CMake module for libngspice

This commit is contained in:
Maciej Suminski 2016-08-12 15:56:51 +02:00
parent 6e5628ceaf
commit 497b2a9442
4 changed files with 37 additions and 2 deletions

View File

@ -502,6 +502,11 @@ if( MINGW AND USE_WX_GRAPHICS_CONTEXT )
check_find_package_result( GDI_PLUS_FOUND "GDI+" ) check_find_package_result( GDI_PLUS_FOUND "GDI+" )
endif() endif()
# Find ngspice library, required for integrated circuit simulator
if( KICAD_SPICE )
find_package( ngspice REQUIRED )
endif()
# Assist with header file searching optimization: # Assist with header file searching optimization:
# INC_BEFORE and INC_AFTER are two lists which go at the front and back of the # INC_BEFORE and INC_AFTER are two lists which go at the front and back of the
# header file search lists, respectively. # header file search lists, respectively.

View File

@ -0,0 +1,25 @@
# CMake script for finding libngspice
# (C) CERN 2016
# Author: Maciej Suminski <maciej.suminski@cern.ch>
find_path( NGSPICE_INCLUDE_DIR ngspice/sharedspice.h
PATHS ${NGSPICE_INCLUDE_PATH}
PATH_SUFFIXES share/ngspice/include
)
find_library( NGSPICE_LIBRARY ngspice
PATHS ${NGSPICE_LIBRARY_PATH}
)
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( ngspice
REQUIRED_VARS
NGSPICE_INCLUDE_DIR
NGSPICE_LIBRARY
)
mark_as_advanced(
NGSPICE_INCLUDE_DIR
NGSPICE_LIBRARY
)

View File

@ -1,5 +1,9 @@
add_definitions( -DEESCHEMA ) add_definitions( -DEESCHEMA )
if( KICAD_SPICE )
set( INC_AFTER ${INC_AFTER} ${NGSPICE_INCLUDE_DIR} )
endif()
include_directories( BEFORE ${INC_BEFORE} ) include_directories( BEFORE ${INC_BEFORE} )
include_directories( include_directories(
./dialogs ./dialogs

View File

@ -25,9 +25,10 @@
#ifndef NGSPICE_H #ifndef NGSPICE_H
#define NGSPICE_H #define NGSPICE_H
#include <../share/ngspice/include/ngspice/sharedspice.h>
#include "spice_simulator.h" #include "spice_simulator.h"
#include <ngspice/sharedspice.h>
class wxDynamicLibrary; class wxDynamicLibrary;
class NGSPICE : public SPICE_SIMULATOR { class NGSPICE : public SPICE_SIMULATOR {