[Cmake] Auto-generating exports for Windows DLLs

Brad King brad . king at kitware . com
Thu, 30 Oct 2003 17:54:27 -0500 (EST)


On Thu, 30 Oct 2003, Amitha Perera wrote:

> I've looked briefly at this, and can get it to work with Makefiles
> (NMake). It is more difficult with Visual Studio, because the object
> files are in some "random" (Debug, Release, RelWithDebInfo)
> sub-directory of the build tree. In order to automatically generate
> the .def file, I need a list of the object files that will go into the
> library. Is there a way to get this list in a project file?

The .dll and .lib files themselves are put in corresponding
Debug/Release/etc subdirectories.  Therefore a separate .def file should
be put in each configuration directory that is built.  You can write
custom rules using "${CMAKE_CFG_INTDIR}" which expands to "." for most
generators and "$(IntDir)" for the Visual Studio generators.  Then the
.dsp automatically expands $(IntDir) to Debug/Release/etc when the rule
runs.

-Brad