From 07347b13f7c2eb424d7ced400b5efc7024cb4d50 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 29 Aug 2022 13:33:40 +0200 Subject: [PATCH 1/9] Create build-win64-setup.yml --- .github/workflows/build-win64-setup.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/build-win64-setup.yml diff --git a/.github/workflows/build-win64-setup.yml b/.github/workflows/build-win64-setup.yml new file mode 100644 index 0000000..b09bbc8 --- /dev/null +++ b/.github/workflows/build-win64-setup.yml @@ -0,0 +1,20 @@ +name: build-win64-setup + +on: + [push, pull_request] + +env: + BUILD_TYPE: Release + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} From affea81f82dd62007289ee9bda4ff077131de7dc Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 29 Aug 2022 13:26:32 +0200 Subject: [PATCH 2/9] Replaced qmake project file with CMake --- CMakeLists.txt | 209 ++++++++++++++++++++++++++++++++++++++++ cvcomposer.pro | 252 ------------------------------------------------- 2 files changed, 209 insertions(+), 252 deletions(-) create mode 100644 CMakeLists.txt delete mode 100644 cvcomposer.pro diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..bfc1308 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,209 @@ +cmake_minimum_required(VERSION 3.16) +project(cvcomposer VERSION 1.0 LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOUIC ON) + +find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui Widgets Xml) + +qt_standard_project_setup() + +qt_add_executable(cvcomposer + execution/composerexecutor.cpp execution/composerexecutor.h + execution/composerscheduler.cpp execution/composerscheduler.h + execution/executorsettings.h + global/cvconstants.h + global/cvutils.cpp global/cvutils.h + global/parser.cpp global/parser.h + global/properties.cpp global/properties.h + global/threestatebool.h + global/utils.h + gui/advancedimageviewer.cpp gui/advancedimageviewer.h + gui/command/commandid.h + gui/command/createnodecommand.cpp gui/command/createnodecommand.h + gui/command/editconnectioncommand.cpp gui/command/editconnectioncommand.h + gui/command/editvaluecommand.cpp gui/command/editvaluecommand.h + gui/command/movenodecommand.cpp gui/command/movenodecommand.h + gui/command/removenodecommand.cpp gui/command/removenodecommand.h + gui/composerscene.cpp gui/composerscene.h + gui/composerwidget.cpp gui/composerwidget.h + gui/connectionitem.cpp gui/connectionitem.h + gui/customitems.h + gui/editsettingsdialog.cpp gui/editsettingsdialog.h gui/editsettingsdialog.ui + gui/errordisplaydialog.cpp gui/errordisplaydialog.h gui/errordisplaydialog.ui + gui/genericnodeitem.cpp gui/genericnodeitem.h + gui/genericnodewidget.cpp gui/genericnodewidget.h + gui/interactivegraphicsview.cpp gui/interactivegraphicsview.h + gui/mainwidget.cpp gui/mainwidget.h gui/mainwidget.ui + gui/plugitem.cpp gui/plugitem.h + gui/plugtypeshelpdialog.cpp gui/plugtypeshelpdialog.h gui/plugtypeshelpdialog.ui + gui/processorsitemmodel.cpp gui/processorsitemmodel.h + gui/processorsmodelfilter.cpp gui/processorsmodelfilter.h + main.cpp + model/circle.h + model/composermodel.cpp model/composermodel.h + model/connection.cpp model/connection.h + model/contour.h + model/ellipse.h + model/line.h + model/node.cpp model/node.h + model/plug.cpp model/plug.h + model/plugdefinition.h + model/plugtype.cpp model/plugtype.h + model/segment.h + model/triangle.h + plugwidget/abstractplugwidget.cpp plugwidget/abstractplugwidget.h + plugwidget/booleanwidget.cpp plugwidget/booleanwidget.h + plugwidget/colorwidget.cpp plugwidget/colorwidget.h + plugwidget/dataviewerwidget.cpp plugwidget/dataviewerwidget.h + plugwidget/doubleitemdelegate.cpp plugwidget/doubleitemdelegate.h + plugwidget/doublewidget.cpp plugwidget/doublewidget.h + plugwidget/enumerationwidget.cpp plugwidget/enumerationwidget.h + plugwidget/imageviewerdockwidget.cpp plugwidget/imageviewerdockwidget.h plugwidget/imageviewerdockwidget.ui + plugwidget/imageviewerwidget.cpp plugwidget/imageviewerwidget.h + plugwidget/kerneldefinitionwidget.cpp plugwidget/kerneldefinitionwidget.h + plugwidget/pathwidget.cpp plugwidget/pathwidget.h + plugwidget/pointwidget.cpp plugwidget/pointwidget.h + plugwidget/sizewidget.cpp plugwidget/sizewidget.h + plugwidget/stringwidget.cpp plugwidget/stringwidget.h + processor/abstractprocessor.cpp processor/abstractprocessor.h + processor/analyzer/discretefouriertransformprocessor.cpp processor/analyzer/discretefouriertransformprocessor.h + processor/analyzer/findcontoursprocessor.cpp processor/analyzer/findcontoursprocessor.h + processor/analyzer/haarcascadeprocessor.cpp processor/analyzer/haarcascadeprocessor.h + processor/analyzer/mixtureofgaussian2processor.cpp processor/analyzer/mixtureofgaussian2processor.h + processor/data/applycolormapprocessor.cpp processor/data/applycolormapprocessor.h + processor/data/countlistprocessor.cpp processor/data/countlistprocessor.h + processor/data/kernelprocessor.cpp processor/data/kernelprocessor.h + processor/data/splitchannelsprocessor.cpp processor/data/splitchannelsprocessor.h + processor/data/sublistprocessor.cpp processor/data/sublistprocessor.h + processor/filter/absolutedifferenceprocessor.cpp processor/filter/absolutedifferenceprocessor.h + processor/filter/adaptativethresholdprocessor.cpp processor/filter/adaptativethresholdprocessor.h + processor/filter/addweightedprocessor.cpp processor/filter/addweightedprocessor.h + processor/filter/applyroiprocessor.cpp processor/filter/applyroiprocessor.h + processor/filter/bilateralfilterprocessor.cpp processor/filter/bilateralfilterprocessor.h + processor/filter/blurprocessor.cpp processor/filter/blurprocessor.h + processor/filter/cannyprocessor.cpp processor/filter/cannyprocessor.h + processor/filter/convertcolorprocessor.cpp processor/filter/convertcolorprocessor.h + processor/filter/converttoprocessor.cpp processor/filter/converttoprocessor.h + processor/filter/customfilterprocessor.cpp processor/filter/customfilterprocessor.h + processor/filter/floodfillprocessor.cpp processor/filter/floodfillprocessor.h + processor/filter/gaussianblurprocessor.cpp processor/filter/gaussianblurprocessor.h + processor/filter/inrangeprocessor.cpp processor/filter/inrangeprocessor.h + processor/filter/laplacianprocessor.cpp processor/filter/laplacianprocessor.h + processor/filter/medianblurprocessor.cpp processor/filter/medianblurprocessor.h + processor/filter/morphologytransformationprocessor.cpp processor/filter/morphologytransformationprocessor.h + processor/filter/sobelprocessor.cpp processor/filter/sobelprocessor.h + processor/filter/thresholdprocessor.cpp processor/filter/thresholdprocessor.h + processor/geometry/makeborderprocessor.cpp processor/geometry/makeborderprocessor.h + processor/geometry/pyramidprocessor.cpp processor/geometry/pyramidprocessor.h + processor/geometry/subimageprocessor.cpp processor/geometry/subimageprocessor.h + processor/helpmessage.h + processor/helpmessagetype.h + processor/input/cameraprocessor.cpp processor/input/cameraprocessor.h + processor/input/imagefromfileprocessor.cpp processor/input/imagefromfileprocessor.h + processor/input/imagesfromfolderprocessor.cpp processor/input/imagesfromfolderprocessor.h + processor/math/averageprocessor.cpp processor/math/averageprocessor.h + processor/math/countnonzeroprocessor.cpp processor/math/countnonzeroprocessor.h + processor/math/meanprocessor.cpp processor/math/meanprocessor.h + processor/math/operatorprocessor.cpp processor/math/operatorprocessor.h + processor/processorlisttype.h + processor/processorsfactory.cpp processor/processorsfactory.h + processor/shape/boundingrectprocessor.cpp processor/shape/boundingrectprocessor.h + processor/shape/circleprocessor.cpp processor/shape/circleprocessor.h + processor/shape/convexhullprocessor.cpp processor/shape/convexhullprocessor.h + processor/shape/drawshapeprocessor.cpp processor/shape/drawshapeprocessor.h + processor/shape/drawtextprocessor.cpp processor/shape/drawtextprocessor.h + processor/shape/ellipseprocessor.cpp processor/shape/ellipseprocessor.h + processor/shape/fitellipseprocessor.cpp processor/shape/fitellipseprocessor.h + processor/shape/fitlineprocessor.cpp processor/shape/fitlineprocessor.h + processor/shape/houghcircleprocessor.cpp processor/shape/houghcircleprocessor.h + processor/shape/houghlineprobaprocessor.cpp processor/shape/houghlineprobaprocessor.h + processor/shape/houghlineprocessor.cpp processor/shape/houghlineprocessor.h + processor/shape/lineprocessor.cpp processor/shape/lineprocessor.h + processor/shape/minenclosingtriangleprocessor.cpp processor/shape/minenclosingtriangleprocessor.h + processor/shape/rectangleprocessor.cpp processor/shape/rectangleprocessor.h + processor/viewer/dataviewerprocessor.cpp processor/viewer/dataviewerprocessor.h + processor/viewer/imageviewerprocessor.cpp processor/viewer/imageviewerprocessor.h +) + +target_link_libraries(cvcomposer PRIVATE + Qt::Core + Qt::Gui + Qt::Widgets + Qt::Xml +) + +target_compile_options(cvcomposer PRIVATE + -Werror=return-type + -Werror=shadow + -Wno-deprecated-enum-enum-conversion + -Wsuggest-override + -std=c++2a +) + +# Resources: +set(resources_resource_files + "resources/Ubuntu-R.ttf" + "resources/book.svg" + "resources/brackets.svg" + "resources/class.svg" + "resources/credits.html" + "resources/licence.html" +) + +qt_add_resources(cvcomposer "resources" + PREFIX + "/" + FILES + ${resources_resource_files} +) + +if(WIN32) + target_include_directories(cvcomposer PRIVATE + C:/Program Files/opencv3.1.0/build-mingw64/include + ) + + target_compile_definitions(cvcomposer PRIVATE + _GLIBCXX_USE_CXX11_ABI=0 + ) + + target_link_libraries(cvcomposer PRIVATE + # Remove: L"C:/Program Files/opencv3.1.0/build-mingw64/lib" + opencv_core310 + opencv_highgui310 + opencv_imgcodecs310 + opencv_imgproc310 + opencv_objdetect310 + opencv_video310 + opencv_videoio310 + ) +endif() + +if(UNIX) + target_include_directories(cvcomposer PRIVATE + /usr/include/opencv4 + ) + + target_link_libraries(cvcomposer PRIVATE + opencv_core + opencv_highgui + opencv_imgcodecs + opencv_imgproc + opencv_objdetect + opencv_video + opencv_videoio + ) +endif() + +install(TARGETS cvcomposer + BUNDLE DESTINATION . + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +qt_generate_deploy_app_script( + TARGET cvcomposer + FILENAME_VARIABLE deploy_script + NO_UNSUPPORTED_PLATFORM_ERROR +) +install(SCRIPT ${deploy_script}) diff --git a/cvcomposer.pro b/cvcomposer.pro deleted file mode 100644 index 355b29f..0000000 --- a/cvcomposer.pro +++ /dev/null @@ -1,252 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2015-12-29T23:02:19 -# -#------------------------------------------------- - -QT += core gui xml widgets - -TARGET = cvcomposer -TEMPLATE = app -QMAKE_CXXFLAGS = -std=c++2a -QMAKE_CXXFLAGS += -Werror=return-type -QMAKE_CXXFLAGS += -Werror=shadow -QMAKE_CXXFLAGS += -Wsuggest-override -QMAKE_CXXFLAGS += -Wno-deprecated-enum-enum-conversion - -win32 { - DEFINES += "_GLIBCXX_USE_CXX11_ABI=0" - INCLUDEPATH += "C:/Program Files/opencv3.1.0/build-mingw64/include" - LIBS += -L"C:/Program Files/opencv3.1.0/build-mingw64/lib" - LIBS += -lopencv_core310 -lopencv_imgproc310 -lopencv_highgui310 -lopencv_imgcodecs310 -lopencv_videoio310 -lopencv_objdetect310 -lopencv_video310 -} -else { - INCLUDEPATH += /usr/include/opencv4 - LIBS += -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lopencv_videoio -lopencv_objdetect -lopencv_video -} - - -SOURCES += main.cpp\ - gui/command/createnodecommand.cpp \ - gui/command/editconnectioncommand.cpp \ - gui/command/editvaluecommand.cpp \ - gui/command/movenodecommand.cpp \ - gui/command/removenodecommand.cpp \ - gui/mainwidget.cpp \ - gui/composerwidget.cpp \ - gui/composerscene.cpp \ - gui/plugitem.cpp \ - gui/connectionitem.cpp \ - model/composermodel.cpp \ - execution/composerexecutor.cpp \ - execution/composerscheduler.cpp \ - gui/interactivegraphicsview.cpp \ - gui/genericnodeitem.cpp \ - model/connection.cpp \ - global/cvutils.cpp \ - plugwidget/imageviewerdockwidget.cpp \ - processor/abstractprocessor.cpp \ - processor/data/applycolormapprocessor.cpp \ - processor/filter/absolutedifferenceprocessor.cpp \ - processor/filter/adaptativethresholdprocessor.cpp \ - processor/filter/blurprocessor.cpp \ - processor/filter/floodfillprocessor.cpp \ - processor/filter/inrangeprocessor.cpp \ - processor/input/imagefromfileprocessor.cpp \ - processor/filter/gaussianblurprocessor.cpp \ - processor/filter/medianblurprocessor.cpp \ - processor/filter/bilateralfilterprocessor.cpp \ - gui/genericnodewidget.cpp \ - model/plugtype.cpp \ - model/plug.cpp \ - plugwidget/abstractplugwidget.cpp \ - plugwidget/sizewidget.cpp \ - plugwidget/pointwidget.cpp \ - plugwidget/enumerationwidget.cpp \ - plugwidget/doublewidget.cpp \ - plugwidget/stringwidget.cpp \ - plugwidget/colorwidget.cpp \ - processor/filter/morphologytransformationprocessor.cpp \ - processor/filter/thresholdprocessor.cpp \ - processor/input/cameraprocessor.cpp \ - processor/data/kernelprocessor.cpp \ - plugwidget/kerneldefinitionwidget.cpp \ - global/properties.cpp \ - plugwidget/doubleitemdelegate.cpp \ - processor/filter/customfilterprocessor.cpp \ - model/node.cpp \ - processor/analyzer/discretefouriertransformprocessor.cpp \ - processor/math/meanprocessor.cpp \ - processor/shape/fitellipseprocessor.cpp \ - processor/shape/fitlineprocessor.cpp \ - processor/shape/minenclosingtriangleprocessor.cpp \ - processor/shape/rectangleprocessor.cpp \ - processor/geometry/subimageprocessor.cpp \ - processor/geometry/makeborderprocessor.cpp \ - processor/filter/addweightedprocessor.cpp \ - processor/filter/converttoprocessor.cpp \ - plugwidget/booleanwidget.cpp \ - processor/shape/drawtextprocessor.cpp \ - processor/filter/sobelprocessor.cpp \ - processor/filter/laplacianprocessor.cpp \ - gui/editsettingsdialog.cpp \ - global/parser.cpp \ - processor/processorsfactory.cpp \ - plugwidget/dataviewerwidget.cpp \ - processor/viewer/dataviewerprocessor.cpp \ - processor/viewer/imageviewerprocessor.cpp \ - plugwidget/imageviewerwidget.cpp \ - processor/math/countnonzeroprocessor.cpp \ - processor/shape/circleprocessor.cpp \ - processor/shape/houghcircleprocessor.cpp \ - processor/data/sublistprocessor.cpp \ - processor/input/imagesfromfolderprocessor.cpp \ - processor/math/averageprocessor.cpp \ - processor/math/operatorprocessor.cpp \ - processor/analyzer/findcontoursprocessor.cpp \ - processor/data/countlistprocessor.cpp \ - processor/data/splitchannelsprocessor.cpp \ - plugwidget/pathwidget.cpp \ - processor/shape/drawshapeprocessor.cpp \ - processor/shape/lineprocessor.cpp \ - processor/shape/ellipseprocessor.cpp \ - gui/errordisplaydialog.cpp \ - gui/advancedimageviewer.cpp \ - processor/shape/convexhullprocessor.cpp \ - processor/shape/boundingrectprocessor.cpp \ - processor/geometry/pyramidprocessor.cpp \ - processor/filter/cannyprocessor.cpp \ - gui/processorsitemmodel.cpp \ - gui/processorsmodelfilter.cpp \ - processor/shape/houghlineprocessor.cpp \ - processor/shape/houghlineprobaprocessor.cpp \ - processor/analyzer/haarcascadeprocessor.cpp \ - processor/analyzer/mixtureofgaussian2processor.cpp \ - gui/plugtypeshelpdialog.cpp \ - processor/filter/convertcolorprocessor.cpp \ - processor/filter/applyroiprocessor.cpp - -HEADERS += gui/mainwidget.h \ - gui/command/commandid.h \ - gui/command/createnodecommand.h \ - gui/command/editconnectioncommand.h \ - gui/command/editvaluecommand.h \ - gui/command/movenodecommand.h \ - gui/command/removenodecommand.h \ - gui/composerwidget.h \ - gui/composerscene.h \ - gui/plugitem.h \ - gui/connectionitem.h \ - model/composermodel.h \ - gui/customitems.h \ - execution/composerexecutor.h \ - execution/composerscheduler.h \ - model/connection.h \ - gui/interactivegraphicsview.h \ - gui/genericnodeitem.h \ - model/line.h \ - model/plug.h \ - global/cvutils.h \ - model/segment.h \ - model/triangle.h \ - plugwidget/imageviewerdockwidget.h \ - processor/abstractprocessor.h \ - processor/data/applycolormapprocessor.h \ - processor/filter/absolutedifferenceprocessor.h \ - processor/filter/adaptativethresholdprocessor.h \ - processor/filter/blurprocessor.h \ - processor/filter/floodfillprocessor.h \ - processor/filter/inrangeprocessor.h \ - processor/input/imagefromfileprocessor.h \ - global/properties.h \ - processor/filter/gaussianblurprocessor.h \ - processor/filter/medianblurprocessor.h \ - processor/filter/bilateralfilterprocessor.h \ - model/plugdefinition.h \ - model/plugtype.h \ - gui/genericnodewidget.h \ - plugwidget/abstractplugwidget.h \ - plugwidget/sizewidget.h \ - plugwidget/pointwidget.h \ - plugwidget/enumerationwidget.h \ - plugwidget/doublewidget.h \ - plugwidget/stringwidget.h \ - plugwidget/colorwidget.h \ - processor/filter/morphologytransformationprocessor.h \ - processor/filter/thresholdprocessor.h \ - processor/input/cameraprocessor.h \ - processor/data/kernelprocessor.h \ - plugwidget/kerneldefinitionwidget.h \ - global/cvconstants.h \ - plugwidget/doubleitemdelegate.h \ - processor/filter/customfilterprocessor.h \ - model/node.h \ - processor/analyzer/discretefouriertransformprocessor.h \ - processor/math/meanprocessor.h \ - processor/shape/fitellipseprocessor.h \ - processor/shape/fitlineprocessor.h \ - processor/shape/minenclosingtriangleprocessor.h \ - processor/shape/rectangleprocessor.h \ - processor/geometry/subimageprocessor.h \ - processor/geometry/makeborderprocessor.h \ - processor/filter/addweightedprocessor.h \ - processor/filter/converttoprocessor.h \ - plugwidget/booleanwidget.h \ - processor/shape/drawtextprocessor.h \ - processor/filter/sobelprocessor.h \ - processor/filter/laplacianprocessor.h \ - gui/editsettingsdialog.h \ - execution/executorsettings.h \ - global/parser.h \ - global/threestatebool.h \ - processor/processorsfactory.h \ - plugwidget/dataviewerwidget.h \ - processor/viewer/dataviewerprocessor.h \ - processor/viewer/imageviewerprocessor.h \ - plugwidget/imageviewerwidget.h \ - processor/math/countnonzeroprocessor.h \ - model/circle.h \ - processor/shape/circleprocessor.h \ - processor/shape/houghcircleprocessor.h \ - global/utils.h \ - processor/data/sublistprocessor.h \ - processor/input/imagesfromfolderprocessor.h \ - processor/math/averageprocessor.h \ - processor/math/operatorprocessor.h \ - processor/analyzer/findcontoursprocessor.h \ - model/contour.h \ - processor/data/countlistprocessor.h \ - processor/data/splitchannelsprocessor.h \ - plugwidget/pathwidget.h \ - processor/shape/drawshapeprocessor.h \ - processor/shape/lineprocessor.h \ - processor/shape/ellipseprocessor.h \ - model/ellipse.h \ - processor/processorlisttype.h \ - gui/errordisplaydialog.h \ - gui/advancedimageviewer.h \ - processor/shape/convexhullprocessor.h \ - processor/shape/boundingrectprocessor.h \ - processor/geometry/pyramidprocessor.h \ - processor/filter/cannyprocessor.h \ - gui/processorsitemmodel.h \ - gui/processorsmodelfilter.h \ - processor/shape/houghlineprocessor.h \ - processor/shape/houghlineprobaprocessor.h \ - processor/analyzer/haarcascadeprocessor.h \ - processor/analyzer/mixtureofgaussian2processor.h \ - processor/helpmessagetype.h \ - processor/helpmessage.h \ - gui/plugtypeshelpdialog.h \ - processor/filter/convertcolorprocessor.h \ - processor/filter/applyroiprocessor.h - -FORMS += \ - gui/mainwidget.ui \ - gui/editsettingsdialog.ui \ - gui/errordisplaydialog.ui \ - plugwidget/imageviewerdockwidget.ui \ - gui/plugtypeshelpdialog.ui - -RESOURCES += \ - resources.qrc From 14c567b70260541642cf040b33ca2cc1b3db5364 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 29 Aug 2022 13:47:42 +0200 Subject: [PATCH 3/9] Update build-win64-setup.yml --- .github/workflows/build-win64-setup.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-win64-setup.yml b/.github/workflows/build-win64-setup.yml index b09bbc8..8fa1a9c 100644 --- a/.github/workflows/build-win64-setup.yml +++ b/.github/workflows/build-win64-setup.yml @@ -13,6 +13,11 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: '6.3.1' + - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} From 2712e014d65bbb8162a8de91e05a93a13c93a8b0 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 29 Aug 2022 13:59:36 +0200 Subject: [PATCH 4/9] Fixed build with MSVC --- CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bfc1308..d913a43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,13 +134,15 @@ target_link_libraries(cvcomposer PRIVATE Qt::Xml ) -target_compile_options(cvcomposer PRIVATE - -Werror=return-type - -Werror=shadow - -Wno-deprecated-enum-enum-conversion - -Wsuggest-override - -std=c++2a -) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options(cvcomposer PRIVATE + -Werror=return-type + -Werror=shadow + -Wno-deprecated-enum-enum-conversion + -Wsuggest-override + -std=c++2a + ) +endif() # Resources: set(resources_resource_files From 8e3460283cb291c0965e9fdfa7bc39aae69f46ec Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 29 Aug 2022 14:09:36 +0200 Subject: [PATCH 5/9] Clean OpenCV ihntegration --- .github/workflows/build-win64-setup.yml | 6 +++ CMakeLists.txt | 53 ++++++++----------------- 2 files changed, 22 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build-win64-setup.yml b/.github/workflows/build-win64-setup.yml index 8fa1a9c..ceba4d5 100644 --- a/.github/workflows/build-win64-setup.yml +++ b/.github/workflows/build-win64-setup.yml @@ -17,6 +17,12 @@ jobs: uses: jurplel/install-qt-action@v3 with: version: '6.3.1' + + - name: Install opencv + uses: cvpkg/opencv-action@main + with: + opencv_tag: '4.6.0' + BUILD_LIST: 'core,highgui,imgcodecs,imgproc,objdetect,video,videoio' - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} diff --git a/CMakeLists.txt b/CMakeLists.txt index d913a43..04a4539 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,19 @@ set(CMAKE_AUTOUIC ON) find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui Widgets Xml) +if(DEFINED ENV{GITHUB_ACTIONS} AND DEFINED ENV{GITHUB_WORKSPACE}) + set(ARTIFACTS_DIR "$ENV{GITHUB_WORKSPACE}/artifacts") + if(CMAKE_SYSTEM_NAME MATCHES "Windows") + set(OpenCV_DIR "${ARTIFACTS_DIR}/opencv/$ENV{opencv_tag}/windows-x64/x64/vc17/staticlib/") + elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") + set(OpenCV_DIR "${ARTIFACTS_DIR}/opencv/$ENV{opencv_tag}/linux-x64/lib/cmake/opencv4") + elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin") + set(OpenCV_DIR "${ARTIFACTS_DIR}/opencv/$ENV{opencv_tag}/mac-x64/lib/cmake/opencv4") + endif() + find_package(OpenCV REQUIRED) +endif() +find_package(OpenCV REQUIRED) + qt_standard_project_setup() qt_add_executable(cvcomposer @@ -127,11 +140,14 @@ qt_add_executable(cvcomposer processor/viewer/imageviewerprocessor.cpp processor/viewer/imageviewerprocessor.h ) +include_directories(${OpenCV_INCLUDE_DIRS}) + target_link_libraries(cvcomposer PRIVATE Qt::Core Qt::Gui Qt::Widgets Qt::Xml + ${OpenCV_LIBS} ) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") @@ -161,43 +177,6 @@ qt_add_resources(cvcomposer "resources" ${resources_resource_files} ) -if(WIN32) - target_include_directories(cvcomposer PRIVATE - C:/Program Files/opencv3.1.0/build-mingw64/include - ) - - target_compile_definitions(cvcomposer PRIVATE - _GLIBCXX_USE_CXX11_ABI=0 - ) - - target_link_libraries(cvcomposer PRIVATE - # Remove: L"C:/Program Files/opencv3.1.0/build-mingw64/lib" - opencv_core310 - opencv_highgui310 - opencv_imgcodecs310 - opencv_imgproc310 - opencv_objdetect310 - opencv_video310 - opencv_videoio310 - ) -endif() - -if(UNIX) - target_include_directories(cvcomposer PRIVATE - /usr/include/opencv4 - ) - - target_link_libraries(cvcomposer PRIVATE - opencv_core - opencv_highgui - opencv_imgcodecs - opencv_imgproc - opencv_objdetect - opencv_video - opencv_videoio - ) -endif() - install(TARGETS cvcomposer BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} From 5f55f695e63dfd46c693de3691010ea0310de573 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 29 Aug 2022 16:08:14 +0200 Subject: [PATCH 6/9] Fixed Visual Studio build error --- plugwidget/dataviewerwidget.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/plugwidget/dataviewerwidget.cpp b/plugwidget/dataviewerwidget.cpp index 077b2f5..7fa2d09 100644 --- a/plugwidget/dataviewerwidget.cpp +++ b/plugwidget/dataviewerwidget.cpp @@ -69,7 +69,6 @@ void DataViewerWidget::onNodeProcessed(const Properties &inputs, const Propertie { _text = QString::number(output.toDouble()); } - #warning TBD display kernel update(); } From ed1a5b45424f9b06183d83427eda88454fe8cb52 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 29 Aug 2022 16:08:28 +0200 Subject: [PATCH 7/9] Fixed windows environment version --- .github/workflows/build-win64-setup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-win64-setup.yml b/.github/workflows/build-win64-setup.yml index ceba4d5..00f5c0d 100644 --- a/.github/workflows/build-win64-setup.yml +++ b/.github/workflows/build-win64-setup.yml @@ -8,7 +8,7 @@ env: jobs: build: - runs-on: windows-latest + runs-on: windows-2022 steps: - uses: actions/checkout@v3 From a79dbb825804b67e976d5bb674f929c37933a1fb Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Tue, 30 Aug 2022 10:47:10 +0200 Subject: [PATCH 8/9] Build OpenCV as shared library --- .github/workflows/build-win64-setup.yml | 3 ++- CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-win64-setup.yml b/.github/workflows/build-win64-setup.yml index 00f5c0d..e20c835 100644 --- a/.github/workflows/build-win64-setup.yml +++ b/.github/workflows/build-win64-setup.yml @@ -19,10 +19,11 @@ jobs: version: '6.3.1' - name: Install opencv - uses: cvpkg/opencv-action@main + uses: wawanbreton/opencv-action@main with: opencv_tag: '4.6.0' BUILD_LIST: 'core,highgui,imgcodecs,imgproc,objdetect,video,videoio' + BUILD_SHARED_LIBS: 'ON' - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} diff --git a/CMakeLists.txt b/CMakeLists.txt index 04a4539..93d70f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui Widgets Xml) if(DEFINED ENV{GITHUB_ACTIONS} AND DEFINED ENV{GITHUB_WORKSPACE}) set(ARTIFACTS_DIR "$ENV{GITHUB_WORKSPACE}/artifacts") if(CMAKE_SYSTEM_NAME MATCHES "Windows") - set(OpenCV_DIR "${ARTIFACTS_DIR}/opencv/$ENV{opencv_tag}/windows-x64/x64/vc17/staticlib/") + set(OpenCV_DIR "${ARTIFACTS_DIR}/opencv/$ENV{opencv_tag}/windows-x64/x64/vc17/lib/") elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") set(OpenCV_DIR "${ARTIFACTS_DIR}/opencv/$ENV{opencv_tag}/linux-x64/lib/cmake/opencv4") elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin") From 1304de44965d340e47c5a07b170b35502cace71b Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Tue, 30 Aug 2022 15:21:25 +0200 Subject: [PATCH 9/9] Gather dependancies and build setup --- .github/workflows/build-win64-setup.yml | 12 ++++++++++++ CMakeLists.txt | 2 +- setup/cvcomposer.iss | 25 ++++--------------------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-win64-setup.yml b/.github/workflows/build-win64-setup.yml index e20c835..3549758 100644 --- a/.github/workflows/build-win64-setup.yml +++ b/.github/workflows/build-win64-setup.yml @@ -30,3 +30,15 @@ jobs: - name: Build run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Gather libraries + run: windeployqt --no-translations ${{github.workspace}}/build/Release/cvcomposer.exe + + - name: Build setup + run: iscc.exe setup/cvcomposer.iss + + - name: Archive setup + uses: actions/upload-artifact@v3 + with: + name: setup + path: setup/Output/CvComposer-setup.exe diff --git a/CMakeLists.txt b/CMakeLists.txt index 93d70f2..ff695b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ find_package(OpenCV REQUIRED) qt_standard_project_setup() -qt_add_executable(cvcomposer +qt_add_executable(cvcomposer WIN32 execution/composerexecutor.cpp execution/composerexecutor.h execution/composerscheduler.cpp execution/composerscheduler.h execution/executorsettings.h diff --git a/setup/cvcomposer.iss b/setup/cvcomposer.iss index e292ca4..c309e4a 100644 --- a/setup/cvcomposer.iss +++ b/setup/cvcomposer.iss @@ -2,7 +2,7 @@ [Setup] #define AppBin "cvcomposer.exe" #define AppName "CvComposer" -#define AppVersion "1.2" +#define AppVersion "1.3" AppId={{051E987E-CDAA-49CB-A5EF-014FDEBAF6FE}} AppName={#AppName} VersionInfoVersion={#AppVersion} @@ -17,31 +17,14 @@ ArchitecturesInstallIn64BitMode=x64 [Files] -; Main executable -Source: "..\release\{#AppBin}"; DestDir: "{app}"; Flags: ignoreversion +; Executable and automatically gathered dependancies +Source: "..\build\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs ; Haar cascade resources Source: "..\haarcascade_*.xml"; DestDir: "{app}"; Flags: ignoreversion -; Qt and its dependancies -Source: "C:\Qt\Qt5.7.0-MinGW64\bin\Qt5Core.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\Qt\Qt5.7.0-MinGW64\bin\Qt5Gui.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\Qt\Qt5.7.0-MinGW64\bin\Qt5Widgets.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\Qt\Qt5.7.0-MinGW64\bin\Qt5Xml.dll"; DestDir: "{app}"; Flags: ignoreversion -source: "C:\Qt\Qt5.7.0-MinGW64\plugins\platforms\qwindows.dll"; DestDir: "{app}\platforms"; Flags: ignoreversion -source: "C:\Qt\Qt5.7.0-MinGW64\plugins\imageformats\qjpeg.dll"; DestDir: "{app}\imageformats"; Flags: ignoreversion -Source: "C:\Qt\Qt5.7.0-MinGW64\mingw-deps\libgcc_s_seh-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\Qt\Qt5.7.0-MinGW64\mingw-deps\libstdc++-6.dll"; DestDir: "{app}"; Flags: ignoreversion - ; OpenCV -Source: "C:\Program Files\opencv3.1.0\build-mingw64\bin\libopencv_core310.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\Program Files\opencv3.1.0\build-mingw64\bin\libopencv_highgui310.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\Program Files\opencv3.1.0\build-mingw64\bin\libopencv_imgproc310.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\Program Files\opencv3.1.0\build-mingw64\bin\libopencv_imgcodecs310.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\Program Files\opencv3.1.0\build-mingw64\bin\libopencv_videoio310.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\Program Files\opencv3.1.0\build-mingw64\bin\libopencv_objdetect310.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\Program Files\opencv3.1.0\build-mingw64\bin\libopencv_video310.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\Program Files\opencv3.1.0\build-mingw64\bin\libopencv_ml310.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "..\artifacts\opencv\4.6.0\windows-x64\x64\vc17\bin\opencv_*.dll"; DestDir: "{app}"; Flags: ignoreversion [Tasks] Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked