GCLC is a mathematical software tool for producing high-quality mathematical illustrations, for teaching mathematics, and for automated proving of geometry theorems.
Wrt #23, this ports (1), (2), and (4) to CMake. I expect this will take a bit of experimentation (read: force-pushing) to figure out the exact build.yml changes to meet CI’s expectations.
A couple of things:
While doing this, I discovered I think source/cGCLC.pro just describes a Qt-based build of the same thing in Makefile and/or Makefile.win. Is this correct? If so, do we want to retain/port/delete it?
I left source/gGCLC.pro intact despite porting it under the assumption users may wish to still use Qt Creator on this. Is that correct?
For now, I held off on porting Makefile.web, which I figure we can tackle after working out the kinks on this PR.
I dropped -static as I think we discussed it’s not working, and this PR does not yet make any steps to re-enable it. Maybe we want to figure out whether that is easy/possible before landing this?
CMake primer
I guess not everyone reading this will be familiar with CMake, so here is a brief getting started guide…
tl;dr
# build everything
cmake -B my-build-folder -S . # ← configure the build
cmake --build my-build-folder # ← run compilation
# build only the CLI
cmake -B my-build-folder -S .
cmake --build my-build-folder --target gclc
more…
You read on the internet that CMake is not a build system but a “meta build system”. This statement is both accurate and thoroughly useless for helping you understand CMake. What people mean when they say this is that CMake generates build system files (e.g. Makefiles) that then become inputs to an actual build system (e.g. GNU Make).
The overwhelming main benefit of CMake is cross-platform portability. You could think of it as a variant of Autotools that plays nicer on Windows and has fewer opportunities for life-ruining typos. As the name suggests, it is biased towards building C/C++ projects.
You configure things with one or more files named CMakeLists.txt. What is possible and how the syntax works is explained at https://cmake.org/cmake/help/latest/. Though admittedly it is sometimes hard to know the right terms to search for and you have to resort to cribbing things from strangers’ existing CMakeLists.txt files.
There are a few notable bells and whistles that CMake gives you out of the box:
In-tree and out-of-tree builds. Out-of-tree builds are encouraged, but cmake . will configure an in-tree build.
Parallelism. Pass --parallel to the CMake build step to run multiple compilation jobs in parallel. If you stick within CMake’s basic feature set, it is hard to accidentally construct a build with race conditions.
Automatic dependency tracking. Touching sources, headers, or even a CMakeLists.txt file will cause the relevant dependent artifacts to be rebuilt next time you run cmake --build …. No more messing with .d files or running make clean out of paranoia.
Wrt #23, this ports (1), (2), and (4) to CMake. I expect this will take a bit of experimentation (read: force-pushing) to figure out the exact build.yml changes to meet CI’s expectations.
A couple of things:
-static
as I think we discussed it’s not working, and this PR does not yet make any steps to re-enable it. Maybe we want to figure out whether that is easy/possible before landing this?CMake primer
I guess not everyone reading this will be familiar with CMake, so here is a brief getting started guide…
tl;dr
more…
You read on the internet that CMake is not a build system but a “meta build system”. This statement is both accurate and thoroughly useless for helping you understand CMake. What people mean when they say this is that CMake generates build system files (e.g. Makefiles) that then become inputs to an actual build system (e.g. GNU Make).
The overwhelming main benefit of CMake is cross-platform portability. You could think of it as a variant of Autotools that plays nicer on Windows and has fewer opportunities for life-ruining typos. As the name suggests, it is biased towards building C/C++ projects.
You configure things with one or more files named CMakeLists.txt. What is possible and how the syntax works is explained at https://cmake.org/cmake/help/latest/. Though admittedly it is sometimes hard to know the right terms to search for and you have to resort to cribbing things from strangers’ existing CMakeLists.txt files.
There are a few notable bells and whistles that CMake gives you out of the box:
cmake .
will configure an in-tree build.--parallel
to the CMake build step to run multiple compilation jobs in parallel. If you stick within CMake’s basic feature set, it is hard to accidentally construct a build with race conditions.cmake --build …
. No more messing with .d files or runningmake clean
out of paranoia.