[Cmake-commits] CMake branch, next, updated. v3.0.0-4544-g309d1a6

Daniele E. Domenichelli daniele.domenichelli at gmail.com
Mon Jul 28 11:06:31 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  309d1a645e358d0b88414d6b95e0d13185d8c1f6 (commit)
       via  8bab4454afa9e364d1ff08501309b902e65d98f2 (commit)
       via  b01fdb58b36bcd6694cf6c5d02a3db70f3befc82 (commit)
       via  9528e6a6a17a43207fb22e051fa7df06a8844223 (commit)
       via  855e76e90d249664fafb66b9f0b2d37cfc508a40 (commit)
      from  dea3d880aff4e50131a1ebf3ad082a70826f1e0c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=309d1a645e358d0b88414d6b95e0d13185d8c1f6
commit 309d1a645e358d0b88414d6b95e0d13185d8c1f6
Merge: dea3d88 8bab445
Author:     Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
AuthorDate: Mon Jul 28 11:06:30 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jul 28 11:06:30 2014 -0400

    Merge topic 'CMakePackageConfigHelpers_build_tree' into next
    
    8bab4454 CMakePackageConfigHelpers: Add unit tests for BUILD_TREE option
    b01fdb58 CMakePackageConfigHelpers: Add BUILD_TREE option
    9528e6a6 CMakePackageConfigHelpers: restructure documentation and document commands
    855e76e9 CMakePackageConfigHelpers: Remove unused variable


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8bab4454afa9e364d1ff08501309b902e65d98f2
commit 8bab4454afa9e364d1ff08501309b902e65d98f2
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Tue Jul 15 19:51:16 2014 +0200
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Mon Jul 28 17:03:06 2014 +0200

    CMakePackageConfigHelpers: Add unit tests for BUILD_TREE option

diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index 092bf20..5a81b44 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -374,6 +374,7 @@ endif()
 
 include(CMakePackageConfigHelpers)
 
