refactor: re-implement the project, which should be available for both org and com version of OpenFOAM
This commit is contained in:
29
README.md
29
README.md
@ -1,21 +1,24 @@
|
||||
# of_cmake_config
|
||||
[中文](./README.zh_CN.md) | [English](./README.md)
|
||||
|
||||
#### Description
|
||||
This project is used to generate CMakeLists.txt for OpenFOAM project.
|
||||
#### Introduction
|
||||
This project is used to generate `CMakeLists.txt` for OpenFOAM projects.
|
||||
|
||||
#### Installation
|
||||
0. Activate OpenFOAM environment:
|
||||
- Using alias `of2012clang` or `of2012clangdebug`
|
||||
- source directly: `source $HOME/OpenFOAM/OpenFOAM-v2012/etc/bashrc WM_COMPILER=Clang ...`
|
||||
1. Get this project: `git clone https://github.com/zhyang-dev/of_cmake_config.git`
|
||||
#### Installation Guide
|
||||
0. Activate the required OpenFOAM environment (otherwise the installation will fail).
|
||||
1. Obtain the project source code: `git clone https://github.com/zhyang-dev/of_cmake_config.git`
|
||||
2. Install: `cd of_cmake_config && ./install`
|
||||
|
||||
#### Instructions
|
||||
#### Usage Instructions
|
||||
|
||||
1. Activate OpenFOAM environment
|
||||
2. In project root path,
|
||||
- run `ofCmakeConfig` to generate `CMakeLists.txt`
|
||||
- or run `occ`, which is a wrapper of `ofCmakeConfig` script, to generate `CMakeLists.txt` and `compile_commands.json`.
|
||||
0. Activate the OpenFOAM environment.
|
||||
1. In the project's root directory:
|
||||
- Run `ofCmakeConfig` to generate `CMakeLists.txt`.
|
||||
- Or run `occ`, which will execute `ofCmakeConfig` and call `cmake -B build`, eventually generating `compile_commands.json` in the build directory.
|
||||
|
||||

|
||||
#### Testing Environment
|
||||
- `vscode` + `clangd`
|
||||
- `vim` + `coc-clangd`
|
||||
|
||||
The following demonstrates the second scenario based on the icoFoam case.
|
||||

|
||||
Reference in New Issue
Block a user