[CMake] Paths with spaces - Visual Studio

Totte Karlsson totte at dunescientific.com
Wed Jul 4 15:20:11 EDT 2012


On 7/4/2012 12:01 PM, David Cole wrote:
> The preferred way is simply to add the def file as a source file of
> your library or executable:
>
>    add_library(my lib SHARED
>      ${cxx_sources}
>      ${CMAKE_CURRENT_SOURCE_DIR}/c_api_vs.def
>      )
That makes sense. I'm using different def file for different compilers, 
but I guess one can 'construct' a file name before adding to add_library.

Is the spaces problem  present for all flags and 'options' to cmake 
functions?

tk

> Then you don't need to modify the linker flags at all.
>
>
> HTH,
> David
>
>
> On Wed, Jul 4, 2012 at 1:03 PM, Totte Karlsson <totte at dunescientific.com> wrote:
>> Hi,
>> I had a problem with a source path containing spaces:
>> SET (CMAKE_SHARED_LINKER_FLAGS  "${CMAKE_SHARED_LINKER_FLAGS}
>> /DEF:${CMAKE_CURRENT_SOURCE_DIR}/c_api_vs.def")
>>
>> where CMAKE_CURRENT_SOURCE_DIR had spaces. That casued problems in the
>> visual studio project.
>>
>> I quoted the above as this:
>> ..... \"/DEF:${CMAKE_CURRENT_SOURCE_DIR}/c_api_vs.def\"")
>>
>> and it 'fixed' it. Question is. Is that the preferred way?
>>
>> thanks,
>> Totte
>>
>>
>> --
>> .........................
>> Totte Karlsson, Ph.D.
>> Dune Scientific, LLC
>> 425-296 1980 (office)
>> 425-780 9648 (cell)
>> www.dunescientific.com
>> .........................
>>
>>
>> --
>>
>> 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




More information about the CMake mailing list