On Fri Mar 11, 2022 at 08:54:01AM +0100, Rafael Sadowski wrote: > On Wed Mar 09, 2022 at 04:25:15PM +0000, Stuart Henderson wrote: > > On 2022/03/09 11:15, Rafael Sadowski wrote: > > > With the results from Stuart's bulk build and Klemens analyses, I end up > > > with a new diff. > > > > > > - Handle target names like libXXX with PREFIX set to "". > > > With this, all reported errors are happy. Afterwards, we can delete > > > all patches. For example, I can remove all x11/kde-application cmake > > > hackish patches. > > > - Use cmSystemTools::GetEnv instead getenv(3) > > > - More shorter C++ code > > > > Makes sense. > > > > > Thank you to all. A final bulk build would be advisable, wouldn't it? > > > > Definitely needed. I can't run one right now though. > > > > Before Stuart says that net/bro is still broken. I think all cmake ports > should be ok with the latest patch but not net/bro. Bro calls cmake > separately and therefore has no access to the environment variables. > > I would like to solve this via an option MODCMAKE_USE_SAHRED_LIBS.(Other > name proposals?) This way we can also deactivate in the future if we > have to. > > We can also add the SHARED_LIBS-loop inside the > if-MODCMAKE_USE_SAHRED_LIBS-block? > > Diff without port-modules(5). >
Add MODCMAKE_USE_SHARED_LIBS in port-modules(5). I have tried to describe all the changes we make in CMake. Opinions? diff --git a/share/man/man5/port-modules.5 b/share/man/man5/port-modules.5 index 1eeb808c6ec..ef8a6382e54 100644 --- a/share/man/man5/port-modules.5 +++ b/share/man/man5/port-modules.5 @@ -567,6 +567,24 @@ Changes to `test' as this is standard for CMake projects. Also this module has the following knobs: .Bl -tag -width Ds +.It MODCMAKE_USE_SHARED_LIBS +If set to `Yes', CMake will override of shared library version using +.Ev LIBxxx_VERSION. +.Ev LIBxxx_VERSION . +is created by the module and put in +.Ev CONFIGURE_ENV +and +.Ev MAKE_ENV. +This override is only effective if the CMake target is defined as shared +library and the CMake target name is called exactly like the name from +.Bl SHARED_LIBS . +Special case: If the CMake target shared library is given the prefix `lib' and +the `PREFIX' option is set to an empty string then the overwrite still takes +effect. If no +.Ev LIBxxx_VERSION +environment variable is present during configure stage but the shared library +was set a VERSION or SOVERSION by CMake, then the shared library verison is set +to 0.0. Default value is `Yes'. .It MODCMAKE_WANTCOLOR If set to `Yes', CMake will colorize its output. Should not be used in ports Makefiles.