Skip to content

Use CMAKE_STATIC_LIBRARY_* macros for FindRdKafka #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions cmake/FindRdKafka.cmake
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# Override default CMAKE_FIND_LIBRARY_SUFFIXES
# (Allows optional prioritization of static libraries during resolution)
if (CPPKAFKA_RDKAFKA_STATIC_LIB)
if (MSVC)
set(RDKAFKA_SUFFIX lib)
else()
set(RDKAFKA_SUFFIX a)
endif()
set(RDKAFKA_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
set(RDKAFKA_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
else()
if (MSVC)
set(RDKAFKA_SUFFIX dll)
else()
set(RDKAFKA_SUFFIX so)
endif()
set(RDKAFKA_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
set(RDKAFKA_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()

find_path(RDKAFKA_ROOT_DIR
Expand All @@ -31,7 +26,7 @@ if (CPPKAFKA_CMAKE_VERBOSE)
endif()

find_library(RDKAFKA_LIBRARY
NAMES rdkafka.${RDKAFKA_SUFFIX} librdkafka.${RDKAFKA_SUFFIX} rdkafka
NAMES ${RDKAFKA_PREFIX}rdkafka${RDKAFKA_SUFFIX} rdkafka
HINTS ${RDKAFKA_ROOT_DIR}/lib
)

Expand Down