vcpkg/ports/shaderc/portfile.cmake

48 lines
1.6 KiB
CMake
Raw Normal View History

#Note: glslang and spir tools doesn't export symbol and need to be build as static lib for cmake to work
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/shaderc
REF "v${VERSION}"
SHA512 f3c1db574312e7e5ee22fb64f47f6609369754dd1648eb4e51c30b3c40aafd9994e54560e8334d01ac7d00011285a94d0543fa9ecd6977ec34c39a965fd72269
HEAD_REF master
PATCHES
disable-update-version.patch
fix-build-type.patch
cmake-config-export.patch
)
2016-11-27 19:07:15 +08:00
file(COPY "${CMAKE_CURRENT_LIST_DIR}/build-version.inc" DESTINATION "${SOURCE_PATH}/glslc/src")
2016-11-27 19:07:15 +08:00
set(OPTIONS "")
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
list(APPEND OPTIONS -DSHADERC_ENABLE_SHARED_CRT=ON)
endif()
# shaderc uses python to manipulate copyright information
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_EXE_PATH "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path(PREPEND "${PYTHON3_EXE_PATH}")
2016-11-27 19:07:15 +08:00
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${OPTIONS}
"-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake"
-DSHADERC_ENABLE_EXAMPLES=OFF
-DSHADERC_SKIP_TESTS=true
2016-11-27 19:07:15 +08:00
)
vcpkg_cmake_install()
2016-11-27 19:07:15 +08:00
vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-shaderc CONFIG_PATH share/unofficial-shaderc)
vcpkg_copy_tools(TOOL_NAMES glslc AUTO_CLEAN)
2016-11-27 19:07:15 +08:00
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
2016-11-27 19:07:15 +08:00
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)