The following issue has been SUBMITTED. ====================================================================== http://www.cmake.org/Bug/view.php?id=15744 ====================================================================== Reported By: Thiago M. Assigned To: ====================================================================== Project: CMake Issue ID: 15744 Category: CMake Reproducibility: always Severity: major Priority: normal Status: new ====================================================================== Date Submitted: 2015-09-15 13:21 EDT Last Modified: 2015-09-15 13:21 EDT ====================================================================== Summary: Spaces in paths with non-ASCII characters are not escaped when using Ninja Description: When using CMake with the Ninja generator to build some source code that is inside a path that contains both spaces and non-ASCII characters, the path is used without escaping the spaces inside the generated Ninja rules files.
Steps to Reproduce: 1) Create a sources folder in a path which contains both spaces and non-ASCII characters. Ex: `make /tmp/CMake Ninja Spaces/Código` 2) Inside the source folder, create a `CMakeLists.txt` with an `add_executable(main main.cpp)`. 3) Run CMake using the Ninja generator. 4) Check the generated `build.ninja` file. It should have spaces in paths escaped with `$`, like: build CMakeFiles/CMakeNinjaSpaces.dir/main.cpp.o: CXX_COMPILER__CMakeNinjaSpaces /tmp/CMake$ Ninja$ Spaces/Código/main.cpp However, it has variables names `identX` with unescaped paths: ident0 = /tmp/CMake Ninja Spaces/Código/main.cpp build CMakeFiles/CMakeNinjaSpaces.dir/main.cpp.o: CXX_COMPILER__CMakeNinjaSpaces $ident0 Additional Information: The unescaped paths make Ninja rebuild and relink everything whenever it runs, making incremental builds and the edit-build-test cicle impossible. Steps to reproduce (cont.): 5) Run Ninja on the generated `build.ninja` file. It outputs the progress of files being build: [1/2] Building CXX object CMakeFiles/CMakeNinjaSpaces.dir/main.cpp.o [2/2] Linking CXX executable CMakeNinjaSpaces 6) Run Ninja again. It should do nothing and print: `ninja: no work to do.` However, it does rebuild and relink everything, showing again the progress messages described in step 5. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2015-09-15 13:21 Thiago M. New Issue 2015-09-15 13:21 Thiago M. File Added: build.ninja ====================================================================== -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers