[mythtv-users] Building using CMake??

James Abernathy jfabernathy at gmail.com
Tue Feb 4 15:28:50 UTC 2025


On Tue, Feb 4, 2025 at 10:02 AM David Hampton via mythtv-users <
mythtv-users at mythtv.org> wrote:

> On Mon, 2025-02-03 at 20:23 -0500, James Abernathy wrote:
> > So I couldn't find anything interesting to read today so I read
> > Mythtv/README.CMake.md.  I'm guessing that making the move to CMake
> > will make it easier for developers to support different OSs and
> > platforms.
>
> It does.  From the same source tree I can build a linux version, a
> variety of android versions, and a version for windows.  The only
> difference to building any these versions is the argument to the "cmake
> --preset" command.
>
> > 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?
>
> This is the same default location as for the traditional configure/make
> method of building.  The difference is that the traditional method
> builds everything first and installs everything last, where the cmake
> method builds and installs each part, and then moves on to the next
> part.  You change the default location in the traditional method by
> passing the --prefix argument to "configure", you change it in the
> cmake method by passing the -DCMAKE_INSTALL_PREFIX argument to the
> "cmake --preset" command.
>
> Building MythTV from five sub-projects (28 on android, 30 on windows)
> is the way to have the same command invocation no matter what you are
> building.  Each sub-project needs to build then install, so that its
> results can be found by the next sub-project's configuration step.
>
> I'm not sure how other developers are handling the change to have
> multiple installs as part of the build.  I have always installed my
> test builds into a temporary directory underneath my home directory and
> run them from there, so this wasn't an issue for me.  Running directly
> from a temporary location should be a matter of setting the PATH and
> LD_LIBRARY_PATH variables appropriately.   If you really want to run
> out of /usr/local, one solution might be to first install into a
> temporary directory and then use a "sudo rsync" command to copy
> everything into /usr/local.  Hopefully others will chime in on what
> they are doing.
>
> I still do my production builds using Gary's script to build a set of
> Fedora rpms, which I then copy to my production systems.
>
> David
>

Thanks for the explanation.  Running as sudo allowed me to run natively for
Debian and I could quickly have a combo FE/BE up and running as a test.
I'm now doing the same thing to Archlinux since their AUR package is
broken. There is some confusion as to what are the true required
dependencies and ansible for Arch is not working correctly.  I have my own
list and I recently removed python-future and added cmake patch and ninja.
Ninja-build is called ninja on archlinux.

I refer back to the wiki Build from source for what to do with the libs. I
just had to sudo  /sbin/ldconfig if I use /usr/local/.  If I choose
_DCMAKE_INSTALL_PREFIX=/usr, then I don't have to mess with it.

This seems to be a good change from the ./configure, make, and sudo make
install method. I like not having to deal with the python in an environment
forced by PEP668.

Jim A
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20250204/8b8c7b7c/attachment.htm>


More information about the mythtv-users mailing list