From 02f00dfbc75844a09b121a6f0de35747dafb898f Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 26 Nov 2016 02:40:38 -0800 Subject: [PATCH] [zstd] Reduce modifications to the upstream CMake. Remove all variation from the import lib name. --- ports/zstd/portfile.cmake | 40 +++++++++------------------------------ 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/ports/zstd/portfile.cmake b/ports/zstd/portfile.cmake index 7384e54616..0cb089ce56 100644 --- a/ports/zstd/portfile.cmake +++ b/ports/zstd/portfile.cmake @@ -7,30 +7,6 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -# Name dynamic libs to be non-versioned and simpler "zstd". -# Avoid name conflict with static, so postfix static to "zstd-static" -# This seems to be less painful than renaming a DLL file after creation. -set(lib_cmake_filename ${SOURCE_PATH}/build/cmake/lib/CMakeLists.txt) -if (NOT EXISTS ${lib_cmake_filename}.orig) - file(INSTALL ${SOURCE_PATH}/build/cmake/lib/CMakeLists.txt - DESTINATION ${SOURCE_PATH}/build/cmake/lib - RENAME CMakeLists.txt.orig) -endif() -file(READ "${lib_cmake_filename}" lib_cmake_content) -string(REPLACE - "SET(SHARED_LIBRARY_OUTPUT_NAME \${LIBRARY_BASE_NAME}.\${LIBVER_MAJOR}.\${LIBVER_MINOR}.\${LIBVER_RELEASE})" - "SET(SHARED_LIBRARY_OUTPUT_NAME zstd)" - lib_cmake_content - "${lib_cmake_content}" -) -string(REPLACE - "SET(STATIC_LIBRARY_OUTPUT_NAME \${LIBRARY_BASE_NAME})" - "SET(STATIC_LIBRARY_OUTPUT_NAME zstd-static)" - lib_cmake_content - "${lib_cmake_content}" -) -file(WRITE "${lib_cmake_filename}" "${lib_cmake_content}") - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/build/cmake OPTIONS -DZSTD_LEGACY_SUPPORT=1 @@ -46,17 +22,19 @@ file(COPY ${SOURCE_PATH}/lib/dictBuilder/zdict.h DESTINATION ${CURRENT_PACKAGES_ set(RELDIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/Release) set(DEBDIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/Debug) -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(INSTALL ${RELDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "zstd_*.lib") - file(INSTALL ${RELDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "zstd_*.dll") - file(INSTALL ${DEBDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib FILES_MATCHING PATTERN "zstd_*.lib") - file(INSTALL ${DEBDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "zstd_*.dll") + +if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file(INSTALL ${RELDIR}/zstdlib.1.1.1024_${TRIPLET_SYSTEM_ARCH}.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib RENAME zstdlib.lib) + file(INSTALL ${DEBDIR}/zstdlib.1.1.1024_${TRIPLET_SYSTEM_ARCH}.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib RENAME zstdlib.lib) + file(INSTALL ${RELDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") + file(INSTALL ${DEBDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dll") vcpkg_copy_pdbs() else() - file(INSTALL ${RELDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "zstd-static_*.lib") - file(INSTALL ${DEBDIR}/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib FILES_MATCHING PATTERN "zstd-static_*.lib") + file(INSTALL ${RELDIR}/zstdlib_${TRIPLET_SYSTEM_ARCH}.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib RENAME zstdlib.lib) + file(INSTALL ${DEBDIR}/zstdlib_${TRIPLET_SYSTEM_ARCH}.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib RENAME zstdlib.lib) endif() + # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/zstd) file(RENAME ${CURRENT_PACKAGES_DIR}/share/zstd/LICENSE ${CURRENT_PACKAGES_DIR}/share/zstd/copyright)