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. qmake for-loop gives empty variable from hand-typed list
Forum Updated to NodeBB v4.3 + New Features

qmake for-loop gives empty variable from hand-typed list

Scheduled Pinned Locked Moved Solved Installation and Deployment
2 Posts 2 Posters 1.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.
  • S Offline
    S Offline
    Szymon. M. Sabat
    wrote on last edited by
    #1

    I am trying to copy some DLL files from folder full of DLL files with similar names. CVLIBS is the list of filenames I want to copy and there are e.g. opencv_core412d.dll and opencv_core412.dll files for "core", same for highgui etc.
    I am getting qmake error "cannot find -lopencv_412d" so it's the LIBS row and LNAME is getting empty string from $$CVLIB. Why?

    CVLIBS = core \
            highgui \
            imgproc \
            videoio \
            video \
            imgcodecs
    
    CONFIG(release, debug|release): DDIR = $$OUT_PWD/release
    else:CONFIG(debug, debug|release): DDIR = $$OUT_PWD/debug
    
    CONFIG(release, debug|release): SUFF = 412
    else:CONFIG(debug, debug|release): SUFF = 412d
    
    ODIR = $$PWD/../../GitHub/opencv/builds/install/x64/vc16/bin
    
    for (CVLIB, CVLIBS)
    {
        LNAME = opencv_$$CVLIB$$SUFF
        LIBS += -L$$ODIR -l$$LNAME
    
        FNAME = $$LNAME.dll
        OFILE = $$BIN/$$FNAME
        DFILE = $$DDIR/$$FNAME
        OFILE ~= s,/,\\,g
        DFILE ~= s,/,\\,g
        QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$OFILE) $$quote($$DFILE) $$escape_expand(\\n\\t)
    }
    
    export(QMAKE_POST_LINK)
    
    INCLUDEPATH += $$PWD/../../GitHub/opencv/builds/install/include
    DEPENDPATH += $$PWD/../../GitHub/opencv/builds/install/include
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Your for line is wrong. It should be:

      for (CVLIB, CVLIBS) {
      # Your code here
      }
      

      qmake's syntax is not the same as C++. You have to have the opening bracket on the same line as the test/loop/etc..

      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
      2

      • Login

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