2019-05-17 14:46:54 +02:00
|
|
|
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
|
|
|
|
|
2019-10-10 20:13:10 +02:00
|
|
|
project(CPMExampleBenchmark)
|
|
|
|
|
|
2019-05-17 14:46:54 +02:00
|
|
|
# ---- Dependencies ----
|
|
|
|
|
|
|
|
|
|
include(../../cmake/CPM.cmake)
|
|
|
|
|
|
2021-03-04 10:01:01 +01:00
|
|
|
CPMAddPackage("gh:cpm-cmake/testpack-fibonacci@2.0")
|
2019-05-17 14:46:54 +02:00
|
|
|
|
|
|
|
|
CPMAddPackage(
|
|
|
|
|
NAME benchmark
|
2019-05-20 13:33:01 +02:00
|
|
|
GITHUB_REPOSITORY google/benchmark
|
2021-02-07 17:08:04 +01:00
|
|
|
VERSION 1.5.2
|
2021-01-06 14:40:33 +01:00
|
|
|
OPTIONS "BENCHMARK_ENABLE_TESTING Off"
|
2019-05-17 14:46:54 +02:00
|
|
|
)
|
|
|
|
|
|
2021-01-06 14:40:33 +01:00
|
|
|
if(benchmark_ADDED)
|
2021-02-25 08:53:28 +01:00
|
|
|
# enable c++11 to avoid compilation errors
|
2021-02-07 17:08:04 +01:00
|
|
|
set_target_properties(benchmark PROPERTIES CXX_STANDARD 11)
|
2019-05-20 01:52:55 +02:00
|
|
|
endif()
|
2019-05-17 14:46:54 +02:00
|
|
|
|
|
|
|
|
# ---- Executable ----
|
|
|
|
|
|
|
|
|
|
add_executable(CPMExampleBenchmark "main.cpp")
|
|
|
|
|
target_link_libraries(CPMExampleBenchmark fibonacci benchmark)
|
2021-02-07 17:08:04 +01:00
|
|
|
target_compile_features(CPMExampleBenchmark PRIVATE cxx_std_17)
|