[opensuse-buildservice] CMake and OBS
Hi, Are there any best known methods to package CMake based projects using the open build service ? 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 3) Populate BuildRequires: based on the find_package inside the CMakeLists.txt( 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 ? I googled around a bit before asking here but could not find any relevant information. I see that CMake is used heavily in KDE and so some of the openSUSE packagers would have run into similar requirements and wanted to find out the best practices for using CMake in OBS. Thanks. Sankar -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
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@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
Dnia czwartek, 5 września 2013 00:45:53 Sankar P pisze:
Hi,
Are there any best known methods to package CMake based projects using the open build service ?
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
{ rpm -qd cmake; } Chris -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On 9/6/2013 at 11:22 PM, in message <1477147.Yx7NZbg7Kf@linux-d902>, Krzysztof *elechowski<giecrilj@stegny.2a.pl> wrote: Dnia czwartek, 5 wrze*nia 2013 00:45:53 Sankar P pisze: Hi,
Are there any best known methods to package CMake based projects using the open build service ?
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
{ rpm -qd cmake; }
{ rpm -qd cmake | xargs grep -i buildservice; } What I am looking for is a way to define the install prefixes in the OBS' .spec files as opposed to generating RPM via CMake itself. Sankar -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
Dnia wtorek, 10 września 2013 12:16:15 Sankar P pisze:
What I am looking for is a way to define the install prefixes in the OBS' .spec files as opposed to generating RPM via CMake itself.
You specify those as named parameters to cmake. HTH, Chris -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
participants (4)
-
Klaas Freitag
-
Krzysztof Żelechowski
-
Křištof Želechovski
-
Sankar P