Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Conditional compilation
Conditional compilation [message #50662] Fri, 30 November 2018 14:23 Go to next message
Giorgio is currently offline  Giorgio
Messages: 170
Registered: August 2015
Experienced Member
Hi there,
I have a project consisting in several packages. Not all the packages should be built each time, because I would like to customize the executable for each user excluding or including some packages. This should be done using an include file in which I define some "variable" specifying if the package has to be compiled. I have tried to use the package organizer, but I do not understand completely how it works. For instance, in the include file i defined a variable: #define COMPILEMODULEA and then in the package organizer, in the when column, I put COMPILEMODULEA. My understanding in fact was that if the variable in the when column is defined, the package is included, but this is clearly not the case, as that is not working. What should I put in the when column of the package organizer?

Thanks,
gio
Re: Conditional compilation [message #50663 is a reply to message #50662] Sat, 01 December 2018 08:50 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11706
Registered: November 2005
Ultimate Member
Giorgio wrote on Fri, 30 November 2018 14:23
Hi there,
I have a project consisting in several packages. Not all the packages should be built each time, because I would like to customize the executable for each user excluding or including some packages. This should be done using an include file in which I define some "variable" specifying if the package has to be compiled. I have tried to use the package organizer, but I do not understand completely how it works. For instance, in the include file i defined a variable: #define COMPILEMODULEA and then in the package organizer, in the when column, I put COMPILEMODULEA. My understanding in fact was that if the variable in the when column is defined, the package is included, but this is clearly not the case, as that is not working. What should I put in the when column of the package organizer?

Thanks,
gio


Almost correct, but you do not define it with #define. Those variables are set in "main configuration" and the term is in fact 'FLAG' (not variable). Note that some flags are also added by builders (like WIN32 etc...).

You can create package organizer "when" conditions based on flags and it is really meant for you usecase.

Additionally, all flags (both those specified in main package and those added by build process) are reflected as #define flagXXX (via commandline). So you can additionally test these in the code.
Re: Conditional compilation [message #50676 is a reply to message #50663] Mon, 03 December 2018 11:04 Go to previous message
Giorgio is currently offline  Giorgio
Messages: 170
Registered: August 2015
Experienced Member
Thanks
Previous Topic: Non-modal close button?
Next Topic: Extending an existing widget...
Goto Forum:
  


Current Time: Tue Feb 19 20:48:40 CET 2019

Total time taken to generate the page: 0.00652 seconds