Add new full_web_node target
This will eventually run a full node complete with bundled web GUI
This commit is contained in:
parent
96fb8f60c2
commit
8fc1ac736b
5 changed files with 73 additions and 0 deletions
|
|
@ -7,3 +7,7 @@ set(BUILD_QT_GUI FALSE CACHE BOOL "Build the Qt-based light client GUI")
|
||||||
if(BUILD_QT_GUI)
|
if(BUILD_QT_GUI)
|
||||||
add_subdirectory(light_client)
|
add_subdirectory(light_client)
|
||||||
endif()
|
endif()
|
||||||
|
set(BUILD_WEB_NODE FALSE CACHE BOOL "Build the Qt-based full node with web GUI")
|
||||||
|
if(BUILD_WEB_NODE)
|
||||||
|
add_subdirectory(full_web_node)
|
||||||
|
endif()
|
||||||
|
|
|
||||||
26
programs/full_web_node/CMakeLists.txt
Normal file
26
programs/full_web_node/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
cmake_minimum_required(VERSION 2.8.11)
|
||||||
|
|
||||||
|
project(full_web_node)
|
||||||
|
|
||||||
|
# Find includes in corresponding build directories
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
# Instruct CMake to run moc automatically when needed.
|
||||||
|
#set(CMAKE_AUTOMOC ON)
|
||||||
|
|
||||||
|
find_package(Qt5Core)
|
||||||
|
find_package(Qt5Quick)
|
||||||
|
find_package(Qt5WebEngine)
|
||||||
|
|
||||||
|
file(GLOB QML qml/*)
|
||||||
|
qt5_add_resources(QML_QRC qml/qml.qrc)
|
||||||
|
|
||||||
|
add_executable(full_web_node main.cpp ${QML_QRC} ${QML})
|
||||||
|
|
||||||
|
target_link_libraries(full_web_node PRIVATE Qt5::Core Qt5::Quick Qt5::WebEngine graphene_chain graphene_egenesis_brief graphene_utilities fc graphene_app )
|
||||||
|
|
||||||
|
install( TARGETS
|
||||||
|
full_web_node
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
ARCHIVE DESTINATION lib
|
||||||
|
)
|
||||||
24
programs/full_web_node/main.cpp
Normal file
24
programs/full_web_node/main.cpp
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
#include <fc/thread/thread.hpp>
|
||||||
|
|
||||||
|
#include <QGuiApplication>
|
||||||
|
#include <QQmlApplicationEngine>
|
||||||
|
#include <QtWebEngine>
|
||||||
|
#include <QtQml>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
fc::thread::current().set_name("main");
|
||||||
|
QGuiApplication app(argc, argv);
|
||||||
|
app.setApplicationName("Graphene Client");
|
||||||
|
app.setApplicationDisplayName(app.applicationName());
|
||||||
|
app.setOrganizationDomain("cryptonomex.org");
|
||||||
|
app.setOrganizationName("Cryptonomex, Inc.");
|
||||||
|
|
||||||
|
QtWebEngine::initialize();
|
||||||
|
QQmlApplicationEngine engine;
|
||||||
|
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||||
|
|
||||||
|
return app.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "main.moc"
|
||||||
13
programs/full_web_node/qml/main.qml
Normal file
13
programs/full_web_node/qml/main.qml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Window 2.2
|
||||||
|
import QtWebEngine 1.0
|
||||||
|
|
||||||
|
Window {
|
||||||
|
width: 800
|
||||||
|
height: 600
|
||||||
|
visible: true
|
||||||
|
|
||||||
|
WebEngineView {
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
}
|
||||||
6
programs/full_web_node/qml/qml.qrc
Normal file
6
programs/full_web_node/qml/qml.qrc
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<RCC>
|
||||||
|
<qresource prefix="/">
|
||||||
|
<file>main.qml</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
||||||
|
|
||||||
Loading…
Reference in a new issue