mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
ci: add option to disable installation of web assets (#4906)
Fixes #4864
This commit is contained in:
@@ -47,6 +47,7 @@ tr_auto_option(ENABLE_GTK "Build GTK client" AUTO)
|
|||||||
tr_auto_option(ENABLE_QT "Build Qt client" AUTO)
|
tr_auto_option(ENABLE_QT "Build Qt client" AUTO)
|
||||||
tr_auto_option(ENABLE_MAC "Build Mac client" AUTO)
|
tr_auto_option(ENABLE_MAC "Build Mac client" AUTO)
|
||||||
tr_auto_option(REBUILD_WEB "Rebuild the web client's generated assets. Requires Node.js and network access." OFF)
|
tr_auto_option(REBUILD_WEB "Rebuild the web client's generated assets. Requires Node.js and network access." OFF)
|
||||||
|
option(INSTALL_WEB "Install the web client's generated assets." ON)
|
||||||
option(ENABLE_UTILS "Build utils (create, edit, show)" ON)
|
option(ENABLE_UTILS "Build utils (create, edit, show)" ON)
|
||||||
option(ENABLE_CLI "Build command-line client" OFF)
|
option(ENABLE_CLI "Build command-line client" OFF)
|
||||||
option(ENABLE_TESTS "Build unit tests" ON)
|
option(ENABLE_TESTS "Build unit tests" ON)
|
||||||
@@ -515,6 +516,7 @@ tr_add_external_auto_library(B64 libb64 b64
|
|||||||
CMAKE_ARGS
|
CMAKE_ARGS
|
||||||
-DLIBB64_SHARED:BOOL=OFF)
|
-DLIBB64_SHARED:BOOL=OFF)
|
||||||
|
|
||||||
|
set(TR_WEB_ASSETS ${CMAKE_SOURCE_DIR}/web/public_html)
|
||||||
if(NOT ${REBUILD_WEB} STREQUAL "OFF")
|
if(NOT ${REBUILD_WEB} STREQUAL "OFF")
|
||||||
find_program(NPM npm)
|
find_program(NPM npm)
|
||||||
if ("${NPM}" STREQUAL "NPM-NOTFOUND")
|
if ("${NPM}" STREQUAL "NPM-NOTFOUND")
|
||||||
@@ -755,9 +757,11 @@ if(ENABLE_TESTS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(tr_install_web DST_DIR)
|
function(tr_install_web DST_DIR)
|
||||||
install(
|
if(INSTALL_WEB)
|
||||||
DIRECTORY ${CMAKE_SOURCE_DIR}/web/public_html
|
install(
|
||||||
DESTINATION ${DST_DIR})
|
DIRECTORY ${TR_WEB_ASSETS}
|
||||||
|
DESTINATION ${DST_DIR})
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
add_subdirectory(libtransmission)
|
add_subdirectory(libtransmission)
|
||||||
@@ -779,7 +783,7 @@ foreach(P cli daemon gtk mac qt utils)
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if(NOT REBUILD_WEB AND (ENABLE_DAEMON OR ENABLE_GTK OR ENABLE_QT))
|
if(ENABLE_DAEMON OR ENABLE_GTK OR ENABLE_QT)
|
||||||
tr_install_web(${CMAKE_INSTALL_DATAROOTDIR}/${TR_NAME})
|
tr_install_web(${CMAKE_INSTALL_DATAROOTDIR}/${TR_NAME})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -797,7 +801,7 @@ if(INSTALL_DOC)
|
|||||||
DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC AND ENABLE_DAEMON AND ENABLE_QT AND ENABLE_UTILS AND WITH_CRYPTO STREQUAL "openssl")
|
if(MSVC AND ENABLE_DAEMON AND ENABLE_QT AND ENABLE_UTILS AND WITH_CRYPTO STREQUAL "openssl" AND INSTALL_WEB)
|
||||||
add_subdirectory(dist/msi)
|
add_subdirectory(dist/msi)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,4 @@ add_custom_target("${TR_NAME}-web"
|
|||||||
SOURCES
|
SOURCES
|
||||||
${WEB_SOURCES})
|
${WEB_SOURCES})
|
||||||
|
|
||||||
install(
|
set(TR_WEB_ASSETS ${CMAKE_CURRENT_BINARY_DIR}/public_html PARENT_SCOPE)
|
||||||
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/public_html
|
|
||||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${TR_NAME})
|
|
||||||
|
|||||||
Reference in New Issue
Block a user