vcpkg/ports/cpputest/portfile.cmake

52 lines
2.2 KiB
CMake
Raw Normal View History

2019-09-17 04:08:54 +08:00
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO cpputest/cpputest
REF 4699da9942a1bdcc33e2a8c8a48e863b0f18188e
SHA512 6f588691f1b4092b3be8167ab09f3a4a64c34715ac9397210724121d161024a43b12a88198b02b0cc8da7d72406670daaf375bb64cc4cf92c8bd2479e7a881bc
HEAD_REF master
PATCHES
fix-arm-build-error.patch
2019-09-17 04:08:54 +08:00
)
2022-12-20 03:33:56 +08:00
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
2019-09-17 04:08:54 +08:00
)
2022-12-20 03:33:56 +08:00
vcpkg_cmake_install()
2019-09-17 04:08:54 +08:00
2022-12-20 03:33:56 +08:00
vcpkg_cmake_config_fixup(CONFIG_PATH lib/CppUTest/cmake )
if (EXISTS "${CURRENT_PACKAGES_DIR}/lib/CppUTest")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/CppUTest")
2019-09-17 04:08:54 +08:00
endif()
2022-12-20 03:33:56 +08:00
if (EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/CppUTest")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/CppUTest")
2019-09-17 04:08:54 +08:00
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
2022-12-20 03:33:56 +08:00
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/manual-link")
file(GLOB CPPUTEST_LIBS "${CURRENT_PACKAGES_DIR}/lib/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}")
file(COPY ${CPPUTEST_LIBS} DESTINATION "${CURRENT_PACKAGES_DIR}/lib/manual-link")
file(REMOVE ${CPPUTEST_LIBS})
2022-12-20 03:33:56 +08:00
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/CppUTestTargets-release.cmake" "\${_IMPORT_PREFIX}/lib/" "\${_IMPORT_PREFIX}/lib/manual-link/")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
2022-12-20 03:33:56 +08:00
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link")
file(GLOB CPPUTEST_LIBS "${CURRENT_PACKAGES_DIR}/debug/lib/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}")
file(COPY ${CPPUTEST_LIBS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link")
file(REMOVE ${CPPUTEST_LIBS})
2022-12-20 03:33:56 +08:00
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/CppUTestTargets-debug.cmake" "\${_IMPORT_PREFIX}/debug/lib/" "\${_IMPORT_PREFIX}/debug/lib/manual-link/")
endif()
2022-12-20 03:33:56 +08:00
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
2019-09-17 04:08:54 +08:00
# Handle copyright
2022-12-20 03:33:56 +08:00
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)