CTest: integrate example as optional test (PRIVATEBIN_IT-gated) and ensure DLL copy; wire example into root CMake

This commit is contained in:
mbusc
2025-08-28 15:44:16 +02:00
parent 0f58d40f52
commit df74c8a1af
3 changed files with 21 additions and 2 deletions

View File

@ -24,4 +24,13 @@ target_link_libraries(example PRIVATE ${PRIVATEBINAPI_LIB} winhttp)
target_include_directories(example PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../include
)
)
# Install/run helpers for tests: copy DLL next to example on Windows
if(WIN32)
add_custom_command(TARGET example POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${PRIVATEBINAPI_BUILD_DIR}/Release/privatebinapi.dll
$<TARGET_FILE_DIR:example>
)
endif()