diff options
author | Brad King <brad.king@kitware.com> | 2015-08-04 20:45:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-08-04 20:45:43 (GMT) |
commit | c645590152be678a10dfae4bb9fde136a79a2c44 (patch) | |
tree | a35a673989a9b3fe97a01c0704ebbb91a334c3f0 | |
parent | bcba0d30992eb326f9c561b2fd86c784bf358302 (diff) | |
parent | c4d2f64f3c9dea3a5fcd8af5bb389db00ccd64df (diff) | |
download | CMake-c645590152be678a10dfae4bb9fde136a79a2c44.zip CMake-c645590152be678a10dfae4bb9fde136a79a2c44.tar.gz CMake-c645590152be678a10dfae4bb9fde136a79a2c44.tar.bz2 |
Merge branch 'fix-missing-subdir-error' into release
-rw-r--r-- | Source/cmMakefile.cxx | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/add_subdirectory/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/add_subdirectory/DoesNotExist-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt | 5 | ||||
-rw-r--r-- | Tests/RunCMake/add_subdirectory/DoesNotExist.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/add_subdirectory/Missing-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/add_subdirectory/Missing-stderr.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/add_subdirectory/Missing.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/add_subdirectory/Missing/Missing.txt | 0 | ||||
-rw-r--r-- | Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake | 4 |
11 files changed, 27 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ee6c1da..bdc55f2 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 81029cd..4e7c7b3 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 0000000..18dfd26 --- /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 0000000..d00491f --- /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 0000000..369a956 --- /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 0000000..fe2945c --- /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 0000000..d00491f --- /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 0000000..aba0675 --- /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 0000000..0e68927 --- /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 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/Missing/Missing.txt diff --git a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake new file mode 100644 index 0000000..a3ddec8 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake @@ -0,0 +1,4 @@ +include(RunCMake) + +run_cmake(DoesNotExist) +run_cmake(Missing) |