From abec46f6cfa9233424b47d789638c9b823da1b16 Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nwpope@utu.fi> Date: Tue, 7 May 2019 08:27:33 +0300 Subject: [PATCH] Allow control of modules in cmake --- CMakeLists.txt | 20 +++++++++++++++++--- common/cpp/include/ftl/config.h.in | 1 + 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9b838e71..f0e730d44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,10 @@ include(GNUInstallDirs) include(CTest) enable_testing() +option(BUILD_VISION "Enable the vision component" ON) +option(BUILD_RECONSTRUCT "Enable the reconstruction component" ON) +option(BUILD_RENDERER "Enable the renderer component" ON) + set(THREADS_PREFER_PTHREAD_FLAG ON) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") @@ -118,10 +122,20 @@ endif() SET(CMAKE_USE_RELATIVE_PATHS ON) add_subdirectory(common/cpp) -add_subdirectory(renderer) add_subdirectory(net) -add_subdirectory(vision) -add_subdirectory(reconstruct) + +if (BUILD_RENDERER) + add_subdirectory(renderer) + set(HAVE_RENDER) +endif() + +if (BUILD_VISION) + add_subdirectory(vision) +endif() + +if (BUILD_RECONSTRUCT) + add_subdirectory(reconstruct) +endif() ### Generate Build Configuration Files ========================================= diff --git a/common/cpp/include/ftl/config.h.in b/common/cpp/include/ftl/config.h.in index 7c1284129..34d59cc59 100644 --- a/common/cpp/include/ftl/config.h.in +++ b/common/cpp/include/ftl/config.h.in @@ -6,6 +6,7 @@ #cmakedefine HAVE_URIPARSESINGLE #cmakedefine HAVE_CUDA #cmakedefine HAVE_OPENCV +#cmakedefine HAVE_RENDER extern const char *FTL_VERSION_LONG; extern const char *FTL_VERSION; -- GitLab