]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add an autopilot to the build system
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 24 Oct 2012 12:43:55 +0000 (12:43 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 24 Oct 2012 12:43:55 +0000 (12:43 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@27191 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/CMakeLists.txt
deal.II/bundled/tbb30_104oss/Makefile [deleted file]
deal.II/cmake/distclean.cmake.in [new file with mode: 0644]
deal.II/cmake/setup_cached_variables.cmake
deal.II/cmake/setup_custom_targets.cmake
deal.II/cmake/setup_finalize.cmake

index 3162051e9be691e54578c9f42399ce7edb642aee..a29b6cf13f887f29d985a4beff5d0234fe78ef65 100644 (file)
@@ -149,3 +149,9 @@ ADD_SUBDIRECTORY(contrib)
 #
 INCLUDE(setup_custom_targets)
 
+#
+# And finally, print the configuration:
+#
+FILE(READ ${CMAKE_BINARY_DIR}/summary.log DEAL_II_LOG_SUMMARY)
+MESSAGE("${DEAL_II_LOG_SUMMARY}")
+
diff --git a/deal.II/bundled/tbb30_104oss/Makefile b/deal.II/bundled/tbb30_104oss/Makefile
deleted file mode 100644 (file)
index 5d6d930..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-# Copyright 2005-2010 Intel Corporation.  All Rights Reserved.
-#
-# This file is part of Threading Building Blocks.
-#
-# Threading Building Blocks is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public License
-# version 2 as published by the Free Software Foundation.
-#
-# Threading Building Blocks is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
-# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Threading Building Blocks; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-# As a special exception, you may use this file as part of a free software
-# library without restriction.  Specifically, if other files instantiate
-# templates or use macros or inline functions from this file, or you compile
-# this file and link it with other files to produce an executable, this
-# file does not by itself cause the resulting executable to be covered by
-# the GNU General Public License.  This exception does not however
-# invalidate any other reasons why the executable file might be covered by
-# the GNU General Public License.
-
-tbb_root?=.
-include $(tbb_root)/build/common.inc
-.PHONY: default all tbb tbbmalloc test examples
-
-#workaround for non-depend targets tbb and tbbmalloc which both depend on version_string.tmp
-#According to documentation submakes should run in parallel
-.NOTPARALLEL: tbb tbbmalloc
-
-default: tbb tbbmalloc
-
-all: tbb tbbmalloc test examples
-
-tbb: mkdir
-       @$(MAKE) -C "$(work_dir)_debug"  -r -f $(tbb_root)/build/Makefile.tbb cfg=debug tbb_root=$(tbb_root)
-       @$(MAKE) -C "$(work_dir)_release"  -r -f $(tbb_root)/build/Makefile.tbb cfg=release tbb_root=$(tbb_root)
-
-tbbmalloc: mkdir
-       @$(MAKE) -C "$(work_dir)_debug"  -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=debug malloc tbb_root=$(tbb_root)
-       @$(MAKE) -C "$(work_dir)_release"  -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc tbb_root=$(tbb_root)
-
-test: tbb tbbmalloc
-       -@$(MAKE) -C "$(work_dir)_debug"  -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=debug malloc_test tbb_root=$(tbb_root)
-       -@$(MAKE) -C "$(work_dir)_debug"  -r -f $(tbb_root)/build/Makefile.test cfg=debug tbb_root=$(tbb_root)
-       -@$(MAKE) -C "$(work_dir)_release"  -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc_test tbb_root=$(tbb_root)
-       -@$(MAKE) -C "$(work_dir)_release"  -r -f $(tbb_root)/build/Makefile.test cfg=release tbb_root=$(tbb_root) 
-
-rml: mkdir
-       @$(MAKE) -C "$(work_dir)_debug"  -r -f $(tbb_root)/build/Makefile.rml cfg=debug tbb_root=$(tbb_root)
-       @$(MAKE) -C "$(work_dir)_release"  -r -f $(tbb_root)/build/Makefile.rml cfg=release tbb_root=$(tbb_root)
-
-
-examples: tbb tbbmalloc
-       $(MAKE) -C examples -r -f Makefile tbb_root=.. release test
-
-.PHONY: clean clean_examples mkdir info
-
-clean: clean_examples
-       $(shell $(RM) $(work_dir)_release$(SLASH)*.* >$(NUL) 2>$(NUL))
-       $(shell $(RD) $(work_dir)_release >$(NUL) 2>$(NUL))
-       $(shell $(RM) $(work_dir)_debug$(SLASH)*.* >$(NUL) 2>$(NUL))
-       $(shell $(RD) $(work_dir)_debug >$(NUL) 2>$(NUL))
-       @echo clean done
-
-clean_examples:
-       $(shell $(MAKE) -s -i -r -C examples -f Makefile tbb_root=.. clean >$(NUL) 2>$(NUL))
-
-mkdir:
-       $(shell $(MD) "$(work_dir)_release" >$(NUL) 2>$(NUL))
-       $(shell $(MD) "$(work_dir)_debug" >$(NUL) 2>$(NUL))
-       @echo Created $(work_dir)_release and ..._debug directories
-
-info:
-       @echo OS: $(tbb_os)
-       @echo arch=$(arch)
-       @echo compiler=$(compiler)
-       @echo runtime=$(runtime)
-       @echo tbb_build_prefix=$(tbb_build_prefix)
-
diff --git a/deal.II/cmake/distclean.cmake.in b/deal.II/cmake/distclean.cmake.in
new file mode 100644 (file)
index 0000000..91beac7
--- /dev/null
@@ -0,0 +1,66 @@
+SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
+
+#
+# Clean subdirectories from the generated CMake build system:
+#
+FOREACH(_folder bundled config contrib doc include scripts source)
+  file(GLOB _files_to_remove
+    ${CMAKE_BINARY_DIR}/${_folder}/cmake_install.cmake
+    ${CMAKE_BINARY_DIR}/${_folder}/*/cmake_install.cmake
+    ${CMAKE_BINARY_DIR}/${_folder}/Makefile
+    ${CMAKE_BINARY_DIR}/${_folder}/*/Makefile
+    )
+  EXECUTE_PROCESS(
+    COMMAND ${CMAKE_COMMAND} -E remove ${_files_to_remove}
+    )
+
+  file(GLOB _directories_to_remove
+    ${CMAKE_BINARY_DIR}/${_folder}/CMakeFiles
+    ${CMAKE_BINARY_DIR}/${_folder}/*/CMakeFiles
+    )
+  FOREACH(_dir ${_directories_to_remove})
+    EXECUTE_PROCESS(
+      COMMAND ${CMAKE_COMMAND} -E remove_directory ${_dir}
+      )
+  ENDFOREACH()
+ENDFOREACH()
+
+
+#
+# Remove configured files
+#
+file(GLOB _files_to_remove
+  ${CMAKE_BINARY_DIR}/CMakeCache.txt
+  ${CMAKE_BINARY_DIR}/cmake_install.cmake
+  ${CMAKE_BINARY_DIR}/config/deal.IIConfig.cmake
+  ${CMAKE_BINARY_DIR}/config/deal.IIConfigVersion.cmake
+  ${CMAKE_BINARY_DIR}/config/Make.global_options
+  ${CMAKE_BINARY_DIR}/config/template-arguments
+  ${CMAKE_BINARY_DIR}/distclean.cmake
+  ${CMAKE_BINARY_DIR}/examples/cmake_install.cmake
+  ${CMAKE_BINARY_DIR}/examples/Makefile
+  ${CMAKE_BINARY_DIR}/include/*/base/config.h
+  ${CMAKE_BINARY_DIR}/install_manifest.txt
+  ${CMAKE_BINARY_DIR}/Makefile
+  ${CMAKE_BINARY_DIR}/summary.log
+  )
+EXECUTE_PROCESS(
+  COMMAND ${CMAKE_COMMAND} -E remove ${_files_to_remove}
+  )
+
+#
+# and special folders
+#
+file(GLOB _directories_to_remove
+  ${CMAKE_BINARY_DIR}/bin
+  ${CMAKE_BINARY_DIR}/CMakeFiles
+  ${CMAKE_BINARY_DIR}/common
+  ${CMAKE_BINARY_DIR}/examples/CMakeFiles
+  ${CMAKE_BINARY_DIR}/lib
+  )
+FOREACH(_dir ${_directories_to_remove})
+  EXECUTE_PROCESS(
+    COMMAND ${CMAKE_COMMAND} -E remove_directory ${_dir}
+    )
+ENDFOREACH()
+
index 087a146473298747175df38c7e21a385d90b7794..d05ba6b9c04a9f5d72114f0005fb6807727eb14b 100644 (file)
@@ -24,6 +24,7 @@
 #     DEAL_II_COMPONENT_CONTRIB
 #     DEAL_II_COMPONENT_DOCUMENTATION
 #     DEAL_II_COMPONENT_EXAMPLES
+#     CMAKE_INSTALL_PREFIX              **)
 #
 # Options regarding compilation and linking:
 #
 #     DEAL_II_CXX_FLAGS_RELEASE
 #     DEAL_II_SHARED_LINKER_FLAGS_RELEASE
 #
-# *) May also be set via environment variable (CFLAGS, CXXFLAGS, LDFLAGS)
-#    (nonempty cached variable has precedence will not be overwritten by
-#    environment)
+# *)  May also be set via environment variable (CFLAGS, CXXFLAGS, LDFLAGS)
+#     (nonempty cached variable has precedence will not be overwritten by
+#     environment)
+#
+# **) for an in-source build (and if DISABLE_AUTOPILOT is not set)
 #
 
 
@@ -82,6 +85,17 @@ OPTION(DEAL_II_COMPONENT_EXAMPLES
   ON
   )
 
+#
+# Set CMAKE_INSTALL_PREFIX to the source directory if an in source build is
+# detected (and DISABLE_AUTOPILOT is not set)
+#
+IF( "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}" AND
+    NOT DISABLE_AUTOPILOT)
+  SET(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}" CACHE STRING
+    "Install path prefix, prepended onto install directories."
+    )
+ENDIF()
+
 
 ###########################################################################
 #                                                                         #
index 3a91c6f3005f975a83b0797381f68afe3398c5b4..7f467f93453d7871a631c02e8a288de0c7d2b604 100644 (file)
 #####
 
 #
-# Setup some convenience custom targets for the build system, i.e.
-#
-#   $ make <custom_target>.
-#
-# We add custom targets for building all targets necessary to install a
-# specific component (too bad, we have to do this by hand. There is no cmake
-# internal way to do this, yet...):
-#
-#   library, documentation, compat_files
+# Setup some convenience custom targets for the build system:
 #
 
-ADD_CUSTOM_TARGET(library)
 
+###########################################################################
+#                                                                         #
+#  Custom targets for library, documentation and compat_files components: #
+#                                                                         #
+###########################################################################
+
+ADD_CUSTOM_TARGET(library)
 FOREACH(_build ${DEAL_II_BUILD_TYPES})
   ADD_DEPENDENCIES(library ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX})
