3 SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g" )
4 SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g" )
8 SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}" )
10 IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
11 SET( LIB_SUFFIX "64" )
12 ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8")
13 SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
15 MESSAGE(STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}" )
16 ####################################################################
18 ####################################################################
20 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
21 SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
23 INCLUDE( ${CMAKE_SOURCE_DIR}/VERSION.cmake )
24 MATH( EXPR LIBZYPP_CURRENT "${LIBZYPP_MAJOR} * 100 + ${LIBZYPP_MINOR}" )
25 MATH( EXPR LIBZYPP_AGE "${LIBZYPP_MINOR} - ${LIBZYPP_COMPATMINOR}" )
27 SET( PACKAGE "libzypp" )
28 SET( VERSION "${LIBZYPP_MAJOR}.${LIBZYPP_MINOR}.${LIBZYPP_PATCH}" )
31 ADD_DEFINITIONS( -DVERSION=\\\"${VERSION}\\\" )
32 SET( LIBZYPP_VERSION_INFO "${LIBZYPP_CURRENT}.${LIBZYPP_PATCH}.${LIBZYPP_AGE}" )
35 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Novell's package management core engine.")
36 SET(CPACK_PACKAGE_VENDOR "Novell Inc.")
37 #SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
38 #SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
39 SET(CPACK_PACKAGE_VERSION_MAJOR ${LIBZYPP_MAJOR})
40 SET(CPACK_PACKAGE_VERSION_MINOR ${LIBZYPP_MINOR})
41 SET(CPACK_PACKAGE_VERSION_PATCH ${LIBZYPP_PATCH})
42 SET( CPACK_GENERATOR "TBZ2")
43 SET( CPACK_SOURCE_GENERATOR "TBZ2")
44 SET( CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}" )
46 # The following components are regex's to match anywhere (unless anchored)
47 # in absolute path + filename to find files or directories to be excluded
48 # from source tarball.
49 SET (CPACK_SOURCE_IGNORE_FILES
50 #/CVS/;/\\.svn/;/\\.libs/;/\\.deps/;\\.swp$;/build/;\\.o$;\\.lo$;\\.la$;~$;\\\\.cvsignore$;Makefile\\\\.in$;
51 /CVS/;/\\\\.svn/;/\\\\.libs/;/\\\\.deps/;\\\\.swp$;/build/;\\\\.o$;\\\\.lo$;\\\\.la$;~$
56 ####################################################################
59 "${CMAKE_INSTALL_PREFIX}/share/doc/packages/${PACKAGE}"
60 CACHE PATH "The install dir for documentation (default prefix/share/doc/packages/${PACKAGE})"
64 ####################################################################
66 FIND_PACKAGE(Rpm REQUIRED)
68 MESSAGE( FATAL_ERROR " rpm not found" )
70 INCLUDE_DIRECTORIES(${RPM_INCLUDE_DIR})
73 FIND_PACKAGE(Boost REQUIRED)
75 MESSAGE( STATUS "boost found: includes in ${Boost_INCLUDE_DIRS}, library in ${Boost_LIBRARY_DIRS}")
76 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
77 LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
80 FIND_PACKAGE(Gettext REQUIRED)
82 MESSAGE(STATUS "Found Gettext: ${GETTEXT_SOURCE}")
83 INCLUDE_DIRECTORIES(${GETTEXT_INCLUDE_DIR})
85 MESSAGE( FATAL_ERROR "Gettext not found" )
88 FIND_PACKAGE(Hal REQUIRED)
90 MESSAGE( FATAL_ERROR " Hal not found" )
92 INCLUDE_DIRECTORIES(${HAL_INCLUDE_DIR})
93 # hal/libhal-storage.h is broken grrr
94 INCLUDE_DIRECTORIES(${HAL_INCLUDE_DIR}/hal)
97 FIND_PACKAGE(Dbus REQUIRED)
99 MESSAGE( FATAL_ERROR " dbus not found" )
100 ELSE ( NOT DBUS_FOUND)
101 INCLUDE_DIRECTORIES(${DBUS_INCLUDE_DIR})
102 INCLUDE_DIRECTORIES(${DBUS_ARCH_INCLUDE_DIR})
103 ENDIF( NOT DBUS_FOUND)
105 FIND_PACKAGE(Glib REQUIRED)
107 MESSAGE( STATUS "glib found: includes in ${GLIB_INCLUDE_DIR}, library in ${GLIB_LIBRARY}")
108 INCLUDE_DIRECTORIES(${GLIB_INCLUDE_DIR})
109 INCLUDE_DIRECTORIES(${GLIB_CONFIG_INCLUDE_DIR})
111 MESSAGE( FATAL_ERROR "glib not found" )
114 #IF (DBUS_GLIB_FOUND)
115 # MESSAGE( STATUS "dbus-glib found" )
116 # INCLUDE_DIRECTORIES(${DBUS_GLIB_INCLUDE_DIR})
117 # LINK_DIRECTORIES(${DBUS_GLIB_LINK_DIR})
118 #ELSE(DBUS_GLIB_FOUND)
119 # MESSAGE( ERROR "dbus-glib not found" )
120 #ENDIF(DBUS_GLIB_FOUND)
122 FIND_PACKAGE(Curl REQUIRED)
124 MESSAGE( FATAL_ERROR " curl not found" )
125 ELSE ( NOT CURL_FOUND)
126 INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
127 ENDIF( NOT CURL_FOUND)
129 FIND_PACKAGE(Libxml REQUIRED)
130 IF ( NOT LIBXML_FOUND)
131 MESSAGE( FATAL_ERROR " libxml not found" )
132 ELSE ( NOT LIBXML_FOUND)
133 INCLUDE_DIRECTORIES(${LIBXML_INCLUDE_DIR})
134 ENDIF( NOT LIBXML_FOUND)
136 FIND_PACKAGE(Sqlite REQUIRED)
138 FIND_PACKAGE(ZLIB REQUIRED)
140 MESSAGE( FATAL_ERROR " zlib not found" )
141 ELSE ( NOT ZLIB_FOUND)
142 INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
143 ENDIF( NOT ZLIB_FOUND)
145 FIND_PROGRAM( DOXYGEN doxygen )
147 MESSAGE( FATAL_ERROR "doxygen not found: install doxygen to build the documentation." )
149 MESSAGE( STATUS "doxygen found: ${DOXYGEN}" )
150 ENDIF ( NOT DOXYGEN )
152 MESSAGE(STATUS "soname: ${LIBZYPP_CURRENT}.${LIBZYPP_PATCH}.${LIBZYPP_AGE}")
153 MESSAGE(STATUS "version: ${VERSION}")
155 ####################################################################
157 ####################################################################
158 MESSAGE(STATUS "Writing spec file...")
159 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/libzypp.spec.cmake ${CMAKE_BINARY_DIR}/package/libzypp.spec @ONLY)
161 MESSAGE(STATUS "Writing pkg-config file...")
162 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/libzypp.pc.cmake ${CMAKE_BINARY_DIR}/libzypp.pc @ONLY)
163 INSTALL( FILES ${CMAKE_BINARY_DIR}/libzypp.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig )
165 MESSAGE(STATUS "FindZypp.cmake will be installed in ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules")
166 INSTALL( FILES ${CMAKE_SOURCE_DIR}/cmake/modules/FindZypp.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules )
168 ####################################################################
170 ####################################################################
172 ADD_SUBDIRECTORY( zypp )
173 ADD_SUBDIRECTORY( zypp2 )
174 # do not build devel by default
175 ADD_SUBDIRECTORY( devel EXCLUDE_FROM_ALL )
176 ADD_SUBDIRECTORY( tools )
177 #ADD_SUBDIRECTORY( examples )
178 ADD_SUBDIRECTORY( po EXCLUDE_FROM_ALL )
179 ADD_SUBDIRECTORY( doc EXCLUDE_FROM_ALL )
180 ADD_SUBDIRECTORY( tests EXCLUDE_FROM_ALL )
182 ####################################################################
184 ####################################################################
186 INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
188 ####################################################################
190 ####################################################################
192 #configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
193 #yumschemadir=${zyppdir}/schema/yum
194 #xmlstoreschemadir=${zyppdir}/schema/xmlstore
196 ####################################################################
198 ####################################################################
200 #INSTALL_FILES( FILES libzypp.pc )
202 ADD_CUSTOM_TARGET( svncheck
203 COMMAND cd $(CMAKE_SOURCE_DIR) && ! LC_ALL=C svn status --show-updates --quiet | grep -v '^Status against revision'
206 SET( AUTOBUILD_COMMAND
207 COMMAND ${CMAKE_MAKE_PROGRAM} package_source
208 COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 ${CMAKE_BINARY_DIR}/package
209 COMMAND ${CMAKE_COMMAND} -E remove ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2
210 COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/package/${PACKAGE}.changes" "${CMAKE_BINARY_DIR}/package/${PACKAGE}.changes"
213 ADD_CUSTOM_TARGET( autobuild_local
217 ADD_CUSTOM_TARGET( autobuild
218 COMMAND ${CMAKE_MAKE_PROGRAM} svncheck