[cmake-developers] [CMake 0012650]: Support duplicate keyword value pairs in CMAKE_PARSE_ARGUMENTS

Mantis Bug Tracker mantis at public.kitware.com
Mon Jan 2 18:35:34 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12650 
====================================================================== 
Reported By:                Julien Finet
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12650
Category:                   Modules
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-01-02 18:35 EST
Last Modified:              2012-01-02 18:35 EST
====================================================================== 
Summary:                    Support duplicate keyword value pairs in
CMAKE_PARSE_ARGUMENTS
Description: 
Being able to specify multiple times the same variable (here TARGETS) could be
useful. I took the example from the doc:

  34 #   function(MY_INSTALL)
  35 #     set(options OPTIONAL FAST)
  36 #     set(oneValueArgs DESTINATION RENAME)
  37 #     set(multiValueArgs TARGETS CONFIGURATIONS)
  38 #     cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN} )
  39 #     ...
  41 # Assume my_install() has been called like this:
  42 #   my_install(TARGETS foo DESTINATION bin OPTIONAL TARGETS bar)
  43 #
  44 # After the cmake_parse_arguments() call the macro will have set the
following
  45 # variables:
  46 #   MY_INSTALL_OPTIONAL = TRUE
  47 #   MY_INSTALL_FAST = FALSE (this option was not used when calling
my_install()
  48 #   MY_INSTALL_DESTINATION = "bin"
  49 #   MY_INSTALL_RENAME = "" (was not used)
  50 #   MY_INSTALL_TARGETS = "foo;bar"
  51 #   MY_INSTALL_CONFIGURATIONS = "" (was not used)
  52 #   MY_INSTALL_UNPARSED_ARGUMENTS = ""


Additional Information: 
Doing so would allow nesting calls without parsing. Keeping the same example:

 function(MY_INSTALL_WITH_FRUIT_DEPENDENCY)
   my_install(TARGET banana apple ${ARGN} )
 end_function()

function(MY_INSTALL_WITH_PERSON_DEPENDENCY)
  my_install(TARGET john alice ${ARGN})
end_functions()

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-01-02 18:35 Julien Finet   New Issue                                    
======================================================================




More information about the cmake-developers mailing list