From: Matthias Maier Date: Tue, 6 Jan 2015 10:40:49 +0000 (+0100) Subject: CMake: Use a global property to store object targets X-Git-Tag: v8.2.1~1^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c29cf7389da21936069ed2eeb9fcda062c9cedba;p=dealii.git CMake: Use a global property to store object targets --- diff --git a/cmake/macros/macro_deal_ii_add_library.cmake b/cmake/macros/macro_deal_ii_add_library.cmake index 1d615a8be0..02f4ed9818 100644 --- a/cmake/macros/macro_deal_ii_add_library.cmake +++ b/cmake/macros/macro_deal_ii_add_library.cmake @@ -1,6 +1,6 @@ ## --------------------------------------------------------------------- ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2015 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -44,9 +44,8 @@ MACRO(DEAL_II_ADD_LIBRARY _library) LINKER_LANGUAGE "CXX" ) - FILE(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_${_build_lowercase} - "$\n" + SET_PROPERTY(GLOBAL APPEND PROPERTY DEAL_II_OBJECTS_${_build} + "$" ) ENDFOREACH() diff --git a/cmake/setup_finalize.cmake b/cmake/setup_finalize.cmake index e77431c982..df8eb59672 100644 --- a/cmake/setup_finalize.cmake +++ b/cmake/setup_finalize.cmake @@ -77,19 +77,6 @@ FOREACH(_suffix ${DEAL_II_LIST_SUFFIXES}) ENDIF() ENDFOREACH() -# -# Cleanup some files used for storing the names of all object targets that -# will be bundled to the deal.II library. -# (Right now, i.e. cmake 2.8.8, this is the only reliable way to get -# information into a global scope...) -# -FOREACH(_build ${DEAL_II_BUILD_TYPES}) - STRING(TOLOWER "${_build}" _build_lowercase) - FILE(REMOVE - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_${_build_lowercase} - ) -ENDFOREACH() - # # Cleanup deal.IITargets.cmake in the build directory: # diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index c36e30dd30..e2fb2b1835 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -1,6 +1,6 @@ ## --------------------------------------------------------------------- ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2015 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -55,13 +55,11 @@ FOREACH(build ${DEAL_II_BUILD_TYPES}) # # Combine all ${build} OBJECT targets to a ${build} library: # - FILE(STRINGS - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_${build_lowercase} - deal_ii_objects_${build_lowercase} - ) + + GET_PROPERTY(_objects GLOBAL PROPERTY DEAL_II_OBJECTS_${build}) ADD_LIBRARY(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} dummy.cc # Workaround for a bug in the Xcode generator - ${deal_ii_objects_${build_lowercase}} + ${_objects} ) ADD_DEPENDENCIES(library ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX})