message("-- looking for libconfig")
find_path(LIBCONFIG_INCLUDE_DIR NAMES "libconfig.h" PATHS /usr/pkg /usr/local /usr PATH_SUFFIXES "include")
-find_path(LIBCONFIG_LIB_DIR NAMES "libconfig.so" PATHS /usr/pkg /usr/local /usr PATH_SUFFIXES "lib")
+find_path(LIBCONFIG_LIB_DIR NAMES "libconfig.so" "libconfig.dylib" PATHS /usr/pkg /usr/local /usr PATH_SUFFIXES "lib" "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
if(LIBCONFIG_INCLUDE_DIR AND LIBCONFIG_LIB_DIR)
set(LIBCONFIG_LIBRARIES config)
include(CheckSymbolExists)
find_path(POLARSSL_INCLUDE_DIR NAMES "version.h" PATHS /usr/pkg /usr/local /usr PATH_SUFFIXES "include/polarssl")
-find_path(POLARSSL_LIB_DIR NAMES "libpolarssl.so" PATHS /usr/pkg /usr/local /usr PATH_SUFFIXES "lib")
+find_path(POLARSSL_LIB_DIR NAMES "libpolarssl.so" "libpolarssl.dylib" PATHS /usr/pkg /usr/local /usr PATH_SUFFIXES "lib" "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
if(POLARSSL_INCLUDE_DIR AND POLARSSL_LIB_DIR)
set(POLARSSL_LIBRARIES polarssl)
include(FindPackageHandleStandardArgs)
find_path(PROTOBUFC_INCLUDE_DIR NAMES "protobuf-c.h" PATHS /usr/pkg /usr/local /usr PATH_SUFFIXES "include/google/protobuf-c")
-find_path(PROTOBUFC_LIB_DIR NAMES "libprotobuf-c.so" PATHS /usr/pkg /usr/local /usr PATH_SUFFIXES "lib")
+find_path(PROTOBUFC_LIB_DIR NAMES "libprotobuf-c.so" "libprotobuf-c.dylib" PATHS /usr/pkg /usr/local /usr PATH_SUFFIXES "lib" "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
if(PROTOBUFC_INCLUDE_DIR AND PROTOBUFC_LIB_DIR)
set(PROTOBUFC_LIBRARIES protobuf-c)