How best to set up QT with multiple versions and compilers?
I am working on a QT project on Windows. I would like to test my code with different versions of QT and different compilers. Each combination requires a few configuration settings.
1. CMake build options needs to be set (eg -DCMAKE_PREFIX_PATH=C:\Qt\5.15.2\msvc2019_64 in Build, Execution, Deployment...CMake)
2. The PATH variable needs to be set so that the built executable can load the appropriate dlls. (Set Path=C:\Qt\5.15.2\msvc2019_64\bin\;%PATH% in Run/Debug Configurations)
This works fine for one particular combination of compiler and library version. However those directories are different for each different combination (ie -DCMAKE_PREFIX_PATH=C:\Qt\5.15.2\mingw81_64 and Path=C:\Qt\5.15.2\mingw81_64\bin\;%PATH%)
The problem comes is how to easily switch between these configurations. I can setup build profiles that will change the CMAKE_PREFIX_PATH to compile appropriately, but the Path environment variable won't change, and I have to manually change it each time to actually execute my program. Is there any easier way than tediously doing this manually?
In an ideal world I'd like to setup these configurations for a library once, then add that library to a build profile which would in turn setup the appropriate build and execution options.
请先登录再写评论。