diff options
author | Brad King <brad.king@kitware.com> | 2019-11-05 19:20:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-11-05 19:29:41 (GMT) |
commit | 0ce8a5c08de0852f22f9be595c6f08a4a6c865e9 (patch) | |
tree | d68254fe6b9eae188dcc336bafd0ca9d521204ba /Tests/RunCMake | |
parent | 9457c95aa033aa192b0fbe2796e3a660a660d0ad (diff) | |
download | CMake-0ce8a5c08de0852f22f9be595c6f08a4a6c865e9.zip CMake-0ce8a5c08de0852f22f9be595c6f08a4a6c865e9.tar.gz CMake-0ce8a5c08de0852f22f9be595c6f08a4a6c865e9.tar.bz2 |
Xcode: Fix generated references to CMakeLists.txt files
Refactoring in commit 2d888e3390 (cmSourceFile: Rename mutating
GetFullPath() overload, 2019-08-29, v3.16.0-rc1~160^2) accidentally left
the paths to `CMakeLists.txt` files empty in generated Xcode project
files.
Fixes: #19927
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/XcodeProject/ImplicitCMakeLists-check.cmake | 20 | ||||
-rw-r--r-- | Tests/RunCMake/XcodeProject/ImplicitCMakeLists.cmake | 0 | ||||
-rw-r--r-- | Tests/RunCMake/XcodeProject/RunCMakeTest.cmake | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/ImplicitCMakeLists-check.cmake b/Tests/RunCMake/XcodeProject/ImplicitCMakeLists-check.cmake new file mode 100644 index 0000000..c6bbc1b --- /dev/null +++ b/Tests/RunCMake/XcodeProject/ImplicitCMakeLists-check.cmake @@ -0,0 +1,20 @@ +set(xcProjectFile "${RunCMake_TEST_BINARY_DIR}/ImplicitCMakeLists.xcodeproj/project.pbxproj") +if(NOT EXISTS "${xcProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${xcProjectFile} does not exist.") + return() +endif() + +set(foundCMakeLists 0) +file(STRINGS "${xcProjectFile}" lines) +foreach(line IN LISTS lines) + if(line MATCHES "PBXFileReference.*CMakeLists.txt") + if(foundCMakeLists) + set(RunCMake_TEST_FAILED "CMakeLists.txt referenced multiple times") + return() + endif() + set(foundCMakeLists 1) + endif() +endforeach() +if(NOT foundCMakeLists) + set(RunCMake_TEST_FAILED "CMakeLists.txt not referenced") +endif() diff --git a/Tests/RunCMake/XcodeProject/ImplicitCMakeLists.cmake b/Tests/RunCMake/XcodeProject/ImplicitCMakeLists.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/ImplicitCMakeLists.cmake diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index 1dfa8b2..9e82841 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -1,6 +1,7 @@ include(RunCMake) run_cmake(ExplicitCMakeLists) +run_cmake(ImplicitCMakeLists) run_cmake(XcodeFileType) run_cmake(XcodeAttributeLocation) |