Josh wrote:Thanks for the suggestions and the code, adrian_007 - even if I'm very late with it ...
I'm not familiar with CMake - what would you say are the specific advantages over "make" with respect to usb_modeswitch?
In short: tclsh is not a build dependency any more
Given that compilation of usb_modeswitch is not very complicated, there're not many benefits over plain Makefile. My reasoning for using CMake was as follow:
- extra step that is currently delegated to tcl script (make_string.tcl) was quite easily doable inside a tool at configuration time, this allowed me to get rid of tcl being a build dependency
- it has a good integration with CLion, which I was and am using for C/C++ development
- it deals well with dependency resolving, especially when project is being cross-compiled (you already rely on pkg-config tool to do the resolution of libusb, CMake does it under the hood)
One might argue that although tclsh is no longer a build dependency, CMake is a new one. That's true, but nowadays, CMake became de-facto a standard with modern C/C++ development, so this tool is either already present or easily obtainable. Most, if not all, cross-compilation / distro-bakers - like Buildroot - already have it and support it out of the box, which cannot be said about tclsh (that is CMake is a dependency of a significant number of projects, where tcsh is a rather niche tool).
So, in summary, Makefile solution depends on:
and CMake solution depends on, well, CMake.