Initialisation of Qt resources must happen from main

Updated CMake config for ICommand

Builds with CMake, but resources doesn't work yet

Initial CMake stuff. Also modified config.h.in template for CMake.

Co-authored-by: Tomatix <iirc@trollskap.no>
Reviewed-on: http://git.idealirc.org:3000/idealirc/idealirc/pulls/20
pull/30/head
Tomatix 4 years ago
parent 0dddc4d06e
commit 4aeb60a8e7
  1. 2
      .gitignore
  2. 23
      CMake/Git.cmake
  3. 8
      CMake/config_h_warning.cmake
  4. 62
      CMakeLists.txt
  5. 28
      ICommand/CMakeLists.txt
  6. 30
      IConfig/CMakeLists.txt
  7. 8
      IConfig/IConfig.ui
  8. 26
      IRCClient/CMakeLists.txt
  9. 19
      IWin/CMakeLists.txt
  10. 203
      IdealIRC.pro
  11. 0
      IdealIRC/AboutIIRC.cpp
  12. 0
      IdealIRC/AboutIIRC.h
  13. 6
      IdealIRC/AboutIIRC.ui
  14. 0
      IdealIRC/ButtonbarMgr.cpp
  15. 0
      IdealIRC/ButtonbarMgr.h
  16. 42
      IdealIRC/CMakeLists.txt
  17. 0
      IdealIRC/ConfigMgr.cpp
  18. 0
      IdealIRC/ConfigMgr.h
  19. 0
      IdealIRC/IRC.cpp
  20. 0
      IdealIRC/IRC.h
  21. 2
      IdealIRC/IdealIRC.cpp
  22. 0
      IdealIRC/IdealIRC.h
  23. 10
      IdealIRC/IdealIRC.ui
  24. 0
      IdealIRC/IniFile.cpp
  25. 0
      IdealIRC/IniFile.h
  26. 0
      IdealIRC/InputHandler.cpp
  27. 0
      IdealIRC/InputHandler.h
  28. 0
      IdealIRC/MdiManager.cpp
  29. 0
      IdealIRC/MdiManager.h
  30. 0
      IdealIRC/Numeric.h
  31. 0
      IdealIRC/ScriptEvent.h
  32. 2
      IdealIRC/main.cpp
  33. 7
      Resources/CMakeLists.txt
  34. 0
      Resources/Icons/add.png
  35. 0
      Resources/Icons/exclamation.png
  36. 0
      Resources/Icons/icon.png
  37. 0
      Resources/Icons/iconcutted.png
  38. 0
      Resources/Icons/log.png
  39. 0
      Resources/Icons/options.png
  40. 0
      Resources/Icons/refresh.png
  41. 0
      Resources/Icons/remove.png
  42. 0
      Resources/Icons/script.png
  43. 0
      Resources/Icons/server.png
  44. 0
      Resources/resources.qrc
  45. 25
      Script/Builtin/CMakeLists.txt
  46. 37
      Script/CMakeLists.txt
  47. 10
      Script/Manager.ui
  48. 10
      ScriptDialog/CMakeLists.txt
  49. 14
      ScriptFunctions/CMakeLists.txt
  50. 14
      Widgets/CMakeLists.txt
  51. 30
      config.h.in

2
.gitignore vendored

@ -18,3 +18,5 @@ config.h
*.autosave
.idea
obsolete
testing
Documentation

@ -0,0 +1,23 @@
# From http://xit0.org/2013/04/cmake-use-git-branch-and-commit-details-in-project/
#
# Produces two self-explanatory variables;
# GIT_BRANCH
# GIT_COMMIT_HASH
#
# Get the current working branch
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)

