Skip to content

Commit

Permalink
CMakeLists.txt: honour BUILD_TESTING
Browse files Browse the repository at this point in the history
Allow the user to disable tests through the standard BUILD_TESTING
option: https://cmake.org/cmake/help/latest/module/CTest.html

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  • Loading branch information
ffontaine committed May 8, 2022
1 parent f644832 commit 15ec267
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Expand Up @@ -29,15 +29,21 @@ option(BUILD_SHARED_LIBS
"Global flag to cause add_library to create shared libraries if on."
ON
)
option(BUILD_TESTING
"Build tests."
ON
)

# subdirectories
add_subdirectory("include/libcgi")
add_subdirectory("src")

# test
enable_testing()
include(CTest)
add_subdirectory("test")
if(BUILD_TESTING)
enable_testing()
include(CTest)
add_subdirectory("test")
endif(BUILD_TESTING)

# cmake package stuff
configure_package_config_file(${PROJECT_NAME_LC}-config.cmake.in
Expand Down

0 comments on commit 15ec267

Please sign in to comment.