[Cmake] Re: Carbon, Cocoa, X

Bill Hoffman bill.hoffman at kitware.com
Fri, 02 Apr 2004 11:40:35 -0500


I think that this problem is fixed in cvs cmake. (linking X11 all the time.)

Here is cvs cmake:
  IF (OPENGL_gl_LIBRARY)
    INCLUDE( ${CMAKE_ROOT}/Modules/FindX11.cmake )
    IF (X11_FOUND)
      IF (NOT APPLE)
        SET (OPENGL_LIBRARIES ${X11_LIBRARIES})
      ENDIF (NOT APPLE)
    ENDIF (X11_FOUND)
  ENDIF (OPENGL_gl_LIBRARY)


However, a more consistent approach to the multi-platform platform is needed.
It is almost like  cygwin on windows, but that requires a different cmake. 
We could have an environment variable, but I really hate them...

Any ideas on how to best do this are welcome...

-Bill


At 11:29 AM 4/2/2004, Chris Scharver wrote:
>I already have my own FindOpenGL.cmake that I use specifically to address differences between building with X11 and building with Cocoa. In particular, I don't want X11 libs linked into the Cocoa application at all. Currently they are linked even if they're not used. Currently, all the X11 stuff is found when CMake configures OpenGL. FindOpenGL.cmake could grab whatever extra windowing libs are required, whether it's X11 or the Cocoa frameworks (but not both!) I define an OPENGL_APPLE_USE_X11 option within FindOpenGL.cmake, but some of my previous mails about that should be in the archives. There are definitely some ugly tricks involved, but it does work properly with CMake 1.8.
>
>Maybe the windowing-related modules (FLTK, GLUT, OpenGL, Qt) should all check the desired windowing implementation. For Carbon and Cocoa, they only need to link the appropriate frameworks. For X11 they can use the FindX11 module.
>
>It does throw in overhead since you have to check for which windowing system is being used for a given project, but it would be wonderful to have a consistent approach in CMake modules for doing this. It really shows the power of CMake when I demonstrate how effortlessly I can switch between different build configurations!
>
>Chris
>
>On Apr 2, 2004, at 9:35 AM, Bill Hoffman wrote:
>
>>It should probably be fixed at the CMake level.
>>Ken and I talked about it a bit, and the problem is that
>>OSX is really several distinct platforms.   So, we should
>>treat it that way.
>>
>>Something like this:
>>
>>CMake/Modules/Platforms/Darwin.cmake
>>SET(CMAKE_APPLE_CARBON_DEVEL 1 CACHE "using cabon development")
>>SET(CMAKE_APPLE_COCO_DEVEL 0 CACHE "using coco development")
>>SET(CMAKE_APPLE_X11_DEVEL 0 CACHE "using X11 development")
>>
>>Then change all of the modules in CMake/Modules that refer to
>>APPLE, to check for which flavor of apple it should be looking for.
>>
>>
>>-Bill
>>
>>At 10:13 PM 3/31/2004, Yves Starreveld wrote:
>>>Bill,
>>>
>>>I have been working on the multiple different builds on OSX problem.
>>>
>>>When building for X11, we need to use different libs for opengl, tcl and tk than when building for the other two.
>>>
>>>Should I add this support at the level of CMake, so that on OSX, it finds installed frameworks for Tk and Tcl for the Carbon/Cocoa builds, and also tcl and tk libs for the X11 builds, or should I just make it work at the VTK level, so that when USE_X11 is switched on, the OpenGL Framework is not used, but the -lGL, etc are used?
>>>
>>>It would be nice to finally sort this out cleanly, since it appears more and more folks are using this stuff now.
>>>
>>>Yves
>>
>>
>>_______________________________________________
>>Cmake mailing list
>>Cmake at www.cmake.org
>>http://www.cmake.org/mailman/listinfo/cmake
>>
>--
>Chris Scharver
>Electronic Visualization Laboratory
>The University of Illinois at Chicago
>Ph: 312-996-3002   FAX: 312-413-7585
><http://www.evl.uic.edu/scharver/>