Move the cmake change to example\CMakeLists.txt

pull/2642/head
zEuS0390 3 years ago
parent e0b05c21df
commit 74fb3a90b5
No known key found for this signature in database
GPG Key ID: B8BB6971852ABE37

@ -179,7 +179,7 @@ endif()
target_compile_definitions(spdlog PUBLIC SPDLOG_COMPILED_LIB)
target_include_directories(spdlog ${SPDLOG_INCLUDES_LEVEL} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
target_link_libraries(spdlog PUBLIC Threads::Threads $<$<BOOL:${MINGW}>: ws2_32>)
target_link_libraries(spdlog PUBLIC Threads::Threads)
spdlog_enable_warnings(spdlog)
set_target_properties(spdlog PROPERTIES VERSION ${SPDLOG_VERSION} SOVERSION ${SPDLOG_VERSION_MAJOR}.${SPDLOG_VERSION_MINOR})
@ -198,7 +198,7 @@ add_library(spdlog::spdlog_header_only ALIAS spdlog_header_only)
target_include_directories(spdlog_header_only ${SPDLOG_INCLUDES_LEVEL} INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
target_link_libraries(spdlog_header_only INTERFACE Threads::Threads $<$<BOOL:${MINGW}>: ws2_32>)
target_link_libraries(spdlog_header_only INTERFACE Threads::Threads)
# ---------------------------------------------------------------------------------------
# Use fmt package if using external fmt

@ -12,7 +12,7 @@ endif()
# Example of using pre-compiled library
# ---------------------------------------------------------------------------------------
add_executable(example example.cpp)
target_link_libraries(example PRIVATE spdlog::spdlog)
target_link_libraries(example PRIVATE spdlog::spdlog $<$<BOOL:MINGW>:ws2_32>)
# ---------------------------------------------------------------------------------------
# Example of using header-only library

Loading…
Cancel
Save