[Cmake-commits] CMake branch, next, updated. v2.8.12.2-1626-g854baa7
Brad King
brad.king at kitware.com
Fri Feb 21 11:06:09 EST 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 854baa7a5fa143e9a8ae80bc1dcf901ad006decd (commit)
via 73e5c6aead4d2c748ced061a7de27f2ffc7e2d31 (commit)
via c0bbefbfe7209e849c04f57e79908401ba825fe0 (commit)
from ab944c0a09a165758f224c58fc1f2e6c4724c139 (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=854baa7a5fa143e9a8ae80bc1dcf901ad006decd
commit 854baa7a5fa143e9a8ae80bc1dcf901ad006decd
Merge: ab944c0 73e5c6a
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Feb 21 11:06:08 2014 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Feb 21 11:06:08 2014 -0500
Merge topic 'ExternalProject-BUILD_ALWAYS' into next
73e5c6ae ExternalProject: Add option to always run the build step
c0bbefbf CMake Nightly Date Stamp
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=73e5c6aead4d2c748ced061a7de27f2ffc7e2d31
commit 73e5c6aead4d2c748ced061a7de27f2ffc7e2d31
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Feb 21 10:59:06 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Feb 21 11:05:41 2014 -0500
ExternalProject: Add option to always run the build step
Teach ExternalProject_Add a new BUILD_ALWAYS option to skip using
the build step stamp file and execute the step on every build.
Extend the BuildDepends test with a case to cover this option.
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 0df51a8..1e83163 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -54,6 +54,7 @@
# [BINARY_DIR dir] # Specify build dir location
# [BUILD_COMMAND cmd...] # Command to drive the native build
# [BUILD_IN_SOURCE 1] # Use source dir for build dir
+# [BUILD_ALWAYS 1] # No stamp file, build step always runs
# #--Install step---------------
# [INSTALL_DIR dir] # Installation prefix
# [INSTALL_COMMAND cmd...] # Command to drive install after build
@@ -1716,10 +1717,18 @@ function(_ep_add_build_command name)
set(log "")
endif()
+ get_property(build_always TARGET ${name} PROPERTY _EP_BUILD_ALWAYS)
+ if(build_always)
+ set(always 1)
+ else()
+ set(always 0)
+ endif()
+
ExternalProject_Add_Step(${name} build
COMMAND ${cmd}
WORKING_DIRECTORY ${binary_dir}
DEPENDEES configure
+ ALWAYS ${always}
${log}
)
endfunction()
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt
index 9727930..a875f07 100644
--- a/Tests/BuildDepends/CMakeLists.txt
+++ b/Tests/BuildDepends/CMakeLists.txt
@@ -68,6 +68,8 @@ file(WRITE ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_exe.h
"#define link_depends_no_shared_exe_value 0\n")
set(link_depends_no_shared_check_txt ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_check.txt)
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external original\n")
+
help_xcode_depends()
message("Building project first time")
@@ -166,6 +168,19 @@ else()
"Targets link_depends_no_shared_lib and link_depends_no_shared_exe not both built.")
endif()
+if(EXISTS ${BuildDepends_BINARY_DIR}/Project/external.out)
+ file(STRINGS ${BuildDepends_BINARY_DIR}/Project/external.out external_out)
+ if("${external_out}" STREQUAL "external original")
+ message(STATUS "external.out contains '${external_out}'")
+ else()
+ message(SEND_ERROR "Project did not initially build properly: "
+ "external.out contains '${external_out}'")
+ endif()
+else()
+ message(SEND_ERROR "Project did not initially build properly: "
+ "external.out is missing")
+endif()
+
message("Waiting 3 seconds...")
# any additional argument will cause ${bar} to wait forever
execute_process(COMMAND ${bar} -infinite TIMEOUT 3 OUTPUT_VARIABLE out)
@@ -191,6 +206,8 @@ if(TEST_LINK_DEPENDS)
file(WRITE ${TEST_LINK_DEPENDS} "2")
endif()
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external changed\n")
+
help_xcode_depends()
message("Building project second time")
@@ -294,3 +311,16 @@ else()
message(SEND_ERROR "Project did not rebuild properly. "
"Targets link_depends_no_shared_lib and link_depends_no_shared_exe not both built.")
endif()
+
+if(EXISTS ${BuildDepends_BINARY_DIR}/Project/external.out)
+ file(STRINGS ${BuildDepends_BINARY_DIR}/Project/external.out external_out)
+ if("${external_out}" STREQUAL "external changed")
+ message(STATUS "external.out contains '${external_out}'")
+ else()
+ message(SEND_ERROR "Project did not rebuild properly: "
+ "external.out contains '${external_out}'")
+ endif()
+else()
+ message(SEND_ERROR "Project did not rebuild properly: "
+ "external.out is missing")
+endif()
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index 8806ecd..9ee4a43 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -139,3 +139,15 @@ add_custom_target(header_tgt DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dir/header.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable(ninjadep ninjadep.cpp)
add_dependencies(ninjadep header_tgt)
+
+include(ExternalProject)
+ExternalProject_Add(ExternalBuild
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/External
+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/External
+ STAMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/External/Stamp
+ BUILD_ALWAYS 1
+ CMAKE_ARGS
+ -Dexternal_in=${CMAKE_CURRENT_BINARY_DIR}/external.in
+ -Dexternal_out=${CMAKE_CURRENT_BINARY_DIR}/external.out
+ INSTALL_COMMAND ""
+ )
diff --git a/Tests/BuildDepends/Project/External/CMakeLists.txt b/Tests/BuildDepends/Project/External/CMakeLists.txt
new file mode 100644
index 0000000..c6015b6
--- /dev/null
+++ b/Tests/BuildDepends/Project/External/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.0)
+project(BuildDependsExternal NONE)
+if(NOT DEFINED external_in)
+ message(FATAL_ERROR "Define external_in")
+endif()
+if(NOT DEFINED external_out)
+ message(FATAL_ERROR "Define external_out")
+endif()
+add_custom_command(
+ OUTPUT ${external_out}
+ COMMAND ${CMAKE_COMMAND} -E copy ${external_in} ${external_out}
+ DEPENDS ${external_in}
+ )
+add_custom_target(drive ALL DEPENDS ${external_out})
-----------------------------------------------------------------------
Summary of changes:
Modules/ExternalProject.cmake | 9 ++++++
Source/CMakeVersion.cmake | 2 +-
Tests/BuildDepends/CMakeLists.txt | 30 ++++++++++++++++++++
Tests/BuildDepends/Project/CMakeLists.txt | 12 ++++++++
Tests/BuildDepends/Project/External/CMakeLists.txt | 14 +++++++++
5 files changed, 66 insertions(+), 1 deletion(-)
create mode 100644 Tests/BuildDepends/Project/External/CMakeLists.txt
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list