-
Notifications
You must be signed in to change notification settings - Fork 16
/
CMakeLists.txt
66 lines (49 loc) · 2.6 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.4.7)
PROJECT(indi-astroberry-diy CXX C)
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")
include(GNUInstallDirs)
set (VERSION_MAJOR 2)
set (VERSION_MINOR 10)
find_package(INDI REQUIRED)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/indi_astroberry_system.xml.cmake ${CMAKE_CURRENT_BINARY_DIR}/indi_astroberry_system.xml)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/indi_astroberry_focuser.xml.cmake ${CMAKE_CURRENT_BINARY_DIR}/indi_astroberry_focuser.xml)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/indi_astroberry_relays.xml.cmake ${CMAKE_CURRENT_BINARY_DIR}/indi_astroberry_relays.xml)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${INDI_INCLUDE_DIR})
include(CMakeCommon)
set(GPIO_LIBRARIES "libgpiod.so")
################ Astroberry System ################
set(indi_astroberry_system_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/astroberry_system.cpp
)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(indi_astroberry_system indi_astroberry_system_SRCS 6 cpp)
ENDIF ()
add_executable(indi_astroberry_system ${indi_astroberry_system_SRCS})
target_link_libraries(indi_astroberry_system ${INDI_LIBRARIES})
install(TARGETS indi_astroberry_system RUNTIME DESTINATION bin )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/indi_astroberry_system.xml DESTINATION ${INDI_DATA_DIR})
################ Astroberry Focuser ################
set(indi_astroberry_focuser_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/astroberry_focuser.cpp
)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(indi_astroberry_focuser indi_astroberry_focuser_SRCS 6 cpp)
ENDIF ()
add_executable(indi_astroberry_focuser ${indi_astroberry_focuser_SRCS})
target_link_libraries(indi_astroberry_focuser ${INDI_DRIVER_LIBRARIES} ${GPIO_LIBRARIES})
install(TARGETS indi_astroberry_focuser RUNTIME DESTINATION bin )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/indi_astroberry_focuser.xml DESTINATION ${INDI_DATA_DIR})
################ Astroberry Relays ################
set(indi_astroberry_relays_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/astroberry_relays.cpp
)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(indi_astroberry_relays indi_astroberry_relays_SRCS 6 cpp)
ENDIF ()
add_executable(indi_astroberry_relays ${indi_astroberry_relays_SRCS})
target_link_libraries(indi_astroberry_relays ${INDI_LIBRARIES} ${GPIO_LIBRARIES})
install(TARGETS indi_astroberry_relays RUNTIME DESTINATION bin )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/indi_astroberry_relays.xml DESTINATION ${INDI_DATA_DIR})