Skip to content
Snippets Groups Projects
Commit ff3729e9 authored by Sergey Linev's avatar Sergey Linev
Browse files

webgui: move all necessary CEF files into ROOT binaries

One should be able to run ROOT without setting extra path variables
parent d155e971
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ elseif(MSVC) ...@@ -21,7 +21,7 @@ elseif(MSVC)
set(CEF_BLOBS ${CEF_root}/Release) set(CEF_BLOBS ${CEF_root}/Release)
set(CEF_LIBRARY ${CEF_root}/Release/libcef.lib) set(CEF_LIBRARY ${CEF_root}/Release/libcef.lib)
set(CEF_DLL_WRAPPER ${CEF_root}/build/libcef_dll_wrapper/Release/libcef_dll_wrapper.lib) set(CEF_DLL_WRAPPER ${CEF_root}/build/libcef_dll_wrapper/Release/libcef_dll_wrapper.lib)
configure_file(${CEF_root}/Release/libcef.dll "../../bin/libcef.dll" COPYONLY) configure_file(${CEF_root}/Release/libcef.dll ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
else () else ()
set(CEF_platform src/gui_handler_linux.cxx) set(CEF_platform src/gui_handler_linux.cxx)
set(CEF_RESOURCES ${CEF_root}/Resources) set(CEF_RESOURCES ${CEF_root}/Resources)
...@@ -34,12 +34,22 @@ endif() ...@@ -34,12 +34,22 @@ endif()
include_directories($ENV{CEF_PATH} inc) include_directories($ENV{CEF_PATH} inc)
set(CEF_MAIN src/cef_main.cxx) set(CEF_MAIN src/cef_main.cxx)
configure_file(${CEF_RESOURCES}/icudtl.dat "../../bin/icudtl.dat" COPYONLY) ## copy different CEF files into binary directory to avoid CEF_PATH when running ROOT
configure_file(${CEF_BLOBS}/natives_blob.bin "../../bin/natives_blob.bin" COPYONLY)
configure_file(${CEF_BLOBS}/snapshot_blob.bin "../../bin/snapshot_blob.bin" COPYONLY)
configure_file(${CEF_BLOBS}/v8_context_snapshot.bin "../../bin/v8_context_snapshot.bin" COPYONLY)
ROOT_LINKER_LIBRARY(${libname} ${CEF_sources} ${CEF_platform} file(GLOB cef_bins ${CEF_BLOBS}/*.bin)
foreach(cef_b ${cef_bins})
configure_file(${cef_b} ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
endforeach()
file(GLOB_RECURSE cef_resources RELATIVE ${CEF_RESOURCES} ${CEF_RESOURCES}/*)
foreach(cef_r ${cef_resources})
configure_file(${CEF_RESOURCES}/${cef_r} ${CMAKE_BINARY_DIR}/bin/${cef_r} COPYONLY)
endforeach()
ROOT_LINKER_LIBRARY(${libname} ${CEF_sources} ${CEF_platform}
LIBRARIES ${CMAKE_DL_LIBS} ${CEF_LIBRARY} ${CEF_DLL_WRAPPER} ${CEF_LIB_DEPENDENCY} LIBRARIES ${CMAKE_DL_LIBS} ${CEF_LIBRARY} ${CEF_DLL_WRAPPER} ${CEF_LIB_DEPENDENCY}
DEPENDENCIES RHTTP ROOTWebDisplay) DEPENDENCIES RHTTP ROOTWebDisplay)
......
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
#include <ROOT/RMakeUnique.hxx> #include <ROOT/RMakeUnique.hxx>
#include <ROOT/TLogger.hxx> #include <ROOT/TLogger.hxx>
THttpServer *gHandlingServer = nullptr; THttpServer *gHandlingServer = nullptr;
class TCefHttpCallArg : public THttpCallArg { class TCefHttpCallArg : public THttpCallArg {
...@@ -159,8 +158,6 @@ public: ...@@ -159,8 +158,6 @@ public:
bytes_read = transfer_size; bytes_read = transfer_size;
} }
printf("ReadResponse bytes_to_read %d bytes_read %d Total size %d Offset %d\n", bytes_to_read, bytes_read, fArg->GetContentLength(), fTransferOffset);
// if content fully copied - can release reference, object will be cleaned up // if content fully copied - can release reference, object will be cleaned up
if (fTransferOffset >= fArg->GetContentLength()) if (fTransferOffset >= fArg->GetContentLength())
fArg.reset(); fArg.reset();
...@@ -366,8 +363,7 @@ void SimpleApp::StartWindow(const std::string &addr, bool batch, CefRect &rect) ...@@ -366,8 +363,7 @@ void SimpleApp::StartWindow(const std::string &addr, bool batch, CefRect &rect)
url = addr; url = addr;
} }
printf("HANDLING SERVER %p url %s\n", gHandlingServer, url.c_str()); // printf("HANDLING SERVER %p url %s\n", gHandlingServer, url.c_str());
// Specify CEF browser settings here. // Specify CEF browser settings here.
CefBrowserSettings browser_settings; CefBrowserSettings browser_settings;
...@@ -495,14 +491,8 @@ protected: ...@@ -495,14 +491,8 @@ protected:
// XSetErrorHandler(XErrorHandlerImpl); // XSetErrorHandler(XErrorHandlerImpl);
// XSetIOErrorHandler(XIOErrorHandlerImpl); // XSetIOErrorHandler(XIOErrorHandlerImpl);
const char *cef_path = gSystem->Getenv("CEF_PATH");
const char *rootsys = gSystem->Getenv("ROOTSYS"); const char *rootsys = gSystem->Getenv("ROOTSYS");
if (!cef_path) {
R__ERROR_HERE("CEF") << "CEF_PATH not configured to use CEF";
return nullptr;
}
if (!rootsys) { if (!rootsys) {
R__ERROR_HERE("CEF") << "ROOTSYS not configured to use CEF"; R__ERROR_HERE("CEF") << "ROOTSYS not configured to use CEF";
return nullptr; return nullptr;
...@@ -511,13 +501,10 @@ protected: ...@@ -511,13 +501,10 @@ protected:
// Specify CEF global settings here. // Specify CEF global settings here.
CefSettings settings; CefSettings settings;
TString path, path2, cef_main; TString cef_main;
path.Form("%s/Resources/", cef_path);
path2.Form("%s/Resources/locales/", cef_path);
cef_main.Form("%s/bin/cef_main", rootsys); cef_main.Form("%s/bin/cef_main", rootsys);
// cef_string_ascii_to_utf16(path.Data(), path.Length(), &settings.resources_dir_path); // cef_string_ascii_to_utf16(path.Data(), path.Length(), &settings.resources_dir_path);
// cef_string_ascii_to_utf16(path2.Data(), path2.Length(), &settings.locales_dir_path); // cef_string_ascii_to_utf16(path2.Data(), path2.Length(), &settings.locales_dir_path);
settings.no_sandbox = 1; settings.no_sandbox = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment