regoth-project / automate-vcpkg Goto Github PK
View Code? Open in Web Editor NEWCMake-Script which automates the installation of VCPKG
License: MIT License
CMake-Script which automates the installation of VCPKG
License: MIT License
Trying to set VCPKG_ROOT
either as ENV or normal variable in parent CMakeLists would result it in being ignored and fallback being used instead.
In my case modifying the check and putting it inside vcpkg_bootstrap
works. Not sure if this would work well with environment variable from terminal or such.
if(NOT VCPKG_ROOT)
set(VCPKG_ROOT ${VCPKG_FALLBACK_ROOT})
endif()
Hey! I like your helpful script, saved me from some headaches.. had to do a small modification though. If you are still maintaining this here is what I did:
From here: line 97
To here: line 100
From my testing, those can be moved under else statement at line 92 to fix first-time CMake generation complaining about missing file for the include.
else()
set(VCPKG_ROOT $ENV{VCPKG_ROOT})
# We know this wasn't set before so we need point the toolchain file to the newly found VCPKG_ROOT
set(CMAKE_TOOLCHAIN_FILE ${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake CACHE STRING "")
# Just setting vcpkg.cmake as toolchain file does not seem to actually pull in the code
include(${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
endif()
Two possible problems. First, in vcpkg_install_packages you have
# Need the given list to be space-separated #string (REPLACE ";" " " PACKAGES_LIST_STR "${ARGN}")
but then
execute_process( COMMAND ${VCPKG_EXEC} install ${ARGN} WORKING_DIRECTORY ${VCPKG_ROOT} )
If the first line matters, then shouldn't that ${ARGN} be ${PACKAGES_LIST_STR}?
Second, the argument list could become too long for the command processor on 'some systems' (you know which I mean) . It should best be processed in a loop.
message("Bootstrapping vcpkg in ${VCPKG_ROOT}")
should read message(STATUS "Bootstrapping vcpkg in ${VCPKG_ROOT}")
execute_process(COMMAND ${VCPKG_BOOTSTRAP} WORKING_DIRECTORY ${VCPKG_ROOT})
could include -disableMetrics , i.e. execute_process(COMMAND ${VCPKG_BOOTSTRAP} -disableMetrics WORKING_DIRECTORY ${VCPKG_ROOT})
. Perhaps make it a configuration parameter?Thanks! Great product.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.