The structure of a mmx package |
To be easy to use together, the
pkg
|-- include
| |-- pkg
| |-- file1.hpp
| |--...
|-- src
| |-- src_file1.cpp
| |-- ...
|-- glue
| |-- glue_file1.cpp
| |-- ...
|-- app
| |-- tool1.cpp
| |-- ...
|-- test
| | ...
|-- axl
| |-- QPlugin1
| | |-- ...
| | ...
|-- specif
| |-- pkg-package.amx
| |-- ...
|-- CMakeModules
| |-- FindPkg.cmake.in
| |-- ...
|-- macros
| |-- ...
|-- CMakeLists.txt
|-- configure.ac
|-- Makefile.am
|-- ...
To describe how this structure is exploited in the configuration step, we assume that we run cmake in a folder build, where the binary files will be compiled:
cd build; cmake ../pkg
The header files are put in pkg/include/pkg. Their suffix is .hpp. They are used with the instruction in c++ files as follows:
#include <pkg/file1.hpp>
The source files are put in pkg/src. Their suffix is .cpp. All the files in this folder are used to construct the library libpkg(.a,.so,.dyl,...) which is put in build/lib.
The application files are put in pkg/app. Their suffix is .cpp. For each file f.cpp in pkg/app, a binary application f is compiled and put in build/bin.
The test files are put in pkg/test. Their suffix is .cpp. For each file t.cpp in pkg/test, a binary application pkg_test_t is compiled in build/test. This files will be compiled if the option TEST is ON. They will executed with:
make test
The glue files are put in pkg/glue. Their suffix is .cpp. All the files in this folder are used to construct the library libmmxpkg(.a,.so,.dyl,...) which is put in build/lib. This library can be loaded in the interpreter with the command use:
use "pkg";
The files for the