#
#TODO:
-SET(CMAKE_CXX_FLAGS "-std=c++0x -Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native") #TODO: c++0x Features umschalten
-SET(CMAKE_C_FLAGS "-Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native") #TODO: c++0x Features umschalten
+SET(CMAKE_CXX_FLAGS "-std=c++0x -Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native")
+SET(CMAKE_C_FLAGS "-Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native")
OPTION(DEAL_II_WITH_THREADS
"Build deal.II with support for threads. This pulls in libtbb as a dependency."
# library can be compiled:
ADD_CUSTOM_TARGET(deal_ii_target_dependencies)
-
-
-
-#
-# Platform checks:
-#
-
-INCLUDE(check_for_cxx_features)
-
-INCLUDE(check_for_compiler_bugs)
+# used to keep track of external libraries and necessary linker flags
+SET(deal_ii_external_libraries "")
+SET(deal_ii_external_debug_libraries "")
+SET(deal_ii_required_linker_flags "")
+#
+# Platform checks:
+#
+
+INCLUDE(check_for_cxx_features)
+
+INCLUDE(check_for_compiler_bugs)
+
+
+
+
#
# Build the toolchain:
#
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include/
- ${CMAKE_SOURCE_DIR}/contrib/ #TODO
+ # ${CMAKE_SOURCE_DIR}/contrib/ #TODO
${CMAKE_BINARY_DIR}/include/
)
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(source)
+
FIND_PACKAGE(Threads REQUIRED)
-# TODO: Necessary linker flags for threads? Or are they set automatically
-# by the package?
+LIST(APPEND deal_ii_required_flags ${CMAKE_THREAD_LIBS_INIT})
IF(DEAL_II_ALLOW_CONTRIB)
FIND_PACKAGE(TBB)
SET(DEAL_II_USE_MT TRUE)
-
IF(CMAKE_USE_PTHREADS_INIT)
SET(DEAL_II_USE_MT_POSIX TRUE)
# Check whether posix thread barriers are available:
+ SET(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
CHECK_CXX_SOURCE_COMPILES(
"
#include <pthread.h>
"
DEAL_II_HAVE_MT_POSIX_BARRIERS)
+ SET(CMAKE_REQUIRED_FLAGS "")
+
IF(NOT DEAL_II_HAVE_MT_POSIX_BARRIERS)
SET(DEAL_II_USE_MT_POSIX_NO_BARRIERS TRUE)
ENDIF()
IF(DEAL_II_FORCE_CONTRIB_UMFPACK OR NOT UmfpackAMD_FOUND)
- #
- # Add umfpack and amd directly to the object files of deal.II
- #
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/contrib/umfpack/UMFPACK/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>
)
+
ELSE()
INCLUDE_DIRECTORIES(${Umfpack_INCLUDE_DIR} ${AMD_INCLUDE_DIR})