This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
CMakeLists.txt
66 lines (50 loc) · 2.2 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
cmake_minimum_required(VERSION 2.8)
project("kms-jsonrpc")
message(STATUS "CMake project: ${PROJECT_NAME}")
# Test configuration
set(GENERATE_TESTS FALSE CACHE BOOL "Always build tests: add `make check_build` to normal `make` calls")
set(DISABLE_TESTS FALSE CACHE BOOL "Enable running `make check` during the building process")
set(VALGRIND_NUM_CALLERS 20 CACHE STRING "Valgrind option: maximum number of entries shown in stack traces")
message("If KurentoHelpers is not found, you need to install 'kms-cmake-utils' from the Kurento repository")
find_package(KurentoHelpers REQUIRED)
include(KurentoGitHelpers)
install_git_hook(pre-commit ${CMAKE_CURRENT_SOURCE_DIR}/hooks/pre-commit.hook)
get_git_version(PROJECT_VERSION 6.18.1-dev)
message(STATUS "Project version: ${PROJECT_NAME}-${PROJECT_VERSION}")
# Compiler flags
include(CommonBuildFlags)
common_buildflags_set()
#common_buildflags_print()
find_package(PkgConfig)
pkg_check_modules(JSONCPP REQUIRED kmsjsoncpp>=0.6.0)
find_package(Boost REQUIRED COMPONENTS unit_test_framework)
include(GNUInstallDirs)
set(CUSTOM_PREFIX "kurento")
set(INCLUDE_PREFIX "${CMAKE_INSTALL_INCLUDEDIR}/${CUSTOM_PREFIX}/jsonrpc")
if(NOT DEFINED SYSCONF_INSTALL_DIR)
set(SYSCONF_INSTALL_DIR etc CACHE PATH
"Install directory for system-wide configuration files")
endif(NOT DEFINED SYSCONF_INSTALL_DIR)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}/${CUSTOM_PREFIX}")
set(requires "kmsjsoncpp")
configure_file(libjsonrpc.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libjsonrpc.pc @ONLY)
configure_file(FindKmsJsonRpc.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FindKmsJsonRpc.cmake @ONLY)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/libjsonrpc.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
set(CMAKE_MODULES_INSTALL_DIR
${CMAKE_INSTALL_DATAROOTDIR}/cmake-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}/Modules
CACHE STRING
"Destination (relative to CMAKE_INSTALL_PREFIX) for cmake modules files"
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/FindKmsJsonRpc.cmake
DESTINATION ${CMAKE_MODULES_INSTALL_DIR}
)
enable_testing()
add_subdirectory(src)
add_subdirectory(tests)