forked from Kitware/sprokit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
74 lines (54 loc) · 2.08 KB
/
CMakeLists.txt
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
project(sprokit)
cmake_minimum_required(VERSION 2.8.8)
option(SPROKIT_USE_BUILD_TREE "Whether the build tree should be used for default paths" ON)
mark_as_advanced(SPROKIT_USE_BUILD_TREE)
set(sprokit_source_dir "${CMAKE_CURRENT_SOURCE_DIR}")
set(sprokit_binary_dir "${CMAKE_CURRENT_BINARY_DIR}")
# Add the cmake directory for CMake modules.
list(INSERT CMAKE_MODULE_PATH 0
"${sprokit_source_dir}/cmake/modules")
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
if (NOT IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}")
message(FATAL_ERROR "Sprokit does not support a relative install prefix (${CMAKE_INSTALL_PREFIX}).")
endif ()
include(CMakeDependentOption)
set(sprokit_output_dir
"${sprokit_binary_dir}")
# Sprokit macros
include("${sprokit_source_dir}/conf/sprokit-macro-configure.cmake")
include("${sprokit_source_dir}/conf/sprokit-macro-targets.cmake")
include("${sprokit_source_dir}/conf/sprokit-macro-python.cmake")
# Support functions.
include("${sprokit_source_dir}/cmake/support/pkgconfig.cmake")
include("${sprokit_source_dir}/cmake/support/doxygen.cmake")
find_package(Git)
if (GIT_FOUND)
if (IS_DIRECTORY "${sprokit_source_dir}/.git")
set(sprokit_is_in_git ON)
endif ()
endif ()
# Project setup.
include("${sprokit_source_dir}/cmake/snippets/version.cmake")
include("${sprokit_source_dir}/cmake/snippets/flags.cmake")
include("${sprokit_source_dir}/cmake/snippets/configuration.cmake")
include("${sprokit_source_dir}/cmake/snippets/groups.cmake")
if (sprokit_is_in_git)
include("${sprokit_source_dir}/cmake/snippets/dist.cmake")
include("${sprokit_source_dir}/cmake/snippets/hooks.cmake")
endif ()
# Dependencies.
include("${sprokit_source_dir}/cmake/snippets/python.cmake")
include("${sprokit_source_dir}/cmake/snippets/depends.cmake")
set(export_name
sprokit_exports)
add_subdirectory(src)
option(SPROKIT_ENABLE_EXTRAS "Enable extra files to help with tooling" OFF)
if (SPROKIT_ENABLE_EXTRAS)
add_subdirectory(extra)
endif ()
option(SPROKIT_ENABLE_TESTING "Build tests" OFF)
if (SPROKIT_ENABLE_TESTING)
include(CTest)
add_subdirectory(tests)
endif ()
add_subdirectory(conf)