I want to write a function in cmake.
it looks like:
macro(compile arg1) # TODO here: define a endless input param
target_link_libraries(${arg1} pthread zmq config++ mmm dl) # TODO here: to add input list
endmacro(compile)
for example:
i want to compile a pragma named demo
, it need library libb
and libc
so i called: compile(demo, b, c)
please notice. the arg num is not fixed. so, i need a thing similar with char ** argv
in c++
the first input parameter will set the binary file name, the left will be library name.
How can i do this? can you help on this? thanks