Sunday, October 7, 2012

Building The Latest With Command Line CMake

To use CMake from the command line on Windows, the directory containing cmake.exe must be added to the path in MSYS just like for the git programs.  The directory /c/Program Files/Cmake 2.8/bin (Windows XP) or /c/Program Files (x86)/Cmake 2.8/bin (Windows 7) needs to be added.  One thing I forgot to mention in the October 5, 2012 post was that in order for the "/c" part to work in MSYS, the /etc/fstab (C:\MinGW\msys\1.0\etc\fstab) file system table file needs to be modified by adding a new line containing "C:\  /c" to give access to the entire C: drive.

To start, first create the build directory.  For this procedure, create ibcp-build in the same directory as the ibcp source directory and change to it.  On Windows, just like in the CMake GUI, the generator needs to be selected from the command line.  This is done with the ‑G option.  So, use this command to generate the make file:
cmake -G "MSYS Makefiles" ../ibcp 
On Linux, the default generator will be used, so use the cmake ../ibcp command.  To build, use the make command.  By the way, to see the complete compile lines that make is using, use the make VERBOSE=1 command to build (which can be helpful in debugging compile problems like header files that can't be found).

Now some additional build issues need to be resolved, including correcting the issues with parser test #3 on the different platforms, finding the problem with in-source directory builds, and correcting regression testing so that it can be run from the build directory without have to copy the executable to the source directory.

So far, Release 0.1.16 development has been mostly about the build system, but a couple of other minor changes were made, namely, parentheses are no longer stored with identifiers and support for negative constants was added to the parser (instead of treating the minus character as a unary operator).  Therefore, before continuing with development (and a change is coming, stay tuned), a release will be made with the new CMake build system once the remaining issues are resolved.

No comments:

Post a Comment

All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)