diff --git a/cmake/modules/FindGRPC.cmake b/cmake/modules/FindGRPC.cmake deleted file mode 100644 index 15e0ab48..00000000 --- a/cmake/modules/FindGRPC.cmake +++ /dev/null @@ -1,70 +0,0 @@ -# -# Copyright (C) 2019 The Falco Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# - -option(BUILD_STATIC_GRPC - "Build a static version of gRPC (useful for building in Operating Systems that don't have the gRPC package)" OFF) - -if(NOT BUILD_STATIC_GRPC) - # todo(fntlnz, leodido): check that gRPC version is greater or equal than 1.8.0 - find_path(GRPCXX_INCLUDE NAMES grpc++/grpc++.h) - if(GRPCXX_INCLUDE) - set(GRPC_INCLUDE ${GRPCXX_INCLUDE}) - else() - find_path(GRPCPP_INCLUDE NAMES grpcpp/grpcpp.h) - set(GRPC_INCLUDE ${GRPCPP_INCLUDE}) - add_definitions(-DGRPC_INCLUDE_IS_GRPCPP=1) - endif() - find_library(GRPC_LIB NAMES grpc) - find_library(GRPCPP_LIB NAMES grpc++) - if(GRPC_INCLUDE - AND GRPC_LIB - AND GRPCPP_LIB) - message(STATUS "Found grpc: include: ${GRPC_INCLUDE}, C lib: ${GRPC_LIB}, C++ lib: ${GRPCPP_LIB}") - else() - message(FATAL_ERROR "Couldn't find system grpc") - endif() - find_program(GRPC_CPP_PLUGIN grpc_cpp_plugin) - if(NOT GRPC_CPP_PLUGIN) - message(FATAL_ERROR "System grpc_cpp_plugin not found") - endif() -else() - find_package(PkgConfig) - if(NOT PKG_CONFIG_FOUND) - message(FATAL_ERROR "pkg-config binary not found") - endif() - message(STATUS "Found pkg-config executable: ${PKG_CONFIG_EXECUTABLE}") - set(GRPC_SRC "${PROJECT_BINARY_DIR}/grpc-prefix/src/grpc") - message(STATUS "Using bundled grpc in '${GRPC_SRC}'") - set(GRPC_INCLUDE "${GRPC_SRC}/include") - set(GRPC_LIB "${GRPC_SRC}/libs/opt/libgrpc.a") - set(GRPCPP_LIB "${GRPC_SRC}/libs/opt/libgrpc++.a") - set(GRPC_CPP_PLUGIN "${GRPC_SRC}/bins/opt/grpc_cpp_plugin") - - ExternalProject_Add( - grpc - URL "https://github.com/grpc/grpc/archive/v1.25.0.tar.gz" - URL_MD5 "3a875f7b3f0e3bdd3a603500bcef3d41" - CONFIGURE_COMMAND "" - BUILD_COMMAND - CFLAGS=-Wno-implicit-fallthrough - PKG_CONFIG_PATH=${PROTOBUF_SRC} - PKG_CONFIG=${PKG_CONFIG_EXECUTABLE} - make - grpc_cpp_plugin - static_cxx - static_c - BUILD_IN_SOURCE 1 - BUILD_BYPRODUCTS ${GRPC_LIB} ${GRPCPP_LIB} - INSTALL_COMMAND "") - -endif() diff --git a/cmake/modules/FindJQ.cmake b/cmake/modules/FindJQ.cmake deleted file mode 100644 index 6673cf03..00000000 --- a/cmake/modules/FindJQ.cmake +++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright (C) 2019 The Falco Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# - -option(BUILD_STATIC_JQ - "Build a static version of jq (useful for building in Operating Systems that don't have the jq package)" OFF) - -if(NOT BUILD_STATIC_JQ) - find_path(JQ_INCLUDE jq.h PATH_SUFFIXES jq) - find_library(JQ_LIB NAMES jq) - if(JQ_INCLUDE AND JQ_LIB) - message(STATUS "Found jq: include: ${JQ_INCLUDE}, lib: ${JQ_LIB}") - else() - message(FATAL_ERROR "Couldn't find system jq") - endif() -else() - set(JQ_SRC "${PROJECT_BINARY_DIR}/jq-prefix/src/jq") - message(STATUS "Using bundled jq in '${JQ_SRC}'") - set(JQ_INCLUDE "${JQ_SRC}") - set(JQ_LIB "${JQ_SRC}/.libs/libjq.a") - ExternalProject_Add( - jq - URL "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-1.5.tar.gz" - URL_MD5 "0933532b086bd8b6a41c1b162b1731f9" - CONFIGURE_COMMAND ./configure --disable-maintainer-mode --enable-all-static --disable-dependency-tracking - BUILD_COMMAND ${CMD_MAKE} LDFLAGS=-all-static - BUILD_IN_SOURCE 1 - PATCH_COMMAND curl -L https://github.com/stedolan/jq/commit/8eb1367ca44e772963e704a700ef72ae2e12babd.patch | patch - INSTALL_COMMAND "") -endif() diff --git a/cmake/modules/FindProtobuf.cmake b/cmake/modules/FindProtobuf.cmake deleted file mode 100644 index 509d6962..00000000 --- a/cmake/modules/FindProtobuf.cmake +++ /dev/null @@ -1,46 +0,0 @@ -# -# Copyright (C) 2019 The Falco Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# - -option( - BUILD_STATIC_PROTOBUF - "Build a static version of protobuf (useful for building in Operating Systems that don't have the protobuf package)" - OFF) - -if(NOT BUILD_STATIC_PROTOBUF) - # todo(fntlnz, leodido): check that protobuf version is greater or equal than 3.5.0 - find_program(PROTOC NAMES protoc) - find_path(PROTOBUF_INCLUDE NAMES google/protobuf/message.h) - find_library(PROTOBUF_LIB NAMES libprotobuf.so) - if(PROTOC - AND PROTOBUF_INCLUDE - AND PROTOBUF_LIB) - message(STATUS "Found protobuf: compiler: ${PROTOC}, include: ${PROTOBUF_INCLUDE}, lib: ${PROTOBUF_LIB}") - else() - message(FATAL_ERROR "Couldn't find system protobuf") - endif() -else() - set(PROTOBUF_SRC "${PROJECT_BINARY_DIR}/protobuf-prefix/src/protobuf") - message(STATUS "Using bundled protobuf in '${PROTOBUF_SRC}'") - set(PROTOC "${PROTOBUF_SRC}/target/bin/protoc") - set(PROTOBUF_INCLUDE "${PROTOBUF_SRC}/target/include") - set(PROTOBUF_LIB "${PROTOBUF_SRC}/target/lib/libprotobuf.a") - ExternalProject_Add( - protobuf - URL "https://github.com/protocolbuffers/protobuf/releases/download/v3.8.0/protobuf-cpp-3.8.0.tar.gz" - URL_MD5 "9054bb5571905a28b3ae787d1d6cf8de" - CONFIGURE_COMMAND /usr/bin/env ./configure --with-zlib --prefix=${PROTOBUF_SRC}/target - BUILD_COMMAND ${CMD_MAKE} - BUILD_IN_SOURCE 1 - BUILD_BYPRODUCTS ${PROTOC} ${PROTOBUF_INCLUDE} ${PROTOBUF_LIB} - INSTALL_COMMAND make install) -endif() diff --git a/cmake/modules/FindYamlCpp.cmake b/cmake/modules/FindYamlCpp.cmake deleted file mode 100644 index 6738742f..00000000 --- a/cmake/modules/FindYamlCpp.cmake +++ /dev/null @@ -1,38 +0,0 @@ -# -# Copyright (C) 2019 The Falco Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# - -option( - BUILD_STATIC_YAMLCPP - "Build a static version of yaml-cpp (useful for building in Operating Systems that don't have the yaml-cpp package)" - OFF) - -if(NOT BUILD_STATIC_YAMLCPP) - find_path(YAMLCPP_INCLUDE_DIR NAMES yaml-cpp/yaml.h) - find_library(YAMLCPP_LIB NAMES yaml-cpp) - if(YAMLCPP_INCLUDE_DIR AND YAMLCPP_LIB) - message(STATUS "Found yamlcpp: include: ${YAMLCPP_INCLUDE_DIR}, lib: ${YAMLCPP_LIB}") - else() - message(FATAL_ERROR "Couldn't find system yamlcpp") - endif() -else() - set(YAMLCPP_SRC "${PROJECT_BINARY_DIR}/yamlcpp-prefix/src/yamlcpp") - message(STATUS "Using bundled yaml-cpp in '${YAMLCPP_SRC}'") - set(YAMLCPP_LIB "${YAMLCPP_SRC}/libyaml-cpp.a") - set(YAMLCPP_INCLUDE_DIR "${YAMLCPP_SRC}/include") - ExternalProject_Add( - yamlcpp - URL "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.6.2.tar.gz" - URL_MD5 "5b943e9af0060d0811148b037449ef82" - BUILD_IN_SOURCE 1 - INSTALL_COMMAND "") -endif()