More Modern CMake (Reupload with slide recording provided by speaker, thanks Deniz!) Deniz Bahadir Meeting C++ 2018 Slides: meetingcpp.com/mcpp/slides
Пікірлер: 17
@retropaganda84425 жыл бұрын
So, now that cmake finally joined the boat of build systems with sane concepts, it may be time to give it a sane syntax.
@yuricherkasov4 жыл бұрын
I was always dreaming of converting all that messy Perl-like syntax into something like Python
@ZhanhuiLi3 жыл бұрын
With knowledge from this lecture, projects managed by CMake become ever easier to understand and maintain. Big thanks!
@Deniz.Bahadir4 жыл бұрын
The sequel to this talk can be found here: kzbin.info/www/bejne/r2rOhKVrmtOlic0
@petermuller95185 жыл бұрын
I always wondered why I have to define a source wenn adding a static library. Nice to see it fixed in 3.11 :)
@cykkm3 жыл бұрын
The hardcoded /opt/boost path is not modern CMake. Try to run this in a CI pipeline...
@PeterPetrakis5 жыл бұрын
A fantastic presentation. So good in fact that it's finally justified to me that I should take a serious look at other build systems, like meson, build2, and evoke. cmake is just too heavy to code in without requiring an IDE of it's own to be able to introspect the properties to keep you productive without getting killed by "off by one" variable name errors.
@anthonymonterrosa43835 жыл бұрын
This seems rash, in my opinion, but maybe cmake isn't ideal for your projects. Terseness of a language is inversely related to its flexibility, and cmake made has made the deliberate decision to give us quite a bit of freedom in structuring our code. Also, I think it hurt the presentation to show the old cmake code. The right side is much more approachable when viewed by itself.
@addit25 жыл бұрын
For everyone with no access to "More Modern CMake": In "Modern CMake" (since 3.1 because of target_sources) you can wrap your object library or imported library with an interface library. It's not pretty, but it's a decent workaround for most of the issues mentioned in this presentation. Here is an example: add_library(someexternallib OBJECT someexternallib/someexternallib.cpp someexternallib/someexternallib.h ) set_property(TARGET someexternallib PROPERTY POSITION_INDEPENDENT_CODE ON) target_compile_definitions(someexternallib PRIVATE SOME_MACRO ) add_library(someexternallib_interface INTERFACE) target_sources(someexternallib_interface INTERFACE $ ) target_compile_definitions(someexternallib_interface INTERFACE SOME_MACRO ) target_include_directories(someexternallib_interface INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/someexternallib" ) add_library(3rdparty::someexternallib ALIAS someexternallib_interface )
@afigegoznaet5 жыл бұрын
Normal slides, finally :)
@qili35324 жыл бұрын
thanks a lot, I'm wondering where can I find the sample code?
@qili35324 жыл бұрын
sorry, speaker attach the source code web link already in the slides: github.com/Bagira80/More-Modern-CMake
@mwont5 жыл бұрын
Before people were writing Makefiles to compile c++ code. But they got complicated, so cmake was created to generated the Makefiles. But now cmake is becoming so complex, that a new tool needs to be developed that will generate cmake for you, which in turn can generated Makefile.
@retropaganda84424 жыл бұрын
That new tool could just be ... makefiles :p
@ovrskr2 ай бұрын
@@retropaganda8442 Makefiles work great until you try to do anything on a path with spaces. Which very helpfully is the case on just about every Windows system! Don't get me wrong, I love my Makefiles, just all the build tools suck in a way :-(
@ovrskr2 ай бұрын
if it's not broken, don't fix it. now there's so many ways to import and the build system is a mess -_-