diff --git a/cmake/Modules/MacroQbtCommonConfig.cmake b/cmake/Modules/MacroQbtCommonConfig.cmake index 391395bdafb..610db40e87e 100644 --- a/cmake/Modules/MacroQbtCommonConfig.cmake +++ b/cmake/Modules/MacroQbtCommonConfig.cmake @@ -90,4 +90,7 @@ macro(qbt_common_config) ) endif() + if (LibtorrentRasterbar_VERSION VERSION_GREATER_EQUAL ${minLibtorrentVersion}) + target_compile_definitions(qbt_common_cfg INTERFACE QBT_USES_LIBTORRENT2) + endif() endmacro(qbt_common_config) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 843b72fb9e1..d22c93a2790 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,7 +36,6 @@ endmacro() find_libtorrent(${minLibtorrent1Version}) if (LibtorrentRasterbar_FOUND AND (LibtorrentRasterbar_VERSION VERSION_GREATER_EQUAL 2.0)) find_libtorrent(${minLibtorrentVersion}) - target_compile_definitions(qbt_common_cfg PUBLIC QBT_USES_LIBTORRENT2) endif() # force variable type so that it always shows up in ccmake/cmake-gui frontends