2017-03-06 11:39:27 +08:00
|
|
|
cmake_minimum_required(VERSION 3.2)
|
2017-02-28 13:07:37 +08:00
|
|
|
project(xlnt.benchmarks)
|
2016-10-26 08:21:58 +08:00
|
|
|
|
2017-03-06 11:39:27 +08:00
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
2016-12-03 19:13:17 +08:00
|
|
|
if(NOT COMBINED_PROJECT)
|
2017-03-06 11:59:55 +08:00
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../source ${CMAKE_CURRENT_BINARY_DIR}/source)
|
2016-12-03 19:13:17 +08:00
|
|
|
endif()
|
2016-10-26 08:21:58 +08:00
|
|
|
|
2016-12-03 19:13:17 +08:00
|
|
|
include_directories(${LIBRARY_INCLUDE_DIR})
|
2016-10-26 08:21:58 +08:00
|
|
|
|
2016-12-03 19:13:17 +08:00
|
|
|
file(GLOB SAMPLE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
|
|
|
|
2017-03-06 12:08:32 +08:00
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
|
2016-12-03 19:13:17 +08:00
|
|
|
foreach(SAMPLE_SOURCE IN ITEMS ${SAMPLE_SOURCES})
|
|
|
|
get_filename_component(SAMPLE_NAME ${SAMPLE_SOURCE} NAME_WE)
|
|
|
|
set(SAMPLE_EXECUTABLE benchmark-${SAMPLE_NAME})
|
|
|
|
add_executable(${SAMPLE_EXECUTABLE} ${SAMPLE_SOURCE})
|
2017-03-06 12:08:32 +08:00
|
|
|
target_link_libraries(${SAMPLE_EXECUTABLE} PRIVATE xlnt PRIVATE ${ZLIB_LIBRARIES})
|
2016-12-03 19:13:17 +08:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data
|
|
|
|
DESTINATION ${CMAKE_BINARY_DIR}/bin)
|