From a8169a0139ad0a1c16885ce5534ccaeeead39af2 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Sun, 26 Apr 2009 18:33:09 +0000 Subject: [PATCH] Use cmake macro find_package_handle_standard_args() git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29416 a592a061-630c-0410-9148-cb99ea01b6c8 --- .../cmake/modules/FindAiksaurusLIB.cmake | 28 ++++++------------- development/cmake/modules/FindMyThesLIB.cmake | 18 +++--------- 2 files changed, 13 insertions(+), 33 deletions(-) diff --git a/development/cmake/modules/FindAiksaurusLIB.cmake b/development/cmake/modules/FindAiksaurusLIB.cmake index 29fe2d0e7f..97370b8b9a 100644 --- a/development/cmake/modules/FindAiksaurusLIB.cmake +++ b/development/cmake/modules/FindAiksaurusLIB.cmake @@ -5,15 +5,15 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) -if (AIKSAURUS_INCLUDE_DIR) +if (AIKSAURUSLIB_INCLUDE_DIR) # Already in cache, be silent - set(AIKSAURUS_FIND_QUIETLY TRUE) + set(AIKSAURUSLIB_FIND_QUIETLY TRUE) endif() -find_path(AIKSAURUS_INCLUDE_DIR NAMES Aiksaurus.h +find_path(AIKSAURUSLIB_INCLUDE_DIR NAMES Aiksaurus.h PATH_SUFFIXES "" "Aiksaurus") -if(AIKSAURUS_INCLUDE_DIR) - if(AIKSAURUS_INCLUDE_DIR MATCHES "Aiksaurus") +if(AIKSAURUSLIB_INCLUDE_DIR) + if(AIKSAURUSLIB_INCLUDE_DIR MATCHES "Aiksaurus") set(AIKSAURUS_H Aiksaurus/Aiksaurus.h) else() set(AIKSAURUS_H Aiksaurus.h) @@ -26,19 +26,9 @@ find_library(AIKSAURUSLIB_LIBRARY NAMES ${POTENTIAL_AIKSAURUS_LIBS} PATHS /usr/lib /usr/local/lib) -if(AIKSAURUS_INCLUDE_DIR AND AIKSAURUSLIB_LIBRARY) - set(AIKSAURUSLIB_FOUND TRUE) -endif() - -if(AIKSAURUSLIB_FOUND) - if(NOT AIKSAURUS_FIND_QUIETLY) - message(STATUS "Found AIKSAURUS: ${AIKSAURUSLIB_LIBRARY}") - endif() -else() - if(AIKSAURUS_FIND_REQUIRED) - message(STATUS "Looked for AIKSAURUS libraries named ${POTENTIAL_AIKSAURUS_LIBS}.") - message(STATUS "Found no acceptable AIKSAURUS library. This is fatal.") - endif() -endif() +# handle the QUIETLY and REQUIRED arguments and set AIKSAURUSLIB_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(AIKSAURUSLIB DEFAULT_MSG AIKSAURUSLIB_LIBRARY AIKSAURUSLIB_INCLUDE_DIR) mark_as_advanced(AIKSAURUSLIB_LIBRARY AIKSAURUSLIB_INCLUDE_DIR) diff --git a/development/cmake/modules/FindMyThesLIB.cmake b/development/cmake/modules/FindMyThesLIB.cmake index bfcef1489d..42d63a0904 100644 --- a/development/cmake/modules/FindMyThesLIB.cmake +++ b/development/cmake/modules/FindMyThesLIB.cmake @@ -21,19 +21,9 @@ find_library(MYTHESLIB_LIBRARY NAMES ${POTENTIAL_MYTHES_LIBS} PATHS /usr/lib /usr/local/lib) -if(MYTHESLIB_INCLUDE_DIR AND MYTHESLIB_LIBRARY) - set(MYTHESLIB_FOUND TRUE) -endif() - -if(MYTHESLIB_FOUND) - if(NOT MYTHESLIB_FIND_QUIETLY) - message(STATUS "Found MYTHES: ${MYTHESLIB_LIBRARY}") - endif() -else() - if(MYTHESLIB_FIND_REQUIRED) - message(STATUS "Looked for MYTHES libraries named ${POTENTIAL_MYTHES_LIBS}.") - message(STATUS "Found no acceptable MYTHES library. This is fatal.") - endif() -endif() +# handle the QUIETLY and REQUIRED arguments and set MYTHESLIB_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(MYTHESLIB DEFAULT_MSG MYTHESLIB_LIBRARY MYTHESLIB_INCLUDE_DIR) mark_as_advanced(MYTHESLIB_LIBRARY MYTHESLIB_INCLUDE_DIR)