Merge pull request #4745 from therearesomewhocallmetim/cmake_link_platform

Added the link platform function.
This commit is contained in:
ygorshenin 2016-11-23 14:52:51 +03:00 committed by GitHub
commit 2a175bc083
14 changed files with 21 additions and 97 deletions

View file

@ -104,9 +104,23 @@ function(omim_add_test_subdirectory subdir)
endif()
endfunction()
function(omim_link_platform_deps target)
if ("${ARGN}" MATCHES "platform")
if (PLATFORM_MAC)
target_link_libraries(
${target}
"-framework CFNetwork"
"-framework Foundation"
"-framework SystemConfiguration"
)
endif()
endif()
endfunction()
function(omim_link_libraries target)
if (TARGET ${target})
target_link_libraries(${target} ${ARGN} ${CMAKE_THREAD_LIBS_INIT})
omim_link_platform_deps(${target} ${ARGN})
else()
message("~> Skipping linking the libraries to the target ${target} as it does not exist")
endif()

View file

@ -69,9 +69,6 @@ omim_link_libraries(
if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
"-framework IOKit"
"-framework Cocoa"
"-framework CoreLocation"
"-framework SystemConfiguration"
)
endif()

View file

@ -13,10 +13,6 @@ if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
${Qt5Widgets_LIBRARIES}
"-framework Cocoa"
"-framework IOKit"
"-framework QuartzCore"
"-framework SystemConfiguration"
)
endif()

View file

@ -29,12 +29,3 @@ omim_link_libraries(
${LIBZ}
${Qt5Widgets_LIBRARIES}
)
if (${PLATFORM_MAC})
omim_link_libraries(
${PROJECT_NAME}
"-framework Cocoa"
"-framework IOKit"
"-framework SystemConfiguration"
)
endif()

View file

@ -22,12 +22,3 @@ omim_link_libraries(
${LIBZ}
${Qt5Widgets_LIBRARIES}
)
if (${PLATFORM_MAC})
omim_link_libraries(
${PROJECT_NAME}
"-framework Cocoa"
"-framework IOKit"
"-framework SystemConfiguration"
)
endif()

View file

@ -42,9 +42,6 @@ omim_link_libraries(
if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
"-framework Cocoa"
"-framework IOKit"
"-framework QuartzCore"
"-framework SystemConfiguration"
)
endif()

View file

@ -20,21 +20,6 @@ omim_link_libraries(
stats_client
${LIBZ}
${Qt5Core_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${Qt5Network_LIBRARIES}
)
if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
${Qt5Widgets_LIBRARIES}
"-framework IOKit"
"-framework SystemConfiguration"
"-framework Cocoa"
)
endif()
if (PLATFORM_LINUX OR PLATFORM_WIN)
omim_link_libraries(
${PROJECT_NAME}
${Qt5Network_LIBRARIES}
)
endif()

View file

@ -17,6 +17,7 @@ set(
)
omim_add_test(${PROJECT_NAME} ${SRC})
omim_link_libraries(
${PROJECT_NAME}
platform_tests_support
@ -29,15 +30,11 @@ omim_link_libraries(
${LIBZ}
)
if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
${Qt5Widgets_LIBRARIES}
"-framework Cocoa"
"-framework IOKit"
"-framework QuartzCore"
"-framework SystemConfiguration"
)
endif()

View file

@ -22,12 +22,8 @@ set(
routing_test_tools.hpp
)
# if (APPLE)
# target_compile_options(${PROJECT_NAME} PUBLIC "-fobjc-arc")
#endif()
omim_add_test(${PROJECT_NAME} ${SRC})
omim_link_libraries(
${PROJECT_NAME}
map
@ -51,12 +47,3 @@ omim_link_libraries(
${Qt5Core_LIBRARIES}
${LIBZ}
)
if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
"-framework Cocoa"
"-framework IOKit"
"-framework SystemConfiguration"
)
endif()

View file

@ -26,6 +26,7 @@ set(
)
omim_add_test(${PROJECT_NAME} ${SRC})
omim_link_libraries(
${PROJECT_NAME}
routing
@ -49,12 +50,3 @@ omim_link_libraries(
${Qt5Core_LIBRARIES}
${LIBZ}
)
if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
"-framework Cocoa"
"-framework IOKit"
"-framework SystemConfiguration"
)
endif()

View file

@ -43,12 +43,3 @@ omim_link_libraries(
${Qt5Core_LIBRARIES}
${LIBZ}
)
if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
"-framework Cocoa"
"-framework IOKit"
"-framework SystemConfiguration"
)
endif ()

View file

@ -10,7 +10,8 @@ omim_add_test(${PROJECT_NAME} ${SRC})
omim_link_libraries(
${PROJECT_NAME}
tracking platform
tracking
platform
platform_tests_support
coding
base
@ -19,12 +20,3 @@ omim_link_libraries(
${LIBZ}
${Qt5Widgets_LIBRARIES}
)
if (${PLATFORM_MAC})
omim_link_libraries(
${PROJECT_NAME}
"-framework Cocoa"
"-framework IOKit"
"-framework SystemConfiguration"
)
endif()

View file

@ -30,10 +30,7 @@ if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
${Qt5Widgets_LIBRARIES}
"-framework Cocoa"
"-framework IOKit"
"-framework QuartzCore"
"-framework SystemConfiguration"
)
endif()

View file

@ -30,9 +30,6 @@ if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
${Qt5Widgets_LIBRARIES}
"-framework IOKit"
"-framework Cocoa"
"-framework SystemConfiguration"
)
endif()