Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. qmake. How to extract file name from the full path?
Forum Updated to NodeBB v4.3 + New Features

qmake. How to extract file name from the full path?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 3 Posters 3.3k 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.
  • _ Offline
    _ Offline
    _Dima
    wrote on last edited by A Former User
    #1

    Could you please advise how can I extract file name from the full path?
    For example I need to get name of pro file, only file name, not full path
    @
    message($$PRO_FILE)
    @

    1 Reply Last reply
    1
    • _ Offline
      _ Offline
      _Dima
      wrote on last edited by
      #2

      I've found answer :)

      @message($$basename(PRO_FILE))@

      There is also very useful "article":https://qt-project.org/doc/qt-5.1/qmake/qmake-function-reference.html

      1 Reply Last reply
      1
      • EddyE Offline
        EddyE Offline
        Eddy
        wrote on last edited by
        #3

        Thanks for posting your solution here.

        Could you edit your first post and add [solved] to it? Thanks!

        Qt Certified Specialist
        www.edalsolutions.be

        1 Reply Last reply
        0
        • I Offline
          I Offline
          ikyb
          wrote on last edited by
          #4

          For me $$basename(anything) always returns empty string :(
          So I use SPEC = $$system(basename $$QMAKESPEC). Sure this will fail on windows.

          1 Reply Last reply
          0

          • Login

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