From: Matthias Maier Date: Fri, 22 Apr 2016 07:00:54 +0000 (-0500) Subject: CMake: Export a number of INTERFACE target information X-Git-Tag: v8.5.0-rc1~1081^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d96592b9fe93be35ccfd0e03f4d40aa86e99db47;p=dealii.git CMake: Export a number of INTERFACE target information --- diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index b7bb5014b0..cd69c0e836 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -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 + $ + $ + # cmake correctly calculates an install prefix relative to + # ${DEAL_II_PROJECT_CONFIG_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 + $ + $ + ) + 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