Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: eddyq 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?
-
Project -> Properties-> Build targets -> Objects output dir
-
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)?
-
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
-
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
-
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
-
Are you sure that you've done it for the correct target?
-
Which version of C::B do you use ?
-
Which version of C::B do you use ?
12.11
-
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
-
Great!! .. that worked just as I want it to.