[CMake] ARGV processing in cmake -P

Bill Newcomb bnewcomb at nvidia.com
Fri Mar 13 19:50:12 EDT 2015


Any idea what I'm doing wrong here?

$ cat foo.cmake
foreach(n RANGE ${ARGC})
   message(STATUS "${n} ${CMAKE_ARGV${n}}")
endforeach()
message(STATUS "${CMAKE_ARGV0}")
message(STATUS "${CMAKE_ARGV1}")
message(STATUS "${CMAKE_ARGV2}")

$ cmake -P foo.cmake a b c
-- 0
-- 
-- 
-- 
$ cmake a b c  -P foo.cmake
-- 0
-- 
-- 
-- 


Thanks,
B.

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------


More information about the CMake mailing list