summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-01-18 15:39:31 +0100
committerMichael Schroeder <mls@suse.de>2012-01-18 15:45:02 +0100
commit50618d25585a8867a40e9d432f225074407e8869 (patch)
tree066fc0b3fefdc0182846819ce6214bc8548deebe /CMakeLists.txt
parentd528e9d1f4b1dae5a7924c9400e9126a36a34b7f (diff)
downloadlibsolv-50618d25585a8867a40e9d432f225074407e8869.tar.gz
libsolv-50618d25585a8867a40e9d432f225074407e8869.tar.bz2
libsolv-50618d25585a8867a40e9d432f225074407e8869.zip
- add cmake options to only build for some repository types
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt89
1 files changed, 56 insertions, 33 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 11a2819..a62988f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,12 @@ OPTION (ENABLE_RUBY "Build the ruby bindings?" OFF)
OPTION (USE_VENDORDIRS "Install the bindings in vendor directories?" OFF)
+OPTION (ENABLE_RPMDB "Build with rpm database support?" OFF)
+OPTION (ENABLE_RPMMD "Build with rpmmd repository support?" OFF)
+OPTION (ENABLE_SUSEREPO "Build with suse repository support?" OFF)
+OPTION (ENABLE_HELIXREPO "Build with helix repository support?" OFF)
+OPTION (ENABLE_DEBIAN "Build with debian database/repository support?" OFF)
+
#IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERISION} GREATER 2.4)
#ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERISION} GREATER 2.4)
@@ -47,54 +53,70 @@ FIND_PACKAGE (ZLIB REQUIRED)
IF (FEDORA)
MESSAGE(STATUS "Building for Fedora")
ADD_DEFINITIONS (-DFEDORA)
+SET (ENABLE_RPMDB ON)
+SET (ENABLE_RPMMD ON)
ENDIF (FEDORA)
IF (DEBIAN)
MESSAGE (STATUS "Building for Debian")
ADD_DEFINITIONS (-DDEBIAN -DDEBIAN_SEMANTICS)
+SET (ENABLE_DEBIAN ON)
ENDIF (DEBIAN)
-IF (MULTI_SEMANTICS)
-MESSAGE (STATUS "Enabling multi dist support")
-ADD_DEFINITIONS (-DMULTI_SEMANTICS)
-ENDIF (MULTI_SEMANTICS)
-
IF (RPM5)
MESSAGE (STATUS "Enabling RPM 5 support")
ADD_DEFINITIONS (-DRPM5)
+SET (ENABLE_RPMDB ON)
+SET (ENABLE_RPMMD ON)
FIND_PACKAGE (PkgConfig REQUIRED)
PKG_CHECK_MODULES (RPM REQUIRED rpm)
INCLUDE_DIRECTORIES (${RPM_INCLUDE_DIRS})
ENDIF (RPM5)
+IF (MULTI_SEMANTICS)
+MESSAGE (STATUS "Enabling multi dist support")
+ADD_DEFINITIONS (-DMULTI_SEMANTICS)
+ENDIF (MULTI_SEMANTICS)
-IF (RPM5 OR NOT DEBIAN)
-FIND_LIBRARY (RPMDB_LIBRARY NAMES rpmdb)
-
-IF (NOT RPMDB_LIBRARY)
-FIND_LIBRARY (RPMDB_LIBRARY NAMES rpm)
-ENDIF (NOT RPMDB_LIBRARY)
-
-FIND_LIBRARY (RPMIO_LIBRARY NAMES rpmio)
-IF (RPMIO_LIBRARY)
-SET(RPMDB_LIBRARY ${RPMIO_LIBRARY} ${RPMDB_LIBRARY})
-ENDIF (RPMIO_LIBRARY)
-
-IF (RPM5)
-FIND_LIBRARY (RPMMISC_LIBRARY NAMES rpmmisc)
-IF (RPMMISC_LIBRARY)
-SET (RPMDB_LIBRARY ${RPMMISC_LIBRARY} ${RPMDB_LIBRARY})
-ENDIF (RPMMISC_LIBRARY)
-ENDIF (RPM5)
-
-IF (RPM5 OR FEDORA)
-FIND_LIBRARY (DB_LIBRARY NAMES db)
-IF (DB_LIBRARY)
-SET (RPMDB_LIBRARY ${DB_LIBRARY} ${RPMDB_LIBRARY})
-ENDIF (DB_LIBRARY)
-ENDIF (RPM5 OR FEDORA)
-
-ENDIF (RPM5 OR NOT DEBIAN)
+# compat: enable some database types
+IF (NOT ENABLE_RPMDB AND
+ NOT ENABLE_RPMMD AND
+ NOT ENABLE_SUSEREPO AND
+ NOT ENABLE_HELIXREPO AND
+ NOT ENABLE_DEBIAN)
+ SET (ENABLE_RPMDB ON)
+ SET (ENABLE_RPMMD ON)
+ SET (ENABLE_SUSEREPO ON)
+ SET (ENABLE_HELIXREPO ON)
+ SET (ENABLE_DEBIAN ON)
+ENDIF ()
+
+IF (ENABLE_RPMDB)
+ FIND_LIBRARY (RPMDB_LIBRARY NAMES rpmdb)
+
+ IF (NOT RPMDB_LIBRARY)
+ FIND_LIBRARY (RPMDB_LIBRARY NAMES rpm)
+ ENDIF (NOT RPMDB_LIBRARY)
+
+ FIND_LIBRARY (RPMIO_LIBRARY NAMES rpmio)
+ IF (RPMIO_LIBRARY)
+ SET(RPMDB_LIBRARY ${RPMIO_LIBRARY} ${RPMDB_LIBRARY})
+ ENDIF (RPMIO_LIBRARY)
+
+ IF (RPM5)
+ FIND_LIBRARY (RPMMISC_LIBRARY NAMES rpmmisc)
+ IF (RPMMISC_LIBRARY)
+ SET (RPMDB_LIBRARY ${RPMMISC_LIBRARY} ${RPMDB_LIBRARY})
+ ENDIF (RPMMISC_LIBRARY)
+ ENDIF (RPM5)
+
+ IF (RPM5 OR FEDORA)
+ FIND_LIBRARY (DB_LIBRARY NAMES db)
+ IF (DB_LIBRARY)
+ SET (RPMDB_LIBRARY ${DB_LIBRARY} ${RPMDB_LIBRARY})
+ ENDIF (DB_LIBRARY)
+ ENDIF (RPM5 OR FEDORA)
+ENDIF (ENABLE_RPMDB)
INCLUDE (CheckFunctionExists)
INCLUDE (TestBigEndian)
@@ -105,7 +127,8 @@ CHECK_FUNCTION_EXISTS (funopen HAVE_FUNOPEN)
TEST_BIG_ENDIAN (WORDS_BIGENDIAN)
# should create config.h with #cmakedefine instead...
-FOREACH (VAR HAVE_STRCHRNUL HAVE_FOPENCOOKIE HAVE_FUNOPEN WORDS_BIGENDIAN)
+FOREACH (VAR HAVE_STRCHRNUL HAVE_FOPENCOOKIE HAVE_FUNOPEN WORDS_BIGENDIAN
+ ENABLE_RPMDB ENABLE_RPMMD ENABLE_SUSEREPO ENABLE_HELIXREPO ENABLE_DEBIAN)
IF(${VAR})
ADD_DEFINITIONS (-D${VAR}=1)
ENDIF (${VAR})