View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0000413 | CMake | public | 2003-12-02 02:54 | 2003-12-29 13:48 | |||||
Reporter | Gerhard Esterhuizen | ||||||||
Assigned To | Bill Hoffman | ||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Platform | OS | OS Version | |||||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0000413: CMAKE_CURRENT_SOURCE and ADD_CUSTOM_COMMAND error | ||||||||
Description | Referencing the "CMAKE_CURRENT_SOURCE" variable in a "MAIN_DEPENDENCY" causes CMake error. The following entry in CMakeLists.txt ADD_CUSTOM_COMMAND(OUTPUT atarget COMMAND /bin/true MAIN_DEPENDENCY $(CMAKE_CURRENT_SOURCE)/afile) causes CMake tor output: -- Check for working C compiler: gcc -- works -- Check for working CXX compiler: c++ -- works CMake Error: can not find file /home/goof/devel/tmp/tcmake/$(CMAKE_CURRENT_SOURCE)/afile Tried .c .C .c++ .cc .cpp .cxx .m .M .mm .h .h++ .hm .hpp .hxx .in .txx CMake Error: CMake failed to properly look up cmSourceFile: $(CMAKE_CURRENT_SOURCE)/afile -- Configuring done However, the following entries work: ADD_CUSTOM_COMMAND(OUTPUT atarget COMMAND /bin/true DEPENDENCIES $(CMAKE_CURRENT_SOURCE)/afile) ADD_CUSTOM_COMMAND(OUTPUT atarget COMMAND /bin/true MAIN_DEPENDENCY afile) Therefore, the problem only seems to occur when using "CMAKE_CURRENT_SOURCE" as part of "MAIN_DEPENDANCY". I only tested this under Linux using CMake 1.8.1. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0000412) Brad King (manager) 2003-12-29 13:46 |
CMake variables should be referenced using curly braces "{" and "}". The given example uses parens "(" and ")", which are not expected to work. |
(0000413) Brad King (manager) 2003-12-29 13:48 |
The parens were working in other dependencies because the make process is expanding them. You probably want MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/afile |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |