cmake

How to generate __init__.py in all subdirectories of current directory in cmake?

How to generate __init__.py in all subdirectories of current directory in cmake? Question: I use an out-of-tree builds with CMake. I have a CMake custom command that generates *_pb2.py files from proto-files. Since proto-files may reside in an unknown number of subdirectories (package namespace), like $SRC/package1/package2/file.proto, then the build directory will contain something like $BLD/package1/package2/file_pb2.py. …

Total answers: 3

Python.h: No such file or directory

Python.h: No such file or directory Question: I recently installed KDevelop 4 for C++ development on my Macbook Pro running Ubuntu 12.04 LTS. I want to embed Python application in my C++ code. To do that, one needs to include the Python.h header file. So, I did that. #include <iostream> #include <Python.h> int main(int argc, …

Total answers: 6

CMake output name for dynamic-loaded library?

CMake output name for dynamic-loaded library? Question: I’m trying to write cmake rules to build dynamic-loaded library for python using boost.python on linux. I’d like to use ‘foo’ for python module name. So, the library must be called foo.so. But by default, cmake uses standard rules for library naming, so if I write add_library(foo foo.cpp) …

Total answers: 2