-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
88 lines (63 loc) · 2.85 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
cmake_minimum_required(VERSION 3.1)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
PROJECT(TicFocuserNG CXX)
set (TICFOCUSER_VERSION_MAJOR 1)
set (TICFOCUSER_VERSION_MINOR 1)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")
set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
set(INDI_TICFOCUSER-NG_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/TicFocuser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/connection/UsbConnectionBase.cpp
${CMAKE_CURRENT_SOURCE_DIR}/connection/SerialConnection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/connection/driver_interfaces/TiclibInterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/connection/ticlib/TicBase.cpp
${CMAKE_CURRENT_SOURCE_DIR}/connection/ticlib/TicDefs.cpp
${CMAKE_CURRENT_SOURCE_DIR}/connection/ticlib/StreamSerial.cpp
)
add_executable(indi_ticfocuser-ng)
find_package(INDI REQUIRED)
target_link_libraries( indi_ticfocuser-ng indidriver)
include_directories( ${CMAKE_CURRENT_BINARY_DIR})
include_directories( ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(
{CMAKE_CURRENT_BINARY_DIR}
${INDI_INCLUDE_DIR} )
find_package(LIBUSB_1)
if (LIBUSB_1_FOUND)
list(APPEND INDI_TICFOCUSER-NG_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/connection/LibUsbConnection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/connection/ticlib/TicUsb.cpp
)
include_directories(${LIBUSB_1_INCLUDE_DIRS})
target_link_libraries( indi_ticfocuser-ng "${LIBUSB_1_LIBRARIES}")
set(WITH_LIBUSB TRUE)
endif()
find_package(LIBBLUETOOTH)
if (LIBBLUETOOTH_FOUND)
list(APPEND INDI_TICFOCUSER-NG_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/connection/ticlib/StreamBT.cpp ${CMAKE_CURRENT_SOURCE_DIR}/connection/BluetoothConnection.cpp
)
target_link_libraries( indi_ticfocuser-ng "${LIBBLUETOOTH_LIBRARIES}")
set(WITH_BLUETOOTH TRUE)
endif()
pkg_check_modules(LIBTIC-1 libpololu-tic-1)
if(LIBTIC-1_FOUND)
list(APPEND INDI_TICFOCUSER-NG_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/connection/driver_interfaces/PololuUsbInterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/connection/PololuUsbConnection.cpp
)
include_directories(${LIBTIC-1_INCLUDE_DIR})
target_compile_options(indi_ticfocuser-ng PUBLIC ${LIBTIC-1_CFLAGS})
target_link_libraries( indi_ticfocuser-ng "${LIBTIC-1_LIBRARIES}")
set(WITH_LIBTIC TRUE)
endif()
target_sources(indi_ticfocuser-ng PUBLIC ${INDI_TICFOCUSER-NG_SRCS})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TicFocuser_config.h.in
${CMAKE_CURRENT_BINARY_DIR}/TicFocuser_config.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/indi_ticfocuser-ng.xml.in
${CMAKE_CURRENT_BINARY_DIR}/indi_ticfocuser-ng.xml)
install(TARGETS indi_ticfocuser-ng RUNTIME DESTINATION bin )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/indi_ticfocuser-ng.xml DESTINATION ${INDI_DATA_DIR})