1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
From: Ole Streicher <olebole@debian.org>
Date: Wed, 20 Nov 2019 08:56:53 +0100
Subject: Change install-tree location of wxPLViewer
The wxPLViewer application is only used internally by the wxwidgets
This is based on commit 4e9679b22 in upstream git,
author Alan W. Irwin <airwin@users.sourceforge.net>
https://sourceforge.net/p/plplot/plplot/ci/4e9679b2266e190f66969f21392cdcf9766a58c9
Closes: #944579
---
drivers/wxwidgets_dev.cpp | 32 ++++++--------------------------
include/plplotP.h | 2 --
src/plcore.c | 5 +----
utils/CMakeLists.txt | 6 +++++-
4 files changed, 12 insertions(+), 33 deletions(-)
diff --git a/drivers/wxwidgets_dev.cpp b/drivers/wxwidgets_dev.cpp
index 6351c68..43e70be 100644
--- a/drivers/wxwidgets_dev.cpp
+++ b/drivers/wxwidgets_dev.cpp
@@ -1753,32 +1753,12 @@ void wxPLDevice::SetupMemoryMap()
header->completeFlag = 0;
#endif // #ifdef PL_WXWIDGETS_IPC3
- //try to find the wxPLViewer executable, in the first instance just assume it
- //is in the path.
- //wxString exeName = wxT( "/nfs/see-fs-02_users/earpros/usr/src/plplot-plplot/build/utils/" NAME_wxPLViewer );
- wxString exeName = wxT( NAME_wxPLViewer );
- if ( plInBuildTree() )
- {
- //if we are in the build tree check for the needed exe in there
- wxArrayString files;
- wxString utilsDir = wxString( wxT( BUILD_DIR ) ) + wxString( wxT( "/utils" ) );
- wxDir::GetAllFiles( utilsDir, &files, exeName, wxDIR_FILES | wxDIR_DIRS );
- if ( files.size() == 0 )
- wxDir::GetAllFiles( utilsDir, &files, exeName + wxT( ".exe" ), wxDIR_FILES | wxDIR_DIRS );
- if ( files.size() > 0 )
- exeName = files[0];
- }
- else
- {
- //check the plplot bin install directory
- wxArrayString files;
- wxDir::GetAllFiles( wxT( BIN_DIR ), &files, exeName, wxDIR_FILES | wxDIR_DIRS );
- if ( files.size() == 0 )
- wxDir::GetAllFiles( wxT( BIN_DIR ), &files, exeName + wxT( ".exe" ), wxDIR_FILES | wxDIR_DIRS );
- if ( files.size() > 0 )
- exeName = files[0];
- }
- //Run the wxPlViewer with command line parameters telling it the location and size of the buffer
+ // The wxPLViewer executable has been built (build-tree case)
+ // or installed (install-tree case) in the drivers directory.
+ // So use the appropriate build-tree or install-tree location
+ // when referring to it.
+ wxString exeName = wxString( _( plGetDrvDir() ) ) + _( "/" ) + _( NAME_wxPLViewer );
+ //Run wxPlViewer with command line parameters telling it the location and size of the buffer
wxString command;
command << wxT( "\"" ) << exeName << wxT( "\" " ) << wxString( mapName, wxConvUTF8 ) << wxT( " " ) <<
mapSize << wxT( " " ) << m_width << wxT( " " ) << m_height;
diff --git a/include/plplotP.h b/include/plplotP.h
index 8d44e49..22a2036 100644
--- a/include/plplotP.h
+++ b/include/plplotP.h
@@ -1275,10 +1275,8 @@ plwytik( PLFLT x, PLFLT y, PLBOOL minor, PLBOOL invert );
// get drivers directory
-#ifdef ENABLE_DYNDRIVERS
PLDLLIMPEXP const char*
plGetDrvDir( void );
-#endif
#ifdef PL_HAVE_FREETYPE
PLDLLIMPEXP void
diff --git a/src/plcore.c b/src/plcore.c
index 84b8063..f57e756 100644
--- a/src/plcore.c
+++ b/src/plcore.c
@@ -2966,7 +2966,7 @@ int plInBuildTree()
return inBuildTree;
}
-#ifdef ENABLE_DYNDRIVERS
+// Need this for both the ENABLE_DYNDRIVERS case and the wxPLViewer case.
PLCHAR_VECTOR
plGetDrvDir()
@@ -2998,9 +2998,6 @@ plGetDrvDir()
return drvdir;
}
-#endif
-
-
//--------------------------------------------------------------------------
// void plInitDispatchTable()
//
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index 5772910..f2a8411 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -52,7 +52,11 @@ if(ENABLE_wxwidgets AND NOT OLD_WXWIDGETS)
)
set(wxPLViewer_link_libraries PLPLOT::plplotwxwidgets PLPLOT::plplotcxx ${wxwidgets_LINK_FLAGS} ${MATH_LIB} ${RT_LIB})
- configure_executable_build(wxPLViewer "${wxPLViewer_SRCS}" "${wxPLViewer_link_libraries}" "${LIB_INSTALL_RPATH}" ${BIN_DIR})
+
+ # wxPLViewer depends on the plplotwxwidgets and plplotcxx libraries and is installed
+ # in the drivers directory.
+ set(LIB_INSTALL_RPATH ${LIB_DIR})
+ configure_executable_build(wxPLViewer "${wxPLViewer_SRCS}" "${wxPLViewer_link_libraries}" "${LIB_INSTALL_RPATH}" ${DRV_DIR})
# Set this property rather than using the WIN32 signature of add_executable
# inside the configure_executable_build function.
|