Skip to content

Commit

Permalink
Improved find_program check and errors
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Sauter <[email protected]>
  • Loading branch information
COM8 committed Jul 27, 2022
1 parent 1d99aeb commit 6236f5b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cmake/check_vulkan_version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ function(check_vulkan_version)
message(FATAL_ERROR "Invalid Vulkan include directory given. Try calling 'find_package(Vulkan REQUIRED)' before you call this function or set 'Vulkan_INCLUDE_DIR' manually!")
return()
endif()
message(STATUS "Found Vulkan Header version ${VULKAN_HEADER_VERSION}.")
message(STATUS "Found Vulkan Header version: ${VULKAN_HEADER_VERSION}")

# Get Vulkan version supported by driver
find_program(VULKAN_INFO_PATH NAMES vulkaninfo)
if(${VULKAN_INFO_PATH})
message(FATAL_ERROR "vulkaninfo not found. The Vulkan SDK might not be installed properly.")
if(VULKAN_INFO_PATH STREQUAL "VULKAN_INFO_PATH-NOTFOUND")
message(FATAL_ERROR "vulkaninfo not found. The Vulkan SDK might not be installed properly. If you know what you are doing, you can disable the Vulkan version check by setting 'KOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK' to 'ON'. (-DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON)")
return()
endif()

Expand Down
2 changes: 1 addition & 1 deletion cmake/vulkan_shader_compiler.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function(vulkan_compile_shader)
find_program(GLS_LANG_VALIDATOR_PATH NAMES glslangValidator)
if(${GLS_LANG_VALIDATOR_PATH})
if(GLS_LANG_VALIDATOR_PATH STREQUAL "GLS_LANG_VALIDATOR_PATH-NOTFOUND")
message(FATAL_ERROR "glslangValidator not found.")
return()
endif()
Expand Down
14 changes: 9 additions & 5 deletions config/FindSphinx.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@

#Look for an executable called sphinx-build
# Look for an executable called sphinx-build
find_program(SPHINX_EXECUTABLE
NAMES sphinx-build
DOC "Path to sphinx-build executable")
NAMES sphinx-build
DOC "Path to sphinx-build executable")

if(SPHINX_EXECUTABLE STREQUAL "SPHINX_EXECUTABLE-NOTFOUND")
message(FATAL_ERROR "sphinx-build not found.")
endif()

include(FindPackageHandleStandardArgs)
#Handle standard arguments to find_package like REQUIRED and QUIET

# Handle standard arguments to find_package like REQUIRED and QUIET
find_package_handle_standard_args(
Sphinx
"Failed to find sphinx-build executable"
Expand Down

0 comments on commit 6236f5b

Please sign in to comment.