[CMake] cmake_check_build_system is causing a rebuild at "make install"

JR Cary cary at txcorp.com
Mon Oct 12 19:41:51 EDT 2015


In our use of cmake on a particular project, we noticed that
after building the project, upon invoking "make install", the
build starts all over again.  Hence we are building the project
twice.

It seems that this is occurring because nearly everything depends
on the target, cmake_check_build_system, which sometimes causes a
reconfiguration, i.e. reinvocation of cmake.  In particular, the
generated Makefile's have:

install: preinstall
...
preinstall: all
...
all: cmake_check_build_system

and then the last target invokes

<cmake bindir>/cmake -H<source dir> -B <build dir> --check-build-system 
CMakeFiles/Makefile.cmake 0

Sometimes this causes a reconfiguration of our project and
sometimes not.  When it does, the whole project rebuilds because
nearly everything depends on some configure_file generated
config.h files.

How can we tell why this reconfiguring?

BTW, I could not find any of the options, -B, -H, or
--check-build-system at the documentation,
https://cmake.org/cmake/help/v3.3/manual/cmake.1.html.

Thanks for any help.....John Cary


More information about the CMake mailing list