diff options
author | Alexander Neundorf <neundorf@kde.org> | 2010-03-07 22:23:07 +0000 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2010-03-07 22:23:07 +0000 |
commit | 6ec201b2310c9d1f8dd947d2c90ff782568f0cd7 (patch) | |
tree | 0a630b29d49ea168eea0a8cf544f6a5584e5a1ca /modules | |
parent | 6293eff4b0b45a2ce1b302a834dabd6e283de2e5 (diff) | |
download | extra-cmake-modules-6ec201b2310c9d1f8dd947d2c90ff782568f0cd7.tar.gz extra-cmake-modules-6ec201b2310c9d1f8dd947d2c90ff782568f0cd7.tar.bz2 |
-fix build on OSX with OpenGL (don't turn "-framework foo" into "-framework;-lfoo"
Alex
svn path=/trunk/KDE/kdelibs/; revision=1100585
Diffstat (limited to 'modules')
-rw-r--r-- | modules/Qt4ConfigDependentSettings.cmake | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/Qt4ConfigDependentSettings.cmake b/modules/Qt4ConfigDependentSettings.cmake index d6fc2d44..b5462e7b 100644 --- a/modules/Qt4ConfigDependentSettings.cmake +++ b/modules/Qt4ConfigDependentSettings.cmake @@ -77,7 +77,18 @@ ENDIF(WIN32 AND NOT QT_IS_STATIC) # 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}) |