summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VS10Project/NoImpLib-check.cmake
blob: 50722b22e6fd4db6e3ff45c91786789b08fb1c01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
if(NOT EXISTS "${vcProjectFile}")
  set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
  return()
endif()

set(found_ImportLibrary 0)
set(found_TargetExt_dll 0)
file(STRINGS "${vcProjectFile}" lines)
foreach(line IN LISTS lines)
  if(line MATCHES "<ImportLibrary>")
    set(found_ImportLibrary 1)
  endif()
  if(line MATCHES "<TargetExt[^\n]*\\.dll")
    set(found_TargetExt_dll 1)
  endif()
endforeach()
if(found_ImportLibrary)
  string(APPEND RunCMake_TEST_FAILED "ImportLibrary incorrectly found in\n  ${vcProjectFile}\n")
endif()
if(NOT found_TargetExt_dll)
  string(APPEND RunCMake_TEST_FAILED "TargetExt not found in\n  ${vcProjectFile}\n")
endif()