CMakeLists.txt 1.59 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

Martin Heistermann's avatar
Martin Heistermann committed
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()

Mike Kremer's avatar
Mike Kremer committed
19

Martin Heistermann's avatar
Martin Heistermann committed
20
21
22
23
#message("OVM_STANDALONE_BUILD: ${OVM_STANDALONE_BUILD}")
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
24

Martin Heistermann's avatar
Martin Heistermann committed
25
26
27
28
29
30
31
32
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
    if (WIN32)
        set (ACG_PROJECT_LIBDIR "lib")
        set (ACG_PROJECT_BINDIR ".")
    else ()
        set (ACG_PROJECT_LIBDIR "lib")
        set (ACG_PROJECT_BINDIR "bin")
    endif ()
Mike Kremer's avatar
Mike Kremer committed
33

Martin Heistermann's avatar
Martin Heistermann committed
34
35
36
37
    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}")
    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}")
    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}")
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

Martin Heistermann's avatar
Martin Heistermann committed
41
enable_testing()
Mike Kremer's avatar
Mike Kremer committed
42
add_subdirectory (src)
43

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

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

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

Martin Heistermann's avatar
Martin Heistermann committed
54
list(REMOVE_AT CMAKE_MODULE_PATH -1)