]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Also export feature versions in deal.IIConfig.cmake and Make.global_options
authorMatthias Maier <tamiko@43-1.org>
Mon, 23 Mar 2015 12:01:32 +0000 (13:01 +0100)
committerMatthias Maier <tamiko@43-1.org>
Mon, 23 Mar 2015 12:01:32 +0000 (13:01 +0100)
With this commit the version string of enabled features (with version
information) is also exported to deal.IIConfig.cmake and
Make.global_options

cmake/config/CMakeLists.txt

index b599339d9fdeafd34ce5d6e624b4f406d922f4ff..96971a4ea73e700274794a7fc37afa2476efac9a 100644 (file)
@@ -103,10 +103,9 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES})
     SET(_type "STATIC")
   ENDIF()
 
-  SET(_reldir "\${DEAL_II_LIBRARY_RELDIR}")
-  
+  SET(_name "${CMAKE_${_type}_LIBRARY_PREFIX}${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX}${CMAKE_${_type}_LIBRARY_SUFFIX}")
   SET(CONFIG_LIBRARIES_${_build}
-    "\${DEAL_II_PATH}/${_reldir}/${CMAKE_${_type}_LIBRARY_PREFIX}${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX}${CMAKE_${_type}_LIBRARY_SUFFIX}"
+    "\${DEAL_II_PATH}/${DEAL_II_LIBRARY_RELDIR}/${_name}"
     ${DEAL_II_LIBRARIES_${_build}}
     ${DEAL_II_LIBRARIES}
     )
@@ -205,7 +204,7 @@ SET(_files
   )
 SET(_makefiles
   ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/Make.global_options
-  ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/Make.global_options
+  ${CMAKE_CURRENT_BINARY_DIR}/Make.global_options
   )
 FOREACH(_file ${_files} ${_makefiles})
   FILE(APPEND ${_file} "\n\n#\n# Feature configuration:\n#\n\n")
@@ -214,12 +213,25 @@ ENDFOREACH()
 GET_CMAKE_PROPERTY(res VARIABLES)
 FOREACH(var ${res})
   IF(var MATCHES "DEAL_II_WITH")
+    STRING(REPLACE "DEAL_II_WITH_" "" _name ${var})
+
     FOREACH(_file ${_files})
       FILE(APPEND ${_file} "SET(${var} ${${var}})\n")
+      IF(${var} AND NOT "${${_name}_VERSION}" STREQUAL "")
+        FILE(APPEND ${_file}
+          "SET(DEAL_II_${_name}_VERSION \"${${_name}_VERSION}\")\n"
+          )
+      ENDIF()
     ENDFOREACH()
+
     FOREACH(_file ${_makefiles})
       IF(${var})
         FILE(APPEND ${_file} "${var} = true\n")
+        IF(NOT "${${_name}_VERSION}" STREQUAL "")
+          FILE(APPEND ${_file}
+            "DEAL_II_${_name}_VERSION = ${${_name}_VERSION}\n"
+            )
+        ENDIF()
       ELSE()
         FILE(APPEND ${_file} "${var} = false\n")
       ENDIF()

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.