aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libmysofa/use-vcpkg-zlib.patch
blob: 06c2fbc1f705d5d903d4518f87186d3c02185530 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 018f4ce..90ec50d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -13,21 +13,25 @@ use_c99()
 configure_file(config.h.in config.h)
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
+find_package(ZLIB REQUIRED)
+
 if(NOT MSVC)
   if(NOT WIN32)
     find_library(MATH m)
   else()
     set(MATH "")
   endif()
-  include(FindZLIB)
+  #include(FindZLIB)
 else()
   set(MATH "")
+  #[[
   find_program(NUGET nuget)
   if(NUGET)
     execute_process(COMMAND ${NUGET} install zlib)
   endif()
   include_directories(
     ${PROJECT_SOURCE_DIR}/windows/third-party/zlib-1.2.11/include/)
+  ]]#
 endif()
 
 if(NOT MSVC)
@@ -36,12 +40,13 @@ if(NOT MSVC)
   else()
     set(MATH "")
   endif()
-  include(FindZLIB)
-  include_directories(${ZLIB_INCLUDE_DIRS})
+  #include(FindZLIB)
+  #include_directories(${ZLIB_INCLUDE_DIRS})
   set(PKG_CONFIG_PRIVATELIBS "-lm ${PKG_CONFIG_PRIVATELIBS}")
   set(PKG_CONFIG_PRIVATELIBS "-lz ${PKG_CONFIG_PRIVATELIBS}")
 else()
   set(MATH "")
+  #[[
   find_program(NUGET nuget)
   if(NOT NUGET)
     message(
@@ -53,6 +58,7 @@ else()
   endif()
   include_directories(
     ${PROJECT_SOURCE_DIR}/windows/third-party/zlib-1.2.11/include/)
+    ]]#
 endif()
 
 set(libsrc
@@ -81,6 +87,8 @@ set(public-headers
     hrtf/mysofa.h
 )
 
+install(FILES "${public-headers}" DESTINATION include)
+
 if(BUILD_STATIC_LIBS)
 add_library(mysofa-static STATIC ${libsrc})
 target_include_directories(mysofa-static
@@ -88,7 +96,7 @@ target_include_directories(mysofa-static
   "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/hrtf>"
   $<INSTALL_INTERFACE:include/>
 )
-target_link_libraries(mysofa-static LINK_PRIVATE ${MATH} ${ZLIB_LIBRARIES})
+target_link_libraries(mysofa-static LINK_PRIVATE ${MATH} ZLIB::ZLIB)
 set_target_properties(
   mysofa-static
   PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1 POSITION_INDEPENDENT_CODE
@@ -120,7 +128,7 @@ if(BUILD_SHARED_LIBS)
     "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/hrtf>"
     $<INSTALL_INTERFACE:include/>
   )
-  target_link_libraries(mysofa-shared PRIVATE ${MATH} ${ZLIB_LIBRARIES})
+  target_link_libraries(mysofa-shared PRIVATE ${MATH} ZLIB::ZLIB)
   set_target_properties(mysofa-shared
                         PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1)
   # Rename the Windows import library (stub) of the DLL to prevent a name clash