New Issue: Support for CMake build systems when using Chapel/C interop

20243, "brandon-neth", "Support for CMake build systems when using Chapel/C interop", "2022-07-18T21:58:54Z"

I've been working on porting parts of Parflow (GitHub - parflow/parflow: Parflow is an open-source parallel watershed flow model.) to Chapel. This has meant utilizing the C interop capabilities of Chapel.

The Chapel compiler supports generating Makefile definitions for these interop libraries using the --library-makefile flag on the compiler. However, Parflow uses CMake as its build system, so the generated definitions can not easily be incorporated into the Parflow build.

I'm proposing a similar flag, --library-cmakelists that generates a CMakeList.txt file containing the same definitions as the generated makefiles, but in CMake syntax. Then, linking it into the existing CMake system is as simple as an "include()" and a couple of target linking commands that will be included as comments to the generated file.