Learning and using fdbus

Posted by Scriptor on Tue, 30 Jun 2020 06:48:29 +0200

1: fdbus address

https://github.com/jeremyczhen/fdbus

2: build fdbus (ubuntu environment)

cd ~/workspace
git clone https://github.com/jeremyczhen/fdbus.git #get fdbus source code
cd fdbus;mkdir -p build/install;cd build #create directory for out-of-source build
cmake -DCMAKE_INSTALL_PREFIX=install ../cmake
make install

3: Build FDBus example (depends on protobuf) for Ubuntu

  • Compile protobuf first
cd ~/workspace
git clone https://github.com/protocolbuffers/protobuf.git #get protobuf source code
cd protobuf;git submodule update --init --recursive
mkdir -p build/install;cd build #create directory for out-of-source build
cmake -DCMAKE_INSTALL_PREFIX=install -DBUILD_SHARED_LIBS=1 ../cmake
make -j4 install #build and install to build/install directory

This depends on git information. git clone on my side has failed all the time. There is a protobuf software package with. Git information in my file, which can be downloaded and used

If the network doesn't work well, it doesn't work

git submodule update --init --recursive

Then execute:

cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=install -DBUILD_SHARED_LIBS=1 ../cmake

 

  • Recompile example

The readme of fdbus is as follows:

cd ~/workspace/fdbus;mkdir -p build-example/install;cd build-example #create directory for out-of-source build
cmake -DSYSTEM_ROOT=~/workspace/protobuf/build/install;~/workspace/fdbus/build/install -DCMAKE_INSTALL_PREFIX=install ../cmake
PATH=~/workspace/protobuf/build/install/bin:$PATH make install #set PATH to the directory where protoc can be found

But I have the following question:

cmake -DSYSTEM_ROOT="/home/ubuntu16/Desktop/work/FDbus/protobuf/build/install;/home/ubuntu16/Desktop/work/FDbus/fdbus/build/install" -DCMAKE_INSTALL_PREFIX=install  ../cmake/pb-example/
PATH=/home/ubuntu16/Desktop/work/FDbus/protobuf/build/install/bin:$PATH make install

../cmake/pb-example/
For the cmake path of example, you can check the cmake confirmation

The compiled test file can be run directly. Note that some test examples need to pass in parameters when running. In addition, the log of some test cases is not output to the logviewer. For the moment, I will add printf to check the running effect of the example

Topics: cmake git github Ubuntu