diff options
Diffstat (limited to 'Modules/FindGLUT.cmake')
-rw-r--r-- | Modules/FindGLUT.cmake | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake index 43041c5..320ddad 100644 --- a/Modules/FindGLUT.cmake +++ b/Modules/FindGLUT.cmake @@ -96,7 +96,21 @@ endfunction() find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) + # Tell pkg-config not to strip any -I flags to make sure GLUT_INCLUDE_DIRS + # will be defined. + if(DEFINED ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS}) + set(_pkgconfig_allow_system_cflags_old "$ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS}") + else() + unset(_pkgconfig_allow_system_cflags_old) + endif() + set(ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS} 1) pkg_check_modules(GLUT QUIET glut) + if(DEFINED _pkgconfig_allow_system_cflags_old) + set(ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS} "${_pkgconfig_allow_system_cflags_old}") + unset(_pkgconfig_allow_system_cflags_old) + else() + unset(ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS}) + endif() if(NOT GLUT_FOUND) pkg_check_modules(GLUT QUIET freeglut) endif() @@ -261,8 +275,4 @@ if (GLUT_FOUND) PROPERTY INTERFACE_LINK_LIBRARIES GLUT::Cocoa) endif() endif() - - #The following deprecated settings are for backwards compatibility with CMake1.4 - set (GLUT_LIBRARY ${GLUT_LIBRARIES}) - set (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIRS}) endif() |