Commit 87169e40 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

another CMakeLists correction

parent 81da3eca
......@@ -28,6 +28,10 @@ set(AMDIS_NEED_CXX11 @ENABLE_CXX11@)
set(AMDIS_NEED_UMFPACK @ENABLE_UMFPACK@)
set(AMDIS_HAS_PARALLEL_DOMAIN @ENABLE_PARALLEL_DOMAIN@)
set(AMDIS_NEED_COMPRESSION @ENABLE_COMPRESSION@)
set(AMDIS_NEED_EXTENSIONS @ENABLE_EXTENSIONS@)
set(AMDIS_NEED_BASE_PROBLEMS @ENABLE_BASE_PROBLEMS@)
set(AMDIS_NEED_REINIT @ENABLE_REINIT@)
set(AMDIS_NEED_COMPOSITE_FEM @ENABLE_COMPOSITE_FEM@)
set(BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
......@@ -127,28 +131,49 @@ if (AMDIS_HAS_PARALLEL_DOMAIN)
endif (AMDIS_HAS_PARALLEL_DOMAIN)
# amdis extensions
# ----------------
if (AMDIS_NEED_EXTENSIONS)
find_library(_EXTENSIONS_LIB amdis_extensions PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_EXTENSIONS_LIB)
target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/extensions)
target_link_libraries(amdis_base INTERFACE ${_EXTENSIONS_LIB})
if (AMDIS_NEED_BASE_PROBLEMS)
target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/extensions/base_problems)
endif (AMDIS_NEED_BASE_PROBLEMS)
else ()
message(ERROR "Extensions library not found")
endif ()
unset(_EXTENSIONS_LIB CACHE)
endif (AMDIS_NEED_EXTENSIONS)
# reinit library
# --------------
find_library(_REINIT_LIB amdis_reinit PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_REINIT_LIB)
target_include_directories(amdis_base INTERFACE ${Boost_INCLUDE_DIR}/reinit)
if (AMDIS_NEED_REINIT)
find_library(_REINIT_LIB amdis_reinit PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_REINIT_LIB)
target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/reinit)
target_link_libraries(amdis_base INTERFACE ${_REINIT_LIB})
else ()
else ()
message(ERROR "Reinit library not found")
endif ()
unset(_REINIT_LIB CACHE)
endif ()
unset(_REINIT_LIB CACHE)
endif (AMDIS_NEED_REINIT)
# compositeFEM library
# --------------------
find_library(_COMPOSITE_FEM_LIB amdis_compositeFEM PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_COMPOSITE_FEM_LIB)
if (AMDIS_NEED_COMPOSITE_FEM)
find_library(_COMPOSITE_FEM_LIB amdis_compositeFEM PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_COMPOSITE_FEM_LIB)
target_include_directories(amdis_base INTERFACE ${Boost_INCLUDE_DIR}/compositeFEM)
target_link_libraries(amdis_base INTERFACE ${_COMPOSITE_FEM_LIB})
else ()
else ()
message(ERROR "CompositeFEM library not found")
endif ()
unset(_COMPOSITE_FEM_LIB CACHE)
endif ()
unset(_COMPOSITE_FEM_LIB CACHE)
endif (AMDIS_NEED_COMPOSITE_FEM)
# muparser library
......
......@@ -13,6 +13,12 @@ option(ENABLE_UMFPACK "Enable support for the UMFPACK solver" false)
option(ENABLE_COMPRESSION "Use output compression for vtu and arh files" false)
option(ENABLE_EXTENSIONS "Use extensions for AMDiS" false)
# enable/disable some more features
option(ENABLE_REINIT "Compile reinit library" true)
mark_as_advanced(ENABLE_REINIT)
option(ENABLE_COMPOSITE_FEM "Compile compositeFEM library" true)
mark_as_advanced(ENABLE_COMPOSITE_FEM)
option(BUILD_SHARED_LIBS "Build all libraries as shared or static, default: shared" ON)
if (MSVC)
# if (${CMAKE_VERSION} VERSION_LESS "3.4")
......@@ -198,8 +204,15 @@ if (ENABLE_UMFPACK)
endif (ENABLE_UMFPACK)
include(amdis_parallel) # adds sources to amdis
include(amdis_reinit) # -> target AMDiS::reinit
include(amdis_compositeFEM) # -> target AMDiS::compositeFEM
if (ENABLE_REINIT)
include(amdis_reinit) # -> target AMDiS::reinit
endif (ENABLE_REINIT)
if (ENABLE_COMPOSITE_FEM)
include(amdis_compositeFEM) # -> target AMDiS::compositeFEM
endif (ENABLE_COMPOSITE_FEM)
include(amdis_extensions) # -> target AMDiS::extensions
include(muparser) # -> target muparser
......
......@@ -7,7 +7,7 @@ if (ENABLE_EXTENSIONS)
DOC "Path to AMDiS extensions.")
if (EXTENSIONS_DIR)
if (NOT EXISTS ${EXTENSIONS_DIR}/Helpers.h OR NOT EXISTS ${EXTENSIONS_DIR}/ExtendedProblemStat.h)
message(FATAL_ERROR "Wrong extensions directory! Directory must contain the files 'Helpers.h' and 'ExtendedProblemStath'")
message(FATAL_ERROR "Wrong extensions directory! Directory must contain the files 'Helpers.h' and 'ExtendedProblemStat.h'")
endif ()
add_library(amdis_extensions
......@@ -46,13 +46,16 @@ if (ENABLE_EXTENSIONS)
endif (ENABLE_PARALLEL_DOMAIN)
if (ENABLE_BASE_PROBLEMS)
if (ENABLE_REINIT)
target_sources(amdis_extensions PRIVATE
${EXTENSIONS_DIR}/base_problems/CahnHilliard.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliard_RB.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes_RB.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes_TwoPhase.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes_TwoPhase_RB.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes_TwoPhase_RB.cc)
endif (ENABLE_REINIT)
target_sources(amdis_extensions PRIVATE
${EXTENSIONS_DIR}/base_problems/DiffuseDomainFsi.cc
${EXTENSIONS_DIR}/base_problems/LinearElasticity.cc
${EXTENSIONS_DIR}/base_problems/LinearElasticityPhase.cc
......
if (ENABLE_PARALLEL_DOMAIN)
option(ENABLE_ZOLTAN "Add support for the Parallel Partitioning suite Zoltan" false)
option(ENABLE_PARALLEL_SOLVERS "Add some problem dependent solver, e.g. Feti, Navier-Stokes and Cahn-Hilliard" false)
option(ENABLE_PARALLEL_SOLVERS "Add some problem dependent solver, e.g. Feti, Navier-Stokes and Cahn-Hilliard" true)
mark_as_advanced(ENABLE_PARALLEL_SOLVERS)
add_library(amdis_parallel INTERFACE)
target_sources(amdis PRIVATE
......
if (BOOST_ROOT)
file(TO_NATIVE_PATH ${BOOST_ROOT} BOOST_ROOT)
endif (BOOST_ROOT)
if (BOOST_LIBRARYDIR)
file(TO_NATIVE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR)
endif (BOOST_LIBRARYDIR)
set(BOOST_VERSION "1.48")
set(BOOST_LIBS_REQUIRED system iostreams filesystem program_options date_time)
if (WIN32)
......
......@@ -42,6 +42,10 @@ function (petsc_get_version)
endif ()
endfunction ()
if (PETSC_DIR)
file(TO_NATIVE_PATH ${PETSC_DIR} PETSC_DIR)
endif (PETSC_DIR)
find_path (PETSC_DIR include/petsc.h
HINTS ${AMDIS_PETSC_DIR} $ENV{HOME}/petsc ENV PETSC_DIR
DOC "PETSc Directory")
......
......@@ -3,6 +3,10 @@ if (ENABLE_UMFPACK OR AMDIS_NEED_UMFPACK)
set(SuiteSparse_USE_LAPACK_BLAS ON)
endif (WIN32)
if (SuiteSparse_DIR)
file(TO_NATIVE_PATH ${SuiteSparse_DIR} SuiteSparse_DIR)
endif (SuiteSparse_DIR)
# try to use a cmake-package of suitesparse
find_package(SuiteSparse QUIET HINTS ${AMDIS_SuiteSparse_DIR})
if (SuiteSparse_FOUND)
......@@ -69,6 +73,7 @@ if (ENABLE_UMFPACK OR AMDIS_NEED_UMFPACK)
file(STRINGS ${_UMFPACK_H} UMFPACK_VERSION_LINE REGEX "#define UMFPACK_VERSION")
string(REGEX MATCH "\"UMFPACK V?([^\"]+)\"" UMFPACK_VERSION_REGEX ${UMFPACK_VERSION_LINE})
set(UMFPACK_VERSION ${CMAKE_MATCH_1})
unset(_UMFPACK_H CACHE)
message(STATUS "UMFPACK version: ${UMFPACK_VERSION}")
message(STATUS "Found the following SuiteSparse libraries:")
......@@ -77,8 +82,9 @@ if (ENABLE_UMFPACK OR AMDIS_NEED_UMFPACK)
endforeach ()
endif (FOUND_SUITESPARSE_LIBS)
target_compile_definitions(amdis_base INTERFACE HAVE_UMFPACK=1)
target_compile_definitions(amdis_base INTERFACE MTL_HAS_UMFPACK=1)
target_compile_definitions(amdis_base INTERFACE
HAVE_UMFPACK=1
MTL_HAS_UMFPACK=1)
install(FILES ${BASE_DIR}/cmake3/find_umfpack.cmake DESTINATION share/amdis/)
endif (ENABLE_UMFPACK OR AMDIS_NEED_UMFPACK)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment