diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f9dbbd..23b24ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,11 @@ cmake_minimum_required (VERSION 3.0) project (Simple-Web-Server) option(USE_STANDALONE_ASIO "set ON to use standalone Asio instead of Boost.Asio" OFF) -option(BUILD_TESTING "set ON to build library tests" OFF) +if(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + option(BUILD_TESTING "set ON to build library tests" ON) +else() + option(BUILD_TESTING "set ON to build library tests" OFF) +endif() option(BUILD_FUZZING "set ON to build library fuzzers" OFF) option(USE_OPENSSL "set OFF to build without OpenSSL" ON) @@ -75,7 +79,6 @@ if(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(https_examples PRIVATE ${Boost_INCLUDE_DIR}) endif() endif() - set(BUILD_TESTING ON) install(FILES asio_compatibility.hpp server_http.hpp client_http.hpp server_https.hpp client_https.hpp crypto.hpp utility.hpp status_code.hpp mutex.hpp DESTINATION include/simple-web-server) endif()