vcpkg_execute_required_process not setting OUTPUT_VARIABLE? #39131
Replies: 3 comments 2 replies
-
Maybe one or more of these triplet options could help? Then you can run |
Beta Was this translation helpful? Give feedback.
-
Keep your existing batch script and add VC_VARS to one or more of the 3 in a custom triplet. |
Beta Was this translation helpful? Give feedback.
-
Please put the full question in the initial post. |
Beta Was this translation helpful? Give feedback.
-
I've made a stackoverflow question about this, so I thought I'd just link it instead of repeating the question here: https://stackoverflow.com/questions/78577338/vcpkg-execute-required-process-not-setting-output-variable
Since I'm very new to cmake/vcpkg, I assume I'm making some simple mistake, but my coworkers who have a bit more experience with them couldn't see the problem.
Edit: I've copied the question from SO below
I'm not very familiar w/ cmake or vcpkg, but I've been assigned to work on a task to build some libraries using a tool which wraps the latter.
My goal, in the interests of perhaps helping me solve this XY problem, is to follow the directions from https://unicode-org.github.io/icu/userguide/icu4c/build.html#how-to-build-and-install-on-windows-with-cygwin, which tell you to run vcvars.bat before running configure.
My constraint is that I have to implement the build process from within a vcpkg 'port' .cmake file, so I can't simply CALL the batch file directly to affect vcpkg/cmake's environment.
My idea was to run another shell script which runs vcvars.bat & then echo the relevant details to stdout, and to have cmake parse that output & explicitly set the environment based on that.
My new script which implements that idea, called GetVCVars.bat looks like
The relevant fragment of associated cmake logic is
The weird thing is, that when I test this, that I get the output -- VC_VARS = '' (Which I interpret to mean that the output variable I told vcpkg_execute_required_process to fill w/ the stdout of the invoked command was either not set, or set to an empty string???), even though a file called GetVCVars-build_configuration-release-out.log gets created with the content
(i.e. what I expected)
I don't understand what I've done wrong (https://learn.microsoft.com/en-us/vcpkg/maintainers/functions/vcpkg_execute_required_process#output_variable)?
Beta Was this translation helpful? Give feedback.
All reactions