Commit 8325e114 authored by Ken Martin's avatar Ken Martin
Browse files

Add findglslang.cmake

Eventually for Vulkan which uses glslang to compile shaders
parent 51a1acd0
Pipeline #165348 passed with stage
if(WIN32)
find_path(glslang_INCLUDE_DIR
NAMES glslang/Public/ShaderLang.h
)
find_path(glslang_LIBRARY_DIR
NAMES glslang.lib
)
else()
find_path(glslang_INCLUDE_DIR
NAMES glslang/Public/ShaderLang.h
)
find_library(glslang_LIBRARY_DIR
NAMES glslang.lib
)
endif()
set(glslang_INCLUDE_DIRS ${glslang_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(glslang
DEFAULT_MSG
glslang_LIBRARY_DIR glslang_INCLUDE_DIR)
mark_as_advanced(glslang_INCLUDE_DIR glslang_LIBRARY)
if(glslang_FOUND AND NOT TARGET glslang::glslang)
add_library(glslang::glslang UNKNOWN IMPORTED)
set_target_properties(glslang::glslang PROPERTIES
IMPORTED_LOCATION "${glslang_LIBRARY_DIR}/glslang.lib"
IMPORTED_LOCATION_DEBUG "${glslang_LIBRARY_DIR}/glslangd.lib"
IMPORTED_LINK_INTERFACE_LIBRARIES
"${glslang_LIBRARY_DIR}/SPIRV.lib;${glslang_LIBRARY_DIR}/HLSL.lib;${glslang_LIBRARY_DIR}/OGLCompiler.lib;${glslang_LIBRARY_DIR}/OSDependent.lib;${glslang_LIBRARY_DIR}/SPVRemapper.lib"
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG
"${glslang_LIBRARY_DIR}/SPIRVd.lib;${glslang_LIBRARY_DIR}/HLSLd.lib;${glslang_LIBRARY_DIR}/OGLCompilerd.lib;${glslang_LIBRARY_DIR}/OSDependentd.lib;${glslang_LIBRARY_DIR}/SPVRemapperd.lib"
INTERFACE_INCLUDE_DIRECTORIES "${glslang_INCLUDE_DIRS}")
endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment