michaelrsweet / mxml

Tiny XML library.
https://www.msweet.org/mxml
Apache License 2.0
426 stars 157 forks source link

Support CMake builds of library itself and generate finders #281

Open widgetii opened 3 years ago

widgetii commented 3 years ago

Thank you so much for your wonderful library! I would like to suggest adding CMake build support that was tested for few weeks in my project and seems to be proper designed according to modern CMake guidances.

Everything you need to have inside your own CMakeLists.txt is

find_package(mxml)
target_link_libraries(${PROJECT_NAME} PRIVATE MSweet::mxml)
lgtm-com[bot] commented 3 years ago

This pull request introduces 2 alerts when merging 7d3223e14b5118c459051e015aed1b37735f47f0 into ab78fd816fd6c5e249c92b158d676b748de414ac - view on LGTM.com

new alerts:

michaelrsweet commented 3 years ago

@widgetii I've gotten several requests to use cmake, but so far I haven't been happy with the results. Also, cmake is not a standard build tool so either I'd need to keep the autoconf stuff around or maintain both, and neither of those options appeals to me... :/

Not going to close this, but for the moment don't expect it to be merged any time soon.

widgetii commented 3 years ago

If you wish I can maintain all CMake stuff of the project and fix issues (my motivation to don't have a separate fork of Mini-XML).

Rossmaxx commented 7 months ago

I was searching for mxml in vcpkg and didn't find it. Investigated further and found this pr and the fact that cmake is not supported.

I've gotten several requests to use cmake, but so far I haven't been happy with the results.

Have you tried now? Cmake support seems to have improved since 2021.

cmake is not a standard build tool.

It's not but it's getting closer to being a standard makefile/msvc-sln generator

If mxml gets a cmake port, i might consider adding a port to vcpkg so that windows users too can benefit.

michaelrsweet commented 7 months ago

@Rossmaxx cmake remains an optional, third-party add-on developer tool on all operating systems.

Looking at the release notes over the past several years, there is very little new functionality that is compelling and it continues to depend on having this tool on any developer system, creating makefiles or IDE files that are hard to comprehend or debug, and completely lacking in the basic functionality that the current autoconf (for Unix) and VC (for Windows) files provide.

It is conceivable that I might add a set of official NuGet packages for using Mini-XML with VC, but at present I am not interested in vcpkg which is itself a bit of a hack with all of the package definitions/ports info in a Git repository... That said, nothing prevents you from submitted a pull request to the vcpkg repository and having the libmxml port info provide a separate cmake file for this project.

Rossmaxx commented 7 months ago

Hmm, i understand your concerns. Coming from a windows environment, I didn't know that autotools was preconfigured. For vcpkg, I'll maybe either have to fork it or patch it using vcpkg's patching mechanisms. But since you don't plan to support it officially, I don't wanna bother you anymore.