From: Matthias Maier
Date: Thu, 26 Mar 2015 13:48:25 +0000 (+0100)
Subject: CMake: Relocate testsuite macros and scripts to ./cmake/macros
X-Git-Tag: v8.3.0-rc1~353^2~6
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8eb17b388e1be1d5300853c7d6b88558deaae758;p=dealii.git
CMake: Relocate testsuite macros and scripts to ./cmake/macros
This commit relocates all testsuite macros back to cmake/macros and
the run_test.cmake and normalize.pl script to cmake/scripts. Further, all
of those are copied to the build directory and installed appropriately.
---
diff --git a/cmake/config/CMakeLists.txt b/cmake/config/CMakeLists.txt
index 96971a4ea7..534267b88c 100644
--- a/cmake/config/CMakeLists.txt
+++ b/cmake/config/CMakeLists.txt
@@ -38,7 +38,7 @@ CONFIGURE_FILE( # for binary dir:
########################################################################
# #
-# Setup and install the convenience macros: #
+# Setup and install cmake macros: #
# #
########################################################################
@@ -47,12 +47,14 @@ SET(_macros
${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_invoke_autopilot.cmake
${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_setup_target.cmake
${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_query_git_information.cmake
+ ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_add_test.cmake
+ ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_pickup_tests.cmake
)
FILE(COPY ${_macros}
- DESTINATION ${CMAKE_BINARY_DIR}/${DEAL_II_CMAKE_MACROS_RELDIR}
+ DESTINATION ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/macros
)
INSTALL(FILES ${_macros}
- DESTINATION ${DEAL_II_CMAKE_MACROS_RELDIR}
+ DESTINATION ${DEAL_II_SHARE_RELDIR}/macros
COMPONENT library
)
diff --git a/cmake/config/Config.cmake.in b/cmake/config/Config.cmake.in
index a80aeee0d2..a1696dd3d3 100644
--- a/cmake/config/Config.cmake.in
+++ b/cmake/config/Config.cmake.in
@@ -49,15 +49,14 @@ SET(DEAL_II_BUILD_TYPES "@DEAL_II_BUILD_TYPES@")
# Information about the project location
#
-SET(DEAL_II_CMAKE_MACROS_RELDIR "@DEAL_II_CMAKE_MACROS_RELDIR@")
-SET(DEAL_II_SHARE_RELDIR "@DEAL_II_SHARE_RELDIR@")
-SET(DEAL_II_DOCREADME_RELDIR "@DEAL_II_DOCREADME_RELDIR@")
SET(DEAL_II_DOCHTML_RELDIR "@DEAL_II_DOCHTML_RELDIR@")
+SET(DEAL_II_DOCREADME_RELDIR "@DEAL_II_DOCREADME_RELDIR@")
SET(DEAL_II_EXAMPLES_RELDIR "@DEAL_II_EXAMPLES_RELDIR@")
SET(DEAL_II_EXECUTABLE_RELDIR "@DEAL_II_EXECUTABLE_RELDIR@")
SET(DEAL_II_INCLUDE_RELDIR "@DEAL_II_INCLUDE_RELDIR@")
SET(DEAL_II_LIBRARY_RELDIR "@DEAL_II_LIBRARY_RELDIR@")
SET(DEAL_II_PROJECT_CONFIG_RELDIR "@DEAL_II_PROJECT_CONFIG_RELDIR@")
+SET(DEAL_II_SHARE_RELDIR "@DEAL_II_SHARE_RELDIR@")
#
# Determine DEAL_II_PATH from CMAKE_CURRENT_LIST_DIR:
@@ -96,7 +95,7 @@ ENDIF()
#
FILE(GLOB _macro_files
- "${DEAL_II_PATH}/${DEAL_II_CMAKE_MACROS_RELDIR}/macro_deal_ii*.cmake"
+ "${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/macros/*.cmake"
)
FOREACH(file ${_macro_files})
IF(NOT ${DEAL_II_PACKAGE_NAME}_FIND_QUIETLY)
diff --git a/cmake/config/Make.global_options.in b/cmake/config/Make.global_options.in
index 697b0faaea..86b7616989 100644
--- a/cmake/config/Make.global_options.in
+++ b/cmake/config/Make.global_options.in
@@ -48,7 +48,6 @@ DEAL_II_BUILD_TYPES = @MAKEFILE_BUILD_TYPES@
# Information about the project location
#
-DEAL_II_CMAKE_MACROS_RELDIR = @DEAL_II_CMAKE_MACROS_RELDIR@
DEAL_II_SHARE_RELDIR = @DEAL_II_SHARE_RELDIR@
DEAL_II_DOCREADME_RELDIR = @DEAL_II_DOCREADME_RELDIR@
DEAL_II_DOCHTML_RELDIR = @DEAL_II_DOCHTML_RELDIR@
diff --git a/tests/macro_add_test.cmake b/cmake/macros/macro_deal_ii_add_test.cmake
similarity index 96%
rename from tests/macro_add_test.cmake
rename to cmake/macros/macro_deal_ii_add_test.cmake
index 654897969a..8862908f46 100644
--- a/tests/macro_add_test.cmake
+++ b/cmake/macros/macro_deal_ii_add_test.cmake
@@ -45,7 +45,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
IF(NOT DEAL_II_PROJECT_CONFIG_INCLUDED)
MESSAGE(FATAL_ERROR
- "\nDEAL_II_ADD_TEST can only be called in external test subprojects after "
+ "\nDEAL_II_ADD_TEST can only be called in external (test sub-) projects after "
"the inclusion of deal.IIConfig.cmake. It is not intended for "
"internal use.\n\n"
)
@@ -191,14 +191,14 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
&& echo "${_test_full}: RUN failed. ------ Partial output:"
&& cat ${_test_directory}/failing_output
&& exit 1)
- COMMAND
- ${PERL_EXECUTABLE} -pi ${DEAL_II_SOURCE_DIR}/tests/normalize.pl
- ${_test_directory}/output
+ COMMAND ${PERL_EXECUTABLE}
+ -pi ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/normalize.pl
+ ${_test_directory}/output
WORKING_DIRECTORY
${_test_directory}
DEPENDS
${_target}
- ${DEAL_II_SOURCE_DIR}/tests/normalize.pl
+ ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/normalize.pl
)
ADD_CUSTOM_COMMAND(OUTPUT ${_test_directory}/diff
COMMAND
@@ -256,7 +256,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
-DEXPECT=${_expect}
-DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
-DGUARD_FILE=${CMAKE_CURRENT_BINARY_DIR}/${_target}/interrupt_guard.cc
- -P ${DEAL_II_SOURCE_DIR}/tests/run_test.cmake
+ -P ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.cmake
WORKING_DIRECTORY ${_test_directory}
)
SET_TESTS_PROPERTIES(${_test_full} PROPERTIES
diff --git a/tests/macro_pickup_tests.cmake b/cmake/macros/macro_deal_ii_pickup_tests.cmake
similarity index 100%
rename from tests/macro_pickup_tests.cmake
rename to cmake/macros/macro_deal_ii_pickup_tests.cmake
diff --git a/cmake/scripts/CMakeLists.txt b/cmake/scripts/CMakeLists.txt
index 03f5bfbddd..3feceadd95 100644
--- a/cmake/scripts/CMakeLists.txt
+++ b/cmake/scripts/CMakeLists.txt
@@ -18,3 +18,15 @@ SET_TARGET_PROPERTIES(expand_instantiations_exe PROPERTIES
OUTPUT_NAME expand_instantiations
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR}
)
+
+SET(_scripts
+ ${CMAKE_CURRENT_SOURCE_DIR}/normalize.pl
+ ${CMAKE_CURRENT_SOURCE_DIR}/run_test.cmake
+ )
+FILE(COPY ${_scripts}
+ DESTINATION ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/scripts
+ )
+INSTALL(FILES ${_scripts}
+ DESTINATION ${DEAL_II_SHARE_RELDIR}/scripts
+ COMPONENT library
+ )
diff --git a/tests/normalize.pl b/cmake/scripts/normalize.pl
similarity index 100%
rename from tests/normalize.pl
rename to cmake/scripts/normalize.pl
diff --git a/tests/run_test.cmake b/cmake/scripts/run_test.cmake
similarity index 100%
rename from tests/run_test.cmake
rename to cmake/scripts/run_test.cmake
diff --git a/cmake/setup_deal_ii.cmake b/cmake/setup_deal_ii.cmake
index 30c5889cb5..1450a76cd8 100644
--- a/cmake/setup_deal_ii.cmake
+++ b/cmake/setup_deal_ii.cmake
@@ -47,7 +47,6 @@
# DEAL_II_LIBRARY_RELDIR *)
# DEAL_II_PROJECT_CONFIG_RELDIR *)
# DEAL_II_SHARE_RELDIR *)
-# DEAL_II_CMAKE_MACROS_RELDIR *)
# DEAL_II_DOCREADME_RELDIR *)
# DEAL_II_DOCHTML_RELDIR *)
# DEAL_II_EXAMPLES_RELDIR *)
@@ -124,7 +123,6 @@ SET_IF_EMPTY(DEAL_II_INCLUDE_RELDIR "include")
SET_IF_EMPTY(DEAL_II_LIBRARY_RELDIR "lib${LIB_SUFFIX}")
SET_IF_EMPTY(DEAL_II_PROJECT_CONFIG_RELDIR "${DEAL_II_LIBRARY_RELDIR}/cmake/${DEAL_II_PROJECT_CONFIG_NAME}")
SET_IF_EMPTY(DEAL_II_SHARE_RELDIR "share/${DEAL_II_PACKAGE_NAME}")
-SET_IF_EMPTY(DEAL_II_CMAKE_MACROS_RELDIR "${DEAL_II_SHARE_RELDIR}/cmake")
#
# ... but install the documentation into prominent places:
#
diff --git a/doc/news/changes.h b/doc/news/changes.h
index aca830aecd..e5c6a862aa 100644
--- a/doc/news/changes.h
+++ b/doc/news/changes.h
@@ -38,6 +38,13 @@ inconvenience this causes.
+ - Removed: The CMake configuration does not use the variable
+
DEAL_II_CMAKE_MACROS_RELDIR
any more. Instead, the fixed
+ location ${DEAL_II_SHARE_RELDIR}/macros
is used
+ unconditionally
+
+ (Matthias Maier, 2015/03/26)
+
- Changed: The TrilinosWrappers::SparseMatrix::clear_row() function used
to call TrilinosWrappers::SparseMatrix::compress() before doing its work,
but this is neither efficient nor safe. You will now have to do this
diff --git a/doc/users/cmake.html b/doc/users/cmake.html
index abe200fdb7..113aa28f7c 100644
--- a/doc/users/cmake.html
+++ b/doc/users/cmake.html
@@ -921,7 +921,6 @@ DEAL_II_INCLUDE_RELDIR
DEAL_II_LIBRARY_RELDIR
DEAL_II_PROJECT_CONFIG_RELDIR
DEAL_II_SHARE_RELDIR
-DEAL_II_CMAKE_MACROS_RELDIR
DEAL_II_DOCREADME_RELDIR
DEAL_II_DOCHTML_RELDIR
DEAL_II_EXAMPLES_RELDIR
diff --git a/doc/users/cmakelists.html b/doc/users/cmakelists.html
index 0a9869971a..1beb81588d 100644
--- a/doc/users/cmakelists.html
+++ b/doc/users/cmakelists.html
@@ -731,7 +731,6 @@ DEAL_II_BUILD_TYPES - an all caps list of available configurations,
#
DEAL_II_PATH
-DEAL_II_CMAKE_MACROS_RELDIR
DEAL_II_SHARE_RELDIR
DEAL_II_DOCREADME_RELDIR
DEAL_II_DOCHTML_RELDIR
diff --git a/doc/users/config.sample b/doc/users/config.sample
index fd45b09d1e..d45cac19f0 100644
--- a/doc/users/config.sample
+++ b/doc/users/config.sample
@@ -626,10 +626,6 @@
# "Library suffix for the release library"
# )
#
-# SET(DEAL_II_CMAKE_MACROS_RELDIR "cmake/macros" CACHE STRING
-# "Relative installation directory for macros"
-# )
-#
# SET(DEAL_II_DOCHTML_RELDIR "doc" CACHE STRING
# "Relative installation directory for html documentation"
# )
diff --git a/tests/a-framework/CMakeLists.txt b/tests/a-framework/CMakeLists.txt
index 3f4f7fa5ac..73bbb73385 100644
--- a/tests/a-framework/CMakeLists.txt
+++ b/tests/a-framework/CMakeLists.txt
@@ -23,7 +23,7 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES})
ADD_TEST(NAME ${_test}
COMMAND ${CMAKE_COMMAND} -DTRGT=${_target} -DTEST=${_test}
-DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR} -DEXPECT=CONFIGURE
- -P ${DEAL_II_SOURCE_DIR}/tests/run_test.cmake
+ -P ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
SET_TESTS_PROPERTIES(${_test} PROPERTIES
diff --git a/tests/all-headers/CMakeLists.txt b/tests/all-headers/CMakeLists.txt
index b29d103c71..0597365743 100644
--- a/tests/all-headers/CMakeLists.txt
+++ b/tests/all-headers/CMakeLists.txt
@@ -1,6 +1,6 @@
## ---------------------------------------------------------------------
##
-## Copyright (C) 2013 - 2014 by the deal.II authors
+## Copyright (C) 2013 - 2015 by the deal.II authors
##
## This file is part of the deal.II library.
##
@@ -87,7 +87,7 @@ FOREACH(_header ${_headers})
COMMAND ${CMAKE_COMMAND} -DTRGT=${_target}.build -DTEST=${_test}
-DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
-DGUARD_FILE=${CMAKE_CURRENT_BINARY_DIR}/${_target}_interrupt_guard.cc
- -P ${DEAL_II_SOURCE_DIR}/tests/run_test.cmake
+ -P ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
SET_TESTS_PROPERTIES(${_test} PROPERTIES
diff --git a/tests/build_tests/CMakeLists.txt b/tests/build_tests/CMakeLists.txt
index 867985d49c..04cce5bc90 100644
--- a/tests/build_tests/CMakeLists.txt
+++ b/tests/build_tests/CMakeLists.txt
@@ -1,6 +1,6 @@
## ---------------------------------------------------------------------
##
-## Copyright (C) 2013 - 2014 by the deal.II authors
+## Copyright (C) 2013 - 2015 by the deal.II authors
##
## This file is part of the deal.II library.
##
@@ -181,7 +181,7 @@ FOREACH(_step_full ${_steps})
COMMAND ${CMAKE_COMMAND} -DTRGT=${_target} -DTEST=${_test}
-DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
-DGUARD_FILE=${_step_dir}/interrupt_guard
- -P ${DEAL_II_SOURCE_DIR}/tests/run_test.cmake
+ -P ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
SET_TESTS_PROPERTIES(${_test} PROPERTIES
diff --git a/tests/quick_tests/CMakeLists.txt b/tests/quick_tests/CMakeLists.txt
index 3b70b91423..33e256cd6e 100644
--- a/tests/quick_tests/CMakeLists.txt
+++ b/tests/quick_tests/CMakeLists.txt
@@ -1,6 +1,6 @@
## ---------------------------------------------------------------------
##
-## Copyright (C) 2013 - 2014 by the deal.II authors
+## Copyright (C) 2013 - 2015 by the deal.II authors
##
## This file is part of the deal.II library.
##
@@ -67,7 +67,7 @@ MACRO(make_quicktest test_basename build_name mpi_run)
ADD_TEST(NAME ${_target}
COMMAND ${CMAKE_COMMAND} -DTRGT=${_target}.run -DTEST=${_target}
-DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
- -P ${CMAKE_SOURCE_DIR}/tests/run_test.cmake
+ -P ${CMAKE_SOURCE_DIR}/cmake/scripts/run_test.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
SET_TESTS_PROPERTIES(${_target} PROPERTIES LABEL "sanity checks")
diff --git a/tests/setup_testsubproject.cmake b/tests/setup_testsubproject.cmake
index d1c63d07ba..4488e3d4af 100644
--- a/tests/setup_testsubproject.cmake
+++ b/tests/setup_testsubproject.cmake
@@ -41,7 +41,6 @@ FOREACH(_var
SET(${_var} ${${_var}})
ENDFOREACH()
-
#
# Load all macros:
#
@@ -50,9 +49,6 @@ FOREACH(_file ${_macro_files})
INCLUDE(${_file})
ENDFOREACH()
-INCLUDE(${DEAL_II_SOURCE_DIR}/tests/macro_add_test.cmake)
-INCLUDE(${DEAL_II_SOURCE_DIR}/tests/macro_pickup_tests.cmake)
-
#
# Pick up values from environment:
#