[CMake] blank chars in directory names problem

Guerreiro da Luz g.da.luz at gmail.com
Mon Feb 12 11:08:23 EST 2007


I'm trying to add CMake support to a project that contains
subdirectories with blank  characters in its name; it seems like CMake
is not escaping these blanks on all occasions in generated makefiles,
so compilation fails.  Here is a very dumb example demonstrating the
problem: let's say we have a project main directory with single
subdirectory named "source code".  The contents of CMakeLists.txt file
in project main directory is:
    PROJECT(foo)
    ADD_SUBDIRECTORY("source code")
and the contents of "source code/CMakeLists.txt" file is:
    ADD_EXECUTABLE(
        hello
        hello.c
    )
The "source code" subdirectory contains hello.c file also, with
hello-world C program.  When a build directory created, and CMake
launched, everything is going fine, but when make launched afterwards,
following is reported (everything of above happens on Linux, with
cmake 2.4.6):
    [100%] Building C object source code/CMakeFiles/hello.dir/hello.o
    gcc: code/CMakeFiles/hello.dir/hello.o: No such file or directory
    make[2]: *** [source code/CMakeFiles/hello.dir/hello.o] Error 1
    make[1]: *** [source code/CMakeFiles/hello.dir/all] Error 2
    make: *** [all] Error 2

Any suggestion?

Thanks.


More information about the CMake mailing list