cmake_minimum_required(VERSION 3.16) project(BionxControl VERSION 1.0 LANGUAGES C CXX) # --- C++23 aktivieren --- set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) # set(CMAKE_CXX_EXTENSIONS OFF) # Optional: Auf OFF setzen, wenn du reines C++23 statt GNU++23 erzwingen willst set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOUIC ON) find_package(Qt6 REQUIRED COMPONENTS Gui Svg Widgets) qt_standard_project_setup() qt_add_executable(BionxControl WIN32 MACOSX_BUNDLE bc.cpp bc.h bcdelightpmwidget.cpp bcdelightpmwidget.h bcdeviceview.cpp bcdeviceview.h bcdriver.cpp bcdriver.h bcdriverstatewidget.cpp bcdriverstatewidget.h bcdrivertinycan.cpp bcdrivertinycan.h bcmainwindow.cpp bcmainwindow.h bcmainwindow.ui bcthemeswitchbutton.cpp bcthemeswitchbutton.h bctoggleswitch.cpp bctoggleswitch.h bctransmitter.cpp bctransmitter.h bcvalue.cpp bcvalue.h bcvaluedelegate.cpp bcvaluedelegate.h bcvaluemodel.cpp bcvaluemodel.h bcvalueslider.cpp bcvalueslider.h bcvalueslider.ui bcxmlloader.cpp bcxmlloader.h main.cpp ) # Plattformspezifische CAN-Treiber einbinden if(WIN32) target_sources(BionxControl PRIVATE libwin/can_drv_win.c) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") target_sources(BionxControl PRIVATE libwin/mhs_can_drv.c) endif() target_include_directories(BionxControl PRIVATE . libwin ) target_link_libraries(BionxControl PRIVATE Qt::Core Qt::Gui Qt::Svg Qt::Widgets ) # Resources: set_source_files_properties("resources/bc_dark.qss" PROPERTIES QT_RESOURCE_ALIAS "bc_dark.qss" ) set_source_files_properties("resources/bc_light.qss" PROPERTIES QT_RESOURCE_ALIAS "bc_light.qss" ) set_source_files_properties("resources/bikeinfo.xml" PROPERTIES QT_RESOURCE_ALIAS "bikeinfo.xml" ) set_source_files_properties("resources/bionx_akku.png" PROPERTIES QT_RESOURCE_ALIAS "bionx_akku.png" ) set_source_files_properties("resources/bionx_console.png" PROPERTIES QT_RESOURCE_ALIAS "bionx_console.png" ) set_source_files_properties("resources/bionx_motor.png" PROPERTIES QT_RESOURCE_ALIAS "bionx_motor.png" ) set_source_files_properties("resources/connect.png" PROPERTIES QT_RESOURCE_ALIAS "connect.png" ) set_source_files_properties("resources/exit.png" PROPERTIES QT_RESOURCE_ALIAS "exit.png" ) set_source_files_properties("resources/exit_red.png" PROPERTIES QT_RESOURCE_ALIAS "exit_red.png" ) set_source_files_properties("resources/sync.png" PROPERTIES QT_RESOURCE_ALIAS "sync.png" ) set_source_files_properties("resources/sync_green.png" PROPERTIES QT_RESOURCE_ALIAS "sync_green.png" ) set_source_files_properties("resources/sync_yellow.png" PROPERTIES QT_RESOURCE_ALIAS "sync_yellow.png" ) set_source_files_properties("resources/update.png" PROPERTIES QT_RESOURCE_ALIAS "update.png" ) set(bionxcontrol_resource_files "resources/bc_dark.qss" "resources/bc_light.qss" "resources/bikeinfo.xml" "resources/bionx_akku.png" "resources/bionx_console.png" "resources/bionx_motor.png" "resources/connect.png" "resources/exit.png" "resources/exit_red.png" "resources/smile/face-angel.png" "resources/smile/face-angry.png" "resources/smile/face-cool.png" "resources/smile/face-crying.png" "resources/smile/face-embarrassed.png" "resources/smile/face-glasses.png" "resources/smile/face-kiss.png" "resources/smile/face-laugh.png" "resources/smile/face-monkey.png" "resources/smile/face-plain.png" "resources/smile/face-raspberry.png" "resources/smile/face-sad.png" "resources/smile/face-sick.png" "resources/smile/face-smile-big.png" "resources/smile/face-smile.png" "resources/smile/face-smirk.png" "resources/smile/face-surprise.png" "resources/sync.png" "resources/sync_green.png" "resources/sync_yellow.png" "resources/update.png" ) qt_add_resources(BionxControl "bionxcontrol" PREFIX "/" FILES ${bionxcontrol_resource_files} ) install(TARGETS BionxControl BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )