Merge pull request #584 from richardapeters/master

build: only include CTest when building the pugixml tests
This commit is contained in:
Arseny Kapoulkine 2023-10-06 06:14:27 -07:00 committed by GitHub
commit ef856bf975
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,6 @@ project(pugixml VERSION 1.14 LANGUAGES CXX)
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
include(CMakeDependentOption) include(CMakeDependentOption)
include(GNUInstallDirs) include(GNUInstallDirs)
include(CTest)
cmake_dependent_option(PUGIXML_USE_VERSIONED_LIBDIR cmake_dependent_option(PUGIXML_USE_VERSIONED_LIBDIR
"Use a private subdirectory to install the headers and libraries" OFF "Use a private subdirectory to install the headers and libraries" OFF
@ -26,7 +25,7 @@ cmake_dependent_option(PUGIXML_STATIC_CRT
cmake_dependent_option(PUGIXML_BUILD_TESTS cmake_dependent_option(PUGIXML_BUILD_TESTS
"Build pugixml tests" OFF "Build pugixml tests" OFF
"BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF) "CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF)
# Custom build defines # Custom build defines
set(PUGIXML_BUILD_DEFINES CACHE STRING "Build defines for custom options") set(PUGIXML_BUILD_DEFINES CACHE STRING "Build defines for custom options")
@ -240,6 +239,7 @@ install(
${CMAKE_INSTALL_INCLUDEDIR}${versioned-dir} COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT}) ${CMAKE_INSTALL_INCLUDEDIR}${versioned-dir} COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT})
if (PUGIXML_BUILD_TESTS) if (PUGIXML_BUILD_TESTS)
include(CTest)
set(fuzz-pattern "tests/fuzz_*.cpp") set(fuzz-pattern "tests/fuzz_*.cpp")
set(test-pattern "tests/*.cpp") set(test-pattern "tests/*.cpp")
if (CMAKE_VERSION VERSION_GREATER 3.11) if (CMAKE_VERSION VERSION_GREATER 3.11)