bigsnitch/CMakeLists.txt

89 lines
2.3 KiB
CMake

cmake_minimum_required(VERSION 3.5)
project(bigsnitch LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# for BSD
link_directories(/usr/local/lib)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(PLUGIN_DIR ${CMAKE_BINARY_DIR}/plugins)
find_package(Qt5 COMPONENTS Widgets REQUIRED)
find_package(cppzmq REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(SQLite3 REQUIRED)
find_package(Catch2 REQUIRED)
add_executable(bigsnitch
main.cpp
mainwindow.cpp
networkthread.cpp
session.cpp
httpflow.cpp
proxyhandler.cpp
historymodel.cpp
editandresend.cpp
settings.cpp
mainwindow.h
httpflow.h
networkthread.h
session.h
includes.h
proxyhandler.h
historymodel.h
editandresend.h
settings.h
include/api.h
include/proxyinterface.h
include/httpsender.h
include/httpreceiver.h
mainwindow.ui
editandresend.ui
settings.ui
)
target_include_directories(bigsnitch PRIVATE /usr/local/include)
target_link_libraries(bigsnitch PRIVATE Qt5::Widgets cppzmq sqlite3)
add_executable(bigsnitch_tests
tests/generic_tests.cpp
networkthread.cpp
)
target_include_directories(bigsnitch_tests PRIVATE /usr/local/include)
target_link_libraries(bigsnitch_tests PRIVATE Qt5::Widgets cppzmq sqlite3 Catch2::Catch2)
add_subdirectory(plugins/mitmproxy/)
include(CTest)
include(Catch)
catch_discover_tests(bigsnitch_tests)
option(BUILD_DOCS "build documentation" ON)
if(BUILD_DOCS)
find_package(Doxygen REQUIRED)
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message("Doxygen build started")
add_custom_target( doc_doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM )
endif(BUILD_DOCS)