diff options
| author | Laurent Montel <montel@kde.org> | 2007-08-26 13:49:18 +0000 | 
|---|---|---|
| committer | Laurent Montel <montel@kde.org> | 2007-08-26 13:49:18 +0000 | 
| commit | 0e6e562f6144cb145c893aaf81c200e9bc4d8b73 (patch) | |
| tree | 650b4be545c2e671c98dda1f19d409168aa9289f | |
| parent | 7c2dbce61c2e54afab9eef2574a06aea45d1e11f (diff) | |
| download | extra-cmake-modules-0e6e562f6144cb145c893aaf81c200e9bc4d8b73.tar.gz extra-cmake-modules-0e6e562f6144cb145c893aaf81c200e9bc4d8b73.tar.bz2 | |
Use FIND_PACKAGE_HANDLE_STANDARD_ARGS
svn path=/trunk/KDE/kdelibs/; revision=704860
| -rw-r--r-- | modules/FindEigen.cmake | 16 | ||||
| -rw-r--r-- | modules/FindLinuxWirelesstools.cmake | 16 | ||||
| -rw-r--r-- | modules/FindPlasma.cmake | 16 | ||||
| -rw-r--r-- | modules/FindTIFF.cmake | 4 | ||||
| -rw-r--r-- | modules/FindUSB.cmake | 15 | 
5 files changed, 14 insertions, 53 deletions
| diff --git a/modules/FindEigen.cmake b/modules/FindEigen.cmake index 847239e0..733b2963 100644 --- a/modules/FindEigen.cmake +++ b/modules/FindEigen.cmake @@ -4,7 +4,7 @@  #  EIGEN_FOUND - system has eigen lib  #  EIGEN_INCLUDE_DIR - the eigen include directory  # -# Copyright (c) 2006, Montel Laurent, <montel@kde.org> +# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>  # Redistribution and use is allowed according to the terms of the BSD license.  # For details see the accompanying COPYING-CMAKE-SCRIPTS file. @@ -20,19 +20,9 @@ find_path(EIGEN_INCLUDE_DIR NAMES eigen/matrix.h       ${INCLUDE_INSTALL_DIR}     ) -if(EIGEN_INCLUDE_DIR) -  set(EIGEN_FOUND TRUE) -endif(EIGEN_INCLUDE_DIR) +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Eigen DEFAULT_MSG EIGEN_INCLUDE_DIR ) -if(EIGEN_FOUND) -   if(NOT Eigen_FIND_QUIETLY) -      message(STATUS "Found Eigen: ${EIGEN_INCLUDE_DIR}") -   endif(NOT Eigen_FIND_QUIETLY) -else(EIGEN_FOUND) -   if(Eigen_FIND_REQUIRED) -      message(FATAL_ERROR "Could NOT find Eigen") -   endif(Eigen_FIND_REQUIRED) -endif(EIGEN_FOUND)  mark_as_advanced(EIGEN_INCLUDE_DIR) diff --git a/modules/FindLinuxWirelesstools.cmake b/modules/FindLinuxWirelesstools.cmake index 844e6c56..794bba77 100644 --- a/modules/FindLinuxWirelesstools.cmake +++ b/modules/FindLinuxWirelesstools.cmake @@ -20,19 +20,9 @@ FIND_PATH(IW_INCLUDE_DIR iwlib.h)  FIND_LIBRARY(IW_LIBRARIES NAMES iw) -IF(IW_INCLUDE_DIR AND IW_LIBRARIES) -   SET(IW_FOUND TRUE) -ENDIF(IW_INCLUDE_DIR AND IW_LIBRARIES) - -IF(IW_FOUND) -  IF(NOT LinuxWirelesstools_FIND_QUIETLY) -    MESSAGE(STATUS "Found Linux Wirelesstools lib : ${IW_LIBRARIES}") -  ENDIF(NOT LinuxWirelesstools_FIND_QUIETLY) -ELSE(IW_FOUND) -  IF(LinuxWirelesstools_FIND_REQUIRED) -    MESSAGE(FATAL_ERROR "Could not find Linux Wirelesstools (libIW)") -  ENDIF(LinuxWirelesstools_FIND_REQUIRED) -ENDIF(IW_FOUND) +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(IW "Could not find Linux Wirelesstools (libIW)" IW_INCLUDE_DIR IW_LIBRARIES ) +  # show the IW_INCLUDE_DIR and IW_LIBRARIES variables only in the advanced view  MARK_AS_ADVANCED(IW_INCLUDE_DIR IW_LIBRARIES ) diff --git a/modules/FindPlasma.cmake b/modules/FindPlasma.cmake index 6779cd04..ca7953df 100644 --- a/modules/FindPlasma.cmake +++ b/modules/FindPlasma.cmake @@ -23,22 +23,14 @@ find_library(PLASMA_LIBS NAMES plasma          PATHS          ${LIB_INSTALL_DIR}  ) -if (PLASMA_LIBS AND PLASMA_INCLUDE_DIR) -    set(PLASMA_FOUND TRUE) +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Plasma DEFAULT_MSG PLASMA_LIBS PLASMA_INCLUDE_DIR ) + +if (PLASMA_FOUND)      find_file(PLASMA_OPENGL_FOUND glapplet.h                PATHS ${PLASMA_INCLUDE_DIR}                NO_DEFAULT_PATH) -endif (PLASMA_LIBS AND PLASMA_INCLUDE_DIR) - -if (PLASMA_FOUND) -    if (NOT Plasma_FIND_QUIETLY) -    message(STATUS "Found Plasma: ${PLASMA_LIBS}") -    endif (NOT Plasma_FIND_QUIETLY) -else (PLASMA_FOUND) -    if (Plasma_FIND_REQUIRED) -    message(FATAL_ERROR "Could NOT find Plasma") -    endif (Plasma_FIND_REQUIRED)  endif (PLASMA_FOUND)  mark_as_advanced(PLASMA_INCLUDE_DIR PLASMA_LIBS) diff --git a/modules/FindTIFF.cmake b/modules/FindTIFF.cmake index d9668ac6..6bdd53d6 100644 --- a/modules/FindTIFF.cmake +++ b/modules/FindTIFF.cmake @@ -10,10 +10,10 @@  # Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.  # See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. -if (TIFF_INCLUDE_DIR) +if (TIFF_INCLUDE_DIR AND TIFF_LIBRARY)    # Already in cache, be silent    set(TIFF_FIND_QUIETLY TRUE) -endif (TIFF_INCLUDE_DIR) +endif (TIFF_INCLUDE_DIR AND TIFF_LIBRARY)  find_path(TIFF_INCLUDE_DIR NAMES tiff.h ) diff --git a/modules/FindUSB.cmake b/modules/FindUSB.cmake index 91263fd5..6909b05a 100644 --- a/modules/FindUSB.cmake +++ b/modules/FindUSB.cmake @@ -32,19 +32,8 @@ else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)    set( LIBUSB_LIBRARIES ${LIBUSB_LIBRARY} CACHE INTERNAL "The libraries for libusb" ) -  if (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) -     set( LIBUSB_FOUND TRUE) -  endif (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) - -  if (LIBUSB_FOUND) -    if (NOT USB_FIND_QUIETLY) -      message(STATUS "Found LIBUSB: ${LIBUSB_LIBRARIES}") -    endif (NOT USB_FIND_QUIETLY) -  else (LIBUSB_FOUND) -    if (USB_FIND_REQUIRED) -      message(FATAL_ERROR "Could NOT find LIBUSB") -    endif (USB_FIND_REQUIRED) -  endif (LIBUSB_FOUND) +  include(FindPackageHandleStandardArgs) +  FIND_PACKAGE_HANDLE_STANDARD_ARGS(USB DEFAULT_MSG LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)    MARK_AS_ADVANCED(       LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES  | 
