~chaffra/+junk/trilinos

« back to all changes in this revision

Viewing changes to cmake/utils/ParseVariableArguments.cmake

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Johannes Ring
  • Date: 2009-12-13 12:53:22 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091213125322-in0nrdjc55deqsw9
Tags: 10.0.3.dfsg-1
[Christophe Prud'homme]
* New upstream release

[Johannes Ring]
* debian/patches/libname.patch: Add prefix 'libtrilinos_' to all
  libraries. 
* debian/patches/soname.patch: Add soversion to libraries.
* debian/watch: Update download URL.
* debian/control:
  - Remove python-numeric from Build-Depends (virtual package).
  - Remove automake and autotools from Build-Depends and add cmake to
    reflect switch to CMake.
  - Add python-support to Build-Depends.
* debian/rules: 
  - Cleanup and updates for switch to CMake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
# Set PARSE_ARGUMENTS_DUMP_OUTPUT_ENABLED to TRUE to see output from parsing.
 
3
 
 
4
FUNCTION(PARSE_ARGUMENTS_DUMP_OUTPUT)
 
5
  IF (PARSE_ARGUMENTS_DUMP_OUTPUT_ENABLED)
 
6
    MESSAGE(${ARGN})
 
7
  ENDIF()
 
8
ENDFUNCTION()
 
9
 
 
10
#
 
11
# Parse a set of input arguments into different lists
 
12
#
 
13
 
 
14
MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
 
15
 
 
16
  PARSE_ARGUMENTS_DUMP_OUTPUT("PARSE_ARGUMENTS: prefix='${prefix}'")
 
17
  PARSE_ARGUMENTS_DUMP_OUTPUT("PARSE_ARGUMENTS: arg_names='${arg_names}'")
 
18
  PARSE_ARGUMENTS_DUMP_OUTPUT("PARSE_ARGUMENTS: option_names='${option_names}'")
 
19
  PARSE_ARGUMENTS_DUMP_OUTPUT("PARSE_ARGUMENTS: ARGN='${ARGN}'")
 
20
 
 
21
  SET(DEFAULT_ARGS)
 
22
  FOREACH(arg_name ${arg_names})    
 
23
    SET(${prefix}_${arg_name})
 
24
  ENDFOREACH(arg_name)
 
25
  FOREACH(option ${option_names})
 
26
    SET(${prefix}_${option} FALSE)
 
27
  ENDFOREACH(option)
 
28
 
 
29
  SET(current_arg_name DEFAULT_ARGS)
 
30
  SET(current_arg_list)
 
31
 
 
32
  FOREACH(arg ${ARGN})            
 
33
    SET(larg_names ${arg_names})    
 
34
    LIST(FIND larg_names "${arg}" is_arg_name)                   
 
35
    IF (is_arg_name GREATER -1)
 
36
      SET(${prefix}_${current_arg_name} "${current_arg_list}")
 
37
      PARSE_ARGUMENTS_DUMP_OUTPUT("PARSE_ARGUMENTS:"
 
38
        " ${prefix}_${current_arg_name} = '${${prefix}_${current_arg_name}}'" )
 
39
      SET(current_arg_name "${arg}")
 
40
      SET(current_arg_list)
 
41
    ELSE()
 
42
      SET(loption_names "${option_names}")
 
43
      LIST(FIND loption_names "${arg}" is_option)            
 
44
      IF (is_option GREATER -1)
 
45
        SET(${prefix}_${arg} TRUE)
 
46
        PARSE_ARGUMENTS_DUMP_OUTPUT( "PARSE_ARGUMENTS:"
 
47
          " ${prefix}_${arg} = '${${prefix}_${arg}}'" )
 
48
      ELSE()
 
49
        LIST(APPEND current_arg_list "${arg}")
 
50
      ENDIF()
 
51
    ENDIF()
 
52
  ENDFOREACH()
 
53
 
 
54
  SET(${prefix}_${current_arg_name} "${current_arg_list}")
 
55
 
 
56
ENDMACRO(PARSE_ARGUMENTS)