Skip to content
Snippets Groups Projects
Select Git revision
  • 56106d874a699ac6e0a2f014b3fb954646b15044
  • develop default protected
  • feature/gmsh-reader
  • feature/reconstruction
  • save_clemence
  • origin/stage/bouguettaia
  • feature/kinetic-schemes
  • 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
  • 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
      56106d87
      git subrepo pull (merge) packages/kokkos · 56106d87
      Stéphane Del Pino authored
      subrepo:
        subdir:   "packages/kokkos"
        merged:   "81aa135f"
      upstream:
        origin:   "git@github.com:kokkos/kokkos.git"
        branch:   "master"
        commit:   "81aa135f"
      git-subrepo:
        version:  "0.4.1"
        origin:   "git@github.com:ingydotnet/git-subrepo.git"
        commit:   "a04d8c2"
      56106d87
      History
      git subrepo pull (merge) packages/kokkos
      Stéphane Del Pino authored
      subrepo:
        subdir:   "packages/kokkos"
        merged:   "81aa135f"
      upstream:
        origin:   "git@github.com:kokkos/kokkos.git"
        branch:   "master"
        commit:   "81aa135f"
      git-subrepo:
        version:  "0.4.1"
        origin:   "git@github.com:ingydotnet/git-subrepo.git"
        commit:   "a04d8c2"
    CMakeLists.txt 12.70 KiB
    cmake_minimum_required (VERSION 3.4)
    
    # CMake utils
    list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
    
    # 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)
        message(FATAL_ERROR "Invalid CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'")