-
Notifications
You must be signed in to change notification settings - Fork 127
/
Copy pathosvrBuildOptions.cmake
64 lines (53 loc) · 2.92 KB
/
osvrBuildOptions.cmake
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
###
# NOTE: To configure the build, don't edit this file - use CMake to set the options (in the GUI or on the command line)
# These are just defaults, and are split into a separate file for easier forwarding from superbuilds.
###
if(COMMAND get_subproject_status)
get_subproject_status(OSVR_SUBPROJECT)
else()
set(OSVR_SUBPROJECT NO)
endif()
if(OSVR_SUBPROJECT)
set(OSVR_ON_UNLESS_SUBPROJECT OFF)
else()
set(OSVR_ON_UNLESS_SUBPROJECT ON)
endif()
###
# Configuration Options
###
# List of options, for easier consumption by superbuilds. Leaving off the BUILD_ prefix
set(OSVR_BUILD_OPTIONS SERVER SERVER_EXAMPLES SERVER_APP SERVER_PLUGINS CLIENT CLIENT_EXAMPLES CLIENT_APPS WITH_OPENCV)
option(BUILD_SHARED_LIBS "Should we build as a shared library?" ON)
option(BUILD_DEV_VERBOSE "Build with verbose development messages?" ON)
option(BUILD_SERVER "Should we build the server libraries and required dev tools?" ON)
option(BUILD_SERVER_EXAMPLES "Should we build the server-related example apps and plugins?" ${OSVR_ON_UNLESS_SUBPROJECT})
option(BUILD_SERVER_APP "Should we build the server app?" ON)
option(BUILD_SERVER_PLUGINS "Should we build the standard plugins?" ON)
option(BUILD_CLIENT "Should we build the client libraries?" ON)
option(BUILD_CLIENT_EXAMPLES "Should we build the client example apps?" ${OSVR_ON_UNLESS_SUBPROJECT})
option(BUILD_CLIENT_APPS "Should we build the client apps?" ON)
option(BUILD_WITH_OPENCV "Should we build the stock and example plugins and apps (as otherwise configured) that require OpenCV?" ${OSVR_ON_UNLESS_SUBPROJECT})
option(BUILD_HEADER_DEPENDENCY_TESTS "Should we add targets to ensure that every public header compiles cleanly on its own? Increases number of targets greatly..." ${OSVR_ON_UNLESS_SUBPROJECT})
option(BUILD_ADVANCED_DEV_TOOLS "Should we build tools designed for core developers?" OFF)
# Logging options
option(BUILD_WITH_LOGGING_SINGLETON "Enable the logging singleton - required for optimal logging performance and logging to file." TRUE)
mark_as_advanced(BUILD_WITH_LOGGING_SINGLETON)
#TODO: consider BUILD_WITH_LOGGING_COARSE_TIMESTAMPS on Linux only
#TODO: consider BUILD_WITH_LOGGING_THREAD_ID_SUPPORT if we add thread (%t) to our pattern.
# Consistency: can't build the examples, apps, etc if you don't have the library
set(dependent_options
BUILD_SERVER_EXAMPLES
BUILD_SERVER_APP
BUILD_SERVER_PLUGINS
BUILD_CLIENT_EXAMPLES
BUILD_CLIENT_APPS)
foreach(dependent_option ${dependent_options})
string(REGEX REPLACE "_[^_]+$" "" dependency "${dependent_option}")
if("${${dependent_option}}" AND NOT "${${dependency}}")
# Commented-out code updates the cache variable.
#get_property(_help CACHE ${dependent_option} PROPERTY HELPSTRING)
#set(${dependent_option} OFF CACHE BOOL "${_help}" FORCE)
set(${dependent_option} OFF)
message(STATUS "Disabling ${dependent_option}: depends on ${dependency}, which is disabled")
endif()
endforeach()