pybind / cmake_example

Example pybind11 module built with a CMake-based build system
Other
613 stars 218 forks source link

How to cmake manually. #115

Closed LukeLIN-web closed 1 year ago

LukeLIN-web commented 1 year ago

I want to cmake it manually. From this video https://www.youtube.com/watch?v=H2wOlriHGmM. The following are successes.

mkdir build 
cd build
cmake ..
make mymath

Scanning dependencies of target mymath [ 50%] Building CXX object CMakeFiles/mymath.dir/src/mymath.cpp.o [100%] Linking CXX static library libmymath.a [100%] Built target mymath

make cmake_example

[ 50%] Built target mymath Scanning dependencies of target cmake_example [ 75%] Building CXX object CMakeFiles/cmake_example.dir/src/binder.cpp.o [100%] Linking CXX shared module cmake_example.cpython-38-x86_64-linux-gnu.so [100%] Built target cmake_example

Screen Shot 2023-01-07 at 8 32 16 PM

And I don't know how to use setup.py I tried python3 setup.py cmake_example But the output is : usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help

error: invalid command 'cmake_example' What is the cmd1 means?

LukeLIN-web commented 1 year ago

Now I know ,https://stackoverflow.com/questions/63145828/python-pypi-setup-py-error-usage-setup-py-global-opts-cmd1-cmd1-opts-cmd2