link libsolvext with libsolv for completeness
[platform/upstream/libsolv.git] / ext / CMakeLists.txt
1 SET (libsolvext_SRCS
2     solv_xfopen.c testcase.c)
3
4 SET (libsolvext_HEADERS
5     tools_util.h solv_xfopen.h testcase.h)
6
7 IF (ENABLE_RPMDB)
8     SET (libsolvext_SRCS ${libsolvext_SRCS}
9         pool_fileconflicts.c repo_rpmdb.c)
10     SET (libsolvext_HEADERS ${libsolvext_HEADERS}
11         pool_fileconflicts.h repo_rpmdb.h)
12 ENDIF (ENABLE_RPMDB)
13
14 IF (ENABLE_RPMMD)
15     SET (libsolvext_SRCS ${libsolvext_SRCS}
16         repo_repomdxml.c repo_rpmmd.c
17         repo_deltainfoxml.c repo_updateinfoxml.c)
18     SET (libsolvext_HEADERS ${libsolvext_HEADERS}
19         repo_repomdxml.h repo_rpmmd.h
20         repo_deltainfoxml.h repo_updateinfoxml.h)
21 ENDIF (ENABLE_RPMMD)
22
23 IF (ENABLE_SUSEREPO)
24     SET (libsolvext_SRCS ${libsolvext_SRCS}
25         repo_content.c repo_products.c repo_releasefile_products.c
26         repo_susetags.c repo_zyppdb.c)
27     SET (libsolvext_HEADERS ${libsolvext_HEADERS}
28         repo_content.h repo_products.h repo_releasefile_products.h
29         repo_susetags.h repo_zyppdb.h)
30 ENDIF (ENABLE_SUSEREPO)
31
32 IF (ENABLE_COMPS)
33     SET (libsolvext_SRCS ${libsolvext_SRCS}
34         repo_comps.c)
35     SET (libsolvext_HEADERS ${libsolvext_HEADERS}
36         repo_comps.h)
37 ENDIF (ENABLE_COMPS)
38
39 IF (ENABLE_DEBIAN)
40     SET (libsolvext_SRCS ${libsolvext_SRCS}
41         repo_deb.c)
42     SET (libsolvext_HEADERS ${libsolvext_HEADERS}
43         repo_deb.h)
44 ENDIF (ENABLE_DEBIAN)
45         
46 IF (ENABLE_HELIXREPO)
47     SET (libsolvext_SRCS ${libsolvext_SRCS}
48         repo_helix.c)
49     SET (libsolvext_HEADERS ${libsolvext_HEADERS}
50         repo_helix.h)
51 ENDIF (ENABLE_HELIXREPO)
52
53 IF (ENABLE_MDKREPO)
54     SET (libsolvext_SRCS ${libsolvext_SRCS}
55         repo_mdk.c)
56     SET (libsolvext_HEADERS ${libsolvext_HEADERS}
57         repo_mdk.h)
58 ENDIF (ENABLE_MDKREPO)
59
60 IF (ENABLE_ARCHREPO)
61     SET (libsolvext_SRCS ${libsolvext_SRCS}
62         repo_arch.c)
63     SET (libsolvext_HEADERS ${libsolvext_HEADERS}
64         repo_arch.h)
65 ENDIF (ENABLE_ARCHREPO)
66
67 IF (ENABLE_CUDFREPO)
68     SET (libsolvext_SRCS ${libsolvext_SRCS}
69         repo_cudf.c)
70     SET (libsolvext_HEADERS ${libsolvext_HEADERS}
71         repo_cudf.h)
72 ENDIF (ENABLE_CUDFREPO)
73
74 SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
75 SET (CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS} -Wl,--version-script=${CMAKE_SOURCE_DIR}/ext/libsolvext.ver")
76
77 SET (SYSTEM_LIBRARIES ${EXPAT_LIBRARY} ${ZLIB_LIBRARY})
78 IF (ENABLE_LZMA_COMPRESSION)
79 SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${LZMA_LIBRARY})
80 ENDIF (ENABLE_LZMA_COMPRESSION)
81 IF (ENABLE_BZIP2_COMPRESSION)
82 SET (SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES} ${BZIP2_LIBRARIES})
83 ENDIF (ENABLE_BZIP2_COMPRESSION)
84 IF (ENABLE_RPMDB)
85 SET (SYSTEM_LIBRARIES ${RPMDB_LIBRARY} ${SYSTEM_LIBRARIES})
86 ENDIF (ENABLE_RPMDB)
87
88 IF (DISABLE_SHARED)
89 ADD_LIBRARY (libsolvext STATIC ${libsolvext_SRCS})
90 ELSE (DISABLE_SHARED)
91 ADD_LIBRARY (libsolvext SHARED ${libsolvext_SRCS})
92 TARGET_LINK_LIBRARIES(libsolvext libsolv ${SYSTEM_LIBRARIES})
93 ENDIF (DISABLE_SHARED)
94
95 SET_TARGET_PROPERTIES(libsolvext PROPERTIES OUTPUT_NAME "solvext")
96 SET_TARGET_PROPERTIES(libsolvext PROPERTIES SOVERSION ${LIBSOLVEXT_SOVERSION})
97
98 INSTALL (FILES ${libsolvext_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/solv")
99 INSTALL (TARGETS libsolvext LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
100
101 IF (ENABLE_STATIC AND NOT DISABLE_SHARED)
102 ADD_LIBRARY (libsolvext_static STATIC ${libsolvext_SRCS})
103 SET_TARGET_PROPERTIES(libsolvext_static PROPERTIES OUTPUT_NAME "solvext")
104 SET_TARGET_PROPERTIES(libsolvext_static PROPERTIES SOVERSION ${LIBSOLVEXT_SOVERSION})
105 INSTALL (TARGETS libsolvext_static LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
106 ENDIF (ENABLE_STATIC AND NOT DISABLE_SHARED)