Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. VC++ Compiler Flags Per-Profile

VC++ Compiler Flags Per-Profile

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 140 Views
  • 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.
  • S Offline
    S Offline
    scrand
    wrote on last edited by
    #1

    Is there a way to add C++ compiler flags for just one profile? For example, I want to have a "Portable" install option that uses a local .ini file instead of the Windows registry. I created a profile called "PORTABLE" that is based on "RELEASE." I need to pass the flag /DPORTABLE to cl.exe so that my preprocessor directives catch that this is a portable install and use the right logic.

    I think I could use

    QMAKE_CXXFLAGS += /DPORTABLE
    

    in my .pro file, but that would pass it to every profile. I could create a separate .pro for the portable install, but that seems unelegant and like overkill. I assume that it's something that needs to go in .pro.user, or that I can set in the GUI for the PORTABLE profile, but I don't see where to put it. Any suggestions?

    Thanks!

    1 Reply Last reply
    0
    • SeDiS Offline
      SeDiS Offline
      SeDi
      wrote on last edited by
      #2

      Not sure if it works (and if I understand your question correctly), but have you tried this?

      win32: {
          CONFIG(debug, debug|release):            ///whatever, if you need it
              else:CONFIG(release, release|debug):  QMAKE_CXXFLAGS += /DPORTABLE
      }
      
      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved