# include <dlfcn.h>
#endif // cpPlugins_SYS_WINDOWS
#include <cpPlugins_dirent.h>
-#include <cpPlugins/cpPlugins_DynLibs.h>
+#include <cpPlugins_Instances/cpPlugins_DynLibs.h>
#include <algorithm>
// -------------------------------------------------------------------------
// Explicitly load all ITK and VTK
if( Self::InterfacesCount == 0 )
{
+ // Base libraries
std::vector< std::string > libs;
cpPlugins::TokenizeString( libs, cpPlugins_DynLibs, ";" );
- this->_AddInstancesLib( libs, cpPlugins_CompilationDir );
- this->_AddInstancesLib( libs, cpPlugins_InstallationDir );
+
+ // Local instances
+ for( auto p = this->m_Paths.begin( ); p != this->m_Paths.end( ); ++p )
+ {
+ DIR* dir;
+ struct dirent* ent;
+ if( ( dir = opendir( p->c_str( ) ) ) != NULL )
+ {
+ while( ( ent = readdir( dir ) ) != NULL )
+ {
+ std::string fname = *p + std::string( "/" ) + ent->d_name;
+ if( fname.find( "_Instances" ) != std::string::npos )
+ libs.push_back( fname );
+
+ } // elihw
+ closedir( dir );
+
+ } // fi
+
+ } // rof
for( auto l = libs.begin( ); l != libs.end( ); ++l )
{
return( res );
}
-// -------------------------------------------------------------------------
-template< class _TList >
-void cpPlugins::Interface::
-_AddInstancesLib( _TList& libs, const std::string& path )
-{
- DIR* dir;
- struct dirent* ent;
- if( ( dir = opendir( path.c_str( ) ) ) != NULL )
- {
- while( ( ent = readdir( dir ) ) != NULL )
- {
- std::string fname = path + std::string( "/" ) + ent->d_name;
- if( fname.find( "cpPlugins_Instances_" ) != std::string::npos )
- libs.push_back( fname );
-
- } // elihw
- closedir( dir );
-
- } // fi
-}
-
// -------------------------------------------------------------------------
void* cpPlugins::Interface::
_DLOpen( const std::string& fname, std::string& error )