Browse Source

Merge pull request #13412 from Chocobo1/cmake

CMake improvements
adaptive-webui-19844
Mike Tzou 4 years ago committed by GitHub
parent
commit
1b2fc63089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      cmake/Modules/MacroQbtCommonConfig.cmake
  2. 12
      src/app/CMakeLists.txt

9
cmake/Modules/MacroQbtCommonConfig.cmake

@ -95,4 +95,13 @@ macro(qbt_common_config) @@ -95,4 +95,13 @@ macro(qbt_common_config)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
if (MSVC)
target_compile_options(qbt_common_cfg INTERFACE /guard:cf)
target_link_options(qbt_common_cfg INTERFACE /guard:cf
$<$<NOT:$<CONFIG:Debug>>:/OPT:REF /OPT:ICF>
# suppress linking warning due to /INCREMENTAL and /OPT:ICF being both ON
$<$<CONFIG:RelWithDebInfo>:/INCREMENTAL:NO>
)
endif()
endmacro(qbt_common_config)

12
src/app/CMakeLists.txt

@ -4,14 +4,22 @@ @@ -4,14 +4,22 @@
# Based on https://gist.github.com/giraldeau/546ba5512a74dfe9d8ea0862d66db412
file(GLOB QBT_TS_FILES "${qBittorrent_SOURCE_DIR}/src/lang/*.ts")
set_source_files_properties(${QBT_TS_FILES} PROPERTIES OUTPUT_LOCATION "${qBittorrent_BINARY_DIR}/src/lang")
qt5_add_translation(QBT_QM_FILES ${QBT_TS_FILES})
if (Qt5_VERSION VERSION_LESS 5.12)
qt5_add_translation(QBT_QM_FILES ${QBT_TS_FILES})
else()
qt5_add_translation(QBT_QM_FILES ${QBT_TS_FILES} OPTIONS -silent)
endif()
configure_file("${qBittorrent_SOURCE_DIR}/src/lang/lang.qrc" "${qBittorrent_BINARY_DIR}/src/lang/lang.qrc" COPYONLY)
if (WEBUI)
file(GLOB QBT_WEBUI_TS_FILES "${qBittorrent_SOURCE_DIR}/src/webui/www/translations/*.ts")
set_source_files_properties(${QBT_WEBUI_TS_FILES}
PROPERTIES OUTPUT_LOCATION "${qBittorrent_BINARY_DIR}/src/webui/www/translations")
qt5_add_translation(QBT_WEBUI_QM_FILES ${QBT_WEBUI_TS_FILES})
if (Qt5_VERSION VERSION_LESS 5.12)
qt5_add_translation(QBT_WEBUI_QM_FILES ${QBT_WEBUI_TS_FILES})
else()
qt5_add_translation(QBT_WEBUI_QM_FILES ${QBT_WEBUI_TS_FILES} OPTIONS -silent)
endif()
configure_file("${qBittorrent_SOURCE_DIR}/src/webui/www/translations/webui_translations.qrc"
"${qBittorrent_BINARY_DIR}/src/webui/www/translations/webui_translations.qrc" COPYONLY)
endif()

Loading…
Cancel
Save