-
-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bindings): update README.md and add CSERIALPORT_DEBUG for log
- Loading branch information
Showing
9 changed files
with
92 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ cmake version 3.26.4 | |
## Build | ||
|
||
``` | ||
cd c | ||
cd bindings/c | ||
mkdir bin | ||
cd bin | ||
cmake .. | ||
|
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
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
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 |
---|---|---|
@@ -1,25 +1,101 @@ | ||
# CSerialPort for Python | ||
|
||
``` | ||
swig: 4.1.0 | ||
cmake: 3.8.2 | ||
python: 3.6.8 | ||
swig: 4.1.1 (2022-11-30) | ||
cmake: 3.26.4 | ||
python: 3.10.11 | ||
``` | ||
|
||
## Install swig && cmake | ||
|
||
### windows | ||
|
||
- swig | ||
|
||
``` | ||
$ wget https://sourceforge.net/projects/swig/files/swigwin/swigwin-4.1.1/swigwin-4.1.1.zip | ||
``` | ||
|
||
- cmake | ||
|
||
``` | ||
$ wget https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-windows-x86_64.msi | ||
``` | ||
|
||
### linux | ||
|
||
- swig | ||
|
||
``` | ||
$ wget https://sourceforge.net/projects/swig/files/swig/swig-4.1.1/swig-4.1.1.tar.gz | ||
$ tar zxvf swig-4.1.1.tar.gz | ||
$ cd swig-4.1.1 | ||
$ ./configure --without-pcre | ||
$ make | ||
$ sudo make install | ||
$ swig -version | ||
SWIG Version 4.1.1 | ||
``` | ||
|
||
- cmake | ||
|
||
``` | ||
$ wget https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-linux-x86_64.sh | ||
$ sudo ./cmake-3.26.4-linux-x86_64.sh --prefix=/usr/local --skip-license | ||
$ cmake --version | ||
cmake version 3.26.4 | ||
``` | ||
|
||
## Build | ||
|
||
``` | ||
cd bindings/python | ||
mkdir bin | ||
cd bin | ||
cmake .. | ||
cmake .. -DSWIG_EXECUTABLE=D:/swigwin-4.1.1/swig.exe | ||
cmake --build . --config Release | ||
``` | ||
|
||
**Notice:** | ||
|
||
``` | ||
D:/swigwin-4.1.1/swig.exe should replace with your path to swig.exe | ||
``` | ||
|
||
or (config swig to path) | ||
|
||
``` | ||
set path=D:/swigwin-4.1.1;%path% | ||
cmake .. | ||
``` | ||
|
||
## Run | ||
|
||
``` | ||
cd bindings/python | ||
cmake -E copy generate/cserialport.py example | ||
cmake -E copy bin/bin/Release/_cserialport.pyd example | ||
python example/main.py | ||
``` | ||
|
||
### Tree | ||
|
||
``` | ||
bindings/python $tree | ||
. | ||
+--- bin | ||
| +--- bin | ||
| | +--- Release | ||
| | | +--- _cserialport.pyd | ||
+--- CMakeLists.txt | ||
+--- cserialport.i | ||
+--- example | ||
| +--- cserialport.py | ||
| +--- main.py | ||
| +--- _cserialport.pyd | ||
+--- generate | ||
| +--- cserialport.py | ||
| +--- cserialportPYTHON_wrap.cxx | ||
| +--- cserialportPYTHON_wrap.h | ||
+--- README.md | ||
``` |