Author Topic: compiler variables/macros  (Read 3236 times)

Offline grahamo

  • Multiple posting newcomer
  • *
  • Posts: 17
compiler variables/macros
« on: April 18, 2011, 04:25:43 pm »
hi,

I have to migrate about 40 projects to codeblocks. 30 of the projects link against the same libs (amongst others). i would like to be able to define a variable (not an environment variable, but a variable that exists only within codeblocks) that indicates the libs I link against.

e.g. something like;

DEBUG_DOC_LIBS=libdoc.so, libprinter.so, libtoto.so

In each of my 30 projects, I can specify $DEBUG_DOC_LIBS. i want to then use this variable in the project build options -> linker settings -> link libraries box (or probably in the "other linker options" box as I see the former only accepts files as input.

Can anybody tell me how I can define such a variable and use it thus.

Thanks and have a nice day

Graham

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: compiler variables/macros
« Reply #1 on: April 18, 2011, 08:02:34 pm »
I suggest you read up on what Code::Blocks targets do before you try to do it the way your described.

If after reading up on targets you still wish to do it the way you said, I suggest reading up on Code::Blocks scripting and see if that does what you want.

Tim S.
« Last Edit: April 18, 2011, 08:04:56 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline grahamo

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: compiler variables/macros
« Reply #2 on: April 19, 2011, 02:17:38 pm »
thanks for the honest reply :)

have a nice day.

Graham