[CMake] FindQt4.cmake returns too much irrelevant information

Clinton Stimpson clinton at elemtech.com
Fri May 8 14:40:44 EDT 2009


Just thinking here....

Perhaps you can use the export() command then make a cmake script to 
include that, and just query for the libraries with 
get_target_property(LIBS mytarget IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE)
and create your *.pc file from that information?
That export is roughly equivalent to a *.pc file.
You can run that cmake script to generate the .pc file at build time or 
install time if you want it to work with an IDE or some cmake generator 
that ignores CMAKE_BUILD_TYPE.

That has the advantage of working with any target with any dependency 
(Qt or not).
It also gives an export file for your PLplot users who choose to use 
CMake instead of pkg-config.

Clint

Alan W. Irwin wrote:
> I just realized that some of the debug and optimized keyword logic inside
> FindQt4.cmake appears outside an IF(CMAKE_CONFIGURATION_TYPES OR
> CMAKE_BUILD_TYPE) logic block which considerably weakens my case.  
> Also, I
> acknowlege that there is so much information available from 
> FindQt4.cmake it
> is an extremely difficult problem to come up with a clean design, and 
> I am
> not sure I could do any better than what is already in FindQt4.cmake. So
> that is the end of that particular "clean design" sub-topic of this 
> thread.
>
> Thanks, Mike, for the suggestion of using QT_*_LIBRARY_DEBUG or
> QT_*_LIBRARY_RELEASE, but I am concerned those rather long lists of
> variables might change in the future requiring on-going maintenance.
> Therefore, I have decided to write a general macro to go through a
> particular LIBRARIES list and generate three LIBRARIES lists based on the
> general (or no keyword), debug, and optimized keywords that are found. I
> plan to use the three such lists generated from QT_LIBRARIES for PLplot's
> particular pkg-config export needs.
>
> Alan
> __________________________
> Alan W. Irwin
>
> Astronomical research affiliation with Department of Physics and 
> Astronomy,
> University of Victoria (astrowww.phys.uvic.ca).
>
> Programming affiliations with the FreeEOS equation-of-state 
> implementation
> for stellar interiors (freeeos.sf.net); PLplot scientific plotting 
> software
> package (plplot.org); the libLASi project (unifont.org/lasi); the 
> Loads of
> Linux Links project (loll.sf.net); and the Linux Brochure Project
> (lbproject.sf.net).
> __________________________
>
> Linux-powered Science
> __________________________
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list