blob: 0268ed8dd0b6896ca2dfd2adef1c6f7bbd995a36 [file] [log] [blame]
Ed Tanous1e439872018-05-18 11:48:52 -07001cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
Ed Tanous0fdddb12017-02-28 11:06:34 -08002
Ed Tanous271584a2019-07-09 16:24:22 -07003project (bmc-webserver CXX)
4
Ed Tanous1e439872018-05-18 11:48:52 -07005cmake_policy (SET CMP0054 NEW)
Ed Tanouscfbe25d2017-05-23 16:34:35 -07006
Ed Tanous1e439872018-05-18 11:48:52 -07007set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
Ed Tanous0fdddb12017-02-28 11:06:34 -08008
Ed Tanous1e439872018-05-18 11:48:52 -07009option (BUILD_STATIC_LIBS "Built static libraries" ON)
Ed Tanous911ac312017-08-15 09:37:42 -070010
Joseph Reynolds7a777f52018-11-07 22:01:31 -060011option (YOCTO_DEPENDENCIES "Use YOCTO dependencies system" OFF)
Ed Tanous0fdddb12017-02-28 11:06:34 -080012
Joseph Reynolds7a777f52018-11-07 22:01:31 -060013option (BMCWEB_ENABLE_KVM "Enable the KVM host video WebSocket. Path is
Ed Tanous3eb2f352018-12-20 12:30:45 -080014 '/kvm/0'. Video is from the BMC's '/dev/video' device." ON)
Adriana Kobylak1bfbe0e2019-01-17 12:08:38 -060015option (BMCWEB_ENABLE_VM_WEBSOCKET "Enable the Virtual Media WebSocket. Path is
16 '/vm/0/0'to open the websocket. See
17 https://github.com/openbmc/jsnbd/blob/master/README." ON)
Joseph Reynolds7a777f52018-11-07 22:01:31 -060018option (BMCWEB_ENABLE_DBUS_REST "Enable Phosphor REST (D-Bus) APIs. Paths
19 directly map Phosphor D-Bus object paths, for example,
20 '/xyz/openbmc_project/logging/entry/enumerate'. See
21 https://github.com/openbmc/docs/blob/master/rest-api.md." ON)
22option (BMCWEB_ENABLE_REDFISH "Enable Redfish APIs. Paths are under
23 '/redfish/v1/'. See
24 https://github.com/openbmc/bmcweb/blob/master/DEVELOPING.md#redfish."
25 ON)
26option (BMCWEB_ENABLE_HOST_SERIAL_WEBSOCKET "Enable host serial console
27 WebSocket. Path is '/console0'. See
28 https://github.com/openbmc/docs/blob/master/console.md." ON)
29option (BMCWEB_ENABLE_STATIC_HOSTING "Enable serving files from the
30 '/usr/share/www' directory as paths under '/'." ON)
31option (BMCWEB_ENABLE_REDFISH_BMC_JOURNAL "Enable BMC journal access through
32 Redfish. Paths are under
33 '/redfish/v1/Managers/bmc/LogServices/Journal'." OFF)
34option (BMCWEB_ENABLE_REDFISH_RAW_PECI "Enable PECI transactions through
Jason M. Billsd53dd412019-02-12 17:16:22 -080035 Redfish. Paths are under '/redfish/v1/Systems/system/LogServices/CpuLog/
Joseph Reynolds7a777f52018-11-07 22:01:31 -060036 Actions/Oem/CpuLog.SendRawPeci'." OFF)
37option (BMCWEB_ENABLE_REDFISH_CPU_LOG "Enable CPU log service transactions
38 through Redfish. Paths are under
Jason M. Bills424c4172019-03-21 13:50:33 -070039 '/redfish/v1/Systems/system/LogServices/Crashdump'." OFF)
Andrew Geisslercb92c032018-08-17 07:56:14 -070040option (BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES "Enable DBUS log service
41 transactions through Redfish. Paths are under
42 '/redfish/v1/Systems/system/LogServices/EventLog/Entries'." OFF)
Ed Tanous1da66f72018-07-27 16:13:37 -070043
Ed Tanousbdd1c832018-10-12 11:00:30 -070044# Insecure options. Every option that starts with a BMCWEB_INSECURE flag should
Ed Tanous1e439872018-05-18 11:48:52 -070045# not be enabled by default for any platform, unless the author fully
46# comprehends the implications of doing so. In general, enabling these options
47# will cause security problems of varying degrees
Ed Tanousf0d73c22018-07-26 14:24:20 -070048option (BMCWEB_INSECURE_DISABLE_CSRF_PREVENTION "Disable CSRF prevention checks.
49 Should be set to OFF for production systems." OFF)
Ed Tanousf3d847c2017-06-12 16:01:42 -070050
Ed Tanousf0d73c22018-07-26 14:24:20 -070051option (BMCWEB_INSECURE_DISABLE_SSL "Disable SSL ports. Should be set to OFF for
52 production systems." OFF)
Ed Tanous0fdddb12017-02-28 11:06:34 -080053
Ed Tanousf0d73c22018-07-26 14:24:20 -070054option (BMCWEB_INSECURE_DISABLE_AUTHENTICATION "Disable authentication on all
55 ports. Should be set to OFF for production systems" OFF)
Ed Tanous0fdddb12017-02-28 11:06:34 -080056
Ed Tanous1e439872018-05-18 11:48:52 -070057option (BMCWEB_INSECURE_DISABLE_XSS_PREVENTION "Disable XSS preventions" OFF)
Ed Tanous0d485ef2017-05-23 09:23:53 -070058
Andrew Geissler0554c982019-04-23 14:40:12 -050059option (BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE "Enable TFTP based
60 firmware update transactions through Redfish
61 UpdateService.SimpleUpdate." OFF)
62
Ed Tanous1e439872018-05-18 11:48:52 -070063include (CTest)
64
Ed Tanous62288742018-10-16 14:58:20 -070065set (CMAKE_CXX_STANDARD 17)
Ed Tanous1e439872018-05-18 11:48:52 -070066set (CMAKE_CXX_STANDARD_REQUIRED ON)
67
68set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
69
Ed Tanousb01bf292019-03-25 19:25:26 +000070set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -Wall")
Ed Tanous1e439872018-05-18 11:48:52 -070071
Ed Tanous271584a2019-07-09 16:24:22 -070072set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
73 -fno-rtti \
74")
75
76set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
77-Wall \
78-Wextra \
79-Wnon-virtual-dtor \
80-Wold-style-cast \
81-Wcast-align \
82-Wunused \
83-Woverloaded-virtual \
84-Wpedantic \
85-Wconversion \
86-Wsign-conversion \
87-Wnull-dereference \
88-Wdouble-promotion \
89-Wformat=2 \
90-Wno-unused-parameter \
91")
92
93# only set -Werror if we're on a compiler that we know passes
94if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
95 if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
96 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
97 -Werror \
98 -Wduplicated-cond \
99 -Wduplicated-branches \
100 -Wlogical-op \
101 -Wnull-dereference \
102 -Wdouble-promotion \
103 -Wformat=2 \
104 -Wno-unused-parameter \
105 ")
106 endif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
107endif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
108
Ed Tanous1e439872018-05-18 11:48:52 -0700109set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti")
Ed Tanous3dac7492017-08-02 13:46:20 -0700110
Ed Tanous0fdddb12017-02-28 11:06:34 -0800111# general
Ed Tanous797d0c02018-08-07 10:22:35 -0700112option (BMCWEB_BUILD_UT "Enable Unit test" OFF)
Ed Tanous8041f312017-04-03 09:47:01 -0700113
Ed Tanous1ccd57c2017-03-21 13:15:58 -0700114# security flags
Ed Tanousf0d73c22018-07-26 14:24:20 -0700115set (SECURITY_FLAGS "\
Ed Tanous580f3722018-03-13 16:59:02 -0700116 -fstack-protector-strong \
117 -fPIE \
118 -fPIC \
119 -D_FORTIFY_SOURCE=2 \
120 -Wformat \
Ed Tanousf0d73c22018-07-26 14:24:20 -0700121 -Wformat-security")
Ed Tanous1e439872018-05-18 11:48:52 -0700122set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${SECURITY_FLAGS}")
Ed Tanousf0d73c22018-07-26 14:24:20 -0700123set (
124 CMAKE_CXX_FLAGS_RELWITHDEBINFO
125 "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${SECURITY_FLAGS}"
126)
Ed Tanous1e439872018-05-18 11:48:52 -0700127set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${SECURITY_FLAGS}")
Ed Tanous3dac7492017-08-02 13:46:20 -0700128
Ed Tanous580f3722018-03-13 16:59:02 -0700129# Enable link time optimization This is a temporary workaround because
130# INTERPROCEDURAL_OPTIMIZATION isn't available until cmake 3.9. gcc-ar and gcc-
131# ranlib are wrappers around ar and ranlib which add the lto plugin to the
132# command line.
Ed Tanous1e439872018-05-18 11:48:52 -0700133if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
134 if (NOT CMAKE_BUILD_TYPE MATCHES Debug)
135 string (REGEX REPLACE "ar$" "gcc-ar" CMAKE_AR ${CMAKE_AR})
Ed Tanousf0d73c22018-07-26 14:24:20 -0700136 string (
137 REGEX
138 REPLACE "ranlib$" "gcc-ranlib" CMAKE_RANLIB ${CMAKE_RANLIB}
139 )
Ed Tanous1e439872018-05-18 11:48:52 -0700140 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -fno-fat-lto-objects")
Borawski.Lukasz109799e2018-01-30 15:04:42 +0100141
Ed Tanous1e439872018-05-18 11:48:52 -0700142 # Reduce the binary size by removing unnecessary dynamic symbol table
143 # entries
Ed Tanousf0d73c22018-07-26 14:24:20 -0700144 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
Ed Tanous580f3722018-03-13 16:59:02 -0700145 -fvisibility=hidden \
146 -fvisibility-inlines-hidden \
Ed Tanousf0d73c22018-07-26 14:24:20 -0700147 -Wl,--exclude-libs,ALL")
Ed Tanous1e439872018-05-18 11:48:52 -0700148 endif (NOT CMAKE_BUILD_TYPE MATCHES Debug)
149endif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
Borawski.Lukasz109799e2018-01-30 15:04:42 +0100150
Ed Tanous1e439872018-05-18 11:48:52 -0700151if (NOT ${YOCTO_DEPENDENCIES}) # Download and unpack googletest at configure
152 # time
153 configure_file (CMakeLists.txt.in 3rdparty/CMakeLists.txt)
Ed Tanousf0d73c22018-07-26 14:24:20 -0700154 execute_process (
155 COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
156 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3rdparty
157 )
158 execute_process (
159 COMMAND ${CMAKE_COMMAND} --build .
160 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3rdparty
161 )
Ed tanous7d95f5f2018-03-23 00:19:20 -0700162
Ed Tanous1e439872018-05-18 11:48:52 -0700163 set (CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}/prefix ${CMAKE_PREFIX_PATH})
164endif ()
Ed tanous7d95f5f2018-03-23 00:19:20 -0700165
Ed Tanous271584a2019-07-09 16:24:22 -0700166find_package (Boost 1.66 REQUIRED)
167include_directories (SYSTEM ${BOOST_SRC_DIR})
168
Ed Tanous580f3722018-03-13 16:59:02 -0700169# add_definitions(-DBOOST_ASIO_ENABLE_HANDLER_TRACKING)
Ed Tanousd3a38062018-07-27 12:06:29 -0700170add_definitions (-DBOOST_ASIO_DISABLE_THREADS)
Ed Tanous39e77502019-03-04 17:35:53 -0800171add_definitions (-DBOOST_BEAST_USE_STD_STRING_VIEW)
Ed Tanous1e439872018-05-18 11:48:52 -0700172add_definitions (-DBOOST_ERROR_CODE_HEADER_ONLY)
173add_definitions (-DBOOST_SYSTEM_NO_DEPRECATED)
Ed Tanous271584a2019-07-09 16:24:22 -0700174message(BOOST_VERSION = ${Boost_VERSION})
175if ("${Boost_VERSION}" STREQUAL "107100")
176 add_definitions (-DBOOST_ASIO_NO_DEPRECATED)
177endif()
Ed Tanous1e439872018-05-18 11:48:52 -0700178add_definitions (-DBOOST_ALL_NO_LIB)
179add_definitions (-DBOOST_NO_RTTI)
180add_definitions (-DBOOST_NO_TYPEID)
Ed Tanousc85eb8b2018-10-16 14:59:20 -0700181add_definitions (-DBOOST_COROUTINES_NO_DEPRECATION_WARNING)
Ed tanous7d95f5f2018-03-23 00:19:20 -0700182
Ed Tanousaa2e59c2018-04-12 12:17:20 -0700183# sdbusplus
Ed Tanous1e439872018-05-18 11:48:52 -0700184if (NOT ${YOCTO_DEPENDENCIES})
Ed Tanous271584a2019-07-09 16:24:22 -0700185 include_directories (SYSTEM ${CMAKE_BINARY_DIR}/sdbusplus-src)
James Feista975e9f2018-08-08 14:03:49 -0700186 link_directories (${CMAKE_BINARY_DIR}/sdbusplus-src/.libs)
Ed Tanous1e439872018-05-18 11:48:52 -0700187endif ()
Ed Tanous0fdddb12017-02-28 11:06:34 -0800188
Ed Tanous580f3722018-03-13 16:59:02 -0700189# Openssl
Ed Tanous1e439872018-05-18 11:48:52 -0700190find_package (OpenSSL REQUIRED)
Ed Tanous271584a2019-07-09 16:24:22 -0700191include_directories (SYSTEM ${OPENSSL_INCLUDE_DIR})
Ed Tanous1e439872018-05-18 11:48:52 -0700192message ("OPENSSL_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR}")
Ed Tanous0fdddb12017-02-28 11:06:34 -0800193
Ed Tanous55c7b7a2018-05-22 15:27:24 -0700194# bmcweb
Ed Tanous1e439872018-05-18 11:48:52 -0700195message ("CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
196if (CMAKE_BUILD_TYPE MATCHES Debug)
197 message ("Logging disabled")
Ed Tanous55c7b7a2018-05-22 15:27:24 -0700198 add_definitions (-DBMCWEB_ENABLE_LOGGING)
199 add_definitions (-DBMCWEB_ENABLE_DEBUG)
Ed Tanous1e439872018-05-18 11:48:52 -0700200endif (CMAKE_BUILD_TYPE MATCHES Debug)
Ed Tanousaa2e59c2018-04-12 12:17:20 -0700201
Andrew Geissler1f2fbf22018-07-17 07:57:30 -0700202if (NOT "${BMCWEB_INSECURE_DISABLE_SSL}")
Ed Tanousa434f2b2018-07-27 13:04:22 -0700203 add_definitions (-DBMCWEB_ENABLE_SSL)
Andrew Geissler1f2fbf22018-07-17 07:57:30 -0700204endif (NOT "${BMCWEB_INSECURE_DISABLE_SSL}")
Ed Tanous55c7b7a2018-05-22 15:27:24 -0700205include_directories (${CMAKE_CURRENT_SOURCE_DIR}/crow/include)
Ed Tanous0fdddb12017-02-28 11:06:34 -0800206
Ed Tanous580f3722018-03-13 16:59:02 -0700207# Zlib
Ed Tanous1e439872018-05-18 11:48:52 -0700208find_package (ZLIB REQUIRED)
Ed Tanous271584a2019-07-09 16:24:22 -0700209include_directories (SYSTEM ${ZLIB_INCLUDE_DIRS})
Ed Tanousf9273472017-02-28 16:05:13 -0800210
Ed Tanous4758d5b2017-06-06 15:28:13 -0700211# PAM
Ed Tanous1e439872018-05-18 11:48:52 -0700212option (WEBSERVER_ENABLE_PAM "enable pam authentication" ON)
213if ("${WEBSERVER_ENABLE_PAM}")
214 find_package (PAM REQUIRED)
215else ()
216 add_definitions ("-DWEBSERVER_DISABLE_PAM")
217endif ()
Ed Tanous911ac312017-08-15 09:37:42 -0700218
Ed Tanousf0d73c22018-07-26 14:24:20 -0700219add_definitions ("-Wno-attributes")
Jennifer Lee03346702018-05-23 14:05:20 -0700220# Copy pam-webserver to etc/pam.d
Ed Tanousf0d73c22018-07-26 14:24:20 -0700221install (
222 FILES ${CMAKE_CURRENT_SOURCE_DIR}/pam-webserver
223 DESTINATION /etc/pam.d/
224 RENAME webserver
225)
Ed Tanous5f34a9c2017-02-28 12:35:13 -0800226
Ed tanous7d95f5f2018-03-23 00:19:20 -0700227# tinyxml2
Ed Tanous1e439872018-05-18 11:48:52 -0700228find_package (tinyxml2 REQUIRED)
Ed tanous7d95f5f2018-03-23 00:19:20 -0700229
Ed Tanous1e439872018-05-18 11:48:52 -0700230set (WEBSERVER_MAIN src/webserver_main.cpp)
Ed Tanousb4d29f42017-03-24 16:39:25 -0700231
Ed Tanous1e439872018-05-18 11:48:52 -0700232include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
233include_directories (${CMAKE_CURRENT_SOURCE_DIR}/redfish-core/include)
Ed Tanousb4d29f42017-03-24 16:39:25 -0700234
Ed Tanous1e439872018-05-18 11:48:52 -0700235file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/include/bmcweb)
Ed Tanous1e439872018-05-18 11:48:52 -0700236include_directories (${CMAKE_BINARY_DIR}/include)
Ed Tanous5f34a9c2017-02-28 12:35:13 -0800237
Ed Tanousf0d73c22018-07-26 14:24:20 -0700238set (
239 SRC_FILES redfish-core/src/error_messages.cpp
240 redfish-core/src/utils/json_utils.cpp ${GENERATED_SRC_FILES}
241)
Ed Tanous93f987d2017-04-17 17:52:36 -0700242
Ed Tanous1e439872018-05-18 11:48:52 -0700243file (COPY src/test_resources DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
Ed Tanous911ac312017-08-15 09:37:42 -0700244
Ed Tanous38bdb982017-03-03 14:19:33 -0800245# Unit Tests
Ed Tanous1e439872018-05-18 11:48:52 -0700246if (${BMCWEB_BUILD_UT})
Ed Tanousf0d73c22018-07-26 14:24:20 -0700247 set (
248 UT_FILES src/crow_test.cpp src/gtest_main.cpp
249 src/token_authorization_middleware_test.cpp
250 src/security_headers_middleware_test.cpp src/webassets_test.cpp
251 src/crow_getroutes_test.cpp src/ast_jpeg_decoder_test.cpp
252 src/kvm_websocket_test.cpp src/msan_test.cpp
253 src/ast_video_puller_test.cpp src/openbmc_jtag_rest_test.cpp
254 redfish-core/ut/privileges_test.cpp
255 ${CMAKE_BINARY_DIR}/include/bmcweb/blns.hpp
256 ) # big list of naughty strings
257 add_custom_command (
258 OUTPUT ${CMAKE_BINARY_DIR}/include/bmcweb/blns.hpp
259 COMMAND
260 xxd -i ${CMAKE_CURRENT_SOURCE_DIR}/src/test_resources/blns
261 ${CMAKE_BINARY_DIR}/include/bmcweb/blns.hpp
262 )
Ed Tanous1e439872018-05-18 11:48:52 -0700263
Ed Tanousf0d73c22018-07-26 14:24:20 -0700264 set_source_files_properties (
265 ${CMAKE_BINARY_DIR}/include/bmcweb/blns.hpp PROPERTIES GENERATED TRUE
266 )
Ed Tanous1e439872018-05-18 11:48:52 -0700267 enable_testing ()
268
269 add_executable (webtest ${SRC_FILES} ${UT_FILES})
270
271 find_package (GTest REQUIRED)
272 find_package (GMock REQUIRED)
273 target_link_libraries (webtest ${GTEST_LIBRARIES})
274 target_link_libraries (webtest ${GMOCK_LIBRARIES})
275
276 target_link_libraries (webtest pthread)
277 target_link_libraries (webtest ${OPENSSL_LIBRARIES})
278 target_link_libraries (webtest ${ZLIB_LIBRARIES})
279 target_link_libraries (webtest pam)
280 target_link_libraries (webtest tinyxml2)
Ed Tanousd425c6f2018-05-16 10:20:11 -0700281 target_link_libraries (webtest sdbusplus)
Ed Tanouse0625902018-05-16 13:35:08 -0700282 target_link_libraries (webtest -lsystemd)
Ed Tanous1e439872018-05-18 11:48:52 -0700283 target_link_libraries (webtest -lstdc++fs)
284 add_test (webtest webtest "--gtest_output=xml:webtest.xml")
285
286endif (${BMCWEB_BUILD_UT})
287
288install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/static/ DESTINATION share/www)
289
290# bmcweb
291add_executable (bmcweb ${WEBSERVER_MAIN} ${HDR_FILES} ${SRC_FILES})
Ed Tanous1e439872018-05-18 11:48:52 -0700292target_link_libraries (bmcweb ${OPENSSL_LIBRARIES})
293target_link_libraries (bmcweb ${ZLIB_LIBRARIES})
294target_link_libraries (bmcweb pam)
Brad Bishop79ba46f2018-11-29 10:57:31 -0500295target_link_libraries (bmcweb -latomic)
Ed Tanous1e439872018-05-18 11:48:52 -0700296target_link_libraries (bmcweb -lsystemd)
297target_link_libraries (bmcweb -lstdc++fs)
Ed Tanousd425c6f2018-05-16 10:20:11 -0700298target_link_libraries (bmcweb sdbusplus)
Ed Tanous1e439872018-05-18 11:48:52 -0700299target_link_libraries (bmcweb tinyxml2)
300install (TARGETS bmcweb DESTINATION bin)
301
Jason M. Billsc50fc5a2018-11-14 14:49:59 -0800302target_compile_definitions (
303 bmcweb PRIVATE
304 $<$<BOOL:${BMCWEB_ENABLE_KVM}>: -DBMCWEB_ENABLE_KVM>
Adriana Kobylak1bfbe0e2019-01-17 12:08:38 -0600305 $<$<BOOL:${BMCWEB_ENABLE_VM_WEBSOCKET}>: -DBMCWEB_ENABLE_VM_WEBSOCKET>
Jason M. Billsc50fc5a2018-11-14 14:49:59 -0800306 $<$<BOOL:${BMCWEB_ENABLE_DBUS_REST}>: -DBMCWEB_ENABLE_DBUS_REST>
307 $<$<BOOL:${BMCWEB_ENABLE_REDFISH}>: -DBMCWEB_ENABLE_REDFISH>
308 $<$<BOOL:${BMCWEB_ENABLE_STATIC_HOSTING}>: -DBMCWEB_ENABLE_STATIC_HOSTING>
309 $<$<BOOL:${BMCWEB_ENABLE_HOST_SERIAL_WEBSOCKET}>: -DBMCWEB_ENABLE_HOST_SERIAL_WEBSOCKET>
310 $<$<BOOL:${BMCWEB_INSECURE_DISABLE_CSRF_PREVENTION}>: -DBMCWEB_INSECURE_DISABLE_CSRF_PREVENTION>
311 $<$<BOOL:${BMCWEB_INSECURE_DISABLE_SSL}>: -DBMCWEB_INSECURE_DISABLE_SSL>
312 $<$<BOOL:${BMCWEB_INSECURE_DISABLE_XSS_PREVENTION}>: -DBMCWEB_INSECURE_DISABLE_XSS_PREVENTION>
313 $<$<BOOL:${BMCWEB_ENABLE_REDFISH_RAW_PECI}>: -DBMCWEB_ENABLE_REDFISH_RAW_PECI>
314 $<$<BOOL:${BMCWEB_ENABLE_REDFISH_CPU_LOG}>: -DBMCWEB_ENABLE_REDFISH_CPU_LOG>
Jason M. Billsc4bf6372018-11-05 13:48:27 -0800315 $<$<BOOL:${BMCWEB_ENABLE_REDFISH_BMC_JOURNAL}>: -DBMCWEB_ENABLE_REDFISH_BMC_JOURNAL>
Andrew Geisslercb92c032018-08-17 07:56:14 -0700316 $<$<BOOL:${BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES}>: -DBMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES>
Andrew Geissler0554c982019-04-23 14:40:12 -0500317 $<$<BOOL:${BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE}>: -DBMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE>
Andrew Geisslercb92c032018-08-17 07:56:14 -0700318
Brad Bishopf5e906b2018-11-29 10:55:10 -0500319)
Brad Bishop5a7094b2019-04-10 19:33:15 -0400320
321# configure and install systemd unit files
322configure_file (bmcweb.socket bmcweb.socket COPYONLY)
323configure_file (bmcweb.service.in bmcweb.service)
324pkg_get_variable (SYSTEMD_SYSTEMUNITDIR systemd systemdsystemunitdir)
325install (
326 FILES ${PROJECT_BINARY_DIR}/bmcweb.socket
327 DESTINATION ${SYSTEMD_SYSTEMUNITDIR}
328)
329install (
330 FILES ${PROJECT_BINARY_DIR}/bmcweb.service
331 DESTINATION ${SYSTEMD_SYSTEMUNITDIR}
332)