Skip to content

Commit

Permalink
added backwards compatible to the search for DrModelica and OMC in OM…
Browse files Browse the repository at this point in the history
…Notebook and OMShell

// Anders Fernström

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2177 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
x05andfe committed Feb 28, 2006
1 parent 4d6cf18 commit 1128b33
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
20 changes: 10 additions & 10 deletions OMShell/QWinMosh.vcproj
Expand Up @@ -249,15 +249,6 @@
Name="Generated Files"
Filter="moc;h;cpp"
UniqueIdentifier="{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}">
<File
RelativePath=".\generatedfiles\release\moc_omc_communicator.cpp">
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\generatedfiles\debug\moc_omc_communicator.cpp">
<FileConfiguration
Expand All @@ -275,7 +266,7 @@
</FileConfiguration>
</File>
<File
RelativePath=".\GeneratedFiles\release\moc_oms.cpp">
RelativePath=".\generatedfiles\release\moc_omc_communicator.cpp">
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
Expand All @@ -299,6 +290,15 @@
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
</FileConfiguration>
</File>
<File
RelativePath=".\GeneratedFiles\release\moc_oms.cpp">
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\GeneratedFiles\qrc_oms.cpp">
</File>
Expand Down
18 changes: 17 additions & 1 deletion OMShell/omcinteractiveenvironment.cpp
Expand Up @@ -51,6 +51,7 @@ licence: http://www.trolltech.com/products/qt/licensing.html
#include <exception>
#include <stdexcept>

#include <QtCore/QDir>
#include <QtGui/QMessageBox>

#include "omcinteractiveenvironment.h"
Expand Down Expand Up @@ -138,7 +139,22 @@ namespace IAEX
throw std::exception( "Could not find environment variable OPENMODELICAHOME" );

// location of omc in openmodelica folder
OMCPath += "\\bin\\";
QDir dir;
if( dir.exists( QString(OMCPath.c_str()) + "\\bin\\omc.exe" ) )
OMCPath += "\\bin\\";
else if( dir.exists( QString(OMCPath.c_str()) + "\\omc.exe" ) )
OMCPath;
else if( dir.exists( "omc.exe" ))
OMCPath = "";
else
{
string msg = "Unable to find omc.exe, searched in:\n" +
OMCPath + "\\bin\\\n" +
OMCPath + "\n" +
dir.absolutePath().toStdString();

throw std::exception( msg.c_str() );
}

STARTUPINFO startinfo;
PROCESS_INFORMATION procinfo;
Expand Down

0 comments on commit 1128b33

Please sign in to comment.