diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CPackComponent.cmake | 62 | ||||
-rw-r--r-- | Modules/ExternalProject.cmake | 129 |
2 files changed, 90 insertions, 101 deletions
diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake index a55a01e..aff8764 100644 --- a/Modules/CPackComponent.cmake +++ b/Modules/CPackComponent.cmake @@ -375,17 +375,17 @@ endmacro() # Macro that adds a component to the CPack installer macro(cpack_add_component compname) - string(TOUPPER ${compname} CPACK_ADDCOMP_UNAME) - cpack_parse_arguments(CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME} + string(TOUPPER ${compname} _CPACK_ADDCOMP_UNAME) + cpack_parse_arguments(CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME} "DISPLAY_NAME;DESCRIPTION;GROUP;DEPENDS;INSTALL_TYPES;ARCHIVE_FILE" "HIDDEN;REQUIRED;DISABLED;DOWNLOADED" ${ARGN} ) - if (CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED) - set(CPACK_ADDCOMP_STR "\n# Configuration for downloaded component \"${compname}\"\n") + if (CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_DOWNLOADED) + set(_CPACK_ADDCOMP_STR "\n# Configuration for downloaded component \"${compname}\"\n") else () - set(CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n") + set(_CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n") endif () if(NOT CPACK_MONOLITHIC_INSTALL) @@ -394,51 +394,51 @@ macro(cpack_add_component compname) # take care of any components that have been added after the CPack # moduled was included. if(NOT CPACK_COMPONENTS_ALL_SET_BY_USER) - get_cmake_property(CPACK_ADDCOMP_COMPONENTS COMPONENTS) - set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL") - foreach(COMP ${CPACK_ADDCOMP_COMPONENTS}) - set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}") + get_cmake_property(_CPACK_ADDCOMP_COMPONENTS COMPONENTS) + set(_CPACK_ADDCOMP_STR "${_CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL") + foreach(COMP ${_CPACK_ADDCOMP_COMPONENTS}) + set(_CPACK_ADDCOMP_STR "${_CPACK_ADDCOMP_STR} ${COMP}") endforeach() - set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n") + set(_CPACK_ADDCOMP_STR "${_CPACK_ADDCOMP_STR})\n") endif() endif() cpack_append_string_variable_set_command( - CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISPLAY_NAME - CPACK_ADDCOMP_STR) + CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_DISPLAY_NAME + _CPACK_ADDCOMP_STR) cpack_append_string_variable_set_command( - CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DESCRIPTION - CPACK_ADDCOMP_STR) + CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_DESCRIPTION + _CPACK_ADDCOMP_STR) cpack_append_variable_set_command( - CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_GROUP - CPACK_ADDCOMP_STR) + CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_GROUP + _CPACK_ADDCOMP_STR) cpack_append_variable_set_command( - CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DEPENDS - CPACK_ADDCOMP_STR) + CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_DEPENDS + _CPACK_ADDCOMP_STR) cpack_append_variable_set_command( - CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_INSTALL_TYPES - CPACK_ADDCOMP_STR) + CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_INSTALL_TYPES + _CPACK_ADDCOMP_STR) cpack_append_string_variable_set_command( - CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_ARCHIVE_FILE - CPACK_ADDCOMP_STR) + CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_ARCHIVE_FILE + _CPACK_ADDCOMP_STR) cpack_append_option_set_command( - CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_HIDDEN - CPACK_ADDCOMP_STR) + CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_HIDDEN + _CPACK_ADDCOMP_STR) cpack_append_option_set_command( - CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_REQUIRED - CPACK_ADDCOMP_STR) + CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_REQUIRED + _CPACK_ADDCOMP_STR) cpack_append_option_set_command( - CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISABLED - CPACK_ADDCOMP_STR) + CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_DISABLED + _CPACK_ADDCOMP_STR) cpack_append_option_set_command( - CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED - CPACK_ADDCOMP_STR) + CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_DOWNLOADED + _CPACK_ADDCOMP_STR) # Backward compatibility issue. # Write to config iff the macros is used after CPack.cmake has been # included, other it's not necessary because the variables # will be encoded by cpack_encode_variables. if(CPack_CMake_INCLUDED) - file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}") + file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${_CPACK_ADDCOMP_STR}") endif() endmacro() diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 84fa613..63f1180 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -4,11 +4,11 @@ # # Create custom targets to build projects in external trees # -# The 'ExternalProject_Add' function creates a custom target to drive +# The ``ExternalProject_Add`` function creates a custom target to drive # download, update/patch, configure, build, install and test steps of an # external project: # -# :: +# .. code-block:: cmake # # ExternalProject_Add(<name> # Name for custom target # [DEPENDS projects...] # Targets on which the project depends @@ -72,46 +72,42 @@ # ) # # The ``*_DIR`` options specify directories for the project, with default -# directories computed as follows. If the PREFIX option is given to -# ExternalProject_Add() or the EP_PREFIX directory property is set, then -# an external project is built and installed under the specified prefix: +# directories computed as follows. If the ``PREFIX`` option is given to +# ``ExternalProject_Add()`` or the ``EP_PREFIX`` directory property is set, +# then an external project is built and installed under the specified prefix:: # -# :: +# TMP_DIR = <prefix>/tmp +# STAMP_DIR = <prefix>/src/<name>-stamp +# DOWNLOAD_DIR = <prefix>/src +# SOURCE_DIR = <prefix>/src/<name> +# BINARY_DIR = <prefix>/src/<name>-build +# INSTALL_DIR = <prefix> # -# TMP_DIR = <prefix>/tmp -# STAMP_DIR = <prefix>/src/<name>-stamp -# DOWNLOAD_DIR = <prefix>/src -# SOURCE_DIR = <prefix>/src/<name> -# BINARY_DIR = <prefix>/src/<name>-build -# INSTALL_DIR = <prefix> +# Otherwise, if the ``EP_BASE`` directory property is set then components +# of an external project are stored under the specified base:: # -# Otherwise, if the EP_BASE directory property is set then components of -# an external project are stored under the specified base: +# TMP_DIR = <base>/tmp/<name> +# STAMP_DIR = <base>/Stamp/<name> +# DOWNLOAD_DIR = <base>/Download/<name> +# SOURCE_DIR = <base>/Source/<name> +# BINARY_DIR = <base>/Build/<name> +# INSTALL_DIR = <base>/Install/<name> # -# :: +# If no ``PREFIX``, ``EP_PREFIX``, or ``EP_BASE`` is specified then the +# default is to set ``PREFIX`` to ``<name>-prefix``. Relative paths are +# interpreted with respect to the build directory corresponding to the +# source directory in which ``ExternalProject_Add`` is invoked. # -# TMP_DIR = <base>/tmp/<name> -# STAMP_DIR = <base>/Stamp/<name> -# DOWNLOAD_DIR = <base>/Download/<name> -# SOURCE_DIR = <base>/Source/<name> -# BINARY_DIR = <base>/Build/<name> -# INSTALL_DIR = <base>/Install/<name> -# -# If no PREFIX, EP_PREFIX, or EP_BASE is specified then the default is -# to set PREFIX to "<name>-prefix". Relative paths are interpreted with -# respect to the build directory corresponding to the source directory -# in which ExternalProject_Add is invoked. -# -# If SOURCE_DIR is explicitly set to an existing directory the project +# If ``SOURCE_DIR`` is explicitly set to an existing directory the project # will be built from it. Otherwise a download step must be specified -# using one of the DOWNLOAD_COMMAND, CVS_*, SVN_*, or URL options. The -# URL option may refer locally to a directory or source tarball, or -# refer to a remote tarball (e.g. http://.../src.tgz). +# using one of the ``DOWNLOAD_COMMAND``, ``CVS_*``, ``SVN_*``, or ``URL`` +# options. The ``URL`` option may refer locally to a directory or source +# tarball, or refer to a remote tarball (e.g. ``http://.../src.tgz``). # -# The 'ExternalProject_Add_Step' function adds a custom step to an +# The ``ExternalProject_Add_Step`` function adds a custom step to an # external project: # -# :: +# .. code-block:: cmake # # ExternalProject_Add_Step(<name> <step> # Names of project and custom step # [COMMAND cmd...] # Command line invoked by this step @@ -125,51 +121,45 @@ # ) # # The command line, comment, and working directory of every standard and -# custom step is processed to replace tokens <SOURCE_DIR>, <BINARY_DIR>, -# <INSTALL_DIR>, and <TMP_DIR> with corresponding property values. +# custom step is processed to replace tokens ``<SOURCE_DIR>``, +# ``<BINARY_DIR>``, ``<INSTALL_DIR>``, and ``<TMP_DIR>`` with +# corresponding property values. # -# Any builtin step that specifies a "<step>_COMMAND cmd..." or custom -# step that specifies a "COMMAND cmd..." may specify additional command -# lines using the form "COMMAND cmd...". At build time the commands -# will be executed in order and aborted if any one fails. For example: +# Any builtin step that specifies a ``<step>_COMMAND cmd...`` or custom +# step that specifies a ``COMMAND cmd...`` may specify additional command +# lines using the form ``COMMAND cmd...``. At build time the commands +# will be executed in order and aborted if any one fails. For example:: # -# :: +# ... BUILD_COMMAND make COMMAND echo done ... # -# ... BUILD_COMMAND make COMMAND echo done ... -# -# specifies to run "make" and then "echo done" during the build step. +# specifies to run ``make`` and then ``echo done`` during the build step. # Whether the current working directory is preserved between commands is -# not defined. Behavior of shell operators like "&&" is not defined. -# -# The 'ExternalProject_Get_Property' function retrieves external project -# target properties: +# not defined. Behavior of shell operators like ``&&`` is not defined. # -# :: +# The ``ExternalProject_Get_Property`` function retrieves external project +# target properties:: # -# ExternalProject_Get_Property(<name> [prop1 [prop2 [...]]]) +# ExternalProject_Get_Property(<name> [prop1 [prop2 [...]]]) # # It stores property values in variables of the same name. Property # names correspond to the keyword argument names of -# 'ExternalProject_Add'. +# ``ExternalProject_Add``. # -# The 'ExternalProject_Add_StepTargets' function generates custom -# targets for the steps listed: +# The ``ExternalProject_Add_StepTargets`` function generates custom +# targets for the steps listed:: # -# :: +# ExternalProject_Add_StepTargets(<name> [step1 [step2 [...]]]) # -# ExternalProject_Add_StepTargets(<name> [step1 [step2 [...]]]) -# -# -# -# If STEP_TARGETS is set then ExternalProject_Add_StepTargets is +# If ``STEP_TARGETS`` is set then ``ExternalProject_Add_StepTargets`` is # automatically called at the end of matching calls to -# ExternalProject_Add_Step. Pass STEP_TARGETS explicitly to individual -# ExternalProject_Add calls, or implicitly to all ExternalProject_Add -# calls by setting the directory property EP_STEP_TARGETS. +# ``ExternalProject_Add_Step``. Pass ``STEP_TARGETS`` explicitly to +# individual ``ExternalProject_Add`` calls, or implicitly to all +# ``ExternalProject_Add`` calls by setting the directory property +# ``EP_STEP_TARGETS``. # -# If STEP_TARGETS is not set, clients may still manually call -# ExternalProject_Add_StepTargets after calling ExternalProject_Add or -# ExternalProject_Add_Step. +# If ``STEP_TARGETS`` is not set, clients may still manually call +# ``ExternalProject_Add_StepTargets`` after calling +# ``ExternalProject_Add`` or ``ExternalProject_Add_Step``. # # This functionality is provided to make it easy to drive the steps # independently of each other by specifying targets on build command @@ -181,15 +171,14 @@ # will also run to ensure everything is up to date. # # For example, to drive configure, build and test steps independently -# for each ExternalProject_Add call in your project, write the following -# line prior to any ExternalProject_Add calls in your CMakeLists file: -# -# :: +# for each ``ExternalProject_Add`` call in your project, write the following +# line prior to any ``ExternalProject_Add`` calls in your ``CMakeLists.txt`` +# file:: # -# set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) +# set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) #============================================================================= -# Copyright 2008-2012 Kitware, Inc. +# Copyright 2008-2013 Kitware, Inc. # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. |