forked from oddkiva/sara
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (47 loc) · 1.77 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
cmake_minimum_required(VERSION 2.8.12)
project(Sara)
# Set the version major and minor manually.
set(DO_Sara_VERSION_MAJOR 1)
set(DO_Sara_VERSION_MINOR 2)
if (POLICY CMP0020)
cmake_policy(SET CMP0020 OLD)
endif (POLICY CMP0020)
# Set default build type to Release mode.
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Build type options are: Debug, Release")
# Set options.
option(SARA_USE_VLD "Enable Visual Leak Detector for unit tests" OFF)
option(SARA_BUILD_VIDEOIO "Build Sara's Video I/O module" OFF)
option(SARA_BUILD_PYTHON_BINDINGS "Build Python bindings" OFF)
option(SARA_BUILD_TESTS "Build unit tests for DO-Sara libraries" OFF)
option(SARA_BUILD_SAMPLES "Build sample programs using DO-Sara libraries" OFF)
option(SARA_BUILD_SHARED_LIBS "Build shared libraries for DO-Sara libraries" OFF)
option(SARA_SELF_CONTAINED_INSTALLATION
"Install C++ and Python libraries in a single self contained directory" OFF)
# Set the following internal switches to build Sara.
set(SARA_USE_FROM_SOURCE TRUE CACHE INTERNAL "Build Sara libraries")
set(BUILD_SHARED_LIBS ${SARA_BUILD_SHARED_LIBS})
# Add Sara to the CMake module path.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# Configure Sara library version.
include(sara_macros)
sara_dissect_version()
# We are ready to build Sara.
find_package(DO_Sara REQUIRED)
# Group projects by category.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Set installation settings.
include(sara_installation_settings)
# Enable testing before building the library.
if (SARA_BUILD_TESTS)
enable_testing()
endif ()
# Build the libraries.
add_subdirectory(cpp)
if (SARA_BUILD_PYTHON_BINDINGS)
add_subdirectory(python)
endif ()
# Make documentation
add_subdirectory(doc)
# To create Windows installer and Linux packages.
include(CPack)