Commit dc67fcc3 authored by Ghislain MARY's avatar Ghislain MARY

Fix build on Windows.

parent 66ee3705
...@@ -32,6 +32,7 @@ include(GNUInstallDirs) ...@@ -32,6 +32,7 @@ include(GNUInstallDirs)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
if(NOT WIN32)
set(CUSTOM_FLAGS "\ set(CUSTOM_FLAGS "\
-Wall \ -Wall \
-Wcast-align \ -Wcast-align \
...@@ -49,6 +50,7 @@ set(CUSTOM_FLAGS "\ ...@@ -49,6 +50,7 @@ set(CUSTOM_FLAGS "\
-Wuninitialized \ -Wuninitialized \
-Wunused \ -Wunused \
") ")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG")
...@@ -59,8 +61,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG -DQT_DECLARAT ...@@ -59,8 +61,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG -DQT_DECLARAT
set(QT5_PACKAGES Core Gui Quick Widgets QuickControls2 LinguistTools) set(QT5_PACKAGES Core Gui Quick Widgets QuickControls2 LinguistTools)
find_package(Linphone REQUIRED) find_package(Linphone REQUIRED)
find_package(LinphoneCxx REQUIRED)
set(LIBS "${CMAKE_SOURCE_DIR}/../OUTPUT/desktop/lib64/liblinphone++.so")
set(SOURCES set(SOURCES
src/app/App.cpp src/app/App.cpp
...@@ -161,10 +162,12 @@ foreach (line ${QRC_RESOURCES_CONTENT}) ...@@ -161,10 +162,12 @@ foreach (line ${QRC_RESOURCES_CONTENT})
endif () endif ()
endforeach () endforeach ()
add_custom_target( if(NOT WIN32)
check_qml DEPENDS ${QML_SOURCES} add_custom_target(
COMMAND "${CMAKE_SOURCE_DIR}/tools/check_qml_syntax" check_qml DEPENDS ${QML_SOURCES}
) COMMAND "${CMAKE_SOURCE_DIR}/tools/check_qml_syntax"
)
endif()
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Init git hooks. # Init git hooks.
...@@ -190,9 +193,15 @@ qt5_add_resources(RESOURCES ${QRC_RESOURCES}) ...@@ -190,9 +193,15 @@ qt5_add_resources(RESOURCES ${QRC_RESOURCES})
# Build. # Build.
# Note: `update_translations` is provided by `languages/CMakeLists.txt`. # Note: `update_translations` is provided by `languages/CMakeLists.txt`.
add_executable(${LINPHONE_EXEC} ${SOURCES} ${HEADERS} ${RESOURCES}) if(WIN32)
add_dependencies(${LINPHONE_EXEC} update_translations) add_executable(${LINPHONE_EXEC} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES})
add_dependencies(update_translations check_qml) else()
add_executable(${LINPHONE_EXEC} ${SOURCES} ${HEADERS} ${RESOURCES})
endif()
add_dependencies(${LINPHONE_EXEC} update_translations)
if(NOT WIN32)
add_dependencies(update_translations check_qml)
endif()
target_include_directories(${LINPHONE_EXEC} SYSTEM PRIVATE "${LINPHONE_INCLUDE_DIRS}") target_include_directories(${LINPHONE_EXEC} SYSTEM PRIVATE "${LINPHONE_INCLUDE_DIRS}")
foreach (package ${QT5_PACKAGES}) foreach (package ${QT5_PACKAGES})
...@@ -204,7 +213,7 @@ foreach (package ${QT5_PACKAGES}) ...@@ -204,7 +213,7 @@ foreach (package ${QT5_PACKAGES})
endif() endif()
endforeach () endforeach ()
target_link_libraries(${LINPHONE_EXEC} ${LIBS} ${LINPHONE_LIBRARIES}) target_link_libraries(${LINPHONE_EXEC} ${LINPHONE_LIBRARIES} ${LINPHONECXX_LIBRARIES})
install(TARGETS ${LINPHONE_EXEC} install(TARGETS ${LINPHONE_EXEC}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
......
#include <QMenu>
#include <QQmlComponent>
#include <QQmlContext>
#include <QQuickView>
#include <QtDebug>
#include "../components/calls/CallsListModel.hpp" #include "../components/calls/CallsListModel.hpp"
#include "../components/camera/Camera.hpp" #include "../components/camera/Camera.hpp"
#include "../components/chat/ChatProxyModel.hpp" #include "../components/chat/ChatProxyModel.hpp"
...@@ -16,6 +10,12 @@ ...@@ -16,6 +10,12 @@
#include "App.hpp" #include "App.hpp"
#include <QMenu>
#include <QQmlComponent>
#include <QQmlContext>
#include <QQuickView>
#include <QtDebug>
#define LANGUAGES_PATH ":/languages/" #define LANGUAGES_PATH ":/languages/"
#define WINDOW_ICON_PATH ":/assets/images/linphone.png" #define WINDOW_ICON_PATH ":/assets/images/linphone.png"
......
#ifndef APP_H_ #ifndef APP_H_
#define APP_H_ #define APP_H_
#include "../components/notifier/Notifier.hpp"
#include "AvatarProvider.hpp"
#include "DefaultTranslator.hpp"
#include "ThumbnailProvider.hpp"
#include <QApplication> #include <QApplication>
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
#include <QQmlFileSelector> #include <QQmlFileSelector>
#include <QQuickWindow> #include <QQuickWindow>
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
#include "../components/notifier/Notifier.hpp"
#include "AvatarProvider.hpp"
#include "DefaultTranslator.hpp"
#include "ThumbnailProvider.hpp"
// ============================================================================= // =============================================================================
class App : public QApplication { class App : public QApplication {
......
#include "Camera.hpp"
#include <QOpenGLFunctions> #include <QOpenGLFunctions>
#include <QOpenGLTexture> #include <QOpenGLTexture>
#include <QtMath> #include <QtMath>
#include "Camera.hpp"
// ============================================================================= // =============================================================================
struct CameraStateBinder { struct CameraStateBinder {
......
#ifndef CAMERA_H_ #ifndef CAMERA_H_
#define CAMERA_H_ #define CAMERA_H_
#include "../call/CallModel.hpp"
#include <QOpenGLFramebufferObject> #include <QOpenGLFramebufferObject>
#include <QQuickFramebufferObject> #include <QQuickFramebufferObject>
#include "../call/CallModel.hpp"
// ============================================================================= // =============================================================================
class Camera; class Camera;
......
#ifndef CHAT_PROXY_MODEL_H_ #ifndef CHAT_PROXY_MODEL_H_
#define CHAT_PROXY_MODEL_H_ #define CHAT_PROXY_MODEL_H_
#include <QSortFilterProxyModel>
#include "ChatModel.hpp" #include "ChatModel.hpp"
#include <QSortFilterProxyModel>
// ============================================================================= // =============================================================================
class ChatProxyModel : public QSortFilterProxyModel { class ChatProxyModel : public QSortFilterProxyModel {
......
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
#define CONTACTS_LIST_MODEL_H_ #define CONTACTS_LIST_MODEL_H_
#include <linphone++/linphone.hh> #include <linphone++/linphone.hh>
#include <QAbstractListModel>
#include "../contact/ContactModel.hpp" #include "../contact/ContactModel.hpp"
#include <QAbstractListModel>
// ============================================================================= // =============================================================================
class ContactsListModel : public QAbstractListModel { class ContactsListModel : public QAbstractListModel {
......
#ifndef CONTACTS_LIST_PROXY_MODEL_H_ #ifndef CONTACTS_LIST_PROXY_MODEL_H_
#define CONTACTS_LIST_PROXY_MODEL_H_ #define CONTACTS_LIST_PROXY_MODEL_H_
#include <QSortFilterProxyModel>
#include "../contact/ContactModel.hpp" #include "../contact/ContactModel.hpp"
#include <QSortFilterProxyModel>
// ============================================================================= // =============================================================================
class ContactsListModel; class ContactsListModel;
......
#include "../../app/App.hpp"
#include "Notifier.hpp"
#include <QQmlComponent> #include <QQmlComponent>
#include <QQuickWindow> #include <QQuickWindow>
#include <QtDebug> #include <QtDebug>
#include <QTimer> #include <QTimer>
#include "../../app/App.hpp"
#include "Notifier.hpp"
// Notifications QML properties/methods. // Notifications QML properties/methods.
#define NOTIFICATION_SHOW_METHOD_NAME "show" #define NOTIFICATION_SHOW_METHOD_NAME "show"
......
#ifndef ACCOUNT_SETTINGS_MODEL_H_ #ifndef ACCOUNT_SETTINGS_MODEL_H_
#define ACCOUNT_SETTINGS_MODEL_H_ #define ACCOUNT_SETTINGS_MODEL_H_
#include <QObject>
#include "../presence/Presence.hpp" #include "../presence/Presence.hpp"
#include <QObject>
// =================================================================== // ===================================================================
class AccountSettingsModel : public QObject { class AccountSettingsModel : public QObject {
......
#ifndef SIP_ADDRESSES_MODEL_H_ #ifndef SIP_ADDRESSES_MODEL_H_
#define SIP_ADDRESSES_MODEL_H_ #define SIP_ADDRESSES_MODEL_H_
#include <QAbstractListModel>
#include "../chat/ChatModel.hpp" #include "../chat/ChatModel.hpp"
#include "../contact/ContactModel.hpp" #include "../contact/ContactModel.hpp"
#include "../contact/ContactObserver.hpp" #include "../contact/ContactObserver.hpp"
#include <QAbstractListModel>
// ============================================================================= // =============================================================================
class CoreHandlers; class CoreHandlers;
......
#ifndef SMART_SEARCH_BAR_MODEL_H_ #ifndef SMART_SEARCH_BAR_MODEL_H_
#define SMART_SEARCH_BAR_MODEL_H_ #define SMART_SEARCH_BAR_MODEL_H_
#include <QSortFilterProxyModel>
#include "../sip-addresses/SipAddressesModel.hpp" #include "../sip-addresses/SipAddressesModel.hpp"
#include <QSortFilterProxyModel>
// ============================================================================= // =============================================================================
class SmartSearchBarModel : public QSortFilterProxyModel { class SmartSearchBarModel : public QSortFilterProxyModel {
......
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