From 874ccf0708d0be16aa4c67ed6c05633ff99ce03f Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 5 Nov 2014 10:57:06 -0800 Subject: [PATCH] add FindLibcuckoo module and instructions for dropping in libcuckoo --- .gitignore | 4 +++ cmake/modules/FindLibcuckoo.cmake | 29 +++++++++++++++++++ libraries/networking/CMakeLists.txt | 5 +++- .../networking/externals/libcuckoo/readme.txt | 14 +++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 cmake/modules/FindLibcuckoo.cmake create mode 100644 libraries/networking/externals/libcuckoo/readme.txt diff --git a/.gitignore b/.gitignore index 6e6b69cb66..74a5748b85 100644 --- a/.gitignore +++ b/.gitignore @@ -32,5 +32,9 @@ DerivedData interface/external/*/* !interface/external/*/readme.txt +# ignore libraries externals +libraries/*/externals/*/* +!libraries/*/externals/*/readme.txt + # Ignore interfaceCache for Linux users interface/interfaceCache/ diff --git a/cmake/modules/FindLibcuckoo.cmake b/cmake/modules/FindLibcuckoo.cmake new file mode 100644 index 0000000000..d997f25449 --- /dev/null +++ b/cmake/modules/FindLibcuckoo.cmake @@ -0,0 +1,29 @@ +# FindLibCuckoo.cmake +# +# Try to find libcuckoo. +# +# You can provide a LIBCUCKOO_ROOT_DIR which contains src and include directories +# +# Once done this will define +# +# LIBCUCKOO_FOUND - system found libcuckoo +# LIBCUCKOO_INCLUDE_DIRS - the libcuckoo include directory +# +# Created on 5/11/2014 by Stephen Birarda +# Copyright 2014 High Fidelity, Inc. +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# + +include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") +hifi_library_search_hints("libcuckoo") + +find_path(LIBCUCKOO_INCLUDE_DIRS cuckoohash_map.hh PATH_SUFFIXES libcuckoo HINTS ${LIBCUCKOO_SEARCH_DIRS}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + libcuckoo + "Could NOT find libcuckoo. Read libraries/networking/externals/libcuckoo/readme.txt" + LIBCUCKOO_INCLUDE_DIRS +) \ No newline at end of file diff --git a/libraries/networking/CMakeLists.txt b/libraries/networking/CMakeLists.txt index 50f41fe643..cf68bc464a 100644 --- a/libraries/networking/CMakeLists.txt +++ b/libraries/networking/CMakeLists.txt @@ -10,9 +10,12 @@ if (WIN32) target_link_libraries(${TARGET_NAME} ws2_32.lib) endif () -# find OpenSSL +# find required dependencies find_package(OpenSSL REQUIRED) +list(APPEND LIBCUCKOO_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/externals/libcuckoo") +find_package(libcuckoo REQUIRED) + if (APPLE AND ${OPENSSL_INCLUDE_DIR} STREQUAL "/usr/include") # this is a user on OS X using system OpenSSL, which is going to throw warnings since they're deprecating for their common crypto message(WARNING "The found version of OpenSSL is the OS X system version. This will produce deprecation warnings." diff --git a/libraries/networking/externals/libcuckoo/readme.txt b/libraries/networking/externals/libcuckoo/readme.txt new file mode 100644 index 0000000000..b86f8bc609 --- /dev/null +++ b/libraries/networking/externals/libcuckoo/readme.txt @@ -0,0 +1,14 @@ + +Instructions for adding the libcuckoo library to Interface +Stephen Birarda, November 5, 2014 + +1. Download the libcuckoo ZIP from the High Fidelity libcuckoo fork on Github. + https://github.com/highfidelity/libcuckoo/archive/master.zip + +2. Copy the libcuckoo folder from inside the ZIP to libraries/networking/externals/libcuckoo/. + + You should have the following structure: + + libraries/networking/externals/libcuckoo/libcuckoo/cuckoohash_map.hh + +3. Delete your build directory, run cmake and build, and you should be all set.