-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix pkgconfig files install path #2917
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2917 +/- ##
==========================================
+ Coverage 43.65% 44.13% +0.47%
==========================================
Files 253 253
Lines 20940 21269 +329
Branches 5139 5210 +71
==========================================
+ Hits 9142 9387 +245
- Misses 10785 11057 +272
+ Partials 1013 825 -188 see 74 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
e0b6879
to
e4c2d0a
Compare
Pull Request Test Coverage Report for Build 12436619949Details
💛 - Coveralls |
@ChrisThrasher has since implemented this in #2835 Does that also work for you @texus? |
e4c2d0a
to
47019cd
Compare
The issue still occurs. I've rebased my PR on the master branch (to solve the conflict with the change from that PR). |
I'm starting to think that we don't actually need I'm not familiar enough with pkg-config files to actually check whether the generated files are correct though. |
I think I understand enough about the pkg-config issues in the meantime, but I'm waiting until there is a consensus on SFML/CSFML#374 to keep the SFML implementation the same as in CSFML. There are 3 distinct pkg-config issues that exist:
|
47019cd
to
edfaaa4
Compare
SFML sets the precedent that CSFML follows so this PR does not need to concern itself too much with being consistent with CSFML.
Do you still think this may be true? If we can fix this bug while also getting rid of some extra intermediate variables then I'd prefer that. |
The same changes are needed in both libraries though, so the exact same discussion in CSFML can be had right here for SFML. Which is why I still think that the CSFML discussion is relevant.
It still has a use in the existing code, but it can be removed depending on which decision is taken in the
|
This allows the pkgconfig install path to still be correct when changing the CMAKE_INSTALL_PREFIX after the first cmake run.
edfaaa4
to
71a7793
Compare
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.
I believe we should go with this for SFML 3. We can still have a discussion on the topic of variables.
Description
When running CMake without setting CMAKE_INSTALL_PREFIX, and then running CMake again with a different prefix, the install path for the pkgconfig files still points to the old location.
Because the default
/usr/local
prefix on Linux requires root access, installing SFML without sudo will fail with an error like this:This was fixed in the CSFML project a few weeks ago (see SFML/CSFML#233 and SFML/CSFML#234), this PR applies the same fix to SFML.
This change is NOT backwards compatible. The existing
SFML_PKGCONFIG_INSTALL_PREFIX
variable will no longer work and is being replaced with a newSFML_PKGCONFIG_INSTALL_DIR
variable in cmake.Tasks
How to test this PR?
On linux you can run the following commands to get the error:
cmake -S . -B build cmake --build build cmake --install build --prefix whatever
On other platforms you can probably also witness the files being installed to the wrong directory, but you will need to set
SFML_INSTALL_PKGCONFIG_FILES
toON
yourself because it is only enabled by default on Linux and BSD.