Commit 10e86dd7 authored by Alexandre Lision's avatar Alexandre Lision

Add CMakeLists.txt

This commit switch compilation to cmake
We now properly set the App icon (.icns file)
parent 21ceea22
......@@ -28,7 +28,7 @@
*.app
# Qt-es
*.user
/.qmake.cache
/.qmake.stash
*.pro.user
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
IF(POLICY CMP0022)
CMAKE_POLICY(SET CMP0022 NEW)
ENDIF(POLICY CMP0022)
PROJECT(RingClient)
ADD_DEFINITIONS("-std=c++0x")
FIND_PACKAGE(Qt5Core REQUIRED)
FIND_PACKAGE(Qt5Gui REQUIRED)
FIND_PACKAGE(Qt5Widgets REQUIRED)
FIND_PACKAGE(LibRingClient REQUIRED)
# Instruct CMake to run moc automatically when needed.
SET(CMAKE_AUTOMOC ON)
INCLUDE_DIRECTORIES(SYSTEM ${Qt5Core_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(SYSTEM ${Qt5Gui_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${LIB_RING_CLIENT_INCLUDE_DIR})
MESSAGE("LibRingClient is here:" ${LIB_RING_CLIENT_INCLUDE_DIR})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
#Files to compile
SET(ringclient_SRCS
main.cpp
mainwindow.cpp
mysearchbar.cpp)
SET(ringclient_FORMS
mainwindow.ui)
QT5_WRAP_UI(ringclient_FORMS_HEADERS ${ringclient_FORMS})
SET(ringclient_HDRS
mainwindox.h
mysearchbar.h)
MESSAGE("BINARY IS HERE:" ${LIB_RING_CLIENT_LIBRARY})
# Icons
# NOTE: Don't include the path in MACOSX_BUNDLE_ICON_FILE -- this is
# the property added to Info.plist
SET(MACOSX_BUNDLE_ICON_FILE appicon.icns)
# And this part tells CMake where to find and install the file itself
SET(myApp_ICON ${CMAKE_CURRENT_SOURCE_DIR}/data/appicon.icns)
SET_SOURCE_FILES_PROPERTIES(${myApp_ICON} PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources")
ADD_EXECUTABLE(RingClient MACOSX_BUNDLE
${ringclient_SRCS}
${ringclient_HEADERS_MOC}
${ringclient_FORMS_HEADERS}
${myApp_ICON})
TARGET_LINK_LIBRARIES( RingClient
${LIB_RING_CLIENT_LIBRARY}
${QT_QTCORE_LIBRARY}
${Qt5Widgets_LIBRARIES}
${QT_QTGUI_LIBRARY}
)
#-------------------------------------------------
#
# Project created by QtCreator 2014-12-02T09:49:01
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Ring
TEMPLATE = app
CONFIG += c++11
SOURCES += main.cpp\
mainwindow.cpp \
mysearchbar.cpp
HEADERS += mainwindow.h \
mysearchbar.h
FORMS += mainwindow.ui
macx: LIBS += -L$$PWD/build/ -lqtsflphone
INCLUDEPATH += $$PWD/../sflphone/kde/src/lib
DEPENDPATH += $$PWD/../sflphone/kde/src/lib
RESOURCES += \
data.qrc
......@@ -82,9 +82,6 @@ void MainWindow::connectSlots()
QObject::connect(callModel_, SIGNAL(incomingCall(Call*)),
this, SLOT(incoming_call(Call*)));
connect(&pollTimer_, SIGNAL(timeout()), this, SLOT(pollEvents()));
pollTimer_.start(1000);
}
void MainWindow::showAnswerBar()
......@@ -183,6 +180,7 @@ void MainWindow::incoming_call(Call *call)
void MainWindow::on_call_button_clicked()
{
mainCall_ = CallModel::instance()->dialingCall();
qDebug() << "ICI" << ui->search_bar->text();
mainCall_->setDialNumber(ui->search_bar->text());
mainCall_->performAction(Call::Action::ACCEPT);
}
......@@ -203,13 +201,6 @@ void MainWindow::on_answer_button_clicked()
transformAnswerBar();
}
void MainWindow::pollEvents()
{
qDebug() << "Poll Events?";
AccountModel::currentAccount()->poll_events();
}
void MainWindow::on_decline_button_clicked()
{
......
......@@ -47,7 +47,6 @@ private slots:
void incoming_call(Call* call);
void on_call_button_clicked();
void on_hangup_button_clicked();
void pollEvents();
void on_answer_button_clicked();
......@@ -60,7 +59,6 @@ private:
Call* mainCall_{nullptr};
Account* mainAccount_;
LegacyHistoryBackend* backend_;
QTimer pollTimer_;
QPoint clickPos_{QPoint(0,0)};
};
......
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