cleanup build files
This commit is contained in:
parent
2ad75de379
commit
f031259f35
101
binding.gyp
101
binding.gyp
@ -1,99 +1,6 @@
|
||||
{
|
||||
"targets": [{
|
||||
"target_name": "qtnode",
|
||||
"cflags!": ["-fno-exceptions"],
|
||||
"cflags_cc!": ["-fno-exceptions"],
|
||||
"sources": [
|
||||
"src/cpp/main.cpp",
|
||||
# non-wrapped cpps
|
||||
"src/cpp/Extras/Utils/utils.cpp",
|
||||
# wrapped cpps
|
||||
"src/cpp/QtGui/QApplication/qapplication_wrap.cpp",
|
||||
"src/cpp/QtGui/QWidget/qwidget_wrap.cpp",
|
||||
"src/cpp/QtWidgets/QGridLayout/qgridlayout_wrap.cpp",
|
||||
"src/cpp/QtWidgets/QLabel/qlabel_wrap.cpp",
|
||||
"src/cpp/QtWidgets/QLayout/qlayout_wrap.cpp",
|
||||
"src/cpp/QtWidgets/QMainWindow/qmainwindow_wrap.cpp",
|
||||
"src/cpp/QtWidgets/QPushButton/qpushbutton_wrap.cpp"
|
||||
],
|
||||
'conditions': [
|
||||
['OS=="mac"', {
|
||||
'xcode_settings': {
|
||||
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
|
||||
},
|
||||
'include_dirs': [
|
||||
# install qt via homebrew only
|
||||
'<!(echo $QN_QT_HOME_DIR)/include',
|
||||
'<!(echo $QN_QT_HOME_DIR)/include/QtCore',
|
||||
'<!(echo $QN_QT_HOME_DIR)/include/QtGui',
|
||||
'<!(echo $QN_QT_HOME_DIR)/include/QtTest',
|
||||
'<!(echo $QN_QT_HOME_DIR)/include/QtWidgets',
|
||||
],
|
||||
'libraries': [
|
||||
'<!(echo $QN_QT_HOME_DIR)/lib/QtCore.framework/QtCore',
|
||||
'<!(echo $QN_QT_HOME_DIR)/lib/QtGui.framework/QtGui',
|
||||
'<!(echo $QN_QT_HOME_DIR)/lib/QtTest.framework/QtTest',
|
||||
'<!(echo $QN_QT_HOME_DIR)/lib/QtWidgets.framework/QtWidgets',
|
||||
'<!(echo $QN_QT_HOME_DIR)/lib/QtPrintSupport.framework/QtPrintSupport',
|
||||
],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'-Wl,-rpath,<!(echo $QN_QT_HOME_DIR)/lib/',
|
||||
],
|
||||
},
|
||||
}],
|
||||
['OS=="linux"', {
|
||||
'cflags': [
|
||||
'<!@(pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets Qt5Test)',
|
||||
],
|
||||
'ldflags': [
|
||||
'<!@(pkg-config --libs-only-L --libs-only-other Qt5Core Qt5Gui Qt5Widgets Qt5Test)',
|
||||
],
|
||||
'libraries': [
|
||||
'<!@(pkg-config --libs-only-l Qt5Core Qt5Gui Qt5Widgets Qt5Test)',
|
||||
]
|
||||
}],
|
||||
['OS=="win"', {
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'AdditionalOptions': [
|
||||
'/GR-',
|
||||
'/MT',
|
||||
'/EHsc'
|
||||
]
|
||||
},
|
||||
},
|
||||
'include_dirs': [
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/includes',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/includes/QtCore',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/includes/QtGui',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/includes/QtTest',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/includes/QtWidgets',
|
||||
],
|
||||
'libraries': [
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/lib/Qt5Core.lib',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/lib/Qt5Gui.lib',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/lib/Qt5Test.lib',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/lib/Qt5Widgets.lib',
|
||||
],
|
||||
'copies': [{
|
||||
'files': [
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/dll/Qt5Core.dll',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/dll/Qt5Gui.dll',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/dll/Qt5Test.dll',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/dll/Qt5Widgets.dll',
|
||||
],
|
||||
'destination': '<(module_root_dir)/build/Release',
|
||||
}]
|
||||
}],
|
||||
],
|
||||
'include_dirs': [
|
||||
"<!@(node -p \"require('node-addon-api').include\")",
|
||||
],
|
||||
'dependencies': [
|
||||
"<!(node -p \"require('node-addon-api').gyp\")",
|
||||
],
|
||||
'defines': ['NAPI_CPP_EXCEPTIONS'],
|
||||
|
||||
}]
|
||||
"includes": [
|
||||
"./config/application.gypi"
|
||||
],
|
||||
"targets": []
|
||||
}
|
||||
|
||||
23
config/application.gypi
Normal file
23
config/application.gypi
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"includes": [
|
||||
"./common.gypi"
|
||||
],
|
||||
"targets": [
|
||||
{
|
||||
"target_name": "qtnode",
|
||||
"sources": [
|
||||
"../src/cpp/main.cpp",
|
||||
# non-wrapped cpps
|
||||
"../src/cpp/Extras/Utils/utils.cpp",
|
||||
# wrapped cpps
|
||||
"../src/cpp/QtGui/QApplication/qapplication_wrap.cpp",
|
||||
"../src/cpp/QtGui/QWidget/qwidget_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QGridLayout/qgridlayout_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QLabel/qlabel_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QLayout/qlayout_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QMainWindow/qmainwindow_wrap.cpp",
|
||||
"../src/cpp/QtWidgets/QPushButton/qpushbutton_wrap.cpp"
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
||||
91
config/common.gypi
Normal file
91
config/common.gypi
Normal file
@ -0,0 +1,91 @@
|
||||
{
|
||||
'includes': [],
|
||||
'type': 'shared_library',
|
||||
'variables': {
|
||||
'qt_home_dir': '<!(echo $QN_QT_HOME_DIR)',
|
||||
},
|
||||
'target_defaults': {
|
||||
"cflags!": ["-fno-exceptions"],
|
||||
"cflags_cc!": ["-fno-exceptions"],
|
||||
'sources': [],
|
||||
'includes': [],
|
||||
'include_dirs': [
|
||||
"<!@(node -p \"require('node-addon-api').include\")",
|
||||
],
|
||||
'dependencies': [
|
||||
"<!(node -p \"require('node-addon-api').gyp\")",
|
||||
],
|
||||
'defines': ['NAPI_CPP_EXCEPTIONS'],
|
||||
'target_conditions': [
|
||||
['OS=="mac"', {
|
||||
'xcode_settings': {
|
||||
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
|
||||
},
|
||||
'include_dirs': [
|
||||
# install qt via homebrew only
|
||||
'<(qt_home_dir)/include',
|
||||
'<(qt_home_dir)/include/QtCore',
|
||||
'<(qt_home_dir)/include/QtGui',
|
||||
'<(qt_home_dir)/include/QtTest',
|
||||
'<(qt_home_dir)/include/QtWidgets',
|
||||
],
|
||||
'libraries': [
|
||||
'<(qt_home_dir)/lib/QtCore.framework/QtCore',
|
||||
'<(qt_home_dir)/lib/QtGui.framework/QtGui',
|
||||
'<(qt_home_dir)/lib/QtTest.framework/QtTest',
|
||||
'<(qt_home_dir)/lib/QtWidgets.framework/QtWidgets',
|
||||
'<(qt_home_dir)/lib/QtPrintSupport.framework/QtPrintSupport',
|
||||
],
|
||||
# 'link_settings': {
|
||||
# 'libraries': [
|
||||
# '-Wl,-rpath,<(qt_home_dir)/lib/',
|
||||
# ],
|
||||
# },
|
||||
}],
|
||||
['OS=="linux"', {
|
||||
'cflags': [
|
||||
'<!@(pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets Qt5Test)',
|
||||
],
|
||||
'ldflags': [
|
||||
'<!@(pkg-config --libs-only-L --libs-only-other Qt5Core Qt5Gui Qt5Widgets Qt5Test)',
|
||||
],
|
||||
'libraries': [
|
||||
'<!@(pkg-config --libs-only-l Qt5Core Qt5Gui Qt5Widgets Qt5Test)',
|
||||
]
|
||||
}],
|
||||
['OS=="win"', {
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'AdditionalOptions': [
|
||||
'/GR-',
|
||||
'/MT',
|
||||
'/EHsc'
|
||||
]
|
||||
},
|
||||
},
|
||||
'include_dirs': [
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/includes',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/includes/QtCore',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/includes/QtGui',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/includes/QtTest',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/includes/QtWidgets',
|
||||
],
|
||||
'libraries': [
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/lib/Qt5Core.lib',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/lib/Qt5Gui.lib',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/lib/Qt5Test.lib',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/lib/Qt5Widgets.lib',
|
||||
],
|
||||
'copies': [{
|
||||
'files': [
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/dll/Qt5Core.dll',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/dll/Qt5Gui.dll',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/dll/Qt5Test.dll',
|
||||
'<(module_root_dir)/dep/qt-5.11.0/win32/msvc2017_64/dll/Qt5Widgets.dll',
|
||||
],
|
||||
'destination': '<(module_root_dir)/build/Release',
|
||||
}]
|
||||
}],
|
||||
],
|
||||
},
|
||||
}
|
||||
19
demo.ts
19
demo.ts
@ -1,18 +1,23 @@
|
||||
import { QtGui, QtWidgets } from "./src";
|
||||
const win = new QtWidgets.QMainWindow();
|
||||
const view = new QtGui.QWidget();
|
||||
import { QMainWindow } from "./src/lib/QtWidgets/QMainWindow";
|
||||
import { QWidget } from "./src/lib/QtGui/QWidget";
|
||||
import { QGridLayout } from "./src/lib/QtWidgets/QGridLayout";
|
||||
import { QLabel } from "./src/lib/QtWidgets/QLabel";
|
||||
import { QPushButton } from "./src/lib/QtWidgets/QPushButton";
|
||||
|
||||
const win = new QMainWindow();
|
||||
const view = new QWidget();
|
||||
win.setCentralWidget(view);
|
||||
|
||||
const gridLayout = new QtWidgets.QGridLayout();
|
||||
const gridLayout = new QGridLayout();
|
||||
|
||||
const label = new QtWidgets.QLabel();
|
||||
const label = new QLabel();
|
||||
label.setText("Testing1234");
|
||||
|
||||
const label2 = new QtWidgets.QLabel();
|
||||
const label2 = new QLabel();
|
||||
label2.setText("Hello12321");
|
||||
label2.setStyleSheet("background-color:blue; color:white;");
|
||||
|
||||
const button1 = new QtWidgets.QPushButton();
|
||||
const button1 = new QPushButton();
|
||||
button1.setText("Yolo");
|
||||
// button1.setEventListener("click", () => {
|
||||
// console.log("button clicked");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user