[CMake] HOW DO I: Build VTK with CMake/ExternalProject_add against Qt with Cocoa on OS X?

Dave Partyka dave.partyka at kitware.com
Tue Apr 13 10:52:51 EDT 2010


I am "pretty sure" carbon/cocoa are switched on/off by whatever QT tells VTK
to use: (VTK/CMakeLists:306)  If this logic is not working correctly please
let me know.

IF(VTK_USE_QT)
# Now require Qt 4.5.0 or later
  SET(QT_MIN_VERSION "4.5.0")
  SET(QT_OFFICIAL_VERSION "4.5")
  SET(QT_REQUIRED TRUE)
  SET(QT_USE_QTSQL 1)
  FIND_PACKAGE(Qt4)
  IF(NOT QT4_FOUND)
    MESSAGE(SEND_ERROR "Qt ${QT_MIN_VERSION} or greater not found.  Please
check the QT_QMAKE_EXECUTABLE variable.")
  ELSE(NOT QT4 FOUND)
    # enforce Carbon or Cocoa in VTK for Qt/Mac
    IF(Q_WS_MAC)
      IF(QT_MAC_USE_COCOA)
        SET(VTK_USE_CARBON OFF CACHE BOOL "Build VTK with Carbon" FORCE)
        SET(VTK_USE_COCOA ON CACHE BOOL "Build VTK with Cocoa" FORCE)
      ELSE(QT_MAC_USE_COCOA)
        SET(VTK_USE_CARBON ON CACHE BOOL "Build VTK with Carbon" FORCE)
        SET(VTK_USE_COCOA OFF CACHE BOOL "Build VTK with Cocoa" FORCE)
      ENDIF(QT_MAC_USE_COCOA)
    ENDIF(Q_WS_MAC)
  ENDIF(NOT QT4_FOUND)
ENDIF(VTK_USE_QT)

On Tue, Apr 13, 2010 at 10:47 AM, Michael Jackson <
mike.jackson at bluequartz.net> wrote:

> Not sure about the X11 part but you would definitely want to set
> VTK_USE_CARBON=OFF and VTK_USE_COCOA=ON in the CMakeCache for VTK, how ever
> you need to do this with ExternalProject_add(). I would think that it should
> "just work".
>
> ___________________________________________________________
> Mike Jackson                      www.bluequartz.net
> Principal Software Engineer       mike.jackson at bluequartz.net
> BlueQuartz Software               Dayton, Ohio
>
>
>
> On Apr 13, 2010, at 10:19 AM, kent williams wrote:
>
>  I've descended into a confusing morass of complicated CMake macros,
>> and I need help getting out!
>>
>> The situation is this:  I didn't have much trouble building VTK with
>> QT as long as I stuck with Carbon.  Now I'm running into some serious
>> problems (phantom dependencies on X11 libraries, for starters) when I
>> try to use QT/Cocoa -- which is necessary, according to my boss, to
>> build on OS X 10.6.
>>
>> So does anyone have a successful example of building VTK against QT
>> using ExternalProject?
>> 2
>>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100413/00163ccf/attachment.htm>


More information about the CMake mailing list