+# Generate a config file ready to be installed.
 set(INCLUDE_INSTALL_DIR include )
 set(SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/" )
 set(CURRENT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" )
@@ -407,6 +408,43 @@ if(Relocatable_FOUND)
   message(SEND_ERROR "Relocatable_FOUND set to TRUE !")
 endif()
 
+# Generate a config file for the build tree.
+set(INCLUDE_INSTALL_DIR include )
+set(SHARE_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/share/" )
+set(CURRENT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" )
+
+configure_package_config_file(RelocatableConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/RelocatableConfig.cmake"
+                              INSTALL_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}"
+                              PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR
+                              BUILD_TREE
+                             )
+
+set(Relocatable_FIND_COMPONENTS AComp BComp CComp)
+set(Relocatable_FIND_REQUIRED_BComp 1)
+include("${CMAKE_CURRENT_BINARY_DIR}/RelocatableConfig.cmake")
+
+if(NOT "${RELOC_INCLUDE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/include")
+  message(SEND_ERROR "RELOC_INCLUDE_DIR set by configure_package_config_file() is set to \"${RELOC_INCLUDE_DIR}\" (expected \"${CMAKE_CURRENT_BINARY_DIR}/include\")")
+endif()
+
+if(NOT "${RELOC_SHARE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/share/")
+  message(SEND_ERROR "RELOC_SHARE_DIR set by configure_package_config_file() is set to \"${RELOC_SHARE_DIR}\" (expected \"${CMAKE_CURRENT_BINARY_DIR}/share/\")")
+endif()
+
+if(NOT "${RELOC_BUILD_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
+  message(SEND_ERROR "RELOC_BUILD_DIR set by configure_package_config_file() is set to \"${RELOC_BUILD_DIR}\" (expected \"${CMAKE_CURRENT_BINARY_DIR}\")")
+endif()
+
+if(NOT DEFINED Relocatable_FOUND)
+  message(SEND_ERROR "Relocatable_FOUND not defined !")
+endif()
+
+if(Relocatable_FOUND)
+  message(SEND_ERROR "Relocatable_FOUND set to TRUE !")
+endif()
+
+
+
 #-----------------------------------------------------------------------------
 # Test write_basic_config_version_file().
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b01fdb58b36bcd6694cf6c5d02a3db70f3befc82
commit b01fdb58b36bcd6694cf6c5d02a3db70f3befc82
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Tue Jul 15 19:10:54 2014 +0200
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Mon Jul 28 17:03:06 2014 +0200

    CMakePackageConfigHelpers: Add BUILD_TREE option
    
    This option instructs configure_package_config_file to consider paths
    that are not absolute as relative to the CMAKE_BINARY_DIR directory
    instead of relative to the CMAKE_INSTALL_PREFIX` directory.
    
    The new signature is therefore:
    
      configure_package_config_file(<input> <output> INSTALL_DESTINATION <path>
                                                     [PATH_VARS <var1> <var2> ... <varN>]
                                                     [NO_SET_AND_CHECK_MACRO]
                                                     [NO_CHECK_REQUIRED_COMPONENTS_MACRO]
                                                     [BUILD_TREE])

diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake
index 712ced2..8ec9c69 100644
--- a/Modules/CMakePackageConfigHelpers.cmake
+++ b/Modules/CMakePackageConfigHelpers.cmake
@@ -18,7 +18,8 @@
 #     configure_package_config_file(<input> <output> INSTALL_DESTINATION <path>
 #                                                    [PATH_VARS <var1> <var2> ... <varN>]
 #                                                    [NO_SET_AND_CHECK_MACRO]
-#                                                    [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
+#                                                    [NO_CHECK_REQUIRED_COMPONENTS_MACRO]
+#                                                    [BUILD_TREE])
 #
 #
 # ``configure_package_config_file()`` should be used instead of the plain
@@ -77,6 +78,12 @@
 # only if the absolute location is a subdirectory of
 # :variable:`CMAKE_INSTALL_PREFIX`.
 #
+# When generating a FooConfig.cmake file to use your package from the build
+# tree the option ``BUILD_TREE`` should be passed, in order to consider
+# paths that are not absolute as relative to the
+# :cmake:variable:`CMAKE_BINARY_DIR` directory instead of relative to the
+# :cmake:variable:`CMAKE_INSTALL_PREFIX` directory.
+#
 # By default ``configure_package_config_file`` also generates two helper macros,
 # ``set_and_check()`` and ``check_required_components()`` into the
 # ``FooConfig.cmake`` file.
@@ -209,7 +216,7 @@ macro(WRITE_BASIC_PACKAGE_VERSION_FILE)
 endmacro()
 
 function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile)
-  set(options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO)
+  set(options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO BUILD_TREE)
   set(oneValueArgs INSTALL_DESTINATION )
   set(multiValueArgs PATH_VARS )
 
@@ -225,19 +232,31 @@ function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile)
 
   if(IS_ABSOLUTE "${CCF_INSTALL_DESTINATION}")
     set(absInstallDir "${CCF_INSTALL_DESTINATION}")
+  elseif(CCF_BUILD_TREE)
+    set(absInstallDir "${CMAKE_BINARY_DIR}/${CCF_INSTALL_DESTINATION}")
   else()
     set(absInstallDir "${CMAKE_INSTALL_PREFIX}/${CCF_INSTALL_DESTINATION}")
   endif()
 
-  file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${absInstallDir}" "${CMAKE_INSTALL_PREFIX}" )
+
+  if(CCF_BUILD_TREE)
+    file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${absInstallDir}" "${CMAKE_BINARY_DIR}" )
+  else()
+    file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${absInstallDir}" "${CMAKE_INSTALL_PREFIX}" )
+  endif()
 
   foreach(var ${CCF_PATH_VARS})
     if(NOT DEFINED ${var})
       message(FATAL_ERROR "Variable ${var} does not exist")
     else()
       if(IS_ABSOLUTE "${${var}}")
-        string(REPLACE "${CMAKE_INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}"
-                        PACKAGE_${var} "${${var}}")
+        if(CCF_BUILD_TREE)
+          string(REPLACE "${CMAKE_BINARY_DIR}" "\${PACKAGE_PREFIX_DIR}"
+                          PACKAGE_${var} "${${var}}")
+        else()
+          string(REPLACE "${CMAKE_INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}"
+                          PACKAGE_${var} "${${var}}")
+        endif()
       else()
         set(PACKAGE_${var} "\${PACKAGE_PREFIX_DIR}/${${var}}")
       endif()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9528e6a6a17a43207fb22e051fa7df06a8844223
commit 9528e6a6a17a43207fb22e051fa7df06a8844223
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Tue Jul 15 19:10:28 2014 +0200
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Mon Jul 28 17:03:06 2014 +0200

    CMakePackageConfigHelpers: restructure documentation and document commands

diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake
index 318382e..712ced2 100644
--- a/Modules/CMakePackageConfigHelpers.cmake
+++ b/Modules/CMakePackageConfigHelpers.cmake
@@ -2,29 +2,35 @@
 # CMakePackageConfigHelpers
 # -------------------------
 #
-# CONFIGURE_PACKAGE_CONFIG_FILE(), WRITE_BASIC_PACKAGE_VERSION_FILE()
+# Helpers functions for creating config files that can be included by other
+# projects to find and use a package.
 #
+# Adds the :command:`configure_package_config_file()` and
+# :command:`write_basic_package_version_file()` commands.
 #
+# Generating a Package Configuration File
+# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 #
-# ::
+# .. command:: configure_package_config_file
 #
-#     CONFIGURE_PACKAGE_CONFIG_FILE(<input> <output> INSTALL_DESTINATION <path>
+#  Create a config file for a project::
+#
+#     configure_package_config_file(<input> <output> INSTALL_DESTINATION <path>
 #                                                    [PATH_VARS <var1> <var2> ... <varN>]
 #                                                    [NO_SET_AND_CHECK_MACRO]
 #                                                    [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
 #
 #
+# ``configure_package_config_file()`` should be used instead of the plain
+# :command:`configure_file()` command when creating the ``<Name>Config.cmake``
+# or ``<Name>-config.cmake`` file for installing a project or library.  It helps
+# making the resulting package relocatable by avoiding hardcoded paths in the
+# installed ``Config.cmake`` file.
 #
-# CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain
-# configure_file() command when creating the <Name>Config.cmake or
-# <Name>-config.cmake file for installing a project or library.  It
-# helps making the resulting package relocatable by avoiding hardcoded
-# paths in the installed Config.cmake file.
-#
-# In a FooConfig.cmake file there may be code like this to make the
-# install destinations know to the using project:
+# In a ``FooConfig.cmake`` file there may be code like this to make the install
+# destinations know to the using project:
 #
-# ::
+# .. code-block:: cmake
 #
 #    set(FOO_INCLUDE_DIR   "@CMAKE_INSTALL_FULL_INCLUDEDIR@" )
 #    set(FOO_DATA_DIR   "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" )
@@ -32,121 +38,126 @@
 #    ...logic to determine installedPrefix from the own location...
 #    set(FOO_CONFIG_DIR  "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
 #
-# All 4 options shown above are not sufficient, since the first 3
-# hardcode the absolute directory locations, and the 4th case works only
-# if the logic to determine the installedPrefix is correct, and if
-# CONFIG_INSTALL_DIR contains a relative path, which in general cannot
-# be guaranteed.  This has the effect that the resulting FooConfig.cmake
-# file would work poorly under Windows and OSX, where users are used to
-# choose the install location of a binary package at install time,
-# independent from how CMAKE_INSTALL_PREFIX was set at build/cmake time.
-#
-# Using CONFIGURE_PACKAGE_CONFIG_FILE() helps.  If used correctly, it
-# makes the resulting FooConfig.cmake file relocatable.  Usage:
+# All 4 options shown above are not sufficient, since the first 3 hardcode the
+# absolute directory locations, and the 4th case works only if the logic to
+# determine the ``installedPrefix`` is correct, and if ``CONFIG_INSTALL_DIR``
+# contains a relative path, which in general cannot be guaranteed.  This has the
+# effect that the resulting ``FooConfig.cmake`` file would work poorly under
+# Windows and OSX, where users are used to choose the install location of a
+# binary package at install time, independent from how
+# :variable:`CMAKE_INSTALL_PREFIX` was set at build/cmake time.
 #
-# ::
+# Using ``configure_package_config_file`` helps.  If used correctly, it makes
+# the resulting ``FooConfig.cmake`` file relocatable.  Usage:
 #
-#    1. write a FooConfig.cmake.in file as you are used to
-#    2. insert a line containing only the string "@PACKAGE_INIT@"
-#    3. instead of set(FOO_DIR "@SOME_INSTALL_DIR@"), use set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
-#       (this must be after the @PACKAGE_INIT@ line)
-#    4. instead of using the normal configure_file(), use CONFIGURE_PACKAGE_CONFIG_FILE()
+#    1. write a ``FooConfig.cmake.in`` file as you are used to
+#    2. insert a line containing only the string ``@PACKAGE_INIT@``
+#    3. instead of ``set(FOO_DIR "@SOME_INSTALL_DIR@")``, use
+#       ``set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")`` (this must be after the
+#       ``@PACKAGE_INIT@`` line)
+#    4. instead of using the normal :command:`configure_file()`, use
+#       ``configure_package_config_file()``
 #
 #
 #
-# The <input> and <output> arguments are the input and output file, the
-# same way as in configure_file().
+# The ``<input>`` and ``<output>`` arguments are the input and output file, the
+# same way as in :command:`configure_file()`.
 #
-# The <path> given to INSTALL_DESTINATION must be the destination where
-# the FooConfig.cmake file will be installed to.  This can either be a
+# The ``<path>`` given to ``INSTALL_DESTINATION`` must be the destination where
+# the ``FooConfig.cmake`` file will be installed to.  This can either be a
 # relative or absolute path, both work.
 #
-# The variables <var1> to <varN> given as PATH_VARS are the variables
-# which contain install destinations.  For each of them the macro will
-# create a helper variable PACKAGE_<var...>.  These helper variables
-# must be used in the FooConfig.cmake.in file for setting the installed
-# location.  They are calculated by CONFIGURE_PACKAGE_CONFIG_FILE() so
-# that they are always relative to the installed location of the
-# package.  This works both for relative and also for absolute
-# locations.  For absolute locations it works only if the absolute
-# location is a subdirectory of CMAKE_INSTALL_PREFIX.
-#
-# By default configure_package_config_file() also generates two helper
-# macros, set_and_check() and check_required_components() into the
-# FooConfig.cmake file.
-#
-# set_and_check() should be used instead of the normal set() command for
-# setting directories and file locations.  Additionally to setting the
-# variable it also checks that the referenced file or directory actually
-# exists and fails with a FATAL_ERROR otherwise.  This makes sure that
-# the created FooConfig.cmake file does not contain wrong references.
-# When using the NO_SET_AND_CHECK_MACRO, this macro is not generated
-# into the FooConfig.cmake file.
-#
-# check_required_components(<package_name>) should be called at the end
-# of the FooConfig.cmake file if the package supports components.  This
-# macro checks whether all requested, non-optional components have been
-# found, and if this is not the case, sets the Foo_FOUND variable to
-# FALSE, so that the package is considered to be not found.  It does
-# that by testing the Foo_<Component>_FOUND variables for all requested
-# required components.  When using the NO_CHECK_REQUIRED_COMPONENTS
-# option, this macro is not generated into the FooConfig.cmake file.
+# The variables ``<var1>`` to ``<varN>`` given as ``PATH_VARS`` are the
+# variables which contain install destinations.  For each of them the macro will
+# create a helper variable ``PACKAGE_<var...>``.  These helper variables must be
+# used in the ``FooConfig.cmake.in`` file for setting the installed location.
+# They are calculated by ``configure_package_config_file`` so that they are
+# always relative to the installed location of the package.  This works both for
+# relative and also for absolute locations.  For absolute locations it works
+# only if the absolute location is a subdirectory of
+# :variable:`CMAKE_INSTALL_PREFIX`.
+#
+# By default ``configure_package_config_file`` also generates two helper macros,
+# ``set_and_check()`` and ``check_required_components()`` into the
+# ``FooConfig.cmake`` file.
+#
+# ``set_and_check()`` should be used instead of the normal ``set()`` command for
+# setting directories and file locations.  Additionally to setting the variable
+# it also checks that the referenced file or directory actually exists and failsù
+# with a ``FATAL_ERROR`` otherwise.  This makes sure that the created
+# ``FooConfig.cmake`` file does not contain wrong references.
+# When using the ``NO_SET_AND_CHECK_MACRO``, this macro is not generated
+# into the ``FooConfig.cmake`` file.
+#
+# ``check_required_components(<package_name>)`` should be called at the end of
+# the ``FooConfig.cmake`` file if the package supports components.  This macro
+# checks whether all requested, non-optional components have been found, and if
+# this is not the case, sets the ``Foo_FOUND`` variable to ``FALSE``, so that
+# the package is considered to be not found.  It does that by testing the
+# ``Foo_<Component>_FOUND`` variables for all requested required components.
+# When using the ``NO_CHECK_REQUIRED_COMPONENTS_MACRO`` option, this macro is
+# not generated into the ``FooConfig.cmake`` file.
 #
 # For an example see below the documentation for
-# WRITE_BASIC_PACKAGE_VERSION_FILE().
-#
-#
-#
-# ::
-#
-#   WRITE_BASIC_PACKAGE_VERSION_FILE( filename [VERSION major.minor.patch] COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) )
-#
-#
-#
-# Writes a file for use as <package>ConfigVersion.cmake file to
-# <filename>.  See the documentation of find_package() for details on
-# this.
-#
-# ::
-#
-#     filename is the output filename, it should be in the build tree.
-#     major.minor.patch is the version number of the project to be installed
-#
-# If no ``VERSION`` is given, the :variable:`PROJECT_VERSION` variable
-# is used.  If this hasn't been set, it errors out.
-#
-# The COMPATIBILITY mode AnyNewerVersion means that the installed
-# package version will be considered compatible if it is newer or
-# exactly the same as the requested version.  This mode should be used
-# for packages which are fully backward compatible, also across major
-# versions.  If SameMajorVersion is used instead, then the behaviour
-# differs from AnyNewerVersion in that the major version number must be
-# the same as requested, e.g.  version 2.0 will not be considered
-# compatible if 1.0 is requested.  This mode should be used for packages
-# which guarantee backward compatibility within the same major version.
-# If ExactVersion is used, then the package is only considered
-# compatible if the requested version matches exactly its own version
-# number (not considering the tweak version).  For example, version
-# 1.2.3 of a package is only considered compatible to requested version
-# 1.2.3.  This mode is for packages without compatibility guarantees.
-# If your project has more elaborated version matching rules, you will
-# need to write your own custom ConfigVersion.cmake file instead of
-# using this macro.
-#
-# Internally, this macro executes configure_file() to create the
-# resulting version file.  Depending on the COMPATIBLITY, either the
-# file BasicConfigVersion-SameMajorVersion.cmake.in or
-# BasicConfigVersion-AnyNewerVersion.cmake.in is used.  Please note that
+# :command:`write_basic_package_version_file()`.
+#
+# Generating a Package Version File
+# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+#
+# .. command:: write_basic_package_version_file
+#
+#  Create a version file for a project::
+#
+#     write_basic_package_version_file(<filename>
+#                                      [VERSION <major.minor.patch>]
+#                                      COMPATIBILITY <AnyNewerVersion|SameMajorVersion|ExactVersion> )
+#
+#
+# Writes a file for use as ``<package>ConfigVersion.cmake`` file to
+# ``<filename>``.  See the documentation of :command:`find_package()` for
+# details on this.
+#
+# ``<filename>`` is the output filename, it should be in the build tree.
+# ``<major.minor.patch>`` is the version number of the project to be installed.
+#
+# If no ``VERSION`` is given, the :variable:`PROJECT_VERSION` variable is used.
+# If this hasn't been set, it errors out.
+#
+# The ``COMPATIBILITY`` mode ``AnyNewerVersion`` means that the installed
+# package version will be considered compatible if it is newer or exactly the
+# same as the requested version.  This mode should be used for packages which
+# are fully backward compatible, also across major versions.
+# If ``SameMajorVersion`` is used instead, then the behaviour differs from
+# ``AnyNewerVersion`` in that the major version number must be the same as
+# requested, e.g.  version 2.0 will not be considered compatible if 1.0 is
+# requested.  This mode should be used for packages which guarantee backward
+# compatibility within the same major version.
+# If ``ExactVersion`` is used, then the package is only considered compatible if
+# the requested version matches exactly its own version number (not considering
+# the tweak version).  For example, version 1.2.3 of a package is only
+# considered compatible to requested version 1.2.3.  This mode is for packages
+# without compatibility guarantees.
+# If your project has more elaborated version matching rules, you will need to
+# write your own custom ``ConfigVersion.cmake`` file instead of using this
+# macro.
+#
+# Internally, this macro executes :command:`configure_file()` to create the
+# resulting version file.  Depending on the ``COMPATIBLITY``, either the file
+# ``BasicConfigVersion-SameMajorVersion.cmake.in`` or
+# ``BasicConfigVersion-AnyNewerVersion.cmake.in`` is used.  Please note that
 # these two files are internal to CMake and you should not call
-# configure_file() on them yourself, but they can be used as starting
-# point to create more sophisticted custom ConfigVersion.cmake files.
+# :command:`configure_file()` on them yourself, but they can be used as starting
+# point to create more sophisticted custom ``ConfigVersion.cmake`` files.
 #
+# Example Generating Package Files
+# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 #
+# Example using both :command:`configure_package_config_file` and
+# ``write_basic_package_version_file()``:
 #
-# Example using both configure_package_config_file() and
-# write_basic_package_version_file(): CMakeLists.txt:
+# ``CMakeLists.txt``:
 #
-# ::
+# .. code-block:: cmake
 #
 #    set(INCLUDE_INSTALL_DIR include/ ... CACHE )
 #    set(LIB_INSTALL_DIR lib/ ... CACHE )
@@ -162,11 +173,9 @@
 #    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
 #            DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
 #
+# ``FooConfig.cmake.in``:
 #
-#
-# With a FooConfig.cmake.in:
-#
-# ::
+# .. code-block:: cmake
 #
 #    set(FOO_VERSION x.y.z)
 #    ...
@@ -175,10 +184,6 @@
 #    set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
 #    set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
 #
-#
-#
-# ::
-#
 #    check_required_components(Foo)
 
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=855e76e90d249664fafb66b9f0b2d37cfc508a40
commit 855e76e90d249664fafb66b9f0b2d37cfc508a40
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Tue Jul 15 18:47:05 2014 +0200
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Mon Jul 28 17:03:06 2014 +0200

    CMakePackageConfigHelpers: Remove unused variable

diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake
index 473bbe5..318382e 100644
--- a/Modules/CMakePackageConfigHelpers.cmake
+++ b/Modules/CMakePackageConfigHelpers.cmake
@@ -203,8 +203,6 @@ macro(WRITE_BASIC_PACKAGE_VERSION_FILE)
   write_basic_config_version_file(${ARGN})
 endmacro()
 
-set(cfpch_dir ${CMAKE_CURRENT_LIST_DIR})
-
 function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile)
   set(options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO)
   set(oneValueArgs INSTALL_DESTINATION )

-----------------------------------------------------------------------

Summary of changes:
 Modules/CMakePackageConfigHelpers.cmake |  276 +++++++++++++++++--------------
 Tests/FindPackageTest/CMakeLists.txt    |   38 +++++
 2 files changed, 187 insertions(+), 127 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list