-
Notifications
You must be signed in to change notification settings - Fork 34
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
cmake: Add configuration for Cmake Package #553
Conversation
dea7242
to
972b035
Compare
Codecov Report
@@ Coverage Diff @@
## master #553 +/- ##
=======================================
Coverage 98.64% 98.64%
=======================================
Files 61 61
Lines 8959 8959
=======================================
Hits 8838 8838
Misses 121 121 |
f4e8fe1
to
b007b09
Compare
972b035
to
5fd3677
Compare
@@ -100,5 +104,12 @@ if(FIZZY_TESTING) | |||
add_subdirectory(test) | |||
endif() | |||
|
|||
set(CMAKE_INSTALL_CMAKEPACKAGEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) | |||
|
|||
write_basic_package_version_file(fizzyConfigVersion.cmake COMPATIBILITY ExactVersion) |
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.
What is this?
# This example shows how to use the fizzy library from the fizzy CMake package. | ||
cmake_minimum_required(VERSION 3.15) | ||
project(use_fizzy LANGUAGES CXX) | ||
find_package(fizzy CONFIG REQUIRED) |
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.
So this use_fizzy
directory is a test for find_package(fizzy)
?
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.
My understanding is limited, but looks okay-ish.
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.
CMake package consist of a number of special files.
fizzyConfig.cmake
- the main one;find_package(fizzy CONFIG)
is looking for it; it is generated fromConfig.cmake.in
in https://github.com/wasmx/fizzy/pull/553/files#diff-af3b638bc2a3e6c650974192a53c7291R110.fizzyConfigVersion.cmake
- it contains a script to resolved required version infind_package(fizzy VERSION a.b.c)
; generated by https://github.com/wasmx/fizzy/pull/553/files#diff-af3b638bc2a3e6c650974192a53c7291R109; we opt for "ExactVersion" compatibility.fizzyTargets.cmake
- contains information about all "installed" targets; generate and installed byinstall(EXPORT ...)
in https://github.com/wasmx/fizzy/pull/553/files#diff-af3b638bc2a3e6c650974192a53c7291R114.
CMake docs in subject: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html
In summary: there is a shit lot of boilerplate here and essential parts well hidden in-between.
5fd3677
to
4274c04
Compare
4274c04
to
9927571
Compare
No description provided.