2021-03-07 02:40:21 +02:00
|
|
|
# Try to find the DBusMenuQt library, once done this will define:
|
2014-11-13 01:04:59 +02:00
|
|
|
#
|
2020-02-07 00:14:00 +00:00
|
|
|
# DBUSMENUQT_FOUND - system has DBusMenuQt
|
|
|
|
# DBUSMENUQT_INCLUDE_DIR - the DBusMenuQt include directory
|
|
|
|
# DBUSMENUQT_LIBRARIES - the libraries needed to use DBusMenuQt
|
2020-02-19 20:52:40 +00:00
|
|
|
# DBUSMENUQT_DEFINITIONS - compiler switches required for using DBusMenuQt
|
2014-11-13 01:04:59 +02:00
|
|
|
#
|
2021-03-07 02:40:21 +02:00
|
|
|
# Copyright (c) 2020 Ivailo Monev <xakepa10@gmail.com>
|
2014-11-13 01:04:59 +02:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
|
2020-02-07 00:14:00 +00:00
|
|
|
set(DBUSMENU_QT_NAMES dbusmenu-katie dbusmenu-qt dbusmenu-qtd)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-10 20:40:01 +00:00
|
|
|
if(NOT WIN32)
|
|
|
|
find_package(PkgConfig)
|
|
|
|
foreach(name ${DBUSMENU_QT_NAMES})
|
|
|
|
if(NOT PC_DBUSMENUQT_FOUND)
|
|
|
|
pkg_check_modules(PC_DBUSMENUQT QUIET ${name})
|
|
|
|
|
|
|
|
set(DBUSMENUQT_INCLUDE_DIR ${PC_DBUSMENUQT_INCLUDE_DIRS})
|
|
|
|
set(DBUSMENUQT_LIBRARIES ${PC_DBUSMENUQT_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-18 15:53:03 +00:00
|
|
|
set(DBUSMENUQT_VERSION ${PC_DBUSMENUQT_VERSION})
|
2014-11-13 01:04:59 +02:00
|
|
|
set(DBUSMENUQT_DEFINITIONS ${PC_DBUSMENUQT_CFLAGS_OTHER})
|
|
|
|
|
2020-02-10 20:40:01 +00:00
|
|
|
if(NOT DBUSMENUQT_INCLUDE_DIR OR NOT DBUSMENUQT_LIBRARIES)
|
|
|
|
find_path(DBUSMENUQT_INCLUDE_DIR
|
|
|
|
NAMES dbusmenuexporter.h
|
|
|
|
PATH_SUFFIXES ${DBUSMENU_QT_NAMES}
|
|
|
|
HINTS $ENV{DBUSMENUQTDIR}/include
|
|
|
|
)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-10 20:40:01 +00:00
|
|
|
find_library(DBUSMENUQT_LIBRARIES
|
|
|
|
NAMES ${DBUSMENU_QT_NAMES}
|
|
|
|
HINTS $ENV{DBUSMENUQTDIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-07 00:14:00 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(DBusMenuQt
|
2020-02-18 15:53:03 +00:00
|
|
|
VERSION_VAR DBUSMENUQT_VERSION
|
2020-02-10 20:40:01 +00:00
|
|
|
REQUIRED_VARS DBUSMENUQT_LIBRARIES DBUSMENUQT_INCLUDE_DIR
|
2020-02-07 00:14:00 +00:00
|
|
|
)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-07 00:14:00 +00:00
|
|
|
mark_as_advanced(DBUSMENUQT_INCLUDE_DIR DBUSMENUQT_LIBRARIES)
|