Skip to content

Commit e0d6623

Browse files
committed
move sio_packet to internal,update cmake script
1 parent 7a884dc commit e0d6623

File tree

10 files changed

+29
-21
lines changed

10 files changed

+29
-21
lines changed

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ PROJECT(sioclient)
33

44
set(BOOST_VER "1.55.0" CACHE STRING "boost version" )
55
set(BOOST_PATH "__boost__" CACHE STRING "boost root path" )
6+
set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++" )
67

78
if(${BOOST_PATH} STREQUAL "__boost__" )
89
set(BOOST_INCLUDE "__boost__" CACHE STRING "boost include path" )
@@ -31,7 +32,15 @@ find_package(Boost ${BOOST_VER} COMPONENTS system date_time random)
3132
if(Boost_FOUND)
3233
include_directories(${Boost_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/lib/websocketpp ${PROJECT_SOURCE_DIR}/lib/rapidjson/include)
3334
aux_source_directory(${PROJECT_SOURCE_DIR}/src ALL_SRC)
34-
MESSAGE( STATUS "SRC FILES: " ${ALL_SRC} )
35+
aux_source_directory(${PROJECT_SOURCE_DIR}/src/internal ALL_SRC)
36+
file(GLOB ALL_HEADERS ${PROJECT_SOURCE_DIR}/src/*.h )
37+
MESSAGE(STATUS ${ALL_HEADERS} )
3538
add_library(sioclient STATIC ${ALL_SRC})
3639
target_link_libraries(sioclient ${Boost_LIBRARIES})
40+
INSTALL(FILES ${ALL_HEADERS}
41+
DESTINATION "${PROJECT_SOURCE_DIR}/build/include"
42+
)
43+
INSTALL(TARGETS sioclient
44+
DESTINATION "${PROJECT_SOURCE_DIR}/build/lib"
45+
)
3746
endif()

examples/QT/SioChatDemo/SioChatDemo.pro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ CONFIG+=c++11
1717
SOURCES += main.cpp\
1818
mainwindow.cpp \
1919
../../../src/sio_client.cpp \
20-
../../../src/sio_packet.cpp \
2120
../../../src/sio_socket.cpp \
21+
../../../src/internal/sio_packet.cpp \
2222
../../../src/internal/sio_client_impl.cpp \
2323
nicknamedialog.cpp
2424

2525
HEADERS += mainwindow.h \
2626
../../../src/sio_client.h \
2727
../../../src/sio_message.h \
28-
../../../src/sio_packet.h \
2928
../../../src/sio_socket.h \
29+
../../../src/internal/sio_packet.h \
3030
../../../src/internal/sio_client_impl.h \
3131
nicknamedialog.h
3232

examples/iOS/SioChatDemo/SioChatDemo.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
CE1D31A01AD5087800895150 /* sio_packet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE1D319E1AD5087800895150 /* sio_packet.cpp */; };
11+
CE1D31A11AD5087800895150 /* sio_packet.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1D319F1AD5087800895150 /* sio_packet.h */; };
1012
CE2958691ACE4589000ABD30 /* sio_client_impl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE2958671ACE442F000ABD30 /* sio_client_impl.cpp */; };
1113
CE29586A1ACE4592000ABD30 /* sio_socket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE2958621ACE2CD6000ABD30 /* sio_socket.cpp */; };
1214
CE3B3B401AC8F365003CEB94 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE3B3B3F1AC8F365003CEB94 /* main.m */; };
@@ -21,8 +23,6 @@
2123
CE3B3E8C1ACA5446003CEB94 /* sio_client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE3B3E871ACA5446003CEB94 /* sio_client.cpp */; };
2224
CE3B3E8D1ACA5446003CEB94 /* sio_client.h in Headers */ = {isa = PBXBuildFile; fileRef = CE3B3E881ACA5446003CEB94 /* sio_client.h */; };
2325
CE3B3E8E1ACA5446003CEB94 /* sio_message.h in Headers */ = {isa = PBXBuildFile; fileRef = CE3B3E891ACA5446003CEB94 /* sio_message.h */; };
24-
CE3B3E8F1ACA5446003CEB94 /* sio_packet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE3B3E8A1ACA5446003CEB94 /* sio_packet.cpp */; };
25-
CE3B3E901ACA5446003CEB94 /* sio_packet.h in Headers */ = {isa = PBXBuildFile; fileRef = CE3B3E8B1ACA5446003CEB94 /* sio_packet.h */; };
2626
/* End PBXBuildFile section */
2727

2828
/* Begin PBXContainerItemProxy section */
@@ -62,6 +62,8 @@
6262
/* End PBXCopyFilesBuildPhase section */
6363

