Skip to content

Commit b7c1022

Browse files
committed
[CI] modernize cmake build
1 parent 56ba31f commit b7c1022

File tree

10 files changed

+39
-17708
lines changed

10 files changed

+39
-17708
lines changed

extras/test/.gitignore

+17-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
1-
build
1+
build
2+
### CMake ###
3+
CMakeLists.txt.user
4+
CMakeCache.txt
5+
CMakeFiles
6+
CMakeScripts
7+
Testing
8+
Makefile
9+
cmake_install.cmake
10+
install_manifest.txt
11+
compile_commands.json
12+
CTestTestfile.cmake
13+
_deps
14+
15+
### CMake Patch ###
16+
# External projects
17+
*-prefix/

extras/test/CMakeLists.txt

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
##########################################################################
22

33
set(CMAKE_VERBOSE_MAKEFILE ON)
4-
cmake_minimum_required(VERSION 2.8)
4+
cmake_minimum_required(VERSION 3.5)
55

66
##########################################################################
77

88
project(testArduinoBLE)
99

10+
Include(FetchContent)
11+
12+
FetchContent_Declare(
13+
Catch2
14+
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
15+
GIT_TAG v3.4.0
16+
)
17+
18+
FetchContent_MakeAvailable(Catch2)
19+
1020
##########################################################################
1121

1222
set(CMAKE_CXX_STANDARD 11)
@@ -102,7 +112,6 @@ include_directories(../../src)
102112
include_directories(../../src/local)
103113
include_directories(../../src/remote)
104114
include_directories(../../src/utility)
105-
include_directories(external/catch/v2.12.1/include)
106115

107116
target_include_directories(TEST_TARGET_DISC_DEVICE PUBLIC include/test_discovered_device)
108117
target_include_directories(TEST_TARGET_ADVERTISING_DATA PUBLIC include/test_advertising_data)
@@ -124,3 +133,7 @@ add_custom_command(TARGET TEST_TARGET_DISC_DEVICE POST_BUILD
124133
add_custom_command(TARGET TEST_TARGET_ADVERTISING_DATA POST_BUILD
125134
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TEST_TARGET_ADVERTISING_DATA
126135
)
136+
137+
target_link_libraries( TEST_TARGET_UUID Catch2WithMain )
138+
target_link_libraries( TEST_TARGET_DISC_DEVICE Catch2WithMain )
139+
target_link_libraries( TEST_TARGET_ADVERTISING_DATA Catch2WithMain )

0 commit comments

Comments
 (0)