86 lines
2.2 KiB
CMake
86 lines
2.2 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(nlohmann_json REQUIRED)
|
|
find_package(SQLite3 REQUIRED)
|
|
find_package(Catch2 REQUIRED)
|
|
|
|
add_executable(bigsnitch
|
|
main.cpp
|
|
mainwindow.cpp
|
|
session.cpp
|
|
pluginhandler.cpp
|
|
proxyhandler.cpp
|
|
historymodel.cpp
|
|
editandresend.cpp
|
|
settings.cpp
|
|
|
|
mainwindow.h
|
|
session.h
|
|
includes.h
|
|
proxyhandler.h
|
|
pluginhandler.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
|
|
pluginlist.ui
|
|
)
|
|
|
|
target_include_directories(bigsnitch PRIVATE /usr/local/include)
|
|
target_link_libraries(bigsnitch PRIVATE Qt5::Widgets sqlite3)
|
|
|
|
add_executable(bigsnitch_tests
|
|
tests/generic_tests.cpp
|
|
)
|
|
|
|
target_include_directories(bigsnitch_tests PRIVATE /usr/local/include)
|
|
target_link_libraries(bigsnitch_tests PRIVATE Qt5::Widgets 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)
|