Revision: 9121
http://sourceforge.net/p/playerstage/svn/9121
Author: jpgr87
Date: 2013-01-12 20:06:07 +0000 (Sat, 12 Jan 2013)
Log Message:
-----------
Add a global plugin directory outside of system library search path
This commit adds support for a system-wide plugin installation directory that
is versioned and not on the system's library installation path. Currently it
is implemented as a subdirectory of the library installation directory.
Modified Paths:
--------------
code/player/trunk/cmake/UsePlayerPlugin.cmake.in
code/player/trunk/cmake/internal/SetupDirectories.cmake
code/player/trunk/config.h.in
code/player/trunk/libplayercore/plugins.cc
Modified: code/player/trunk/cmake/UsePlayerPlugin.cmake.in
===================================================================
--- code/player/trunk/cmake/UsePlayerPlugin.cmake.in 2013-01-07 00:18:52 UTC
(rev 9120)
+++ code/player/trunk/cmake/UsePlayerPlugin.cmake.in 2013-01-12 20:06:07 UTC
(rev 9121)
@@ -64,6 +64,9 @@
ENDIF (PLAYERCORE_PKG_LDFLAGS_OTHER)
ENDIF (NOT PKG_CONFIG_FOUND)
+# Set Player's global plugin directory so third parties can drop their plugins
+# there when installing system-wide
+SET(PLAYER_PLUGIN_INSTALL_DIR
"@CMAKE_INSTALL_PREFIX@/@PLAYER_PLUGIN_INSTALL_DIR@")
# This is slightly different from the one used by the Player build system
itself.
# It takes a single file instead of a directory. It also expects
playerinterfacegen.py
Modified: code/player/trunk/cmake/internal/SetupDirectories.cmake
===================================================================
--- code/player/trunk/cmake/internal/SetupDirectories.cmake 2013-01-07
00:18:52 UTC (rev 9120)
+++ code/player/trunk/cmake/internal/SetupDirectories.cmake 2013-01-12
20:06:07 UTC (rev 9121)
@@ -20,7 +20,8 @@
#ENDIF (PLAYER_PROC_64BIT)
SET (PLAYER_LIBRARY_INSTALL_DIR "lib${LIB_SUFFIX}")
+SET (PLAYER_PLUGIN_INSTALL_DIR
"${PLAYER_LIBRARY_INSTALL_DIR}/${projectNameLower}-${PLAYER_MAJOR_VERSION}.${PLAYER_MINOR_VERSION}")
MESSAGE (STATUS "Headers will be installed to
${CMAKE_INSTALL_PREFIX}/${PLAYER_INCLUDE_INSTALL_DIR}")
MESSAGE (STATUS "Libraries will be installed to
${CMAKE_INSTALL_PREFIX}/${PLAYER_LIBRARY_INSTALL_DIR}")
-
+MESSAGE (STATUS "Plugins will be installed to
${CMAKE_INSTALL_PREFIX}/${PLAYER_PLUGIN_INSTALL_DIR}")
Modified: code/player/trunk/config.h.in
===================================================================
--- code/player/trunk/config.h.in 2013-01-07 00:18:52 UTC (rev 9120)
+++ code/player/trunk/config.h.in 2013-01-12 20:06:07 UTC (rev 9121)
@@ -3,6 +3,7 @@
/* Install prefix */
#define PLAYER_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}"
#define PLAYER_LIBRARY_INSTALL_DIR "${PLAYER_LIBRARY_INSTALL_DIR}"
+#define PLAYER_PLUGIN_INSTALL_DIR "${PLAYER_PLUGIN_INSTALL_DIR}"
/* enable TCP_NODELAY */
#cmakedefine ENABLE_TCP_NODELAY 1
Modified: code/player/trunk/libplayercore/plugins.cc
===================================================================
--- code/player/trunk/libplayercore/plugins.cc 2013-01-07 00:18:52 UTC (rev
9120)
+++ code/player/trunk/libplayercore/plugins.cc 2013-01-12 20:06:07 UTC (rev
9121)
@@ -123,14 +123,23 @@
free(tmp);
}
- // add $PLAYER_INSTALL_PREFIX/lib
+ // Add the global plugin install directory
+ char plugindir[ PATH_MAX ];
+ strncpy( plugindir, PLAYER_INSTALL_PREFIX, PATH_MAX);
+ strncat( plugindir, "/", PATH_MAX);
+ strncat( plugindir, PLAYER_PLUGIN_INSTALL_DIR, PATH_MAX);
+ strncat( plugindir, "/", PATH_MAX);
+ if( lt_dladdsearchdir( plugindir ) )
+ PLAYER_ERROR1( "failed to add system plugin directory %s to the plugin
path", plugindir );
+
+ // add $PLAYER_INSTALL_PREFIX/lib<qual>
char installdir[ PATH_MAX ];
strncpy( installdir, PLAYER_INSTALL_PREFIX, PATH_MAX);
strncat( installdir, "/", PATH_MAX);
strncat( installdir, PLAYER_LIBRARY_INSTALL_DIR, PATH_MAX);
strncat( installdir, "/", PATH_MAX);
if( lt_dladdsearchdir( installdir ) )
- PLAYER_ERROR1( "failed to add working directory %s to the plugin path",
installdir );
+ PLAYER_ERROR1( "failed to add library installation directory %s to the
plugin path", installdir );
}
PLAYER_MSG1(3, "loading plugin %s", pluginname);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit