Skip to content

Commit

Permalink
The first public release
Browse files Browse the repository at this point in the history
  • Loading branch information
abroshan39 committed May 3, 2022
0 parents commit 4dbaaf2
Show file tree
Hide file tree
Showing 144 changed files with 21,067 additions and 0 deletions.
148 changes: 148 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
cmake_minimum_required(VERSION 3.5)

set(PROJECT_NAME "Ghazal")
project(${PROJECT_NAME} VERSION 1.4 LANGUAGES C CXX)

if(UNIX)
set(OUTPUT_FILE_NAME "ghazal")
else()
set(OUTPUT_FILE_NAME "Ghazal")
endif()

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt5 QUIET COMPONENTS Core)

if(QT_FOUND)
set(QT_VERSION_MAJOR 5)
else()
find_package(QT NAMES Qt6 QUIET COMPONENTS Core)
if(QT_FOUND)
set(QT_VERSION_MAJOR 6)
else()
set(QT_VERSION_MAJOR 5) # If neither 5 nor 6 are found, we default to 5. The setup will fail further down.
endif()
endif()

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()

if(QT_VERSION_MAJOR EQUAL 5)
find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets Sql Concurrent Xml Network)
if(UNIX)
set(QUAZIP_LIB "${CMAKE_CURRENT_SOURCE_DIR}/libraries/unix/quazip/libquazip1-qt5.so")
set(ZLIB "${CMAKE_CURRENT_SOURCE_DIR}/libraries/unix/quazip/libz.so")
elseif(WIN32)
set(QUAZIP_LIB "${CMAKE_CURRENT_SOURCE_DIR}/libraries/win/quazip/libquazip1-qt5.dll")
set(ZLIB "${CMAKE_CURRENT_SOURCE_DIR}/libraries/win/quazip/zlib1.dll")
endif()
set(GHAZAL_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Sql Qt5::Concurrent Qt5::Xml Qt5::Network ${QUAZIP_LIB})
elseif(QT_VERSION_MAJOR EQUAL 6)
find_package(Qt6 REQUIRED COMPONENTS Core Core5Compat Gui Widgets Sql Concurrent Xml Network)
if(UNIX)
set(QUAZIP_LIB "${CMAKE_CURRENT_SOURCE_DIR}/libraries/unix/quazip/libquazip1-qt6.so")
set(ZLIB "${CMAKE_CURRENT_SOURCE_DIR}/libraries/unix/quazip/libz.so")
elseif(WIN32)
set(QUAZIP_LIB "${CMAKE_CURRENT_SOURCE_DIR}/libraries/win/quazip/libquazip1-qt6.dll")
set(ZLIB "${CMAKE_CURRENT_SOURCE_DIR}/libraries/win/quazip/zlib1.dll")
endif()
set(GHAZAL_LIBRARIES Qt6::Core Qt6::Core5Compat Qt6::Gui Qt6::Widgets Qt6::Sql Qt6::Concurrent Qt6::Xml Qt6::Network ${QUAZIP_LIB})
endif()

set(HEADERS
src/abjad_class.h
src/abjadform.h
src/abjadformmini.h
src/aboutauthorform.h
src/aboutform.h
src/appthemes.h
src/common_functions.h
src/databaseform.h
src/date_converter.h
src/downloadform.h
src/event_functions.h
src/filedownloader.h
src/mainwindow.h
src/searchexamplesform.h
src/searchform.h
src/settingsform.h
src/tabform.h
src/wordsearchform.h
src/worker.h
)

set(SOURCES
src/abjad_class.cpp
src/abjadform.cpp
src/abjadformmini.cpp
src/aboutauthorform.cpp
src/aboutform.cpp
src/appthemes.cpp
src/common_functions.cpp
src/common_search.cpp
src/databaseform.cpp
src/date_converter.c
src/downloadform.cpp
src/event_functions.cpp
src/filedownloader.cpp
src/main.cpp
src/mainwindow.cpp
src/mainwindow_action_menu.cpp
src/mainwindow_app_setting.cpp
src/mainwindow_search_form.cpp
src/searchexamplesform.cpp
src/searchform.cpp
src/settingsform.cpp
src/tabform.cpp
src/tabform_context_menu.cpp
src/wordsearchform.cpp
src/worker.cpp
)

set(FORMS
src/abjadform.ui
src/abjadformmini.ui
src/aboutauthorform.ui
src/aboutform.ui
src/databaseform.ui
src/downloadform.ui
src/mainwindow.ui
src/searchexamplesform.ui
src/searchform.ui
src/settingsform.ui
src/tabform.ui
src/wordsearchform.ui
)

set(RESOURCES
resources/themes/darkstyle.qrc
resources/resource.qrc
)

include_directories("${CMAKE_CURRENT_SOURCE_DIR}/libraries/include")

