[CMake] ARGV to ARGN translation debugging

Joe climberking2000 at gmail.com
Mon Nov 17 13:44:07 EST 2014


Hey all,

I know that ARGV is all arguments, and ARGN is all arguments past the last
expected argument. I find myself in a weird situation with these, where
identical ARGV's in the same function lead to different ARGN's. The
relevant code in the CMake script is below

FUNCTION(MY_FUNC_NAME EXE_NAME)

  MESSAGE("FINAL ARGV: ${ARGV}")
  MESSAGE("FINAL ARGN: ${ARGN}")
  .............
ENDFUNCTION()

Two different calls lead to the following outputs

FINAL ARGV:
Multifield_Repartition;SOURCES;multifield_repartition.cpp;COMM;mpi;serial;STANDARD_PASS_OUTPUT;NUM_MPI_PROCS;4;FAIL_REGULAR_EXPRESSION;TEST
FAILED;PASS_REGULAR_EXPRESSION;TEST
PASSED;ARGS;--num_particles=50;--num_dimensions=2
FINAL ARGN:

FINAL ARGV:
Multifield_Repartition;SOURCES;multifield_repartition.cpp;COMM;mpi;serial;STANDARD_PASS_OUTPUT;NUM_MPI_PROCS;4;FAIL_REGULAR_EXPRESSION;TEST
FAILED;PASS_REGULAR_EXPRESSION;TEST
PASSED;ARGS;--num_particles=50;--num_dimensions=2
FINAL ARGN:
SOURCES;multifield_repartition.cpp;COMM;mpi;serial;STANDARD_PASS_OUTPUT;NUM_MPI_PROCS;4;FAIL_REGULAR_EXPRESSION;TEST
FAILED;PASS_REGULAR_EXPRESSION;TEST
PASSED;ARGS;--num_particles=50;--num_dimensions=2

The formatting in an email is weird, but a diff on these outputs is empty
on the argv lines, the only difference is in the ARGN.

So I could use the answer to either of the following questions:

1) How  can the same ARGV to the same function give different ARGN's? My
feeling is that the answer is "never, it's something in how the MESSAGE
command displays lists."
2) How can we display lists in a way that allows us to see the differences
between them? That is, is there some function  which I can replace MESSAGE
with in order to see the discrepancy between these two lists?

More info available on request, I'm still new enough to CMake to not know
what to report, the CMake versions used are git head (
3609fceee75b4f3751a702ac0a7f21e5cbd67a0a ) and a release (2.8.12.2),
problem is identical in each case.

Best,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20141117/482c2b1a/attachment.html>


More information about the CMake mailing list