Skip to content

Commit

Permalink
Add CMake project
Browse files Browse the repository at this point in the history
  • Loading branch information
plfiorini committed Nov 25, 2014
1 parent 00c4c02 commit 3c8cbd7
Show file tree
Hide file tree
Showing 23 changed files with 463 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,2 +1,2 @@
*.qmlproject
build/
*.user
4 changes: 4 additions & 0 deletions AUTHORS
@@ -0,0 +1,4 @@
Authors
=======

Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
73 changes: 73 additions & 0 deletions CMakeLists.txt
@@ -0,0 +1,73 @@
project(Hawaii)

cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)

# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)

# Instruct CMake to run moc automatically when needed
set(CMAKE_AUTOMOC ON)

# Options
option(ENABLE_SYSTEMD "Enables systemd support" OFF)

# Set version
set(HAWAII_VERSION_MAJOR 0)
set(HAWAII_VERSION_MINOR 0)
set(HAWAII_VERSION_PATCH 0)
set(HAWAII_VERSION_STRING "${HAWAII_VERSION_MAJOR}.${HAWAII_VERSION_MINOR}.${HAWAII_VERSION_PATCH}")

# ECM
find_package(ECM 0.0.11 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

# Installation directories
include(KDEInstallDirs)

# Other macros
include(KDECMakeSettings)
include(KDECompilerSettings)

# Macro to print feature summary
include(FeatureSummary)

# Add custom uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")

# Set up packaging
set(CPACK_PACKAGE_NAME "kahai")
set(CPACK_PACKAGE_VERSION "${HAWAII_VERSION_STRING}")
set(CPACK_GENERATOR "TGZ")
set(CPACK_SET_DESTDIR FALSE)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
set(CPACK_SOURCE_IGNORE_FILES "/build/;/.git;/*.user;/.tx/;~$;${CPACK_SOURCE_IGNORE_FILES}")
include(CPack)
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)

# Build flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wno-unused-parameter -std=c++11")

# Assume release build by default
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "" FORCE)
endif()

# Minimum version requirements
set(QT_MIN_VERSION "5.3.0")
set(KF5_MIN_VERSION "5.1.0")

# Find Qt5
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Qml Quick)

# Find KF5
find_package(KF5 REQUIRED COMPONENTS Package)

# Subdirectories
add_subdirectory(shells)

# Display featute summary
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
339 changes: 339 additions & 0 deletions COPYING

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions cmake_uninstall.cmake.in
@@ -0,0 +1,18 @@
IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")

file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
if(EXISTS "$ENV{DESTDIR}${file}")
exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT VARIABLE rm_out RETURN_VALUE rm_retval)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
endif(NOT "${rm_retval}" STREQUAL 0)
else(EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
endif(EXISTS "$ENV{DESTDIR}${file}")
endforeach(file ${files})
1 change: 1 addition & 0 deletions shells/CMakeLists.txt
@@ -0,0 +1 @@
kpackage_install_package(desktop org.hawaii.desktop greenisland/compositors)
2 changes: 1 addition & 1 deletion App.qml → shells/desktop/contents/App.qml
Expand Up @@ -30,7 +30,7 @@ import QtQuick.Controls 1.1
import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import "indicators"
import "plasmapackage:/indicators"

Window {
id: shellRoot
Expand Down
2 changes: 1 addition & 1 deletion Clock.qml → shells/desktop/contents/Clock.qml
Expand Up @@ -28,7 +28,7 @@ import QtQuick 2.0
import QtQuick.Layouts 1.0
import QtQuick.Controls 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import "."
import "plasmapackage:/"

ColumnLayout {
property string timeFormat
Expand Down
4 changes: 2 additions & 2 deletions Indicator.qml → shells/desktop/contents/Indicator.qml
Expand Up @@ -27,8 +27,8 @@
import QtQuick 2.0
import QtQuick.Controls 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import "."
import "components"
import "plasmapackage:/"
import "plasmapackage:/components"

Item {
property string name
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion Panel.qml → shells/desktop/contents/Panel.qml
Expand Up @@ -28,7 +28,7 @@ import QtQuick 2.0
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import "indicators"
import "plasmapackage:/indicators"

Rectangle {
property Indicator selectedIndicator: null
Expand Down
Expand Up @@ -27,7 +27,7 @@
import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import "."
import "plasmapackage:/"

Item {
default property alias contents: background.children
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -28,7 +28,7 @@ import QtQuick 2.0
import QtQuick.Layouts 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
import ".."
import "plasmapackage:/"

Indicator {
//batteryType: "Mouse"
Expand Down
Expand Up @@ -28,7 +28,7 @@ import QtQuick 2.0
import QtQuick.Layouts 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
import ".."
import "plasmapackage:/"

Indicator {
name: "chat"
Expand Down
Expand Up @@ -29,7 +29,7 @@ import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
import ".."
import "plasmapackage:/"
import "../components"

MouseArea {
Expand Down
Expand Up @@ -29,7 +29,7 @@ import QtQuick 2.0
import QtQuick.Layouts 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
import ".."
import "plasmapackage:/"

Indicator {
property int notificationId: 0
Expand Down
Expand Up @@ -27,7 +27,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.0
import org.kde.plasma.extras 2.0 as PlasmaExtras
import ".."
import "plasmapackage:/"

Indicator {
name: "network"
Expand Down
Expand Up @@ -27,7 +27,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.0
import org.kde.plasma.extras 2.0 as PlasmaExtras
import ".."
import "plasmapackage:/"

Indicator {
name: "settings"
Expand Down
Expand Up @@ -27,7 +27,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.0
import org.kde.plasma.extras 2.0 as PlasmaExtras
import ".."
import "plasmapackage:/"

Indicator {
name: "settings"
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions shells/desktop/metadata.desktop
@@ -0,0 +1,14 @@
[Desktop Entry]
Name=Desktop
Type=Service

X-KDE-ServiceTypes=GreenIsland/Compositor
X-KDE-ParentApp=
X-KDE-PluginInfo-Author=Pier Luigi Fiorini
X-KDE-PluginInfo-Category=
X-KDE-PluginInfo-Email=pierluigi.fiorini@gmail.com
X-KDE-PluginInfo-License=GPLv2+
X-KDE-PluginInfo-Name=org.hawaii.desktop
X-KDE-PluginInfo-Version=0.0.0
X-KDE-PluginInfo-Website=

0 comments on commit 3c8cbd7

Please sign in to comment.