Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake toolchain file - use list(APPEND #2336

Closed
rpavlik opened this issue Dec 8, 2017 · 0 comments
Closed

CMake toolchain file - use list(APPEND #2336

rpavlik opened this issue Dec 8, 2017 · 0 comments

Comments

@rpavlik
Copy link
Contributor

rpavlik commented Dec 8, 2017

https://github.com/Microsoft/vcpkg/blob/48c4b79be510c5aff3f28079b7875a95497691e5/scripts/buildsystems/vcpkg.cmake#L131

That line is inside of a loop and just appends directories to a list. Doing so using set(VAR ${VAR} NewThing) is much less efficient (slower CMake execution) than the equivalent list(APPEND VAR NewThing) command.

Thus replacing the block with

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}")
        list(APPEND CMAKE_PROGRAM_PATH "${_VCPKG_TOOLS_DIR}")
    endif()
endforeach()

would provide some speedup in cmake/config time. (Might be measurable speedup, especially if there are a lot of things in the tools directory)

You'll note I also added quotes around things that might have spaces in their expansion: CMake isn't as fragile as Make with spaces, but I think in at least some of those cases, a space in the path might mess things up, so I tend to err on the side of caution and quote paths in CMake.

ras0219-msft pushed a commit that referenced this issue Jan 3, 2018
* [vcpkg] Further fix for clang/gcc

* [vcpkg] Only default target triplet to windows if on windows

* [mpfr] add MPFR_USE_INTMAX_T

* [mpfr] prepend stdint to header

* [mpfr] fix portfile

* [mpfr] fix source path

* [mpfr] define have_stdint_h

* [mpfr] revert portfile patch

* [mpfr] prefer ninja

* [mpfr] bump version

* Updated benchmark to v1.3

* [libmspack] Initial port.

* [vcpkg] Add --x-xunit internal command to print installation results in a VSTS friendly format.

* [many ports] Updates to latest

* [llvm] Fail early on UWP

* [netcdf-c] Fix x64-windows-static builds

* [harfbuzz] Revert upgrade due to regression

* Exit early if no VS is found

* [libsodium] Fix static build trying to copy dlls

* Specify VSLANG=1033 to use english locale in builds

Resolves several locale-specific issues outside our control

* Exclude and warn about VS instances without English language pack

Resolves several locale-specific issues outside our control

* [botan] Revert upgrade due to regressions

* [vlpp] initial create

* [vlpp] add the CppMerge.exe tool

* libuv: update to v1.18.0

* [hotfix] Remove VSLANG=1033. It is causing a lot of Process creation failed with error code: 87

* Properly fix VSLANG=1033

* [vcpkg-contact-survey] Add monthly survey prompt

* Update libtorrent to 1.1.5

* [speex] Fix debug mode .def file. Add exports for extern globals.

* [scintilla] Initial port.

* Flint: enable DLL builds (#2271)

* [flint] enable dynamic building

* [flint] increment version

* [sciter] Update to 4.0.6.5590

* Add `vcpkg integrate powershell` for tab completion

* [autocomplete] Add info in README.md

* [aws-sdk-cpp] update to 1.3.15

* Update CHANGELOG and bump version to v0.0.100

* Adding re2 port

* [re2] Use vcpkg_from_github()

* [re2] Don't pass BUILD_SHARED_LIBS

BUILD_SHARED_LIBS should not be locked to shared/static, because the other type will fail.
Vcpkg was overriding this flag before, so no behavior change. (i.e. static builds worked before as well).
Also tests = OFF.

* crow initial port

* fcl: add missing dependencies within cmake

Signed-off-by: Tobias Kohlbau <[email protected]>

* Fix pcl/CMakeLists fot Visual Studio 2017

Fix conditional branch for Visual C++ 2017.
Visual C++ 2017 has a version number 191x.

* [vcpkg-msbuild-integration] Address #2299 by using full path to powershell.

* Fix path to powershell.exe

#2299

* Improve error message when failing to parse package

* [ms-gsl] update to 2017-12-04

* [ms-gsl] simplify portfile

* Adaptation for so-5.5.20-beta1

* Improve error message on invalid dependency of package

* [libsodium] Disable tests

Also, this is a workaround for x64-windows-static taking forever in VS2017 15.5

* updata live555 live555-latest

* [gmime] Update to version 3.0.5.

* curl: update to v7.57.0

Due to changes in curl's CMake support, where it now installs .cmake
files, we now have to make sure that they are installed into the correct
directory (and not duplicated into the debug/share/ directory, either).

Also, a change in the context of the 2nd patch required an update of
said patch.

Signed-off-by: Johannes Schindelin <[email protected]>

* [live555] Set version instead of latest and update CONTROL file

* openssl: update to v1.0.2n

The patch to allow for spaces in paths while running the Perl helpers is
no longer necessary, and was dropped.

Signed-off-by: Johannes Schindelin <[email protected]>

* [ACE] 6.4.6

* Update for sobjectizer v.5.5.20

* [jansson] Prefer ninja

* [openssl] Remove entry of removed patch

* [unicorn] Adding unicorn port

* Improve vcpkgExtractFile. Also merge vcpkgRemoveDirectory/File

* [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.

* [gtest] Remove renaming of DLLs -- only the import libs need renaming.

* [unicorn] Adjust handling of CRT and LIBRARY LINKAGE. Reformat to LF.

* [mbedtls] Initial port. (#2286)

* mbedtls: init port

* add VCPKG_LIBRARY_LINKAGE for static libs only

* [mbedtls] Slight cleanup

* [tinyexif] add TinyEXIF library (#2221)

* alac-decoder (#2176)

* [tinyexif] update to version 1.0.1

* [speex] Fix regression for release mode import library

* [speex] Fix release mode .def file. Add missing exports (#2340)

* [speex] Fix release mode .def file. Add missing exports
Fixed .def file in release mode (it is bugged after #2293 fix in d5395ac) #2293 (comment)
Added exports for speex_header_free and speex_mode_list (#2292 (comment))

* [speex] Fix regression for release mode import library

* [vcpkg-cmake-toolchain] Mark _VCPKG_ROOT_DIR as INTERNAL

* [openssl] Add -utf-8 flag

* [exiv2] update to latest master and fix debug config

* Fix Gtest port fails install when one of the configuration is set to VCPKG_BUILD_TYPE (#2359)

* Support build with master/HEAD

Gtest will be able to build with master/HEAD.

* Fix install when one of the configuration is set to VCPKG_BUILD_TYPE

Fix install when one of the configuration is set to VCPKG_BUILD_TYPE.

* [powershell] Use \ instead of / for paths. Resolves #2358. Resolves #2361

* Fix fetching dependency text

* [vcpkg-upgrade] Initial commit of upgrade command.

* [vcpkg-upgrade] Accept list of packages to specifically upgrade.

* Upgrade assimp to v4.1.0 (#2364)

* [assimp] Update to v4.1.0 and remove code patch which is fixed in new version

* [assimp] Fix vcpkg_fixup_cmake_targets argument

* [assimp] Fix formatting

* Revert "[vcpkg-upgrade] Accept list of packages to specifically upgrade."

This reverts commit d88563c.

* Revert "[vcpkg-upgrade] Initial commit of upgrade command."

This reverts commit 803347a.

* [vcpkg] Fix regressions introduced with update command. Fixed issue with upgrade where it assumed downloads were not allowed.

* [brotli] Fix regressions introduced during update

* Add quotation marks to support user profiles with spaces in them

* Revert "Add quotation marks to support user profiles with spaces in them"

This reverts commit 0ba4b66.

* [vcpkg] Revert revert of #2369.

* [tinyxml2] update to 6.0.0

* [vcpkg] Fix regressions in WSL build.

* [cpprestsdk] Update to 2.10.1

* [gtest] Fix issue with renaming gtest DLLs in debug mode

* Added port brynet - A C++ cross platform high performance TCP network library using C++ 11.

* [tbb] Update to 2018_U2

* [gsl-lite] Updated to 0.26.0

* [nlohmann-json] Update to 3.0.0

* Update string-theory to 1.7

* Update Range-V3-VS2015.

* [vcpkg] Improve error message upon graph cycle detected.

* [glm] Ignore MSVC warning C4201

* [boost] Modularize

* [vcpkg-list] Improve list output for long triplets

* Update downstream libraries to use modularized boost

* [magnum] Remove --trace

* [vcpkg-list] Improve list output for long triplets

* [llvm] Add atlmfc to dependencies -- fixes #2400

* [vcpkg-integrate-powershell] Fix $false bug. Fixes #2397.

* 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

* [sciter] Update to 4.0.7.5637

* Initial experimental re-support for VCPKG_BUILD_TYPE release

re-add this commit 5335d17

* [dlib] update to 19.8

* [fftw] Build more libs

* Improving support for ITK

* [libdatrie] add version 0.2.10

* [alembic] update to 1.7.5

* Added port libqrencode - a fast and compact QR Code encoding library (#2372)

* #2363

* libqrencode: Added necessary new line at end of CONTROL, portfile.cmake, usage files. Added copying the usage file in portfile.cmake, and removed unnecessary DBUILD_SHARED_LIBS as remarked @ras0219-msft

* [libqrencode] Adjust usage to match other packages

* libmupdf initial port (#1950)

* libmupdf initial port

* [libmupdf] Use CMake for buildsystem replacement.

* [hpx] Handle boost breaking changes. Fixes #2416.

* [folly] Handle boost upgrade

* [nghttp2] initial port (dynamic build only). (#2366)

* [nghttp2] initial port (dynamic build only).

* [nghttp2] Slight tweak

* [brynet] Use vcpkg_from_github

* [boost] Fix uwp builds on systems with spaces

* [assimp] Fix unitialized variable issue.

* [libtorrent] Update to more recent snapshot to support boost 1.66

* [assimp] Fixup: add missing patchfile

* [vcpkg-download-distfile] Add input sanitization

* [boost-python] Fix build.

* [qt5] Add atlmfc to dependencies on windows due to �tlbase.h inclusion. Fixes #2344.

* clang-tidy fixes

* [opencv] update to 3.4.0

* [vcpkg-hash] Replace certutil.exe with cmake built-in hash commands

* [sciter] Update to 4.0.8.5649

* [directxmesh] Update to the last version (dec2017)

* [directxtex] Update to the last version (dec2017)

* [directxtk] Update to the last version (dec2017)

* Revert "clang-tidy fixes"

This reverts commit 2d0a763.

* [libgit2] Initial port.

* [bullet3] Update from 2.86.1 to 2.87

* Update librealsense v2.8.3

Update librealsense v2.8.3.

* [libconfig] update to 1.7.1

* [fmt] update to 4.1.0

* [gainput] Initial port

* mpfr: fix download link

* [mpir] use vcpkg_from_github

* [portmidi] Initial port

* [jack2] Initial commit

* [libdatrie] fix trietool for MSVC runtime

* Fix version

* Add support for Box2D to be build as a static library

* [asio] swith to vcpkg_from_github()

* [nlohmann-json] update to 3.0.1

* [libbson] update to 1.9.0

* [mongo-c-driver] update to 1.9.0

* [harfbuzz] update to 1.7.4

* [jack2] Prefer using vcpkg_from_github. Removed check for Windows Store

* [zstd] update to 1.3.3

* Use vcpkg version of BLAS and LAPACK in dlib
dlib v19.8 detects these packages correctly

* [libpqxx] Initial port

* [tacopie] Update to 3.2.0

* [cpp-redis] Update to 4.3.0

* Update cmake to 3.10.1

* Remove workaround for a bug in FindMPI.cmake that was introduced in cmake 3.10.0 and fixed in 3.10.1

* Update szip to 2.1.1

* Update HDF5 to 1.10.1

* [soundtouch] Initial port (#2455)

* [soundtouch] Initial port

* [soundtouch] Fixed typo

* [vcpkg-download-distfile] Fix #2426

* 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

* [gitignore] Add new triplets to gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant