diff options
author | Brad King <brad.king@kitware.com> | 2019-11-06 14:23:47 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-11-06 09:23:56 -0500 |
commit | bae7a82ffab7350ae55a104d85d91b5d36347cae (patch) | |
tree | 92cd132723f3bbcfdad2cf4f0d3eeb6e6092dda4 /Tests | |
parent | e0ec13059a04491c601e158c137cddc0802a410c (diff) | |
parent | 0ce8a5c08de0852f22f9be595c6f08a4a6c865e9 (diff) | |
download | cmake-bae7a82ffab7350ae55a104d85d91b5d36347cae.tar.gz |
Merge topic 'xcode-restore-CMakeLists' into release-3.16
0ce8a5c08d Xcode: Fix generated references to CMakeLists.txt files
9457c95aa0 cmGlobalXCodeGenerator: Mark known source locations
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3999
Diffstat (limited to 'Tests')
-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 0000000000..c6bbc1be18 --- /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 0000000000..e69de29bb2 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/ImplicitCMakeLists.cmake diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index 1dfa8b2bd3..9e828415b6 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) |