COMPONENT library
PATTERN ".svn" EXCLUDE
)
- FILE(APPEND ${CMAKE_BINARY_DIR}${C\n"MAKE_FILES_DIRECTORY}/deal_ii_source_includes
++ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_source_includes
+ "${BOOST_FOLDER}/include\n"
+ )
ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/serialization/src)
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE
)
- FILE(APPEND ${CMAKE_BINARY_DIR}${C\n"MAKE_FILES_DIRECTORY}/deal_ii_source_includes
++ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_source_includes
+ "${TBB_FOLDER}/include\n"
+ )
ADD_SUBDIRECTORY(${TBB_FOLDER}/src)
ENDIF()
#
# Configure the template-arguments file
#
-CONFIGURE_FILE(
+CONFIGURE_FILE( # for binary dir:
${CMAKE_CURRENT_SOURCE_DIR}/template-arguments.in
- ${CMAKE_CURRENT_BINARY_DIR}/template-arguments
+ ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/template-arguments
)
- CONFIGURE_FILE( # for installation:
- ${CMAKE_CURRENT_SOURCE_DIR}/template-arguments.in
- ${CMAKE_CURRENT_BINARY_DIR}/template-arguments
- )
########################################################################
)
ENDFOREACH()
-SET(CONFIG_INCLUDE_DIRS
+#
+# For binary dir:
+#
- SET(CONFIG_INCLUDE_DIRS
- \${DEAL_II_PATH}/\${DEAL_II_INCLUDE_RELDIR}
- \${DEAL_II_PATH}/\${DEAL_II_INCLUDE_RELDIR}/deal.II
++SET(CONFIG_INCLUDE_DIRS_BINARY
++ \${DEAL_II_PATH}/include
++ \${DEAL_II_PATH}/include/deal.II
+ ${CMAKE_SOURCE_DIR}/include/
+ ${CMAKE_SOURCE_DIR}/include/deal.II
+ ${deal_ii_source_includes}
+ ${DEAL_II_USER_INCLUDE_DIRS}
+ )
- CONFIGURE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
- ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
- @ONLY
- )
-
+#
+# For installation:
+#
- SET(CONFIG_INCLUDE_DIRS
++SET(CONFIG_INCLUDE_DIRS_INSTALLATION
\${DEAL_II_PATH}/\${DEAL_II_INCLUDE_RELDIR}
\${DEAL_II_PATH}/\${DEAL_II_INCLUDE_RELDIR}/deal.II
\${DEAL_II_PATH}/\${DEAL_II_INCLUDE_RELDIR}/deal.II/bundled
${DEAL_II_USER_INCLUDE_DIRS}
)
-
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
-- ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
++ ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
@ONLY
)
--
#
# Append feature configuration:
#
- FOREACH(_file
-
-SET(_file ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake)
++SET(_file
+ ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
- ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
++ )
+ FILE(APPEND ${_file}
+ "\n\n#\n# Feature configuration:\n#\n\n"
)
-GET_CMAKE_PROPERTY(res VARIABLES)
-FOREACH(var ${res})
- IF(var MATCHES "DEAL_II_WITH")
- FILE(APPEND ${_file}
- "SET(${var} ${${var}})\n"
- )
- ENDIF()
+ FILE(APPEND ${_file}
+ "\n\n#\n# Feature configuration:\n#\n\n"
+ )
+ GET_CMAKE_PROPERTY(res VARIABLES)
+ FOREACH(var ${res})
+ IF(var MATCHES "DEAL_II_WITH")
+ FILE(APPEND ${_file}
+ "SET(${var} ${${var}})\n"
+ )
+ ENDIF()
+ ENDFOREACH()
ENDFOREACH()
--
- CONFIGURE_FILE( # for binary dir:
+ CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/ConfigVersion.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}ConfigVersion.cmake
+ ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}ConfigVersion.cmake
@ONLY
)
- CONFIGURE_FILE( # for installation:
- ${CMAKE_CURRENT_SOURCE_DIR}/ConfigVersion.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}ConfigVersion.cmake
- @ONLY
- )
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_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
++ ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}ConfigVersion.cmake
DESTINATION ${DEAL_II_PROJECT_CONFIG_RELDIR}
COMPONENT library
)
COND_SET_TO_YES(DEAL_II_WITH_P4EST MAKEFILE_P4EST)
COND_SET_TO_YES(DEAL_II_WITH_MPI MAKEFILE_MPI)
- TO_STRING_AND_ADD_PREFIX(MAKEFILE_INCLUDE_DIRS "${CMAKE_INCLUDE_FLAG_CXX}"
- $(D)/${DEAL_II_INCLUDE_RELDIR}
- $(D)/${DEAL_II_INCLUDE_RELDIR}/deal.II
+ #
+ # For binary dir:
+ #
- SET(MAKEFILE_D ${CMAKE_BINARY_DIR})
- CONFIGURE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/Make.global_options.in
- ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/Make.global_options
- )
-
++ SET(MAKEFILE_D_BINARY ${CMAKE_BINARY_DIR})
++ TO_STRING_AND_ADD_PREFIX(MAKEFILE_INCLUDE_DIRS_BINARY "${CMAKE_INCLUDE_FLAG_CXX}"
++ $(D)/install
++ $(D)/install/deal.II
+ ${CMAKE_SOURCE_DIR}/include/
+ ${CMAKE_SOURCE_DIR}/include/deal.II
+ ${deal_ii_source_includes}
+ ${DEAL_II_USER_INCLUDE_DIRS}
+ )
- TO_STRING_AND_ADD_PREFIX(MAKEFILE_INCLUDE_DIRS "${CMAKE_INCLUDE_FLAG_CXX}"
+ #
+ # For installation:
+ #
- SET(MAKEFILE_D ${CMAKE_INSTALL_PREFIX})
++ SET(MAKEFILE_D_INSTALLATION ${CMAKE_INSTALL_PREFIX})
++ TO_STRING_AND_ADD_PREFIX(MAKEFILE_INCLUDE_DIRS_INSTALLATION "${CMAKE_INCLUDE_FLAG_CXX}"
+ $(D)/${DEAL_II_INCLUDE_RELDIR}
+ $(D)/${DEAL_II_INCLUDE_RELDIR}/deal.II
+ $(D)/${DEAL_II_INCLUDE_RELDIR}/deal.II/bundled
+ ${DEAL_II_USER_INCLUDE_DIRS}
+ )
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/Make.global_options.in
-- ${CMAKE_CURRENT_BINARY_DIR}/Make.global_options
++ ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/Make.global_options
)
INSTALL(FILES
-- ${CMAKE_CURRENT_BINARY_DIR}/template-arguments
-- ${CMAKE_CURRENT_BINARY_DIR}/Make.global_options
++ ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/template-arguments
++ ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/Make.global_options
DESTINATION ${DEAL_II_COMMON_RELDIR}
COMPONENT compat_files
)
ENDIF()
++#
++# Finally, add a target to create the "binary" file in
++# ${DEAL_II_PROJECT_CONFIG_RELDIR} and add it to the library target:
++#
++ADD_CUSTOM_TARGET(setup_build_dir ALL
++ COMMAND ${CMAKE_COMMAND} -E touch
++ ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/binary
++ COMMAND ${CMAKE_COMMAND} -E touch
++ ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
++ )
++ADD_DEPENDENCIES(library setup_build_dir)
++
++#
++# And a script to remove it upon installation from the install prefix:
++#
++INSTALL(CODE
++ "
++ FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEAL_II_PROJECT_CONFIG_RELDIR}/binary)
++ EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E touch
++ ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
++ )
++ "
++ COMPONENT library
++ )
GET_FILENAME_COMPONENT(_path "${_path}" PATH)
ENDWHILE()
++#
++# Is this project reside in a build directory or at an installed location?
++#
++
++IF(EXISTS ${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/binary)
++ SET(DEAL_II_BUILD_DIR TRUE)
++ENDIF()
++
#
# Print a message after inclusion of this file:
#
SET(DEAL_II_PROJECT_CONFIG_INCLUDED TRUE)
IF(NOT ${DEAL_II_PACKAGE_NAME}_FIND_QUIETLY)
-- MESSAGE(STATUS
-- "Using the ${DEAL_II_PACKAGE_NAME}-${DEAL_II_PACKAGE_VERSION} installation found at ${DEAL_II_PATH}"
-- )
++ IF(DEAL_II_BUILD_DIR)
++ MESSAGE(STATUS
++ "Using the ${DEAL_II_PACKAGE_NAME}-${DEAL_II_PACKAGE_VERSION} build directory found at ${DEAL_II_PATH}"
++ )
++ ELSE()
++ MESSAGE(STATUS
++ "Using the ${DEAL_II_PACKAGE_NAME}-${DEAL_II_PACKAGE_VERSION} installation found at ${DEAL_II_PATH}"
++ )
++ ENDIF()
ENDIF()
#
# Information about include directories and libraries
#
--
--SET(DEAL_II_INCLUDE_DIRS "@CONFIG_INCLUDE_DIRS@")
++IF(DEAL_II_BUILD_DIR)
++ SET(DEAL_II_INCLUDE_DIRS "@CONFIG_INCLUDE_DIRS_BINARY@")
++ELSE()
++ SET(DEAL_II_INCLUDE_DIRS "@CONFIG_INCLUDE_DIRS_INSTALLATION@")
++ENDIF()
# Full list of libraries for the debug target:
SET(DEAL_II_LIBRARIES_DEBUG "@CONFIG_LIBRARIES_DEBUG@")
# Information about library targets
#
--SET(DEAL_II_TARGET_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake")
++IF(DEAL_II_BUILD_DIR)
++ SET(DEAL_II_TARGET_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}BuildTargets.cmake")
++ELSE()
++ SET(DEAL_II_TARGET_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake")
++ENDIF()
# The Debug target:
SET(DEAL_II_TARGET_DEBUG "@CONFIG_TARGET_DEBUG@")
#
- D = @MAKEFILE_D@
-D = @CMAKE_INSTALL_PREFIX@
++ifeq ($(wildcard $(D)/@DEAL_II_PROJECT_CONFIG_RELDIR@/binary),)
++ D = @MAKEFILE_D_INSTALLATION@
++else
++ D = @MAKEFILE_D_BINARY@
++endif
++
CXX = @CMAKE_CXX_COMPILER@
CXX-ID = @CMAKE_CXX_COMPILER_ID@
CXX-VERSION = @CMAKE_CXX_COMPILER_VERSION@
# Include paths as command line flags
--INCLUDE = @MAKEFILE_INCLUDE_DIRS@
++ifeq ($(wildcard $(D)/@DEAL_II_PROJECT_CONFIG_RELDIR@/binary),)
++ INCLUDE = @MAKEFILE_INCLUDE_DIRS_INSTALLATION@
++else
++ INCLUDE = @MAKEFILE_INCLUDE_DIRS_BINARY@
++endif
# compiler flags for debug and optimized mode
MACRO(EXPAND_INSTANTIATIONS _target _inst_in_files)
-- IF(CMAKE_CROSSCOMPILING)
- SET(_ei_exec exported-expand_instantiations)
- SET(_ei_exec native-expand_instantiations)
-- ELSE()
-- SET(_ei_exec expand_instantiations)
-- ENDIF()
--
FOREACH (_inst_in_file ${_inst_in_files})
STRING(REGEX REPLACE "\\.in$" "" _inst_file "${_inst_in_file}" )
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}
-- DEPENDS ${_ei_exec}
++ DEPENDS expand_instantiations
${CMAKE_BINARY_DIR}/cmake/config/template-arguments
${CMAKE_CURRENT_SOURCE_DIR}/${_inst_in_file}
-- COMMAND ${_ei_exec}
++ COMMAND expand_instantiations
ARGS ${CMAKE_BINARY_DIR}/cmake/config/template-arguments
< ${CMAKE_CURRENT_SOURCE_DIR}/${_inst_in_file}
> ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}
##
## ---------------------------------------------------------------------
--ADD_EXECUTABLE(expand_instantiations expand_instantiations.cc)
+ IF(NOT CMAKE_CROSSCOMPILING)
- #
- # Export expand_instantiations for use in cross compilation:
- #
++ ADD_EXECUTABLE(expand_instantiations expand_instantiations.cc)
+
- IF(DEAL_II_COMPONENT_COMPAT_FILES)
- SET_TARGET_PROPERTIES(expand_instantiations
- PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/common/scripts
- )
- ENDIF()
++ IF(DEAL_II_COMPONENT_COMPAT_FILES)
++ SET_TARGET_PROPERTIES(expand_instantiations
++ PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/common/scripts
++ )
++ INSTALL(TARGETS expand_instantiations
++ EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets
++ DESTINATION ${DEAL_II_COMMON_RELDIR}/scripts
++ COMPONENT compat_files
++ )
++ ENDIF()
+
- IF(NOT CMAKE_CROSSCOMPILING)
- #
- # Export expand_instantiations for use in cross compilation:
- #
EXPORT(TARGETS expand_instantiations
- FILE ${CMAKE_CURRENT_BINARY_DIR}/importExecutables.cmake
- NAMESPACE native- # Prefix a namespace
+ FILE ${CMAKE_BINARY_DIR}/importExecutables.cmake
- NAMESPACE exported- # Prefix a namespace
)
ENDIF()
# Build and install the old dependency_resolution and report_features
# executables:
#
++
INCLUDE_DIRECTORIES(
BEFORE # Ensure deal.II include directories come first
-- ${CMAKE_BINARY_DIR}/include/
++ #
++ # Reverse order due to BEFORE:
++ #
${CMAKE_SOURCE_DIR}/include/
++ ${CMAKE_BINARY_DIR}/include/
)
ADD_EXECUTABLE(make_dependencies make_dependencies.cc)
ADD_CUSTOM_TARGET(run_report_features COMMAND report_features)
ENDIF()
- INSTALL(TARGETS make_dependencies report_features expand_instantiations
+ SET_TARGET_PROPERTIES(make_dependencies report_features
+ PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/common/scripts
+ )
+
- INSTALL(TARGETS make_dependencies report_features expand_instantiations
++ INSTALL(TARGETS make_dependencies report_features
EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets
DESTINATION ${DEAL_II_COMMON_RELDIR}/scripts
COMPONENT compat_files
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_${_build_lowercase}
)
ENDFOREACH()
- ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake
+FILE(WRITE
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_source_includes
+ ""
+ )
+
+#
+# Cleanup deal.IITargets.cmake in the build directory:
+#
+FILE(REMOVE
++ ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}BuildTargets.cmake
+ )
########################################################################
SET(DEAL_II_NATIVE "DEAL_II_NATIVE-NOTFOUND" CACHE FILEPATH
"A pointer to a native deal.Ii build directory"
)
- INCLUDE(${DEAL_II_NATIVE}/cmake/scripts/importExecutables.cmake)
++ IF(DEAL_II_NATIVE MATCHES "-NOTFOUND")
++ MESSAGE(FATAL_ERROR
++ "Please set the CMake variable DEAL_II_NATIVE to a valid path that points to a native deal.II build directory"
++ )
++ ENDIF()
+ INCLUDE(${DEAL_II_NATIVE}/importExecutables.cmake)
ENDIF()
<ol>
<li>
++ Enhancement: It is now possible to use the build directory directly without
++ the need to install first. For this, a second copy of all necessary project
++ configuration files (deal.IIConfig.cmake, ..., Make.global_options) are
++ generated and deployed in the build directory. (This is fully compatible with
++ the old possibility to install into the build dir.)
++ <br>
++ (Matthias Maier, 2013/09/15)
++ </li>
++
++ <li>
Fixed: DoFTools::extract_locally_*_dofs now instantiated for hp::DofHandler.
<br>
(Jean-Paul Pelteret, 2013/09/11)
${DEAL_II_EXTERNAL_LIBRARIES}
)
- FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake
+ FILE(MAKE_DIRECTORY
+ ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}
+ )
+ EXPORT(TARGETS ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
++ FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}BuildTargets.cmake
+ APPEND
+ )
+
INSTALL(TARGETS ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets
DESTINATION ${DEAL_II_LIBRARY_RELDIR}