From bdeaaff099f15a01a65231e497728999d28c19ff Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 3 Dec 2013 17:45:43 +0000 Subject: [PATCH] Final cleanup of the build system for the release. git-svn-id: https://svn.dealii.org/trunk@31861 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/CMakeLists.txt | 8 +- deal.II/bundled/CMakeLists.txt | 60 ++------------- deal.II/bundled/setup_bundled.cmake | 74 +++++++++++++++++++ deal.II/cmake/config/CMakeLists.txt | 4 + deal.II/cmake/scripts/CMakeLists.txt | 3 + deal.II/contrib/CMakeLists.txt | 4 + .../contrib/mesh_conversion/CMakeLists.txt | 17 ++--- deal.II/contrib/parameter_gui/CMakeLists.txt | 19 +++-- deal.II/doc/CMakeLists.txt | 11 +-- deal.II/doc/news/changes.h | 10 +++ deal.II/examples/CMakeLists.txt | 4 + deal.II/source/CMakeLists.txt | 4 + 12 files changed, 137 insertions(+), 81 deletions(-) create mode 100644 deal.II/bundled/setup_bundled.cmake diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index 4caaebe4c8..8ae7818a1e 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -88,7 +88,13 @@ INCLUDE(setup_compiler_flags) # Include information about bundled libraries: # IF(DEAL_II_HAVE_BUNDLED_DIRECTORY) - INCLUDE(bundled/CMakeLists.txt) + FILE(GLOB _check_files "bundled/*.cmake") + LIST(SORT _check_files) + FOREACH(_file ${_check_files}) + MESSAGE(STATUS "") + MESSAGE(STATUS "Include ${_file}") + INCLUDE(${_file}) + ENDFOREACH() ENDIF() # diff --git a/deal.II/bundled/CMakeLists.txt b/deal.II/bundled/CMakeLists.txt index ff7abbe921..30e62c7d3f 100644 --- a/deal.II/bundled/CMakeLists.txt +++ b/deal.II/bundled/CMakeLists.txt @@ -15,19 +15,11 @@ ## --------------------------------------------------------------------- # -# Export information about bundled library locations and do the actual -# setup of compilation targets and installation here: +# Compile and install enabled bundled features: # +MESSAGE(STATUS "Setup bundled features") -# -# Boost C++ libraries -# -SET(FEATURE_BOOST_HAVE_BUNDLED TRUE) -OPTION(DEAL_II_FORCE_BUNDLED_BOOST - "Always use the bundled boost library instead of an external one." - OFF) -SET(BOOST_FOLDER "${CMAKE_SOURCE_DIR}/bundled/boost-1.49.0") IF(FEATURE_BOOST_BUNDLED_CONFIGURED) INSTALL(DIRECTORY ${BOOST_FOLDER}/include/boost @@ -35,13 +27,14 @@ 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) - IF( DEAL_II_WITH_THREADS AND NOT DEAL_II_USE_CXX11) + IF(DEAL_II_WITH_THREADS AND NOT DEAL_II_USE_CXX11) # # If the C++ compiler doesn't completely support the C++11 standard # (and consequently we can't use std::thread, std::mutex, etc), then @@ -54,36 +47,11 @@ IF(FEATURE_BOOST_BUNDLED_CONFIGURED) ENDIF() -# -# FunctionParser project: -# -SET(FEATURE_FUNCTIONPARSER_HAVE_BUNDLED TRUE) -OPTION(DEAL_II_FORCE_BUNDLED_FUNCTIONPARSER - "Always use the bundled functionparser library instead of an external one." - OFF) -SET(FUNCTIONPARSER_FOLDER "${CMAKE_SOURCE_DIR}/bundled/functionparser/") - IF(FEATURE_FUNCTIONPARSER_BUNDLED_CONFIGURED) ADD_SUBDIRECTORY(${FUNCTIONPARSER_FOLDER}) ENDIF() -# -# Threading Building Blocks library -# -IF(NOT CMAKE_SYSTEM_NAME MATCHES "CYGWIN" - AND NOT CMAKE_SYSTEM_NAME MATCHES "Windows") - # - # Cygwin is unsupported by tbb, Windows due to the way we compile tbb... - # - SET(FEATURE_THREADS_HAVE_BUNDLED TRUE) - OPTION(DEAL_II_FORCE_BUNDLED_THREADS - "Always use the bundled tbb library instead of an external one." - OFF) - SET(TBB_FOLDER "${CMAKE_SOURCE_DIR}/bundled/tbb41_20130401oss") -ENDIF() - - IF(FEATURE_THREADS_BUNDLED_CONFIGURED) INSTALL(DIRECTORY ${TBB_FOLDER}/include/tbb DESTINATION ${DEAL_II_INCLUDE_RELDIR}/deal.II/bundled @@ -91,6 +59,7 @@ 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" ) @@ -99,25 +68,10 @@ IF(FEATURE_THREADS_BUNDLED_CONFIGURED) ENDIF() -# -# UMFPACK, AMD and UFCONFIG: -# -SET(FEATURE_UMFPACK_HAVE_BUNDLED TRUE) -SET(UMFPACK_FOLDER "${CMAKE_SOURCE_DIR}/bundled/umfpack") -OPTION(DEAL_II_FORCE_BUNDLED_UMFPACK - "Always use the bundled umfpack library instead of an external one." - OFF) - -# -# Resolve a cache invalidation problem by searching for these flags -# unconditionally. They're used for compiling the sources in -# ${UMFPACK_FOLDER}/UMFPACK/Source depending on cached variables. -# -ENABLE_IF_SUPPORTED(_dummy "-Wno-sign-compare") -ENABLE_IF_SUPPORTED(_dummy "-Wno-write-strings") - IF(FEATURE_UMFPACK_BUNDLED_CONFIGURED) ADD_SUBDIRECTORY(${UMFPACK_FOLDER}/UMFPACK/Source) ADD_SUBDIRECTORY(${UMFPACK_FOLDER}/AMD/Source) ENDIF() + +MESSAGE(STATUS "Setup bundled features - Done") diff --git a/deal.II/bundled/setup_bundled.cmake b/deal.II/bundled/setup_bundled.cmake new file mode 100644 index 0000000000..42e1a592b8 --- /dev/null +++ b/deal.II/bundled/setup_bundled.cmake @@ -0,0 +1,74 @@ +## --------------------------------------------------------------------- +## $Id$ +## +## Copyright (C) 2013 by the deal.II authors +## +## This file is part of the deal.II library. +## +## The deal.II library is free software; you can use it, redistribute +## it, and/or modify it under the terms of the GNU Lesser General +## Public License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## The full text of the license can be found in the file LICENSE at +## the top level of the deal.II distribution. +## +## --------------------------------------------------------------------- + +# +# Export information about bundled library locations and do the actual +# setup of compilation targets and installation here: +# + +# +# Boost C++ libraries +# + +SET(FEATURE_BOOST_HAVE_BUNDLED TRUE) + +OPTION(DEAL_II_FORCE_BUNDLED_BOOST + "Always use the bundled boost library instead of an external one." + OFF) + +SET(BOOST_FOLDER "${CMAKE_SOURCE_DIR}/bundled/boost-1.49.0") + +# +# FunctionParser project: +# + +SET(FEATURE_FUNCTIONPARSER_HAVE_BUNDLED TRUE) + +OPTION(DEAL_II_FORCE_BUNDLED_FUNCTIONPARSER + "Always use the bundled functionparser library instead of an external one." + OFF) + +SET(FUNCTIONPARSER_FOLDER "${CMAKE_SOURCE_DIR}/bundled/functionparser/") + +# +# Threading Building Blocks library +# + +IF( NOT CMAKE_SYSTEM_NAME MATCHES "CYGWIN" + AND NOT CMAKE_SYSTEM_NAME MATCHES "Windows" ) + # + # Cygwin is unsupported by tbb, Windows due to the way we compile tbb... + # + SET(FEATURE_THREADS_HAVE_BUNDLED TRUE) + + OPTION(DEAL_II_FORCE_BUNDLED_THREADS + "Always use the bundled tbb library instead of an external one." + OFF) + + SET(TBB_FOLDER "${CMAKE_SOURCE_DIR}/bundled/tbb41_20130401oss") +ENDIF() + +# +# UMFPACK, AMD and UFCONFIG: +# + +SET(FEATURE_UMFPACK_HAVE_BUNDLED TRUE) + +OPTION(DEAL_II_FORCE_BUNDLED_UMFPACK + "Always use the bundled umfpack library instead of an external one." + OFF) + +SET(UMFPACK_FOLDER "${CMAKE_SOURCE_DIR}/bundled/umfpack") diff --git a/deal.II/cmake/config/CMakeLists.txt b/deal.II/cmake/config/CMakeLists.txt index d6b3bb2a89..e499bafbee 100644 --- a/deal.II/cmake/config/CMakeLists.txt +++ b/deal.II/cmake/config/CMakeLists.txt @@ -26,6 +26,8 @@ # two distinct set ups. # +MESSAGE(STATUS "Setup project configuration") + # # Read in auxiliary include directories for the build directory # configuration: @@ -377,3 +379,5 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES) COMPONENT compat_files ) ENDIF() + +MESSAGE(STATUS "Setup project configuration - Done") diff --git a/deal.II/cmake/scripts/CMakeLists.txt b/deal.II/cmake/scripts/CMakeLists.txt index 55aae26c1a..8c38f883de 100644 --- a/deal.II/cmake/scripts/CMakeLists.txt +++ b/deal.II/cmake/scripts/CMakeLists.txt @@ -20,6 +20,8 @@ SET_TARGET_PROPERTIES(expand_instantiations_exe ) IF(DEAL_II_COMPONENT_COMPAT_FILES) + MESSAGE(STATUS "Setup compat_files") + # # Also build and install the old dependency_resolution executable: # @@ -38,4 +40,5 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES) DESTINATION ${DEAL_II_COMMON_RELDIR}/scripts COMPONENT compat_files ) + MESSAGE(STATUS "Setup compat_files - Done") ENDIF() diff --git a/deal.II/contrib/CMakeLists.txt b/deal.II/contrib/CMakeLists.txt index 6e92950efa..0be39e772a 100644 --- a/deal.II/contrib/CMakeLists.txt +++ b/deal.II/contrib/CMakeLists.txt @@ -15,10 +15,14 @@ ## --------------------------------------------------------------------- IF(DEAL_II_COMPONENT_MESH_CONVERTER) + MESSAGE(STATUS "Setup mesh_converter") ADD_SUBDIRECTORY(mesh_conversion) + MESSAGE(STATUS "Setup mesh_converter - Done") ENDIF() IF(DEAL_II_COMPONENT_PARAMETER_GUI) + MESSAGE(STATUS "Setup parameter_gui") ADD_SUBDIRECTORY(parameter_gui) + MESSAGE(STATUS "Setup parameter_gui - Done") ENDIF() diff --git a/deal.II/contrib/mesh_conversion/CMakeLists.txt b/deal.II/contrib/mesh_conversion/CMakeLists.txt index 387797f3e1..ba3190a52d 100644 --- a/deal.II/contrib/mesh_conversion/CMakeLists.txt +++ b/deal.II/contrib/mesh_conversion/CMakeLists.txt @@ -17,26 +17,23 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) #PROJECT(mesh_converter) +IF("${DEAL_II_EXECUTABLE_RELDIR}" STREQUAL "") + SET(DEAL_II_EXECUTABLE_RELDIR "bin") +ENDIF() + ADD_EXECUTABLE(mesh_converter_exe Main.cc MeshConversion.cc ) SET_TARGET_PROPERTIES(mesh_converter_exe - PROPERTIES OUTPUT_NAME mesh_converter + PROPERTIES + OUTPUT_NAME mesh_converter + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR}" ) ADD_DEPENDENCIES(mesh_converter mesh_converter_exe) -IF("${DEAL_II_EXECUTABLE_RELDIR}" STREQUAL "") - SET(DEAL_II_EXECUTABLE_RELDIR "bin") -ENDIF() - INSTALL(TARGETS mesh_converter_exe RUNTIME DESTINATION ${DEAL_II_EXECUTABLE_RELDIR} COMPONENT mesh_converter ) -EXPORT(TARGETS mesh_converter_exe - FILE - ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake - APPEND - ) diff --git a/deal.II/contrib/parameter_gui/CMakeLists.txt b/deal.II/contrib/parameter_gui/CMakeLists.txt index b0350b59e0..cebf057f95 100644 --- a/deal.II/contrib/parameter_gui/CMakeLists.txt +++ b/deal.II/contrib/parameter_gui/CMakeLists.txt @@ -17,6 +17,10 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) #PROJECT(parameter_gui) +IF("${DEAL_II_EXECUTABLE_RELDIR}" STREQUAL "") + SET(DEAL_II_EXECUTABLE_RELDIR "bin") +ENDIF() + FIND_PACKAGE(Qt4 REQUIRED QtCore QtGui QtXml) MARK_AS_ADVANCED(QT_QMAKE_EXECUTABLE) @@ -46,21 +50,16 @@ ADD_EXECUTABLE(parameter_gui_exe ${SOURCE_MOC} ${SOURCE_RCC} ) -SET_TARGET_PROPERTIES(parameter_gui_exe PROPERTIES OUTPUT_NAME parameter_gui) +SET_TARGET_PROPERTIES(parameter_gui_exe + PROPERTIES + OUTPUT_NAME parameter_gui + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR}" + ) TARGET_LINK_LIBRARIES(parameter_gui_exe ${QT_LIBRARIES}) ADD_DEPENDENCIES(parameter_gui parameter_gui_exe) -IF("${DEAL_II_EXECUTABLE_RELDIR}" STREQUAL "") - SET(DEAL_II_EXECUTABLE_RELDIR "bin") -ENDIF() - INSTALL(TARGETS parameter_gui_exe RUNTIME DESTINATION ${DEAL_II_EXECUTABLE_RELDIR} COMPONENT parameter_gui ) -EXPORT(TARGETS parameter_gui_exe - FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake - APPEND - ) - diff --git a/deal.II/doc/CMakeLists.txt b/deal.II/doc/CMakeLists.txt index ff3bc2d970..c4ec069aff 100644 --- a/deal.II/doc/CMakeLists.txt +++ b/deal.II/doc/CMakeLists.txt @@ -14,14 +14,13 @@ ## ## --------------------------------------------------------------------- - - - # # Set up all necessary bits for the documentation # IF(DEAL_II_COMPONENT_DOCUMENTATION) + MESSAGE(STATUS "Setup documentation") + # # Required packages for the document generation: # @@ -46,10 +45,6 @@ IF(DEAL_II_COMPONENT_DOCUMENTATION) # Generate the source documentation via doxygen: # ADD_SUBDIRECTORY(doxygen) - - # - # A custom target with the same name as the component: - # ADD_DEPENDENCIES(documentation doxygen) # @@ -73,6 +68,8 @@ IF(DEAL_II_COMPONENT_DOCUMENTATION) COMPONENT documentation ) + MESSAGE(STATUS "Setup documentation - Done") + ENDIF(DEAL_II_COMPONENT_DOCUMENTATION) # diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 561b61f680..18464c88da 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -113,6 +113,16 @@ inconvenience this causes.
    +
  1. Improved: The build system now supports usage of the library + out of the build directory without prior installation. This is done by + exporting an additional project configuration just for the build directory. + Furthermore, a bunch of convenience targets get now defined that just build + individual components (such as just the documentation or the libraries), and + if CMAKE_INSTALL_PREFIX is set, also install that specific component. +
    + (Matthias Maier, Luca Heltai, 2013/12/03) +
  2. +
  3. Fixed: Missing instantiations of SparseDirectMUMPS have been added.
    (Timo Heister, 2013/11/25) diff --git a/deal.II/examples/CMakeLists.txt b/deal.II/examples/CMakeLists.txt index 3655a42bf1..45f41856a9 100644 --- a/deal.II/examples/CMakeLists.txt +++ b/deal.II/examples/CMakeLists.txt @@ -15,6 +15,8 @@ ## --------------------------------------------------------------------- IF(DEAL_II_COMPONENT_EXAMPLES) + MESSAGE(STATUS "Setup examples") + INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION ${DEAL_II_EXAMPLES_RELDIR} COMPONENT examples @@ -42,4 +44,6 @@ IF(DEAL_II_COMPONENT_EXAMPLES) PATTERN "untitled.geo" # step-49 PATTERN "untitled.msh" # step-49 ) + + MESSAGE(STATUS "Setup examples - Done") ENDIF() diff --git a/deal.II/source/CMakeLists.txt b/deal.II/source/CMakeLists.txt index cabda8f8fd..dd6de69d3e 100644 --- a/deal.II/source/CMakeLists.txt +++ b/deal.II/source/CMakeLists.txt @@ -14,6 +14,8 @@ ## ## --------------------------------------------------------------------- +MESSAGE(STATUS "Setup library") + # # Compile the deal.II library # @@ -114,3 +116,5 @@ INSTALL(EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets DESTINATION ${DEAL_II_PROJECT_CONFIG_RELDIR} COMPONENT library ) + +MESSAGE(STATUS "Setup library - Done") -- 2.39.5