There are a few simple steps for building using the CMake system. It's worth noting that when using CMake, all the output files are put into a separate build directory. This prevents the source directory from getting cluttered with files. Assuming that the source files are in the
ibcp sub-directory, an
ibcp-build directory will be created. These commands are used for building the project:
- mkdir ibcp-build
- cd ibcp-build
- cmake ../ibcp
- make
If no errors occur from Step 3 (like the correct version of GCC was not found), then Step 4 will build the program. All auto-generated include files, object files and the program will be located in the
ibcp-build directory. To enable debug information in the executable, the
ccmake program is used with these steps:
- ccmake ../ibcp
- Press Enter on the CMAKE_BUILD_TYPE line
- Type in "Debug" and press Enter
- Press [c] to configure
- Press [g] to generate and exit
- Now entering make will build with debug information
Setting the string to "
Release" in Step 3 will turn off the debugging information. There is also a "
make clean" option. If the build is not performed in the source directory (possible but not recommended), the entire contents of the build directory can also be deleted and cmake rerun. Now that CMake is working on Linux, it is now time to make it work under Windows...
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.)