]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add deal.IIFeatureConfig.cmake which contains detailed info about configured features
authorDenis Davydov <davydden@gmail.com>
Mon, 29 May 2017 09:39:08 +0000 (11:39 +0200)
committerDenis Davydov <davydden@gmail.com>
Mon, 29 May 2017 14:21:17 +0000 (16:21 +0200)
cmake/config/CMakeLists.txt
cmake/config/Config.cmake.in
cmake/setup_write_config.cmake
doc/news/changes/minor/20170529DenisDavydov [new file with mode: 0644]

index 1d094e7c3463bb67a920dae9fa9b20509e50d307..3169f0edba60dd76be44b021cd3bafb5c5b16e99 100644 (file)
@@ -159,6 +159,7 @@ CONFIGURE_FILE(
 INSTALL(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
   ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}ConfigVersion.cmake
+  ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}FeatureConfig.cmake
   DESTINATION ${DEAL_II_PROJECT_CONFIG_RELDIR}
   COMPONENT library
   )
index 7900b9f6307fa3436a2c6f5c5b19f8db350dccaf..45a02046ca1207a26c67d6c879c18649034bdfe1 100644 (file)
@@ -174,7 +174,7 @@ SET(DEAL_II_LIBRARIES "@CONFIG_LIBRARIES@")
 
 
 #
-# Information about library targets
+# Information about library targets and feature configuration
 #
 
 # The library targets file:
@@ -188,3 +188,6 @@ SET(DEAL_II_TARGET_RELEASE "@CONFIG_TARGET_RELEASE@")
 
 # Full list of targets with "debug" and "optimized" keywords for easy use with TARGET_LINK_LIBRARIES:
 SET(DEAL_II_TARGET "@CONFIG_TARGET@")
+
+# The feature configuration file:
+SET(DEAL_II_FEATURE_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}FeatureConfig.cmake")
index daafa3e18b129fa1ec63150e72860eb3b0d777f2..61c2fe6b66f1d0d6f3f64cec4b69083b79217ff8 100644 (file)
@@ -41,7 +41,8 @@ FILE(WRITE ${CMAKE_BINARY_DIR}/revision.log
 
 SET(_log_detailed "${CMAKE_BINARY_DIR}/detailed.log")
 SET(_log_summary  "${CMAKE_BINARY_DIR}/summary.log")
-FILE(REMOVE ${_log_detailed} ${_log_summary})
+SET(_log_feature "${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}FeatureConfig.cmake")
+FILE(REMOVE ${_log_detailed} ${_log_summary} ${_log_feature})
 
 MACRO(_both)
   # Write to both log files:
@@ -56,6 +57,10 @@ MACRO(_summary)
   # Only write to summary.log:
   FILE(APPEND ${_log_summary} "${ARGN}")
 ENDMACRO()
+MACRO(_featurelog)
+  # Only write to deal.IIFeatureConfig.cmake:
+  FILE(APPEND ${_log_feature} "${ARGN}")
+ENDMACRO()
 
 _both(
 "###
@@ -211,6 +216,7 @@ FOREACH(_feature ${_deal_ii_features_sorted})
     #
     IF(NOT "${${_feature}_DIR}" STREQUAL "")
       _detailed("#            ${_feature}_DIR = ${${_feature}_DIR}\n")
+      _featurelog("SET(DEAL_II_${_feature}_DIR \"${${_feature}_DIR}\")\n")
     ENDIF()
 
     #
@@ -222,6 +228,7 @@ FOREACH(_feature ${_deal_ii_features_sorted})
       )
       IF(DEFINED ${_feature}_${_var2})
         _detailed("#            ${_feature}_${_var2} = ${${_feature}_${_var2}}\n")
+        _featurelog("SET(DEAL_II_${_feature}_${_var2} \"${${_feature}_${_var2}}\")\n")
       ENDIF()
     ENDFOREACH()
   ELSE()
diff --git a/doc/news/changes/minor/20170529DenisDavydov b/doc/news/changes/minor/20170529DenisDavydov
new file mode 100644 (file)
index 0000000..6c719a6
--- /dev/null
@@ -0,0 +1,7 @@
+New: deal.IIFeatureConfig.cmake will contain detailed information about
+feature configuration and is installed along with other CMake files.
+These variables can be loaded by calling INCLUDE(${DEAL_II_FEATURE_CONFIG}).
+This is useful when users want to link in additional parts of dependencies, not
+required by deal.II (i.e. filesystem library from Boost package).
+<br>
+(Denis Davydov and Matthias Maier, 2017/05/29)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.