[Development] CMake problem

Dmitry Ashkadov dmitry.ashkadov at gmail.com
Tue Jul 23 08:27:10 CEST 2013


I've found that next CMake script doesn't work as expected:

> cmake_minimum_required(VERSION 2.8.9)
> find_package(Qt5 5.1.0 REQUIRED COMPONENTS Core LinguistTools)
> add_custom_target(lupdate COMMAND "${Qt5_LUPDATE_EXECUTABLE}" -version)

If a "libdir" option of configure script is set to be not a subdirectory 
of PREFIX (a path, specified with option "-prefix") then command "make 
lupdate" will cause errors. For example, for prefix == /usr/lib64/qt5 
and libdir == /usr/lib64:

> $ make lupdate
> make[3]: /usr/lib64/cmake/Qt5LinguistTools/bin/lupdate: Command not found
> make[3]: *** [CMakeFiles/lupdate] Error 127
> make[2]: *** [CMakeFiles/lupdate.dir/all] Error 2
> make[1]: *** [CMakeFiles/lupdate.dir/rule] Error 2
> make: *** [lupdate] Error 2

It seems like qmake project file assumes that libdir must be a 
subdirectory of prefix and generates wrong CMake config file. This 
problem makes macro add_translations() causing errors.

Thank you!

More information about the Development mailing list