cmake add ECL_TESTS option only enabled in standalone build

This commit is contained in:
Daniel Agar 2019-03-12 23:00:11 -04:00
parent fabd216ca5
commit a892ececf8
3 changed files with 4 additions and 4 deletions

View File

@ -104,6 +104,7 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
enable_testing()
if(BUILD_TESTING)
option(ECL_TESTS "Build ECL tests" ON)
add_custom_target(check
COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C Debug

View File

@ -39,9 +39,8 @@ add_dependencies(ecl_validation prebuild_targets)
target_compile_definitions(ecl_validation PRIVATE -DMODULE_NAME="ecl/validation")
target_include_directories(ecl_validation PUBLIC ${ECL_SOURCE_DIR})
if(BUILD_TESTING)
if(ECL_TESTS)
add_definitions(-UNDEBUG) # keep assert
add_subdirectory(tests)
endif()

View File

@ -35,5 +35,5 @@ add_executable(ecl_tests_data_validator test_data_validator.cpp)
target_link_libraries(ecl_tests_data_validator ecl_validation)
add_test(NAME ecl_tests_data_validator
COMMAND ecl_tests_data_validator
)
COMMAND ecl_tests_data_validator
)