2020-06-12 14:13:23 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2021-09-08 22:45:37 +08:00
|
|
|
index b83fbbd..2f675d1 100644
|
2020-06-12 14:13:23 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2021-09-08 22:45:37 +08:00
|
|
|
@@ -2678,9 +2678,12 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap.h DESTINATION include)
|
2020-06-12 14:13:23 +08:00
|
|
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap-bpf.h DESTINATION include)
|
|
|
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap-namedb.h DESTINATION include)
|
|
|
|
|
|
|
|
-# On UN*X, and on Windows when not using MSVC, generate libpcap.pc and
|
2021-09-08 22:45:37 +08:00
|
|
|
-# pcap-config and process man pages and arrange that they be installed.
|
|
|
|
-if(NOT MSVC)
|
2020-06-12 14:13:23 +08:00
|
|
|
+# Generate libpcap.pc
|
|
|
|
+if(BUILD_SHARED_LIBS)
|
|
|
|
+ set(PACKAGE_NAME ${LIBRARY_NAME})
|
|
|
|
+else()
|
|
|
|
+ set(PACKAGE_NAME pcap)
|
|
|
|
+endif()
|
2021-09-08 22:45:37 +08:00
|
|
|
set(prefix ${CMAKE_INSTALL_PREFIX})
|
|
|
|
set(exec_prefix "\${prefix}")
|
|
|
|
set(includedir "\${prefix}/include")
|
|
|
|
@@ -2715,10 +2718,14 @@ if(NOT MSVC)
|
|
|
|
foreach(LIB ${PCAP_LINK_LIBRARIES})
|
|
|
|
set(LIBS "${LIBS} -l${LIB}")
|
|
|
|
endforeach(LIB)
|
|
|
|
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcap-config.in ${CMAKE_CURRENT_BINARY_DIR}/pcap-config @ONLY)
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpcap.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc @ONLY)
|
|
|
|
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pcap-config DESTINATION bin)
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc DESTINATION lib/pkgconfig)
|
|
|
|
+
|
|
|
|
+# On UN*X, and on Windows when not using MSVC, generate libpcap.pc and
|
|
|
|
+# pcap-config and process man pages and arrange that they be installed.
|
|
|
|
+if(NOT MSVC)
|
|
|
|
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcap-config.in ${CMAKE_CURRENT_BINARY_DIR}/pcap-config @ONLY)
|
|
|
|
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pcap-config DESTINATION bin)
|
|
|
|
|
2020-06-12 14:13:23 +08:00
|
|
|
#
|
|
|
|
# Man pages.
|