Commit f97c06cd authored by Jan Grulich's avatar Jan Grulich
Browse files

Require NM 1.0.0 and newer

parent 2583b423
......@@ -40,7 +40,7 @@ set_package_properties(KF5ModemManagerQt PROPERTIES
TYPE OPTIONAL)
# Required only for getting information about NetworkManager version in CMake
find_package(NetworkManager 0.9.8.4)
find_package(NetworkManager 1.0.0)
set_package_properties(NetworkManager PROPERTIES
TYPE REQUIRED)
......
......@@ -9,7 +9,7 @@
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
# Copyright (c) 2007, Will Stephenson, <wstephenson@kde.org>
# Copyright (c) 2015, Jan Grulich, <jgrulich@redhat.com>
# Copyright (c) 2015-2018, Jan Grulich, <jgrulich@redhat.com>
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
......@@ -36,31 +36,22 @@
# SUCH DAMAGE.
IF (NETWORKMANAGER_INCLUDE_DIRS AND NM-CORE_INCLUDE_DIRS)
IF (NETWORKMANAGER_INCLUDE_DIRS)
# in cache already
SET(NetworkManager_FIND_QUIETLY TRUE)
ENDIF (NETWORKMANAGER_INCLUDE_DIRS AND NM-CORE_INCLUDE_DIRS)
ENDIF (NETWORKMANAGER_INCLUDE_DIRS)
IF (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
PKG_SEARCH_MODULE( NETWORKMANAGER NetworkManager )
PKG_SEARCH_MODULE(NETWORKMANAGER libnm)
IF (NETWORKMANAGER_FOUND)
IF (NetworkManager_FIND_VERSION AND ("${NETWORKMANAGER_VERSION}" VERSION_LESS "${NetworkManager_FIND_VERSION}"))
MESSAGE(FATAL_ERROR "NetworkManager ${NETWORKMANAGER_VERSION} is too old, need at least ${NetworkManager_FIND_VERSION}")
ELSE ()
# Since NetworkManager 1.0.0 we need to find different libraries
IF (NetworkManager_FIND_VERSION AND ("${NETWORKMANAGER_VERSION}" VERSION_GREATER "1.0.0" OR "${NETWORKMANAGER_VERSION}" VERSION_EQUAL "1.0.0"))
PKG_SEARCH_MODULE( NM-CORE libnm )
IF (NM-CORE_FOUND)
IF (NOT NetworkManager_FIND_QUIETLY)
MESSAGE(STATUS "Found libnm-core: ${NM-CORE_LIBRARY_DIRS}")
ENDIF ()
ELSE ()
MESSAGE(FATAL_ERROR "Could NOT find libnm-core, check FindPkgConfig output above!")
ENDIF ()
IF (NOT NetworkManager_FIND_QUIETLY)
MESSAGE(STATUS "Found NetworkManager: ${NETWORKMANAGER_LIBRARY_DIRS}")
ENDIF ()
ENDIF ()
ELSE ()
......@@ -68,5 +59,5 @@ IF (NOT WIN32)
ENDIF ()
ENDIF (NOT WIN32)
MARK_AS_ADVANCED(NETWORKMANAGER_INCLUDE_DIRS NM-UTIL_INCLUDE_DIRS NM-GLIB_INCLUDE_DIRS NM-CORE_INCLUDE_DIRS)
MARK_AS_ADVANCED(NETWORKMANAGER_INCLUDE_DIRS)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment