diff options
| author | Victor Romero <romerosanchezv@gmail.com> | 2019-04-02 16:53:20 -0700 |
|---|---|---|
| committer | Victor Romero <romerosanchezv@gmail.com> | 2019-04-02 16:53:20 -0700 |
| commit | 9596fe7dd72179045cd9460730a71e197e82b1c2 (patch) | |
| tree | c27ae77fe5a646686bbf72f910416dfbb2af9e0b /scripts | |
| parent | f41cc7b47cd0e846e047891b605f6870cc598ccb (diff) | |
| parent | 0fffb47ed02507aeacc29c64d91e9d4639f981f6 (diff) | |
| download | vcpkg-9596fe7dd72179045cd9460730a71e197e82b1c2.tar.gz vcpkg-9596fe7dd72179045cd9460730a71e197e82b1c2.zip | |
Merge branch 'master' of https://github.com/Microsoft/vcpkg into pr/cmake_3_14
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/cmake/vcpkg_find_acquire_program.cmake | 4 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_test_cmake.cmake | 92 |
2 files changed, 52 insertions, 44 deletions
diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index d8dd10b2b..1642bf3b4 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -136,7 +136,9 @@ function(vcpkg_find_acquire_program VAR) set(PATHS "${DOWNLOADS}/tools/nuget") set(BREW_PACKAGE_NAME "nuget") set(URL "https://dist.nuget.org/win-x86-commandline/v4.8.1/nuget.exe") - set(HASH 42CB744338AF8DECC033A75BCE5B4C4DF28E102BAFC45F9A8BA86D7BC010F5B43EBACAE80D7B28C4F85AC900EEFC2A349620AE65F27F6CA1C21C53B63B92924B) + set(ARCHIVE "nuget.exe") + set(NOEXTRACT ON) + set(HASH 42cb744338af8decc033a75bce5b4c4df28e102bafc45f9a8ba86d7bc010f5b43ebacae80d7b28c4f85ac900eefc2a349620ae65f27f6ca1c21c53b63b92924b) elseif(VAR MATCHES "MESON") set(PROGNAME meson) set(REQUIRED_INTERPRETER PYTHON3) diff --git a/scripts/cmake/vcpkg_test_cmake.cmake b/scripts/cmake/vcpkg_test_cmake.cmake index f02f0cf07..20343bf64 100644 --- a/scripts/cmake/vcpkg_test_cmake.cmake +++ b/scripts/cmake/vcpkg_test_cmake.cmake @@ -16,58 +16,64 @@ ## Indicates that the library expects to be found via built-in CMake targets. ## function(vcpkg_test_cmake) - cmake_parse_arguments(_tc "MODULE" "PACKAGE_NAME" "" ${ARGN}) + # The following issues need to be addressed before re-enabling this function. + # 1. Use the actual vcpkg toolchain file. + # 2. Select a generator in the same method as vcpkg_configure_cmake() as though the PREFER_NINJA flag was always passed. + # 3. Fully emulate the toolchain file for the just-built package (just adding it to CMAKE_PREFIX_PATH is not enough). + return() - if(NOT DEFINED _tc_PACKAGE_NAME) - message(FATAL_ERROR "PACKAGE_NAME must be specified") - endif() - if(_tc_MODULE) - set(PACKAGE_TYPE MODULE) - else() - set(PACKAGE_TYPE CONFIG) - endif() + cmake_parse_arguments(_tc "MODULE" "PACKAGE_NAME" "" ${ARGN}) - if(VCPKG_PLATFORM_TOOLSET STREQUAL "v142") - message(STATUS "Skipping CMake integration test due to v142 / CMake interaction issues") - return() - endif() + if(NOT DEFINED _tc_PACKAGE_NAME) + message(FATAL_ERROR "PACKAGE_NAME must be specified") + endif() + if(_tc_MODULE) + set(PACKAGE_TYPE MODULE) + else() + set(PACKAGE_TYPE CONFIG) + endif() - message(STATUS "Performing CMake integration test") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) + if(VCPKG_PLATFORM_TOOLSET STREQUAL "v142") + message(STATUS "Skipping CMake integration test due to v142 / CMake interaction issues") + return() + endif() - #Generate Dummy source + message(STATUS "Performing CMake integration test") + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) + + #Generate Dummy source # set(VCPKG_TEST_SOURCE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test/CMakeIntegration.cpp) # file(WRITE ${VCPKG_TEST_SOURCE} "int main() \{\n") # file(APPEND ${VCPKG_TEST_SOURCE} "return 0;}") - # Generate test source CMakeLists.txt - set(VCPKG_TEST_CMAKELIST ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test/CMakeLists.txt) - file(WRITE ${VCPKG_TEST_CMAKELIST} "cmake_minimum_required(VERSION 3.10)\n") - file(APPEND ${VCPKG_TEST_CMAKELIST} "set(CMAKE_PREFIX_PATH \"${CURRENT_PACKAGES_DIR};${CURRENT_INSTALLED_DIR}\")\n") - file(APPEND ${VCPKG_TEST_CMAKELIST} "\n") - file(APPEND ${VCPKG_TEST_CMAKELIST} "find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)\n") - #To properly test if the package is actually working haveway correctly we have to link all targets of a package to - #a test executable and than actually build it. This will not discover if every symbol exported by the library is available/linked - #but it will doscover if all files which are linked by a target actual exist. Problem is: How to discover all targets? + # Generate test source CMakeLists.txt + set(VCPKG_TEST_CMAKELIST ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test/CMakeLists.txt) + file(WRITE ${VCPKG_TEST_CMAKELIST} "cmake_minimum_required(VERSION 3.10)\n") + file(APPEND ${VCPKG_TEST_CMAKELIST} "set(CMAKE_PREFIX_PATH \"${CURRENT_PACKAGES_DIR};${CURRENT_INSTALLED_DIR}\")\n") + file(APPEND ${VCPKG_TEST_CMAKELIST} "\n") + file(APPEND ${VCPKG_TEST_CMAKELIST} "find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)\n") + #To properly test if the package is actually working haveway correctly we have to link all targets of a package to + #a test executable and than actually build it. This will not discover if every symbol exported by the library is available/linked + #but it will doscover if all files which are linked by a target actual exist. Problem is: How to discover all targets? # file(APPEND ${VCPKG_TEST_CMAKELIST} "add_executable(${_tc_PACKAGE_NAME}_exe ${VCPKG_TEST_SOURCE})\n") # file(APPEND ${VCPKG_TEST_CMAKELIST} "target_link_libraries(${_tc_PACKAGE_NAME}_exe PRIVATE ${_tc_PACKAGE_NAME})\n") - if(DEFINED _VCPKG_CMAKE_GENERATOR) - set(VCPKG_CMAKE_TEST_GENERATOR "${_VCPKG_CMAKE_GENERATOR}") - else() - set(VCPKG_CMAKE_TEST_GENERATOR Ninja) - endif() + if(DEFINED _VCPKG_CMAKE_GENERATOR) + set(VCPKG_CMAKE_TEST_GENERATOR "${_VCPKG_CMAKE_GENERATOR}") + else() + set(VCPKG_CMAKE_TEST_GENERATOR Ninja) + endif() - # Run cmake config with a generated CMakeLists.txt - set(LOGPREFIX "${CURRENT_BUILDTREES_DIR}/test-cmake-${TARGET_TRIPLET}") - execute_process( - COMMAND ${CMAKE_COMMAND} -G ${VCPKG_CMAKE_TEST_GENERATOR} . - OUTPUT_FILE "${LOGPREFIX}-out.log" - ERROR_FILE "${LOGPREFIX}-err.log" - RESULT_VARIABLE error_code - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test - ) - if(error_code) - message(FATAL_ERROR "CMake integration test failed; unable to find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)") - endif() + # Run cmake config with a generated CMakeLists.txt + set(LOGPREFIX "${CURRENT_BUILDTREES_DIR}/test-cmake-${TARGET_TRIPLET}") + execute_process( + COMMAND ${CMAKE_COMMAND} -G ${VCPKG_CMAKE_TEST_GENERATOR} . + OUTPUT_FILE "${LOGPREFIX}-out.log" + ERROR_FILE "${LOGPREFIX}-err.log" + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test + ) + if(error_code) + message(FATAL_ERROR "CMake integration test failed; unable to find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)") + endif() endfunction() |
