#
#
-
-
-
-#
-# General configuration for cmake:
-#
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-
-SET(CMAKE_INCLUDE_CURRENT_DIR true)
-
-SET(CMAKE_MODULE_PATH
- ${CMAKE_MODULE_PATH}
- "${CMAKE_SOURCE_DIR}/contrib/cmake/check/"
- "${CMAKE_SOURCE_DIR}/contrib/cmake/configure/"
- "${CMAKE_SOURCE_DIR}/contrib/cmake/macros/"
- "${CMAKE_SOURCE_DIR}/contrib/cmake/modules/"
- )
-
-
-
-
-#
-# Set up deal.II specific variables
-#
-
-SET(DEAL_II_PACKAGE_BUGREPORT "dealii@dealii.org")
-SET(DEAL_II_PACKAGE_NAME "deal.II")
-SET(DEAL_II_PACKAGE_TARNAME ${DEAL_II_PACKAGE_NAME})
-SET(DEAL_II_PACKAGE_VERSION ${VERSION})
-SET(DEAL_II_PACKAGE_STRING "${DEAL_II_PACKAGE_NAME} ${DEAL_II_PACKAGE_VERSION}")
-SET(DEAL_II_PACKAGE_URL "")
-STRING(REGEX REPLACE "^([0-9]+)\\..*" "\\1" DEAL_II_MAJOR "${VERSION}")
-STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" DEAL_II_MINOR "${VERSION}")
-SET(DEAL_II_PATH ${CMAKE_INSTALL_PREFIX})
-
-
-
-#TODO:
-SET(CMAKE_CXX_FLAGS "-Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native")
-SET(CMAKE_C_FLAGS "-Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native")
-
-
-
-
#
# General configuration options:
#
"Build deal.II with support for zlib."
ON)
+#
+# Options for library selection:
+#
+
OPTION(DEAL_II_ALLOW_CONTRIB
"Allow the use of contrib libraries bundled with the source tarball.
Note: If set to off DEAL_II_FORCE_CONTRIB* will still pull in bundled
"Always use the bundled umfpack library instead of an external one."
OFF)
+#
+# Configuration options regarding linkage:
+#
+
+#OPTION(DEAL_II_SET_SONAME
+# "Set the soname."
+# ON)
+
+#
+# Compatibility support:
+#
+
+OPTION(DEAL_II_COMPAT_MAPPING
+ "Backward compatibility support for functions and classes that do not
+ take an explicit mapping variable, but rather use a default Q1 mapping
+ instead."
+ ON)
+
+
+
+#
+# General configuration for cmake:
+#
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
+
+SET(CMAKE_INCLUDE_CURRENT_DIR true)
+
+SET(CMAKE_MODULE_PATH
+ ${CMAKE_MODULE_PATH}
+ "${CMAKE_SOURCE_DIR}/contrib/cmake/check/"
+ "${CMAKE_SOURCE_DIR}/contrib/cmake/configure/"
+ "${CMAKE_SOURCE_DIR}/contrib/cmake/macros/"
+ "${CMAKE_SOURCE_DIR}/contrib/cmake/modules/"
+ )
+
+
+
+
+#
+# Set up deal.II specific variables
+#
+
+SET(DEAL_II_PACKAGE_BUGREPORT "dealii@dealii.org")
+SET(DEAL_II_PACKAGE_NAME "deal.II")
+SET(DEAL_II_PACKAGE_TARNAME ${DEAL_II_PACKAGE_NAME})
+SET(DEAL_II_PACKAGE_VERSION ${VERSION})
+SET(DEAL_II_PACKAGE_STRING "${DEAL_II_PACKAGE_NAME} ${DEAL_II_PACKAGE_VERSION}")
+SET(DEAL_II_PACKAGE_URL "")
+STRING(REGEX REPLACE "^([0-9]+)\\..*" "\\1" DEAL_II_MAJOR "${VERSION}")
+STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" DEAL_II_MINOR "${VERSION}")
+SET(DEAL_II_PATH ${CMAKE_INSTALL_PREFIX})
+#TODO:
+SET(CMAKE_CXX_FLAGS "-Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native")
+SET(CMAKE_C_FLAGS "-Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native")
+
+
#
# Now, configure a lot of things:
#
# 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 "")
+SET(deal_ii_required_linker_flags "")
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(source)
-
+#
+# Compile the deal.II library
+#
+
+#
+# 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 shared library:
+#
+
ADD_LIBRARY(deal_II SHARED
$<TARGET_OBJECTS:obj_base>
$<TARGET_OBJECTS:obj_distributed>
$<TARGET_OBJECTS:obj_lac>
$<TARGET_OBJECTS:obj_multigrid>
$<TARGET_OBJECTS:obj_numerics>
+
+ # for contrib stuff:
${deal_ii_additional_object_files}
)
+
+#
+# Link all external libraries into the target:
+# TODO: toggle for as-needed
+#
+
+IF (CMAKE_BUILD_TYPE MATCHES "debug")
+ TARGET_LINK_LIBRARIES(deal_II ${deal_ii_required_linker_flags} ${deal_ii_external_debug_libraries})
+ELSE()
+ TARGET_LINK_LIBRARIES(deal_II ${deal_ii_required_linker_flags} ${deal_ii_external_libraries})
+ENDIF()