From 3b23d5fe4f9f85cae008922faca59b5ba8900aad Mon Sep 17 00:00:00 2001 From: Timofey Date: Tue, 11 Oct 2016 13:07:27 +0300 Subject: [PATCH 1/6] Map, mwm_tests --- 3party/expat/CMakeLists.txt | 125 ++------- 3party/freetype/CMakeLists.txt | 494 ++++++++------------------------- 3party/fribidi/CMakeLists.txt | 60 ++++ CMakeLists.txt | 4 +- map/CMakeLists.txt | 68 +++++ map/mwm_tests/CMakeLists.txt | 49 ++++ 6 files changed, 312 insertions(+), 488 deletions(-) mode change 100755 => 100644 3party/expat/CMakeLists.txt create mode 100644 3party/fribidi/CMakeLists.txt create mode 100644 map/CMakeLists.txt create mode 100644 map/mwm_tests/CMakeLists.txt diff --git a/3party/expat/CMakeLists.txt b/3party/expat/CMakeLists.txt old mode 100755 new mode 100644 index bc930571b4..612a143c14 --- a/3party/expat/CMakeLists.txt +++ b/3party/expat/CMakeLists.txt @@ -1,111 +1,28 @@ -# This file is copyrighted under the BSD-license for buildsystem files of KDE -# copyright 2010, Patrick Spendrin +cmake_minimum_required(VERSION 3.2) -project(expat) +project(expat C CXX) -cmake_minimum_required(VERSION 2.6) -set(PACKAGE_BUGREPORT "expat-bugs@libexpat.org") -set(PACKAGE_NAME "expat") -set(PACKAGE_VERSION "2.1.0") -set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") -set(PACKAGE_TARNAME "${PACKAGE_NAME}") +add_definitions(-DHAVE_MEMMOVE) -option(BUILD_tools "build the xmlwf tool for expat library" ON) -option(BUILD_examples "build the examples for expat library" ON) -option(BUILD_tests "build the tests for expat library" ON) -option(BUILD_shared "build a shared expat library" ON) - -# configuration options -set(XML_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point") -option(XML_DTD "Define to make parameter entity parsing functionality available" ON) -option(XML_NS "Define to make XML Namespaces functionality available" ON) - -if(XML_DTD) - set(XML_DTD 1) -else(XML_DTD) - set(XML_DTD 0) -endif(XML_DTD) -if(XML_NS) - set(XML_NS 1) -else(XML_NS) - set(XML_NS 0) -endif(XML_NS) - -if(BUILD_tests) - enable_testing() -endif(BUILD_tests) - -include(ConfigureChecks.cmake) - -include_directories(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/lib) -if(MSVC) - add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4996) -endif(MSVC) - -set(expat_SRCS - lib/xmlparse.c - lib/xmlrole.c - lib/xmltok.c - lib/xmltok_impl.c - lib/xmltok_ns.c +add_compile_options( + "-Wall" ) -if(WIN32 AND BUILD_shared) - set(expat_SRCS ${expat_SRCS} lib/libexpat.def) -endif(WIN32 AND BUILD_shared) -if(BUILD_shared) - set(_SHARED SHARED) -else(BUILD_shared) - set(_SHARED STATIC) -endif(BUILD_shared) +set( + SRC + lib/ascii.h + lib/expat_external.h + lib/expat.h + lib/internal.h + lib/nametab.h + lib/xmlparse.c + lib/xmlrole.c + lib/xmlrole.h + lib/xmltok_impl.c + lib/xmltok_ns.c + lib/xmltok.c + lib/xmltok.h +) -add_library(expat ${_SHARED} ${expat_SRCS}) - -install(TARGETS expat RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) - -set(prefix ${CMAKE_INSTALL_PREFIX}) -set(exec_prefix "\${prefix}/bin") -set(libdir "\${prefix}/lib") -set(includedir "\${prefix}/include") -configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc) - -install(FILES lib/expat.h lib/expat_external.h DESTINATION include) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION lib/pkgconfig) - - - -if(BUILD_tools AND NOT WINCE) - set(xmlwf_SRCS - xmlwf/xmlwf.c - xmlwf/xmlfile.c - xmlwf/codepage.c - xmlwf/readfilemap.c - ) - - add_executable(xmlwf ${xmlwf_SRCS}) - target_link_libraries(xmlwf expat) - install(TARGETS xmlwf DESTINATION bin) - install(FILES doc/xmlwf.1 DESTINATION share/man/man1) -endif(BUILD_tools AND NOT WINCE) - -if(BUILD_examples) - add_executable(elements examples/elements.c) - target_link_libraries(elements expat) - - add_executable(outline examples/outline.c) - target_link_libraries(outline expat) -endif(BUILD_examples) - -if(BUILD_tests) - ## these are unittests that can be run on any platform - add_executable(runtests tests/runtests.c tests/chardata.c tests/minicheck.c) - target_link_libraries(runtests expat) - add_test(runtests runtests) - - add_executable(runtestspp tests/runtestspp.cpp tests/chardata.c tests/minicheck.c) - target_link_libraries(runtestspp expat) - add_test(runtestspp runtestspp) -endif(BUILD_tests) +add_library(expat ${SRC}) diff --git a/3party/freetype/CMakeLists.txt b/3party/freetype/CMakeLists.txt index edcb64e873..7dda4bbb34 100644 --- a/3party/freetype/CMakeLists.txt +++ b/3party/freetype/CMakeLists.txt @@ -1,404 +1,132 @@ -# CMakeLists.txt -# -# Copyright 2013-2015 by -# David Turner, Robert Wilhelm, and Werner Lemberg. -# -# Written originally by John Cary -# -# This file is part of the FreeType project, and may only be used, modified, -# and distributed under the terms of the FreeType project license, -# LICENSE.TXT. By continuing to use, modify, or distribute this file you -# indicate that you have read the license and understand and accept it -# fully. -# -# -# As a preliminary, create a compilation directory and change into it, for -# example -# -# mkdir ~/freetype2.compiled -# cd ~/freetype2.compiled -# -# Now you can say -# -# cmake -# -# to create a Makefile that builds a static version of the library. -# -# For a dynamic library, use -# -# cmake -D BUILD_SHARED_LIBS:BOOL=true -# -# For a framework on OS X, use -# -# cmake -D BUILD_FRAMEWORK:BOOL=true -G Xcode -# -# instead. -# -# For an iOS static library, use -# -# cmake -D IOS_PLATFORM=OS -G Xcode -# -# or -# -# cmake -D IOS_PLATFORM=SIMULATOR -G Xcode -# -# Please refer to the cmake manual for further options, in particular, how -# to modify compilation and linking parameters. -# -# Some notes. -# -# . `cmake' creates configuration files in -# -# /include/freetype/config -# -# which should be further modified if necessary. -# -# . You can use `cmake' directly on a freshly cloned FreeType git -# repository. -# -# . `CMakeLists.txt' is provided as-is since it is normally not used by the -# developer team. +cmake_minimum_required(VERSION 3.2) +project(freetype C CXX) -cmake_minimum_required(VERSION 2.6) - - -include(CheckIncludeFile) - - -# CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which -# configures the base build environment and references the toolchain file -if (APPLE) - if (DEFINED IOS_PLATFORM) - if (NOT "${IOS_PLATFORM}" STREQUAL "OS" - AND NOT "${IOS_PLATFORM}" STREQUAL "SIMULATOR") - message(FATAL_ERROR - "IOS_PLATFORM must be set to either OS or SIMULATOR") - endif () - if (NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode") - message(AUTHOR_WARNING - "You should use Xcode generator with IOS_PLATFORM enabled to get Universal builds.") - endif () - if (BUILD_SHARED_LIBS) - message(FATAL_ERROR - "BUILD_SHARED_LIBS can not be on with IOS_PLATFORM enabled") - endif () - if (BUILD_FRAMEWORK) - message(FATAL_ERROR - "BUILD_FRAMEWORK can not be on with IOS_PLATFORM enabled") - endif () - - # iOS only uses static libraries - set(BUILD_SHARED_LIBS OFF) - - set(CMAKE_TOOLCHAIN_FILE - ${PROJECT_SOURCE_DIR}/builds/cmake/iOS.cmake) - endif () -else () - if (DEFINED IOS_PLATFORM) - message(FATAL_ERROR "IOS_PLATFORM is not supported on this platform") - endif () -endif () - -if (WIN32 AND BUILD_SHARED_LIBS) - message(FATAL_ERROR "Shared libraries not supported on Windows.") -endif () - - -project(freetype) - - -# Disallow in-source builds -if ("${PROJECT_BINARY_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}") - message(FATAL_ERROR - " -In-source builds are not permitted! Make a separate folder for" - " building, e.g.," - " - mkdir build; cd build; cmake .." - " -Before that, remove the files created by this failed run with" - " - rm -rf CMakeCache.txt CMakeFiles") -endif () - - -# Add local cmake modules -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/builds) - - -if (BUILD_FRAMEWORK) - if (NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode") - message(FATAL_ERROR - "You should use Xcode generator with BUILD_FRAMEWORK enabled") - endif () - set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)") - set(BUILD_SHARED_LIBS ON) -endif () - - -set(VERSION_MAJOR "2") -set(VERSION_MINOR "6") -set(VERSION_PATCH "0") - -set(PROJECT_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) -set(SHARED_LIBRARY_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}) - - -# Compiler definitions for building the library add_definitions(-DFT2_BUILD_LIBRARY) - -# Find dependencies -find_package(ZLIB) -find_package(BZip2) -find_package(PNG) -find_package(HarfBuzz) - - -message(STATUS - "Creating directory ${PROJECT_BINARY_DIR}/include/freetype/config") -file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/include/freetype/config") - - -# Create the configuration file -message(STATUS - "Creating file ${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h") - -if (UNIX) - check_include_file("unistd.h" HAVE_UNISTD_H) - check_include_file("fcntl.h" HAVE_FCNTL_H) - check_include_file("stdint.h" HAVE_STDINT_H) - - file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.in" - FTCONFIG_H) - if (HAVE_UNISTD_H) - string(REGEX REPLACE - "#undef +(HAVE_UNISTD_H)" "#define \\1" - FTCONFIG_H "${FTCONFIG_H}") - endif () - if (HAVE_FCNTL_H) - string(REGEX REPLACE - "#undef +(HAVE_FCNTL_H)" "#define \\1" - FTCONFIG_H "${FTCONFIG_H}") - endif () - if (HAVE_STDINT_H) - string(REGEX REPLACE - "#undef +(HAVE_STDINT_H)" "#define \\1" - FTCONFIG_H "${FTCONFIG_H}") - endif () - string(REPLACE "/undef " "#undef " - FTCONFIG_H "${FTCONFIG_H}") - file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h" - "${FTCONFIG_H}") -else () - file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftconfig.h" - FTCONFIG_H) - file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h" - "${FTCONFIG_H}") +if (PLATFORM_LINUX AND CMAKE_COMPILER_IS_GNUCXX) + add_definitions(-DOMIM_FULL_FREETYPE) endif () +add_compile_options( + "-Wall" +) -# Create the options file -message(STATUS - "Creating file ${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h") - -file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftoption.h" - FTOPTION_H) -if (ZLIB_FOUND) - string(REGEX REPLACE - "/\\* +(#define +FT_CONFIG_OPTION_SYSTEM_ZLIB) +\\*/" "\\1" - FTOPTION_H "${FTOPTION_H}") -endif () -if (BZIP2_FOUND) - string(REGEX REPLACE - "/\\* +(#define +FT_CONFIG_OPTION_USE_BZIP2) +\\*/" "\\1" - FTOPTION_H "${FTOPTION_H}") -endif () -if (PNG_FOUND) - string(REGEX REPLACE - "/\\* +(#define +FT_CONFIG_OPTION_USE_PNG) +\\*/" "\\1" - FTOPTION_H "${FTOPTION_H}") -endif () -if (HARFBUZZ_FOUND) - string(REGEX REPLACE - "/\\* +(#define +FT_CONFIG_OPTION_USE_HARFBUZZ) +\\*/" "\\1" - FTOPTION_H "${FTOPTION_H}") -endif () -file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h" - "${FTOPTION_H}") +include_directories(include) -# Specify library include directories -include_directories("${PROJECT_SOURCE_DIR}/include") -include_directories(BEFORE "${PROJECT_BINARY_DIR}/include") - - -file(GLOB PUBLIC_HEADERS "include/ft2build.h" "include/freetype/*.h") -file(GLOB PUBLIC_CONFIG_HEADERS "include/freetype/config/*.h") -file(GLOB PRIVATE_HEADERS "include/freetype/internal/*.h") - - -set(BASE_SRCS - src/autofit/autofit.c - src/base/ftbase.c - src/base/ftbbox.c - src/base/ftbdf.c +set( + SRC + src/autofit/afangles.c + src/autofit/afblue.c + src/autofit/afcjk.c + src/autofit/afdummy.c + src/autofit/afglobal.c + src/autofit/afhints.c + src/autofit/afindic.c + src/autofit/aflatin.c + src/autofit/afloader.c + src/autofit/afmodule.c + src/autofit/afranges.c + src/autofit/afwarp.c + src/autofit/hbshim.c + src/base/ftadvanc.c src/base/ftbitmap.c - src/base/ftcid.c - src/base/ftfntfmt.c - src/base/ftfstype.c - src/base/ftgasp.c + src/base/ftcalc.c + src/base/ftgloadr.c src/base/ftglyph.c - src/base/ftgxval.c src/base/ftinit.c - src/base/ftlcdfil.c - src/base/ftmm.c - src/base/ftotval.c - src/base/ftpatent.c - src/base/ftpfr.c + src/base/ftobjs.c + src/base/ftoutln.c + src/base/ftrfork.c + src/base/ftstream.c src/base/ftstroke.c - src/base/ftsynth.c src/base/ftsystem.c - src/base/fttype1.c - src/base/ftwinfnt.c - src/bdf/bdf.c - src/bzip2/ftbzip2.c - src/cache/ftcache.c - src/cff/cff.c - src/cid/type1cid.c + src/base/fttrigon.c + src/base/ftutil.c + src/bdf/bdfdrivr.c + src/bdf/bdflib.c + src/cache/ftcbasic.c + src/cache/ftccache.c + src/cache/ftccmap.c + src/cache/ftcglyph.c + src/cache/ftcimage.c + src/cache/ftcmanag.c + src/cache/ftcmru.c + src/cache/ftcsbits.c + src/cff/cf2ft.c + src/cff/cf2font.c + src/cff/cf2blues.c + src/cff/cf2intrp.c + src/cff/cf2stack.c + src/cff/cf2arrst.c + src/cff/cf2hints.c + src/cff/cf2error.c + src/cff/cf2read.c + src/cff/cffcmap.c + src/cff/cffdrivr.c + src/cff/cffgload.c + src/cff/cffload.c + src/cff/cffobjs.c + src/cff/cffparse.c + src/cid/cidriver.c + src/cid/cidgload.c + src/cid/cidload.c + src/cid/cidobjs.c + src/cid/cidparse.c src/gzip/ftgzip.c src/lzw/ftlzw.c - src/pcf/pcf.c - src/pfr/pfr.c - src/psaux/psaux.c - src/pshinter/pshinter.c - src/psnames/psnames.c - src/raster/raster.c - src/sfnt/sfnt.c - src/smooth/smooth.c + src/pcf/pcfdrivr.c + src/pcf/pcfread.c + src/pcf/pcfutil.c + src/pfr/pfrcmap.c + src/pfr/pfrdrivr.c + src/pfr/pfrgload.c + src/pfr/pfrload.c + src/pfr/pfrobjs.c + src/pfr/pfrsbit.c + src/psaux/afmparse.c + src/psaux/psauxmod.c + src/psaux/psconv.c + src/psaux/psobjs.c + src/psaux/t1cmap.c + src/psaux/t1decode.c + src/pshinter/pshalgo.c + src/pshinter/pshglob.c + src/pshinter/pshmod.c + src/pshinter/pshrec.c + src/psnames/psmodule.c + src/raster/ftraster.c + src/raster/ftrend1.c + src/sfnt/sfdriver.c + src/sfnt/sfobjs.c + src/sfnt/ttbdf.c + src/sfnt/ttcmap.c + src/sfnt/ttkern.c + src/sfnt/ttload.c + src/sfnt/ttmtx.c + src/sfnt/ttpost.c + src/sfnt/ttsbit.c + src/smooth/ftgrays.c + src/smooth/ftsmooth.c + src/truetype/ttdriver.c + src/truetype/ttgload.c + src/truetype/ttinterp.c + src/truetype/ttobjs.c + src/truetype/ttpload.c src/truetype/truetype.c - src/type1/type1.c + src/type1/t1afm.c + src/type1/t1driver.c + src/type1/t1gload.c + src/type1/t1load.c + src/type1/t1objs.c + src/type1/t1parse.c + src/type42/t42drivr.c + src/type42/t42objs.c + src/type42/t42parse.c src/type42/type42.c src/winfonts/winfnt.c + src/cache/ftstrokedcache.c ) -if (WIN32) - set(BASE_SRCS ${BASE_SRCS} builds/windows/ftdebug.c) -elseif (WINCE) - set(BASE_SRCS ${BASE_SRCS} builds/wince/ftdebug.c) -else () - set(BASE_SRCS ${BASE_SRCS} src/base/ftdebug.c) -endif () - - -if (BUILD_FRAMEWORK) - set(BASE_SRCS - ${BASE_SRCS} - builds/mac/freetype-Info.plist - ) -endif () - - -add_library(freetype - ${PUBLIC_HEADERS} - ${PUBLIC_CONFIG_HEADERS} - ${PRIVATE_HEADERS} - ${BASE_SRCS} -) - - -if (BUILD_SHARED_LIBS) - set_target_properties(freetype PROPERTIES - VERSION ${PROJECT_VERSION} - SOVERSION ${SHARED_LIBRARY_VERSION} - COMPILE_DEFINITIONS freetype_EXPORTS - ) -endif () - - -if (BUILD_FRAMEWORK) - set_property(SOURCE ${PUBLIC_CONFIG_HEADERS} - PROPERTY MACOSX_PACKAGE_LOCATION Headers/config - ) - set_target_properties(freetype PROPERTIES - FRAMEWORK TRUE - MACOSX_FRAMEWORK_INFO_PLIST builds/mac/freetype-Info.plist - PUBLIC_HEADER "${PUBLIC_HEADERS}" - XCODE_ATTRIBUTE_INSTALL_PATH "@rpath" - ) -endif () - - -if (MSVC) - set_target_properties(freetype PROPERTIES - COMPILE_FLAGS /Fd"$(IntDir)$(TargetName).pdb") -endif () - - -if (ZLIB_FOUND) - target_link_libraries(freetype ${ZLIB_LIBRARIES}) - include_directories(${ZLIB_INCLUDE_DIRS}) -endif () -if (BZIP2_FOUND) - target_link_libraries(freetype ${BZIP2_LIBRARIES}) - include_directories(${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS -endif () -if (PNG_FOUND) - add_definitions(${PNG_DEFINITIONS}) - target_link_libraries(freetype ${PNG_LIBRARIES}) - include_directories(${PNG_INCLUDE_DIRS}) -endif () -if (HARFBUZZ_FOUND) - target_link_libraries(freetype ${HARFBUZZ_LIBRARIES}) - include_directories(${HARFBUZZ_INCLUDE_DIRS}) -endif () - - -# Installations -# Note the trailing slash in the argument to the `DIRECTORY' directive -install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ - DESTINATION include/freetype2 - PATTERN "internal" EXCLUDE - PATTERN "ftconfig.h" EXCLUDE - PATTERN "ftoption.h" EXCLUDE -) -install(FILES - ${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h - ${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h - DESTINATION include/freetype2/freetype/config -) -install(TARGETS freetype - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - FRAMEWORK DESTINATION Library/Frameworks -) - - -# Packaging -# CPack version numbers for release tarball name. -set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) -set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) -set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}}) -if (NOT DEFINED CPACK_PACKAGE_DESCRIPTION_SUMMARY) - set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${CMAKE_PROJECT_NAME}") -endif () -if (NOT DEFINED CPACK_SOURCE_PACKAGE_FILE_NAME) - set(CPACK_SOURCE_PACKAGE_FILE_NAME - "${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}-r${PROJECT_REV}" - CACHE INTERNAL "tarball basename" - ) -endif () -set(CPACK_SOURCE_GENERATOR TGZ) -set(CPACK_SOURCE_IGNORE_FILES - "/CVS/;/.svn/;.swp$;.#;/#;/build/;/serial/;/ser/;/parallel/;/par/;~;/preconfig.out;/autom4te.cache/;/.config") -set(CPACK_GENERATOR TGZ) -include(CPack) - - -# add make dist target -add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) - - -# eof +add_library(freetype ${SRC}) diff --git a/3party/fribidi/CMakeLists.txt b/3party/fribidi/CMakeLists.txt new file mode 100644 index 0000000000..3ec3f4bbd6 --- /dev/null +++ b/3party/fribidi/CMakeLists.txt @@ -0,0 +1,60 @@ +cmake_minimum_required(VERSION 3.2) + +project(fribidi C CXX) + +include_directories(lib ./) + +add_definitions(-DHAVE_CONFIG_H) + +add_compile_options( + "-Wall" +) + + +set( + SRC + config_android.h + config_ios.h + config_mac.h + config_tizen.h + config_win32.h + config.h + lib/bidi-types.h + lib/common.h + lib/debug.h + lib/fribidi-arabic.c + lib/fribidi-arabic.h + lib/fribidi-begindecls.h + lib/fribidi-bidi-types-list.h + lib/fribidi-bidi-types.c + lib/fribidi-bidi-types.h + lib/fribidi-bidi.c + lib/fribidi-bidi.h + lib/fribidi-common.h + lib/fribidi-config.h + lib/fribidi-deprecated.c + lib/fribidi-deprecated.h + lib/fribidi-enddecls.h + lib/fribidi-flags.h + lib/fribidi-joining-types-list.h + lib/fribidi-joining-types.c + lib/fribidi-joining-types.h + lib/fribidi-joining.c + lib/fribidi-joining.h + lib/fribidi-mem.c + lib/fribidi-mirroring.c + lib/fribidi-mirroring.h + lib/fribidi-run.c + lib/fribidi-shape.c + lib/fribidi-shape.h + lib/fribidi-types.h + lib/fribidi-unicode-version.h + lib/fribidi-unicode.h + lib/fribidi.c + lib/fribidi.h + lib/joining-types.h + lib/mem.h + lib/run.h +) + +add_library(fribidi ${SRC}) diff --git a/CMakeLists.txt b/CMakeLists.txt index 442c92d28a..07b4cdde4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,9 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) find_package(Threads) find_package(Qt5Core REQUIRED) -find_package(Qt5Network REQUIRED) find_package(Qt5Gui REQUIRED) +find_package(Qt5Network REQUIRED) +find_package(Qt5OpenGL REQUIRED) find_package(Qt5Widgets REQUIRED) if (APPLE) @@ -132,6 +133,7 @@ endmacro() add_subdirectory(3party/jansson) add_subdirectory(3party/minizip) add_subdirectory(3party/tomcrypt) +add_subdirectory(map) add_compile_options( "-Wall" diff --git a/map/CMakeLists.txt b/map/CMakeLists.txt new file mode 100644 index 0000000000..a610a5f254 --- /dev/null +++ b/map/CMakeLists.txt @@ -0,0 +1,68 @@ +include_directories( + ${OMIM_ROOT}/3party/protobuf/src + ${OMIM_ROOT}/3party/freetype/include + ${OMIM_ROOT}/3party/jansson/src + ${OMIM_ROOT}/3party/glm +) + +add_compile_options( + "-Wall" +) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + +set( + SRC + ../api/src/c/api-client.c + address_finder.cpp + api_mark_point.cpp + api_mark_point.hpp + booking_api.cpp + booking_api.hpp + bookmark_manager.cpp + bookmark_manager.hpp + bookmark.cpp + bookmark.hpp + chart_generator.cpp + chart_generator.hpp + displacement_mode_manager.cpp + displacement_mode_manager.hpp + feature_vec_model.cpp + feature_vec_model.hpp + framework.cpp + framework.hpp + ge0_parser.cpp + ge0_parser.hpp + geourl_process.cpp + geourl_process.hpp + gps_track_collection.cpp + gps_track_collection.hpp + gps_track_filter.cpp + gps_track_filter.hpp + gps_track_storage.cpp + gps_track_storage.hpp + gps_track.cpp + gps_track.hpp + gps_tracker.cpp + gps_tracker.hpp + mwm_url.cpp + mwm_url.hpp + place_page_info.cpp + place_page_info.hpp + track.cpp + track.hpp + user_mark_container.cpp + user_mark_container.hpp + user_mark.cpp + user_mark.hpp +) + +add_library(map ${SRC}) + +if (NOT PLATFORM_IPHONE AND NOT PLATFORM_ANDROID) + include_directories( + ${Qt5OpenGL_LIBRARIES} + ) +endif() + +omim_add_test_subdirectory(mwm_tests) diff --git a/map/mwm_tests/CMakeLists.txt b/map/mwm_tests/CMakeLists.txt new file mode 100644 index 0000000000..653ec2810e --- /dev/null +++ b/map/mwm_tests/CMakeLists.txt @@ -0,0 +1,49 @@ +add_compile_options( + "-Wall" + "-std=c++11" +) + +set( + SRC + multithread_mwm_test.cpp + mwm_foreach_test.cpp + mwm_index_test.cpp +) + +omim_add_test(mwm_tests ${SRC}) +omim_link_libraries( + mwm_tests + map + search + storage + indexer + editor + platform + geometry + coding + base + opening_hours + freetype + fribidi + expat + oauthcpp + protobuf + tomcrypt + jansson + succinct + pugixml + stats_client + ${Qt5Core_LIBRARIES} + ${Qt5OpenGL_LIBRARIES} + ${LIBZ} +) + +if (PLATFORM_MAC) + omim_link_libraries( + mwm_tests + "-framework Cocoa" + "-framework IOKit" + "-framework QuartzCore" + "-framework SystemConfiguration" + ) +endif() From 9e5fc56291a6b1cbcb118bf75302fa0069bedf72 Mon Sep 17 00:00:00 2001 From: Timofey Date: Wed, 9 Nov 2016 18:51:01 +0300 Subject: [PATCH 2/6] Added routing and routing tests. --- 3party/expat/CMakeLists.txt | 7 +-- 3party/freetype/CMakeLists.txt | 7 +-- 3party/fribidi/CMakeLists.txt | 7 +-- 3party/osrm/CMakeLists.txt | 29 +++++++++ CMakeLists.txt | 5 ++ map/CMakeLists.txt | 12 ++-- map/mwm_tests/CMakeLists.txt | 8 ++- routing/CMakeLists.txt | 93 ++++++++++++++++++++++++++++ routing/routing_tests/CMakeLists.txt | 61 ++++++++++++++++++ 9 files changed, 203 insertions(+), 26 deletions(-) create mode 100644 3party/osrm/CMakeLists.txt create mode 100644 routing/CMakeLists.txt create mode 100644 routing/routing_tests/CMakeLists.txt diff --git a/3party/expat/CMakeLists.txt b/3party/expat/CMakeLists.txt index 612a143c14..1f333580b3 100644 --- a/3party/expat/CMakeLists.txt +++ b/3party/expat/CMakeLists.txt @@ -1,6 +1,4 @@ -cmake_minimum_required(VERSION 3.2) - -project(expat C CXX) +project(expat) add_definitions(-DHAVE_MEMMOVE) @@ -8,7 +6,6 @@ add_compile_options( "-Wall" ) - set( SRC lib/ascii.h @@ -25,4 +22,4 @@ set( lib/xmltok.h ) -add_library(expat ${SRC}) +add_library(${PROJECT_NAME} ${SRC}) diff --git a/3party/freetype/CMakeLists.txt b/3party/freetype/CMakeLists.txt index 7dda4bbb34..c205922f18 100644 --- a/3party/freetype/CMakeLists.txt +++ b/3party/freetype/CMakeLists.txt @@ -1,6 +1,4 @@ -cmake_minimum_required(VERSION 3.2) - -project(freetype C CXX) +project(freetype) add_definitions(-DFT2_BUILD_LIBRARY) @@ -14,7 +12,6 @@ add_compile_options( include_directories(include) - set( SRC src/autofit/afangles.c @@ -129,4 +126,4 @@ set( src/cache/ftstrokedcache.c ) -add_library(freetype ${SRC}) +add_library(${PROJECT_NAME} ${SRC}) diff --git a/3party/fribidi/CMakeLists.txt b/3party/fribidi/CMakeLists.txt index 3ec3f4bbd6..0a6c797e6d 100644 --- a/3party/fribidi/CMakeLists.txt +++ b/3party/fribidi/CMakeLists.txt @@ -1,6 +1,4 @@ -cmake_minimum_required(VERSION 3.2) - -project(fribidi C CXX) +project(fribidi) include_directories(lib ./) @@ -10,7 +8,6 @@ add_compile_options( "-Wall" ) - set( SRC config_android.h @@ -57,4 +54,4 @@ set( lib/run.h ) -add_library(fribidi ${SRC}) +add_library(${PROJECT_NAME} ${SRC}) diff --git a/3party/osrm/CMakeLists.txt b/3party/osrm/CMakeLists.txt new file mode 100644 index 0000000000..8e34bd8e22 --- /dev/null +++ b/3party/osrm/CMakeLists.txt @@ -0,0 +1,29 @@ +project(osrm) + +add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY) +include_directories( + ${OMIM_ROOT}/3party/osrm/osrm-backend/include + ${OMIM_ROOT}/3party/osrm/osrm-backend/third_party +) + +set( + SRC + boost_stub.cpp + osrm-backend/data_structures/coordinate.cpp + osrm-backend/data_structures/coordinate_calculation.hpp + osrm-backend/data_structures/coordinate_calculation.cpp + osrm-backend/data_structures/search_engine_data.cpp + osrm-backend/data_structures/phantom_node.cpp + osrm-backend/util/mercator.cpp + osrm-backend/util/mercator.hpp +) + +# if (APPLE) +# target_compile_options(${PROJECT_NAME} PUBLIC "-fobjc-arc") +#endif() + +add_library(${PROJECT_NAME} ${SRC}) + +#omim_add_test_subdirectory(osrm_tests) +#omim_add_test(${project} ${SRC}) +# omim_link_libraries(osrm ...) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07b4cdde4f..9d515f6ecd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,6 +133,9 @@ endmacro() add_subdirectory(3party/jansson) add_subdirectory(3party/minizip) add_subdirectory(3party/tomcrypt) +add_subdirectory(3party/freetype) +add_subdirectory(3party/fribidi) +add_subdirectory(3party/expat) add_subdirectory(map) add_compile_options( @@ -144,6 +147,7 @@ add_subdirectory(3party/protobuf) add_subdirectory(3party/liboauthcpp) add_subdirectory(3party/pugixml) add_subdirectory(3party/succinct) +add_subdirectory(3party/osrm) add_subdirectory(base) add_subdirectory(coding) @@ -154,5 +158,6 @@ add_subdirectory(stats) add_subdirectory(storage) add_subdirectory(editor) add_subdirectory(indexer) +add_subdirectory(routing) add_subdirectory(search) add_subdirectory(tracking) diff --git a/map/CMakeLists.txt b/map/CMakeLists.txt index a610a5f254..fb14d486b3 100644 --- a/map/CMakeLists.txt +++ b/map/CMakeLists.txt @@ -1,3 +1,5 @@ +project(map) + include_directories( ${OMIM_ROOT}/3party/protobuf/src ${OMIM_ROOT}/3party/freetype/include @@ -5,11 +7,7 @@ include_directories( ${OMIM_ROOT}/3party/glm ) -add_compile_options( - "-Wall" -) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +append(CMAKE_CXX_FLAGS "-std=c++11") set( SRC @@ -17,8 +15,6 @@ set( address_finder.cpp api_mark_point.cpp api_mark_point.hpp - booking_api.cpp - booking_api.hpp bookmark_manager.cpp bookmark_manager.hpp bookmark.cpp @@ -57,7 +53,7 @@ set( user_mark.hpp ) -add_library(map ${SRC}) +add_library(${PROJECT_NAME} ${SRC}) if (NOT PLATFORM_IPHONE AND NOT PLATFORM_ANDROID) include_directories( diff --git a/map/mwm_tests/CMakeLists.txt b/map/mwm_tests/CMakeLists.txt index 653ec2810e..3a5148ad99 100644 --- a/map/mwm_tests/CMakeLists.txt +++ b/map/mwm_tests/CMakeLists.txt @@ -1,3 +1,5 @@ +project(mwm_tests) + add_compile_options( "-Wall" "-std=c++11" @@ -10,9 +12,9 @@ set( mwm_index_test.cpp ) -omim_add_test(mwm_tests ${SRC}) +omim_add_test(${PROJECT_NAME} ${SRC}) omim_link_libraries( - mwm_tests + ${PROJECT_NAME} map search storage @@ -40,7 +42,7 @@ omim_link_libraries( if (PLATFORM_MAC) omim_link_libraries( - mwm_tests + ${PROJECT_NAME} "-framework Cocoa" "-framework IOKit" "-framework QuartzCore" diff --git a/routing/CMakeLists.txt b/routing/CMakeLists.txt new file mode 100644 index 0000000000..9059685f8b --- /dev/null +++ b/routing/CMakeLists.txt @@ -0,0 +1,93 @@ +project(routing) + +include_directories( + . + ${OMIM_ROOT}/3party/jansson/src + ${OMIM_ROOT}/3party/osrm/osrm-backend/include + ${OMIM_ROOT}/3party/osrm/osrm-backend/third_party +) + +set( + SRC + async_router.cpp + async_router.hpp + base/astar_algorithm.hpp + base/followed_polyline.cpp + base/followed_polyline.hpp + bicycle_directions.cpp + bicycle_directions.hpp + bicycle_model.cpp + bicycle_model.hpp + car_model.cpp + car_model.hpp + car_router.cpp + car_router.hpp + cross_mwm_road_graph.cpp + cross_mwm_road_graph.hpp + cross_mwm_router.cpp + cross_mwm_router.hpp + cross_routing_context.cpp + cross_routing_context.hpp + directions_engine.cpp + directions_engine.hpp + features_road_graph.cpp + features_road_graph.hpp + loaded_path_segment.hpp + nearest_edge_finder.cpp + nearest_edge_finder.hpp + online_absent_fetcher.cpp + online_absent_fetcher.hpp + online_cross_fetcher.cpp + online_cross_fetcher.hpp + osrm_data_facade.hpp + osrm_engine.cpp + osrm_engine.hpp + osrm_helpers.cpp + osrm_helpers.hpp + osrm_path_segment_factory.cpp + osrm_path_segment_factory.hpp + osrm2feature_map.cpp + osrm2feature_map.hpp + pedestrian_directions.cpp + pedestrian_directions.hpp + pedestrian_model.cpp + pedestrian_model.hpp + road_graph_router.cpp + road_graph_router.hpp + road_graph.cpp + road_graph.hpp + route.cpp + route.hpp + router_delegate.cpp + router_delegate.hpp + router.cpp + router.hpp + routing_algorithm.cpp + routing_algorithm.hpp + routing_helpers.hpp + routing_mapping.cpp + routing_mapping.hpp + routing_result_graph.hpp + routing_session.cpp + routing_session.hpp + routing_settings.hpp + speed_camera.cpp + speed_camera.hpp + turn_candidate.hpp + turns_generator.cpp + turns_generator.hpp + turns_notification_manager.cpp + turns_notification_manager.hpp + turns_sound_settings.cpp + turns_sound_settings.hpp + turns_tts_text.cpp + turns_tts_text.hpp + turns.cpp + turns.hpp + vehicle_model.cpp + vehicle_model.hpp +) + +add_library(${PROJECT_NAME} ${SRC}) +omim_add_test_subdirectory(routing_tests) + diff --git a/routing/routing_tests/CMakeLists.txt b/routing/routing_tests/CMakeLists.txt new file mode 100644 index 0000000000..e7e57decbe --- /dev/null +++ b/routing/routing_tests/CMakeLists.txt @@ -0,0 +1,61 @@ +project(routing_tests) + +include_directories(${OMIM_ROOT}/3party/osrm/osrm-backend/include) + +set( + SRC + astar_algorithm_test.cpp + astar_progress_test.cpp + astar_router_test.cpp + async_router_test.cpp + cross_routing_tests.cpp + followed_polyline_test.cpp + nearest_edge_finder_tests.cpp + online_cross_fetcher_test.cpp + osrm_router_test.cpp + road_graph_builder.cpp + road_graph_builder.hpp + road_graph_nearest_edges_test.cpp + route_tests.cpp + routing_mapping_test.cpp + routing_session_test.cpp + turns_generator_test.cpp + turns_sound_test.cpp + turns_tts_text_tests.cpp + vehicle_model_test.cpp +) + +omim_add_test(${PROJECT_NAME} ${SRC}) +omim_link_libraries( + ${PROJECT_NAME} + routing + indexer + platform_tests_support + oauthcpp + platform + editor + geometry + coding + base + osrm + protobuf + tomcrypt + succinct + opening_hours + jansson + stats_client + map + pugixml + stats_client + ${Qt5Core_LIBRARIES} + ${LIBZ} +) + +if (PLATFORM_MAC) + omim_link_libraries( + ${PROJECT_NAME} + "-framework Cocoa" + "-framework IOKit" + "-framework SystemConfiguration" + ) +endif() \ No newline at end of file From 61d10c1df1c1b2538da226312f8bb964efe73203 Mon Sep 17 00:00:00 2001 From: Timofey Date: Wed, 9 Nov 2016 20:08:10 +0300 Subject: [PATCH 3/6] Added routing_integration_tests --- routing/CMakeLists.txt | 2 + .../routing_integration_tests/CMakeLists.txt | 63 +++++++++++++++++++ routing/routing_tests/CMakeLists.txt | 4 +- 3 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 routing/routing_integration_tests/CMakeLists.txt diff --git a/routing/CMakeLists.txt b/routing/CMakeLists.txt index 9059685f8b..c6aba963bb 100644 --- a/routing/CMakeLists.txt +++ b/routing/CMakeLists.txt @@ -90,4 +90,6 @@ set( add_library(${PROJECT_NAME} ${SRC}) omim_add_test_subdirectory(routing_tests) +omim_add_test_subdirectory(routing_integration_tests) + diff --git a/routing/routing_integration_tests/CMakeLists.txt b/routing/routing_integration_tests/CMakeLists.txt new file mode 100644 index 0000000000..6d1e4eaa7d --- /dev/null +++ b/routing/routing_integration_tests/CMakeLists.txt @@ -0,0 +1,63 @@ +# This subproject implements integration tests. +# This tests are launched on the whole world dataset. + +# It is recommended to place tests here in the following cases: +# - tests are written to be launch on the whole world dataset; +# - tests covers significant number of subsystems; + +project(routing_integration_tests) + +set( + SRC + bicycle_route_test.cpp + bicycle_turn_test.cpp + cross_section_tests.cpp + get_altitude_test.cpp + online_cross_tests.cpp + osrm_route_test.cpp + osrm_street_names_test.cpp + osrm_turn_test.cpp + pedestrian_route_test.cpp + routing_test_tools.cpp + 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 + routing + search + storage + indexer + editor + platform + oauthcpp + geometry + coding + base + osrm + jansson + protobuf + tomcrypt + succinct + stats_client + pugixml + opening_hours + ${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 e7e57decbe..d92a3e17eb 100644 --- a/routing/routing_tests/CMakeLists.txt +++ b/routing/routing_tests/CMakeLists.txt @@ -31,9 +31,9 @@ omim_link_libraries( routing indexer platform_tests_support - oauthcpp - platform editor + platform + oauthcpp geometry coding base From e054c0170fc80465a2cebc41117745c8685801a9 Mon Sep 17 00:00:00 2001 From: Timofey Date: Thu, 10 Nov 2016 18:54:05 +0300 Subject: [PATCH 4/6] Added drape and drape_tests --- 3party/freetype/CMakeLists.txt | 1 + 3party/gmock/CMakeLists.txt | 39 +++++ CMakeLists.txt | 8 +- drape/CMakeLists.txt | 194 +++++++++++++++++++++++++ drape/drape_tests/CMakeLists.txt | 77 ++++++++++ platform/platform_tests/CMakeLists.txt | 1 - qt_tstfrm/CMakeLists.txt | 9 ++ 7 files changed, 323 insertions(+), 6 deletions(-) create mode 100644 3party/gmock/CMakeLists.txt create mode 100644 drape/CMakeLists.txt create mode 100644 drape/drape_tests/CMakeLists.txt create mode 100644 qt_tstfrm/CMakeLists.txt diff --git a/3party/freetype/CMakeLists.txt b/3party/freetype/CMakeLists.txt index c205922f18..e803f1a275 100644 --- a/3party/freetype/CMakeLists.txt +++ b/3party/freetype/CMakeLists.txt @@ -112,6 +112,7 @@ set( src/truetype/ttobjs.c src/truetype/ttpload.c src/truetype/truetype.c + src/truetype/ttgxvar.c src/type1/t1afm.c src/type1/t1driver.c src/type1/t1gload.c diff --git a/3party/gmock/CMakeLists.txt b/3party/gmock/CMakeLists.txt new file mode 100644 index 0000000000..00660b1b66 --- /dev/null +++ b/3party/gmock/CMakeLists.txt @@ -0,0 +1,39 @@ +project(gmock) + +include_directories(. gtest gtest/include include) + +set( + SRC + gtest/src/gtest-all.cc + gtest/src/gtest-death-test.cc + gtest/src/gtest-filepath.cc + gtest/src/gtest-internal-inl.h + gtest/src/gtest-port.cc + gtest/src/gtest-printers.cc + gtest/src/gtest-test-part.cc + gtest/src/gtest-typed-test.cc + gtest/src/gtest.cc + include/gmock/gmock-actions.h + include/gmock/gmock-cardinalities.h + include/gmock/gmock-generated-actions.h + include/gmock/gmock-generated-function-mockers.h + include/gmock/gmock-generated-matchers.h + include/gmock/gmock-generated-nice-strict.h + include/gmock/gmock-matchers.h + include/gmock/gmock-more-actions.h + include/gmock/gmock-more-matchers.h + include/gmock/gmock-spec-builders.h + include/gmock/gmock.h + include/gmock/internal/gmock-generated-internal-utils.h + include/gmock/internal/gmock-internal-utils.h + include/gmock/internal/gmock-port.h + src/gmock-all.cc + src/gmock-cardinalities.cc + src/gmock-internal-utils.cc + src/gmock-matchers.cc + src/gmock-spec-builders.cc + src/gmock.cc + src/gmock_main.cc +) + +add_library(${PROJECT_NAME} ${SRC}) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d515f6ecd..c315ce2cf5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,10 +14,6 @@ find_package(Qt5Network REQUIRED) find_package(Qt5OpenGL REQUIRED) find_package(Qt5Widgets REQUIRED) -if (APPLE) - find_library(APL_SYSCON SystemConfiguration) -endif() - find_library(LIBZ NAMES z) if (LIBZ STREQUAL "LIBZ-NOTFOUND") message(FATAL_ERROR "Failed to find libz library.") @@ -137,6 +133,7 @@ add_subdirectory(3party/freetype) add_subdirectory(3party/fribidi) add_subdirectory(3party/expat) add_subdirectory(map) +add_subdirectory(drape) add_compile_options( "-Wall" @@ -148,7 +145,8 @@ add_subdirectory(3party/liboauthcpp) add_subdirectory(3party/pugixml) add_subdirectory(3party/succinct) add_subdirectory(3party/osrm) - +add_subdirectory(3party/gmock) +add_subdirectory(qt_tstfrm) add_subdirectory(base) add_subdirectory(coding) add_subdirectory(geometry) diff --git a/drape/CMakeLists.txt b/drape/CMakeLists.txt new file mode 100644 index 0000000000..cb9138cf9a --- /dev/null +++ b/drape/CMakeLists.txt @@ -0,0 +1,194 @@ +project(drape) + +get_filename_component(DRAPE_ROOT ${PROJECT_SOURCE_DIR} ABSOLUTE) + +execute_process( + COMMAND python ${OMIM_ROOT}/tools/autobuild/shader_preprocessor.py + ${DRAPE_ROOT}/shaders + shader_index.txt + shader_def +) + +include_directories( + ${OMIM_ROOT}/3party/freetype/include + ${OMIM_ROOT}/3party/glm +) + +append(CMAKE_CXX_FLAGS "-std=c++11 ") + +set( + DRAPE_COMMON_SRC + ${DRAPE_ROOT}/attribute_buffer_mutator.cpp + ${DRAPE_ROOT}/attribute_buffer_mutator.hpp + ${DRAPE_ROOT}/attribute_provider.cpp + ${DRAPE_ROOT}/attribute_provider.hpp + ${DRAPE_ROOT}/batcher.cpp + ${DRAPE_ROOT}/batcher.hpp + ${DRAPE_ROOT}/batcher_helpers.cpp + ${DRAPE_ROOT}/batcher_helpers.hpp + ${DRAPE_ROOT}/binding_info.cpp + ${DRAPE_ROOT}/binding_info.hpp + ${DRAPE_ROOT}/buffer_base.cpp + ${DRAPE_ROOT}/buffer_base.hpp + ${DRAPE_ROOT}/color.cpp + ${DRAPE_ROOT}/color.hpp + ${DRAPE_ROOT}/constants.hpp + ${DRAPE_ROOT}/cpu_buffer.cpp + ${DRAPE_ROOT}/cpu_buffer.hpp + ${DRAPE_ROOT}/data_buffer.cpp + ${DRAPE_ROOT}/data_buffer.hpp + ${DRAPE_ROOT}/data_buffer_impl.hpp + ${DRAPE_ROOT}/debug_rect_renderer.cpp + ${DRAPE_ROOT}/debug_rect_renderer.hpp + ${DRAPE_ROOT}/drape_global.hpp + ${DRAPE_ROOT}/dynamic_texture.hpp + ${DRAPE_ROOT}/font_texture.cpp + ${DRAPE_ROOT}/font_texture.hpp + ${DRAPE_ROOT}/fribidi.cpp + ${DRAPE_ROOT}/fribidi.hpp + ${DRAPE_ROOT}/glconstants.cpp + ${DRAPE_ROOT}/glconstants.hpp + ${DRAPE_ROOT}/glextensions_list.cpp + ${DRAPE_ROOT}/glextensions_list.hpp + ${DRAPE_ROOT}/glfunctions.hpp + ${DRAPE_ROOT}/glIncludes.hpp + ${DRAPE_ROOT}/glsl_func.hpp + ${DRAPE_ROOT}/glsl_types.hpp + ${DRAPE_ROOT}/glstate.cpp + ${DRAPE_ROOT}/glstate.hpp + ${DRAPE_ROOT}/glyph_manager.cpp + ${DRAPE_ROOT}/glyph_manager.hpp + ${DRAPE_ROOT}/gpu_buffer.cpp + ${DRAPE_ROOT}/gpu_buffer.hpp + ${DRAPE_ROOT}/gpu_program.cpp + ${DRAPE_ROOT}/gpu_program.hpp + ${DRAPE_ROOT}/gpu_program_manager.cpp + ${DRAPE_ROOT}/gpu_program_manager.hpp + ${DRAPE_ROOT}/hw_texture.cpp + ${DRAPE_ROOT}/hw_texture.hpp + ${DRAPE_ROOT}/index_buffer.cpp + ${DRAPE_ROOT}/index_buffer.hpp + ${DRAPE_ROOT}/index_buffer_mutator.cpp + ${DRAPE_ROOT}/index_buffer_mutator.hpp + ${DRAPE_ROOT}/index_storage.cpp + ${DRAPE_ROOT}/index_storage.hpp + ${DRAPE_ROOT}/object_pool.hpp + ${DRAPE_ROOT}/oglcontext.hpp + ${DRAPE_ROOT}/oglcontextfactory.cpp + ${DRAPE_ROOT}/oglcontextfactory.hpp + ${DRAPE_ROOT}/overlay_handle.cpp + ${DRAPE_ROOT}/overlay_handle.hpp + ${DRAPE_ROOT}/overlay_tree.cpp + ${DRAPE_ROOT}/overlay_tree.hpp + ${DRAPE_ROOT}/pointers.cpp + ${DRAPE_ROOT}/pointers.hpp + ${DRAPE_ROOT}/render_bucket.cpp + ${DRAPE_ROOT}/render_bucket.hpp + ${DRAPE_ROOT}/shader.cpp + ${DRAPE_ROOT}/shader.hpp + ${DRAPE_ROOT}/shader_def.cpp + ${DRAPE_ROOT}/shader_def.hpp + ${DRAPE_ROOT}/static_texture.cpp + ${DRAPE_ROOT}/static_texture.hpp + ${DRAPE_ROOT}/stipple_pen_resource.cpp + ${DRAPE_ROOT}/stipple_pen_resource.hpp + ${DRAPE_ROOT}/support_manager.cpp + ${DRAPE_ROOT}/support_manager.hpp + ${DRAPE_ROOT}/symbols_texture.cpp + ${DRAPE_ROOT}/symbols_texture.hpp + ${DRAPE_ROOT}/texture.cpp + ${DRAPE_ROOT}/texture.hpp + ${DRAPE_ROOT}/texture_manager.cpp + ${DRAPE_ROOT}/texture_manager.hpp + ${DRAPE_ROOT}/texture_of_colors.cpp + ${DRAPE_ROOT}/texture_of_colors.hpp + ${DRAPE_ROOT}/uniform_value.cpp + ${DRAPE_ROOT}/uniform_value.hpp + ${DRAPE_ROOT}/uniform_values_storage.cpp + ${DRAPE_ROOT}/uniform_values_storage.hpp + ${DRAPE_ROOT}/utils/glyph_usage_tracker.cpp + ${DRAPE_ROOT}/utils/glyph_usage_tracker.hpp + ${DRAPE_ROOT}/utils/gpu_mem_tracker.cpp + ${DRAPE_ROOT}/utils/gpu_mem_tracker.hpp + ${DRAPE_ROOT}/utils/projection.cpp + ${DRAPE_ROOT}/utils/projection.hpp + ${DRAPE_ROOT}/utils/vertex_decl.cpp + ${DRAPE_ROOT}/utils/vertex_decl.hpp + ${DRAPE_ROOT}/vertex_array_buffer.cpp + ${DRAPE_ROOT}/vertex_array_buffer.hpp + ${DRAPE_ROOT}/visual_scale.hpp + + ${OMIM_ROOT}/3party/sdf_image/sdf_image.cpp + ${OMIM_ROOT}/3party/sdf_image/sdf_image.h + ${OMIM_ROOT}/3party/stb_image/stb_image.c + ${OMIM_ROOT}/3party/stb_image/stb_image.h +) + +set( + SRC + glfunctions.cpp +) + +if (PLATFORM_IOS) + append( + SRC + hw_texture_ios.hpp + hw_texture_ios.mm + ) +endif() + +set( #might not need this declaration + OTHER_FILES + shaders/area3d_outline_vertex_shader.vsh + shaders/area3d_vertex_shader.vsh + shaders/area_vertex_shader.vsh + shaders/arrow3d_fragment_shader.fsh + shaders/arrow3d_shadow_fragment_shader.fsh + shaders/arrow3d_shadow_vertex_shader.vsh + shaders/arrow3d_vertex_shader.vsh + shaders/circle_shader.fsh + shaders/circle_shader.vsh + shaders/compass_vertex_shader.vsh + shaders/dashed_fragment_shader.fsh + shaders/dashed_vertex_shader.vsh + shaders/debug_rect_fragment_shader.fsh + shaders/debug_rect_vertex_shader.vsh + shaders/line_fragment_shader.fsh + shaders/line_vertex_shader.vsh + shaders/masked_texturing_billboard_vertex_shader.vsh + shaders/masked_texturing_fragment_shader.fsh + shaders/masked_texturing_vertex_shader.vsh + shaders/my_position_shader.vsh + shaders/path_symbol_vertex_shader.vsh + shaders/position_accuracy3d_shader.vsh + shaders/route_arrow_vertex_shader.vsh + shaders/route_dash_fragment_shader.fsh + shaders/route_fragment_shader.fsh + shaders/route_vertex_shader.vsh + shaders/ruler_vertex_shader.vsh + shaders/shader_index.txt + shaders/solid_color_fragment_shader.fsh + shaders/text_billboard_vertex_shader.vsh + shaders/text_fragment_shader.fsh + shaders/text_outlined_billboard_vertex_shader.vsh + shaders/text_outlined_gui_vertex_shader.vsh + shaders/text_outlined_vertex_shader.vsh + shaders/text_vertex_shader.vsh + shaders/texturing3d_fragment_shader.fsh + shaders/texturing3d_vertex_shader.vsh + shaders/texturing_billboard_vertex_shader.vsh + shaders/texturing_fragment_shader.fsh + shaders/texturing_vertex_shader.vsh + shaders/trackpoint_fragment_shader.fsh + shaders/trackpoint_vertex_shader.vsh + shaders/traffic_fragment_shader.fsh + shaders/traffic_vertex_shader.vsh + shaders/transparent_layer_fragment_shader.fsh + shaders/transparent_layer_vertex_shader.vsh + shaders/user_mark.vsh + shaders/user_mark_billboard.vsh +) + +add_library(${PROJECT_NAME} ${DRAPE_COMMON_SRC} ${SRC}) + +omim_add_test_subdirectory(drape_tests) diff --git a/drape/drape_tests/CMakeLists.txt b/drape/drape_tests/CMakeLists.txt new file mode 100644 index 0000000000..d4cdf981da --- /dev/null +++ b/drape/drape_tests/CMakeLists.txt @@ -0,0 +1,77 @@ +project(drape_tests) + +execute_process( + COMMAND python ${OMIM_ROOT}/tools/autobuild/shader_preprocessor.py + ${DRAPE_ROOT}/shaders + shader_index.txt + shader_def +) + +add_definitions( + -DOGL_TEST_ENABLED + -DGTEST_DONT_DEFINE_TEST + -DCOMPILER_TESTS +) + +include_directories( + ${OMIM_ROOT}/3party/gmock/include + ${OMIM_ROOT}/3party/gmock/gtest/include + ${OMIM_ROOT}/3party/freetype/include +) + +set( + SRC + attribute_provides_tests.cpp + batcher_tests.cpp + bingind_info_tests.cpp + buffer_tests.cpp + compile_shaders_test.cpp + dummy_texture.hpp + failure_reporter.cpp + font_texture_tests.cpp + fribidi_tests.cpp + glfunctions.cpp + glmock_functions.cpp + glmock_functions.hpp + glyph_mng_tests.cpp + glyph_packer_test.cpp + img.cpp + img.hpp + memory_comparer.hpp + pointers_tests.cpp + stipple_pen_tests.cpp + texture_of_colors_tests.cpp + uniform_value_tests.cpp +) + +omim_add_test(${PROJECT_NAME} ${DRAPE_COMMON_SRC} ${SRC}) + +omim_link_libraries( + ${PROJECT_NAME} + qt_tstfrm + indexer + platform + coding + geometry + base + fribidi + expat + tomcrypt + stats_client + freetype + gmock + ${Qt5Core_LIBRARIES} + ${Qt5Gui_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ${LIBZ} +) + +if (PLATFORM_MAC) + omim_link_libraries( + ${PROJECT_NAME} + "-framework IOKit" + "-framework Cocoa" + "-framework CoreLocation" + "-framework SystemConfiguration" + ) +endif() diff --git a/platform/platform_tests/CMakeLists.txt b/platform/platform_tests/CMakeLists.txt index ae6e11d933..5ffd0ca67b 100644 --- a/platform/platform_tests/CMakeLists.txt +++ b/platform/platform_tests/CMakeLists.txt @@ -1,7 +1,6 @@ project(platform_tests) add_definitions(-DOMIM_UNIT_TEST_WITH_QT_EVENT_LOOP) -include_directories(${APL_SYSCON}) set( SRC diff --git a/qt_tstfrm/CMakeLists.txt b/qt_tstfrm/CMakeLists.txt new file mode 100644 index 0000000000..ef4f591acc --- /dev/null +++ b/qt_tstfrm/CMakeLists.txt @@ -0,0 +1,9 @@ +project(qt_tstfrm) + +set( + SRC + test_main_loop.hpp + test_main_loop.cpp +) + +add_library(${PROJECT_NAME} ${SRC}) From ee44a8a940ddd5deb587b6db483c4dedfeb6659e Mon Sep 17 00:00:00 2001 From: Timofey Date: Fri, 11 Nov 2016 15:43:41 +0300 Subject: [PATCH 5/6] Compiles now. --- 3party/freetype/CMakeLists.txt | 25 ++++++---------- drape/CMakeLists.txt | 52 ---------------------------------- 2 files changed, 8 insertions(+), 69 deletions(-) diff --git a/3party/freetype/CMakeLists.txt b/3party/freetype/CMakeLists.txt index e803f1a275..15a4c05e3c 100644 --- a/3party/freetype/CMakeLists.txt +++ b/3party/freetype/CMakeLists.txt @@ -51,26 +51,27 @@ set( src/cache/ftcmanag.c src/cache/ftcmru.c src/cache/ftcsbits.c - src/cff/cf2ft.c - src/cff/cf2font.c - src/cff/cf2blues.c - src/cff/cf2intrp.c - src/cff/cf2stack.c + src/cache/ftstrokedcache.c src/cff/cf2arrst.c - src/cff/cf2hints.c + src/cff/cf2blues.c src/cff/cf2error.c + src/cff/cf2font.c + src/cff/cf2ft.c + src/cff/cf2hints.c + src/cff/cf2intrp.c src/cff/cf2read.c + src/cff/cf2stack.c src/cff/cffcmap.c src/cff/cffdrivr.c src/cff/cffgload.c src/cff/cffload.c src/cff/cffobjs.c src/cff/cffparse.c - src/cid/cidriver.c src/cid/cidgload.c src/cid/cidload.c src/cid/cidobjs.c src/cid/cidparse.c + src/cid/cidriver.c src/gzip/ftgzip.c src/lzw/ftlzw.c src/pcf/pcfdrivr.c @@ -106,25 +107,15 @@ set( src/sfnt/ttsbit.c src/smooth/ftgrays.c src/smooth/ftsmooth.c - src/truetype/ttdriver.c - src/truetype/ttgload.c - src/truetype/ttinterp.c - src/truetype/ttobjs.c - src/truetype/ttpload.c src/truetype/truetype.c - src/truetype/ttgxvar.c src/type1/t1afm.c src/type1/t1driver.c src/type1/t1gload.c src/type1/t1load.c src/type1/t1objs.c src/type1/t1parse.c - src/type42/t42drivr.c - src/type42/t42objs.c - src/type42/t42parse.c src/type42/type42.c src/winfonts/winfnt.c - src/cache/ftstrokedcache.c ) add_library(${PROJECT_NAME} ${SRC}) diff --git a/drape/CMakeLists.txt b/drape/CMakeLists.txt index cb9138cf9a..9ed1b04d18 100644 --- a/drape/CMakeLists.txt +++ b/drape/CMakeLists.txt @@ -137,58 +137,6 @@ if (PLATFORM_IOS) ) endif() -set( #might not need this declaration - OTHER_FILES - shaders/area3d_outline_vertex_shader.vsh - shaders/area3d_vertex_shader.vsh - shaders/area_vertex_shader.vsh - shaders/arrow3d_fragment_shader.fsh - shaders/arrow3d_shadow_fragment_shader.fsh - shaders/arrow3d_shadow_vertex_shader.vsh - shaders/arrow3d_vertex_shader.vsh - shaders/circle_shader.fsh - shaders/circle_shader.vsh - shaders/compass_vertex_shader.vsh - shaders/dashed_fragment_shader.fsh - shaders/dashed_vertex_shader.vsh - shaders/debug_rect_fragment_shader.fsh - shaders/debug_rect_vertex_shader.vsh - shaders/line_fragment_shader.fsh - shaders/line_vertex_shader.vsh - shaders/masked_texturing_billboard_vertex_shader.vsh - shaders/masked_texturing_fragment_shader.fsh - shaders/masked_texturing_vertex_shader.vsh - shaders/my_position_shader.vsh - shaders/path_symbol_vertex_shader.vsh - shaders/position_accuracy3d_shader.vsh - shaders/route_arrow_vertex_shader.vsh - shaders/route_dash_fragment_shader.fsh - shaders/route_fragment_shader.fsh - shaders/route_vertex_shader.vsh - shaders/ruler_vertex_shader.vsh - shaders/shader_index.txt - shaders/solid_color_fragment_shader.fsh - shaders/text_billboard_vertex_shader.vsh - shaders/text_fragment_shader.fsh - shaders/text_outlined_billboard_vertex_shader.vsh - shaders/text_outlined_gui_vertex_shader.vsh - shaders/text_outlined_vertex_shader.vsh - shaders/text_vertex_shader.vsh - shaders/texturing3d_fragment_shader.fsh - shaders/texturing3d_vertex_shader.vsh - shaders/texturing_billboard_vertex_shader.vsh - shaders/texturing_fragment_shader.fsh - shaders/texturing_vertex_shader.vsh - shaders/trackpoint_fragment_shader.fsh - shaders/trackpoint_vertex_shader.vsh - shaders/traffic_fragment_shader.fsh - shaders/traffic_vertex_shader.vsh - shaders/transparent_layer_fragment_shader.fsh - shaders/transparent_layer_vertex_shader.vsh - shaders/user_mark.vsh - shaders/user_mark_billboard.vsh -) - add_library(${PROJECT_NAME} ${DRAPE_COMMON_SRC} ${SRC}) omim_add_test_subdirectory(drape_tests) From 2af6d87d5c492ab15ea4f936d8363e30a1ae79be Mon Sep 17 00:00:00 2001 From: Timofey Date: Mon, 14 Nov 2016 15:40:07 +0300 Subject: [PATCH 6/6] Fixed drape tests. --- drape/drape_tests/CMakeLists.txt | 3 +- tools/unix/cmake_omim.sh | 109 +++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100755 tools/unix/cmake_omim.sh diff --git a/drape/drape_tests/CMakeLists.txt b/drape/drape_tests/CMakeLists.txt index d4cdf981da..a0cb547e85 100644 --- a/drape/drape_tests/CMakeLists.txt +++ b/drape/drape_tests/CMakeLists.txt @@ -41,10 +41,11 @@ set( pointers_tests.cpp stipple_pen_tests.cpp texture_of_colors_tests.cpp + testingmain.cpp uniform_value_tests.cpp ) -omim_add_test(${PROJECT_NAME} ${DRAPE_COMMON_SRC} ${SRC}) +add_executable(${PROJECT_NAME} ${DRAPE_COMMON_SRC} ${SRC}) omim_link_libraries( ${PROJECT_NAME} diff --git a/tools/unix/cmake_omim.sh b/tools/unix/cmake_omim.sh new file mode 100755 index 0000000000..8010aa510d --- /dev/null +++ b/tools/unix/cmake_omim.sh @@ -0,0 +1,109 @@ +#!/usr/bin/env bash + +set -u -e -x + +OPT_DEBUG= +OPT_RELEASE=1 +OPT_OSRM= +OPT_CLEAN= +VERBOSE= +while getopts ":cdrov" opt; do + case $opt in + d) + OPT_DEBUG=1 + OPT_RELEASE= + ;; + r) + OPT_RELEASE=1 + ;; + o) +# OPT_OSRM=1 + echo "OSRM build is not supported yet, try again later" + exit 1 + ;; + c) + OPT_CLEAN=1 + ;; + v) + VERBOSE=1 + ;; + *) + echo "This tool builds omim and osrm-backend." + echo "Usage: $0 [-d] [-r] [-o] [-c]" + echo + echo -e "-d\tBuild omim-debug" + echo -e "-r\tBuild omim-release" + echo -e "-o\tBuild osrm-backend" + echo -e "-c\tClean before building" + echo + echo "By default release is built. Specify TARGET and OSRM_TARGET if needed." + exit 1 + ;; + + esac +done + +OMIM_PATH="$(cd "${OMIM_PATH:-$(dirname "$0")/../..}"; pwd)" + +check_private_h() +{ + if ! grep "DEFAULT_URLS_JSON" "$OMIM_PATH/private.h" >/dev/null 2>/dev/null; then + echo "Please run $OMIM_PATH/configure.sh" + exit 2 + fi +} + +set_platform_dependent_options() +{ + if [ "$(uname -s)" == "Darwin" ]; then + PROCESSES=$(sysctl -n hw.ncpu) + else + PROCESSES=$(nproc) + export CC=clang + export CXX=clang++ + fi +} + +build_conf() +{ + CONF=$1 + POSTFIX=$(echo "${CONF}" | tr '[:upper:]' '[:lower:]') + echo $POSTFIX + DIRNAME="${TARGET:-$OMIM_PATH/../omim-build-$POSTFIX}" + [ -d "$DIRNAME" -a -n "$OPT_CLEAN" ] && rm -r "$DIRNAME" + + if [ ! -d "$DIRNAME" ]; then + mkdir -p "$DIRNAME" + ln -s "$OMIM_PATH/data" "$DIRNAME/data" + fi + + TARGET="$DIRNAME/out/$POSTFIX" + mkdir -p $TARGET + + cd "$TARGET" + cmake "$OMIM_PATH" -DCMAKE_BUILD_TYPE=$CONF + if [ $VERBOSE ]; then + make -j $PROCESSES VERBOSE=1 + else + make -j $PROCESSES + fi +} + +get_os_dependent_option() #(for_mac_os, for_linux) +{ + if [ "$(uname -s)" == "Darwin" ]; then + return $($1) + else + return $($2) + fi + +} + +check_private_h +set_platform_dependent_options +echo $PROCESSES + +[ -n "$OPT_DEBUG" ] && build_conf Debug +[ -n "$OPT_RELEASE" ] && build_conf Release + +exit 0