Fix cocoa example - some absolute paths needed in cmake, and float conversion to sf::Angle

This commit is contained in:
Jonny Paton 2022-09-26 21:31:55 +01:00 committed by Lukas Dürrenberger
parent 0b4d9ca822
commit e01e4760e9
2 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ set(SRC CocoaAppDelegate.h
NSString+stdstring.mm
main.m)
compile_xib(INPUT "MainMenu.xib" OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/MainMenu.nib")
compile_xib(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/MainMenu.xib" OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/MainMenu.nib")
# all resource files
set(RESOURCES resources/icon.icns
@ -56,5 +56,5 @@ sfml_add_example(cocoa
DEPENDS SFML::System SFML::Window SFML::Graphics)
set_target_properties(cocoa PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_INFO_PLIST resources/Cocoa-Info.plist)
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/Cocoa-Info.plist)
target_link_libraries(cocoa PRIVATE "-framework Cocoa" "-framework Foundation" SFML::Graphics)

View File

@ -199,7 +199,7 @@ struct SFMLmainWindow
if (self.initialized)
{
float angle = [sender floatValue];
self.mainWindow->sprite.setRotation(angle);
self.mainWindow->sprite.setRotation(sf::degrees(angle));
}
}