Prefer static libraries for some dependencies on OS X

This makes binary packaging easier because OS X doesn't ship with
all the shared libraries we may link against (libmagic and libGeoIP
in this case)
This commit is contained in:
Jon Siwek 2011-01-06 16:59:48 -06:00
parent b496d63632
commit e1ebf81f76
2 changed files with 18 additions and 2 deletions

View file

@ -21,8 +21,16 @@ find_path(LibGeoIP_ROOT_DIR
NAMES include/GeoIPCity.h
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# the static version of the library is preferred on OS X for the
# purposes of making packages (libGeoIP doesn't ship w/ OS X)
set(libgeoip_names libGeoIp.a GeoIP)
else ()
set(libgeoip_names GeoIP)
endif ()
find_library(LibGeoIP_LIBRARY
NAMES GeoIP
NAMES ${libgeoip_names}
HINTS ${LibGeoIP_ROOT_DIR}/lib
)

View file

@ -21,8 +21,16 @@ find_path(LibMagic_ROOT_DIR
NAMES include/magic.h
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# the static version of the library is preferred on OS X for the
# purposes of making packages (libmagic doesn't ship w/ OS X)
set(libmagic_names libmagic.a magic)
else ()
set(libmagic_names magic)
endif ()
find_library(LibMagic_LIBRARY
NAMES magic
NAMES ${libmagic_names}
HINTS ${LibMagic_ROOT_DIR}/lib
)