group FIND_X and IF(X_FOUND) together
authorMichael Andres <ma@suse.de>
Tue, 20 Feb 2007 09:28:09 +0000 (09:28 +0000)
committerMichael Andres <ma@suse.de>
Tue, 20 Feb 2007 09:28:09 +0000 (09:28 +0000)
CMakeLists.txt

index 7ce0451..ad3d6a1 100644 (file)
@@ -10,9 +10,14 @@ SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
 INCLUDE( ${CMAKE_SOURCE_DIR}/VERSION.cmake )
 MATH( EXPR LIBZYPP_CURRENT "${LIBZYPP_MAJOR} * 100 + ${LIBZYPP_MINOR}" )
 MATH( EXPR LIBZYPP_AGE     "${LIBZYPP_MINOR} - ${LIBZYPP_COMPATMINOR}" )
+
 SET( PACKAGE "libzypp" )
 SET( VERSION "${LIBZYPP_MAJOR}.${LIBZYPP_MINOR}.${LIBZYPP_PATCH}" )
+
+ADD_DEFINITIONS( -DVERSION=\\\"${VERSION}\\\" )
 SET( LIBZYPP_VERSION_INFO   "-version-info ${LIBZYPP_CURRENT}:${LIBZYPP_PATCH}:${LIBZYPP_AGE}" )
+
+
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Novell's package management core engine.")
 SET(CPACK_PACKAGE_VENDOR "Novell Inc.")
 #SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
@@ -38,31 +43,21 @@ SET (CPACK_SOURCE_IGNORE_FILES
 INCLUDE(CPack)
 INCLUDE(DefineInstallationPaths)
 
-ADD_DEFINITIONS( -DVERSION=\\\"${VERSION}\\\" )
-
 FIND_PACKAGE(Rpm REQUIRED)
-FIND_PACKAGE(Boost REQUIRED)
-FIND_PACKAGE(Gettext REQUIRED)
-FIND_PACKAGE(Hal REQUIRED)
-FIND_PACKAGE(Dbus REQUIRED)
-FIND_PACKAGE(Glib REQUIRED)
-FIND_PACKAGE(Curl REQUIRED)
-FIND_PACKAGE(Libxml REQUIRED)
-FIND_PACKAGE(Sqlite REQUIRED)
-FIND_PACKAGE(ZLIB REQUIRED)
-
 IF ( NOT RPM_FOUND)
   MESSAGE( FATAL_ERROR " rpm not found" )
 ELSE ( NOT RPM_FOUND)
   INCLUDE_DIRECTORIES(${RPM_INCLUDE_DIR})
 ENDIF( NOT RPM_FOUND)
 
-IF ( NOT ZLIB_FOUND)
-  MESSAGE( FATAL_ERROR " zlib not found" )
-ELSE ( NOT ZLIB_FOUND)
-  INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
-ENDIF( NOT ZLIB_FOUND)
+FIND_PACKAGE(Boost REQUIRED)
+IF (Boost_FOUND)
+  MESSAGE( STATUS "boost found: includes in ${Boost_INCLUDE_DIRS}, library in ${Boost_LIBRARY_DIRS}")
+  INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
+  LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
+ENDIF(Boost_FOUND)
 
+FIND_PACKAGE(Gettext REQUIRED)
 IF (GETTEXT_FOUND)
   MESSAGE(STATUS "Found Gettext: ${GETTEXT_SOURCE}")
   INCLUDE_DIRECTORIES(${GETTEXT_INCLUDE_DIR})
@@ -70,24 +65,7 @@ ELSE (GETTEXT_FOUND)
   MESSAGE( FATAL_ERROR "Gettext not found" )
 ENDIF (GETTEXT_FOUND)
 
-IF (Boost_FOUND)
-  MESSAGE( STATUS "boost found: includes in ${Boost_INCLUDE_DIRS}, library in ${Boost_LIBRARY_DIRS}")
-  INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
-  LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
-ENDIF(Boost_FOUND)
-
-IF ( NOT LIBXML_FOUND)
-  MESSAGE( FATAL_ERROR " libxml not found" )
-ELSE ( NOT LIBXML_FOUND)
-  INCLUDE_DIRECTORIES(${LIBXML_INCLUDE_DIR})
-ENDIF( NOT LIBXML_FOUND)
-
-IF ( NOT CURL_FOUND)
-  MESSAGE( FATAL_ERROR " curl not found" )
-ELSE ( NOT CURL_FOUND)
-  INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
-ENDIF( NOT CURL_FOUND)
-
+FIND_PACKAGE(Hal REQUIRED)
 IF ( NOT HAL_FOUND)
   MESSAGE( FATAL_ERROR " Hal not found" )
 ELSE ( NOT HAL_FOUND)
@@ -96,6 +74,7 @@ ELSE ( NOT HAL_FOUND)
   INCLUDE_DIRECTORIES(${HAL_INCLUDE_DIR}/hal)
 ENDIF( NOT HAL_FOUND)
 
+FIND_PACKAGE(Dbus REQUIRED)
 IF ( NOT DBUS_FOUND)
   MESSAGE( FATAL_ERROR " dbus not found" )
 ELSE ( NOT DBUS_FOUND)
@@ -103,6 +82,7 @@ ELSE ( NOT DBUS_FOUND)
   INCLUDE_DIRECTORIES(${DBUS_ARCH_INCLUDE_DIR})
 ENDIF( NOT DBUS_FOUND)
 
+FIND_PACKAGE(Glib REQUIRED)
 IF (GLIB_FOUND)
   MESSAGE( STATUS "glib found: includes in ${GLIB_INCLUDE_DIR}, library in ${GLIB_LIBRARY}")
   INCLUDE_DIRECTORIES(${GLIB_INCLUDE_DIR})
@@ -119,6 +99,29 @@ ENDIF(GLIB_FOUND)
 #  MESSAGE( ERROR "dbus-glib not found" )
 #ENDIF(DBUS_GLIB_FOUND)
 
+FIND_PACKAGE(Curl REQUIRED)
+IF ( NOT CURL_FOUND)
+  MESSAGE( FATAL_ERROR " curl not found" )
+ELSE ( NOT CURL_FOUND)
+  INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
+ENDIF( NOT CURL_FOUND)
+
+FIND_PACKAGE(Libxml REQUIRED)
+IF ( NOT LIBXML_FOUND)
+  MESSAGE( FATAL_ERROR " libxml not found" )
+ELSE ( NOT LIBXML_FOUND)
+  INCLUDE_DIRECTORIES(${LIBXML_INCLUDE_DIR})
+ENDIF( NOT LIBXML_FOUND)
+
+FIND_PACKAGE(Sqlite REQUIRED)
+
+FIND_PACKAGE(ZLIB REQUIRED)
+IF ( NOT ZLIB_FOUND)
+  MESSAGE( FATAL_ERROR " zlib not found" )
+ELSE ( NOT ZLIB_FOUND)
+  INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
+ENDIF( NOT ZLIB_FOUND)
+
 FIND_PROGRAM( DOXYGEN doxygen )
 IF ( NOT DOXYGEN )
   MESSAGE( FATAL_ERROR "doxygen not found: install doxygen to build the documentation." )
@@ -128,8 +131,6 @@ ENDIF ( NOT DOXYGEN )
 
 MESSAGE(STATUS "soname: ${LIBZYPP_CURRENT}.${LIBZYPP_PATCH}.${LIBZYPP_AGE}")
 MESSAGE(STATUS "version: ${VERSION}")
-#yumschemadir=${zyppdir}/schema/yum
-#xmlstoreschemadir=${zyppdir}/schema/xmlstore
 
 ####################################################################
 # RPM SPEC                                                         #
@@ -177,6 +178,8 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CUR
 ####################################################################
 
 #configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
+#yumschemadir=${zyppdir}/schema/yum
+#xmlstoreschemadir=${zyppdir}/schema/xmlstore
 
 ####################################################################
 # INSTALL                                                          #