Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Define the installation prefix using qmake?
Forum Updated to NodeBB v4.3 + New Features

Define the installation prefix using qmake?

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 4 Posters 33.2k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    alexandros
    wrote on last edited by
    #1

    Hello, I need to make my project file to have a PREFIX variable, I assume as the guy here: http://lists.trolltech.com/qt-interest/2002-01/thread00062-0.html
    although he is not showing how he declares PREFIX, but I assume that's the correct way to do it. (and no, it's not PREFIX = /usr/local simply)
    The same thing using cmake is:
    cmake "-DCMAKE_INSTALL_PREFIX:PATH=/usr/local"

    So it actually passes to command line the prefix path whilst it can be used from inside the program (so as to know where it is installed and communicate with the necessary files)

    Any ideas?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on last edited by
      #2

      I'm not sure what you mean. How do you intend to pass the PREFIX to qmake? For instance, by using environment variables, you could set up something like
      @
      target.path = $$(PREFIX)
      INSTALLS += target
      DEFINES += INSTALL_PREFIX=$$(PREFIX)
      @

      and then use INSTALL_PREFIX inside your code?

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

      1 Reply Last reply
      0
      • A Offline
        A Offline
        alexandros
        wrote on last edited by
        #3

        Hello peppe (the one from IRC(?))
        I finally got a solution: http://stackoverflow.com/questions/7106442/qt-project-files-and-prefix-variable

        thanks anyway for the try

        1 Reply Last reply
        0
        • L Offline
          L Offline
          luispereira
          wrote on last edited by
          #4

          qmake PREFIX=/usr/local

          1 Reply Last reply
          0
          • S Offline
            S Offline
            shaan7
            wrote on last edited by
            #5

            [quote author="luispereira" date="1324318967"]qmake PREFIX=/usr/local[/quote]

            This worked for me

            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