Permalink
Switch branches/tags
OpenSceneGraph_1_2_release_revision_2 OpenSceneGraph_1_2_release_revision_1 OpenSceneGraph_1_1_release_revision_1 OpenSceneGraph_1_0_0_release_revision_1 OpenSceneGraph_0_9_9_release_revision_1 OpenSceneGraph_0_9_8_release_revision_2 OpenSceneGraph_0_9_8_release_revision_1 OpenSceneGraph_0_9_7_release_revision_2 OpenSceneGraph_0_9_7_release_revision_1 OpenSceneGraph-3.5.7 OpenSceneGraph-3.5.6 OpenSceneGraph-3.5.5 OpenSceneGraph-3.5.4 OpenSceneGraph-3.5.3 OpenSceneGraph-3.5.2 OpenSceneGraph-3.5.1 OpenSceneGraph-3.5.0 OpenSceneGraph-3.4.1 OpenSceneGraph-3.4.1-rc3 OpenSceneGraph-3.4.1-rc2 OpenSceneGraph-3.4.1-rc1 OpenSceneGraph-3.4.0 OpenSceneGraph-3.4.0-rc11 OpenSceneGraph-3.4.0-rc10 OpenSceneGraph-3.4.0-rc9 OpenSceneGraph-3.4.0-rc8 OpenSceneGraph-3.4.0-rc7 OpenSceneGraph-3.4.0-rc6 OpenSceneGraph-3.4.0-rc5 OpenSceneGraph-3.4.0-rc4 OpenSceneGraph-3.4.0-rc3 OpenSceneGraph-3.4.0-rc2 OpenSceneGraph-3.4.0-rc1 OpenSceneGraph-3.3.9 OpenSceneGraph-3.3.8 OpenSceneGraph-3.3.7 OpenSceneGraph-3.3.6 OpenSceneGraph-3.3.5 OpenSceneGraph-3.3.4 OpenSceneGraph-3.3.3 OpenSceneGraph-3.3.2 OpenSceneGraph-3.3.1 OpenSceneGraph-3.3.0 OpenSceneGraph-3.2.2 OpenSceneGraph-3.2.2-rc3 OpenSceneGraph-3.2.2-rc2 OpenSceneGraph-3.2.2-rc1 OpenSceneGraph-3.2.1 OpenSceneGraph-3.2.1-rc7 OpenSceneGraph-3.2.1-rc6 OpenSceneGraph-3.2.1-rc5 OpenSceneGraph-3.2.1-rc4 OpenSceneGraph-3.2.1-rc3 OpenSceneGraph-3.2.1-rc2 OpenSceneGraph-3.2.1-rc1 OpenSceneGraph-3.2.0 OpenSceneGraph-3.2.0-rc4 OpenSceneGraph-3.2.0-rc3 OpenSceneGraph-3.2.0-rc2 OpenSceneGraph-3.2.0-rc1 OpenSceneGraph-3.1.10 OpenSceneGraph-3.1.9 OpenSceneGraph-3.1.8 OpenSceneGraph-3.1.7 OpenSceneGraph-3.1.6 OpenSceneGraph-3.1.5 OpenSceneGraph-3.1.4 OpenSceneGraph-3.1.2 OpenSceneGraph-3.1.1 OpenSceneGraph-3.1.0 OpenSceneGraph-3.0.1 OpenSceneGraph-3.0.1-rc3 OpenSceneGraph-3.0.1-rc2 OpenSceneGraph-3.0.1-rc1 OpenSceneGraph-3.0.0 OpenSceneGraph-3.0.0-rc7 OpenSceneGraph-3.0.0-rc6 OpenSceneGraph-3.0.0-rc5 OpenSceneGraph-3.0.0-rc4 OpenSceneGraph-3.0.0-rc3 OpenSceneGraph-3.0.0-rc2 OpenSceneGraph-3.0.0-rc1 OpenSceneGraph-2.9.16 OpenSceneGraph-2.9.15 OpenSceneGraph-2.9.14 OpenSceneGraph-2.9.13 OpenSceneGraph-2.9.12 OpenSceneGraph-2.9.11 OpenSceneGraph-2.9.10 OpenSceneGraph-2.9.9 OpenSceneGraph-2.9.8 OpenSceneGraph-2.9.7 OpenSceneGraph-2.9.6 OpenSceneGraph-2.9.5 OpenSceneGraph-2.9.4 OpenSceneGraph-2.9.3 OpenSceneGraph-2.9.2 OpenSceneGraph-2.9.1 OpenSceneGraph-2.9.0 OpenSceneGraph-2.8.5
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
112 lines (96 sloc) 3.18 KB
#miscellaneous macros
################### macros from http://www.cmake.org/Wiki/CMakeMacroListOperations
MACRO(CAR var)
SET(${var} ${ARGV1})
ENDMACRO(CAR)
MACRO(CDR var junk)
SET(${var} ${ARGN})
ENDMACRO(CDR)
MACRO(LIST_INDEX var index)
SET(list . ${ARGN})
FOREACH(i RANGE 1 ${index})
CDR(list ${list})
ENDFOREACH(i)
CAR(${var} ${list})
ENDMACRO(LIST_INDEX)
######### LIST_CONTAINS usage
#SET(MYLIST hello world foo bar)
#LIST_CONTAINS(contains foo ${MYLIST})
#IF (contains)
# MESSAGE("MYLIST contains foo")
#ENDIF (contains)
#LIST_CONTAINS(contains baz ${MYLIST})
#IF (NOT contains)
# MESSAGE("MYLIST does not contain baz")
#ENDIF (NOT contains)
MACRO(LIST_CONTAINS var value)
SET(${var})
FOREACH (value2 ${ARGN})
IF (${value} STREQUAL ${value2})
SET(${var} TRUE)
ENDIF (${value} STREQUAL ${value2})
ENDFOREACH (value2)
ENDMACRO(LIST_CONTAINS)
############################################################
################### macros from http://www.cmake.org/Wiki/CMakeMacroParseArguments
MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
#MESSAGE("!!!! ${prefix} args-->${arg_names}<-- opt-->${option_names}<--")
SET(DEFAULT_ARGS)
FOREACH(arg_name ${arg_names})
SET(${prefix}_${arg_name})
ENDFOREACH(arg_name)
FOREACH(option ${option_names})
SET(${prefix}_${option} FALSE)
ENDFOREACH(option)
SET(current_arg_name DEFAULT_ARGS)
SET(current_arg_list)
FOREACH(arg ${ARGN})
#debug#MESSAGE("---->${arg}<------")
LIST_CONTAINS(is_arg_name ${arg} ${arg_names})
IF (is_arg_name)
SET(${prefix}_${current_arg_name} ${current_arg_list})
SET(current_arg_name ${arg})
SET(current_arg_list)
ELSE (is_arg_name)
LIST_CONTAINS(is_option ${arg} ${option_names})
IF (is_option)
SET(${prefix}_${arg} TRUE)
ELSE (is_option)
SET(current_arg_list ${current_arg_list} ${arg})
ENDIF (is_option)
ENDIF (is_arg_name)
ENDFOREACH(arg)
SET(${prefix}_${current_arg_name} ${current_arg_list})
ENDMACRO(PARSE_ARGUMENTS)
#############################################################
#MACRO(SHOW_USAGE_OF_PARSE_ARGUMENTS)
# PARSE_ARGUMENTS(PLUGIN
# "EXPORTS;AUTOLOAD_SCRIPTS;LINK_LIBRARIES;DEPENDS"
# "AUTO_INSTALL;NO_MODULE"
# ${ARGN}
# )
# CAR(PLUGIN_NAME ${PLUGIN_DEFAULT_ARGS})
# CDR(PLUGIN_SOURCES ${PLUGIN_DEFAULT_ARGS})
#
# MESSAGE("*** Arguments for ${PLUGIN_NAME}")
# MESSAGE("Sources: ${PLUGIN_SOURCES}")
# MESSAGE("Exports: ${PLUGIN_EXPORTS}")
# MESSAGE("Autoload scripts: ${PLUGIN_AUTOLOAD_SCRIPTS}")
# MESSAGE("Link libraries: ${PLUGIN_LINK_LIBRARIES}")
# MESSAGE("Depends: ${PLUGIN_DEPENDS}")
# IF (PLUGIN_AUTO_INSTALL)
# MESSAGE("Auto install")
# ENDIF (PLUGIN_AUTO_INSTALL)
# IF (PLUGIN_NO_MODULE)
# MESSAGE("No module")
# ENDIF (PLUGIN_NO_MODULE)
#ENDMACRO(SHOW_USAGE_OF_PARSE_ARGUMENTS)
#examples
#SHOW_USAGE_OF_PARSE_ARGUMENTS(MyAppCore NO_MODULE CoreSource1.cxx CoreSource2.cxx EXPORTS RequiredObject1 RequredObject2 AUTOLOAD_SCRIPTS startup.py initialize.py)
#SHOW_USAGE_OF_PARSE_ARGUMENTS(MyAppDefaultComponents
# Component1.cxx Component2.cxx
# EXPORTS Component1 Component2
# DEPENDS MyAppCore
# AUTO_INSTALL
# )
########################################################