[Cmake-commits] CMake branch, next, updated. v3.2.0-923-ga4f71ff
Brad King
brad.king at kitware.com
Mon Mar 9 10:07:11 EDT 2015
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 a4f71ff435624bbccb41f912a2d7470e3c35456d (commit)
via 86032ae0ebb7e86f3ff5617e080dd827dbbe98b0 (commit)
from 9eb5112f845b9634a40cbf541174a531f96e43da (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=a4f71ff435624bbccb41f912a2d7470e3c35456d
commit a4f71ff435624bbccb41f912a2d7470e3c35456d
Merge: 9eb5112 86032ae
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Mar 9 10:07:10 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Mar 9 10:07:10 2015 -0400
Merge topic 'ExternalProject-byproducts-tokens' into next
86032ae0 ExternalProject: Replace placeholder tokens in BYPRODUCTS
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=86032ae0ebb7e86f3ff5617e080dd827dbbe98b0
commit 86032ae0ebb7e86f3ff5617e080dd827dbbe98b0
Author: Gaëtan Lehmann <gaetan.lehmann at gmail.com>
AuthorDate: Fri Mar 6 11:43:16 2015 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Mar 9 10:04:44 2015 -0400
ExternalProject: Replace placeholder tokens in BYPRODUCTS
This allows the developer to specify the byproducts relative to the
binary directory without the need to set the binary directory location
explicitly.
diff --git a/Help/release/dev/ExternalProject-byproducts-tokens.rst b/Help/release/dev/ExternalProject-byproducts-tokens.rst
new file mode 100644
index 0000000..20b4dd4
--- /dev/null
+++ b/Help/release/dev/ExternalProject-byproducts-tokens.rst
@@ -0,0 +1,5 @@
+ExternalProject-byproducts-tokens
+---------------------------------
+
+* The :module:`ExternalProject` module learned to replace tokens
+ like ``<BINARY_DIR>`` in the ``BYPRODUCTS`` of each step.
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 1f9f4d3..d7b985d 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -251,8 +251,8 @@ Create custom targets to build projects in external trees
``LOG 1``
Wrap step in script to log output
- The command line, comment, and working directory of every standard and
- custom step is processed to replace tokens ``<SOURCE_DIR>``,
+ The command line, comment, working directory, and byproducts of every
+ standard and custom step are processed to replace tokens ``<SOURCE_DIR>``,
``<BINARY_DIR>``, ``<INSTALL_DIR>``, and ``<TMP_DIR>`` with
corresponding property values.
@@ -1443,7 +1443,7 @@ function(ExternalProject_Add_Step name step)
endif()
# Replace location tags.
- _ep_replace_location_tags(${name} comment command work_dir)
+ _ep_replace_location_tags(${name} comment command work_dir byproducts)
# Custom comment?
get_property(comment_set TARGET ${name} PROPERTY _EP_${step}_COMMENT SET)
diff --git a/Tests/CustomCommandByproducts/CMakeLists.txt b/Tests/CustomCommandByproducts/CMakeLists.txt
index 884f8c2..3289e8f 100644
--- a/Tests/CustomCommandByproducts/CMakeLists.txt
+++ b/Tests/CustomCommandByproducts/CMakeLists.txt
@@ -102,6 +102,27 @@ add_library(ExternalLibrary STATIC IMPORTED)
set_property(TARGET ExternalLibrary PROPERTY IMPORTED_LOCATION ${ExternalLibrary_LIBRARY})
add_dependencies(ExternalLibrary ExternalTarget)
+# Generate the library file of an imported target as a byproduct
+# of an external project. The byproduct uses <BINARY_DIR> that is substituted
+# by the real binary path
+if(CMAKE_CONFIGURATION_TYPES)
+ set(cfg /${CMAKE_CFG_INTDIR})
+else()
+ set(cfg)
+endif()
+include(ExternalProject)
+ExternalProject_Add(ExtTargetSubst
+ SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/External"
+ DOWNLOAD_COMMAND ""
+ INSTALL_COMMAND ""
+ BUILD_BYPRODUCTS "<BINARY_DIR>${cfg}/${CMAKE_STATIC_LIBRARY_PREFIX}ExternalLibrary${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ )
+ExternalProject_Get_Property(ExtTargetSubst binary_dir)
+add_library(ExternalLibraryWithSubstitution STATIC IMPORTED)
+set_property(TARGET ExternalLibraryWithSubstitution PROPERTY IMPORTED_LOCATION
+ ${binary_dir}${cfg}/${CMAKE_STATIC_LIBRARY_PREFIX}ExternalLibrary${CMAKE_STATIC_LIBRARY_SUFFIX})
+add_dependencies(ExternalLibraryWithSubstitution ExtTargetSubst)
+
# Add an executable consuming all the byproducts.
add_executable(CustomCommandByproducts
CustomCommandByproducts.c
-----------------------------------------------------------------------
Summary of changes:
.../dev/ExternalProject-byproducts-tokens.rst | 5 +++++
Modules/ExternalProject.cmake | 6 +++---
Tests/CustomCommandByproducts/CMakeLists.txt | 21 ++++++++++++++++++++
3 files changed, 29 insertions(+), 3 deletions(-)
create mode 100644 Help/release/dev/ExternalProject-byproducts-tokens.rst
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list