File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -234,11 +234,7 @@ endif()
234
234
option (USE_ZLIB "Enable zlib support" TRUE )
235
235
236
236
if (USE_ZLIB)
237
- # This ZLIB_FOUND check is to help find a cmake manually configured zlib
238
- if (NOT ZLIB_FOUND)
239
- find_package (ZLIB REQUIRED)
240
- endif ()
241
- target_include_directories (ixwebsocket PUBLIC $<BUILD_INTERFACE:${ZLIB_INCLUDE_DIRS} >)
237
+ find_package (ZLIB REQUIRED)
242
238
target_link_libraries (ixwebsocket PRIVATE ZLIB::ZLIB)
243
239
244
240
target_compile_definitions (ixwebsocket PUBLIC IXWEBSOCKET_USE_ZLIB)
@@ -289,10 +285,14 @@ if (IXWEBSOCKET_INSTALL)
289
285
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} /ixwebsocket/
290
286
)
291
287
288
+ configure_file ("${CMAKE_CURRENT_LIST_DIR} /ixwebsocket-config.cmake.in" "${CMAKE_BINARY_DIR} /ixwebsocket-config.cmake" @ONLY)
289
+ install (FILES "${CMAKE_BINARY_DIR} /ixwebsocket-config.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR} /cmake/ixwebsocket" )
290
+
292
291
install (EXPORT ixwebsocket
293
- FILE ixwebsocket-config .cmake
292
+ FILE ixwebsocket-targets .cmake
294
293
NAMESPACE ixwebsocket::
295
- DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/ixwebsocket)
294
+ DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/ixwebsocket
295
+ )
296
296
endif ()
297
297
298
298
if (USE_WS OR USE_TEST)
Original file line number Diff line number Diff line change
1
+ @PACKAGE_INIT@
2
+
3
+ include (CMakeFindDependencyMacro)
4
+
5
+ if (@USE_ZLIB@)
6
+ find_dependency(ZLIB)
7
+ endif ()
8
+
9
+ include ("${CMAKE_CURRENT_LIST_DIR} /ixwebsocket-targets.cmake" )
You can’t perform that action at this time.
0 commit comments