commit 77ee91ccfe82377439ad329963ca759346f1a34e
Author: Kornel Benko <[email protected]>
Date:   Tue May 13 12:30:20 2014 +0200

    Cmake build: Use find_package_handle_standard_args() consistently

diff --git a/development/cmake/modules/FindASPELL.cmake 
b/development/cmake/modules/FindASPELL.cmake
index 6054d6a..0900b4c 100644
--- a/development/cmake/modules/FindASPELL.cmake
+++ b/development/cmake/modules/FindASPELL.cmake
@@ -81,27 +81,23 @@ else()
        set(ASPELL_LIBRARY ${ASPELL_LIBRARY_RELEASE} CACHE STRING "Aspell 
library" FORCE)
 endif()
 
-if(ASPELL_INCLUDE_DIR AND ASPELL_LIBRARY)
-        set(ASPELL_FOUND TRUE)
-endif()
+# handle the QUIETLY and REQUIRED arguments and DEFAULT_MSG
+# set ASPELL_FOUND to TRUE if all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(ASPELL DEFAULT_MSG ASPELL_LIBRARY 
ASPELL_INCLUDE_DIR)
 
-if(ASPELL_FOUND)
-       if (NOT ASPELL_FIND_QUIETLY)
-       message(STATUS "Found ASPELL: ${ASPELL_LIBRARY}")
-       endif()
-else()
-       if (ASPELL_FIND_REQUIRED)
-       message("aspell header      : ${ASPELL_INCLUDE_DIR}")
-       message("aspell lib release : ${ASPELL_LIBRARY_RELEASE}")
-       message("aspell lib debug   : ${ASPELL_LIBRARY_DEBUG}") 
-       if(MSVC_IDE)
-               # the ide needs the debug and release version
-               if(NOT ASPELL_LIBRARY_DEBUG OR NOT ASPELL_LIBRARY_RELEASE)
-                        message(FATAL_ERROR "\nCould NOT find the debug AND 
release version of the aspell library.\nYou need to have both to use MSVC 
projects.\nPlease build and install both kdelibs/win/ libraries first.\n")
-               endif()
-       endif()
-       message(FATAL_ERROR "Could NOT find ASPELL")
-       endif()
+if(NOT ASPELL_FOUND)
+  if (ASPELL_FIND_REQUIRED)
+    message("aspell header      : ${ASPELL_INCLUDE_DIR}")
+    message("aspell lib release : ${ASPELL_LIBRARY_RELEASE}")
+    message("aspell lib debug   : ${ASPELL_LIBRARY_DEBUG}")
+    if(MSVC_IDE)
+      # the ide needs  the debug and release version
+      if(NOT ASPELL_LIBRARY_DEBUG OR NOT ASPELL_LIBRARY_RELEASE)
+       message(FATAL_ERROR "\nCould NOT find the debug AND release version of 
the aspell library.\nYou need to have both to use MSVC projects.\nPlease build 
and install both kdelibs/win/ libraries first.\n")
+      endif()
+    endif()
+  endif()
 endif()
 
 MARK_AS_ADVANCED(ASPELL_INCLUDE_DIR ASPELL_LIBRARY ASPELL_LIBRARY_RELEASE 
ASPELL_LIBRARY_DEBUG)
diff --git a/development/cmake/modules/FindEnchant.cmake 
b/development/cmake/modules/FindEnchant.cmake
index d4164b6..d7548a8 100644
--- a/development/cmake/modules/FindEnchant.cmake
+++ b/development/cmake/modules/FindEnchant.cmake
@@ -14,21 +14,9 @@ else()
                /opt/local/include/enchant)
 endif()
 
-if (ENCHANT_LIBRARY AND ENCHANT_INCLUDE_DIR)
-       set(ENCHANT_FOUND TRUE)
-       message(STATUS "Building with USE_ENCHANT")
-else()
-       message(STATUS "Enchant not found, building without enchant support")
-endif()
-
-
-# handle the QUIETLY and REQUIRED arguments and 
+# handle the QUIETLY and REQUIRED arguments and
 # set ENCHANT_FOUND to TRUE if all listed variables are TRUE
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(ENCHANT DEFAULT_MSG ENCHANT_LIBRARY 
ENCHANT_INCLUDE_DIR)
 
-if(Enchant_FIND_REQUIRED AND NOT ENCHANT_FOUND)
-       message(FATAL_ERROR "Could not find Enchant library")
-endif()
-
 mark_as_advanced(ENCHANT_LIBRARY ENCHANT_INCLUDE_DIR)
diff --git a/development/cmake/modules/FindHunspell.cmake 
b/development/cmake/modules/FindHunspell.cmake
index 36a7c68..ae63f49 100644
--- a/development/cmake/modules/FindHunspell.cmake
+++ b/development/cmake/modules/FindHunspell.cmake
@@ -7,14 +7,9 @@ endif()
 
 FIND_PATH(HUNSPELL_INCLUDE_DIR "hunspell/hunspell.hxx")
 
-
-# handle the QUIETLY and REQUIRED arguments and 
+# handle the QUIETLY and REQUIRED arguments and
 # set HUNSPELL_FOUND to TRUE if all listed variables are TRUE
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(HUNSPELL DEFAULT_MSG HUNSPELL_LIBRARY 
HUNSPELL_INCLUDE_DIR)
 
-if(HUNSPELL_FIND_REQUIRED AND NOT HUNSPELL_FOUND)
-       message(FATAL_ERROR "Could not find Hunspell library")
-endif()
-
 mark_as_advanced(HUNSPELL_LIBRARY HUNSPELL_INCLUDE_DIR)

Reply via email to