John,

The cmake_parse_arguments command takes 5 arguments, not 4. My guess is that 
you just need to get the arguments right and things should then work for you 
assuming the rest of your code is correct. If you look in 
CMakeParseArguments.cmake you should see the documentation for the command, but 
I can tell you that the command takes the following arguments:

cmake_parse_arguments(prefix options singleValueArgs multiValueArgs ${ARGN})

The prefix is what is added to the beginning of each variable that is set, the 
options is a list of parameters that do not have any arguments associated with 
them (i.e. REQUIRED, NO_DEFAULT_PATH, etc.), the singleValueArgs is a list of 
all parameters that have only one argument associated with them, the 
mutliValueArgs is a list of all parameters that have one or more arguments 
associated with them, and the last parameter should always be ${ARGN}.

Hope this helps...
Eric

From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of 
Biddiscombe, John A.
Sent: Friday, October 19, 2012 11:32 AM
To: cmake@cmake.org
Subject: [CMake] help with cmake_parse_arguments

I don't understand why this stripped down test gives the wrong results. Can 
anyone point out what I've done wrong. I'm using cmake 2.8.9

Thanks

JB

=== TEST cmake ===

include (CMakeParseArguments)

MACRO(ADD_TEXT_TEST)
  CMAKE_PARSE_ARGUMENTS(
    TEST ""
       "NAME;COMMAND;ARGSLIST;BASELINE"
       ${ARGN}
  )
  message("TEST_DEFAULT_ARGS is ${TEST_DEFAULT_ARGS} from ${ARGN}")
  message("TEST_NAME is ${TEST_NAME}")
  message("TEST_COMMAND is ${TEST_COMMAND}")
  message("TEST_ARGSLIST is ${TEST_ARGSLIST}")
  message("TEST_BASELINE is ${TEST_BASELINE}")
ENDMACRO(ADD_TEXT_TEST)

set (datafile "Test1.xxx")

  ADD_TEXT_TEST(
    NAME
      testiso_${datafile}
    COMMAND
      "RunMe"
    ARGSLIST
      3.5555 nodal "${EAVL_SOURCE_DIR}/data/${datafile}"
    BASELINE
      "${CMAKE_CURRENT_SOURCE_DIR}/baseline/testiso/${datafile}.out"
  )


=== output ===

Gives output as follows - the name is missing and the arglist is truncated ...

TEST_DEFAULT_ARGS is from 
NAME;testiso_Test1.xxx;COMMAND;RunMe;ARGSLIST;3.5555;nodal;D:/Code/EAVL/data/Test1.xxx;BASELINE;D:/Code/EAVL/test/baseline/testiso/Test1.xxx.out
TEST_NAME is
TEST_COMMAND is RunMe
TEST_ARGSLIST is 3.5555
TEST_BASELINE is D:/Code/EAVL/test/baseline/testiso/Test1.xxx.out



--
John Biddiscombe,                        email:biddisco @.at.@ cscs.ch
http://www.cscs.ch/
CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
Via Trevano 131, 6900 Lugano, Switzerland   | Fax:  +41 (91) 610.82.82

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to