Notes |
|
(0032947)
|
Rolf Eike Beer
|
2013-04-28 04:18
|
|
Works as advertised: the current file processed is the macro file. When you want the line of the caller you must pass ${CMAKE_CURRENT_LIST_LINE} as argument to the debug macros so it knows what to print. |
|
|
(0032951)
|
Kyle Heath
|
2013-04-28 15:08
|
|
The advertising is not clear... The naming scheme prefix "CMAKE_CURRENT_LIST" should indicate a consistent definition of what file is "current list". The documentation for CMAKE_CURRENT_LIST_DIR and CMAKE_CURRENT_LIST_FILE explain in detail... while the CMAKE_CURRENT_LIST_LINE is a one-liner. This could lead the user to believe it was the same definition as other variables from the same family.
The naming scheme would suggest that a macro writer could print a message indicating the call site of a macro to which invalid parameters were passed with this construct:
MESSAGE(FATAL_ERROR "Invalid use of MY_MACRO at ${CMAKE_CURRENT_LIST_FILE} at line ${CMAKE_CURRENT_LIST_LINE}")
Suggestion:
Define two different variables for handling line numbers:
CMAKE_CURRENT_LIST_LINE - where "current list" is consistent with the definitions used in CMAKE_CURRENT_LIST_FILE and CMAKE_CURRENT_LIST_DIR
CMAKE_CURRENT_SOURCE_LINE - "current source" is the file in which the variable is used
As it stands, it seems I can't tell the user of the macro (or potentially IDE error parsers) where the invalid use of the macro occurred because there is no way to report the line number of the call site. |
|
|
(0032953)
|
Brad King
|
2013-04-29 09:24
|
|
|
|
(0034316)
|
Stephen Kelly
|
2013-11-02 09:19
|
|
Looks like this bug should be closed. |
|
|
(0042273)
|
Kitware Robot
|
2016-06-10 14:28
|
|
Resolving issue as `moved`.
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page. |
|