-  IF(_build MATCHES "RELEASE")
-    ADD_CUSTOM_TARGET(release
-      DEPENDS ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX}
-      )
-  ELSEIF(_build MATCHES "DEBUG")
-    ADD_CUSTOM_TARGET(debug
-      DEPENDS ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX}
-      )
-  ENDIF()
 ENDFOREACH()
 
 IF(DEAL_II_COMPONENT_DOCUMENTATION)
@@ -62,3 +51,52 @@ IF(DEAL_II_COMPONENT_CONTRIB)
     )
 ENDIF()
 
+
+###########################################################################
+#                                                                         #
+#                  Custom targets for the autopilot mode:                 #
+#                                                                         #
+###########################################################################
+
+IF( "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}" AND
+    NOT DISABLE_AUTOPILOT)
+  #
+  # Setup the "distclean" target:
+  #
+  CONFIGURE_FILE(
+    ${CMAKE_SOURCE_DIR}/cmake/distclean.cmake.in
+    ${CMAKE_BINARY_DIR}/distclean.cmake
+    @ONLY)
+  ADD_CUSTOM_TARGET(distclean
+    COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target clean
+    COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/distclean.cmake
+    )
+
+  #
+  # Targets for changing the build type:
+  #
+  ADD_CUSTOM_TARGET(debug
+    COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR}
+    COMMENT "Switch CMAKE_BUILD_TYPE to Debug"
+    )
+  ADD_CUSTOM_TARGET(release
+    COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ${CMAKE_SOURCE_DIR}
+    COMMENT "Switch CMAKE_BUILD_TYPE to Release"
+    )
+  ADD_CUSTOM_TARGET(debugrelease
+    COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=DebugRelease ${CMAKE_SOURCE_DIR}
+    COMMENT "Switch CMAKE_BUILD_TYPE to DebugRelease"
+    )
+
+  #
+  # A cheesy trick to automatically install and print a summary
+  #
+  ADD_CUSTOM_TARGET("install-intree" ALL
+    COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target install/fast
+    )
+  ADD_DEPENDENCIES(install-intree compat_files)
+  ADD_DEPENDENCIES(install-intree contrib)
+  ADD_DEPENDENCIES(install-intree documentation)
+  ADD_DEPENDENCIES(install-intree library)
+ENDIF()
+
index cb111ab1f83988637db5026dbdcd1d3738518a55..90d1ab12f72d7588ec8b9920b31faed35c416a3d 100644 (file)
@@ -63,55 +63,61 @@ ENDFOREACH()
 SET(_log "${CMAKE_BINARY_DIR}/summary.log")
 
 FILE(WRITE ${_log}
-"#
-# deal.II configuration:
-#
-      CMAKE_BUILD_TYPE:       ${CMAKE_BUILD_TYPE}
-      CMAKE_INSTALL_PREFIX:   ${CMAKE_INSTALL_PREFIX}
-      CMAKE_SOURCE_DIR:       ${CMAKE_SOURCE_DIR}
-      CMAKE_BINARY_DIR:       ${CMAKE_BINARY_DIR}\n
-      CMAKE_CXX_COMPILER:     ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} on platform ${CMAKE_SYSTEM_NAME}
-                              ${CMAKE_CXX_COMPILER}\n
-Compiler flags used for this build:
-      CMAKE_CXX_FLAGS:                     ${CMAKE_CXX_FLAGS}\n"
+"###
+#
+#  deal.II configuration:
+#
+#        CMAKE_BUILD_TYPE:       ${CMAKE_BUILD_TYPE}
+#        CMAKE_INSTALL_PREFIX:   ${CMAKE_INSTALL_PREFIX}
+#        CMAKE_SOURCE_DIR:       ${CMAKE_SOURCE_DIR}
+#        CMAKE_BINARY_DIR:       ${CMAKE_BINARY_DIR}
+#        CMAKE_CXX_COMPILER:     ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} on platform ${CMAKE_SYSTEM_NAME}
+#                                ${CMAKE_CXX_COMPILER}
+#
+#  Compiler flags used for this build:
+#        CMAKE_CXX_FLAGS:                     ${CMAKE_CXX_FLAGS}
+"
   )
 IF(CMAKE_BUILD_TYPE MATCHES "Release")
