Generate ';' separated libraries in prl files for CMake.

The generated CMake files need to pass ';' separated libraries to
the IMPORTED_LINK_INTERFACE_LIBRARIES property, otherwise we get errors
such as this:

http://testresults.qt-project.org/ci/QtTools_master_Integration/build_00386/win32-msvc2010_Windows_7/log.txt.gz

(grep for QtCore5.lib.lib)

Rather than a naive and error prone replacement of whitespace, generate
the appropriate ';' separated content directly in the qmake prl file.

Change-Id: I8eb5e233a0318b57ec74b86d910583ff99c29415
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Brad King <brad.king@kitware.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
Stephen Kelly 2012-10-07 10:42:36 +02:00 committed by The Qt Project
parent 2672c4fa91
commit 95e548eeaa
2 changed files with 9 additions and 3 deletions

View File

@ -78,9 +78,8 @@ if (NOT Qt5_EXCLUDE_STATIC_DEPENDENCIES)
macro(macro_process_prl_file prl_file_location Configuration)
if (EXISTS \"${prl_file_location}\")
file(STRINGS \"${prl_file_location}\" prl_strings REGEX \"QMAKE_PRL_LIBS\")
string(REGEX REPLACE \"QMAKE_PRL_LIBS *= *([^\\n]*)\" \"\\\\1\" static_depends ${prl_strings} )
string(STRIP ${static_depends} static_depends)
file(STRINGS \"${prl_file_location}\" prl_strings REGEX \"QMAKE_PRL_LIBS_FOR_CMAKE\")
string(REGEX REPLACE \"QMAKE_PRL_LIBS_FOR_CMAKE *= *([^\\n]*)\" \"\\\\1\" static_depends ${prl_strings} )
if (_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES)
set(_list_sep \";\")
endif()

View File

@ -1010,6 +1010,13 @@ MakefileGenerator::writePrlFile(QTextStream &t)
for (ProStringList::Iterator it = libs.begin(); it != libs.end(); ++it)
t << project->values((*it).toKey()).join(' ').replace('\\', "\\\\") << " ";
t << endl;
t << "QMAKE_PRL_LIBS_FOR_CMAKE = ";
QString sep;
for (ProStringList::Iterator it = libs.begin(); it != libs.end(); ++it) {
t << sep << project->values((*it).toKey()).join(';').replace('\\', "\\\\");
sep = ';';
}
t << endl;
}
}