瀏覽代碼

Merge topic 'FindFreeType-config-windows' into release-3.28

0117446c97 FindFreeType: also set `FREETYPE_FOUND`
2cf2d4f7df FindFreeType: insert Freetype's location to the start
1cfc708eea FindFreeType: handle config-specific `LOCATION` settings as well
ae9890cd36 FindFreeType: consider `IMPLIB`-using platforms

Acked-by: Kitware Robot <[email protected]>
Merge-request: !8920
Brad King 2 年之前
父節點
當前提交
d33ea3dff5
共有 1 個文件被更改,包括 32 次插入2 次删除
  1. 32 2
      Modules/FindFreetype.cmake

+ 32 - 2
Modules/FindFreetype.cmake

@@ -110,11 +110,41 @@ if (freetype_FOUND)
   endif ()
   get_property(FREETYPE_INCLUDE_DIRS TARGET freetype PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
   get_property(FREETYPE_LIBRARIES TARGET freetype PROPERTY INTERFACE_LINK_LIBRARIES)
-  get_property(_Freetype_location TARGET freetype PROPERTY LOCATION)
-  list(APPEND FREETYPE_LIBRARIES
+  get_property(_Freetype_location TARGET freetype PROPERTY IMPORTED_IMPLIB)
+  if (NOT _Freetype_location)
+    get_property(_Freetype_location_release TARGET freetype PROPERTY IMPORTED_IMPLIB_RELEASE)
+    get_property(_Freetype_location_debug TARGET freetype PROPERTY IMPORTED_IMPLIB_DEBUG)
+    if (_Freetype_location_release AND _Freetype_location_debug)
+      set(_Freetype_location
+        optimized "${_Freetype_location_release}"
+        debug "${_Freetype_location_debug}")
+    elseif (_Freetype_location_release)
+      set(_Freetype_location "${_Freetype_location_release}")
+    elseif (_Freetype_location_debug)
+      set(_Freetype_location "${_Freetype_location_debug}")
+    else ()
+      get_property(_Freetype_location_release TARGET freetype PROPERTY LOCATION_RELEASE)
+      get_property(_Freetype_location_debug TARGET freetype PROPERTY LOCATION_DEBUG)
+      if (_Freetype_location_release AND _Freetype_location_debug)
+        set(_Freetype_location
+          optimized "${_Freetype_location_release}"
+          debug "${_Freetype_location_debug}")
+      elseif (_Freetype_location_release)
+        set(_Freetype_location "${_Freetype_location_release}")
+      elseif (_Freetype_location_debug)
+        set(_Freetype_location "${_Freetype_location_debug}")
+      else ()
+        get_property(_Freetype_location TARGET freetype PROPERTY LOCATION)
+      endif ()
+    endif ()
+    unset(_Freetype_location_release)
+    unset(_Freetype_location_debug)
+  endif ()
+  list(INSERT FREETYPE_LIBRARIES 0
     "${_Freetype_location}")
   unset(_Freetype_location)
   set(Freetype_FOUND 1)
+  set(FREETYPE_FOUND 1)
   set(FREETYPE_VERSION_STRING "${freetype_VERSION}")
   foreach (_Freetype_component IN LISTS Freetype_FIND_COMPONENTS)
     set(Freetype_${_Freetype_component}_FOUND "${freetype_${_Freetype_component}_FOUND}")