Browse Source

Enable qa_ngspice to run from build dir on macOS

pcb_db
Jon Evans 11 months ago
parent
commit
1198233464
  1. 2
      eeschema/CMakeLists.txt
  2. 11
      eeschema/sim/ngspice.cpp

2
eeschema/CMakeLists.txt

@ -20,10 +20,12 @@ set( INC_AFTER ${INC_AFTER} ${NGSPICE_INCLUDE_DIR} )
# Find out the exact libngspice file name
get_filename_component( NGSPICE_DLL_ABSPATH "${NGSPICE_DLL}" ABSOLUTE )
get_filename_component( NGSPICE_DLL_FILE "${NGSPICE_DLL_ABSPATH}" NAME )
get_filename_component( NGSPICE_DLL_DIR "${NGSPICE_DLL_ABSPATH}" DIRECTORY )
set_property( SOURCE sim/ngspice.cpp
APPEND PROPERTY COMPILE_DEFINITIONS
NGSPICE_DLL_FILE="${NGSPICE_DLL_FILE}"
NGSPICE_DLL_DIR="${NGSPICE_DLL_DIR}"
)
include_directories( BEFORE ${INC_BEFORE} )

11
eeschema/sim/ngspice.cpp

@ -436,12 +436,12 @@ void NGSPICE::init_dll()
wxFileName dllFile( "", NGSPICE_DLL_FILE );
#if defined(__WINDOWS__)
#if defined( _MSC_VER )
const std::vector<std::string> dllPaths = { "" };
std::vector<std::string> dllPaths = { "" };
#else
const std::vector<std::string> dllPaths = { "", "/mingw64/bin", "/mingw32/bin" };
std::vector<std::string> dllPaths = { "", "/mingw64/bin", "/mingw32/bin" };
#endif
#elif defined(__WXMAC__)
const std::vector<std::string> dllPaths = {
std::vector<std::string> dllPaths = {
PATHS::GetOSXKicadUserDataDir().ToStdString() + "/PlugIns/ngspice",
PATHS::GetOSXKicadMachineDataDir().ToStdString() + "/PlugIns/ngspice",
@ -453,9 +453,12 @@ void NGSPICE::init_dll()
"/../../../../../Contents/PlugIns/sim"
};
#else // Unix systems
const std::vector<std::string> dllPaths = { "/usr/local/lib" };
std::vector<std::string> dllPaths = { "/usr/local/lib" };
#endif
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
dllPaths.emplace_back( NGSPICE_DLL_DIR );
#if defined(__WINDOWS__) || (__WXMAC__)
for( const auto& path : dllPaths )
{

Loading…
Cancel
Save