5 SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}" )
7 IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
9 ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8")
10 SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
12 MESSAGE(STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}" )
14 ####################################################################
16 ####################################################################
18 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
19 SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
21 INCLUDE( ${CMAKE_SOURCE_DIR}/VERSION.cmake )
23 FIND_PACKAGE(Db43 REQUIRED)
24 FIND_PACKAGE(EXPAT REQUIRED)
25 FIND_PACKAGE(Ruby REQUIRED)
27 SET( PACKAGE "satsolver" )
28 SET( VERSION "${LIBSATSOLVER_MAJOR}.${LIBSATSOLVER_MINOR}.${LIBSATSOLVER_PATCH}" )
30 SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -Wall" )
31 ADD_DEFINITIONS( -D_FILE_OFFSET_BITS=64 )
32 ADD_DEFINITIONS( -DVERSION=\\\"${VERSION}\\\" )
34 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "mls solver")
35 SET(CPACK_PACKAGE_VENDOR "Novell Inc.")
36 SET(CPACK_PACKAGE_VERSION_MAJOR ${LIBSATSOLVER_MAJOR})
37 SET(CPACK_PACKAGE_VERSION_MINOR ${LIBSATSOLVER_MINOR})
38 SET(CPACK_PACKAGE_VERSION_PATCH ${LIBSATSOLVER_PATCH})
39 SET( CPACK_GENERATOR "TBZ2")
40 SET( CPACK_SOURCE_GENERATOR "TBZ2")
41 SET( CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}" )
43 # The following components are regex's to match anywhere (unless anchored)
44 # in absolute path + filename to find files or directories to be excluded
45 # from source tarball.
46 SET (CPACK_SOURCE_IGNORE_FILES
73 "testsuite/data.libzypp/kernel-tests/kernel-hardware"
74 "testsuite/data.libzypp/yast-tests/kernel3-hardware"
79 ####################################################################
82 "${CMAKE_INSTALL_PREFIX}/share/doc/packages/${PACKAGE}"
83 CACHE PATH "The install dir for documentation (default prefix/share/doc/packages/${PACKAGE})"
87 ####################################################################
89 ####################################################################
91 #SET (CMAKE_INCLUDE_DIRECTORIES_BEFORE ON)
92 INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR} SYSTEM )
94 ####################################################################
96 MESSAGE(STATUS "Looking modules in ${CMAKE_MODULE_PATH}")
97 FIND_PROGRAM(SWIG_EXECUTABLE
99 PATHS ${SWIG_DIR} ${SWIG_DIR}/.. ${SWIG_DIR}/../../bin /usr/bin /usr/local/bin ${CMAKE_INSTALL_PREFIX}/bin
102 set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror" )
103 set ( CMAKE_C_FLAGS_DEBUG "-g3 -O0" )
105 ADD_SUBDIRECTORY(src)
106 ADD_SUBDIRECTORY(tools)
107 ADD_SUBDIRECTORY(testsuite)
109 IF ( NOT SWIG_EXECUTABLE )
110 MESSAGE( FATAL "SWIG not found." )
111 ELSE ( NOT SWIG_EXECUTABLE )
112 MESSAGE( STATUS "SWIG found at ${SWIG_EXECUTABLE}" )
113 ADD_SUBDIRECTORY(bindings)
114 ENDIF ( NOT SWIG_EXECUTABLE )
116 MESSAGE(STATUS "version: ${VERSION}")
118 ####################################################################
120 ####################################################################
123 MESSAGE(STATUS "Writing spec file...")
124 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/package/libsatsolver.spec.in ${CMAKE_BINARY_DIR}/package/libsatsolver.spec @ONLY)
125 #MESSAGE(STATUS "I hate you rpm-lint...!!!")
126 #CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/package/libsatsolver-rpmlint.cmake ${CMAKE_BINARY_DIR}/package/libsatsolver-rpmlintrc @ONLY)
131 ADD_CUSTOM_TARGET( svncheck
132 COMMAND cd $(CMAKE_SOURCE_DIR) && ! LC_ALL=C svn status --show-updates --quiet | grep -v '^Status against revision'
135 SET( AUTOBUILD_COMMAND
136 COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/package/*.tar.bz2
137 COMMAND ${CMAKE_MAKE_PROGRAM} package_source
138 COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 ${CMAKE_BINARY_DIR}/package
139 COMMAND ${CMAKE_COMMAND} -E remove ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2
140 COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/package/libsatsolver.changes" "${CMAKE_BINARY_DIR}/package/libsatsolver.changes"
143 ADD_CUSTOM_TARGET( srcpackage_local
147 ADD_CUSTOM_TARGET( srcpackage
148 COMMAND ${CMAKE_MAKE_PROGRAM} svncheck