[CMake] Adding a reference to a .NET dll in my C++/CLI project

Hendrik Sattler post at hendrik-sattler.de
Wed Jan 4 17:40:22 EST 2012


Am Mittwoch, 4. Januar 2012, 23:32:21 schrieb brian:
> I've been able to generate VS 2010 solution's via CMake for my C++/CLI
> project (.NET project).  We've added the log4net.dll to the project by
> hand.  This is the .NET version of the log4j project.  What I'd like to do
> is add a reference to this DLL to the solution via cmake using a
> Findlog4net.cmake file with a given version number but haven't figured out
> how to integrate this since its a dll only.
> 
> I've tried,
> find_library(LOG4NET_LIB  log4net ${PATH_TO_DLL_LOCATION})
> 
> but this hasn't worked.

The .dll is the runtime library but for linking with VisualStudio, you need a 
.lib import library.

HS


More information about the CMake mailing list