diff options
Diffstat (limited to 'x-plane-plugin')
-rw-r--r-- | x-plane-plugin/CMakeLists.txt | 25 | ||||
-rw-r--r-- | x-plane-plugin/plugin.c | 4 |
2 files changed, 22 insertions, 7 deletions
diff --git a/x-plane-plugin/CMakeLists.txt b/x-plane-plugin/CMakeLists.txt index 1d686d98..8e8fb338 100644 --- a/x-plane-plugin/CMakeLists.txt +++ b/x-plane-plugin/CMakeLists.txt @@ -2,19 +2,30 @@ if(LINUX OR APPLE) set(SDK_XPLANE "" CACHE PATH "Path to the X-Plane SDK") if(SDK_XPLANE) - otr_module(xplane-plugin NO-QT) + if (APPLE) + otr_module(xplane-plugin NO-QT NO-INSTALL) + else() + otr_module(xplane-plugin NO-QT) + endif() # probably librt already included - #install(FILES ${opentrack-xplane-plugin-c} DESTINATION "${opentrack-doc-src-pfx}/opentrack-xplane-plugin") - target_include_directories(opentrack-xplane-plugin SYSTEM PUBLIC ${SDK_XPLANE}/CHeaders ${SDK_XPLANE}/CHeaders/XPLM) + #install(FILES ${opentrack-xplane-plugin-c} DESTINATION "opentrack-libexec") + target_include_directories(opentrack-xplane-plugin SYSTEM PUBLIC ${SDK_XPLANE}/CHeaders/XPLM) if(APPLE) target_compile_options(${self} PRIVATE -iframework "${SDK_XPLANE}/Libraries/Mac/" - -DAPL -DXPLM200 -DXPLM210 - -framework XPLM -framework XPWidgets) - target_link_options(${self} + -DAPL -DXPLM200 -DXPLM210 + -framework XPLM) + target_link_options(${self} PRIVATE "-F${SDK_XPLANE}/Libraries/Mac/" - -framework XPLM -framework XPWidgets) + -framework XPLM) + + install(TARGETS "${self}" + RUNTIME DESTINATION ${opentrack-bin}/xplane + BUNDLE DESTINATION ${opentrack-bin}/xplane + LIBRARY DESTINATION ${opentrack-bin}/xplane + PERMISSIONS ${opentrack-perms-exec}) + elseif(CMAKE_COMPILER_IS_GNUCXX) target_compile_options(${self} PRIVATE -DLIN -DXPLM200 -DXPLM210) target_link_options(${self} PRIVATE -rdynamic -nodefaultlibs) diff --git a/x-plane-plugin/plugin.c b/x-plane-plugin/plugin.c index ed72e50e..e43ee0ef 100644 --- a/x-plane-plugin/plugin.c +++ b/x-plane-plugin/plugin.c @@ -134,6 +134,8 @@ static int TrackToggleHandler(XPLMCommandRef inCommand, XPLMCommandPhase inPhase, void* inRefCon) { + if (inPhase != xplm_CommandBegin) return 0; + if (track_disabled) { //Enable @@ -156,6 +158,8 @@ static int TranslationToggleHandler(XPLMCommandRef inCommand, XPLMCommandPhase inPhase, void* inRefCon) { + if (inPhase != xplm_CommandBegin) return 0; + translation_disabled = !translation_disabled; if (!translation_disabled) { |