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. [SOLVED] Qt SDK 1.1.3 and CMake on Mac OS X 10.7.1 / Lion
QtWS25 Last Chance

[SOLVED] Qt SDK 1.1.3 and CMake on Mac OS X 10.7.1 / Lion

Scheduled Pinned Locked Moved Qt Creator and other tools
8 Posts 3 Posters 6.8k 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.
  • A Offline
    A Offline
    agarny
    wrote on last edited by
    #1

    Hi, I have installed Qt SDK 1.1.3 on my Mac (running Mac OS X 10.7.1 / Lion) and rather than installing it under my home directory as suggested by the Qt SDK installer (why does it suggest that in fact?! -- I can't remember whether I installed it using sudo or not, so could it be the issue?), I installed the Qt SDK under /Developer/QtSDK.

    Now, my project uses CMake (rather than QMake) and whenever I open my CMakeLists.txt file in Qt Creator 2.3.0 and then run CMake, I get told that Qt can't be found. Note that I have added /Developer/QtSDK/Desktop/Qt/474/gcc/bin to my PATH in my ~/.profile. Still, if in my CMakeLists.txt, I ask CMake to tell me about the contents of my PATH, then it tells me that it contains /usr/bin:/usr/sbin:/sbin, i.e. no /Developer/QtSDK at all. I therefore thought I would update /etc/profile, but to no avail. Same with adding /Developer/QtSDK to /etc/paths or under /etc/paths.d.

    So... any idea how I could use Qt SDK 1.1.3 and CMake on Mac OS X 10.7.1 / Lion? Note that if I was to install Qt 4.7.4 and Qt Creator 2.3.0 individually (i.e. as individual packages as opposed to as part of Qt SDK 1.13), then everything works since, since qmake (among others) will be available under /usr/bin (if I recall correctly) which actually begs the question of why Qt SDK 1.1.3 doesn't do the same...?!

    1 Reply Last reply
    0
    • U Offline
      U Offline
      uranusjr
      wrote on last edited by
      #2

      I think this is the new behavior... Qt SDK does not add its path to system environmental variable PATH. Neither does it put its libs in the system search path. All things are now in the SDK's own directory. Therefore, the libraries in the SDK only works with Qt Creator, unless you configure the environment manually.

      If you want to use CMake with the official installer, you'll need to tell it where to find your Qt frameworks. It should be somewhere inside /Developer/QtSDK. Look for QtCore.framework, QtGui.framework and names like that. Include the directory that contains these framework into CMake's search path.

      I found all these settings a bit annoying, so I use the Homebrew version of Qt now. :-p

      1 Reply Last reply
      0
      • AlicemirrorA Offline
        AlicemirrorA Offline
        Alicemirror
        wrote on last edited by
        #3

        My concern is that you are using Lion instead of Snow Leopard. Did you notice that this problem happens only when you updated your OS ?

        Enrico Miglino (aka Alicemirror)
        Balearic Dynamics
        Islas Baleares, Ibiza (Spain)
        www.balearicdynamics.com

        1 Reply Last reply
        0
        • A Offline
          A Offline
          agarny
          wrote on last edited by
          #4

          @uranusjr: how do you setup that CMake's search path exactly? I thought I would do this through the call to FIND_PACKAGE(Qt4 ${QT_VERSION_REQUIRED} REQUIRED PATHS ${SOME_QT_PATHS}), but to no avail so far. Maybe I am missing something...?

          @Alicemirror: I can't imagine this being the case. I mean, everything works fine if I install Qt and Qt Creator 'by hand' (i.e. without using Qt SDK).

          1 Reply Last reply
          0
          • AlicemirrorA Offline
            AlicemirrorA Offline
            Alicemirror
            wrote on last edited by
            #5

            Thank you for the information, but there is a meaningful difference to do all by hand or with the SDK Installer.

            Take in account that not rarely I should work with more than one Qt version at the same moment, that developing with mobile devices is frequent theed of updates etc... This means that doing all by hand maybe a not indifferent time lost.

            Enrico Miglino (aka Alicemirror)
            Balearic Dynamics
            Islas Baleares, Ibiza (Spain)
            www.balearicdynamics.com

            1 Reply Last reply
            0
            • U Offline
              U Offline
              uranusjr
              wrote on last edited by
              #6

              I'm not very familiar with CMake myself, but I think adding paths to CMAKE_MODULE_PATH might do the job...?

              "This page":http://cmake.org/Wiki/CMake_Useful_Variables gives some usable CMake settings.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                agarny
                wrote on last edited by
                #7

                Ok, I have tried with CMAKE_MODULE_PATH, but that didn't work (from within Qt Creator, at least). However, by setting QT_QMAKE_EXECUTABLE to qmake's path, i.e.

                SET(QT_QMAKE_EXECUTABLE /Developer/QtSDK/Desktop/Qt/474/gcc/bin/qmake)

                then everything is fine. I just wish I didn't have to hard-code qmake's path in my CMake file and, instead, be able to do something like

                EXECUTE_PROCESS(COMMAND which qmake OUTPUT_VARIABLE QT_QMAKE_EXECUTABLE)

                but though this worked fine from the command line, it didn't from within Qt Creator...?! Oh well, at least, I now have a working solution...

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  agarny
                  wrote on last edited by
                  #8

                  FWIW, I have revisited this issue since I really didn't like having to hard set QT_QMAKE_EXECUTABLE. So, instead, I rely on the fact that I, personally at least, set Qt's path in /etc/profile:

                  @EXECUTE_PROCESS(
                  COMMAND sh -c ". /etc/profile && which qmake"
                  OUTPUT_STRIP_TRAILING_WHITESPACE
                  OUTPUT_VARIABLE QT_QMAKE_EXECUTABLE
                  )@

                  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