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 cmake nghttp2 support #922
Conversation
@remoe, thanks for your PR! By analyzing the annotation information on this pull request, we identified @Sukender, @jzakrzewski and @billhoffman to be potential reviewers |
find_path(NGHTTP2_INCLUDE_DIR "nghttp2/nghttp2.h" | ||
HINTS ${NGHTTP2_DIR}/include ${NGHTTP2_DIR}/inc) | ||
|
||
find_library(NGHTTP2_LIBRARY_RELEASE NAMES NGHTTP2LIB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name should be lowercase to work on case-sensitive filesystems (Linux).
@bradking is this appropriate use of select_library_configurations
in a FindXXX.cmake file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
Please see cmake-developer(7) for documentation of find module variable names. The |
@bagder , ready to merge ? |
I'll await a |
nghttp2 (in
Note the lower-case |
I've tested it on windows. I prefer not to use global settings like CMAKE_* for paths on windows. About the names: you're right, it could this doesn't find the library on linux. |
How did you build nghttp2 on Windows? Using its cmake system, the lib/Makefile.msvc or something else? CMAKE_LIBRARY_PATH and friends are supposed to be set by the user (e.g. using cmake-gui), are you avoiding them because you find it more convenient to set a single |
I've build nghttp2 1.12.0 with CMake on Windows. |
@Lekensteyn's comments still need to be addressed:
|
@Lekensteyn , @bradking thanks. |
|
||
find_path(NGHTTP2_INCLUDE_DIR "nghttp2/nghttp2.h") | ||
|
||
find_library(NGHTTP2_LIBRARY NAMES nghttp2 libnghttp2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMake does automatically add a lib
prefix when searching on platforms that use it. This can be just
find_library(NGHTTP2_LIBRARY NAMES nghttp2)
|
||
find_package_handle_standard_args(NGHTTP2 | ||
FOUND_VAR | ||
NGHTTP2_FOUND |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FOUND_VAR NGHTTP2_FOUND
is the default so you could omit that
Change looks good, I'll give this a test on Linux. Oh, and please use Unix line endings in FindNGHTTP2.cmake |
This fails to build if nghttp2 is not installed. Maybe use |
@Lekensteyn @bagder I've tested it now with USE_NGHTTP2 ON/OFF. Windows (win64 VS2015) curl binary version dump with OFF:
Version dump with ON:
|
And does it now also work fine to build even if nghttp2 is not installed/found? @Lekensteyn remarked on that on Sep 6. |
yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current patch looks good for merging.
option(USE_NGHTTP2 "Use Nghttp2 library" OFF) | ||
if(USE_NGHTTP2) | ||
find_package(NGHTTP2 REQUIRED) | ||
if(NGHTTP2_FOUND) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is strictly not necessary since you have REQUIRED for find_package.
Thanks a lot @remoe for your hard work on this. Squashed and merged now! |
I tested this PR, works like a charm. However, of the latest stable release, the provided source code zip file is incomplete. It does not contain all CMake Modules required and available in git. Seems to be a simple packaging error.. Thanks for the good job! |
@TDannhauer What's missing? I see FindCARES.cmake and FindLibSSH2.cmake are not in the release and should be added to CMAKE_DIST. Is there anything else? Do you want to take a shot at a PR? |
The package as defined in CMAKE_DIST contains CMake/CMakeConfigurableFile.in However, the package did not contain: Additionally we have two missing files: CMake/FindCARES.cmake Finally, we need also the brand new CMake/FindNGHTTP2.cmake, which was added with the PR of this thread. |
CurlSymbolHiding issue was fixed in 82279c8 which was after 7.50.3 was released. The three missing files I agree. Do you want to open a PR with those changes? |
Ah thanks. I will try, I'm not used to the workflow, so it will be a fight against gihub, give me some minutes. :) |
Do I need to make the PR in master branch oder another branch? sorry, I'm not used to it.... |
The easiest way is if you make a new branch dedicated for that fix only and you make a PR from that. That way you can update that individually if needed and you can delete it once the PR gets merged. |
Hm thanks.. Way back to the basics: What should I use? GitHub desktop, or Web interface?
What might be the mistake? Hmpf. the Github doc is very confusing for SVN guys without git experience... |
Is this repos a shared model approach, or do I need to fork? Thanks for the baby sitting ;) |
Basically when you are working in git branches are cheap so you can just create a bunch of them. Your failure message may be because you are attempting to push directly upstream (here) and not to your origin (your fork of curl). The way you submit changes is push them to a branch in your fork and then when you go to your curl fork in github you will see the changes you have just pushed with a button "create pull request". So first you need to go to the top of our project page and click the fork button and that will put a fork of the curl repo on your account, and then in the local repo:
What gets kind of confusing is though 'upstream' is a typical name for the canonical repo you set a branch "upstream" meaning where you want it to land, which in this case is your fork 'origin'. Also read https://github.com/curl/curl/blob/master/docs/CONTRIBUTE.md |
Hm, I hope I did it right: #1070 |
No description provided.