From 7a686a53f3445fa6397c0abf2c0f66e2e2a5dcb9 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 8 Feb 2023 17:47:07 -0600 Subject: [PATCH] build: renamed ENABLE_WEB build option for clarity (#4760) --- CMakeLists.txt | 19 +++++++++++-------- docs/Building-Transmission.md | 1 - 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f611b1352..9e42e5395 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,7 @@ option(ENABLE_DAEMON "Build daemon" ON) tr_auto_option(ENABLE_GTK "Build GTK client" AUTO) tr_auto_option(ENABLE_QT "Build Qt client" AUTO) tr_auto_option(ENABLE_MAC "Build Mac client" AUTO) -tr_auto_option(ENABLE_WEB "Build Web client" AUTO) +tr_auto_option(REBUILD_WEB "Rebuild the web client's generated assets. Requires Node.js and network access." OFF) option(ENABLE_UTILS "Build utils (create, edit, show)" ON) option(ENABLE_CLI "Build command-line client" OFF) option(ENABLE_TESTS "Build unit tests" ON) @@ -503,13 +503,13 @@ endif() tr_add_external_auto_library(B64 libb64 b64 TARGET libb64::libb64) -if(NOT ${ENABLE_WEB} STREQUAL "OFF") +if(NOT ${REBUILD_WEB} STREQUAL "OFF") find_program(NPM npm) if ("${NPM}" STREQUAL "NPM-NOTFOUND") - if ("${ENABLE_WEB}" STREQUAL "ON") + if ("${REBUILD_WEB}" STREQUAL "ON") message(FATAL_ERROR "Could NOT find NPM, minimum required is \"${NPM_MINIMUM}\"") else() # AUTO - set(ENABLE_WEB OFF) + set(REBUILD_WEB OFF) endif() else() execute_process(COMMAND "${NPM}" --version @@ -517,14 +517,17 @@ if(NOT ${ENABLE_WEB} STREQUAL "OFF") OUTPUT_VARIABLE NPM_VERSION_STRING) if ("${NPM_VERSION_STRING}" VERSION_GREATER_EQUAL "${NPM_MINIMUM}") message(STATUS "Found NPM: ${NPM} (found suitable version \"${NPM_VERSION_STRING}\", minimum required is \"${NPM_MINIMUM}\")") - set(ENABLE_WEB ON) - elseif ("${ENABLE_WEB}" STREQUAL "ON") + set(REBUILD_WEB ON) + elseif ("${REBUILD_WEB}" STREQUAL "ON") message(FATAL_ERROR "Found NPM: ${NPM} Found unsuitable version \"${NPM_VERSION_STRING}\", but required is at least \"${NPM_MINIMUM}\"") else() # AUTO message(STATUS "Found NPM: ${NPM} Found unsuitable version \"${NPM_VERSION_STRING}\", but required is at least \"${NPM_MINIMUM}\"") - set(ENABLE_WEB OFF) + set(REBUILD_WEB OFF) endif() endif() + if(REBUILD_WEB) + add_subdirectory(web) + endif() endif() if(WITH_INOTIFY) @@ -749,7 +752,7 @@ if(ENABLE_GTK AND ENABLE_NLS) add_subdirectory(po) endif() -foreach(P cli daemon gtk mac qt utils web) +foreach(P cli daemon gtk mac qt utils) string(TOUPPER "${P}" P_ID) if(ENABLE_${P_ID}) if(DEFINED ${P_ID}_PROJECT_DIR) diff --git a/docs/Building-Transmission.md b/docs/Building-Transmission.md index e4747c3df..8da31a3cd 100644 --- a/docs/Building-Transmission.md +++ b/docs/Building-Transmission.md @@ -160,7 +160,6 @@ To configure which components are built use the flags below. Each option can be set to `ON` or `OFF`, values shown below are the defaults. * `-DENABLE_DAEMON=ON` - build transmission daemon * `-DENABLE_QT=AUTO` - build the Qt client -* `-DENABLE_WEB=OFF` - build the Web client * `-DENABLE_UTILS=ON` - build transmission-remote, transmission-create, transmission-edit and transmission-show cli tools * `-DENABLE_CLI=OFF` - build the cli client