forked from papabricole/Pololu-Maestro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
36 lines (29 loc) · 1.09 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
cmake_minimum_required(VERSION 3.11.4)
project(Maestro)
option(PYTHON_BINDING "Set when you want to build PYTHON_BINDING (Python bindings for the library)" OFF)
include(FindPkgConfig)
pkg_search_module(LIBUSB REQUIRED libusb-1.0)
include_directories(${LIBUSB_INCLUDE_DIRS})
# Extract version information from git
find_package(Git REQUIRED)
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --always --tags
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE MAESTRO_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "VERSION: ${MAESTRO_VERSION}")
add_subdirectory(src)
add_subdirectory(firmwares)
if(PYTHON_BINDING)
add_subdirectory(python)
endif()
# Package builder
set(CPACK_PACKAGE_NAME "Maestro")
set(CPACK_PACKAGE_VENDOR "https://github.com/papabricole/Pololu-Maestro")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A cross-platform C++ library for controlling Pololu Maestro devices")
set(CPACK_PACKAGE_VERSION ${MAESTRO_VERSION})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME}")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
include(CPack)