summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-05-30 11:42:47 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-05-30 11:50:37 (GMT)
commite5375442ff20fde45e70de318c5aa2f1e4bb190a (patch)
treea09e6f32c27d9a9e0b4fe7aefa79cc0969a01a2f /Source/cmCoreTryCompile.cxx
parente65ef08bf2719ffd1cc4226f9594ff7127ad8b5e (diff)
downloadCMake-e5375442ff20fde45e70de318c5aa2f1e4bb190a.zip
CMake-e5375442ff20fde45e70de318c5aa2f1e4bb190a.tar.gz
CMake-e5375442ff20fde45e70de318c5aa2f1e4bb190a.tar.bz2
try_compile: Trim whitespace from LINK_LIBRARIES entries
Commit e65ef08b (try_compile: Fix quoting of libraries in generated CMakeLists.txt, 2013-05-24) added quoting to entries specified in the LINK_LIBRARIES. However, if the input entries contain whitespace padding, that quoted whitespace causes an error in the generated CMakeLists.txt at target_link_libraries. Strictly, it is an error to have space separated entries in the CMAKE_REQUIRED_LIBRARIES, as it was never properly handled by CMakeExpandImportedTargets even prior to commit 236133e7 (Handle targets in the LINK_LIBRARIES of try_compile., 2013-02-09). However, it is causing a regression in KDE code which tests the next branch.
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index ebfcae0..85e49a9 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -111,7 +111,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
++i)
{
extraArgs++;
- libsToLink += "\"" + argv[i] + "\" ";
+ libsToLink += "\"" + cmSystemTools::TrimWhitespace(argv[i]) + "\" ";
cmTarget *tgt = this->Makefile->FindTargetToUse(argv[i].c_str());
if (!tgt)
{