diff --git a/CMakeLists.txt b/CMakeLists.txt index b30790cc..988545bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,26 +42,10 @@ message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) find_package(Threads REQUIRED) -#--------------------------------------------------------------------------------------- -# IDE support for headers -#--------------------------------------------------------------------------------------- -set(SPDLOG_HEADERS_DIR "${CMAKE_CURRENT_LIST_DIR}/include") -file(GLOB SPDLOG_TOP_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/*.h") -file(GLOB SPDLOG_DETAILS_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/details/*.h") -file(GLOB SPDLOG_SINKS_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/sinks/*.h") -file(GLOB SPDLOG_FMT_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/fmt/*.h") -file(GLOB SPDLOG_FMT_BUNDELED_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/fmt/bundled/*.h") -set(SPDLOG_ALL_HEADERS ${SPDLOG_TOP_HEADERS} ${SPDLOG_DETAILS_HEADERS} ${SPDLOG_SINKS_HEADERS} ${SPDLOG_FMT_HEADERS} ${SPDLOG_FMT_BUNDELED_HEADERS}) - -source_group("Header Files\\spdlog" FILES ${SPDLOG_TOP_HEADERS}) -source_group("Header Files\\spdlog\\details" FILES ${SPDLOG_DETAILS_HEADERS}) -source_group("Header Files\\spdlog\\sinks" FILES ${SPDLOG_SINKS_HEADERS}) -source_group("Header Files\\spdlog\\fmt" FILES ${SPDLOG_FMT_HEADERS}) -source_group("Header Files\\spdlog\\fmt\\bundled\\" FILES ${SPDLOG_FMT_BUNDELED_HEADERS}) - #--------------------------------------------------------------------------------------- # Static library version #--------------------------------------------------------------------------------------- +include(cmake/ide.cmake) add_library(spdlog STATIC src/spdlog.cpp ${SPDLOG_ALL_HEADERS}) add_library(spdlog::spdlog ALIAS spdlog) diff --git a/cmake/ide.cmake b/cmake/ide.cmake new file mode 100644 index 00000000..27472c38 --- /dev/null +++ b/cmake/ide.cmake @@ -0,0 +1,18 @@ +#--------------------------------------------------------------------------------------- +# IDE support for headers +#--------------------------------------------------------------------------------------- +set(SPDLOG_HEADERS_DIR "${CMAKE_CURRENT_LIST_DIR}/../include") + +file(GLOB SPDLOG_TOP_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/*.h") +file(GLOB SPDLOG_DETAILS_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/details/*.h") +file(GLOB SPDLOG_SINKS_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/sinks/*.h") +file(GLOB SPDLOG_FMT_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/fmt/*.h") +file(GLOB SPDLOG_FMT_BUNDELED_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/fmt/bundled/*.h") +set(SPDLOG_ALL_HEADERS ${SPDLOG_TOP_HEADERS} ${SPDLOG_DETAILS_HEADERS} ${SPDLOG_SINKS_HEADERS} ${SPDLOG_FMT_HEADERS} ${SPDLOG_FMT_BUNDELED_HEADERS}) + +source_group("Header Files\\spdlog" FILES ${SPDLOG_TOP_HEADERS}) +source_group("Header Files\\spdlog\\details" FILES ${SPDLOG_DETAILS_HEADERS}) +source_group("Header Files\\spdlog\\sinks" FILES ${SPDLOG_SINKS_HEADERS}) +source_group("Header Files\\spdlog\\fmt" FILES ${SPDLOG_FMT_HEADERS}) +source_group("Header Files\\spdlog\\fmt\\bundled\\" FILES ${SPDLOG_FMT_BUNDELED_HEADERS}) +