Author Topic: New plugin: Library finder  (Read 13009 times)

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
New plugin: Library finder
« on: December 01, 2005, 05:59:24 pm »
Hi,

I've created plugin which may ease setting up libraries to be used inside C::B.
Base idea is to set-up global variables is such way that if one want to use library settings, only following project options must be added:
  • $(#GV.include) in include path
  • $(#GV.lib) in library path
  • $(#GV.obj) in resource path
  • $(#GV.cflags) to other compiler options
  • $(#GV.lflags) to other linker options
(where GV is name of global variable - f.ex. WX for wxWidgets, CB for Code::Blocks SDK etc, etc)

Maybe this list isn't too short but it will be same for all libraries and perhaps it should be done automatically ;).

Currently it support only wxWidgets (2.6 MONOLITHIC DLL version), C::B SDK, glfw but this list can be easily extendedd through xml settings (see libfinder/README.txt in attached source for deetails).

If You want to compile plugin, extract files from attached archive into C::B/src/plugins/contrib directory and simply compile (maybe some project settings will have to be changed).

This plugin also assumes that library can use multiple paths. Because C::B Global Variables allow only one path in category, other will be simulated through -I<include_path> and -L<include_path> paths. Maybe it's good point for feature request ;)

And one more thing - target platform for this plugin was Windows since there are common paths for libraries and there's no need to find them ;)

[attachment deleted by admin]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9594
Re: New plugin: Library finder
« Reply #1 on: January 03, 2006, 03:19:35 pm »
Nice job. In case you haven't alreay noticed, may I point to: http://wiki.codeblocks.org/index.php?title=Announcement_for_plugins/patches. It would be nice if you could add the plugin there, too. If you don't have the time I can do it for you... for the sake of completness...  ;-)
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

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: New plugin: Library finder
« Reply #2 on: January 03, 2006, 05:02:54 pm »
Nice job. In case you haven't alreay noticed, may I point to: http://wiki.codeblocks.org/index.php?title=Announcement_for_plugins/patches. It would be nice if you could add the plugin there, too. If you don't have the time I can do it for you... for the sake of completness...  ;-)
Morten.


If You could add it I would really appreciate that :). Since I have thousands of things on my mind I've almost forgot about this little project ;)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9594
Re: New plugin: Library finder
« Reply #3 on: January 04, 2006, 08:09:40 am »
If You could add it I would really appreciate that.
Done. I set the state to "beta", I hope you don't mind. I've also attached an updated version of the project file that make it easier to compile the plugin with the new build system of the C::B SVN trunk. (It assumes the lib_finder is in the plugins/contrib folder.)
Best regards, Morten.

[attachment deleted by admin]
« Last Edit: January 04, 2006, 08:11:17 am 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 byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: New plugin: Library finder
« Reply #4 on: January 04, 2006, 10:28:57 pm »
Big THX :)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9594
Re: New plugin: Library finder
« Reply #5 on: January 13, 2006, 07:21:16 pm »
Big THX :)
I have a question: By now I am getting this warning if I try to compile the plugin:
Code: [Select]
./pch.h:4:17: warning: E:/Devel/CodeBlocks_Devel/src/sdk/sdk.h.gch: not used because `_MT' not defined
The plugin still compiles and works but I couldn't find out where this comes from. I can nowhere find the define at all. Any ideas?
With regards, Morten.
Edit: I forgot to add (don't know if it's important): C::B as of revision 1749, wxWidgets 2.6.2 (unicode) under Windows.
« Last Edit: January 13, 2006, 07:54:40 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: Library finder
« Reply #6 on: January 13, 2006, 07:54:24 pm »
Make sure the following are in "Project->Build options->Compiler->Other options":

Quote
-pipe
-mthreads
-fmessage-length=0
-fexceptions
-Winvalid-pch
Be patient!
This bug will be fixed soon...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9594
Re: New plugin: Library finder
« Reply #7 on: January 13, 2006, 10:07:55 pm »
Make sure the following are in "Project->Build options->Compiler->Other options":
[...]
...that did the trick. Thanks a lot!
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

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: New plugin: Library finder
« Reply #8 on: December 23, 2007, 01:59:05 am »
Hi everyone,
After a long time, I've digged out my old lib_finder plugin and added few nice features.
The most important is that I've managed to compile wxWidgets project on both Linux and Windows using only one project file (I was working on few cross-platform projects recently and keeping those project files up-to-date was really a nightmare).

How does the new version work?

Many things are done in the same way - on Plugins menu there's "Library Finder" entry which shows serch dialog. After entering few directories where we think that our libraries are placed, lib_finder will scan those directories in order to detect and configure what's there.

After such scan, each library found have one or more sets of configurations. In project options there's new "Libraries" tab where you can specify which libraries this project use. With small modification of sdk, lib_finder may automatically alter compiler options while the project is compiled so the only thing you need to use library in project is to add it on "Libraries" tab. And it works independently of platform because the configuration of library is stored in c::b settings, not in .cbp file.

I attach patch which allows lib_finder to alter compile options and test project which can be compiled on windows and linux without any modification (of course lib_finder must search for files before the project can be compiled). The patch adds one extra event, so I didn't want to add it myself to SDK.

So question to other developers: is there a chance to apply this patch to main sources ?

Regards
   BYO



[attachment deleted by admin]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9594
Re: New plugin: Library finder
« Reply #9 on: December 29, 2007, 04:58:56 pm »
So question to other developers: is there a chance to apply this patch to main sources ?
To confirm that this did not get lost: I have applied the patch for several days now - I see no issues at all and would vote positively for it's application. I think it's a nice feature. If the other devs agree then (Byo:) Go ahead! :-)
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9594
Re: New plugin: Library finder
« Reply #10 on: January 07, 2008, 12:58:50 pm »
After a long time, I've digged out my old lib_finder plugin and added few nice features.
I found the time to truely give it a try (although not he very recent release). I probably found something irritating: When I ran the plugin and stepped though it to integrate the wx libs in the end there was no message whats-o-ever whether it worked or not and what actually happened. I found out later that lib_finder modified the global variables correctly - but (more-or-less) by accident (had forgotten that completely meanwhile...). So my wish would be not to leave the user in "the dark" by poviding something like a summary dialog in the end what happened (succeeded) and how the user can now make use of it. Especially for newbies (like me ;-)) this would be nice. Any annoying dilaig would fit well there (IMHO) so that one can switch it off once read.
Beside that: Nice work!!! :-)
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

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: New plugin: Library finder
« Reply #11 on: January 07, 2008, 01:48:34 pm »
Right, I also found this irritating some time ago but forgot to code the solution :lol:. Anyway, there's a big list of todos for this plugin (I've put some scratchpad here if anyone's interested) so it may take some time till it's user-friendly ;)

Regards
   BYO