-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
65 lines (50 loc) · 2.02 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
# Copyright (C) 2013-2016 Pelagicore AB <[email protected]>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# For further information see LICENSE
cmake_minimum_required(VERSION 2.6)
set(PACKAGE dbus-proxy)
project(${PACKAGE})
find_package(PkgConfig REQUIRED)
pkg_check_modules(DEPENDENCIES REQUIRED dbus-1 dbus-glib-1 jansson)
add_definitions(${DEPENDENCIES_CFLAGS_OTHER})
include_directories(${DEPENDENCIES_INCLUDE_DIRS})
set(${PROJECT_NAME}_MAJOR_VERSION 1)
set(${PROJECT_NAME}_MINOR_VERSION 1)
set(${PROJECT_NAME}_PATCH_LEVEL 0)
set(VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_LEVEL})
add_definitions(-DPACKAGE_VERSION="${VERSION}")
option(ENABLE_LOG_TO_FILE "Enables logging to file" OFF)
option(ENABLE_LOG_TO_STDOUT "Enables logging to stdout/stderr" OFF)
if(ENABLE_LOG_TO_FILE)
add_definitions(-DLOG_TO_FILE)
endif()
# Logging to stdout will trump logging to file if both are set by user
if(ENABLE_LOG_TO_STDOUT)
if(ENABLE_LOG_TO_FILE)
remove_definitions(-DLOG_TO_FILE)
message(WARNING "Unsetting option to log to file since log to stdout is also enabled.")
endif()
add_definitions(-DLOG_TO_STDOUT)
endif()
add_executable(dbus-proxy
src/proxy.c
)
target_link_libraries(dbus-proxy
${DEPENDENCIES_LIBRARIES}
)
install(TARGETS dbus-proxy RUNTIME DESTINATION bin)