Replies: 1 comment
-
It looks like this is where the If a feature has been enabled, you can use this function to set a CMake variable. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a library I'm looking to add to vcpkg at somepoint (currently private and on a private registry within my org).
There is an optional feature for building a GUI preview tool for somethings, which I currently set by adding the following to my root
CMakeLists.txt
:Then in later
CMakeLists.txt
I testif(BUILD_GUI)
to configure the correct things to build.Then in my
vcpkg.json
manifest file, I add the following:The idea being you can simply set the
-DBUILD_GUI
when building the project, and then by updatingVCPKG_MANIFEST_FEATURES
with the correct keyword, it will fetch the necessary dependencies.This works perfectly when developing my library, however when attempting to install from my private registry, it does not seem possible to configure a specific CMake option without using a custom-overlay, which doesn't seem like the right solution. Obviously what could be done is to set the feature directly in the manifest file, but then my existing logic within various
CMakeLists.txt
would be broken.Would it therefore be correct to reorganize my logic to be centered around whether or not the necessary dependencies have been installed via specifying the feature? And similarly, is it possible to use this system to specify options that do not explicitly require any additional dependencies? Say, for example, I wanted to optionally build some command-line applications alongside my library. Could I allow a user to specify an
apps
feature in their manifest file using:that my CMake could detect and build those applications? It just feels like requiring a custom-overlay for building additional components is the wrong solution but perhaps I'm just misunderstanding.
Beta Was this translation helpful? Give feedback.
All reactions