OS X
Adding to a new/existing project:
Include ofxLibwebsockets' xcconfig file via your project's Project.xcconfig file:
OFX_LWS_PATH = "$(OF_PATH)/addons/ofxLibwebsockets"
#include "../../../addons/ofxLibwebsockets/ofxLibwebsockets.xcconfig"
OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OFX_LWS_LIBS)
HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS)
USER_HEADER_SEARCH_PATHS = $(OFX_LWS_INCLUDES)
LIBRARY_SEARCH_PATHS = $(inherited) $(OFX_LWS_SEARCH)
Windows
Note: On Windows projects must be compiled for 64-bit to run
Via OF Project Generator
Adding to new/existing project:
Add the ofxLibwebsockets source files to the C++ Linker
..\..\..\addons\ofxLibwebsockets\libs\jsoncpp
..\..\..\addons\ofxLibwebsockets\libs\jsoncpp\json
..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\include\
..\..\..\addons\ofxLibwebsockets\libs\openssl\openssl
..\..\..\addons\ofxLibwebsockets\libs\ofxLibwebsockets\include
..\..\..\addons\ofxLibwebsockets\libs\ofxLibwebsockets\include\ofxLibwebsockets
..\..\..\addons\ofxLibwebsockets\libs\ofxLibwebsockets\src
..\..\..\addons\ofxLibwebsockets\src
..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\include\win32port
..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\include\win32port\win32helpers
Add the ofxLibwebsockets paths to the "Additional Library Directories":
..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\lib\win32\Debug
..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\lib\win32\Release
..\..\..\addons\ofxLibwebsockets\libs\libwebsockets\libs\openssl\lib\win32
Now go down to Linker > Input; open the editor "Additional dependencies" the same way
Linux
ofxLibwebsockets uses libwebsockets 1.4
brew install openssl --universal
brew link openssl --force
cd /path/to/libwebsockets
mkdir build
cd build
cmake "-DCMAKE_OSX_ARCHITECTURES=x86_64;i386" ..
make
cmake -DCMAKE_INSTALL_PREFIX:PATH=./install . && make install
cd /path/to/libwebsockets
mkdir build
cd build
cmake .. -DLWS_IPV6=OFF
make
cd /path/to/libwebsockets
mkdir build
cd build
cmake ..
make
cp lib/libwebsockets.a /path/to/ofxLibwebsocket/libs/libwebsockets/lib/linux64/
cd /path/to/libwebsockets
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/ofxLibwebsockets/extras/ios_libwebsockets/toolchain/iOS.cmake -GXcode ..
cd /path/to/your/build/folder
cp lib/Relase/libwebsockets.a /PATH/TO/OF/addons/ofxLibwebsockets/libs/libwebsockets/lib/iosarmv7/libwebsockets.a
Install OpenSSL
C:\OpenSSL-Win64
Build libwebsockets
cmake-gui.exe
build
folder inside the libwebsockets source folderVisual Studio 14 2015 Win64
from dropdown, and leave default setting of Use default native compilers
build\libwebsockets.sln
from your source folderALL_BUILD
project in Debug and Release modeswebsockets_static.lib
and ZLIB.lib
from build\lib\[Debug|Release\]
into the proper locations in ofxLibwebsockets. You don't need websockets.lib
or websockets.exp