Ticket #23720: opengl-on-mac.patch

File opengl-on-mac.patch, 1.3 KB (added by jgosmann (Jan Gosmann), 14 years ago)

Patch for Qt4ConfigDependentSettings.cmake to build kdeedu4

  • Qt4ConfigDependentSettings.cmake

     
    7777
    7878# QtOpenGL dependencies
    7979QT_QUERY_QMAKE(QMAKE_LIBS_OPENGL "QMAKE_LIBS_OPENGL")
    80 SEPARATE_ARGUMENTS(QMAKE_LIBS_OPENGL)
     80IF(Q_WS_MAC)
     81# On the Mac OpenGL is probably frameworks and QMAKE_LIBS_OPENGL can be e.g. "-framework OpenGL -framework AGL".
     82# The separate_arguments() call in the other branch makes "-framework;-OpenGL;-framework;-lAGL" appear in the
     83# linker command. So we need to protect the "-framework foo" as non-separatable strings.
     84# We do this by replacing the space after "-framework" with an underscore, then calling separate_arguments(),
     85# and then we replace the underscores again with spaces. So we get proper linker commands. Alex
     86  STRING(REGEX REPLACE "-framework +" "-framework_" QMAKE_LIBS_OPENGL "${QMAKE_LIBS_OPENGL}")
     87  SEPARATE_ARGUMENTS(QMAKE_LIBS_OPENGL)
     88  STRING(REGEX REPLACE "-framework_" "-framework " QMAKE_LIBS_OPENGL "${QMAKE_LIBS_OPENGL}")
     89ELSE(Q_WS_MAC)
     90  SEPARATE_ARGUMENTS(QMAKE_LIBS_OPENGL)
     91ENDIF(Q_WS_MAC)
    8192SET (QT_QTOPENGL_LIB_DEPENDENCIES ${QT_QTOPENGL_LIB_DEPENDENCIES} ${QMAKE_LIBS_OPENGL})
    8293
    8394