2017-05-03 20:12:40 +08:00
|
|
|
if (EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git")
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/src)
|
2016-09-21 21:33:07 +08:00
|
|
|
endif()
|
|
|
|
|
2017-05-03 20:12:40 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO google/googletest
|
2023-09-14 06:54:23 +08:00
|
|
|
REF "v${VERSION}"
|
|
|
|
SHA512 765c326ccc1b87a01027385e69238266e356361cd4ee3e18e3c9d137a5d11fa5d657c164d02dd1be8fe693c8e10f2b580588dbfa57d27f070e2750f50d3e662c
|
2021-11-23 07:39:52 +08:00
|
|
|
HEAD_REF main
|
2018-11-15 03:05:11 +08:00
|
|
|
PATCHES
|
2023-02-24 03:14:11 +08:00
|
|
|
001-fix-UWP-death-test.patch
|
2022-04-06 01:57:13 +08:00
|
|
|
clang-tidy-no-lint.patch
|
2019-07-18 15:11:23 +08:00
|
|
|
fix-main-lib-path.patch
|
2017-05-03 20:12:40 +08:00
|
|
|
)
|
2016-09-21 21:33:07 +08:00
|
|
|
|
2017-12-13 09:34:16 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" GTEST_FORCE_SHARED_CRT)
|
2017-05-23 00:00:19 +08:00
|
|
|
|
2022-03-29 04:31:07 +08:00
|
|
|
vcpkg_cmake_configure(
|
2017-05-03 20:12:40 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2018-11-15 03:05:11 +08:00
|
|
|
OPTIONS
|
2017-12-13 09:34:16 +08:00
|
|
|
-DBUILD_GMOCK=ON
|
|
|
|
-Dgtest_force_shared_crt=${GTEST_FORCE_SHARED_CRT}
|
2016-09-21 21:33:07 +08:00
|
|
|
)
|
|
|
|
|
2022-03-29 04:31:07 +08:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/GTest)
|
2017-05-03 20:12:40 +08:00
|
|
|
|
2017-11-26 23:51:32 +08:00
|
|
|
file(
|
|
|
|
INSTALL
|
|
|
|
"${SOURCE_PATH}/googletest/src/gtest.cc"
|
|
|
|
"${SOURCE_PATH}/googletest/src/gtest_main.cc"
|
|
|
|
"${SOURCE_PATH}/googletest/src/gtest-all.cc"
|
2022-06-25 04:47:34 +08:00
|
|
|
"${SOURCE_PATH}/googletest/src/gtest-assertion-result.cc"
|
2017-11-26 23:51:32 +08:00
|
|
|
"${SOURCE_PATH}/googletest/src/gtest-death-test.cc"
|
|
|
|
"${SOURCE_PATH}/googletest/src/gtest-filepath.cc"
|
|
|
|
"${SOURCE_PATH}/googletest/src/gtest-internal-inl.h"
|
2019-03-05 02:29:28 +08:00
|
|
|
"${SOURCE_PATH}/googletest/src/gtest-matchers.cc"
|
2017-11-26 23:51:32 +08:00
|
|
|
"${SOURCE_PATH}/googletest/src/gtest-port.cc"
|
|
|
|
"${SOURCE_PATH}/googletest/src/gtest-printers.cc"
|
|
|
|
"${SOURCE_PATH}/googletest/src/gtest-test-part.cc"
|
|
|
|
"${SOURCE_PATH}/googletest/src/gtest-typed-test.cc"
|
|
|
|
DESTINATION
|
|
|
|
${CURRENT_PACKAGES_DIR}/src
|
|
|
|
)
|
|
|
|
|
2016-09-21 21:33:07 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2017-02-21 06:59:02 +08:00
|
|
|
|
2021-10-27 07:03:33 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2021-11-04 12:46:49 +08:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gmock_main.pc" "libdir=\${prefix}/lib" "libdir=\${prefix}/lib/manual-link")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gtest_main.pc" "libdir=\${prefix}/lib" "libdir=\${prefix}/lib/manual-link")
|
|
|
|
endif()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gmock_main.pc" "libdir=\${prefix}/lib" "libdir=\${prefix}/lib/manual-link")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gtest_main.pc" "libdir=\${prefix}/lib" "libdir=\${prefix}/lib/manual-link")
|
|
|
|
endif()
|
2016-09-21 21:33:07 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2017-11-17 15:54:55 +08:00
|
|
|
|
2021-02-09 06:08:25 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
2023-02-10 02:59:04 +08:00
|
|
|
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|