-
Notifications
You must be signed in to change notification settings - Fork 1
/
spdlog.cmake
27 lines (21 loc) · 906 Bytes
/
spdlog.cmake
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
message(STATUS "Configuring spdlog")
get_filename_component(SPDLOG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extlibs/spdlog ABSOLUTE)
# Submodule check
cmutils_directory_is_empty(is_empty "${SPDLOG_DIR}")
if(is_empty)
message(FATAL_ERROR "Spdlog dependency is missing, maybe you didn't pull the git submodules")
endif()
# Include spdlog
add_subdirectory(${SPDLOG_DIR})
if(NOT TARGET spdlog)
message(FATAL_ERROR "spdlog target is missing")
endif()
# Disable warnings on spdlog headers
get_target_property(spdlog_include_directories spdlog INTERFACE_INCLUDE_DIRECTORIES)
set_target_properties(spdlog PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "")
target_include_directories(spdlog SYSTEM INTERFACE ${spdlog_include_directories})
if(TARGET spdlog_headers_for_ide)
# Set target IDE folder
cmutils_target_set_ide_folder(spdlog_headers_for_ide "extlibs/spdlog")
endif()
message(STATUS "Configuring spdlog - Done")