diff options
author | Brad King <brad.king@kitware.com> | 2019-11-06 14:23:47 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-11-06 14:23:56 (GMT) |
commit | 30908fa0ee965a67c6dbdc554c67038d14bca7d6 (patch) | |
tree | 2bd68710d01e40efa22fe81ad5a48b05886ba839 /Tests | |
parent | 48d3b83b9dd3a97874f560660a21b7af8e10ffff (diff) | |
parent | 0ce8a5c08de0852f22f9be595c6f08a4a6c865e9 (diff) | |
download | CMake-30908fa0ee965a67c6dbdc554c67038d14bca7d6.zip CMake-30908fa0ee965a67c6dbdc554c67038d14bca7d6.tar.gz CMake-30908fa0ee965a67c6dbdc554c67038d14bca7d6.tar.bz2 |
Merge topic 'xcode-restore-CMakeLists'
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 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) |