Closed jkoritzinsky closed 1 year ago
The main goal driving this PR was the following:
Enable a developer to walk up to a project do the following steps, and be able to use dnmd:
CMAKE_PREFIX_PATH
to the artifacts directory of dnmd to declare a dependency on dnmd.find_package(dncp REQUIRED)
find_package(dnmd REQUIRED)
dnmd::dnmd
#include <dnmd.h>
to their code.This way the user doesn't need to include any external headers, define any types, or muck with include paths before including dnmd.h. Everything is automatically hooked up through CMake.
Most of the complexity here is due to limiting the exposed dependency surface for consumers. For example, consumers of dnmd::interfaces
don't need to reference dnmd::dnmd
, but consumers of dnmd::interfaces_static
do. Also, the test projects use the internal include paths, but we don't ship those, so some of the complexity is due to how I hooked that up. I can probably reduce some of the CMake complexity here, and I can be more lax on exposing dependencies through the install interface.
I updated how we find ICU to be more "correct" with CMake instead of just discovering whatever is on the library path to provide a better failure experience if ICU isn't found (the failure before would fail at link time during the build, now it will fail at CMake configure time).
This PR updates the build of DNMD in a few ways: