Closed ingo-h closed 3 years ago
That's right it should be pointed out clearly that this only applies for autotools. cmake intentionally doesn't provide uninstall-target. On unix you could do xargs rm < install_manifest.txt
I'll leave it open for discussion if I should create one, as CPack is on my ToDo I don't see really a need for this.
Usually I don't expect users to install selfcompiled software into dirs that are used by the usual system-libs.
Where to find install_manifest.txt
?
Doesn't the existence of install_manifest.txt
imply that a Makefile has been created?
Where to find install_manifest.txt?
In the build-dir
Doesn't the existence of install_manifest.txt imply that a Makefile has been created?
Doesn't installation imply that a Makefile has been created?
Doesn't the existence of install_manifest.txt imply that a Makefile has been created?
Doesn't installation imply that a Makefile has been created?
Sorry, I am not used to Makefiles out of the sources dir. Now I see what cmake did, it created lots os Makefiles in the build directory and its subdirectories. Very odd, but easy to remove.
Having an uninstall target seems reasonable to me, why do the cmake guys think it is so ugly? I think it is a good thing to have.
Yeah, that cluttering of files is the best reason for building outside the source-dir. Beside the fact that Makefiles always represent only one config. I really enjoy to just change dir to switch e.g. from debug to release builds. But with the many files you have some additional comfort. You can in the toplevel just do make ixml_shared
to only build that (or anything listed in make help
) which maybe is possible the old way, but the targets are not that easy to find out. And you can just to to upnp/ and type make
and it will also work (including the build of ixml). And you won't have to list anything in .gitignore, as there goes nothing in the source that you didn't change yourself.
Having an uninstall target seems reasonable to me, why do the cmake guys think it is so ugly?
There are different reasons:
But if you like to have one, my patch-of-the-day can be that.
Where to find install_manifest.txt?
In the build-dir
pupnp$ git pull upstream master
pupnp$ rm -fr ../pupnp-build/
pupnp$ cmake -B ../pupnp-build .
pupnp$ cmake --build ../pupnp-build
pupnp$ find ../pupnp-build/ -iname "install_manifest.txt"
pupnp$
Why find
does not find install_manifest.txt
in the build-dir? What I'm doing wrong?
~$git clone https://github.com/pupnp/pupnp.git
~$cmake -S pupnp/ -B pupnp-build
~$cmake --build pupnp-build/
~$DESTDIR=`pwd`/pupnp-inst cmake --install pupnp-build/
~$find pupnp-build/ -iname "install_manifest.txt"
pupnp-build/install_manifest.txt
~$
No installation, no manifest.
And don't try the xargs with higher privileges, as this doesn't honor DESTDIR and will delete your systems installation.
But if you like to have one, my patch-of-the-day can be that.
If you are telling me that this is a non-issue for distros that use rpm or deb and that normal users should just install it under /usr/local/something and remove the folder, I can live with that.
Autotools used to take care of this, even in the /usr/loca case, because the supposed hierarchy is to install the binaries in /usr/local/bin, the includes in /usr/local/include, the libs in /usr/local/lib, etc, thus making it tedious to do it by hand.
Installing stuff inside /usr/local/something has the inconvenient that you would have to mess with the system paths, like PATH and LD_LIBRARY_PATH to have stuff working.
If you are telling me that this is a non-issue for distros that use rpm or deb and that normal users should just install it under /usr/local/something and remove the folder, I can live with that.
Live with the risk this target brings, or with missing the target?
Autotools used to take care of this, even in the /usr/loca case, because the supposed hierarchy is to install the binaries in /usr/local/bin, the includes in /usr/local/include, the libs in /usr/local/lib, etc, thus making it tedious to do it by hand.
cmake defaults also to /usr/local. includes go to /usr/local/include/upnp ,so that's easy to find. samples, pkg-config cmake-config and the libs are another topic. I didn't check, but iirc autotools have the same problem and can let the user run into it. What happens if you want to check something and install with DESTDIR=something and then make uninstall and forget the DESTDIR? And yes, I suppose uninstall would honor that,too.
Installing stuff inside /usr/local/something has the inconvenient that you would have to mess with the system paths, like PATH and LD_LIBRARY_PATH to have stuff working.
Sure, that's why I'm going to include CPack. For produktive usage it should be installed somewhere that doesn't need these things, but it should also be installed in a way that other packages from the system can use them, which only works if the packaghemanager knows about them, otherwise you would need to tweak these path's again to let the selfcompiled one be found first.
IMO it is fine to not offer a uninstall target with CMake, as there is not really a very good risk-free way to do it, afaik.
If you are telling me that this is a non-issue for distros that use rpm or deb and that normal users should just install it under /usr/local/something and remove the folder, I can live with that.
Live with the risk this target brings, or with missing the target?
Live without the target. In other words, I trust you.
Sure, that's why I'm going to include CPack. For produktive usage it should be installed somewhere that doesn't need these things, but it should also be installed in a way that other packages from the system can use them, which only works if the packaghemanager knows about them, otherwise you would need to tweak these path's again to let the selfcompiled one be found first.
Nice :+1:
So, we leave it with no uninstall target.
According to the README - 11.2. Uninstall this can be done with
But this is not available when using a 10.7. CMake Build: