From: maier Date: Sat, 23 Mar 2013 23:57:16 +0000 (+0000) Subject: CMake: Some more documentation and code cleanup X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d0125501edb5cae7d314d20c123e2fc2373e7ed;p=dealii-svn.git CMake: Some more documentation and code cleanup git-svn-id: https://svn.dealii.org/trunk@28999 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/cmake/configure/configure_1_lapack.cmake b/deal.II/cmake/configure/configure_1_lapack.cmake index 773885df39..fb4ff6e4af 100644 --- a/deal.II/cmake/configure/configure_1_lapack.cmake +++ b/deal.II/cmake/configure/configure_1_lapack.cmake @@ -70,9 +70,7 @@ ENDMACRO() MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL) ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}") - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${LAPACK_LIBRARIES}) - CHECK_FOR_LAPACK_FUNCTIONS() ENDMACRO() diff --git a/deal.II/cmake/configure/configure_boost.cmake b/deal.II/cmake/configure/configure_boost.cmake index b5cbc1e6ae..b295d83044 100644 --- a/deal.II/cmake/configure/configure_boost.cmake +++ b/deal.II/cmake/configure/configure_boost.cmake @@ -52,22 +52,20 @@ ENDMACRO() MACRO(FEATURE_BOOST_CONFIGURE_EXTERNAL) - INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR}) + INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS}) + + # + # Transform Boost_LIBRARIES into a list of debug and release libraries + # without keywords: + # + SPLIT_DEBUG_RELEASE(_boost_debug _boost_release ${Boost_LIBRARIES}) IF (CMAKE_BUILD_TYPE MATCHES "Debug") - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG - ${Boost_SERIALIZATION_LIBRARY_DEBUG} - ${Boost_SYSTEM_LIBRARY_DEBUG} - ${Boost_THREAD_LIBRARY_DEBUG} - ) + LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG ${_boost_debug}) ENDIF() IF (CMAKE_BUILD_TYPE MATCHES "Release") - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_RELEASE - ${Boost_SERIALIZATION_LIBRARY_RELEASE} - ${Boost_SYSTEM_LIBRARY_RELEASE} - ${Boost_THREAD_LIBRARY_RELEASE} - ) + LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_RELEASE ${_boost_release}) ENDIF() ENDMACRO() diff --git a/deal.II/cmake/macros/macro_split_debug_release.cmake b/deal.II/cmake/macros/macro_split_debug_release.cmake new file mode 100644 index 0000000000..c39c5fb4c5 --- /dev/null +++ b/deal.II/cmake/macros/macro_split_debug_release.cmake @@ -0,0 +1,53 @@ +##### +## +## Copyright (C) 2013 by the deal.II authors +## +## This file is part of the deal.II library. +## +## +## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later +## version of the LGPL license. +## +## Author: Matthias Maier +## +##### + + +# +# A small macro to split a list of libraries with debug, optimized and +# general keywords into two lists consisting of all libraries necessary for +# the debug and release target only. If no keyword is given "optimized" is +# assumed. +# +# Usage: +# SPLIT_DEBUG_RELEASE(list_debug list_release <...list of libraries...>) +# +# + +MACRO(SPLIT_DEBUG_RELEASE _list_debug _list_release) + + SET(_toggle "optimized") + FOREACH(_tmp ${ARGN}) + IF("${_tmp}" STREQUAL "debug" OR + "${_tmp}" STREQUAL "optimized" OR + "${_tmp}" STREQUAL "general") + SET(_toggle "${_tmp}") + ELSE() + IF("${_toggle}" STREQUAL "general") + LIST(APPEND ${_list_debug} "${_tmp}") + LIST(APPEND ${_list_release} "${_tmp}") + ELSEIF("${_toggle}" STREQUAL "debug") + LIST(APPEND ${_list_debug} "${_tmp}") + ELSEIF("${_toggle}" STREQUAL "optimized") + LIST(APPEND ${_list_release} "${_tmp}") + ENDIF() + ENDIF() + ENDFOREACH() + + IF("${${_list_debug}}" STREQUAL "") + SET(${_list_debug} ${${_list_release}}) + ELSEIF("${${_list_release}}" STREQUAL "") + SET(${_list_release} ${${_list_debug}}) + ENDIF() + +ENDMACRO() diff --git a/deal.II/doc/development/Config.sample b/deal.II/doc/development/Config.sample index a3f61ef7b8..c264cc5592 100644 --- a/deal.II/doc/development/Config.sample +++ b/deal.II/doc/development/Config.sample @@ -151,7 +151,19 @@ # # Boost is a mandatory build time dependency. # -# TODO +# Automatic detection: +# +# SET(Boost_DIR "..." CACHE PATH +# "The preferred installation prefix for searching for boost" +# ) +# +# Have a look at the very long configuration list in FindBoost.cmake. +# +# Manual setup: +# +# SET(Boost_FOUND TRUE CACHE BOOL "") +# SET(Boost_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "") +# SET(Boost_LIBRARIES "libraries;and;semicolon;separated;list;of;link;interface" CACHE STRING "") # @@ -265,7 +277,7 @@ # # SET(MPI_CXX_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "") # SET(MPI_CXX_INCLUDE_PATH "include directory for mpi" CACHE STRING "") -# SET(MPI_CXX_FLAGS "..." CACHE STRING "") +# SET(MPI_CXX_COMPILE_FLAGS "..." CACHE STRING "") # SET(MPI_CXX_LINK_FLAGS "..." CACHE STRING "") #