Results 1 to 3 of 3

Thread: Qt SDK 1.1.3 and CMake on Mac OS X 10.7.1 / Lion

  1. #1
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt SDK 1.1.3 and CMake on Mac OS X 10.7.1 / Lion

    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...?!

  2. #2
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

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

    Ok, I have found a solution which involves setting QT_QMAKE_EXECUTABLE to qmake's path, i.e.

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

    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...

  3. #3
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

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

    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:

    Qt Code:
    1. EXECUTE_PROCESS(
    2. COMMAND sh -c ". /etc/profile && which qmake"
    3. OUTPUT_STRIP_TRAILING_WHITESPACE
    4. OUTPUT_VARIABLE QT_QMAKE_EXECUTABLE
    5. )
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Qt 4.7.3 in Mac OSX Lion???
    By sword726 in forum Qt Programming
    Replies: 3
    Last Post: 5th September 2011, 02:10
  2. QThread with MAC OSX 10.7 Lion
    By r41nb0ww4RR10R in forum Qt Programming
    Replies: 2
    Last Post: 29th July 2011, 10:29
  3. Mac OS X Lion problems.
    By Jeffb in forum Qt Programming
    Replies: 2
    Last Post: 27th July 2011, 02:44
  4. Cmake
    By R.CH in forum Qt Programming
    Replies: 1
    Last Post: 7th October 2010, 18:06
  5. using moc with cmake
    By Isaac in forum Newbie
    Replies: 2
    Last Post: 29th May 2008, 04:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.