mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Create a new ApplicationExe project for the executable
This commit is contained in:
@@ -1076,27 +1076,7 @@ QString RiaApplication::pythonPath() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QProcessEnvironment RiaApplication::pythonProcessEnvironment() const
|
||||
{
|
||||
QProcessEnvironment penv = QProcessEnvironment::systemEnvironment();
|
||||
#ifdef ENABLE_GRPC
|
||||
penv.insert( "RESINSIGHT_GRPC_PORT", QString( "%1" ).arg( m_grpcServer->portNumber() ) );
|
||||
penv.insert( "RESINSIGHT_EXECUTABLE", QCoreApplication::applicationFilePath() );
|
||||
|
||||
QStringList ripsLocations;
|
||||
QString separator;
|
||||
#ifdef WIN32
|
||||
ripsLocations << QCoreApplication::applicationDirPath() + "\\Python"
|
||||
<< QCoreApplication::applicationDirPath() + "\\..\\..\\Python";
|
||||
separator = ";";
|
||||
|
||||
#else
|
||||
ripsLocations << QCoreApplication::applicationDirPath() + "/Python"
|
||||
<< QCoreApplication::applicationDirPath() + "/../../Python";
|
||||
separator = ":";
|
||||
#endif
|
||||
penv.insert( "PYTHONPATH",
|
||||
QString( "%1%2%3" ).arg( penv.value( "PYTHONPATH" ) ).arg( separator ).arg( ripsLocations.join( separator ) ) );
|
||||
#endif
|
||||
return penv;
|
||||
return QProcessEnvironment::systemEnvironment();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1500,36 +1480,6 @@ cvf::Font* RiaApplication::defaultWellLabelFont()
|
||||
return m_defaultWellLabelFont.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaApplication::initializeGrpcServer( const cvf::ProgramOptions& progOpt )
|
||||
{
|
||||
#ifdef ENABLE_GRPC
|
||||
if ( !m_preferences->enableGrpcServer() ) return false;
|
||||
|
||||
int defaultPortNumber = m_preferences->defaultGrpcPortNumber();
|
||||
bool fixedPort = false;
|
||||
if ( cvf::Option o = progOpt.option( "server" ) )
|
||||
{
|
||||
if ( o.valueCount() == 1 )
|
||||
{
|
||||
defaultPortNumber = o.value( 0 ).toInt( defaultPortNumber );
|
||||
fixedPort = true;
|
||||
}
|
||||
}
|
||||
int portNumber = defaultPortNumber;
|
||||
if ( !fixedPort )
|
||||
{
|
||||
portNumber = RiaGrpcServer::findAvailablePortNumber( defaultPortNumber );
|
||||
}
|
||||
m_grpcServer = std::make_unique<RiaGrpcServer>( portNumber );
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user