Author Topic: Output objects to a specific subfolder  (Read 6516 times)

Offline eddyq

  • Multiple posting newcomer
  • *
  • Posts: 56
Output objects to a specific subfolder
« on: April 04, 2013, 04:37:41 pm »
I have my project in ./Projects. By default it puts the objects in ./Projects/obj. I want to use a different obj name called LinuxObj (the reason is because I use C::B from both Windows and Linux in which case on the Windows system I'll name WindowsObj).

I looked around and don't see an option for that so I just took a stab at Settings/Compiler/Compiler Settings/Other Options and added -o LinuxObj. (of course that didn't work).

Is there a way?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Output objects to a specific subfolder
« Reply #1 on: April 04, 2013, 04:46:05 pm »
Project -> Properties-> Build targets -> Objects output dir
(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 eddyq

  • Multiple posting newcomer
  • *
  • Posts: 56
Re: Output objects to a specific subfolder
« Reply #2 on: April 04, 2013, 08:10:25 pm »
I want it to be specific to the system I'm using. For both systems they use the same project file. Is there a way to use something in the global settings (because that sits on the platform in use)?

Offline osdt

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Output objects to a specific subfolder
« Reply #3 on: April 04, 2013, 08:26:39 pm »
I want it to be specific to the system I'm using. For both systems they use the same project file. Is there a way to use something in the global settings (because that sits on the platform in use)?

It's possible by using global variables:

Settings->Global Variables: add 'my_output_dir' = somewhere
Project->Properties->Build Targets->Output Filename: $(#my_output_dir)/mydll.dll

- osdt

Offline osdt

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Output objects to a specific subfolder
« Reply #4 on: April 04, 2013, 08:39:07 pm »
I want it to be specific to the system I'm using. For both systems they use the same project file. Is there a way to use something in the global settings (because that sits on the platform in use)?

It's possible by using global variables:

Settings->Global Variables: add 'my_output_dir' = somewhere
Project->Properties->Build Targets->Output Filename: $(#my_output_dir)/mydll.dll

BTW: this works for 'Objects output dir' too.

- osdt

Offline eddyq

  • Multiple posting newcomer
  • *
  • Posts: 56
Re: Output objects to a specific subfolder
« Reply #5 on: April 04, 2013, 08:56:59 pm »
Settings->Global Variables: add 'my_output_dir' = somewhere
Project->Properties->Build Targets->Output Filename: $(#my_output_dir)/mydll.dll

I could not get that to work.
1) In Settings->Global Variables, I added "object_dir" to Current Variable
2) then I added my folder name where my project is to "base"
3) then I set "obj" to "obj_windows" (I want the object files to go to .\obj_windows (where . is where my project is)
4) then closed and opened Project->Properties->Build targets->Objects output dir and added $(#object_dir)\Debug\
5) then re-built

But all of the objects went to ./obj/Debug

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Output objects to a specific subfolder
« Reply #6 on: April 04, 2013, 09:17:57 pm »
Are you sure that you've done it for the correct target?
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Output objects to a specific subfolder
« Reply #7 on: April 04, 2013, 09:22:24 pm »
Which version of C::B do you use ?

Offline eddyq

  • Multiple posting newcomer
  • *
  • Posts: 56
Re: Output objects to a specific subfolder
« Reply #8 on: April 04, 2013, 09:34:30 pm »
Which version of C::B do you use ?

12.11

Offline osdt

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Output objects to a specific subfolder
« Reply #9 on: April 04, 2013, 11:12:21 pm »
I could not get that to work.
1) In Settings->Global Variables, I added "object_dir" to Current Variable
2) then I added my folder name where my project is to "base"
3) then I set "obj" to "obj_windows" (I want the object files to go to .\obj_windows (where . is where my project is)
4) then closed and opened Project->Properties->Build targets->Objects output dir and added $(#object_dir)\Debug\
5) then re-built

But all of the objects went to ./obj/Debug

Set base to "obj_windows" and use $(#object_dir) for the Target. This will be relative to your project's root.

If you want to use the 'obj' part of the global, use $(#object_dir.obj)

- osdt

Offline eddyq

  • Multiple posting newcomer
  • *
  • Posts: 56
Re: Output objects to a specific subfolder
« Reply #10 on: April 05, 2013, 03:53:17 pm »
Great!! .. that worked just as I want it to.