diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2018-11-30 12:40:36 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2018-11-30 12:40:36 +0900 |
commit | 97330b5a608c2213fdf3f49bfbaa268bf9627920 (patch) | |
tree | eb753c0b9543739bb05137b73562d705d0ce8c6f /CMakeLists.txt | |
parent | e197f682d93362b26879b545062694a050a4c4b4 (diff) | |
download | libsolv-97330b5a608c2213fdf3f49bfbaa268bf9627920.tar.gz libsolv-97330b5a608c2213fdf3f49bfbaa268bf9627920.tar.bz2 libsolv-97330b5a608c2213fdf3f49bfbaa268bf9627920.zip |
Imported Upstream version 0.6.27upstream/0.6.27
Change-Id: I4feccd10bd9fe0514ff13520136e962b6c093175
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 838f9d0..bcdeee6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,8 @@ OPTION (MULTI_SEMANTICS "Build with support for multiple distribution types?" OF OPTION (ENABLE_LZMA_COMPRESSION "Build with lzma/xz compression support?" OFF) OPTION (ENABLE_BZIP2_COMPRESSION "Build with bzip2 compression support?" OFF) +OPTION (WITH_LIBXML2 "Build with libxml2 instead of libexpat?" OFF) + #IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERISION} GREATER 2.4) #ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERISION} GREATER 2.4) @@ -153,16 +155,29 @@ IF (${have_system} STRGREATER xx) MESSAGE (FATAL_ERROR "Can only compile for one system type.") ENDIF (${have_system} STRGREATER xx) +SET (ENABLE_ZLIB_COMPRESSION ON) IF (ENABLE_ARCHREPO) SET (ENABLE_LZMA_COMPRESSION ON) ENDIF (ENABLE_ARCHREPO) +IF (ENABLE_RPMMD OR ENABLE_SUSEREPO OR ENABLE_APPDATA OR ENABLE_COMPS OR ENABLE_HELIXREPO OR ENABLE_MDKREPO) +IF (WITH_LIBXML2 ) +FIND_PACKAGE (LibXml2 REQUIRED) +INCLUDE_DIRECTORIES (${LIBXML2_INCLUDE_DIR}) +ELSE(WITH_LIBXML2 ) FIND_PACKAGE (EXPAT REQUIRED) INCLUDE_DIRECTORIES (${EXPAT_INCLUDE_DIRS}) +ENDIF (WITH_LIBXML2 ) +ENDIF (ENABLE_RPMMD OR ENABLE_SUSEREPO OR ENABLE_APPDATA OR ENABLE_COMPS OR ENABLE_HELIXREPO OR ENABLE_MDKREPO) + +IF (ENABLE_ZLIB_COMPRESSION) FIND_PACKAGE (ZLIB REQUIRED) +ENDIF (ENABLE_ZLIB_COMPRESSION) + IF (ENABLE_LZMA_COMPRESSION) FIND_PACKAGE (LZMA REQUIRED) ENDIF (ENABLE_LZMA_COMPRESSION) + IF (ENABLE_BZIP2_COMPRESSION) FIND_PACKAGE (BZip2 REQUIRED) ENDIF (ENABLE_BZIP2_COMPRESSION) @@ -250,7 +265,7 @@ ENDIF (${CMAKE_MAJOR_VERSION} GREATER 2) # should create config.h with #cmakedefine instead... FOREACH (VAR HAVE_STRCHRNUL HAVE_FOPENCOOKIE HAVE_FUNOPEN WORDS_BIGENDIAN - HAVE_RPM_DB_H HAVE_PGPDIGGETPARAMS) + HAVE_RPM_DB_H HAVE_PGPDIGGETPARAMS WITH_LIBXML2 ) IF(${VAR}) ADD_DEFINITIONS (-D${VAR}=1) SET (SWIG_FLAGS ${SWIG_FLAGS} -D${VAR}) @@ -271,7 +286,8 @@ FOREACH (VAR ENABLE_RPMDB ENABLE_RPMPKG ENABLE_PUBKEY ENABLE_RPMMD ENABLE_RPMDB_BYRPMHEADER ENABLE_SUSEREPO ENABLE_COMPS ENABLE_HELIXREPO ENABLE_MDKREPO ENABLE_ARCHREPO ENABLE_DEBIAN ENABLE_HAIKU - ENABLE_LZMA_COMPRESSION ENABLE_BZIP2_COMPRESSION ENABLE_PGPVRFY ENABLE_APPDATA) + ENABLE_ZLIB_COMPRESSION ENABLE_LZMA_COMPRESSION ENABLE_BZIP2_COMPRESSION + ENABLE_PGPVRFY ENABLE_APPDATA) IF(${VAR}) ADD_DEFINITIONS (-D${VAR}=1) SET (SWIG_FLAGS ${SWIG_FLAGS} -D${VAR}) @@ -355,7 +371,19 @@ set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3") set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -O3") set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -O0") -SET (SYSTEM_LIBRARIES ${EXPAT_LIBRARY} ${ZLIB_LIBRARY}) +# set system libraries +SET (SYSTEM_LIBRARIES "") +IF (ENABLE_RPMMD OR ENABLE_SUSEREPO OR ENABLE_APPDATA OR ENABLE_COMPS OR ENABLE_HELIXREPO OR ENABLE_MDKREPO) +IF (WITH_LIBXML2 ) +SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${LIBXML2_LIBRARIES}) +ELSE (WITH_LIBXML2 ) +SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${EXPAT_LIBRARY}) +ENDIF (WITH_LIBXML2 ) + +ENDIF (ENABLE_RPMMD OR ENABLE_SUSEREPO OR ENABLE_APPDATA OR ENABLE_COMPS OR ENABLE_HELIXREPO OR ENABLE_MDKREPO) +IF (ENABLE_ZLIB_COMPRESSION) +SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${ZLIB_LIBRARY}) +ENDIF (ENABLE_ZLIB_COMPRESSION) IF (ENABLE_LZMA_COMPRESSION) SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${LZMA_LIBRARY}) ENDIF (ENABLE_LZMA_COMPRESSION) |