mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-14 17:52:05 +08:00
Copy dlls to the executable folder for msvc
This commit is contained in:
parent
c6206a3191
commit
ea66477ac0
@ -1,6 +1,6 @@
|
|||||||
# Copyright(c) 2019 spdlog authors Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
# Copyright(c) 2019 spdlog authors Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.11)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(spdlog_bench CXX)
|
project(spdlog_bench CXX)
|
||||||
|
|
||||||
if(NOT TARGET spdlog)
|
if(NOT TARGET spdlog)
|
||||||
@ -36,8 +36,8 @@ target_link_libraries(latency PRIVATE benchmark::benchmark spdlog::spdlog)
|
|||||||
add_executable(formatter-bench formatter-bench.cpp)
|
add_executable(formatter-bench formatter-bench.cpp)
|
||||||
target_link_libraries(formatter-bench PRIVATE benchmark::benchmark spdlog::spdlog)
|
target_link_libraries(formatter-bench PRIVATE benchmark::benchmark spdlog::spdlog)
|
||||||
|
|
||||||
# copy dll to the executable folder for msvc
|
# copy dlls to the executable folder for msvc
|
||||||
if(MSVC AND (SPDLOG_BUILD_SHARED OR BUILD_SHARED_LIBS))
|
if(MSVC AND (SPDLOG_BUILD_SHARED OR BUILD_SHARED_LIBS))
|
||||||
add_custom_command(TARGET latency POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:spdlog>
|
add_custom_command(TARGET latency POST_BUILD COMMAND ${CMAKE_COMMAND}
|
||||||
$<TARGET_FILE_DIR:latency>)
|
-E copy_if_different $<TARGET_FILE:spdlog> $<TARGET_FILE:fmt> $<TARGET_FILE:benchmark::benchmark> $<TARGET_FILE_DIR:latency>)
|
||||||
endif()
|
endif()
|
||||||
|
@ -2,7 +2,7 @@ include(FetchContent)
|
|||||||
|
|
||||||
# Always build static fmtlib version
|
# Always build static fmtlib version
|
||||||
set(BUILD_SHARED_LIBS_ORIG "${BUILD_SHARED_LIBS}")
|
set(BUILD_SHARED_LIBS_ORIG "${BUILD_SHARED_LIBS}")
|
||||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Disable BUILD_SHARED_LIBS for fmtlib" FORCE)
|
#set(BUILD_SHARED_LIBS OFF CACHE BOOL "Disable BUILD_SHARED_LIBS for fmtlib" FORCE)
|
||||||
|
|
||||||
Set(FETCHCONTENT_QUIET FALSE)
|
Set(FETCHCONTENT_QUIET FALSE)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Copyright(c) 2019 spdlog authors Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
# Copyright(c) 2019 spdlog authors Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.11)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(spdlog_example CXX)
|
project(spdlog_example CXX)
|
||||||
|
|
||||||
if(NOT TARGET spdlog)
|
if(NOT TARGET spdlog)
|
||||||
@ -11,8 +11,8 @@ endif()
|
|||||||
add_executable(example example.cpp)
|
add_executable(example example.cpp)
|
||||||
target_link_libraries(example PRIVATE spdlog::spdlog $<$<BOOL:${MINGW}>:ws2_32>)
|
target_link_libraries(example PRIVATE spdlog::spdlog $<$<BOOL:${MINGW}>:ws2_32>)
|
||||||
|
|
||||||
# copy dll to the executable folder for msvc
|
# copy dlls to the executable folder for msvc
|
||||||
if(MSVC AND (SPDLOG_BUILD_SHARED OR BUILD_SHARED_LIBS))
|
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>
|
add_custom_command(TARGET example POST_BUILD COMMAND ${CMAKE_COMMAND}
|
||||||
$<TARGET_FILE_DIR:example>)
|
-E copy_if_different $<TARGET_FILE:spdlog> $<TARGET_FILE:fmt> $<TARGET_FILE_DIR:example>)
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.11)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(spdlog_utests CXX)
|
project(spdlog_utests CXX)
|
||||||
|
|
||||||
if(NOT TARGET spdlog)
|
if(NOT TARGET spdlog)
|
||||||
@ -88,11 +88,10 @@ endfunction()
|
|||||||
if(SPDLOG_BUILD_TESTS OR SPDLOG_BUILD_ALL)
|
if(SPDLOG_BUILD_TESTS OR SPDLOG_BUILD_ALL)
|
||||||
spdlog_prepare_test(spdlog-utests spdlog::spdlog)
|
spdlog_prepare_test(spdlog-utests spdlog::spdlog)
|
||||||
|
|
||||||
# copy dll to the executable folder for msvc
|
# copy dlls to the executable folder for msvc
|
||||||
if(MSVC AND (SPDLOG_BUILD_SHARED OR BUILD_SHARED_LIBS))
|
if(MSVC AND (SPDLOG_BUILD_SHARED OR BUILD_SHARED_LIBS))
|
||||||
add_custom_command(
|
add_custom_command(TARGET spdlog-utests POST_BUILD COMMAND ${CMAKE_COMMAND}
|
||||||
TARGET spdlog-utests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:spdlog>
|
-E copy_if_different $<TARGET_FILE:spdlog> $<TARGET_FILE:fmt> $<TARGET_FILE:Catch2::Catch2> $<TARGET_FILE:Catch2::Catch2WithMain> $<TARGET_FILE_DIR:spdlog-utests>)
|
||||||
$<TARGET_FILE_DIR:spdlog-utests>)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user