Skip to content

Commit

Permalink
Make option for build migration tool
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
feniksa authored and ony committed Apr 17, 2015
1 parent 9c6a388 commit b4f56ad
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)

Expand Down

0 comments on commit b4f56ad

Please sign in to comment.