Is this a known thing, or a bug (I'm using cmake 3.1.0): I create this CMakeLists.txt:
cmake_minimum_required(VERSION 3.1.0) project(ArgTest) function(FOO one two) message(STATUS "extra args are ${ARGN}") message(STATUS "third arg is ${ARGV2}") endfunction() function(BAR one) FOO(${one} TWO) message(STATUS "do something with ${ARGN}") endfunction() BAR(ONE N1 N2 N3 N4) Note how I invoke BAR() with 5 arguments, but BAR invokes FOO with only two arguments. I would expect that the third argument ${ARGV3} would be empty in function FOO. However, when I run cmake on this file it shows: -- extra args are -- third arg is N2 -- do something with N1;N2;N3;N4 So the ARGN for function FOO is correct (nothing there) but FOO has "inherited" the extra ARGVx arguments beyond the first two, that I passed to function BAR! That's rather unexpected. Bug or feature? -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake