Re: building SWIG on Windows with CMake (and Visual Studio)
William S Fulton <[email protected]> Wed, 22 Sep 2021 21:15:16 +0100
| Newsgroups | gmane.comp.programming.swig |
|---|---|
| Message-ID | <CANGqftCr71Ma+Z5qdcDOmRwG0T9PXp1m-OkuVay+j8-2QDCgig@mail.gmail.com> |
Hi Kris There is actually an updated version of the Windows.html file you referenced which includes CMake build instructions for master / next release (4.1.0) at https://github.com/swig/swig/blob/45c015b6319927fed962967c2a2c7fb816076043/Doc/Manual/Windows.html. HTML preview can be seen using http://htmlpreview.github.io/?https://github.com/swig/swig/blob/45c015b6319927fed962967c2a2c7fb816076043/Doc/Manual/Windows.html. These will be the official instructions. If these don't work for you or you think they should be improved please put in a pull request. William On Mon, 19 Jul 2021 at 15:36, <[email protected]> wrote: > Dear all > > > > I've just successfully build current SWIG master via CMake on Windows 10, > using Visual Studio 2019. I thought others might be interested in this so > post it here. > > > > This instructions are a bit more complicated as hoped by still simpler > than Getting started on Windows (swig.org) > <http://swig.org/Doc4.0/Windows.html#Windows_swig_exe>. > > > > - install sed and bison. I used Gnuwin32 set-up utilities from > > http://gnuwin32.sourceforge.net/packages/m4.htm (which actually installs > sed+m4) and http://gnuwin32.sourceforge.net/packages/bison.htm. Install > into a directory without spaces (e.g. c:\users\yourname\Gnuwin32) > > > > - build PCRE > > - get latest pcre-* source from https://ftp.pcre.org/pub/pcre/ (I used > 8.45). (Do not use pcre2*). > > - Use CMake to configure: > > - set BUILD_SHARED_LIBS=ON or you will get linking errors (missing > symbol imp_pcre...) > > - best to set CMAKE_INSTALL_PREFIX to a directory where you have > write permission > > - build Release version and INSTALL > > > > - For old SWIG versions, do "pip install 2to3" > > > > - add both c:\users\yourname\Gnuwin32\bin and the "bin" sub-directory > where you set CMAKE_INSTALL_PREFIX to your (user) path via the System > Properties control panel > > > > - build SWIG > > - run CMake > > - best to set CMAKE_INSTALL_PREFIX to same directory as used for PCRE > > - probably will have to set PCRE_INCLUDE_DIR and PCRE_LIBRARY (point > the latter to .../pcre.lib) > > - set BISON_EXECUTABLE if not found > > - build and INSTALL (probably you want to use Release as well) > > > > (note: adding the PCRE CMAKE_INSTALL_PREFIX/bin to your path is necessary > as you will need directory where pcre.dll is in your path for SWIG to run). > > > > Kris > > > _______________________________________________ > Swig-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/swig-user > _______________________________________________ Swig-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/swig-user