@Christian-Ehrlicher
Got it working by myself now, but thanks anyhow for the quick reply.
The problem was that i called cmake from within the source not the build dir so it ran cmake for a fresh new build that wasn't already setup from within Qtcreator and did not know where to search for Qt stuff.
This is my script now:
cd C:\Build\myQtApp\build_r cmake -S Y:/ -B C:/Build/myQtApp/build_r "-DBUILD_TYPE_1:BOOL=ON" "-DBUILD_TYPE_2:BOOL=ON" cmake --build C:/Build/myQtApp/build_r --target all -j2 ... cmake -S Y:/ -B C:/Build/myQtApp/build_r "-DBUILD_TYPE_1:BOOL=OFF" "-DBUILD_TYPE_2:BOOL=ON" cmake --build C:/Build/myQtApp/build_r --target all -j2The boolean parameters BUILD_TYPE_1 and so on are used inside cmake to add a preprocessor defines that are then used to switch between different build configurations just in case anybody wants to know.
In cmake:
if(BUILD_TYPE_1) message(STATUS "Build Type: Type 1") add_definitions(-DBUILD_TYPE_1) endif()in c++
#ifdef BUILD_TYPE_1 ... #endif