-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
62 lines (47 loc) · 2.4 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
cmake_minimum_required(VERSION 2.4.7)
PROJECT(indi-astroberry-piface CXX C)
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake_modules/")
include(GNUInstallDirs)
set (VERSION_MAJOR 2)
set (VERSION_MINOR 3)
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_piface_focuser.xml.cmake ${CMAKE_CURRENT_BINARY_DIR}/indi_piface_focuser.xml)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/indi_piface_relay.xml.cmake ${CMAKE_CURRENT_BINARY_DIR}/indi_piface_relay.xml)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${INDI_INCLUDE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/libs/)
include(CMakeCommon)
add_library(mcp23s17 STATIC IMPORTED)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "armv+")
set_property(TARGET mcp23s17 PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libs/armhf/libmcp23s17.a)
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
set_property(TARGET mcp23s17 PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libs/arm64/libmcp23s17.a)
else ()
set_property(TARGET mcp23s17 PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libs/armhf/libmcp23s17.a)
endif ()
set(PIFACE_LIBRARIES "mcp23s17")
################ PiFace Focuser ################
set(indi_piface_focuser_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/piface_focuser.cpp
)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(indi_piface_focuser indi_piface_focuser_SRCS 6 cpp)
ENDIF ()
add_executable(indi_piface_focuser ${indi_piface_focuser_SRCS})
target_link_libraries(indi_piface_focuser ${INDI_DRIVER_LIBRARIES} ${PIFACE_LIBRARIES})
install(TARGETS indi_piface_focuser RUNTIME DESTINATION bin )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/indi_piface_focuser.xml DESTINATION ${INDI_DATA_DIR})
################ PiFace Relay ################
set(indi_piface_relay_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/piface_relay.cpp
)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(indi_piface_relay indi_piface_relay_SRCS 6 cpp)
ENDIF ()
add_executable(indi_piface_relay ${indi_piface_relay_SRCS})
target_link_libraries(indi_piface_relay ${INDI_DRIVER_LIBRARIES} ${PIFACE_LIBRARIES})
install(TARGETS indi_piface_relay RUNTIME DESTINATION bin )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/indi_piface_relay.xml DESTINATION ${INDI_DATA_DIR})