#
OPTION(DEAL_II_USE_CONTRIB "Build and use contrib libraries bundled with the source tarball." OFF)
-OPTION(DEAL_II_WITH_UMFPACK "Build deal.II with support for UMFPACK, BLAS and LAPACK." ON)
OPTION(DEAL_II_WITH_THREADS "Build deal.II with support for threads. This pulls in libtbb as a dependency." ON)
-OPTION(DEAL_II_WITH_METIS "Build deal.II with support for Metis." OFF)
-OPTION(DEAL_II_MPI "Build deal.II with support for openmpi." OFF)
OPTION(DEAL_II_FUNCTIONPARSER "BUild deal.II with support for functionparser" ON)
+OPTION(DEAL_II_MPI "Build deal.II with support for openmpi." OFF)
+OPTION(DEAL_II_WITH_UMFPACK "Build deal.II with support for UMFPACK, BLAS and LAPACK." ON)
+OPTION(DEAL_II_WITH_METIS "Build deal.II with support for Metis." OFF)
# TODO: The rest ;-)
-
#
# Configure:
#
SET(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
+ "${CMAKE_SOURCE_DIR}/contrib/cmake/macros/"
"${CMAKE_SOURCE_DIR}/contrib/cmake/modules/"
)
-#
-# DEAL_II_WITH_THREADS:
-#
-
IF(DEAL_II_WITH_THREADS)
- FIND_PACKAGE(Threads REQUIRED)
-
- IF(DEAL_II_USE_CONTRIB)
- # Compiles and links libtbb, exports the TBB_* variables as well:
- ADD_SUBDIRECTORY(contrib/tbb)
- ELSE()
- FIND_PACKAGE(TBB REQUIRED)
- ENDIF()
-
- INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIR})
-
- SET(DEAL_II_USE_MT TRUE)
- SET(DEAL_II_USE_MT_POSIX TRUE)
+ INCLUDE(deal_ii_with_threads)
ENDIF()
-
-#
-#
-#
+IF(DEAL_II_WITH_UMFPACK)
+ INCLUDE(deal_ii_with_umfpack)
+ENDIF()
#
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include/
+ ${CMAKE_SOURCE_DIR}/contrib/ #TODO
${CMAKE_BINARY_DIR}/include/
)
-INCLUDE(${CMAKE_SOURCE_DIR}/contrib/cmake/macros/macro_expand_instantiations.cmake)
+INCLUDE(macro_expand_instantiations)
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(source)
--- /dev/null
+FIND_PACKAGE(Threads REQUIRED)
+
+IF(DEAL_II_USE_CONTRIB)
+ # Compiles and links libtbb, exports the TBB_* variables as well:
+ ADD_SUBDIRECTORY(contrib/tbb)
+ELSE()
+ FIND_PACKAGE(TBB REQUIRED)
+ENDIF()
+
+INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIR})
+# TODO: external_libraries
+
+SET(DEAL_II_USE_MT TRUE)
+SET(DEAL_II_USE_MT_POSIX TRUE)
ADD_CUSTOM_COMMAND(
#
- # TODO: This is very ugly. There should be a better way than calling to a
- # Makefile...
+ # This makes me very, very sad:
#
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${libtbb_directory}/build
COMMAND "make"
${CMAKE_CURRENT_BINARY_DIR}/${libtbb_directory}/build
)
-ADD_CUSTOM_TARGET(contrib ALL DEPENDS tbb)
+ADD_CUSTOM_TARGET(deal_ii_target_dependencies ALL DEPENDS tbb)
SET(TBB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${libtbb_directory}/include)
SET(TBB_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libtbb.so)
-CONFIGURE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/deal.II/lac/lapack_templates.h.in
- ${CMAKE_CURRENT_BINARY_DIR}/deal.II/lac/lapack_templates.h
- )
-
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/deal.II/base/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/deal.II/base/config.h
)
+
+
+#
+#TODO: This perl script has to die...:
+#
+ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deal.II/lac/lapack_templates.h
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/deal.II/lac/
+ COMMAND perl
+ ARGS ${CMAKE_SOURCE_DIR}/common/scripts/lapack_templates.pl
+ ${CMAKE_CURRENT_SOURCE_DIR}/deal.II/lac/lapack_templates.h.in
+ > ${CMAKE_CURRENT_BINARY_DIR}/deal.II/lac/lapack_templates.h
+ )
+
+ADD_CUSTOM_TARGET(deal_ii_target_dependencies ALL
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/deal.II/lac/lapack_templates.h
+ )
)
ADD_LIBRARY(obj_base OBJECT ${src_base})
-ADD_DEPENDENCIES(obj_base contrib)
+ADD_DEPENDENCIES(obj_base deal_ii_target_dependencies)
ADD_LIBRARY(obj_distributed OBJECT ${src})
macro_expand_instantiations(obj_distributed "${inst_in_files}")
-ADD_DEPENDENCIES(obj_distributed contrib)
+ADD_DEPENDENCIES(obj_distributed deal_ii_target_dependencies)
ADD_LIBRARY(obj_dofs OBJECT ${src})
macro_expand_instantiations(obj_dofs "${inst_in_files}")
-ADD_DEPENDENCIES(obj_dofs contrib)
+ADD_DEPENDENCIES(obj_dofs deal_ii_target_dependencies)
ADD_LIBRARY(obj_fe OBJECT ${src})
macro_expand_instantiations(obj_fe "${inst_in_files}")
-ADD_DEPENDENCIES(obj_fe contrib)
+ADD_DEPENDENCIES(obj_fe deal_ii_target_dependencies)
ADD_LIBRARY(obj_grid OBJECT ${src})
macro_expand_instantiations(obj_grid "${inst_in_files}")
-ADD_DEPENDENCIES(obj_grid contrib)
+ADD_DEPENDENCIES(obj_grid deal_ii_target_dependencies)
ADD_LIBRARY(obj_hp OBJECT ${src})
macro_expand_instantiations(obj_hp "${inst_in_files}")
-ADD_DEPENDENCIES(obj_hp contrib)
+ADD_DEPENDENCIES(obj_hp deal_ii_target_dependencies)
ADD_LIBRARY(obj_lac OBJECT ${src})
macro_expand_instantiations(obj_lac "${inst_in_files}")
-ADD_DEPENDENCIES(obj_lac contrib)
+ADD_DEPENDENCIES(obj_lac deal_ii_target_dependencies)
ADD_LIBRARY(obj_multigrid OBJECT ${src})
macro_expand_instantiations(obj_multigrid "${inst_in_files}")
-ADD_DEPENDENCIES(obj_multigrid contrib)
+ADD_DEPENDENCIES(obj_multigrid deal_ii_target_dependencies)
ADD_LIBRARY(obj_numerics OBJECT ${src})
macro_expand_instantiations(obj_numerics "${inst_in_files}")
-ADD_DEPENDENCIES(obj_numerics contrib)
+ADD_DEPENDENCIES(obj_numerics deal_ii_target_dependencies)