Compare commits

...

2 Commits

Author SHA1 Message Date
Pavel
70e7e8703f
Merge d175af9ea3a0055fd29deb18ec0af25a54eeceb1 into 085af2cc08600bdb13827ca40261abcbe5048bb5 2025-11-11 02:40:33 +03:00
Pavel
d175af9ea3
Make SYSTEM argument optional
Fix bug when include directories hidden from clang-cl & cmake-fetch-content
2024-06-02 21:27:32 +03:00

View File

@ -26,6 +26,8 @@ option(
"Build gtest with internal symbols hidden in shared libraries."
OFF)
option(gtest_enable_system_include "Whether or not gtest should be considered a system include." ON)
# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
include(cmake/hermetic_build.cmake OPTIONAL)
@ -138,10 +140,13 @@ endif()
cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
set_target_properties(gtest_main PROPERTIES VERSION ${GOOGLETEST_VERSION})
string(REPLACE ";" "$<SEMICOLON>" dirs "${gtest_build_include_dirs}")
target_include_directories(gtest SYSTEM INTERFACE
if (gtest_enable_system_include)
set(gtest_system_include SYSTEM)
endif()
target_include_directories(gtest ${gtest_system_include} INTERFACE
"$<BUILD_INTERFACE:${dirs}>"
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
target_include_directories(gtest_main SYSTEM INTERFACE
target_include_directories(gtest_main ${gtest_system_include} INTERFACE
"$<BUILD_INTERFACE:${dirs}>"
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
if(CMAKE_SYSTEM_NAME MATCHES "QNX" AND CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL 7.1)