Sfoglia il codice sorgente

Merge pull request #1117 from cyfdecyf/hiredis

hiredis: fix include directory in cmake file.
ruki 3 anni fa
parent
commit
50b9c8e02b
1 ha cambiato i file con 6 aggiunte e 2 eliminazioni
  1. 6 2
      packages/h/hiredis/xmake.lua

+ 6 - 2
packages/h/hiredis/xmake.lua

@@ -24,8 +24,12 @@ package("hiredis")
     end)
 
     on_install(function (package)
-        if not package:config("shared") then
-            if package:version():eq("v1.0.2") then
+        if package:version():eq("v1.0.2") then
+            io.replace("CMakeLists.txt",
+                "TARGET_INCLUDE_DIRECTORIES(hiredis PUBLIC $<INSTALL_INTERFACE:.>",
+                "TARGET_INCLUDE_DIRECTORIES(hiredis PUBLIC $<INSTALL_INTERFACE:include>",
+                {plain = true})
+            if not package:config("shared") then
                 -- Following change is required for package user to call `find_package(hiredis)` to work.
                 io.replace("CMakeLists.txt", "ADD_LIBRARY(hiredis SHARED", "ADD_LIBRARY(hiredis", {plain = true})
                 io.replace("CMakeLists.txt", "ADD_LIBRARY(hiredis_ssl SHARED", "ADD_LIBRARY(hiredis_ssl", {plain = true})