Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to change output filename
Forum Updated to NodeBB v4.3 + New Features

How to change output filename

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 4 Posters 726 Views
  • 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.
  • S Offline
    S Offline
    stretchthebits
    wrote on 14 Sept 2024, 03:40 last edited by
    #1

    When I compile my project, I get an executable but I would like to change the filename.
    I don’t want to use my File Manager that comes with my OS to change the filename. If I were to use that method, every time I compile, I would have to rename the executable.

    I looked at the GUI, I could only find the place to change the output folder.
    It looks like when we compile, in a Release folder, it creates a file named Makefile.
    If I change things in this Makefile and I compile the project, it looks like Makefile gets overwritten by some default values.

    In my project folder, I have
    glhlib.pro
    glhlib.pro.user

    Do I have to manually change something in these files?

    Thanks!

    C 1 Reply Last reply 14 Sept 2024, 03:51
    0
    • S stretchthebits
      14 Sept 2024, 03:40

      When I compile my project, I get an executable but I would like to change the filename.
      I don’t want to use my File Manager that comes with my OS to change the filename. If I were to use that method, every time I compile, I would have to rename the executable.

      I looked at the GUI, I could only find the place to change the output folder.
      It looks like when we compile, in a Release folder, it creates a file named Makefile.
      If I change things in this Makefile and I compile the project, it looks like Makefile gets overwritten by some default values.

      In my project folder, I have
      glhlib.pro
      glhlib.pro.user

      Do I have to manually change something in these files?

      Thanks!

      C Offline
      C Offline
      ChrisW67
      wrote on 14 Sept 2024, 03:51 last edited by ChrisW67
      #2

      @stretchthebits said in How to change output filename:

      Do I have to manually change something in these files?

      Yes. TARGET in glhlib.pro

      S 1 Reply Last reply 14 Sept 2024, 13:33
      4
      • C ChrisW67
        14 Sept 2024, 03:51

        @stretchthebits said in How to change output filename:

        Do I have to manually change something in these files?

        Yes. TARGET in glhlib.pro

        S Offline
        S Offline
        stretchthebits
        wrote on 14 Sept 2024, 13:33 last edited by
        #3

        @ChrisW67 I added the line
        TARGET = glhlib2.2.so
        somewhere at the top of the glhlib.pro file

        I did a clean build and it creates the file
        libglhlib2.2.so.so.1.0.0

        How can I tell it to not add a .so and not add its own version number.

        C 1 Reply Last reply 14 Sept 2024, 13:52
        0
        • S stretchthebits
          14 Sept 2024, 13:33

          @ChrisW67 I added the line
          TARGET = glhlib2.2.so
          somewhere at the top of the glhlib.pro file

          I did a clean build and it creates the file
          libglhlib2.2.so.so.1.0.0

          How can I tell it to not add a .so and not add its own version number.

          C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 14 Sept 2024, 13:52 last edited by
          #4

          @stretchthebits You can take a look into the documentation: https://doc.qt.io/qt-6/qmake-variable-reference.html#version

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          S 1 Reply Last reply 14 Sept 2024, 18:52
          1
          • C Christian Ehrlicher
            14 Sept 2024, 13:52

            @stretchthebits You can take a look into the documentation: https://doc.qt.io/qt-6/qmake-variable-reference.html#version

            S Offline
            S Offline
            stretchthebits
            wrote on 14 Sept 2024, 18:52 last edited by
            #5

            @Christian-Ehrlicher If I put
            win32:VERSION = 1.2.3.4 # major.minor.patch.build
            else:VERSION = 1.2.3 # major.minor.patch

            like the document says, then it adds 1.2.3 to the filename and I get
            libglhlib2.2.so.1.2.3

            If I put
            win32:VERSION = # major.minor.patch.build
            else:VERSION = # major.minor.patch

            it still adds a version number to the filename
            libglhlib2.2.so.1.0.0

            J 1 Reply Last reply 14 Sept 2024, 19:12
            0
            • C Offline
              C Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 14 Sept 2024, 19:03 last edited by
              #6

              And that's the correct linux naming schema- don't see what's wrong here. You don't specify a version so its 1.0.0 by default.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              S 1 Reply Last reply 15 Sept 2024, 01:06
              0
              • S stretchthebits
                14 Sept 2024, 18:52

                @Christian-Ehrlicher If I put
                win32:VERSION = 1.2.3.4 # major.minor.patch.build
                else:VERSION = 1.2.3 # major.minor.patch

                like the document says, then it adds 1.2.3 to the filename and I get
                libglhlib2.2.so.1.2.3

                If I put
                win32:VERSION = # major.minor.patch.build
                else:VERSION = # major.minor.patch

                it still adds a version number to the filename
                libglhlib2.2.so.1.0.0

                J Offline
                J Offline
                JonB
                wrote on 14 Sept 2024, 19:12 last edited by
                #7

                @stretchthebits
                I don't know if you can somehow force the VERSION to be empty on the end of the library target.

                It's following the Linux convention for naming libraries. It's more usual to have libglhlib2.2.so as a symbolic link to a specific library with version, perhaps you could adopt that.

                1 Reply Last reply
                0
                • C Christian Ehrlicher
                  14 Sept 2024, 19:03

                  And that's the correct linux naming schema- don't see what's wrong here. You don't specify a version so its 1.0.0 by default.

                  S Offline
                  S Offline
                  stretchthebits
                  wrote on 15 Sept 2024, 01:06 last edited by
                  #8

                  @Christian-Ehrlicher I see. I am a Linux noob so I don't know some of these Linux design standards.
                  So, I'll let it be libglhlib.so.2.2

                  1 Reply Last reply
                  0
                  • S stretchthebits has marked this topic as solved on 15 Sept 2024, 01:06

                  6/8

                  14 Sept 2024, 19:03

                  • Login

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