forked from OpenSCAP/openscap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
137 lines (131 loc) · 3.63 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
add_subdirectory("common")
add_subdirectory("CPE")
add_subdirectory("CVE")
add_subdirectory("CVSS")
add_subdirectory("CVRF")
add_subdirectory("DS")
add_subdirectory("OVAL")
if(ENABLE_SCE)
add_subdirectory("SCE")
endif()
add_subdirectory("source")
add_subdirectory("XCCDF")
add_subdirectory("XCCDF_POLICY")
set(OBJECTS_TO_LINK_AGAINST
$<TARGET_OBJECTS:common_object>
$<TARGET_OBJECTS:cpe_object>
$<TARGET_OBJECTS:cve_object>
$<TARGET_OBJECTS:cvrf_object>
$<TARGET_OBJECTS:cvss_object>
$<TARGET_OBJECTS:ds_object>
$<TARGET_OBJECTS:oscapsource_object>
$<TARGET_OBJECTS:oval_object>
$<TARGET_OBJECTS:ovaladt_object>
$<TARGET_OBJECTS:ovalcmp_object>
$<TARGET_OBJECTS:ovalresults_object>
$<TARGET_OBJECTS:rbt_object>
$<TARGET_OBJECTS:xccdf_object>
$<TARGET_OBJECTS:xccdfPolicy_object>
)
if (TARGET "compat_object")
list(APPEND OBJECTS_TO_LINK_AGAINST $<TARGET_OBJECTS:compat_object>)
endif()
if (TARGET "yamlfilter_object")
list(APPEND OBJECTS_TO_LINK_AGAINST $<TARGET_OBJECTS:yamlfilter_object>)
endif()
if (ENABLE_PROBES)
list(APPEND OBJECTS_TO_LINK_AGAINST
$<TARGET_OBJECTS:probe_object>
$<TARGET_OBJECTS:seap_object>
)
if (ENABLE_PROBES_INDEPENDENT)
list(APPEND OBJECTS_TO_LINK_AGAINST
$<TARGET_OBJECTS:independent_probes_object>
)
endif()
if (ENABLE_PROBES_UNIX)
list(APPEND OBJECTS_TO_LINK_AGAINST
$<TARGET_OBJECTS:unix_probes_object>
)
if (ENABLE_PROBES_LINUX)
list(APPEND OBJECTS_TO_LINK_AGAINST
$<TARGET_OBJECTS:linux_probes_object>
)
endif()
if (ENABLE_PROBES_SOLARIS)
list(APPEND OBJECTS_TO_LINK_AGAINST
$<TARGET_OBJECTS:solaris_probes_object>
)
endif()
endif()
if (ENABLE_PROBES_WINDOWS)
list(APPEND OBJECTS_TO_LINK_AGAINST
$<TARGET_OBJECTS:windows_probes_object>
)
endif()
endif()
if (HAVE_MMAN_H AND (GCRYPT_FOUND OR NSS_FOUND))
list(APPEND OBJECTS_TO_LINK_AGAINST
$<TARGET_OBJECTS:crapi_object>
)
endif()
add_library(openscap SHARED ${OBJECTS_TO_LINK_AGAINST})
# default symbol visibility is hidden
# exported symbols must be marked by OSCAP_API
set_target_properties(openscap PROPERTIES
VERSION ${SONAME}
SOVERSION ${SOVERSION}
C_VISIBILITY_PRESET hidden
)
target_link_libraries(openscap ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${XMLSEC_LIBRARIES} ${OPENSSL_LIBRARIES} ${LIBXSLT_EXSLT_LIBRARIES} ${PCRE_LIBRARIES} ${CURL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
if (BZIP2_FOUND)
target_link_libraries(openscap ${BZIP2_LIBRARIES})
endif()
if(RPM_FOUND)
target_link_libraries(openscap ${RPM_LIBRARIES})
endif()
if(WIN32)
target_link_libraries(openscap wsock32 ws2_32 iphlpapi netapi32 wbemuuid)
endif()
if (GCRYPT_FOUND)
target_link_libraries(openscap ${GCRYPT_LIBRARIES})
endif()
if (NSS_FOUND)
target_link_libraries(openscap ${NSS_LIBRARIES})
endif()
if(OPENDBX_FOUND)
target_link_libraries(openscap ${OPENDBX_LIBRARIES})
endif()
if(GCONF_FOUND)
target_link_libraries(openscap ${GCONF_LIBRARIES})
endif()
if(SELINUX_FOUND)
target_link_libraries(openscap ${SELINUX_LIBRARIES})
endif()
if(PROCPS_FOUND)
target_link_libraries(openscap ${PROCPS_LIBRARIES})
endif()
if(BLKID_FOUND)
target_link_libraries(openscap ${BLKID_LIBRARIES})
endif()
if(DBUS_FOUND)
target_link_libraries(openscap ${DBUS_LIBRARIES})
endif()
if(APTPKG_FOUND)
target_link_libraries(openscap ${APTPKG_LIBRARIES})
endif()
if(ACL_FOUND)
target_link_libraries(openscap ${ACL_LIBRARY})
endif()
if(CAP_FOUND)
target_link_libraries(openscap ${CAP_LIBRARIES})
endif()
if(LIBYAML_FOUND)
target_link_libraries(openscap ${LIBYAML_LIBRARIES})
endif()
if(WIN32)
set(OPENSCAP_INSTALL_DESTINATION ".")
else()
set(OPENSCAP_INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
install(TARGETS openscap DESTINATION ${OPENSCAP_INSTALL_DESTINATION})