]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Improvement: Support direct build directory usage
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 15 Sep 2013 01:17:10 +0000 (01:17 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 15 Sep 2013 01:17:10 +0000 (01:17 +0000)
With this commit it is now possible to use the build directory directly
without the need to install the project first.

git-svn-id: https://svn.dealii.org/trunk@30705 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/bundled/CMakeLists.txt
deal.II/cmake/config/CMakeLists.txt
deal.II/cmake/config/Config.cmake.in
deal.II/cmake/config/Make.global_options.in
deal.II/cmake/macros/macro_expand_instantiations.cmake
deal.II/cmake/scripts/CMakeLists.txt
deal.II/cmake/setup_finalize.cmake
deal.II/cmake/setup_post_project_call.cmake
deal.II/doc/news/changes.h
deal.II/source/CMakeLists.txt

index 846b614f2ae08e78d929ecc6e6271264f68c2819..897b4632e1d087d9d401afcb9288696b1db82503 100644 (file)
@@ -35,6 +35,9 @@ IF(FEATURE_BOOST_BUNDLED_CONFIGURED)
     COMPONENT library
     PATTERN ".svn" EXCLUDE
     )
+  FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_source_includes
+    "${BOOST_FOLDER}/include\n"
+    )
 
   ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/serialization/src)
 
@@ -88,6 +91,9 @@ IF(FEATURE_THREADS_BUNDLED_CONFIGURED)
     FILES_MATCHING PATTERN "*.h"
     PATTERN ".svn" EXCLUDE
     )
+  FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_source_includes
+    "${TBB_FOLDER}/include\n"
+    )
 
   ADD_SUBDIRECTORY(${TBB_FOLDER}/src)
 ENDIF()
index 49f9893e6593e360f80f37bc4584a9c21a284cd7..48cf9f0c92f3ffe179af4a2bb972b3e9e423a57d 100644 (file)
 ##
 ## ---------------------------------------------------------------------
 
+#
+# This file sets up the project configuration consisting of
+#
+#   Make.global_options (legacy)
+#   deal.IIConfig.cmake
+#   deal.IIVersionConfig.cmake
+#
+# and copies it (a) to the build directory and (b) prepares it for later
+# installation (the copy in CMAKE_CURRENT_BINARY_DIR).
+#
+
+#
+# Read in auxiliary include directories for the build directory
+# configuration:
+#
+FILE(STRINGS
+  ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_source_includes
+  deal_ii_source_includes
+  )
 
 #
 # 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
   )
 
 
@@ -30,7 +49,13 @@ CONFIGURE_FILE(
 #                                                                      #
 ########################################################################
 
-INSTALL(FILES
+FILE(COPY # for binary dir:
+  ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake
+  ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_invoke_autopilot.cmake
+  ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_setup_target.cmake
+  DESTINATION ${CMAKE_BINARY_DIR}/${DEAL_II_CMAKE_MACROS_RELDIR}
+  )
+INSTALL(FILES # for installation:
   ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake
   ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_invoke_autopilot.cmake
   ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_setup_target.cmake
@@ -93,24 +118,37 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES})
     )
 ENDFOREACH()
 
-SET(CONFIG_INCLUDE_DIRS
+#
+# For binary dir:
+#
+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}
+  )
+#
+# For installation:
+#
+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:
 #
-
-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
+  )
 FILE(APPEND ${_file}
   "\n\n#\n# Feature configuration:\n#\n\n"
   )
@@ -123,16 +161,15 @@ FOREACH(var ${res})
   ENDIF()
 ENDFOREACH()
 
-
 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
   )
 
 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
   )
@@ -150,13 +187,6 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES)
   # Transform some cmake lists into a string that the old Makefile
   # mechanism actually understands:
   #
-  TO_STRING_AND_ADD_PREFIX(MAKEFILE_INCLUDE_DIRS "${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}
-    ${DEAL_II_INCLUDE_DIRS}
-    )
 
   FOREACH(build ${DEAL_II_BUILD_TYPES})
     TO_STRING_AND_ADD_PREFIX(MAKEFILE_DEFINITIONS_${build}
@@ -241,16 +271,62 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES)
   COND_SET_TO_YES(DEAL_II_WITH_P4EST MAKEFILE_P4EST)
   COND_SET_TO_YES(DEAL_II_WITH_MPI MAKEFILE_MPI)
 
