Re: building SWIG on Windows with CMake (and Visual Studio)
<[email protected]> Fri, 24 Sep 2021 11:57:36 +0100
| Newsgroups | gmane.comp.programming.swig |
|---|---|
| Message-ID | <[email protected]> |
Thanks William That seems to overlap with my recommendations. The page does need a tiny bit of changes but I guess I'll try to find the time to do a PR for that… Thanks again! Kris From: William S Fulton <[email protected]> Sent: 22 September 2021 21:15 To: Kris Thielemans <[email protected]> Cc: swig-user <[email protected]> Subject: Re: [Swig-user] building SWIG on Windows with CMake (and Visual Studio) 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] <mailto:[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] <mailto:[email protected]> https://lists.sourceforge.net/lists/listinfo/swig-user _______________________________________________ Swig-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/swig-user