STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
IF(NOT DEAL_II_HAVE_SANE_MT_DEFINITIONS)
- LIST(APPEND DEAL_II_DEFINITIONS "-D_REENTRANT" "-D_THREAD_SAFE")
- LIST(APPEND DEAL_II_USER_DEFINITIONS "-D_REENTRANT" "-D_THREAD_SAFE") # TODO: Necessary?
+ LIST(APPEND DEAL_II_DEFINITIONS "_REENTRANT" "_THREAD_SAFE")
+ LIST(APPEND DEAL_II_USER_DEFINITIONS "_REENTRANT" "_THREAD_SAFE") # TODO: Necessary?
ENDIF()
ENDIF(Threads_FOUND)
IF(TBB_DEBUG_FOUND)
LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG ${TBB_DEBUG_LIBRARY})
LIST(APPEND DEAL_II_DEFINITIONS_DEBUG
- "-DTBB_USE_DEBUG=1"
- "-DTBB_DO_ASSERT=1"
+ "TBB_USE_DEBUG=1" "TBB_DO_ASSERT=1"
)
ELSE()
MESSAGE(STATUS
#
IF (CMAKE_BUILD_TYPE MATCHES "Debug")
LIST(APPEND DEAL_II_DEFINITIONS_DEBUG
- "-DTBB_DO_DEBUG=1" "-DTBB_DO_ASSERT=1"
+ "TBB_DO_DEBUG=1" "TBB_DO_ASSERT=1"
)
ENDIF()
# library:
#
LIST(APPEND DEAL_II_DEFINITIONS
- "-DBOOST_NO_HASH" "-DBOOST_NO_SLIST"
+ "BOOST_NO_HASH" "BOOST_NO_SLIST"
)
LIST(APPEND DEAL_II_USER_DEFINIITONS
- "-DBOOST_NO_HASH" "-DBOOST_NO_SLIST"
+ "BOOST_NO_HASH" "BOOST_NO_SLIST"
)
INCLUDE_DIRECTORIES(
STRIP_FLAG(CMAKE_REQUIRED_FLAGS "-DHAS_C99_TR1_CMATH")
IF(TRILINOS_HAS_C99_TR1_WORKAROUND)
- LIST(APPEND DEAL_II_DEFINITIONS "-DHAS_C99_TR1_CMATH")
- LIST(APPEND DEAL_II_USER_DEFINITIONS "-DHAS_C99_TR1_CMATH")
+ LIST(APPEND DEAL_II_DEFINITIONS "HAS_C99_TR1_CMATH")
+ LIST(APPEND DEAL_II_USER_DEFINITIONS "HAS_C99_TR1_CMATH")
ELSE()
MESSAGE(WARNING "\n"
"Your Trilinos installation is not compatible with the C++ standard selected for\n"
--- /dev/null
+
+#
+# TODO: A comment
+#
+
+MACRO(DEAL_II_ADD_DEPENDENCIES name target)
+
+ IF(CMAKE_BUILD_TYPE MATCHES "Debug")
+ ADD_DEPENDENCIES(${name}.g ${target}.g)
+ ENDIF()
+
+ IF(CMAKE_BUILD_TYPE MATCHES "Release")
+ ADD_DEPENDENCIES(${name} ${target})
+ ENDIF()
+
+ENDMACRO()
--- /dev/null
+
+#
+# TODO: A comment
+#
+
+MACRO(DEAL_II_ADD_LIBRARY name)
+
+ IF(CMAKE_BUILD_TYPE MATCHES "Debug")
+ #
+ # and a debug target
+ #
+ ADD_LIBRARY(${name}.g
+ ${ARGN}
+ )
+
+ SET_TARGET_PROPERTIES(${name}.g PROPERTIES
+ LINK_FLAGS "${DEAL_II_SHARED_LINKER_FLAGS_DEBUG}"
+ COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_DEBUG}"
+ COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_DEBUG}"
+ )
+ ENDIF()
+
+ IF(CMAKE_BUILD_TYPE MATCHES "Release")
+ #
+ # Add a release target
+ #
+ ADD_LIBRARY(${name}
+ ${ARGN}
+ )
+
+ SET_TARGET_PROPERTIES(${name} PROPERTIES
+ LINK_FLAGS "${DEAL_II_SHARED_LINKER_FLAGS_RELEASE}"
+ COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_RELEASE}"
+ COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_RELEASE}"
+ )
+ ENDIF()
+
+ENDMACRO()
# A macro for the inst.in file expansion
#
# Usage:
-# macro_expand_instantiations(target inst_in_files)
+# EXPAND_INSTANTATIONS(target inst_in_files)
#
# Options:
#
# a list of inst.in files that will be expanded
#
-MACRO(macro_expand_instantiations target inst_in_files)
+MACRO(EXPAND_INSTANTIATIONS target inst_in_files)
FOREACH (inst_in_file ${inst_in_files})
STRING(REGEX REPLACE "\\.in$" "" inst_file "${inst_in_file}" )
# Add a dependency to target so that target.inst is fully generated
# before target will be processed.
#
- ADD_DEPENDENCIES(${target} ${target}.inst)
+ IF(CMAKE_BUILD_TYPE MATCHES "Debug")
+ ADD_DEPENDENCIES(${target}.g ${target}.inst)
+ ENDIF()
+ IF(CMAKE_BUILD_TYPE MATCHES "Release")
+ ADD_DEPENDENCIES(${target} ${target}.inst)
+ ENDIF()
+
ENDMACRO()
IF (CMAKE_BUILD_TYPE MATCHES "Debug")
- LIST(APPEND DEAL_II_DEFINITIONS_DEBUG "-DDEBUG")
- LIST(APPEND DEAL_II_USER_DEFINTIONS_DEBUG "-DDEBUG")
+ LIST(APPEND DEAL_II_DEFINITIONS_DEBUG "DEBUG")
+ LIST(APPEND DEAL_II_USER_DEFINTIONS_DEBUG "DEBUG")
ADD_FLAGS(DEAL_II_CXX_FLAGS_DEBUG "-O0")
utilities.cc
)
-ADD_LIBRARY(obj_base OBJECT ${src_base})
-ADD_DEPENDENCIES(obj_base deal_ii_target_dependencies)
+DEAL_II_ADD_LIBRARY(obj_base OBJECT ${src_base})
+DEAL_II_ADD_DEPENDENCIES(obj_base deal_ii_target_dependencies)
tria.inst.in
)
-ADD_LIBRARY(obj_distributed OBJECT ${src})
-macro_expand_instantiations(obj_distributed "${inst_in_files}")
-ADD_DEPENDENCIES(obj_distributed deal_ii_target_dependencies)
+DEAL_II_ADD_LIBRARY(obj_distributed OBJECT ${src})
+EXPAND_INSTANTIATIONS(obj_distributed "${inst_in_files}")
+DEAL_II_ADD_DEPENDENCIES(obj_distributed deal_ii_target_dependencies)
dof_tools.inst.in
)
-ADD_LIBRARY(obj_dofs OBJECT ${src})
-macro_expand_instantiations(obj_dofs "${inst_in_files}")
-ADD_DEPENDENCIES(obj_dofs deal_ii_target_dependencies)
+DEAL_II_ADD_LIBRARY(obj_dofs OBJECT ${src})
+EXPAND_INSTANTIATIONS(obj_dofs "${inst_in_files}")
+DEAL_II_ADD_DEPENDENCIES(obj_dofs deal_ii_target_dependencies)
mapping_q.inst.in
)
-ADD_LIBRARY(obj_fe OBJECT ${src})
-macro_expand_instantiations(obj_fe "${inst_in_files}")
-ADD_DEPENDENCIES(obj_fe deal_ii_target_dependencies)
+DEAL_II_ADD_LIBRARY(obj_fe OBJECT ${src})
+EXPAND_INSTANTIATIONS(obj_fe "${inst_in_files}")
+DEAL_II_ADD_DEPENDENCIES(obj_fe deal_ii_target_dependencies)
tria_objects.inst.in
)
-ADD_LIBRARY(obj_grid OBJECT ${src})
-macro_expand_instantiations(obj_grid "${inst_in_files}")
-ADD_DEPENDENCIES(obj_grid deal_ii_target_dependencies)
+DEAL_II_ADD_LIBRARY(obj_grid OBJECT ${src})
+EXPAND_INSTANTIATIONS(obj_grid "${inst_in_files}")
+DEAL_II_ADD_DEPENDENCIES(obj_grid deal_ii_target_dependencies)
mapping_collection.inst.in
)
-ADD_LIBRARY(obj_hp OBJECT ${src})
-macro_expand_instantiations(obj_hp "${inst_in_files}")
-ADD_DEPENDENCIES(obj_hp deal_ii_target_dependencies)
+DEAL_II_ADD_LIBRARY(obj_hp OBJECT ${src})
+EXPAND_INSTANTIATIONS(obj_hp "${inst_in_files}")
+DEAL_II_ADD_DEPENDENCIES(obj_hp deal_ii_target_dependencies)
vector_view.inst.in
)
-ADD_LIBRARY(obj_lac OBJECT ${src})
-macro_expand_instantiations(obj_lac "${inst_in_files}")
-ADD_DEPENDENCIES(obj_lac deal_ii_target_dependencies)
+DEAL_II_ADD_LIBRARY(obj_lac OBJECT ${src})
+EXPAND_INSTANTIATIONS(obj_lac "${inst_in_files}")
+DEAL_II_ADD_DEPENDENCIES(obj_lac deal_ii_target_dependencies)
mg_transfer_prebuilt.inst.in
)
-ADD_LIBRARY(obj_multigrid OBJECT ${src})
-macro_expand_instantiations(obj_multigrid "${inst_in_files}")
-ADD_DEPENDENCIES(obj_multigrid deal_ii_target_dependencies)
+DEAL_II_ADD_LIBRARY(obj_multigrid OBJECT ${src})
+EXPAND_INSTANTIATIONS(obj_multigrid "${inst_in_files}")
+DEAL_II_ADD_DEPENDENCIES(obj_multigrid deal_ii_target_dependencies)
vector_tools.inst.in
)
-ADD_LIBRARY(obj_numerics OBJECT ${src})
-macro_expand_instantiations(obj_numerics "${inst_in_files}")
-ADD_DEPENDENCIES(obj_numerics deal_ii_target_dependencies)
+DEAL_II_ADD_LIBRARY(obj_numerics OBJECT ${src})
+EXPAND_INSTANTIATIONS(obj_numerics "${inst_in_files}")
+DEAL_II_ADD_DEPENDENCIES(obj_numerics deal_ii_target_dependencies)