From: Thomas Debesse Date: Mon, 20 May 2019 17:52:56 +0000 (+0200) Subject: cmake: fix linking on macOS X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9f3200bc10d75b3ce5fa73402eadef3e6774515c;p=xonotic%2Fnetradiant.git cmake: fix linking on macOS --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c28d90f..ad592edf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,6 +178,10 @@ if (BUILD_BINARIES) add_definitions( -DPOSIX=1 ) + + link_directories( + /usr/local/lib + ) elseif (WIN32) add_definitions( -DWIN32=1 diff --git a/cmake/FindGtkGLExt.cmake b/cmake/FindGtkGLExt.cmake index b30a1e11..40a0c858 100644 --- a/cmake/FindGtkGLExt.cmake +++ b/cmake/FindGtkGLExt.cmake @@ -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)