From: Matthias Maier Date: Thu, 28 Mar 2013 10:17:03 +0000 (+0000) Subject: CMake: Cleanup X-Git-Tag: v8.0.0~859 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48d6fc7e24a41b1411284e48581da8ef5d3732cb;p=dealii.git CMake: Cleanup git-svn-id: https://svn.dealii.org/trunk@29099 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/cmake/README.cmake b/deal.II/cmake/README.cmake index 24ecbdde72..724cd4d607 100644 --- a/deal.II/cmake/README.cmake +++ b/deal.II/cmake/README.cmake @@ -12,8 +12,10 @@ Contains checks for platform features and compiler bugs and features ./config ======= -Contains configuration templates for installing deal.IIConfig.cmake and for -the c++ template expansion mechanism +Contains configuration templates for + - the project configuration (deal.IIConfig.cmake) + - the legacy Make.global_options mechanism + - the C++ template expansion mechanism (template-arguments) ./configure =========== @@ -34,7 +36,7 @@ Contains Find.cmake modules for finding external libraries ./scripts ========= -Contains script files needed for the build system +Contains script files needed for the build system, notably expand_instantiations ./setup_*.cmake diff --git a/deal.II/cmake/config/CMakeLists.txt b/deal.II/cmake/config/CMakeLists.txt index 4b771f2a12..3b1d006f1a 100644 --- a/deal.II/cmake/config/CMakeLists.txt +++ b/deal.II/cmake/config/CMakeLists.txt @@ -214,7 +214,7 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/template-arguments ${CMAKE_CURRENT_BINARY_DIR}/Make.global_options - DESTINATION common + DESTINATION ${DEAL_II_COMMON_RELDIR} COMPONENT compat_files ) ENDIF() diff --git a/deal.II/cmake/config/Config.cmake.in b/deal.II/cmake/config/Config.cmake.in index f2a47e8d99..46bed777e8 100644 --- a/deal.II/cmake/config/Config.cmake.in +++ b/deal.II/cmake/config/Config.cmake.in @@ -43,6 +43,7 @@ SET(DEAL_II_BUILD_TYPES "@DEAL_II_BUILD_TYPES@") SET(DEAL_II_PATH "@DEAL_II_PATH@") SET(DEAL_II_CMAKE_MACROS_RELDIR "@DEAL_II_CMAKE_MACROS_RELDIR@") +SET(DEAL_II_COMMON_RELDIR "@DEAL_II_COMMON_RELDIR@") SET(DEAL_II_DOCUMENTATION_RELDIR "@DEAL_II_DOCUMENTATION_RELDIR@") SET(DEAL_II_EXAMPLES_RELDIR "@DEAL_II_EXAMPLES_RELDIR@") SET(DEAL_II_EXECUTABLE_RELDIR "@DEAL_II_EXECUTABLE_RELDIR@") diff --git a/deal.II/cmake/scripts/CMakeLists.txt b/deal.II/cmake/scripts/CMakeLists.txt index b27b6cfd04..8f924f22de 100644 --- a/deal.II/cmake/scripts/CMakeLists.txt +++ b/deal.II/cmake/scripts/CMakeLists.txt @@ -44,7 +44,7 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES) INSTALL(TARGETS make_dependencies report_features expand_instantiations RUNTIME - DESTINATION common/scripts + DESTINATION ${DEAL_II_COMMON_RELDIR}/scripts COMPONENT compat_files ) ENDIF() diff --git a/deal.II/cmake/setup_custom_targets.cmake b/deal.II/cmake/setup_custom_targets.cmake index 51000e8024..a348a6dda7 100644 --- a/deal.II/cmake/setup_custom_targets.cmake +++ b/deal.II/cmake/setup_custom_targets.cmake @@ -35,11 +35,11 @@ IF(DEAL_II_COMPONENT_DOCUMENTATION) ENDIF() IF(DEAL_II_COMPONENT_COMPAT_FILES) - ADD_CUSTOM_TARGET(compat_files) - ADD_DEPENDENCIES(compat_files - expand_instantiations - make_dependencies - report_features + ADD_CUSTOM_TARGET(compat_files + DEPENDS + expand_instantiations + make_dependencies + report_features ) ENDIF() diff --git a/deal.II/cmake/setup_deal_ii.cmake b/deal.II/cmake/setup_deal_ii.cmake index 95a32211db..110af8706d 100644 --- a/deal.II/cmake/setup_deal_ii.cmake +++ b/deal.II/cmake/setup_deal_ii.cmake @@ -49,7 +49,7 @@ # DEAL_II_INCLUDE_DIRS # DEAL_II_LIBRARY_DIRS # -# DEAL_II_BUILD_TYPE +# DEAL_II_BUILD_TYPES # DEAL_II_WITH_BUNDLED_DIRECTORY # DEAL_II_WITH_DOC_DIRECTORY # @@ -95,6 +95,7 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES) # The good, old directory structure: # SET_IF_EMPTY(DEAL_II_CMAKE_MACROS_RELDIR "cmake/macros") + SET_IF_EMPTY(DEAL_II_COMMON_RELDIR "common") SET_IF_EMPTY(DEAL_II_DOCUMENTATION_RELDIR "doc") SET_IF_EMPTY(DEAL_II_EXAMPLES_RELDIR "examples") SET_IF_EMPTY(DEAL_II_EXECUTABLE_RELDIR "bin") @@ -107,6 +108,7 @@ ELSE() # obey the FSHS... # SET_IF_EMPTY(DEAL_II_CMAKE_MACROS_RELDIR "share/${DEAL_II_PACKAGE_NAME}/cmake/Macros") + SET_IF_EMPTY(DEAL_II_COMMON_RELDIR "share/${DEAL_II_PACKAGE_NAME}/common") SET_IF_EMPTY(DEAL_II_DOCUMENTATION_RELDIR "share/doc/${DEAL_II_PACKAGE_NAME}/html") SET_IF_EMPTY(DEAL_II_EXAMPLES_RELDIR "share/doc/${DEAL_II_PACKAGE_NAME}/examples") SET_IF_EMPTY(DEAL_II_EXECUTABLE_RELDIR "bin") diff --git a/deal.II/cmake/setup_finalize.cmake b/deal.II/cmake/setup_finalize.cmake index 70e035e5f1..1773ed5f82 100644 --- a/deal.II/cmake/setup_finalize.cmake +++ b/deal.II/cmake/setup_finalize.cmake @@ -57,9 +57,26 @@ ENDFOREACH() # # ########################################################################### -SET(_log "${CMAKE_BINARY_DIR}/summary.log") - -FILE(WRITE ${_log} +SET(_log_detailed "${CMAKE_BINARY_DIR}/detailed.log") +SET(_log_summary "${CMAKE_BINARY_DIR}/summary.log") +FILE(REMOVE ${_log_detailed} ${_log_summary}) + +MACRO(_both) + # Write to both log files: + FILE(APPEND ${_log_detailed} ${ARGN}) + FILE(APPEND ${_log_summary} ${ARGN}) +ENDMACRO() +MACRO(_detailed) + # Only write to detailed.log: + FILE(APPEND ${_log_detailed} ${ARGN}) +ENDMACRO() +MACRO(_summary) + # Only write to summary.log: + FILE(APPEND ${_log_summary} ${ARGN}) +ENDMACRO() + + +_both( "### # # ${DEAL_II_PACKAGE_NAME} configuration: @@ -72,44 +89,41 @@ FILE(WRITE ${_log} # CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} on platform ${CMAKE_SYSTEM_NAME} # ${CMAKE_CXX_COMPILER} # -# Compiler flags used for this build: +" + ) + +_detailed( +"# Compiler flags used for this build: # CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS} " ) IF(CMAKE_BUILD_TYPE MATCHES "Release") - FILE(APPEND ${_log} "# DEAL_II_CXX_FLAGS_RELEASE: ${DEAL_II_CXX_FLAGS_RELEASE}\n") + _detailed("# DEAL_II_CXX_FLAGS_RELEASE: ${DEAL_II_CXX_FLAGS_RELEASE}\n") ENDIF() IF(CMAKE_BUILD_TYPE MATCHES "Debug") - FILE(APPEND ${_log} "# DEAL_II_CXX_FLAGS_DEBUG: ${DEAL_II_CXX_FLAGS_DEBUG}\n") + _detailed("# DEAL_II_CXX_FLAGS_DEBUG: ${DEAL_II_CXX_FLAGS_DEBUG}\n") ENDIF() -FILE(APPEND ${_log} "# CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS}\n") +_detailed("# CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS}\n") IF(CMAKE_BUILD_TYPE MATCHES "Release") - FILE(APPEND ${_log} "# DEAL_II_SHARED_LINKER_FLAGS_RELEASE: ${DEAL_II_SHARED_LINKER_FLAGS_RELEASE}\n") + _detailed("# DEAL_II_SHARED_LINKER_FLAGS_RELEASE: ${DEAL_II_SHARED_LINKER_FLAGS_RELEASE}\n") ENDIF() IF(CMAKE_BUILD_TYPE MATCHES "Debug") - FILE(APPEND ${_log} "# DEAL_II_SHARED_LINKER_FLAGS_DEBUG: ${DEAL_II_SHARED_LINKER_FLAGS_DEBUG}\n") + _detailed("# DEAL_II_SHARED_LINKER_FLAGS_DEBUG: ${DEAL_II_SHARED_LINKER_FLAGS_DEBUG}\n") ENDIF() +_detailed("#\n") IF(NOT DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) - FILE(APPEND ${_log} "#\n# WARNING: DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS is set to OFF\n") + _both("# WARNING: DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS is set to OFF\n") ENDIF() - -FILE(APPEND ${_log} - "#\n# Configured Features (" - ) +_both("# Configured Features (") IF(DEFINED DEAL_II_ALLOW_BUNDLED) - FILE(APPEND ${_log} - "DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED}, " - ) + _both("DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED}, ") ENDIF() IF(DEAL_II_FORCE_AUTODETECTION) - FILE(APPEND ${_log} - "!!! DEAL_II_FORCE_AUTODETECTION=ON !!!, " - ) + _both("!!! DEAL_II_FORCE_AUTODETECTION=ON !!!, ") ENDIF() -FILE(APPEND ${_log} - "DEAL_II_ALLOW_AUTODETECTION = ${DEAL_II_ALLOW_AUTODETECTION}):\n" - ) +_both("DEAL_II_ALLOW_AUTODETECTION = ${DEAL_II_ALLOW_AUTODETECTION}):\n") + # # Cache for quicker access: @@ -130,7 +144,7 @@ FOREACH(_var ${_features}) # FEATURE is enabled STRING(REGEX REPLACE "^DEAL_II_WITH_" "" _feature ${_var}) IF(FEATURE_${_feature}_EXTERNAL_CONFIGURED) - FILE(APPEND ${_log} "# ${_var} set up with external dependencies\n") + _both("# ${_var} set up with external dependencies\n") # # Print the feature configuration: @@ -146,38 +160,41 @@ FOREACH(_var ${_features}) ( (NOT _var2 MATCHES "^(MPI|Boost)") AND _var2 MATCHES "^${_feature}_(INCLUDE_DIRS|LIBRARIES|LINKER_FLAGS)$" ) ) - FILE(APPEND ${_log} "# ${_var2} = ${${_var2}}\n") + _detailed("# ${_var2} = ${${_var2}}\n") ENDIF() ENDFOREACH() ELSEIF(FEATURE_${_feature}_BUNDLED_CONFIGURED) IF(DEAL_II_FORCE_BUNDLED_${_feature}) - FILE(APPEND ${_log} "# ${_var} set up with bundled packages (forced)\n") + _both("# ${_var} set up with bundled packages (forced)\n") ELSE() - FILE(APPEND ${_log} "# ${_var} set up with bundled packages\n") + _both("# ${_var} set up with bundled packages\n") ENDIF() ENDIF() ELSE() # FEATURE is disabled - FILE(APPEND ${_log} "# ( ${_var} = ${${_var}} )\n") + _both("# ( ${_var} = ${${_var}} )\n") ENDIF() ENDFOREACH() -FILE(APPEND ${_log} +_both( "#\n# Component configuration:\n" ) FOREACH(_var ${_components}) IF(_var MATCHES "DEAL_II_COMPONENT") IF(${${_var}}) - FILE(APPEND ${_log} "# ${_var}\n") + _both("# ${_var}\n") STRING(REPLACE "DEAL_II_COMPONENT_" "" _component ${_var}) LIST(APPEND _components ${_component}) ELSE() - FILE(APPEND ${_log} "# ( ${_var} = ${${_var}} )\n") + _both("# ( ${_var} = ${${_var}} )\n") ENDIF() ENDIF() ENDFOREACH() -FILE(APPEND ${_log} - "#\n###" +_summary( + "#\n# Detailed information (compiler flags, feature configuration) can be found in detailed.log\n" ) + +_both("#\n###") + diff --git a/deal.II/source/meshworker/CMakeLists.txt b/deal.II/source/meshworker/CMakeLists.txt index 85ff52b6c4..888296f13e 100644 --- a/deal.II/source/meshworker/CMakeLists.txt +++ b/deal.II/source/meshworker/CMakeLists.txt @@ -15,10 +15,10 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) FILE(GLOB _header - ${CMAKE_SOURCE_DIR}/include/deal.II/mesh_worker/*.h + ${CMAKE_SOURCE_DIR}/include/deal.II/meshworker/*.h ) SET(_src ) -DEAL_II_ADD_LIBRARY(obj_mesh_worker OBJECT ${_src} ${_header}) +DEAL_II_ADD_LIBRARY(obj_meshworker OBJECT ${_src} ${_header})