[Cmake] Building DLLs on Windows

Bill Hoffman bill.hoffman at kitware.com
Mon Jan 13 09:25:20 EST 2003


At 08:33 AM 1/13/2003 -0500, Bill Hoffman wrote:

I forgot to mention, that cmake will add a -DLibrary_EXPORT flag
to the c/cxx files in a shared library build.   In this case,
the library name was CMakeTestLibraryShared:

>-----sharedFile.h------
>#if defined(WIN32) /* Win32 version */
>#ifdef CMakeTestLibraryShared_EXPORTS
>#  define CMakeTest_EXPORT __declspec(dllexport)
>#else
>#  define CMakeTest_EXPORT __declspec(dllimport)
>#endif
>#else
>/* unix needs nothing */
>#define CMakeTest_EXPORT
>#endif






More information about the CMake mailing list