-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
54 lines (42 loc) · 1.13 KB
/
CMakeLists.txt
File metadata and controls
54 lines (42 loc) · 1.13 KB
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
cmake_minimum_required(VERSION 3.13)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(BTE_MAJOR 0)
set(BTE_MINOR 1)
set(BTE_PATCH 0)
project(
bt-embedded
VERSION ${BTE_MAJOR}.${BTE_MINOR}.${BTE_PATCH}
LANGUAGES ASM C CXX
)
option(BUILD_EXAMPLE "Build example program" OFF)
option(BUILD_TESTS "Build and run tests" OFF)
option(ENABLE_COVERAGE "Enable code coverage rules" OFF)
option(WITH_OPENOBEX "Build with OpenOBEX if available" ON)
option(WITH_DEBUG "Build with debugging enabled" OFF)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 20)
add_compile_options(
${ARCH}
-fomit-frame-pointer
-ffunction-sections
-Wall
${EXTRA_CFLAGS}
)
find_package(PkgConfig)
pkg_check_modules(LibUSB libusb-1.0 IMPORTED_TARGET)
if(WITH_OPENOBEX)
pkg_check_modules(OpenObex openobex IMPORTED_TARGET)
endif(WITH_OPENOBEX)
include(GNUInstallDirs)
if(BUILD_TESTS AND ENABLE_COVERAGE)
include(CodeCoverage)
append_coverage_compiler_flags()
endif()
add_subdirectory(bt-embedded)
if(BUILD_EXAMPLE)
add_subdirectory(example)
endif()
if(BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()