5 SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}" )
7 IF ( EXISTS "${CMAKE_INSTALL_PREFIX}/lib64" )
9 ENDIF ( EXISTS "${CMAKE_INSTALL_PREFIX}/lib64" )
10 SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
12 MESSAGE(STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}" )
13 ####################################################################
15 ####################################################################
17 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
18 SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
20 INCLUDE( ${CMAKE_SOURCE_DIR}/VERSION.cmake )
21 MATH( EXPR LIBZYPP_CURRENT "${LIBZYPP_MAJOR} * 100 + ${LIBZYPP_MINOR}" )
22 MATH( EXPR LIBZYPP_AGE "${LIBZYPP_MINOR} - ${LIBZYPP_COMPATMINOR}" )
24 SET( PACKAGE "libzypp" )
25 SET( VERSION "${LIBZYPP_MAJOR}.${LIBZYPP_MINOR}.${LIBZYPP_PATCH}" )
27 ADD_DEFINITIONS( -DVERSION=\\\"${VERSION}\\\" )
28 SET( LIBZYPP_VERSION_INFO "${LIBZYPP_CURRENT}.${LIBZYPP_PATCH}.${LIBZYPP_AGE}" )
31 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Novell's package management core engine.")
32 SET(CPACK_PACKAGE_VENDOR "Novell Inc.")
33 #SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
34 #SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
35 SET(CPACK_PACKAGE_VERSION_MAJOR ${LIBZYPP_MAJOR})
36 SET(CPACK_PACKAGE_VERSION_MINOR ${LIBZYPP_MINOR})
37 SET(CPACK_PACKAGE_VERSION_PATCH ${LIBZYPP_PATCH})
38 SET( CPACK_GENERATOR "TBZ2")
39 SET( CPACK_SOURCE_GENERATOR "TBZ2")
40 SET( CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}" )
42 # The following components are regex's to match anywhere (unless anchored)
43 # in absolute path + filename to find files or directories to be excluded
44 # from source tarball.
45 SET (CPACK_SOURCE_IGNORE_FILES
46 #/CVS/;/\\.svn/;/\\.libs/;/\\.deps/;\\.swp$;/build/;\\.o$;\\.lo$;\\.la$;~$;\\\\.cvsignore$;Makefile\\\\.in$;
47 /CVS/;/\\\\.svn/;/\\\\.libs/;/\\\\.deps/;\\\\.swp$;/build/;\\\\.o$;\\\\.lo$;\\\\.la$;~$
52 ####################################################################
55 "${CMAKE_INSTALL_PREFIX}/share/doc/packages/${PACKAGE}"
56 CACHE PATH "The install dir for documentation (default prefix/share/doc/packages/${PACKAGE})"
60 ####################################################################
62 FIND_PACKAGE(Rpm REQUIRED)
64 MESSAGE( FATAL_ERROR " rpm not found" )
66 INCLUDE_DIRECTORIES(${RPM_INCLUDE_DIR})
69 FIND_PACKAGE(Boost REQUIRED)
71 MESSAGE( STATUS "boost found: includes in ${Boost_INCLUDE_DIRS}, library in ${Boost_LIBRARY_DIRS}")
72 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
73 LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
76 FIND_PACKAGE(Gettext REQUIRED)
78 MESSAGE(STATUS "Found Gettext: ${GETTEXT_SOURCE}")
79 INCLUDE_DIRECTORIES(${GETTEXT_INCLUDE_DIR})
81 MESSAGE( FATAL_ERROR "Gettext not found" )
84 FIND_PACKAGE(Hal REQUIRED)
86 MESSAGE( FATAL_ERROR " Hal not found" )
88 INCLUDE_DIRECTORIES(${HAL_INCLUDE_DIR})
89 # hal/libhal-storage.h is broken grrr
90 INCLUDE_DIRECTORIES(${HAL_INCLUDE_DIR}/hal)
93 FIND_PACKAGE(Dbus REQUIRED)
95 MESSAGE( FATAL_ERROR " dbus not found" )
96 ELSE ( NOT DBUS_FOUND)
97 INCLUDE_DIRECTORIES(${DBUS_INCLUDE_DIR})
98 INCLUDE_DIRECTORIES(${DBUS_ARCH_INCLUDE_DIR})
99 ENDIF( NOT DBUS_FOUND)
101 FIND_PACKAGE(Glib REQUIRED)
103 MESSAGE( STATUS "glib found: includes in ${GLIB_INCLUDE_DIR}, library in ${GLIB_LIBRARY}")
104 INCLUDE_DIRECTORIES(${GLIB_INCLUDE_DIR})
105 INCLUDE_DIRECTORIES(${GLIB_CONFIG_INCLUDE_DIR})
107 MESSAGE( FATAL_ERROR "glib not found" )
110 #IF (DBUS_GLIB_FOUND)
111 # MESSAGE( STATUS "dbus-glib found" )
112 # INCLUDE_DIRECTORIES(${DBUS_GLIB_INCLUDE_DIR})
113 # LINK_DIRECTORIES(${DBUS_GLIB_LINK_DIR})
114 #ELSE(DBUS_GLIB_FOUND)
115 # MESSAGE( ERROR "dbus-glib not found" )
116 #ENDIF(DBUS_GLIB_FOUND)
118 FIND_PACKAGE(Curl REQUIRED)
120 MESSAGE( FATAL_ERROR " curl not found" )
121 ELSE ( NOT CURL_FOUND)
122 INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
123 ENDIF( NOT CURL_FOUND)
125 FIND_PACKAGE(Libxml REQUIRED)
126 IF ( NOT LIBXML_FOUND)
127 MESSAGE( FATAL_ERROR " libxml not found" )
128 ELSE ( NOT LIBXML_FOUND)
129 INCLUDE_DIRECTORIES(${LIBXML_INCLUDE_DIR})
130 ENDIF( NOT LIBXML_FOUND)
132 FIND_PACKAGE(Sqlite REQUIRED)
134 FIND_PACKAGE(ZLIB REQUIRED)
136 MESSAGE( FATAL_ERROR " zlib not found" )
137 ELSE ( NOT ZLIB_FOUND)
138 INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
139 ENDIF( NOT ZLIB_FOUND)
141 FIND_PROGRAM( DOXYGEN doxygen )
143 MESSAGE( FATAL_ERROR "doxygen not found: install doxygen to build the documentation." )
145 MESSAGE( STATUS "doxygen found: ${DOXYGEN}" )
146 ENDIF ( NOT DOXYGEN )
148 MESSAGE(STATUS "soname: ${LIBZYPP_CURRENT}.${LIBZYPP_PATCH}.${LIBZYPP_AGE}")
149 MESSAGE(STATUS "version: ${VERSION}")
151 ####################################################################
153 ####################################################################
154 MESSAGE(STATUS "Writing spec file...")
155 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/libzypp.spec.cmake ${CMAKE_BINARY_DIR}/package/libzypp.spec @ONLY)
157 MESSAGE(STATUS "Writing pkg-config file...")
158 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/libzypp.pc.cmake ${CMAKE_BINARY_DIR}/libzypp.pc @ONLY)
159 INSTALL( FILES ${CMAKE_BINARY_DIR}/libzypp.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig )
161 MESSAGE(STATUS "FindZypp.cmake will be installed in ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules")
162 INSTALL( FILES ${CMAKE_SOURCE_DIR}/cmake/modules/FindZypp.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules )
164 ####################################################################
166 ####################################################################
168 ADD_SUBDIRECTORY( zypp )
169 ADD_SUBDIRECTORY( zypp2 )
170 # do not build devel by default
171 ADD_SUBDIRECTORY( devel EXCLUDE_FROM_ALL )
172 ADD_SUBDIRECTORY( tools )
173 #ADD_SUBDIRECTORY( examples )
174 ADD_SUBDIRECTORY( po EXCLUDE_FROM_ALL )
175 ADD_SUBDIRECTORY( doc EXCLUDE_FROM_ALL )
177 ####################################################################
179 ####################################################################
181 INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
183 ####################################################################
185 ####################################################################
187 #configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
188 #yumschemadir=${zyppdir}/schema/yum
189 #xmlstoreschemadir=${zyppdir}/schema/xmlstore
191 ####################################################################
193 ####################################################################
195 #INSTALL_FILES( FILES libzypp.pc )
197 ADD_CUSTOM_TARGET( svncheck
198 COMMAND cd $(CMAKE_SOURCE_DIR) && ! LC_ALL=C svn status --show-updates --quiet | grep -v '^Status against revision'
201 SET( AUTOBUILD_COMMAND
202 COMMAND ${CMAKE_MAKE_PROGRAM} package_source
203 COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 ${CMAKE_BINARY_DIR}/package
204 COMMAND ${CMAKE_COMMAND} -E remove ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2
205 COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/package/${PACKAGE}.changes" "${CMAKE_BINARY_DIR}/package/${PACKAGE}.changes"
208 ADD_CUSTOM_TARGET( autobuild_local
212 ADD_CUSTOM_TARGET( autobuild
213 COMMAND ${CMAKE_MAKE_PROGRAM} svncheck