[CMake] Calling qmake from cmake

Michael Wild themiwi at gmail.com
Mon Aug 23 07:17:11 EDT 2010


On 23. Aug, 2010, at 11:43 , norulez wrote:

> Hello,
> 
> I've 3rdparty projects which are using qmake as the build system. How can I execute qmake from within an existing project to integrate such projects into the build process?
> 
> Thanks in advance
> 
> Best Regards
> NoRulez

Probably best do find_package(Qt4 REQUIRED) and then use ${QT_QMAKE_EXECUTABLE} in an ExternalProject_Add() invocation. Alternatively, instead of using the ExternalProject_Add, you could simply create a add_custom_target which runs qmake. In any case, you should then create IMPORTED libraries using add_library, and have all targets that link against them depend on the custom target.

I hope this isn't too abstract ;-)

Michael



More information about the CMake mailing list