On Thursday 19 May 2011, Theodore Papadopoulo wrote:
> Hello,
>
> I'm facing with the following problem, I'm using the _XXX trick to
> access the previous version of a command. Unfortunately, this is not
> quite what I need because of a double redefinition of the command.
>
> Here is a small example of the problem I have:
>
> PROJECT(Test)
>
> FUNCTION(FIND_LIBRARY VAR)
> MESSAGE("HERE 1")
> _FIND_LIBRARY(${VAR} ${ARGN})
> ENDFUNCTION()
>
> FIND_LIBRARY(ZLIB z)
>
> FUNCTION(FIND_LIBRARY VAR)
> MESSAGE("HERE 2")
> _FIND_LIBRARY(${VAR} ${ARGN})
> ENDFUNCTION()
>
> FIND_LIBRARY(GTKLIB gtk)
>
> In the second call "FIND_LIBRARY(GTKLIB gtk)", _FIND_LIBRARY refers to
> the first definition and the call to that function just loops forever.
> Browsing cmake sources reveals that basically cmake just renames the old
> function XXX into _XXX. If _XXX already exists, it is suppressed (if I
> understood well).
This feature is not very, let's say polished, so yes, it is not perfect as it
is.
Why do you want do do this ?
How about adding a "my_find_library()", so you don't have to rename it ?
In KDE4 we have KDE4_ADD_EXECUTABLE(), KDE4_ADD_LIBRARY() which add some
features, and developers who want to make use of this have to use these
functions.
It works well for us.
Alex
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake