mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #80] CMake build #68
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#68
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @burlen on GitHub (Dec 1, 2016).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/80
Originally assigned to: @jmcnamara on GitHub.
Have you considered switching to CMake, or adding it as a side by side option to complement your makefile base solution?
I'm contemplating writing a CMakeLists so that the xlsx writer can be built more easily integrated into our cmake based cross-platform superbuild, and was curious to see if you already written a CMakeLists file for xlsx writer, and to see what your thoughts are on the subject.
Thanks
Burlen
@jmcnamara commented on GitHub (Dec 1, 2016):
I wouldn't be keen on the idea since I don't know enough CMake to maintain it.
If you do create a CMakeLists then feel free to post a link to it here in case other people are interested.
Thanks for the suggestion.
John
@burlen commented on GitHub (Dec 5, 2016):
here is link to branch in my fork:
https://github.com/burlen/libxlsxwriter/pull/1
@jmcnamara commented on GitHub (Mar 1, 2017):
See also #99
@Alexhuszagh commented on GitHub (Mar 1, 2017):
So I've updated the fork here.
Pros:
ZLIB_ROOTfor custom ZLIB install directories (only required for unittests and examples).Cons:
Maintenance:
There are a few conditions where I can see the CMake build sytem requiring separate maintenance. One is if the versioning changes syntax, or moves to a file other than
include/xlsxwriter.h. The other is if a unittest or source file is added to a new directory, or another third party module is added. Other than those specific cases, CMake should automatically track new headers insideincludeandinclude/xlsxwriter, track new source files inside the existing source and unittest directories, so the maintenance should be little to none.Examples
I've added examples inside the documentation of the CMakeLists file here, including documentation of the various configuration flags and build tools available.
A quick example for building libxlsxwriter with unittests and examples on a Unix-like platform, in release mode:
Another example for building libxlsxwriter with Visual Studio is:
If this seems suitable, I'll make a pull request.
@burlen commented on GitHub (Mar 1, 2017):
Hi Alexander,
Cool. By the way my fork has much of that functionality and the tests
working for out of source builds as well. :)
https://github.com/burlen/libxlsxwriter/tree/cmake_configure
although I hadn't ever tested mine on Visual Studio, just OSX and Linux
where we currently need it.
Burlen
On 03/01/2017 12:44 PM, Alexander Huszagh wrote:
@burlen commented on GitHub (Mar 1, 2017):
That's probably going to make things more difficult than you anticipate.
from the cmake documentation:
On 03/01/2017 12:44 PM, Alexander Huszagh wrote:
@Alexhuszagh commented on GitHub (Mar 1, 2017):
@burlen That's an issue if the maintainer is primarily using the build system. As an external build system for an existing project, it's entirely fine (and much easier).
It's true, if you don't edit the CMakeLists, then the build system isn't updated. But this lowers the amount of maintenance for @jmcnamara to maintain the CMake build system, since it should handle new files with any fresh build. I carefully chose globs rather than manually listing files since this is more of a supplementary build system, rather than the primary one.
Also, I'm not explicitly forbidding in-source builds, because the original project works fine with them. Yes, I dislike cluttering the source with files, but that's not exactly a flaw.
@burlen commented on GitHub (Mar 1, 2017):
so to me, I want things done according to best practices it increases
quality reduces maintenance over time. when I integrated cmake into
libxlsxwriter, I ended up applying best practices, which meant some
differences compared to the current Makefiles.
I think the down side of trying to emulate the current Makefile is that
you'd not be able to transition to CMake as the primary build system,
without a bunch of work, and potentially lost time debugging odd issues
(eg: why my new source file isn't being compiled)
That said, I don't have a stake in libxlsxwriter, not sure how the
author prioritizes things, and very happy that your patch might be accepted
Burlen
On 03/01/2017 02:17 PM, Alexander Huszagh wrote:
@jmcnamara commented on GitHub (Mar 3, 2017):
@Alexhuszagh
That looks good. Submit a PR as a single (squashed) commit and I'll merge it. It doesn't need to have every build option in the first version. You or others can add to it as required.
Could you change this to FreeBSD. That is the main license.
Don't be too worried about zero maintenance. I can add dirs to the file if required. :-)
Automatic versioning isn't required since the Make build already has this and that is what I will be using for the release process.
Also, in general the Cmake system doesn't have to mirror the Make system. There are a lot of targets in there that only the maintainer needs and itt is unlikely that I will move to Cmake.
Thanks,
John