Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb48781' into 'master'
[libsystrace] Build using cmake instead of qmake. Fixes JB#48781

See merge request mer-core/libsystrace!1
  • Loading branch information
Matti Kosola committed Feb 14, 2020
2 parents 2e90487 + c424879 commit f665e0c
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 31 deletions.
24 changes: 24 additions & 0 deletions CMakeLists.txt
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.0.0)

# Remove git hash from version number if present
string(REGEX REPLACE "([0-9.]+).*" "\\1" VERSION "${VERSION}")

project(systrace VERSION ${VERSION} LANGUAGES C DESCRIPTION "Systrace library")

include(GNUInstallDirs)

add_library(systrace SHARED src/systrace.c)

set_target_properties(systrace
PROPERTIES VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
PUBLIC_HEADER src/systrace.h)

configure_file(systrace.pc.in systrace.pc @ONLY)

install(TARGETS systrace
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

install(FILES ${CMAKE_BINARY_DIR}/systrace.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
21 changes: 0 additions & 21 deletions libsystrace.pro

This file was deleted.

25 changes: 15 additions & 10 deletions rpm/libsystrace.spec
@@ -1,35 +1,40 @@
Name: libsystrace
Version: 0.0.0
Release: 1
Summary: A library for logging systrace data.
Group: System/Libraries
Summary: A library for logging systrace data
License: BSD
URL: https://github.com/mer-packages/
URL: https://git.sailfishos.org/mer-core/libsystrace
Source0: %{name}-%{version}.tar.bz2
BuildRequires: qt5-qmake
BuildRequires: cmake
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig

%description
%summary.
%summary

%package devel
Summary: Development files for %{name}
Group: System/Libraries
Summary: Development files for %{name}
Requires: %{name} = %{version}-%{release}

%description devel
%{summary}.
%{summary}

%prep
%setup -q -n %{name}-%{version}

%build
%qmake5
mkdir -p build
pushd build
%cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DVERSION=%{version}
make %{?_smp_mflags}
popd build

%install
rm -rf %{buildroot}
%qmake5_install
make -C build install DESTDIR=%{buildroot}

%clean
rm -rf %{buildroot}
Expand Down
10 changes: 10 additions & 0 deletions systrace.pc.in
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/lib@LIB_SUFFIX@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@

Name: Systrace
Description: Systrace Library
Version: @PROJECT_VERSION@
Libs: -lsystrace
Cflags:

0 comments on commit f665e0c

Please sign in to comment.