[CMake] Encapsulating macros

Theodore Papadopoulo Theodore.Papadopoulo at sophia.inria.fr
Tue Oct 20 12:00:40 EDT 2009


Following-up a previous message "Re: [CMake] Updating cache entries on 
variable modification", I would like
to encapsulate the FIND_LIBRARY.

Taking a simple example, let's assume that I'd like to have a list of 
all the calls of FIND_LIBRARY I did.
Is there a way of creating a cmake script that basically does something 
like:

MACRO(SAVED_FIND_LIBRARY)
    FIND_LIBRARY(${ARGN})
ENDMACRO()

MACRO(FIND_LIBRARY VAR)
    SET(MY_LIB_LIST ${MY_LIB_LIST} ${VAR})
    SAVED_FIND_LIBRARY(${VAR} ${ARGN})
ENDMACRO()

Obviously this does not work....
Is there a tricky way to achieve this, or should  resign myself to use a 
new name ?

    Thank's...



More information about the CMake mailing list