[mythtv-users] Building using CMake??

Peter Bennett pb.mythtv at gmail.com
Tue Feb 4 14:08:43 UTC 2025


On 2/3/25 20:23, James Abernathy wrote:
> So I couldn't find anything interesting to read today so I read 
> Mythtv/README.CMake.md <http://README.CMake.md>.  I'm guessing that 
> making the move to CMake will make it easier for developers to support 
> different OSs and platforms.
>
> I decided I'd give it a try on a fresh system, Debian 12 in this case.
>
> So things I found out so far are:
>
> 1. You still need the mythtv/ansible for your dependencies.
> 2. If you use the default CMAKE_INSTALL_PREFIX your binaries end up in 
> /usr/local/bin and your libs end up in /usr/local/lib.  However, I had 
> to give my user write permission to /usr/local to make this happen.  I 
> didn't want to run the build as sudo, at least I don't think so?
> 3. I had to run:
> sudo /sbin/ldconfigso my libraries would be found in /usr/local/lib. I tested 
> mythfrontend and it worked. Any pointers on how to get a better 
> understanding of all this? Jim A
>
> _______________________________________________

cmake builds and installs in one command. By default the install 
location is /usr/local. Thus the cmake by default has to run with root. 
I agree that is not desirable, but that is also the default with make 
install if you do not use any overrides.

You need something like this

cmake --preset qt5 \
-DCMAKE_INSTALL_PREFIX=/home/peter/proj/build/noble-amd64/mythtv/cmake/usr \
-DMYTH_RUN_PREFIX=/usr

cmake --build build-qt5

The CMAKE_INSTALL_PREFIX tells where it will be installed.

The MYTH_RUN_PREFIX is for cases where you will eventually copy to 
another location and run it there. So the above command will install it 
in /home/peter/proj/build/noble-amd64/mythtv/cmake/usr but to run it you 
should copy it to /usr. This is what a package script would do.

If you will run from the same place you install to, then leave out  the 
MYTH_RUN_PREFIX, but you will have to set LD_LIBRARY_PATH to the place 
the libs are installed, set PYTHONPATH and PERL5LIB to places those are 
installed, and maybe other stuff.

HTH

Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20250204/c68e068f/attachment.htm>


More information about the mythtv-users mailing list