Add cmake toggle to disable tests (#219)

* disable testing

* add cmake option for building tests

* switch default behaviour for tests to ON
This commit is contained in:
NotAPenguin 2022-06-25 14:21:25 +02:00 committed by GitHub
parent 3c2a53c79b
commit fed85fe14d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,8 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
endif()
option(PEGLIB_BUILD_TESTS "Build cpp-peglib tests" ON)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads)
@ -19,8 +21,10 @@ endif()
add_subdirectory(example)
add_subdirectory(lint)
add_subdirectory(test)
enable_testing()
if (${PEGLIB_BUILD_TESTS})
add_subdirectory(test)
enable_testing()
endif()
install(FILES peglib.h DESTINATION include)