summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-05-13 12:51:58 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-05-13 12:52:04 (GMT)
commitef7c0cb8856ed5629301ad925685c4281bcb9098 (patch)
tree38055c8ca85ff08fa96930c6c8754cfe0752ce83 /Modules
parent300c91fecd6d46fcd1054fc6b7f5273d3b0b8c02 (diff)
parent8041ca5df0cb7a016f061206abe2466832add0ea (diff)
downloadCMake-ef7c0cb8856ed5629301ad925685c4281bcb9098.zip
CMake-ef7c0cb8856ed5629301ad925685c4281bcb9098.tar.gz
CMake-ef7c0cb8856ed5629301ad925685c4281bcb9098.tar.bz2
Merge topic 'FindGLUT-system-include-dirs'
8041ca5df0 FindGLUT: Fix GLUT_INCLUDE_DIRS with pkg-config and /usr/include Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7252
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindGLUT.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake
index 43041c5..72d4db5 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()