On Friday 05 March 2010, Bill Hoffman wrote:
> CMake 2.8.1 RC 4 is ready to try:
>
> http://www.cmake.org/files/v2.8/?C=M;O=D
>
> Please try your projects with it.   If you find any issues, let me know.
> I think this is about it.  So, if I don't hear anything by Monday, this
> is going to be 2.8.1.

FindQt4.cmake seems to have a bug with OpenGl on Mac:
http://lists.kde.org/?l=kde-buildsystem&m=126780519900727&w=2

I'm attaching a patch which probably fixes it, but I'm still waiting for 
confirmation that it really does.

Alex
Index: Qt4ConfigDependentSettings.cmake
===================================================================
--- Qt4ConfigDependentSettings.cmake	(revision 1099551)
+++ Qt4ConfigDependentSettings.cmake	(working copy)
@@ -77,7 +77,18 @@
 
 # QtOpenGL dependencies
 QT_QUERY_QMAKE(QMAKE_LIBS_OPENGL "QMAKE_LIBS_OPENGL")
-SEPARATE_ARGUMENTS(QMAKE_LIBS_OPENGL)
+IF(Q_WS_MAC)
+# On the Mac OpenGL is probably frameworks and QMAKE_LIBS_OPENGL can be e.g. "-framework OpenGL -framework AGL".
+# The separate_arguments() call in the other branch makes "-framework;-OpenGL;-framework;-lAGL" appear in the 
+# linker command. So we need to protect the "-framework foo" as non-separatable strings.
+# We do this by replacing the space after "-framework" with an underscore, then calling separate_arguments(),
+# and then we replace the underscores again with spaces. So we get proper linker commands. Alex
+  STRING(REGEX REPLACE "-framework +" "-framework_" QMAKE_LIBS_OPENGL "${QMAKE_LIBS_OPENGL}")
+  SEPARATE_ARGUMENTS(QMAKE_LIBS_OPENGL)
+  STRING(REGEX REPLACE "-framework_" "-framework " QMAKE_LIBS_OPENGL "${QMAKE_LIBS_OPENGL}")
+ELSE(Q_WS_MAC)
+  SEPARATE_ARGUMENTS(QMAKE_LIBS_OPENGL)
+ENDIF(Q_WS_MAC)
 SET (QT_QTOPENGL_LIB_DEPENDENCIES ${QT_QTOPENGL_LIB_DEPENDENCIES} ${QMAKE_LIBS_OPENGL})
 
 
_______________________________________________
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

Reply via email to