Skip to content

Commit

Permalink
Merge pull request #20 from PureTryOut/cmake
Browse files Browse the repository at this point in the history
Port to CMake
  • Loading branch information
neochapay committed Jan 28, 2021
2 parents 7b386e9 + bf08067 commit c141d82
Show file tree
Hide file tree
Showing 71 changed files with 93 additions and 229 deletions.
40 changes: 40 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
cmake_minimum_required(VERSION 3.1.0)

project(glacier-settings
VERSION 0.0.12
DESCRIPTION "The Glacier settings application")

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

include(FeatureSummary)
include(GNUInstallDirs)

set(QT_MIN_VERSION "5.6.0")
find_package(Qt5 COMPONENTS Qml Quick Positioning LinguistTools REQUIRED)
find_package(Glacier COMPONENTS App REQUIRED)

add_subdirectory(src)

# Translations
file(GLOB TS_FILES translations/*.ts)
#set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_INSTALL_LOCALEDIR})
qt5_add_translation(QM_FILES ${TS_FILES})
add_custom_target(translations DEPENDS ${QM_FILES})
add_dependencies(glacier-settings translations)

install(FILES ${QM_FILES}
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/glacier-settings/translations)

install(FILES glacier-settings.desktop
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
install(FILES data/org.nemomobile.qmlsettings.service
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services)
install(FILES glacier-settings.privileges
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/mapplauncherd/privileges.d)
install(FILES glacier-settings.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/glacier-settings)

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
225 changes: 0 additions & 225 deletions glacier-settings.pro

This file was deleted.

16 changes: 12 additions & 4 deletions rpm/glacier-settings.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Name: glacier-settings
Summary: Glacier Settings
Version: 0.1
Release: 1
Release: 3
Group: System/Settings
License: LGPL
URL: https://github.com/nemomobile-ux/glacier-settings
Expand All @@ -31,6 +31,7 @@ Requires: qt5-qtdeclarative-import-positioning
Requires: qt5-plugin-position-geoclue
%endif

BuildRequires: cmake
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Quick)
Expand Down Expand Up @@ -84,12 +85,19 @@ This is just example plugin
%setup -q -n %{name}-%{version}

%build
%qtc_qmake5
%qtc_make %{?_smp_mflags}
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_VERBOSE_MAKEFILE=ON \
..
cmake --build .

%install
cd build
rm -rf %{buildroot}
%qmake5_install
DESTDIR=%{buildroot} cmake --build . --target install

%lrelease %{buildroot}%{_datadir}/%{name}/translations/*.ts

Expand Down
41 changes: 41 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
set(SRC
main.cpp
models/imagesmodel.cpp
models/imagesmodel.h
models/satellitemodel.cpp
models/satellitemodel.h
models/settingsmodel.cpp
models/settingsmodel.h)
set(QML_PLUGINS
qml/plugins/example/example.json
qml/plugins/bluez/bluez.json
qml/plugins/developermode/developermode.json
qml/plugins/display/display.json
qml/plugins/datetime/datetime.json
qml/plugins/wifi/wifi.json
qml/plugins/gps/gps.json
qml/plugins/nfc/nfc.json
qml/plugins/language/language.json
qml/plugins/about/about.json
qml/plugins/keyboard/keyboard.json
qml/plugins/usb/usb.json
qml/plugins/devicelock/devicelock.json
qml/plugins/mobile/mobile.json
qml/plugins/powersave/powersave.json)

qt5_create_translation(QT_FILES ${SRC})

add_executable(glacier-settings ${SRC} ${QT_FILES})

target_link_libraries(glacier-settings
Qt5::Qml
Qt5::Quick
Qt5::Positioning
Glacier::App)
install(TARGETS glacier-settings RUNTIME
DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${QML_PLUGINS}
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/glacier-settings/plugins)
install(DIRECTORY qml
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/glacier-settings
PATTERN "*.json" EXCLUDE)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes

0 comments on commit c141d82

Please sign in to comment.