Skip to content

Commit

Permalink
Use CMake variables for shared/static library suffixes
Browse files Browse the repository at this point in the history
  • Loading branch information
timwoj committed Sep 6, 2024
1 parent 2d42baf commit 1efc03b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions FindCAres.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ if (NOT HAVE_CARES)
find_path(CARES_ROOT_DIR NAMES "include/ares.h")

# Prefer linking statically but look for a shared library version too.
find_library(CARES_LIBRARIES NAMES libcares_static.a libcares.so
HINTS ${CARES_ROOT_DIR}/lib)
find_library(
CARES_LIBRARIES NAMES "libcares_static${CMAKE_STATIC_LIBRARY_SUFFIX}"
"libcares${CMAKE_SHARED_LIBRARY_SUFFIX}"
HINTS ${CARES_ROOT_DIR}/lib)

find_path(CARES_INCLUDE_DIRS NAMES "ares.h" HINTS ${CARES_ROOT_DIR}/include)

Expand Down
6 changes: 4 additions & 2 deletions FindKqueue.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ if (NOT HAVE_KQUEUE)
find_path(LIBKQUEUE_ROOT_DIR NAMES "include/sys/event.h")

# Prefer linking statically but look for a shared library version too.
find_library(LIBKQUEUE_LIBRARIES NAMES libkqueue.a libkqueue.so
HINTS ${LIBKQUEUE_ROOT_DIR}/lib)
find_library(
LIBKQUEUE_LIBRARIES NAMES "libkqueue${CMAKE_STATIC_LIBRARY_SUFFIX}"
"libkqueue${CMAKE_SHARED_LIBRARY_SUFFIX}"
HINTS ${LIBKQUEUE_ROOT_DIR}/lib)

find_path(LIBKQUEUE_INCLUDE_DIRS NAMES "sys/event.h"
HINTS ${LIBKQUEUE_ROOT_DIR}/include/kqueue)
Expand Down

0 comments on commit 1efc03b

Please sign in to comment.