CMakeLists.txt 1.56 KB
Newer Older
Martin Heistermann's avatar
Martin Heistermann committed
1
2
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
cmake_policy(VERSION 3.12.0)
3

4

Martin Heistermann's avatar
Martin Heistermann committed
5
6
7
8
9
project (OpenVolumeMesh
    VERSION 2.1.0
    LANGUAGES CXX
    HOMEPAGE_URL https://openvolumemesh.org/
    )
10

11
#list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
Mike Kremer's avatar
Mike Kremer committed
12

Martin Heistermann's avatar
Martin Heistermann committed
13
14
15
16
if( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR} )
    set(OVM_STANDALONE_BUILD TRUE)
else()
    set(OVM_STANDALONE_BUILD FALSE)
Jan Möbius's avatar
Jan Möbius committed
17
18
endif()

Martin Heistermann's avatar
Martin Heistermann committed
19
20
21
set(OVM_ENABLE_UNITTESTS ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh unit tests in 'all' target")
set(OVM_ENABLE_EXAMPLES ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh examples in 'all' target")
set(OVM_BUILD_DOCUMENTATION ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh documentation in 'all' target")
Mike Kremer's avatar
Mike Kremer committed
22

23
24
25
set(OVM_CXX_VERSION 14 CACHE STRING "C++ version to use")
set_property(CACHE OVM_CXX_VERSION PROPERTY STRINGS 14 17 20)

26
27
28
29
30
31
32
33
34
if (OVM_STANDALONE_BUILD)
    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/bin")
    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/lib")
    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/lib")
    set(OVM_TARGET_PREFIX "")
else()
    # OVM_TARGET_PREFIX is prepended to targets with generic names,
    # i.e., "doc", "unittests"
    set(OVM_TARGET_PREFIX "OVM_")
Martin Heistermann's avatar
Martin Heistermann committed
35
endif()
Mike Kremer's avatar
Mike Kremer committed
36

Martin Heistermann's avatar
Martin Heistermann committed
37
set (CMAKE_DEBUG_POSTFIX "d")
Mike Kremer's avatar
Mike Kremer committed
38

Martin Heistermann's avatar
Martin Heistermann committed
39
enable_testing()
Mike Kremer's avatar
Mike Kremer committed
40
add_subdirectory (src)
41

Martin Heistermann's avatar
Martin Heistermann committed
42
if (OVM_ENABLE_EXAMPLES)
43
    add_subdirectory (examples)
Martin Heistermann's avatar
Martin Heistermann committed
44
45
46
endif()

if (OVM_BUILD_DOCUMENTATION)
47
48
    add_subdirectory (documentation)
endif()
Mike Kremer's avatar
Mike Kremer committed
49

Martin Heistermann's avatar
Martin Heistermann committed
50
#export(PACKAGE OpenVolumeMesh)
Mike Kremer's avatar
Mike Kremer committed
51

52
#list(REMOVE_AT CMAKE_MODULE_PATH -1)