-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
Installing Crow #160
Comments
I think that there is merit to multiple headers, but it is difficult right now. As is, getting updates is a non-automated process in many projects. Making Crow work with FetchContent would help a lot too. |
well the idea behind this issue is whether single or multi header, the user either manually or automatically (through a package manager) installs crow on their system and just references it without having a to download the headers for each project. |
I guess having multiple headers should be no problem. Vcpkg doesn't use Maybe the amalgamation should be made accessible via an option. nlohmann/json is doing a similar thing. I could look into providing FetchContent support and a non-amalgamated target. |
@luca-schlecker Sorry for the late response, I was doing some research. I think a non-amalgamated target for install is a really good idea. FetchContent isn't a bad addition either. So by the time this issue closes, we should have the following:
|
Exactly what I've though. 👍 I'll have a look at the first three points. 🚀 |
I appreciate the help :) |
I guess installing the amalgamated |
That's sort of what I had in mind, any install, through PM or CMake would install all headers, and keep crow_all for manual installation (small projects and such) |
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
See CrowCpp#160 for more info.
To make this support even more Fetch Content ready, could sensible default values for the configuration be used? In particular tests and stuff disabled by default? This doesn't mean that Tests have to be OFF by default, one can just build a protection, so that test get disabled if it's not the top level source project: Something like Furthermore, I would also suggest using |
That's a good suggestion. I'd like to keep |
Since CMake generates |
Well, to properly consume the compiled archive ( |
I understand, my concern is someone installing Crow through AUR or manually then later on wanting to use CMake, specifically for the AUR install, they would need to uninstall and reinstall the package, which is less than ideal. |
I am sorry, I don't quite understand. Could you please elaborate? |
The way AUR (or pacman) works is that it downloads a package from source then runs 1 or more shell scripts, since the cmake files (Config and Targets) need to be generated using CMake, one would need to have CMake installed in order to get these files. The simple solution is to only attempt to use CMake if it is already installed on the system, but this means that a user installing Crow before CMake would not have these files. And would only have them if they uninstalled and reinstalled the package. Providing a package with the CMake files fixes this problem by not relying on CMake at all during installation, instead just copying the files to where they need to be ( |
Update on this matter, I added the |
@luca-schlecker adding Update: I got it working by adding Update 2: I also needed to add |
I had a short look and I know where the problem is coming from. I'll fix it in a PR hopefully this afternoon/evening. 👍 |
@The-EDev The fix is pretty simple. diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 643e2f3e..e7bc0e61 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -49,7 +49,8 @@ if(CROW_AMALGAMATE)
add_executable(example_with_all example_with_all.cpp)
add_dependencies(example_with_all crow_amalgamated)
add_warnings_optimizations(example_with_all)
- target_include_directories(example_with_all PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
+ target_link_libraries(example_with_all PUBLIC Crow::Crow)
+ target_include_directories(example_with_all PUBLIC ${CMAKE_BINARY_DIR})
endif()
add_executable(example_chat example_chat.cpp) Linking against Crow would automatically lead to the right libraries also being linked to. |
Solution works, Thanks a lot! I'll merge ssl_test then commit your changes. This branch is getting a little too big with SSL, docs, and now the coveralls issue. I think I won't work on docs beyond the setup ones, I'll leave the extra tutorials for another PR. |
Seems like a good idea. 👍 |
See CrowCpp#160 for more info.
With the work on vcpkg and different Linux package managers, Crow can now be installed rather than just included in the downstream project.
The idea has often been to just use
crow_all.h
which probably works for small projects, but I'm not sure about larger ones, since a larger project might want to use certain components in one source file and not others. (I might be wrong here and a single header is all that is actually needed, please correct me if so)So the first question is: Should crow by default be installed as a set of header files or just the single header file?
This will shape how the documentation and releases are made moving forward.
The text was updated successfully, but these errors were encountered: