开发者

Call external programs with CMake

开发者 https://www.devze.com 2023-03-09 12:00 出处:网络
I tried to search the CMake documentation, but I couldn\'t figure out how to call external programs from CMake.

I tried to search the CMake documentation, but I couldn't figure out how to call external programs from CMake.

There are few things I want to do.

  1. Compile other third-party dependencies that uses a makefile
  2. Compile Thrift definition files to C++ / Python stubs.
  3. Compile Cython definition files.

Another question is, what is a good way to handle those cases anyway? It feels like calling a shell script directly from CMake doesn't feel so clean, when "C" in CMake stands for Cross Platform.

EDIT: I have few extra questions. Before, in my build, I prebu开发者_开发百科ilt my dependencies, and the project itself used FIND_PACKAGE(...) to find the header / libraries for the dependencies.

Now, I'm ExternalProject_Add() to compile the dependencies, but the problem is, all my FindXYZ() functions fails when I run cmake ., because the dependencies aren't present when CMake gets executed.

How should I include the third-party libraries in my project in this case?


  1. http://www.kitware.com/media/html/BuildingExternalProjectsWithCMake2.8.html

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号