-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (26 loc) · 1.19 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
cmake_minimum_required(VERSION 2.4.7)
PROJECT(astroberry-mqtt CXX C)
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")
include(GNUInstallDirs)
set (VERSION_MAJOR 1)
set (VERSION_MINOR 0)
set(BIN_INSTALL_DIR "/usr/bin")
set(CONFIG_INSTALL_DIR "/etc")
find_package(INDI REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Mosquitto REQUIRED)
find_package(Threads REQUIRED)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${INDI_INCLUDE_DIR})
include_directories( ${ZLIB_INCLUDE_DIR})
include(CMakeCommon)
add_executable(astroberry-mqtt astroberry-mqtt.cpp)
target_link_libraries(astroberry-mqtt indiclient ${INDI_LIBRARIES} ${ZLIB_LIBRARY} ${MOSQUITTO_LIBRARY})
IF (UNIX AND NOT APPLE)
target_link_libraries(astroberry-mqtt -lpthread)
ENDIF ()
install(TARGETS astroberry-mqtt RUNTIME DESTINATION bin )
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/astroberry-mqtt.service DESTINATION ${CONFIG_INSTALL_DIR}/systemd/system)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/astroberry-mqtt.conf DESTINATION ${CONFIG_INSTALL_DIR})