[Cmake-commits] CMake branch, next, updated. v3.2.2-2020-ge745990

Brad King brad.king at kitware.com
Tue Apr 21 11:01:54 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  e74599068473f2d7e7c1f7f244c386ef11d6ae4b (commit)
       via  b470d618644808d5d2db20e5bbc09a1d22bf486d (commit)
       via  0273ef146972e0fbfbf399e468ae9d5f2b4bb3d3 (commit)
       via  7bd8cfb813e9bd19cebda92b280beb2deaf052d4 (commit)
       via  1cf43dcf7c63a61e6254d102314b121623d2086d (commit)
      from  8e226f43e9ed08946401200ffd379e3426b5bbdc (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=e74599068473f2d7e7c1f7f244c386ef11d6ae4b
commit e74599068473f2d7e7c1f7f244c386ef11d6ae4b
Merge: 8e226f4 b470d61
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 21 11:01:52 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Apr 21 11:01:52 2015 -0400

    Merge topic 'ExternalProject-genex' into next
    
    b470d618 Help: Add notes for topic 'ExternalProject-genex'
    0273ef14 ExternalProject: Allow generator expressions with LOG_* options (#15287)
    7bd8cfb8 ExternalProject: Allow generator expressions in initial cache options
    1cf43dcf Tests: Add case to cover ExternalProject with subdirectories


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b470d618644808d5d2db20e5bbc09a1d22bf486d
commit b470d618644808d5d2db20e5bbc09a1d22bf486d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 21 10:13:46 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 21 10:51:08 2015 -0400

    Help: Add notes for topic 'ExternalProject-genex'

diff --git a/Help/release/dev/ExternalProject-genex.rst b/Help/release/dev/ExternalProject-genex.rst
new file mode 100644
index 0000000..2c7bf8a
--- /dev/null
+++ b/Help/release/dev/ExternalProject-genex.rst
@@ -0,0 +1,6 @@
+ExternalProject-genex
+---------------------
+
+* The :module:`ExternalProject` module APIs learned to support
+  :manual:`generator expressions <cmake-generator-expressions(7)>`
+  when using ``LOG_*`` options and in CMake initial cache options.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0273ef146972e0fbfbf399e468ae9d5f2b4bb3d3
commit 0273ef146972e0fbfbf399e468ae9d5f2b4bb3d3
Author:     Andrey Pokrovskiy <pokroa at amazon.com>
AuthorDate: Mon Apr 20 23:28:21 2015 -0700
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 21 10:51:08 2015 -0400

    ExternalProject: Allow generator expressions with LOG_* options (#15287)
    
    Use file(GENERATE) to write the logging wrapper scripts to evaluate
    generator expressions.  Use a per-config script names in case the
    content varies by configuration.

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index d916270..d9b6842 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -106,6 +106,8 @@ Create custom targets to build projects in external trees
     :manual:`CMake Options <cmake(1)>`. Arguments in the form
     ``-Dvar:string=on`` are always passed to the command line, and
     therefore cannot be changed by the user.
+    Arguments may use
+    :manual:`generator expressions <cmake-generator-expressions(7)>`.
   ``CMAKE_CACHE_ARGS <arg>...``
     Initial cache arguments, of the form ``-Dvar:string=on``.
     These arguments are written in a pre-load a script that populates
@@ -271,6 +273,9 @@ 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.
 
+Arguments to ``<step>_COMMAND`` or ``COMMAND`` options may use
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
 .. command:: ExternalProject_Get_Property
 
   The ``ExternalProject_Get_Property`` function retrieves external project
@@ -1303,14 +1308,14 @@ endif()
       endif()
     endforeach()
     set(code "${code}set(command \"${cmd}\")${code_execute_process}")
-    file(WRITE ${stamp_dir}/${name}-${step}-impl.cmake "${code}")
-    set(command ${CMAKE_COMMAND} "-Dmake=\${make}" "-Dconfig=\${config}" -P ${stamp_dir}/${name}-${step}-impl.cmake)
+    file(GENERATE OUTPUT "${stamp_dir}/${name}-${step}-$<CONFIG>-impl.cmake" CONTENT "${code}")
+    set(command ${CMAKE_COMMAND} "-Dmake=\${make}" "-Dconfig=\${config}" -P ${stamp_dir}/${name}-${step}-$<CONFIG>-impl.cmake)
   endif()
 
   # Wrap the command in a script to log output to files.
-  set(script ${stamp_dir}/${name}-${step}.cmake)
+  set(script ${stamp_dir}/${name}-${step}-$<CONFIG>.cmake)
   set(logbase ${stamp_dir}/${name}-${step})
-  file(WRITE ${script} "
+  set(code "
 ${code_cygpath_make}
 set(command \"${command}\")
 execute_process(
@@ -1331,6 +1336,7 @@ else()
   message(STATUS \"\${msg}\")
 endif()
 ")
+  file(GENERATE OUTPUT "${script}" CONTENT "${code}")
   set(command ${CMAKE_COMMAND} ${make} ${config} -P ${script})
   set(${cmd_var} "${command}" PARENT_SCOPE)
 endfunction()
diff --git a/Tests/ExternalProjectSubdir/CMakeLists.txt b/Tests/ExternalProjectSubdir/CMakeLists.txt
index fb5aa3c..013b418 100644
--- a/Tests/ExternalProjectSubdir/CMakeLists.txt
+++ b/Tests/ExternalProjectSubdir/CMakeLists.txt
@@ -6,7 +6,7 @@ ExternalProject_Add(Subdir1
   SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Subdir1
   BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Subdir1
 
-  CMAKE_ARGS -DNORMAL_VAR=NORMAL_VALUE
+  CMAKE_ARGS -DNORMAL_VAR=NORMAL_VALUE -DGENEX_VAR=$<1:GENEX_VALUE>
   LOG_CONFIGURE 1
 
   BUILD_COMMAND ""
diff --git a/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt b/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt
index 8b0653a..28107f0 100644
--- a/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt
+++ b/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt
@@ -4,3 +4,7 @@ project(Subdir1 NONE)
 if(NOT "${NORMAL_VAR}" STREQUAL "NORMAL_VALUE")
   message(SEND_ERROR "NORMAL_VAR != 'NORMAL_VALUE'")
 endif()
+
+if(NOT "${GENEX_VAR}" STREQUAL "GENEX_VALUE")
+  message(SEND_ERROR "GENEX_VAR != 'GENEX_VALUE'")
+endif()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7bd8cfb813e9bd19cebda92b280beb2deaf052d4
commit 7bd8cfb813e9bd19cebda92b280beb2deaf052d4
Author:     Andrey Pokrovskiy <pokroa at amazon.com>
AuthorDate: Thu Apr 16 21:42:19 2015 -0700
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 21 10:50:29 2015 -0400

    ExternalProject: Allow generator expressions in initial cache options
    
    Use file(GENERATE) to write the initial cache file so that we can
    evaluate generator expressions.  Use a per-config initial cache file
    name in case the content varies by configuration.

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 0c73d41..d916270 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -113,6 +113,8 @@ Create custom targets to build projects in external trees
     overcome command line length limits.
     These arguments are :command:`set` using the ``FORCE`` argument,
     and therefore cannot be changed by the user.
+    Arguments may use
+    :manual:`generator expressions <cmake-generator-expressions(7)>`.
   ``CMAKE_CACHE_DEFAULT_ARGS <arg>...``
     Initial default cache arguments, of the form ``-Dvar:string=on``.
     These arguments are written in a pre-load a script that populates
@@ -121,6 +123,8 @@ Create custom targets to build projects in external trees
     These arguments can be used as default value that will be set if no
     previous value is found in the cache, and that the user can change
     later.
+    Arguments may use
+    :manual:`generator expressions <cmake-generator-expressions(7)>`.
 
   Build step options are:
 
@@ -1126,10 +1130,7 @@ function(_ep_write_initial_cache target_name script_filename script_initial_cach
   # Replace location tags.
   _ep_replace_location_tags(${target_name} script_initial_cache)
   # Write out the initial cache file to the location specified.
-  if(NOT EXISTS "${script_filename}.in")
-    file(WRITE "${script_filename}.in" "\@script_initial_cache\@\n")
-  endif()
-  configure_file("${script_filename}.in" "${script_filename}")
+  file(GENERATE OUTPUT "${script_filename}" CONTENT "${script_initial_cache}")
 endfunction()
 
 
@@ -2054,7 +2055,7 @@ function(_ep_add_configure_command name)
     get_property(cmake_cache_default_args TARGET ${name} PROPERTY _EP_CMAKE_CACHE_DEFAULT_ARGS)
 
     if(cmake_cache_args OR cmake_cache_default_args)
-      set(_ep_cache_args_script "${tmp_dir}/${name}-cache.cmake")
+      set(_ep_cache_args_script "${tmp_dir}/${name}-cache-$<CONFIG>.cmake")
       if(cmake_cache_args)
         _ep_command_line_to_initial_cache(script_initial_cache_force "${cmake_cache_args}" 1)
       endif()
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake
index c1e4204..c350a63 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS-check.cmake
@@ -1,4 +1,4 @@
-set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache.cmake")
+set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache-Debug.cmake")
 
 if(NOT EXISTS "${_cache_file}")
   set(RunCMake_TEST_FAILED "Initial cache not created")
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake
index 5e37eec..62b1640 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_ARGS.cmake
@@ -1,5 +1,8 @@
+if(NOT CMAKE_CONFIGURATION_TYPES)
+  set(CMAKE_BUILD_TYPE Debug)
+endif()
 include(ExternalProject)
 
 ExternalProject_Add(FOO TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp"
                         DOWNLOAD_COMMAND ""
-                        CMAKE_CACHE_ARGS "-DFOO:STRING=BAR")
+                        CMAKE_CACHE_ARGS "-DFOO:STRING=$<1:BAR>$<0:BAD>")
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake
index ec1cafb..aeee11f 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS-check.cmake
@@ -1,4 +1,4 @@
-set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache.cmake")
+set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache-Debug.cmake")
 
 if(NOT EXISTS "${_cache_file}")
   set(RunCMake_TEST_FAILED "Initial cache not created")
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake
index 8e98470..3a83dbe 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake
@@ -1,5 +1,8 @@
+if(NOT CMAKE_CONFIGURATION_TYPES)
+  set(CMAKE_BUILD_TYPE Debug)
+endif()
 include(ExternalProject)
 
 ExternalProject_Add(FOO TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp"
                         DOWNLOAD_COMMAND ""
-                        CMAKE_CACHE_DEFAULT_ARGS "-DFOO:STRING=BAR")
+                        CMAKE_CACHE_DEFAULT_ARGS "-DFOO:STRING=$<1:BAR>$<0:BAD>")
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix-check.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix-check.cmake
index 2a07f27..04d49b9 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix-check.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix-check.cmake
@@ -1,4 +1,4 @@
-set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache.cmake")
+set(_cache_file "${RunCMake_TEST_BINARY_DIR}/tmp/FOO-cache-Debug.cmake")
 
 if(NOT EXISTS "${_cache_file}")
   set(RunCMake_TEST_FAILED "Initial cache not created")
diff --git a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix.cmake b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix.cmake
index e7f26ae..192776b 100644
--- a/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix.cmake
+++ b/Tests/RunCMake/ExternalProject/CMAKE_CACHE_mix.cmake
@@ -1,6 +1,9 @@
+if(NOT CMAKE_CONFIGURATION_TYPES)
+  set(CMAKE_BUILD_TYPE Debug)
+endif()
 include(ExternalProject)
 
 ExternalProject_Add(FOO TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp"
                         DOWNLOAD_COMMAND ""
-                        CMAKE_CACHE_ARGS "-DFOO:STRING=BAR"
-                        CMAKE_CACHE_DEFAULT_ARGS "-DBAR:STRING=BAZ")
+                        CMAKE_CACHE_ARGS "-DFOO:STRING=$<1:BAR>$<0:BAD>"
+                        CMAKE_CACHE_DEFAULT_ARGS "-DBAR:STRING=$<1:BAZ>$<0:BAD>")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1cf43dcf7c63a61e6254d102314b121623d2086d
commit 1cf43dcf7c63a61e6254d102314b121623d2086d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 21 10:38:17 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 21 10:40:52 2015 -0400

    Tests: Add case to cover ExternalProject with subdirectories
    
    Add an ExternalProjectSubdir test directory with a minimal test showing
    use of ExternalProject_Add for a source tree in a subdirectory.  This
    will allow us to easily add test external projects that cover specific
    behavior where the client project must check results.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 699b616..6abee25 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1326,6 +1326,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
   set_tests_properties(ExternalProject PROPERTIES
     TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
 
+  add_test(NAME ExternalProjectSubdir
+    COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+    --build-and-test
+    "${CMake_SOURCE_DIR}/Tests/ExternalProjectSubdir"
+    "${CMake_BINARY_DIR}/Tests/ExternalProjectSubdir"
+    ${build_generator_args}
+    --build-project ExternalProjectSubdir
+    --force-new-ctest-process
+    --build-options ${build_options}
+    )
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSubdir")
+
   add_test(ExternalProjectLocal ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/ExternalProjectLocal"
diff --git a/Tests/ExternalProjectSubdir/CMakeLists.txt b/Tests/ExternalProjectSubdir/CMakeLists.txt
new file mode 100644
index 0000000..fb5aa3c
--- /dev/null
+++ b/Tests/ExternalProjectSubdir/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.2)
+project(ExternalProjectSubdir NONE)
+include(ExternalProject)
+
+ExternalProject_Add(Subdir1
+  SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Subdir1
+  BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Subdir1
+
+  CMAKE_ARGS -DNORMAL_VAR=NORMAL_VALUE
+  LOG_CONFIGURE 1
+
+  BUILD_COMMAND ""
+  INSTALL_COMMAND ""
+  )
diff --git a/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt b/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt
new file mode 100644
index 0000000..8b0653a
--- /dev/null
+++ b/Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.2)
+project(Subdir1 NONE)
+
+if(NOT "${NORMAL_VAR}" STREQUAL "NORMAL_VALUE")
+  message(SEND_ERROR "NORMAL_VAR != 'NORMAL_VALUE'")
+endif()

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

Summary of changes:
 Help/release/dev/ExternalProject-genex.rst         |    6 +++++
 Modules/ExternalProject.cmake                      |   25 +++++++++++++-------
 Tests/CMakeLists.txt                               |   12 ++++++++++
 Tests/ExternalProjectSubdir/CMakeLists.txt         |   14 +++++++++++
 Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt |   10 ++++++++
 .../ExternalProject/CMAKE_CACHE_ARGS-check.cmake   |    2 +-
 .../ExternalProject/CMAKE_CACHE_ARGS.cmake         |    5 +++-
 .../CMAKE_CACHE_DEFAULT_ARGS-check.cmake           |    2 +-
 .../ExternalProject/CMAKE_CACHE_DEFAULT_ARGS.cmake |    5 +++-
 .../ExternalProject/CMAKE_CACHE_mix-check.cmake    |    2 +-
 .../RunCMake/ExternalProject/CMAKE_CACHE_mix.cmake |    7 ++++--
 11 files changed, 74 insertions(+), 16 deletions(-)
 create mode 100644 Help/release/dev/ExternalProject-genex.rst
 create mode 100644 Tests/ExternalProjectSubdir/CMakeLists.txt
 create mode 100644 Tests/ExternalProjectSubdir/Subdir1/CMakeLists.txt


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list