Fields2Cover / Fields2Cover

Robust and efficient coverage paths for autonomous agricultural vehicles. A modular and extensible Coverage Path Planning library
https://fields2cover.github.io/
BSD 3-Clause "New" or "Revised" License
498 stars 105 forks source link

Use CMAKE_INSTALL_PREFIX to specify where to install the python interface #140

Closed Taka-Kazu closed 4 months ago

Taka-Kazu commented 4 months ago

This PR allows the python interface to be installed in the specified path. The default behavior is not changed.

Example:

cd Fields2Cover;
mkdir -p build;
cd build;
cmake -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=/tmp/test ..;
make -j$(nproc);
make install;

In this case, fields2cover.py will be installed as /tmp/test/lib/python3.X/site-packages/fields2cover.py

And you can run test by PYTHONPATH=${PYTHONPATH}:/tmp/test/lib/python3.X/site-packages pytest-3 tests

Gonzalo-Mier commented 4 months ago

Hi @Taka-Kazu,

Thank you for your contribution. Test are failing though :(

Taka-Kazu commented 4 months ago

I could reproduce the error using gh act command locally. I'll take a look.

Taka-Kazu commented 4 months ago

I found that CMAKE_INSTALL_PREFIX is specified in the test. Specifying PYTHONPATH should fix the failure.

Gonzalo-Mier commented 4 months ago

Thank you for the PR!