]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
cmake: fix linking on macOS
authorThomas Debesse <dev@illwieckz.net>
Mon, 20 May 2019 17:52:56 +0000 (19:52 +0200)
committerThomas Debesse <dev@illwieckz.net>
Sat, 1 Jun 2019 15:51:39 +0000 (17:51 +0200)
CMakeLists.txt
cmake/FindGtkGLExt.cmake

index 4c28d90ffba3772c17e3e7ce1d3a4a87dca981e7..ad592edfadc8e76234bb2cf2591962e5d0230aac 100644 (file)
@@ -178,6 +178,10 @@ if (BUILD_BINARIES)
         add_definitions(
                 -DPOSIX=1
         )
+
+        link_directories(
+                /usr/local/lib
+        )
     elseif (WIN32)
         add_definitions(
                 -DWIN32=1
index b30a1e1185fe57a11b891f277bccba0df94f0bfb..40a0c858b19a334dad7e68eae0251bfb053de7fd 100644 (file)
@@ -3,12 +3,15 @@ if (PKG_CONFIG_FOUND)
     if (GtkGLExt_FIND_REQUIRED)
         set(_pkgconfig_REQUIRED REQUIRED)
     endif ()
-    if (XWINDOWS)
+    if (APPLE)
+        # libffi is provided by base system so brew does not take the risk to override it
+        # hence then need for an explicit look-up
+        set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/libffi/lib/pkgconfig")
+        pkg_check_modules(GtkGLExt ${_pkgconfig_REQUIRED} gtkglext-1.0 gtkglext-quartz-1.0)
+    elseif (XWINDOWS)
         pkg_check_modules(GtkGLExt ${_pkgconfig_REQUIRED} gtkglext-x11-1.0)
     elseif (WIN32)
         pkg_check_modules(GtkGLExt ${_pkgconfig_REQUIRED} gtkglext-win32-1.0)
-    else ()
-        pkg_check_modules(GtkGLExt ${_pkgconfig_REQUIRED} gtkglext-quartz-1.0)
     endif ()
 else ()
     find_path(GtkGLExt_INCLUDE_DIRS gtkglwidget.h)