[cmake-developers] Fwd: cmVisualStudio10TargetGenerator should not generate a rule for an ImportLibrary for executables

Brad King brad.king at kitware.com
Mon Nov 28 09:58:00 EST 2016


On 11/28/2016 09:16 AM, Daniel Pfeifer wrote:
> On Mon, Nov 28, 2016 at 2:41 PM, Lode Leroy wrote:
>> The problem is that when a project contains a FOO.DLL and a FOO.EXE,
>> the cmake generator tries to build FOO.LIB for both.
>> The FOO.EXE does not need a FOO.LIB.
> Please see https://cmake.org/cmake/help/v3.7/prop_tgt/ENABLE_EXPORTS.html

Correct.  The `ImportLibrary` setting in a `.vcxproj` file only tells
the tools where to put the `.lib` file *if* there are exports.  No file
will be generated unless the project code is using `dllexport` or other
means to export a symbol from the executable.  To prevent one from showing
up, check the project code to make sure it doesn't try to export something.

-Brad



More information about the cmake-developers mailing list