-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·59 lines (44 loc) · 2.05 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
cmake_minimum_required(VERSION 3.0)
cmake_policy(VERSION 3.0)
project(matsya-appmotor)
find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(FeatureSummary)
include(GNUInstallDirs)
include(ECMGeneratePkgConfigFile)
option(INSTALL_SYSTEMD_UNITS "Install systemd unit files" ON)
#
# NOTE: For verbose build use VERBOSE=1
#
# Default C++-flags. Sub-builds might alter these.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra -g -O3 -Wl,--as-needed")
# Default C-flags. Sub-builds might alter these.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W -Wall -Wextra -g -O3")
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
# Find libdl
find_library(LIBDL NAMES dl)
if ($ENV{DEBUG_BUILD})
add_definitions(-DDEBUG_BUILD)
endif ($ENV{DEBUG_BUILD})
# Set the program name defines. Must be at this level due to unit tests.
add_definitions(-DPROG_NAME_INVOKER="matsya-invoker")
add_definitions(-DPROG_NAME_SINGLE_INSTANCE="matsya-single-instance")
# applauncherd will try to load single-instance using this path
add_definitions(-DSINGLE_INSTANCE_PATH="/usr/bin/matsya-single-instance")
# Disable debug logging, only error and warning messages get logged
# Currently effective only for invoker. Launcher part recognizes --debug
# which enables console echoing and debug messages.
add_definitions(-DDEBUG_LOGGING_DISABLED)
# Build with test coverage switch if BUILD_COVERAGE environment variable is set
if ($ENV{BUILD_COVERAGE})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage -DWITH_COVERAGE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -DWITH_COVERAGE")
set(CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} --coverage")
endif ($ENV{BUILD_COVERAGE})
# Sub build: applauncherd
add_subdirectory(src)
# Install html documentation
install(DIRECTORY doc/implementation-documentation DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR} OPTIONAL)
install(DIRECTORY doc/user-documentation DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR} OPTIONAL)
install(DIRECTORY doc/mdeclarativecache-documentation DESTINATION ${CMAKE_INSTALL_FULL_DOCDIR} OPTIONAL)