Skip to content

Instantly share code, notes, and snippets.

@stryku
Last active October 7, 2019 21:48
Show Gist options
  • Save stryku/cdc833c24e8861ae7351cf903c2fff0a to your computer and use it in GitHub Desktop.
Save stryku/cdc833c24e8861ae7351cf903c2fff0a to your computer and use it in GitHub Desktop.
CMakeSL fully builds itself for the first time

CMakeSL builds itself \o/

tl;dr: CMakeSL is now able to build itself. Read along to find out what changes have been made since last reddit post and a short video from CMakeSL building.

Links

Disclaimer

Documents like the README, all files in doc are highly WIP, so they are not up-to-date, they are not pretty etc, so please don't rely on them.

Today the CMakeSL has built itself for the first time (including tests). When you develop project like this, the point when the project is able to handle itself is really satisfying. I'm pretty happy with this fact and wanted to give a quick update (:

Quick reminder

Last post on reddit was about creation of abseil-cpp CMakeSL scripts. There I posted that I've created CMakeSL scripts for the abseil-cpp project and said that next update will be when CMakeSL builds it. Well, CMakeSL is not able to handle this project yet (now I realized that I didn't try, maybe it is).

Changes since last post on r/cpp

Here's a rough changelog. It's based on github pull request, so it's not ideal, but I don't remember all this stuff.

The video (sooooooory for the audio quality but I just wanted to upload all this)

https://youtu.be/dws-FY9etPs

Couple of pretty neat things that are not so obvious at the first glance

There are a couple of things that you may have not noticed but are pretty neat considering what CMakeSL does. Just to name a few:

  • The biggest one is adding subdirectories with old CMakeLists.txt scripts. This allows you to use external libraries (like googletest in my case) that don't support CMakeSL yet (or never will). This also ease porting your CMakeLists.txt to CMakeSL.
  • The options passed from the command line (like -DCMAKESL_WITH_TOOLS=ON) are handled in bot old CMake and CMakeSL language.
  • There is an equivalent for add_custom_command(): cmake::add_custom_command(). In CMakeSL building it's used to run a python script for code generation.
  • 'Modules', import/export etc. An example script which is imported in a couple of places
  • Last but not least, the thing that I fought from the very beginning. Support of C++ tools (that don't need to know code semantic) out-of-the-box. All CMakeLists.cmsl scripts are formatted by clang-format, using the .clang-format file that is used to format a regular C++ code in the project. Even stuff like //clang-format: off work

Thanks for reading

Any thoughts? Leave a comment, issue or ask via email (you can find it on my page). And as always, I encourage you to contribute (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment