diff --git a/CMakeModules/Findngspice.cmake b/CMakeModules/Findngspice.cmake index 40b18ea01a..07b57c978a 100644 --- a/CMakeModules/Findngspice.cmake +++ b/CMakeModules/Findngspice.cmake @@ -51,7 +51,6 @@ if( PKG_CONFIG_FOUND ) endif() endif() - find_path( NGSPICE_INCLUDE_DIR ngspice/sharedspice.h PATHS ${NGSPICE_ROOT_DIR} @@ -65,7 +64,13 @@ find_path( NGSPICE_INCLUDE_DIR ngspice/sharedspice.h share/ngspice/include/ngspice ) -find_library( NGSPICE_LIBRARY ngspice +if( UNIX ) + set( NGSPICE_LIB_NAME libngspice.so.0 CACHE STRING "Optionally versioned name of the shared library" ) +else() + set( NGSPICE_LIB_NAME ngspice CACHE STRING "Optionally versioned name of the shared library" ) +endif() + +find_library( NGSPICE_LIBRARY ${NGSPICE_LIB_NAME} PATHS ${NGSPICE_ROOT_DIR} $ENV{NGSPICE_ROOT_DIR} @@ -147,5 +152,5 @@ mark_as_advanced( NGSPICE_LIBRARY NGSPICE_DLL NGSPICE_BUILD_VERSION - NGSPIC_HAVE_CONFIG_H + NGSPICE_HAVE_CONFIG_H ) diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index daf141f2ad..79cc227b46 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -9,8 +9,8 @@ if( KICAD_SPICE ) set( INC_AFTER ${INC_AFTER} ${NGSPICE_INCLUDE_DIR} ) # Find out the exact libngspice file name - get_filename_component( NGSPICE_DLL_REALPATH "${NGSPICE_DLL}" REALPATH ) - get_filename_component( NGSPICE_DLL_FILE "${NGSPICE_DLL_REALPATH}" NAME ) + get_filename_component( NGSPICE_DLL_ABSPATH "${NGSPICE_DLL}" ABSOLUTE ) + get_filename_component( NGSPICE_DLL_FILE "${NGSPICE_DLL_ABSPATH}" NAME ) set_property( SOURCE sim/ngspice.cpp APPEND PROPERTY COMPILE_DEFINITIONS