summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-01 11:58:04 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-10-01 11:58:09 (GMT)
commitb1e1cb2d0dea1198efb4b02652180cd3eae908c9 (patch)
treedbf0362bf671d5986cfcc897acc214f7b43541b1 /Tests
parent95aa5c40cfd2853fa920609714c20e0473312229 (diff)
parent7bda9a7fc78cfe43fe7f0d98bea41158bf75433e (diff)
downloadCMake-b1e1cb2d0dea1198efb4b02652180cd3eae908c9.zip
CMake-b1e1cb2d0dea1198efb4b02652180cd3eae908c9.tar.gz
CMake-b1e1cb2d0dea1198efb4b02652180cd3eae908c9.tar.bz2
Merge topic 'msvc_implib'
7bda9a7fc7 VS: Make ImportLibary generation optional Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5282
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/VS10Project/NoImpLib-check.cmake23
-rw-r--r--Tests/RunCMake/VS10Project/NoImpLib.cmake3
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake1
3 files changed, 27 insertions, 0 deletions
diff --git a/Tests/RunCMake/VS10Project/NoImpLib-check.cmake b/Tests/RunCMake/VS10Project/NoImpLib-check.cmake
new file mode 100644
index 0000000..50722b2
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/NoImpLib-check.cmake
@@ -0,0 +1,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()
diff --git a/Tests/RunCMake/VS10Project/NoImpLib.cmake b/Tests/RunCMake/VS10Project/NoImpLib.cmake
new file mode 100644
index 0000000..2c11eac
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/NoImpLib.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+set(CMAKE_IMPORT_LIBRARY_SUFFIX "")
+add_library(foo SHARED empty.c)
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 8e56e1b..133dacc 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -11,6 +11,7 @@ run_cmake(VsCsharpSourceGroup)
run_cmake(VsCSharpCompilerOpts)
run_cmake(ExplicitCMakeLists)
run_cmake(InterfaceLibSources)
+run_cmake(NoImpLib)
run_cmake(RuntimeLibrary)
run_cmake(SourceGroupCMakeLists)
run_cmake(SourceGroupTreeCMakeLists)