Skip to content
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

Fix CMake warning on macOS since CMake 3.9 #1371

Closed
wants to merge 2 commits into from

Conversation

Ceylo
Copy link
Contributor

@Ceylo Ceylo commented Feb 10, 2018

This fixes this warning since CMake 3.9 where CMP0068 was introduced:

CMake Warning (dev):
  Policy CMP0068 is not set: RPATH settings on macOS do not affect
  install_name.  Run "cmake --help-policy CMP0068" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

  For compatibility with older versions of CMake, the install_name fields for
  the following targets are still affected by RPATH settings:

   SFML
   sfml-audio
   sfml-graphics
   sfml-network
   sfml-system
   sfml-window

This warning is for project developers.  Use -Wno-dev to suppress it.

Happens at CMake generation time.
Originally reported by @mantognini in #1344

I checked the output of the installed dylibs and frameworks with "otool -L", after having generated both with CMake 3.10 and 3.0, and they looked exactly the same as what's shipped for current latest SFML release.

@Foaly
Copy link
Contributor

Foaly commented Feb 14, 2018

I gave this a quick test and it fixes the warning as expected (cmake 3.10.2). I couldn't test the actual install part as I am not quiet sure how.

@Ceylo
Copy link
Contributor Author

Ceylo commented Feb 14, 2018

To install you just need to build the “install” target. Just make sure to select a writable install prefix in CMake config.

About testing, I don’t think installing will help much. You can but you mainly need to check that the frameworks/dylibs can be embedded in bundle apps exactly the same way as previously, or check the paths shown by “otool -L” on all generated binaries. Probably the easiest and most reliable.

@Ceylo
Copy link
Contributor Author

Ceylo commented Feb 17, 2018

@mantognini Are you able to check the PR so that it can be merged? Dunno if you're still away from home though.

@JonnyPtn
Copy link
Contributor

I've tested this and it does indeed make the warning go away. Doesn't seem to have any adverse affect on my game bundling either

@eXpl0it3r eXpl0it3r added this to Discussion in SFML 2.5.0 via automation Feb 23, 2018
@eXpl0it3r eXpl0it3r added this to the 2.5 milestone Feb 23, 2018
@eXpl0it3r eXpl0it3r moved this from Discussion to Ready in SFML 2.5.0 Feb 23, 2018
@mantognini
Copy link
Member

@Ceylo, do you prefer having this one merged first, or rather after the big one #1335? I'll try this one as soon as possible.

@Ceylo
Copy link
Contributor Author

Ceylo commented Mar 6, 2018

@mantognini I’d really prefer the big one to be merged first : it’ll fix CI, and some of my changes for iOS depend on it, and it’s much easier to merge and fix conflict in a small PR :)

@eXpl0it3r
Copy link
Member

eXpl0it3r commented Mar 12, 2018

Merged in 8b7a50a

@eXpl0it3r eXpl0it3r closed this Mar 12, 2018
SFML 2.5.0 automation moved this from Ready to Merged / Superseded Mar 12, 2018
@Ceylo Ceylo deleted the bugfix/CMP0068 branch April 7, 2018 22:02
@SFML SFML deleted a comment from mantognini Dec 31, 2022
Comment on lines +403 to +405
set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
else()
set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_NAME_DIR TRUE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we mean to use SFML here instead of ${target}? I can't find a variable defined with the name target in CMakeLists.txt. I just found this out because I started enforcing uninitialized variable warnings.

https://github.com/SFML/SFML/actions/runs/6859641809/job/18652242185#step:14:43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
SFML 2.5.0
  
Merged / Superseded
Development

Successfully merging this pull request may close these issues.

None yet

6 participants