summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/ObjectLibrary/ImportMultiArch-check.cmake
blob: af1df789709ff49deae6a3b14ce7cd4221948e40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
set(xcProjectFile "${RunCMake_TEST_BINARY_DIR}/ImportMultiArch.xcodeproj/project.pbxproj")
if(NOT EXISTS "${xcProjectFile}")
  set(RunCMake_TEST_FAILED "Project file ${xcProjectFile} does not exist.")
  return()
endif()

file(READ ${xcProjectFile} pbxFileContents)
foreach(config IN ITEMS Debug Release RelWithDebInfo MinSizeRel)
  set(regex "--findconfig-${config}[^
]*\\$\\(CURRENT_ARCH\\)")
  if(NOT pbxFileContents MATCHES "${regex}")
    set(RunCMake_TEST_FAILED "$(CURRENT_ARCH) not preserved for config ${config}")
    return()
  endif()
endforeach()