-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
36 lines (26 loc) · 986 Bytes
/
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.10)
# Parse version
include (cmake/ParseVersion.cmake)
message(STATUS "Configuring for NovaGSM version '${NOVAGSM_VERSION}'")
# Define project
project(NOVAGSM VERSION ${NOVAGSM_VERSION} LANGUAGES CXX)
set(PROJECT_DESCRIPTION "GSM/GPRS modem drivers")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Construct ${NOVAGSM_SOURCES}
add_subdirectory(source)
# Create library
add_library(novagsm SHARED ${NOVAGSM_SOURCES})
# Set include directory
target_include_directories(novagsm PUBLIC ${CMAKE_SOURCE_DIR}/include)
# Set compile options (TODO: make DEBUG an option)
target_compile_options(novagsm PRIVATE -Wall -Wextra -DNOVAGSM_DEBUG=4)
# Build unix example (TODO: make this an option)
add_subdirectory(examples/unix)
# Set install rules
include(GNUInstallDirs)
install(
TARGETS novagsm
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})