Why does externalproject downloads and compiles every time ?

Hello,
i’m using externalproject alot but he downloads and builds the targets everytime i build it. why is this happening?

If you’re using a Ninja generator, I suggest using ninja -d explain to see why it thinks it needs to re-download all the time.

no, i’m using linux and makefiles

The equivalent there is make -d, but it is very verbose.

i use cmake . to config
cmake --build . to build
cmake --install to install and
ctest to run the tests

Instead of cmake --build ., use make directly to get more information about why it is rerunning that command all the time.

If you’re using the URL method and don’t specify a hash, I believe the default behavior is that it’s redownloaded every time. I typically use the external project option

UPDATE_DISCONNECTED true

Or for all ExternalProject in that directory scope

set_property(DIRECTORY PROPERTY EP_UPDATE_DISCONNECTED true)

That should stop the constant redownloading on every configure.

I also like external project option

CONFIGURE_HANDLED_BY_BUILD true

That in general will save significant time of reconfiguring external projects besides just the redownloading.