[Cmake-commits] CMake branch, next, updated. v2.8.8-3431-gbf08255
Brad King
brad.king at kitware.com
Tue Jul 10 11:04:34 EDT 2012
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 bf08255e7c2217b14b5ec343fabbe0e741e7c9eb (commit)
via 1f87945433c323b5ee8feb932e7dee5e44c03d5a (commit)
from f11d76d6156c651c44066c2b276f5aad359d0ff2 (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=bf08255e7c2217b14b5ec343fabbe0e741e7c9eb
commit bf08255e7c2217b14b5ec343fabbe0e741e7c9eb
Merge: f11d76d 1f87945
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jul 10 11:04:32 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jul 10 11:04:32 2012 -0400
Merge topic 'include-command-empty-filename' into next
1f87945 include: Ignore empty string as file name (#13388)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f87945433c323b5ee8feb932e7dee5e44c03d5a
commit 1f87945433c323b5ee8feb932e7dee5e44c03d5a
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jul 10 10:55:02 2012 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jul 10 11:00:55 2012 -0400
include: Ignore empty string as file name (#13388)
Previously CMake silently accepted the empty string and added a bogus
dependency on the current directory. Instead warn about the empty file
name and ignore it. We cannot make this an error because there may be
existing projects that accidentally depend on the old behavior.
Add a RunCMake.include test to cover this case.
diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx
index 520f334..0d5f67b 100644
--- a/Source/cmIncludeCommand.cxx
+++ b/Source/cmIncludeCommand.cxx
@@ -31,14 +31,6 @@ bool cmIncludeCommand
{
if (args[i] == "OPTIONAL")
{
- if (fname.empty())
- {
- // do nothing when no file name is given
- // because of OPTIONAL don't handle it as error
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
- "In command 'include(<filename> OPTIONAL)' <filename> is empty.");
- return true;
- }
if (optional)
{
this->SetError("called with invalid arguments: OPTIONAL used twice");
@@ -78,11 +70,11 @@ bool cmIncludeCommand
}
}
- if (fname.empty())
+ if(fname.empty())
{
- this->SetError("called with empty file name.");
- cmSystemTools::SetFatalErrorOccured();
- return false;
+ this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
+ "include() given empty file name (ignored).");
+ return true;
}
if(!cmSystemTools::FileIsFullPath(fname.c_str()))
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 23fc086..eca96f9 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -50,6 +50,7 @@ add_RunCMake_test(ObjectLibrary)
add_RunCMake_test(build_command)
add_RunCMake_test(find_package)
+add_RunCMake_test(include)
add_RunCMake_test(list)
if("${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [^6]")
diff --git a/Tests/RunCMake/include/CMakeLists.txt b/Tests/RunCMake/include/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/include/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/include/EmptyString-stderr.txt b/Tests/RunCMake/include/EmptyString-stderr.txt
new file mode 100644
index 0000000..006c647
--- /dev/null
+++ b/Tests/RunCMake/include/EmptyString-stderr.txt
@@ -0,0 +1,5 @@
+CMake Warning \(dev\) at EmptyString.cmake:1 \(include\):
+ include\(\) given empty file name \(ignored\).
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/include/EmptyString.cmake b/Tests/RunCMake/include/EmptyString.cmake
new file mode 100644
index 0000000..4285cb3
--- /dev/null
+++ b/Tests/RunCMake/include/EmptyString.cmake
@@ -0,0 +1 @@
+include("")
diff --git a/Tests/RunCMake/include/EmptyStringOptional-stderr.txt b/Tests/RunCMake/include/EmptyStringOptional-stderr.txt
new file mode 100644
index 0000000..b61c679
--- /dev/null
+++ b/Tests/RunCMake/include/EmptyStringOptional-stderr.txt
@@ -0,0 +1,5 @@
+CMake Warning \(dev\) at EmptyStringOptional.cmake:1 \(include\):
+ include\(\) given empty file name \(ignored\).
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/include/EmptyStringOptional.cmake b/Tests/RunCMake/include/EmptyStringOptional.cmake
new file mode 100644
index 0000000..549d46b
--- /dev/null
+++ b/Tests/RunCMake/include/EmptyStringOptional.cmake
@@ -0,0 +1 @@
+include("" OPTIONAL)
diff --git a/Tests/RunCMake/include/RunCMakeTest.cmake b/Tests/RunCMake/include/RunCMakeTest.cmake
new file mode 100644
index 0000000..59b87ca
--- /dev/null
+++ b/Tests/RunCMake/include/RunCMakeTest.cmake
@@ -0,0 +1,4 @@
+include(RunCMake)
+
+run_cmake(EmptyString)
+run_cmake(EmptyStringOptional)
-----------------------------------------------------------------------
Summary of changes:
Source/cmIncludeCommand.cxx | 16 ++++------------
Tests/RunCMake/CMakeLists.txt | 1 +
.../RunCMake/{Languages => include}/CMakeLists.txt | 0
Tests/RunCMake/include/EmptyString-stderr.txt | 5 +++++
Tests/RunCMake/include/EmptyString.cmake | 1 +
.../include/EmptyStringOptional-stderr.txt | 5 +++++
Tests/RunCMake/include/EmptyStringOptional.cmake | 1 +
Tests/RunCMake/include/RunCMakeTest.cmake | 4 ++++
8 files changed, 21 insertions(+), 12 deletions(-)
copy Tests/RunCMake/{Languages => include}/CMakeLists.txt (100%)
create mode 100644 Tests/RunCMake/include/EmptyString-stderr.txt
create mode 100644 Tests/RunCMake/include/EmptyString.cmake
create mode 100644 Tests/RunCMake/include/EmptyStringOptional-stderr.txt
create mode 100644 Tests/RunCMake/include/EmptyStringOptional.cmake
create mode 100644 Tests/RunCMake/include/RunCMakeTest.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list