if(COMMAND cmake_policy)
# escape preprocessor, see -DVERSION below
cmake_policy(SET CMP0005 OLD)
-endif(COMMAND cmake_policy)
-
+endif(COMMAND cmake_policy)
# Library
IF ( DEFINED LIB )
INCLUDE( ${CMAKE_SOURCE_DIR}/VERSION.cmake )
FIND_PACKAGE(EXPAT REQUIRED)
+FIND_PACKAGE(Check REQUIRED)
+FIND_PACKAGE(ZLIB REQUIRED)
+
+IF ( FEDORA )
+MESSAGE(STATUS "Building for Fedora")
+ADD_DEFINITIONS( -DFEDORA )
+FIND_LIBRARY(RPMDB_LIBRARY NAMES rpm)
+ELSE ( FEDORA )
FIND_LIBRARY(RPMDB_LIBRARY NAMES rpmdb)
-FIND_LIBRARY(ZLIB_LIBRARY NAMES z)
+ENDIF ( FEDORA)
SET( PACKAGE "satsolver" )
SET( VERSION "${LIBSATSOLVER_MAJOR}.${LIBSATSOLVER_MINOR}.${LIBSATSOLVER_PATCH}" )
ADD_DEFINITIONS( -D_FILE_OFFSET_BITS=64 )
ADD_DEFINITIONS( -DVERSION=\\\"${VERSION}\\\" )
-SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "mls solver")
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SAT Solver library")
SET(CPACK_PACKAGE_VENDOR "Novell Inc.")
SET(CPACK_PACKAGE_VERSION_MAJOR ${LIBSATSOLVER_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${LIBSATSOLVER_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${LIBSATSOLVER_PATCH})
-SET( CPACK_GENERATOR "TBZ2")
-SET( CPACK_SOURCE_GENERATOR "TBZ2")
-SET( CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}" )
+SET(CPACK_GENERATOR "TBZ2")
+SET(CPACK_SOURCE_GENERATOR "TBZ2")
+SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}")
+SET(CPACK_SOURCE_TOPLEVEL_TAG "Linux-Source:")
+SET(CPACK_TOPLEVEL_TAG "Linux-Source:")
# The following components are regex's to match anywhere (unless anchored)
# in absolute path + filename to find files or directories to be excluded
"\\\\.o$"
"\\\\.lo$"
"\\\\.la$"
+"Makefile$"
"Makefile\\\\.in$"
-"testsuite/data.libzypp/kernel-tests/kernel-hardware"
-"testsuite/data.libzypp/yast-tests/kernel3-hardware"
# cmake cache files
+"DartConfiguration.tcl$"
"CMakeCache.txt"
"CMakeFiles"
+"cmake_install.cmake$"
+"CMakeLists.txt.auto$"
+"CTestTestfile.cmake"
+"CPackConfig.cmake$"
+"CPackSourceConfig.cmake$"
+"libsatsolver.spec$"
)
INCLUDE(CPack)
####################################################################
MESSAGE(STATUS "Looking modules in ${CMAKE_MODULE_PATH}")
-FIND_PROGRAM(SWIG_EXECUTABLE
- NAMES swig-1.3 swig
- PATHS ${SWIG_DIR} ${SWIG_DIR}/.. ${SWIG_DIR}/../../bin /usr/bin /usr/local/bin ${CMAKE_INSTALL_PREFIX}/bin
-)
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall" )
set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -g -O3" )
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(tools)
ADD_SUBDIRECTORY(applayer)
-ADD_SUBDIRECTORY(testsuite)
+ADD_SUBDIRECTORY(tests)
+ADD_SUBDIRECTORY(doc)
-IF ( NOT SWIG_EXECUTABLE )
- MESSAGE( FATAL "SWIG not found." )
-ELSE ( NOT SWIG_EXECUTABLE )
- MESSAGE( STATUS "SWIG found at ${SWIG_EXECUTABLE}" )
+FIND_PACKAGE(SWIG)
+
+IF ( SWIG_FOUND )
ADD_SUBDIRECTORY(bindings)
-ENDIF ( NOT SWIG_EXECUTABLE )
+ELSE ( SWIG_FOUND )
+ # for older version of swig/cmake
+ FIND_PROGRAM(SWIG_EXECUTABLE
+ NAMES swig-1.3 swig
+ PATHS ${SWIG_DIR} ${SWIG_DIR}/.. ${SWIG_DIR}/../../bin /usr/bin /usr/local/bin ${CMAKE_INSTALL_PREFIX}/bin
+ )
+ IF ( SWIG_EXECUTABLE )
+ ADD_SUBDIRECTORY(bindings)
+ ENDIF ( SWIG_EXECUTABLE )
+ENDIF ( SWIG_FOUND )
MESSAGE(STATUS "version: ${VERSION}")
SET( AUTOBUILD_COMMAND
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/package/*.tar.bz2
+ COMMAND mkdir -p _CPack_Packages/${CPACK_TOPLEVEL_TAG}
COMMAND ${CMAKE_MAKE_PROGRAM} package_source
COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 ${CMAKE_BINARY_DIR}/package
COMMAND ${CMAKE_COMMAND} -E remove ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2
INCLUDE(CTest)
ENABLE_TESTING()
+
+