Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! First of all, great work! In my opinion, md4c is the most interesting Markdown library of all :)
With this patch set I've reworked a bit the CMake files, to make them a bit more "modern" (what "modern" really means is up to the reader). I've also fixed some actual (small) issues.
I've split this in two separate commits since they are two separate kind of fixes, but if you prefer to have a single commit instead let me know! GitHub's Squash feature kinda sucks and tends to drop commit messages.
Here's the description of the individual changes:
build: CMake improvements
This patch improves and modernizes the CMake build scripts in multiple
ways, while also fixing some bugs:
libraries are now assigned to targets explicitly. This has the
benefits of propagating requirements transitively, which is especially
helpful when using md4c as a subproject or via the CMake Config files.
version number in different MD_VERSION_* variables is no longer
needed. I also made use of the HOMEPAGE_URL option, which requires
CMake 3.12. This can be reverted in case compatibility with older
CMake versions is desired.
with
${}
syntax.MD4C_USE_UTF8
compile definition from CMake code, sothat users can more easily override the default. UTF-8 is used by
default automatically if no relevant definition is found since commit
64bf660.
DEBUG
to only be defined when compiling md4c in debug modevia a generator expression (documented in
https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations).
installing the md4c and md4c-html targets, thanks to a generator
expression (documented in
https://cmake.org/cmake/help/latest/command/target_include_directories.html).
This makes the
INCLUDES DESTINATION
install()
option redundant,and has been removed.
build: handle absolute include and lib dirs in pc file
With this patch, the pkg-config files are now correctly generated when
the include and/or lib directories are absolute paths outside of
CMAKE_INSTALL_PREFIX, which (if I recall correctly) is commonly the case
on distributions like Nix.
For further information, see
https://github.com/jtojnar/cmake-snips#assuming-cmake_install_dir-is-relative-path.