How can I detect the location of Qt5 core in a CMake file on OS X? -


I'm using CMake to build a QT5 project on OS X. I have a manufacturing process that is possible The need to make others is simple.

Qt5 is installed by default in the home folder on OS X. However, after that, its files are placed in a directory named after the exact version number, e.g. 5.2.1

The moment I am using these lines in my CMake file:.

Set (QT5_PATH $ ENV {Home} /Qt5.2.1/5.2.1 / clang_64 / cache path "Path for Qt5") Set (QT5_MODULE_PATH $ {QT5_PATH} / lib / cmake) Set (CMAKE_PREFIX_PATH $ {CMAKE_PREFIX_PATH} $ {QT5_MODULE_PATH})

This works, but unfortunately breaks with every minor update of QT because 5.2.1 has to be changed to 5.2.2 , etc.

In Windows, there are environments that can be used to find QT searches, similar to OS X Anything that I use within CMake Can I find a QT installation?

"itemprop =" text ">

use search_package instead of having to rotate with the path itself Then your users can rely on the standard CMake system instead of locating their own CMake code.

Use the find_package (Qt5Widgets) like the QT :: widget to get the / code to get links for more Qt5Core and any part of QT5 is required

See QT's documentation: ..


Comments