[Cmake] wxWindows + DLL

Mathieu Malaterre Mathieu . Malaterre at creatis . insa-lyon . fr
Tue, 30 Sep 2003 14:27:23 +0200


>> If not could you tell me how I am supposed to link to wxWindows DLL ? 
> 
> 
> The idea ist to use the switch WXWINDOWS_USE_SHARED_LIBS in cmake.
> But this switch is only available if the appropriate library is found by 
> FindwxWindows.cmake
> 
> Just a guess:
> Maybe the library name (e.g. "wxmsw24d") has to be adapted/added, in 
> particular for the new for wx 2.4.2/2.5.x/2.6.x
> 

	Hum, I guess I was not clear.

	I built wxWindows DLL properly but for WIN32 you need to define a 
special tag for each symbol you want to export in your DLL. And for that 
to work, wxWindow assume you pass 'DLLUSINGDLL' to the preprocessor (it 
will have consequence on included wx files).

	What I suggest is (*):

	Jan what do you think of it ? Can anybody from cmake-dev-team answer on 
this ? I tried looking at FindQT, and this was the way used for passing 
QT_DLL (~WXUSINGDLL) when linking against Qt's DLL. Then all you have to 
do in your *own* CMakeLists.txt is to add:

	ADD_DEFINITIONS(${WXWINDOWS_DEFINITIONS})

Thanks
mathieu

(*)
$ cvs diff -u FindwxWindows.cmake
Index: FindwxWindows.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindwxWindows.cmake,v
retrieving revision 1.12
diff -u -r1.12 FindwxWindows.cmake
--- FindwxWindows.cmake	21 Aug 2003 17:26:56 -0000	1.12
+++ FindwxWindows.cmake	30 Sep 2003 12:28:44 -0000
@@ -263,6 +263,9 @@
      SET(WXWINDOWS_DEFINITIONS "")
    ENDIF (WXWINDOWS_SET_DEFINITIONS)

+  IF(WXWINDOWS_USE_SHARED_LIBS)
+    SET(WXWINDOWS_DEFINITIONS ${WXWINDOWS_DEFINITIONS} "-DWXUSINGDLL")
+  ENDIF(WXWINDOWS_USE_SHARED_LIBS)

    ## Find the include directories for wxwindows
    ## the first, build specific for wx/setup.h was determined before.