'How can I install extra dependencies for a particular configuration only using manifest mode of vcpkg?

I am trying to build the Testing example from the fruit DI Injection library, it contains a standard int main entrypoint in main.cpp, and has another entrypoint using InitGoogleTest

So I have two Debug configurations, Debug the standard build that executes the program via main.cpp and another GTest for unit testing which will exclude main.cpp, and include cached_greeter_test.cpp instead which calls InitGoogleTest.

I am consuming the fruit library via vcpkg, and using manifest mode. I can't seem to figure out from vcpkg.io website how to install fruit from vcpkg in both Debug and GTest Configurations, but only install Google Test in the GTest configuration.

How can install the extra dependency of Google test for a particular configuration only using manifest mode, and yet still install fruit under all other project configurations?

Code at - https://github.com/google/fruit/tree/master/examples/testing



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source