Fix shaderc not finding python when inside VS

Visual Studio 2017 is able to build CMake-based projects directly be
opening the folder containing the CMakeLists.txt. However when doing
this shaderc is not able to find the Python executable (it uses
find_program instead of the special Python CMake module). Help shaderc
by setting the PYTHON_EXE variable before including its CMakeLists.txt
This commit is contained in:
Corentin Wallez 2017-07-03 09:52:12 -04:00 committed by Corentin Wallez
parent e9d347e89e
commit ac06ef34e4
1 changed files with 3 additions and 0 deletions

View File

@ -41,6 +41,9 @@ set(SHADERC_SKIP_TESTS ON)
set(SHADERC_GOOGLE_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest CACHE STRING "Location of googletest source")
set(SHADERC_GLSLANG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/glslang" CACHE STRING "Location of glslang source")
set(SHADERC_SPIRV_TOOLS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools CACHE STRING "Location of spirv-tools source")
# Help shaderc find the python executable when run inside VS.
find_package(PythonInterp REQUIRED)
set(PYTHON_EXE ${PYTHON_EXECUTABLE})
# Need to include this for spirv-tools to find it
add_subdirectory(spirv-headers)
add_subdirectory(shaderc)