Browse Source

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
Brad King 3 years ago
parent
commit
919ab832e8
1 changed files with 5 additions and 3 deletions
  1. 5 3
      Modules/FindGLUT.cmake

+ 5 - 3
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)