I'm using the SE callback mechanism to trigger/hook on project (config) changes e.g. to apply some special project build settings and such.
Example:
void _prjconfig_hs2()
{
// hook for special project setup: check project path containing '\project\requiring\special\setup'
// say ("_prjconfig_hs2: _project_name=" _project_name " PROJECT=" get_env( 'PROJECT'));
if ( (get_env( 'PROJECT') :!= "") && pos( '\project\requiring\special\setup', _project_name ) ) rbuildprj();
}
void _prjopen_hs2 ()
{
// also needed on startup
// say ("_prjopen_hs2: _project_name=" _project_name " PROJECT=" get_env( 'PROJECT'));
_prjconfig_hs2();
}
// special project setup fct.
_command int rbuildprj ( )
{
exit_process ();
clear_pbuffer ();
... whatever needed ...
}
In addition I'm using this little cmdline helper to quickly change the current project (build) config [Release/Debug]:
_command void qprojcfg ( _str config ='' ) name_info (','VSARG2_MARK|VSARG2_TEXT_BOX|VSARG2_READ_ONLY)
{
if ( config == '' )
{
get_string ( config, '[R-elease,D-ebug]: ', NONE_ARG, gActiveConfigName );
}
if( pos( '^R', config, 1, 'ri' ) ) config = 'Release';
else if ( pos( '^D', config, 1, 'ri' ) ) config = 'Debug';
else
{
message ("current config: " gActiveConfigName " [configs: release,debug]");
return;
}
// maybe exit build shell (and restart later)
if ( !strieq ( config, gActiveConfigName ) )
{
exit_process ();
clear_pbuffer ();
}
project_config_set_active( config );
}
Good luck,
HS2