-
Notifications
You must be signed in to change notification settings - Fork 33
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
Create a CMake target upon install #123
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #123 +/- ##
=======================================
Coverage 97.70% 97.70%
=======================================
Files 67 67
Lines 2398 2398
=======================================
Hits 2343 2343
Misses 55 55 ☔ View full report in Codecov by Sentry. |
Thanks for the PR! Being able to install the library is definitely a good idea, so thanks for working on it. |
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 for the changes!
I noticed a couple of CMake warnings in the CI runs:
CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Warning (dev) at /usr/local/share/cmake-3.27/Modules/GNUInstallDirs.cmake:243 (message):
Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
target architecture is known. Please enable at least one language before
including GNUInstallDirs.
Call Stack (most recent call first):
CMakeLists.txt:4 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- The CXX compiler identification is GNU 13.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/linuxbrew/.linuxbrew/bin/g++-13 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:13 (target_sources):
Policy CMP0076 is not set: target_sources() command converts relative paths
to absolute. Run "cmake --help-policy CMP0076" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
An interface source of target "flux" has a relative path.
This warning is for project developers. Use -Wno-dev to suppress it.
-- BAR=0
The first one isn't related to this PR (but feel free to bump the required CMake version to 3.5 while you're working on things if you wish).
I guess for the second warning the include(GnuInstallDirs)
line needs to come after project(libflux CXX)
?
I'm not sure what needs to be done to fix the warning about relative vs absolute paths?
Looks great, thank you! |
This updates the
CMakeLists.txt
file to include the ability to install. The install creates CMake targetflux::flux
for use in other CMake builds.That is, you can build like:
and, in your consuming CMakeLists.txt, use like
The README has an update for this and there is an additional file used as part of the CMake target creation.