New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for local statically linked openssl #175
Comments
I'm thinking I might just switch from add_subdirectory to ExternalProject_Add. This would allow me to save all IXWebSocket cmake configuration until build time. I'll experiment with that, but I think add_subdirectory is most likely still the correct way for me be using ixwebsocket in a cmake project, so I'd love to be able to continue with that direction if possible. Max |
I'm not a cmake expert so I'm open to suggestions on changing this, but I'd like to follow existing patterns from 'grown ups' packages like curl.
There are existing users so we should find a way not to break them as well. One users do use ExternalProject_Add I believe, but I don't know much about it.
Here is how curl is doing it, and they have lots of similarity with this project
https://github.com/curl/curl/blob/master/CMakeLists.txt
… On Apr 2, 2020, at 2:43 PM, Max Weisel ***@***.***> wrote:
I'm thinking I might just switch from add_subdirectory to ExternalProject_Add. This would allow me to save all IXWebSocket cmake configuration until build time. I'll experiment with that, but I think add_subdirectory is most likely still the correct way for me be using ixwebsocket in a cmake project, so I'd love to be able to continue with that direction if possible.
Max
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#175 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AC2O6UPATVENK52NU36SXADRKUBJRANCNFSM4L25Q47A>.
|
Another assumption I have is that people can just 'include' the ixwebsocket folder, and thing should work.
… On Apr 2, 2020, at 2:43 PM, Max Weisel ***@***.***> wrote:
I'm thinking I might just switch from add_subdirectory to ExternalProject_Add. This would allow me to save all IXWebSocket cmake configuration until build time. I'll experiment with that, but I think add_subdirectory is most likely still the correct way for me be using ixwebsocket in a cmake project, so I'd love to be able to continue with that direction if possible.
Max
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#175 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AC2O6UPATVENK52NU36SXADRKUBJRANCNFSM4L25Q47A>.
|
afaik curl uses autoconf / make, which supports specifying an openssl path with I think the simple approach would be to look for a variable like STATIC_OPENSSL_INCLUDE if it's not present, default back to the find_package() approach. Another small change that would help would be to split the ixwebsocket and CLI targets into separate CMakeList.txt files that are all included in a root CMakeLists.txt via add_subdirectory(). Then you can use find_package() in the CLI where you need to link against system openssl, and IXWebSocket will only need to reference headers. It also means I could use add_subdirectory() on just the library instead of the whole project. Max |
It turns out that this should already be possible.
the block that deals with openssl has a way not to trigger find_package
|
At the moment CMakeLists.txt uses find_package() to find OpenSSL. Which works great if it's installed on your system. However, in my project, I already compile and link against a static library copy of openssl, so I'd like to just use those symbols for IXWebSocket.
find_package(OpenSSL) does support searching for static libraries, but this has to be done at cmake generate time which means even if my cmake project builds openssl, the static library needs to be present before I can even run
make
which is before I'd be able to compile openssl myself and so find_package(OpenSSL) will always fail.I'd love to be able to specify something like OPENSSL_INCLUDE myself. I'm compiling a static library version of ixwebsocket, so I don't even really need the project to do any linking for me. All it really needs are the headers for the openssl library I'm using in my project.
I'm happy to implement this and open a PR, I figured I'd file a github issue in case you had any opinions on how you'd like to integrate this into the project.
Max
The text was updated successfully, but these errors were encountered: