[CMake] Paths with spaces - Visual Studio

David Cole david.cole at kitware.com
Wed Jul 4 15:01:23 EDT 2012


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
    )

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