if(WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Release")
enable_language(RC)
set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_CURRENT_SOURCE_DIR}/resources/resource_win.rc")
add_executable(${PROJECT_NAME} WIN32 ${HEADERS} ${SOURCES} ${FORMS} ${RESOURCES} ${APP_ICON_RESOURCE_WINDOWS})
else()
add_executable(${PROJECT_NAME} ${HEADERS} ${SOURCES} ${FORMS} ${RESOURCES})
endif()

target_link_libraries(${PROJECT_NAME} ${GHAZAL_LIBRARIES})

set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${OUTPUT_FILE_NAME})

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${QUAZIP_LIB}
${ZLIB}
"${CMAKE_BINARY_DIR}")
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2012-2022 Aboutaleb Roshan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Ghazal: The library of persian poetry
Ghazal is a library of persian poetry and a free and open-source software. Ghazal is written in C++ using the Qt framework. This software uses [Ganjoor](https://ganjoor.net) database. This branch here contains pre-built files for Windows and Linux ([AppImage](https://appimage.org)). Simply download the AppImage and run it on all linux distributions.

## Building
Linux (cmake):
```
cd ghazal-src-dir
cmake . -Bbuild
cd build
make
```

Linux (qmake):
```
cd ghazal-src-dir
qmake ghazal.pro
make
```

Windows (cmake):
```
cd ghazal-src-dir
cmake . -Bbuild -G"MinGW Makefiles"
cd build
mingw32-make
```

Windows (qmake):
```
cd ghazal-src-dir
qmake ghazal.pro
mingw32-make
```

## PGP Public Key
Source and binary executables are signed with the following key:
- [abroshan39_PGP_public_key.asc](http://www.rosybit.com/abroshan39/abroshan39_PGP_public_key.asc) (Key ID: B0E5D23797D2D8CB)

You can import the public key from the MIT PGP Public Key Server by running a command like:
```
gpg --keyserver pgp.mit.edu --receive-keys B0E5D23797D2D8CB
```

## Authors
- Aboutaleb Roshan [@abroshan39](https://github.com/abroshan39)

## License
Ghazal is licensed under MIT. See the `LICENSE` file.
100 changes: 100 additions & 0 deletions ghazal.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
QT += core gui widgets sql concurrent xml network

greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat

CONFIG += c++11

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

OUTPUT_FILE_NAME_UNIX = "ghazal"
OUTPUT_FILE_NAME_WIN = "Ghazal"
QUAZIP_LIB_NAME_UNIX = "quazip1-qt5"
QUAZIP_LIB_NAME_WIN = "quazip1-qt5"

unix {
TARGET = $$OUTPUT_FILE_NAME_UNIX
LIBS += -L$$PWD/libraries/unix/quazip -l$$QUAZIP_LIB_NAME_UNIX
}

win32 {
TARGET = $$OUTPUT_FILE_NAME_WIN
LIBS += -L$$PWD/libraries/win/quazip -l$$QUAZIP_LIB_NAME_WIN
RC_FILE = $$PWD/resources/resource_win.rc
}

INCLUDEPATH += $$PWD/libraries/include

HEADERS += \
src/abjad_class.h \
src/abjadform.h \
src/abjadformmini.h \
src/aboutauthorform.h \
src/aboutform.h \
src/appthemes.h \
src/common_functions.h \
src/databaseform.h \
src/date_converter.h \
src/downloadform.h \
src/event_functions.h \
src/filedownloader.h \
src/mainwindow.h \
src/searchexamplesform.h \
src/searchform.h \
src/settingsform.h \
src/tabform.h \
src/wordsearchform.h \
src/worker.h

SOURCES += \
src/abjad_class.cpp \
src/abjadform.cpp \
src/abjadformmini.cpp \
src/aboutauthorform.cpp \
src/aboutform.cpp \
src/appthemes.cpp \
src/common_functions.cpp \
src/common_search.cpp \
src/databaseform.cpp \
src/date_converter.c \
src/downloadform.cpp \
src/event_functions.cpp \
src/filedownloader.cpp \
src/main.cpp \
src/mainwindow.cpp \
src/mainwindow_action_menu.cpp \
src/mainwindow_app_setting.cpp \
src/mainwindow_search_form.cpp \
src/searchexamplesform.cpp \
src/searchform.cpp \
src/settingsform.cpp \
src/tabform.cpp \
src/tabform_context_menu.cpp \
src/wordsearchform.cpp \
src/worker.cpp

FORMS += \
src/abjadform.ui \
src/abjadformmini.ui \
src/aboutauthorform.ui \
src/aboutform.ui \
src/databaseform.ui \
src/downloadform.ui \
src/mainwindow.ui \
src/searchexamplesform.ui \
src/searchform.ui \
src/settingsform.ui \
src/tabform.ui \
src/wordsearchform.ui

RESOURCES += \
resources/themes/darkstyle.qrc \
resources/resource.qrc
Loading

0 comments on commit 4dbaaf2

Please sign in to comment.