Results 1 to 4 of 4

Thread: Qt5 with CMake: how to find qt translations dir?

  1. #1
    Join Date
    Mar 2014
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt5 with CMake: how to find qt translations dir?

    I am currently working on porting my application to Qt5. I use CMake as my build system. With Qt4, I used QT_TRANSLATIONS_DIR variable to copy precompiled Qt translations to the target directory. However, Qt5 does not define any of these specific variables. I know the command

    Qt Code:
    1. qmake -query QT_INSTALL_TRANSLATIONS
    To copy to clipboard, switch view to plain text mode 

    gives me correct path to where Qt translations are installed on my system. I would like to use it, but now I dont know how to get the qmake executable path. I tried to use

    Qt Code:
    1. Qt5Core_QMAKE_EXECUTABLE
    To copy to clipboard, switch view to plain text mode 

    variable, but it gives me "Qt5::qmake", which is not a correct executable.

    What I would like to see is a list of Qt each target's properties to know how I can get specific variables, but I could not find anything like that on the internet. CMake documentation does not answer my questions.

    How can I get path of qt translations with cmake and qt5? Thank you in advance for your answer.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt5 with CMake: how to find qt translations dir?

    Why don't you simply create an environment variable that points to the location of qmake? Doesn't the visual CMake utility let you resolve build-time variables like this?

  3. #3
    Join Date
    Mar 2014
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt5 with CMake: how to find qt translations dir?

    It does, but it is not a solution and I want a solution, not a workaround. One should be able to build my project without setting any additional evironment variables.
    I do not understand why qmake executable can't be found somewhere in CMake. Qt documentation specifies how to merge specific translations using lconvert, but it does not tell how to find them.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt5 with CMake: how to find qt translations dir?

    If CMake can't find the qmake executable, it is a problem with your environment's PATH setting. The failure to build your conversions is an irrelevant side effect. If CMake can't find an executable, it won't be able to build whatever it is the executable is supposed to build.

    CMake doesn't have God-like powers to find executables out in the universe (or even on your PC) unless you tell it where to look. That's done either with your system PATH, CMake variables, or a combination of them. Setting the PATH or a CMake variable isn't a "workaround", it's how the thing works. Look at cmake-gui.

Similar Threads

  1. Qt cmake project cannot find pakages
    By the_dew in forum Newbie
    Replies: 2
    Last Post: 8th May 2014, 00:37
  2. CMake problems to find lib
    By Alundra in forum Newbie
    Replies: 0
    Last Post: 6th November 2013, 11:47
  3. cmake error with Failed to find "glu32" in ""
    By kennethadammiller in forum Qt Programming
    Replies: 1
    Last Post: 12th September 2013, 23:12
  4. Replies: 2
    Last Post: 22nd November 2011, 00:09
  5. cmake kdelib,can not find automoc
    By toartist in forum KDE Forum
    Replies: 0
    Last Post: 1st October 2009, 08:05

Tags for this Thread

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.