macOS include AppKit

This commit is contained in:
Paulchen-Panther 2023-11-16 19:44:35 +01:00
parent 30e44f24b2
commit 287ff990ea
2 changed files with 2 additions and 9 deletions

View File

@ -16,17 +16,10 @@ endif()
target_link_libraries(events target_link_libraries(events
hyperion-utils hyperion-utils
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Widgets
) )
if(APPLE) if(APPLE)
find_library(FOUNDATION_LIBRARY Foundation REQUIRED)
set_source_files_properties(OsEventHandler.cpp PROPERTIES COMPILE_FLAGS "-x objective-c++") set_source_files_properties(OsEventHandler.cpp PROPERTIES COMPILE_FLAGS "-x objective-c++")
target_link_libraries(events ${FOUNDATION_LIBRARY}) target_link_libraries(events "-framework AppKit")
target_include_directories(events PRIVATE ${FOUNDATION_LIBRARY})
endif() endif()

View File

@ -17,7 +17,7 @@
#pragma comment( lib, "wtsapi32.lib" ) #pragma comment( lib, "wtsapi32.lib" )
#elif defined(__APPLE__) #elif defined(__APPLE__)
#import <Cocoa/Cocoa.h> #include <AppKit/AppKit.h>
#endif #endif
OsEventHandlerBase::OsEventHandlerBase() OsEventHandlerBase::OsEventHandlerBase()