-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.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 14)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
project(ADS1115_RaspberryPi_Library VERSION 1.0.0 LANGUAGES CXX)
include(GNUInstallDirs)
add_subdirectory(example)
add_compile_options(-Wall -Wconversion -Wextra -pedantic)
set(LIBSRC ads1115rpi.cpp)
set(LIBINCLUDE ads1115rpi.h)
add_library(ads1115rpi
SHARED
${LIBSRC}
)
set_target_properties(ads1115rpi PROPERTIES
SOVERSION 1
PUBLIC_HEADER "${LIBINCLUDE}")
target_link_libraries(ads1115rpi gpiod)
install(TARGETS ads1115rpi EXPORT ads1115rpi-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
add_library(ads1115rpi_static
STATIC
${LIBSRC}
)
set_target_properties(ads1115rpi_static PROPERTIES
PUBLIC_HEADER "${LIBINCLUDE}")
target_link_libraries(ads1115rpi_static gpiod)
install(TARGETS ads1115rpi_static EXPORT ads1115rpi_static-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})