Skip to content

Commit 637b836

Browse files
committed
Add spdlog as fetch content
1 parent 9925716 commit 637b836

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ project(swerve
77

88
set(WEBOTS_HOME "/usr/local/webots")
99

10+
add_subdirectory(external)
11+
1012
link_directories(${WEBOTS_HOME}/lib/controller)
1113
include_directories(${WEBOTS_HOME}/include/controller/c ${WEBOTS_HOME}/include/controller/cpp)
1214

13-
find_package(spdlog 1.14.1 REQUIRED)
14-
1515
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libraries)
1616
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/controllers)

external/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include(${CMAKE_CURRENT_LIST_DIR}/spdlog.cmake)

external/spdlog.cmake

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
include(FetchContent)
2+
3+
FetchContent_Declare(
4+
spdlog
5+
GIT_REPOSITORY https://github.com/gabime/spdlog.git
6+
GIT_TAG v1.11.0)
7+
8+
set(SPDLOG_BUILD_ALL OFF)
9+
set(SPDLOG_BUILD_SHARED OFF)
10+
set(SPDLOG_ENABLE_PCH OFF)
11+
set(SPDLOG_BUILD_PIC ON)
12+
set(SPDLOG_BUILD_EXAMPLE OFF)
13+
set(SPDLOG_BUILD_EXAMPLE_HO OFF)
14+
set(SPDLOG_BUILD_TESTS OFF)
15+
set(SPDLOG_BUILD_TESTS_HO OFF)
16+
set(SPDLOG_BUILD_BENCH OFF)
17+
set(SPDLOG_BUILD_WARNINGS OFF)
18+
set(SPDLOG_INSTALL ON)
19+
20+
FetchContent_MakeAvailable(spdlog)

0 commit comments

Comments
 (0)