-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add uninstall target #366
Add uninstall target #366
Conversation
Satisfy the OpenSSF Best Practices Badge requirement for an insta/uninstall process: https://www.bestpractices.dev/en/criteria/1#1.installation_common CMake does not support a standard "uninstall" target, but the community recommends implementing an "uninstal" target that remove files named in the `install_manifest.txt`: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake However, our existing process of installing the symlink to the "bare" library, i.e. the symlink from libImath-3_2.so to libImath.so, fails to add the symlink to the manifest, so "make uninstall" misses the symlink. The existing mechanism uses "install(CODE execute_process(cmake -E create_symlink))". This changes that to use a simpler "file(CREATE_LINK)" and "install(FILES)" to accomplish the same thing while also registering the symlink the the manifest. This change also adds the cmake option `IMATH_INSTALL`, on by default and for normal usage, but which allows disabling of the installation when Imath is configured as a subproject of another project. OpenEXR propgates the `OPENEXR_INSTALL` option to `IMATH_INSTALL`. Signed-off-by: Cary Phillips <[email protected]>
I haven't seen this pattern in other projects, I think I missed the motivation when it was introduced upstream at OpenEXR? |
It's needed by the python bindings because the cmake target that installs the wheels should not install the libraries, so this option makes it possible to suppress installing the libraries. Imath needs it, too, otherwise the OpenEXR target that installs the wheels would also install the Imath library. |
Gotcha, lgtm! |
Satisfy the OpenSSF Best Practices Badge requirement for an insta/uninstall process: https://www.bestpractices.dev/en/criteria/1#1.installation_common CMake does not support a standard "uninstall" target, but the community recommends implementing an "uninstal" target that remove files named in the `install_manifest.txt`: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake However, our existing process of installing the symlink to the "bare" library, i.e. the symlink from libImath-3_2.so to libImath.so, fails to add the symlink to the manifest, so "make uninstall" misses the symlink. The existing mechanism uses "install(CODE execute_process(cmake -E create_symlink))". This changes that to use a simpler "file(CREATE_LINK)" and "install(FILES)" to accomplish the same thing while also registering the symlink the the manifest. This change also adds the cmake option `IMATH_INSTALL`, on by default and for normal usage, but which allows disabling of the installation when Imath is configured as a subproject of another project. OpenEXR propgates the `OPENEXR_INSTALL` option to `IMATH_INSTALL`. Signed-off-by: Cary Phillips <[email protected]>
This should have gone into PR AcademySoftwareFoundation#366, since `file(CREATE_LINK)` was introduced in cmake 3.14, not sure how it slipped through the CI. Signed-off-by: Cary Phillips <[email protected]>
This should have gone into PR #366, since `file(CREATE_LINK)` was introduced in cmake 3.14, not sure how it slipped through the CI. Signed-off-by: Cary Phillips <[email protected]>
This part of AcademySoftwareFoundation#366, backported for the 3.1 branch. Signed-off-by: Cary Phillips <[email protected]>
This part of AcademySoftwareFoundation#366, backported for the 3.1 branch. Signed-off-by: Cary Phillips <[email protected]>
This part of #366, backported for the 3.1 branch. Signed-off-by: Cary Phillips <[email protected]>
Satisfy the OpenSSF Best Practices Badge requirement for an insta/uninstall process:
https://www.bestpractices.dev/en/criteria/1#1.installation_common
CMake does not support a standard "uninstall" target, but the community recommends implementing an "uninstal" target that remove files named in the
install_manifest.txt
:https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
However, our existing process of installing the symlink to the "bare" library, i.e. the symlink from libImath-3_2.so to libImath.so, fails to add the symlink to the manifest, so "make uninstall" misses the symlink. The existing mechanism uses "install(CODE execute_process(cmake -E create_symlink))".
This changes that to use a simpler "file(CREATE_LINK)" and "install(FILES)" to accomplish the same thing while also registering the symlink the the manifest.
This change also adds the cmake option
IMATH_INSTALL
, on by default and for normal usage, but which allows disabling of the installation when Imath is configured as a subproject of another project. OpenEXR propgates theOPENEXR_INSTALL
option toIMATH_INSTALL
.