[CMake] Enhancement of FIND_PACKAGE

Alexander Neundorf a.neundorf-work at gmx.net
Fri Jan 27 09:09:45 EST 2006


Hi, 
 
> Von: Filipe Sousa <filipe at ipb.pt> 
>  
> Hi! 
>  
> I'm thinking we could extend REQUIRED parameter from FIND_PACKAGE to be 
> more specific. Some packages have a lot of libraries and we may not need 
> all them. Something link FIND_PACKAGE(Qt4 REQUIRED GUI XML SQL) should 
> define Qt4_FIND_REQUIRED-GUI, Qt4_FIND_REQUIRED-XML and 
> Qt4_FIND_REQUIRED-SQL. 
 
Did you follow the discussions about the KDE4 buildsystem ? 
We will probably also need some extensions to the 
FindQt4.cmake/UseQt4.cmake files. 
They are now also in kde svn and will be synced when neccessary: 
http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/ 
 
In the CMakeLists.txt currently in KDE/kdelibs/ most targets link to 
QT_QTCORE_LIBRARY , QT_QTGUI_LIBRARY or QT_QTXML_LIBRARY. These are the 
non-debug versions. 
Now some developers would like to use the debug versions of the Qt libs 
without having to link to all of them. 
We see two options: 
1)  
 
SET(QT_DONT_USE_THIS TRUE) 
SET(QT_USE_THAT TRUE) 
INCLUDE(UseQt4) 
TARGET_LINK_LIBRARIES(kdeui ${QT_LIBRARIES} )  
 
in basically every CMakeLists.txt. 
 
2) 
write a macro which simplifies the above: 
QT4_USE(QTCORE QTGUI QTXML) #specify only those you want to use 
TARGET_LINK_LIBRARIES(kdeui ${QT_LIBRARIES} )  
 
3) 
 
make wrappers for each of the QT_QTFOO_LIBRARY variables: 
 
IF(BUILDTYPE==DEBUG) 
   SET(FOO_QTCORE_LIBRARY ${QT_QTCORE_LIBRARY_DEBUG) 
ELSE 
   SET(FOO_QTCORE_LIBRARY ${QT_QTCORE_LIBRARY) 
ENDIF 
 
 
What do you think ? 
 
Bye 
Alex 
 

-- 
DSL-Aktion wegen großer Nachfrage bis 28.2.2006 verlängert:
GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl


More information about the CMake mailing list