Add option to provide thirdparty dependencies externally #188
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.
This adds a CMAKE option
VAL3DITY_USE_INTERNAL_DEPS
(default ON). When leaving this to the default (ON) it should build as before, ie. bundling the files inthirdparty
as aval3dity_thirdparty
lib and linking against that.However, when set to OFF, it is expected that those 'thirdparty' dependencies (spdlog, nlohmann-json, tclap, pugixml) are available externally, eg. through vcpkg, and findable using CMAKE's
find_package()
. This is helpful in case val3dity is integrated as a library into another software that also depends those 'thirdparty' dependencies. I specifically had issues with spdlog, as this was publicly linked and it was a different version from what I used in my project, which can lead to undefined behaviour, unexpected crashes etc.In addition
VAL3DITY_LIBRARY
is now an option, so can be easily toggled when using ccmake or cmake-gui.val3dity_core
object that contains most of the val3dity source code (all exceptmain.cpp
andval3dity.cpp
). This object is reused both for the val3dity library and executable.PRIVATE
to prevent pulling unwanted includes into projects that use val3dity as a library.#include
statements for nlohmann-json and pugixml to work in case they are externally provided. For the same reason I renamed thethirdparty/nlohmann
folder.