diff --git a/gui/cefdisplay/CMakeLists.txt b/gui/cefdisplay/CMakeLists.txt index ca4eeff3f7cb5958718c933fb133e84b5bceb905..fc316b6232343bd2009119792b03c8f1c06c70eb 100644 --- a/gui/cefdisplay/CMakeLists.txt +++ b/gui/cefdisplay/CMakeLists.txt @@ -21,7 +21,7 @@ elseif(MSVC) set(CEF_BLOBS ${CEF_root}/Release) set(CEF_LIBRARY ${CEF_root}/Release/libcef.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 () set(CEF_platform src/gui_handler_linux.cxx) set(CEF_RESOURCES ${CEF_root}/Resources) @@ -34,12 +34,22 @@ endif() include_directories($ENV{CEF_PATH} inc) set(CEF_MAIN src/cef_main.cxx) -configure_file(${CEF_RESOURCES}/icudtl.dat "../../bin/icudtl.dat" COPYONLY) -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) +## copy different CEF files into binary directory to avoid CEF_PATH when running ROOT -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} DEPENDENCIES RHTTP ROOTWebDisplay) diff --git a/gui/cefdisplay/src/simple_app.cxx b/gui/cefdisplay/src/simple_app.cxx index 16afb918c6e86c7a05d18e88bd7247a5f4c3df56..2d94305bc78826cc0129644535e7182f32fe2658 100644 --- a/gui/cefdisplay/src/simple_app.cxx +++ b/gui/cefdisplay/src/simple_app.cxx @@ -51,7 +51,6 @@ #include <ROOT/RMakeUnique.hxx> #include <ROOT/TLogger.hxx> - THttpServer *gHandlingServer = nullptr; class TCefHttpCallArg : public THttpCallArg { @@ -159,8 +158,6 @@ public: 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 (fTransferOffset >= fArg->GetContentLength()) fArg.reset(); @@ -366,8 +363,7 @@ void SimpleApp::StartWindow(const std::string &addr, bool batch, CefRect &rect) 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. CefBrowserSettings browser_settings; @@ -495,14 +491,8 @@ protected: // XSetErrorHandler(XErrorHandlerImpl); // XSetIOErrorHandler(XIOErrorHandlerImpl); - const char *cef_path = gSystem->Getenv("CEF_PATH"); const char *rootsys = gSystem->Getenv("ROOTSYS"); - if (!cef_path) { - R__ERROR_HERE("CEF") << "CEF_PATH not configured to use CEF"; - return nullptr; - } - if (!rootsys) { R__ERROR_HERE("CEF") << "ROOTSYS not configured to use CEF"; return nullptr; @@ -511,13 +501,10 @@ protected: // Specify CEF global settings here. CefSettings settings; - TString path, path2, cef_main; - path.Form("%s/Resources/", cef_path); - path2.Form("%s/Resources/locales/", cef_path); + TString cef_main; 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(path2.Data(), path2.Length(), &settings.locales_dir_path); settings.no_sandbox = 1;