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

2011-12-07 Thread David Cole
On Wed, Dec 7, 2011 at 1:40 AM, Michael Wild them...@gmail.com 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

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 developers 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 HTH, David --

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 generate

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.

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

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 export/import

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

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

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,

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 symbols