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

25 26 27 28
set(OVM_CXX_VERSION 14 CACHE STRING "C++ version to use")
set_property(CACHE OVM_CXX_VERSION PROPERTY STRINGS 14 17 20)


Martin Heistermann's avatar
Martin Heistermann committed
29 30 31 32 33 34 35 36
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
37

Martin Heistermann's avatar
Martin Heistermann committed
38 39 40 41
    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
42

Martin Heistermann's avatar
Martin Heistermann committed
43
set (CMAKE_DEBUG_POSTFIX "d")
Mike Kremer's avatar
Mike Kremer committed
44

Martin Heistermann's avatar
Martin Heistermann committed
45
enable_testing()
Mike Kremer's avatar
Mike Kremer committed
46
add_subdirectory (src)
47

Martin Heistermann's avatar
Martin Heistermann committed
48
if (OVM_ENABLE_EXAMPLES)
49
    add_subdirectory (examples)
Martin Heistermann's avatar
Martin Heistermann committed
50 51 52
endif()

if (OVM_BUILD_DOCUMENTATION)
53 54
    add_subdirectory (documentation)
endif()
Mike Kremer's avatar
Mike Kremer committed
55

Martin Heistermann's avatar
Martin Heistermann committed
56
#export(PACKAGE OpenVolumeMesh)
Mike Kremer's avatar
Mike Kremer committed
57

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