-
Notifications
You must be signed in to change notification settings - Fork 8
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
Start to modernize the code #4
base: main
Are you sure you want to change the base?
Conversation
@ClausKlein please do not use cmake-format in this repo. The CMake files are formatted like they are so they match the style presented in the book. |
@ClausKlein i generally use the llvm style. |
Is the book already published? If so, is it planned to continue with a 3th edition? I would have a lot of suggestions to improve the examples:
|
Yes, the second edition of the book was published on August 30th 2024 and should hit the stores in the next few weeks. However, I we gladly take up the feedback for an eventual 3rd edition. At the moment this is not planned and it depends on a few factors if a 3rd edition will happen or not. If it is OK, I would contact you directly as a reviewer to include you into the writing process directly. Creating a new edition takes ~half a year, so we're unfortunately always missing out the latest features. To your input:
This is one of the features that has great potential to become a best practice, at the time of the rewrite there was not yet an established way of using file sets that would make us confident to write them as a preferred way of handling source files. I expect that to change for the next edition, especially if C++ modules are also firmly established by then.
Where to enforce code formatting is somewhat controversial. My personal stance is that code formatting does not belong into the build process, but either into the IDE, commit rule or into CI. So I don't consider using CMake to format the code a good practice.
Good idea, this belongs into CI/CD or me, will add it there.
The focus of the book and the repo is to show CMake features not C++ language features, with the possible exception of modules. Handling of modules was not yet mature enough at the time of writing.
the examples in the book are tailored to conan 2 with using conan as dependency provider as the preferred way to interact with CMake. Are we missing something specific?
This was considered, but not done for lack of time.
Good idea, this should go into CI/CD or into a commit hook.
See the focus of the book, but nothing prevents us from applying it. |
You may have a look at https://github.com/ClausKlein/cmake-init-modules It prepare/have most of the features. P.S.: the conan example is commented out. And the git module |
Do you know https://github.com/TheLartians/Format.cmake ? |
@bernedom what is your preferred c++ code style?
I have prepared a .lang-format config file as proposal.
You may see the result at ClausKlein#1