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.
pull/370/head
Alexander Golubev 4 days ago
parent 2c51577e84
commit 1256297108

@ -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 )

Loading…
Cancel
Save