2016-08-12 13:56:51 +00:00
|
|
|
# CMake script for finding libngspice
|
|
|
|
# (C) CERN 2016
|
|
|
|
# Author: Maciej Suminski <maciej.suminski@cern.ch>
|
|
|
|
|
|
|
|
find_path( NGSPICE_INCLUDE_DIR ngspice/sharedspice.h
|
2016-08-15 12:39:26 +00:00
|
|
|
PATHS ${NGSPICE_ROOT_DIR} $ENV{NGSPICE_ROOT_DIR} ${NGSPICE_INCLUDE_PATH}
|
2016-08-15 13:27:24 +00:00
|
|
|
PATH_SUFFIXES src/include share/ngspice/include share/ngspice/include/ngspice
|
2016-08-12 13:56:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
find_library( NGSPICE_LIBRARY ngspice
|
2016-08-15 12:39:26 +00:00
|
|
|
PATHS ${NGSPICE_ROOT_DIR} $ENV{NGSPICE_ROOT_DIR} ${NGSPICE_LIBRARY_PATH}
|
2016-08-15 13:27:24 +00:00
|
|
|
PATH_SUFFIXES src/.libs lib
|
2016-08-12 13:56:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
include( FindPackageHandleStandardArgs )
|
|
|
|
|
2016-08-22 12:28:31 +00:00
|
|
|
if( ${NGSPICE_INCLUDE_DIR} STREQUAL "NGSPICE_INCLUDE_DIR-NOTFOUND" OR ${NGSPICE_LIBRARY} STREQUAL "NGSPICE_LIBRARY-NOTFOUND" )
|
|
|
|
message( "" )
|
|
|
|
message( "*** NGSPICE library missing ***" )
|
|
|
|
message( "Most of ngspice packages do not provide the required libngspice library." )
|
|
|
|
message( "You can either compile ngspice configured with --with-ngshared parameter" )
|
|
|
|
message( "or run a script that does the job for you:" )
|
|
|
|
message( " wget https://orson.net.pl/pub/libngspice/get_libngspice_so.sh" )
|
2016-08-22 14:08:45 +00:00
|
|
|
message( " chmod +x get_libngspice_so.sh" )
|
|
|
|
message( " ./get_libngspice_so.sh" )
|
|
|
|
message( " sudo ./get_libngspice_so.sh install" )
|
2016-08-22 12:28:31 +00:00
|
|
|
message( "" )
|
|
|
|
endif()
|
|
|
|
|
2016-08-12 13:56:51 +00:00
|
|
|
find_package_handle_standard_args( ngspice
|
|
|
|
REQUIRED_VARS
|
|
|
|
NGSPICE_INCLUDE_DIR
|
|
|
|
NGSPICE_LIBRARY
|
|
|
|
)
|
|
|
|
|
|
|
|
mark_as_advanced(
|
|
|
|
NGSPICE_INCLUDE_DIR
|
|
|
|
NGSPICE_LIBRARY
|
|
|
|
)
|