Re: [CMake] import/export and DLL's

2011-12-07 Thread Clinton Stimpson
> > See also the "new in 2.8.6" module GenerateExportHeader: > > > http://cmake.org/cmake/help/cmake-2-8-docs.html#module:GenerateExportHeade > r > > cmake --help-module GenerateExportHeader > > I see the header has this: #ifdef IS_STATIC_BUILD ... #else ... #endif Is there any way to

Re: [CMake] import/export and DLL's

2011-12-07 Thread Michael Wild
On 12/07/2011 03:57 PM, Michael Jackson wrote: > > On Dec 7, 2011, at 7:57 AM, David Cole wrote: >> See also the "new in 2.8.6" module GenerateExportHeader: >> >> http://cmake.org/cmake/help/cmake-2-8-docs.html#module:GenerateExportHeader >> >> cmake --help-module GenerateExportHeader >> >> >> H

Re: [CMake] import/export and DLL's

2011-12-07 Thread Michael Jackson
On Dec 7, 2011, at 7:57 AM, David Cole wrote: > See also the "new in 2.8.6" module GenerateExportHeader: > > http://cmake.org/cmake/help/cmake-2-8-docs.html#module:GenerateExportHeader > > cmake --help-module GenerateExportHeader > > > HTH, > David > -- > +1 for that. Now to get all my de

Re: [CMake] import/export and DLL's

2011-12-07 Thread David Cole
On Wed, Dec 7, 2011 at 1:40 AM, Michael Wild wrote: > On 12/07/2011 01:49 AM, Totte Karlsson wrote: >>> Well, then just use add_definitions(-DIMPORT_X_DLL). If >>> -DEXPORT_X_DLL is present, it will override your export/import >>> header definitions for the import case, and everything should be >>

Re: [CMake] import/export and DLL's

2011-12-06 Thread Michael Wild
On 12/07/2011 01:49 AM, Totte Karlsson wrote: >> Well, then just use add_definitions(-DIMPORT_X_DLL). If >> -DEXPORT_X_DLL is present, it will override your export/import >> header definitions for the import case, and everything should be >> fine. > > Not sure what you mean by override. If both

Re: [CMake] import/export and DLL's

2011-12-06 Thread Michael Jackson
___ Mike Jackson www.bluequartz.net Principal Software Engineer mike.jack...@bluequartz.net BlueQuartz Software Dayton, Ohio On Dec 6, 2011, at 7:59 PM, Totte Karlsson wrote: > On 12/6/2011 8:10 AM,

Re: [CMake] import/export and DLL's

2011-12-06 Thread Totte Karlsson
On 12/6/2011 8:10 AM, Michael Jackson wrote: Read this article. http://www.cmake.org/Wiki/BuildingWinDLL Yeah, I did start with that one. My main problem was (as M. Wild) pointed out, defining the build flags correctly. I ended up using add_definitions(-DEXPORT_MOLECULE_DLL) In the article, t

Re: [CMake] import/export and DLL's

2011-12-06 Thread Totte Karlsson
> Well, then just use add_definitions(-DIMPORT_X_DLL). If -DEXPORT_X_DLL > is present, it will override your export/import header definitions for > the import case, and everything should be fine. Not sure what you mean by override. If both symbols are defined, MTK_COMMON will be defined as __dec

Re: [CMake] import/export and DLL's

2011-12-06 Thread Michael Jackson
Read this article. http://www.cmake.org/Wiki/BuildingWinDLL If you have questions after that please post. That article should clear everything up. Thanks ___ Mike JacksonPrincipal Software Engineer BlueQuartz Software

Re: [CMake] import/export and DLL's

2011-12-06 Thread Michael Wild
On 12/06/2011 10:42 AM, Totte Karlsson wrote: > Thanks for feedback >> >> You misunderstand and misuse the DEFINE_SYMBOL property. All the >> IMPORT_X_DLL symbols are wrong, you have to remove them. > > But when building the B, and C dll the import symbols need to be defined > somehow. See my expo

Re: [CMake] import/export and DLL's

2011-12-06 Thread Totte Karlsson
Thanks for feedback You misunderstand and misuse the DEFINE_SYMBOL property. All the IMPORT_X_DLL symbols are wrong, you have to remove them. But when building the B, and C dll the import symbols need to be defined somehow. See my export/import header below. CMake will only add the DEFINE_

Re: [CMake] import/export and DLL's

2011-12-06 Thread Michael Wild
On 12/06/2011 09:47 AM, Totte Karlsson wrote: > Hi, I have a project where several DLL's are to be built, say A, B > and C. B needs to import functions/classes from A, and C need to > import functions from both A and B. In each library, a flag is > defined for exporting or importing, i.e. __declspe