mirror of
				https://git.wownero.com/wowlet/wowlet.git
				synced 2024-08-15 01:03:14 +00:00 
			
		
		
		
	Prepare build system for OpenVR and QtQuick (QML)
This commit is contained in:
		
							parent
							
								
									144c19fab1
								
							
						
					
					
						commit
						69c371938b
					
				
					 5 changed files with 159 additions and 34 deletions
				
			
		| 
						 | 
					@ -11,6 +11,8 @@ set(VERSION "beta-1")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
option(FETCH_DEPS "Download dependencies if they are not found" ON)
 | 
					option(FETCH_DEPS "Download dependencies if they are not found" ON)
 | 
				
			||||||
option(XMRIG "Include XMRig module" ON)
 | 
					option(XMRIG "Include XMRig module" ON)
 | 
				
			||||||
 | 
					option(OPENVR "Include OpenVR support" OFF)
 | 
				
			||||||
 | 
					option(QML "Include QtQuick (QML)" OFF)
 | 
				
			||||||
option(TOR_BIN "Path to Tor binary to embed inside WOWlet" OFF)
 | 
					option(TOR_BIN "Path to Tor binary to embed inside WOWlet" OFF)
 | 
				
			||||||
option(STATIC "Link libraries statically, requires static Qt")
 | 
					option(STATIC "Link libraries statically, requires static Qt")
 | 
				
			||||||
option(USE_DEVICE_TREZOR "Trezor support compilation" OFF)
 | 
					option(USE_DEVICE_TREZOR "Trezor support compilation" OFF)
 | 
				
			||||||
| 
						 | 
					@ -24,16 +26,26 @@ include(FindCcache)
 | 
				
			||||||
include(CheckIncludeFile)
 | 
					include(CheckIncludeFile)
 | 
				
			||||||
include(CheckSymbolExists)
 | 
					include(CheckSymbolExists)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(DEBUG)
 | 
					 | 
				
			||||||
    set(CMAKE_VERBOSE_MAKEFILE ON)
 | 
					 | 
				
			||||||
endif()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
set(WOWNERO_HEAD "f611d5c9e32bc62f1735f6571b0bdb95cc020531")
 | 
					set(WOWNERO_HEAD "f611d5c9e32bc62f1735f6571b0bdb95cc020531")
 | 
				
			||||||
set(BUILD_GUI_DEPS ON)
 | 
					set(BUILD_GUI_DEPS ON)
 | 
				
			||||||
set(ARCH "x86-64")
 | 
					set(ARCH "x86-64")
 | 
				
			||||||
set(BUILD_64 ON)
 | 
					set(BUILD_64 ON)
 | 
				
			||||||
set(INSTALL_VENDORED_LIBUNBOUND ${STATIC})
 | 
					set(INSTALL_VENDORED_LIBUNBOUND ${STATIC})
 | 
				
			||||||
