0

I’ve got a project that needs to use the Nash Equilibrium solving capabilities of Gambit-Project This is a performance critical application, so I have to somehow link my codebase with Gambit.

My actual use case sounds simple to me. There is one executable in the folder that has all the top level functions that I need.

The problem is that I am new to Cmake, and C++ in general. Additionally, Gambit is a very mature project that does not use Cmake; Instead, it uses its own make file which is quite difficult to parse.

My project is here: https://github.com/baskuit/surskit/blob/master/CMakeLists.txt

The CMakeLists.txt is very rudimentary (and half commented out this commit)

And Gambit project is here: https://github.com/gambitproject/gambit with the required source file here: https://github.com/gambitproject/gambit/tree/master/src/tools/enummixed

I’m hoping that there is someway to link these two projects without delving into that heinous makefile.

  • 2
    In your CMake project you could use [ExternalProject_Add](https://cmake.org/cmake/help/latest/module/ExternalProject.html) for build the Makefile project during the build of your CMake project. You could look into [that question](https://stackoverflow.com/questions/15175318/cmake-how-to-build-external-projects-and-include-their-targets) about linking with libraries created in external project. – Tsyvarev Jun 28 '22 at 06:25
  • Is it a library or just a gui application/command line tool? If there is a library, build & install gambit from source (it has autotools build system files, not raw makefile by the way). Then in your CMakeLists, use any common way to discover & inject external dependencies (find_package() if gambit provides a CMake config file, pkg_check_modules() if gambit provides a pkgconf file, or write a custom Find module file to discover headers and lib). – SpacePotatoes Jun 28 '22 at 10:47

0 Answers0