| 1 |
add_executable(realbenchmark benchmark.cpp) |
| 2 |
set_property( |
| 3 |
TARGET realbenchmark |
| 4 |
PROPERTY CXX_STANDARD 17) |
| 5 |
|
| 6 |
target_link_libraries(realbenchmark PUBLIC fast_float) |
| 7 |
include(ExternalProject) |
| 8 |
|
| 9 |
# Define the external project |
| 10 |
ExternalProject_Add(simple_fastfloat_benchmark |
| 11 |
GIT_REPOSITORY https://github.com/lemire/simple_fastfloat_benchmark.git |
| 12 |
GIT_TAG master # or specify a particular commit/tag/branch |
| 13 |
SOURCE_DIR ${CMAKE_BINARY_DIR}/simple_fastfloat_benchmark |
| 14 |
BINARY_DIR ${CMAKE_BINARY_DIR}/simple_fastfloat_benchmark-build |
| 15 |
CONFIGURE_COMMAND "" |
| 16 |
BUILD_COMMAND "" |
| 17 |
INSTALL_COMMAND "" |
| 18 |
) |
| 19 |
set(DATA_DIR ${CMAKE_BINARY_DIR}/simple_fastfloat_benchmark/data) |
| 20 |
|
| 21 |
add_custom_target(CopyData ALL |
| 22 |
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DATA_DIR} ${CMAKE_CURRENT_BINARY_DIR}/data |
| 23 |
DEPENDS simple_fastfloat_benchmark |
| 24 |
) |
| 25 |
add_dependencies(realbenchmark CopyData) |
| 26 |
target_compile_definitions(realbenchmark PUBLIC BENCHMARK_DATA_DIR="${CMAKE_CURRENT_BINARY_DIR}/data") |