# This configuration file is shipped with the great FEM-Toolbox AMDiS. # It simplifies the configure of different amdis-versions. # # In order to compile an amdis-project and link against the amdis # (and subsequent) libraries simply add 'AMDiS' to the target_link_libraries # of your executable target. All include-paths and additional libraries are # automatically added. # # For a fast start, you use this package in the following way # simply look for it, possibly set the AMDiS directory # # find_package(AMDiS REQUIRED) # add_executable(yourTarget ) # target_link_libraries(yourTarget AMDiS) # if (${CMAKE_VERSION} VERSION_LESS "3.0") message(FATAL_ERROR "The Configuration file was created for CMake version >= 3.0") endif () list(APPEND CMAKE_MODULE_PATH ${AMDIS_DIR}) set(IS_AMDISCONFIG true) set(AMDIS_USE_FILE ${AMDIS_DIR}/AMDISUse.cmake) set(AMDIS_NEED_ZOLTAN @ENABLE_ZOLTAN@) 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@) add_library(amdis_base INTERFACE) add_library(AMDiS ALIAS amdis_base) target_compile_definitions(amdis_base INTERFACE $<$:DEBUG=0> $<$>:DEBUG=1>) if (AMDIS_NEED_CXX11) target_compile_features(amdis_base INTERFACE cxx_alias_templates cxx_auto_type cxx_lambdas cxx_override cxx_range_for cxx_static_assert cxx_variadic_templates) target_compile_definitions(amdis_base INTERFACE HAS_CXX11=1) else () target_compile_definitions(amdis_base INTERFACE HAS_CXX11=0) endif (AMDIS_NEED_CXX11) # try to detect the AMDiS include directory # ------------------------------------------- find_file(_AMDIS_H AMDiS.h PATHS ${AMDIS_DIR}/../../include/amdis/) if (_AMDIS_H) get_filename_component(AMDIS_INCLUDE_DIR ${_AMDIS_H} PATH CACHE) target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}) include(find_mtl4) else () message(ERROR "Could not detect the AMDiS include directory. Please set the variable AMDIS_INCLUDE_DIR to the directory containing the AMDiS headers.") endif () unset(_AMDIS_H CACHE) # AMDiS base libraries # -------------------- find_library(_AMDIS_LIB amdis PATHS ${AMDIS_DIR}/../../lib/amdis/) if (_AMDIS_LIB) target_link_libraries(amdis_base INTERFACE ${_AMDIS_LIB}) else () message(ERROR "Could not detect the AMDiS library. Please set the variable _AMDIS_LIB to the AMDiS library.") endif () unset(_AMDIS_LIB CACHE) # Boost libraries # --------------- if (NOT BOOST_ROOT) set(BOOST_ROOT @BOOST_ROOT@) endif (NOT BOOST_ROOT) if (NOT BOOST_LIBRARYDIR) set(BOOST_LIBRARYDIR @BOOST_LIBRARYDIR@) endif (NOT BOOST_LIBRARYDIR) include(find_boost) # umfpack library # -------------------- if (AMDIS_NEED_UMFPACK) set(AMDIS_SuiteSparse_DIR @SuiteSparse_DIR@) set(AMDIS_UMFPACK_INCLUDE_DIR @UMFPACK_INCLUDE_DIRS@) set(AMDIS_UMFPACK_LIB_DIR ${AMDIS_UMFPACK_INCLUDE_DIR}/../include) include(find_umfpack) endif (AMDIS_NEED_UMFPACK) # Parallel amdis # -------------- if (AMDIS_HAS_PARALLEL_DOMAIN) target_compile_definitions(amdis_base INTERFACE HAVE_PARALLEL_DOMAIN_AMDIS=1) find_package(MPI REQUIRED) if (MPI_FOUND) target_include_directories(amdis_base INTERFACE ${MPI_INCLUDE_PATH}) target_compile_options(amdis_base INTERFACE ${MPI_COMPILE_FLAGS}) target_link_libraries(amdis_base INTERFACE ${MPI_LIBRARIES}) endif (MPI_FOUND) set(PETSC_EXECUTABLE_RUNS ON) set(AMDIS_PETSC_DIR @PETSC_DIR@) include(find_petsc) if (PETSc_FOUND) target_include_directories(amdis_base INTERFACE ${PETSC_INCLUDES}) target_link_libraries(amdis_base INTERFACE ${PETSC_LIBRARY_SYS} ${PETSC_LIBRARIES} blas lapack) target_compile_definitions(amdis_base INTERFACE HAVE_PARALLEL_PETSC=1) else() message(FATAL_ERROR "Could not find PETSc!") endif (PETSc_FOUND) 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 # -------------- 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 () message(ERROR "Reinit library not found") endif () unset(_REINIT_LIB CACHE) endif (AMDIS_NEED_REINIT) # compositeFEM library # -------------------- 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 () message(ERROR "CompositeFEM library not found") endif () unset(_COMPOSITE_FEM_LIB CACHE) endif (AMDIS_NEED_COMPOSITE_FEM) # muparser library # -------------------- find_library(_MUPARSER_LIB muparser PATHS ${AMDIS_DIR}/../../lib/amdis/) if (_MUPARSER_LIB) target_include_directories(amdis_base INTERFACE ${Boost_INCLUDE_DIR}/muparser) target_link_libraries(amdis_base INTERFACE ${_MUPARSER_LIB}) else () message(ERROR "MuParser library not found") endif () unset(_MUPARSER_LIB CACHE) # Zoltan library # -------------- if (AMDIS_NEED_ZOLTAN) find_library(ZOLTAN_LIB zoltan HINTS ENV LIBRARY_PATH DOC "Full path to the zoltan library") if (ZOLTAN_LIB) target_link_libraries(amdis_base INTERFACE ${ZOLTAN_LIB}) else() message(FATAL_ERROR "Could not find zoltan library!") endif() endif () set(AMDIS_LIBRARIES AMDiS)