diff --git a/CMakeLists.txt b/CMakeLists.txt index f0bea577..ec6037de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,8 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# Authors: +# Authors: # - Christophe Riccio +# - Charles Giessen # ~~~ cmake_minimum_required(VERSION 3.22.1) @@ -80,6 +81,13 @@ find_package(VulkanUtilityLibraries REQUIRED CONFIG QUIET) find_package(valijson REQUIRED CONFIG) find_package(jsoncpp REQUIRED CONFIG) +# Workaround AppleClang using the wrong headers when there are headers in /usr/local/include +if (CMAKE_CXX_COMPILER_ID STREQUAL AppleClang AND TARGET Vulkan::Headers AND TARGET Vulkan::LayerSettings AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.25) + set_target_properties(Vulkan::Headers PROPERTIES SYSTEM OFF) + set_target_properties(Vulkan::LayerSettings PROPERTIES SYSTEM OFF) + set_target_properties(Vulkan::UtilityHeaders PROPERTIES SYSTEM OFF) +endif() + option(BUILD_TESTS "Build the tests") if (BUILD_TESTS) enable_testing()