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

Eric Noulard eric.noulard at gmail.com
Mon Mar 19 14:00:14 EDT 2012


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


More information about the CMake mailing list