How to upgrade cmake on leap 15.3

I have found that, in order to successfully compile an app, I need a newer version of cmake than is currently installed on leap 15.3 (version 3.17). Tumbleweed has cmake version 3.22 and the app compiles fine in a tumblweed vm. Also, the latest version is cmake 3.22 and I have it downloaded from cmake website.

My questions is “how can I upgrade leap 15.3 cmake to version 3.22”?

I thought perhaps I could just remove (delete) the installed cmake from 15.3 and then install the newer version using yast-software using the downloaded cmake tar.gz file. But, removing cmake through yast software management also removes 66 additional packages that would wreak havoc with my system or cause lots of work to reinstall. Also the removed packages might not play well the newer cmake version after they were reinstalled

I’d like to upgrade cmake on 15.3 or have 2 cmakes where I could choose which one to use in a cmpilation. Of course, I can just use the tumbleweed vm to run this app but would like to get it compiled to run on lasp 15.3 rather than keep jumpilg around.

Anyone with a solution? thanks, tom kosvic

I leave it to others, but I think you open a can of worms. But one thing is for sure: you can not install a *.tar.gz file with YaST > Software.

You can always build cmake from source.

Otherwise you may try, but it may pull in more dependencies and cause unexpected behavior. So building from source and installing parallel to system version is more safe approach.

I think I will try to compile cmake using a less than newest version of cmake.

I am not sure how to install and run a parallel version to that installed in the system. Any pointers on how to set that up?

Special compile directives, such as install directory, might be necessary when compiling cmake (newer) for the parallel version. Any guidance?

Might prove to be easier and potentially less destructive just to use the opensuse tumbleweed vm version.

thanks much, tom kosvic

you can also grab the src.rpm and build it by

rpmbuild --rebuild xxxx.src.rpm

After that you can install the rpm.

I have compiled the cmake source of the latest cmake (3.22) and installed into USER local directory. New cmake runs when whole path to USER cmake is provided on the commandline. Think I will try this for a while.

I am nervous about using “rpmbuild --rebuild xxxx.src.rpm” as suggested and installing into system files as root. Afraid that might affect the 66 dependent processes that were to be affected in removing the current system cmake. Also, I don’t know whether to give new system cmake from rpm install a different name than current cmake or over write current cmake.

I’ll see if the USER cmake works.

thanks all, tom kosvic