CMake: allow both SPIRV-Headers and spirv-headers

Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/1057
This commit is contained in:
Lei Zhang 2017-12-05 10:55:00 -05:00
parent 94e3e7b8ef
commit b93c066b0b
2 changed files with 6 additions and 2 deletions

View File

@ -16,9 +16,13 @@
if (DEFINED SPIRV-Headers_SOURCE_DIR)
# This allows flexible position of the SPIRV-Headers repo.
set(SPIRV_HEADER_DIR ${SPIRV-Headers_SOURCE_DIR})
else()
if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/SPIRV-Headers)
set(SPIRV_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SPIRV-Headers)
else()
set(SPIRV_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/spirv-headers)
endif()
endif()
if (IS_DIRECTORY ${SPIRV_HEADER_DIR})
set(SPIRV_HEADER_INCLUDE_DIR ${SPIRV_HEADER_DIR}/include PARENT_SCOPE)