+  #
+  # For binary dir:
+  #
+  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}
+    )
+  #
+  # For installation:
+  #
+  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
+  )
index 150793f5cc781460b568550d2dce111d2c538be1..53417f2bdf1b42c8b88224527a799eb7efca8551 100644 (file)
@@ -66,6 +66,14 @@ WHILE(NOT "${_path}" STREQUAL "")
   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:
 #
@@ -73,9 +81,15 @@ ENDWHILE()
 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()
 
 
@@ -138,8 +152,11 @@ SET(DEAL_II_STATIC_EXECUTABLE "@DEAL_II_STATIC_EXECUTABLE@")
 #
 # 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@")
@@ -155,7 +172,11 @@ SET(DEAL_II_LIBRARIES "@CONFIG_LIBRARIES@")
 # 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@")
index cc00835e7440e8448ea655089eaae2d4cd6fc3cf..3ebd2f232a20f9d9238b6103e2d425231426ea70 100644 (file)
 #
 
 
-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@
@@ -82,7 +87,11 @@ lib-deal2.g     = @MAKEFILE_TARGETS_DEBUG@
 
 
 # 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
index 5516eb01de9e9ccbd23b1913dbd1d1015062e59b..c842ba0d96a53512d34f78826f436a2eb50bdbad 100644 (file)
 
 MACRO(EXPAND_INSTANTIATIONS _target _inst_in_files)
 
-  IF(CMAKE_CROSSCOMPILING)
-    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}
index 5ac93c43cc2bb55b93e560efbad9b899558550d4..96539b783549c9fbd2d8ecfe5c56103afdc3dbf1 100644 (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
+      )
+    INSTALL(TARGETS expand_instantiations
+      EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets
+      DESTINATION ${DEAL_II_COMMON_RELDIR}/scripts
+      COMPONENT compat_files
+      )
+  ENDIF()
+
   EXPORT(TARGETS expand_instantiations
-    FILE ${CMAKE_CURRENT_BINARY_DIR}/importExecutables.cmake
-    NAMESPACE native- # Prefix a namespace
+    FILE ${CMAKE_BINARY_DIR}/importExecutables.cmake
     )
 ENDIF()
 
@@ -30,10 +38,14 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES)
   # 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)
@@ -81,7 +93,11 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES)
     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
     EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets
     DESTINATION ${DEAL_II_COMMON_RELDIR}/scripts
     COMPONENT compat_files
index a651931f347fa18cf161cb2e85d7ef00fa2fa6a2..0584cc7696d55f4af15175ed79e1bf70527f484a 100644 (file)
@@ -72,6 +72,17 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES})
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_${_build_lowercase}
     )
 ENDFOREACH()
+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
+  )
 
 
 ########################################################################
index 690acf5d5d3f9ef357487c385e6913087dc12a1d..60aad894dff0f090a51697253537e8dea3f3c895 100644 (file)
@@ -49,5 +49,10 @@ IF(CMAKE_CROSSCOMPILING)
   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()
index 008b42c4ada26807d0103f4aaa3ab97fbf0c4ca6..89ca97044374f847db72a46016073621745b2dc9 100644 (file)
@@ -85,6 +85,16 @@ inconvenience this causes.
 <h3>Specific improvements</h3>
 
 <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>
index 8842add21fba869559ee665956cba0f79f586319..5b21083aac97b8d7a36efaf84cbab2f633fddf95 100644 (file)
@@ -82,6 +82,9 @@ FOREACH(build ${DEAL_II_BUILD_TYPES})
     COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${build}}"
     COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_${build}}"
     INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}"
+    ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
+    LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
+    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
     )
 
   TARGET_LINK_LIBRARIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
@@ -89,6 +92,14 @@ FOREACH(build ${DEAL_II_BUILD_TYPES})
     ${DEAL_II_EXTERNAL_LIBRARIES}
     )
 
+  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}

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.