C++
#
Yesterday while driving to work, I was thinking: shouldn’t it be possible to use modern #CMake to handle what we usually do with a #Git submodule?
So, let’s turn that idea into a working prototype and test it in practice.
For this example, CMake ๐ ๐๐ญ๐๐ก๐๐จ๐ง๐ญ๐๐ง๐ญ is used instead of a Git submodule to provide #LVGL for a minimal demo application.
๐๐ก๐ ๐๐๐ฉ๐๐ง๐๐๐ง๐๐ฒ ๐๐ข๐ ๐ง๐จ๐ญ ๐๐ข๐ฌ๐๐ฉ๐ฉ๐๐๐ซ. ๐๐ฐ๐ง๐๐ซ๐ฌ๐ก๐ข๐ฉ ๐จ๐ ๐๐๐ฉ๐๐ง๐๐๐ง๐๐ฒ ๐๐๐ช๐ฎ๐ข๐ฌ๐ข๐ญ๐ข๐จ๐ง ๐ฆ๐จ๐ฏ๐๐ ๐๐ซ๐จ๐ฆ ๐ญ๐ก๐ ๐๐ข๐ญ ๐๐ก๐๐๐ค๐จ๐ฎ๐ญ ๐ฆ๐จ๐๐๐ฅ ๐ญ๐จ ๐ญ๐ก๐ ๐๐๐๐ค๐ ๐๐จ๐ง๐๐ข๐ ๐ฎ๐ซ๐ ๐ฆ๐จ๐๐๐ฅ.
๐๐ฉ๐ข๐ต ๐ช๐ด ๐ข๐ค๐ต๐ถ๐ข๐ญ๐ญ๐บ ๐ค๐ฉ๐ข๐ฏ๐จ๐ช๐ฏ๐จ?
* the VCS structure: LVGL is no longer part of the parent repository as a Git submodule
* the physical layout: the dependency moves from the source tree into the build tree
* the control: CMake declares the requested LVGL revision
* build graph: no ๐ this is almost unchanged โ LVGL is still compiled and linked as a normal target
So, CMake does not replace Git. Git is still needed, but it is now invoked by CMake during configuration instead of being handled upfront by the developer.
The example can be found on GitHub: https://github.com/marcelpetrick/codingWithGPT/tree/master/cmakeFetchContentVersusGitSubmodule
Thank you for your attention ๐
qmake: shared libs without versioning and symlinks
Fatal error: Uncaught Error: Call to a member function id() on array in /users/marcelpetrick/www/wp_solutionsnotcode/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php:36 Stack trace: #0 /users/marcelpetrick/www/wp_solutionsnotcode/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php(538): CrayonFormatter::format_code('', Array, Object(CrayonHighlighter)) #1 [internal function]: CrayonFormatter::delim_to_internal(Array) #2 /users/marcelpetrick/www/wp_solutionsnotcode/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php(516): preg_replace_callback('#()#msi', 'CrayonFormatter...', '# disable symli...') #3 /users/marcelpetrick/www/wp_solutionsnotcode/wp-content/plugins/crayon-syntax-highlighter/crayon_highlighter.class.php(166): CrayonFormatter::format_mixed_code('# disable symli...', Object(CrayonLang), Object(CrayonHighlighter)) #4 /users/marcelpetrick/www/wp_solutionsnotcode/wp-content/plugins/crayon-syntax-highlighter/crayon_highlighter.class.php(186): CrayonHighlighter->process() #5 /users/marcelpetrick/www/wp_solutionsnotcode/wp-content/plugins/crayon-syntax-highlighter/crayon_wp.class.php(703): CrayonHighlighter->output(true, false) #6 /users/marcelpetrick/www/wp_solutionsnotcode/wp-includes/class-wp-hook.php(286): CrayonWP::the_content('<p>By default s...') #7 /users/marcelpetrick/www/wp_solutionsnotcode/wp-includes/plugin.php(203): WP_Hook->apply_filters('<p>By default s...', Array) #8 /users/marcelpetrick/www/wp_solutionsnotcode/wp-includes/post-template.php(240): apply_filters('the_content', 'By default shar...') #9 /users/marcelpetrick/www/wp_solutionsnotcode/wp-content/themes/clean-black/loop.php(7): the_content('Read more...') #10 /users/marcelpetrick/www/wp_solutionsnotcode/wp-includes/template.php(751): require('/users/marcelpe...') #11 /users/marcelpetrick/www/wp_solutionsnotcode/wp-includes/template.php(708): load_template('/users/marcelpe...', false) #12 /users/marcelpetrick/www/wp_solutionsnotcode/wp-includes/general-template.php(155): locate_template in /users/marcelpetrick/www/wp_solutionsnotcode/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 36
