forked from commschamp/cc.ublox.commsdsl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
55 lines (39 loc) · 1.27 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 3.16)
include(GNUInstallDirs)
include(FetchContent)
set (CMAKE_CXX_STANDARD 14)
list (APPEND CMAKE_PREFIX_PATH "${COMMS_INSTALL_DIR}")
#find_package(LibComms NO_MODULE REQUIRED)
FetchContent_Declare(LibComms
GIT_REPOSITORY https://github.com/commschamp/comms.git
GIT_TAG v5.2
)
FetchContent_MakeAvailable(LibComms)
find_package(Boost)
if (NOT Boost_FOUND)
message (Warning "Cannot compile example applications due to missing boost libraries")
return ()
endif()
set (extra_boost_components)
if (WIN32)
# For some reason windows build requires extra boost components
set (extra_boost_components date_time regex)
endif ()
find_package(Boost REQUIRED
COMPONENTS program_options system ${extra_boost_components})
find_package(Threads REQUIRED)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/include)
set (cc_compile_file "${LibComms_DIR}/CC_Compile.cmake")
if (EXISTS ${cc_compile_file})
include (${cc_compile_file})
set (warn_as_err_opt)
if (NOT UBLOX_NO_WARN_AS_ERR)
set (warn_as_err_opt WARN_AS_ERR)
endif()
set (ccache_opt)
if (UBLOX_USE_CCACHE)
set (ccache_opt USE_CCACHE)
endif()
cc_compile(${warn_as_err_opt} ${ccache_opt})
endif ()
add_subdirectory (simple_pos)