From 11278c50dc78f3cd3701ace2614d2a74f315dd47 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 12 Oct 2011 21:30:18 +0000 Subject: [PATCH] Fix Java viewer integration when building WinVNC with MinGW git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4727 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- win/winvnc/CMakeLists.txt | 8 ++++---- win/winvnc/JavaViewer.cxx | 4 ++++ win/winvnc/winvnc.rc.in | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/win/winvnc/CMakeLists.txt b/win/winvnc/CMakeLists.txt index 3b576a7b..dc567b12 100644 --- a/win/winvnc/CMakeLists.txt +++ b/win/winvnc/CMakeLists.txt @@ -7,11 +7,11 @@ endif() add_library(wm_hooks SHARED ../wm_hooks/wm_hooks.cxx - ../wm_hooks/wm_hooks.def - ../wm_hooks/wm_hooks.rc) + ../wm_hooks/wm_hooks.def + ../wm_hooks/wm_hooks.rc) -string(REGEX REPLACE "/" "\\\\\\\\" CMAKE_WIN_BINARY_DIR ${CMAKE_BINARY_DIR}) -string(REGEX REPLACE "/" "\\\\\\\\" CMAKE_WIN_SOURCE_DIR ${CMAKE_SOURCE_DIR}) +set(VNCVIEWER_JAR_PATH ${CMAKE_BINARY_DIR}/java/VncViewer.jar) +set(INDEX_VNC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/index.vnc) configure_file(winvnc.rc.in winvnc.rc) diff --git a/win/winvnc/JavaViewer.cxx b/win/winvnc/JavaViewer.cxx index 39ff915a..6f9f6de5 100644 --- a/win/winvnc/JavaViewer.cxx +++ b/win/winvnc/JavaViewer.cxx @@ -45,6 +45,10 @@ rdr::InStream* JavaViewerServer::getFile(const char* name, { if (strcmp(name, "/") == 0) name = "/index.vnc"; + if (strcmp(name, "/VncViewer.jar") == 0) + name = "VncViewer.jar"; + if (strcmp(name, "/index.vnc") == 0) + name = "index.vnc"; HRSRC resource = FindResource(0, TStr(name), _T("HTTPFILE")); if (!resource) return 0; diff --git a/win/winvnc/winvnc.rc.in b/win/winvnc/winvnc.rc.in index 3c484ed7..b59befde 100644 --- a/win/winvnc/winvnc.rc.in +++ b/win/winvnc/winvnc.rc.in @@ -223,8 +223,8 @@ END #cmakedefine BUILD_JAVA #ifdef BUILD_JAVA -/VNCVIEWER.JAR HTTPFILE DISCARDABLE "@CMAKE_WIN_BINARY_DIR@\\java\\VncViewer.jar" -/INDEX.VNC HTTPFILE DISCARDABLE "@CMAKE_WIN_SOURCE_DIR@\\win\\winvnc\\index.vnc" +VNCVIEWER.JAR HTTPFILE DISCARDABLE "@VNCVIEWER_JAR_PATH@" +INDEX.VNC HTTPFILE DISCARDABLE "@INDEX_VNC_PATH@" #endif ///////////////////////////////////////////////////////////////////////////// -- 2.39.5