I have been experimenting with TextMate as an alternative editor. The run
shortcut is fantastic for testing ideas quickly and easily. I have installed boost via homebrew and the run
function will happily find, include and build simple projects with headers such as boost/lexical_cast.hpp
. Great!
I now want to build a project that needs to be linked against boost_system-mt
. Is there a simple way I can add this linker step to a textmate project?
EDIT
Ok. I can get this to work if I add -lboost_system-mt
to the Run command in the bundle editor, but I can't fathom how to link this to a single project.
OK, this is simple. If you look at the code in the bundle editor yo can see the bit of code that adds the flags to the build settings . . .
flags = ENV["TM_#{env}_FLAGS"] || "-incl...
... seeing as the environment is CXX, it means you need to add a "project specific shell variable" called TM_CXX_FLAGS
containing boost_system-mt
. To do this, look at the bottom of the small pane on the left that shows all of the files in your project and click on the 'i'. THis will bring up project information where you can add the necessary variables.
You can use double quotes to put loads of compilation flags in there if you wish, making TextMate capable of running pretty much anything!