From 64821e8a40cf1add0cf3fd99b0860378754c64cf Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 24 Jul 2015 14:23:13 -0400 Subject: [PATCH 1/5] ctest: fix add_subdirectory() crash The directory is at args[0], not args[1]. Introduced in commit v2.6.0~489 (... 5889 ... tests are not found in some cases when using add_subdirectory ..., 2008-01-18). --- Source/CTest/cmCTestTestHandler.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 70b7f5cb5..2af09cbf9 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -176,7 +176,7 @@ bool cmCTestAddSubdirectoryCommand cmSystemTools::ChangeDirectory(cwd); std::string fname = cwd; fname += "/"; - fname += args[1]; + fname += args[0]; if ( !cmSystemTools::FileExists(fname.c_str()) ) { From f7a9ed7e90cd2661b279d0bcd44d43620b8eeda1 Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Fri, 31 Jul 2015 13:41:15 +0200 Subject: [PATCH 2/5] Xcode: Quote strings containing a tilde (#15672) Since commit v3.3.0-rc1~183^2 (Xcode: Refine quoting rules for Strings, 2015-04-09) we no longer quote strings containing a period ('.'). However, file names like "icon29x29~ipad.png" still need quoting because they contain a tilde ('~'). Add tilde to our explicit list of characters that need quoting because such file names will no longer happen to be quoted because they contain a period. --- Source/cmXCodeObject.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index e72d315a7..ba6e39517 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -243,7 +243,7 @@ void cmXCodeObject::PrintString(std::ostream& os,std::string String) bool needQuote = (String.empty() || String.find("//") != String.npos || - String.find_first_of(" <>+-*=@[](){},") != String.npos); + String.find_first_of(" <>+-*=@[](){},~") != String.npos); const char* quote = needQuote? "\"" : ""; // Print the string, quoted and escaped as necessary. From c4d2f64f3c9dea3a5fcd8af5bb389db00ccd64df Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 4 Aug 2015 16:39:31 -0400 Subject: [PATCH 3/5] add_subdirectory: Fix error message on missing CMakeLists.txt (#15680) Refactoring in commit v3.3.0-rc1~76^2 (cmMakefile: Handle CMP0014 before configuring the generator, 2015-05-14) accidentally left the file name "/CMakeLists.txt" in the error message. Remove it and add a test case. --- Source/cmMakefile.cxx | 4 ++-- Tests/RunCMake/CMakeLists.txt | 1 + Tests/RunCMake/add_subdirectory/CMakeLists.txt | 3 +++ Tests/RunCMake/add_subdirectory/DoesNotExist-result.txt | 1 + Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt | 5 +++++ Tests/RunCMake/add_subdirectory/DoesNotExist.cmake | 1 + Tests/RunCMake/add_subdirectory/Missing-result.txt | 1 + Tests/RunCMake/add_subdirectory/Missing-stderr.txt | 8 ++++++++ Tests/RunCMake/add_subdirectory/Missing.cmake | 1 + Tests/RunCMake/add_subdirectory/Missing/Missing.txt | 0 Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake | 4 ++++ 11 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 Tests/RunCMake/add_subdirectory/CMakeLists.txt create mode 100644 Tests/RunCMake/add_subdirectory/DoesNotExist-result.txt create mode 100644 Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt create mode 100644 Tests/RunCMake/add_subdirectory/DoesNotExist.cmake create mode 100644 Tests/RunCMake/add_subdirectory/Missing-result.txt create mode 100644 Tests/RunCMake/add_subdirectory/Missing-stderr.txt create mode 100644 Tests/RunCMake/add_subdirectory/Missing.cmake create mode 100644 Tests/RunCMake/add_subdirectory/Missing/Missing.txt create mode 100644 Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ee6c1daf2..bdc55f2b5 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1564,8 +1564,8 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2) cmSystemTools::Message(msg.c_str()); } - currentStart += "/CMakeLists.txt"; - if(!cmSystemTools::FileExists(currentStart.c_str(), true)) + std::string const currentStartFile = currentStart + "/CMakeLists.txt"; + if (!cmSystemTools::FileExists(currentStartFile, true)) { // The file is missing. Check policy CMP0014. std::ostringstream e; diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 81029cdcc..4e7c7b324 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -118,6 +118,7 @@ add_RunCMake_test(Syntax) add_RunCMake_test(add_custom_command) add_RunCMake_test(add_custom_target) add_RunCMake_test(add_dependencies) +add_RunCMake_test(add_subdirectory) add_RunCMake_test(build_command) add_RunCMake_test(execute_process) add_RunCMake_test(export) diff --git a/Tests/RunCMake/add_subdirectory/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMakeLists.txt new file mode 100644 index 000000000..18dfd2686 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.2) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/add_subdirectory/DoesNotExist-result.txt b/Tests/RunCMake/add_subdirectory/DoesNotExist-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/DoesNotExist-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt b/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt new file mode 100644 index 000000000..369a956e6 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at DoesNotExist.cmake:1 \(add_subdirectory\): + add_subdirectory given source "DoesNotExist" which is not an existing + directory. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/add_subdirectory/DoesNotExist.cmake b/Tests/RunCMake/add_subdirectory/DoesNotExist.cmake new file mode 100644 index 000000000..fe2945ce7 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/DoesNotExist.cmake @@ -0,0 +1 @@ +add_subdirectory(DoesNotExist) diff --git a/Tests/RunCMake/add_subdirectory/Missing-result.txt b/Tests/RunCMake/add_subdirectory/Missing-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/Missing-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/add_subdirectory/Missing-stderr.txt b/Tests/RunCMake/add_subdirectory/Missing-stderr.txt new file mode 100644 index 000000000..aba06755a --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/Missing-stderr.txt @@ -0,0 +1,8 @@ +^CMake Error at Missing.cmake:1 \(add_subdirectory\): + The source directory + + .*/Tests/RunCMake/add_subdirectory/Missing + + does not contain a CMakeLists.txt file. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/add_subdirectory/Missing.cmake b/Tests/RunCMake/add_subdirectory/Missing.cmake new file mode 100644 index 000000000..0e6892763 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/Missing.cmake @@ -0,0 +1 @@ +add_subdirectory(Missing) diff --git a/Tests/RunCMake/add_subdirectory/Missing/Missing.txt b/Tests/RunCMake/add_subdirectory/Missing/Missing.txt new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake new file mode 100644 index 000000000..a3ddec8ec --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake @@ -0,0 +1,4 @@ +include(RunCMake) + +run_cmake(DoesNotExist) +run_cmake(Missing) From f0609182cc2bbce7f6af557d6352e0c434e7acc2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 5 Aug 2015 10:39:03 -0400 Subject: [PATCH 4/5] Fortran: Store detected compiler version persistently (#15684) The Fortran compiler version detection infrastructure added by commit v3.3.0-rc1~436^2~9 (Fortran: Add infrastructure to detect compiler version, 2015-02-17) forgot to update CMakeFortranCompiler.cmake.in to save the compiler version persistently as we do already in "CMake{C,CXX}Compiler.cmake.in". Add the missing line now. --- Modules/CMakeFortranCompiler.cmake.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in index e4c76180a..14fdd60d9 100644 --- a/Modules/CMakeFortranCompiler.cmake.in +++ b/Modules/CMakeFortranCompiler.cmake.in @@ -1,6 +1,7 @@ set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@") set(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@") set(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@") +set(CMAKE_Fortran_COMPILER_VERSION "@CMAKE_Fortran_COMPILER_VERSION@") set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@") set(CMAKE_Fortran_SIMULATE_ID "@CMAKE_Fortran_SIMULATE_ID@") set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@") From 4a6fe0290880bd56dd5141f06c9fa2b9e310162e Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 13 Aug 2015 09:17:06 -0400 Subject: [PATCH 5/5] CMake 3.3.1 --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 508efbc00..e1bffac2f 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 3) -set(CMake_VERSION_PATCH 0) +set(CMake_VERSION_PATCH 1) #set(CMake_VERSION_RC 0)