MantisBT - LibParserUtils
View Issue Details
0002621LibParserUtils[All Projects] Generalpublic2018-09-25 07:262019-02-16 17:54
ReporterJ. Peter Mugaas 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionwon't fix 
Platformmingw-w64OSWindowsOS Version10
Product Version0.2.1 
Target VersionFixed in Version 
Fixed in CI build #
Reported in CI build #
Summary0002621: Contribution - CMake-based build system in one file
DescriptionAs I have discussed previously, I encountered numerous issues using the netsurf-buildsystem on Windows due to various differences between it and many Unix-based systems. These differences go to how files are named, how they are built, how files are placed, as well as other things. In addition, it's useful to think of separate tool-chains like their own targets (OS/CPU combinations) and on Windows, you sometimes might be using software layers such as MSYS2 ( https://www.msys2.org/ ) or CygWin ( https://www.cygwin.com/ ). Along with this, you have numerous differences in available software. To write this, I actually used 3 different CMake programs that aren't interchangeable, for example.

Anyway, I'm attaching the CMakeLists.txt file and I permit it's use and modification as well as any derivative work even for other projects. Share and enjoy. This cmake-based build allows you to use 4 commands to build static and/or shared libraries including tests and installation. Those are "cmake ../sourcedir", "make", "make test", and "make install" (a great thing for package builders).

Now some obligatory whining. I don't like the way the Doxyfile is setup because I had to build the docs right into the source-code tree because the paths are hard-coded relative to that tree (not my separate build directory) which is outside the source-code.

I know some things like testing could probably be done more elegantly like the test runner but I hate having to recurs through stuff and I wanted to get the testing done quickly. But the tests do use your source-code compiled into .EXE's. In my CMake build process, there are two sets of tests, one for the statically compiled library and the shared library. But I could run all them with one command, "make test".

Speaking of tests, I did report an earlier bug concerning a test that used a Winsock function ( bug report 0002620 ).

I admit that the file is somewhat lengthy but I wanted to have something self-contained for submission or for use in a package I'm planning to include elsewhere (I just provide the bash script, the CMakeLists.txt, and any patches). Some of it is also that the Windows .rc and the pkg-config files share many of the same values even if in a slightly different format.

This probably complements the current Makefile system after all, there is more than one way to skin a cat, or rather, more than one solution to a problem.

Share and enjoy!!!
TagsNo tags attached.
Attached Filestxt CMakeLists.txt (23,184) 2018-09-25 07:26
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=563&type=bug

Notes
(0001849)
J. Peter Mugaas   
2018-09-25 07:36   
BTW, this CMakeLists.txt file is for LibParserUtils.
(0001879)
Daniel Silverstone   
2019-02-16 17:54   
Thank you for your contribution, however we are not cmake users and the rest of the project does not use cmake either.

Issue History
2018-09-25 07:26J. Peter MugaasNew Issue
2018-09-25 07:26J. Peter MugaasFile Added: CMakeLists.txt
2018-09-25 07:36J. Peter MugaasNote Added: 0001849
2019-02-16 17:54Daniel SilverstoneStatusnew => closed
2019-02-16 17:54Daniel SilverstoneResolutionopen => won't fix
2019-02-16 17:54Daniel SilverstoneNote Added: 0001879