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:
authorgreshilov <slovaricheg@gmail.com>2018-01-12 15:33:07 +0300
committerYuri Gorshenin <mipt.vi002@gmail.com>2018-01-18 13:25:44 +0300
commit71d211bf1cd877a7e1373778507c33499afc41fe (patch)
treef0da64cadeb2bae89181ffc769fc895367246da4
parentd4abef8634d8b89af727c45adbd5c60563d60943 (diff)
[cmake] Designer Tool final fix
Fix omim_add_test, omim_add_executable
-rw-r--r--CMakeLists.txt12
-rw-r--r--generator/generator_tool/CMakeLists.txt4
-rw-r--r--map/style_tests/CMakeLists.txt5
-rw-r--r--qt/CMakeLists.txt48
-rw-r--r--qt/build_style/build_skins.cpp4
-rw-r--r--skin_generator/CMakeLists.txt5
-rwxr-xr-xtools/unix/build_omim.sh3
7 files changed, 42 insertions, 39 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f8a07ad8b..999223fa4d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -106,10 +106,16 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
-if ($ENV{QT_PATH})
+if (DEFINED ENV{QT_PATH})
+ message("Qt path is set to: " $ENV{QT_PATH})
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} $ENV{QT_PATH})
else()
- set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/local/opt/qt5")
+ file(GLOB QT_PATH_LIST "/usr/local/opt/qt*" "/usr/lib/x86_64-linux-gnu/qt*")
+ if (QT_PATH_LIST)
+ list(GET QT_PATH_LIST 0 QT_PATH)
+ message("Found Qt path: " ${QT_PATH})
+ set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QT_PATH})
+ endif()
endif()
if (NOT SKIP_TESTS)
@@ -230,7 +236,7 @@ endfunction()
function(omim_add_test executable)
if (NOT SKIP_TESTS)
- omim_add_executable(${executable} ${OMIM_ROOT}/testing/testingmain.cpp ${ARGN})
+ omim_add_executable(${executable} ${ARGN} ${OMIM_ROOT}/testing/testingmain.cpp)
endif()
endfunction()
diff --git a/generator/generator_tool/CMakeLists.txt b/generator/generator_tool/CMakeLists.txt
index a9b91ca993..b3f0ca7158 100644
--- a/generator/generator_tool/CMakeLists.txt
+++ b/generator/generator_tool/CMakeLists.txt
@@ -4,6 +4,10 @@ include_directories(${OMIM_PATH}/3party/gflags/src)
set(SRC generator_tool.cpp)
+if (BUILD_DESIGNER)
+ set(SRC MACOSX_BUNDLE ${SRC})
+endif()
+
omim_add_executable(${PROJECT_NAME} ${SRC})
omim_link_libraries(
diff --git a/map/style_tests/CMakeLists.txt b/map/style_tests/CMakeLists.txt
index 1c927fd503..4b3e6054b6 100644
--- a/map/style_tests/CMakeLists.txt
+++ b/map/style_tests/CMakeLists.txt
@@ -10,6 +10,11 @@ set(
style_symbols_consistency_test.cpp
)
+
+if (BUILD_DESIGNER)
+ set(SRC MACOSX_BUNDLE ${SRC})
+endif()
+
omim_add_test(${PROJECT_NAME} ${SRC})
omim_link_libraries(
diff --git a/qt/CMakeLists.txt b/qt/CMakeLists.txt
index d65cb1d702..36f2c43d57 100644
--- a/qt/CMakeLists.txt
+++ b/qt/CMakeLists.txt
@@ -213,17 +213,6 @@ if (PLATFORM_MAC)
)
endif()
-function(omim_append_built_tools)
- foreach(tool ${ARGN})
- add_custom_command(
- TARGET ${PROJECT_NAME}
- POST_BUILD
- DEPENDS ${tool}
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${tool} ${RESOURCES_FOLDER}
- )
- endforeach()
-endfunction()
-
if (BUILD_DESIGNER)
execute_process(
COMMAND cp -rf ${OMIM_ROOT}/data/resources-mdpi_clear/ ${OMIM_ROOT}/data/resources-mdpi_design/
@@ -249,15 +238,6 @@ if (BUILD_DESIGNER)
resources-6plus_design
)
- omim_append_built_tools(
- generator_tool
- skin_generator_tool
- )
-
- if (NOT SKIP_TESTS)
- omim_append_built_tools(style_tests)
- endif()
-
execute_process(
COMMAND cp ${OMIM_ROOT}/tools/python/recalculate_geom_index.py ${RESOURCES_FOLDER}
COMMAND cp ${OMIM_ROOT}/tools/python/generate_styles_override.py ${RESOURCES_FOLDER}
@@ -269,17 +249,25 @@ if (BUILD_DESIGNER)
# Generate DMG
install(DIRECTORY ${DATA_DIR}/styles DESTINATION .)
+ set(
+ BUNDLES
+ ${CMAKE_BINARY_DIR}/generator_tool.app
+ ${CMAKE_BINARY_DIR}/skin_generator_tool.app
+ ${CMAKE_BINARY_DIR}/style_tests.app
+ )
install(CODE "
- execute_process(
- COMMAND macdeployqt \"${BUNDLE_FOLDER}\"
- )
- file(WRITE \"${RESOURCES_FOLDER}/qt.conf\" \"\")
- file(GLOB_RECURSE QTPLUGINS
- \"${BUNDLE_FOLDER}/Contents/PlugIns/*/*${CMAKE_SHARED_LIBRARY_SUFFIX}\"
- )
- include(BundleUtilities)
- fixup_bundle(\"${BUNDLE_FOLDER}\" \"\${QTPLUGINS}\" \"${Qt5_DIR}/lib\")
- ")
+ foreach(BUNDLE ${BUNDLE_FOLDER} ${BUNDLES})
+ execute_process(
+ COMMAND \"${QT_PATH}/bin/macdeployqt\" \"\${BUNDLE}\"
+ COMMAND python \"${OMIM_ROOT}/tools/macdeployqtfix/macdeployqtfix.py\" -q -nl \"\${BUNDLE}\" \"${QT_PATH}\"
+ )
+ endforeach()
+ foreach(BUNDLE ${BUNDLES})
+ execute_process(
+ COMMAND cp -rf \"\${BUNDLE}\" \"${RESOURCES_FOLDER}\"
+ )
+ endforeach()
+ ")
install(TARGETS ${PROJECT_NAME} DESTINATION .)
set(CPACK_GENERATOR DragNDrop)
diff --git a/qt/build_style/build_skins.cpp b/qt/build_style/build_skins.cpp
index 7c576ae1f7..82506a862f 100644
--- a/qt/build_style/build_skins.cpp
+++ b/qt/build_style/build_skins.cpp
@@ -52,9 +52,9 @@ inline bool SkinCoorrectColor(SkinType s) { return std::get<2>(g_skinInfo[s]); }
QString GetSkinGeneratorPath()
{
- QString path = GetExternalPath("skin_generator", "skin_generator.app/Contents/MacOS", "");
+ QString path = GetExternalPath("skin_generator_tool", "skin_generator_tool.app/Contents/MacOS", "");
if (path.isEmpty())
- path = GetExternalPath("skin_generator_tool", "skin_generator_tool.app/Contents/MacOS", "");
+ throw std::runtime_error("Can't find skin_generator_tool");
ASSERT(QFileInfo::exists(path), (path.toStdString()));
return path;
}
diff --git a/skin_generator/CMakeLists.txt b/skin_generator/CMakeLists.txt
index ecfd799f63..aaac777dae 100644
--- a/skin_generator/CMakeLists.txt
+++ b/skin_generator/CMakeLists.txt
@@ -18,6 +18,10 @@ set(
main.cpp
)
+if (BUILD_DESIGNER)
+ set(SRC MACOSX_BUNDLE ${SRC})
+endif()
+
omim_add_executable(${PROJECT_NAME} ${SRC})
omim_link_libraries(
@@ -34,4 +38,3 @@ omim_link_libraries(
${Qt5Svg_LIBRARIES}
${LIBZ}
)
-
diff --git a/tools/unix/build_omim.sh b/tools/unix/build_omim.sh
index f5c020d021..6de3242508 100755
--- a/tools/unix/build_omim.sh
+++ b/tools/unix/build_omim.sh
@@ -77,9 +77,6 @@ source "$OMIM_PATH/tools/autobuild/detect_cmake.sh"
# OS-specific parameters
if [ "$(uname -s)" == "Darwin" ]; then
- [ -n "$OPT_DESIGNER" -a "$(id -u)" != "0" ] \
- && echo "To build designer tool you have to run this script with sudo" \
- && exit 2
PROCESSES=$(sysctl -n hw.ncpu)
else
[ -n "$OPT_DESIGNER" ] \