# 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
#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
# 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
# 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)