]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Use a global property to store object targets
authorMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 6 Jan 2015 10:40:49 +0000 (11:40 +0100)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Mon, 12 Jan 2015 22:21:58 +0000 (23:21 +0100)
cmake/macros/macro_deal_ii_add_library.cmake
cmake/setup_finalize.cmake
source/CMakeLists.txt

index 1d615a8be060d31bbfd62fa3509292bfbe39485f..02f4ed9818463ae8b9eb6c17ddef48ee846ad96d 100644 (file)
@@ -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}
-      "$<TARGET_OBJECTS:${_library}.${_build_lowercase}>\n"
+    SET_PROPERTY(GLOBAL APPEND PROPERTY DEAL_II_OBJECTS_${_build}
+      "$<TARGET_OBJECTS:${_library}.${_build_lowercase}>"
       )
   ENDFOREACH()
 
index e77431c9829ec4e65650d19a4483b27beb0f8eb8..df8eb59672c22e176af486957932c1fd2f11c0df 100644 (file)
@@ -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:
 #
index c36e30dd30f3cce515a855ff2a2214fa7901867c..e2fb2b1835441dafa1986b1a3d2db0d57bf929e3 100644 (file)
@@ -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})
 

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.