Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorygorshenin <mipt.vi002@gmail.com>2016-11-23 14:52:51 +0300
committerGitHub <noreply@github.com>2016-11-23 14:52:51 +0300
commit2a175bc08316179a2d6f9c944ec6cd3b4da9d797 (patch)
tree9907c41b49af0ca9b807da2edaf4a1e936470342
parentf36a01accc04908c2bbb6191f3e0c568f984f1f5 (diff)
parent9517d5779c778af46615fdfbe518d61c07df5102 (diff)
Merge pull request #4745 from therearesomewhocallmetim/cmake_link_platform
Added the link platform function.
-rw-r--r--CMakeLists.txt14
-rw-r--r--drape/drape_tests/CMakeLists.txt3
-rw-r--r--drape_frontend/drape_frontend_tests/CMakeLists.txt4
-rw-r--r--editor/editor_tests/CMakeLists.txt9
-rw-r--r--editor/osm_auth_tests/CMakeLists.txt9
-rw-r--r--map/mwm_tests/CMakeLists.txt3
-rw-r--r--partners_api/partners_api_tests/CMakeLists.txt19
-rw-r--r--platform/platform_tests/CMakeLists.txt5
-rw-r--r--routing/routing_integration_tests/CMakeLists.txt15
-rw-r--r--routing/routing_tests/CMakeLists.txt10
-rw-r--r--search/search_tests/CMakeLists.txt9
-rw-r--r--tracking/tracking_tests/CMakeLists.txt12
-rw-r--r--traffic/pytraffic/CMakeLists.txt3
-rw-r--r--traffic/traffic_tests/CMakeLists.txt3
14 files changed, 21 insertions, 97 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f674734fd..4a1343f74a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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()
diff --git a/drape/drape_tests/CMakeLists.txt b/drape/drape_tests/CMakeLists.txt
index 852a0eb67d..3d80914617 100644
--- a/drape/drape_tests/CMakeLists.txt
+++ b/drape/drape_tests/CMakeLists.txt
@@ -69,9 +69,6 @@ omim_link_libraries(
if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
- "-framework IOKit"
- "-framework Cocoa"
"-framework CoreLocation"
- "-framework SystemConfiguration"
)
endif()
diff --git a/drape_frontend/drape_frontend_tests/CMakeLists.txt b/drape_frontend/drape_frontend_tests/CMakeLists.txt
index 090ec29985..1975a62513 100644
--- a/drape_frontend/drape_frontend_tests/CMakeLists.txt
+++ b/drape_frontend/drape_frontend_tests/CMakeLists.txt
@@ -13,10 +13,6 @@ if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
${Qt5Widgets_LIBRARIES}
- "-framework Cocoa"
- "-framework IOKit"
- "-framework QuartzCore"
- "-framework SystemConfiguration"
)
endif()
diff --git a/editor/editor_tests/CMakeLists.txt b/editor/editor_tests/CMakeLists.txt
index 9dbd8b1949..aa63b7a3cf 100644
--- a/editor/editor_tests/CMakeLists.txt
+++ b/editor/editor_tests/CMakeLists.txt
@@ -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()
diff --git a/editor/osm_auth_tests/CMakeLists.txt b/editor/osm_auth_tests/CMakeLists.txt
index 2e8b61d36a..e7e4361934 100644
--- a/editor/osm_auth_tests/CMakeLists.txt
+++ b/editor/osm_auth_tests/CMakeLists.txt
@@ -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()
diff --git a/map/mwm_tests/CMakeLists.txt b/map/mwm_tests/CMakeLists.txt
index f301073ed9..3bda28ff74 100644
--- a/map/mwm_tests/CMakeLists.txt
+++ b/map/mwm_tests/CMakeLists.txt
@@ -42,9 +42,6 @@ omim_link_libraries(
if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
- "-framework Cocoa"
- "-framework IOKit"
"-framework QuartzCore"
- "-framework SystemConfiguration"
)
endif()
diff --git a/partners_api/partners_api_tests/CMakeLists.txt b/partners_api/partners_api_tests/CMakeLists.txt
index c4348aae20..2a35a1d0ae 100644
--- a/partners_api/partners_api_tests/CMakeLists.txt
+++ b/partners_api/partners_api_tests/CMakeLists.txt
@@ -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()
diff --git a/platform/platform_tests/CMakeLists.txt b/platform/platform_tests/CMakeLists.txt
index b6a9d672d7..86decc8340 100644
--- a/platform/platform_tests/CMakeLists.txt
+++ b/platform/platform_tests/CMakeLists.txt
@@ -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()
diff --git a/routing/routing_integration_tests/CMakeLists.txt b/routing/routing_integration_tests/CMakeLists.txt
index 0ffde31c5c..67c9c6864a 100644
--- a/routing/routing_integration_tests/CMakeLists.txt
+++ b/routing/routing_integration_tests/CMakeLists.txt
@@ -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()
diff --git a/routing/routing_tests/CMakeLists.txt b/routing/routing_tests/CMakeLists.txt
index 7331941370..29797161be 100644
--- a/routing/routing_tests/CMakeLists.txt
+++ b/routing/routing_tests/CMakeLists.txt
@@ -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() \ No newline at end of file
diff --git a/search/search_tests/CMakeLists.txt b/search/search_tests/CMakeLists.txt
index dae480eaa8..b57100bbe3 100644
--- a/search/search_tests/CMakeLists.txt
+++ b/search/search_tests/CMakeLists.txt
@@ -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 ()
diff --git a/tracking/tracking_tests/CMakeLists.txt b/tracking/tracking_tests/CMakeLists.txt
index d5dc1abfb4..dd38da7e00 100644
--- a/tracking/tracking_tests/CMakeLists.txt
+++ b/tracking/tracking_tests/CMakeLists.txt
@@ -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()
diff --git a/traffic/pytraffic/CMakeLists.txt b/traffic/pytraffic/CMakeLists.txt
index 148e08ec52..b8ec31abf4 100644
--- a/traffic/pytraffic/CMakeLists.txt
+++ b/traffic/pytraffic/CMakeLists.txt
@@ -30,10 +30,7 @@ if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
${Qt5Widgets_LIBRARIES}
- "-framework Cocoa"
- "-framework IOKit"
"-framework QuartzCore"
- "-framework SystemConfiguration"
)
endif()
diff --git a/traffic/traffic_tests/CMakeLists.txt b/traffic/traffic_tests/CMakeLists.txt
index d722122235..8f8a81b117 100644
--- a/traffic/traffic_tests/CMakeLists.txt
+++ b/traffic/traffic_tests/CMakeLists.txt
@@ -30,9 +30,6 @@ if (PLATFORM_MAC)
omim_link_libraries(
${PROJECT_NAME}
${Qt5Widgets_LIBRARIES}
- "-framework IOKit"
- "-framework Cocoa"
- "-framework SystemConfiguration"
)
endif()