Reputation: 3896
I'm using CMake's External Project support very similar as proposed in CMake + GoogleTest.
Obviously my build eventually depends on a download step and hence will only work if that is possible - i.e. I need an internet connection. However, if I am using a fixed revison to download (not HEAD) and have already build the external project once, I'm not sure why this download step seems to be performed every time.
While no actual files seem to be downloaded and no time consuming rebuild is triggered, my build still fails when I'm not online. This is pretty annoying when working without internet connection, e.g. on a train.
Is there a way to let my build skip the download step altogether if it can be deduced to be unnessary (fixed revision + lib for the EP already build / no clean step performed)?
Upvotes: 1
Views: 487
Reputation: 71
thiagowfx's suggestion in the comments section will get you most of the way, but running make clean
will put you back in the position of relying on the internet to build. (The suggestion is to set UPDATE_COMMAND to the empty string in ExternalProject_Add.)
To avoid this, add SET_DIRECTORY_PROPERTIES(PROPERTIES CLEAN_NO_CUSTOM 1)
to the CMakeLists.txt.in file, per Ding-Yi Chen's suggestion on this post. This will make sure that make clean
does not remove the binaries for the external project.
Upvotes: 0