Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Python scripts for using Emacs Flymake with the CMake build system out of the box
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

Flymake for the CMake build system

These are python scripts for using the CMake build system with Flymake, an on-the-fly syntax checker for GNU Emacs. I've found these scripts written by Sean Fisk. But it didn't work for me because some relative path issue. So I re-write it in python.


These scripts require a few obvious dependencies.

  • Emacs 23, which includes Flymake (this is not necessary to run the script, but to use the results)
  • Python, I tested it with python 2.7 but I think 2.3 will be fine.
  • CMake, I tested it with cmake 2.8


All you need is the script `cmflymk`. Download it at


  1. Create Makefiles for flymake in one step (Make sure you've run cmake under ~/your_project/cmake_project_build/ at first)

    cmflymk ~/your_project/cmake_project_build/
  2. M-x flymake-mode in Emacs

  3. DONE!

Other Notes

  • When you change any of your CMakeLists.txt files, re-run cmake and cmflymk (you may want to use option -y to overwrite the make files without being asked the permission).
  • To remove the Flymake Makefiles, run cmflymk -c.
  • These scripts are configured to use the GNU make variables ${CXX}, ${CXX_FLAGS}, and ${CXX_DEFINES} in the actual Makefiles. This means that the scripts will require editing to work with pure C projects (when using CC, CFLAGS, etc.) or any other language besides C++. This should be quite easy to figure out. Look at the actual Makefiles which get generated for more information.
  • I haven't tested this on Windows because I'm only working under Linux/Cygwin. Contact me (chenbin DOT sh AT GMAIL) if you need Windows support.
Something went wrong with that request. Please try again.