CMakeLists.txt 1.62 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()

19
set(OVM_ENABLE_APPLICATIONS ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh applications")
20
set(OVM_ENABLE_UNITTESTS ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh unit tests")
21
22
set(OVM_ENABLE_EXAMPLES ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh examples")
set(OVM_BUILD_DOCUMENTATION ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh documentation")
Mike Kremer's avatar
Mike Kremer committed
23

Martin Heistermann's avatar
Martin Heistermann committed
24
25
set(OVM_CXX_VERSION 11 CACHE STRING "C++ version to use")
set_property(CACHE OVM_CXX_VERSION PROPERTY STRINGS 11 14 17 20)
26

27
28
29
30
31
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 "")
32
    enable_testing()
33
34
35
36
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
37
endif()
Mike Kremer's avatar
Mike Kremer committed
38

Martin Heistermann's avatar
Martin Heistermann committed
39
set (CMAKE_DEBUG_POSTFIX "d")
Mike Kremer's avatar
Mike Kremer committed
40
41

add_subdirectory (src)
42

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

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

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

53
#list(REMOVE_AT CMAKE_MODULE_PATH -1)