MantisBT - CMake | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0010503 | CMake | CMake | public | 2010-04-01 19:14 | 2010-04-09 20:18 |
| Reporter | Conrad | ||||
| Assigned To | |||||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | OS | OS Version | |||
| Product Version | CMake-2-8 | ||||
| Target Version | Fixed in Version | ||||
| Summary | 0010503: In Visual Studio 2010 custom rules need absolute paths, not relative | ||||
| Description | Perhaps something has changed in Visual Studio 2010 - I added clear std::cout statements in cmake.cxx's cmakeCheckStampFile() and cmakeCheckStampList() functions to show the current directory, and sometimes custom rules get executed from within a directory other than the main directory in which the .vcxproj file resides. Custom targets often fail because CMake generates rules that assume that the commands are being executed from within the .vcxproj directory. (We use Qt and we have project files that pull in source files from other directories. The custom build rules generated by FindQt4.cmake / UseQt.cmake first cd to the location of the file and then run moc/uic. Sometimes these commands fail, and perhaps Visual Studio doesn't reset the current directory before moving on to the next command?) The fix is to generate custom commands that use absolute paths. Change one line in cmLocalVisualStudioGenerator::ConstructScript() from: script += this->Convert(workingDirectory, START_OUTPUT, SHELL); to: script += this->Convert(workingDirectory, FULL, SHELL); and change one line in cmLocalVisualStudio7Generator::CreateVCProjBuildRule() from: commandLine.push_back(stampName.c_str()); to: std::string stampFilename = this->Convert(stampName.c_str(), FULL, SHELL); commandLine.push_back(stampFilename.c_str()); This solves the problem. | ||||
| Steps To Reproduce | |||||
| Additional Information | |||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | https://public.kitware.com/Bug/file/3007/CMakeVS2010DirectoryTest.zip https://public.kitware.com/Bug/file/3008/0001-Improve-clarity-of-messages-that-get-printed-when-CM.patch | ||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2010-04-01 19:14 | Conrad | New Issue | |||
| 2010-04-02 09:26 | Brad King | Note Added: 0020060 | |||
| 2010-04-02 12:39 | Conrad | File Added: CMakeVS2010DirectoryTest.zip | |||
| 2010-04-02 12:55 | Conrad | File Added: 0001-Improve-clarity-of-messages-that-get-printed-when-CM.patch | |||
| 2010-04-02 13:07 | Conrad | Note Added: 0020062 | |||
| 2010-04-02 14:19 | Bill Hoffman | Note Added: 0020063 | |||
| 2010-04-09 20:18 | Bill Hoffman | Note Added: 0020116 | |||
| 2010-04-09 20:18 | Bill Hoffman | Status | new => closed | ||
| 2010-04-09 20:18 | Bill Hoffman | Resolution | open => fixed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||