diff --git a/cmake/modules/FindCHM.cmake b/cmake/modules/FindCHM.cmake index f51073522..4e7ae2925 100644 --- a/cmake/modules/FindCHM.cmake +++ b/cmake/modules/FindCHM.cmake @@ -24,22 +24,10 @@ else (CHM_LIBRARY AND CHM_INCLUDE_DIR) ${GNUWIN32_DIR}/lib ) - if(CHM_INCLUDE_DIR AND CHM_LIBRARY) - set(CHM_FOUND TRUE) - endif(CHM_INCLUDE_DIR AND CHM_LIBRARY) - - if (CHM_FOUND) - if (NOT CHM_FIND_QUIETLY) - message(STATUS "Found CHM: ${CHM_LIBRARY}") - endif (NOT CHM_FIND_QUIETLY) - else (CHM_FOUND) - if (CHM_FIND_REQUIRED) - message(FATAL_ERROR "Could NOT find CHM") - endif (CHM_FIND_REQUIRED) - endif (CHM_FOUND) - - # ensure that they are cached - set(CHM_INCLUDE_DIR ${CHM_INCLUDE_DIR} CACHE INTERNAL "The chmlib include path") - set(CHM_LIBRARY ${CHM_LIBRARY} CACHE INTERNAL "The libraries needed to use chmlib") + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(CHM DEFAULT_MSG CHM_INCLUDE_DIR CHM_LIBRARY ) + # ensure that they are cached + set(CHM_INCLUDE_DIR ${CHM_INCLUDE_DIR} CACHE INTERNAL "The chmlib include path") + set(CHM_LIBRARY ${CHM_LIBRARY} CACHE INTERNAL "The libraries needed to use chmlib") endif (CHM_LIBRARY AND CHM_INCLUDE_DIR) diff --git a/cmake/modules/FindKadmos.cmake b/cmake/modules/FindKadmos.cmake index bfbcccc6e..24aedcafa 100644 --- a/cmake/modules/FindKadmos.cmake +++ b/cmake/modules/FindKadmos.cmake @@ -1,9 +1,9 @@ -# + # KADMOS_FOUND - system has KADMOS libs # KADMOS_INCLUDE_DIR - the KADMOS include directory # KADMOS_LIBRARIES - The libraries needed to use KADMOS -# Copyright (c) 2006, Laurent Montel, +# Copyright (c) 2006, 2007 Laurent Montel, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. @@ -17,22 +17,8 @@ FIND_PATH(KADMOS_INCLUDE_DIR kadmos.h) FIND_PATH(KADMOS_LIBRARY NAMES librep.a) -if (KADMOS_INCLUDE_DIR AND KADMOS_LIBRARY) - set(KADMOS_FOUND TRUE) - set(KADMOS_LIBRARIES ${SANE_LIBRARY}) -else (KADMOS_INCLUDE_DIR AND KADMOS_LIBRARY) - set(KADMOS_FOUND FALSE) -endif (KADMOS_INCLUDE_DIR AND KADMOS_LIBRARY) - -if (KADMOS_FOUND) - if (NOT Kadmos_FIND_QUIETLY) - message(STATUS "Found kadmos: ${KADMOS_LIBRARIES}") - endif (NOT Kadmos_FIND_QUIETLY) -else (KADMOS_FOUND) - if (NOT Kadmos_FIND_REQUIRED) - message(FATAL_ERROR "didn't find KADMOS") - endif (NOT Kadmos_FIND_REQUIRED) -endif (KADMOS_FOUND) +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Kadmos DEFAULT_MSG KADMOS_INCLUDE_DIR KADMOS_LIBRARY ) MARK_AS_ADVANCED(KADMOS_INCLUDE_DIR KADMOS_LIBRARIES KADMOS_LIBRARY)