close
Skip to content

Fix CMake warning on macOS since CMake 3.9#1371

Closed
Ceylo wants to merge 2 commits into
SFML:masterfrom
Ceylo:bugfix/CMP0068
Closed

Fix CMake warning on macOS since CMake 3.9#1371
Ceylo wants to merge 2 commits into
SFML:masterfrom
Ceylo:bugfix/CMP0068

Conversation

@Ceylo

@Ceylo Ceylo commented Feb 10, 2018

Copy link
Copy Markdown
Contributor

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

Foaly commented Feb 14, 2018

Copy link
Copy Markdown
Contributor

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

Ceylo commented Feb 14, 2018

Copy link
Copy Markdown
Contributor Author

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

Ceylo commented Feb 17, 2018

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
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

@mantognini

Copy link
Copy Markdown
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

Ceylo commented Mar 6, 2018

Copy link
Copy Markdown
Contributor Author

@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

eXpl0it3r commented Mar 12, 2018

Copy link
Copy Markdown
Member

Merged in 8b7a50a

@eXpl0it3r eXpl0it3r closed this 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 thread CMakeLists.txt
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
Copy Markdown
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

None yet

Development

Successfully merging this pull request may close these issues.

6 participants