mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-14 01:37:56 +08:00
Problem: CMake build rejects to build with openpgm enabled
Solution: add optional lookup for openpgm via pkg-config
This commit is contained in:
parent
50a6c117f1
commit
6f597d0bd3
@ -375,11 +375,31 @@ if (MSVC)
|
|||||||
endif ()
|
endif ()
|
||||||
else ()
|
else ()
|
||||||
if (WITH_OPENPGM)
|
if (WITH_OPENPGM)
|
||||||
message (FATAL_ERROR "WITH_OPENPGM not implemented")
|
# message (FATAL_ERROR "WITH_OPENPGM not implemented")
|
||||||
|
|
||||||
|
if (NOT OPENPGM_PKGCONFIG_NAME)
|
||||||
|
SET (OPENPGM_PKGCONFIG_NAME "openpgm-5.2")
|
||||||
|
endif(NOT OPENPGM_PKGCONFIG_NAME)
|
||||||
|
|
||||||
|
SET (OPENPGM_PKGCONFIG_NAME ${OPENPGM_PKGCONFIG_NAME} CACHE STRING
|
||||||
|
"Name pkg-config shall use to find openpgm libraries and include paths"
|
||||||
|
FORCE )
|
||||||
|
|
||||||
|
find_package(PkgConfig)
|
||||||
|
pkg_check_modules (OPENPGM ${OPENPGM_PKGCONFIG_NAME})
|
||||||
|
|
||||||
|
if (OPENPGM_FOUND)
|
||||||
|
message (STATUS ${OPENPGM_PKGCONFIG_NAME}" found")
|
||||||
|
else ()
|
||||||
|
message (FATAL_ERROR
|
||||||
|
${OPENPGM_PKGCONFIG_NAME}" not found. openpgm is searchd via `pkg-config ${OPENPGM_PKGCONFIG_NAME}`. Consider providing a valid OPENPGM_PKGCONFIG_NAME")
|
||||||
|
endif ()
|
||||||
|
|
||||||
# DSO symbol visibility for openpgm
|
# DSO symbol visibility for openpgm
|
||||||
if (HAVE_FLAG_VISIBILITY_HIDDEN)
|
if (HAVE_FLAG_VISIBILITY_HIDDEN)
|
||||||
|
|
||||||
elseif (HAVE_FLAG_LDSCOPE_HIDDEN)
|
elseif (HAVE_FLAG_LDSCOPE_HIDDEN)
|
||||||
|
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
@ -780,7 +800,7 @@ endif ()
|
|||||||
if (WITH_PERF_TOOL)
|
if (WITH_PERF_TOOL)
|
||||||
foreach (perf-tool ${perf-tools})
|
foreach (perf-tool ${perf-tools})
|
||||||
add_executable (${perf-tool} perf/${perf-tool}.cpp)
|
add_executable (${perf-tool} perf/${perf-tool}.cpp)
|
||||||
target_link_libraries (${perf-tool} libzmq)
|
target_link_libraries (${perf-tool} libzmq ${OPTIONAL_LIBRARIES})
|
||||||
|
|
||||||
if (RT_LIBRARY)
|
if (RT_LIBRARY)
|
||||||
target_link_libraries (${perf-tool} ${RT_LIBRARY})
|
target_link_libraries (${perf-tool} ${RT_LIBRARY})
|
||||||
|
@ -138,7 +138,7 @@ if(WIN32)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# add library and include dirs for all targets
|
# add library and include dirs for all targets
|
||||||
link_libraries(libzmq)
|
link_libraries(libzmq ${OPTIONAL_LIBRARIES})
|
||||||
include_directories("${CMAKE_SOURCE_DIR}/../include")
|
include_directories("${CMAKE_SOURCE_DIR}/../include")
|
||||||
|
|
||||||
foreach(test ${tests})
|
foreach(test ${tests})
|
||||||
@ -157,6 +157,7 @@ foreach(test ${tests})
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(RT_LIBRARY)
|
if(RT_LIBRARY)
|
||||||
target_link_libraries(${test} ${RT_LIBRARY} )
|
target_link_libraries(${test} ${RT_LIBRARY} )
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user