vcpkg/ports/glslang/portfile.cmake
2023-10-26 13:15:55 -07:00

58 lines
1.7 KiB
CMake

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KhronosGroup/glslang
REF "${VERSION}"
SHA512 678df76a6f23b9da93f111fc7e6db57b7f6bf34661b077f9259a0a77d6c023b4d2e3c1cd60b3f9fc15fe69f25cdcb19877e88a50771d3d5275e32574eaefc056
HEAD_REF master
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools ENABLE_GLSLANG_BINARIES
rtti ENABLE_RTTI
)
if (ENABLE_GLSLANG_BINARIES)
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON_PATH ${PYTHON3} DIRECTORY)
vcpkg_add_to_path("${PYTHON_PATH}")
endif ()
if (VCPKG_TARGET_IS_WINDOWS)
set(PLATFORM_OPTIONS "-DOVERRIDE_MSVCCRT=OFF")
endif ()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_EXTERNAL=OFF
-DENABLE_CTEST=OFF
-DSKIP_GLSLANG_INSTALL=OFF
${FEATURE_OPTIONS}
${PLATFORM_OPTIONS}
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/glslang DO_NOT_DELETE_PARENT_CONFIG_PATH)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/glslang-config.cmake"
"${PACKAGE_PREFIX_DIR}/lib/cmake/glslang/glslang-targets.cmake"
"${PACKAGE_PREFIX_DIR}/share/${PORT}/glslang-targets.cmake"
)
vcpkg_copy_pdbs()
if (ENABLE_GLSLANG_BINARIES)
vcpkg_copy_tools(TOOL_NAMES glslangValidator spirv-remap AUTO_CLEAN)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_copy_tools(TOOL_NAMES glslang AUTO_CLEAN)
endif()
endif ()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")