configure-like for CMake

918 views Asked by At

G'day.

Is there a tool which provides autoconf-like configure interface to CMake? eg instead of

cmake -DCMAKE_C_COMPILER=mpicc

invoke same command via

./configure CC=mpicc
2

There are 2 answers

3
sradomski On

Just wrap the call to cmake in the configure script (from OpenSceneGraph):

openscenegraph$ cat ./configure 
cmake . -DCMAKE_BUILD_TYPE=Release $@

Be aware that this will perform an "in-source" build. You can pass build variables via the usual -DVARNAME=VALUE, e.g.:

./configure -DCMAKE_VERBOSE_MAKEFILE=On
0
g19fanatic On

This github project provides a configure script that understands and translates between a cmake project and a standard autotools configure including support for --prefix and --enable

It takes a little bit to grok, but I believe its the closest solution to what you're expecting.