add install to cmake

This commit is contained in:
Ryo Nakamura
2022-10-30 17:58:56 +09:00
parent abd6bf2bbf
commit 2bcbdd2292
2 changed files with 14 additions and 7 deletions

View File

@@ -8,3 +8,8 @@ add_executable(mscp src/main.c src/platform.c src/ssh.c src/file.c src/pprint.c)
target_include_directories(mscp PUBLIC ./src /usr/local/include) target_include_directories(mscp PUBLIC ./src /usr/local/include)
target_link_directories(mscp PUBLIC /usr/local/lib) target_link_directories(mscp PUBLIC /usr/local/lib)
target_link_libraries(mscp ssh pthread m) target_link_libraries(mscp ssh pthread m)
install(TARGETS mscp
RUNTIME DESTINATION bin
)

View File

@@ -28,21 +28,23 @@ Clone and build this repositoy.
```console ```console
git clone https://github.com/upa/mscp.git git clone https://github.com/upa/mscp.git
cd mscp cd mscp
mkdir build mkdir build
cd build cd build
cmake .. cmake ..
make make
```
# install the mscp binary to CMAKE_INSTALL_PREFIX/bin (usually /usr/local/bin)
make install
```
## Run ## Run
- Usage - Usage
```shell-session ```shell-session
./mscp -h $ mscp -h
mscp: copy files over multiple ssh connections mscp: copy files over multiple ssh connections
Usage: mscp [CvqDdh] [-n nr_conns] [-s min_chunk_sz] [-S max_chunk_sz] Usage: mscp [CvqDdh] [-n nr_conns] [-s min_chunk_sz] [-S max_chunk_sz]
@@ -74,7 +76,7 @@ Usage: mscp [CvqDdh] [-n nr_conns] [-s min_chunk_sz] [-S max_chunk_sz]
- Two Intel Xeon Gold 6130 machines directly connected with Intel E810 100Gbps NICs. - Two Intel Xeon Gold 6130 machines directly connected with Intel E810 100Gbps NICs.
```shell-session ```shell-session
$ ./mscp /tmp/test.img 10.0.0.1:/tmp/ $ mscp /tmp/test.img 10.0.0.1:/tmp/
[===============================================================] 100% 8GB/8GB 3.02GB/s [===============================================================] 100% 8GB/8GB 3.02GB/s
$ $
``` ```
@@ -82,10 +84,10 @@ $
- `-v` options increment verbose output level. - `-v` options increment verbose output level.
```shell-session ```shell-session
$ ./mscp test 10.0.0.1: $ mscp test 10.0.0.1:
[===============================================================] 100% 13B/13B 2.41KB/s [===============================================================] 100% 13B/13B 2.41KB/s
$ ./mscp -v test 10.0.0.1: $ mscp -v test 10.0.0.1:
file test/test.txt (local) -> ./test/test.txt (remote) 9B file test/test.txt (local) -> ./test/test.txt (remote) 9B
file test/test2/2.txt (local) -> ./test/test2/2.txt (remote) 2B file test/test2/2.txt (local) -> ./test/test2/2.txt (remote) 2B
file test/1.txt (local) -> ./test/1.txt (remote) 2B file test/1.txt (local) -> ./test/1.txt (remote) 2B
@@ -97,7 +99,7 @@ copy done: test/test2/2.txt
copy done: test/test.txt copy done: test/test.txt
[===============================================================] 100% 13B/13B 2.51KB/s [===============================================================] 100% 13B/13B 2.51KB/s
$ ./mscp -vv -n 4 test 10.0.0.1: $ mscp -vv -n 4 test 10.0.0.1:
connecting to 10.0.0.1 for checking destinations... connecting to 10.0.0.1 for checking destinations...
file test/test.txt (local) -> ./test/test.txt (remote) 9B file test/test.txt (local) -> ./test/test.txt (remote) 9B
file test/test2/2.txt (local) -> ./test/test2/2.txt (remote) 2B file test/test2/2.txt (local) -> ./test/test2/2.txt (remote) 2B