-  FILE(APPEND ${_log} "      DEAL_II_CXX_FLAGS_RELEASE:           ${DEAL_II_CXX_FLAGS_RELEASE}\n")
+  FILE(APPEND ${_log} "#        DEAL_II_CXX_FLAGS_RELEASE:           ${DEAL_II_CXX_FLAGS_RELEASE}\n")
 ENDIF()
 IF(CMAKE_BUILD_TYPE MATCHES "Debug")
-  FILE(APPEND ${_log} "      DEAL_II_CXX_FLAGS_DEBUG:             ${DEAL_II_CXX_FLAGS_DEBUG}\n")
+  FILE(APPEND ${_log} "#        DEAL_II_CXX_FLAGS_DEBUG:             ${DEAL_II_CXX_FLAGS_DEBUG}\n")
 ENDIF()
-FILE(APPEND ${_log} "      CMAKE_SHARED_LINKER_FLAGS:           ${CMAKE_SHARED_LINKER_FLAGS}\n")
+FILE(APPEND ${_log} "#        CMAKE_SHARED_LINKER_FLAGS:           ${CMAKE_SHARED_LINKER_FLAGS}\n")
 IF(CMAKE_BUILD_TYPE MATCHES "Release")
-  FILE(APPEND ${_log} "      DEAL_II_SHARED_LINKER_FLAGS_RELEASE: ${DEAL_II_SHARED_LINKER_FLAGS_RELEASE}\n")
+  FILE(APPEND ${_log} "#        DEAL_II_SHARED_LINKER_FLAGS_RELEASE: ${DEAL_II_SHARED_LINKER_FLAGS_RELEASE}\n")
 ENDIF()
 IF(CMAKE_BUILD_TYPE MATCHES "Debug")
