Replies: 9 comments 15 replies
-
There is no such thing as "using CMake directly", as opposed to "not using it directly". The CMake build has basically 3 stages:
Steps 1 and 2 are typically though of as a single step, especially because CMake does both sequentially when the user is "configuring". That's why at the end of a CMake "configuration" you see "Configuring done. Generating done". CMake itself never actually "builds" (in the sense of generating object files from source code) your project. Ninja just happens to be the better option to choose as a generator the vast majority of the time. You can certainly control the verbosity of the generated ninja build file, and one thing that's also exceptionally useful is to use That being said, I agree that the advice should be consistent. We should always recommend and assume Ninja by default, but also mention that anyone can choose a different generator, if they need to. Apple may still be an exception to this rule, since their closed-down
For cross-compiling, you probably want to look into CMake toolchain files (e.g. |
Beta Was this translation helpful? Give feedback.
-
Since qbittorrent is difficult to build in the best of circumstances I think a verbose and easy to debug method should be first with the fine tuning applied after. If I use cmake without ninja the output I generally a bit more verbose and more helpful. That is what I noticed. Once I have it working it's ok to apply ninja, even though I need to build it on alpine since there is no release past version 3.11 for some reason. I was considering if I needed to make a toolchain file but right now I don't need it. The alpine toolchain works as long as I use Also, I found out that when making a release the bin are not stripped. I need to do this to have my binaries stripped and be comparable to the qmake builds in size. I think the strip options should be in the docs.
|
Beta Was this translation helpful? Give feedback.
-
Also, this is a problem. I must create this path as root.
It's related to this line specifically https://github.com/qbittorrent/qBittorrent/blob/master/src/CMakeLists.txt#L17 If this directory does not exist, cmake bugs out. |
Beta Was this translation helpful? Give feedback.
-
Ok, so i better understand that issue. This line https://github.com/qbittorrent/qBittorrent/blob/master/src/CMakeLists.txt#L3 is returning I can resolve this by creating my pkg config but really it's odd that it's not finding the lib |
Beta Was this translation helpful? Give feedback.
-
1: It would make sense to factor those options into the build doc so users unfamiliar with using cmake or building in general are using verbose and helpful options by default. 2: The stripping should be included by default other simply doing 3: The problem (debian based or alpine btw) is that when you use libtorrent's recommended and documented build system
And I create it like this
I have asked about it here arvidn/libtorrent#6211 But either way you need to appreciate that using the 4: Really the main oddness with building fully static and not relying on package config file is you need to pass the libs to the linked manually. The creates situations with the built in checks/config doing one thing and the build does another. To be honest it really makes things odd as you can have failures to config with successful builds and vice versa. |
Beta Was this translation helpful? Give feedback.
-
For the doc i think this info will be very handy https://cliutils.gitlab.io/modern-cmake/chapters/features/debug.html specifically these kind of commands. These help me understand the This is particularly helpful, to get a specific search.
And this
Realistically when we are talking about building qbittorrent this is what we are looking at and it is complicated. Build systems links
Dependency relationships
I have mostly resolved these issues for my build process now. |
Beta Was this translation helpful? Give feedback.
-
I stuck my graph in here instead as i could not get a similar output from graphiz https://www.yworks.com/yed-live/. |
Beta Was this translation helpful? Give feedback.
-
I'll try to work up some of the points raised and draft some wiki edits to see what you think towards making the cmake docs a bit better but it won't be super quick. I'll give it a try though. |
Beta Was this translation helpful? Give feedback.
-
I have been looking at using cmake with my script and whilst i have an ok understanding of the process and can build with consistent outcomes but I have one particular question regarding an inconsistent usage of cmake ninja build in the wiki.
What is the verdict on whether ninja should be installed and used by default or explained as an optional step in all cmake related build guides?
The reasoning behind this question is as follows.
When I looked across the available guides ( to be clear this is not a complaint about the guides they were very helpful ) i found this inconsistent usage:
Common Info - It's optional and recommend here
Debian and Ubuntu - It's used and assumed default with no context here
OSX - It's not used at all here and the build process is different for it
I found the OSX build process more helpful to understand as it was just using cmake directly and it was easier to troubleshoot as the ninja build method is very quiet by default. Adding this make it more verbose if needed and works for with or without ninja.
It's not a big deal but I think I would have found it easier if there was a more consistent build method across platforms as well as perhaps ninja being a recommended once you have a working , verbose cmake build process. I think this would make it easier for a cmake novice to get up and running and troubleshoot problems easier.
Then apply ninja build to get the faster build.
So working on Alpine using cross building I am doing something this.
Beta Was this translation helpful? Give feedback.
All reactions