File: CMakeLists.txt

package info (click to toggle)
hera 2.0.0%2Bgit20221115.8bfdd4b%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,120 kB
  • sloc: cpp: 30,506; python: 8,986; ansic: 2,088; sh: 49; makefile: 16
file content (43 lines) | stat: -rw-r--r-- 1,317 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
cmake_minimum_required(VERSION 3.12)
project(hera VERSION 1.1.1)

# C++ 14 required
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS OFF)

if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
    set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif(NOT CMAKE_BUILD_TYPE)

# by default Hera only provides the library
# so that other projects using it do not build any executables.
# That is why these options are OFF
option(HERA_BUILD_EXAMPLES OFF)
option(HERA_BUILD_PYTHON_BINDINGS OFF)
option(HERA_BUILD_TESTS OFF)

# Hera is header-only library
# adding this target just makes it possible to automatically add
# correct include directories by target_link_libraries(user_prog PRIVATE hera)
add_library(hera INTERFACE)
target_include_directories(hera INTERFACE include/ extern/)

if(HERA_BUILD_TESTS)
    # TODO: detect system Catch2?
    add_subdirectory(extern/Catch2)
    set(HERA_BUILD_EXAMPLES ON)
    enable_testing()
endif()

if(HERA_BUILD_EXAMPLES)
    add_subdirectory(bottleneck)
    add_subdirectory(wasserstein)
endif()

if(HERA_BUILD_PYTHON_BINDINGS)
    add_subdirectory(bindings/python)
endif()