qmake install appears to ignore variables?



  • I have a makefile containing:

    build: directories
    	qmake -o build/Makefile project.pro
    	make -C build -j8
    
    builddbg: directories
    	qmake -o build/Makefile project.pro debug=1 
    	make -C build -j8
    
    install: build
    	make -C build install
    

    and in project.pro I have the following conditional test:

    defined(debug, var) {
        warning ("***** debug build *****")
    
        # WITH-SYMBOLS
        QMAKE_CXXFLAGS += -Wall -ggdb
        QMAKE_CFLAGS += -Wall -Werror -ggdb 
        QMAKE_LFLAGS += -Wl,-Map=project.map
        CONFIG+=debug
    
    } else {
        warning (release build)
    
        # NO-SYMBOLS
        QMAKE_CFLAGS += -Wall -Werror 
    }
    

    make build followed by sudo make install works as expected.

    make builddbg produces the build containing the symbols, however submitting sudo make install the release build is produced and installed. The makefile in the build directory does indicate the variable in the header:

    #############################################################################
    # Makefile for building: .......
    # Generated by qmake (3.1) (Qt 5.10.1)
    # Project:  ../project.pro
    # Template: lib
    # Command: /usr/lib/qt5/bin/qmake -o Makefile ../project.pro debug=1
    #############################################################################
    

    Is there something I am missing, or is there a better way of switching between installing a project with symbols and installing without?


  • Lifetime Qt Champion

    Hi,

    You install target depends on your build target, hence it's going to build "build" and then install whatever is in the build folder.


 

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