-
Notifications
You must be signed in to change notification settings - Fork 2
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 support to LodePNG #1
Conversation
@@ -0,0 +1,69 @@ | |||
cmake_minimum_required(VERSION 3.0) | |||
|
|||
# Project is not versioned, so use date of last upstream commit. |
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.
Usually I do 0.0.0
in this case because if they will release for example 1.0.0
then we will have situation when 2018.10.29
is greater than 1.0.0
(see https://semver.org/).
Also VERSION
is not a requirement neither for CMake install config nor Hunter, so you are free to remove related parts.
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.
Got it, thanks. I'll do 0.0.0 then
CMakeLists.txt
Outdated
set(PROJECT_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}Config.cmake") | ||
|
||
set(CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") | ||
set(INCLUDE_INSTALL_DIR "include") |
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.
Similar variable defined by GNUInstallDirs:
You can use CMAKE_INSTALL_INCLUDEDIR
here, example:
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.
Thanks!
This change adds support to build this library with cmake. Normally, we would contribute this upstream, but there are 3 PRs up to do that, and have not been answered:
It's unclear if the author is receptive to adding CMake support or not.
This change will then allow the package to be used with Hunter.
Tested by pulling in and building/linking against lodepng in both debug and release projects.
After merge, can we make a release version, and then I will pull it in to hunter/hunter?