← Back to team overview

kicad-developers team mailing list archive

Re: Improving behavior and logic of Findngspice.cmake

 

Carsten,

The Findngspice.cmake script looks like a pretty standard (and pretty clean) 
implementation of how one is supposed to write find modules. There should be no 
need to provide debian specific modifications to it, and if there is it should 
be either provided by Debian ( as this is surely an issue for many packages), 
or it is a bug in cmake that it isn't respecting CMAKE_LIBRARY_ARCHITECTURE.

As you can probably tell I don't have experience in Debian packaging, but I 
have packaged quite a few things for RPM based distros, and the need to patch 
standard-style find modules is extremely rare, granted that a lot of cmake 
variables needed are pretty obscure.

Thanks,
Dan W

On Wednesday, 17 January 2018 15:46:41 GMT Wayne Stambaugh wrote:
> Hey Carsten,
> 
> On 1/17/2018 5:14 AM, Carsten Schoenert wrote:
> > Hello Dan,
> > 
> > Am 16.01.2018 um 21:16 schrieb Dan Weatherill:
> >> Hi Carsten,
> >> have you tried specifying -DCMAKE_LIBRARY_ARCHITECTURE=x86_64-linux-gnu
> >> when calling cmake in the build script?
> > 
> > no I haven't until now, but this seems not to do anything.
> > Even if I definitely have no parts of libngspice installed the cmake
> > call works without error out.
> > 
> >> Relevant documentation here, in roughly the 2nd paragraph:
> >> https://cmake.org/cmake/help/v3.0/command/find_library.html
> > 
> > I've looks several times into the documentation, after years it's still
> > not really useful and easy to understand for me.
> > 
> > I've done some small debugging right now. If I add the following message
> > statements into the helper (right after the find_library call) I got
> > output to variables that should be empty.
> > 
> >> message( STATUS "NGSPICE_INCLUDE_DIR=${NGSPICE_INCLUDE_DIR}")
> >> message( STATUS "NGSPICE_LIBRARY=${NGSPICE_LIBRARY}")
> >> message( STATUS
> >> "CMAKE_LIBRARY_ARCHITECTURE=${CMAKE_LIBRARY_ARCHITECTURE}")
> >> message( STATUS "NGSPICE_LIBRARY_PATH=${NGSPICE_LIBRARY_PATH}")
> >> message( STATUS "NGSPICE_ROOT_DIR=${NGSPICE_ROOT_DIR}")
> >> message( STATUS "CMAKE_LIBRARY_PATH=${CMAKE_LIBRARY_PATH}")
> >> 
> >> $ cmake .. -DCMAKE_LIBRARY_ARCHITECTURE=x86_64-linux-gnu
> >> -DKICAD_SCRIPTING_ACTION_MENU=ON -DKICAD_SCRIPTING_WXPYTHON=ON
> >> -DKICAD_SCRIPTING_MODULES=ON -DKICAD_SPICE=ON -DKICAD_USE_OCE=ON
> >> -DCMAKE_INSTALL_PREFIX=/home/carsten/tmp/kicad ...
> >> -- NGSPICE_INCLUDE_DIR=/usr/share/ngspice/include
> >> -- NGSPICE_LIBRARY=/usr/lib/libngspice.so
> >> -- CMAKE_LIBRARY_ARCHITECTURE=x86_64-linux-gnu
> >> -- NGSPICE_LIBRARY_PATH=
> >> -- NGSPICE_ROOT_DIR=
> >> -- CMAKE_LIBRARY_PATH=
> >> -- Check for installed Python Interpreter -- found
> >> 
> >> $ LANG= ls /usr/share/ngspice/include
> >> ls: cannot access '/usr/share/ngspice/include': No such file or directory
> >> $ LANG= ls /usr/lib/libngspice.so
> >> ls: cannot access '/usr/lib/libngspice.so': No such file or directory
> > 
> > I'm quite sure there is something not correct in the cmake helper for
> > ngspice.
> 
> Is this a clean config or did you run cmake on top of an existing
> config?  If it's an existing config, that is your issue.  CMake caches
> config values so it's picking up the cached library and header files.
> 
> Cheers,
> 
> Wayne
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp




Follow ups

References