7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 00:21:25 +00:00

Enable qa_ngspice to run from build dir on macOS

This commit is contained in:
Jon Evans 2024-12-01 14:44:25 -05:00
parent 9b1b318736
commit 1198233464
2 changed files with 9 additions and 4 deletions

View File

@ -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} )

View File

@ -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 )
{