Files
CPM.cmake/examples/benchmark/CMakeLists.txt
Lars Melchior 8afc2af4f9 update more examples to use shorthand syntax (#223)
* update more examples to use shorthand syntax

* revert google-benchmark as tests require googletest to be installed

* update comments

* always quote single-arguments

* undo accidental deletion
2021-02-25 09:53:28 +02:00

28 lines
648 B
CMake

cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(CPMExampleBenchmark)
# ---- Dependencies ----
include(../../cmake/CPM.cmake)
CPMAddPackage("gh:TheLartians/Fibonacci@2.0")
CPMAddPackage(
NAME benchmark
GITHUB_REPOSITORY google/benchmark
VERSION 1.5.2
OPTIONS "BENCHMARK_ENABLE_TESTING Off"
)
if(benchmark_ADDED)
# enable c++11 to avoid compilation errors
set_target_properties(benchmark PROPERTIES CXX_STANDARD 11)
endif()
# ---- Executable ----
add_executable(CPMExampleBenchmark "main.cpp")
target_link_libraries(CPMExampleBenchmark fibonacci benchmark)
target_compile_features(CPMExampleBenchmark PRIVATE cxx_std_17)