Commit c5e96515 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

extensions moved to AMDiS src dir, nanoflann and pugixml extracted to lib dir

parent 37f7406f
......@@ -14,7 +14,7 @@ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose the type of build, options are: None Debug Release [RelWithDebInfo] MinSizeRel."
"Choose the type of build, options are: Debug Release [RelWithDebInfo] MinSizeRel."
FORCE)
endif ()
......@@ -55,6 +55,12 @@ cmake_dependent_option(ENABLE_BDDCML
"ENABLE_PARALLEL_DOMAIN" false)
# }
# additional options for Extensions
# {
cmake_dependent_option(ENABLE_BASE_PROBLEMS
"Use base_problems" true
"ENABLE_EXTENSIONS" false)
# }
# enable/disable some more features
option(ENABLE_COMPRESSION "Use output compression for vtu and arh files" true)
......@@ -96,9 +102,9 @@ endif ()
add_subdirectory(cmake)
add_subdirectory(lib)
add_subdirectory(src)
if (ENABLE_EXTENSIONS)
add_subdirectory(../extensions extensions)
endif (ENABLE_EXTENSIONS)
# if (ENABLE_EXTENSIONS)
# add_subdirectory(../extensions extensions)
# endif (ENABLE_EXTENSIONS)
if(TARGET AMDiS::AMDiS)
feature_summary(WHAT ALL)
......
......@@ -10,17 +10,26 @@ find_dependency(MTL REQUIRED)
target_enable_boost()
find_dependency(MuParser REQUIRED)
# add sequential/parallel dependencies and add the amdis import target
if(AMDiS_FIND_REQUIRED_SEQUENTIAL AND NOT TARGET AMDiS::AMDiS-s)
find_dependency(UMFPACK REQUIRED)
find_dependency(UMFPACK)
find_dependency(HYPRE)
find_dependency(PNG)
find_dependency(PETSc)
find_dependency(MPI)
include("${AMDiS_CMAKE_DIR}/AMDiSTargets-s.cmake")
set(AMDiS_SEQUENTIAL_FOUND TRUE)
elseif(AMDiS_FIND_REQUIRED_PARALLEL AND NOT TARGET AMDiS::AMDiS-p)
find_dependency(MPI)
find_dependency(PETSc)
find_dependency(MPI REQUIRED)
find_dependency(PETSc REQUIRED)
find_dependency(Zoltan)
find_dependency(BDDCML)
include("${AMDiS_CMAKE_DIR}/AMDiSTargets-p.cmake")
set(AMDiS_PARALLEL_FOUND TRUE)
endif()
# add alias AMDiS that links to the sequential version by default
# only if component=PARALLEL it links to the parallel version
if (AMDiS_FIND_REQUIRED_SEQUENTIAL OR NOT AMDiS_FIND_REQUIRED_PARALLEL)
add_library(AMDiS INTERFACE)
target_link_libraries(AMDiS INTERFACE AMDiS::AMDiS-s)
......
......@@ -22,15 +22,13 @@ write_basic_package_version_file(
install(FILES
${PROJECT_CONFIG_VERSION_FILE}
${PROJECT_CONFIG_FILE}
#FindMPI.cmake
FindBDDCML.cmake
FindHYPRE.cmake
FindMTL.cmake
FindPETSc.cmake
FindUMFPACK.cmake
FindZoltan.cmake
parse_zoltan_makefile.cmake
target_enable_bddcml.cmake
target_enable_boost.cmake
target_enable_cxx11.cmake
target_enable_hypre.cmake
target_enable_png.cmake
target_enable_zoltan.cmake
DESTINATION ${INSTALL_CONFIG_DIR})
# FindBDDCML.cmake
#
# Finds the BDDCML library
#
# This will define the following variables
#
# BDDCML_FOUND
#
# and the following imported targets
#
# BDDCML::BDDCML
#
# Author: Simon Praetorius <simon.praetorius@tu-dresden.de>
mark_as_advanced(BDDCML_FOUND BDDCML_INCLUDE_DIR BDDCML_LIBRARY)
find_library(BDDCML_LIBRARY bddcml
HINTS
${AMDIS_BDDCML_ROOT_DIR}
${BDDCML_ROOT}
${PETSC_LIBRARY_DIRS}
ENV BDDCML_ROOT
ENV EBROOTBDDCML
PATH_SUFFIXES lib/ lib64/
DOC "Library file for BDDCML"
)
find_file(BDDCML_HEADER bddcml_interface_c.h
HINTS
${AMDIS_BDDCML_ROOT_DIR}
${BDDCML_ROOT}
${PETSC_INCLUDE_DIRS}
ENV BDDCML_ROOT
ENV EBROOTBDDCML
PATH_SUFFIXES include/
DOC "Headerfile bddcml_interface_c.h for BDDCML"
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(BDDCML
REQUIRED_VARS BDDCML_LIBRARY BDDCML_HEADER
)
if(BDDCML_FOUND AND MPI_FOUND AND NOT TARGET BDDCML::BDDCML)
add_library(BDDCML::BDDCML INTERFACE IMPORTED)
get_filename_component(BDDCML_INCLUDE_DIR ${BDDCML_HEADER} PATH)
set_target_properties(BDDCML::BDDCML PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${BDDCML_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${BDDCML_LIBRARY}"
)
endif()
# FindHYPRE.cmake
#
# Finds the HYPRE library
#
# This will define the following variables
#
# HYPRE_FOUND
#
# and the following imported targets
#
# HYPRE::HYPRE
#
# Author: Simon Praetorius <simon.praetorius@tu-dresden.de>
mark_as_advanced(HYPRE_FOUND HYPRE_LIBRARY HYPRE_HEADER)
find_library(HYPRE_LIBRARY HYPRE
HINTS
${AMDIS_HYPRE_ROOT_DIR}
${HYPRE_ROOT}
${PETSC_LIBRARY_DIRS}
ENV HYPRE_ROOT
ENV EBROOTHYPRE
PATH_SUFFIXES lib/ lib64/
DOC "Library file for HYPRE"
)
find_file(HYPRE_HEADER HYPRE.h
HINTS
${AMDIS_HYPRE_ROOT_DIR}
${HYPRE_ROOT}
${PETSC_INCLUDE_DIRS}
ENV HYPRE_ROOT
ENV EBROOTHYPRE
PATH_SUFFIXES include/
DOC "Headerfile hypre.h for HYPRE"
)
find_package(MPI QUIET COMPONENTS CXX)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HYPRE
REQUIRED_VARS HYPRE_LIBRARY HYPRE_HEADER MPI_FOUND
)
if(HYPRE_FOUND AND MPI_FOUND AND NOT TARGET HYPRE::HYPRE)
add_library(HYPRE::HYPRE INTERFACE IMPORTED)
get_filename_component(HYPRE_INCLUDE_DIR ${HYPRE_HEADER} PATH)
get_filename_component(HYPRE_LIB_DIR ${HYPRE_LIBRARY} PATH)
file(GLOB HYPRE_LIBS ${HYPRE_LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}HYPRE*${CMAKE_SHARED_LIBRARY_SUFFIX})
list(APPEND HYPRE_LIBS ${HYPRE_LIBRARY})
find_package(LAPACK QUIET)
if (LAPACK_FOUND)
list(APPEND HYPRE_LIBS ${LAPACK_LIBRARIES})
set_target_properties(HYPRE::HYPRE PROPERTIES
INTERFACE_LINK_OPTIONS "${LAPACK_LINKER_FLAGS}"
)
endif (LAPACK_FOUND)
set_target_properties(HYPRE::HYPRE PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${HYPRE_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${HYPRE_LIBS}"
)
target_link_libraries(HYPRE::HYPRE INTERFACE MPI::MPI_CXX)
endif()
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindPNG
# -------
#
# Find libpng, the official reference library for the PNG image format.
#
# Imported targets
# ^^^^^^^^^^^^^^^^
#
# This module defines the following :prop_tgt:`IMPORTED` target:
#
# ``PNG::PNG``
# The libpng library, if found.
#
# Result variables
# ^^^^^^^^^^^^^^^^
#
# This module will set the following variables in your project:
#
# ``PNG_INCLUDE_DIRS``
# where to find png.h, etc.
# ``PNG_LIBRARIES``
# the libraries to link against to use PNG.
# ``PNG_DEFINITIONS``
# You should add_definitions(${PNG_DEFINITIONS}) before compiling code
# that includes png library files.
# ``PNG_FOUND``
# If false, do not try to use PNG.
# ``PNG_VERSION_STRING``
# the version of the PNG library found (since CMake 2.8.8)
#
# Obsolete variables
# ^^^^^^^^^^^^^^^^^^
#
# The following variables may also be set, for backwards compatibility:
#
# ``PNG_LIBRARY``
# where to find the PNG library.
# ``PNG_INCLUDE_DIR``
# where to find the PNG headers (same as PNG_INCLUDE_DIRS)
#
# Since PNG depends on the ZLib compression library, none of the above
# will be defined unless ZLib can be found.
if(PNG_FIND_QUIETLY)
set(_FIND_ZLIB_ARG QUIET)
endif()
find_package(ZLIB ${_FIND_ZLIB_ARG})
if(ZLIB_FOUND)
find_path(PNG_PNG_INCLUDE_DIR png.h HINTS ${PNG_ROOT} ENV PNG_ROOT PATH_SUFFIXES include include/libpng include/libpng16)
if (NOT PNG_PNG_INCLUDE_DIR)
message(FATAL_ERROR "PNG header png.h not found. Specify PNG_ROOT as root directory of your PNG installation")
endif ()
list(APPEND PNG_NAMES png libpng)
unset(PNG_NAMES_DEBUG)
set(_PNG_VERSION_SUFFIXES 17 16 15 14 12)
if (PNG_FIND_VERSION MATCHES "^([0-9]+)\\.([0-9]+)(\\..*)?$")
set(_PNG_VERSION_SUFFIX_MIN "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
if (PNG_FIND_VERSION_EXACT)
set(_PNG_VERSION_SUFFIXES ${_PNG_VERSION_SUFFIX_MIN})
else ()
string(REGEX REPLACE
"${_PNG_VERSION_SUFFIX_MIN}.*" "${_PNG_VERSION_SUFFIX_MIN}"
_PNG_VERSION_SUFFIXES "${_PNG_VERSION_SUFFIXES}")
endif ()
unset(_PNG_VERSION_SUFFIX_MIN)
endif ()
foreach(v IN LISTS _PNG_VERSION_SUFFIXES)
list(APPEND PNG_NAMES png${v} libpng${v})
list(APPEND PNG_NAMES_DEBUG png${v}d libpng${v}d)
endforeach()
unset(_PNG_VERSION_SUFFIXES)
# For compatibility with versions prior to this multi-config search, honor
# any PNG_LIBRARY that is already specified and skip the search.
if(NOT PNG_LIBRARY)
find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES} HINTS ${PNG_ROOT} ENV PNG_ROOT PATH_SUFFIXES lib lib64)
find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG} HINTS ${PNG_ROOT} ENV PNG_ROOT PATH_SUFFIXES lib lib64)
if (NOT PNG_LIBRARY_RELEASE AND NOT PNG_LIBRARY_DEBUG)
message(FATAL_ERROR "PNG library {${PNG_NAMES}} not found. Specify PNG_ROOT as root directory of your PNG installation")
endif ()
include(SelectLibraryConfigurations)
select_library_configurations(PNG)
mark_as_advanced(PNG_LIBRARY_RELEASE PNG_LIBRARY_DEBUG)
endif()
unset(PNG_NAMES)
unset(PNG_NAMES_DEBUG)
# Set by select_library_configurations(), but we want the one from
# find_package_handle_standard_args() below.
unset(PNG_FOUND)
if (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
# png.h includes zlib.h. Sigh.
set(PNG_INCLUDE_DIRS ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
set(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIRS} ) # for backward compatibility
set(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY})
if (CYGWIN)
if(BUILD_SHARED_LIBS)
# No need to define PNG_USE_DLL here, because it's default for Cygwin.
else()
set (PNG_DEFINITIONS -DPNG_STATIC)
endif()
endif ()
if(NOT TARGET PNG::PNG)
add_library(PNG::PNG UNKNOWN IMPORTED)
set_target_properties(PNG::PNG PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${PNG_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${PNG_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
if(EXISTS "${PNG_LIBRARY}")
set_target_properties(PNG::PNG PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${PNG_LIBRARY}")
endif()
if(EXISTS "${PNG_LIBRARY_RELEASE}")
set_property(TARGET PNG::PNG APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(PNG::PNG PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
IMPORTED_LOCATION_RELEASE "${PNG_LIBRARY_RELEASE}")
endif()
if(EXISTS "${PNG_LIBRARY_DEBUG}")
set_property(TARGET PNG::PNG APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(PNG::PNG PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
IMPORTED_LOCATION_DEBUG "${PNG_LIBRARY_DEBUG}")
endif()
endif()
endif ()
if (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")
file(STRINGS "${PNG_PNG_INCLUDE_DIR}/png.h" png_version_str REGEX "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\".+\"")
string(REGEX REPLACE "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\"([^\"]+)\".*" "\\1" PNG_VERSION_STRING "${png_version_str}")
unset(png_version_str)
endif ()
else()
message(FATAL_ERROR "zlib required for PNG. Specify ZLIB_ROOT as root directory of your zlib installation.")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PNG
REQUIRED_VARS PNG_LIBRARY PNG_PNG_INCLUDE_DIR
VERSION_VAR PNG_VERSION_STRING)
mark_as_advanced(PNG_PNG_INCLUDE_DIR PNG_LIBRARY )
......@@ -15,7 +15,7 @@
# Author: Simon Praetorius <simon.praetorius@tu-dresden.de>
mark_as_advanced(UMFPACK_FOUND UMFPACK_COMPILE_OPTIONS UMFPACK_INCLUDE_DIR)
mark_as_advanced(UMFPACK_FOUND UMFPACK_LIBRARY UMFPACK_HEADER)
find_library(UMFPACK_LIBRARY umfpack
HINTS
......@@ -58,9 +58,9 @@ if(UMFPACK_FOUND AND NOT TARGET UMFPACK::UMFPACK)
if (_lib)
list(APPEND SUITESPARSE_LIBS ${_lib})
endif (_lib)
unset(_lib)
unset(_lib CACHE)
endforeach(_comp)
unset(_comp)
unset(_comp CACHE)
find_package(BLAS QUIET)
if (BLAS_FOUND)
......
# FindZoltan.cmake
#
# Finds the Zoltan library
#
# This will define the following variables
#
# Zoltan_FOUND
# ZOLTAN_INCLUDE_DIR
# ZOLTAN_LIBS
#
# and the following imported targets
#
# Zoltan::Zoltan
#
# Author: Simon Praetorius <simon.praetorius@tu-dresden.de>
mark_as_advanced(Zoltan_FOUND ZOLTAN_INCLUDE_DIR ZOLTAN_LIBS)
find_package(Zoltan QUIET)
if (Zoltan_FOUND)
find_file(ZOLTAN_HEADER zoltan.h HINTS ${Zoltan_INCLUDE_DIRS})
if (ZOLTAN_HEADER)
set(ZOLTAN_INCLUDE_DIR ${Zoltan_INCLUDE_DIRS})
endif (ZOLTAN_HEADER)
set(ZOLTAN_LIBS "")
foreach (LIB_NAME ${Zoltan_LIBRARIES})
find_library(_ZOLTAN_LIB ${LIB_NAME} HINTS ${Zoltan_LIBRARY_DIRS})
if (_ZOLTAN_LIB)
list(APPEND ZOLTAN_LIBS ${_ZOLTAN_LIB})
else ()
message(FATAL_ERROR "Could not find library \"${LIB_NAME}\" in directories ${Zoltan_LIBRARY_DIRS}!")
endif ()
unset(_ZOLTAN_LIB CACHE)
endforeach(LIB_NAME)
else (Zoltan_FOUND)
find_file(ZOLTAN_HEADER zoltan.h
HINTS
${ZOLTAN_ROOT}
${PETSC_INCLUDE_DIRS}
ENV ZOLTAN_ROOT
ENV EBROOTZOLTAN
PATH_SUFFIXES include/
)
if (ZOLTAN_HEADER)
get_filename_component(ZOLTAN_INCLUDE_DIR "${ZOLTAN_HEADER}" PATH CACHE)
endif (ZOLTAN_HEADER)
find_library(ZOLTAN_LIB zoltan
HINTS
${Zoltan_INCLUDE_DIR}/..
${ZOLTAN_ROOT}
${PETSC_LIB_DIRS}
ENV ZOLTAN_ROOT
ENV EBROOTZOLTAN
PATH_SUFFIXES lib/ lib64/
)
include(parse_zoltan_makefile)
find_file(ZOLTAN_CONFIG_FILE Makefile.export.zoltan HINTS ${Zoltan_INCLUDE_DIR})
if (ZOLTAN_CONFIG_FILE)
set(ZOLTAN_LIBS ${ZOLTAN_LIB})
parse_zoltan_makefile(${ZOLTAN_CONFIG_FILE} ZOLTAN_LIBS)
else ()
message(WARNING "Zoltan configuration file Makefile.export.zoltan not found!")
endif ()
endif (Zoltan_FOUND)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Zoltan
REQUIRED_VARS ZOLTAN_INCLUDE_DIR ZOLTAN_LIBS
CONFIG_MODE
)
if(Zoltan_FOUND AND NOT TARGET Zoltan::Zoltan)
add_library(Zoltan::Zoltan INTERFACE IMPORTED)
set_target_properties(Zoltan::Zoltan PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ZOLTAN_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${ZOLTAN_LIBS}"
)
# extract Zoltan version number
if (ZOLTAN_HEADER)
file(STRINGS ${ZOLTAN_HEADER} ZOLTAN_VERSION_LINE REGEX "#define ZOLTAN_VERSION_NUMBER")
string(REGEX MATCH "([0-9]+[.][0-9]+)" ZOLTAN_VERSION_REGEX ${ZOLTAN_VERSION_LINE})
set(Zoltan_VERSION ${CMAKE_MATCH_1})
endif (ZOLTAN_HEADER)
endif()
macro(parse_zoltan_makefile _FILE_ _TARGET_ _SCOPE_)
macro(parse_zoltan_makefile _FILE_ _OUTPUT_)
# parse zoltan extra libs AND ld flags
file(STRINGS ${_FILE_} ZOLTAN_EXTRA_LIBS_LINE REGEX "ZOLTAN_EXTRA_LIBS")
......@@ -25,7 +25,7 @@ macro(parse_zoltan_makefile _FILE_ _TARGET_ _SCOPE_)
if (NOT _ZOLTAN_EXTERN_LIB)
message(FATAL_ERROR "Could not find library \"${LIB_NAME}\" in directories ${ZOLTAN_LIB_DIRS}!")
else ()
target_link_libraries(${_TARGET_} ${_SCOPE_} ${_ZOLTAN_EXTERN_LIB})
list(APPEND ${_OUTPUT_} ${_ZOLTAN_EXTERN_LIB})
endif ()
unset(_ZOLTAN_EXTERN_LIB CACHE)
else ()
......
# This configuration file is shipped with the FEM-Toolbox AMDiS.
# It simplifies the configure of different amdis-versions.
#
# We set the following variables:
# AMDIS_INCLUDE_DIRS all include directories (mtl, umfpack, parmetis, metis, ...)
# AMDIS_LIBRARIES the needed libraries
# AMDiS_COMPILEFLAGS some compile flags for amdis
#
# Use this package in the following way:
#
# find_package(AMDiS REQUIRED [PARALLEL|SEQUENTIAL])
# add_executable(yourTarget <yourSources>)
# include_directories(${AMDIS_INCLUDE_DIRS})
# compile_definitions(${AMDIS_COMPILEFLAGS})
# target_link_libraries(yourTarget ${AMDIS_LIBRARIES})
#
# Or directly link against target AMDiS:
#
# find_package(AMDiS REQUIRED [ [PARALLEL|SEQUENTIAL] ])
# add_executable(yourTarget <yourSources>)
# target_link_libraries(yourTarget AMDiS)
#
# The default component for this package is SEQUENTIAL DEBUG.
#
if (${CMAKE_VERSION} VERSION_LESS "3.2")
message(FATAL_ERROR "The Configuration file was created for CMake version >= 3.2")
endif ()
list(APPEND CMAKE_MODULE_PATH ${AMDIS_DIR})
set(IS_AMDISCONFIG true)
set(AMDIS_USE_FILE ${AMDIS_DIR}/AMDISUse.cmake)
# Include macros
include(target_enable_cxx11)
include(target_enable_mtl4)
include(target_enable_boost)
include(target_enable_umfpack)
include(target_enable_petsc)
include(target_enable_zoltan)
include(target_enable_bddcml)
include(target_enable_hypre)
include(target_enable_png)
# enable components
# -----------------
if (AMDIS_FIND_REQUIRED_PARALLEL AND AMDIS_FIND_REQUIRED_SEQUENTIAL)
message(WARNING "Choose either SEQUENTIAL or PARALLEL as component, not both! Falling back to the default SEQUENTIAL.")
set(AMDIS_FIND_REQUIRED_PARALLEL OFF)
endif ()
set(AMDIS_CONFIGURATION "")
# parallel of sequential version
if (AMDIS_FIND_REQUIRED_PARALLEL)
set(AMDIS_HAS_PARALLEL_DOMAIN ON)
set(POSTFIX "-p")
list(APPEND AMDIS_CONFIGURATION "PARALLEL")
else ()
set(AMDIS_HAS_PARALLEL_DOMAIN OFF)
set(POSTFIX "-s")
list(APPEND AMDIS_CONFIGURATION "SEQUENTIAL")
endif ()
if (MSVC)
add_definitions(-DNOMINMAX -D_CONSOLE -DSTRICT -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
endif (MSVC)
if (NOT EXISTS ${AMDIS_DIR}/AMDIS${POSTFIX}.cmake)
message(FATAL_ERROR "Configuration ${AMDIS_CONFIGURATION} can not be found in ${AMDIS_DIR}.")
endif ()
# include component configuration
include(AMDIS${POSTFIX})
# globally add compile options and include directories
add_definitions(${AMDIS_COMPILEFLAGS})
include_directories(${AMDIS_INCLUDE_DIRS})
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(AMDiS VERSION 1.1 LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH ${BASE_DIR}/cmake3)
# Include macros
include(target_enable_cxx11)
include(target_enable_mtl4)
include(target_enable_boost)
include(target_enable_umfpack)
include(target_enable_petsc)
include(target_enable_zoltan)
include(target_enable_bddcml)
include(target_enable_hypre)
include(target_enable_png)
# ------------------------------------------------------------------------------
# define an interface-library for flags and compile-definitions
add_library(amdis_base INTERFACE)
add_library(AMDiS::base ALIAS amdis_base)
target_include_directories(amdis_base INTERFACE ${SOURCE_DIR})
target_compile_definitions(amdis_base INTERFACE)
target_enable_cxx14(SUPPORTS_CXX14 amdis_base INTERFACE)
if (SUPPORTS_CXX14)
target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX14=1)
else ()
target_enable_cxx11(SUPPORTS_CXX11 amdis_base INTERFACE)
endif ()
if (NOT SUPPORTS_CXX11 AND NOT SUPPORTS_CXX14)
message(FATAL_ERROR "AMDiS needs c++11 support, but the current compiler does not support this feature!")
endif ()
target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX11=1)
target_enable_mtl4(amdis_base INTERFACE)
target_enable_boost(amdis_base INTERFACE)
if (ENABLE_UMFPACK)
target_enable_umfpack(amdis_base INTERFACE)
endif (ENABLE_UMFPACK)
if (ENABLE_PNG)
target_enable_png(amdis_base INTERFACE)