Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • iwr/amdis
  • backofen/amdis
  • aland/amdis
3 results
Show changes
Showing
with 1627 additions and 0 deletions
# 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})
#
# The default component for this package is SEQUENTIAL.
#
if (${CMAKE_VERSION} VERSION_LESS "2.8.10")
message(FATAL_ERROR "The Configuration file was created for CMake version >= 2.8.10")
endif ()
list(APPEND CMAKE_MODULE_PATH ${AMDIS_DIR})
set(IS_AMDISCONFIG true)
set(AMDIS_USE_FILE ${AMDIS_DIR}/AMDISUse.cmake)
# Include macros
include(enable_cxx11)
include(enable_mtl4)
include(enable_boost)
include(enable_umfpack)
include(enable_petsc)
include(enable_zoltan)
include(enable_bddcml)
include(enable_hypre)
include(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 2.8.10 FATAL_ERROR)
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
project(AMDiS)
# set some policies
cmake_policy(SET CMP0017 OLD)
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
list(APPEND CMAKE_MODULE_PATH ${BASE_DIR}/cmake)
# Include macros
include(enable_cxx11)
include(enable_mtl4)
include(enable_boost)
include(enable_umfpack)
include(enable_petsc)
include(enable_zoltan)
include(enable_bddcml)
include(enable_hypre)
include(enable_png)
# ------------------------------------------------------------------------------
include_directories(${SOURCE_DIR})
set(AMDIS_INCLUDE_DIRS "")
set(COMPILEFLAGS "")
enable_cxx11(ENABLE_CXX11 COMPILEFLAGS)
if (ENABLE_CXX11)
list(APPEND COMPILEFLAGS "-DAMDIS_HAS_CXX11=1")
else ()
list(APPEND COMPILEFLAGS "-DAMDIS_HAS_CXX11=0")
endif (ENABLE_CXX11)
enable_mtl4(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
enable_boost(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
if (ENABLE_UMFPACK)
enable_umfpack(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
endif (ENABLE_UMFPACK)
if (ENABLE_PNG)
enable_png(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
endif (ENABLE_PNG)
# ------------------------------------------------------------------------------
set(AMDIS_SRC "")
list(APPEND AMDIS_SRC
${SOURCE_DIR}/AdaptBase.cc
${SOURCE_DIR}/AdaptInfo.cc
${SOURCE_DIR}/AdaptInstationary.cc
${SOURCE_DIR}/AdaptStationary.cc
${SOURCE_DIR}/AMDiS.cc
${SOURCE_DIR}/Assembler.cc
${SOURCE_DIR}/BasisFunction.cc
${SOURCE_DIR}/Boundary.cc
${SOURCE_DIR}/BoundaryManager.cc
${SOURCE_DIR}/BoundaryObject.cc
${SOURCE_DIR}/Bubble.cc
${SOURCE_DIR}/Cholesky.cc
${SOURCE_DIR}/CoarseningManager.cc
${SOURCE_DIR}/CoarseningManager1d.cc
${SOURCE_DIR}/CoarseningManager2d.cc
${SOURCE_DIR}/CoarseningManager3d.cc
${SOURCE_DIR}/ComponentTraverseInfo.cc
${SOURCE_DIR}/CouplingIterationInterface.cc
${SOURCE_DIR}/CreatorMap.cc
${SOURCE_DIR}/DOFAdmin.cc
${SOURCE_DIR}/DOFIndexed.cc
${SOURCE_DIR}/DOFMatrix.cc
${SOURCE_DIR}/DOFVector.cc
${SOURCE_DIR}/DirichletBC.cc
${SOURCE_DIR}/DualTraverse.cc
${SOURCE_DIR}/ElInfo.cc
${SOURCE_DIR}/ElInfo1d.cc
${SOURCE_DIR}/ElInfo2d.cc
${SOURCE_DIR}/ElInfo3d.cc
${SOURCE_DIR}/ElInfoStack.cc
${SOURCE_DIR}/Element.cc
${SOURCE_DIR}/ElementData.cc
${SOURCE_DIR}/ElementDofIterator.cc
${SOURCE_DIR}/ElementRegion_ED.cc
${SOURCE_DIR}/FiniteElemSpace.cc
${SOURCE_DIR}/FirstOrderAssembler.cc
${SOURCE_DIR}/FirstOrderTerm.cc
${SOURCE_DIR}/FixVec.cc
${SOURCE_DIR}/Global.cc
${SOURCE_DIR}/Initfile.cc
${SOURCE_DIR}/Lagrange.cc
${SOURCE_DIR}/LeafData.cc
${SOURCE_DIR}/Line.cc
${SOURCE_DIR}/MacroElement.cc
${SOURCE_DIR}/Marker.cc
${SOURCE_DIR}/MatrixVector.cc
${SOURCE_DIR}/Mesh.cc
${SOURCE_DIR}/MeshStructure.cc
${SOURCE_DIR}/Operator.cc
${SOURCE_DIR}/OperatorTerm.cc
${SOURCE_DIR}/Parametric.cc
${SOURCE_DIR}/PeriodicBC.cc
${SOURCE_DIR}/ProblemInstat.cc
${SOURCE_DIR}/ProblemInterpol.cc
${SOURCE_DIR}/ProblemStat.cc
${SOURCE_DIR}/Projection.cc
${SOURCE_DIR}/QPInfo.cc
${SOURCE_DIR}/QPsiPhi.cc
${SOURCE_DIR}/Quadrature.cc
${SOURCE_DIR}/RCNeighbourList.cc
${SOURCE_DIR}/Recovery.cc
${SOURCE_DIR}/RefinementManager.cc
${SOURCE_DIR}/RefinementManager1d.cc
${SOURCE_DIR}/RefinementManager2d.cc
${SOURCE_DIR}/RefinementManager3d.cc
${SOURCE_DIR}/RobinBC.cc
${SOURCE_DIR}/ScalableQuadrature.cc
${SOURCE_DIR}/SecondOrderAssembler.cc
${SOURCE_DIR}/SecondOrderTerm.cc
${SOURCE_DIR}/Serializer.cc
${SOURCE_DIR}/StandardProblemIteration.cc
${SOURCE_DIR}/SubAssembler.cc
${SOURCE_DIR}/SubElInfo.cc
${SOURCE_DIR}/SubQuadrature.cc
${SOURCE_DIR}/SurfaceQuadrature.cc
${SOURCE_DIR}/SurfaceRegion_ED.cc
${SOURCE_DIR}/SystemVector.cc
${SOURCE_DIR}/Tetrahedron.cc
${SOURCE_DIR}/Timer.cc
${SOURCE_DIR}/Traverse.cc
${SOURCE_DIR}/Triangle.cc
${SOURCE_DIR}/VertexVector.cc
${SOURCE_DIR}/ZeroOrderAssembler.cc
${SOURCE_DIR}/ZeroOrderTerm.cc
${SOURCE_DIR}/est/Estimator.cc
${SOURCE_DIR}/est/RecoveryEstimator.cc
${SOURCE_DIR}/est/ResidualEstimator.cc
${SOURCE_DIR}/est/SimpleResidualEstimator.cc
${SOURCE_DIR}/io/ArhReader.cc
${SOURCE_DIR}/io/detail/ArhReader.cc
${SOURCE_DIR}/io/Arh2Reader.cc
${SOURCE_DIR}/io/Arh2Writer.cc
${SOURCE_DIR}/io/Arh3Reader.cc
${SOURCE_DIR}/io/Arh3Writer.cc
${SOURCE_DIR}/io/detail/Arh2Reader.cc
${SOURCE_DIR}/io/detail/ArhWriter.cc
${SOURCE_DIR}/io/detail/Arh2Writer.cc
${SOURCE_DIR}/io/detail/Arh3Reader.cc
${SOURCE_DIR}/io/detail/Arh3Writer.cc
${SOURCE_DIR}/io/DofWriter.cc
${SOURCE_DIR}/io/ElementFileWriter.cc
${SOURCE_DIR}/io/FileWriterInterface.cc
${SOURCE_DIR}/io/FileWriter.cc
${SOURCE_DIR}/io/GNUPlotWriter.cc
${SOURCE_DIR}/io/MacroInfo.cc
${SOURCE_DIR}/io/MacroReader.cc
${SOURCE_DIR}/io/MacroWriter.cc
${SOURCE_DIR}/io/PngReader.cc
${SOURCE_DIR}/io/PngWriter.cc
${SOURCE_DIR}/io/PovrayWriter.cc
${SOURCE_DIR}/io/Spreadsheet.cc
${SOURCE_DIR}/io/ValueReader.cc
${SOURCE_DIR}/io/ValueWriter.cc
${SOURCE_DIR}/io/VtkWriter.cc
${SOURCE_DIR}/io/VtkVectorWriter.cc
${SOURCE_DIR}/io/detail/VtkWriter.cc
${SOURCE_DIR}/nonlin/ProblemNonLin.cc
${SOURCE_DIR}/solver/SolverMatrix.cc
${SOURCE_DIR}/time/RosenbrockAdaptInstationary.cc
${SOURCE_DIR}/time/RosenbrockMethod.cc
${SOURCE_DIR}/time/RosenbrockStationary.cc
# debugging files
${SOURCE_DIR}/Debug.cc
${SOURCE_DIR}/GlobalDOFNumbering.cc # not used by any other class
${SOURCE_DIR}/GlobalElementNumbering.cc # not used by any other class
${SOURCE_DIR}/ProblemStatDbg.cc
)
if (ENABLE_MPI)
enable_mpi(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
list(APPEND COMPILEFLAGS "-DHAVE_MPI=1")
endif (ENABLE_MPI)
include(amdis_parallel)
include(muparser)
# ------------------------------------------------------------------------------
if (ENABLE_COMPRESSION)
list(APPEND COMPILEFLAGS "-DAMDIS_HAS_COMPRESSION")
endif (ENABLE_COMPRESSION)
if (ENABLE_EXTENSIONS)
include(amdis_extensions)
add_library(amdis_extensions ${EXTENSIONS_SRC})
set_target_properties(amdis_extensions PROPERTIES OUTPUT_NAME amdisextensions${POSTFIX}
DEBUG_OUTPUT_NAME amdisextensions${POSTFIX}d)
install(TARGETS amdis_extensions DESTINATION lib/amdis/ )
endif (ENABLE_EXTENSIONS)
if (ENABLE_REINIT)
include(amdis_reinit)
add_library(amdis_reinit ${REINIT_SRC})
set_target_properties(amdis_reinit PROPERTIES OUTPUT_NAME amdisreinit${POSTFIX}
DEBUG_OUTPUT_NAME amdisreinit${POSTFIX}d)
install(TARGETS amdis_reinit DESTINATION lib/amdis/ )
endif (ENABLE_REINIT)
if (ENABLE_COMPOSITE_FEM)
include(amdis_compositeFEM)
add_library(amdis_compositeFEM ${COMPOSITE_FEM_SRC})
set_target_properties(amdis_compositeFEM PROPERTIES OUTPUT_NAME amdiscompositefem${POSTFIX}
DEBUG_OUTPUT_NAME amdiscompositefem${POSTFIX}d)
install(TARGETS amdis_compositeFEM DESTINATION lib/amdis/ )
endif (ENABLE_COMPOSITE_FEM)
if (ENABLE_SEQ_PETSC)
include(amdis_seq_petsc)
endif (ENABLE_SEQ_PETSC)
# ------------------------------------------------------------------------------
include_directories(${AMDIS_INCLUDE_DIRS})
add_definitions(${COMPILEFLAGS})
add_library(amdis ${AMDIS_SRC} ${PARALLEL_DOMAIN_AMDIS_SRC})
# specify how to install this target:
# -----------------------------------
set(INSTALL_SUBDIRS . config nonlin est expressions operations traits
utility time solver solver/details solver/itl io io/detail)
foreach (SUBDIR ${INSTALL_SUBDIRS})
file(GLOB HEADERS "${SOURCE_DIR}/${SUBDIR}/*.h*")
install(FILES ${HEADERS} DESTINATION include/amdis/${SUBDIR}/)
endforeach ()
file(GLOB CMAKE_MACROS "${BASE_DIR}/cmake/enable_*.cmake")
install(FILES ${CMAKE_MACROS} DESTINATION share/amdis/)
install(FILES ${BASE_DIR}/cmake3/parse_zoltan_makefile.cmake DESTINATION share/amdis/)
install(DIRECTORY ${BASE_DIR}/lib/mtl4/ DESTINATION include/amdis/mtl4/
FILES_MATCHING PATTERN "*.hpp"
PATTERN ".svn" EXCLUDE
PATTERN ".svn/*" EXCLUDE
PATTERN "mtl4/libs" EXCLUDE
PATTERN "mtl4/extern" EXCLUDE)
set_target_properties(amdis PROPERTIES OUTPUT_NAME amdis${POSTFIX}
DEBUG_OUTPUT_NAME amdis${POSTFIX}d)
install(TARGETS amdis DESTINATION lib/amdis/ )
# generate configuration file:
# ----------------------------
# global configuration
configure_file(${BASE_DIR}/cmake/AMDISConfig.cmake.in
${AMDiS_BINARY_DIR}/AMDISConfig.cmake
@ONLY
)
# component configuration
configure_file(${BASE_DIR}/cmake/AMDIS.cmake.in
${AMDiS_BINARY_DIR}/AMDIS${POSTFIX}.cmake
@ONLY
)
install(FILES ${AMDiS_BINARY_DIR}/AMDISConfig.cmake DESTINATION share/amdis/)
install(FILES ${AMDiS_BINARY_DIR}/AMDIS${POSTFIX}.cmake DESTINATION share/amdis/)
install(FILES ${BASE_DIR}/cmake3/AMDISUse.cmake DESTINATION share/amdis/)
# CorrectWindowsPaths - this module defines one macro
#
# CONVERT_CYGWIN_PATH( PATH )
# This uses the command cygpath (provided by cygwin) to convert
# unix-style paths into paths useable by cmake on windows
macro (CONVERT_CYGWIN_PATH _path)
if (WIN32)
EXECUTE_PROCESS(COMMAND cygpath.exe -m ${${_path}}
OUTPUT_VARIABLE ${_path})
string (STRIP ${${_path}} ${_path})
endif (WIN32)
endmacro (CONVERT_CYGWIN_PATH)
This diff is collapsed.
# PackageMultipass - this module defines two macros
#
# FIND_PACKAGE_MULTIPASS (Name CURRENT
# STATES VAR0 VAR1 ...
# DEPENDENTS DEP0 DEP1 ...)
#
# This function creates a cache entry <UPPERCASED-Name>_CURRENT which
# the user can set to "NO" to trigger a reconfiguration of the package.
# The first time this function is called, the values of
# <UPPERCASED-Name>_VAR0, ... are saved. If <UPPERCASED-Name>_CURRENT
# is false or if any STATE has changed since the last time
# FIND_PACKAGE_MULTIPASS() was called, then CURRENT will be set to "NO",
# otherwise CURRENT will be "YES". IF not CURRENT, then
# <UPPERCASED-Name>_DEP0, ... will be FORCED to NOTFOUND.
# Example:
# find_path (FOO_DIR include/foo.h)
# FIND_PACKAGE_MULTIPASS (Foo foo_current
# STATES DIR
# DEPENDENTS INCLUDES LIBRARIES)
# if (NOT foo_current)
# # Make temporary files, run programs, etc, to determine FOO_INCLUDES and FOO_LIBRARIES
# endif (NOT foo_current)
#
# MULTIPASS_SOURCE_RUNS (Name INCLUDES LIBRARIES SOURCE RUNS LANGUAGE)
# Always runs the given test, use this when you need to re-run tests
# because parent variables have made old cache entries stale. The LANGUAGE
# variable is either C or CXX indicating which compiler the test should
# use.
# MULTIPASS_C_SOURCE_RUNS (Name INCLUDES LIBRARIES SOURCE RUNS)
# DEPRECATED! This is only included for backwards compatability. Use
# the more general MULTIPASS_SOURCE_RUNS instead.
# Always runs the given test, use this when you need to re-run tests
# because parent variables have made old cache entries stale.
macro (FIND_PACKAGE_MULTIPASS _name _current)
string (TOUPPER ${_name} _NAME)
set (_args ${ARGV})
list (REMOVE_AT _args 0 1)
set (_states_current "YES")
list (GET _args 0 _cmd)
if (_cmd STREQUAL "STATES")
list (REMOVE_AT _args 0)
list (GET _args 0 _state)
while (_state AND NOT _state STREQUAL "DEPENDENTS")
# The name of the stored value for the given state
set (_stored_var PACKAGE_MULTIPASS_${_NAME}_${_state})
if (NOT "${${_stored_var}}" STREQUAL "${${_NAME}_${_state}}")
set (_states_current "NO")
endif (NOT "${${_stored_var}}" STREQUAL "${${_NAME}_${_state}}")
set (${_stored_var} "${${_NAME}_${_state}}" CACHE INTERNAL "Stored state for ${_name}." FORCE)
list (REMOVE_AT _args 0)
list (GET _args 0 _state)
endwhile (_state AND NOT _state STREQUAL "DEPENDENTS")
endif (_cmd STREQUAL "STATES")
set (_stored ${_NAME}_CURRENT)
if (NOT ${_stored})
set (${_stored} "YES" CACHE BOOL "Is the configuration for ${_name} current? Set to \"NO\" to reconfigure." FORCE)
set (_states_current "NO")
endif (NOT ${_stored})
set (${_current} ${_states_current})
if (NOT ${_current} AND PACKAGE_MULTIPASS_${_name}_CALLED)
message (STATUS "Clearing ${_name} dependent variables")
# Clear all the dependent variables so that the module can reset them
list (GET _args 0 _cmd)
if (_cmd STREQUAL "DEPENDENTS")
list (REMOVE_AT _args 0)
foreach (dep ${_args})
set (${_NAME}_${dep} "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
endforeach (dep)
endif (_cmd STREQUAL "DEPENDENTS")
set (${_NAME}_FOUND "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
endif ()
set (PACKAGE_MULTIPASS_${name}_CALLED YES CACHE INTERNAL "Private" FORCE)
endmacro (FIND_PACKAGE_MULTIPASS)
macro (MULTIPASS_SOURCE_RUNS includes libraries source runs language)
include (Check${language}SourceRuns)
# This is a ridiculous hack. CHECK_${language}_SOURCE_* thinks that if the
# *name* of the return variable doesn't change, then the test does
# not need to be re-run. We keep an internal count which we
# increment to guarantee that every test name is unique. If we've
# gotten here, then the configuration has changed enough that the
# test *needs* to be rerun.
if (NOT MULTIPASS_TEST_COUNT)
set (MULTIPASS_TEST_COUNT 00)
endif (NOT MULTIPASS_TEST_COUNT)
math (EXPR _tmp "${MULTIPASS_TEST_COUNT} + 1") # Why can't I add to a cache variable?
set (MULTIPASS_TEST_COUNT ${_tmp} CACHE INTERNAL "Unique test ID")
set (testname MULTIPASS_TEST_${MULTIPASS_TEST_COUNT}_${runs})
set (CMAKE_REQUIRED_INCLUDES ${includes})
set (CMAKE_REQUIRED_LIBRARIES ${libraries})
if(${language} STREQUAL "C")
check_c_source_runs ("${source}" ${testname})
elseif(${language} STREQUAL "CXX")
check_cxx_source_runs ("${source}" ${testname})
endif()
set (${runs} "${${testname}}")
endmacro (MULTIPASS_SOURCE_RUNS)
macro (MULTIPASS_C_SOURCE_RUNS includes libraries source runs)
multipass_source_runs("${includes}" "${libraries}" "${source}" ${runs} "C")
endmacro (MULTIPASS_C_SOURCE_RUNS)
# ResolveCompilerPaths - this module defines two macros
#
# RESOLVE_LIBRARIES (XXX_LIBRARIES LINK_LINE)
# This macro is intended to be used by FindXXX.cmake modules.
# It parses a compiler link line and resolves all libraries
# (-lfoo) using the library path contexts (-L/path) in scope.
# The result in XXX_LIBRARIES is the list of fully resolved libs.
# Example:
#
# RESOLVE_LIBRARIES (FOO_LIBRARIES "-L/A -la -L/B -lb -lc -ld")
#
# will be resolved to
#
# FOO_LIBRARIES:STRING="/A/liba.so;/B/libb.so;/A/libc.so;/usr/lib/libd.so"
#
# if the filesystem looks like
#
# /A: liba.so libc.so
# /B: liba.so libb.so
# /usr/lib: liba.so libb.so libc.so libd.so
#
# and /usr/lib is a system directory.
#
# Note: If RESOLVE_LIBRARIES() resolves a link line differently from
# the native linker, there is a bug in this macro (please report it).
#
# RESOLVE_INCLUDES (XXX_INCLUDES INCLUDE_LINE)
# This macro is intended to be used by FindXXX.cmake modules.
# It parses a compile line and resolves all includes
# (-I/path/to/include) to a list of directories. Other flags are ignored.
# Example:
#
# RESOLVE_INCLUDES (FOO_INCLUDES "-I/A -DBAR='\"irrelevant -I/string here\"' -I/B")
#
# will be resolved to
#
# FOO_INCLUDES:STRING="/A;/B"
#
# assuming both directories exist.
# Note: as currently implemented, the -I/string will be picked up mistakenly (cry, cry)
include (CorrectWindowsPaths)
macro (RESOLVE_LIBRARIES LIBS LINK_LINE)
string (REGEX MATCHALL "((-L|-l|-Wl)([^\" ]+|\"[^\"]+\")|[^\" ]+\\.(a|so|dll|lib))" _all_tokens "${LINK_LINE}")
set (_libs_found "")
set (_directory_list "")
foreach (token ${_all_tokens})
if (token MATCHES "-L([^\" ]+|\"[^\"]+\")")
# If it's a library path, add it to the list
string (REGEX REPLACE "^-L" "" token ${token})
string (REGEX REPLACE "//" "/" token ${token})
convert_cygwin_path(token)
list (APPEND _directory_list ${token})
elseif (token MATCHES "^(-l([^\" ]+|\"[^\"]+\")|[^\" ]+\\.(a|so|dll|lib))")
# It's a library, resolve the path by looking in the list and then (by default) in system directories
if (WIN32) #windows expects "libfoo", linux expects "foo"
string (REGEX REPLACE "^-l" "lib" token ${token})
else (WIN32)
string (REGEX REPLACE "^-l" "" token ${token})
endif (WIN32)
set (_root "")
if (token MATCHES "^/") # We have an absolute path
#separate into a path and a library name:
string (REGEX MATCH "[^/]*\\.(a|so|dll|lib)$" libname ${token})
string (REGEX MATCH ".*[^${libname}$]" libpath ${token})
convert_cygwin_path(libpath)
set (_directory_list ${_directory_list} ${libpath})
set (token ${libname})
endif (token MATCHES "^/")
set (_lib "NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
find_library (_lib ${token} HINTS ${_directory_list} ${_root})
if (_lib)
string (REPLACE "//" "/" _lib ${_lib})
list (APPEND _libs_found ${_lib})
else (_lib)
message (STATUS "Unable to find library ${token}")
endif (_lib)
endif (token MATCHES "-L([^\" ]+|\"[^\"]+\")")
endforeach (token)
set (_lib "NOTFOUND" CACHE INTERNAL "Scratch variable" FORCE)
# only the LAST occurence of each library is required since there should be no circular dependencies
if (_libs_found)
list (REVERSE _libs_found)
list (REMOVE_DUPLICATES _libs_found)
list (REVERSE _libs_found)
endif (_libs_found)
set (${LIBS} "${_libs_found}")
endmacro (RESOLVE_LIBRARIES)
macro (RESOLVE_INCLUDES INCS COMPILE_LINE)
string (REGEX MATCHALL "-I([^\" ]+|\"[^\"]+\")" _all_tokens "${COMPILE_LINE}")
set (_incs_found "")
foreach (token ${_all_tokens})
string (REGEX REPLACE "^-I" "" token ${token})
string (REGEX REPLACE "//" "/" token ${token})
convert_cygwin_path(token)
if (EXISTS ${token})
list (APPEND _incs_found ${token})
else (EXISTS ${token})
message (STATUS "Include directory ${token} does not exist")
endif (EXISTS ${token})
endforeach (token)
list (REMOVE_DUPLICATES _incs_found)
set (${INCS} "${_incs_found}")
endmacro (RESOLVE_INCLUDES)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
if (ENABLE_SEQ_PETSC)
enable_mpi(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
enable_petsc(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
list(APPEND COMPILEFLAGS "-DHAVE_SEQ_PETSC=1")
list(APPEND AMDIS_SRC
${SOURCE_DIR}/solver/PetscSolver.cc
${SOURCE_DIR}/solver/PetscTypes.cc)
endif (ENABLE_SEQ_PETSC)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.