andreww / fox

A Fortran XML library
https://andreww.github.io/fox/
Other
60 stars 51 forks source link

Some minor changes in CMake compilation system: #34

Closed victorsndvg closed 9 years ago

victorsndvg commented 9 years ago
- Allows to select which targets will compile
- Manage include_directories from the main CMakeLists.txt
- Library names depend on project name
andreww commented 9 years ago

Any chance you could outline how these features can be used - so this information can be included in the documentation? How would a user select different project names or use different parts of FoX with cmake?

victorsndvg commented 9 years ago

Hello @andreww ,

I create 5 options in order to enable/disable the compilation of each high-level library and the examples:

This options are enabled by default.

For example, to do a out-of-source build disabling WCML, WKML and examples with the CMake command line interface, you have to write:

cmake -DFoX_ENABLE_WCML=OFF -DFoX_ENABLE_WKML=OFF -DFoX_ENABLE_EXAMPLES=OFF $SOURCE_DIR

Using cmake-gui this options will be shown on the CMake window.

victorsndvg commented 9 years ago

About the project name:

When you create a project in CMake you use:

PROJECT(FoX Fortran)

The string "FoX" will be automatically stored in the PROJECT_NAME CMake variable.

I used this variable in order to name the libraries (libFoX_dom.a, libFoX_wxml.a, etc.). Now, if you change the name of the project to PROJECT(ASD Fortran), the resultant libraries will be called libASD_dom.a, libASD_xwml.a, etc.

Is not an important feature, only a bit more flexible.

Finally, I want to thank you the work with FoX. I'm going to start using it in my own project and, if you want, I will be glad to collaborate with the project.

Best regards, Víctor.

andreww commented 9 years ago

Thanks - tested and merged. I really should get around to cutting a new release...