17 lines
518 B
CMake
17 lines
518 B
CMake
cmake_minimum_required(VERSION 3.10)
|
|
project(LibPrivateBinExample)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
# Build example and link against the in-tree target
|
|
add_executable(example example.cpp)
|
|
target_link_libraries(example PRIVATE libprivatebin)
|
|
|
|
# On Windows, copy the DLL next to the example for easy execution
|
|
if(WIN32)
|
|
add_custom_command(TARGET example POST_BUILD
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
$<TARGET_FILE:libprivatebin>
|
|
$<TARGET_FILE_DIR:example>
|
|
)
|
|
endif() |