Skip to content
Snippets Groups Projects
Select Git revision
  • 4c53bd365fc16cef4298910a6e9560ae0d14c5cc
  • develop default protected
  • feature/kinetic-schemes
  • feature/reconstruction
  • feature/local-dt-fsi
  • feature/composite-scheme-sources
  • feature/composite-scheme-other-fluxes
  • feature/serraille
  • feature/variational-hydro
  • feature/composite-scheme
  • hyperplastic
  • feature/polynomials
  • feature/gks
  • feature/implicit-solver-o2
  • feature/coupling_module
  • feature/implicit-solver
  • feature/merge-local-dt-fsi
  • master protected
  • feature/escobar-smoother
  • feature/hypoelasticity-clean
  • feature/hypoelasticity
  • v0.5.0 protected
  • v0.4.1 protected
  • v0.4.0 protected
  • v0.3.0 protected
  • v0.2.0 protected
  • v0.1.0 protected
  • Kidder
  • v0.0.4 protected
  • v0.0.3 protected
  • v0.0.2 protected
  • v0 protected
  • v0.0.1 protected
33 results

CMakeLists.txt

Blame
    • Stéphane Del Pino's avatar
      4c53bd36
      Change tests running policy · 4c53bd36
      Stéphane Del Pino authored
      Do not use `ctest` anymore, tests are now launch directly (manually)
      using generated unit tests binaries (unit_tests and mpi_unit_tests)
      
      `ctest` can always be invoked but not using `make test`.
      
      The reason for this change is that `ctest` runs a binary for each test
      which is not what we want now. The goal of this development is to
      provide a mesh database that is built **once** for all: the cost of
      building meshes could be prohibitive and their multiplication should
      be avoided for obvious performances and storage reasons.
      4c53bd36
      History
      Change tests running policy
      Stéphane Del Pino authored
      Do not use `ctest` anymore, tests are now launch directly (manually)
      using generated unit tests binaries (unit_tests and mpi_unit_tests)
      
      `ctest` can always be invoked but not using `make test`.
      
      The reason for this change is that `ctest` runs a binary for each test
      which is not what we want now. The goal of this development is to
      provide a mesh database that is built **once** for all: the cost of
      building meshes could be prohibitive and their multiplication should
      be avoided for obvious performances and storage reasons.
    CMakeLists.txt 18.06 KiB
    cmake_minimum_required (VERSION 3.10)
    
    # CMake utils
    list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
    list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/packages/cmake-modules")
    
    # Forbids in-source builds
    include(CheckNotInSources)
    
    #------------------------------------------------------
    #----------------- Main configuration -----------------
    #------------------------------------------------------
    
    # custom variable allowing to define version suffixes such as -rc*, -beta*, ...
    set(PUGS_VERSION "0.4.1")
    
    # deduce PUGS_SHORT_VERSION using regex
    string(REGEX MATCH "^[0-9]+\.[0-9]+\.[0-9]+" PUGS_SHORT_VERSION ${PUGS_VERSION})
    if("${PUGS_SHORT_VERSION}" STREQUAL "")
      message(FATAL_ERROR "Unable to compute short version from PUGS_VERSION=${PUGS_VERSION}")
    endif()
    
    # set project version as PUGS_SHORT_VERSION
    project (Pugs VERSION ${PUGS_SHORT_VERSION})
    
    #------------------------------------------------------
    
    set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
    
    #------------------------------------------------------
    
    set(PUGS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
    set(PUGS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
    
    # Change RelWithDebInfo to compile assertions
    SET("CMAKE_CXX_FLAGS_RELWITHDEBINFO"
       "-g -O2"
      CACHE STRING "Flags used by the compiler during release builds with debug info and assertions"
      FORCE )
    SET("CMAKE_C_FLAGS_RELWITHDEBINFO"
       "-g -O2"
      CACHE STRING "Flags used by the compiler during release builds with debug info and assertions"
      FORCE )
    
    # Add new build types
    set(CMAKE_CXX_FLAGS_COVERAGE
      "-g -O0 --coverage"
      CACHE STRING "Flags used by the C++ compiler during coverage builds."
      FORCE )
    set(CMAKE_C_FLAGS_COVERAGE
      "-g -O0 --coverage"
      CACHE STRING "Flags used by the C compiler during coverage builds."
      FORCE )
    set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
      "--coverage"
      CACHE STRING "Flags used for linking binaries during coverage builds."
      FORCE )
    set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
      "--coverage"
      CACHE STRING "Flags used by the shared libraries linker during coverage builds."
      FORCE )
    mark_as_advanced(
      CMAKE_CXX_FLAGS_COVERAGE
      CMAKE_C_FLAGS_COVERAGE
      CMAKE_EXE_LINKER_FLAGS_COVERAGE
      CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
    
    if(CMAKE_BUILD_TYPE)
      string(REGEX MATCH "(Debug|Release|RelWithDebInfo|MinSizeRel|Coverage)" VALID_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
      if(NOT VALID_BUILD_TYPE)