Bulletmagnet
Bulletmagnet

Reputation: 6010

How to rerun cmake with slightly modified options?

I have a project which was configured with the following cmake command:

cmake -DCMAKE_CXX_COMPILER=g++-610 \
-DCMAKE_CXX_FLAGS='-std=c++0x' \
-DCMAKE_C_COMPILER=gcc-610 \
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_RULE_MESSAGES=OFF \
-DDISABLE_GCRYPT=ON \
-DDISABLE_SCGI=ON \
-DDISABLE_HTTP=ON \
-DDISABLE_CACHE=ON \
-DDISABLE_TCPCACHE=ON \
-DDISABLE_GZIP=ON \
..

Now I want to configure a build in a different directory, with a different compiler (e.g. clang). Is there a way to find out the cmake invocation switches from the existing build directory?

When a project using autoconf is configured, I can get the options given to configure with:

$ ./config.status --version
config.status
configured by ../gcc-6.1.0/configure, generated by GNU Autoconf 2.64,
  with options " '--program-suffix=-610' '--enable-version-specific-runtime-libs' '--enable-languages=c,c++,lto'"

Upvotes: 1

Views: 464

Answers (1)

Antonio
Antonio

Reputation: 20256

I am afraid no.

The information would be contained in CMakeCache.txt, but there's no way to distinguish between cache variables set at time of cmake invocation and other cache variables set by cmake itself, or within the project cmake files, or through cmake-gui

Upvotes: 1

Related Questions