mirror of
https://github.com/transmission/transmission.git
synced 2026-02-15 07:26:49 +00:00
Modernize CMake code (ongoing refactoring) (#4507)
* Reformat CMake code
* Bump minimum CMake version to 3.12
* Add target sources separately via `target_source()`
* Make `tr_win32_app_info()` add target sources on its own
* Don't use `include_directories()`
* Don't use `add_definitions()`
* Limit use of `add_compile_options()`
* Move VDKQueue target declaration to a subdirectory
* Add `tr_disable_source_files_compile()` helper
* Add `tr_target_glib_resources()` helper
* Add `tr_gettext_msgfmt()` helper
* Enable AUTOUIC for Qt client
* Enable AUTORCC for Qt client
* Remove AUTO{MOC,RCC,UIC} source group overrides
* Add `tr_target_idl_files()` helper
* Move source group setup to `tr_qt_add_translation()`
* Add `tr_target_xib_files()` helper
* Prefer `target_sources()` to intermediate variables
* Use explicit visibility versions of `target_*()` commands
* Prefer genexes to conditions in `target_*()` commands
* Add `tr_allow_compile_if()` helper
* Leave only top-level `project()`, remove the rest
* Minor fixups
* Fixup Mac QL plugin install
* Fixup IDE target folders and source groups
This commit is contained in:
28
dist/msi/CMakeLists.txt
vendored
28
dist/msi/CMakeLists.txt
vendored
@@ -1,5 +1,3 @@
|
||||
project(tr-dist-msi)
|
||||
|
||||
include(UtilityFunctions.cmake)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
@@ -56,7 +54,9 @@ else()
|
||||
set(TR_OPENSSL_SSL_NAME "ssleay32.dll")
|
||||
endif()
|
||||
|
||||
file(COPY "${CMAKE_SOURCE_DIR}/qt/icons/transmission.ico" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
file(
|
||||
COPY "${CMAKE_SOURCE_DIR}/qt/icons/transmission.ico"
|
||||
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
set(WEBSRCDIR "${CMAKE_INSTALL_PREFIX}/share/transmission/public_html")
|
||||
set(TRQMSRCDIR "${CMAKE_INSTALL_PREFIX}/share/transmission/translations")
|
||||
@@ -66,11 +66,11 @@ configure_file(TransmissionConfig.wxi.in TransmissionConfig.wxi)
|
||||
|
||||
wix_heat(WebUi.wxs "${WEBSRCDIR}" WebUiComponents WEBINSTALLDIR var.WebSrcDir)
|
||||
wix_heat(QtClientTranslations.wxs "${TRQMSRCDIR}" QtClientTranslationsComponents QMINSTALLDIR var.TrQmSrcDir)
|
||||
wix_heat(QtTranslations.wxs "${QTQMSRCDIR}" QtTranslationsComponents QMINSTALLDIR var.QtQmSrcDir XSL_TRANSFORM QtTranslations.xsl)
|
||||
wix_heat(QtTranslations.wxs "${QTQMSRCDIR}" QtTranslationsComponents QMINSTALLDIR var.QtQmSrcDir
|
||||
XSL_TRANSFORM QtTranslations.xsl)
|
||||
|
||||
wix_candle(${PROJECT_NAME}_OBJS
|
||||
ARCHITECTURE
|
||||
${ARCH}
|
||||
wix_candle(WIX_OBJS
|
||||
ARCHITECTURE ${ARCH}
|
||||
SOURCES
|
||||
components/CliTools.wxs
|
||||
components/CommonLibs.wxs
|
||||
@@ -95,14 +95,11 @@ wix_candle(${PROJECT_NAME}_OBJS
|
||||
"MsvcCrtMsmFile=${TR_MSVC_CRT_MSM_FILE}"
|
||||
"OpenSslCryptoName=${TR_OPENSSL_CRYPTO_NAME}"
|
||||
"OpenSslSslName=${TR_OPENSSL_SSL_NAME}"
|
||||
EXTRA_DEPENDS
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/TransmissionConfig.wxi")
|
||||
EXTRA_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/TransmissionConfig.wxi")
|
||||
|
||||
wix_light(${PROJECT_NAME}_OUTPUT
|
||||
NAME
|
||||
transmission-${MSI_FILENAME_VERSION}-${ARCH}
|
||||
OBJECTS
|
||||
${${PROJECT_NAME}_OBJS}
|
||||
wix_light(WIX_OUTPUT
|
||||
NAME transmission-${MSI_FILENAME_VERSION}-${ARCH}
|
||||
OBJECTS ${WIX_OBJS}
|
||||
EXTENSIONS
|
||||
WixUIExtension
|
||||
WixUtilExtension
|
||||
@@ -119,5 +116,4 @@ add_custom_target(pack-msi
|
||||
QtTranslations.xsl
|
||||
Transmission.wxs
|
||||
TransmissionConfig.wxi.in
|
||||
DEPENDS
|
||||
"${${PROJECT_NAME}_OUTPUT}")
|
||||
DEPENDS "${WIX_OUTPUT}")
|
||||
|
||||
16
dist/msi/UtilityFunctions.cmake
vendored
16
dist/msi/UtilityFunctions.cmake
vendored
@@ -22,8 +22,12 @@ function(find_msvc_crt_msm OUTPUT_VAR)
|
||||
set(CMN_PF_DIR "CommonProgramFiles(x86)")
|
||||
find_file(${OUTPUT_VAR}
|
||||
NAMES "${MSM_FILE}"
|
||||
PATHS ${VC_VER_DIRS} $ENV{${CMN_PF_DIR}}
|
||||
PATH_SUFFIXES "MergeModules" "Merge Modules")
|
||||
PATHS
|
||||
${VC_VER_DIRS}
|
||||
$ENV{${CMN_PF_DIR}}
|
||||
PATH_SUFFIXES
|
||||
"MergeModules"
|
||||
"Merge Modules")
|
||||
message(STATUS " * Result: ${${OUTPUT_VAR}}")
|
||||
|
||||
set(${OUTPUT_VAR} "${${OUTPUT_VAR}}" PARENT_SCOPE)
|
||||
@@ -76,7 +80,9 @@ function(wix_candle OUTPUT_VAR)
|
||||
add_custom_command(
|
||||
OUTPUT "${CANDLE_OUTPUT}"
|
||||
COMMAND candle ${OPTIONS} "${F}" -out "${CANDLE_OUTPUT}"
|
||||
DEPENDS "${F}" ${CANDLE_EXTRA_DEPENDS})
|
||||
DEPENDS
|
||||
"${F}"
|
||||
${CANDLE_EXTRA_DEPENDS})
|
||||
list(APPEND ${OUTPUT_VAR} "${CANDLE_OUTPUT}")
|
||||
endforeach()
|
||||
|
||||
@@ -96,7 +102,9 @@ function(wix_light OUTPUT_VAR)
|
||||
OUTPUT ${LIGHT_OUTPUT}
|
||||
BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/${LIGHT_NAME}.wixpdb"
|
||||
COMMAND light ${OPTIONS} -out "${CMAKE_CURRENT_BINARY_DIR}/${LIGHT_NAME}.msi" ${LIGHT_OBJECTS}
|
||||
DEPENDS ${LIGHT_OBJECTS} ${LIGHT_EXTRA_DEPENDS})
|
||||
DEPENDS
|
||||
${LIGHT_OBJECTS}
|
||||
${LIGHT_EXTRA_DEPENDS})
|
||||
|
||||
list(APPEND ${OUTPUT_VAR} ${LIGHT_OUTPUT})
|
||||
set(${OUTPUT_VAR} "${${OUTPUT_VAR}}" PARENT_SCOPE)
|
||||
|
||||
Reference in New Issue
Block a user