From 5c8d362b2210f7efcd91cb342da8b992cf927566 Mon Sep 17 00:00:00 2001 From: Max Smolens Date: Mon, 20 Feb 2017 17:59:02 -0500 Subject: [PATCH] [gtest] Support static build --- ports/gtest/portfile.cmake | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/ports/gtest/portfile.cmake b/ports/gtest/portfile.cmake index d1ba722d7a6..33db3b2bacc 100644 --- a/ports/gtest/portfile.cmake +++ b/ports/gtest/portfile.cmake @@ -1,7 +1,3 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) find_program(GIT git) @@ -42,16 +38,19 @@ vcpkg_configure_cmake( vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/googletest/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/gtest RENAME copyright) -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) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin/) -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) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + 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) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin/) + 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) +endif() 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)