Skip to content

Commit 747be4f

Browse files
committed
Add spdlog dependency
1 parent b789ce1 commit 747be4f

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ include(Helpers)
2020
# === Coverage ===
2121
include(Coverage)
2222

23+
# === Logging ===
24+
include(Logging)
25+
2326
# === Library ===
2427
add_subdirectory(src)
2528

cmake/Logging.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
include(FetchContent)
2+
3+
FetchContent_Declare(
4+
spdlog
5+
URL https://github.com/gabime/spdlog/archive/refs/tags/v1.15.3.zip
6+
DOWNLOAD_EXTRACT_TIMESTAMP true
7+
)
8+
9+
FetchContent_MakeAvailable(spdlog)

cmake/install/InstallConfig.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ install(TARGETS ${PROJECT_NAME}_library
1515

1616
install(DIRECTORY include/${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
1717

18+
# Export spdlog dependency
19+
install(TARGETS spdlog
20+
EXPORT ${PROJECT_NAME}Targets
21+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
22+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
23+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
24+
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
25+
)
26+
1827
# Export for find_package
1928
install(EXPORT ${PROJECT_NAME}Targets
2029
FILE ${PROJECT_NAME}Targets.cmake

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ target_include_directories(${PROJECT_NAME}_library
1212
$<INSTALL_INTERFACE:include>
1313
)
1414

15+
target_link_libraries(${PROJECT_NAME}_library PRIVATE spdlog)
16+
1517
enable_strict_warnings(${PROJECT_NAME}_library)
1618
enable_sanitizers(${PROJECT_NAME}_library)
1719
enable_coverage(${PROJECT_NAME}_library)

0 commit comments

Comments
 (0)