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 | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 3 | set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) |
| 4 | |
| 5 | message("${CMAKE_MODULE_PATH}") |
| 6 | |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 7 | SET(BUILD_SHARED_LIBRARIES OFF) |
| 8 | |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 9 | #SET(HUNTER_STATUS_DEBUG ON) |
Ed Tanous | a1e077c | 2017-04-25 12:42:19 -0700 | [diff] [blame] | 10 | #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") |
| 11 | #SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti") |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 12 | include("cmake/HunterGate.cmake") |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 13 | HunterGate( |
Ed Tanous | a1e077c | 2017-04-25 12:42:19 -0700 | [diff] [blame] | 14 | URL "https://github.com/ruslo/hunter/archive/v0.18.44.tar.gz" |
| 15 | SHA1 "a78f0b377b8e53c038f12fc18b0c02564c4534c8" |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 16 | ) |
| 17 | |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 18 | project(bmc-webserver CXX C) |
| 19 | |
| 20 | set(CMAKE_CXX_STANDARD 14) |
| 21 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
| 22 | |
| 23 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) |
| 24 | |
Ed Tanous | eb1b862 | 2017-04-25 14:11:46 -0700 | [diff] [blame] | 25 | if (MSAN) |
| 26 | if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") |
| 27 | message(FATAL_ERROR "Cannot enable MSAN unless using Clang") |
| 28 | endif() |
| 29 | |
| 30 | if (ASAN) |
| 31 | message(FATAL_ERROR "ASAN and MSAN are mutually exclusive") |
| 32 | endif() |
| 33 | |
| 34 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MSAN_CXX_FLAGS}") |
| 35 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MSAN_LINKER_EXE_FLAGS}") |
| 36 | |
| 37 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer") |
| 38 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer") |
| 39 | set(OPENSSL_NO_ASM "1") |
| 40 | set(LIBC++ ON) |
| 41 | endif() |
| 42 | |
| 43 | if (ASAN) |
| 44 | if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") |
| 45 | message(FATAL_ERROR "Cannot enable ASAN unless using Clang") |
| 46 | endif() |
| 47 | |
| 48 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer") |
| 49 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer") |
| 50 | set(OPENSSL_NO_ASM "1") |
| 51 | endif() |
| 52 | |
| 53 | if (GCOV) |
| 54 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage") |
| 55 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") |
| 56 | endif() |
| 57 | |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 58 | if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} ) |
| 59 | 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." ) |
| 60 | endif() |
| 61 | |
Ed Tanous | eb1b862 | 2017-04-25 14:11:46 -0700 | [diff] [blame] | 62 | if(LIBC++) |
| 63 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") |
| 64 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc++abi") |
| 65 | if (MSAN) |
| 66 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/home/ed/libcxx_msan/include -I/home/ed/libcxx_msan/include/c++/v1") |
| 67 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/home/ed/libcxx_msan/lib -Wl,-rpath,I/home/ed/libcxx_msan/lib") |
| 68 | endif(MSAN) |
| 69 | endif(LIBC++) |
| 70 | |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 71 | # general |
Ed Tanous | 38bdb98 | 2017-03-03 14:19:33 -0800 | [diff] [blame] | 72 | option(BUILD_SHARED_LIBS "Build as shared library" OFF) |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 73 | option(BUILD_UT "Enable Unit test" ON) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 74 | |
Ed Tanous | 8041f31 | 2017-04-03 09:47:01 -0700 | [diff] [blame] | 75 | # This needs to be before the crow and other module includes so headers get overriden correctly |
| 76 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) |
| 77 | |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 78 | # security flags |
| 79 | #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong -fPIE -fPIC -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security" ) |
| 80 | #SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack -z relro -z now") |
| 81 | |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 82 | # Boost |
Ed Tanous | a1e077c | 2017-04-25 12:42:19 -0700 | [diff] [blame] | 83 | #add_definitions(-DBOOST_NO_RTTI -DBOOST_NO_TYPEID) |
| 84 | |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 85 | #add_definitions(-DBOOST_ASIO_ENABLE_HANDLER_TRACKING) |
Ed Tanous | 01250f2 | 2017-04-18 17:49:51 -0700 | [diff] [blame] | 86 | add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY) |
| 87 | add_definitions(-DBOOST_SYSTEM_NO_DEPRECATED) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 88 | add_definitions(-DBOOST_ALL_NO_LIB) |
| 89 | set(Boost_USE_STATIC_LIBS ON) |
Ed Tanous | eb1b862 | 2017-04-25 14:11:46 -0700 | [diff] [blame] | 90 | hunter_add_package(Boost) |
| 91 | find_package(Boost) |
Ed Tanous | e2fc45a | 2017-04-26 09:19:10 -0700 | [diff] [blame] | 92 | include_directories(${Boost_INCLUDE_DIRS}) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 93 | |
| 94 | #Openssl |
Ed Tanous | e2fc45a | 2017-04-26 09:19:10 -0700 | [diff] [blame] | 95 | #hunter_add_package(OpenSSL) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 96 | find_package(OpenSSL REQUIRED) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 97 | |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 98 | #g3 logging |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 99 | # G3logger does some unfortunate compile options, so cheat a little bit and copy/paste |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 100 | set(LOG_SRC ${CMAKE_CURRENT_SOURCE_DIR}/g3log/src) |
| 101 | |
| 102 | file(GLOB_RECURSE SRC_FILES ${LOG_SRC}/*.cpp ${LOG_SRC}/*.ipp) |
| 103 | file(GLOB_RECURSE HEADER_FILES ${LOG_SRC}/*.hpp) |
| 104 | |
| 105 | IF (MSVC OR MINGW) |
Ed Tanous | a1e077c | 2017-04-25 12:42:19 -0700 | [diff] [blame] | 106 | list(REMOVE_ITEM SRC_FILES ${LOG_SRC}/crashhandler_unix.cpp) |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 107 | ELSE() |
Ed Tanous | a1e077c | 2017-04-25 12:42:19 -0700 | [diff] [blame] | 108 | list(REMOVE_ITEM SRC_FILES ${LOG_SRC}/crashhandler_windows.cpp ${LOG_SRC}/g3log/stacktrace_windows.hpp ${LOG_SRC}/stacktrace_windows.cpp) |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 109 | ENDIF (MSVC OR MINGW) |
| 110 | |
| 111 | # Create the g3log library |
| 112 | include_directories(${LOG_SRC}) |
Ed Tanous | 8041f31 | 2017-04-03 09:47:01 -0700 | [diff] [blame] | 113 | |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 114 | add_library(g3logger ${SRC_FILES}) |
Ed Tanous | dc7b679 | 2017-05-12 15:55:51 -0700 | [diff] [blame^] | 115 | set_target_properties(g3logger PROPERTIES LINKER_LANGUAGE CXX) |
Ed Tanous | 9140a67 | 2017-04-24 17:01:32 -0700 | [diff] [blame] | 116 | # clean up some warnings in files we don't own |
Ed Tanous | 7d3dba4 | 2017-04-05 13:04:39 -0700 | [diff] [blame] | 117 | if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) |
| 118 | set_source_files_properties(g3log/src/logcapture.cpp PROPERTIES COMPILE_FLAGS -Wno-braced-scalar-init) |
| 119 | set_source_files_properties(g3log/src/filesink.cpp PROPERTIES COMPILE_FLAGS -Wno-braced-scalar-init) |
| 120 | set_source_files_properties(g3log/src/logworker.cpp PROPERTIES COMPILE_FLAGS -Wno-braced-scalar-init) |
| 121 | endif() |
| 122 | |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 123 | #lib jpeg |
| 124 | set(BUILD_STATIC ON) |
| 125 | #include_directories(libjpeg) |
| 126 | #include_directories(${CMAKE_CURRENT_BINARY_DIR}/libjpeg) |
| 127 | #add_subdirectory(libjpeg) |
| 128 | |
Ed Tanous | 8041f31 | 2017-04-03 09:47:01 -0700 | [diff] [blame] | 129 | |
Ed Tanous | cc5a37f | 2017-05-11 10:27:23 -0700 | [diff] [blame] | 130 | # dbus |
Ed Tanous | dc7b679 | 2017-05-12 15:55:51 -0700 | [diff] [blame^] | 131 | #hunter_add_package(dbus) |
Ed Tanous | cc5a37f | 2017-05-11 10:27:23 -0700 | [diff] [blame] | 132 | find_package(dbus REQUIRED) # Include functions provided by PkgConfig module. |
Ed Tanous | dc7b679 | 2017-05-12 15:55:51 -0700 | [diff] [blame^] | 133 | include_directories(${DBUS_INCLUDE_DIR}) |
Ed Tanous | cc5a37f | 2017-05-11 10:27:23 -0700 | [diff] [blame] | 134 | |
Ed Tanous | 8041f31 | 2017-04-03 09:47:01 -0700 | [diff] [blame] | 135 | # Crow |
Ed Tanous | 9140a67 | 2017-04-24 17:01:32 -0700 | [diff] [blame] | 136 | add_definitions(-DCROW_DISABLE_LOGGING) |
Ed Tanous | 8041f31 | 2017-04-03 09:47:01 -0700 | [diff] [blame] | 137 | add_definitions(-DCROW_ENABLE_SSL) |
| 138 | include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/crow/include) |
Ed Tanous | 0fdddb1 | 2017-02-28 11:06:34 -0800 | [diff] [blame] | 139 | |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 140 | #Zlib |
Ed Tanous | 7d3dba4 | 2017-04-05 13:04:39 -0700 | [diff] [blame] | 141 | hunter_add_package(ZLIB) |
| 142 | find_package(ZLIB REQUIRED) |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 143 | |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 144 | # C++ GSL (Guideline support libraries) |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 145 | include_directories(gsl-lite/include) |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 146 | |
| 147 | set(WEBSERVER_MAIN src/webserver_main.cpp) |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 148 | |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 149 | set(HDR_FILES |
Ed Tanous | 8041f31 | 2017-04-03 09:47:01 -0700 | [diff] [blame] | 150 | include/crow/g3_logger.hpp |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 151 | include/ssl_key_handler.hpp |
| 152 | include/color_cout_g3_sink.hpp |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 153 | ) |
| 154 | |
| 155 | set(GENERATED_SRC_FILES |
| 156 | ${CMAKE_BINARY_DIR}/generated/webassets.cpp |
Ed Tanous | b4a7bfa | 2017-04-04 17:23:00 -0700 | [diff] [blame] | 157 | ${CMAKE_BINARY_DIR}/generated/webassets.hpp |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 158 | ) |
| 159 | |
Ed Tanous | b4a7bfa | 2017-04-04 17:23:00 -0700 | [diff] [blame] | 160 | include_directories(${CMAKE_BINARY_DIR}/generated) |
| 161 | |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 162 | set_source_files_properties(${GENERATED_SRC_FILES} PROPERTIES GENERATED TRUE) |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 163 | |
Ed Tanous | b4d29f4 | 2017-03-24 16:39:25 -0700 | [diff] [blame] | 164 | if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") |
| 165 | if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) |
| 166 | set_source_files_properties(${CMAKE_BINARY_DIR}/generated/webassets.cpp PROPERTIES COMPILE_FLAGS -Wno-narrowing) |
| 167 | endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) |
| 168 | endif() |
| 169 | |
| 170 | |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 171 | set(SRC_FILES |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 172 | src/token_authorization_middleware.cpp |
Ed Tanous | 8041f31 | 2017-04-03 09:47:01 -0700 | [diff] [blame] | 173 | src/security_headers_middleware.cpp |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 174 | src/base64.cpp |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 175 | ${GENERATED_SRC_FILES} |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 176 | ) |
| 177 | |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 178 | set(UT_FILES |
Ed Tanous | 7d3dba4 | 2017-04-05 13:04:39 -0700 | [diff] [blame] | 179 | g3log/test_unit/test_cpp_future_concepts.cpp |
| 180 | g3log/test_unit/tester_sharedlib.cpp |
| 181 | # TODO(ed) figure out why this unit test has a main function in it |
| 182 | #g3log/test_unit/test_filechange.cpp |
| 183 | g3log/test_unit/testing_helpers.h |
| 184 | #TODO(ed) |
| 185 | #g3log/test_unit/test_linux_dynamic_loaded_sharedlib.cpp |
| 186 | #g3log/test_unit/test_sink.cpp |
| 187 | g3log/test_unit/test_concept_sink.cpp |
| 188 | g3log/test_unit/test_crashhandler_windows.cpp |
| 189 | g3log/test_unit/tester_sharedlib.h |
| 190 | g3log/test_unit/testing_helpers.cpp |
| 191 | g3log/test_unit/test_io.cpp |
| 192 | g3log/test_unit/test_message.cpp |
Ed Tanous | 9140a67 | 2017-04-24 17:01:32 -0700 | [diff] [blame] | 193 | src/crow_test.cpp |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 194 | src/gtest_main.cpp |
| 195 | src/base64_test.cpp |
| 196 | src/token_authorization_middleware_test.cpp |
Ed Tanous | b4a7bfa | 2017-04-04 17:23:00 -0700 | [diff] [blame] | 197 | src/security_headers_middleware_test.cpp |
| 198 | src/webassets_test.cpp |
| 199 | src/crow_getroutes_test.cpp |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 200 | src/ast_jpeg_decoder_test.cpp |
Ed Tanous | 9140a67 | 2017-04-24 17:01:32 -0700 | [diff] [blame] | 201 | src/kvm_websocket_test.cpp |
| 202 | src/test_utils.cpp |
Ed Tanous | 01250f2 | 2017-04-18 17:49:51 -0700 | [diff] [blame] | 203 | src/msan_test.cpp |
Ed Tanous | 9140a67 | 2017-04-24 17:01:32 -0700 | [diff] [blame] | 204 | src/ci_map_tests.cpp |
Ed Tanous | e2fc45a | 2017-04-26 09:19:10 -0700 | [diff] [blame] | 205 | src/ast_video_puller_test.cpp |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 206 | ${CMAKE_BINARY_DIR}/generated/blns.hpp |
| 207 | ) |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 208 | |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 209 | |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 210 | file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/generated") |
| 211 | |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 212 | file(COPY src/test_resources DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) |
| 213 | |
Ed Tanous | 38bdb98 | 2017-03-03 14:19:33 -0800 | [diff] [blame] | 214 | # Unit Tests |
| 215 | if(${BUILD_UT}) |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 216 | # big list of naughty strings |
| 217 | add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/generated/blns.hpp |
Ed Tanous | cc5a37f | 2017-05-11 10:27:23 -0700 | [diff] [blame] | 218 | 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] | 219 | |
Ed Tanous | 38bdb98 | 2017-03-03 14:19:33 -0800 | [diff] [blame] | 220 | # googletest |
| 221 | enable_testing() |
Ed Tanous | 01250f2 | 2017-04-18 17:49:51 -0700 | [diff] [blame] | 222 | #hunter_add_package(GTest) |
| 223 | add_subdirectory(googletest) |
| 224 | #find_package(GMock CONFIG REQUIRED) |
Ed Tanous | 38bdb98 | 2017-03-03 14:19:33 -0800 | [diff] [blame] | 225 | |
| 226 | add_executable(unittest ${HDR_FILES} ${SRC_FILES} ${UT_FILES}) |
Ed Tanous | 01250f2 | 2017-04-18 17:49:51 -0700 | [diff] [blame] | 227 | target_link_libraries(unittest gmock gtest) |
| 228 | target_link_libraries(unittest pthread) |
Ed Tanous | 38bdb98 | 2017-03-03 14:19:33 -0800 | [diff] [blame] | 229 | target_link_libraries(unittest OpenSSL::SSL OpenSSL::Crypto) |
| 230 | target_link_libraries(unittest g3logger) |
Ed Tanous | 7d3dba4 | 2017-04-05 13:04:39 -0700 | [diff] [blame] | 231 | target_link_libraries(unittest ${ZLIB_LIBRARIES}) |
Ed Tanous | 38bdb98 | 2017-03-03 14:19:33 -0800 | [diff] [blame] | 232 | add_dependencies(unittest packagestaticcpp) |
| 233 | endif(${BUILD_UT}) |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 234 | |
| 235 | # web static assets |
| 236 | add_subdirectory(static) |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 237 | |
| 238 | # bmcweb |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 239 | add_executable(bmcweb ${WEBSERVER_MAIN} ${HDR_FILES} ${SRC_FILES}) |
Ed Tanous | 01250f2 | 2017-04-18 17:49:51 -0700 | [diff] [blame] | 240 | target_link_libraries(bmcweb pthread) |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 241 | target_link_libraries(bmcweb OpenSSL::SSL OpenSSL::Crypto) |
| 242 | target_link_libraries(bmcweb g3logger) |
Ed Tanous | 9b65f1f | 2017-03-07 15:17:13 -0800 | [diff] [blame] | 243 | target_link_libraries(bmcweb ${ZLIB_LIBRARIES}) |
Ed Tanous | 904063f | 2017-03-02 16:48:24 -0800 | [diff] [blame] | 244 | add_dependencies(bmcweb packagestaticcpp) |
Ed Tanous | dc7b679 | 2017-05-12 15:55:51 -0700 | [diff] [blame^] | 245 | target_link_libraries(bmcweb ${DBUS_LIBRARIES}) |
Ed Tanous | cc5a37f | 2017-05-11 10:27:23 -0700 | [diff] [blame] | 246 | |
| 247 | # dbus |
Ed Tanous | dc7b679 | 2017-05-12 15:55:51 -0700 | [diff] [blame^] | 248 | add_executable(dbus_test src/dbus_main.cpp) |
| 249 | target_link_libraries(dbus_test ${DBUS_LIBRARIES}) |
Ed Tanous | f927347 | 2017-02-28 16:05:13 -0800 | [diff] [blame] | 250 | |
Ed Tanous | 93f987d | 2017-04-17 17:52:36 -0700 | [diff] [blame] | 251 | # udpclient |
Ed Tanous | 9140a67 | 2017-04-24 17:01:32 -0700 | [diff] [blame] | 252 | #add_executable(udpclient src/udpclient.cpp) |
| 253 | #target_link_libraries(udpclient pthread) |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 254 | |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 255 | add_executable(getvideo src/getvideo_main.cpp) |
Ed Tanous | 01250f2 | 2017-04-18 17:49:51 -0700 | [diff] [blame] | 256 | target_link_libraries(getvideo pthread) |
Ed Tanous | d5f3999 | 2017-04-18 13:41:22 -0700 | [diff] [blame] | 257 | target_link_libraries(getvideo g3logger) |
Ed Tanous | 1ccd57c | 2017-03-21 13:15:58 -0700 | [diff] [blame] | 258 | |
Ed Tanous | 38bdb98 | 2017-03-03 14:19:33 -0800 | [diff] [blame] | 259 | # Visual Studio Code helper |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 260 | # 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] | 261 | |
Ed Tanous | 5f34a9c | 2017-02-28 12:35:13 -0800 | [diff] [blame] | 262 | get_property(C_INCLUDE_DIRS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) |
Ed Tanous | 01250f2 | 2017-04-18 17:49:51 -0700 | [diff] [blame] | 263 | execute_process(COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/scripts/prime_vscode_compile_db.py ${C_INCLUDE_DIRS}) |