Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 1 | cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) |
| 2 | |
Ed Tanous | cfbe25d | 2017-05-23 16:34:35 -0700 | [diff] [blame] | 3 | cmake_policy(SET CMP0054 NEW) |
| 4 | |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 5 | set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) |
| 6 | |
| 7 | message("${CMAKE_MODULE_PATH}") |
| 8 | |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 9 | SET(BUILD_SHARED_LIBRARIES OFF) |
| 10 | |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 11 | #SET(HUNTER_STATUS_DEBUG ON) |
Ed Tanous | 2d02dcd | 2017-05-15 12:25:30 -0700 | [diff] [blame] | 12 | option(HUNTER_ENABLED "Enable hunter package pulling" OFF) |
Ed Tanous | a1e077c | 2017-04-25 12:42:19 -0700 | [diff] [blame] | 13 | #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") |
| 14 | #SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti") |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 15 | include("cmake/HunterGate.cmake") |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 16 | HunterGate( |
Ed Tanous | cfbe25d | 2017-05-23 16:34:35 -0700 | [diff] [blame] | 17 | URL "https://github.com/ruslo/hunter/archive/v0.18.64.tar.gz" |
| 18 | SHA1 "baf9c8cc4f65306f0e442b5419967b4c4c04589a" |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 19 | ) |
| 20 | |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 21 | project(bmc-webserver CXX C) |
| 22 | |
Ed Tanous | f3d847c | 2017-06-12 16:01:42 -0700 | [diff] [blame] | 23 | include( CTest ) |
| 24 | |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 25 | set(CMAKE_CXX_STANDARD 14) |
| 26 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
| 27 | |
| 28 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) |
| 29 | |
Ed Tanous | eb1b862 | 2017-04-25 14:11:46 -0700 | [diff] [blame] | 30 | if (MSAN) |
| 31 | if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") |
| 32 | message(FATAL_ERROR "Cannot enable MSAN unless using Clang") |
| 33 | endif() |
| 34 | |
| 35 | if (ASAN) |
| 36 | message(FATAL_ERROR "ASAN and MSAN are mutually exclusive") |
| 37 | endif() |
| 38 | |
| 39 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MSAN_CXX_FLAGS}") |
| 40 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MSAN_LINKER_EXE_FLAGS}") |
| 41 | |
| 42 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer") |
| 43 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer") |
| 44 | set(OPENSSL_NO_ASM "1") |
| 45 | set(LIBC++ ON) |
Ed Tanous | f0226cd | 2017-05-16 12:35:38 -0700 | [diff] [blame] | 46 | endif(MSAN) |
Ed Tanous | eb1b862 | 2017-04-25 14:11:46 -0700 | [diff] [blame] | 47 | |
| 48 | if (ASAN) |
| 49 | if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") |
| 50 | message(FATAL_ERROR "Cannot enable ASAN unless using Clang") |
| 51 | endif() |
| 52 | |
| 53 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer") |
| 54 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer") |
| 55 | set(OPENSSL_NO_ASM "1") |
Ed Tanous | f0226cd | 2017-05-16 12:35:38 -0700 | [diff] [blame] | 56 | endif(ASAN) |
Ed Tanous | eb1b862 | 2017-04-25 14:11:46 -0700 | [diff] [blame] | 57 | |
| 58 | if (GCOV) |
| 59 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage") |
| 60 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") |
Ed Tanous | f0226cd | 2017-05-16 12:35:38 -0700 | [diff] [blame] | 61 | endif(GCOV) |
Ed Tanous | eb1b862 | 2017-04-25 14:11:46 -0700 | [diff] [blame] | 62 | |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 63 | if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} ) |
| 64 | message( FATAL_ERROR "In-source builds not allowed. Please make a new directory (usually called build) and run CMake from there. You may need to remove CMakeCache.txt." ) |
| 65 | endif() |
| 66 | |
Ed Tanous | eb1b862 | 2017-04-25 14:11:46 -0700 | [diff] [blame] | 67 | if(LIBC++) |
| 68 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") |
| 69 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc++abi") |
| 70 | if (MSAN) |
| 71 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/home/ed/libcxx_msan/include -I/home/ed/libcxx_msan/include/c++/v1") |
| 72 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/home/ed/libcxx_msan/lib -Wl,-rpath,I/home/ed/libcxx_msan/lib") |
| 73 | endif(MSAN) |
| 74 | endif(LIBC++) |
| 75 | |
Ed Tanous | 0d485ef | 2017-05-23 09:23:53 -0700 | [diff] [blame] | 76 | #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall") |
| 77 | |
Ed Tanous | 3dac749 | 2017-08-02 13:46:20 -0700 | [diff] [blame] | 78 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") |
| 79 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti") |
| 80 | |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 81 | # general |
Ed Tanous | 38bdb98 | 2017-03-03 14:19:33 -0800 | [diff] [blame] | 82 | option(BUILD_SHARED_LIBS "Build as shared library" OFF) |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 83 | option(BUILD_UT "Enable Unit test" ON) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 84 | |
Ed Tanous | 8041f31 | 2017-04-03 09:47:01 -0700 | [diff] [blame] | 85 | # This needs to be before the crow and other module includes so headers get overriden correctly |
| 86 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) |
| 87 | |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 88 | # security flags |
| 89 | #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong -fPIE -fPIC -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security" ) |
| 90 | #SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack -z relro -z now") |
| 91 | |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 92 | # Boost |
Ed Tanous | a1e077c | 2017-04-25 12:42:19 -0700 | [diff] [blame] | 93 | #add_definitions(-DBOOST_NO_RTTI -DBOOST_NO_TYPEID) |
| 94 | |
Ed Tanous | 3dac749 | 2017-08-02 13:46:20 -0700 | [diff] [blame] | 95 | # TinyXML2 |
| 96 | #add_subdirectory(tinyxml2) |
| 97 | #include_directories(tinyxml2) |
| 98 | |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 99 | #add_definitions(-DBOOST_ASIO_ENABLE_HANDLER_TRACKING) |
Ed Tanous | 01250f2 | 2017-04-18 17:49:51 -0700 | [diff] [blame] | 100 | add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY) |
| 101 | add_definitions(-DBOOST_SYSTEM_NO_DEPRECATED) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 102 | add_definitions(-DBOOST_ALL_NO_LIB) |
Ed Tanous | 3dac749 | 2017-08-02 13:46:20 -0700 | [diff] [blame] | 103 | add_definitions(-DBOOST_NO_RTTI) |
| 104 | add_definitions(-DBOOST_NO_TYPEID) |
Ed Tanous | 0d485ef | 2017-05-23 09:23:53 -0700 | [diff] [blame] | 105 | #set(Boost_USE_STATIC_LIBS ON) |
Ed Tanous | eb1b862 | 2017-04-25 14:11:46 -0700 | [diff] [blame] | 106 | hunter_add_package(Boost) |
Ed Tanous | 2d02dcd | 2017-05-15 12:25:30 -0700 | [diff] [blame] | 107 | find_package(Boost REQUIRED) |
Ed Tanous | e2fc45a | 2017-04-26 09:19:10 -0700 | [diff] [blame] | 108 | include_directories(${Boost_INCLUDE_DIRS}) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 109 | |
| 110 | #Openssl |
Ed Tanous | 2d02dcd | 2017-05-15 12:25:30 -0700 | [diff] [blame] | 111 | hunter_add_package(OpenSSL) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 112 | find_package(OpenSSL REQUIRED) |
Ed Tanous | f0226cd | 2017-05-16 12:35:38 -0700 | [diff] [blame] | 113 | include_directories(${OPENSSL_INCLUDE_DIR}) |
Ed Tanous | 0d485ef | 2017-05-23 09:23:53 -0700 | [diff] [blame] | 114 | message("OPENSSL_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR}") |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 115 | |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 116 | #lib jpeg |
| 117 | set(BUILD_STATIC ON) |
| 118 | #include_directories(libjpeg) |
| 119 | #include_directories(${CMAKE_CURRENT_BINARY_DIR}/libjpeg) |
| 120 | #add_subdirectory(libjpeg) |
| 121 | |
Ed Tanous | 8041f31 | 2017-04-03 09:47:01 -0700 | [diff] [blame] | 122 | |
Ed Tanous | cc5a37f | 2017-05-11 10:27:23 -0700 | [diff] [blame] | 123 | # dbus |
Ed Tanous | 2d02dcd | 2017-05-15 12:25:30 -0700 | [diff] [blame] | 124 | hunter_add_package(dbus) |
Ed Tanous | cc5a37f | 2017-05-11 10:27:23 -0700 | [diff] [blame] | 125 | find_package(dbus REQUIRED) # Include functions provided by PkgConfig module. |
Ed Tanous | e4e67cc | 2017-05-12 16:10:59 -0700 | [diff] [blame] | 126 | include_directories(${DBUS_INCLUDE_DIRS}) |
Ed Tanous | cc5a37f | 2017-05-11 10:27:23 -0700 | [diff] [blame] | 127 | |
Ed Tanous | 8041f31 | 2017-04-03 09:47:01 -0700 | [diff] [blame] | 128 | # Crow |
Ed Tanous | 4c3cbc6 | 2017-05-16 09:17:42 -0700 | [diff] [blame] | 129 | #add_definitions(-DCROW_DISABLE_LOGGING) |
Ed Tanous | 8041f31 | 2017-04-03 09:47:01 -0700 | [diff] [blame] | 130 | add_definitions(-DCROW_ENABLE_SSL) |
| 131 | include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/crow/include) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 132 | |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 133 | #Zlib |
Ed Tanous | 7d3dba4 | 2017-04-05 13:04:39 -0700 | [diff] [blame] | 134 | hunter_add_package(ZLIB) |
| 135 | find_package(ZLIB REQUIRED) |
Ed Tanous | f0226cd | 2017-05-16 12:35:38 -0700 | [diff] [blame] | 136 | include_directories(${ZLIB_INCLUDE_DIRS}) |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 137 | |
Ed Tanous | 4758d5b | 2017-06-06 15:28:13 -0700 | [diff] [blame] | 138 | |
| 139 | # PAM |
| 140 | find_package(PAM REQUIRED) |
| 141 | |
Ed Tanous | c9b5521 | 2017-06-12 13:25:51 -0700 | [diff] [blame] | 142 | # Boost-dbus |
Ed Tanous | c579949 | 2017-06-13 14:06:43 -0700 | [diff] [blame] | 143 | if(${BUILD_UT}) |
| 144 | add_subdirectory(boost-dbus) |
| 145 | endif() |
Ed Tanous | c9b5521 | 2017-06-12 13:25:51 -0700 | [diff] [blame] | 146 | include_directories(boost-dbus/include) |
| 147 | |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 148 | set(WEBSERVER_MAIN src/webserver_main.cpp) |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 149 | |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 150 | set(HDR_FILES |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 151 | include/ssl_key_handler.hpp |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 152 | ) |
| 153 | |
| 154 | set(GENERATED_SRC_FILES |
| 155 | ${CMAKE_BINARY_DIR}/generated/webassets.cpp |
Ed Tanous | b4a7bfa | 2017-04-04 17:23:00 -0700 | [diff] [blame] | 156 | ${CMAKE_BINARY_DIR}/generated/webassets.hpp |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 157 | ) |
| 158 | |
Ed Tanous | b4a7bfa | 2017-04-04 17:23:00 -0700 | [diff] [blame] | 159 | include_directories(${CMAKE_BINARY_DIR}/generated) |
| 160 | |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 161 | set_source_files_properties(${GENERATED_SRC_FILES} PROPERTIES GENERATED TRUE) |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 162 | |
Ed Tanous | 12a002d | 2017-05-15 11:59:16 -0700 | [diff] [blame] | 163 | # the webassets file has a non-ideal beahvior, where it loads binary data into a std::string |
| 164 | # due to the way crow is constructed. This causes GCC warnings. Filter them out. |
Ed Tanous | b4d29f4 | 2017-03-24 16:39:25 -0700 | [diff] [blame] | 165 | if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") |
Ed Tanous | 12a002d | 2017-05-15 11:59:16 -0700 | [diff] [blame] | 166 | if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9) |
Ed Tanous | b4d29f4 | 2017-03-24 16:39:25 -0700 | [diff] [blame] | 167 | set_source_files_properties(${CMAKE_BINARY_DIR}/generated/webassets.cpp PROPERTIES COMPILE_FLAGS -Wno-narrowing) |
Ed Tanous | 12a002d | 2017-05-15 11:59:16 -0700 | [diff] [blame] | 168 | endif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9) |
Ed Tanous | b4d29f4 | 2017-03-24 16:39:25 -0700 | [diff] [blame] | 169 | endif() |
| 170 | |
| 171 | |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 172 | set(SRC_FILES |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 173 | src/base64.cpp |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 174 | ${GENERATED_SRC_FILES} |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 175 | ) |
| 176 | |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 177 | set(UT_FILES |
Ed Tanous | 9140a67 | 2017-04-24 17:01:32 -0700 | [diff] [blame] | 178 | src/crow_test.cpp |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 179 | src/gtest_main.cpp |
| 180 | src/base64_test.cpp |
| 181 | src/token_authorization_middleware_test.cpp |
Ed Tanous | b4a7bfa | 2017-04-04 17:23:00 -0700 | [diff] [blame] | 182 | src/security_headers_middleware_test.cpp |
| 183 | src/webassets_test.cpp |
| 184 | src/crow_getroutes_test.cpp |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 185 | src/ast_jpeg_decoder_test.cpp |
Ed Tanous | 9140a67 | 2017-04-24 17:01:32 -0700 | [diff] [blame] | 186 | src/kvm_websocket_test.cpp |
| 187 | src/test_utils.cpp |
Ed Tanous | 01250f2 | 2017-04-18 17:49:51 -0700 | [diff] [blame] | 188 | src/msan_test.cpp |
Ed Tanous | 9140a67 | 2017-04-24 17:01:32 -0700 | [diff] [blame] | 189 | src/ci_map_tests.cpp |
Ed Tanous | e2fc45a | 2017-04-26 09:19:10 -0700 | [diff] [blame] | 190 | src/ast_video_puller_test.cpp |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 191 | ${CMAKE_BINARY_DIR}/generated/blns.hpp |
| 192 | ) |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 193 | |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 194 | |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 195 | file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/generated") |
| 196 | |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 197 | file(COPY src/test_resources DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) |
| 198 | |
Ed Tanous | 38bdb98 | 2017-03-03 14:19:33 -0800 | [diff] [blame] | 199 | # Unit Tests |
| 200 | if(${BUILD_UT}) |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 201 | # big list of naughty strings |
| 202 | add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/generated/blns.hpp |
Ed Tanous | cc5a37f | 2017-05-11 10:27:23 -0700 | [diff] [blame] | 203 | COMMAND xxd -i ${CMAKE_CURRENT_SOURCE_DIR}/src/test_resources/blns ${CMAKE_BINARY_DIR}/generated/blns.hpp) |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 204 | |
Ed Tanous | 38bdb98 | 2017-03-03 14:19:33 -0800 | [diff] [blame] | 205 | # googletest |
| 206 | enable_testing() |
Ed Tanous | 4c3cbc6 | 2017-05-16 09:17:42 -0700 | [diff] [blame] | 207 | |
Ed Tanous | 01250f2 | 2017-04-18 17:49:51 -0700 | [diff] [blame] | 208 | #hunter_add_package(GTest) |
| 209 | add_subdirectory(googletest) |
| 210 | #find_package(GMock CONFIG REQUIRED) |
Ed Tanous | 38bdb98 | 2017-03-03 14:19:33 -0800 | [diff] [blame] | 211 | |
Ed Tanous | c9b5521 | 2017-06-12 13:25:51 -0700 | [diff] [blame] | 212 | add_executable(webtest ${HDR_FILES} ${SRC_FILES} ${UT_FILES}) |
| 213 | target_link_libraries(webtest gmock gtest) |
| 214 | target_link_libraries(webtest pthread) |
Ed Tanous | f0226cd | 2017-05-16 12:35:38 -0700 | [diff] [blame] | 215 | |
Ed Tanous | c9b5521 | 2017-06-12 13:25:51 -0700 | [diff] [blame] | 216 | target_link_libraries(webtest ${OPENSSL_LIBRARIES}) |
| 217 | target_link_libraries(webtest ${ZLIB_LIBRARIES}) |
| 218 | target_link_libraries(webtest pam) |
| 219 | add_dependencies(webtest packagestaticcpp) |
| 220 | add_test(webtest webtest "--gtest_output=xml:webtest.xml") |
| 221 | |
Ed Tanous | 38bdb98 | 2017-03-03 14:19:33 -0800 | [diff] [blame] | 222 | endif(${BUILD_UT}) |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 223 | |
| 224 | # web static assets |
| 225 | add_subdirectory(static) |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 226 | |
Ed Tanous | c9b5521 | 2017-06-12 13:25:51 -0700 | [diff] [blame] | 227 | |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 228 | # bmcweb |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 229 | add_executable(bmcweb ${WEBSERVER_MAIN} ${HDR_FILES} ${SRC_FILES}) |
Ed Tanous | 01250f2 | 2017-04-18 17:49:51 -0700 | [diff] [blame] | 230 | target_link_libraries(bmcweb pthread) |
Ed Tanous | f0226cd | 2017-05-16 12:35:38 -0700 | [diff] [blame] | 231 | target_link_libraries(bmcweb ${OPENSSL_LIBRARIES}) |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 232 | target_link_libraries(bmcweb ${ZLIB_LIBRARIES}) |
Ed Tanous | dc7b679 | 2017-05-12 15:55:51 -0700 | [diff] [blame] | 233 | target_link_libraries(bmcweb ${DBUS_LIBRARIES}) |
Ed Tanous | 4758d5b | 2017-06-06 15:28:13 -0700 | [diff] [blame] | 234 | target_link_libraries(bmcweb pam) |
Ed Tanous | f0226cd | 2017-05-16 12:35:38 -0700 | [diff] [blame] | 235 | add_dependencies(bmcweb packagestaticcpp) |
Ed Tanous | 12a002d | 2017-05-15 11:59:16 -0700 | [diff] [blame] | 236 | install (TARGETS bmcweb DESTINATION bin) |
Ed Tanous | cc5a37f | 2017-05-11 10:27:23 -0700 | [diff] [blame] | 237 | |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 238 | add_executable(getvideo src/getvideo_main.cpp) |
Ed Tanous | 01250f2 | 2017-04-18 17:49:51 -0700 | [diff] [blame] | 239 | target_link_libraries(getvideo pthread) |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 240 | |
Ed Tanous | 38bdb98 | 2017-03-03 14:19:33 -0800 | [diff] [blame] | 241 | # Visual Studio Code helper |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 242 | # this needs to be at the end to make sure all includes are handled correctly |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 243 | |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 244 | get_property(C_INCLUDE_DIRS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) |
Ed Tanous | cfbe25d | 2017-05-23 16:34:35 -0700 | [diff] [blame] | 245 | execute_process(COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/scripts/prime_vscode_compile_db.py ${C_INCLUDE_DIRS}) |