Call external programs with CMake

I tried to search for CMake documentation, but I could not figure out how to call external programs from CMake.

There are a few things I want to do.

  • Compile other third-party dependencies that use makefile
  • Compile Thrift definition files into C ++ / Python stubs.
  • Compile Cython .

Another question: what is a good way to handle these things? It seems that calling the shell script directly from CMake is not so clean when “C” in CMake means Cross Platform.

EDITOR: I have a few additional questions. Earlier in my assembly, I preconfigured my dependencies, and the project itself used FIND_PACKAGE (...) to search for headers / libraries for dependencies.

Now I have ExternalProject_Add () to compile the dependencies, but the problem is that all my FindXYZ () functions fail when I start cmake ., because the dependencies are not present when CMake starts.

How to include third-party libraries in my project in this project?

+5
source share
1 answer

2 + 3. can be hacked CONFIGURE_COMMAND / BUILD_COMMAND / INSTALL_COMMAND

+4
source

All Articles