-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setting up python bindings and updating github actions workflow
- Loading branch information
Showing
5 changed files
with
74 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ bin* | |
build | ||
*~ | ||
metaconfigure/*.pyc | ||
docs/.build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// system includes | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
|
||
// other includes | ||
|
||
// namespace aliases | ||
namespace python = pybind11; | ||
|
||
/** | ||
* @brief GNDStk python bindings | ||
* | ||
* The name given here (GNDStk) must be the same as the name | ||
* set on the PROPERTIES OUTPUT_NAME in the CMakeLists.txt file. | ||
*/ | ||
PYBIND11_MODULE( GNDStk, module ) { | ||
|
||
module.def( | ||
|
||
"add", | ||
[] ( int left, int right ) { return left + right; }, | ||
python::arg( "left" ), python::arg( "right" ), | ||
"Return the sum of two integers\n\n" | ||
"This function does not throw an exception.\n\n" | ||
"Arguments:\n" | ||
" left the integer on the left\n" | ||
" right the integer on the right" | ||
); | ||
} |