]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Update support for Make.global_options.in
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 24 Sep 2012 23:15:56 +0000 (23:15 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 24 Sep 2012 23:15:56 +0000 (23:15 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26698 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/config/CMakeLists.txt
deal.II/config/Config.cmake.in
deal.II/config/Make.global_options.in
deal.II/config/Make.global_options.stub [deleted file]

index 2861ba18429c4b66b180f84bda224a1c6e7a4a50..5a57227ef7105da1ac672c017cb311d523234582 100644 (file)
@@ -48,35 +48,44 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES)
   # actually understands:
   #
 
-  TO_STRING(MAKEFILE_DEFINITIONS
-    ${DEAL_II_EXTERNAL_DEFINITIONS}
-    )
-
   TO_STRING_AND_ADD_PREFIX(MAKEFILE_INCLUDE_DIRS "${CMAKE_INCLUDE_FLAG_C}"
-    ${DEAL_II_EXTERNAL_INCLUDE_DIRS}
+    ${DEAL_II_USER_INCLUDE_DIRS}
     ${DEAL_II_INCLUDE_DIRS}
     )
 
-  #
-  # Add an rpath directive in front of each library, so that libraries
-  # outside of the default search directories will be found by the runtime
-  # dynamic linker:
-  #
-  FOREACH(lib ${DEAL_II_EXTERNAL_LIBRARIES} ${DEAL_II_LIBRARIES})
-    GET_FILENAME_COMPONENT(path ${lib} PATH)
-    LIST(APPEND MAKEFILE_LIBS "-Wl,-rpath  -Wl,${path}")
+  IF(CMAKE_BUILD_TYPE MATCHES "Debug")
+    LIST(APPEND MAKEFILE_BUILD_TYPES "DEBUG")
+  ENDIF()
+  IF(CMAKE_BUILD_TYPE MATCHES "Release")
+    LIST(APPEND MAKEFILE_BUILD_TYPES "RELEASE")
+  ENDIF()
+
+  FOREACH(type ${MAKEFILE_BUILD_TYPES})
+    TO_STRING(MAKEFILE_DEFINITIONS_${type}
+      ${DEAL_II_USER_DEFINITIONS}
+      ${DEAL_II_USER_DEFINITIONS_${type}}
+      )
+    #
+    # Add an rpath directive in front of each library, so that libraries
+    # outside of the default search directories will be found by the runtime
+    # dynamic linker:
     #
-    # Change this into the canonical -L -l format:
+    FOREACH(lib
+        ${DEAL_II_EXTERNAL_LIBRARIES}
+        ${DEAL_II_EXTERNAL_LIBRARIES_${type}}
+        ${DEAL_II_LIBRARIES_${type}})
+      GET_FILENAME_COMPONENT(path ${lib} PATH)
+      LIST(APPEND MAKEFILE_LIBS_${type} "-Wl,-rpath  -Wl,${path}")
+      LIST(APPEND MAKEFILE_LIBS_${type} ${lib})
+    ENDFOREACH()
+    TO_STRING(MAKEFILE_LIBS_${type} ${MAKEFILE_LIBS_${type}})
     #
-    LIST(APPEND MAKEFILE_LIBS ${lib})
+    # Put our linker flags directly in front of this string:
+    #
+    SET(MAKEFILE_LIBS_${type}
+      "${CMAKE_SHARED_LINKER_FLAGS} ${DEAL_II_SHARED_LINKER_FLAGS_${type}} ${MAKEFILE_LIBS_${type}}"
+      )
   ENDFOREACH()
-  TO_STRING(MAKEFILE_LIBS ${MAKEFILE_LIBS})
-  #
-  # Put our linker flags directly in front of this string:
-  #
-  SET(MAKEFILE_LIBS
-    "${CMAKE_SHARED_LINKER_FLAGS} ${MAKEFILE_LIBS}"
-    )
 
   #
   # Boilerplate: The Make.global_options expects variables to be set to
index ee053f69146bfa6c9a6ae755a1981cf1cd5dcfcd..257e0c8e569ffeb4154fa37e019f433caa47b87b 100644 (file)
@@ -19,7 +19,7 @@ SET(DEAL_II_PACKAGE_BUGREPORT "${DEAL_II_PACKAGE_BUGREPORT}")
 SET(DEAL_II_PACKAGE_TARNAME "${DEAL_II_PACKAGE_TARNAME}")
 SET(DEAL_II_PACKAGE_URL "${DEAL_II_PACKAGE_URL}")
 
-SET(DEAL_II_PROJECT_CONFIG_NAME "${DEAL_II_PROJECT_NAME}")
+SET(DEAL_II_PROJECT_CONFIG_NAME "${DEAL_II_PROJECT_CONFIG_NAME}")
 
 
 #
index ff3da8b3c66aa1bac2118a4287f046e4742d44e7..71afead97ed5631a2a5fc7304ada27d0edc3b68d 100644 (file)
@@ -57,7 +57,11 @@ LDFLAGS              = # intentionally left empty and specified in LIBS
 #F77
 #F77-VERSION
 #F77LIBS
-LIBS                 = @MAKEFILE_LIBS@
+ifeq (${debug-mode}, on)
+  LIBS                 = @MAKEFILE_LIBS_DEBUG@
+else
+  LIBS                 = @MAKEFILE_LIBS_RELEASE@
+endif
 LIBDIR               = @CMAKE_INSTALL_PREFIX@/@DEAL_II_LIBRARY_RELDIR@
 #PERL
 #QMAKE
@@ -142,8 +146,8 @@ EXEEXT     = # TODO
 
 
 # set paths to all the libraries we need:
-lib-deal2.o     = ${DEAL_II_LIBRARIES}
-lib-deal2.g     = ${DEAL_II_LIBRARIES}
+lib-deal2.o     = ${DEAL_II_LIBRARIES_RELEASE}
+lib-deal2.g     = ${DEAL_II_LIBRARIES_DEBUG}
 
 
 # include paths as command line flags. while compilers allow a space between
@@ -154,15 +158,15 @@ INCLUDE = ${MAKEFILE_INCLUDE_DIRS}
 
 
 # compiler flags for debug and optimized mode
-CXXFLAGS.g   = @CMAKE_CXX_FLAGS@ ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}} @MAKEFILE_DEFINITIONS@ $(INCLUDE)
-CXXFLAGS.o   = $(CXXFLAGS.g)
+CXXFLAGS.g   = @CMAKE_CXX_FLAGS@ @DEAL_II_CXX_FLAGS_DEBUG@ @MAKEFILE_DEFINITIONS@ @MAKEFILE_DEFINITIONS_DEBUG@ $(INCLUDE)
+CXXFLAGS.o   = @CMAKE_CXX_FLAGS@ @DEAL_II_CXX_FLAGS_RELEASE@ @MAKEFILE_DEFINITIONS@ @MAKEFILE_DEFINITIONS_RELEASE@ $(INCLUDE)
 
 #F77FLAGS.g
 #F77FLAGS.o
 
 # compile flags for C compiler
-CFLAGS.g   = @CMAKE_C_FLAGS@ ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}} @MAKEFILE_DEFINITIONS@
-CFLAGS.o   = $(CFLAGS.g)
+CFLAGS.g   = @CMAKE_C_FLAGS@ @DEAL_II_C_FLAGS_DEBUG@ @MAKEFILE_DEFINITIONS@ @MAKEFILE_DEFINITIONS_DEBUG@
+CFLAGS.o   = @CMAKE_C_FLAGS@ @DEAL_II_C_FLAGS_RELEASE@ @MAKEFILE_DEFINITIONS@ @MAKEFILE_DEFINITIONS_RELEASE@
 
 
 ifeq ($(enable-threads),yes)
diff --git a/deal.II/config/Make.global_options.stub b/deal.II/config/Make.global_options.stub
deleted file mode 100644 (file)
index 52a71e4..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# $Id$
-
-#
-# Compatibility Make.global_options stub file
-#
-
-#
-# Include the correct configuration depending on whether debug-mode is
-# selected, or not:
-#
-
-ifeq ($(debug-mode),on)
-  include $D/common/Make.global_options.Debug
-else
-  include $D/common/Make.global_options.Release
-endif

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.