ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/contrib/tbb/tbb30_104oss/src)
- LIST(APPEND deal_ii_additional_object_files
- $<TARGET_OBJECTS:obj_tbb>
- )
-
ENDMACRO()
${CMAKE_SOURCE_DIR}/contrib/boost-1.49.0/libs/serialization/src
)
- LIST(APPEND deal_ii_additional_object_files
- $<TARGET_OBJECTS:obj_boost_serialization>
- )
-
IF( DEAL_II_USE_MT AND NOT DEAL_II_CAN_USE_CXX11)
#
# If the C++ compiler doesn't completely support the C++11 standard
ADD_SUBDIRECTORY(
${CMAKE_SOURCE_DIR}/contrib/boost-1.49.0/libs/thread/src
)
-
- LIST(APPEND deal_ii_additional_object_files
- $<TARGET_OBJECTS:obj_boost_thread>
- )
ENDIF()
SET(${var} TRUE)
MACRO(FEATURE_UMFPACK_CONFIGURE_CONTRIB var)
+ #
+ # Add umfpack and amd directly to the object files of deal.II
+ #
+
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/contrib/umfpack/UMFPACK/Include
${CMAKE_SOURCE_DIR}/contrib/umfpack/AMD/Include
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/contrib/umfpack/UMFPACK/Source)
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/contrib/umfpack/AMD/Source)
- #
- # Add umfpack and amd directly to the object files of deal.II
- #
- LIST(APPEND deal_ii_additional_object_files
- ${obj_umfpack_object_files}
- $<TARGET_OBJECTS:obj_amd_int>
- $<TARGET_OBJECTS:obj_amd_long>
- $<TARGET_OBJECTS:obj_amd_global>
- )
-
SET(HAVE_LIBUMFPACK TRUE)
SET(${var} TRUE)
--- /dev/null
+
+#
+# TODO: A comment
+#
+
+MACRO(DEAL_II_ADD_C_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_C_FLAGS_DEBUG}"
+ )
+
+ SET(deal_ii_objects.g
+ ${deal_ii_objects.g}
+ $<TARGET_OBJECTS:${name}.g>
+ PARENT_SCOPE
+ )
+
+ 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_C_FLAGS_RELEASE}"
+ )
+
+ SET(deal_ii_objects
+ ${deal_ii_objects}
+ $<TARGET_OBJECTS:${name}>
+ PARENT_SCOPE
+ )
+ ENDIF()
+
+ENDMACRO()
--- /dev/null
+
+#
+# TODO: A comment
+#
+
+MACRO(DEAL_II_ADD_DEFINITIONS name)
+
+ IF(CMAKE_BUILD_TYPE MATCHES "Debug")
+ GET_TARGET_PROPERTY(macro_definitions ${name}.g COMPILE_DEFINITIONS)
+ SET_TARGET_PROPERTIES(${name}.g PROPERTIES
+ COMPILE_DEFINITIONS "${ARGN};${macro_definitions}"
+ )
+ ENDIF()
+
+ IF(CMAKE_BUILD_TYPE MATCHES "Release")
+ GET_TARGET_PROPERTY(macro_definitions ${name} COMPILE_DEFINITIONS)
+ SET_TARGET_PROPERTIES(${name} PROPERTIES
+ COMPILE_DEFINITIONS "${ARGN};${macro_definitions}"
+ )
+ ENDIF()
+
+ENDMACRO()
+
COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_DEBUG}"
COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_DEBUG}"
)
+
+ SET(deal_ii_objects.g
+ ${deal_ii_objects.g}
+ $<TARGET_OBJECTS:${name}.g>
+ PARENT_SCOPE
+ )
+
ENDIF()
IF(CMAKE_BUILD_TYPE MATCHES "Release")
COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_RELEASE}"
COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_RELEASE}"
)
+
+ SET(deal_ii_objects
+ ${deal_ii_objects}
+ $<TARGET_OBJECTS:${name}>
+ PARENT_SCOPE
+ )
ENDIF()
ENDMACRO()
shared_ptr_helper.cpp
)
-ADD_LIBRARY(obj_boost_serialization OBJECT ${src_boost_serialization})
+DEAL_II_ADD_LIBRARY(obj_boost_serialization OBJECT ${src_boost_serialization})
)
ENDIF()
-ADD_LIBRARY(obj_boost_thread OBJECT ${src_boost_thread})
+DEAL_II_ADD_LIBRARY(obj_boost_thread OBJECT ${src_boost_thread})
IF(DEAL_II_USE_MT_POSIX)
# define UINTMAX_C(x) x ## ULL
# endif
- SET_TARGET_PROPERTIES(obj_boost_thread PROPERTIES
- COMPILE_FLAGS
- "-DBOOST_THREAD_BUILD_LIB -DBOOST_ALL_NO_LIB"
+ DEAL_II_ADD_DEFINITIONS(obj_boost_thread
+ "BOOST_THREAD_BUILD_LIB" "BOOST_ALL_NO_LIB"
)
ELSE()
- SET_TARGET_PROPERTIES(obj_boost_thread PROPERTIES
- COMPILE_FLAGS
- "-DBOOST_THREAD_BUILD_LIB -DBOOST_ALL_NO_LIB -DBOOST_THREAD_POSIX"
+ DEAL_II_ADD_DEFINITIONS(obj_boost_thread
+ "BOOST_THREAD_BUILD_LIB" "BOOST_ALL_NO_LIB" "BOOST_THREAD_POSIX"
)
ENDIF()
-ADD_LIBRARY(obj_functionparser OBJECT "fparser.cc")
+DEAL_II_ADD_LIBRARY(obj_functionparser OBJECT "fparser.cc")
tbb/tbb_thread.cpp
)
-ADD_LIBRARY(obj_tbb OBJECT ${src_tbb})
-
-
-#
-# For debug build -DTBB_USE_DEBUG and -DTBB_DO_ASSERT=1 will be defined
-# globally by the configure script specified.
-#
+DEAL_II_ADD_LIBRARY(obj_tbb OBJECT ${src_tbb})
#
# Add necessary definitions:
#
+SET(obj_tbb_DEFINITIONS)
IF(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
- ADD_FLAGS(obj_tbb_COMPILE_FLAGS "-DDO_ITT_NOTIFY")
+ LIST(APPEND obj_tbb_DEFINITIONS "DO_ITT_NOTIFY")
ENDIF()
IF(DEAL_II_USE_MT_POSIX)
- ADD_FLAGS(obj_tbb_COMPILE_FLAGS "-DUSE_PTHREAD")
+ LIST(APPEND obj_tbb_DEFINITIONS "USE_PTHREAD")
ENDIF()
IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
- ADD_FLAGS(obj_tbb_COMPILE_FLAGS "-DUSE_WINTHREAD")
+ LIST(APPEND obj_tbb_DEFINITIONS "-DUSE_WINTHREAD")
ENDIF()
-SET_TARGET_PROPERTIES(obj_tbb PROPERTIES
- COMPILE_FLAGS ${obj_tbb_COMPILE_FLAGS}
- )
-
+DEAL_II_ADD_DEFINITIONS(obj_tbb ${obj_tbb_DEFINITIONS})
)
-ADD_LIBRARY(obj_amd_int OBJECT ${src_amd})
-SET_TARGET_PROPERTIES(obj_amd_int PROPERTIES COMPILE_FLAGS "-DDINT")
+DEAL_II_ADD_C_LIBRARY(obj_amd_int OBJECT ${src_amd})
+DEAL_II_ADD_DEFINITIONS(obj_amd_int "DINT")
-ADD_LIBRARY(obj_amd_long OBJECT ${src_amd})
-SET_TARGET_PROPERTIES(obj_amd_long PROPERTIES COMPILE_FLAGS "-DDLONG")
+DEAL_II_ADD_C_LIBRARY(obj_amd_long OBJECT ${src_amd})
+DEAL_II_ADD_DEFINITIONS(obj_amd_long "DLONG")
-ADD_LIBRARY(obj_amd_global OBJECT "amd_global.c")
+DEAL_II_ADD_C_LIBRARY(obj_amd_global OBJECT "amd_global.c")
# compile each int and long routine (with no real/complex version)
#-------------------------------------------------------------------------------
-ADD_LIBRARY(obj_umfpack_I_UMF OBJECT ${src_umfpack_UMF})
-SET_TARGET_PROPERTIES(obj_umfpack_I_UMF PROPERTIES COMPILE_FLAGS "-DDINT")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_I_UMF OBJECT ${src_umfpack_UMF})
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_I_UMF "DINT")
-ADD_LIBRARY(obj_umfpack_L_UMF OBJECT ${src_umfpack_UMF})
-SET_TARGET_PROPERTIES(obj_umfpack_L_UMF PROPERTIES COMPILE_FLAGS "-DDLONG")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_L_UMF OBJECT ${src_umfpack_UMF})
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_L_UMF "DLONG")
-ADD_LIBRARY(obj_umfpack_I_UMFPACK OBJECT ${src_umfpack_UMFPACK})
-SET_TARGET_PROPERTIES(obj_umfpack_I_UMFPACK PROPERTIES COMPILE_FLAGS "-DDINT")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_I_UMFPACK OBJECT ${src_umfpack_UMFPACK})
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_I_UMFPACK "DINT")
-ADD_LIBRARY(obj_umfpack_L_UMFPACK OBJECT ${src_umfpack_UMFPACK})
-SET_TARGET_PROPERTIES(obj_umfpack_L_UMFPACK PROPERTIES COMPILE_FLAGS "-DDLONG")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_L_UMFPACK OBJECT ${src_umfpack_UMFPACK})
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_L_UMFPACK "DLONG")
#-------------------------------------------------------------------------------
# compile each routine in the DI version
#-------------------------------------------------------------------------------
-ADD_LIBRARY(obj_umfpack_DI_TSOLVE OBJECT umf_ltsolve.c umf_utsolve.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DI_TSOLVE PROPERTIES COMPILE_FLAGS "-DDINT -DCONJUGATE_SOLVE")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_DI_TSOLVE OBJECT umf_ltsolve.c umf_utsolve.c)
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_DI_TSOLVE "DINT" "CONJUGATE_SOLVE")
-ADD_LIBRARY(obj_umfpack_DI_TRIPLET_MAP_NOX OBJECT umf_triplet.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DI_TRIPLET_MAP_NOX PROPERTIES COMPILE_FLAGS "-DDINT -DDO_MAP")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_DI_TRIPLET_MAP_NOX OBJECT umf_triplet.c)
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_DI_TRIPLET_MAP_NOX "DINT" "DO_MAP")
-ADD_LIBRARY(obj_umfpack_DI_TRIPLET_MAP_X OBJECT umf_triplet.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DI_TRIPLET_MAP_X PROPERTIES COMPILE_FLAGS "-DDINT -DDO_MAP -DDO_VALUES")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_DI_TRIPLET_MAP_X OBJECT umf_triplet.c)
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_DI_TRIPLET_MAP_X "DINT" "DO_MAP" "DO_VALUES")
-ADD_LIBRARY(obj_umfpack_DI_TRIPLET_NOMAP_X OBJECT umf_triplet.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DI_TRIPLET_NOMAP_X PROPERTIES COMPILE_FLAGS "-DDINT -DDO_VALUES")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_DI_TRIPLET_NOMAP_X OBJECT umf_triplet.c)
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_DI_TRIPLET_NOMAP_X "DINT" "DO_VALUES")
-ADD_LIBRARY(obj_umfpack_DI_STORE OBJECT umf_store_lu.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DI_STORE PROPERTIES COMPILE_FLAGS "-DDINT -DDROP")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_DI_STORE OBJECT umf_store_lu.c)
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_DI_STORE "DINT" "DROP")
-ADD_LIBRARY(obj_umfpack_DI_ASSEMBLE OBJECT umf_assemble.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DI_ASSEMBLE PROPERTIES COMPILE_FLAGS "-DDINT -DFIXQ")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_DI_ASSEMBLE OBJECT umf_assemble.c)
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_DI_ASSEMBLE "DINT" "FIXQ")
-ADD_LIBRARY(obj_umfpack_DI_SOLVE OBJECT umfpack_solve.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DI_SOLVE PROPERTIES COMPILE_FLAGS "-DDINT -DWSOLVE")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_DI_SOLVE OBJECT umfpack_solve.c)
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_DI_SOLVE "DINT" "WSOLVE")
#-------------------------------------------------------------------------------
# compile each routine in the DL version
#-------------------------------------------------------------------------------
-ADD_LIBRARY(obj_umfpack_DL_TSOLVE OBJECT umf_ltsolve.c umf_utsolve.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DL_TSOLVE PROPERTIES COMPILE_FLAGS "-DDLONG -DCONJUGATE_SOLVE")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_DL_TSOLVE OBJECT umf_ltsolve.c umf_utsolve.c)
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_TSOLVE "DLONG" "CONJUGATE_SOLVE")
-ADD_LIBRARY(obj_umfpack_DL_TRIPLET_MAP_NOX OBJECT umf_triplet.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DL_TRIPLET_MAP_NOX PROPERTIES COMPILE_FLAGS "-DDLONG -DDO_MAP")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_DL_TRIPLET_MAP_NOX OBJECT umf_triplet.c)
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_TRIPLET_MAP_NOX "DLONG" "DO_MAP")
-ADD_LIBRARY(obj_umfpack_DL_TRIPLET_MAP_X OBJECT umf_triplet.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DL_TRIPLET_MAP_X PROPERTIES COMPILE_FLAGS "-DDLONG -DDO_MAP -DDO_VALUES")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_DL_TRIPLET_MAP_X OBJECT umf_triplet.c)
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_TRIPLET_MAP_X "DLONG" "DO_MAP" "DO_VALUES")
-ADD_LIBRARY(obj_umfpack_DL_TRIPLET_NOMAP_X OBJECT umf_triplet.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DL_TRIPLET_NOMAP_X PROPERTIES COMPILE_FLAGS "-DDLONG -DDO_VALUES")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_DL_TRIPLET_NOMAP_X OBJECT umf_triplet.c)
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_TRIPLET_NOMAP_X "DLONG" "DO_VALUES")
-ADD_LIBRARY(obj_umfpack_DL_STORE OBJECT umf_store_lu.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DL_STORE PROPERTIES COMPILE_FLAGS "-DDLONG -DDROP")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_DL_STORE OBJECT umf_store_lu.c)
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_STORE "DLONG" "DROP")
-ADD_LIBRARY(obj_umfpack_DL_ASSEMBLE OBJECT umf_assemble.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DL_ASSEMBLE PROPERTIES COMPILE_FLAGS "-DDLONG -DFIXQ")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_DL_ASSEMBLE OBJECT umf_assemble.c)
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_ASSEMBLE "DLONG" "FIXQ")
-ADD_LIBRARY(obj_umfpack_DL_SOLVE OBJECT umfpack_solve.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DL_SOLVE PROPERTIES COMPILE_FLAGS "-DDLONG -DWSOLVE")
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_DL_SOLVE OBJECT umfpack_solve.c)
+DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_SOLVE "DLONG" "WSOLVE")
#-------------------------------------------------------------------------------
# Create the generic routines (GN) using a generic rule
#-------------------------------------------------------------------------------
-ADD_LIBRARY(obj_umfpack_GENERIC OBJECT ${src_umfpack_UMFPACK})
-
-
-SET(obj_umfpack_object_files
- $<TARGET_OBJECTS:obj_umfpack_I_UMF>
- $<TARGET_OBJECTS:obj_umfpack_L_UMF>
- $<TARGET_OBJECTS:obj_umfpack_I_UMFPACK>
- $<TARGET_OBJECTS:obj_umfpack_L_UMFPACK>
- $<TARGET_OBJECTS:obj_umfpack_DI_TSOLVE>
- $<TARGET_OBJECTS:obj_umfpack_DI_TRIPLET_MAP_NOX>
- $<TARGET_OBJECTS:obj_umfpack_DI_TRIPLET_MAP_X>
- $<TARGET_OBJECTS:obj_umfpack_DI_TRIPLET_NOMAP_X>
- $<TARGET_OBJECTS:obj_umfpack_DI_STORE>
- $<TARGET_OBJECTS:obj_umfpack_DI_ASSEMBLE>
- $<TARGET_OBJECTS:obj_umfpack_DI_SOLVE>
- $<TARGET_OBJECTS:obj_umfpack_DL_TSOLVE>
- $<TARGET_OBJECTS:obj_umfpack_DL_TRIPLET_MAP_NOX>
- $<TARGET_OBJECTS:obj_umfpack_DL_TRIPLET_MAP_X>
- $<TARGET_OBJECTS:obj_umfpack_DL_TRIPLET_NOMAP_X>
- $<TARGET_OBJECTS:obj_umfpack_DL_STORE>
- $<TARGET_OBJECTS:obj_umfpack_DL_ASSEMBLE>
- $<TARGET_OBJECTS:obj_umfpack_DL_SOLVE>
- $<TARGET_OBJECTS:obj_umfpack_GENERIC>
- )
+DEAL_II_ADD_C_LIBRARY(obj_umfpack_GENERIC OBJECT ${src_umfpack_UMFPACK})
+
${CMAKE_BINARY_DIR}/include/
)
-#
-# Each subdirectory specifies an OBJECT target:
-#
ADD_SUBDIRECTORY(base)
ADD_SUBDIRECTORY(distributed)
ADD_SUBDIRECTORY(dofs)
ADD_SUBDIRECTORY(multigrid)
ADD_SUBDIRECTORY(numerics)
-#
-# Combine all OBJECT targets to a library:
-#
-ADD_LIBRARY(${DEAL_II_BASE_NAME}
- $<TARGET_OBJECTS:obj_base>
- $<TARGET_OBJECTS:obj_distributed>
- $<TARGET_OBJECTS:obj_dofs>
- $<TARGET_OBJECTS:obj_fe>
- $<TARGET_OBJECTS:obj_grid>
- $<TARGET_OBJECTS:obj_hp>
- $<TARGET_OBJECTS:obj_lac>
- $<TARGET_OBJECTS:obj_multigrid>
- $<TARGET_OBJECTS:obj_numerics>
-
- # for contrib stuff:
- ${deal_ii_additional_object_files}
- )
+IF(CMAKE_BUILD_TYPE MATCHES "Debug")
-#
-# Sonaming: Well... we just use the version number.
-# No point to wrack one's brain over the question whether a new version of
-# a C++ library is still ABI backwards compatible :-]
-#
-SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME} PROPERTIES
- VERSION ${VERSION}
- SOVERSION ${VERSION}
- )
+ #
+ # Combine all debug OBJECT targets to a debug library:
+ #
+ ADD_LIBRARY(${DEAL_II_BASE_NAME}${DEAL_II_DEBUG_SUFFIX}
+ ${deal_ii_objects.g}
+ )
-SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME} PROPERTIES
- LINK_FLAGS "${deal_ii_required_linker_flags}"
- )
+ SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}${DEAL_II_DEBUG_SUFFIX}
+ PROPERTIES
+ VERSION ${VERSION}
+ #
+ # Sonaming: Well... we just use the version number.
+ # No point to wrack one's brain over the question whether a new version of
+ # a C++ library is still ABI backwards compatible :-]
+ #
+ SOVERSION ${VERSION}
+ LINK_FLAGS "${DEAL_II_SHARED_LINKER_FLAGS_DEBUG}"
+ COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_DEBUG}"
+ COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_DEBUG}"
+ )
-TARGET_LINK_LIBRARIES(${DEAL_II_BASE_NAME} ${DEAL_II_EXTERNAL_LIBRARIES})
+ TARGET_LINK_LIBRARIES(${DEAL_II_BASE_NAME}${DEAL_II_DEBUG_SUFFIX}
+ "${DEAL_II_EXTERNAL_LIBRARIES};${DEAL_II_EXTERNAL_LIBRARIES_DEBUG}"
+ )
+ INSTALL(TARGETS ${DEAL_II_BASE_NAME}${DEAL_II_DEBUG_SUFFIX}
+ LIBRARY
+ DESTINATION ${DEAL_II_LIBRARY_RELDIR}
+ COMPONENT library
+ )
-#
-# Finally, add a rule how to install the library:
-#
-INSTALL(TARGETS ${DEAL_II_BASE_NAME}
- LIBRARY
- DESTINATION ${DEAL_II_LIBRARY_RELDIR}
- COMPONENT library
- )
+ENDIF()
+
+
+IF(CMAKE_BUILD_TYPE MATCHES "Release")
+
+ #
+ # Combine all debug OBJECT targets to a debug library:
+ #
+ ADD_LIBRARY(${DEAL_II_BASE_NAME}
+ ${deal_ii_objects}
+ )
+
+ SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}
+ PROPERTIES
+ VERSION ${VERSION}
+ #
+ # Sonaming: Well... we just use the version number.
+ # No point to wrack one's brain over the question whether a new version of
+ # a C++ library is still ABI backwards compatible :-]
+ #
+ SOVERSION ${VERSION}
+ LINK_FLAGS "${DEAL_II_SHARED_LINKER_FLAGS_RELEASE}"
+ COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_RELEASE}"
+ COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_RELEASE}"
+ )
+
+ TARGET_LINK_LIBRARIES(${DEAL_II_BASE_NAME}
+ "${DEAL_II_EXTERNAL_LIBRARIES};${DEAL_II_EXTERNAL_LIBRARIES_RELEASE}"
+ )
+
+ INSTALL(TARGETS ${DEAL_II_BASE_NAME}
+ LIBRARY
+ DESTINATION ${DEAL_II_LIBRARY_RELDIR}
+ COMPONENT library
+ )
+
+ENDIF()