Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Scripts for using Emacs Flymake with the CMake build system, based on the original scripts from <http://wiki.opencog.org/w/Flymake_help>.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 README.markdown
Octocat-spinner-32 cmake-flymake-generate
Octocat-spinner-32 cmake-flymake-remove
README.markdown

Flymake for the CMake build system

These are 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 Nil Geisweiller on the OpenCog Wiki, but they didn't work immediately for me. I'm hoping that the modified versions now work rather reliably out of the box. I was linked to them by Flymake with CMake on the EmacsWiki.

Dependencies

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)
  • GNU bash
  • CMake

Installation

cd your_projects_dir
git clone git://github.com/seanfisk/cmake-flymake.git
cd cmake-flymake
ln -s "$PWD"/cmake-flymake-{generate,remove} ~/bin # or wherever you put your scripts

Use

  1. Follow these project setup instructions:

    cd your_cmake_project
    mkdir build # your build directory
    cd build
    cmake .. # create the CMake configs
    cd ..
    cmake-flymake-generate build # or whatever you named the build directory
    
  2. Open your file in Emacs.

  3. M-x flymake-mode
  4. Enjoy the incremental compilation!

Other Notes

  • When you change any of your CMakeLists.txt files, re-run cmake .. and cmake-flymake-generate build.
  • To remove the Flymake Makefiles, run cmake-flymake-remove.
  • 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, but I doubt it will work (it is bash, after all). UNIX-like operating systems (including GNU/Linux, BSD, Mac OS X) should be fine.

TODO

  • I'd like to not have to parse CMakeLists.txt, because I already had some problems in a simple build when I used a variable as my executable name. Alternative approaches involve something like find build -name flags.make, e tc.
Something went wrong with that request. Please try again.