Open jmarrec opened 1 year ago
One thing I'm not clear about is how to handle older versions that do not have a CMakeLists.txt. Keep two subfolders with two recipes?
The config variables to pass to the CMakeLists are going to be -DSWIG_LIB_RELATIVE_TO_EXE:BOOL=ON -DSWIG_LIB_RELATIVE_PATH:STRING=bin/swiglib
and that should probably just be it: pcre2 will be found via find_package (PCRE2 REQUIRED)
so that should work as is, and we can remove a lot of things (winflexbison, automake, etc are no longer needed).
I've started trying to use CMakeLists.txt on https://github.com/jmarrec/conan-center-index/tree/swig/cmakelists. I'm having trouble getting find_package(SWIG) to work in the test_package.
Hi @jmarrec ,
I'm interested by your contribution. If I understand correctly, swig use cmake from 4.1.0 release? Then I think the simpler could be to remove 4.0.x releases, non? What is your trouble with test_package? Is it not better to declare swig as tool_requires?
Regards.
Hello @EstebanDugueperoux2 . Yes SWIG added a CMakeLists.txt option in 4.1.0. Beforehand, it only had autotools to build.
My main issue is with the test_package is that I don't know what I'm doing to be honest. conan 2.x is new to me.
CMake has a built-in FindSWIG module, which basically just locates an executable called swig
or swig4.0
.
I'm trying to upstream a change to SWIG to allow specifying the location of the swiglib
directory (which is a directory that contains static text files): https://github.com/swig/swig/pull/2509
When you build SWIG via cmake, it produces the swig executable. When you install, it installs the exe and copies the in-source swiglib
directory to the appropriate location relative to this exe (and when you call swig.exe -swiglib
it computes that location relative to the current directory the executable is actually in, via dladdr
on unix). This directory https://github.com/swig/swig/tree/master/Lib is just installed as is: https://github.com/swig/swig/blob/2171115d380c899e7fd54224142ff2540632ef1e/CMakeLists.txt#L126
I'm having trouble putting the recipe together so it does find the conan-build .exe in the test_package via FindSWIG module.
Package Name/Version
swig/4.1.1
Changelog
https://github.com/swig/swig/pull/2509
Context about the new update
https://github.com/conan-io/conan-center-index/issues/15324#issuecomment-1468079165