forked from aja-video/libajantv2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
83 lines (69 loc) · 2.58 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
75
76
77
78
79
80
81
82
83
cmake_minimum_required(VERSION 3.15)
# For CMAKE_MSVC_RUNTIME_LIBRARY compatability. Per note: This must be before the first project()
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
project(libajantv2)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(LIBAJANTV2_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
list(APPEND CMAKE_MODULE_PATH "${LIBAJANTV2_CMAKE_DIR}")
list(REMOVE_DUPLICATES CMAKE_MODULE_PATH)
if (NOT AJANTV2_VERSION_FILENAME)
set(AJANTV2_VERSION_FILENAME ${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt)
endif()
include(GNUInstallDirs)
include(CMakeOptions)
include(CompilerFlags)
include(Defines)
include(Version)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if (DEFINED AJA_MSVC_RUNTIME_LIBRARY)
set(CMAKE_MSVC_RUNTIME_LIBRARY "${AJA_MSVC_RUNTIME_LIBRARY}" PARENT_SCOPE)
endif()
endif()
option(AJANTV2_BUILD_OPENSOURCE "Build libajantv2 as open-source (MIT license)?" ON)
option(AJANTV2_BUILD_SHARED "Build libajantv2 shared libraries?" OFF)
option(AJANTV2_DISABLE_DEMOS "Disable building libajantv2 demo apps?" OFF)
option(AJANTV2_DISABLE_DRIVER "Disable building libajantv2 driver (Linux-only)?" OFF)
option(AJANTV2_DISABLE_TESTS "Disable building libajantv2 tests?" OFF)
option(AJANTV2_DISABLE_TOOLS "Disable building libajantv2 tools?" OFF)
option(AJANTV2_DISABLE_PLUGINS "Disable building libajantv2 plugins?" OFF)
if (NOT DEFINED LIBAJANTV2_DIR)
set(LIBAJANTV2_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif()
if(NOT AJANTV2_BUILD_OPENSOURCE)
if (NOT DEFINED LIBAJANTV2_PRIVATE_DIR)
set(LIBAJANTV2_PRIVATE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../libajantv2-private)
endif()
endif()
# Cascade top-level options
if(DEFINED AJA_BUILD_SHARED)
set(AJANTV2_BUILD_SHARED ${AJA_BUILD_SHARED})
endif()
if(DEFINED AJA_DISABLE_DEMOS)
set(AJANTV2_DISABLE_DEMOS ${AJA_DISABLE_DEMOS})
endif()
if (DEFINED AJA_DISABLE_DRIVER)
set(AJANTV2_DISABLE_DRIVER ${AJA_DISABLE_DRIVER})
endif()
if(DEFINED AJA_DISABLE_TESTS)
set(AJANTV2_DISABLE_TESTS ${AJA_DISABLE_TESTS})
endif()
if(DEFINED AJA_DISABLE_TOOLS)
set(AJANTV2_DISABLE_TOOLS ${AJA_DISABLE_TOOLS})
endif()
if(DEFINED AJA_DISABLE_PLUGINS)
set(AJANTV2_DISABLE_PLUGINS ${AJA_DISABLE_PLUGINS})
endif()
add_subdirectory(ajantv2)
add_subdirectory(demos)
add_subdirectory(plugins)
add_subdirectory(tools)
add_subdirectory(driver)
if(AJA_INSTALL_CMAKE)
install(FILES CMakeLists.txt DESTINATION ${CMAKE_INSTALL_PREFIX}/libajantv2)
endif()
if (NOT AJANTV2_DISABLE_TESTS)
add_subdirectory(ajabase/test)
add_subdirectory(ajaanc/test)
endif()