Is there some way to specify CMake Profile specific environment variables which apply at runtime?
Let's say you have a program which can be compiled using two different backends that are dynamically linked. The choice of which backend to compile/link against is specified using cmake options at build time. So then you might have four CMake Profiles: Debug_Backend1, Debug_Backend2, Release_Backend1, Release_Backend2. You can set environment variables during the build process by setting the Environment in the CMake Profiles windows. However, it seems the environment does not apply to the Run/Debug configurations. So when you run, for example, the main | Debug_Backend1 then the environment specified in Debug_Backend1 is not applied prior to execution. One thing you can do which would work in some cases is to try create an environment which works for both Backend1 and Backend2 and specify that environment using the Environment variables in the Run/Debug configurations. However, if the environments are incompatible (e.g. dynamic library name collisions) then this won't work. So my question is: Is there some way to specify CMake Profile specific environment variables which apply at runtime?
Please sign in to leave a comment.