diff options
| author | Alexander Kaspar <alexander.kaspar@gmail.com> | 2016-11-30 19:10:23 +0100 |
|---|---|---|
| committer | Alexander Kaspar <alexander.kaspar@gmail.com> | 2016-11-30 19:10:23 +0100 |
| commit | 255849a3c0d4638e37a538f9547625818516e6e4 (patch) | |
| tree | 6022d8f7360e3ab5bb0bfc251c23226dcb66f079 /scripts | |
| parent | 8de36e12dbd87db740a7ca089f3dcd1222a22637 (diff) | |
| parent | 61e484a640884bc33ae3754f98006ebb1b4c1f1f (diff) | |
| download | vcpkg-255849a3c0d4638e37a538f9547625818516e6e4.tar.gz vcpkg-255849a3c0d4638e37a538f9547625818516e6e4.zip | |
Merge branch 'master' of https://github.com/Microsoft/vcpkg into qca
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/buildsystems/msbuild/vcpkg.targets | 8 | ||||
| -rw-r--r-- | scripts/buildsystems/vcpkg.cmake | 34 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_find_acquire_program.cmake | 22 |
3 files changed, 53 insertions, 11 deletions
diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 18c4e9d9f..7782551c2 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -31,11 +31,13 @@ <ItemDefinitionGroup Condition="'$(VcpkgEnabled)' == 'true'"> <Link> - <AdditionalDependencies Condition="'$(VcpkgConfiguration)' == 'Debug'">$(VcpkgRoot)debug\lib\*.lib;%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalDependencies Condition="'$(VcpkgConfiguration)' == 'Release'">$(VcpkgRoot)lib\*.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies Condition="'$(VcpkgConfiguration)' == 'Debug' and '$(VcpkgAutoLink)' != 'false'">%(AdditionalDependencies);$(VcpkgRoot)debug\lib\*.lib</AdditionalDependencies> + <AdditionalDependencies Condition="'$(VcpkgConfiguration)' == 'Release' and '$(VcpkgAutoLink)' != 'false'">%(AdditionalDependencies);$(VcpkgRoot)lib\*.lib</AdditionalDependencies> + <AdditionalLibraryDirectories Condition="'$(VcpkgConfiguration)' == 'Release'">%(AdditionalLibraryDirectories);$(VcpkgRoot)lib;$(VcpkgRoot)lib\manual-link</AdditionalLibraryDirectories> + <AdditionalLibraryDirectories Condition="'$(VcpkgConfiguration)' == 'Debug'">%(AdditionalLibraryDirectories);$(VcpkgRoot)debug\lib;$(VcpkgRoot)debug\lib\manual-link</AdditionalLibraryDirectories> </Link> <ClCompile> - <AdditionalIncludeDirectories>$(VcpkgRoot)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(VcpkgRoot)include</AdditionalIncludeDirectories> </ClCompile> </ItemDefinitionGroup> diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 54960a138..44db05a22 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -46,21 +46,29 @@ if(NOT VCPKG_TOOLCHAIN) 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 + ) + link_directories(${_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 + ) + link_directories(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link) include_directories(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include) set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) - option(OVERRIDE_ADD_EXECUTABLE "Automatically copy dependencies into the output directory for executables." ON) - if(OVERRIDE_ADD_EXECUTABLE) - function(add_executable name) - _add_executable(${ARGV}) - list(FIND ARGV "IMPORTED" IMPORTED_IDX) - if(IMPORTED_IDX EQUAL -1) + 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) + if(IMPORTED_IDX EQUAL -1) + if(VCPKG_APPLOCAL_DEPS) add_custom_command(TARGET ${name} POST_BUILD COMMAND powershell -noprofile -executionpolicy UnRestricted -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 -targetBinary $<TARGET_FILE:${name}> @@ -68,7 +76,17 @@ if(NOT VCPKG_TOOLCHAIN) -OutVariable out ) endif() - endfunction() - endif() + set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) + endif() + endfunction() + + function(add_library name) + _add_library(${ARGV}) + list(FIND ARGV "IMPORTED" IMPORTED_IDX) + if(IMPORTED_IDX EQUAL -1) + set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) + endif() + endfunction() + set(VCPKG_TOOLCHAIN ON) endif() diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 633721f0e..b192bc5d7 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -30,6 +30,28 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://www.python.org/ftp/python/3.5.2/python-3.5.2-embed-amd64.zip") set(ARCHIVE "python-3.5.2-embed-amd64.zip") set(HASH 48bdcb6f94c993acad6782ee33ad4a07a0ea3b9b1bfcdeadf446d459a9224336837e2e7b518d54d8d99c5c3f4e9f8877ea1789cae513fa2eda2a3cad9e4dfd8f) + elseif(VAR MATCHES "PYTHON2") + find_program(PYTHON2 NAMES python2 python PATHS C:/python27 ENV PYTHON) + if(NOT PYTHON2 MATCHES "NOTFOUND") + execute_process( + COMMAND ${PYTHON2} --version + OUTPUT_VARIABLE PYTHON_VER_CHECK_OUT + ERROR_VARIABLE PYTHON_VER_CHECK_ERR + ) + set(PYTHON_VER_CHECK "${PYTHON_VER_CHECK_OUT}${PYTHON_VER_CHECK_ERR}") + debug_message("PYTHON_VER_CHECK=${PYTHON_VER_CHECK}") + if(NOT PYTHON_VER_CHECK MATCHES "Python 2.7") + set(PYTHON2 PYTHON2-NOTFOUND) + find_program(PYTHON2 NAMES python2 python PATHS C:/python27 ENV PYTHON NO_SYSTEM_ENVIRONMENT_PATH) + endif() + endif() + if(PYTHON2 MATCHES "NOTFOUND") + message(FATAL_ERROR "libuv uses the GYP build system, which requires Python 2.7.\n" + "Python 2.7 was not found in the path or by searching inside C:\\Python27.\n" + "There is no portable redistributable for Python 2.7, so you will need to install the MSI located at:\n" + " https://www.python.org/ftp/python/2.7.11/python-2.7.11.amd64.msi\n" + ) + endif() elseif(VAR MATCHES "JOM") set(PROGNAME jom) set(PATHS ${DOWNLOADS}/tools/jom) |
