1
mirror of https://github.com/qbittorrent/qBittorrent synced 2024-10-19 21:36:47 +02:00
qBittorrent/cmake/Modules/FeatureOptionsSetup.cmake
FranciscoPombal 46123b9989 CMake: overhaul and improve scripts
- Bump minimum required version and
make use of more modern language features
- Rely more on target_...() commands to establish dependency
relationships between targets rather than directory property commands
- Improve libtorrent package discovery
- Enable and handle application features more explicitly
- Improve user-facing output
- Fix various compilation issues on Windows (MSVC and MinGW) and macOS
- Improve handling of translations
- Add explanatory comments where relevant
- Make CMake scripts fully independent of qmake files/details
- Remove old functions/macros
2020-09-17 13:13:26 +01:00

15 lines
748 B
CMake

# Helper functions for coupling add_feature_info() or CMAKE_DEPENDENT_OPTION() and option()
function(feature_option _name _description _default)
string(CONCAT _desc "${_description} (default: ${_default})")
option("${_name}" "${_desc}" "${_default}")
add_feature_info("${_name}" "${_name}" "${_desc}")
endfunction()
include(CMakeDependentOption)
function(feature_option_dependent _name _description _default_opt _dependency _default_dep_not_sat)
string(CONCAT _desc "${_description} (default: ${_default_opt}; depends on condition: ${_dependency})")
CMAKE_DEPENDENT_OPTION("${_name}" "${_desc}" "${_default_opt}" "${_dependency}" "${_default_dep_not_sat}")
add_feature_info("${_name}" "${_name}" "${_desc}")
endfunction()