@ -1,4 +1,3 @@
set ( default_build_gui OFF )
set ( default_build_gui OFF )
set ( default_gui_target pack )
set ( default_gui_target pack )
if ( APPLE )
if ( APPLE )
@ -15,12 +14,13 @@ set(GUI_YARN_EXTRA_OPTS "" CACHE STRING "extra options to pass into the yarn bui
if ( BUILD_GUI )
if ( BUILD_GUI )
message ( STATUS "Building lokinet-gui" )
message ( STATUS "Building lokinet-gui" )
if ( NOT YARN )
find_program ( YARN NAMES yarn yarnpkg REQUIRED )
find_program ( YARN NAMES yarn yarnpkg REQUIRED )
endif ( )
message ( STATUS "Building lokinet-gui with yarn ${YARN}, target ${GUI_YARN_TARGET}" )
message ( STATUS "Building lokinet-gui with yarn ${YARN}, target ${GUI_YARN_TARGET}" )
set ( wine_env )
set ( wine_env )
if ( WIN32 )
if ( WIN32 )
set ( wine_env WINEDEBUG=-all "WINEPREFIX=${PROJECT_BINARY_DIR}/wineprefix" )
set ( wine_env USE_SYSTEM_7ZA=true DISPLAY= WINEDEBUG=-all "WINEPREFIX=${PROJECT_BINARY_DIR}/wineprefix" )
endif ( )
endif ( )
add_custom_target ( lokinet-gui
add_custom_target ( lokinet-gui
@ -48,17 +48,25 @@ if (BUILD_GUI)
elseif ( WIN32 )
elseif ( WIN32 )
file ( MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/gui" )
file ( MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/gui" )
add_custom_target ( copy_gui ALL
option ( GUI_ZIP_FILE "custom lokinet gui for windows from zip file" OFF )
D E P E N D S l o k i n e t l o k i n e t - g u i
if ( GUI_ZIP_FILE )
# F I X M E : w e r e a l l y s h o u l d n ' t b e b u i l d i n g i n s i d e t h e s o u r c e d i r e c t o r y b u t t h i s i s n p m . . .
message ( STATUS "using custom lokinet gui from ${GUI_ZIP_FILE}" )
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
execute_process ( COMMAND ${ CMAKE_COMMAND } -E tar xf ${ GUI_ZIP_FILE }
W O R K I N G _ D I R E C T O R Y $ { P R O J E C T _ B I N A R Y _ D I R } )
else ( )
add_custom_command ( OUTPUT "${PROJECT_BINARY_DIR}/gui/lokinet-gui.exe"
D E P E N D S l o k i n e t l o k i n e t - g u i
# F I X M E : w e r e a l l y s h o u l d n ' t b e b u i l d i n g i n s i d e t h e s o u r c e d i r e c t o r y b u t t h i s i s n p m . . .
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
" $ { P R O J E C T _ S O U R C E _ D I R } / g u i / r e l e a s e / L o k i n e t - G U I _ p o r t a b l e . e x e "
" $ { P R O J E C T _ S O U R C E _ D I R } / g u i / r e l e a s e / L o k i n e t - G U I _ p o r t a b l e . e x e "
" $ { P R O J E C T _ B I N A R Y _ D I R } / g u i / l o k i n e t - g u i . e x e "
" $ { P R O J E C T _ B I N A R Y _ D I R } / g u i / l o k i n e t - g u i . e x e "
)
)
add_custom_target ( assemble_gui ALL
D E P E N D S $ { P R O J E C T _ B I N A R Y _ D I R } / g u i / l o k i n e t - g u i . e x e )
endif ( )
else ( )
else ( )
message ( FATAL_ERROR "Building/bundling the GUI from this repository is not supported on this platform" )
message ( FATAL_ERROR "Building/bundling the GUI from this repository is not supported on this platform" )
endif ( )
endif ( )
else ( )
else ( )
message ( STATUS " Not building lokinet- gui")
message ( STATUS " not building gui")
endif ( )
endif ( )