Skip to content
Snippets Groups Projects
Select Git revision
  • c4334164a3193f96d7a6135791d52c099cf3baf4
  • main default protected
  • 16-include-advection-into-upstream-version
  • ml/refactor-simulation-grid
  • sh/2D-BTCS-Optimizations
  • sh/rowmajor-inplace
  • ml/sycl-impl
  • ml/restructure-api
  • stenheimbrodt-praktikum
  • ml/add-verbosity
  • fixed-point
  • improve_openmp
  • v0.4.2
  • v0.4.1
  • v0.4
  • hand-in-hp
  • v0.3
  • v0.2
  • v0.1
19 results

Changelog.md

Blame
  • To find the state of this project's repository at the time of any of these versions, check out the tags.
    CMakeLists.txt 2.37 KiB
    # debian stable (currently bullseye)
    cmake_minimum_required(VERSION 3.18)
    
    project(
      tug
      VERSION 0.4
      LANGUAGES CXX)
    
    find_package(Eigen3 3.4 REQUIRED NO_MODULE)
    find_package(OpenMP)
    
    include(GNUInstallDirs)
    
    option(TUG_USE_OPENMP "Compile tug with OpenMP support" ON)
    
    option(
      TUG_USE_UNSAFE_MATH_OPT "Use compiler options to break IEEE compliances by
        oenabling reordering of instructions when adding/multiplying of floating
        points." OFF)
    
    option(TUG_ENABLE_TESTING "Run tests after succesfull compilation" OFF)
    
    option(TUG_HANNESPHILIPP_EXAMPLES "Compile example applications" OFF)
    
    option(TUG_NAAICE_EXAMPLE "Enables NAAICE examples with export of CSV files"
           OFF)
    
    add_library(tug INTERFACE)
    target_include_directories(
      tug INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
                    $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
    
    target_link_libraries(tug INTERFACE Eigen3::Eigen)
    
    target_compile_features(tug INTERFACE cxx_std_17)
    
    if(TUG_USE_OPENMP AND OpenMP_CXX_FOUND)
      target_link_libraries(tug INTERFACE OpenMP::OpenMP_CXX)
    endif()
    
    if(TUG_USE_UNSAFE_MATH_OPT)
      target_compile_options(tug INTERFACE -ffast-math)
    endif()
    
    install(
      TARGETS tug
      EXPORT ${PROJECT_NAME}_Targets
      ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
      LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
      RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
    
    include(CMakePackageConfigHelpers)
    write_basic_package_version_file(
      "tugConfigVersion.cmake"
      VERSION ${PROJECT_VERSION}
      COMPATIBILITY SameMajorVersion)
    
    configure_package_config_file(
      "${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in"
      "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
      INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake)
    
    install(
      EXPORT ${PROJECT_NAME}_Targets
      FILE ${PROJECT_NAME}Targets.cmake
      NAMESPACE ${PROJECT_NAME}::
      DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake)
    
    install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
                  "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
            DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake)
    
    install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/tug DESTINATION include)
    
    if(TUG_ENABLE_TESTING)
    enable_testing()
      add_subdirectory(test)
    endif()
    
    if(TUG_HANNESPHILIPP_EXAMPLES)
      add_subdirectory(examples)
    endif()
    
    if(TUG_NAAICE_EXAMPLE)
      add_subdirectory(naaice)
    endif()