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. [solved] QMAKE: unknown replace function...

[solved] QMAKE: unknown replace function...

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 5.5k 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.
  • P Offline
    P Offline
    Peppy
    wrote on last edited by
    #1

    Hi guys, I am here again, now I am learning QMAKE from QtCreator Git Clone and I am trying to use that directory structure, everything works fine but:
    I have got Project.pri file where is defined function:
    @defineReplace(getLibraryTarget) { return($${PROJECT_NAME}.$$1) }@
    And it should replace library target in library subproject (Project.pri is included there) to: Project.LibraryName
    But: If I run that project, QMAKE writes: @"Unknown replace function: getLibraryTarget"@

    In library project is:
    @
    include(../../../Project.pri)
    QT += xml xmlpatterns gui

    TARGET = $$getLibraryTarget(ServicesManager)
    TEMPLATE = lib

    DEFINES += SERVICESMANAGER_LIBRARY

    SOURCES += ServicesManager.cpp

    HEADERS += ServicesManager.h
    ServicesManager_global.h
    @

    I really don't know where is the problem.

    EDIT: I tried to define another function in Project.pri, but the same problem result: unknown function... I don't know where is the problem...But when I wrote message($${PROJECT_NAME}), that variable was found and wrote the "Project" .. I really don't understand it...

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      I think qmake is pretty strict in the function formatting. See if it helps if you no longer make it a one-liner:

      @defineReplace(getLibraryTarget) {
      return($${PROJECT_NAME}.$$1)
      }@

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Peppy
        wrote on last edited by
        #3

        Well, I rewrote it...Probably .pri file was missing (but it was there!)... And then it worked fine... thanks for help and time :)

        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