forked from rkaczorek/astroberry-amh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
55 lines (41 loc) · 1.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
cmake_minimum_required(VERSION 2.4.7)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
PROJECT(indi-amh CXX C)
include(ExternalProject)
set (VERSION_MAJOR 0)
set (VERSION_MINOR 2)
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(MAKE make)
find_package(INDI REQUIRED)
find_package(WiringPi REQUIRED)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${INDI_INCLUDE_DIR})
include_directories(${WIRINGPI_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/libs/AdafruitStepperMotorHAT_CPP)
add_library(AdafruitStepperMotorHAT STATIC IMPORTED)
set_property(TARGET AdafruitStepperMotorHAT PROPERTY IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libs/AdafruitStepperMotorHAT_CPP/AdafruitStepperMotorHAT.a)
add_dependencies(AdafruitStepperMotorHAT libAdafruitStepperMotorHAT)
################ AdafruitStepperMotorHAT ################
ExternalProject_Add(libAdafruitStepperMotorHAT
GIT_REPOSITORY "https://github.com/Ctibor/AdafruitStepperMotorHAT_CPP.git"
GIT_TAG "master"
SOURCE_DIR ${CMAKE_SOURCE_DIR}/libs/AdafruitStepperMotorHAT_CPP
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libs/AdafruitStepperMotorHAT_CPP
CONFIGURE_COMMAND ""
BUILD_COMMAND ${MAKE}
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
################ Adafruit Motor HAT Focuser ################
set(indi_amh_focuser_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/amh_focuser.cpp
)
add_executable(indi_amh_focuser ${indi_amh_focuser_SRCS})
target_link_libraries(indi_amh_focuser indidriver AdafruitStepperMotorHAT ${WIRINGPI_LIBRARIES} pthread crypt rt)
install(TARGETS indi_amh_focuser RUNTIME DESTINATION bin)
install(FILES indi_amh_focuser.xml DESTINATION ${INDI_DATA_DIR})