> Hi all, > > As far as I can tell, all Qt programs built with CMake must include > QT_USE_FILE after find_package(). So why doesn't FindQt4.cmake simply > include QT_USE_FILE itself? Is there maybe a use case where > QT_USE_FILE is *not* wanted?
Besides the points already given here is another example: CMakeLists.txt: find_package(Qt4 REQUIRED) add_subdirectory(a) add_subdirectory(b) a/CMakeLists.txt SET(QT_DONT_USE_QTGUI TRUE) INCLUDE(${QT_USE_FILE}) ... TARGET_LINK_LIBRARIES(foo ${QT_LIBRARIES}) b/CMakeLists.txt INCLUDE(${QT_USE_FILE}) ... TARGET_LINK_LIBRARIES(bar ${QT_LIBRARIES}) So bar would get linked against QtGui, but foo not. And this all without fiddling with all the single Qt libraries and their dependencies. Eike _______________________________________________ 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