From fed85fe14d0d2cf83fc649a72bd55a50f28439b2 Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Sat, 25 Jun 2022 14:21:25 +0200 Subject: [PATCH] Add cmake toggle to disable tests (#219) * disable testing * add cmake option for building tests * switch default behaviour for tests to ON --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ed8dab..a4d4a61 100644 --- a/CMakeLists.txt +++ b/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)