<div><div dir="auto">I’m also interested in this. </div><div dir="auto"><br></div><div dir="auto">Side note 1: Things like this eventually lead me to have a post process (a python script) on all my VS project files to “fix” any issues like this. If I can’t figure out a way to do something specific in a VS project, I just add it to my post process until I eventually have time to dig in and figure it out. For this specific issue, I just match a regex for the line and remove it. I know this shouldn’t be neccessary but sometimes I just don’t have the time to figure out a specific generator problem.</div></div><div dir="auto"><br></div><div dir="auto">Side note 2: I also used this process at one point to make relocatable VS solutions/projects. It worked quite well and is a quick way to get around short comings in how CMake creates VS artifacts.</div><div dir="auto"><br></div><div dir="auto">-Caleb</div><div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 9, 2018 at 6:49 PM Jason Heeris <<a href="mailto:jason.heeris@gmail.com">jason.heeris@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank">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" target="_blank">https://gitlab.kitware.com/cmake/cmake/blob/master/Source/cmComputeLinkInformation.cxx#L271</a><br></div>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Sent from my iPhone 4s</div>