FIND_PACKAGE(EXPAT REQUIRED)
FIND_PACKAGE(Check REQUIRED)
+FIND_PACKAGE(ZLIB REQUIRED)
FIND_LIBRARY(RPMDB_LIBRARY NAMES rpmdb)
-FIND_LIBRARY(ZLIB_LIBRARY NAMES z)
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})
####################################################################
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
-)
+#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(applayer)
ADD_SUBDIRECTORY(tests)
-IF ( NOT SWIG_EXECUTABLE )
+FIND_PACKAGE(SWIG REQUIRED)
+
+IF ( NOT SWIG_FOUND )
MESSAGE( FATAL "SWIG not found." )
-ELSE ( NOT SWIG_EXECUTABLE )
+ELSE ( NOT SWIG_FOUND )
MESSAGE( STATUS "SWIG found at ${SWIG_EXECUTABLE}" )
ADD_SUBDIRECTORY(bindings)
-ENDIF ( NOT SWIG_EXECUTABLE )
+ENDIF ( NOT SWIG_FOUND )
MESSAGE(STATUS "version: ${VERSION}")
INCLUDE(CTest)
ENABLE_TESTING()
+
+
+IF (CHECK_INCLUDE_DIR)
+ # Already in cache, be silent
+ SET(CHECK_FIND_QUIETLY TRUE)
+ENDIF (CHECK_INCLUDE_DIR)
+
FIND_PATH(CHECK_INCLUDE_DIR NAMES check.h)
-MARK_AS_ADVANCED(CHECK_INCLUDE_DIR)
# Look for the library.
FIND_LIBRARY(CHECK_LIBRARY NAMES check)
-MARK_AS_ADVANCED(CHECK_LIBRARY)
-# Copy the results to the output variables.
-IF(CHECK_INCLUDE_DIR AND CHECK_LIBRARY)
- SET(CHECK_FOUND 1)
- SET(CHECK_LIBRARIES ${CHECK_LIBRARY})
- SET(CHECK_INCLUDE_DIRS ${CHECK_INCLUDE_DIR})
-ELSE(CHECK_INCLUDE_DIR AND CHECK_LIBRARY)
- SET(CHECK_FOUND 0)
- SET(CHECK_LIBRARIES)
- SET(CHECK_INCLUDE_DIRS)
-ENDIF(CHECK_INCLUDE_DIR AND CHECK_LIBRARY)
+# handle the QUIETLY and REQUIRED arguments and set CHECK_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CHECK "Please install 'check' and 'check-devel' packages" CHECK_LIBRARY CHECK_INCLUDE_DIR)
-# Report the results.
-IF(NOT CHECK_FOUND)
- SET(CHECK_DIR_MESSAGE
- "check C unit testing library was not found. Install check and check-devel.")
- IF(NOT Check_FIND_QUIETLY)
- MESSAGE(STATUS "${CHECK_DIR_MESSAGE}")
- ELSE(NOT Check_FIND_QUIETLY)
- IF(Check_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "${CHECK_DIR_MESSAGE}")
- ENDIF(Check_FIND_REQUIRED)
- ENDIF(NOT Check_FIND_QUIETLY)
-ELSE(NOT CHECK_FOUND)
- MESSAGE(STATUS "check C unit testing library: ${CHECK_LIBRARIES}")
-ENDIF(NOT CHECK_FOUND)
+IF(CHECK_FOUND)
+ SET( CHECK_LIBRARIES ${CHECK_LIBRARY} )
+ELSE(CHECK_FOUND)
+ SET( CHECK_LIBRARIES )
+ENDIF(CHECK_FOUND)
+
+MARK_AS_ADVANCED(CHECK_INCLUDE_DIR)
+MARK_AS_ADVANCED(CHECK_LIBRARY)