Friday, October 12, 2012

CMake with NetBeans

There were problems getting the new test code to work properly.  Using gdb from the command line was not the first choice (more time is spent looking up help on commands than actually debugging).  So this left NetBeans, which I was hoping to delay if not permanently postpone the use of (for the reason the change in development alluded to earlier, more on this soon).  NetBeans is supposed to work with CMake and it was time to find out. 

In the spirit of staying current, the latest version (7.2) was downloaded from NetBeans.org.  The C/C++ bundle was selected for both Windows and Linux (x86/x64).  The defaults for the installer were used on all three platforms (XP, 7 and Mint 13) and available updates were installed.

On Windows XP and 7, getting NetBeans to work with CMake was problematic, in fact, I never did figure out how to get it to work correctly.  NetBeans appeared to give CMake incorrect options and CMake said that the compiler was not able to be used.  All attempts to get the options that worked were unsuccessful.

The solution found searching the Internet was to run CMake outside of NetBeans, then point NetBeans to the Makefile produced and this worked.  CMake would have to be run outside of NetBeans from then on when needed - not ideal.  After a bit of work, debugging was enabled and the program could be stepped through.

On Mint 13, NetBeans worked with CMake the way it was supposed to.  NetBeans was able to run CMake and build the program.  The program was built with debugging enabled by default.  Debugging the problems in the new test code went without a hitch.  Hit Continue... for details of the procedures on both platforms.