6464
/* Begin PBXFileReference section */
65+
CE1D319E1AD5087800895150 /* sio_packet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sio_packet.cpp; sourceTree = "<group>"; };
66+
CE1D319F1AD5087800895150 /* sio_packet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sio_packet.h; sourceTree = "<group>"; };
6567
CE2958621ACE2CD6000ABD30 /* sio_socket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sio_socket.cpp; sourceTree = "<group>"; };
6668
CE2958631ACE2CD6000ABD30 /* sio_socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sio_socket.h; sourceTree = "<group>"; };
6769
CE2958661ACE2CDD000ABD30 /* sio_client_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sio_client_impl.h; sourceTree = "<group>"; };
@@ -85,8 +87,6 @@
8587
CE3B3E871ACA5446003CEB94 /* sio_client.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sio_client.cpp; sourceTree = "<group>"; };
8688
CE3B3E881ACA5446003CEB94 /* sio_client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sio_client.h; sourceTree = "<group>"; };
8789
CE3B3E891ACA5446003CEB94 /* sio_message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sio_message.h; sourceTree = "<group>"; };
88-
CE3B3E8A1ACA5446003CEB94 /* sio_packet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sio_packet.cpp; sourceTree = "<group>"; };
89-
CE3B3E8B1ACA5446003CEB94 /* sio_packet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sio_packet.h; sourceTree = "<group>"; };
9090
/* End PBXFileReference section */
9191

9292
/* Begin PBXFrameworksBuildPhase section */
@@ -126,6 +126,8 @@
126126
CE2958651ACE2CDD000ABD30 /* internal */ = {
127127
isa = PBXGroup;
128128
children = (
129+
CE1D319E1AD5087800895150 /* sio_packet.cpp */,
130+
CE1D319F1AD5087800895150 /* sio_packet.h */,
129131
CE2958661ACE2CDD000ABD30 /* sio_client_impl.h */,
130132
CE2958671ACE442F000ABD30 /* sio_client_impl.cpp */,
131133
);
@@ -228,8 +230,6 @@
228230
CE3B3E871ACA5446003CEB94 /* sio_client.cpp */,
229231
CE3B3E881ACA5446003CEB94 /* sio_client.h */,
230232
CE3B3E891ACA5446003CEB94 /* sio_message.h */,
231-
CE3B3E8A1ACA5446003CEB94 /* sio_packet.cpp */,
232-
CE3B3E8B1ACA5446003CEB94 /* sio_packet.h */,
233233
);
234234
name = src;
235235
path = ../../../src;
@@ -243,7 +243,7 @@
243243
buildActionMask = 2147483647;
244244
files = (
245245
CE3B3E8E1ACA5446003CEB94 /* sio_message.h in Headers */,
246-
CE3B3E901ACA5446003CEB94 /* sio_packet.h in Headers */,
246+
CE1D31A11AD5087800895150 /* sio_packet.h in Headers */,
247247
CE3B3E8D1ACA5446003CEB94 /* sio_client.h in Headers */,
248248
);
249249
runOnlyForDeploymentPostprocessing = 0;
@@ -419,9 +419,9 @@
419419
buildActionMask = 2147483647;
420420
files = (
421421
CE29586A1ACE4592000ABD30 /* sio_socket.cpp in Sources */,
422+
CE1D31A01AD5087800895150 /* sio_packet.cpp in Sources */,
422423
CE2958691ACE4589000ABD30 /* sio_client_impl.cpp in Sources */,
423424
CE3B3E8C1ACA5446003CEB94 /* sio_client.cpp in Sources */,
424-
CE3B3E8F1ACA5446003CEB94 /* sio_packet.cpp in Sources */,
425425
);
426426
runOnlyForDeploymentPostprocessing = 0;
427427
};

src/internal/sio_client_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "sio_client_impl.h"
1010
#include <sstream>
1111
#include <boost/date_time/posix_time/posix_time.hpp>
12-
#include "sio_packet.h"
1312
#include <mutex>
1413
// Comment this out to disable handshake logging to stdout
1514
#if DEBUG || _DEBUG
@@ -20,7 +19,8 @@
2019

2120
using boost::posix_time::milliseconds;
2221

23-
namespace sio {
22+
namespace sio
23+
{
2424
client_impl::client_impl() :
2525
m_con_state(con_closed),
2626
m_ping_interval(0),

src/internal/sio_client_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ typedef websocketpp::config::asio_client client_config;
2525
#include <map>
2626
#include <thread>
2727
#include "../sio_client.h"
28-
#include "../sio_packet.h"
28+
#include "sio_packet.h"
2929

3030
namespace sio
3131
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef __SIO_PACKET_H__
88
#define __SIO_PACKET_H__
99
#include <sstream>
10-
#include "sio_message.h"
10+
#include "../sio_message.h"
1111
#include <functional>
1212

1313
namespace sio

src/sio_client.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ using std::stringstream;
1313

1414
namespace sio
1515
{
16-
1716
client::client():
1817
m_impl(new client_impl())
1918
{

src/sio_client.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#include "sio_message.h"
1212
#include "sio_socket.h"
1313

14-
namespace sio {
15-
14+
namespace sio
15+
{
1616
class client_impl;
1717

1818
class client {

src/sio_socket.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "sio_socket.h"
2-
#include "sio_packet.h"
2+
#include "internal/sio_packet.h"
33
#include "internal/sio_client_impl.h"
44
#include <boost/asio/deadline_timer.hpp>
55
#include <boost/system/error_code.hpp>
@@ -14,8 +14,8 @@
1414
#define NULL_GUARD(_x_) \
1515
if(_x_ == NULL) return
1616

17-
namespace sio {
18-
17+
namespace sio
18+
{
1919
class event_adapter
2020
{
2121
public:

0 commit comments

Comments
 (0)