Why a cmake option to clear install target before installation?

Recently an option was introduced so that clearing the directory is an option at the following commit.

I introduced this action at “make install” stage so that it avoided some problems some users were reporting to me directly. But now, if it is an option, the user will not be aware of it.

So, why it is a problem to impose that the target install directory must be removed before the new installation?

Sometimes we directly do analysis in the install directory. Many people have their install dir highly modified. For example, I usually generate readout files and then run cobo analysis in $REST_PATH/examples. There are many root files and modified rml files in it. It is very annoying to remove it every time when install.

I believe it is better not to remove the install dir by default.

Another option is that, we can keep a list of installed files in $REST_PATH. When doing install REST, we only remove the files in that list.

I dont think it is a good practice to work at the install directory. This should be a static directory. I believe it is a bad habit. If you work on a project, you are willing to track changes with a git repository. The install directory it is in principle not tracked. I believe we should get used to clone a work repository somewhere and work introducing the changes there.

Perhaps what it is not good right now is that we are copying project/example RML files to the REST_PATH directory?

Not sure if that is easy to maintain, or it might require longer development/debugging time. The rm -r $REST_PATH was a straight forward solution.

We run into problems when we disable for instance a library, the old objects remain at the REST_PATH and those cause errors when loading restRoot.

So, I believe the option INSTALL_CLEARDIR should be for te moment ON by default, to minimise brainstorming on people playing with REST compilation and installation.

So, why don’t you just go to REST_SOURCE_PATH/examples?