]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Export a number of INTERFACE target information
authorMatthias Maier <tamiko@43-1.org>
Fri, 22 Apr 2016 07:00:54 +0000 (02:00 -0500)
committerMatthias Maier <tamiko@43-1.org>
Fri, 22 Apr 2016 07:00:54 +0000 (02:00 -0500)
source/CMakeLists.txt

index b7bb5014b0757f5efc88bf0a5ca917317e046d59..cd69c0e8364186fbd104514e79775413048d60c8 100644 (file)
@@ -81,6 +81,47 @@ FOREACH(build ${DEAL_II_BUILD_TYPES})
     RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR}"
     )
 
+  IF("${CMAKE_VERSION}" VERSION_GREATER "3.0")
+    #
+    # Populate the full target interface variables for newer cmake
+    # versions:
+    #
+
+    # FIXME: There is no INTERFACE_LINK_FLAGS yet... *sigh*
+
+    SET_PROPERTY(TARGET ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
+      PROPERTY INTERFACE_INCLUDE_DIRECTORIES
+        $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include/>
+        $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include/>
+        # cmake correctly calculates an install prefix relative to
+        # ${DEAL_II_PROJECT_CONFIG_RELDIR}!
+        $<INSTALL_INTERFACE:${DEAL_II_INCLUDE_RELDIR}>
+      )
+    IF(NOT "${DEAL_II_BUNDLED_INCLUDE_DIRS}" STREQUAL "")
+      SET_PROPERTY(TARGET ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
+        APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
+          $<BUILD_INTERFACE:${DEAL_II_BUNDLED_INCLUDE_DIRS}>
+          $<INSTALL_INTERFACE:${DEAL_II_INCLUDE_RELDIR}/deal.II/bundled>
+        )
+    ENDIF()
+    SET_PROPERTY(TARGET ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
+      APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
+        ${DEAL_II_USER_INCLUDE_DIRS}
+      )
+
+    SET_PROPERTY(TARGET ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
+      PROPERTY INTERFACE_COMPILE_DEFINITIONS
+        ${DEAL_II_DEFINITIONS}
+        ${DEAL_II_DEFINITIONS_${build}}
+        )
+
+    SET(_flags "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${build}}")
+    SEPARATE_ARGUMENTS(_flags)
+    SET_PROPERTY(TARGET ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
+      PROPERTY INTERFACE_COMPILE_OPTIONS ${_flags}
+      )
+  ENDIF()
+
   IF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
     SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
       PROPERTIES

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.