Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved qmake install appears to ignore variables?

    Tools
    2
    2
    165
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      Jason_C last edited by Jason_C

      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?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • First post
          Last post