Skip to content

Commit 5d89fa0

Browse files
committed
cmake,use built-in boost path variables instead
1 parent 4ca0a6c commit 5d89fa0

File tree

3 files changed

+5
-25
lines changed

3 files changed

+5
-25
lines changed

CMakeLists.txt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,7 @@ return()
5858
endif()
5959

6060
set(BOOST_VER "1.55.0" CACHE STRING "boost version" )
61-
set(BOOST_PATH "__boost__" CACHE STRING "boost root path" )
6261

63-
if(${BOOST_PATH} STREQUAL "__boost__" )
64-
set(BOOST_INCLUDE "__boost__" CACHE STRING "boost include path" )
65-
set(BOOST_LIB "__boost__" CACHE STRING "boost lib path" )
66-
MESSAGE(STATUS "BOOST_PATH not set, find BOOST_INCLUDE and BOOST_LIB" )
67-
68-
if(${BOOST_INCLUDE} STREQUAL "__boost__" OR ${BOOST_LIB} STREQUAL "__boost__" )
69-
MESSAGE(SEND_ERROR "You need to specify either BOOST_PATH or BOOST_INCLUDE & BOOST_LIB" )
70-
return()
71-
else()
72-
MESSAGE(STATUS "got include " ${BOOST_INCLUDE} )
73-
MESSAGE(STATUS "got lib " ${BOOST_LIB} )
74-
set(BOOST_INCLUDEDIR ${BOOST_INCLUDE} )
75-
set(BOOST_LIBRARYDIR ${BOOST_LIB} )
76-
endif()
77-
else()
78-
MESSAGE(STATUS "got path " ${BOOST_PATH} )
79-
set(BOOST_ROOT ${BOOST_PATH} )
80-
endif()
81-
set(Boost_DEBUG 1)
8262
set(Boost_USE_STATIC_LIBS ON)
8363
set(Boost_USE_MULTITHREADED ON)
8464
set(Boost_USE_STATIC_RUNTIME OFF)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ By virtue of being written in C++, this client works in several different platfo
1919
###<a name="with_cmake"></a> With CMake
2020
1. Install boost, see [Boost setup](#boost_setup) section.
2121
2. Use `git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git` to clone your local repo.
22-
3. Run `cmake -DBOOST_PATH:STRING=<your boost install folder> -DBOOST_VER:STRING=<your boost version> ./`
22+
3. Run `cmake -DBOOST_ROOT:STRING=<your boost install folder> -DBOOST_VER:STRING=<your boost version> ./`
2323
4. Run `make install`(if makefile generated) or open generated project (if project file generated) to build.
2424
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.
2525

2626
* If you're using boost without install,you can specify `boost include dir` and `boost lib dir` separately by:
2727
```bash
2828
cmake
29-
-DBOOST_INCLUDE:STRING=<your boost include folder>
30-
-DBOOST_LIB:STRING=<your boost lib folder>
29+
-DBOOST_INCLUDEDIR=<your boost include folder>
30+
-DBOOST_LIBRARYDIR=<your boost lib folder>
3131
-DBOOST_VER:STRING=<your boost version>
3232
./
3333
```

test/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ You need have your boost unpacked on your disk, at least staged following module
77

88
Then use following instruction to gen makefile or VS project.
99
```bash
10-
cmake -DBOOST_LIB=`<your boost static libs path>` -DBOOST_INCLUDE=`<your boost include path>` -DBOOST_VER:STRING=`<your boost version>` -DCMAKE_BUILD_TYPE=Debug ./
10+
cmake -DBOOST_LIBRARYDIR=`<your boost static libs path>` -DBOOST_INCLUDEDIR=`<your boost include path>` -DBOOST_VER:STRING=`<your boost version>` -DCMAKE_BUILD_TYPE=Debug ./
1111
```
1212
Then run `make` or open by VS.
1313

1414
For example I've installed boost 1.57.0 at `D:\boost_1_57_0` and staged the static lib at `D\boost_1_57_0\build\lib` then the command should be:
1515
```bash
16-
cmake -DBOOST_LIB=D:\boost_1_57_0\build\lib -DBOOST_INCLUDE=D:\boost_1_57_0 -DBOOST_VER:STRING=1.57.0 -DCMAKE_BUILD_TYPE=Debug ./
16+
cmake -DBOOST_LIBRARYDIR=D:\boost_1_57_0\build\lib -DBOOST_INCLUDEDIR=D:\boost_1_57_0 -DBOOST_VER:STRING=1.57.0 -DCMAKE_BUILD_TYPE=Debug ./
1717
```
1818
In this case(Windows) CMake will create a VS project under `./test` folder. Open in VS and run it.

0 commit comments

Comments
 (0)