Alexander Neundorf wrote: >> Is there some way I can modify that example to re-create the linker error >> described in the comment? > > Well, if simply the path is used, FindQt4.cmake does not have to be > executed before. > If imported targets are used, FindQt4.cmake has to be executed before (or > at least at some point), otherwise nobody creates the imported targets > (independent from the USE_IMPORTED_TARGETS switch). > > I think that's all.
Interesting. I think it would be very odd to not use FindQt4.cmake though. Not something to consider I think. > >> > You can still test in e.g. GrantleeConfig.cmake whether the target >> > Qt4::QtCore exists and fail with FATAL_ERROR if it doesn't. >> > >> > I strongly recommend using these imported targets, one reason is >> > because otherwise when installing a binary package of Grantlee under >> > Windows, it will not be possible to freely choose the install location, >> > or better the location where Qt must be is then already hardcoded in >> > GrantLeeConfig.cmake (because then there won't be "Qt4::QtCore" in >> > GrantleeConfig.cmake, but something like >> > "c:/where/was/Qt/at/buildtime/QtCore.dll"). When then linking against >> > Grantleee, and Qt is installed somewhere else, it will fail. >> >> Yes, this makes sense. I think that's something we almost covered in the >> review in Randa :). I am adding the setter to use the imported target >> feature so it will be in the next release, but I also want to understand >> it > > What setter ? Sorry, I meant the set(QT_USE_IMPORTED_TARGETS TRUE) > I think you can simply use the exported targets. > Agreed. Done now, thanks for the help. Steve. _______________________________________________ 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
