Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » C/C++ Eclipse(Run 2 or more compilations in 1 click)
C/C++ Eclipse [message #1043239] Wed, 17 April 2013 13:07 Go to next message
Patrice Cavin is currently offline Patrice CavinFriend
Messages: 2
Registered: April 2013
Junior Member
Hi,

I would like run 2 compilations for example, one called "myCompilation1" and the second "myCompilation2" in one click. And according to the current configuration,the right "myHeaderX.h" is defined in my header file (myConfig.h).

myConfig.h file
---------------

#if myCompilation1
#include "myHeader1.h"
#endif

#if myCompilation2
#include "myHeader2.h"
#endif


And after each compilation, I would like to move the output file to a dedicated directory.

if myCompilation1 then move output to c:/myDir1
if myCompilation2 then move output to c:/myDir2


Thanks for your help.

Pat

Re: C/C++ Eclipse [message #1043874 is a reply to message #1043239] Thu, 18 April 2013 08:07 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
You can define a Build Configuration for each compilation.

see http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_prop_build_settings_tool.htm&cp=11_4_7_0_3_3_0

You can then define a Post Build Step to copy your executables
http://help.eclipse.org/juno/topic/org.eclipse.cdt.doc.user/reference/cdt_u_prop_build_settings_steps.htm?cp=11_4_7_0_3_3_1


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: C/C++ Eclipse [message #1043897 is a reply to message #1043874] Thu, 18 April 2013 08:36 Go to previous messageGo to next message
Patrice Cavin is currently offline Patrice CavinFriend
Messages: 2
Registered: April 2013
Junior Member
Hi Axel,

Yes, I already created 2 configurations and for each of them I also defined a symbol MY_COMPILATION = 1 and respectively MY_COMPILATION = 2 in order to test the current active configuration.

MyConfig.h file
-------------------
#if MY_COMPILATION == 1
# include "myHeader1.h"
#endif

#if MY_COMPILATION == 2
# include "myHeader2.h"
#endif

The post build command is a good idea, thanks. Do you have commands examples ? What do you recommend to copy the files (batch file,...) ?

Best regards,
Pat
Re: C/C++ Eclipse [message #1050569 is a reply to message #1043897] Sat, 27 April 2013 11:34 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Patrice Cavin wrote on Thu, 18 April 2013 10:36
Hi Axel,
The post build command is a good idea, thanks. Do you have commands examples ? What do you recommend to copy the files (batch file,...) ?

Best regards,
Pat

You can use the xcopy command.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:CDT indexer not support MS-style anonymous struct ?
Next Topic:problem with changing templates
Goto Forum:
  


Current Time: Thu Apr 25 10:45:08 GMT 2024

Powered by FUDForum. Page generated in 0.03455 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top