View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013595CMakeCMakepublic2012-10-17 14:522013-03-04 08:38
ReporterMatt Coffin 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformAppleOSMac OS XOS Version10.8.2
Product VersionCMake 2.8.9 
Target VersionFixed in Version 
Summary0013595: CMAKE_COMMAND handles spaces in path poorly when used in CMAKE_CXX_LINK_EXECUTABLE
DescriptionWhen ${CMAKE_COMMAND} is used from within CMAKE_CXX_LINK_EXECUTABLE, spaces in the pathname are not handled as escape characters, so the executable cannot be found. This happens when using a custom toolchain most often. The problem is easily remedied by manually editing link.txt and putting backslashes before the spaces in the path, but this should really be something that CMake handles itself, right? Sorry if there's poor formatting or lack of information. I can grab more info if need be. Its my first bug post.
Steps To ReproduceThe following toolchain file for cross-compiling for powerpc-wrs-vxworks will reproduce the problem nicely. But I suspect any use of ${CMAKE_COMMAND} in CMAKE_CXX_LINK_EXECUTABLE will reproduce the same problem as it is all about how spaces are handled when the executable's path is written to link.txt.

The toolchain file can be found at https://github.com/mcoffin/cmake_vxworks. [^]

If you wish to build a cross-compiler environment identical to mine, the patches for GCC and relevant build scripts are at https://github.com/rbmj/vxworks-gcc-patches. [^]

WPILib for GCC is at https://github.com/rbmj/wpilib, [^] but I can't imagine that one would need all of this to reproduce the problem, I'm just simply offering my setup just in case
Additional InformationThere is a space by default in the installation path for CMake on OSX, so this problem will most likely effect all users that installed to the default location under OSX. I just realized I can attach files, so I'll toss in the "culprit" link.txt that is generated by that toolchain file. Just look at the last line to see why the space causes a problem.
TagsNo tags attached.
Attached Filestxt file icon link.txt [^] (1,435 bytes) 2012-10-17 14:52 [Show Content]
txt file icon vxworks_toolchain.cmake.txt [^] (7,603 bytes) 2012-10-17 14:59 [Show Content]

 Relationships

  Notes
(0031254)
Brad King (manager)
2012-10-17 15:32

Use "<CMAKE_COMMAND>", not "${CMAKE_COMMAND}". This is already done in several upstream platform modules:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/Platform/Windows-Intel.cmake;hb=v2.8.9#l102 [^]

Please bring this up on the mailing list if you need further help:

 http://www.cmake.org/mailman/listinfo/cmake [^]
(0032474)
Robert Maynard (manager)
2013-03-04 08:38

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-10-17 14:52 Matt Coffin New Issue
2012-10-17 14:52 Matt Coffin File Added: link.txt
2012-10-17 14:59 Matt Coffin File Added: vxworks_toolchain.cmake.txt
2012-10-17 15:32 Brad King Note Added: 0031254
2012-10-17 15:32 Brad King Status new => resolved
2012-10-17 15:32 Brad King Resolution open => no change required
2013-03-04 08:38 Robert Maynard Note Added: 0032474
2013-03-04 08:38 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team