Skip to content

Commit

Permalink
CMake: use Python3_EXECUTABLE instead of PYTHON_EXECUTABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Aug 6, 2023
1 parent 3120169 commit 062dde9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ endforeach()

# Convert shaders to headers and generate master header with the list of all files
if(NOT FILE2STRING_PATH STREQUAL "")
find_package(Python3 REQUIRED)

set(SHADER_OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/shaders_inc)

file(MAKE_DIRECTORY ${SHADER_OUTPUT_DIR})
Expand All @@ -78,7 +80,7 @@ if(NOT FILE2STRING_PATH STREQUAL "")
get_filename_component(FILE_NAME ${FILE} NAME)
set(CONVERTED_FILE ${SHADER_OUTPUT_DIR}/${FILE_NAME}.h)
add_custom_command(OUTPUT ${CONVERTED_FILE}
COMMAND ${PYTHON_EXECUTABLE} ${FILE2STRING_PATH} ${FILE} ${CONVERTED_FILE}
COMMAND ${Python3_EXECUTABLE} ${FILE2STRING_PATH} ${FILE} ${CONVERTED_FILE}
MAIN_DEPENDENCY ${FILE} # the primary input source file to the command
COMMENT "Processing shader ${FILE}"
VERBATIM)
Expand Down

0 comments on commit 062dde9

Please sign in to comment.