Author Topic: New PlugIn: Environment Variables Editor  (Read 7814 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
New PlugIn: Environment Variables Editor
« on: May 08, 2006, 09:40:10 pm »
Dear community,

it's ready: A plugin for Code::Blocks that allows setting environment variables in the focus of Code::Blocks. Find it attached.

--> What is does
Imagine you require to setup specific environment variables for your compiler / application to work. Think of "LIBS", "INCLUDES", "LD_LIBRARY_PATH" or "LICENSE_FILE" you would like to setup specifically. If you don't want to setup these system wide for any reason you can now use this plugin to apply them only within the focus of Code::Blocks. Thus all applications you call / run from C::B have access to the environment variables setup but ones you close C::B all setings are back to "normal". The variables are applied on-the-fly and saved through the C::B configuration file from one to another Code::Blocks session.

--> How to compile/install
If this plugin is placed under [CodeBlocks_SVN]\plugins\contrib\envvars in the source-code distribution of Code::Blocks it should compile fine (relative path's are set).

--> Help wanted
I don't have access to a linux box. Allthough this plugin should work fine under linux (there is no platform specific code) it requires testing.

Comments and hints are appreciated.

With regards, Morten.

Edit: Updated to version 0.91 (fixing the bug reported by Ceniza).

[attachment deleted by admin]
« Last Edit: May 08, 2006, 10:33:01 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: New PlugIn: Environment Variables Editor
« Reply #1 on: May 08, 2006, 10:13:50 pm »
I created a new envvar named INCLUDE_DIR with value C:\MinGW\include, clicked Set now, closed the window and then checked with Process Explorer and found INCLUDE_DIR was added but without a value.

I tried again and the envvar was listed with its value. I clicked Set now again, closed the window and now the value was set.

Created another envvar named LIB_DIR with value C:\MinGW\lib, clicked Set now and closed the window. Now Process Explorer shows INCLUDE_DIR and LIB_DIR empty. I tried again clicking on INCLUDE_DIR first and then on Set now, but now both INCLUDE_DIR and LIB_DIR have C:\MinGW\include as value. I tried again clicking on LIB_DIR and then Set now, but now both have C:\MinGW\lib as value.

Bugs? :)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: New PlugIn: Environment Variables Editor
« Reply #2 on: May 08, 2006, 10:27:29 pm »
Bugs? :)
Well... The "Set now" button is actually not really required. The environment variables are applied on-the-fly when another variable is added or an existing one is changed.
Anyway: I found this bug and fixed it... I'll update the plugin in a minute...
Thanks for that!
With regards, Morten.

Edit: Updated. Could you (Ceniza) please give it a try again?  Thanks in advance!
« Last Edit: May 08, 2006, 10:35:49 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: New PlugIn: Environment Variables Editor
« Reply #3 on: May 08, 2006, 10:38:41 pm »
Thanks for this plugin Morten. It has been added in the contrib plugins.
I expect a post or PM with your BerliOS account to add you as this plugins maintainer (i.e. commit access).
Be patient!
This bug will be fixed soon...

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: New PlugIn: Environment Variables Editor
« Reply #4 on: May 08, 2006, 11:32:41 pm »
I just tried the new one and it seems to be working fine :)

It's nice Don Corleone added it to SVN now. It took what? 1 hour? :D

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: New PlugIn: Environment Variables Editor
« Reply #5 on: May 09, 2006, 12:00:20 am »
I don't know if what I added to HEAD contains the fixes you 're talking about, but Morten can work on the repository now so he 'll update it if I added the older sources :)
Be patient!
This bug will be fixed soon...

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2173
Re: New PlugIn: Environment Variables Editor
« Reply #6 on: May 09, 2006, 01:38:30 am »
I get the following errors compiling envars plugin under win xp
using the contrib.cbp
Code: [Select]
-------------- Build: default in EnvVars Plug-In for Code::Blocks ---------------
Compiling: envvars.cpp
In file included from C:/Usr/Proj/wxWidgets262/include/wx/defs.h:21,
                 from C:/Usr/Proj/wxWidgets262/include/wx/button.h:15,
                 from envvars.cpp:16:
