mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-26 23:01:04 +08:00
Problem: CMake does not look for NSS using pkg-config
Solution: use pkg-config by default and FindPackage only as a fallback
This commit is contained in:
parent
068385c951
commit
2c2ff01e85
@ -29,6 +29,8 @@ include(TestZMQVersion)
|
|||||||
include(ZMQSourceRunChecks)
|
include(ZMQSourceRunChecks)
|
||||||
include(ZMQSupportMacros)
|
include(ZMQSupportMacros)
|
||||||
|
|
||||||
|
find_package(PkgConfig)
|
||||||
|
|
||||||
option(ENABLE_ASAN "Build with address sanitizer" OFF)
|
option(ENABLE_ASAN "Build with address sanitizer" OFF)
|
||||||
if(ENABLE_ASAN)
|
if(ENABLE_ASAN)
|
||||||
message(STATUS "Instrumenting with Address Sanitizer")
|
message(STATUS "Instrumenting with Address Sanitizer")
|
||||||
@ -120,17 +122,23 @@ if (NOT DISABLE_WS)
|
|||||||
set(ZMQ_HAVE_WS 1)
|
set(ZMQ_HAVE_WS 1)
|
||||||
|
|
||||||
if (WITH_NSS)
|
if (WITH_NSS)
|
||||||
find_package("NSS3")
|
pkg_check_modules(NSS3 "nss")
|
||||||
if (NSS3_FOUND)
|
if (NSS3_FOUND)
|
||||||
message(STATUS "Using NSS")
|
set(pkg_config_names_private "${pkg_config_names_private} nss")
|
||||||
include_directories(${NSS3_INCLUDE_DIRS})
|
|
||||||
set(pkg_config_names_private "${pkg_config_names_private} nss3")
|
|
||||||
set(pkg_config_libs_private "${pkg_config_libs_private} -lnss3")
|
|
||||||
set(ZMQ_USE_NSS 1)
|
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR
|
find_package("NSS3")
|
||||||
"nss is not installed. Install it, then run CMake again")
|
if (NSS3_FOUND)
|
||||||
|
set(pkg_config_libs_private "${pkg_config_libs_private} -lnss3")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"nss is not installed. Install it, then run CMake again")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
message(STATUS "Using NSS")
|
||||||
|
include_directories(${NSS3_INCLUDE_DIRS})
|
||||||
|
link_directories(${NSS3_LIBRARY_DIRS})
|
||||||
|
set(OPTIONAL_LIBRARIES ${NSS3_LIBRARIES})
|
||||||
|
set(ZMQ_USE_NSS 1)
|
||||||
else()
|
else()
|
||||||
list(APPEND sources ${CMAKE_CURRENT_SOURCE_DIR}/external/sha1/sha1.c ${CMAKE_CURRENT_SOURCE_DIR}/external/sha1/sha1.h)
|
list(APPEND sources ${CMAKE_CURRENT_SOURCE_DIR}/external/sha1/sha1.c ${CMAKE_CURRENT_SOURCE_DIR}/external/sha1/sha1.h)
|
||||||
message("Using builtin sha1")
|
message("Using builtin sha1")
|
||||||
@ -139,7 +147,6 @@ if (NOT DISABLE_WS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
find_package(PkgConfig)
|
|
||||||
option(WITH_LIBBSD "Use libbsd instead of builtin strlcpy" ON)
|
option(WITH_LIBBSD "Use libbsd instead of builtin strlcpy" ON)
|
||||||
if (WITH_LIBBSD)
|
if (WITH_LIBBSD)
|
||||||
pkg_check_modules(LIBBSD "libbsd")
|
pkg_check_modules(LIBBSD "libbsd")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user