Commit f665e0ca authored by Matti Kosola's avatar Matti Kosola

Merge branch 'jb48781' into 'master'

[libsystrace] Build using cmake instead of qmake. Fixes JB#48781

See merge request !1
parents 2e904874 c424879d
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)
VERSION = 0.0.0
TEMPLATE = lib
TARGET = systrace
CONFIG -= qt
SOURCES = \
src/systrace.c
HEADERS = \
src/systrace.h
headers.path = $$[QT_INSTALL_PREFIX]/include
headers.files += $$HEADERS
INSTALLS += headers
target.path = $$[QT_INSTALL_LIBS]
INSTALLS += target
CONFIG += create_pc create_prl no_install_prl
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
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}
......
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:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment