summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2025-08-09 23:32:44 +0300
committerAlexander Golubev <fatzer2@gmail.com>2025-08-10 10:11:19 +0300
commitdd898a208cf799d893bd9099fde63b1843bc88af (patch)
tree241b7ceda60581239d63e5e2fc9b8a4e236083c5
parenta04f73e57a596ac033efd272f46517a7202508ce (diff)
downloadtdelibs-dd898a20.tar.gz
tdelibs-dd898a20.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. (cherry picked from commit 1256297108752093c40ddd3fe025c0d98ff03a6a)
-rw-r--r--CMakeLists.txt14
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 )