summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/UseSWIG.cmake8
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmConfigureFileCommand.cxx7
-rw-r--r--Source/cmLocalGenerator.h2
-rw-r--r--Source/cmLocalNinjaGenerator.cxx3
-rw-r--r--Tests/CMakeTests/CMakeLists.txt1
-rw-r--r--Tests/CMakeTests/ConfigureFile-DirOutput.cmake5
-rw-r--r--Tests/CMakeTests/ConfigureFile-Relative.cmake4
-rw-r--r--Tests/CMakeTests/ConfigureFileTest.cmake.in28
-rw-r--r--Tests/RunCMake/configure_file/BadArg-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/BadArg-stderr.txt4
-rw-r--r--Tests/RunCMake/configure_file/BadArg.cmake (renamed from Tests/CMakeTests/ConfigureFile-BadArg.cmake)0
-rw-r--r--Tests/RunCMake/configure_file/DirInput-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/DirInput-stderr.txt8
-rw-r--r--Tests/RunCMake/configure_file/DirInput.cmake (renamed from Tests/CMakeTests/ConfigureFile-DirInput.cmake)0
-rw-r--r--Tests/RunCMake/configure_file/DirOutput-stderr.txt1
-rw-r--r--Tests/RunCMake/configure_file/DirOutput.cmake4
-rw-r--r--Tests/RunCMake/configure_file/DirOutput.txt1
-rw-r--r--Tests/RunCMake/configure_file/NewLineStyle-COPYONLY-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/NewLineStyle-COPYONLY-stderr.txt4
-rw-r--r--Tests/RunCMake/configure_file/NewLineStyle-COPYONLY.cmake (renamed from Tests/CMakeTests/ConfigureFile-NewLineStyle-COPYONLY.cmake)2
-rw-r--r--Tests/RunCMake/configure_file/NewLineStyle-NoArg-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/NewLineStyle-NoArg-stderr.txt5
-rw-r--r--Tests/RunCMake/configure_file/NewLineStyle-NoArg.cmake (renamed from Tests/CMakeTests/ConfigureFile-NewLineStyle-NoArg.cmake)2
-rw-r--r--Tests/RunCMake/configure_file/NewLineStyle-ValidArg.cmake (renamed from Tests/CMakeTests/ConfigureFile-NewLineStyle-ValidArg.cmake)2
-rw-r--r--Tests/RunCMake/configure_file/NewLineStyle-WrongArg-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/NewLineStyle-WrongArg-stderr.txt5
-rw-r--r--Tests/RunCMake/configure_file/NewLineStyle-WrongArg.cmake (renamed from Tests/CMakeTests/ConfigureFile-NewLineStyle-WrongArg.cmake)2
-rw-r--r--Tests/RunCMake/configure_file/Relative-In.txt1
-rw-r--r--Tests/RunCMake/configure_file/Relative-stderr.txt1
-rw-r--r--Tests/RunCMake/configure_file/Relative.cmake3
-rw-r--r--Tests/RunCMake/configure_file/RunCMakeTest.cmake8
32 files changed, 68 insertions, 50 deletions
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index bab1b21..7939b1f 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -76,16 +76,16 @@ macro(SWIG_MODULE_INITIALIZE name language)
if (";${CMAKE_SWIG_FLAGS};" MATCHES ";-noproxy;")
set (SWIG_MODULE_${name}_NOPROXY TRUE)
endif ()
- if("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "UNKNOWN")
+ if("x${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "xUNKNOWN")
message(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
- elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PYTHON" AND NOT SWIG_MODULE_${name}_NOPROXY)
+ elseif("x${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "xPYTHON" AND NOT SWIG_MODULE_${name}_NOPROXY)
# swig will produce a module.py containing an 'import _modulename' statement,
# which implies having a corresponding _modulename.so (*NIX), _modulename.pyd (Win32),
# unless the -noproxy flag is used
set(SWIG_MODULE_${name}_REAL_NAME "_${name}")
- elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PERL")
+ elseif("x${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "xPERL")
set(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")
- elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "CSHARP")
+ elseif("x${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "xCSHARP")
# This makes sure that the name used in the generated DllImport
# matches the library name created by CMake
set(SWIG_MODULE_${name}_EXTRA_FLAGS "-dllimport;${name}")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 038a09f..8fcdac9 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 2)
-set(CMake_VERSION_PATCH 20150309)
+set(CMake_VERSION_PATCH 20150310)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx
index fa7f486..6876388 100644
--- a/Source/cmConfigureFileCommand.cxx
+++ b/Source/cmConfigureFileCommand.cxx
@@ -100,6 +100,13 @@ bool cmConfigureFileCommand
{
/* Ignore legacy option. */
}
+ else if(args[i] == "NEWLINE_STYLE" ||
+ args[i] == "LF" || args[i] == "UNIX" ||
+ args[i] == "CRLF" || args[i] == "WIN32" ||
+ args[i] == "DOS")
+ {
+ /* Options handled by NewLineStyle member above. */
+ }
else
{
unknown_args += " ";
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 3a9d5be..d64ae0f 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -130,7 +130,7 @@ public:
std::string ConvertToOptionallyRelativeOutputPath(const std::string& remote);
///! set/get the parent generator
- cmLocalGenerator* GetParent(){return this->Parent;}
+ cmLocalGenerator* GetParent() const {return this->Parent;}
void SetParent(cmLocalGenerator* g) { this->Parent = g; g->AddChild(this); }
///! set/get the children
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 413dc0f..640c1b3 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -182,8 +182,7 @@ cmake* cmLocalNinjaGenerator::GetCMakeInstance()
bool cmLocalNinjaGenerator::isRootMakefile() const
{
- return (strcmp(this->Makefile->GetCurrentDirectory(),
- this->GetCMakeInstance()->GetHomeDirectory()) == 0);
+ return !this->GetParent();
}
void cmLocalNinjaGenerator::WriteBuildFileTop()
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt
index ce36830..d5524c3 100644
--- a/Tests/CMakeTests/CMakeLists.txt
+++ b/Tests/CMakeTests/CMakeLists.txt
@@ -19,7 +19,6 @@ AddCMakeTest(GetFilenameComponentRealpath "")
AddCMakeTest(Version "")
AddCMakeTest(Message "")
AddCMakeTest(File "")
-AddCMakeTest(ConfigureFile "")
AddCMakeTest(SeparateArguments "")
AddCMakeTest(ImplicitLinkInfo "")
AddCMakeTest(ModuleNotices "")
diff --git a/Tests/CMakeTests/ConfigureFile-DirOutput.cmake b/Tests/CMakeTests/ConfigureFile-DirOutput.cmake
deleted file mode 100644
index d682a2d..0000000
--- a/Tests/CMakeTests/ConfigureFile-DirOutput.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureFile-DirOutput.txt "DirOutput test file\n")
-file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ConfigureFile-DirOutput)
-configure_file(ConfigureFile-DirOutput.txt ConfigureFile-DirOutput)
-file(READ ${CMAKE_CURRENT_BINARY_DIR}/ConfigureFile-DirOutput/ConfigureFile-DirOutput.txt out)
-message("${out}")
diff --git a/Tests/CMakeTests/ConfigureFile-Relative.cmake b/Tests/CMakeTests/ConfigureFile-Relative.cmake
deleted file mode 100644
index 532580a..0000000
--- a/Tests/CMakeTests/ConfigureFile-Relative.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureFile-Relative-In.txt "Relative test file\n")
-configure_file(ConfigureFile-Relative-In.txt ConfigureFile-Relative-Out.txt)
-file(READ ${CMAKE_CURRENT_BINARY_DIR}/ConfigureFile-Relative-Out.txt out)
-message("${out}")
diff --git a/Tests/CMakeTests/ConfigureFileTest.cmake.in b/Tests/CMakeTests/ConfigureFileTest.cmake.in
deleted file mode 100644
index 6cc61d9..0000000
--- a/Tests/CMakeTests/ConfigureFileTest.cmake.in
+++ /dev/null
@@ -1,28 +0,0 @@
-set(DirInput-RESULT 1)
-set(DirInput-STDERR "is a directory")
-set(DirOutput-RESULT 0)
-set(DirOutput-STDERR "DirOutput test file")
-set(Relative-RESULT 0)
-set(Relative-STDERR "Relative test file")
-set(BadArg-RESULT 1)
-set(BadArg-STDERR "called with incorrect number of arguments")
-set(NewLineStyle-NoArg-RESULT 1)
-set(NewLineStyle-NoArg-STDERR "NEWLINE_STYLE must set a style:")
-set(NewLineStyle-WrongArg-RESULT 1)
-set(NewLineStyle-WrongArg-STDERR "NEWLINE_STYLE sets an unknown style")
-set(NewLineStyle-ValidArg-RESULT 0)
-set(NewLineStyle-ValidArg-STDERR )
-set(NewLineStyle-COPYONLY-RESULT 1)
-set(NewLineStyle-COPYONLY-STDERR "COPYONLY could not be used in combination")
-
-include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake")
-check_cmake_test(ConfigureFile
- DirInput
- DirOutput
- Relative
- BadArg
- NewLineStyle-NoArg
- NewLineStyle-WrongArg
- NewLineStyle-ValidArg
- NewLineStyle-COPYONLY
- )
diff --git a/Tests/RunCMake/configure_file/BadArg-result.txt b/Tests/RunCMake/configure_file/BadArg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/BadArg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/BadArg-stderr.txt b/Tests/RunCMake/configure_file/BadArg-stderr.txt
new file mode 100644
index 0000000..4567d3f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/BadArg-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at BadArg.cmake:[0-9]+ \(configure_file\):
+ configure_file called with incorrect number of arguments, expected 2
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/CMakeTests/ConfigureFile-BadArg.cmake b/Tests/RunCMake/configure_file/BadArg.cmake
index 769fae1..769fae1 100644
--- a/Tests/CMakeTests/ConfigureFile-BadArg.cmake
+++ b/Tests/RunCMake/configure_file/BadArg.cmake
diff --git a/Tests/RunCMake/configure_file/DirInput-result.txt b/Tests/RunCMake/configure_file/DirInput-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/DirInput-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/DirInput-stderr.txt b/Tests/RunCMake/configure_file/DirInput-stderr.txt
new file mode 100644
index 0000000..2e0cd14
--- /dev/null
+++ b/Tests/RunCMake/configure_file/DirInput-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at DirInput.cmake:[0-9]+ \(configure_file\):
+ configure_file input location
+
+ .*/Tests/RunCMake/configure_file/.
+
+ is a directory but a file was expected.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/CMakeTests/ConfigureFile-DirInput.cmake b/Tests/RunCMake/configure_file/DirInput.cmake
index 920ea28..920ea28 100644
--- a/Tests/CMakeTests/ConfigureFile-DirInput.cmake
+++ b/Tests/RunCMake/configure_file/DirInput.cmake
diff --git a/Tests/RunCMake/configure_file/DirOutput-stderr.txt b/Tests/RunCMake/configure_file/DirOutput-stderr.txt
new file mode 100644
index 0000000..d051f7c
--- /dev/null
+++ b/Tests/RunCMake/configure_file/DirOutput-stderr.txt
@@ -0,0 +1 @@
+^DirOutput test file$
diff --git a/Tests/RunCMake/configure_file/DirOutput.cmake b/Tests/RunCMake/configure_file/DirOutput.cmake
new file mode 100644
index 0000000..aa0fadf
--- /dev/null
+++ b/Tests/RunCMake/configure_file/DirOutput.cmake
@@ -0,0 +1,4 @@
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/DirOutput)
+configure_file(DirOutput.txt DirOutput)
+file(READ ${CMAKE_CURRENT_BINARY_DIR}/DirOutput/DirOutput.txt out)
+message("${out}")
diff --git a/Tests/RunCMake/configure_file/DirOutput.txt b/Tests/RunCMake/configure_file/DirOutput.txt
new file mode 100644
index 0000000..16388a6
--- /dev/null
+++ b/Tests/RunCMake/configure_file/DirOutput.txt
@@ -0,0 +1 @@
+DirOutput test file
diff --git a/Tests/RunCMake/configure_file/NewLineStyle-COPYONLY-result.txt b/Tests/RunCMake/configure_file/NewLineStyle-COPYONLY-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/NewLineStyle-COPYONLY-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/NewLineStyle-COPYONLY-stderr.txt b/Tests/RunCMake/configure_file/NewLineStyle-COPYONLY-stderr.txt
new file mode 100644
index 0000000..3f66909
--- /dev/null
+++ b/Tests/RunCMake/configure_file/NewLineStyle-COPYONLY-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NewLineStyle-COPYONLY.cmake:[0-9]+ \(configure_file\):
+ configure_file COPYONLY could not be used in combination with NEWLINE_STYLE
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/CMakeTests/ConfigureFile-NewLineStyle-COPYONLY.cmake b/Tests/RunCMake/configure_file/NewLineStyle-COPYONLY.cmake
index 3b09eb0..c07b8f5 100644
--- a/Tests/CMakeTests/ConfigureFile-NewLineStyle-COPYONLY.cmake
+++ b/Tests/RunCMake/configure_file/NewLineStyle-COPYONLY.cmake
@@ -1,3 +1,3 @@
-set(file_name ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureFile-NewLineStyle.txt)
+set(file_name ${CMAKE_CURRENT_BINARY_DIR}/NewLineStyle.txt)
file(WRITE ${file_name} "Data\n")
configure_file(${file_name} ${file_name}.out COPYONLY NEWLINE_STYLE DOS)
diff --git a/Tests/RunCMake/configure_file/NewLineStyle-NoArg-result.txt b/Tests/RunCMake/configure_file/NewLineStyle-NoArg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/NewLineStyle-NoArg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/NewLineStyle-NoArg-stderr.txt b/Tests/RunCMake/configure_file/NewLineStyle-NoArg-stderr.txt
new file mode 100644
index 0000000..3652657
--- /dev/null
+++ b/Tests/RunCMake/configure_file/NewLineStyle-NoArg-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at NewLineStyle-NoArg.cmake:[0-9]+ \(configure_file\):
+ configure_file NEWLINE_STYLE must set a style: LF, CRLF, UNIX, DOS, or
+ WIN32
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/CMakeTests/ConfigureFile-NewLineStyle-NoArg.cmake b/Tests/RunCMake/configure_file/NewLineStyle-NoArg.cmake
index 133a67a..b35bde1 100644
--- a/Tests/CMakeTests/ConfigureFile-NewLineStyle-NoArg.cmake
+++ b/Tests/RunCMake/configure_file/NewLineStyle-NoArg.cmake
@@ -1,3 +1,3 @@
-set(file_name ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureFile-NewLineStyle.txt)
+set(file_name ${CMAKE_CURRENT_BINARY_DIR}/NewLineStyle.txt)
file(WRITE ${file_name} "Data\n")
configure_file(${file_name} ${file_name}.out NEWLINE_STYLE)
diff --git a/Tests/CMakeTests/ConfigureFile-NewLineStyle-ValidArg.cmake b/Tests/RunCMake/configure_file/NewLineStyle-ValidArg.cmake
index b7e619c..8d9f474 100644
--- a/Tests/CMakeTests/ConfigureFile-NewLineStyle-ValidArg.cmake
+++ b/Tests/RunCMake/configure_file/NewLineStyle-ValidArg.cmake
@@ -1,4 +1,4 @@
-set(file_name ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureFile-NewLineStyle.txt)
+set(file_name ${CMAKE_CURRENT_BINARY_DIR}/NewLineStyle.txt)
function(test_eol style in out)
file(WRITE ${file_name} "${in}")
diff --git a/Tests/RunCMake/configure_file/NewLineStyle-WrongArg-result.txt b/Tests/RunCMake/configure_file/NewLineStyle-WrongArg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/NewLineStyle-WrongArg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/NewLineStyle-WrongArg-stderr.txt b/Tests/RunCMake/configure_file/NewLineStyle-WrongArg-stderr.txt
new file mode 100644
index 0000000..0d6855f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/NewLineStyle-WrongArg-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at NewLineStyle-WrongArg.cmake:[0-9]+ \(configure_file\):
+ configure_file NEWLINE_STYLE sets an unknown style, only LF, CRLF, UNIX,
+ DOS, and WIN32 are supported
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/CMakeTests/ConfigureFile-NewLineStyle-WrongArg.cmake b/Tests/RunCMake/configure_file/NewLineStyle-WrongArg.cmake
index e8887c1..3ae906d 100644
--- a/Tests/CMakeTests/ConfigureFile-NewLineStyle-WrongArg.cmake
+++ b/Tests/RunCMake/configure_file/NewLineStyle-WrongArg.cmake
@@ -1,3 +1,3 @@
-set(file_name ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureFile-NewLineStyle.txt)
+set(file_name ${CMAKE_CURRENT_BINARY_DIR}/NewLineStyle.txt)
file(WRITE ${file_name} "Data\n")
configure_file(${file_name} ${file_name}.out NEWLINE_STYLE FOO)
diff --git a/Tests/RunCMake/configure_file/Relative-In.txt b/Tests/RunCMake/configure_file/Relative-In.txt
new file mode 100644
index 0000000..572fe53
--- /dev/null
+++ b/Tests/RunCMake/configure_file/Relative-In.txt
@@ -0,0 +1 @@
+Relative test file
diff --git a/Tests/RunCMake/configure_file/Relative-stderr.txt b/Tests/RunCMake/configure_file/Relative-stderr.txt
new file mode 100644
index 0000000..b94de0d
--- /dev/null
+++ b/Tests/RunCMake/configure_file/Relative-stderr.txt
@@ -0,0 +1 @@
+^Relative test file$
diff --git a/Tests/RunCMake/configure_file/Relative.cmake b/Tests/RunCMake/configure_file/Relative.cmake
new file mode 100644
index 0000000..085991c
--- /dev/null
+++ b/Tests/RunCMake/configure_file/Relative.cmake
@@ -0,0 +1,3 @@
+configure_file(Relative-In.txt Relative-Out.txt)
+file(READ ${CMAKE_CURRENT_BINARY_DIR}/Relative-Out.txt out)
+message("${out}")
diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake
index 489652b..de14468 100644
--- a/Tests/RunCMake/configure_file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake
@@ -7,6 +7,14 @@ run_cmake(UTF16BE-BOM)
run_cmake(UTF32LE-BOM)
run_cmake(UTF32BE-BOM)
run_cmake(UnknownArg)
+run_cmake(DirInput)
+run_cmake(DirOutput)
+run_cmake(Relative)
+run_cmake(BadArg)
+run_cmake(NewLineStyle-NoArg)
+run_cmake(NewLineStyle-WrongArg)
+run_cmake(NewLineStyle-ValidArg)
+run_cmake(NewLineStyle-COPYONLY)
if(RunCMake_GENERATOR MATCHES "Make")
# Use a single build tree for a few tests without cleaning.