Skip to content

Commit

Permalink
[cmake] Fixup cmake build
Browse files Browse the repository at this point in the history
  • Loading branch information
neochapay committed Apr 9, 2020
1 parent 40f3304 commit 9bb1349
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Expand Up @@ -15,3 +15,11 @@ Makefile
installroot/
RPMS/
debug*.list
CMakeCache.txt
*.qm
*.cmake
CMakeFiles
lipstick
lipstick_autogen
prefix.sh
install_manifest.txt
11 changes: 8 additions & 3 deletions CMakeLists.txt
Expand Up @@ -13,13 +13,16 @@ include(FindPkgConfig)
include(FeatureSummary)
include(GNUInstallDirs)

set(QT_MIN_VERSION "5.6.0")
set(QT_MIN_VERSION "5.9.0")
find_package(Qt5 COMPONENTS Gui Qml Quick DBus LinguistTools REQUIRED)
if(QT_VERSION EQUAL "5.6.0")
if(QT_VERSION EQUAL "5.9.0")
find_package(Qt5 COMPONENTS Compositor REQUIRED)
else()
find_package(Qt5 COMPONENTS WaylandCompositor REQUIRED)
endif()

option (USE_SYSTEMD "Use systemd services" ON)

find_package(PkgConfig REQUIRED)
pkg_check_modules(LIPSTICK lipstick-qt5 REQUIRED IMPORTED_TARGET)
pkg_check_modules(NEMODEVICELOCK nemodevicelock REQUIRED IMPORTED_TARGET)
Expand All @@ -33,13 +36,15 @@ include(KDECMakeSettings)

add_subdirectory(src)

if(EXISTS /run/systemd/system)
if(USE_SYSTEMD)
install(FILES data/lipstick.service
DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/user)
endif()

install(FILES data/glacier-home.privileges
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/mapplauncherd/privileges.d)
install(FILES data/nemovars.conf
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/lipstick-glacier-home-qt5)
install(FILES
data/90-glacier-powerkey.conf
data/90-glacier-devlock.conf
Expand Down
File renamed without changes.
14 changes: 8 additions & 6 deletions rpm/lipstick-glacier-home-qt5.spec
Expand Up @@ -32,12 +32,13 @@ Requires: libqofonoext-declarative
Requires: qt5-qtmultimedia-plugin-audio-pulseaudio

BuildRequires: cmake
BuildRequires: extra-cmake-modules >= 5.68.0
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(lipstick-qt5) >= 0.12.0
BuildRequires: pkgconfig(Qt5Compositor)
BuildRequires: pkgconfig(Qt5WaylandCompositor)
BuildRequires: pkgconfig(nemodevicelock)
BuildRequires: pkgconfig(KF5BluezQt)
BuildRequires: kf5bluezqt-bluez5-devel >= 5.68.0

Provides: lipstick-colorful-home-qt5

Expand All @@ -50,17 +51,18 @@ A homescreen for Nemo Mobile
%setup -q -n %{name}-%{version}

%build
cmake -B build \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_INSTALL_LIBDIR=%{_lib} \
-DCMAKE_INSTALL_LIBDIR=%{_libdir} \
-DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} \
-DCMAKE_VERBOSE_MAKEFILE=ON \
.
cmake --build build
cmake --build .

%install
rm -rf %{buildroot}
DESTDIR=$RPM_BUILD_ROOT cmake --build build --target install
DESTDIR=$RPM_BUILD_ROOT cmake --build . --target install

mkdir -p %{buildroot}%{_libdir}/systemd/user/user-session.target.wants/
ln -s ../lipstick.service %{buildroot}%{_libdir}/systemd/user/user-session.target.wants/lipstick.service
Expand Down

0 comments on commit 9bb1349

Please sign in to comment.