Handle copying libcpptrace.dll better for findpackage integration
This commit is contained in:
parent
ddf155b122
commit
3cd8e92e66
6
.github/workflows/cmake-integration.yml
vendored
6
.github/workflows/cmake-integration.yml
vendored
@ -167,9 +167,6 @@ jobs:
|
||||
cd findpackage-integration/build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=C:/foo "-GUnix Makefiles"
|
||||
make
|
||||
if("${{matrix.shared}}" -eq "On") {
|
||||
cp C:/foo/bin/libcpptrace.dll .
|
||||
}
|
||||
./main
|
||||
test-mingw-add_subdirectory:
|
||||
runs-on: windows-2022
|
||||
@ -235,9 +232,6 @@ jobs:
|
||||
cd findpackage-integration/build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=C:/foo
|
||||
msbuild demo_project.sln
|
||||
if("${{matrix.shared}}" -eq "On") {
|
||||
cp C:/foo/bin/cpptrace.dll .
|
||||
}
|
||||
.\Debug\main.exe
|
||||
test-windows-add_subdirectory:
|
||||
runs-on: windows-2022
|
||||
|
||||
@ -7,3 +7,12 @@ add_executable(main main.cpp)
|
||||
find_package(cpptrace REQUIRED)
|
||||
target_link_libraries(main cpptrace::cpptrace)
|
||||
target_compile_features(main PRIVATE cxx_std_11)
|
||||
|
||||
if(WIN32)
|
||||
add_custom_command(
|
||||
TARGET main POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
$<TARGET_FILE:cpptrace::cpptrace>
|
||||
$<TARGET_FILE_DIR:main>
|
||||
)
|
||||
endif()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user