FindQt4: Assumption that all imported libraries are frameworks if "QtCore" is a framework is incorrect
When building QT 4.8.7 from source, the UiTools
module is not a framework:
factory@kitware:/Users/kitware/Dashboards/Support/qt-everywhere-opensource-build-4.8.7/lib> ls -1
QtCore.framework
QtCore.la
[...]
QtScript.framework
QtScript.la
QtScriptTools.framework
QtScriptTools.la
QtSql.framework
QtSql.la
QtSvg.framework
QtSvg.la
QtTest.framework
QtTest.la
QtWebKit.framework
QtWebKit.la
QtXml.framework
QtXml.la
QtXmlPatterns.framework
QtXmlPatterns.la
libQtCLucene.4.8.7.dylib
libQtCLucene.4.8.dylib
libQtCLucene.4.dylib
libQtCLucene.dylib
libQtCLucene.la
libQtCLucene.prl
libQtUiTools.a <-------------------------- NOT A FRAMEWORK
libQtUiTools.prl
libQtUiTools_debug.a
libQtUiTools_debug.prl
phonon.framework
phonon.la
pkgconfig
This means that the systematic setting of IMPORTED_LOCATION_(RELEASE|DEBUG)
for the imported targets (see here) to value like
"${QT_${basename}_LIBRARY_RELEASE}/${_camelCaseBasename}"
leads to link error like the following:
make[8]: *** No rule to make target
`/Users/kitware/Dashboards/Support/qt-everywhere-opensource-build-4.8.7/lib/libQtUiTools.a/QtUiTools',
needed by `lib/Slicer-4.7/qt-loadable-modules/libqSlicerDicomRtImportExportSubjectHierarchyPlugins.dylib'.
Stop
A more robust approach would be to check if the file ${QT_${basename}_LIBRARY_RELEASE}/${_camelCaseBasename}
exists first.