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()
${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()