[CMake] cmake generates broken project file when path includes whitespace (in this case at least)

Ajay Panyala ajay at csc.lsu.edu
Mon Mar 19 13:42:42 EDT 2012


Please notice the linebreak after Foo, this causes the linker to fail,
saying it can not find "C:/Projects/Foo".

I guess this is a cmake bug, but I need to find a workaround for this one.
I am using cmake 2.8.2 on Windows 7.

I have the exact same whitespace issue with a custom command. I am using
cmake 2.8.4 with Cygwin
on Windows XP. I have not tried to fix it yet since it was not too urgent
for me.

My guess is (I maybe wrong) that it may have something to do with the way
Windows paths ( "C:/Projects/Foo")
are specified. I think CMake has something to handle this, but I do not
know what that would be.

Thanks
Ajay

On Mon, Mar 19, 2012 at 7:51 AM, Paul Baumer <paul.baumer2 at googlemail.com>wrote:

> Hello,
>
> I have the following in my Cmakelists.txt file:
>
> set_target_properties( MyApp PROPERTIES STATIC_LIBRARY_FLAGS
> "${SOME_LIB_FILENAME}")
>
> If the SOME_LIB_FILENAME path includes white space such as
>
> c:/Projects/Foo 4/Src/somelib.lib
>
> the generated visual studio 2008 file includes the following fragment:
>
> <Tool Name="VCLibrarianTool"
> AdditionalOptions="'"C:/Projects/Foo
> 4/Src/somelib.lib"'"
>
> Please notice the linebreak after Foo, this causes the linker to fail,
> saying it can not find "C:/Projects/Foo".
>
> I guess this is a cmake bug, but I need to find a workaround for this one.
> I am using cmake 2.8.2 on Windows 7.
>
> Any ideas?
>
> Paul
>
>
> --
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120319/3bb7046d/attachment.htm>


More information about the CMake mailing list