[CMake] Getting started with CMake macros

Thomas Sondergaard ts_news1 at sondergaard.cc
Tue Nov 6 04:15:26 EST 2007


Is there a beginners guide to macros somewhere? I tried something basic 
like wrapping up find_library like this:

macro(my_find_library arg1 arg2)
   find_library(arg1 arg2)
endmacro(my_find_library)

my_find_library(CPPUNIT cppunit)

To my surprise it didn't work at all. If I browse CMakeCache.txt there 
is no reference to CPPUNIT. If I call find_library directly it works!

Regards,

Thomas



More information about the CMake mailing list