pavelliavonau/cmakeconverter

Filenames with spaces result in cmake error.

Closed this issue · 0 comments

bigla commented

Consider

  <ItemGroup>
    <Text Include="data\dummy space space.txt" />
...

will yield

set(data
    data/dummy space space.txt
...

which results in:

CMake Error at FooBar/CMakeLists.txt:332 (add_executable):
  Cannot find source file:

    data/dummy

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx

(Idea: Use double-quotes (" ") for all filenames or at least the ones containing spaces)

Edit:

  <ItemGroup>
    <ClInclude Include="$(FooVar)\subfolder\include\header.h" />
...

Interestingly variables (I manually converted from $() to ${}) containing spaces do not interfere.