cmake_minimum_required(VERSION 3.14) project(EuroFuckSimulator LANGUAGES CXX) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) #add_compile_options(-fsanitize=address) #add_link_options(-fsanitize=address) include(ExternalProject) include(FetchContent) #if (OPT_MINGW_STD_THREADS) # FetchContent_Declare( # mingw-std-threads # GIT_REPOSITORY https://github.com/meganz/mingw-std-threads.git # GIT_TAG master # ) # FetchContent_MakeAvailable(mingw-std-threads) #endif() if (OPT_QT_JSON_SETTINGS) FetchContent_Declare( QtJsonSettings GIT_REPOSITORY https://github.com/jimj316/QtJsonSettings.git GIT_TAG main ) FetchContent_MakeAvailable(QtJsonSettings) add_compile_definitions(WITH_QT_JSON_SETTINGS) endif() find_package(ixwebsocket CONFIG REQUIRED) find_package(nlohmann_json 3.2.0 REQUIRED) find_package(ZLIB REQUIRED) find_package(Threads REQUIRED) file(GLOB BUTTPLUG_SRC_FILES "libraries/buttplugCpp/src/*.cpp" "libraries/buttplugCpp/include/*.h" ) file(GLOB_RECURSE SCS_SDK_FILES "libraries/scs-sdk/include/*.h" ) #file(GLOB ACCORDION_FILES # "libraries/accordion/src/*" #) find_package(QT NAMES Qt5 REQUIRED COMPONENTS Core Gui Widgets Charts LinguistTools) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Widgets Charts LinguistTools) set(TS_FILES EuroFuckSimulator_en_GB.ts) include_directories( # libraries/accordion/src/ libraries/buttplugCpp/include/ libraries/scs-sdk/include/ src/ ) if (OPT_QT_JSON_SETTINGS) include_directories( ${QtJsonSettings_SOURCE_DIR} ) endif() set (SOURCE_FILES src/EuroFuckSimulator_global.h src/eurofucksimulator.cpp src/eurofucksimulator.h src/telemetry.h src/qapphost.h src/qapphost.cpp src/rulemodule.h src/rulemodule.cpp src/gui/gui.h src/gui/gui.cpp src/gui/gui.ui src/gui/fancygraph.h src/gui/fancygraph.cpp src/gui/fancyslider.h src/gui/fancyslider.cpp ) if (OPT_BUILD_TEST_EXE) message("Building test executable.") add_executable(EuroFuckSimulator src/main.cpp ${SOURCE_FILES} ${TS_FILES} ${BUTTPLUG_SRC_FILES} ${SCS_SDK_FILES} # ${ACCORDION_FILES} ) else() add_library(EuroFuckSimulator SHARED src/telemeter.cpp ${SOURCE_FILES} ${TS_FILES} ${BUTTPLUG_SRC_FILES} ${SCS_SDK_FILES} # ${ACCORDION_FILES} ) endif() target_link_libraries(EuroFuckSimulator PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Charts ixwebsocket::ixwebsocket nlohmann_json::nlohmann_json ) if (OPT_QT_JSON_SETTINGS) target_link_libraries(EuroFuckSimulator PRIVATE QtJsonSettings ) endif() target_compile_definitions(EuroFuckSimulator PRIVATE EUROFUCKSIMULATOR_LIBRARY) if(COMMAND qt_create_translation) qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) else() qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) endif()