Skip to content

Commit

Permalink
Create modules in build script
Browse files Browse the repository at this point in the history
  • Loading branch information
u-235 committed Nov 24, 2023
1 parent aa1ef36 commit 18e9a86
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 25 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/kdiff3/kdiff3.pro
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CONFIG += staticlib
include(../../common.pri)

QT *= widgets
# QTextCodec QRegExp in Qt6
# QTextCodec in Qt6
greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat

SOURCES += \
Expand Down
52 changes: 40 additions & 12 deletions common.pri
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@


PROJECT_ROOT_PATH = $${PWD}
PROJECT_BUILD_PATH = $$shadowed($$PROJECT_ROOT_PATH)

CONFIG(debug, debug|release) {
BUILD_FLAG = debug
Expand All @@ -22,24 +21,53 @@ LANG_PATH = $${PROJECT_ROOT_PATH}/lang
# define locales for translation
LANG_LIST = pl ca de fi cs_CZ es nl ru

LIBS_PATH = $${PROJECT_BUILD_PATH}/libs
BIN_PATH = $${PROJECT_ROOT_PATH}/bin/$${BUILD_FLAG}

DESTDIR = $${BIN_PATH}
CONFIG(staticlib) {
DESTDIR = $$LIBS_PATH
!CONFIG(staticlib) {
DESTDIR = $${PROJECT_ROOT_PATH}/bin/$${BUILD_FLAG}
}

LIBS += -L$${LIBS_PATH} -L$${BIN_PATH}
INCLUDEPATH += $${PROJECT_ROOT_PATH}/include
INCLUDEPATH += $${PROJECT_ROOT_PATH}/3rdparty
INCLUDEPATH += $${PROJECT_ROOT_PATH}/3rdparty/include

!defined(PREFIX, var) {
unix:PREFIX = /usr/local/
win32:PREFIX = $$(programfiles)
}

#------------------#
# Link modules #
#------------------#

contains(MODULES, kdiff3) {
INCLUDEPATH += $${PROJECT_ROOT_PATH}/3rdparty
LIBS += -L$$shadowed($${PROJECT_ROOT_PATH}/3rdparty/kdiff3)
LIBS += -lkdiff3
# QTextCodec in Qt6
greaterThan(QT_MAJOR_VERSION, 5): QT *= core5compat
}

contains(MODULES, qtsingleapplication) {
INCLUDEPATH += $${PROJECT_ROOT_PATH}/3rdparty/include
LIBS += -L$$shadowed($${PROJECT_ROOT_PATH}/3rdparty/qtsingleapplication)
LIBS += -lqtsingleapplication
}

contains(MODULES, edytornc-common) {
INCLUDEPATH += $${PROJECT_ROOT_PATH}/src-common \
$${PROJECT_ROOT_PATH}/src-common/include \
$$shadowed($${PROJECT_ROOT_PATH}/src-common)
LIBS += -L$$shadowed($${PROJECT_ROOT_PATH}/src-common)
LIBS += -ledytornc-common
}

contains(MODULES, edytornc) {
INCLUDEPATH += $${PROJECT_ROOT_PATH}/src/include
# LIBS += -L$$shadowed($${PROJECT_ROOT_PATH}/src)
# LIBS += -ledytornc
}

contains(MODULES, sfs) {
INCLUDEPATH += $${PROJECT_ROOT_PATH}/sfs
# LIBS += -L$$shadowed($${PROJECT_ROOT_PATH}/sfs)
# LIBS += -lsfs
}


#
# function findFiles(dir, basename)
Expand Down
6 changes: 2 additions & 4 deletions sfs/sfs.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ TARGET = sfs
include(../common.pri)

QT *= widgets serialport network
# QTextCodec QRegExp uses in kdiff3. In Qt6 need add core5compat
greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat
MODULES *= kdiff3 qtsingleapplication edytornc-common

INCLUDEPATH += ../src-common ../src-common/include/ $$shadowed(../src-common)
LIBS += -lkdiff3 -lqtsingleapplication -ledytornc-common
include(../common.pri)

#EdytorNC - SFS

Expand Down
4 changes: 2 additions & 2 deletions src-common/src-common.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ TEMPLATE = lib
TARGET = edytornc-common
CONFIG += staticlib

include(../common.pri)

QT *= widgets serialport network

include(../common.pri)

INCLUDEPATH += include

#EdytorNC common
Expand Down
10 changes: 4 additions & 6 deletions src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ VERSION = 2018.07
TEMPLATE = app
TARGET = edytornc

include(../common.pri)

QT *= widgets printsupport serialport network
# QTextCodec QRegExp uses in kdiff3. In Qt6 need add core5compat
greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat
MODULES *= kdiff3 qtsingleapplication edytornc-common sfs

include(../common.pri)

INCLUDEPATH += include ../src-common ../src-common/include/ $$shadowed(../src-common) ../sfs
LIBS += -lkdiff3 -lqtsingleapplication -ledytornc-common
INCLUDEPATH += include

#EdytorNC

Expand Down

0 comments on commit 18e9a86

Please sign in to comment.