> -----Original Message----- > From: Pau Garcia i Quiles [mailto:pgqui...@elpauer.org] > Sent: 31 December 2009 14:07 > To: Hicham Mouline > Cc: cmake@cmake.org > Subject: Re: [CMake] restricting Qt include and library linking to 1 > library/project > > Hello, > > Do find_package( Qt4 COMPONENTS ... ) from each subdir and use only > the components you need for each library. > > Do not INCLUDE( ${QT_USE_FILE} ) in any case, just do an include_directories. > > When linking, do not use the contain-all QT_LIBRARIES variable but the > individual library variables. > > Assuming lib1 uses QtCore and QtNetwork: > > find_package( Qt4 COMPONENTS QtCore QtNetwork REQUIRED ) > include_directories( ${QT_QTCORE_INCLUDE_DIR} ${QT_QTNETWORK_INCLUDE_DIR} ) > add_library( lib1 SHARED lib1_source1.cpp lib1_source2.cpp ... ) > target_link_libraries( lib1 ${QT_QTCORE_LIBRARIES} ${QT_QTNETWORK_LIBRARIES} )
Does this take care of both release and debug libraries? Ie, in release build, it will include release libs and in debug debug libs? Thanks for this, _______________________________________________ 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