-
Notifications
You must be signed in to change notification settings - Fork 958
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 ability to install library and headers through CMake #191
Comments
At the moment, there is no (convenient) way to install cpr system-wide which makes it hard to package. But changing this might introduce a couple new problems and makes the whole solution more complex so I am not sure if it is worth it if there is another way (but by doing so it would be possible to switch curl installation via a cmake option I guess). |
Well, installation would still be nice in the cases where for instance system curl is used (which would be done if you wanted to package CPR for debian etc…). |
Debian and Archlinux packages would be appreciated nice. |
https://github.com/sroycode/identt/blob/master/src/cpr/CMakeLists.txt |
Dear developer, I have built CPR successfully, however I have no idea - being quite new to the c\c++ world - how to use it. "sudo make install" just copies curl into usr/local.. I see there are already open issues, so opening one seems to be the wrong way to go about it. Instead, could you provide simple instructions on how to include CPR in one's project? You currently mention git subdirectory and cmakelists, but not everyone has his project under versioning, or is using cmake. Thanks a lot! |
You are not finding this include, what should I do? Please, can anyone help me? Could not find OpenSSL, try to set the path to OpenSSL root folder in the I have already added openssl to the project, but I can not configure it in CMALKELIST. |
Hi:
Regards |
That's awesome! Thank you! |
Hello, I encountered another problem: Debug Result: /Applications/CLion.app/Contents/bin/cmake/bin/cmake -DCMAKE_BUILD_TYPE = Debug -G "CodeBlocks - Unix Makefiles" / Users / samuelkarlos / Downloads / testCmake
[Finished] I added add_subdirectory (cpr) to my CMAKELIST. How to solve this? Please |
Hello, I was able to solve the above problem, but I came across another problem ... /Applications/CLion.app/Contents/bin/cmake/bin/cmake --build / Users / samuelkarlos / Downloads / testCmake --target testCmake - -j 4 Here is my sample code: #include int main (int argc, char ** argv) { auto r = cpr :: Get (cpr :: url {"http://www.httpbin.org/get"), |
Have you tried the hunter approach? It is full CMake approach. https://github.com/ruslo/hunter/tree/master/examples/cpr |
we had to add Can we just add that routine for the case one uses system lib? Because for that case its that easy. |
I do not want a submodule. apparently the proj i am working on has all compiled deps system wide and i do not want just this perticular library as a submodule. Trying to install system wide:
From the root of the project:
Gives me an error:
|
It's telling you right there that you're missing two CMake variables in your CMakeLists.txt (root one): CPR_LIBRARY and CPR_INCLUDE_DIR. So add this before the find() or find_package() or whatever:
If you've already set CPR_DIR, then you can just use that macro as a path reference. Mine looks like this:
|
Should be fixed in #645 |
There are three competing pull requests right now that implement this. My laziness has unfortunately resulted in some duplicate work 😥 .
#176
#132
#56
Unbiased discussion on the pros and cons of each approach would be appreciated. The immediate goal is to make
make install
in a sane way. The long term goal is to make packaging the library (for something like Homebrew for instance) feasible so it can be distributed without git.The text was updated successfully, but these errors were encountered: