From 1256297108752093c40ddd3fe025c0d98ff03a6a Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Sat, 9 Aug 2025 23:32:44 +0300 Subject: [PATCH] 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. --- CMakeLists.txt | 14 ++++++++++---- 1 file 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 )