summaryrefslogtreecommitdiff
path: root/Modules/FindGLUT.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-10-27 12:39:06 -0400
committerBrad King <brad.king@kitware.com>2022-10-27 12:39:06 -0400
commit919ab832e848a4d1ae8b1b0d9960e706bff60c3b (patch)
treebdb815bf966cf535c08cf48c82156b538ad7d457 /Modules/FindGLUT.cmake
parent33d610a07695ca4716e376d7411845ccd894c6c0 (diff)
downloadcmake-919ab832e848a4d1ae8b1b0d9960e706bff60c3b.tar.gz
FindGLUT: Fix regression when pkg-config is not available
In commit a2fc4b6257 (FindGLUT: Drop the now-unnecessary exclusion of pkg-config for multiconfig, 2022-10-13, v3.25.0-rc2~16^2) we accidentally removed the entire condition around the `pkg-config` code path instead of just the multi-config part. Fixes: #24095
Diffstat (limited to 'Modules/FindGLUT.cmake')
-rw-r--r--Modules/FindGLUT.cmake8
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake
index e0636b2f86..09403bc114 100644
--- a/Modules/FindGLUT.cmake
+++ b/Modules/FindGLUT.cmake
@@ -68,9 +68,11 @@ include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package(PkgConfig QUIET)
-pkg_check_modules(PC_GLUT QUIET glut)
-if(NOT PC_GLUT_FOUND)
- pkg_check_modules(PC_GLUT QUIET freeglut)
+if(PKG_CONFIG_FOUND)
+ pkg_check_modules(PC_GLUT QUIET glut)
+ if(NOT PC_GLUT_FOUND)
+ pkg_check_modules(PC_GLUT QUIET freeglut)
+ endif()
endif()
if(WIN32)