Important: Please read the Qt Code of Conduct -

Using a variable in QtCreator's Shadow build directory doesn't appear to work

  • I'm trying to modify the output directories for QtCreator because I'm building a host application and qml plugins for that host application and my host application needs to be able to determine where to dynamically load plugins from.

    I can modify the shadow build directory just fine without using a QtCreator variable.

    If I add a QtCreator variable, part of the build process works; however, jom (nmake clone?) can't seem to find the makefile.

    For example, if I specify:


    Everything builds fine.

    If I try to include the kit name it only works for the first part of the build (the part that generates the Makefiles.)

    For example, usin:


    and then building, yields a correctly created directory structure, that contains the three Makefiles (Makefile, Makefile.Debug, Makefile.Release) but the build fails with the output:

    18:53:38: Running steps for project MyContainerApp...
    18:53:38: Starting: "C:\Qt\Qt5.6.0\5.6\msvc2015_64\bin\qmake.exe" C:\MyStuff\MyProduct\MyApp\Discovery\MyContainerApp\ -r -spec win32-msvc2015 "CONFIG+=debug" "CONFIG+=qml_debug"
    18:53:39: The process "C:\Qt\Qt5.6.0\5.6\msvc2015_64\bin\qmake.exe" exited normally.
    18:53:39: Cannot find Makefile. Check your build settings.
    Error while building/deploying project MyContainerApp (kit: windows)
    When executing step "Make"
    18:53:39: Elapsed time: 00:00.

    I presume that jom.exe is getting passed "C:\MyStuff\MyProduct\bin\app%{CurrentKit:Name}" rather than a properly evaluated string.

    I couldn't seem to get jom to emit any debug info to let me know where exactly it was looking for the makefile.

    Anyone run into this?


    P.S. I forgot to add that the Make build step in QtCreator Projects setting for the windows kit shows the correct path to the Makefile (presumably the UI to display that string is evaluating the kit variable.)

  • Moderators


    I use this to shadow-build on windows:

    win32  {
    	DESTDIR = $$OUT_PWD		# Fix for (windows') shadow building

    I haven't tested it with a variable though.

    Kind regards.

  • @kshegunov Do you disable shadow building in QtCreator and put that in your *.pro file? (Sorry, I'm a noob at QtCreator.)

  • Moderators

    No, not at all. I leave the checkbox clicked and just add that line to my project file.

  • This is how I override qt creators default directory structure


    RC_FILE = myfile.rc
    DESTDIR =     $$PWD/Dist
    OBJECTS_DIR = $$PWD/Temp/obj
    MOC_DIR =     $$PWD/Temp/moc
    RCC_DIR =     $$PWD/Temp/rcc
    UI_DIR =      $$PWD/Temp/gui


    very usefull if you want to have a clean build directory

  • I haven't been able to use a QtCreator variable sadly - I've worked around by making some default assumptions about the structure of the project instead. Thanks for the suggestions though :).

Log in to reply