Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
melode11 committed Apr 9, 2015
1 parent 2eb2a30 commit 1a3e792
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 28 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ By virtue of being written in C++, this client works in several different platfo
- Similar API to the Socket.IO JS client

## How to use
### With CMake
<a name="with_cmake"></a>### With CMake
1. Install boost, see [Boost setup](#boost_setup) section.
2. Use `git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git` to clone your local repo.
3. Run `cmake -DBOOST_PATH:STRING=<your boost install folder> -DBOOST_VER:STRING=<your boost version> ./`
4. Run `make install`(if makefile generated) or open generated project (if project file generated) to build.
5. Find headers and lib under `./build`, link with the static lib and include `sio_client.h` in your client code where you want to use it.
5. Outputs is under `./build`, link with the all static libs under `./build/lib` and include headers under `./build/include` in your client code where you want to use it.

*If you're using boost without install,you can specify `boost include dir` and `boost lib dir` separately by:*
```bash
Expand Down
5 changes: 3 additions & 2 deletions examples/QT/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Demo shot](https://cldup.com/K2wREmuErz.png)
![Demo shot](https://cldup.com/LNmXuFu2tu.gif)

In this tutorial we’ll learn how to create a QT chat application that communicates with a [Socket.IO Node.JS chat server](https://github.com/Automattic/socket.io/tree/master/examples/chat).

Expand Down Expand Up @@ -302,5 +302,6 @@ void MainWindow::SendBtnClicked()
```

###Further reading
If you want to learn more, I recommanded you to look into the [Demo project](https://github.com/socketio/socket.io-client-cpp/tree/master/examples/QT/SioChatDemo) for other features.
You can run [Demo project](https://github.com/socketio/socket.io-client-cpp/tree/master/examples/QT/SioChatDemo) to have a closer look.
Before running, please follow the [instructions](../../README.md#with_cmake) to make the sioclient library.

31 changes: 7 additions & 24 deletions examples/QT/SioChatDemo/SioChatDemo.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,20 @@ CONFIG+=c++11

SOURCES += main.cpp\
mainwindow.cpp \
../../../src/sio_client.cpp \
../../../src/sio_socket.cpp \
../../../src/internal/sio_packet.cpp \
../../../src/internal/sio_client_impl.cpp \
nicknamedialog.cpp

HEADERS += mainwindow.h \
../../../src/sio_client.h \
../../../src/sio_message.h \
../../../src/sio_socket.h \
../../../src/internal/sio_packet.h \
../../../src/internal/sio_client_impl.h \
nicknamedialog.h

FORMS += mainwindow.ui \
nicknamedialog.ui

CONFIG(debug, debug|release):DEFINES +=DEBUG=1

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../iOS/SioChatDemo/boost/osx/build/x86_64/release/ -lboost
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../iOS/SioChatDemo/boost/osx/build/x86_64/debug/ -lboost
else:unix: LIBS += -L$$PWD/../../iOS/SioChatDemo/boost/osx/build/x86_64/ -lboost

INCLUDEPATH += $$PWD/../../iOS/SioChatDemo/boost/src/boost_1_55_0
INCLUDEPATH += $$PWD/../../../lib/rapidjson/include
INCLUDEPATH += $$PWD/../../../lib/websocketpp
INCLUDEPATH += $$PWD/../../../src
DEPENDPATH += $$PWD/../../iOS/SioChatDemo/boost/src/boost_1_55_0

win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../iOS/SioChatDemo/boost/osx/build/x86_64/release/libboost.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../iOS/SioChatDemo/boost/osx/build/x86_64/debug/libboost.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../iOS/SioChatDemo/boost/osx/build/x86_64/release/boost.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../iOS/SioChatDemo/boost/osx/build/x86_64/debug/boost.lib
else:unix: PRE_TARGETDEPS += $$PWD/../../iOS/SioChatDemo/boost/osx/build/x86_64/libboost.a
LIBS += -L$$PWD/../../../build/lib/ -lsioclient
LIBS += -L$$PWD/../../../build/lib/ -lboost_system
LIBS += -L$$PWD/../../../build/lib/ -lboost_date_time
LIBS += -L$$PWD/../../../build/lib/ -lboost_random

INCLUDEPATH += $$PWD/../../../build/include
DEPENDPATH += $$PWD/../../../build/lib

0 comments on commit 1a3e792

Please sign in to comment.