2

I want to install Socket.IO C++ Client from https://github.com/socketio/socket.io-client-cpp, but I have some difficulties following the steps from https://github.com/socketio/socket.io-client-cpp/blob/master/INSTALL.md. I have successfully installed Boost version 1_73_0 (step 1) and run step 2. Boost is installed at /Users/Home/Documents/boost_1_73_0. The socket.io C++ client is at /Users/Home/Documents/socket.io-client-cpp

When I run step 3 with this code:

(base) MacBook-Pro-7:socket.io-client-cpp Home$ cmake -DBOOST_ROOT:STRING=/Users/Home/Documents/boost_1_73_0 -DBOOST_VER:STRING=1_73_0 ./

I receive the following error:

-- not define build type, set to release
CMake Error at CMakeLists.txt:23 (find_package):
  find_package called with invalid argument "1_73_0"


-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR) 
-- Configuring incomplete, errors occurred!
See also "/Users/Home/Documents/GitHub/socket.io-client-cpp/CMakeFiles/CMakeOutput.log".

I tried to install openssl with brew install openssl in the directory as well, but I still receive the same error. I would appreciate it if you clarify what should I do.

Kevin
  • 16,549
  • 8
  • 60
  • 74
UnesBeig19
  • 37
  • 4

1 Answers1

2

The contents of the BOOST_VER cache variable in the cmake command line are provided to CMake's find_package command as an argument:

1_73_0

However, per the find_package documentation, the format must use periods to separate the version components:

The [version] argument requests a version with which the package found should be compatible (format is major[.minor[.patch[.tweak]]])

Just change the cmake command line to conform to the required version format:

cmake -DBOOST_ROOT:STRING=/Users/Home/Documents/boost_1_73_0 -DBOOST_VER:STRING=1.73.0 ./
Kevin
  • 16,549
  • 8
  • 60
  • 74
  • Many thanks to @squareskittles. But now I receive this error: `-- not define build type, set to release` + along list of searched files + `-- Configuring incomplete, errors occurred! See also "/Users/Home/Documents/GitHub/socket.io-client-cpp/CMakeFiles/CMakeOutput.log".` I checked many posts but none of them where useful. they just to include -DBOOST_LIBRARYDIR= or -DBoost_DEBUG=ON which is not helpful. – UnesBeig19 Aug 03 '20 at 20:46
  • @YounesValibeigi I'm not sure about this error, it may be worth writing a new question about it. With regards to the OpenSSL issue, you may just need to install openssl (which you've tried), then point CMake to where openssl was installed on your system, as suggested in the response [here](https://stackoverflow.com/a/41375186/3987854). – Kevin Aug 03 '20 at 22:02