From 11eed50003b8590c83f6987fa614504ee52a150e Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Thu, 19 Dec 2019 11:47:25 +0000 Subject: [PATCH] build: out-of-source build for sysdig deps (CMake 3.5) Co-authored-by: Lorenzo Fontana Signed-off-by: Leonardo Di Donato --- cmake/modules/sysdig-repo/CMakeLists.txt | 2 +- cmake/modules/sysdig.cmake | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cmake/modules/sysdig-repo/CMakeLists.txt b/cmake/modules/sysdig-repo/CMakeLists.txt index 2466629d..bfa0c49e 100644 --- a/cmake/modules/sysdig-repo/CMakeLists.txt +++ b/cmake/modules/sysdig-repo/CMakeLists.txt @@ -28,7 +28,7 @@ endif() ExternalProject_Add( sysdig URL "https://github.com/draios/sysdig/archive/${SYSDIG_VERSION}.tar.gz" - URL_HASH SHA256=bd09607aa8beb863db07e695863f7dc543e2d39e7153005759d26a340ff66fa5 + # URL_HASH SHA256=bd09607aa8beb863db07e695863f7dc543e2d39e7153005759d26a340ff66fa5 CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" diff --git a/cmake/modules/sysdig.cmake b/cmake/modules/sysdig.cmake index a9adb504..aa661ff7 100644 --- a/cmake/modules/sysdig.cmake +++ b/cmake/modules/sysdig.cmake @@ -13,7 +13,15 @@ set(SYSDIG_WORKING_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/sysdig-repo") set(SYSDIG_REPO_DIR "${CMAKE_BINARY_DIR}/sysdig-repo") -execute_process(COMMAND "${CMAKE_COMMAND}" -B ${SYSDIG_REPO_DIR} WORKING_DIRECTORY "${SYSDIG_WORKING_DIR}") + +file(MAKE_DIRECTORY ${SYSDIG_REPO_DIR}) +# cd /path/to/build && cmake /path/to/source +execute_process(COMMAND "${CMAKE_COMMAND}" ${SYSDIG_WORKING_DIR} WORKING_DIRECTORY ${SYSDIG_REPO_DIR}) + +# todo(leodido, fntlnz) > use the following one when CMake version will be >= 3.13 + +# execute_process(COMMAND "${CMAKE_COMMAND}" -B ${SYSDIG_REPO_DIR} WORKING_DIRECTORY "${SYSDIG_WORKING_DIR}") + execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${SYSDIG_REPO_DIR}") set(SYSDIG_SOURCE_DIR "${SYSDIG_REPO_DIR}/sysdig-prefix/src/sysdig") @@ -31,3 +39,7 @@ add_subdirectory("${SYSDIG_SOURCE_DIR}/userspace/libscap" "${PROJECT_BINARY_DIR} # Add libsinsp directory add_subdirectory("${SYSDIG_SOURCE_DIR}/userspace/libsinsp" "${PROJECT_BINARY_DIR}/userspace/libsinsp") add_dependencies(sinsp tbb b64 luajit) + +if(USE_BUNDLED_DEPS) + add_dependencies(scap grpc curl jq) +endif()