--- CMakeLists.txt.orig	2025-03-20 09:59:25 UTC
+++ CMakeLists.txt
@@ -239,10 +239,10 @@ if (UNIX)
             list(APPEND UVGRTP_LINKER_FLAGS "-lpthread")
         endif()
         # Check PKG_CONFIG_PATH, if not defined, use lib/pkgconfig
-        if(NOT DEFINED ENV{PKG_CONFIG_PATH})
+        if(NOT DEFINED PKG_CONFIG_PATH)
             set(PKG_CONFIG_PATH "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
             message("PKG_CONFIG_PATH is not set. Setting it to ${PKG_CONFIG_PATH}")
-        endif(NOT DEFINED ENV{PKG_CONFIG_PATH})
+        endif()
 
         # Find crypto++
         if(NOT UVGRTP_DISABLE_CRYPTO)
