forked from blue/squawk
build: WIP CMakeLists refactoring
This commit is contained in:
parent
b7b70bc198
commit
6e06a1d5bc
21 changed files with 214 additions and 264 deletions
|
@ -1,43 +1,5 @@
|
|||
cmake_minimum_required(VERSION 3.3)
|
||||
project(squawkUI)
|
||||
|
||||
# Instruct CMake to run moc automatically when needed.
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
# Instruct CMake to create code from Qt designer ui files
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
# Find the QtWidgets library
|
||||
find_package(Qt5 CONFIG REQUIRED COMPONENTS Widgets DBus Core)
|
||||
find_package(Boost 1.36.0 REQUIRED)
|
||||
if(Boost_FOUND)
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
endif()
|
||||
target_sources(squawk PRIVATE squawk.cpp squawk.h squawk.ui)
|
||||
|
||||
add_subdirectory(models)
|
||||
add_subdirectory(utils)
|
||||
add_subdirectory(widgets)
|
||||
|
||||
set(squawkUI_SRC
|
||||
squawk.cpp
|
||||
models/accounts.cpp
|
||||
models/roster.cpp
|
||||
models/item.cpp
|
||||
models/account.cpp
|
||||
models/contact.cpp
|
||||
models/presence.cpp
|
||||
models/group.cpp
|
||||
models/room.cpp
|
||||
models/abstractparticipant.cpp
|
||||
models/participant.cpp
|
||||
models/reference.cpp
|
||||
models/messagefeed.cpp
|
||||
models/element.cpp
|
||||
)
|
||||
|
||||
# Tell CMake to create the helloworld executable
|
||||
add_library(squawkUI STATIC ${squawkUI_SRC})
|
||||
|
||||
# Use the Widgets module from Qt 5.
|
||||
target_link_libraries(squawkUI squawkWidgets)
|
||||
target_link_libraries(squawkUI squawkUIUtils)
|
||||
target_link_libraries(squawkUI Qt5::Widgets)
|
||||
target_link_libraries(squawkUI Qt5::DBus)
|
||||
|
|
28
ui/models/CMakeLists.txt
Normal file
28
ui/models/CMakeLists.txt
Normal file
|
@ -0,0 +1,28 @@
|
|||
target_sources(squawk PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/abstractparticipant.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/abstractparticipant.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/account.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/account.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/accounts.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/accounts.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/contact.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/contact.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/element.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/element.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/group.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/group.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/item.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/item.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/messagefeed.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/messagefeed.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/participant.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/participant.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/presence.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/presence.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/reference.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/reference.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/room.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/room.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/roster.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/roster.h
|
||||
)
|
|
@ -39,7 +39,7 @@
|
|||
#include "models/roster.h"
|
||||
#include "widgets/vcard/vcard.h"
|
||||
|
||||
#include "shared.h"
|
||||
#include "shared/shared.h"
|
||||
|
||||
namespace Ui {
|
||||
class Squawk;
|
||||
|
|
|
@ -1,32 +1,26 @@
|
|||
cmake_minimum_required(VERSION 3.3)
|
||||
project(squawkUIUtils)
|
||||
|
||||
# Instruct CMake to run moc automatically when needed.
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
# Instruct CMake to create code from Qt designer ui files
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
# Find the QtWidgets library
|
||||
find_package(Qt5 CONFIG REQUIRED COMPONENTS Widgets Core)
|
||||
|
||||
set(squawkUIUtils_SRC
|
||||
# messageline.cpp
|
||||
# message.cpp
|
||||
resizer.cpp
|
||||
# image.cpp
|
||||
flowlayout.cpp
|
||||
badge.cpp
|
||||
progress.cpp
|
||||
comboboxdelegate.cpp
|
||||
feedview.cpp
|
||||
messagedelegate.cpp
|
||||
exponentialblur.cpp
|
||||
shadowoverlay.cpp
|
||||
)
|
||||
|
||||
# Tell CMake to create the helloworld executable
|
||||
add_library(squawkUIUtils STATIC ${squawkUIUtils_SRC})
|
||||
|
||||
# Use the Widgets module from Qt 5.
|
||||
target_link_libraries(squawkUIUtils squawkWidgets)
|
||||
target_link_libraries(squawkUIUtils Qt5::Widgets)
|
||||
target_sources(squawk PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/badge.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/badge.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/comboboxdelegate.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/comboboxdelegate.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/exponentialblur.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/exponentialblur.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/feedview.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/feedview.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/flowlayout.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/flowlayout.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/image.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/image.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/message.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/message.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/messagedelegate.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/messagedelegate.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/messageline.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/messageline.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/progress.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/progress.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/resizer.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/resizer.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/shadowoverlay.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/shadowoverlay.h
|
||||
)
|
|
@ -1,31 +1,23 @@
|
|||
cmake_minimum_required(VERSION 3.0)
|
||||
project(squawkWidgets)
|
||||
|
||||
# Instruct CMake to run moc automatically when needed.
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
# Instruct CMake to create code from Qt designer ui files
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
# Find the QtWidgets library
|
||||
find_package(Qt5Widgets CONFIG REQUIRED COMPONENTS Widgets Core)
|
||||
target_sources(squawk PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/account.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/account.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/account.ui
|
||||
${CMAKE_CURRENT_LIST_DIR}/accounts.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/accounts.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/accounts.ui
|
||||
${CMAKE_CURRENT_LIST_DIR}/chat.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/chat.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/conversation.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/conversation.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/conversation.ui
|
||||
${CMAKE_CURRENT_LIST_DIR}/joinconference.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/joinconference.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/joinconference.ui
|
||||
${CMAKE_CURRENT_LIST_DIR}/newcontact.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/newcontact.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/newcontact.ui
|
||||
${CMAKE_CURRENT_LIST_DIR}/room.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/room.h
|
||||
)
|
||||
|
||||
add_subdirectory(vcard)
|
||||
|
||||
set(squawkWidgets_SRC
|
||||
conversation.cpp
|
||||
chat.cpp
|
||||
room.cpp
|
||||
newcontact.cpp
|
||||
accounts.cpp
|
||||
account.cpp
|
||||
joinconference.cpp
|
||||
)
|
||||
|
||||
add_library(squawkWidgets STATIC ${squawkWidgets_SRC})
|
||||
|
||||
# Use the Widgets module from Qt 5.
|
||||
target_link_libraries(squawkWidgets vCardUI)
|
||||
target_link_libraries(squawkWidgets squawkUIUtils)
|
||||
target_link_libraries(squawkWidgets Qt5::Widgets)
|
||||
|
||||
qt5_use_modules(squawkWidgets Core Widgets)
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <QDesktopServices>
|
||||
|
||||
#include "shared/message.h"
|
||||
#include "order.h"
|
||||
#include "shared/order.h"
|
||||
#include "ui/models/account.h"
|
||||
#include "ui/models/roster.h"
|
||||
#include "ui/utils/flowlayout.h"
|
||||
|
|
|
@ -1,22 +1,9 @@
|
|||
cmake_minimum_required(VERSION 3.0)
|
||||
project(vCardUI)
|
||||
|
||||
# Instruct CMake to run moc automatically when needed.
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
# Instruct CMake to create code from Qt designer ui files
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
# Find the QtWidgets library
|
||||
find_package(Qt5Widgets CONFIG REQUIRED)
|
||||
|
||||
set(vCardUI_SRC
|
||||
vcard.cpp
|
||||
emailsmodel.cpp
|
||||
phonesmodel.cpp
|
||||
)
|
||||
|
||||
# Tell CMake to create the helloworld executable
|
||||
add_library(vCardUI STATIC ${vCardUI_SRC})
|
||||
|
||||
# Use the Widgets module from Qt 5.
|
||||
target_link_libraries(vCardUI Qt5::Widgets)
|
||||
target_sources(squawk PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/emailsmodel.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/emailsmodel.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/phonesmodel.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/phonesmodel.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/vcard.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/vcard.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/vcard.ui
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue