-
Notifications
You must be signed in to change notification settings - Fork 143
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
Add CMake Config-file package #260
base: master
Are you sure you want to change the base?
Add CMake Config-file package #260
Conversation
This is intended to make the installed package relocatable.
CMakeLists.txt
Outdated
) | ||
write_basic_package_version_file( | ||
"${CMAKE_CURRENT_BINARY_DIR}/utf8proc-config-version.cmake" | ||
COMPATIBILITY AnyNewerVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that utf8proc follows the semantic versioning. SameMajorVersion
may be better.
README.md
Outdated
## Using with CMake | ||
|
||
A CMake Config-file package is provided. To use utf8proc in a CMake project: | ||
|
||
```cmake | ||
add_executable (app app.c) | ||
find_package (utf8proc 2.9.0 REQUIRED) | ||
target_link_libraries (app PRIVATE utf8proc::utf8proc) | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that Using other compilers
is a subsection of Quick Start
.
How about moving this after Using other compilers
?
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
utf8proc appears to use SemVer. Do not consider different major versions compatible.
Thank you for the review @kou. Feedback has been applied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
(But I'm not a maintainer of this project. I just an user of this project.)
@stevengj may I request merging this PR? This may help using utf8proc with CMake. |
Summary
This PR resolves #250 by creating CMake Config-file Package.
Motivation
https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#config-file-packages notes:
Including a CMake Config-file Package enables CMake consumers to use
find_package
to find and use utf8proc:The absence of a CMake Config-file Package may add difficulty using utf8proc in a CMake project. For example: the MongoDB C driver includes FindUtf8Proc.cmake using pkg-config. However, using pkg-config is not suitable for consumers building with MSVC (the
-l
and-L
flags are unrecognized).Use of relative paths in 422de38 is intended to make the installed package relocatable.