Added CMake variable to enable unit tests.
This commit is contained in:
@@ -1,13 +1,27 @@
|
||||
cmake_minimum_required (VERSION 2.6)
|
||||
project (libsettable)
|
||||
|
||||
find_package(Boost 1.42 COMPONENTS system unit_test_framework)
|
||||
|
||||
if (NOT ${tests})
|
||||
set(enable_tests "off")
|
||||
else()
|
||||
set(enable_tests "on")
|
||||
endif()
|
||||
|
||||
if (${enable_tests} STREQUAL "on")
|
||||
find_package(Boost 1.42 COMPONENTS system unit_test_framework)
|
||||
else()
|
||||
find_package(Boost)
|
||||
endif()
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR}/src
|
||||
${Boost_INCLUDE_DIRS})
|
||||
|
||||
add_subdirectory(examples)
|
||||
|
||||
enable_testing()
|
||||
|
||||
add_subdirectory(unittest)
|
||||
|
||||
if (${enable_tests} STREQUAL "on")
|
||||
enable_testing()
|
||||
add_subdirectory(unittest)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user