Author Topic: easily copy and edit multiple options in build options?  (Read 3759 times)

Offline Story

  • Single posting newcomer
  • *
  • Posts: 9
easily copy and edit multiple options in build options?
« on: June 16, 2011, 05:24:54 am »
Sorry I can't think of a simple way to describe this problem. But the problem is that under Project->Build Options, there are a lot of options that have to be entered one by one. For example Link Libraries.

Libraries under linker settings have to be added one by one, and there is no way to easily edit or copy them. (Apart from the Copy All button, which only moves them to another target). For example, suppose I link to a bunch of libraries in a particular directory, but then that directory gets moved. What I want to do is just a simple search replace to update all the directory names. But there's no way to do it. I have to manually click on each one, browse through windows explore to the new location of the library, and then click to accept. For every single library. Obviously this quickly becomes unwieldy and is a huge hassle.

P.S. I figured out one way to do this: manual editing of the project file as xml. However this seems needlessly complicated. Is there any way to get support for something like this inside the C::B gui?
« Last Edit: June 16, 2011, 05:32:20 am by Story »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: easily copy and edit multiple options in build options?
« Reply #1 on: June 16, 2011, 07:43:59 am »
Hm, Do you put library names only in the Link libraries, or you put the full paths?
Aren't you using "Search directory|Linker"?
Have you read about global variables? http://wiki.codeblocks.org/index.php?title=Global_compiler_variables
And last but not least, there is a scripting support for modifying this things...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: easily copy and edit multiple options in build options?
« Reply #2 on: June 16, 2011, 07:52:08 am »
If you always use a absolute library path, this could be an issue.

Can you use a short fine name? then only specify the library search path in another tab?

Look at the image below:
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.