set(USE_SINGLE_BUILDDIR ON)
 | 
					set(USE_SINGLE_BUILDDIR ON)
 | 
				
			||||||
 | 
					if(OPENVR)
 | 
				
			||||||
 | 
					    set(QML ON)
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Are we in debug mode?
 | 
				
			||||||
 | 
					set(_CMAKE_BUILD_TYPE "")
 | 
				
			||||||
 | 
					string(TOUPPER "${CMAKE_BUILD_TYPE}" _CMAKE_BUILD_TYPE)
 | 
				
			||||||
 | 
					if("${_CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
 | 
				
			||||||
 | 
					    set(DEBUG ON)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    set(CMAKE_VERBOSE_MAKEFILE ON)
 | 
				
			||||||
 | 
					    message(STATUS "OPENVR: ${OPENVR}")
 | 
				
			||||||
 | 
					    message(STATUS "QML: ${QML}")
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_include_file(sys/prctl.h HAVE_SYS_PRCTL_H)
 | 
					check_include_file(sys/prctl.h HAVE_SYS_PRCTL_H)
 | 
				
			||||||
check_symbol_exists(prctl "sys/prctl.h" HAVE_PRCTL)
 | 
					check_symbol_exists(prctl "sys/prctl.h" HAVE_PRCTL)
 | 
				
			||||||
| 
						 | 
					@ -87,7 +99,7 @@ if(GIT_FOUND)
 | 
				
			||||||
    if(NOT _WOWNERO_HEAD STREQUAL WOWNERO_HEAD)
 | 
					    if(NOT _WOWNERO_HEAD STREQUAL WOWNERO_HEAD)
 | 
				
			||||||
        message(FATAL_ERROR "[submodule] Monero HEAD was at ${_WOWNERO_HEAD} but should be at ${WOWNERO_HEAD}")
 | 
					        message(FATAL_ERROR "[submodule] Monero HEAD was at ${_WOWNERO_HEAD} but should be at ${WOWNERO_HEAD}")
 | 
				
			||||||
    else()
 | 
					    else()
 | 
				
			||||||
        message(STATUS "[submodule] Monero HEAD @ ${WOWNERO_HEAD}")
 | 
					        message(STATUS "[submodule] Wownero HEAD @ ${WOWNERO_HEAD}")
 | 
				
			||||||
    endif()
 | 
					    endif()
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -365,4 +377,12 @@ if(APPLE)
 | 
				
			||||||
    add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/contrib/KDMacTouchBar")
 | 
					    add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/contrib/KDMacTouchBar")
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if(OPENVR)
 | 
				
			||||||
 | 
					    # Add contrib/openvr as library
 | 
				
			||||||
 | 
					    add_definitions(-DVR_API_PUBLIC)
 | 
				
			||||||
 | 
					    add_definitions(-DOPENVR_BUILD_STATIC)  # is this needed?
 | 
				
			||||||
 | 
					    add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/contrib/openvr")
 | 
				
			||||||
 | 
					    message(STATUS "yeepp")
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
add_subdirectory(src)
 | 
					add_subdirectory(src)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										6
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
					@ -30,6 +30,8 @@ CMAKEFLAGS = \
 | 
				
			||||||
	-DARCH=x86_64 \
 | 
						-DARCH=x86_64 \
 | 
				
			||||||
	-DBUILD_64=On \
 | 
						-DBUILD_64=On \
 | 
				
			||||||
	-DBUILD_TESTS=Off \
 | 
						-DBUILD_TESTS=Off \
 | 
				
			||||||
 | 
						-DOPENVR=Off \
 | 
				
			||||||
 | 
						-DQML=Off \
 | 
				
			||||||
	-DXMRIG=Off \
 | 
						-DXMRIG=Off \
 | 
				
			||||||
	-DTOR_BIN=Off \
 | 
						-DTOR_BIN=Off \
 | 
				
			||||||
	-DCMAKE_CXX_STANDARD=11 \
 | 
						-DCMAKE_CXX_STANDARD=11 \
 | 
				
			||||||
| 
						 | 
					@ -50,10 +52,11 @@ release-static:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
depends:
 | 
					depends:
 | 
				
			||||||
	mkdir -p build/$(target)/release
 | 
						mkdir -p build/$(target)/release
 | 
				
			||||||
	cd build/$(target)/release && cmake -D STATIC=ON -DREPRODUCIBLE=$(or ${SOURCE_DATE_EPOCH},OFF) -DTOR_VERSION=$(or ${TOR_VERSION}, OFF) -DTOR_BIN=$(or ${TOR_BIN},OFF) -D DEV_MODE=$(or ${DEV_MODE},OFF) -D BUILD_TAG=$(tag) -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=$(root)/$(target)/share/toolchain.cmake ../../.. && $(MAKE)
 | 
						cd build/$(target)/release && cmake -D STATIC=ON -DREPRODUCIBLE=$(or ${SOURCE_DATE_EPOCH},OFF) -DTOR_VERSION=$(or ${TOR_VERSION}, OFF) -DOPENVR=ON -DQML=ON -DTOR_BIN=$(or ${TOR_BIN},OFF) -D DEV_MODE=$(or ${DEV_MODE},OFF) -D BUILD_TAG=$(tag) -D CMAKE_BUILD_TYPE=Debug -D CMAKE_TOOLCHAIN_FILE=$(root)/$(target)/share/toolchain.cmake ../../.. && $(MAKE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
windows-mxe-release: CMAKEFLAGS += -DBUILD_TAG="win-x64"
 | 
					windows-mxe-release: CMAKEFLAGS += -DBUILD_TAG="win-x64"
 | 
				
			||||||
windows-mxe-release: CMAKEFLAGS += -DTOR_BIN=$(or ${TOR_BIN},OFF)
 | 
					windows-mxe-release: CMAKEFLAGS += -DTOR_BIN=$(or ${TOR_BIN},OFF)
 | 
				
			||||||
 | 
					windows-mxe-debug: CMAKEFLAGS += -DOPENVR=On
 | 
				
			||||||
windows-mxe-release: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Release
 | 
					windows-mxe-release: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Release
 | 
				
			||||||
windows-mxe-release:
 | 
					windows-mxe-release:
 | 
				
			||||||
	cmake -Bbuild $(CMAKEFLAGS)
 | 
						cmake -Bbuild $(CMAKEFLAGS)
 | 
				
			||||||
| 
						 | 
					@ -61,6 +64,7 @@ windows-mxe-release:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
windows-mxe-debug: CMAKEFLAGS += -DBUILD_TAG="win-x64"
 | 
					windows-mxe-debug: CMAKEFLAGS += -DBUILD_TAG="win-x64"
 | 
				
			||||||
windows-mxe-debug: CMAKEFLAGS += -DTOR_BIN=$(or ${TOR_BIN},OFF)
 | 
					windows-mxe-debug: CMAKEFLAGS += -DTOR_BIN=$(or ${TOR_BIN},OFF)
 | 
				
			||||||
 | 
					windows-mxe-debug: CMAKEFLAGS += -DOPENVR=On
 | 
				
			||||||
windows-mxe-debug: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Debug
 | 
					windows-mxe-debug: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Debug
 | 
				
			||||||
windows-mxe-debug:
 | 
					windows-mxe-debug:
 | 
				
			||||||
	cmake -Bbuild $(CMAKEFLAGS)
 | 
						cmake -Bbuild $(CMAKEFLAGS)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,16 +5,7 @@ set(CMAKE_AUTOUIC ON)
 | 
				
			||||||
# pthread
 | 
					# pthread
 | 
				
			||||||
find_package(Threads REQUIRED)
 | 
					find_package(Threads REQUIRED)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui Network Svg Xml WebSockets)
 | 
					# Compile these source files (.h/.cpp)
 | 
				
			||||||
 | 
					 | 
				
			||||||
add_subdirectory(libwalletqt)
 | 
					 | 
				
			||||||
add_subdirectory(model)
 | 
					 | 
				
			||||||
add_subdirectory(utils)
 | 
					 | 
				
			||||||
add_subdirectory(openpgp)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
qt5_add_resources(RESOURCES assets.qrc)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Compile source files (.h/.cpp)
 | 
					 | 
				
			||||||
file(GLOB SOURCE_FILES
 | 
					file(GLOB SOURCE_FILES
 | 
				
			||||||
        "*.h"
 | 
					        "*.h"
 | 
				
			||||||
        "*.cpp"
 | 
					        "*.cpp"
 | 
				
			||||||
| 
						 | 
					@ -42,6 +33,35 @@ file(GLOB SOURCE_FILES
 | 
				
			||||||
        "dialog/*.cpp"
 | 
					        "dialog/*.cpp"
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if(QML)
 | 
				
			||||||
 | 
					    find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui Network Svg Xml WebSockets Quick Qml QuickControls2 QmlImportScanner)
 | 
				
			||||||
 | 
					else()
 | 
				
			||||||
 | 
					    find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui Network Svg Xml WebSockets)
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if(OPENVR)
 | 
				
			||||||
 | 
					    # include some extra files
 | 
				
			||||||
 | 
					    qt5_add_resources(RESOURCES vr/qml.qrc)
 | 
				
			||||||
 | 
					    file(GLOB SOURCE_FILES_QML
 | 
				
			||||||
 | 
					            "vr/*.h"
 | 
				
			||||||
 | 
					            "vr/*.cpp"
 | 
				
			||||||
 | 
					            "vr/utils/*.h"
 | 
				
			||||||
 | 
					            "vr/utils/*.cpp"
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					    list(APPEND SOURCE_FILES ${SOURCE_FILES_QML})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if(MINGW)
 | 
				
			||||||
 | 
					        set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wno-deprecated-declarations")  # @TODO: removeme
 | 
				
			||||||
 | 
					    endif()
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					add_subdirectory(libwalletqt)
 | 
				
			||||||
 | 
					add_subdirectory(model)
 | 
				
			||||||
 | 
					add_subdirectory(utils)
 | 
				
			||||||
 | 
					add_subdirectory(openpgp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					qt5_add_resources(RESOURCES assets.qrc)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(TOR_BIN)
 | 
					if(TOR_BIN)
 | 
				
			||||||
    if(APPLE)
 | 
					    if(APPLE)
 | 
				
			||||||
        set(ASSETS_TOR "assets_tor_macos.qrc")
 | 
					        set(ASSETS_TOR "assets_tor_macos.qrc")
 | 
				
			||||||
| 
						 | 
					@ -118,6 +138,10 @@ target_include_directories(wowlet PUBLIC
 | 
				
			||||||
        ${Qt5WebSockets_INCLUDE_DIRS}
 | 
					        ${Qt5WebSockets_INCLUDE_DIRS}
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if(OPENVR)
 | 
				
			||||||
 | 
					    target_include_directories(wowlet PUBLIC ${CMAKE_SOURCE_DIR}/contrib/)
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(DONATE_BEG)
 | 
					if(DONATE_BEG)
 | 
				
			||||||
    target_compile_definitions(wowlet PRIVATE DONATE_BEG=1)
 | 
					    target_compile_definitions(wowlet PRIVATE DONATE_BEG=1)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
| 
						 | 
					@ -130,6 +154,11 @@ if(XMRIG)
 | 
				
			||||||
    target_compile_definitions(wowlet PRIVATE HAS_XMRIG=1)
 | 
					    target_compile_definitions(wowlet PRIVATE HAS_XMRIG=1)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if(OPENVR)
 | 
				
			||||||
 | 
					    target_compile_definitions(wowlet PRIVATE HAS_OPENVR=1)
 | 
				
			||||||
 | 
					    target_compile_definitions(wowlet PUBLIC VR_API_PUBLIC)
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(HAVE_SYS_PRCTL_H)
 | 
					if(HAVE_SYS_PRCTL_H)
 | 
				
			||||||
    target_compile_definitions(wowlet PRIVATE HAVE_SYS_PRCTL_H=1)
 | 
					    target_compile_definitions(wowlet PRIVATE HAVE_SYS_PRCTL_H=1)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
| 
						 | 
					@ -150,6 +179,17 @@ if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
 | 
				
			||||||
    target_compile_definitions(wowlet PRIVATE QT_NO_DEBUG=1)
 | 
					    target_compile_definitions(wowlet PRIVATE QT_NO_DEBUG=1)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					add_definitions(${QT_DEFINITIONS})
 | 
				
			||||||
 | 
					if(NOT "${CMAKE_BUILD_TYPE}" EQUAL "Debug")
 | 
				
			||||||
 | 
					    add_definitions(-DQT_NO_DEBUG)
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					target_compile_definitions(wowlet PUBLIC VR_API_PUBLIC)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if(QML)
 | 
				
			||||||
 | 
					    qt5_import_qml_plugins(${PROJECT_NAME})
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
target_compile_definitions(wowlet
 | 
					target_compile_definitions(wowlet
 | 
				
			||||||
        PUBLIC
 | 
					        PUBLIC
 | 
				
			||||||
        ${Qt5Core_DEFINITIONS}
 | 
					        ${Qt5Core_DEFINITIONS}
 | 
				
			||||||
| 
						 | 
					@ -166,12 +206,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
 | 
				
			||||||
if(UNIX AND NOT APPLE)
 | 
					if(UNIX AND NOT APPLE)
 | 
				
			||||||
    # https://stackoverflow.com/questions/57766620/cmake-add-library-doesnt-initialize-static-global-variable
 | 
					    # https://stackoverflow.com/questions/57766620/cmake-add-library-doesnt-initialize-static-global-variable
 | 
				
			||||||
    # so that contrib/monero-seed/src/gf_elem.cpp properly initializes. A better solution is welcome.
 | 
					    # so that contrib/monero-seed/src/gf_elem.cpp properly initializes. A better solution is welcome.
 | 
				
			||||||
    target_link_libraries(wowlet -Wl,--whole-archive monero-seed::monero-seed -Wl,--no-whole-archive)
 | 
					    target_link_libraries(wowlet PUBLIC -Wl,--whole-archive monero-seed::monero-seed -Wl,--no-whole-archive)
 | 
				
			||||||
else()
 | 
					else()
 | 
				
			||||||
    target_link_libraries(wowlet monero-seed::monero-seed)
 | 
					    target_link_libraries(wowlet PUBLIC monero-seed::monero-seed)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
target_link_libraries(wowlet
 | 
					# Link Wownero core libraries
 | 
				
			||||||
 | 
					target_link_libraries(wowlet PUBLIC
 | 
				
			||||||
        wallet_merged
 | 
					        wallet_merged
 | 
				
			||||||
        ${LMDB_LIBRARY}
 | 
					        ${LMDB_LIBRARY}
 | 
				
			||||||
        epee
 | 
					        epee
 | 
				
			||||||
| 
						 | 
					@ -183,19 +224,51 @@ target_link_libraries(wowlet
 | 
				
			||||||
        ${Boost_LIBRARIES}
 | 
					        ${Boost_LIBRARIES}
 | 
				
			||||||
        ${OPENSSL_LIBRARIES}
 | 
					        ${OPENSSL_LIBRARIES}
 | 
				
			||||||
        ${CMAKE_DL_LIBS}
 | 
					        ${CMAKE_DL_LIBS}
 | 
				
			||||||
        ${EXTRA_LIBRARIES}
 | 
					        ${EXTRA_LIBRARIES})
 | 
				
			||||||
        Qt5::Core
 | 
					
 | 
				
			||||||
        Qt5::Widgets
 | 
					# Link Qt libraries
 | 
				
			||||||
        Qt5::Gui
 | 
					if(QML)
 | 
				
			||||||
        Qt5::Network
 | 
					    target_link_libraries(wowlet PUBLIC
 | 
				
			||||||
        Qt5::Svg
 | 
					            Qt5::Core
 | 
				
			||||||
        Qt5::Xml
 | 
					            Qt5::Widgets
 | 
				
			||||||
        Qt5::WebSockets
 | 
					            Qt5::Gui
 | 
				
			||||||
 | 
					            Qt5::Network
 | 
				
			||||||
 | 
					            Qt5::Svg
 | 
				
			||||||
 | 
					            Qt5::QSvgPlugin
 | 
				
			||||||
 | 
					            Qt5::QSvgIconPlugin
 | 
				
			||||||
 | 
					            Qt5::Xml
 | 
				
			||||||
 | 
					            Qt5::WebSockets
 | 
				
			||||||
 | 
					            Qt5::Quick
 | 
				
			||||||
 | 
					            Qt5::Qml
 | 
				
			||||||
 | 
					            Qt5::QuickControls2)
 | 
				
			||||||
 | 
					else()
 | 
				
			||||||
 | 
					    target_link_libraries(wowlet PUBLIC
 | 
				
			||||||
 | 
					            Qt5::Core
 | 
				
			||||||
 | 
					            Qt5::Widgets
 | 
				
			||||||
 | 
					            Qt5::Gui
 | 
				
			||||||
 | 
					            Qt5::Network
 | 
				
			||||||
 | 
					            Qt5::Svg
 | 
				
			||||||
 | 
					            Qt5::Xml
 | 
				
			||||||
 | 
					            Qt5::WebSockets)
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Link random other stuff
 | 
				
			||||||
 | 
					target_link_libraries(wowlet PUBLIC
 | 
				
			||||||
        ${ICU_LIBRARIES}
 | 
					        ${ICU_LIBRARIES}
 | 
				
			||||||
        openpgp
 | 
					        openpgp
 | 
				
			||||||
        Threads::Threads
 | 
					        Threads::Threads
 | 
				
			||||||
        ${QRENCODE_LIBRARY}
 | 
					        ${QRENCODE_LIBRARY})
 | 
				
			||||||
        )
 | 
					
 | 
				
			||||||
 | 
					# Link OpenVR
 | 
				
			||||||
 | 
					if(OPENVR)
 | 
				
			||||||
 | 
					    if(MINGW)
 | 
				
			||||||
 | 
					        target_link_libraries(wowlet PUBLIC
 | 
				
			||||||
 | 
					                openvr_api64
 | 
				
			||||||
 | 
					                gcc stdc++ winpthread ssp glu32 opengl32 glmf32 -dynamic)
 | 
				
			||||||
 | 
					    else()
 | 
				
			||||||
 | 
					        target_link_libraries(wowlet PUBLIC openvr_api)
 | 
				
			||||||
 | 
					    endif()
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(APPLE)
 | 
					if(APPLE)
 | 
				
			||||||
    target_link_libraries(wowlet
 | 
					    target_link_libraries(wowlet
 | 
				
			||||||
| 
						 | 
					@ -206,14 +279,14 @@ if(APPLE)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(NOT APPLE)
 | 
					if(NOT APPLE)
 | 
				
			||||||
    target_link_libraries(wowlet
 | 
					    target_link_libraries(wowlet PUBLIC
 | 
				
			||||||
            Qt5::QSvgIconPlugin
 | 
					            Qt5::QSvgIconPlugin
 | 
				
			||||||
            Qt5::QSvgPlugin
 | 
					            Qt5::QSvgPlugin
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(STATIC)
 | 
					if(STATIC)
 | 
				
			||||||
    target_link_libraries(wowlet
 | 
					    target_link_libraries(wowlet PUBLIC
 | 
				
			||||||
            Qt5::QSvgIconPlugin
 | 
					            Qt5::QSvgIconPlugin
 | 
				
			||||||
            Qt5::QSvgPlugin)
 | 
					            Qt5::QSvgPlugin)
 | 
				
			||||||
    if(UNIX AND NOT APPLE)
 | 
					    if(UNIX AND NOT APPLE)
 | 
				
			||||||
| 
						 | 
					@ -223,7 +296,7 @@ if(STATIC)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(X11_FOUND)
 | 
					if(X11_FOUND)
 | 
				
			||||||
    target_link_libraries(wowlet ${X11_LIBRARIES})
 | 
					    target_link_libraries(wowlet PUBLIC ${X11_LIBRARIES})
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(APPLE)
 | 
					if(APPLE)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										30
									
								
								src/main.cpp
									
										
									
									
									
								
							
							
						
						
									
										30
									
								
								src/main.cpp
									
										
									
									
									
								
							| 
						 | 
					@ -10,6 +10,10 @@
 | 
				
			||||||
#include "mainwindow.h"
 | 
					#include "mainwindow.h"
 | 
				
			||||||
#include "cli.h"
 | 
					#include "cli.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef HAS_OPENVR
 | 
				
			||||||
 | 
					#include "vr/main.h"
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(Q_OS_WIN)
 | 
					#if defined(Q_OS_WIN)
 | 
				
			||||||
#include <windows.h>
 | 
					#include <windows.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					@ -84,6 +88,12 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) {
 | 
				
			||||||
    QCommandLineOption backgroundPasswordOption(QStringList() << "daemon-password", "Password for connecting to the wowlet websocket service", "backgroundPassword");
 | 
					    QCommandLineOption backgroundPasswordOption(QStringList() << "daemon-password", "Password for connecting to the wowlet websocket service", "backgroundPassword");
 | 
				
			||||||
    parser.addOption(backgroundPasswordOption);
 | 
					    parser.addOption(backgroundPasswordOption);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    QCommandLineOption openVROption(QStringList() << "openvr", "Start Wowlet OpenVR");
 | 
				
			||||||
 | 
					    parser.addOption(openVROption);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    QCommandLineOption openVRDebugOption(QStringList() << "openvr-debug", "Start the Wowlet VR interface without initializing OpenVR - for debugging purposes.");
 | 
				
			||||||
 | 
					    parser.addOption(openVRDebugOption);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    auto parsed = parser.parse(argv_);
 | 
					    auto parsed = parser.parse(argv_);
 | 
				
			||||||
    if(!parsed) {
 | 
					    if(!parsed) {
 | 
				
			||||||
        qCritical() << parser.errorText();
 | 
					        qCritical() << parser.errorText();
 | 
				
			||||||
| 
						 | 
					@ -99,17 +109,35 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) {
 | 
				
			||||||
    bool exportContacts = parser.isSet(exportContactsOption);
 | 
					    bool exportContacts = parser.isSet(exportContactsOption);
 | 
				
			||||||
    bool exportTxHistory = parser.isSet(exportTxHistoryOption);
 | 
					    bool exportTxHistory = parser.isSet(exportTxHistoryOption);
 | 
				
			||||||
    bool backgroundAddressEnabled = parser.isSet(backgroundOption);
 | 
					    bool backgroundAddressEnabled = parser.isSet(backgroundOption);
 | 
				
			||||||
 | 
					    bool openVREnabled = parser.isSet(openVROption);
 | 
				
			||||||
    bool cliMode = exportContacts || exportTxHistory || backgroundAddressEnabled;
 | 
					    bool cliMode = exportContacts || exportTxHistory || backgroundAddressEnabled;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    qRegisterMetaType<QVector<QString>>();
 | 
					    qRegisterMetaType<QVector<QString>>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if(openVREnabled) {
 | 
				
			||||||
 | 
					#ifdef HAS_OPENVR
 | 
				
			||||||
 | 
					        QApplication vr_app(argc, argv);
 | 
				
			||||||
 | 
					        auto *ctx = new AppContext(&parser);
 | 
				
			||||||
 | 
					        auto *vr = new wowletVR::WowletVR(ctx, &parser, &vr_app);
 | 
				
			||||||
 | 
					        qDebug() << "Context: " << qgetenv("QMLSCENE_DEVICE");
 | 
				
			||||||
 | 
					        if(vr->errors.length() > 0)
 | 
				
			||||||
 | 
					            return 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        vr->render();
 | 
				
			||||||
 | 
					        return vr_app.exec();
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					        qCritical() << "Wowlet compiled without OpenVR support.";
 | 
				
			||||||
 | 
					        exit(1);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if(cliMode) {
 | 
					    if(cliMode) {
 | 
				
			||||||
 | 
					        auto *ctx = new AppContext(&parser);
 | 
				
			||||||
        QCoreApplication cli_app(argc, argv);
 | 
					        QCoreApplication cli_app(argc, argv);
 | 
				
			||||||
        QCoreApplication::setApplicationName("wowlet");
 | 
					        QCoreApplication::setApplicationName("wowlet");
 | 
				
			||||||
        QCoreApplication::setOrganizationDomain("wownero.org");
 | 
					        QCoreApplication::setOrganizationDomain("wownero.org");
 | 
				
			||||||
        QCoreApplication::setOrganizationName("wownero.org");
 | 
					        QCoreApplication::setOrganizationName("wownero.org");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        auto *ctx = new AppContext(&parser);
 | 
					 | 
				
			||||||
        ctx->applicationPath = QString(argv[0]);
 | 
					        ctx->applicationPath = QString(argv[0]);
 | 
				
			||||||
        ctx->isDebug = debugMode;
 | 
					        ctx->isDebug = debugMode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -201,7 +201,7 @@ void WSServer::processBinaryMessage(QByteArray buffer) {
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        FeatherSeed seed = FeatherSeed(m_ctx->restoreHeights[m_ctx->networkType], m_ctx->coinName, m_ctx->seedLanguage);
 | 
					        WowletSeed seed = WowletSeed(m_ctx->restoreHeights[m_ctx->networkType], m_ctx->coinName, m_ctx->seedLanguage);
 | 
				
			||||||
        m_ctx->createWallet(seed, walletPath, password);
 | 
					        m_ctx->createWallet(seed, walletPath, password);
 | 
				
			||||||
    } else if(cmd == "transactionHistory") {
 | 
					    } else if(cmd == "transactionHistory") {
 | 
				
			||||||
        m_ctx->currentWallet->history()->refresh(m_ctx->currentWallet->currentSubaddressAccount());
 | 
					        m_ctx->currentWallet->history()->refresh(m_ctx->currentWallet->currentSubaddressAccount());
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue