cmake_minimum_required(VERSION 3.5) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(QT NAMES Qt6 COMPONENTS Core Widgets Network REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Widgets Network REQUIRED) find_package(QT NAMES Qt6 COMPONENTS Charts) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Charts) #get_cmake_property(_variableNames VARIABLES) #foreach (_variableName ${_variableNames}) # message(STATUS "${_variableName}=${${_variableName}}") #endforeach() include_directories(${TASKBUS_INTERFACEDIR}) if (Qt${QT_VERSION_MAJOR}Charts_FOUND) set(PRJ_GUISTATUS watchdog/status_charts/formstatus.h watchdog/status_charts/formstatus.cpp watchdog/status_charts/formstatus.ui ) include_directories(watchdog/status_charts) set(TB_CHARTS_LIB Qt${QT_VERSION_MAJOR}::Charts ) else() set(PRJ_GUISTATUS watchdog/status_nocharts/formstatus.h watchdog/status_nocharts/formstatus.cpp watchdog/status_nocharts/formstatus.ui ) include_directories(watchdog/status_nocharts) set(TB_CHARTS_LIB ) endif() set(PRJ_HEADERS_CORE core/tasknode.h core/taskcell.h core/taskproject.h core/process_prctl.h ../tb_interface/cmdlineparser.h ../tb_interface/tb_interface.h watchdog/tbwatchdog.h watchdog/profile_log.h ) set(PRJ_HEADERS_GUI gui/taskbusplatformfrm.h gui/handbookview.h gui/pdesignerview.h gui/taskmodule.h gui/tgraphicstaskitem.h gui/dlgabout.h gui/tbscene.h ) set(PRJ_SOURCES_CORE core/tasknode.cpp core/taskcell.cpp core/taskproject.cpp core/process_prctl.cpp watchdog/tbwatchdog.cpp watchdog/watchmemmodule.cpp ) set(PRJ_SOURCES_GUI gui/taskbusplatformfrm.cpp gui/taskbusplatformfrm_modules.cpp gui/taskbusplatformfrm_project.cpp gui/dlgabout.cpp gui/pdesignerview.cpp gui/handbookview.cpp gui/taskmodule.cpp gui/tgraphicstaskitem.cpp gui/custom_item_editor.cpp gui/tbscene.cpp ) set(PRJ_FORMS gui/taskbusplatformfrm.ui gui/handbookview.ui gui/pdesignerview.ui gui/dlgabout.ui ) set(PRJ_RESOURCES taskbusplatform.qrc taskBusPlatform_zh_CN.ts taskbusplatform.rc ) # ========================GUI Exe======================== qt_add_executable(taskBusPlatform MANUAL_FINALIZATION gui/main.cpp ${PRJ_HEADERS_CORE} ${PRJ_HEADERS_GUI} ${PRJ_SOURCES_CORE} ${PRJ_SOURCES_GUI} ${PRJ_FORMS} ${PRJ_RESOURCES} ${PRJ_GUISTATUS} ) target_link_libraries(taskBusPlatform PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network ${TB_CHARTS_LIB} ) set_target_properties(taskBusPlatform PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER taskBus.taskBusPlatform MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE TRUE WIN32_EXECUTABLE TRUE ) qt_finalize_executable(taskBusPlatform) # ========================TUI Exe======================== add_executable(subtask_wrapper tui/listen_thread.h tui/subtask_wrapper.cpp tui/listen_thread.cpp watchdog/consolewatchdog.h watchdog/consolewatchdog.cpp ${PRJ_HEADERS_CORE} ${PRJ_SOURCES_CORE} ) target_link_libraries(subtask_wrapper Qt${QT_VERSION_MAJOR}::Core)