0

In the Plug & Paint Example the .pro presents the following:

LIBS           = -Lplugins -lpnp_basictools

if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
   mac:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)_debug
   win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)d
}

Which, for that particular case, appends a d to the lib name in debug mode, pnp_basictools becomes pnp_basictoolsd. But it doesn't scale well, i.e.:

LIBS           = -Lplugins -lplugin_1 -lplugin_2 -lplugin_3

if(!debug_and_release|build_pass):CONFIG(debug, debug|release)
   win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)d

Seems not to append d to plugin_2 and plugin_3.

So, may I ask for another method to add the d to the lib name in debug mode?

The issue was also mentioned here.

Cœur
  • 34,719
  • 24
  • 185
  • 251
KcFnMi
  • 4,665
  • 8
  • 52
  • 106

1 Answers1

1

$$member(X, pos) returns the item at the position pos of the list variable X. So, the code you found only handles 2 of the elements of that list (0 => -Lplugins and 1 => -lpnp_basictools).

There is a for loop that could help you handle all the elements of the list, but instead you can "simply" use a regular expression with the ~= operator :

win32:LIBS ~= s/-l(.*)/-l\1d/g
alexisdm
  • 28,572
  • 6
  • 57
  • 90