forked from akimach/LSM9DS1_RaspberryPi_Library
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
50 lines (34 loc) · 1.17 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
cmake_minimum_required(VERSION 3.1.0)
set(CMAKE_CXX_STANDARD 11)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
project(LSM9DS1_RaspberryPi_Library VERSION 2.0.0 LANGUAGES CXX)
include(GNUInstallDirs)
add_subdirectory(example)
# add_compile_options(-Wall -Wconversion -Wextra -pedantic)
set(LIBSRC LSM9DS1.cpp)
set(LIBINCLUDE LSM9DS1.h LSM9DS1_Registers.h LSM9DS1_Types.h)
add_library(lsm9ds1
SHARED
${LIBSRC}
)
set_target_properties(lsm9ds1 PROPERTIES
SOVERSION 2
PUBLIC_HEADER "${LIBINCLUDE}")
target_link_libraries(lsm9ds1 gpiod)
install(TARGETS lsm9ds1 EXPORT lsm9ds1-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
add_library(lsm9ds1_static
STATIC
${LIBSRC}
)
set_target_properties(lsm9ds1_static PROPERTIES
PUBLIC_HEADER "${LIBINCLUDE}")
target_link_libraries(lsm9ds1_static gpiod)
install(TARGETS lsm9ds1_static EXPORT lsm9ds1_static-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})