OOF2: The Manual

7.3. Compiling and Installing External Extensions

  1. Create CMakeLists.txt and the source files, as described in the previous sections.

  2. Create a build directory. It can be inside the source directory, but it does not have to be. It also does not have to be called build.

  3. In a terminal window, cd to the build directory and type

        ccmake <path> 

    to start ccmake, replacing <path> with the path to the top source directory containing CMakeLists.txt.[54]

  4. Inside ccmake,

    1. Type 'c' to generate the initial configuration.
    2. Change[55] CMAKE_INSTALL_PREFIX to the location where the extension is to be installed. This should be the directory marked INSTALL in Figure 7.2 and Figure 7.3.
    3. Type 'c' to update the configuration.
    4. Type 'g' to generate the Makefile and exit ccmake.

  5. Type make to run swig and compile the C++ files.

  6. Type make install to install the Python module and compiled libraries. If you're installing into a system directory, type sudo make install instead.



[54] For example, if build is a subdirectory of the source directory, type cmake ...

[55] The OOF2 README file has some basic instructions on how to use ccmake. For more detail, see the CMake User Interaction Guide.