Qmake don't use my ui_dir and rcc_dir with vs2010



  • Hello,

    I'm using qt 4.8.0 with visual studio 2010 with the visual-addin. I generate my project in visual studio opening the .pro file with the visual studio throw the visual-addin. The problem is that the qmake uses the MOC_DIR, OBJECTS_DIR and DESTDIR that i have especified. But, with UI_DIR and RCC_DIR it doesn't happens. In the visual studio solution the folders that i have specified are inside a folder called Generated Files. The moc and obj files are placed in their corresponent folder, but ui and rcc intermediate files are NOT. They are duplicated, once in the folder that i have specified and once in the Generated Files folder. If i try to open the files that there are in the folder that i have specified VS can't find them. The others yes. If i go to the file system, the folders that i have specified are not created, and the intermediate ui and rcc files are inside a folder called GeneratedFiles.

    The problem is that VS does uic and rcc twice (once for the real intermediate files and another for the files that don't exists) and rcc fails... I have to delete the files placed in the folder that i have specified of the VS solution to make the solution work....

    I'm doing something wrong in the project files?? is this a bug???

    General.pri
    @
    #################################### CONFIG ############################################
    #Añadimos las configuraciones que utilizaran la mayor parte de librerias
    #Ver : (http://doc.qt.nokia.com/latest/qmake-project-files.html)

    #Mostrar todos los warnings
    CONFIG += warn_on

    #Permite compilar el proyecto en modo debug y release
    CONFIG += debug_and_release

    #La aplicacion necesita una consola
    CONFIG += console

    #La aplicacion usara Qt
    CONFIG += qt

    #Muestra en VS los archivos con su estructura jerarquica de carpetas
    CONFIG -= flat

    #Hay que definir que extensiones de qt no por defecto vendran
    QT += opengl

    ################################## DIRECTORIOS #########################################

    #Directorio donde se guardan los ficheros ui_*.h
    UI_DIR = ui_headers

    #En funcion de la configuracion se decide donde se almacenaram
    CONFIG(debug, debug|release){
    MOC_DIR = moc_debug
    OBJECTS_DIR = obj_debug
    RCC_DIR = resources_debug
    DESTDIR = ../bin/debug
    }CONFIG(release, debug|release){
    MOC_DIR = moc_release
    OBJECTS_DIR = obj_release
    RCC_DIR = resources_release
    DESTDIR = ../bin/release
    }

    #Añadimos las rutas donde buscara el compilador para buscar cabezeras
    INCLUDEPATH+= include ui ui_headers ../
    INCLUDEPATH+= src/ply
    unix{
    INCLUDEPATH+= /usr/include
    }

    win32{
    INCLUDEPATH+= ../glew/include
    }

    #Indica a qmake donde tiene que buscar dependencias, de esta manera si modificamos un .h
    #los .cpp que dependan de el seran recompilados
    DEPENDPATH += include ui src ../

    ########################################################################################

    Estructura de fichero de proyecto

    project.pro

    TEMPLATE = subdirs

    CONFIG +=ordered debug_and_release

    SUBDIRS += Libreria1 \

    ...

    @

    Project File
    @
    include (../general.pri)

    TEMPLATE = app
    LANGUAGE = C++
    TARGET = NightLighting

    SOURCES += src/main.cpp
    src/NightLighting.cpp
    src/ViewBCN.cpp
    src/SceneBCN.cpp
    src/TextureManagerBCN.cpp
    src/ModelLoaderBCN.cpp
    src/ObjectBCN.cpp
    src/ConfigurationTab.cpp

    HEADERS += include/NightLighting.h
    include/ViewBCN.h
    include/SceneBCN.h
    include/TextureManagerBCN.h
    include/ModelLoaderBCN.h
    include/ObjectBCN.h
    include/ConfigurationTab.h

    FORMS = ui/NightLighting.ui
    ui/Configuration.ui

    RESOURCES += resources/main.qrc

    CONFIG(debug, debug|release){
    LIBS += -L../bin/debug -lMath -lCore -lLoaders -lUtils
    }CONFIG(release, debug|release){
    LIBS += -L../bin/release -lMath -lCore -lLoaders -lUtils
    }

    unix{
    LIBS += -lGLEW
    }

    win32{
    LIBS += -L../glew/lib -lglew32
    }
    @



  • Same in 2012. Just generates to GeneratedFiles when I use:
    Debug:RCC_DIR = ../../Interface/Generated/Debug/rcc
    Debug:UI_DIR = ../../Interface/Generated/Debug/ui

    Which means that I have to have an additional INCLUDEPATH entry because it the visualstudio plugin/qmake ignores those values...



  • bq.
    Which means that I have to have an additional INCLUDEPATH entry because it the visualstudio plugin/qmake ignores those values…

    What does it means? Do you have any solution?



  • Not a solution, a workaround.

    My pri now reads:
    @
    RELATIVEPATH = $$PWD/../..
    CONFIGURATION = Debug
    CONFIG(release,debug|release) {
    CONFIGURATION = Release
    }

    INCLUDEPATH *= $${RELATIVEPATH}/Implementation
    $${RELATIVEPATH}/Interface/Generated/$${CONFIGURATION}/ui
    $${RELATIVEPATH}/Interface/Generated/$${CONFIGURATION}/moc
    $${RELATIVEPATH}/Interface/Generated/$${CONFIGURATION}/rcc
    $${PWD}/GeneratedFiles #We need this because VS seems to ignore the Interface stuff and just whack it in GeneratedFiles
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.