@ -0,0 +1,8 @@
set(config_h_warning
"/*
* =-=-=-=-=-=-=-=-=-=-= WARNING =-=-=-=-=-=-=-=-=-=-=
* This file was created automatically by qmake.
* Do not edit it directly! Changes will most likely
* be lost, edit config.h.in instead.
* =-=-=-=-=-=-=-=-=-=-= WARNING =-=-=-=-=-=-=-=-=-=-=
*/")

@ -0,0 +1,62 @@
cmake_minimum_required(VERSION 3.10)
project(IdealIRC)
#
# Versioning
#
set(BUILD_TYPE "packaged")
set(VERSION_MAJOR 0)
set(VERSION_MINOR 0)
set(VERSION_PATCH 1)
set(VERSION_APPEND "")
#
# CMake build environment setup
#
set(CMAKE_CXX_STANDARD 17)
include(CMake/Git.cmake)
include(CMake/config_h_warning.cmake)
set(IIRC_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${IIRC_SOURCE_DIR})
include_directories(${IIRC_SOURCE_DIR}/IdealIRC)
include_directories(${CMAKE_BINARY_DIR})
# For GCC and Clang, basically.
if (UNIX)
# set(CMAKE_CXX_FLAGS "-Wall -Werror")
set(CMAKE_CXX_FLAGS "-pthread")
endif()
#
# Qt setup
#
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
#
# Project setup
#
configure_file(config.h.in ${CMAKE_BINARY_DIR}/config.h @ONLY)
set(IIRC_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
message("IdealIRC version ${IIRC_VERSION}")
message("Git branch: ${GIT_BRANCH}")
message("Git commit: ${GIT_COMMIT_HASH}")
add_subdirectory(Resources)
add_subdirectory(ICommand)
add_subdirectory(IConfig)
add_subdirectory(IRCClient)
add_subdirectory(IWin)
add_subdirectory(Script)
add_subdirectory(ScriptDialog)
add_subdirectory(ScriptFunctions)
add_subdirectory(Widgets)
add_subdirectory(IdealIRC) # This one builds the binary.

@ -0,0 +1,28 @@
set(component "ICommand")
list(APPEND ${component}_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/CommandData.cpp
${CMAKE_CURRENT_SOURCE_DIR}/CommandData.h
${CMAKE_CURRENT_SOURCE_DIR}/Commands.h
${CMAKE_CURRENT_SOURCE_DIR}/ICommand.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ICommand.h
${CMAKE_CURRENT_SOURCE_DIR}/ICommandPriv.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ICommandPriv.h
)
list(APPEND ${component}_SOURCES_Internal
${CMAKE_CURRENT_SOURCE_DIR}/Internal/ctcp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Internal/me.cpp
)
list(APPEND ${component}_SOURCES_External
${CMAKE_CURRENT_SOURCE_DIR}/External/kick.cpp
${CMAKE_CURRENT_SOURCE_DIR}/External/notice.cpp
${CMAKE_CURRENT_SOURCE_DIR}/External/privmsg.cpp
)
add_library(${component} STATIC ${${component}_SOURCES} ${${component}_SOURCES_Internal} ${${component}_SOURCES_External})
qt5_use_modules(${component} Widgets)
target_include_directories(${component} PRIVATE ${CMAKE_SOURCE_DIR})

@ -0,0 +1,30 @@
set(component "IConfig")
list(APPEND ${component}_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/ColorConfig.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ColorConfig.h
${CMAKE_CURRENT_SOURCE_DIR}/IConfig.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IConfig.h
${CMAKE_CURRENT_SOURCE_DIR}/IConfig.ui
${CMAKE_CURRENT_SOURCE_DIR}/IConfigLogging.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IConfigLogging.h
${CMAKE_CURRENT_SOURCE_DIR}/IConfigLogging.ui
${CMAKE_CURRENT_SOURCE_DIR}/IConfigOptions.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IConfigOptions.h
${CMAKE_CURRENT_SOURCE_DIR}/IConfigOptions.ui
${CMAKE_CURRENT_SOURCE_DIR}/IConfigServers.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IConfigServers.h
${CMAKE_CURRENT_SOURCE_DIR}/IConfigServers.ui
${CMAKE_CURRENT_SOURCE_DIR}/ServerEditor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ServerEditor.h
${CMAKE_CURRENT_SOURCE_DIR}/ServerEditor.ui
${CMAKE_CURRENT_SOURCE_DIR}/ServerMgr.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ServerMgr.h
${CMAKE_CURRENT_SOURCE_DIR}/ServerModel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ServerModel.h
)
add_library(${component} STATIC ${${component}_SOURCES})
qt5_use_modules(${component} Widgets)
target_link_libraries(${component} Resources)
target_include_directories(${component} PRIVATE ${CMAKE_SOURCE_DIR})

@ -62,7 +62,7 @@
<string>Servers</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/Icons/server.png</normaloff>:/Icons/server.png</iconset>
</property>
<property name="iconSize">
@ -94,7 +94,7 @@
<string>Options</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/Icons/options.png</normaloff>:/Icons/options.png</iconset>
</property>
<property name="iconSize">
@ -126,7 +126,7 @@
<string>Logging</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/Icons/log.png</normaloff>:/Icons/log.png</iconset>
</property>
<property name="iconSize">
@ -219,7 +219,7 @@
</layout>
</widget>
<resources>
<include location="../resources.qrc"/>
<include location="../Resources/resources.qrc"/>
</resources>
<connections/>
</ui>

@ -0,0 +1,26 @@
set(component "IRCClient")
list(APPEND ${component}_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/Commands.h
${CMAKE_CURRENT_SOURCE_DIR}/DCC.cpp
${CMAKE_CURRENT_SOURCE_DIR}/DCC.h
${CMAKE_CURRENT_SOURCE_DIR}/IRCBase.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IRCBase.h
${CMAKE_CURRENT_SOURCE_DIR}/IRCChannel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IRCChannel.h
${CMAKE_CURRENT_SOURCE_DIR}/IRCError.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IRCError.h
${CMAKE_CURRENT_SOURCE_DIR}/IRCMember.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IRCMember.h
${CMAKE_CURRENT_SOURCE_DIR}/IRCMemberEntry.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IRCMemberEntry.h
${CMAKE_CURRENT_SOURCE_DIR}/IRCPrefix.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IRCPrefix.h
${CMAKE_CURRENT_SOURCE_DIR}/Numeric.h
${CMAKE_CURRENT_SOURCE_DIR}/Utilities.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Utilities.h
)
add_library(${component} STATIC ${${component}_SOURCES})
target_link_libraries(${component} fmt crypto ssl)
target_include_directories(${component} PRIVATE ${CMAKE_SOURCE_DIR})

@ -0,0 +1,19 @@
set(component "IWin")
list(APPEND ${component}_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/IWin.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IWin.h
${CMAKE_CURRENT_SOURCE_DIR}/IWinChannel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IWinChannel.h
${CMAKE_CURRENT_SOURCE_DIR}/IWinPrivate.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IWinPrivate.h
${CMAKE_CURRENT_SOURCE_DIR}/IWinStatus.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IWinStatus.h
${CMAKE_CURRENT_SOURCE_DIR}/NicklistController.cpp
${CMAKE_CURRENT_SOURCE_DIR}/NicklistController.h
)
add_library(${component} STATIC ${${component}_SOURCES})
qt5_use_modules(${component} Widgets)
target_link_libraries(${component} IWidgets)
target_include_directories(${component} PRIVATE ${CMAKE_SOURCE_DIR})

@ -1,203 +0,0 @@
# IdealIRC - Internet Relay Chat client
# Copyright (C) 2019 Tom-Andre Barstad
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
QT += core gui widgets
TARGET = IdealIRC
TEMPLATE = app
VERSION_MAJOR = 1
VERSION_MINOR = 0
VERSION_PATCH = 0
VERSION_BUILD = 001
# Two different "build types".
# standalone:
# Read config and skeleton from same folder as the executable.
# packaged:
# Used with installers, and reads config and skeleton from a more system-friendly path.
BUILD_TYPE = packaged
QMAKE_SUBSTITUTES += config.h.in
DEFINES += QT_DEPRECATED_WARNINGS
CONFIG += c++17
unix { QMAKE_CXXFLAGS += -std=c++17 }
win32 | win64 { QMAKE_CXXFLAGS += /std:c++17 }
QMAKE_LFLAGS += -lm -lfmt -lcrypto -lssl
SOURCES += \
ICommand/ICommandPriv.cpp \
IRC.cpp \
Script/Builtin/Builtin.cpp \
Script/Builtin/DialogUtils.cpp \
Script/Builtin/Error.cpp \
Script/Builtin/GeneralUtils.cpp \
Script/Builtin/ListUtils.cpp \
Script/Builtin/MapUtils.cpp \
Script/Builtin/Mathematics.cpp \
Script/Builtin/StringUtils.cpp \
Script/Dialog.cpp \
Script/ManagerListModel.cpp \
Script/Menu.cpp \
Script/ParserToken.cpp \
Script/Script.cpp \
Script/ScriptException.cpp \
Script/SymbolScope.cpp \
Script/Tokenizer.cpp \
Script/Tokens.cpp \
Script/ValueExtract.cpp \
Script/ValueHolder.cpp \
ScriptDialog/ScriptDialog.cpp \
ScriptFunctions/RegisterScriptFunctions.cpp \
ScriptFunctions/ScriptGeneralUtils.cpp \
ScriptFunctions/ScriptIRCUtils.cpp \
main.cpp \
IdealIRC.cpp \
# IMember.cpp \
# IConnection/IConnection.cpp \
IWin/IWin.cpp \
# IChannel.cpp \
# IServer.cpp \
MdiManager.cpp \
IWin/IWinStatus.cpp \
Widgets/IIRCView.cpp \
# IRCReader.cpp \
# IRCPrefix.cpp \
InputHandler.cpp \
ICommand/ICommand.cpp \
ICommand/External/kick.cpp \
ICommand/External/notice.cpp \
ICommand/External/privmsg.cpp \
ICommand/Internal/ctcp.cpp \
ICommand/Internal/me.cpp \
IWin/IWinChannel.cpp \
IWin/IWinPrivate.cpp \
IWin/NicklistController.cpp \
IConfig/IConfig.cpp \
IConfig/IConfigServers.cpp \
IConfig/IConfigOptions.cpp \
IConfig/IConfigLogging.cpp \
AboutIIRC.cpp \
IniFile.cpp \
IConfig/ColorConfig.cpp \
ConfigMgr.cpp \
Widgets/ILineEdit.cpp \
Widgets/IListWidget.cpp \
IConfig/ServerEditor.cpp \
IConfig/ServerMgr.cpp \
IConfig/ServerModel.cpp \
ButtonbarMgr.cpp \
ICommand/CommandData.cpp \
Script/Manager.cpp \
IRCClient/DCC.cpp \
IRCClient/IRCBase.cpp \
IRCClient/IRCChannel.cpp \
IRCClient/IRCError.cpp \
IRCClient/IRCMember.cpp \
IRCClient/IRCMemberEntry.cpp \
IRCClient/IRCPrefix.cpp \
IRCClient/Utilities.cpp \
HEADERS += \
ICommand/ICommandPriv.h \
IRC.h \
IdealIRC.h \
# IMember.h \
# IConnection/IConnection.h \
IWin/IWin.h \
# IChannel.h \
# IServer.h \
MdiManager.h \
IWin/IWinStatus.h \
Script/Builtin/Builtin.h \
Script/Builtin/DialogUtils.h \
Script/Builtin/Error.h \
Script/Builtin/GeneralUtils.h \
Script/Builtin/ListUtils.h \
Script/Builtin/MapUtils.h \
Script/Builtin/Mathematics.h \
Script/Builtin/StringUtils.h \
Script/Dialog.h \
Script/ManagerListModel.h \
Script/Menu.h \
Script/ParserOperator.h \
Script/ParserToken.h \
Script/Script.h \
Script/ScriptException.h \
Script/SymbolScope.h \
Script/Tokenizer.h \
Script/Tokens.h \
Script/ValueExtract.h \
Script/ValueHolder.h \
ScriptDialog/ScriptDialog.h \
ScriptEvent.h \
ScriptFunctions/RegisterScriptFunctions.h \
ScriptFunctions/ScriptGeneralUtils.h \
ScriptFunctions/ScriptIRCUtils.h \
Widgets/IIRCView.h \
# IRCReader.h \
# IRCPrefix.h \
# Numeric.h \
ICommand/Commands.h \
InputHandler.h \
ICommand/ICommand.h \
IWin/IWinChannel.h \
IWin/IWinPrivate.h \
IWin/NicklistController.h \
IConfig/IConfig.h \
IConfig/IConfigServers.h \
IConfig/IConfigOptions.h \
IConfig/IConfigLogging.h \
AboutIIRC.h \
IniFile.h \
IConfig/ColorConfig.h \
ConfigMgr.h \
Widgets/ILineEdit.h \
Widgets/IListWidget.h \
IConfig/ServerEditor.h \
IConfig/ServerMgr.h \
IConfig/ServerModel.h \
ButtonbarMgr.h \
ICommand/CommandData.h \
Script/Manager.h \
IRCClient/Commands.h \
IRCClient/DCC.h \
IRCClient/IRCBase.h \
IRCClient/IRCChannel.h \
IRCClient/IRCError.h \
IRCClient/IRCMember.h \
IRCClient/IRCMemberEntry.h \
IRCClient/IRCPrefix.h \
IRCClient/Numeric.h \
IRCClient/Utilities.h
FORMS += \
IdealIRC.ui \
IConfig/IConfig.ui \
IConfig/IConfigServers.ui \
IConfig/IConfigOptions.ui \
IConfig/IConfigLogging.ui \
AboutIIRC.ui \
IConfig/ServerEditor.ui \
Script/Manager.ui
RESOURCES += \
resources.qrc
DISTFILES += \
events.txt

@ -26,7 +26,7 @@
<string>About IdealIRC</string>
</property>
<property name="windowIcon">
<iconset resource="resources.qrc">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/Icons/iconcutted.png</normaloff>:/Icons/iconcutted.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout">
@ -36,7 +36,7 @@
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;img src=&quot;:/Icons/icon.png&quot; /&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:16pt;&quot;&gt;IdealIRC {ver}&lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans';&quot;&gt;Build type: {buildtype}&lt;/span&gt;&lt;/p&gt;
@ -82,7 +82,7 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
<resources>
<include location="resources.qrc"/>
<include location="../Resources/resources.qrc"/>
</resources>
<connections>
<connection>

@ -0,0 +1,42 @@
set(component "IdealIRC")
list(APPEND ${component}_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/AboutIIRC.cpp
${CMAKE_CURRENT_SOURCE_DIR}/AboutIIRC.h
${CMAKE_CURRENT_SOURCE_DIR}/AboutIIRC.ui
${CMAKE_CURRENT_SOURCE_DIR}/ButtonbarMgr.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ButtonbarMgr.h
${CMAKE_CURRENT_SOURCE_DIR}/ConfigMgr.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ConfigMgr.h
${CMAKE_CURRENT_SOURCE_DIR}/IRC.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IRC.h
${CMAKE_CURRENT_SOURCE_DIR}/IdealIRC.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IdealIRC.h
${CMAKE_CURRENT_SOURCE_DIR}/IdealIRC.ui
${CMAKE_CURRENT_SOURCE_DIR}/IniFile.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IniFile.h
${CMAKE_CURRENT_SOURCE_DIR}/InputHandler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/InputHandler.h
${CMAKE_CURRENT_SOURCE_DIR}/MdiManager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/MdiManager.h
${CMAKE_CURRENT_SOURCE_DIR}/Numeric.h
${CMAKE_CURRENT_SOURCE_DIR}/ScriptEvent.h
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
)
add_executable(${component} ${${component}_SOURCES})
qt5_use_modules(${component} Widgets)
target_link_libraries(${component}
ICommand
IConfig
IRCClient
IWidgets
IWin
Script
ScriptDialog
ScriptFunctions
Resources
)
target_include_directories(${component} PRIVATE ${CMAKE_SOURCE_DIR})

@ -93,7 +93,7 @@ IdealIRC::IdealIRC(QWidget* parent)
const QString title = QString("%1 %2")
.arg(windowTitle())
.arg(VERSION_STRING_NO_BUILD);
.arg(VERSION_STRING_NO_APPEND);
setWindowTitle(title);
trayIcon = new QSystemTrayIcon(QIcon(QStringLiteral(":/Icons/iconcutted.png")), this);
mdiManager = new MdiManager(*ui->mdiArea, *ui->windowButtons, *trayIcon);

@ -14,7 +14,7 @@
<string>IdealIRC</string>
</property>
<property name="windowIcon">
<iconset resource="resources.qrc">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/Icons/iconcutted.png</normaloff>:/Icons/iconcutted.png</iconset>
</property>
<widget class="QWidget" name="centralWidget">
@ -49,7 +49,7 @@
<x>0</x>
<y>0</y>
<width>973</width>
<height>20</height>
<height>19</height>
</rect>
</property>
<property name="contextMenuPolicy">
@ -118,7 +118,7 @@
</action>
<action name="actionOptions">
<property name="icon">
<iconset resource="resources.qrc">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/Icons/options.png</normaloff>:/Icons/options.png</iconset>
</property>
<property name="text">
@ -127,7 +127,7 @@
</action>
<action name="actionScripts">
<property name="icon">
<iconset resource="resources.qrc">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/Icons/script.png</normaloff>:/Icons/script.png</iconset>
</property>
<property name="text">
@ -152,7 +152,7 @@
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
<include location="resources.qrc"/>
<include location="../Resources/resources.qrc"/>
</resources>
<connections>
<connection>

@ -25,6 +25,8 @@ int main(int argc, char *argv[])
{
qSetMessagePattern("[%{time}] %{file}:%{line} %{message}");
Q_INIT_RESOURCE(resources);
QApplication a(argc, argv);
IdealIRC w;
w.show();

@ -0,0 +1,7 @@
set(component "Resources")
qt5_add_resources(${component}_SOURCES ${IIRC_SOURCE_DIR}/Resources/resources.qrc)
add_library(${component} STATIC ${${component}_SOURCES})
qt5_use_modules(${component} Core)
target_include_directories(${component} PRIVATE ${CMAKE_SOURCE_DIR})

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

@ -0,0 +1,25 @@
set(component "ScriptBuiltinFunctions")
list(APPEND ${component}_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/Builtin.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Builtin.h
${CMAKE_CURRENT_SOURCE_DIR}/DialogUtils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/DialogUtils.h
${CMAKE_CURRENT_SOURCE_DIR}/Error.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Error.h
${CMAKE_CURRENT_SOURCE_DIR}/GeneralUtils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/GeneralUtils.h
${CMAKE_CURRENT_SOURCE_DIR}/ListUtils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ListUtils.h
${CMAKE_CURRENT_SOURCE_DIR}/MapUtils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/MapUtils.h
${CMAKE_CURRENT_SOURCE_DIR}/Mathematics.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Mathematics.h
${CMAKE_CURRENT_SOURCE_DIR}/StringUtils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/StringUtils.h
)
add_library(${component} STATIC ${${component}_SOURCES})
qt5_use_modules(${component} Core)
target_link_libraries(${component} m)
target_include_directories(${component} PRIVATE ${CMAKE_SOURCE_DIR})

@ -0,0 +1,37 @@
set(component "Script")
add_subdirectory(Builtin)
list(APPEND ${component}_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/Dialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Dialog.h
${CMAKE_CURRENT_SOURCE_DIR}/Manager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Manager.h
${CMAKE_CURRENT_SOURCE_DIR}/Manager.ui
${CMAKE_CURRENT_SOURCE_DIR}/ManagerListModel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ManagerListModel.h
${CMAKE_CURRENT_SOURCE_DIR}/Menu.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Menu.h
${CMAKE_CURRENT_SOURCE_DIR}/ParserOperator.h
${CMAKE_CURRENT_SOURCE_DIR}/ParserToken.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ParserToken.h
${CMAKE_CURRENT_SOURCE_DIR}/Script.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Script.h
${CMAKE_CURRENT_SOURCE_DIR}/ScriptException.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ScriptException.h
${CMAKE_CURRENT_SOURCE_DIR}/SymbolScope.cpp
${CMAKE_CURRENT_SOURCE_DIR}/SymbolScope.h
${CMAKE_CURRENT_SOURCE_DIR}/Tokenizer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Tokenizer.h
${CMAKE_CURRENT_SOURCE_DIR}/Tokens.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Tokens.h
${CMAKE_CURRENT_SOURCE_DIR}/ValueExtract.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ValueExtract.h
${CMAKE_CURRENT_SOURCE_DIR}/ValueHolder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ValueHolder.h
)
add_library(${component} STATIC ${${component}_SOURCES})
qt5_use_modules(${component} Widgets)
target_link_libraries(${component} ScriptBuiltinFunctions Resources)
target_include_directories(${component} PRIVATE ${CMAKE_SOURCE_DIR})

@ -14,7 +14,7 @@
<string>Script manager</string>
</property>
<property name="windowIcon">
<iconset resource="../resources.qrc">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/Icons/script.png</normaloff>:/Icons/script.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@ -60,7 +60,7 @@
<string>+</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/Icons/add.png</normaloff>:/Icons/add.png</iconset>
</property>
<property name="iconSize">
@ -77,7 +77,7 @@
<string>@</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/Icons/refresh.png</normaloff>:/Icons/refresh.png</iconset>
</property>
<property name="iconSize">
@ -94,7 +94,7 @@
<string>–</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/Icons/remove.png</normaloff>:/Icons/remove.png</iconset>
</property>
<property name="iconSize">
@ -137,7 +137,7 @@
<tabstop>btnClose</tabstop>
</tabstops>
<resources>
<include location="../resources.qrc"/>
<include location="../Resources/resources.qrc"/>
</resources>
<connections>
<connection>

@ -0,0 +1,10 @@
set(component "ScriptDialog")
list(APPEND ${component}_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/ScriptDialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ScriptDialog.h
)
add_library(${component} STATIC ${${component}_SOURCES})
qt5_use_modules(${component} Widgets)
target_include_directories(${component} PRIVATE ${CMAKE_SOURCE_DIR})

@ -0,0 +1,14 @@
set(component "ScriptFunctions")
list(APPEND ${component}_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/RegisterScriptFunctions.cpp
${CMAKE_CURRENT_SOURCE_DIR}/RegisterScriptFunctions.h
${CMAKE_CURRENT_SOURCE_DIR}/ScriptGeneralUtils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ScriptGeneralUtils.h
${CMAKE_CURRENT_SOURCE_DIR}/ScriptIRCUtils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ScriptIRCUtils.h
)
add_library(${component} STATIC ${${component}_SOURCES})
qt5_use_modules(${component} Widgets)
target_include_directories(${component} PRIVATE ${CMAKE_SOURCE_DIR})

@ -0,0 +1,14 @@
set(component "IWidgets")
list(APPEND ${component}_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/IIRCView.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IIRCView.h
${CMAKE_CURRENT_SOURCE_DIR}/ILineEdit.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ILineEdit.h
${CMAKE_CURRENT_SOURCE_DIR}/IListWidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/IListWidget.h
)
add_library(${component} STATIC ${${component}_SOURCES})
qt5_use_modules(${component} Widgets)
target_include_directories(${component} PRIVATE ${CMAKE_SOURCE_DIR})

@ -17,13 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* =-=-=-=-=-=-=-=-=-=-= WARNING =-=-=-=-=-=-=-=-=-=-=
* This file was created automatically by qmake.
* Do not edit it directly! Changes will most likely
* be lost, edit config.h.in instead.
* =-=-=-=-=-=-=-=-=-=-= WARNING =-=-=-=-=-=-=-=-=-=-=
*/
@config_h_warning@
#ifndef IDEALIRC_CONFIG_H
#define IDEALIRC_CONFIG_H
@ -39,20 +33,20 @@
*/
#define IIRCBT_packaged 1
#define IIRCBT_standalone 2
#define IIRCBT IIRCBT_'$$BUILD_TYPE'
#define IIRCBT IIRCBT_@BUILD_TYPE@
#if IIRCBT == IIRCBT_packaged
#if defined(Q_OS_LINUX)
#define GLOBAL_PATH QStringLiteral('"/usr/share/idealirc"')
#define GLOBAL_PATH QStringLiteral("/usr/share/idealirc")
#endif
#if defined(Q_OS_WIN32) | defined(Q_OS_WIN64)
#define GLOBAL_PATH QApplication::applicationDirPath()
#endif
#define LOCAL_PATH QStringLiteral('"%1/idealirc"').arg(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation))
#define LOCAL_PATH QStringLiteral("%1/idealirc").arg(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation))
#elif IIRCBT == IIRCBT_standalone
#define GLOBAL_PATH QApplication::applicationDirPath()
#define LOCAL_PATH QApplication::applicationDirPath()
#else
#error 'Invalid BUILD_TYPE setting: '$$BUILD_TYPE'. Valid choises are: "packaged" and "standalone".'
#error 'Invalid BUILD_TYPE setting: @BUILD_TYPE@. Valid choises are: "packaged" and "standalone".'
#endif
#undef IIRCBT
#undef IIRCBT_packaged
@ -64,14 +58,14 @@ enum class BuildType
standalone
};
constexpr BuildType BUILD_TYPE = BuildType::'$$BUILD_TYPE';
constexpr BuildType BUILD_TYPE = BuildType::@BUILD_TYPE@;
constexpr int VERSION_MAJOR = '$$VERSION_MAJOR';
constexpr int VERSION_MINOR = '$$VERSION_MINOR';
constexpr int VERSION_PATCH = '$$VERSION_PATCH';
constexpr int VERSION_BUILD = '$$VERSION_BUILD';
constexpr auto* VERSION_STRING = '"$$VERSION_MAJOR'.'$$VERSION_MINOR'.'$$VERSION_PATCH'-'$$VERSION_BUILD"';
constexpr auto* VERSION_STRING_NO_BUILD = '"$$VERSION_MAJOR'.'$$VERSION_MINOR'.'$$VERSION_PATCH"';
constexpr int VERSION_MAJOR = @VERSION_MAJOR@;
constexpr int VERSION_MINOR = @VERSION_MINOR@;
constexpr int VERSION_PATCH = @VERSION_PATCH@;
constexpr auto* VERSION_APPEND = "@VERSION_APPEND@";
constexpr auto* VERSION_STRING = "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@@VERSION_APPEND@";
constexpr auto* VERSION_STRING_NO_APPEND = "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@";
#endif

Loading…
Cancel
Save