Hi!
I had no time for KDE since end of September. Today I found a few
FindModules I've done in September for extra-cmake-modules. Links to old
threads:
http://mail.kde.org/pipermail/kde-buildsystem/2011-September/008128.html
http://mail.kde.org/pipermail/kde-buildsystem/2011-September/008130.html
http://mail.kde.org/pipermail/kde-buildsystem/2011-September/008131.html
Should I commit these files to ECM/find-modules/ or should I fix some other
issues?
--
Yury G. Kudryashov,
mailto: [email protected]
# - Try to find msgfmt
# Once done this will define
#
# MSGFMT_FOUND - system has msgfmt
# MSGFMT_EXECUTABLE - full path of msgfmt
# MSGFMT_VERSION - the version as reported by msgfmt --version
# Copyright (c) 2007, Montel Laurent <[email protected]>
# Copyright (c) 2011, Yury G. Kudryashov <[email protected]> (cleanup, version check)
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
find_program(MSGFMT_EXECUTABLE NAMES msgfmt)
if(MSGFMT_EXECUTABLE)
exec_program(${MSGFMT_EXECUTABLE} ARGS --version OUTPUT_VARIABLE _tmp)
if(${_tmp} MATCHES "msgfmt.* ([0-9]+\\.[0-9]+(\\.[0-9]+)?)")
set(MSGFMT_VERSION ${CMAKE_MATCH_1})
else()
message(WARNING "Failed to determine version of msgfmt")
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Msgfmt REQUIRED_VARS MSGFMT_EXECUTABLE
VERSION_VAR MSGFMT_VERSION)
mark_as_advanced(MSGFMT_EXECUTABLE)
# - Try to find the libusb-1.0 library
# Once done this defines
#
# LIBUSB1_FOUND - system has libusb-1.0
# LIBUSB1_INCLUDE_DIRS - the libusb-1.0 include directory
# LIBUSB1_LIBRARIES - Link these to use libusb-1.0
# Copyright (c) 2011 Yury Kudryashov, <[email protected]>
# Based on FindUSB.cmake which is:
# Copyright (c) 2006, 2008 Laurent Montel, <[email protected]>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
pkg_check_modules(PC_LIBUSB1 QUIET libusb-1.0)
find_path(LIBUSB1_INCLUDE_DIR libusb.h
HINTS ${PC_LIBUSB1_INCLUDEDIR} ${PC_LIBUSB1_INCLUDE_DIRS}
PATH_SUFFIXES libusb-1.0)
set(LIBUSB1_INCLUDE_DIRS ${LIBUSB1_INCLUDE_DIR})
find_library(LIBUSB1_LIBRARY NAMES usb-1.0
HINTS ${PC_LIBUSB1_LIBDIR} ${PC_LIBUSB1_LIBRARY_DIRS})
set(LIBUSB1_LIBRARIES ${LIBUSB1_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBUSB1 DEFAULT_MSG LIBUSB1_LIBRARIES LIBUSB1_INCLUDE_DIR)
include(FeatureSummary)
set_package_properties(USB PROPERTIES URL http://www.libusb.org/
DESCRIPTION "A library that provides uniform API to access USB devices on many OSes")
mark_as_advanced(LIBUSB1_INCLUDE_DIR LIBUSB1_LIBRARY)
# - Try to find the libusb-0.1 library
# Once done this defines
#
# LIBUSB_FOUND - system has libusb-0.1
# LIBUSB_INCLUDE_DIR - the libusb-0.1 include directory
# LIBUSB_LIBRARIES - Link these to use libusb-0.1
#
# If you're using this library, consider switching to libusb-1.0.
# Copyright (c) 2006, 2008 Laurent Montel, <[email protected]>
# Copyright (c) 2011 Yury Kudryashov, <[email protected]>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
pkg_check_modules(PC_LIBUSB QUIET libusb)
message(AUTHOR_WARNING "Consider switching from libusb-0.1 to libusb-1.0")
find_path(LIBUSB_INCLUDE_DIR usb.h
HINTS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
find_library(LIBUSB_LIBRARY NAMES usb
HINTS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
include(FeatureSummary)
set_package_properties(USB PROPERTIES URL http://www.libusb.org/
DESCRIPTION "A library that provides uniform API to access USB devices on many OSes")
mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARY)
_______________________________________________
Kde-buildsystem mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-buildsystem