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
|
2021-05-11 15:33:14 +08:00
|
|
|
REF f5e592d8ee5ffb1d9af5be7f715ce3576b8bf9c4 #commite on 2021-04-29
|
|
|
|
SHA512 8168cc2b2c2f18ae7411db8a74369c98bb2d19b5be94a5a5f96a1d4e8e22b70c219c1cdfaef934b674d9c078dd97d0481c62e382aab432e3b89aa79ea5051673
|
2017-05-03 20:12:40 +08:00
|
|
|
HEAD_REF master
|
2018-11-15 03:05:11 +08:00
|
|
|
PATCHES
|
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
|
|
|
|
2016-09-21 21:33:07 +08:00
|
|
|
vcpkg_configure_cmake(
|
2017-05-03 20:12:40 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-11-29 02:25:52 +08:00
|
|
|
PREFER_NINJA
|
2018-11-15 03:05:11 +08:00
|
|
|
OPTIONS
|
2017-12-13 09:34:16 +08:00
|
|
|
-DBUILD_GMOCK=ON
|
|
|
|
-DBUILD_GTEST=ON
|
2018-03-13 00:51:25 +08:00
|
|
|
-DCMAKE_DEBUG_POSTFIX=d
|
2017-12-13 09:34:16 +08:00
|
|
|
-Dgtest_force_shared_crt=${GTEST_FORCE_SHARED_CRT}
|
2016-09-21 21:33:07 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
2020-08-20 10:44:43 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/GTest TARGET_PATH share/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"
|
|
|
|
"${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
|
|
|
|
2019-08-16 10:07:20 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/gtest_maind.lib)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gtest_maind.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/gtest_maind.lib)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gmock_maind.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/gmock_maind.lib)
|
|
|
|
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/share/gtest/GTestTargets-debug.cmake DEBUG_CONFIG)
|
|
|
|
string(REPLACE "\${_IMPORT_PREFIX}/debug/lib/gtest_maind.lib"
|
|
|
|
"\${_IMPORT_PREFIX}/debug/lib/manual-link/gtest_maind.lib" DEBUG_CONFIG "${DEBUG_CONFIG}")
|
|
|
|
string(REPLACE "\${_IMPORT_PREFIX}/debug/lib/gmock_maind.lib"
|
|
|
|
"\${_IMPORT_PREFIX}/debug/lib/manual-link/gmock_maind.lib" DEBUG_CONFIG "${DEBUG_CONFIG}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/gtest/GTestTargets-debug.cmake "${DEBUG_CONFIG}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/gtest_main.lib)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gtest_main.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/gtest_main.lib)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gmock_main.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/gmock_main.lib)
|
|
|
|
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/share/gtest/GTestTargets-release.cmake RELEASE_CONFIG)
|
|
|
|
string(REPLACE "\${_IMPORT_PREFIX}/lib/gtest_main.lib"
|
|
|
|
"\${_IMPORT_PREFIX}/lib/manual-link/gtest_main.lib" RELEASE_CONFIG "${RELEASE_CONFIG}")
|
|
|
|
string(REPLACE "\${_IMPORT_PREFIX}/lib/gmock_main.lib"
|
|
|
|
"\${_IMPORT_PREFIX}/lib/manual-link/gmock_main.lib" RELEASE_CONFIG "${RELEASE_CONFIG}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/gtest/GTestTargets-release.cmake "${RELEASE_CONFIG}")
|
|
|
|
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)
|