[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 14:18:02 EDT 2012


Did you try playing around with:

file(TO_CMAKE_PATH path result)
file(TO_NATIVE_PATH path result)

I did try file(TO_NATIVE_PATH path result) at the time, but it was not
useful in my case.
The result is still a unix style path (maybe because I am using Cygwin)

Thanks
Ajay

On Mon, Mar 19, 2012 at 11:00 AM, Eric Noulard <eric.noulard at gmail.com>wrote:

> 2012/3/19 Ajay Panyala <ajay at csc.lsu.edu>:
> > 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.
>
> Did you try playing around with:
>
> file(TO_CMAKE_PATH path result)
> file(TO_NATIVE_PATH path result)
>
> cmake --help-command file
>
> >
> > 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
> >
> >
> >
> >
> >
> >
> > --
> >
> > 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
>
>
>
> --
> Erk
> Le gouvernement représentatif n'est pas la démocratie --
> http://www.le-message.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120319/f0070f0a/attachment.htm>


More information about the CMake mailing list