28 lines
822 B
CMake
28 lines
822 B
CMake
cmake_minimum_required(VERSION 3.10)
|
|
project(PrivateBinAPITests)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
# Create test executable
|
|
add_executable(test_basic test_basic.cpp)
|
|
|
|
# Link with the already-defined privatebinapi target from the root project
|
|
target_link_libraries(test_basic PRIVATE privatebinapi)
|
|
|
|
# Ensure the DLL is available next to the test executable on Windows
|
|
if(WIN32)
|
|
add_dependencies(test_basic privatebinapi)
|
|
add_custom_command(TARGET test_basic POST_BUILD
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
$<TARGET_FILE:privatebinapi>
|
|
$<TARGET_FILE_DIR:test_basic>
|
|
)
|
|
endif()
|
|
|
|
# Include directories
|
|
target_include_directories(test_basic PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../include
|
|
)
|
|
|
|
# Register the test with CTest
|
|
add_test(NAME test_basic COMMAND test_basic) |