1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
include(DownloadExternal)
# Download GoogleTest
if(DOWNLOAD_GTEST)
download_external(GTEST "googletest-release-1.7.0"
"https://github.com/google/googletest/archive/release-1.7.0.zip"
"ef5e700c8a0f3ee123e2e0209b8b4961")
endif()
if(DOWNLOAD_SPDLOG)
download_external(SPDLOG "spdlog-0.14.0"
"https://github.com/gabime/spdlog/archive/v0.14.0.zip"
"f213d83c466aa7044a132e2488d71b11"
"spdlog-1")
endif()
find_package(spdlog CONFIG REQUIRED)
# Find standard libraries
find_package(Socket REQUIRED)
find_package(Threads REQUIRED)
if(NOT MINGW)
find_package(FUSE REQUIRED)
endif()
find_library(RT_LIBRARY rt)
message(STATUS "RT_LIBRARY: ${RT_LIBRARY}")
if(ENABLE_TCMALLOC)
find_library(TCMALLOC_LIBRARY NAMES tcmalloc_minimal)
message(STATUS "TCMALLOC_LIBRARY: ${TCMALLOC_LIBRARY}")
endif()
# Find extra binaries
find_program(A2X_BINARY a2x)
message(STATUS "a2x: ${A2X_BINARY}")
# Find Zlib
find_package(ZLIB)
if(ZLIB_FOUND)
message(STATUS "Found Zlib ${ZLIB_VERSION_STRING}")
set(LIZARDFS_HAVE_ZLIB_H 1)
else()
message(STATUS "Could not find Zlib")
message(STATUS " This dependency is optional.")
message(STATUS " If it's installed in a non-standard path, set ZLIB_ROOT variable")
message(STATUS " to point this path (cmake -DZLIB_ROOT=...)")
endif()
# Find Systemd
INCLUDE(FindPkgConfig)
pkg_check_modules(SYSTEMD libsystemd)
if(SYSTEMD_FOUND)
check_include_files(systemd/sd-daemon.h LIZARDFS_HAVE_SYSTEMD_SD_DAEMON_H)
message(STATUS "Found Systemd ${SYSTEMD_VERSION_STRING}")
else()
message(STATUS "Could not find Systemd (but it is not required)")
endif()
# Find Boost
set(BOOST_MIN_VERSION "1.48.0")
find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS filesystem iostreams program_options system)
# Find Thrift
find_package(Thrift COMPONENTS library)
if(THRIFT_FOUND)
message(STATUS "Found Thrift")
else()
message(STATUS "Could NOT find Thrift (but it's not required)")
message(STATUS " If it's installed in a non-standard path, set THRIFT_ROOT variable")
message(STATUS " to point this path (cmake -DTHRIFT_ROOT=...)")
endif()
# Find Polonaise
set(POLONAISE_REQUIRED_VERSION 0.3.1)
find_package(Polonaise ${POLONAISE_REQUIRED_VERSION} EXACT QUIET NO_MODULE NO_CMAKE_BUILDS_PATH)
if(POLONAISE_FOUND)
message(STATUS "Found Polonaise")
else()
message(STATUS "Could NOT find Polonaise v${POLONAISE_REQUIRED_VERSION} (but it's not required)")
if(Polonaise_CONSIDERED_VERSIONS)
message(STATUS " Incompatible versions ${Polonaise_CONSIDERED_VERSIONS} "
"found in ${Polonaise_CONSIDERED_CONFIGS}")
endif()
message(STATUS " If it's installed in a non-standard path, set Polonaise_DIR variable")
message(STATUS " to point this path (cmake -DPolonaise_DIR=...)")
endif()
# Find crcutil
if(NOT BIG_ENDIAN)
INCLUDE(FindPkgConfig)
pkg_check_modules(CRCUTIL libcrcutil)
if(CRCUTIL_FOUND)
message(STATUS "Found libcrcutil")
set(HAVE_CRCUTIL 1)
else()
message(STATUS "Could NOT find system libcrcutil (but it's not required)")
set(CRCUTIL_VERSION crcutil-1.0)
message(STATUS "Using bundled ${CRCUTIL_VERSION}")
set(HAVE_CRCUTIL 1)
set(CRCUTIL_LIBRARIES "crcutil")
set(CRCUTIL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/external/${CRCUTIL_VERSION}/code)
set(CRCUTIL_SOURCE_DIR ${CMAKE_SOURCE_DIR}/external/${CRCUTIL_VERSION}/code)
if(CXX_HAS_MCRC32)
set(CRCUTIL_CXX_FLAGS "-mcrc32")
else()
set(CRCUTIL_CXX_FLAGS "")
endif()
endif()
endif()
set(GTEST_NAME gtest)
# Find GoogleTest
if(ENABLE_TESTS)
set(GTEST_INCLUDE_DIRS /usr/include)
set(TEST_LIBRARIES "" CACHE INTERNAL "" FORCE)
endif()
# Find Judy
find_package(Judy)
if(JUDY_FOUND)
set(LIZARDFS_HAVE_JUDY YES)
set(LIZARDFS_HAVE_WORKING_JUDY1 ${JUDY_HAVE_WORKING_JUDY1})
endif()
# Find PAM libraries
find_package(PAM)
if(PAM_FOUND)
set(LIZARDFS_HAVE_PAM YES)
endif()
# Find BerkeleyDB
find_package(DB 11.2.5.2)
# Find Intel Storage Acceleration library
find_library(ISAL_LIBRARY isal)
if(APPLE)
find_library(ISAL_PIC_LIBRARY libisal.dylib)
else()
find_library(ISAL_PIC_LIBRARY libisal.so)
endif()
if(NOT ISAL_PIC_LIBRARY)
find_library(ISAL_PIC_LIBRARY isal_pic)
endif()
if (NOT ISAL_PIC_LIBRARY)
message(WARNING "Some systems may require position-independent ISA-L library.")
endif()
message(STATUS "ISAL(Intel Storage Acceleration) LIBRARY: ${ISAL_LIBRARY}")
message(STATUS "ISAL PIC LIBRARY: ${ISAL_PIC_LIBRARY}")
# Download nfs-ganesha
if(ENABLE_NFS_GANESHA)
download_external(NFS_GANESHA "nfs-ganesha-2.5-stable"
"https://github.com/nfs-ganesha/nfs-ganesha/archive/V2.5-stable.zip")
download_external(NTIRPC "ntirpc-1.5"
"https://github.com/nfs-ganesha/ntirpc/archive/v1.5.zip")
endif()
|