2 ms·
Another example: FindBLAS. [0] There are various different compatible BLAS libraries, and the elaborate CMake script accommodates this. To return to a point I
by MaxBarraclough 6y ago
Another example: FindBLAS. [0] There are various different compatible BLAS libraries, and the elaborate CMake script accommodates this.
To return to a point I made earlier, part of the value of having a configure step before the build step, is to handle all the platform-specific stuff early, failing early and with good error-messages if something is missing. I've seen builds fail several minutes in, it's very annoying, and the configure step should make all the checks necessary to prevent this happening. If the configure step succeeds, I should be able to rely on make succeeding.
You make a good case that this step should really be very simple, and I agree, especially considering pkg-config exists, [1] but here we are. (True to form, CMake is able to leverage pkg-config, but makes it painful and confusing. [2] You have to be a master of CMake to figure it out, and the correct answer depends on the CMake version, despite that both pkg-config and CMake were first released in the year 2000.)
Also, optional dependencies can be handled properly. I don't see how you could easily handle this with pure Make.
[0] https://github.com/Kitware/CMake/blob/master/Modules/FindBLAS.cmake https://github.com/Kitware/CMake/blob/master/Modules/FindBLA...
[1] https://en.wikipedia.org/wiki/Pkg-config https://en.wikipedia.org/wiki/Pkg-config
[2] https://stackoverflow.com/q/29191855/ https://stackoverflow.com/q/29191855/