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. Qmake INCLUDEPATH problem
Forum Updated to NodeBB v4.3 + New Features

Qmake INCLUDEPATH problem

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 12.8k 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.
  • S Offline
    S Offline
    SirSmackalot
    wrote on last edited by
    #1

    Hi,

    i am working with Qt on Windows 7. I have a build.bat where all necessary steps are called (qmake, nmake,...).
    In the build.bat i set a path to the include-directory of the JDK:

    set JDK="C:\Program Files\Java\jdk1.7.0_02"
    (in the batch file there is only one backslash as seperator, i dont know why this editor puts in two"

    in my .pro-file i want to pass this path to INCLUDEPATH with:

    INCLUDEPATH += $$(JDK)/include

    and:

    INCLUDEPATH += $$(JDK)/include/win32

    I additionaly use Visual Studio 2010. Opening the pro-File creates a Project, but the include path are wrong. It only shows:

    "/include/win32". The string behind $$(JDK) is gone. I tried everything i could think of till now:

    t = $$quote($$quote($$replace(jdk, \\, /)/include/win32))
    #message($$t)
    INCLUDEPATH += $$t

    but this does not work either. The strange thing is, messaging $$t in this case shows:

    "C:/Program Files/Java/jdk1.7.0_02"/include/win32
    (I cannot get rid of the spaces in this string)

    i even tried to $$replace the quotations, but that did not work.
    Any suggestions would be very appreciated!

    Thanks,

    SirSmackalot

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      It might be different on windows (I doubt it), but on GNU/Linux, variables are denoted with $${}, not $$() for example:
      @
      INCLUDEPATH += $${JDK}/include
      @

      (Z(:^

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        And as you have spaces in the path, you need to put the result between quotes:

        @
        INCLUDEPATH += "$${JDK}/include"
        INCLUDEPATH += "$${JDK}/include/win32"
        @

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SirSmackalot
          wrote on last edited by
          #4

          The qmake-docs say round brackets are right. "{" don`t work for me here.
          That does not work. In VS the resulting path is still just "/include" and "/include/win32".
          The funny thing is that message($$INCLUDEPATH) reports this:
          C:\Program Files\Java\jdk1.7.0_02/include

          In VS the first part of the string is gone. Weird. Replacing the "" with "/" does not change a thing.

          Thanks, but seems like a bug to me somewhere.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            ah, correct. Environment vars are accessed with $$(xxx) and qmake variables with $${xxx}.

            http://www.catb.org/~esr/faqs/smart-questions.html

            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