diff options
author | Alexander Golubev <fatzer2@gmail.com> | 2025-08-09 23:32:44 +0300 |
---|---|---|
committer | Alexander Golubev <fatzer2@gmail.com> | 2025-08-09 23:42:40 +0300 |
commit | 1256297108752093c40ddd3fe025c0d98ff03a6a (patch) | |
tree | addd4a5c568775ed71ea6b2cf92cd4785a01f881 | |
parent | 2c51577e84cdddd5ced97ce0126e502fc72da29e (diff) | |
download | tdelibs-1256297108752093c40ddd3fe025c0d98ff03a6a.tar.gz tdelibs-1256297108752093c40ddd3fe025c0d98ff03a6a.zip |
Allow build without libnm installed
libnm is not actually required, but rather used only to determine the
value of NM_VPN_SERVICE_DIR. So it's fine to build with NM support but
without the lib. Since we already provide a default for the parameter
print a warning instead of a fatal message in case the value couldn't
be determined.
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e5fde6fe3..505977a9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1343,12 +1343,18 @@ endif() if( WITH_NETWORK_MANAGER_BACKEND ) pkg_search_module( LIBNM libnm ) - if( NOT LIBNM_FOUND ) - tde_message_fatal( "libnm was requested but it was not found on your system." ) - endif( NOT LIBNM_FOUND ) - pkg_get_variable( NM_VPN_SERVICE_DIR libnm vpnservicedir ) + if( LIBNM_FOUND ) + pkg_get_variable( NM_VPN_SERVICE_DIR libnm vpnservicedir ) + endif( ) if( "${NM_VPN_SERVICE_DIR}" STREQUAL "" ) set( NM_VPN_SERVICE_DIR "/usr/lib/NetworkManager/VPN" ) + message( WARNING "NetworkManager support was requested, but the value for NM_VPN_SERVICE_DIR " + "couldn't be determined (either because NetworkManger or libnm's pkg-config " + "files are not installed or they don't declare it explicitly). " + "Falling back to the default value:\n" + " ${NM_VPN_SERVICE_DIR}\n" + "If the value doesn't suite your needs consider setting it manually by " + "passing \"-DNM_VPN_SERVICE_DIR=/path/to/your/NetworkManager/VPN\" to cmake." ) endif( "${NM_VPN_SERVICE_DIR}" STREQUAL "" ) endif( WITH_NETWORK_MANAGER_BACKEND ) |