mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-17 22:58:14 -05:00
* apply clang-format and cmake-format and add style check workflow * add declare package definition * add additional public methods and rename internals * change development verison tag to 1.0.0 * rename internal method * rename public method * rename test var * update copyright and fix comment * typo * run fix-format * fix test function names
32 lines
687 B
CMake
32 lines
687 B
CMake
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
|
|
|
project(CPMExampleBenchmark)
|
|
|
|
# ---- Dependencies ----
|
|
|
|
include(../../cmake/CPM.cmake)
|
|
|
|
CPMAddPackage(
|
|
NAME fibonacci
|
|
GITLAB_REPOSITORY TheLartians/Fibonacci
|
|
VERSION 2.0
|
|
)
|
|
|
|
CPMAddPackage(
|
|
NAME benchmark
|
|
GITHUB_REPOSITORY google/benchmark
|
|
VERSION 1.5.0
|
|
OPTIONS "BENCHMARK_ENABLE_TESTING Off"
|
|
)
|
|
|
|
if(benchmark_ADDED)
|
|
# patch google benchmark target
|
|
set_target_properties(benchmark PROPERTIES CXX_STANDARD 17)
|
|
endif()
|
|
|
|
# ---- Executable ----
|
|
|
|
add_executable(CPMExampleBenchmark "main.cpp")
|
|
set_target_properties(CPMExampleBenchmark PROPERTIES CXX_STANDARD 17)
|
|
target_link_libraries(CPMExampleBenchmark fibonacci benchmark)
|