Add cmake toggle to disable tests (#219)

* disable testing

* add cmake option for building tests

* switch default behaviour for tests to ON
pull/222/head
NotAPenguin 2 years ago committed by GitHub
parent 3c2a53c79b
commit fed85fe14d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      CMakeLists.txt

@ -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)

Loading…
Cancel
Save