-
Notifications
You must be signed in to change notification settings - Fork 523
Fix lib version #237
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
Fix lib version #237
Conversation
Commit 9c5d084 nows sets the lib version based on the version defined in CMakelists.txt. |
This commit makes CMake a required component/step. IOW it is now impossible to build libharu without first running CMake to generate the libharu version string. This could be fixed by (re)storing the canonical version number in a header file, so it remains available without any build-system-specific logic. Also, by deleting Can these be restored in a non-generated header? |
One concrete place where this causes issues is in VTK, which relies on parsing from the |
@vszakats defining the version number at different locations will be very prone to errors. I will just leave it as it is. Packaged versions of libharu will just include the generated include file, and won't require CMake for generating this file. @vszakats @acmiyaguchi I realise now that I have been a bit to rigourous with the removal of these version defines. My apologies. Please have a look at the proposed PR #239, and let me know if you have any comments. |
@bramton: No worries and thanks for your follow-up on this. #239 solves half of the problem, but since it uses CMake config files as the source of truth for version numbers, they are not available when pulling the source tree (such as the release archive) and using the C sources as-is, without CMake. Storing the version numbers in |
I appreciate the fast response relative to my comment. A generated include file should resolve issues on my end since I depend on a packaged version of the library. |
* version: add static hpdf_version.h header Store the libharu version number values (major/minor/bugfix and suffix) in the C header `include/hpdf_version.h`. Generate `HPDF_VERSION_TEXT` and `HPDF_VERSION_ID` from these values using the C preprocessor. To make the version number available to CMake, add CMake logic that automatically pulls these values from the C header. After this patch, the libharu version number is available to dependents without running CMake first, or without running CMake at all, making the source tree build-system agnostic. All the while retaining the advantage of having to maintain/update the version number at a single place. While here, make sure to include `hpdf_version.h` from `hpdf.h` again, so existing apps do not need to be modified to access the version numbers. This restores compatibility with pre-2.4.1 releases, where version number was accessible from C without custom build steps, and always available to users when including `hpdf.h`. Ref: #237
No description provided.