diff options
| author | yurybura <yurybura@gmail.com> | 2018-05-11 13:33:49 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-11 13:33:49 +0300 |
| commit | 9535a5631ac212b1c657a02be3ed9398df30c96c (patch) | |
| tree | a1124b7b5d81606c6d7413bb7075e8bdbc6afad3 /scripts/buildsystems | |
| parent | 92eb878b3efdb780097178125066a6070869c954 (diff) | |
| parent | 9a19dae13a0fa594245db2df45ec54a504bc82f3 (diff) | |
| download | vcpkg-9535a5631ac212b1c657a02be3ed9398df30c96c.tar.gz vcpkg-9535a5631ac212b1c657a02be3ed9398df30c96c.zip | |
Merge pull request #1 from Microsoft/master
update
Diffstat (limited to 'scripts/buildsystems')
| -rw-r--r-- | scripts/buildsystems/msbuild/applocal.ps1 | 17 | ||||
| -rw-r--r-- | scripts/buildsystems/vcpkg.cmake | 73 |
2 files changed, 31 insertions, 59 deletions
diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index 3f0f2ef37..e5f3c3dd0 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -4,6 +4,7 @@ param([string]$targetBinary, [string]$installedDir, [string]$tlogFile, [string]$ $g_searched = @{} # Note: installedDir is actually the bin\ directory. $g_install_root = Split-Path $installedDir -parent +$g_is_debug = $g_install_root -match '(.*\\)?debug(\\)?$' # Ensure we create the copied files log, even if we don't end up copying any files if ($copiedFilesLog) @@ -63,6 +64,13 @@ function resolve([string]$targetBinary) { deployBinary $baseTargetBinaryDir $installedDir "$_" if (Test-Path function:\deployPluginsIfQt) { deployPluginsIfQt $targetBinaryDir "$g_install_root\plugins" "$_" } if (Test-Path function:\deployOpenNI2) { deployOpenNI2 $targetBinaryDir "$g_install_root" "$_" } + if (Test-Path function:\deployPluginsIfMagnum) { + if ($g_is_debug) { + deployPluginsIfMagnum $targetBinaryDir "$g_install_root\bin\magnum-d" "$_" + } else { + deployPluginsIfMagnum $targetBinaryDir "$g_install_root\bin\magnum" "$_" + } + } resolve "$baseTargetBinaryDir\$_" } elseif (Test-Path "$targetBinaryDir\$_") { Write-Verbose " ${_}: $_ not found in vcpkg; locally deployed" @@ -85,5 +93,12 @@ if (Test-Path "$g_install_root\bin\OpenNI2\openni2deploy.ps1") { . "$g_install_root\bin\OpenNI2\openni2deploy.ps1" } +# Note: This is a hack to make Magnum work. +if (Test-Path "$g_install_root\bin\magnum\magnumdeploy.ps1") { + . "$g_install_root\bin\magnum\magnumdeploy.ps1" +} elseif (Test-Path "$g_install_root\bin\magnum-d\magnumdeploy.ps1") { + . "$g_install_root\bin\magnum-d\magnumdeploy.ps1" +} + resolve($targetBinary) -Write-Verbose $($g_searched | out-string)
\ No newline at end of file +Write-Verbose $($g_searched | out-string) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 1d1977e6a..91c196fb9 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -44,7 +44,7 @@ else() elseif(_VCPKG_CL MATCHES "arm/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) elseif(_VCPKG_CL MATCHES "arm64/cl.exe$") - set(_VCPKG_TARGET_TRIPLET_ARCH arm64) + set(_VCPKG_TARGET_TRIPLET_ARCH arm64) elseif(_VCPKG_CL MATCHES "bin/cl.exe$" OR _VCPKG_CL MATCHES "x86/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") @@ -57,12 +57,14 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") set(_VCPKG_TARGET_TRIPLET_PLAT uwp) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")) set(_VCPKG_TARGET_TRIPLET_PLAT linux) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")) set(_VCPKG_TARGET_TRIPLET_PLAT osx) -else() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")) set(_VCPKG_TARGET_TRIPLET_PLAT windows) +elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")) + set(_VCPKG_TARGET_TRIPLET_PLAT freebsd) endif() set(VCPKG_TARGET_TRIPLET ${_VCPKG_TARGET_TRIPLET_ARCH}-${_VCPKG_TARGET_TRIPLET_PLAT} CACHE STRING "Vcpkg target triplet (ex. x86-windows)") @@ -108,16 +110,6 @@ list(APPEND CMAKE_LIBRARY_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link ) -if (NOT DEFINED CMAKE_SYSTEM_VERSION AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp") - include(${_VCPKG_ROOT_DIR}/scripts/cmake/vcpkg_get_windows_sdk.cmake) - # This is used as an implicit parameter for vcpkg_get_windows_sdk - set(VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR}) - vcpkg_get_windows_sdk(WINDOWS_SDK_VERSION) - unset(VCPKG_ROOT_DIR) - set(CMAKE_SYSTEM_VERSION ${WINDOWS_SDK_VERSION} CACHE STRING "Windows SDK version") - message(STATUS "Found Windows SDK ${WINDOWS_SDK_VERSION}") -endif() - file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) set(CMAKE_SYSTEM_IGNORE_PATH "${_programfiles}/OpenSSL" @@ -188,24 +180,14 @@ macro(find_package name) if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${_vcpkg_lowercase_name}/vcpkg-cmake-wrapper.cmake") set(ARGS "${ARGV}") include(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${_vcpkg_lowercase_name}/vcpkg-cmake-wrapper.cmake) - elseif("${name}" STREQUAL "Boost") - set(_Boost_USE_STATIC_LIBS ${Boost_USE_STATIC_LIBS}) - set(_Boost_USE_MULTITHREADED ${Boost_USE_MULTITHREADED}) - set(_Boost_USE_STATIC_RUNTIME ${Boost_USE_STATIC_RUNTIME}) - set(_Boost_COMPILER ${Boost_COMPILER}) + elseif("${name}" STREQUAL "Boost" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/boost") + # Checking for the boost headers disables this wrapper unless the user has installed at least one boost library unset(Boost_USE_STATIC_LIBS) unset(Boost_USE_MULTITHREADED) unset(Boost_USE_STATIC_RUNTIME) set(Boost_COMPILER "-vc140") _find_package(${ARGV}) - if(NOT Boost_FOUND) - set(Boost_USE_STATIC_LIBS ${_Boost_USE_STATIC_LIBS}) - set(Boost_USE_MULTITHREADED ${_Boost_USE_MULTITHREADED}) - set(Boost_USE_STATIC_RUNTIME ${_Boost_USE_STATIC_RUNTIME}) - set(Boost_COMPILER ${_Boost_COMPILER}) - _find_package(${ARGV}) - endif() - elseif("${name}" STREQUAL "ICU") + elseif("${name}" STREQUAL "ICU" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/unicode/utf.h") function(_vcpkg_find_in_list) list(FIND ARGV "COMPONENTS" COMPONENTS_IDX) set(COMPONENTS_IDX ${COMPONENTS_IDX} PARENT_SCOPE) @@ -216,7 +198,7 @@ macro(find_package name) else() _find_package(${ARGV}) endif() - elseif("${name}" STREQUAL "TIFF") + elseif("${name}" STREQUAL "TIFF" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/tiff.h") _find_package(${ARGV}) find_package(LibLZMA) if(TARGET TIFF::TIFF) @@ -225,24 +207,7 @@ macro(find_package name) if(TIFF_LIBRARIES) list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES}) endif() - elseif("${name}" STREQUAL "Freetype") - _find_package(${ARGV}) - find_package(ZLIB) - find_package(PNG) - find_package(BZip2) - if(TARGET Freetype::Freetype) - set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES BZip2::BZip2 PNG::PNG ZLIB::ZLIB) - endif() - if(FREETYPE_LIBRARIES) - list(APPEND FREETYPE_LIBRARIES ${BZIP2_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES}) - endif() - elseif("${name}" STREQUAL "tinyxml2") - _find_package(${ARGV}) - if(TARGET tinyxml2_static AND NOT TARGET tinyxml2) - _add_library(tinyxml2 INTERFACE IMPORTED) - set_target_properties(tinyxml2 PROPERTIES INTERFACE_LINK_LIBRARIES "tinyxml2_static") - endif() - elseif(("${name}" STREQUAL "HDF5" OR "${name}" STREQUAL "hdf5") AND NOT PROJECT_NAME STREQUAL "VTK") + elseif(("${name}" STREQUAL "HDF5" OR "${name}" STREQUAL "hdf5") AND NOT PROJECT_NAME STREQUAL "VTK" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/hdf5.h") # This is a hack to make VTK work. TODO: find another way to suppress the built-in find module. _find_package(${ARGV} CONFIG) # Fill in missing static/shared targets @@ -255,7 +220,7 @@ macro(find_package name) set_target_properties(hdf5::${HDF5TARGET}-static PROPERTIES INTERFACE_LINK_LIBRARIES "hdf5::${HDF5TARGET}-shared") endif() endforeach() - elseif("${name}" STREQUAL "GSL") + elseif("${name}" STREQUAL "GSL" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/gsl") _find_package(${ARGV}) if(GSL_FOUND AND TARGET GSL::gsl) set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Release ) @@ -267,7 +232,7 @@ macro(find_package name) set_target_properties( GSL::gslcblas PROPERTIES IMPORTED_LOCATION_DEBUG "${GSL_CBLAS_LIBRARY_DEBUG}" ) endif() endif() - elseif("${name}" STREQUAL "CURL") + elseif("${name}" STREQUAL "CURL" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/curl") _find_package(${ARGV}) if(CURL_FOUND) if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") @@ -276,16 +241,8 @@ macro(find_package name) "optimized" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") endif() endif() - elseif("${name}" STREQUAL "LibXml2") - _find_package(${ARGV}) - if(LibXml2_FOUND AND (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")) - list(APPEND LIBXML2_LIBRARIES - debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libiconv.lib - optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libiconv.lib - debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libcharset.lib - optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libcharset.lib - ws2_32) - endif() + elseif("${_vcpkg_lowercase_name}" STREQUAL "grpc" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/grpc") + _find_package(gRPC ${ARGN}) else() _find_package(${ARGV}) endif() |
