Re: CMake on Unix
Ivan Zhakov <[email protected]> Mon, 18 May 2026 17:56:44 +0200
| Newsgroups | gmane.comp.apache.apr.devel |
|---|---|
| Message-ID | <CAPZho08HzkMzi5TP+Ed6Ecmccj09GEUG3qVbmLPv944N0oACFw@mail.gmail.com> |
--000000000000a89c750652199cad Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 18 May 2026 at 17:22, Branko =C4=8Cibej <[email protected]> wrote: > On 18. 5. 26 17:04, Ivan Zhakov wrote: > > On Mon, 18 May 2026 at 16:13, Branko =C4=8Cibej <[email protected]> wrote: > >> On 12. 5. 26 18:08, Timofei Zhakov wrote: >> >> Hi all! >> >> There are cmake configuration files in APR's upstream that were >> primarily made to address complexity of building the project on Windows >> platform and yet it's the only one supported. >> >> I think it would be really cool to extend it to support all >> platforms/configurations. There are however a few things that make it >> complicated to implement; >> >> 1. Some platform specific code is put into dedicated subdirectories (lik= e >> file_io/unix/copy.c). But it's not exactly true because if you look >> carefully you realise that the same copy.c is also used in Windows build= . >> This is not related that much to the build system, but a general idea fo= r >> the project, to put shared code away from */unix/. I suggest moving thos= e >> files under those subdirs into the parents of unix/ (file_io/unix/copy.c= -> >> file_io/copy.c), keeping only platform specific code there. Also for >> example the os2 version of copy.c simply includes the one for unix. So I >> believe this is something that would be an improvement to keeping things >> organised. >> >> I think it will be clearer when some ancient platforms are removed from >> upstream... >> >> I want to mention that, code from apr-util has this exact structure >> because there is a little difference between platforms. >> >> 2. apr.h is a complete mess right now; There are four templates that >> generate it and I believe some of them are outdated/unused. I want to tr= y >> to make the Unix and Windows versions to be as similar to each other >> as possible. Perhaps we might rely on macros where different code is >> needed. A lot of stuff is still similar, especially in the modern days. = The >> cmakefication will achieve that! >> >> 3. Some parts of cmake that we currently have are tied to Windows too >> much. I think there is some refactoring to be done to get it to work on >> Unix. >> >> 4. There are also some Unix specific features that are not fully >> implemented in cmake currently. >> >> I will be happy to try and extend cmake to work on Unix, if this feature >> is wanted of course. >> >> >> There are several real problems with CMake that make it hard to use in >> any project with complex dependencies. I already mentioned the lack of s= ane >> platform-specific defaults. For example, why does one have to >> include(GNUInstallDirs) to get basic layout support and why did the >> authors think this has anything to do with GNU when it's a POSIX thing? >> >> While I agree that CMake is very inconsistent. > But at least CMake has GNUInstallDirs. I mean the same applies to > autoconf: why it doesn't support Windows? ;) > > > But it does, if you use Cygwin or MSYS or WSL... :) > > ;) > More seriously, the real question is why doesn't Windows support Autoconf= . > After all, Autoconf is older than Windows, though possibly not older than > DOS. > > I think we are both know that this question is more for historians, than for software engineers. May be because of bash? > I still fondly remember when Microsoft released Microsoft C 6.0 and > proudly presented ... 'nmake'! Almost but not quite entirely unlike > 'make'... > > Well, MS is well known for Embrace, Extend, and Extinguish behavior. I think with nmake that made two 'E' in one step ;) [..] --=20 Ivan Zhakov --000000000000a89c750652199cad Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr">On Mon, 18 May 2026 at 17:22, Branko =C4= =8Cibej <<a href=3D"mailto:[email protected]">[email protected]</a>> wr= ote:</div><div class=3D"gmail_quote gmail_quote_container"><blockquote clas= s=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid r= gb(204,204,204);padding-left:1ex"><u></u> =20 =20 =20 <div> <div>On 18. 5. 26 17:04, Ivan Zhakov wrote:<br> </div> <blockquote type=3D"cite"> =20 <div dir=3D"ltr"> <div dir=3D"ltr"> <div dir=3D"ltr">On Mon, 18 May 2026 at 16:13, Branko =C4=8Cibej = <<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]<= /a>> wrote:</div> <div class=3D"gmail_quote"> <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0= .8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <div> <div>On 12. 5. 26 18:08, Timofei Zhakov wrote:<br> </div> <blockquote type=3D"cite"> <div dir=3D"ltr"> <div>Hi=C2=A0all!</div> <div><br> </div> <div>There are cmake configuration files in APR's upstream that were primarily=C2=A0made to address=C2=A0complexity of building the project on Windows platform and yet it's the only one supported.</div> <div><br> </div> <div>I think it would be really cool to extend it to support all platforms/configurations. There are however a few things that make it complicated to implement;</div> <div><br> </div> <div>1. Some platform specific code is put into dedicated subdirectories (like file_io/unix/copy.c). But it's not exactly true because=C2=A0if you look carefully you realise that= =C2=A0the same copy.c is also used in Windows build. This is not related that much to the build system, but a general idea for the project, to put shared code away from */unix/. I suggest moving those files under those subdirs into the parents of unix/ (file_io/unix/copy.c -> file_io/copy.c), keeping only platform=C2=A0specific code there. Also for example the os2 version of copy.c simply includes the one for unix. So I believe this is something that would be an improvement to keeping things organised.</div> <div><br> </div> <div>I think it will be clearer when some ancient platforms are removed from upstream...=C2=A0</div> <div><br> </div> <div>I want to mention that, code from apr-util has this exact structure because there is a little difference between platforms.</div> <div><br> </div> <div>2. apr.h is a complete=C2=A0mess right now; There are four templates that generate it and I believe some of them are outdated/unused. I want to try to make the Unix and Windows versions to be as similar to each other as=C2=A0possible. Perhaps we might rely on macros where different code is needed. A lot of stuff is still similar, especially in the modern days. The cmakefication will achieve=C2=A0that!</div> <div><br> </div> <div>3. Some parts of cmake that we currently have are tied to Windows too much. I think there is some refactoring to be done to get it to work on Unix.</div> <div><br> </div> <div>4. There are also some Unix specific features that are not fully implemented in cmake currently.</d= iv> <div><br> </div> <div>I will be happy to try and extend cmake to work on Unix, if this feature is wanted of course.</div> </div> </blockquote> <br> There are several real problems with CMake that make it hard to use in any project with complex dependencies. I already mentioned the lack of sane platform-specific defaults. For example, why does one have to <font face=3D"m= onospace">include(GNUInstallDirs)</font> to get basic layout support and why did the authors think this has anything to do with GNU when it's a POSIX thing?<br= > <br> </div> </blockquote> <div>While I agree that CMake is very inconsistent.=C2=A0</div> <div>But at least CMake has=C2=A0GNUInstallDirs.=C2=A0 I mean t= he same applies to autoconf: why it doesn't support Windows? ;)= =C2=A0</div> </div> </div> </div> </blockquote> <br> But it does, if you use Cygwin or MSYS or WSL... :)<br> <br></div></blockquote><div>;)</div><div>=C2=A0</div><blockquote class= =3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg= b(204,204,204);padding-left:1ex"><div> More seriously, the real question is why doesn't Windows support Autoconf. After all, Autoconf is older than Windows, though possibly not older than DOS.<br> <br></div></blockquote><div>I think we are both know that this question= is more for historians, than for software engineers. May be because of bas= h?=C2=A0</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"m= argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left= :1ex"><div> I still fondly remember when Microsoft released Microsoft C 6.0 and proudly presented ... 'nmake'! Almost but not quite entirely un= like 'make'...<br> <br></div></blockquote><div>Well, MS is well known for=C2=A0Embrace, Ex= tend, and Extinguish behavior. I think with nmake that made two 'E'= in one step ;)=C2=A0</div><div><br></div><div>[..]</div><br clear=3D"all">= </div><br><span class=3D"gmail_signature_prefix">-- </span><br><div dir=3D"= ltr" class=3D"gmail_signature">Ivan Zhakov</div></div> --000000000000a89c750652199cad--