google / googletest

GoogleTest - Google Testing and Mocking Framework
https://google.github.io/googletest/
BSD 3-Clause "New" or "Revised" License
33.68k stars 9.98k forks source link

Make SYSTEM argument optional in target_include_directories #4553

Open KOMMYHAP opened 1 month ago

KOMMYHAP commented 1 month ago

Hello! I'd like to use cmake FetchContent to download googletest sources and clang-cl to compile it. But in this case gtest include directory was not added to gtest target. Seems like SYSTEM argument in target_include_directories does not pollute target properties correctly. I wrap SYSTEM argument in cmake option gtest_enable_system_include to save backward compatibility.

lilianmoraru commented 4 weeks ago

Sounds like a CMake bug. Did you try using the latest stable CMake?

KOMMYHAP commented 3 weeks ago

Hm, you may be right. I'll try it later and come back