Browse Source

FindPkgConfig: Fix path manipulations when cross compiling

When cross compiling from a unix machine, if(UNIX) is false,
whih causes the path not to be fixed for unix, leading to false
negative if PKG_CONFIG_PATH needs to be probed
Hugo Beauzée-Luyssen 6 years ago
parent
commit
f92a4b2399
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Modules/FindPkgConfig.cmake

+ 1 - 1
Modules/FindPkgConfig.cmake

@@ -337,7 +337,7 @@ macro(_pkg_set_path_internal)
       # remove empty values from the list
       list(REMOVE_ITEM _pkgconfig_path "")
       file(TO_NATIVE_PATH "${_pkgconfig_path}" _pkgconfig_path)
-      if(UNIX)
+      if(CMAKE_HOST_UNIX)
         string(REPLACE ";" ":" _pkgconfig_path "${_pkgconfig_path}")
         string(REPLACE "\\ " " " _pkgconfig_path "${_pkgconfig_path}")
       endif()