build: bump cmake version to 3.5.1 and modules

Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
This commit is contained in:
Lorenzo Fontana 2019-12-13 16:19:35 +00:00 committed by Leo Di Donato
parent 50af72c393
commit 34e3ad937e

View File

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
cmake_minimum_required(VERSION 3.3.2) cmake_minimum_required(VERSION 3.5.1)
project(falco) project(falco)
@ -27,6 +27,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "${SYSDIG_DIR}/cmake/modules") list(APPEND CMAKE_MODULE_PATH "${SYSDIG_DIR}/cmake/modules")
option(BUILD_WARNINGS_AS_ERRORS "Enable building with -Wextra -Werror flags") option(BUILD_WARNINGS_AS_ERRORS "Enable building with -Wextra -Werror flags")
option(USE_BUNDLED_DEPS "Enable bundled dependencies instead of using the system ones" OFF)
if(NOT DEFINED FALCO_ETC_DIR) if(NOT DEFINED FALCO_ETC_DIR)
set(FALCO_ETC_DIR "/etc/falco") set(FALCO_ETC_DIR "/etc/falco")
@ -101,17 +102,8 @@ set(CMD_MAKE make)
include(ExternalProject) include(ExternalProject)
# zlib
find_path(ZLIB_INCLUDE zlib.h PATH_SUFFIXES zlib)
find_library(ZLIB_LIB NAMES z)
if(ZLIB_INCLUDE AND ZLIB_LIB)
message(STATUS "Found zlib: include: ${ZLIB_INCLUDE}, lib: ${ZLIB_LIB}")
else()
message(FATAL_ERROR "Couldn't find system zlib")
endif()
# jq # jq
include(FindJQ) include(jq)
# jsoncpp # jsoncpp
set(JSONCPP_SRC "${SYSDIG_DIR}/userspace/libsinsp/third-party/jsoncpp") set(JSONCPP_SRC "${SYSDIG_DIR}/userspace/libsinsp/third-party/jsoncpp")
@ -149,8 +141,8 @@ ExternalProject_Add(b64
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
INSTALL_COMMAND "") INSTALL_COMMAND "")
# yamlcpp # yaml-cpp
include(FindYamlCpp) include(yaml-cpp)
# OpenSSL # OpenSSL
find_package(OpenSSL REQUIRED) find_package(OpenSSL REQUIRED)
@ -164,8 +156,7 @@ else()
endif() endif()
# libcurl # libcurl
find_package(CURL REQUIRED) include(cURL)
message(STATUS "Found CURL: include: ${CURL_INCLUDE_DIR}, lib: ${CURL_LIBRARIES}")
# LuaJIT # LuaJIT
set(LUAJIT_SRC "${PROJECT_BINARY_DIR}/luajit-prefix/src/luajit/src") set(LUAJIT_SRC "${PROJECT_BINARY_DIR}/luajit-prefix/src/luajit/src")
@ -254,6 +245,7 @@ ExternalProject_Add(civetweb
INSTALL_COMMAND ${CMD_MAKE} install-lib install-headers PREFIX=${CIVETWEB_SRC}/install "WITH_CPP=1 OPENSSL_API_1_1") INSTALL_COMMAND ${CMD_MAKE} install-lib install-headers PREFIX=${CIVETWEB_SRC}/install "WITH_CPP=1 OPENSSL_API_1_1")
# c-ares # c-ares
# TODO(fntlnz, leodido): c-ares is only needed for grpc? In case remove here!
find_path(CARES_INCLUDE NAMES ares.h) find_path(CARES_INCLUDE NAMES ares.h)
find_library(CARES_LIB NAMES libcares.so) find_library(CARES_LIB NAMES libcares.so)
if(CARES_INCLUDE AND CARES_LIB) if(CARES_INCLUDE AND CARES_LIB)
@ -262,12 +254,8 @@ else()
message(FATAL_ERROR "Couldn't find system c-ares") message(FATAL_ERROR "Couldn't find system c-ares")
endif() endif()
# protobuf
include(FindProtobuf)
# gRPC # gRPC
include(FindGRPC) include(gRPC)
# Installation # Installation
install(FILES falco.yaml install(FILES falco.yaml