From 94e6e5be8281cb759a06a3b18f4f25a1c87142e2 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 10 Feb 2019 02:06:27 +0100 Subject: cmake: use target_{compile,link}_options --- x-plane-plugin/CMakeLists.txt | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'x-plane-plugin/CMakeLists.txt') 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() -- cgit v1.2.3