diff --git a/CMakeLists.txt b/CMakeLists.txt index 03383f73f..8486e9f0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,8 +43,16 @@ set(VSG_MAX_INSTRUMENTATION_LEVEL 1 CACHE STRING "Set the instrumentation level # Enable/disable shader compilation support that pulls in glslang set(VSG_SUPPORTS_ShaderCompiler 1 CACHE STRING "Optional shader compiler support, 0 for off, 1 for enabled." ) if (VSG_SUPPORTS_ShaderCompiler) - set(GLSLANG_MIN_VERSION "14" CACHE STRING "glslang 14 is the earliest version that we think installs itself properly on all platforms. Other platforms may be able to use an earlier version") - find_package(glslang ${GLSLANG_MIN_VERSION} CONFIG) + + # Try looking for glslang 15 first. + set(GLSLANG_MIN_VERSION "15" CACHE STRING "glslang 14 is the earliest version that we think installs itself properly on all platforms. Other platforms may be able to use an earlier version") + find_package(glslang ${GLSLANG_MIN_VERSION} CONFIG QUIET) + + if (NOT glslang_FOUND) + # fallback to trying glslang 14. + set(GLSLANG_MIN_VERSION "14") + find_package(glslang ${GLSLANG_MIN_VERSION} CONFIG) + endif() if (glslang_FOUND) set(FIND_DEPENDENCY_glslang "find_package(glslang ${GLSLANG_MIN_VERSION} CONFIG REQUIRED)")