2016-09-21 21:33:07 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
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
|
|
|
|
REF release-1.8.0
|
|
|
|
SHA512 1dbece324473e53a83a60601b02c92c089f5d314761351974e097b2cf4d24af4296f9eb8653b6b03b1e363d9c5f793897acae1f0c7ac40149216035c4d395d9d
|
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Enable-C-11-features-for-VS2015-fix-appveyor-fail.patch
|
|
|
|
)
|
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
|
2017-12-13 09:34:16 +08:00
|
|
|
OPTIONS
|
|
|
|
-DBUILD_GMOCK=ON
|
|
|
|
-DBUILD_GTEST=ON
|
|
|
|
-Dgtest_force_shared_crt=${GTEST_FORCE_SHARED_CRT}
|
2016-09-21 21:33:07 +08:00
|
|
|
)
|
|
|
|
|
2017-10-04 08:03:17 +08:00
|
|
|
set(ENV{_CL_} "/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING")
|
|
|
|
|
2016-09-21 21:33:07 +08:00
|
|
|
vcpkg_install_cmake()
|
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"
|
|
|
|
"${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-05-03 20:12:40 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/googletest/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/gtest RENAME copyright)
|
2017-02-21 06:59:02 +08:00
|
|
|
|
2017-12-13 09:34:16 +08:00
|
|
|
# This block will be unnecessary in googletest 1.9.0 (or later).
|
|
|
|
# These dll files are installed in ../bin directory by default settings.
|
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/gtest.dll)
|
2017-02-21 06:59:02 +08:00
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin/)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gtest.dll ${CURRENT_PACKAGES_DIR}/bin/gtest.dll)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gtest_main.dll ${CURRENT_PACKAGES_DIR}/bin/gtest_main.dll)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gmock.dll ${CURRENT_PACKAGES_DIR}/bin/gmock.dll)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gmock_main.dll ${CURRENT_PACKAGES_DIR}/bin/gmock_main.dll)
|
2017-12-13 09:34:16 +08:00
|
|
|
endif()
|
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/gtest.dll)
|
2017-02-21 06:59:02 +08:00
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin/)
|
2017-12-15 14:24:37 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gtest.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gtest.dll)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gtest_main.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gtest_main.dll)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gmock.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gmock.dll)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gmock_main.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gmock_main.dll)
|
2017-12-13 09:34:16 +08:00
|
|
|
endif()
|
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/gtest.lib)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gtest.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/gtest.lib)
|
|
|
|
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.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/gmock.lib)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gmock_main.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/gmock_main.lib)
|
|
|
|
endif()
|
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/gtest.lib)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gtest.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/gtestd.lib)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gtest_main.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/gtest_maind.lib)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gmock.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/gmockd.lib)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gmock_main.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/gmock_maind.lib)
|
2017-02-21 06:59:02 +08:00
|
|
|
endif()
|
2016-11-26 15:10:27 +08:00
|
|
|
|
2016-09-21 21:33:07 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2017-11-17 15:54:55 +08:00
|
|
|
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|