[Cmake-commits] CMake branch, next, updated. v3.3.0-rc2-457-g1ad0a08

Brad King brad.king at kitware.com
Mon Jun 15 09:25:02 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  1ad0a084548422430887a0ee44ea456030401c32 (commit)
       via  90ad087ab9075cc9648df0623502da0caa44e971 (commit)
       via  7195ec92b2f34ef16ff1382fb00f527a3609f3bf (commit)
      from  a29387483823040d0d754d300333098c68e9f823 (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=1ad0a084548422430887a0ee44ea456030401c32
commit 1ad0a084548422430887a0ee44ea456030401c32
Merge: a293874 90ad087
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jun 15 09:25:01 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jun 15 09:25:01 2015 -0400

    Merge topic 'cmake--build-dir' into next
    
    90ad087a cmake: Fix --build <relative-dir> for VS generators (#15609)
    7195ec92 Tests: Extend RunCMake.CommandLine to cover --build with no arg


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=90ad087ab9075cc9648df0623502da0caa44e971
commit 90ad087ab9075cc9648df0623502da0caa44e971
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jun 11 15:01:12 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jun 11 16:04:21 2015 -0400

    cmake: Fix --build <relative-dir> for VS generators (#15609)
    
    The VS >= 10 generators need to parse the .sln file from the build
    directory to locate targets in subdirectories.  This occurs after we
    change the working directory to the build tree.  If a relative directory
    other than "." was given then we would change to it and also refer to
    the .sln file location with it.  Fix this by converting the build tree
    to a full path always.  This will also give a more informative error
    message when the directory does not exist.

diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index cc30732..c94ffec 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -420,7 +420,7 @@ static int do_build(int ac, char const* const* av)
       switch (doing)
         {
         case DoingDir:
-          dir = av[i];
+          dir = cmSystemTools::CollapseFullPath(av[i]);
           doing = DoingNone;
           break;
         case DoingTarget:
diff --git a/Tests/RunCMake/CommandLine/BuildDir.cmake b/Tests/RunCMake/CommandLine/BuildDir.cmake
new file mode 100644
index 0000000..30030a7
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/BuildDir.cmake
@@ -0,0 +1 @@
+add_subdirectory(BuildDir)
diff --git a/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt b/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt
new file mode 100644
index 0000000..20df108
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_custom_command(
+  OUTPUT output.txt
+  COMMAND ${CMAKE_COMMAND} -E echo CustomCommand > output.txt
+  )
+add_custom_target(CustomTarget ALL DEPENDS output.txt)
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 416b94e..84d4cc9 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -28,9 +28,24 @@ run_cmake_command(build-no-cache
   ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR})
 run_cmake_command(build-no-generator
   ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-no-generator)
+run_cmake_command(build-bad-dir
+  ${CMAKE_COMMAND} --build dir-does-not-exist)
 run_cmake_command(build-bad-generator
   ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-bad-generator)
 
+function(run_BuildDir)
+  # Use a single build tree for a few tests without cleaning.
+  set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/BuildDir-build)
+  set(RunCMake_TEST_NO_CLEAN 1)
+  file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+  file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+  run_cmake(BuildDir)
+  run_cmake_command(BuildDir--build ${CMAKE_COMMAND} -E chdir ..
+    ${CMAKE_COMMAND} --build BuildDir-build --target CustomTarget)
+endfunction()
+run_BuildDir()
+
 if(RunCMake_GENERATOR STREQUAL "Ninja")
   # Use a single build tree for a few tests without cleaning.
   set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Build-build)
diff --git a/Tests/RunCMake/CommandLine/build-bad-dir-result.txt b/Tests/RunCMake/CommandLine/build-bad-dir-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/build-bad-dir-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/build-bad-dir-stderr.txt b/Tests/RunCMake/CommandLine/build-bad-dir-stderr.txt
new file mode 100644
index 0000000..d3f3d9c
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/build-bad-dir-stderr.txt
@@ -0,0 +1,2 @@
+^Error: [^
+]+/Tests/RunCMake/CommandLine/build-bad-dir-build/dir-does-not-exist is not a directory$

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7195ec92b2f34ef16ff1382fb00f527a3609f3bf
commit 7195ec92b2f34ef16ff1382fb00f527a3609f3bf
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jun 11 15:40:24 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jun 11 15:58:52 2015 -0400

    Tests: Extend RunCMake.CommandLine to cover --build with no arg

diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 69beed9..416b94e 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -22,6 +22,8 @@ run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -G NoSuchGenerator)
 run_cmake_command(P_no-arg ${CMAKE_COMMAND} -P)
 run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake)
 
+run_cmake_command(build-no-dir
+  ${CMAKE_COMMAND} --build)
 run_cmake_command(build-no-cache
   ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR})
 run_cmake_command(build-no-generator
diff --git a/Tests/RunCMake/CommandLine/build-no-dir-result.txt b/Tests/RunCMake/CommandLine/build-no-dir-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/build-no-dir-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/build-no-dir-stderr.txt b/Tests/RunCMake/CommandLine/build-no-dir-stderr.txt
new file mode 100644
index 0000000..8d518f6
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/build-no-dir-stderr.txt
@@ -0,0 +1 @@
+^Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]

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

Summary of changes:
 Source/cmakemain.cxx                                  |    2 +-
 Tests/RunCMake/CommandLine/BuildDir.cmake             |    1 +
 .../{Build.cmake => BuildDir/CMakeLists.txt}          |    0
 Tests/RunCMake/CommandLine/RunCMakeTest.cmake         |   17 +++++++++++++++++
 .../build-bad-dir-result.txt}                         |    0
 Tests/RunCMake/CommandLine/build-bad-dir-stderr.txt   |    2 ++
 .../build-no-dir-result.txt}                          |    0
 Tests/RunCMake/CommandLine/build-no-dir-stderr.txt    |    1 +
 8 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 Tests/RunCMake/CommandLine/BuildDir.cmake
 copy Tests/RunCMake/CommandLine/{Build.cmake => BuildDir/CMakeLists.txt} (100%)
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/build-bad-dir-result.txt} (100%)
 create mode 100644 Tests/RunCMake/CommandLine/build-bad-dir-stderr.txt
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/build-no-dir-result.txt} (100%)
 create mode 100644 Tests/RunCMake/CommandLine/build-no-dir-stderr.txt


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list