Mailinglist Archive: opensuse-buildservice (148 mails)

< Previous Next >
Re: [opensuse-buildservice] CMake and OBS
On 05.09.2013 08:45, Sankar P wrote:
Hi,

Are there any best known methods to package CMake based projects using the open
build service ?
rather independant from OBS I guess.

Specifically what I am looking forward to is a simplified way of:

1) Installing all the libraries that CMake generates to /usr/lib (or)
/opt/<company>/lib
2) Installing all the binaries that CMake generates to /usr/bin (or)
/opt/<company>/bin
That depends on the install prefix you give:
call cmake with -DCMAKE_INSTALL_PREFIX=/usr or -DCMAKE_INSTALL_PREFIX=/opt/<company>/bin

3) Populate BuildRequires: based on the find_package inside the CMakeLists.txt(
I doubt that is automatted. And why should it? Maybe the package should actually not contain all features the package offers.

4) Building only a small subset of all the targets supported by the CMake file
in a project. To explain on this point. Assume that my project has 10 targets
and I need only 5 targets (3 binaries and 2 libraries that they depend) to be
shipped to the users. So, I want a way to generate a tarball with only these 3
binaries and their dependencies (2 libraries in our case), which can be used in
a build-service project. If I am not using OBS for distributing the binaries, I
can easily build the two binary targets alone and can ship the resultant
binaries. But if I want to use CMake what is the best way for achieving this
instead of creating a tarball with the sources for all the 10 targets ?
You can give the targets you want to the make command:
make %{?_smp_mflags} target1

There is also a macro %cmake_kde4 which sets a couple of options, check /etc/rpm/macros.kde4 how it expands.

HTH,

Klaas



--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >
References