kdelibs/cmake/modules/FindDBusMenuQt.cmake

50 lines
1.6 KiB
CMake
Raw Normal View History

# Try to find the DBusMenuQt library, once done this will define:
2014-11-13 01:04:59 +02:00
#
# DBUSMENUQT_FOUND - system has DBusMenuQt
# DBUSMENUQT_INCLUDE_DIR - the DBusMenuQt include directory
# DBUSMENUQT_LIBRARIES - the libraries needed to use DBusMenuQt
# DBUSMENUQT_DEFINITIONS - compiler switches required for using DBusMenuQt
2014-11-13 01:04:59 +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.
set(DBUSMENU_QT_NAMES dbusmenu-katie dbusmenu-qt dbusmenu-qtd)
2014-11-13 01:04:59 +02: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
set(DBUSMENUQT_VERSION ${PC_DBUSMENUQT_VERSION})
2014-11-13 01:04:59 +02:00
set(DBUSMENUQT_DEFINITIONS ${PC_DBUSMENUQT_CFLAGS_OTHER})
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
find_library(DBUSMENUQT_LIBRARIES
NAMES ${DBUSMENU_QT_NAMES}
HINTS $ENV{DBUSMENUQTDIR}/lib
)
endif()
2014-11-13 01:04:59 +02:00
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DBusMenuQt
VERSION_VAR DBUSMENUQT_VERSION
REQUIRED_VARS DBUSMENUQT_LIBRARIES DBUSMENUQT_INCLUDE_DIR
)
2014-11-13 01:04:59 +02:00
mark_as_advanced(DBUSMENUQT_INCLUDE_DIR DBUSMENUQT_LIBRARIES)