MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0015076 | CMake | (No Category) | public | 2014-08-10 16:53 | 2016-06-10 14:31 |
Reporter | Piotr Dziwinski | ||||
Assigned To | Kitware Robot | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | Linux | OS | Arch Linux | OS Version | |
Product Version | CMake 3.0 | ||||
Target Version | Fixed in Version | ||||
Summary | 0015076: CMake does not support source/build trees with ';' in the path | ||||
Description | While discussing use of proper quoting of variables in CMake (https://github.com/colobot/colobot/issues/317 [^]), I happened to notice this bug. If you run CMake with a binary directory which contains special characters like semicolons, CMake fails with errors coming from core CMake modules for checking compiler and platform: CMake Error at /usr/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake:107 (file): file Internal CMake error when trying to open file: /tmp/cmake-test/directory with semicolons a for writing. Call Stack (most recent call first): /usr/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake:117 (CMAKE_DETERMINE_COMPILER_ID_WRITE) /usr/share/cmake-3.0/Modules/CMakeDetermineCompilerId.cmake:39 (CMAKE_DETERMINE_COMPILER_ID_BUILD) /usr/share/cmake-3.0/Modules/CMakeDetermineCCompiler.cmake:108 (CMAKE_DETERMINE_COMPILER_ID) CMakeLists.txt:2 (project) There are many more such errors coming from modules like CMakeDetermineSystem, CMakeDetermineCCompiler, CMakeTestCCompiler, etc. The problem seems to be caused by improper quoting of ${CMAKE_BINARY_DIR} and related variables within those modules. I have attached a diff that solves the problem in provided simple case of C/C++ project, but I see that same issue occurs in many other places in CMake modules. | ||||
Steps To Reproduce | $ cat > CMakeLists.txt <<EOF cmake_minimum_required(VERSION 2.8) project(test C CXX) add_executable(test_proj test_proj.cpp) EOF $ echo "int main() { return 0; }" > test_proj.cpp $ mkdir "directory with semicolons a;b;c" $ cd "directory with semicolons a;b;c" $ cmake ../ | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | ![]() https://public.kitware.com/Bug/file/5226/binary_dir_quoting_fix.diff | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2014-08-10 16:53 | Piotr Dziwinski | New Issue | |||
2014-08-10 16:53 | Piotr Dziwinski | File Added: binary_dir_quoting_fix.diff | |||
2014-08-11 10:22 | Brad King | Note Added: 0036592 | |||
2014-08-11 12:07 | Piotr Dziwinski | Note Added: 0036596 | |||
2014-08-11 12:52 | Brad King | Note Added: 0036597 | |||
2014-08-11 16:35 | Markus Elfring | Note Added: 0036599 | |||
2014-08-12 09:31 | Brad King | Note Added: 0036601 | |||
2014-08-12 09:32 | Brad King | Summary | CMAKE_BINARY_DIR is not quoted properly in core CMake modules => CMake does not support source/build trees with ';' in the path | ||
2014-08-16 12:04 | Markus Elfring | Note Added: 0036622 | |||
2014-08-18 09:39 | Brad King | Note Added: 0036630 | |||
2014-08-18 11:40 | Markus Elfring | Note Added: 0036636 | |||
2016-06-10 14:29 | Kitware Robot | Note Added: 0042604 | |||
2016-06-10 14:29 | Kitware Robot | Status | new => resolved | ||
2016-06-10 14:29 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:29 | Kitware Robot | Assigned To | => Kitware Robot | ||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|