0

I am attempting to install MySql connector c++ library on my Mac OS, but when I try to configure it as such:

cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/connector-c++-8.0 

I get the following error in the middle:

Configuring CDK as part of MySQL_CONCPP project
-- Looking for SSL library.
CMake Error at cdk/cmake/DepFindSSL.cmake:79 (message):
 Cannot find appropriate system libraries for SSL.  Make sure you've
  specified a supported SSL version.  Consult the documentation for WITH_SSL
 alternatives
Call Stack (most recent call first):
 cdk/cmake/DepFindSSL.cmake:354 (main)
  cdk/cmake/dependency.cmake:42 (include)
 cdk/CMakeLists.txt:96 (find_dependency)


-- Setting up Protobuf.

Documentation for WITH_SSL option suggests I put in a path, but I have no clue what to put in

https://dev.mysql.com/doc/connector-cpp/8.0/en/connector-cpp-source-configuration-options.html#option_cmake_with_ssl

Bamaco
  • 592
  • 9
  • 25

1 Answers1

1

I ended up following @pptaszni suggestion and used brew to re-install openssl into a safe location

$ brew install openssl

Then I used the path as follow

$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/connector-c++-8.0 -DWITH_SSL=/usr/local/Cellar/openssl@1.1/1.1.1k  -DBUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Debug
$ cmake --build . --config Debug
$ sudo cmake --build . --target install --config Debug

And the library installed properly.

Bamaco
  • 592
  • 9
  • 25
  • 1
    Your commands are slightly wrong. If you're using a single-config generator by default (like Makefiles) then `--config ...` is not needed and you're missing `-DCMAKE_BUILD_TYPE=Debug` in your first command. Otherwise, the build type names are case-sensitive and you need `--config Debug` instead. See [here](https://stackoverflow.com/questions/67425557/how-do-i-build-a-cmake-project) for more details. – Alex Reinking Aug 20 '21 at 22:37