Oh No! More Modern CMake - Deniz Bahadir - Meeting C++ 2019

  Рет қаралды 24,219

Meeting Cpp

Meeting Cpp

4 жыл бұрын

Oh No! More Modern CMake - Deniz Bahadir - Meeting C++ 2019
His CMake Talk from last year: • More Modern CMake - De...
Slides: meetingcpp.com/mcpp/slides
Survey: meetingcpp.com/mcpp/survey

Пікірлер: 17
@mapron1
@mapron1 4 жыл бұрын
I personally used object libraries until CMake 3.7-3.9 optimizations in Ninja generator, which made it more parallelizable. After that, no need for me to use them, as dependency propagation was freaked me out. One usage that comes to mind - efficient building both static and shared library on Windows, where you need different export attributes (so you can't just relink static into shared). Please share your use scenario of this beast :)
@CT7ALW
@CT7ALW 4 жыл бұрын
I want to make a note on adding header files to target_sources: For people that use the Qt library, the auto_moc only runs over header files and only on header files that are on the target_sources, so there is "positive implications" in doing so right today.
@MrSamush
@MrSamush 4 жыл бұрын
The approach of importing an external library such as boost in a sub-directory using find_package and setting the target properties to IMPORTED_GLOBAL (slide 24) won't work well if you intend to use the project as a sub-project in a super-project where other sub-projects use the same trick. Is the only viable solution to this to use the more verbose include function instead?
@alexreinking
@alexreinking 3 жыл бұрын
54:45 - I think you can `set(CMAKE_PROJECT_INCLUDE_BEFORE "")` inside of a function call that then does `FetchContent_MakeAvailable`.
@seungin-cha
@seungin-cha 4 жыл бұрын
34:00 Top-Level Project and Sub Project code is correct? my implementation and test does not find variables project_version, etc. In my case, project(MyRootProject) project(MyRootProject ...) thus, double command make it correct... Is there a mistake to me?
@Deniz.Bahadir
@Deniz.Bahadir 4 жыл бұрын
I am very sorry, but there I talked about a feature that is actually not implemented (and sadly probably will not be). Different than I originally thought the variable `CMAKE_PROJECT_INCLUDE_BEFORE` (and the similar named ones) are not loaded before the arguments of the `project` command are expanded. So this mentioned feature does sadly not work. (I thought I tested it before, but I obviously confused myself when testing that.) When I realized that (after my talk) I actually provided a merge-request to CMake's code (see: !4094 in cmake's issue-tracker) which enables the mentioned feature. However, as it seems, the maintainers of CMake are not happy with the variable expansion being deferred to after the file from `CMAKE_PROJECT_INCLUDE_BEFORE` was loaded. So, that will probably not make it into CMake. :-( However, you can still use the other way mentioned on slide 20 which explicitly `include`s the file directly before the call to `project`.
@seungin-cha
@seungin-cha 4 жыл бұрын
@@Deniz.Bahadir Thanks to your explanation very much :-)
@PedroOliveira-sl6nw
@PedroOliveira-sl6nw 3 жыл бұрын
How can I use cmake version 3.15 with Travis-CI ? The last time I checked, they were using CMake 3.12 (when running Ubuntu Bionic)
@PedroOliveira-sl6nw
@PedroOliveira-sl6nw 3 жыл бұрын
I am using VERSION 3.18.2 and for some reason CMAKE_PROJECT_INCLUDE_BEFORE is not working as described. I can set the variables and print them within the project-meta-info.in but CMake reports that "VERSION keyword not given or expands to nothing" (or something like that). And also, CMAKE_PROJECT_googletest-distribution_INCLUDE_BEFORE is not running. Anyone with the same issue?
@Ryanfriedman96
@Ryanfriedman96 Жыл бұрын
With the amount of time spent talking about the oddities of gtest CMake, he could have just issued a PR to fix em. At least it's much better nowadays in 2023. Seems so odd to me that gtest is subscribing to "Abseil Live at Head philosophy" but their CMake support is so behind.
@mizuxseiha1609
@mizuxseiha1609 4 жыл бұрын
Please note when using target_source(), you should list your "public headers" as PRIVATE and use PUBLIC_HEADER properties instead of making them INTERFACE or PUBLIC is not what you'll want to do... see: github.com/Mizux/target_sources/issues/1
@mapron1
@mapron1 4 жыл бұрын
"Use the most recent version of CMake" from the authors of "Use the most recent version of compiler" and "just always update all your 140 dependent libraries to recent versions". That's ridiculous. Are we in C++ world? Words "supporting LTS distribution" also nothing to you? What "if possible" works for? "home project"?
@Deniz.Bahadir
@Deniz.Bahadir 4 жыл бұрын
As I mentioned in the talk, CMake is very good in using backwards-compatibility. So the latest version of CMake still supports very old CMakeLists.txt files. As I showed even CMakeLists.txt files written for CMake 2.6 are still working. And getting a more modern CMake executable should also be quite easy, as Kitware provides several compiled (and statically linked) versions through its website. If, however, you are stuck with an old system for which you do not want to or cannot update your CMake executable, why bother trying to compile a project written for a more modern CMake version at all? If downloading and running a statically linked executable (CMake) is too much of a hassle then compiling a modern project is probably too much to ask for.
@anthonyvays5786
@anthonyvays5786 4 жыл бұрын
it's a generator. no reason you should use an old version.
@CT7ALW
@CT7ALW 4 жыл бұрын
The cmake_minimum_required(VERSION x.x) dumbs cmake down to whatever you write in there as the version, so you can use whatever up-to-date version with whatever cmake script.
@GC-qe8vc
@GC-qe8vc 2 жыл бұрын
Using the latest CMake version will not affect whether your build artifacts (the final product) supports the LTS distribution. You can use the latest CMake version on your CI and build targets for the LTS you want to support. There's really no "excuses" when it comes to CMake , it's very different from choosing a newer stdlibc++.
More Modern CMake - Deniz Bahadir - Meeting C++ 2018
1:05:32
Meeting Cpp
Рет қаралды 29 М.
MEU IRMÃO FICOU FAMOSO
00:52
Matheus Kriwat
Рет қаралды 32 МЛН
The child was abused by the clown#Short #Officer Rabbit #angel
00:55
兔子警官
Рет қаралды 13 МЛН
Must-have gadget for every toilet! 🤩 #gadget
00:27
GiGaZoom
Рет қаралды 11 МЛН
Modern Template Techniques - Jon Kalb - Meeting C++ 2019
53:52
Meeting Cpp
Рет қаралды 17 М.
Deep CMake for Library Authors - Craig Scott - CppCon 2019
1:01:35
Advanced C: The UB and optimizations that trick good programmers.
1:12:34
Eskil Steenberg
Рет қаралды 158 М.
C++ Weekly - Ep 376 - Ultimate CMake C++ Starter Template (2023 Updates)
11:19
C++ Weekly With Jason Turner
Рет қаралды 16 М.
Lecture 6: Version Control (git) (2020)
1:25:00
Missing Semester
Рет қаралды 666 М.
Bob Nystrom - Is There More to Game Architecture than ECS?
23:06
Roguelike Celebration
Рет қаралды 192 М.
C++Now 2017: Daniel Pfeifer “Effective CMake"
1:27:02
CppNow
Рет қаралды 178 М.
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00
Корнеич
Рет қаралды 3,2 МЛН
SSD с кулером и скоростью 1 ГБ/с
0:47
Rozetked
Рет қаралды 285 М.
#miniphone
0:16
Miniphone
Рет қаралды 3,6 МЛН
💅🏻Айфон vs Андроид🤮
0:20
Бутылочка
Рет қаралды 732 М.
🔥Идеальный чехол для iPhone! 📱 #apple #iphone
0:36
Не шарю!
Рет қаралды 1,3 МЛН