[CMake] macro withunexpected results

Alexander Neundorf a.neundorf-work at gmx.net
Fri Aug 24 14:00:23 EDT 2007


On Friday 24 August 2007 13:24, ope wrote:
...
> macro(ADD_SUBDIRECTORIES dirlist)
>   set(prefix " + ")
>   MESSAGE(STATUS "add_subdirectories: ${ARGN}")
>   foreach(subdir ${dirlist})
>     MESSAGE(STATUS "${prefix}${subdir}")
>     add_subdirectory(${subdir})
>   endforeach(subdir ${dirlist})
> endmacro(ADD_SUBDIRECTORIES)
>
> using this gets:
>
> ...
> -- Scanning for sub projects in extra:
> -- Adding est;boost;threadpool
> -- add_subdirectories: boost;threadpool
> --  + est
> ...

The macro has one argument "dirlist" which gets the first argument: est.
The remaining arguments go into ARGN. You are iterating over the first 
argument only.

Bye
Alex


More information about the CMake mailing list