Per Johansson
Per Johansson

Reputation: 6887

configure script calling cmake

I'm thinking to write a simple configure script (similar to autoconf one) which execs cmake. But before doing that I want to check if anyone knows of such an effort already. I wasn't able to find anything on google.

It should be able to support the basic autoconf configure flags (prefix, exec-prefix, bindir mostly).

Reason to do it is of course that there's a certain user expectancy to be able to do ./configure && make

Upvotes: 1

Views: 999

Answers (1)

Bort
Bort

Reputation: 2491

Also not really an answer but too long for a comment:

After reading up about cmake / cpack, I can at least tell you this. Cmake expects to be present on the platform. Therefore CPack cannot generate the same type of ./configure scripts as autotools. The Autotools expect some shell to be present, which is essentially the same as cmake to be present. However since cmake also targets the Win environment, it cannot rely on a shell. That being said, CPack can provide source packages, which need to be installed with cmake in the usual manner.

Also this does not solve your problem, I do not recommend to write a tool for cmake. Cmake is able to use all these type of prefixes you are interested in. If the user wants to compile your program from scratch, he has to know at least the basics (e.g. setting variables) of your build system. This is also true for autotools. If you want to spare him the pain, you can provide binary .sh, .deb or .rpm packages, which can be easily built with cmake / cpack.

Upvotes: 1

Related Questions