2020-05-02 11:38:14 +03:00
|
|
|
# Copyright(c) 2019 spdlog authors Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
2018-02-11 20:45:56 +01:00
|
|
|
|
2023-08-30 22:20:37 +02:00
|
|
|
cmake_minimum_required(VERSION 3.11)
|
2023-10-01 17:42:44 +03:00
|
|
|
project(spdlog_example CXX)
|
2018-02-11 20:45:56 +01:00
|
|
|
|
2019-05-29 00:04:36 +03:00
|
|
|
if(NOT TARGET spdlog)
|
2020-05-02 11:42:08 +03:00
|
|
|
# Stand-alone build
|
|
|
|
|
find_package(spdlog REQUIRED)
|
2018-02-11 20:45:56 +01:00
|
|
|
endif()
|
|
|
|
|
|
2023-10-01 17:42:44 +03:00
|
|
|
|
2018-02-11 20:45:56 +01:00
|
|
|
add_executable(example example.cpp)
|
2023-02-12 16:34:22 +08:00
|
|
|
target_link_libraries(example PRIVATE spdlog::spdlog $<$<BOOL:${MINGW}>:ws2_32>)
|
2023-10-01 17:42:44 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# copy dll to the executable folder for msvc
|
|
|
|
|
if(MSVC AND (SPDLOG_BUILD_SHARED OR BUILD_SHARED_LIBS))
|
|
|
|
|
add_custom_command(TARGET example POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
|
$<TARGET_FILE:spdlog> $<TARGET_FILE_DIR:example>)
|
|
|
|
|
endif()
|
|
|
|
|
|