Qt5 with CMake: how to find qt translations dir?
c++, cmake, internationalization, qt, qt5
Solution
Ok, I found the solution. To get the qmake executable location for currect Qt prefix, you can use
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
However, I find it weird that it is nowhere to be found in the documentation.
Problem
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 ``` qmake -query QT_INSTALL_TRANSLATIONS ``` 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 ``` Qt5Core_QMAKE_EXECUTABLE ``` 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.