MACRO(DEAL_II_INITIALIZE_CACHED_VARIABLES)
+ IF(NOT DEAL_II_PROJECT_CONFIG_INCLUDE)
+ MESSAGE(FATAL_ERROR
+ "DEAL_II_INITIALIZE_CACHED_VARIABLES can only be called in external "
+ "projects after the inclusion of deal.IIConfig.cmake. It is not "
+ "intended for internal use."
+ )
+ ENDIF()
+
SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING
"Choose the type of build, options are: Debug, Release"
)
MACRO(DEAL_II_SETUP_TARGET target)
+ IF(NOT DEAL_II_PROJECT_CONFIG_INCLUDE)
+ MESSAGE(FATAL_ERROR
+ "DEAL_II_SETUP_TARGET can only be called in external projects after "
+ "the inclusion of deal.IIConfig.cmake. It is not intended for "
+ "internal use."
+ )
+ ENDIF()
+
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
SET_TARGET_PROPERTIES(${target} PROPERTIES
"${DEAL_II_USER_DEFINITIONS_RELEASE}"
)
- IF(NOT "${DEAL_II_LIBRARIES_DEBUG}${DEAL_II_EXTERNAL_LIBRARIES_DEBUG}" STREQUAL "")
- TARGET_LINK_LIBRARIES(${target}
- debug
- ${DEAL_II_LIBRARIES_DEBUG}
- ${DEAL_II_EXTERNAL_LIBRARIES_DEBUG}
- )
- ENDIF()
-
- IF(NOT "${DEAL_II_LIBRARIES_RELEASE}${DEAL_II_EXTERNAL_LIBRARIES_RELEASE}" STREQUAL "")
- TARGET_LINK_LIBRARIES(${target}
- optimized
- ${DEAL_II_LIBRARIES_RELEASE}
- ${DEAL_II_EXTERNAL_LIBRARIES_RELEASE}
- )
- ENDIF()
-
- IF(NOT "${DEAL_II_EXTERNAL_LIBRARIES}" STREQUAL "")
TARGET_LINK_LIBRARIES(${target}
- general
+ ${DEAL_II_LIBRARIES}
${DEAL_II_EXTERNAL_LIBRARIES}
)
- ENDIF()
ENDMACRO()
"${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}/${DEAL_II_LIBRARY_NAME_DEBUG}"
)
LIST(APPEND DEAL_II_LIBRARIES
- DEBUG
+ debug
"${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}/${DEAL_II_LIBRARY_NAME_DEBUG}"
)
"${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}/${DEAL_II_LIBRARY_NAME_RELEASE}"
)
LIST(APPEND DEAL_II_LIBRARIES
- RELEASE
+ optimized
"${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}/${DEAL_II_LIBRARY_NAME_RELEASE}"
)
LIST(APPEND DEAL_II_BUILD_TYPES "RELEASE")
ENDIF()
-#
-# TODO: Remove this hack.
-#
FOREACH(build ${DEAL_II_BUILD_TYPES})
STRING(TOLOWER "${build}" build_lowercase)
FILE(REMOVE
# Configure and install the cmake project configuration:
#
+ SET(CONFIG_EXTERNAL_LIBRARIES
+ general
+ ${DEAL_II_EXTERNAL_LIBRARIES}
+ )
+
+ IF(CMAKE_BUILD_TYPE MATCHES "Debug")
+ SET(CONFIG_EXTERNAL_LIBRARIES_DEBUG
+ ${DEAL_II_EXTERNAL_LIBRARIES}
+ ${DEAL_II_EXTERNAL_LIBRARIES_DEBUG}
+ )
+ LIST(APPEND CONFIG_LIBRARIES
+ debug
+ ${DEAL_II_EXTERNAL_LIBRARIES_DEBUG}
+ )
+ ENDIF()
+
+ IF(CMAKE_BUILD_TYPE MATCHES "Release")
+ SET(CONFIG_EXTERNAL_LIBRARIES_RELEASE
+ ${DEAL_II_EXTERNAL_LIBRARIES}
+ ${DEAL_II_EXTERNAL_LIBRARIES_RELEASE}
+ )
+ LIST(APPEND CONFIG_LIBRARIES
+ optimized
+ ${DEAL_II_EXTERNAL_LIBRARIES_RELEASE}
+ )
+ ENDIF()
+
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
# The deal.II project configuration file
#
+SET(DEAL_II_PROJECT_CONFIG_INCLUDE TRUE)
+
#
# General information
SET(DEAL_II_LINKER_FLAGS_DEBUG "${DEAL_II_SHARED_LINKER_FLAGS_DEBUG}")
SET(DEAL_II_LINKER_FLAGS_RELEASE "${DEAL_II_SHARED_LINKER_FLAGS_RELEASE}")
+SET(DEAL_II_USER_DEFINITIONS "${DEAL_II_USER_DEFINITIONS}")
+SET(DEAL_II_USER_DEFINITIONS_DEBUG "${DEAL_II_USER_DEFINITIONS_DEBUG}")
+SET(DEAL_II_USER_DEFINITIONS_RELEASE "${DEAL_II_USER_DEFINITIONS_RELEASE}")
+
+
#
-# Information on where to find the deal.II libraries and headers
+# Information about the the deal.II libraries and headers
#
SET(DEAL_II_INCLUDE_DIRS "${DEAL_II_INCLUDE_DIRS}")
+
SET(DEAL_II_LIBRARIES "${DEAL_II_LIBRARIES}")
SET(DEAL_II_LIBRARIES_DEBUG "${DEAL_II_LIBRARIES_DEBUG}")
SET(DEAL_II_LIBRARIES_RELEASE "${DEAL_II_LIBRARIES_RELEASE}")
SET(DEAL_II_EXTERNAL_INCLUDE_DIRS "${DEAL_II_USER_INCLUDE_DIRS}")
-SET(DEAL_II_EXTERNAL_LIBRARIES "${DEAL_II_EXTERNAL_LIBRARIES}")
-SET(DEAL_II_EXTERNAL_LIBRARIES_DEBUG "${DEAL_II_EXTERNAL_LIBRARIES_DEBUG}")
-SET(DEAL_II_EXTERNAL_LIBRARIES_RELEASE "${DEAL_II_EXTERNAL_LIBRARIES_RELEASE}")
-
-SET(DEAL_II_USER_DEFINITIONS "${DEAL_II_USER_DEFINITIONS}")
-SET(DEAL_II_USER_DEFINITIONS_DEBUG "${DEAL_II_USER_DEFINITIONS_DEBUG}")
-SET(DEAL_II_USER_DEFINITIONS_RELEASE "${DEAL_II_USER_DEFINITIONS_RELEASE}")
+SET(DEAL_II_EXTERNAL_LIBRARIES "${CONFIG_EXTERNAL_LIBRARIES}")
+SET(DEAL_II_EXTERNAL_LIBRARIES_DEBUG "${CONFIG_EXTERNAL_LIBRARIES_DEBUG}")
+SET(DEAL_II_EXTERNAL_LIBRARIES_RELEASE "${CONFIG_EXTERNAL_LIBRARIES_RELEASE}")
#