-  FILE(APPEND ${_log} "      DEAL_II_SHARED_LINKER_FLAGS_DEBUG:   ${DEAL_II_SHARED_LINKER_FLAGS_DEBUG}\n")
+  FILE(APPEND ${_log} "#        DEAL_II_SHARED_LINKER_FLAGS_DEBUG:   ${DEAL_II_SHARED_LINKER_FLAGS_DEBUG}\n")
 ENDIF()
 
 IF(FEATURE_UMFPACK_BUNDLED_CONFIGURED)
   FILE(APPEND ${_log}
-"\nThe bundled UMFPACK library will be compiled with the following C compiler:
-      CMAKE_C_COMPILER:         ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}
-                                ${CMAKE_C_COMPILER}
-      CMAKE_C_FLAGS:           ${CMAKE_C_FLAGS}\n"
+"
+#
+#  The bundled UMFPACK library will be compiled with the following C compiler:
+#        CMAKE_C_COMPILER:         ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}
+#                                  ${CMAKE_C_COMPILER}
+#        CMAKE_C_FLAGS:            ${CMAKE_C_FLAGS}
+"
     )
   IF(CMAKE_BUILD_TYPE MATCHES "Release")
-    FILE(APPEND ${_log} "      DEAL_II_C_FLAGS_RELEASE: ${DEAL_II_C_FLAGS_RELEASE}\n")
+    FILE(APPEND ${_log} "#        DEAL_II_C_FLAGS_RELEASE: ${DEAL_II_C_FLAGS_RELEASE}\n")
   ENDIF()
   IF(CMAKE_BUILD_TYPE MATCHES "Debug")
