2016-10-28 06:40:20 +08:00
|
|
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/common.cmake)
|
|
|
|
project(${LIBRARY_NAME}.samples VERSION ${LIBRARY_VERSION} LANGUAGES CXX C)
|
2016-10-26 08:21:58 +08:00
|
|
|
|
2016-10-28 06:40:20 +08:00
|
|
|
if(NOT COMBINED_PROJECT)
|
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../source ${CMAKE_CURRENT_BINARY_DIR}/source)
|
2016-10-26 08:53:11 +08:00
|
|
|
endif()
|
|
|
|
|
2016-10-28 20:24:08 +08:00
|
|
|
include_directories(${LIBRARY_INCLUDE_DIR})
|
|
|
|
|
|
|
|
add_executable(sample-basic ${CMAKE_CURRENT_SOURCE_DIR}/sample.cpp)
|
2016-10-28 06:40:20 +08:00
|
|
|
target_link_libraries(sample-basic ${LIBRARY_NAME})
|
2016-10-26 08:21:58 +08:00
|
|
|
|
2016-10-28 20:24:08 +08:00
|
|
|
add_executable(sample-decrypt ${CMAKE_CURRENT_SOURCE_DIR}/decrypt.cpp)
|
2016-10-28 06:40:20 +08:00
|
|
|
target_link_libraries(sample-decrypt ${LIBRARY_NAME})
|
2016-10-26 08:21:58 +08:00
|
|
|
|
2016-10-28 20:24:08 +08:00
|
|
|
if(NOT MSVC)
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
target_link_libraries(sample-basic Threads::Threads)
|
|
|
|
target_link_libraries(sample-decrypt Threads::Threads)
|
|
|
|
endif()
|
|
|
|
|
2016-10-26 08:21:58 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data
|
2016-10-28 20:24:08 +08:00
|
|
|
DESTINATION ${CMAKE_BINARY_DIR}/bin)
|