Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 1 | cmake_minimum_required (VERSION 3.5 FATAL_ERROR) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 2 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 3 | cmake_policy (SET CMP0054 NEW) |
Ed Tanous | cfbe25d | 2017-05-23 16:34:35 -0700 | [diff] [blame] | 4 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 5 | set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 6 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 7 | option (BUILD_STATIC_LIBS "Built static libraries" ON) |
| 8 | option (YOCTO_DEPENDENCIES "Use YOCTO depedencies system" OFF) |
Ed Tanous | 911ac31 | 2017-08-15 09:37:42 -0700 | [diff] [blame] | 9 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 10 | option (BMCWEB_ENABLE_KVM "Enable KVM websocket interfaces" ON) |
| 11 | option (BMCWEB_ENABLE_DBUS_REST "Enable rest dbus interfaces" ON) |
| 12 | option (BMCWEB_ENABLE_REDFISH "Enable redfish interfaces" ON) |
Andrew Geissler | d529ee2 | 2018-08-10 13:49:54 -0700 | [diff] [blame] | 13 | option (BMCWEB_ENABLE_STATIC_HOSTING "Enable hosting of static files. |
| 14 | For example, redfish schema and webui files" ON) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 15 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 16 | # Insecure options. Every option that starts with a BMCWEB_INSECURE flag should |
| 17 | # not be enabled by default for any platform, unless the author fully |
| 18 | # comprehends the implications of doing so. In general, enabling these options |
| 19 | # will cause security problems of varying degrees |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 20 | option (BMCWEB_INSECURE_DISABLE_CSRF_PREVENTION "Disable CSRF prevention checks. |
| 21 | Should be set to OFF for production systems." OFF) |
Ed Tanous | f3d847c | 2017-06-12 16:01:42 -0700 | [diff] [blame] | 22 | |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 23 | option (BMCWEB_INSECURE_DISABLE_SSL "Disable SSL ports. Should be set to OFF for |
| 24 | production systems." OFF) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 25 | |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 26 | option (BMCWEB_INSECURE_DISABLE_AUTHENTICATION "Disable authentication on all |
| 27 | ports. Should be set to OFF for production systems" OFF) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 28 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 29 | option (BMCWEB_INSECURE_DISABLE_XSS_PREVENTION "Disable XSS preventions" OFF) |
Ed Tanous | 0d485ef | 2017-05-23 09:23:53 -0700 | [diff] [blame] | 30 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 31 | project (bmc-webserver CXX) |
| 32 | |
| 33 | include (CTest) |
| 34 | |
| 35 | set (CMAKE_CXX_STANDARD 14) |
| 36 | set (CMAKE_CXX_STANDARD_REQUIRED ON) |
| 37 | |
| 38 | set (CMAKE_EXPORT_COMPILE_COMMANDS ON) |
| 39 | |
| 40 | set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -Wall") |
| 41 | |
| 42 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") |
| 43 | set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti") |
Ed Tanous | 3dac749 | 2017-08-02 13:46:20 -0700 | [diff] [blame] | 44 | |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 45 | # general |
Ed Tanous | 797d0c0 | 2018-08-07 10:22:35 -0700 | [diff] [blame] | 46 | option (BMCWEB_BUILD_UT "Enable Unit test" OFF) |
Ed Tanous | 8041f31 | 2017-04-03 09:47:01 -0700 | [diff] [blame] | 47 | |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 48 | # security flags |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 49 | set (SECURITY_FLAGS "\ |
Ed Tanous | 580f372 | 2018-03-13 16:59:02 -0700 | [diff] [blame] | 50 | -fstack-protector-strong \ |
| 51 | -fPIE \ |
| 52 | -fPIC \ |
| 53 | -D_FORTIFY_SOURCE=2 \ |
| 54 | -Wformat \ |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 55 | -Wformat-security") |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 56 | set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${SECURITY_FLAGS}") |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 57 | set ( |
| 58 | CMAKE_CXX_FLAGS_RELWITHDEBINFO |
| 59 | "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${SECURITY_FLAGS}" |
| 60 | ) |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 61 | set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${SECURITY_FLAGS}") |
Ed Tanous | 3dac749 | 2017-08-02 13:46:20 -0700 | [diff] [blame] | 62 | |
Ed Tanous | 580f372 | 2018-03-13 16:59:02 -0700 | [diff] [blame] | 63 | # Enable link time optimization This is a temporary workaround because |
| 64 | # INTERPROCEDURAL_OPTIMIZATION isn't available until cmake 3.9. gcc-ar and gcc- |
| 65 | # ranlib are wrappers around ar and ranlib which add the lto plugin to the |
| 66 | # command line. |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 67 | if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") |
| 68 | if (NOT CMAKE_BUILD_TYPE MATCHES Debug) |
| 69 | string (REGEX REPLACE "ar$" "gcc-ar" CMAKE_AR ${CMAKE_AR}) |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 70 | string ( |
| 71 | REGEX |
| 72 | REPLACE "ranlib$" "gcc-ranlib" CMAKE_RANLIB ${CMAKE_RANLIB} |
| 73 | ) |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 74 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -fno-fat-lto-objects") |
Borawski.Lukasz | 109799e | 2018-01-30 15:04:42 +0100 | [diff] [blame] | 75 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 76 | # Reduce the binary size by removing unnecessary dynamic symbol table |
| 77 | # entries |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 78 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \ |
Ed Tanous | 580f372 | 2018-03-13 16:59:02 -0700 | [diff] [blame] | 79 | -fvisibility=hidden \ |
| 80 | -fvisibility-inlines-hidden \ |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 81 | -Wl,--exclude-libs,ALL") |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 82 | endif (NOT CMAKE_BUILD_TYPE MATCHES Debug) |
| 83 | endif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") |
Borawski.Lukasz | 109799e | 2018-01-30 15:04:42 +0100 | [diff] [blame] | 84 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 85 | if (NOT ${YOCTO_DEPENDENCIES}) # Download and unpack googletest at configure |
| 86 | # time |
| 87 | configure_file (CMakeLists.txt.in 3rdparty/CMakeLists.txt) |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 88 | execute_process ( |
| 89 | COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . |
| 90 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3rdparty |
| 91 | ) |
| 92 | execute_process ( |
| 93 | COMMAND ${CMAKE_COMMAND} --build . |
| 94 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3rdparty |
| 95 | ) |
Ed tanous | 7d95f5f | 2018-03-23 00:19:20 -0700 | [diff] [blame] | 96 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 97 | set (CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}/prefix ${CMAKE_PREFIX_PATH}) |
| 98 | endif () |
Ed tanous | 7d95f5f | 2018-03-23 00:19:20 -0700 | [diff] [blame] | 99 | |
Ed Tanous | 580f372 | 2018-03-13 16:59:02 -0700 | [diff] [blame] | 100 | # add_definitions(-DBOOST_ASIO_ENABLE_HANDLER_TRACKING) |
Ed Tanous | d3a3806 | 2018-07-27 12:06:29 -0700 | [diff] [blame^] | 101 | add_definitions (-DBOOST_ASIO_DISABLE_THREADS) |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 102 | add_definitions (-DBOOST_ERROR_CODE_HEADER_ONLY) |
| 103 | add_definitions (-DBOOST_SYSTEM_NO_DEPRECATED) |
| 104 | add_definitions (-DBOOST_ALL_NO_LIB) |
| 105 | add_definitions (-DBOOST_NO_RTTI) |
| 106 | add_definitions (-DBOOST_NO_TYPEID) |
Ed tanous | 7d95f5f | 2018-03-23 00:19:20 -0700 | [diff] [blame] | 107 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 108 | find_package (Boost 1.66 REQUIRED) |
| 109 | include_directories (${BOOST_SRC_DIR}) |
Ed Tanous | aa2e59c | 2018-04-12 12:17:20 -0700 | [diff] [blame] | 110 | |
| 111 | # sdbusplus |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 112 | if (NOT ${YOCTO_DEPENDENCIES}) |
James Feist | a975e9f | 2018-08-08 14:03:49 -0700 | [diff] [blame] | 113 | include_directories (${CMAKE_BINARY_DIR}/sdbusplus-src) |
| 114 | link_directories (${CMAKE_BINARY_DIR}/sdbusplus-src/.libs) |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 115 | endif () |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 116 | |
Ed Tanous | 580f372 | 2018-03-13 16:59:02 -0700 | [diff] [blame] | 117 | # Openssl |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 118 | find_package (OpenSSL REQUIRED) |
| 119 | include_directories (${OPENSSL_INCLUDE_DIR}) |
| 120 | message ("OPENSSL_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR}") |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 121 | |
Ed Tanous | 55c7b7a | 2018-05-22 15:27:24 -0700 | [diff] [blame] | 122 | # bmcweb |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 123 | message ("CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") |
| 124 | if (CMAKE_BUILD_TYPE MATCHES Debug) |
| 125 | message ("Logging disabled") |
Ed Tanous | 55c7b7a | 2018-05-22 15:27:24 -0700 | [diff] [blame] | 126 | add_definitions (-DBMCWEB_ENABLE_LOGGING) |
| 127 | add_definitions (-DBMCWEB_ENABLE_DEBUG) |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 128 | endif (CMAKE_BUILD_TYPE MATCHES Debug) |
Ed Tanous | aa2e59c | 2018-04-12 12:17:20 -0700 | [diff] [blame] | 129 | |
Andrew Geissler | 1f2fbf2 | 2018-07-17 07:57:30 -0700 | [diff] [blame] | 130 | if (NOT "${BMCWEB_INSECURE_DISABLE_SSL}") |
Ed Tanous | a434f2b | 2018-07-27 13:04:22 -0700 | [diff] [blame] | 131 | add_definitions (-DBMCWEB_ENABLE_SSL) |
Andrew Geissler | 1f2fbf2 | 2018-07-17 07:57:30 -0700 | [diff] [blame] | 132 | endif (NOT "${BMCWEB_INSECURE_DISABLE_SSL}") |
Ed Tanous | 55c7b7a | 2018-05-22 15:27:24 -0700 | [diff] [blame] | 133 | include_directories (${CMAKE_CURRENT_SOURCE_DIR}/crow/include) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 134 | |
Ed Tanous | 580f372 | 2018-03-13 16:59:02 -0700 | [diff] [blame] | 135 | # Zlib |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 136 | find_package (ZLIB REQUIRED) |
| 137 | include_directories (${ZLIB_INCLUDE_DIRS}) |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 138 | |
Ed Tanous | 4758d5b | 2017-06-06 15:28:13 -0700 | [diff] [blame] | 139 | # PAM |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 140 | option (WEBSERVER_ENABLE_PAM "enable pam authentication" ON) |
| 141 | if ("${WEBSERVER_ENABLE_PAM}") |
| 142 | find_package (PAM REQUIRED) |
| 143 | else () |
| 144 | add_definitions ("-DWEBSERVER_DISABLE_PAM") |
| 145 | endif () |
Ed Tanous | 911ac31 | 2017-08-15 09:37:42 -0700 | [diff] [blame] | 146 | |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 147 | add_definitions ("-Wno-attributes") |
Jennifer Lee | 0334670 | 2018-05-23 14:05:20 -0700 | [diff] [blame] | 148 | # Copy pam-webserver to etc/pam.d |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 149 | install ( |
| 150 | FILES ${CMAKE_CURRENT_SOURCE_DIR}/pam-webserver |
| 151 | DESTINATION /etc/pam.d/ |
| 152 | RENAME webserver |
| 153 | ) |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 154 | |
Ed tanous | 7d95f5f | 2018-03-23 00:19:20 -0700 | [diff] [blame] | 155 | # tinyxml2 |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 156 | find_package (tinyxml2 REQUIRED) |
Ed tanous | 7d95f5f | 2018-03-23 00:19:20 -0700 | [diff] [blame] | 157 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 158 | set (WEBSERVER_MAIN src/webserver_main.cpp) |
Ed Tanous | b4d29f4 | 2017-03-24 16:39:25 -0700 | [diff] [blame] | 159 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 160 | include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include) |
| 161 | include_directories (${CMAKE_CURRENT_SOURCE_DIR}/redfish-core/include) |
Ed Tanous | b4d29f4 | 2017-03-24 16:39:25 -0700 | [diff] [blame] | 162 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 163 | file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/include/bmcweb) |
| 164 | configure_file (settings.hpp.in ${CMAKE_BINARY_DIR}/include/bmcweb/settings.hpp) |
| 165 | include_directories (${CMAKE_BINARY_DIR}/include) |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 166 | |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 167 | set ( |
| 168 | SRC_FILES redfish-core/src/error_messages.cpp |
| 169 | redfish-core/src/utils/json_utils.cpp ${GENERATED_SRC_FILES} |
| 170 | ) |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 171 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 172 | file (COPY src/test_resources DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) |
Ed Tanous | 911ac31 | 2017-08-15 09:37:42 -0700 | [diff] [blame] | 173 | |
Ed Tanous | 38bdb98 | 2017-03-03 14:19:33 -0800 | [diff] [blame] | 174 | # Unit Tests |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 175 | if (${BMCWEB_BUILD_UT}) |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 176 | set ( |
| 177 | UT_FILES src/crow_test.cpp src/gtest_main.cpp |
| 178 | src/token_authorization_middleware_test.cpp |
| 179 | src/security_headers_middleware_test.cpp src/webassets_test.cpp |
| 180 | src/crow_getroutes_test.cpp src/ast_jpeg_decoder_test.cpp |
| 181 | src/kvm_websocket_test.cpp src/msan_test.cpp |
| 182 | src/ast_video_puller_test.cpp src/openbmc_jtag_rest_test.cpp |
| 183 | redfish-core/ut/privileges_test.cpp |
| 184 | ${CMAKE_BINARY_DIR}/include/bmcweb/blns.hpp |
| 185 | ) # big list of naughty strings |
| 186 | add_custom_command ( |
| 187 | OUTPUT ${CMAKE_BINARY_DIR}/include/bmcweb/blns.hpp |
| 188 | COMMAND |
| 189 | xxd -i ${CMAKE_CURRENT_SOURCE_DIR}/src/test_resources/blns |
| 190 | ${CMAKE_BINARY_DIR}/include/bmcweb/blns.hpp |
| 191 | ) |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 192 | |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 193 | set_source_files_properties ( |
| 194 | ${CMAKE_BINARY_DIR}/include/bmcweb/blns.hpp PROPERTIES GENERATED TRUE |
| 195 | ) |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 196 | |
| 197 | enable_testing () |
| 198 | |
| 199 | add_executable (webtest ${SRC_FILES} ${UT_FILES}) |
| 200 | |
| 201 | find_package (GTest REQUIRED) |
| 202 | find_package (GMock REQUIRED) |
| 203 | target_link_libraries (webtest ${GTEST_LIBRARIES}) |
| 204 | target_link_libraries (webtest ${GMOCK_LIBRARIES}) |
| 205 | |
| 206 | target_link_libraries (webtest pthread) |
| 207 | target_link_libraries (webtest ${OPENSSL_LIBRARIES}) |
| 208 | target_link_libraries (webtest ${ZLIB_LIBRARIES}) |
| 209 | target_link_libraries (webtest pam) |
| 210 | target_link_libraries (webtest tinyxml2) |
Ed Tanous | d425c6f | 2018-05-16 10:20:11 -0700 | [diff] [blame] | 211 | target_link_libraries (webtest sdbusplus) |
Ed Tanous | e062590 | 2018-05-16 13:35:08 -0700 | [diff] [blame] | 212 | target_link_libraries (webtest -lsystemd) |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 213 | target_link_libraries (webtest -lstdc++fs) |
| 214 | add_test (webtest webtest "--gtest_output=xml:webtest.xml") |
| 215 | |
| 216 | endif (${BMCWEB_BUILD_UT}) |
| 217 | |
| 218 | install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/static/ DESTINATION share/www) |
| 219 | |
| 220 | # bmcweb |
| 221 | add_executable (bmcweb ${WEBSERVER_MAIN} ${HDR_FILES} ${SRC_FILES}) |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 222 | target_link_libraries (bmcweb ${OPENSSL_LIBRARIES}) |
| 223 | target_link_libraries (bmcweb ${ZLIB_LIBRARIES}) |
| 224 | target_link_libraries (bmcweb pam) |
| 225 | target_link_libraries (bmcweb -lsystemd) |
| 226 | target_link_libraries (bmcweb -lstdc++fs) |
Ed Tanous | d425c6f | 2018-05-16 10:20:11 -0700 | [diff] [blame] | 227 | target_link_libraries (bmcweb sdbusplus) |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 228 | target_link_libraries (bmcweb tinyxml2) |
| 229 | install (TARGETS bmcweb DESTINATION bin) |
| 230 | |
| 231 | add_executable (getvideo src/getvideo_main.cpp) |
| 232 | target_link_libraries (getvideo pthread) |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 233 | |
Ed Tanous | 580f372 | 2018-03-13 16:59:02 -0700 | [diff] [blame] | 234 | # Visual Studio Code helper this needs to be at the end to make sure all |
| 235 | # includes are handled correctly |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 236 | include (CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs) |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 237 | get_property ( |
| 238 | C_INCLUDE_DIRS |
| 239 | DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
| 240 | PROPERTY INCLUDE_DIRECTORIES |
| 241 | ) |
Ed Tanous | 911ac31 | 2017-08-15 09:37:42 -0700 | [diff] [blame] | 242 | |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 243 | execute_process ( |
Ed Tanous | f0d73c2 | 2018-07-26 14:24:20 -0700 | [diff] [blame] | 244 | COMMAND |
| 245 | python3 ${CMAKE_CURRENT_SOURCE_DIR}/scripts/prime_vscode_compile_db.py |
| 246 | ${C_INCLUDE_DIRS} ${CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS} |
| 247 | ${CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS} |
Ed Tanous | 1e43987 | 2018-05-18 11:48:52 -0700 | [diff] [blame] | 248 | ) |