https://github.com/Kitware/CMake
Revision 12fed3edb107c949671043196fa94c542b45452a authored by Brad King on 01 June 2018, 13:52:13 UTC, committed by Brad King on 01 June 2018, 13:52:13 UTC
This is an empty commit that precedes an automatic application of
clang-format-6.0 to update the C++ style of our entire source tree.
This may be helpful to rebase a topic branch that was originally
based on a commit preceding the transition.  One may first rebase
the topic on this commit.  Then use one of the following approaches.

*   Rewrite the topic, including this commit, using `git filter-branch`
    `--tree-filter` with `clang-format.bash` to update the style in
    every commit.  Rebase the revised topic, excluding the rewrite of
    this commit, on the style transition commit.

OR

*   Add a `.git/info/grafts` entry to change the parent of the first
    commit in the topic from this commit to the style transition commit.
    Rewrite the topic using `git filter-branch --tree-filter` with
    `clang-format.bash` to update the style in every commit.  Then
    remove the graft, which was resolved by the filter.

See `git help filter-branch` and `git help repository-layout` for
details.
1 parent 523c443
Raw File
Tip revision: 12fed3edb107c949671043196fa94c542b45452a authored by Brad King on 01 June 2018, 13:52:13 UTC
Empty commit at end of history preceding clang-format-6.0 style transition
Tip revision: 12fed3e
CPackIFWConfigureFile.cmake
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

#.rst:
# CPackIFWConfigureFile
# ---------------------
#
# The module defines :command:`configure_file` similar command to
# configure file templates prepared in QtIFW/SDK/Creator style.
#
#
# Commands
# ^^^^^^^^
#
# The module defines the following commands:
#
# .. command:: cpack_ifw_configure_file
#
#   Copy a file to another location and modify its contents.
#
#   ::
#
#     cpack_ifw_configure_file(<input> <output>)
#
#   Copies an ``<input>`` file to an ``<output>`` file and substitutes variable
#   values referenced as ``%{VAR}`` or ``%VAR%`` in the input file content.
#   Each variable reference will be replaced with the current value of the
#   variable, or the empty string if the variable is not defined.
#

# NOTE: This file used to himself packaging via CPack IFW generator and
# should be compatible with minimal CMake version defined in
# ../CMakeLists.txt file.

if(NOT DEFINED CPackIFWConfigureFile_CMake_INCLUDED)
set(CPackIFWConfigureFile_CMake_INCLUDED 1)

macro(cpack_ifw_configure_file INPUT OUTPUT)
  file(READ "${INPUT}" _tmp)
  foreach(_tmp_regex "%{([^%}]+)}" "%([^%]+)%")
    string(REGEX MATCHALL "${_tmp_regex}" _tmp_vars "${_tmp}")
    while(_tmp_vars)
      foreach(_tmp_var ${_tmp_vars})
        string(REGEX REPLACE "${_tmp_regex}" "\\1"
          _tmp_var_name "${_tmp_var}")
        if(DEFINED ${_tmp_var_name})
          set(_tmp_var_value "${${_tmp_var_name}}")
        elseif(NOT "$ENV{${_tmp_var_name}}" STREQUAL "")
          set(_tmp_var_value "$ENV{${_tmp_var_name}}")
        else()
          set(_tmp_var_value "")
        endif()
        string(REPLACE "${_tmp_var}" "${_tmp_var_value}" _tmp "${_tmp}")
      endforeach()
      string(REGEX MATCHALL "${_tmp_regex}" _tmp_vars "${_tmp}")
    endwhile()
  endforeach()
  if(IS_ABSOLUTE "${OUTPUT}")
    file(WRITE "${OUTPUT}" "${_tmp}")
  else()
    file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT}" "${_tmp}")
  endif()
endmacro()

endif() # NOT DEFINED CPackIFWConfigureFile_CMake_INCLUDED
back to top