From da3d89ba1f103c73e454b937cd5db72b32c0b315 Mon Sep 17 00:00:00 2001 From: Spiros Tsalikis Date: Sat, 25 Feb 2023 15:04:51 -0500 Subject: [PATCH] Add ExprTk_BUILD_BENCHMARKS to build benchmarks Also move benchmarks into an benchmarks folder --- CMakeLists.txt | 7 +++++++ benchmarks/CMakeLists.txt | 17 +++++++++++++++++ .../exprtk_benchmark.cpp | 0 3 files changed, 24 insertions(+) create mode 100644 benchmarks/CMakeLists.txt rename exprtk_benchmark.cpp => benchmarks/exprtk_benchmark.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f53288e..6753adf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,3 +55,10 @@ option(ExprTk_BUILD_EXAMPLES "Build ExprTk examples" ON) if (ExprTk_BUILD_EXAMPLES) add_subdirectory(examples) endif () + +# create an ExprTK option for building benchmarks +option(ExprTk_BUILD_BENCHMARKS "Build ExprTk benchmarks" ON) +# if ExprTk_BUILD_BENCHMARKS is set to ON, then build the benchmarks +if (ExprTk_BUILD_BENCHMARKS) + add_subdirectory(benchmarks) +endif () diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt new file mode 100644 index 0000000..39d662b --- /dev/null +++ b/benchmarks/CMakeLists.txt @@ -0,0 +1,17 @@ +# ************************************************************** +# * C++ Mathematical Expression Toolkit Library * +# * * +# * Author: Arash Partow (1999-2023) * +# * URL: https://www.partow.net/programming/exprtk/index.html * +# * * +# * Copyright notice: * +# * Free use of the Mathematical Expression Toolkit Library is * +# * permitted under the guidelines and in accordance with the * +# * most current version of the MIT License. * +# * http://www.opensource.org/licenses/MIT * +# * * +# ************************************************************** + +# create executables for benchmark +add_executable(exprtk_benchmark exprtk_benchmark.cpp) +target_link_libraries(exprtk_benchmark ExprTk) diff --git a/exprtk_benchmark.cpp b/benchmarks/exprtk_benchmark.cpp similarity index 100% rename from exprtk_benchmark.cpp rename to benchmarks/exprtk_benchmark.cpp