From 334a35e4251eb3076594951550930aa9c46cec06 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 28 May 2017 13:07:20 -0700 Subject: [vcpkg-toolchain] Compare CMAKE_SYSTEM_NAME, not WINDOWS_STORE. Fixes #1179. --- scripts/buildsystems/vcpkg.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 26fa020db..d3e1e814a 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -1,3 +1,6 @@ +# Mark variables as used so cmake doesn't complain about them +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE}) + if(NOT VCPKG_TOOLCHAIN) if(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) @@ -32,7 +35,7 @@ if(NOT VCPKG_TOOLCHAIN) endif() endif() - if(WINDOWS_STORE OR WINDOWS_PHONE) + if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") set(_VCPKG_TARGET_TRIPLET_PLAT uwp) else() set(_VCPKG_TARGET_TRIPLET_PLAT windows) -- cgit v1.2.3 From 13b29588ba5c1b89969a3bf2a5cc61a97e9c83a0 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 9 Jun 2017 22:38:17 -0700 Subject: [vcpkg-cmake] Add tools subdirectories to the find programs path. Improves #1143. --- scripts/buildsystems/vcpkg.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index d3e1e814a..513c33ecb 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -1,6 +1,5 @@ # Mark variables as used so cmake doesn't complain about them set(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE}) - if(NOT VCPKG_TOOLCHAIN) if(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) @@ -55,7 +54,6 @@ if(NOT VCPKG_TOOLCHAIN) endif() endwhile() set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE}) - set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) @@ -103,6 +101,12 @@ if(NOT VCPKG_TOOLCHAIN) ) set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) + file(GLOB _VCPKG_TOOLS_DIRS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/*) + foreach(_VCPKG_TOOLS_DIR ${_VCPKG_TOOLS_DIRS}) + if(IS_DIRECTORY ${_VCPKG_TOOLS_DIR}) + set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_TOOLS_DIR}) + endif() + endforeach() option(VCPKG_APPLOCAL_DEPS "Automatically copy dependencies into the output directory for executables." ON) function(add_executable name) -- cgit v1.2.3 From c21a2fe38ab9523974a80194d6cea5dae6fcb76a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 30 Jun 2017 17:33:48 -0700 Subject: [angle] Add preliminary UWP support --- scripts/buildsystems/vcpkg.cmake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 513c33ecb..41bdb3e60 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -140,3 +140,10 @@ if(NOT VCPKG_TOOLCHAIN) set(VCPKG_TOOLCHAIN ON) endif() + +set(_UNUSED ${CMAKE_TOOLCHAIN_FILE}) +set(_UNUSED ${CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION}) +set(_UNUSED ${CMAKE_EXPORT_NO_PACKAGE_REGISTRY}) +set(_UNUSED ${CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY}) +set(_UNUSED ${CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY}) +set(_UNUSED ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP}) -- cgit v1.2.3 From 6950aeb6378adb47ff467a79d58ae8d4b5abe9cb Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 13 Jul 2017 17:47:20 -0700 Subject: [vcpkg-applocal] Recurse into other binaries. Fixes #1435. --- scripts/buildsystems/msbuild/applocal.ps1 | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index 932ba11cd..08a6d9a8f 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -50,6 +50,9 @@ function resolve([string]$targetBinary) { deployBinary $targetBinaryDir $installedDir "$_" if (Test-Path function:\deployPluginsIfQt) { deployPluginsIfQt $targetBinaryDir "$g_install_root\plugins" "$_" } resolve "$targetBinaryDir\$_" + } elseif (Test-Path "$targetBinaryDir\$_") { + Write-Verbose " ${_}: $_ not found in vcpkg; locally deployed" + resolve "$targetBinaryDir\$_" } else { Write-Verbose " ${_}: $installedDir\$_ not found" } -- cgit v1.2.3 From 63454f618996baefef3f60f90767cd4c02d7590d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 28 Jul 2017 11:44:54 -0700 Subject: [vcpkg-cmake] Always search for dynamic boost libraries --- scripts/buildsystems/vcpkg.cmake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 41bdb3e60..8fd08ffb6 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -138,6 +138,13 @@ if(NOT VCPKG_TOOLCHAIN) endif() endfunction() + function(find_package name) + if(name STREQUAL "Boost") + unset(Boost_USE_STATIC_LIBS) + endif() + _find_package(${ARGV}) + endfunction() + set(VCPKG_TOOLCHAIN ON) endif() -- cgit v1.2.3 From 4735040f66155c1b8f94d339bedb6afd4905e47c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 28 Jul 2017 16:46:57 -0700 Subject: [vcpkg] Hotfix for 63454f6189. --- scripts/buildsystems/vcpkg.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 8fd08ffb6..d8c7ee6b8 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -138,12 +138,12 @@ if(NOT VCPKG_TOOLCHAIN) endif() endfunction() - function(find_package name) + macro(find_package name) if(name STREQUAL "Boost") unset(Boost_USE_STATIC_LIBS) endif() _find_package(${ARGV}) - endfunction() + endmacro() set(VCPKG_TOOLCHAIN ON) endif() -- cgit v1.2.3 From f1c6b5cd4b581ec8d3a1b86fe01c4444e3906b2d Mon Sep 17 00:00:00 2001 From: paercebal Date: Sat, 12 Aug 2017 10:57:56 +0200 Subject: Enable tolerance for similar configurations --- scripts/buildsystems/msbuild/vcpkg.targets | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 5c24d755a..1cb338237 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -41,10 +41,10 @@ - %(AdditionalDependencies);$(VcpkgRoot)debug\lib\*.lib - %(AdditionalDependencies);$(VcpkgRoot)lib\*.lib - %(AdditionalLibraryDirectories);$(VcpkgRoot)lib;$(VcpkgRoot)lib\manual-link - %(AdditionalLibraryDirectories);$(VcpkgRoot)debug\lib;$(VcpkgRoot)debug\lib\manual-link + %(AdditionalDependencies);$(VcpkgRoot)debug\lib\*.lib + %(AdditionalDependencies);$(VcpkgRoot)lib\*.lib + %(AdditionalLibraryDirectories);$(VcpkgRoot)lib;$(VcpkgRoot)lib\manual-link + %(AdditionalLibraryDirectories);$(VcpkgRoot)debug\lib;$(VcpkgRoot)debug\lib\manual-link %(AdditionalIncludeDirectories);$(VcpkgRoot)include @@ -63,11 +63,11 @@ - - -- cgit v1.2.3 From 81613fa0ff506852fbb90757fc27f87ffe591fee Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 16 Oct 2017 11:22:21 -0700 Subject: [vcpkg-toolchain] Improvements; add VCPKG_CHAINLOAD_TOOLCHAIN_FILE --- scripts/buildsystems/vcpkg.cmake | 267 +++++++++++++++++++++------------------ 1 file changed, 143 insertions(+), 124 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index d8c7ee6b8..19fc99af7 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -1,156 +1,175 @@ # Mark variables as used so cmake doesn't complain about them -set(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE}) -if(NOT VCPKG_TOOLCHAIN) - if(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$") +mark_as_advanced(CMAKE_TOOLCHAIN_FILE) + +if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") +endif() + +if(VCPKG_TOOLCHAIN) + return() +endif() + +get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) +if( _CMAKE_IN_TRY_COMPILE ) + include( "${CMAKE_CURRENT_SOURCE_DIR}/../vcpkg.config.cmake" OPTIONAL ) +endif() + +if(VCPKG_TARGET_TRIPLET) +elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$") + set(_VCPKG_TARGET_TRIPLET_ARCH x86) +elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Xx]64$") + set(_VCPKG_TARGET_TRIPLET_ARCH x64) +elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]$") + set(_VCPKG_TARGET_TRIPLET_ARCH arm) +else() + if(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 Win64$") + set(_VCPKG_TARGET_TRIPLET_ARCH x64) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 ARM$") + set(_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) - elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Xx]64$") + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 Win64$") set(_VCPKG_TARGET_TRIPLET_ARCH x64) - elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]$") + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 ARM") set(_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017") + set(_VCPKG_TARGET_TRIPLET_ARCH x86) else() - if(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 Win64$") + find_program(_VCPKG_CL cl) + if(_VCPKG_CL MATCHES "amd64/cl.exe$" OR _VCPKG_CL MATCHES "x64/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH x64) - elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 ARM$") + elseif(_VCPKG_CL MATCHES "arm/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) - elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015$") - set(_VCPKG_TARGET_TRIPLET_ARCH x86) - elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 Win64$") - set(_VCPKG_TARGET_TRIPLET_ARCH x64) - elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 ARM") - set(_VCPKG_TARGET_TRIPLET_ARCH arm) - elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017") + elseif(_VCPKG_CL MATCHES "bin/cl.exe$" OR _VCPKG_CL MATCHES "x86/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) else() - find_program(_VCPKG_CL cl) - if(_VCPKG_CL MATCHES "amd64/cl.exe$" OR _VCPKG_CL MATCHES "x64/cl.exe$") - set(_VCPKG_TARGET_TRIPLET_ARCH x64) - elseif(_VCPKG_CL MATCHES "arm/cl.exe$") - set(_VCPKG_TARGET_TRIPLET_ARCH arm) - elseif(_VCPKG_CL MATCHES "bin/cl.exe$" OR _VCPKG_CL MATCHES "x86/cl.exe$") - set(_VCPKG_TARGET_TRIPLET_ARCH x86) - else() - message(FATAL_ERROR "Unable to determine target architecture.") - endif() + message(FATAL_ERROR "Unable to determine target architecture.") endif() endif() +endif() - if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") - set(_VCPKG_TARGET_TRIPLET_PLAT uwp) - else() - set(_VCPKG_TARGET_TRIPLET_PLAT windows) - endif() +if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") + set(_VCPKG_TARGET_TRIPLET_PLAT uwp) +else() + set(_VCPKG_TARGET_TRIPLET_PLAT windows) +endif() - set(VCPKG_TARGET_TRIPLET ${_VCPKG_TARGET_TRIPLET_ARCH}-${_VCPKG_TARGET_TRIPLET_PLAT} CACHE STRING "Vcpkg target triplet (ex. x86-windows)") - set(_VCPKG_TOOLCHAIN_DIR ${CMAKE_CURRENT_LIST_DIR}) +set(VCPKG_TARGET_TRIPLET ${_VCPKG_TARGET_TRIPLET_ARCH}-${_VCPKG_TARGET_TRIPLET_PLAT} CACHE STRING "Vcpkg target triplet (ex. x86-windows)") +set(_VCPKG_TOOLCHAIN_DIR ${CMAKE_CURRENT_LIST_DIR}) - #Detect .vcpkg-root to figure VCPKG_ROOT_DIR - SET(_VCPKG_ROOT_DIR_CANDIDATE ${CMAKE_CURRENT_LIST_DIR}) - while(IS_DIRECTORY ${_VCPKG_ROOT_DIR_CANDIDATE} AND NOT EXISTS "${_VCPKG_ROOT_DIR_CANDIDATE}/.vcpkg-root") - get_filename_component(_VCPKG_ROOT_DIR_TEMP ${_VCPKG_ROOT_DIR_CANDIDATE} DIRECTORY) - if (_VCPKG_ROOT_DIR_TEMP STREQUAL _VCPKG_ROOT_DIR_CANDIDATE) # If unchanged, we have reached the root of the drive - message(FATAL_ERROR "Could not find .vcpkg-root") - else() - SET(_VCPKG_ROOT_DIR_CANDIDATE ${_VCPKG_ROOT_DIR_TEMP}) - endif() - endwhile() - set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE}) - set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) - - if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) - list(APPEND CMAKE_PREFIX_PATH - ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug - ) - list(APPEND CMAKE_LIBRARY_PATH - ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/manual-link - ) +# Detect .vcpkg-root to figure VCPKG_ROOT_DIR +set(_VCPKG_ROOT_DIR_CANDIDATE ${CMAKE_CURRENT_LIST_DIR}) +while(IS_DIRECTORY ${_VCPKG_ROOT_DIR_CANDIDATE} AND NOT EXISTS "${_VCPKG_ROOT_DIR_CANDIDATE}/.vcpkg-root") + get_filename_component(_VCPKG_ROOT_DIR_TEMP ${_VCPKG_ROOT_DIR_CANDIDATE} DIRECTORY) + if (_VCPKG_ROOT_DIR_TEMP STREQUAL _VCPKG_ROOT_DIR_CANDIDATE) # If unchanged, we have reached the root of the drive + message(FATAL_ERROR "Could not find .vcpkg-root") + else() + SET(_VCPKG_ROOT_DIR_CANDIDATE ${_VCPKG_ROOT_DIR_TEMP}) endif() +endwhile() +set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE}) +set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) + +if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) list(APPEND CMAKE_PREFIX_PATH - ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} + ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug ) list(APPEND CMAKE_LIBRARY_PATH - ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link + ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/manual-link ) +endif() +list(APPEND CMAKE_PREFIX_PATH + ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} +) +list(APPEND CMAKE_LIBRARY_PATH + ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link +) - set(Boost_COMPILER "-vc140") +set(Boost_COMPILER "-vc140") - if (NOT DEFINED CMAKE_SYSTEM_VERSION) - 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}) - endif() +if (NOT DEFINED CMAKE_SYSTEM_VERSION) + 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") +endif() - file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) - set(CMAKE_SYSTEM_IGNORE_PATH - "${_programfiles}/OpenSSL" - "${_programfiles}/OpenSSL-Win32" - "${_programfiles}/OpenSSL-Win64" - "${_programfiles}/OpenSSL-Win32/lib/VC" - "${_programfiles}/OpenSSL-Win64/lib/VC" - "${_programfiles}/OpenSSL-Win32/lib/VC/static" - "${_programfiles}/OpenSSL-Win64/lib/VC/static" - "C:/OpenSSL/" - "C:/OpenSSL-Win32/" - "C:/OpenSSL-Win64/" - "C:/OpenSSL-Win32/lib/VC" - "C:/OpenSSL-Win64/lib/VC" - "C:/OpenSSL-Win32/lib/VC/static" - "C:/OpenSSL-Win64/lib/VC/static" - ) +file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) +set(CMAKE_SYSTEM_IGNORE_PATH + "${_programfiles}/OpenSSL" + "${_programfiles}/OpenSSL-Win32" + "${_programfiles}/OpenSSL-Win64" + "${_programfiles}/OpenSSL-Win32/lib/VC" + "${_programfiles}/OpenSSL-Win64/lib/VC" + "${_programfiles}/OpenSSL-Win32/lib/VC/static" + "${_programfiles}/OpenSSL-Win64/lib/VC/static" + "C:/OpenSSL/" + "C:/OpenSSL-Win32/" + "C:/OpenSSL-Win64/" + "C:/OpenSSL-Win32/lib/VC" + "C:/OpenSSL-Win64/lib/VC" + "C:/OpenSSL-Win32/lib/VC/static" + "C:/OpenSSL-Win64/lib/VC/static" +) - set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) - file(GLOB _VCPKG_TOOLS_DIRS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/*) - foreach(_VCPKG_TOOLS_DIR ${_VCPKG_TOOLS_DIRS}) - if(IS_DIRECTORY ${_VCPKG_TOOLS_DIR}) - set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_TOOLS_DIR}) - endif() - endforeach() - - option(VCPKG_APPLOCAL_DEPS "Automatically copy dependencies into the output directory for executables." ON) - function(add_executable name) - _add_executable(${ARGV}) - list(FIND ARGV "IMPORTED" IMPORTED_IDX) - list(FIND ARGV "ALIAS" ALIAS_IDX) - if(IMPORTED_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) - if(VCPKG_APPLOCAL_DEPS) - add_custom_command(TARGET ${name} POST_BUILD - COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 - -targetBinary $ - -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin" - -OutVariable out - ) - endif() - set_target_properties(${name} PROPERTIES VS_USER_PROPS do_not_import_user.props) - set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) - endif() - endfunction() - - function(add_library name) - _add_library(${ARGV}) - list(FIND ARGV "IMPORTED" IMPORTED_IDX) - list(FIND ARGV "INTERFACE" INTERFACE_IDX) - list(FIND ARGV "ALIAS" ALIAS_IDX) - if(IMPORTED_IDX EQUAL -1 AND INTERFACE_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) - set_target_properties(${name} PROPERTIES VS_USER_PROPS do_not_import_user.props) - set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) - endif() - endfunction() +set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) +file(GLOB _VCPKG_TOOLS_DIRS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/*) +foreach(_VCPKG_TOOLS_DIR ${_VCPKG_TOOLS_DIRS}) + if(IS_DIRECTORY ${_VCPKG_TOOLS_DIR}) + set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_TOOLS_DIR}) + endif() +endforeach() - macro(find_package name) - if(name STREQUAL "Boost") - unset(Boost_USE_STATIC_LIBS) +option(VCPKG_APPLOCAL_DEPS "Automatically copy dependencies into the output directory for executables." ON) +function(add_executable name) + _add_executable(${ARGV}) + list(FIND ARGV "IMPORTED" IMPORTED_IDX) + list(FIND ARGV "ALIAS" ALIAS_IDX) + if(IMPORTED_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) + if(VCPKG_APPLOCAL_DEPS) + add_custom_command(TARGET ${name} POST_BUILD + COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 + -targetBinary $ + -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin" + -OutVariable out + ) endif() - _find_package(${ARGV}) - endmacro() + set_target_properties(${name} PROPERTIES VS_USER_PROPS do_not_import_user.props) + set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) + endif() +endfunction() - set(VCPKG_TOOLCHAIN ON) -endif() +function(add_library name) + _add_library(${ARGV}) + list(FIND ARGV "IMPORTED" IMPORTED_IDX) + list(FIND ARGV "INTERFACE" INTERFACE_IDX) + list(FIND ARGV "ALIAS" ALIAS_IDX) + if(IMPORTED_IDX EQUAL -1 AND INTERFACE_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) + set_target_properties(${name} PROPERTIES VS_USER_PROPS do_not_import_user.props) + set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) + endif() +endfunction() + +macro(find_package name) + if(name STREQUAL "Boost") + unset(Boost_USE_STATIC_LIBS) + endif() + _find_package(${ARGV}) +endmacro() -set(_UNUSED ${CMAKE_TOOLCHAIN_FILE}) +set(VCPKG_TOOLCHAIN ON) set(_UNUSED ${CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION}) set(_UNUSED ${CMAKE_EXPORT_NO_PACKAGE_REGISTRY}) set(_UNUSED ${CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY}) set(_UNUSED ${CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY}) set(_UNUSED ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP}) + +if(NOT _CMAKE_IN_TRY_COMPILE) + file(TO_CMAKE_PATH "${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" _chainload_file) + file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/vcpkg.config.cmake" + "set(VCPKG_TARGET_TRIPLET \"${VCPKG_TARGET_TRIPLET}\" CACHE STRING \"\")\n" + "set(VCPKG_APPLOCAL_DEPS \"${VCPKG_APPLOCAL_DEPS}\" CACHE STRING \"\")\n" + "set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE \"${_chainload_file}\" CACHE STRING \"\")\n") +endif() \ No newline at end of file -- cgit v1.2.3 From 330b8d8bab6a3d07165bf7c05fea09a8e0d56348 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 4 Nov 2017 20:48:06 -0700 Subject: [vcpkg-msbuild-integration] Output warning when configuration is not determinable. Add special cases for RelWithDebInfo and MinSizeRel. --- scripts/buildsystems/msbuild/vcpkg.targets | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 1cb338237..ad1dde89b 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -36,15 +36,17 @@ $(Configuration) + Debug + Release $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), .vcpkg-root))\installed\$(VcpkgTriplet)\ - %(AdditionalDependencies);$(VcpkgRoot)debug\lib\*.lib - %(AdditionalDependencies);$(VcpkgRoot)lib\*.lib - %(AdditionalLibraryDirectories);$(VcpkgRoot)lib;$(VcpkgRoot)lib\manual-link - %(AdditionalLibraryDirectories);$(VcpkgRoot)debug\lib;$(VcpkgRoot)debug\lib\manual-link + %(AdditionalDependencies);$(VcpkgRoot)debug\lib\*.lib + %(AdditionalDependencies);$(VcpkgRoot)lib\*.lib + %(AdditionalLibraryDirectories);$(VcpkgRoot)lib;$(VcpkgRoot)lib\manual-link + %(AdditionalLibraryDirectories);$(VcpkgRoot)debug\lib;$(VcpkgRoot)debug\lib\manual-link %(AdditionalIncludeDirectories);$(VcpkgRoot)include @@ -57,6 +59,7 @@ + -- cgit v1.2.3 From 07e4e674f09e435ba2a444296bbc12814cc8428e Mon Sep 17 00:00:00 2001 From: Tsukasa Sugiura Date: Mon, 6 Nov 2017 04:33:35 +0900 Subject: Reset settings to find boost libraries Reset the settings to find the boost libraries that installed by vcpkg. vcpkg will always rename to Boost libraries name that able to be find with default settings of FindBoost.cmake. --- scripts/buildsystems/vcpkg.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 19fc99af7..68e29b87c 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -155,6 +155,8 @@ endfunction() macro(find_package name) if(name STREQUAL "Boost") unset(Boost_USE_STATIC_LIBS) + unset(Boost_USE_MULTITHREADED) + unset(Boost_USE_STATIC_RUNTIME) endif() _find_package(${ARGV}) endmacro() -- cgit v1.2.3 From 50f6bc4e8f103c695f8754962dde0be03e32cbc5 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 10 Nov 2017 17:34:00 -0800 Subject: [vcpkg-toolchain] Fix find_package detection of Boost. Fixes #2130. --- scripts/buildsystems/vcpkg.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 68e29b87c..e3aa46b64 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -153,7 +153,7 @@ function(add_library name) endfunction() macro(find_package name) - if(name STREQUAL "Boost") + if("${name}" STREQUAL "Boost") unset(Boost_USE_STATIC_LIBS) unset(Boost_USE_MULTITHREADED) unset(Boost_USE_STATIC_RUNTIME) -- cgit v1.2.3 From 24283ec1ee019df3e43dbb9c9bf2f1d9d1263911 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 15 Nov 2017 18:56:44 -0800 Subject: [leptonica][tiff] Add LZMA to tiff's dependent libraries. Leptonica should use TIFF_LIBRARIES. --- scripts/buildsystems/vcpkg.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index e3aa46b64..66dd50169 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -159,6 +159,16 @@ macro(find_package name) unset(Boost_USE_STATIC_RUNTIME) endif() _find_package(${ARGV}) + + if("${name}" STREQUAL "TIFF") + find_package(LibLZMA) + if(TARGET TIFF::TIFF) + set_property(TARGET TIFF::TIFF APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) + endif() + if(TIFF_LIBRARIES) + list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES}) + endif() + endif() endmacro() set(VCPKG_TOOLCHAIN ON) -- cgit v1.2.3 From 7e3dcc4f096925f152593e3c8cd33e5dbf0b4e6f Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 15 Nov 2017 21:58:26 -0800 Subject: [tesseract] Fix static linking. [icu][tiff] Add patches in toolchain to fix static linking. --- scripts/buildsystems/vcpkg.cmake | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 66dd50169..ff89439cc 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -157,10 +157,20 @@ macro(find_package name) unset(Boost_USE_STATIC_LIBS) unset(Boost_USE_MULTITHREADED) unset(Boost_USE_STATIC_RUNTIME) - endif() - _find_package(${ARGV}) - - if("${name}" STREQUAL "TIFF") + _find_package(${ARGV}) + elseif("${name}" STREQUAL "ICU") + function(_vcpkg_find_in_list) + list(FIND ARGV "COMPONENTS" COMPONENTS_IDX) + set(COMPONENTS_IDX ${COMPONENTS_IDX} PARENT_SCOPE) + endfunction() + _vcpkg_find_in_list(${ARGV}) + if(NOT COMPONENTS_IDX EQUAL -1) + _find_package(${ARGV} COMPONENTS data) + else() + _find_package(${ARGV}) + endif() + elseif("${name}" STREQUAL "TIFF") + _find_package(${ARGV}) find_package(LibLZMA) if(TARGET TIFF::TIFF) set_property(TARGET TIFF::TIFF APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) @@ -168,6 +178,8 @@ macro(find_package name) if(TIFF_LIBRARIES) list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES}) endif() + else() + _find_package(${ARGV}) endif() endmacro() -- cgit v1.2.3 From 141f10801c2fae8ab844e94fe5338d055892c0ac Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 25 Nov 2017 11:49:15 -0800 Subject: [vcpkg] Improve external toolchain handling. --- scripts/buildsystems/vcpkg.cmake | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index ff89439cc..4d82c43b7 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -1,6 +1,11 @@ # Mark variables as used so cmake doesn't complain about them mark_as_advanced(CMAKE_TOOLCHAIN_FILE) +get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) +if( _CMAKE_IN_TRY_COMPILE ) + include( "${CMAKE_CURRENT_SOURCE_DIR}/../vcpkg.config.cmake" OPTIONAL ) +endif() + if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") endif() @@ -9,11 +14,6 @@ if(VCPKG_TOOLCHAIN) return() endif() -get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) -if( _CMAKE_IN_TRY_COMPILE ) - include( "${CMAKE_CURRENT_SOURCE_DIR}/../vcpkg.config.cmake" OPTIONAL ) -endif() - if(VCPKG_TARGET_TRIPLET) elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) @@ -77,10 +77,16 @@ if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) list(APPEND CMAKE_LIBRARY_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/manual-link ) + list(APPEND CMAKE_FIND_ROOT_PATH + ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug + ) endif() list(APPEND CMAKE_PREFIX_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} ) +list(APPEND CMAKE_FIND_ROOT_PATH + ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} +) list(APPEND CMAKE_LIBRARY_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link ) -- cgit v1.2.3 From 14cbe496bcc136aac590f10d79848ec224088e85 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 25 Nov 2017 15:53:32 -0800 Subject: [vcpkg] Allow compilation inside WSL --- scripts/buildsystems/vcpkg.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 4d82c43b7..8edc2830c 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -42,6 +42,8 @@ else() set(_VCPKG_TARGET_TRIPLET_ARCH arm) 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") + set(_VCPKG_TARGET_TRIPLET_ARCH x64) else() message(FATAL_ERROR "Unable to determine target architecture.") endif() @@ -50,6 +52,8 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") set(_VCPKG_TARGET_TRIPLET_PLAT uwp) +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + set(_VCPKG_TARGET_TRIPLET_PLAT linux) else() set(_VCPKG_TARGET_TRIPLET_PLAT windows) endif() @@ -93,7 +97,7 @@ list(APPEND CMAKE_LIBRARY_PATH set(Boost_COMPILER "-vc140") -if (NOT DEFINED CMAKE_SYSTEM_VERSION) +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}) @@ -134,7 +138,7 @@ function(add_executable name) list(FIND ARGV "IMPORTED" IMPORTED_IDX) list(FIND ARGV "ALIAS" ALIAS_IDX) if(IMPORTED_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) - if(VCPKG_APPLOCAL_DEPS) + if(VCPKG_APPLOCAL_DEPS AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp") add_custom_command(TARGET ${name} POST_BUILD COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 -targetBinary $ -- cgit v1.2.3 From b4668e664a4db7b8bc9e9c4c202312e0fb7a8ff9 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 28 Nov 2017 13:17:10 -0800 Subject: [vcpkg] Only default target triplet to windows if on windows --- scripts/buildsystems/vcpkg.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 8edc2830c..24f6d855e 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -54,7 +54,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "Wind set(_VCPKG_TARGET_TRIPLET_PLAT uwp) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(_VCPKG_TARGET_TRIPLET_PLAT linux) -else() +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") set(_VCPKG_TARGET_TRIPLET_PLAT windows) endif() -- cgit v1.2.3 From a4f8515c9e6af66bbdcf704c75e5284daa240040 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 4 Dec 2017 17:37:08 -0800 Subject: [vcpkg-msbuild-integration] Address #2299 by using full path to powershell. --- scripts/buildsystems/msbuild/vcpkg.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index ad1dde89b..d6fbcf179 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -67,11 +67,11 @@ File="$(TLogLocation)$(ProjectName).write.1u.tlog" Lines="^$(TargetPath);$([System.IO.Path]::Combine($(ProjectDir),$(IntDir)))vcpkg.applocal.log" Encoding="Unicode"/> -- cgit v1.2.3 From e7cbb50f3dd323380928f4cb4e5b9bc0945abac8 Mon Sep 17 00:00:00 2001 From: Ilya Finkelshteyn Date: Tue, 5 Dec 2017 14:31:58 -0800 Subject: Fix path to powershell.exe https://github.com/Microsoft/vcpkg/issues/2299 --- scripts/buildsystems/msbuild/vcpkg.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index d6fbcf179..092e013b5 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -67,11 +67,11 @@ File="$(TLogLocation)$(ProjectName).write.1u.tlog" Lines="^$(TargetPath);$([System.IO.Path]::Combine($(ProjectDir),$(IntDir)))vcpkg.applocal.log" Encoding="Unicode"/> -- cgit v1.2.3 From 3c2b2cc60719b110de889b62dd13af5f1a4b883c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 8 Dec 2017 22:03:03 -0800 Subject: [vcpkg-cmake-toolchain] Use list(APPEND) instead of set(). Fixes #2336. Fix MPI issue introduced in cmake 3.10. Fixes #2317. Add _VCPKG_ROOT_DIR to persisted variables to reduce disk access during cmake reconfigure. --- scripts/buildsystems/vcpkg.cmake | 50 ++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 17 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 24f6d855e..cdef610c1 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -1,6 +1,7 @@ # Mark variables as used so cmake doesn't complain about them mark_as_advanced(CMAKE_TOOLCHAIN_FILE) +# This is a backport of CMAKE_TRY_COMPILE_PLATFORM_VARIABLES to cmake 3.0 get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) if( _CMAKE_IN_TRY_COMPILE ) include( "${CMAKE_CURRENT_SOURCE_DIR}/../vcpkg.config.cmake" OPTIONAL ) @@ -61,17 +62,19 @@ endif() set(VCPKG_TARGET_TRIPLET ${_VCPKG_TARGET_TRIPLET_ARCH}-${_VCPKG_TARGET_TRIPLET_PLAT} CACHE STRING "Vcpkg target triplet (ex. x86-windows)") set(_VCPKG_TOOLCHAIN_DIR ${CMAKE_CURRENT_LIST_DIR}) -# Detect .vcpkg-root to figure VCPKG_ROOT_DIR -set(_VCPKG_ROOT_DIR_CANDIDATE ${CMAKE_CURRENT_LIST_DIR}) -while(IS_DIRECTORY ${_VCPKG_ROOT_DIR_CANDIDATE} AND NOT EXISTS "${_VCPKG_ROOT_DIR_CANDIDATE}/.vcpkg-root") - get_filename_component(_VCPKG_ROOT_DIR_TEMP ${_VCPKG_ROOT_DIR_CANDIDATE} DIRECTORY) - if (_VCPKG_ROOT_DIR_TEMP STREQUAL _VCPKG_ROOT_DIR_CANDIDATE) # If unchanged, we have reached the root of the drive - message(FATAL_ERROR "Could not find .vcpkg-root") - else() - SET(_VCPKG_ROOT_DIR_CANDIDATE ${_VCPKG_ROOT_DIR_TEMP}) - endif() -endwhile() -set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE}) +if(NOT DEFINED _VCPKG_ROOT_DIR) + # Detect .vcpkg-root to figure VCPKG_ROOT_DIR + set(_VCPKG_ROOT_DIR_CANDIDATE ${CMAKE_CURRENT_LIST_DIR}) + while(IS_DIRECTORY ${_VCPKG_ROOT_DIR_CANDIDATE} AND NOT EXISTS "${_VCPKG_ROOT_DIR_CANDIDATE}/.vcpkg-root") + get_filename_component(_VCPKG_ROOT_DIR_TEMP ${_VCPKG_ROOT_DIR_CANDIDATE} DIRECTORY) + if (_VCPKG_ROOT_DIR_TEMP STREQUAL _VCPKG_ROOT_DIR_CANDIDATE) # If unchanged, we have reached the root of the drive + message(FATAL_ERROR "Could not find .vcpkg-root") + else() + SET(_VCPKG_ROOT_DIR_CANDIDATE ${_VCPKG_ROOT_DIR_TEMP}) + endif() + endwhile() + set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE} CACHE STRING "Vcpkg root directory") +endif() set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) @@ -95,8 +98,6 @@ list(APPEND CMAKE_LIBRARY_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link ) -set(Boost_COMPILER "-vc140") - 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 @@ -124,11 +125,11 @@ set(CMAKE_SYSTEM_IGNORE_PATH "C:/OpenSSL-Win64/lib/VC/static" ) -set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) +list(APPEND CMAKE_PROGRAM_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) file(GLOB _VCPKG_TOOLS_DIRS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/*) foreach(_VCPKG_TOOLS_DIR ${_VCPKG_TOOLS_DIRS}) if(IS_DIRECTORY ${_VCPKG_TOOLS_DIR}) - set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_TOOLS_DIR}) + list(APPEND CMAKE_PROGRAM_PATH ${_VCPKG_TOOLS_DIR}) endif() endforeach() @@ -167,6 +168,7 @@ macro(find_package name) unset(Boost_USE_STATIC_LIBS) unset(Boost_USE_MULTITHREADED) unset(Boost_USE_STATIC_RUNTIME) + set(Boost_COMPILER "-vc140") _find_package(${ARGV}) elseif("${name}" STREQUAL "ICU") function(_vcpkg_find_in_list) @@ -188,6 +190,17 @@ macro(find_package name) if(TIFF_LIBRARIES) list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES}) endif() + elseif("${name}" STREQUAL "MPI") + if(MPI_C_LIB_NAMES) + set(MPI_C_WORKS TRUE) + set(MPI_C_WRAPPER_FOUND TRUE) + endif() + if(MPI_CXX_LIB_NAMES) + set(MPI_CXX_WORKS TRUE) + set(MPI_CXX_WRAPPER_FOUND TRUE) + set(MPI_CXX_VALIDATE_SKIP_MPICXX TRUE) + endif() + _find_package(${ARGV}) else() _find_package(${ARGV}) endif() @@ -202,8 +215,11 @@ set(_UNUSED ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP}) if(NOT _CMAKE_IN_TRY_COMPILE) file(TO_CMAKE_PATH "${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" _chainload_file) + file(TO_CMAKE_PATH "${_VCPKG_ROOT_DIR}" _root_dir) file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/vcpkg.config.cmake" "set(VCPKG_TARGET_TRIPLET \"${VCPKG_TARGET_TRIPLET}\" CACHE STRING \"\")\n" "set(VCPKG_APPLOCAL_DEPS \"${VCPKG_APPLOCAL_DEPS}\" CACHE STRING \"\")\n" - "set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE \"${_chainload_file}\" CACHE STRING \"\")\n") -endif() \ No newline at end of file + "set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE \"${_chainload_file}\" CACHE STRING \"\")\n" + "set(_VCPKG_ROOT_DIR \"${_root_dir}\" CACHE STRING \"\")\n" + ) +endif() -- cgit v1.2.3 From 19860a093370c5a57bd8c622e5e47177193c7c8e Mon Sep 17 00:00:00 2001 From: cDc Date: Sat, 9 Dec 2017 10:24:19 +0200 Subject: [tinyexif] add TinyEXIF library (#2221) --- scripts/buildsystems/vcpkg.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index cdef610c1..22dc5d6b1 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -190,6 +190,12 @@ macro(find_package name) if(TIFF_LIBRARIES) list(APPEND TIFF_LIBRARIES ${LIBLZMA_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 "MPI") if(MPI_C_LIB_NAMES) set(MPI_C_WORKS TRUE) -- cgit v1.2.3 From 4567fa570916b0398ac0a65645e2074a4c8f0fd9 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 9 Dec 2017 17:25:12 -0800 Subject: [vcpkg-cmake-toolchain] Mark _VCPKG_ROOT_DIR as INTERNAL --- scripts/buildsystems/vcpkg.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 22dc5d6b1..71cf4e9b3 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -73,7 +73,7 @@ if(NOT DEFINED _VCPKG_ROOT_DIR) SET(_VCPKG_ROOT_DIR_CANDIDATE ${_VCPKG_ROOT_DIR_TEMP}) endif() endwhile() - set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE} CACHE STRING "Vcpkg root directory") + set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE} CACHE INTERNAL "Vcpkg root directory") endif() set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) -- cgit v1.2.3 From 6cb6a61aaf5ef2c143f974e9f731778bcd3f5cbe Mon Sep 17 00:00:00 2001 From: Tsukasa Sugiura Date: Wed, 20 Dec 2017 09:18:13 +0900 Subject: Fix find Boost when can not be found Boost that installed with Vcpkg (#2395) * Fix find Boost when can not be found Boost that installed with Vcpkg Fix find Boost when can not be found Boost that installed with Vcpkg. Re-find package Boost uisng user specified options. * Fix regex of generators Fix regex of generators. Add ending position. * Fix Save and Resore Boost_COMPILER * [vcpkg-cmake-integration] Expand saved boost variables --- scripts/buildsystems/vcpkg.cmake | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 71cf4e9b3..b8d3fbdbb 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -31,9 +31,9 @@ else() set(_VCPKG_TARGET_TRIPLET_ARCH x86) elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 Win64$") set(_VCPKG_TARGET_TRIPLET_ARCH x64) - elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 ARM") + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 ARM$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) - elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017") + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) else() find_program(_VCPKG_CL cl) @@ -165,11 +165,22 @@ endfunction() macro(find_package name) if("${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}) 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") function(_vcpkg_find_in_list) list(FIND ARGV "COMPONENTS" COMPONENTS_IDX) -- cgit v1.2.3 From 43aec468a14993044b9d6fd89d124c1371edba64 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 3 Jan 2018 10:58:59 +0100 Subject: Remove workaround for a bug in FindMPI.cmake that was introduced in cmake 3.10.0 and fixed in 3.10.1 --- scripts/buildsystems/vcpkg.cmake | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index b8d3fbdbb..7ebe695fb 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -207,17 +207,6 @@ macro(find_package name) add_library(tinyxml2 INTERFACE IMPORTED) set_target_properties(tinyxml2 PROPERTIES INTERFACE_LINK_LIBRARIES "tinyxml2_static") endif() - elseif("${name}" STREQUAL "MPI") - if(MPI_C_LIB_NAMES) - set(MPI_C_WORKS TRUE) - set(MPI_C_WRAPPER_FOUND TRUE) - endif() - if(MPI_CXX_LIB_NAMES) - set(MPI_CXX_WORKS TRUE) - set(MPI_CXX_WRAPPER_FOUND TRUE) - set(MPI_CXX_VALIDATE_SKIP_MPICXX TRUE) - endif() - _find_package(${ARGV}) else() _find_package(${ARGV}) endif() -- cgit v1.2.3 From a28138eb9ef8d2986227b7cd784be9ffa8492a46 Mon Sep 17 00:00:00 2001 From: Jacek Blaszczynski Date: Thu, 4 Jan 2018 00:19:52 +0100 Subject: Add preliminary support for arm-windows and arm64-windows triplets (#2371) * Add preliminary support for arm-windows and arm64-windows triplets Visual Studio 15.4 shipped with new VC tools targeting arm and arm64 for desktop. This change allows for recognition and usage of new triplets supporting arm and arm64 Windows desktop and server targets. * Remove unnecessary changes * Part 2 * Part 3 * Make detection of Arm64 _VCPKG_TARGET_ARCHITECTURE precise * Enforce usage of Visual Studio CMake generatorfor arm and temporarily arm64 targets * Address code review feedback, clean libjpeg-turbo port.cmake * [libjpeg-turbo][tiff] Reduce changes to existing libraries. * [vcpkg-cmake] Simplify toolchain selection logic and improve comments --- scripts/buildsystems/msbuild/vcpkg.targets | 15 +++++++++++++++ scripts/buildsystems/vcpkg.cmake | 5 +++++ 2 files changed, 20 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 092e013b5..499052e4d 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -24,6 +24,16 @@ x64-windows + + true + arm-windows + + + + true + arm64-windows + + true x64-uwp @@ -34,6 +44,11 @@ arm-uwp + + true + arm64-uwp + + $(Configuration) Debug diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 7ebe695fb..f157d3236 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -22,6 +22,8 @@ elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Xx]64$") set(_VCPKG_TARGET_TRIPLET_ARCH x64) elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) +elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]64$") + set(_VCPKG_TARGET_TRIPLET_ARCH arm64) else() if(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 Win64$") set(_VCPKG_TARGET_TRIPLET_ARCH x64) @@ -41,6 +43,8 @@ else() set(_VCPKG_TARGET_TRIPLET_ARCH x64) 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) 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") @@ -105,6 +109,7 @@ if (NOT DEFINED CMAKE_SYSTEM_VERSION AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "win 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) -- cgit v1.2.3 From 353d635b97df5c80f270ec200d16a6664c4d6ab6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 18 Jan 2018 10:45:34 -0800 Subject: [freetype][harfbuzz] Fix static freetype dependency. --- scripts/buildsystems/vcpkg.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index f157d3236..8ee21d411 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -206,6 +206,17 @@ 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) -- cgit v1.2.3 From 64203615a6d593fafbea36ce4cd01583deb0ad01 Mon Sep 17 00:00:00 2001 From: Tsukasa Sugiura Date: Wed, 24 Jan 2018 01:45:23 +0900 Subject: Fix OpenNI2 deploy (#2627) * Fix OpenNI2 deploy Fix to deploy initialization file and drivers. * [openni2] Adjusting deployopenni2.ps1 paths * Fix Create Directory of OpenNI2 Drivers Fix create directory of OpenNI2 drivers. * Fix Deploy Script Path Fix deploy script path. --- scripts/buildsystems/msbuild/applocal.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index 08a6d9a8f..0b56356a0 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -49,6 +49,7 @@ function resolve([string]$targetBinary) { if (Test-Path "$installedDir\$_") { deployBinary $targetBinaryDir $installedDir "$_" if (Test-Path function:\deployPluginsIfQt) { deployPluginsIfQt $targetBinaryDir "$g_install_root\plugins" "$_" } + if (Test-Path function:\deployOpenNI2) { deployOpenNI2 $targetBinaryDir "$g_install_root" "$_" } resolve "$targetBinaryDir\$_" } elseif (Test-Path "$targetBinaryDir\$_") { Write-Verbose " ${_}: $_ not found in vcpkg; locally deployed" @@ -66,5 +67,10 @@ if (Test-Path "$g_install_root\plugins\qtdeploy.ps1") { . "$g_install_root\plugins\qtdeploy.ps1" } +# Note: This is a hack to make OpenNI2 work. +if (Test-Path "$g_install_root\bin\OpenNI2\openni2deploy.ps1") { + . "$g_install_root\bin\OpenNI2\openni2deploy.ps1" +} + resolve($targetBinary) Write-Verbose $($g_searched | out-string) \ No newline at end of file -- cgit v1.2.3 From d385e296a6929bcf7e86eda925376e0cabce6fd4 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 5 Feb 2018 17:50:16 -0800 Subject: [hdf5] Always use config mode for HDF5 --- scripts/buildsystems/vcpkg.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 8ee21d411..76d77a0b5 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -223,6 +223,8 @@ macro(find_package name) add_library(tinyxml2 INTERFACE IMPORTED) set_target_properties(tinyxml2 PROPERTIES INTERFACE_LINK_LIBRARIES "tinyxml2_static") endif() + elseif("${name}" STREQUAL "HDF5") + _find_package(${ARGV} CONFIG) else() _find_package(${ARGV}) endif() -- cgit v1.2.3 From 676c861ae65569058014ac5367447464f1fb0877 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 7 Feb 2018 17:02:47 -0800 Subject: [curl] Add nghttp2.lib to dependencies of curl --- scripts/buildsystems/vcpkg.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 76d77a0b5..9fbc24ad7 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -225,6 +225,15 @@ macro(find_package name) endif() elseif("${name}" STREQUAL "HDF5") _find_package(${ARGV} CONFIG) + elseif("${name}" STREQUAL "CURL") + _find_package(${ARGV}) + if(CURL_FOUND) + if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") + list(APPEND CURL_LIBRARIES + "debug" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/nghttp2.lib" + "optimized" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") + endif() + endif() else() _find_package(${ARGV}) endif() -- cgit v1.2.3 From 116914e110e06183eaa8626accf1403637b6b681 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 7 Feb 2018 17:10:43 -0800 Subject: [vtk] Fix breaking change in find_package(HDF5) --- scripts/buildsystems/vcpkg.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 9fbc24ad7..0cb311555 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -223,7 +223,8 @@ macro(find_package name) add_library(tinyxml2 INTERFACE IMPORTED) set_target_properties(tinyxml2 PROPERTIES INTERFACE_LINK_LIBRARIES "tinyxml2_static") endif() - elseif("${name}" STREQUAL "HDF5") + elseif("${name}" STREQUAL "HDF5" AND NOT PROJECT_NAME STREQUAL "VTK") + # This is a hack to make VTK work. TODO: find another way to suppress the built-in find module. _find_package(${ARGV} CONFIG) elseif("${name}" STREQUAL "CURL") _find_package(${ARGV}) -- cgit v1.2.3 From 73e45b0ce2b4132a24708a0359c76927ed418e15 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 7 Feb 2018 19:00:11 -0800 Subject: [qt5-base][qtdeploy] Deploy plugin dependencies to the executable's folder. --- scripts/buildsystems/msbuild/applocal.ps1 | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index 0b56356a0..3f0f2ef37 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -24,6 +24,19 @@ function deployBinary([string]$targetBinaryDir, [string]$SourceDir, [string]$tar if ($tlogFile) { Add-Content $tlogFile "$targetBinaryDir\$targetBinaryName" } } + +Write-Verbose "Resolving base path $targetBinary..." +try +{ + $baseBinaryPath = Resolve-Path $targetBinary -erroraction stop + $baseTargetBinaryDir = Split-Path $baseBinaryPath -parent +} +catch [System.Management.Automation.ItemNotFoundException] +{ + return +} + +# Note: this function signature is depended upon by the qtdeploy.ps1 script function resolve([string]$targetBinary) { Write-Verbose "Resolving $targetBinary..." try @@ -47,10 +60,10 @@ function resolve([string]$targetBinary) { } $g_searched.Set_Item($_, $true) if (Test-Path "$installedDir\$_") { - deployBinary $targetBinaryDir $installedDir "$_" + deployBinary $baseTargetBinaryDir $installedDir "$_" if (Test-Path function:\deployPluginsIfQt) { deployPluginsIfQt $targetBinaryDir "$g_install_root\plugins" "$_" } if (Test-Path function:\deployOpenNI2) { deployOpenNI2 $targetBinaryDir "$g_install_root" "$_" } - resolve "$targetBinaryDir\$_" + resolve "$baseTargetBinaryDir\$_" } elseif (Test-Path "$targetBinaryDir\$_") { Write-Verbose " ${_}: $_ not found in vcpkg; locally deployed" resolve "$targetBinaryDir\$_" -- cgit v1.2.3 From 78b1396b88f93f74f9a007599e5998026445f14f Mon Sep 17 00:00:00 2001 From: Bruce Jones Date: Tue, 13 Feb 2018 19:13:27 -0500 Subject: Copy local dependencies for library targets (#2787) * Fix for issue #2786 * [vcpkg-cmake-toolchain] Only applocal dependencies for shared libraries --- scripts/buildsystems/vcpkg.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 0cb311555..ceb43940b 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -163,6 +163,15 @@ function(add_library name) list(FIND ARGV "INTERFACE" INTERFACE_IDX) list(FIND ARGV "ALIAS" ALIAS_IDX) if(IMPORTED_IDX EQUAL -1 AND INTERFACE_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) + get_target_property(IS_LIBRARY_SHARED ${name} TYPE) + if(VCPKG_APPLOCAL_DEPS AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp" AND IS_LIBRARY_SHARED STREQUAL "SHARED_LIBRARY") + add_custom_command(TARGET ${name} POST_BUILD + COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 + -targetBinary $ + -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin" + -OutVariable out + ) + endif() set_target_properties(${name} PROPERTIES VS_USER_PROPS do_not_import_user.props) set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) endif() -- cgit v1.2.3 From 0334365f516c5f229ff4fcf038c7d0190979a38a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 23 Feb 2018 16:50:32 -0800 Subject: [vcpkg-cmake-integration] Warn if no packages are installed for the current triplet. --- scripts/buildsystems/vcpkg.cmake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index ceb43940b..d5108471f 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -81,6 +81,10 @@ if(NOT DEFINED _VCPKG_ROOT_DIR) endif() set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) +if(NOT EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" AND NOT _CMAKE_IN_TRY_COMPILE) + message(WARNING "There are no libraries installed for the Vcpkg triplet ${VCPKG_TARGET_TRIPLET}.") +endif() + if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) list(APPEND CMAKE_PREFIX_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug -- cgit v1.2.3 From e70250ca199f9e55c88c242ee980313b8acb45e5 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 1 Mar 2018 10:36:13 -0800 Subject: [vcpkg] Improve handling of HDF5 targets --- scripts/buildsystems/vcpkg.cmake | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index d5108471f..7b738bd5e 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -233,12 +233,22 @@ macro(find_package name) elseif("${name}" STREQUAL "tinyxml2") _find_package(${ARGV}) if(TARGET tinyxml2_static AND NOT TARGET tinyxml2) - add_library(tinyxml2 INTERFACE IMPORTED) + _add_library(tinyxml2 INTERFACE IMPORTED) set_target_properties(tinyxml2 PROPERTIES INTERFACE_LINK_LIBRARIES "tinyxml2_static") endif() - elseif("${name}" STREQUAL "HDF5" AND NOT PROJECT_NAME STREQUAL "VTK") + elseif(("${name}" STREQUAL "HDF5" OR "${name}" STREQUAL "hdf5") AND NOT PROJECT_NAME STREQUAL "VTK") # 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 + foreach(HDF5TARGET hdf5 hdf5_hl hdf5_cpp hdf5_hl_cpp) + if(TARGET hdf5::${HDF5TARGET}-static AND NOT TARGET hdf5::${HDF5TARGET}-shared) + _add_library(hdf5::${HDF5TARGET}-shared INTERFACE IMPORTED) + set_target_properties(hdf5::${HDF5TARGET}-shared PROPERTIES INTERFACE_LINK_LIBRARIES "hdf5::${HDF5TARGET}-static") + elseif(TARGET hdf5::${HDF5TARGET}-shared AND NOT TARGET hdf5::${HDF5TARGET}-static) + _add_library(hdf5::${HDF5TARGET}-static INTERFACE IMPORTED) + set_target_properties(hdf5::${HDF5TARGET}-static PROPERTIES INTERFACE_LINK_LIBRARIES "hdf5::${HDF5TARGET}-shared") + endif() + endforeach() elseif("${name}" STREQUAL "CURL") _find_package(${ARGV}) if(CURL_FOUND) -- cgit v1.2.3 From bad51b04626f25d323433ec159af1d60f93cadb1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 2 Mar 2018 08:59:17 -0800 Subject: [vcpkg] Improve handling of external toolchain files --- scripts/buildsystems/vcpkg.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 7b738bd5e..50001e97d 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -59,7 +59,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "Wind set(_VCPKG_TARGET_TRIPLET_PLAT uwp) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(_VCPKG_TARGET_TRIPLET_PLAT linux) -elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(_VCPKG_TARGET_TRIPLET_PLAT osx) +else() set(_VCPKG_TARGET_TRIPLET_PLAT windows) endif() -- cgit v1.2.3 From 59795e2a8e4e2ecd0f1a09e165b61291764df94d Mon Sep 17 00:00:00 2001 From: Viktor Gal Date: Wed, 7 Mar 2018 18:56:59 +0100 Subject: add shogun 6.1.3 (#2977) * add shogun 6.1.3 * [shogun] Add additional dependencies, force static linking --- scripts/buildsystems/vcpkg.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 50001e97d..2f3af6598 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -260,6 +260,11 @@ 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 libiconv libcharset ws2_32) + endif() else() _find_package(${ARGV}) endif() -- cgit v1.2.3 From ae1ce5aaa794c7d3415cabe4f46ea150a01db5ca Mon Sep 17 00:00:00 2001 From: Bruce Jones Date: Wed, 7 Mar 2018 13:17:52 -0500 Subject: applocal-deps applied to MODULE_LIBRARY target too (#2972) * Fix for issue #2786 * [vcpkg-cmake-toolchain] Only applocal dependencies for shared libraries * applocal-deps applied to MODULE_LIBRARY target too --- scripts/buildsystems/vcpkg.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 2f3af6598..b3e27b5d0 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -170,7 +170,7 @@ function(add_library name) list(FIND ARGV "ALIAS" ALIAS_IDX) if(IMPORTED_IDX EQUAL -1 AND INTERFACE_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) get_target_property(IS_LIBRARY_SHARED ${name} TYPE) - if(VCPKG_APPLOCAL_DEPS AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp" AND IS_LIBRARY_SHARED STREQUAL "SHARED_LIBRARY") + if(VCPKG_APPLOCAL_DEPS AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp" AND (IS_LIBRARY_SHARED STREQUAL "SHARED_LIBRARY" OR IS_LIBRARY_SHARED STREQUAL "MODULE_LIBRARY")) add_custom_command(TARGET ${name} POST_BUILD COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 -targetBinary $ -- cgit v1.2.3 From a759caf15e031744e99e9718633fcc8d9a60b077 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 7 Mar 2018 11:56:21 -0800 Subject: [gsl] Fix finding release libs in debug configurations. Fixes #2982. --- scripts/buildsystems/vcpkg.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index b3e27b5d0..a1989b23a 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -251,6 +251,18 @@ macro(find_package name) set_target_properties(hdf5::${HDF5TARGET}-static PROPERTIES INTERFACE_LINK_LIBRARIES "hdf5::${HDF5TARGET}-shared") endif() endforeach() + elseif("${name}" STREQUAL "GSL") + _find_package(${ARGV}) + if(GSL_FOUND AND TARGET GSL::gsl) + set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Release ) + set_property( TARGET GSL::gsl APPEND PROPERTY IMPORTED_CONFIGURATIONS Release ) + if( EXISTS "${GSL_LIBRARY_DEBUG}" AND EXISTS "${GSL_CBLAS_LIBRARY_DEBUG}") + set_property( TARGET GSL::gsl APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug ) + set_target_properties( GSL::gsl PROPERTIES IMPORTED_LOCATION_DEBUG "${GSL_LIBRARY_DEBUG}" ) + set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug ) + set_target_properties( GSL::gslcblas PROPERTIES IMPORTED_LOCATION_DEBUG "${GSL_CBLAS_LIBRARY_DEBUG}" ) + endif() + endif() elseif("${name}" STREQUAL "CURL") _find_package(${ARGV}) if(CURL_FOUND) -- cgit v1.2.3 From 8d70abd134aaa81a84169ec0b352d1aef0f78446 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 9 Mar 2018 01:43:13 -0800 Subject: [libxml2] Fix vcpkg toolchain helper --- scripts/buildsystems/vcpkg.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index a1989b23a..ce5efc1de 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -275,7 +275,12 @@ macro(find_package name) 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 libiconv libcharset ws2_32) + 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() else() _find_package(${ARGV}) -- cgit v1.2.3 From f56a5e4e94a1151bc09f073b3597ff3b40e9d4b8 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 6 Mar 2018 10:07:39 -0800 Subject: [vcpkg] Improve defaults for other platforms --- scripts/buildsystems/vcpkg.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index ce5efc1de..e621da861 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -57,9 +57,9 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") set(_VCPKG_TARGET_TRIPLET_PLAT uwp) -elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") set(_VCPKG_TARGET_TRIPLET_PLAT linux) -elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(_VCPKG_TARGET_TRIPLET_PLAT osx) else() set(_VCPKG_TARGET_TRIPLET_PLAT windows) -- cgit v1.2.3 From 4338ae25a1ac1f81499d12f0c5e4acef5fa1e426 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 11 Mar 2018 23:04:09 -0700 Subject: [vcpkg] Enable packages to provide cmake wrapper scripts. --- scripts/buildsystems/vcpkg.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index e621da861..1d1977e6a 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -184,7 +184,11 @@ function(add_library name) endfunction() macro(find_package name) - if("${name}" STREQUAL "Boost") + string(TOLOWER "${name}" _vcpkg_lowercase_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}) -- cgit v1.2.3 From 7142a093448baad2869e1ac99e619f02d3a395c1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 13 Mar 2018 05:56:02 -0700 Subject: [vcpkg] Improve non-Windows default triplet detection --- scripts/buildsystems/vcpkg.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 1d1977e6a..196ddcb3c 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -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)") -- cgit v1.2.3 From c5f93055a09629247236d1d7dca2c4aa9c1de7c9 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 14 Mar 2018 05:08:35 -0700 Subject: [vcpkg-cmake-toolchain] Only wrap find_package(Boost) if a boost library is installed. --- scripts/buildsystems/vcpkg.cmake | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 196ddcb3c..10e3c3f13 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -190,23 +190,13 @@ 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") function(_vcpkg_find_in_list) list(FIND ARGV "COMPONENTS" COMPONENTS_IDX) -- cgit v1.2.3 From f9d4692749ad68340a07453add49a8ef029fa155 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 29 Mar 2018 21:14:06 -0700 Subject: [vcpkg.cmake] Remove Windows SDK detection. Let cmake detect it --- scripts/buildsystems/vcpkg.cmake | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 10e3c3f13..0c32b22fb 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") @@ -110,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" -- cgit v1.2.3 From 35f5a0de5327efdea1e9aea7979a2c828daacc0d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 5 Apr 2018 21:39:47 -0700 Subject: [vcpkg-cmake-toolchain] Remove some hardcoded find_package helpers and guard all remaining ones --- scripts/buildsystems/vcpkg.cmake | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 0c32b22fb..a9f8190f7 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -187,7 +187,7 @@ macro(find_package name) unset(Boost_USE_STATIC_RUNTIME) set(Boost_COMPILER "-vc140") _find_package(${ARGV}) - 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) @@ -198,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) @@ -207,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 @@ -237,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 ) @@ -249,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") @@ -258,16 +241,6 @@ 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() else() _find_package(${ARGV}) endif() -- cgit v1.2.3 From 3a3fa5cd8f02dde78b00c12273b338e293edcd51 Mon Sep 17 00:00:00 2001 From: Jonathan Hale Date: Thu, 19 Apr 2018 04:33:12 +0200 Subject: [magnum] Properly deploy plugins (#3191) * [magnum] Properly deploy magnum plugins Signed-off-by: Squareys * [magnum-plugins] Add tinygltfimporter feature Signed-off-by: Squareys * [magnum][magnum-plugins] Add features: trade and any* Prepares upcoming move of those sublibraries and allows building --head immediately. For current release this only adds some unused cmake flags that will be ignored. Signed-off-by: Squareys * [magnum] Add gl feature, cleanup dependencies, mark upcoming features And sort features alphabetically. Signed-off-by: Squareys * [magnum-plugins] Prepare renaming of static flag for --head installs Signed-off-by: Squareys * [magnum] Add two missing feature dependencies Signed-off-by: Squareys * [magnum] Enable magnum[any*] features by default Signed-off-by: Squareys --- scripts/buildsystems/msbuild/applocal.ps1 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'scripts/buildsystems') 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) -- cgit v1.2.3 From d84e86a910126e91c781af63e33e3516aa171f2a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 18 Apr 2018 18:13:11 -0700 Subject: Fix grpc lookup (case-insensitive) --- scripts/buildsystems/vcpkg.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts/buildsystems') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index a9f8190f7..91c196fb9 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -241,6 +241,8 @@ macro(find_package name) "optimized" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") endif() 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() -- cgit v1.2.3