diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-02-10 02:06:27 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-02-10 02:06:27 +0100 |
commit | 94e6e5be8281cb759a06a3b18f4f25a1c87142e2 (patch) | |
tree | ba00eca761beb0064c066071d24b027bd7c93211 /x-plane-plugin | |
parent | 3c702e840b23aa350412d53437b34fee7516e00e (diff) |
cmake: use target_{compile,link}_options
Diffstat (limited to 'x-plane-plugin')
-rw-r--r-- | x-plane-plugin/CMakeLists.txt | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/x-plane-plugin/CMakeLists.txt b/x-plane-plugin/CMakeLists.txt index f7bb7a3f..1d686d98 100644 --- a/x-plane-plugin/CMakeLists.txt +++ b/x-plane-plugin/CMakeLists.txt @@ -8,29 +8,28 @@ if(LINUX OR APPLE) target_include_directories(opentrack-xplane-plugin SYSTEM PUBLIC ${SDK_XPLANE}/CHeaders ${SDK_XPLANE}/CHeaders/XPLM) if(APPLE) - set_property(TARGET opentrack-xplane-plugin APPEND_STRING PROPERTY - COMPILE_FLAGS "-iframework ${SDK_XPLANE}/Libraries/Mac/ -DAPL -DXPLM200 -DXPLM210 -framework XPLM -framework XPWidgets ") - set_property(TARGET opentrack-xplane-plugin APPEND_STRING PROPERTY - LINK_FLAGS "-F${SDK_XPLANE}/Libraries/Mac/ -framework XPLM -framework XPWidgets ") + target_compile_options(${self} PRIVATE + -iframework "${SDK_XPLANE}/Libraries/Mac/" + -DAPL -DXPLM200 -DXPLM210 + -framework XPLM -framework XPWidgets) + target_link_options(${self} + "-F${SDK_XPLANE}/Libraries/Mac/" + -framework XPLM -framework XPWidgets) elseif(CMAKE_COMPILER_IS_GNUCXX) - set_property(TARGET opentrack-xplane-plugin APPEND_STRING PROPERTY - COMPILE_FLAGS "-DLIN -DXPLM200 -DXPLM210 ") - set_property(TARGET opentrack-xplane-plugin APPEND_STRING PROPERTY - LINK_FLAGS "-rdynamic -nodefaultlibs ") + target_compile_options(${self} PRIVATE -DLIN -DXPLM200 -DXPLM210) + target_link_options(${self} PRIVATE -rdynamic -nodefaultlibs) endif() if(CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_CLANG) - set_property(TARGET opentrack-xplane-plugin APPEND_STRING PROPERTY - LINK_FLAGS "-undefined_warning ") + target_link_options(${self} PRIVATE -undefined_warning) endif() - set_target_properties(opentrack-xplane-plugin PROPERTIES + set_target_properties(${self} PROPERTIES LIBRARY_OUTPUT_NAME "opentrack.xpl" - PREFIX "" - SUFFIX "") + PREFIX "" SUFFIX "") if(UNIX AND NOT APPLE) - target_link_libraries(opentrack-xplane-plugin rt) + target_link_libraries(${self} rt) endif() endif() endif() |