C:/Usr/Proj/wxWidgets262/include/wx/platform.h:190:22: wx/setup.h: No such file or directory
In file included from C:/Usr/Proj/wxWidgets262/include/wx/platform.h:258,
                 from C:/Usr/Proj/wxWidgets262/include/wx/defs.h:21,
                 from C:/Usr/Proj/wxWidgets262/include/wx/button.h:15,
                 from envvars.cpp:16:
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:84:9: #error "wxUSE_DYNLIB_CLASS must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:92:9: #error "wxUSE_EXCEPTIONS must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:100:9: #error "wxUSE_FILESYSTEM must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:113:9: #error "wxUSE_DYNAMIC_LOADER must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:121:9: #error "wxUSE_LOG must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:129:9: #error "wxUSE_LONGLONG must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:137:9: #error "wxUSE_MIMETYPE must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:153:9: #error "wxUSE_PROTOCOL must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:195:9: #error "wxUSE_REGEX must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:203:9: #error "wxUSE_STDPATHS must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:211:9: #error "wxUSE_XML must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:219:9: #error "wxUSE_SOCKETS must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:227:9: #error "wxUSE_STREAMS must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:235:9: #error "wxUSE_STOPWATCH must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:243:9: #error "wxUSE_TEXTBUFFER must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:251:9: #error "wxUSE_TEXTFILE must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:267:9: #error "wxUSE_URL must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:285:9: #error "wxUSE_ACCEL must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:293:9: #error "wxUSE_BMPBUTTON must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:301:9: #error "wxUSE_BUTTON must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:309:9: #error "wxUSE_CALENDARCTRL must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:317:9: #error "wxUSE_CARET must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:325:9: #error "wxUSE_CHECKBOX must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:341:9: #error "wxUSE_CHOICE must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:349:9: #error "wxUSE_CHOICEBOOK must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:357:9: #error "wxUSE_CHOICEDLG must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:365:9: #error "wxUSE_CLIPBOARD must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:373:9: #error "wxUSE_COLOURDLG must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:381:9: #error "wxUSE_COMBOBOX must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:389:9: #error "wxUSE_DATAOBJ must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:397:9: #error "wxUSE_DATEPICKCTRL must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:405:9: #error "wxUSE_DISPLAY must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:413:9: #error "wxUSE_DOC_VIEW_ARCHITECTURE must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:421:9: #error "wxUSE_FILEDLG must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:429:9: #error "wxUSE_FONTDLG must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:437:9: #error "wxUSE_FONTMAP must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:445:9: #error "wxUSE_GAUGE must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:453:9: #error "wxUSE_GRID must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:461:9: #error "wxUSE_HELP must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:469:9: #error "wxUSE_HTML must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:477:9: #error "wxUSE_XRC must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:498:9: #error "wxUSE_ICO_CUR must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:506:9: #error "wxUSE_IFF must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:514:9: #error "wxUSE_IMAGLIST must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:522:9: #error "wxUSE_JOYSTICK must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:530:9: #error "wxUSE_LISTBOOK must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:538:9: #error "wxUSE_LISTBOX must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:546:9: #error "wxUSE_LISTCTRL must be defined."
C:/Usr/Proj/wxWidgets262/include/wx/chkconf.h:554:9: #error "wxUSE_LOGGUI must be defined."
Process terminated with status 1 (0 minutes, 3 seconds)
52 errors, 0 warnings
 


Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: New PlugIn: Environment Variables Editor
« Reply #7 on: May 09, 2006, 09:02:47 am »
that looks like that $(#WX)/lib/gcc_dll/mswu isn't included in the include paths...
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: New PlugIn: Environment Variables Editor
« Reply #8 on: May 09, 2006, 09:13:25 am »
...I know what's wrong: The problem is that mandrav checked in the version that has WX_CFG already set to "Unicode". This should be empty as it is with all the other plugins... I've already fixed this and now I'm "hardly" trying to commit... please be patient... Give me some minutes...
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