-    FILE(APPEND ${_log} "      DEAL_II_C_FLAGS_DEBUG:   ${DEAL_II_C_FLAGS_DEBUG}\n")
+    FILE(APPEND ${_log} "#        DEAL_II_C_FLAGS_DEBUG:   ${DEAL_II_C_FLAGS_DEBUG}\n")
   ENDIF()
 ENDIF()
 
 IF(NOT DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
-  FILE(APPEND ${_log} "\nWARNING: DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS is set to OFF\n")
+  FILE(APPEND ${_log} "#\n#  WARNING: DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS is set to OFF\n")
 ELSEIF(NOT DEAL_II_KNOWN_COMPILER)
-  FILE(APPEND ${_log} "\nWARNING: Unknown compiler! Please set compiler flags by hand.\n")
+  FILE(APPEND ${_log} "#\n#  WARNING: Unknown compiler! Please set compiler flags by hand.\n")
 ENDIF()
 
 FILE(APPEND ${_log}
-  "\nConfigured Features:"
+  "#\n#  Configured Features:"
   )
 IF(FORCE_AUTODETECTION)
   FILE(APPEND ${_log}
@@ -128,7 +134,6 @@ IF(DEFINED DEAL_II_ALLOW_BUNDLED)
     " (DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED})"
     )
 ENDIF()
-
 FILE(APPEND ${_log} "\n")
 
 GET_CMAKE_PROPERTY(_res VARIABLES)
@@ -136,36 +141,84 @@ FOREACH(_var ${_res})
   IF(_var MATCHES "DEAL_II_WITH")
     IF(${${_var}})
       # FEATURE is enabled
-      STRING(REGEX REPLACE "^DEAL_II_WITH_" "" feature ${_var})
-      IF(FEATURE_${feature}_EXTERNAL_CONFIGURED)
-        FILE(APPEND ${_log} "      ${_var} set up with external dependencies\n")
-      ELSEIF(FEATURE_${feature}_BUNDLED_CONFIGURED)
-        IF(DEAL_II_FORCE_BUNDLED_${feature})
-          FILE(APPEND ${_log} "      ${_var} set up with bundled packages (forced)\n")
+      STRING(REGEX REPLACE "^DEAL_II_WITH_" "" _feature ${_var})
+      IF(FEATURE_${_feature}_EXTERNAL_CONFIGURED)
+        FILE(APPEND ${_log} "#        ${_var} set up with external dependencies\n")
+        LIST(APPEND _features ${_feature})
+      ELSEIF(FEATURE_${_feature}_BUNDLED_CONFIGURED)
+        LIST(APPEND _features ${_feature})
+        IF(DEAL_II_FORCE_BUNDLED_${_feature})
+          FILE(APPEND ${_log} "#        ${_var} set up with bundled packages (forced)\n")
         ELSE()
-          FILE(APPEND ${_log} "      ${_var} set up with bundled packages\n")
+          FILE(APPEND ${_log} "#        ${_var} set up with bundled packages\n")
         ENDIF()
       ENDIF()
     ELSE()
       # FEATURE is disabled
-      FILE(APPEND ${_log} "    ( ${_var} = ${${_var}} )\n")
+      FILE(APPEND ${_log} "#      ( ${_var} = ${${_var}} )\n")
     ENDIF()
   ENDIF()
 ENDFOREACH()
 
 FILE(APPEND ${_log}
-  "\nComponent configuration:\n"
+  "#\n#  Component configuration:\n"
   )
 FOREACH(_var ${_res})
   IF(_var MATCHES "DEAL_II_COMPONENT")
     IF(${${_var}})
-      FILE(APPEND ${_log} "      ${_var}\n")
+      FILE(APPEND ${_log} "#        ${_var}\n")
+      STRING(REPLACE "DEAL_II_COMPONENT_" "" _component ${_var})
+      LIST(APPEND _components ${_component})
     ELSE()
-      FILE(APPEND ${_log} "    ( ${_var} = ${${_var}} )\n")
+      FILE(APPEND ${_log} "#      ( ${_var} = ${${_var}} )\n")
     ENDIF()
   ENDIF()
 ENDFOREACH()
 
-FILE(READ ${_log} DEAL_II_LOG_SUMMARY)
-MESSAGE("\n\n${DEAL_II_LOG_SUMMARY}\n")
 
+IF("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
+  TO_STRING(_components ${_components})
+  TO_STRING(_features ${_features})
+
+  IF(DISABLE_AUTOPILOT)
+    FILE(APPEND ${_log} "#\n#  Autopilot disabled (DISABLE_AUTOPILOT = ON)\n")
+  ELSE()
+    FILE(APPEND ${_log}
+"#
+###
+
+###
+#
+#  !!! In-source build detected. Activating autopilot. !!!
+#  (If you do not want this, configure with DISABLE_AUTOPILOT = ON)
+#
+#  deal.II configuration (short summary, for the detailed one see above):
+#
+#      CMAKE_BUILD_TYPE:   ${CMAKE_BUILD_TYPE}
+#      CMAKE_SOURCE_DIR:   ${CMAKE_SOURCE_DIR}
+#      CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} on platform ${CMAKE_SYSTEM_NAME}
+#      FEATURES:           ${_features}
+#      COMPONENTS:         ${_components}
+#
+#  You can now run
+#
+#      $ make              - to compile and setup the library in-source
+#
+#      $ make debug        - to switch the build type to \"Debug\"
+#      $ make release      - to switch the build type to \"Release\"
+#      $ make debugrelease - to switch the build type to \"DebugRelease\"
+#      $ make edit_cache   - to change the configuration (e.g. select or deselect features)
+#                            and rerun the configure and generate phases of CMake
+#
+#      $ make clean        - to remove files generated by the build system
+#      $ make distclean    - to clean the directory from _all_ generated files
+#                            (includes clean and the removal of the generated build system)
+#
+#  Have a nice day!
+")
+  ENDIF()
+ENDIF()
+
+FILE(APPEND ${_log}
+  "#\n###"
+  )

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.