From b4f56ad18162c2e2f9acef93f0f42eac0f9f3163 Mon Sep 17 00:00:00 2001 From: Maksym Sditanov Date: Fri, 17 Apr 2015 17:57:47 +0300 Subject: [PATCH] Make option for build migration tool - Add option BUILD_MKSANDWICH. By default build of migration tool is turned on. - Add for option BUILD_TESTING help text and make it boolean. - gtest dependency required only when tests are built. --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e029f4a..73302c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,12 +28,15 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH}) option(FAST_CHECK "Run tests in a faster manner" ON) option(BUILD_DOCUMENTATION "Build the documentation (Doxygen)." OFF) +option(BUILD_MKSANDWICH "Build sandwich converting tool" ON) include(CTest) include(ProcessorCount) -find_package(GTest REQUIRED) find_package(LevelDB REQUIRED) +if (BUILD_TESTING) + find_package(GTest REQUIRED) +endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wconversion -Werror") @@ -43,8 +46,10 @@ include_directories(${LevelDB_INCLUDE_DIRS}) install(DIRECTORY include/ DESTINATION include) -add_executable(mksandwich mksandwich.cpp) -target_link_libraries(mksandwich ${GTEST_BOTH_LIBRARIES} ${LevelDB_LIBRARIES}) +if (BUILD_MKSANDWICH) + add_executable(mksandwich mksandwich.cpp) + target_link_libraries(mksandwich ${GTEST_BOTH_LIBRARIES} ${LevelDB_LIBRARIES}) +endif() set(ctest_args --output-on-failure)