diff --git a/CMakeLists.txt b/CMakeLists.txt index 35b8740..fc40235 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required(VERSION 3.0.2) project(mstch) -option (WITH_UNIT_TESTS "enable building unit test executable" OFF) + +option(WITH_UNIT_TESTS "enable building unit test executable" OFF) +option(WITH_BENCHMARK "enable building benchmark executable" OFF) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) @@ -16,15 +18,10 @@ add_subdirectory(src) if(WITH_UNIT_TESTS) enable_testing() - include_directories( - vendor/Catch/single_include - vendor/json.hpp/include) add_subdirectory(test) endif() if(WITH_BENCHMARK) - include_directories( - vendor/benchmark/include) add_subdirectory(vendor/benchmark) add_subdirectory(benchmark) endif() diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 3797c73..fa47f0d 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -1,2 +1,6 @@ +include_directories( + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/vendor/benchmark/include) + add_executable(mstch_benchmark benchmark_main.cpp) target_link_libraries(mstch_benchmark mstch benchmark) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d798839..1ed3fea 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,6 +2,8 @@ find_package(Boost 1.54 COMPONENTS program_options REQUIRED) include_directories( ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/vendor/Catch/single_include + ${CMAKE_SOURCE_DIR}/vendor/json.hpp/include ${Boost_INCLUDE_DIR}) add_executable(headerize headerize.cpp)