-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support and advertise usage in downstream build systems #8
Comments
@peanutfun Thank you for the great suggestions! I will make all of the changes you suggested! |
done! |
Thank you! You now mention the issue with the |
@peanutfun thanks for your great suggestion. I will implement it in a new PR. |
I have implemented it here. |
Great! 👍 |
Summary
The
README.md
advertises to install GiNaCDE in the default installation directory and then link it "by hand" when compiling new executables. However, as CMake project, GiNaCDE should support being used in downstream CMake projects via simplefind_package(GiNaCDE)
. To do so, it is best practice for a CMake project to install its own package configuration. See, for example, the excellent blog post "It's Time To Do CMake Right". Currently, GiNaCDE installs only a pkg-config file. This is fine as it enables downstream modules to at least get the most important information on the package. However, theREADME.md
currently contains no instructions on how to do so.Proposal 1 is easy to do and a simple addition to the current
README.md
. The more complete approach would be Proposal 2, but I realize that this might only be available to advanced users of CMake. However, I want to advertise it nonetheless, because it is the best way of ensuring your project can be used by others.Proposal 1: Show how to use GiNaCDE downstream
If we create a new CMake project that uses GiNaCDE, we need to link the GiNaCDE library against the project executables. GiNaCDE provides a pkg-config configuration. So we currently need to do the following:
This should be reflected in the
README.md
, as the command inREADME.md#Execution
only works if GiNaCDE is installed into the default installation directory (or any other default compiler lookup path). Importantly, pkg-config has its own lookup paths that might have to be adapted depending on where GiNaCDE is installed.Notice also that the
README.md
currently advertises to#include <GiNaCDE/GiNaCDE.h>
, but the include directory set inGiNaCDE.pc.in
is@CMAKE_INSTALL_PREFIX@/include/GiNaCDE
. This means that when using the pkg-config configuration, one needs to#include <GiNaCDE.h>
.Proposal 2: Make GiNaCDE install a proper CMake configuration
Ideally, we would like to call
find_package
in a downstream project, like so:This requires the following to be installed alongside the headers and libraries:
Related issues
openjournals/joss-reviews#3885
The text was updated successfully, but these errors were encountered: