<div dir="ltr">I'm using CMake 3.12-rc1 on Windows 10. I have the following `CMakeLists.txt`:<br><br>cmake_minimum_required(VERSION 3.8)<br>project(cmake_test)<br>unset(CMAKE_IMPORT_LIBRARY_SUFFIX)<br>add_library(main MODULE "main.c")<br><br>The generator is Visual Studio 15 2017.<br><br>I would like to suppress the "/IMPLIB" argument created for the "main" library. In my real project, I have static and shared libraries named the same. This works fine, because they have different extensions (lib vs dll), but a problem arises when the linker tries to create an import library for "something.dll" named "something.lib", while also trying to link against a static library named "something.lib".<br><br>The import library is not needed though; in CMake terminology the DLL is a "module" ie. loaded via DllOpen(). The documentation suggested that calling "add_library()" with "MODULE" was what I needed here. Unfortunately the resulting VS project still contains an import library flag for the linker.<br><br>A Stackoverflow answer[1] suggested unsetting "CMAKE_IMPORT_LIBRARY_SUFFIX" because the source indicates[2] this will stop the flag from appearing. But all this seems to do is drop the filename from the generated project; it still contains this now-incorrect flag that references a directory instead of a full path:<br><br><ImportLibrary>C:/Users/heerij/Code/cmake-ex-2/build/Debug/</ImportLibrary><br><br>How do I prevent the import library creation?<br><br>- Jason<br><br>  [1] <a href="https://stackoverflow.com/questions/34575066/how-to-prevent-cmake-from-issuing-implib">https://stackoverflow.com/questions/34575066/how-to-prevent-cmake-from-issuing-implib</a><br>  [2] <a href="https://gitlab.kitware.com/cmake/cmake/blob/master/Source/cmComputeLinkInformation.cxx#L271">https://gitlab.kitware.com/cmake/cmake/blob/master/Source/cmComputeLinkInformation.cxx#L271</a><br></div>