Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to make app bundle for macOS with OpenCV?
Forum Updated to NodeBB v4.3 + New Features

How to make app bundle for macOS with OpenCV?

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
23 Posts 4 Posters 3.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N NintyS
    21 Oct 2020, 06:00

    Hello how to create app bundle for macOS ( Catalina ) with OpenCV? When I go with this tutorial https://doc.qt.io/qt-5.9/osx-deployment.html then I have this error "make: *** No rule to make target `clean'. Stop." and when I skip this command then I have error that error "Project ERROR: opencv development package not found" I know how to fix it in Qt Creator but I don't know how to fix it in terminal.

    J Offline
    J Offline
    jsulm
    Lifetime Qt Champion
    wrote on 21 Oct 2020, 06:21 last edited by
    #4

    @NintyS said in How to make app bundle for macOS with OpenCV?:

    I know how to fix it in Qt Creator

    How did you fix it in QtCreator?

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    1
    • N Offline
      N Offline
      NintyS
      wrote on 21 Oct 2020, 06:30 last edited by
      #5

      I add to Build Environment PKG_CONFIG_PATH and modify PATH. ( I couldn't post it earlier because I don't have 1 point of reputation and I must wait every time 10 minutes ).

      J 1 Reply Last reply 21 Oct 2020, 06:32
      1
      • N NintyS
        21 Oct 2020, 06:30

        I add to Build Environment PKG_CONFIG_PATH and modify PATH. ( I couldn't post it earlier because I don't have 1 point of reputation and I must wait every time 10 minutes ).

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 21 Oct 2020, 06:32 last edited by
        #6

        @NintyS You can do exactly the same in the terminal, like:

        export PKG_CONFIG_PATH=SOME_PATH
        

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • N Offline
          N Offline
          NintyS
          wrote on 21 Oct 2020, 06:41 last edited by
          #7

          Ok it works, but what about error with make clean? "qmake -config release" and "make" works but what with "make clean"? This commands is necessary? ( I will be asking about whole way of creating app bundle, because this isn't clear to me ).

          J 1 Reply Last reply 21 Oct 2020, 06:44
          0
          • N NintyS
            21 Oct 2020, 06:41

            Ok it works, but what about error with make clean? "qmake -config release" and "make" works but what with "make clean"? This commands is necessary? ( I will be asking about whole way of creating app bundle, because this isn't clear to me ).

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 21 Oct 2020, 06:44 last edited by jsulm
            #8

            @NintyS If there is nothing to clean "make clean" will fail. It should work after make. "make clean" is used to delete build artefacts, for example if you want to rebuild completely.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1
            • N Offline
              N Offline
              NintyS
              wrote on 21 Oct 2020, 06:54 last edited by
              #9

              Here ( in tutorial ) is a "plugins" folder and I know I must create this directory myself, but this folder will be empty and in this tutorial is that I must use "make clean", "qmake -config release" and "make" so what I supposed to do? ( Can you give me a one point of reputation to I could send you reply faster? )

              J 1 Reply Last reply 21 Oct 2020, 07:16
              1
              • N NintyS
                21 Oct 2020, 06:54

                Here ( in tutorial ) is a "plugins" folder and I know I must create this directory myself, but this folder will be empty and in this tutorial is that I must use "make clean", "qmake -config release" and "make" so what I supposed to do? ( Can you give me a one point of reputation to I could send you reply faster? )

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 21 Oct 2020, 07:16 last edited by
                #10

                @NintyS said in How to make app bundle for macOS with OpenCV?:

                I know I must create this directory myself

                According to the documentation this is not correct.
                "When we built the Plug & Paint plugins, based on the DESTDIR variable in their .pro file, the plugins' .dylib files are in the plugins subdirectory under the plugandpaint directory. We just have to move this directory to the correct location."
                https://doc.qt.io/qt-5.9/osx-deployment.html

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • N Offline
                  N Offline
                  NintyS
                  wrote on 21 Oct 2020, 07:23 last edited by NintyS
                  #11

                  @jsulm said in How to make app bundle for macOS with OpenCV?:

                  According to the documentation this is not correct.
                  "When we built the Plug & Paint plugins, based on the DESTDIR variable in their .pro file, the plugins' .dylib files are in the plugins subdirectory under the plugandpaint directory. We just have to move this directory to the correct location."

                  Then how to create a plugin folder? There we go to folder with app "cd /path/to/Qt/examples/widgets/tools/plugandpaint/app" and this create new file .app "make clean && qmake -config release && make" so where is command for plugins folder?

                  J 1 Reply Last reply 21 Oct 2020, 07:26
                  0
                  • N NintyS
                    21 Oct 2020, 07:23

                    @jsulm said in How to make app bundle for macOS with OpenCV?:

                    According to the documentation this is not correct.
                    "When we built the Plug & Paint plugins, based on the DESTDIR variable in their .pro file, the plugins' .dylib files are in the plugins subdirectory under the plugandpaint directory. We just have to move this directory to the correct location."

                    Then how to create a plugin folder? There we go to folder with app "cd /path/to/Qt/examples/widgets/tools/plugandpaint/app" and this create new file .app "make clean && qmake -config release && make" so where is command for plugins folder?

                    J Offline
                    J Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 21 Oct 2020, 07:26 last edited by
                    #12

                    @NintyS This is stated in the link:
                    "This builds the core application. Use the following to build the plugins:"

                    cd ../plugandpaint/plugins
                    make clean
                    qmake -config release
                    make
                    

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • N Offline
                      N Offline
                      NintyS
                      wrote on 21 Oct 2020, 07:45 last edited by NintyS
                      #13

                      This don’t make any sense for me. Why I must go intro plugins directory if this directory don’t exist? Command „cd” set user position intro this directory.

                      J 1 Reply Last reply 21 Oct 2020, 07:50
                      0
                      • N NintyS
                        21 Oct 2020, 07:45

                        This don’t make any sense for me. Why I must go intro plugins directory if this directory don’t exist? Command „cd” set user position intro this directory.

                        J Offline
                        J Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on 21 Oct 2020, 07:50 last edited by jsulm
                        #14

                        @NintyS There IS plugins directory inside the plugandpaint app. It should look like this:

                        app
                        plugins
                        plugandpaint.pro
                        

                        This is what you have to do:

                        cd /path/to/Qt/examples/widgets/tools/plugandpaint/app
                        
                        // Run qmake to create a new makefile for the application, and do a clean build to create the dynamically linked executable:
                        
                        make clean
                        qmake -config release
                        make
                        
                        // This builds the core application.
                        // Use the following to build the plugins:
                        
                        cd ../plugandpaint/plugins
                        make clean
                        qmake -config release
                        make
                        

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • N Offline
                          N Offline
                          NintyS
                          wrote on 21 Oct 2020, 08:02 last edited by
                          #15

                          Do you want a screenshot?

                          J 1 Reply Last reply 21 Oct 2020, 08:17
                          0
                          • N NintyS
                            21 Oct 2020, 08:02

                            Do you want a screenshot?

                            J Offline
                            J Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on 21 Oct 2020, 08:17 last edited by
                            #16

                            @NintyS Yes, pleas.
                            How did you install Qt? And did you install the examples?

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • N Offline
                              N Offline
                              NintyS
                              wrote on 21 Oct 2020, 08:29 last edited by
                              #17

                              Yes, I install qt and examples but I don't do this on the example, just on my own project. There is screenshots. Zrzut ekranu 2020-10-21 o 10.26.02.png Zrzut ekranu 2020-10-21 o 10.25.48.png

                              J 1 Reply Last reply 21 Oct 2020, 08:31
                              0
                              • N NintyS
                                21 Oct 2020, 08:29

                                Yes, I install qt and examples but I don't do this on the example, just on my own project. There is screenshots. Zrzut ekranu 2020-10-21 o 10.26.02.png Zrzut ekranu 2020-10-21 o 10.25.48.png

                                J Offline
                                J Offline
                                jsulm
                                Lifetime Qt Champion
                                wrote on 21 Oct 2020, 08:31 last edited by
                                #18

                                @NintyS Well, in that case I guess you do not have any own plug-ins, so simply skip that step.

                                https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                0
                                • N Offline
                                  N Offline
                                  NintyS
                                  wrote on 21 Oct 2020, 08:39 last edited by
                                  #19

                                  Oooo. Ok.

                                  1 Reply Last reply
                                  0
                                  • N Offline
                                    N Offline
                                    NintyS
                                    wrote on 21 Oct 2020, 08:45 last edited by
                                    #20

                                    Now I have another error: "/Applications/Mobile/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump: error: 'QtGui.framework/QtGui': No such file or directory"

                                    Why otool search framework there but not in Qt/version/clang/bin?

                                    J 1 Reply Last reply 21 Oct 2020, 08:53
                                    0
                                    • N NintyS
                                      21 Oct 2020, 08:45

                                      Now I have another error: "/Applications/Mobile/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump: error: 'QtGui.framework/QtGui': No such file or directory"

                                      Why otool search framework there but not in Qt/version/clang/bin?

                                      J Offline
                                      J Offline
                                      jsulm
                                      Lifetime Qt Champion
                                      wrote on 21 Oct 2020, 08:53 last edited by
                                      #21

                                      @NintyS Sorry, I'm not Mac user. From here somebody else should help you. @SGaist do you have an idea?

                                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      1
                                      • K Offline
                                        K Offline
                                        kelly 219design.com
                                        wrote on 21 Oct 2020, 17:52 last edited by
                                        #22

                                        I would also welcome anything SGaist says (it's always useful, as are the words of jsulm).

                                        My expertise is primarily Linux, but with a healthy dose of Mac development (and Qt ios) as well.

                                        I'm afraid I don't have a direct answer to the objdump error and I don't recall ever encountering that myself.

                                        I'm going to just "throw a bunch of statements at the wall" and maybe some of this will resonate. I do apologize if this ends up being unhelpful noise.

                                        Earlier this year I took a Linux-only qmake project and "ported it" to work on Mac OS 10.15 Catalina.

                                        Here is the entirety of the changes that were required (you'll see it wasn't much):
                                        https://github.com/219-design/qt-qml-project-template-with-ci/pull/26/files

                                        I certainly do recognize, however, that incorporating OpenCV adds a layer of complexity that my template project does not contain.

                                        I'm also using Qt 5.15 (not 5.9), and that could definitely result in different outcomes.

                                        One thing that jumped out at me just now in my "port to Mac" diff is that I am using the -libpath argument to macdeployqt, so you could check whether any extra arguments are needed in your invocation of macdeployqt

                                        I suppose another thing to double-check is that the qmake binary and macdeployqt binary being used are the ones you expect. (As in: it is possible to have multiple versions of Qt installed on a system, and it is possible to accidentally be calling upon qmake from one Qt version instead of the other.)

                                        It seemed problematic to me that you would not see a "app.app/Contents/PlugIns/" folder being created for you. However, I just examined my own CI logs (they are public -- you can look, too), and I see only these plugins mentioned in the logs:

                                        2020-09-12T01:19:21.6364660Z + [[ darwin19 == \d\a\r\w\i\n* ]]
                                        2020-09-12T01:19:21.6365180Z + pushd build/src/app
                                        2020-09-12T01:19:21.6368320Z + macdeployqt app.app -no-strip -libpath=/Users/runner/work/qt-qml-project-template-with-ci/qt-qml-project-template-with-ci/build/src/app -qmldir=../../../src/
                                        2020-09-12T01:19:32.0684960Z File exists, skip copy: "app.app/Contents/PlugIns/quick/libqtquickcontrols2fusionstyleplugin.dylib"
                                        2020-09-12T01:19:32.0883740Z File exists, skip copy: "app.app/Contents/PlugIns/quick/libqtquickcontrols2imaginestyleplugin.dylib"
                                        2020-09-12T01:19:32.1087020Z File exists, skip copy: "app.app/Contents/PlugIns/quick/libqtquickcontrols2materialstyleplugin.dylib"
                                        2020-09-12T01:19:32.1291070Z File exists, skip copy: "app.app/Contents/PlugIns/quick/libqtquickcontrols2universalstyleplugin.dylib"
                                        

                                        Those plugins all look QtQuick-related. So I guess if I were to stop using QtQuick I might also have zero plugins.

                                        (GitHub doesn't seem to support permalinking to the raw log. To see the log, go to https://github.com/219-design/qt-qml-project-template-with-ci/runs/1104573793?check_suite_focus=true then click the ". . ." hamburger button and choose "View raw logs".)

                                        Again, my apologies if none of this turns out to be relevant.

                                        If you have a min-repro that you can post somewhere (github, pastebin, here), then I could try it on mac using Qt 5.15 and see if I can reproduce the issue.

                                        1 Reply Last reply
                                        0
                                        • SGaistS Offline
                                          SGaistS Offline
                                          SGaist
                                          Lifetime Qt Champion
                                          wrote on 21 Oct 2020, 18:23 last edited by
                                          #23

                                          Hi,

                                          Beside the points made by @kelly-219design-com, you might be over-complicating things. The guide, while working correctly, dates back prior to Qt Creator. So you can simplify your like with it.

                                          If you already have a working application bundle built using Qt Creator in release mode, then start from that one to make your deployment.

                                          If there are issues, use the verbose mode of macdeployqt to see exactly where the issues are.

                                          Interested in AI ? www.idiap.ch
                                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          1 Reply Last reply
                                          0

                                          13/23

                                          21 Oct 2020, 07:45

                                          • Login

                                          • Login or register to search.
                                          13 out of 23
                                          • First post
                                            13/23
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved