From 69017c7a213790cb3cb77300a3b57b65c6b05596 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 9 Apr 2020 12:39:55 +0200 Subject: [PATCH] CMake: Adding BUILD_COMPONENT_GUI and BUILD_COMPONENT_CLI (so user's can build either one or both). --- CMakeLists.txt | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12dedca..b752918 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,17 @@ project(eosio-keygen set( PROJECT_MAINTAINER "Henrik Hautakoski ") +# -------------------------------- +# Options +# -------------------------------- + +option(BUILD_COMPONENT_CLI "Build CLI Component" ON) +option(BUILD_COMPONENT_GUI "Build GUI Component (Qt5)" OFF) + +if (NOT BUILD_COMPONENT_CLI AND NOT BUILD_COMPONENT_GUI) + message(FATAL_ERROR "Atleast one of BUILD_COMPONENT_GUI,BUILD_COMPONENT_CLI must be set to ON") +endif() + # -------------------------------- # CMake settings # -------------------------------- @@ -60,12 +71,18 @@ configure_file(config.h.in "${PROJECT_BINARY_DIR}/config.h" @ONLY) include_directories(${PROJECT_BINARY_DIR}) # -------------------------------- -# Subdirectories +# Components # -------------------------------- add_subdirectory( common ) -add_subdirectory( cli ) -add_subdirectory( gui ) + +if (BUILD_COMPONENT_CLI) + add_subdirectory( cli ) +endif() + +if (BUILD_COMPONENT_GUI) + add_subdirectory( gui ) +endif() # -------------------------------- # Install