Skip to content
Snippets Groups Projects
DuneXtMacros.cmake 4.67 KiB
Newer Older
René Fritze's avatar
René Fritze committed
# This file is part of the dune-xt project:
#   https://github.com/dune-community/dune-xt
# Copyright 2009-2018 dune-xt developers and contributors. All rights reserved.
# License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#      or  GPL-2.0+ (http://opensource.org/licenses/gpl-license)
#          with "runtime exception" (http://www.dune-project.org/license.html)
René Fritze's avatar
René Fritze committed
# Authors:
#   Felix Schindler (2013 - 2014, 2016 - 2017)
René Fritze's avatar
René Fritze committed
#   René Fritze     (2013 - 2016, 2018 - 2019)
René Fritze's avatar
René Fritze committed
#   Sven Kaulmann   (2014)
René Fritze's avatar
René Fritze committed
#   Tobias Leibner  (2016, 2018 - 2019)
# enables "IN_LIST operator
cmake_policy(SET CMP0057 NEW)

include(XtCompilerSupport)
include(XtTooling)
René Fritze's avatar
René Fritze committed
# library checks  #########################################################################
set(DS_REQUIRED_BOOST_LIBS atomic chrono date_time filesystem system thread timer)
set(BOOST_ROOT "$ENV{BOOST_ROOT}" ${root_hints})
René Fritze's avatar
René Fritze committed
find_package(PkgConfig)
find_package(Boost 1.48.0 REQUIRED COMPONENTS ${DS_REQUIRED_BOOST_LIBS})
dune_register_package_flags(INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
foreach(_boost_lib ${DS_REQUIRED_BOOST_LIBS})
  set(_BOOST_LIB "")
  string(TOUPPER "${_boost_lib}" _BOOST_LIB)
  dune_register_package_flags(LIBRARIES ${Boost_${_BOOST_LIB}_LIBRARY})
  if(TARGET Boost::${_boost_lib})
    dune_register_package_flags(LIBRARIES Boost::${_boost_lib})
  endif()
endforeach(_boost_lib ${DS_REQUIRED_BOOST_LIBS})
find_package(Eigen3 3.2.0)
if(EIGEN3_FOUND)
René Fritze's avatar
René Fritze committed
  dune_register_package_flags(INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR} COMPILE_DEFINITIONS "ENABLE_EIGEN=1")
René Fritze's avatar
René Fritze committed
  set(HAVE_EIGEN 1)
else(EIGEN3_FOUND)
René Fritze's avatar
René Fritze committed
  dune_register_package_flags(COMPILE_DEFINITIONS "ENABLE_EIGEN=0")
  set(HAVE_EIGEN 0)
endif(EIGEN3_FOUND)
# intel mic and likwid don't mix
if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "k1om")
René Fritze's avatar
René Fritze committed
  include(FindLIKWID)
  find_package(LIKWID)
  if(LIKWID_FOUND)
    dune_register_package_flags(INCLUDE_DIRS ${LIKWID_INCLUDE_DIR} LIBRARIES ${LIKWID_LIBRARY})
  endif(LIKWID_FOUND)
René Fritze's avatar
René Fritze committed
  set(HAVE_LIKWID 0)
include(DuneTBB)
  include(FindMPI4PY)
  if(MPI4PY_FOUND)
    # this only works in dependent modules
    dune_register_package_flags(INCLUDE_DIRS "${MPI4PY_INCLUDE_DIR}")
    # this only works in dune-xt-common itself
    include_directories("${MPI4PY_INCLUDE_DIR}")
  else()
    message(FATAL_ERROR "MPI enabled builds need mpi4py too")
  endif()
René Fritze's avatar
René Fritze committed
# end library checks  #####################################################################
René Fritze's avatar
René Fritze committed
# misc vars  #########################################################################
set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
set(DS_MAX_MIC_THREADS CACHE INTEGER 120)
set(DUNE_XT_COMMON_TEST_DIR ${dune-xt_SOURCE_DIR}/dune/xt/common/test)
set(ENABLE_PERFMON 0 CACHE STRING "enable likwid performance monitoring API usage")
if(NOT DS_HEADERCHECK_DISABLE)
René Fritze's avatar
René Fritze committed
  set(ENABLE_HEADERCHECK 1)
endif(NOT DS_HEADERCHECK_DISABLE)
René Fritze's avatar
René Fritze committed
set(DXT_TEST_TIMEOUT 180 CACHE STRING "per-test timeout in seconds")
set(DXT_TEST_PROCS 1 CACHE STRING "run N tests in parallel")
René Fritze's avatar
René Fritze committed
# This file is part of the dune-xt project:
#   https://github.com/dune-community/dune-xt
# Copyright 2009-2019 dune-xt developers and contributors. All rights reserved.
# License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#      or  GPL-2.0+ (http://opensource.org/licenses/gpl-license)
#          with "runtime exception" (http://www.dune-project.org/license.html)
# Authors:
#   Felix Schindler (2016 - 2017)
#   René Fritze     (2018)
#   Tim Keil        (2018)
#   Tobias Leibner  (2018)
#
# File for module specific CMake tests.
# ~~~
# ~~~
René Fritze's avatar
René Fritze committed
# This file is part of the dune-xt project:
#   https://github.com/dune-community/dune-xt
# Copyright 2009-2019 dune-xt developers and contributors. All rights reserved.
# License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#      or  GPL-2.0+ (http://opensource.org/licenses/gpl-license)
#          with "runtime exception" (http://www.dune-project.org/license.html)
# Authors:
#   Felix Schindler (2016 - 2018)
#   René Fritze     (2017 - 2018)
#   Tobias Leibner  (2018)
#
# File for module specific CMake tests.
# ~~~

set(DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS TRUE)
# ~~~
René Fritze's avatar
René Fritze committed
# This file is part of the dune-xt project:
#   https://github.com/dune-community/dune-xt
# Copyright 2009-2019 dune-xt developers and contributors. All rights reserved.
# License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#      or  GPL-2.0+ (http://opensource.org/licenses/gpl-license)
#          with "runtime exception" (http://www.dune-project.org/license.html)
# Authors:
#   Felix Schindler (2016 - 2017)
#   René Fritze     (2018)
#
# File for module specific CMake tests.
# ~~~