11767c5feSopenharmony_ci C++ version of the libphonenumber project 21767c5feSopenharmony_ci ========================================= 31767c5feSopenharmony_ci 41767c5feSopenharmony_ciThis library is a port of the Java version. 51767c5feSopenharmony_ci 61767c5feSopenharmony_ciThis project uses some third-party code: 71767c5feSopenharmony_ci - src/phonenumbers/utf/ sources come from lib9 which is also used in Go. 81767c5feSopenharmony_ci 91767c5feSopenharmony_ci 101767c5feSopenharmony_ciInstalling the library on GNU/Linux 111767c5feSopenharmony_ci----------------------------------- 121767c5feSopenharmony_ciIn recent Debian-based distributions you may be able to simply install the 131767c5feSopenharmony_cilibphonenumber library directly. 141767c5feSopenharmony_ci 151767c5feSopenharmony_ciInstalling the binary packages: 161767c5feSopenharmony_ci - Use this if you just need to use or link against the library: 171767c5feSopenharmony_ci $ sudo apt-get install libphonenumber8 libphonenumber-dev 181767c5feSopenharmony_ci 191767c5feSopenharmony_ciInstalling the source package: 201767c5feSopenharmony_ci - Use this if you wish to develop or debug the library: 211767c5feSopenharmony_ci $ sudo apt-get source libphonenumber 221767c5feSopenharmony_ci 231767c5feSopenharmony_ciThe latest packages can be found on the Debian packages site: 241767c5feSopenharmony_ci https://packages.debian.org/search?searchon=names&keywords=libphonenumber 251767c5feSopenharmony_ci 261767c5feSopenharmony_ci 271767c5feSopenharmony_ciManually installing the library on GNU/Linux 281767c5feSopenharmony_ci-------------------------------------------- 291767c5feSopenharmony_ciYou should only need these instructions if the above instructions do not work. 301767c5feSopenharmony_ci 311767c5feSopenharmony_ciThe example command lines below assume that you have a Debian-based GNU/Linux 321767c5feSopenharmony_cidistribution. Other distributions and packaging systems will differ. 331767c5feSopenharmony_ci 341767c5feSopenharmony_ciQuickstart: 351767c5feSopenharmony_ci - In recent Debian-based distributions, it should be sufficient to run: 361767c5feSopenharmony_ci $ sudo apt-get install \ 371767c5feSopenharmony_ci cmake cmake-curses-gui libprotobuf-dev libgtest-dev libre2-dev \ 381767c5feSopenharmony_ci libicu-dev libboost-dev libboost-thread-dev libboost-system-dev \ 391767c5feSopenharmony_ci protobuf-compiler 401767c5feSopenharmony_ci 411767c5feSopenharmony_ciIf any of these packages fails to install correctly, follow the instructions 421767c5feSopenharmony_ciin the appropriate section below. 431767c5feSopenharmony_ci 441767c5feSopenharmony_ciRequirements: 451767c5feSopenharmony_ci - CMake build system 461767c5feSopenharmony_ci http://www.cmake.org 471767c5feSopenharmony_ci 481767c5feSopenharmony_ci Installation: 491767c5feSopenharmony_ci $ sudo apt-get install cmake 501767c5feSopenharmony_ci 511767c5feSopenharmony_ci Additionally it is recommended you install the ccmake configuration tool: 521767c5feSopenharmony_ci $ sudo apt-get install cmake-curses-gui 531767c5feSopenharmony_ci 541767c5feSopenharmony_ci - Protocol Buffers 551767c5feSopenharmony_ci http://github.com/google/protobuf/ 561767c5feSopenharmony_ci Version 3.6.1 or more recent is required (this is available by default for 571767c5feSopenharmony_ci recent Debian-based GNU/Linux distributions). 581767c5feSopenharmony_ci 591767c5feSopenharmony_ci You can check which version is available: 601767c5feSopenharmony_ci $ apt-cache show libprotobuf-dev 611767c5feSopenharmony_ci Package: libprotobuf-dev 621767c5feSopenharmony_ci Source: protobuf 631767c5feSopenharmony_ci Version: 3.6.1-9ubuntu1 <-- This must be >= 3.6.1 641767c5feSopenharmony_ci ... 651767c5feSopenharmony_ci 661767c5feSopenharmony_ci Installation: 671767c5feSopenharmony_ci $ sudo apt-get install libprotobuf-dev 681767c5feSopenharmony_ci 691767c5feSopenharmony_ci Note: if your GNU/Linux distribution doesn't provide the needed package, 701767c5feSopenharmony_ci please download and install it manually: 711767c5feSopenharmony_ci More details can be found at its official page: 721767c5feSopenharmony_ci https://github.com/protocolbuffers/protobuf 731767c5feSopenharmony_ci 741767c5feSopenharmony_ci - Google Test 751767c5feSopenharmony_ci http://github.com/google/googletest 761767c5feSopenharmony_ci 771767c5feSopenharmony_ci Installation: 781767c5feSopenharmony_ci $ sudo apt-get install libgtest-dev 791767c5feSopenharmony_ci 801767c5feSopenharmony_ci - RE2 811767c5feSopenharmony_ci http://github.com/google/re2 821767c5feSopenharmony_ci 831767c5feSopenharmony_ci Installation: 841767c5feSopenharmony_ci $ sudo apt-get install libre2-dev 851767c5feSopenharmony_ci 861767c5feSopenharmony_ci Note that some distributions (notably Ubuntu 10.4) may not include this, 871767c5feSopenharmony_ci so you might need to download and install it manually. 881767c5feSopenharmony_ci 891767c5feSopenharmony_ci Find and download the Debian packages for your system. For example: 901767c5feSopenharmony_ci https://packages.ubuntu.com/search?keywords=libre2-9 911767c5feSopenharmony_ci https://packages.ubuntu.com/search?keywords=libre2-dev 921767c5feSopenharmony_ci 931767c5feSopenharmony_ci You need to download both the libre2-dev and libre2-1 packages. 941767c5feSopenharmony_ci Once downloaded, install them with: 951767c5feSopenharmony_ci $ sudo dpkg -i libre2*.deb 961767c5feSopenharmony_ci 971767c5feSopenharmony_ci - ICU 981767c5feSopenharmony_ci Installation: 991767c5feSopenharmony_ci $ sudo apt-get install libicu-dev 1001767c5feSopenharmony_ci 1011767c5feSopenharmony_ci Otherwise you need to download the source tarball for the latest version 1021767c5feSopenharmony_ci from: 1031767c5feSopenharmony_ci http://site.icu-project.org/download 1041767c5feSopenharmony_ci And then extract it via: 1051767c5feSopenharmony_ci $ tar xzf icu4c-*-src.tgz 1061767c5feSopenharmony_ci 1071767c5feSopenharmony_ci Alternatively you can export the SVN repository to the current directory 1081767c5feSopenharmony_ci via: 1091767c5feSopenharmony_ci $ svn export http://source.icu-project.org/repos/icu/icu/tags/release-XX-y-z/ 1101767c5feSopenharmony_ci 1111767c5feSopenharmony_ci Having acquired the latest sources, make and install it via: 1121767c5feSopenharmony_ci $ cd icu/source 1131767c5feSopenharmony_ci $ ./configure && make && sudo make install 1141767c5feSopenharmony_ci 1151767c5feSopenharmony_ci - A thread synchronization solution or more recent is required if you need 1161767c5feSopenharmony_ci libphonenumber to be thread-safe. Supported solution are: 1171767c5feSopenharmony_ci - Boost Version 1.40 or more recent 1181767c5feSopenharmony_ci - Posix Thread. Linux or Apple (ios/mac) detection is automatic. On other 1191767c5feSopenharmony_ci Posix environnement, uses -DUSE_POSIX_THREAD = ON 1201767c5feSopenharmony_ci - C++ 2011 (and later) std::mutex. Uses -DUSE_STDMUTEX = ON to enable 1211767c5feSopenharmony_ci automatic C++ 2011 detection (if you prefer Posix or Win32 solution). 1221767c5feSopenharmony_ci - Windows Win32 synchronization API. 1231767c5feSopenharmony_ci 1241767c5feSopenharmony_ci If you access libphonenumber from a single thread, you don't need one of 1251767c5feSopenharmony_ci these solutions. 1261767c5feSopenharmony_ci 1271767c5feSopenharmony_ci You can install it very easily on a Debian-based GNU/Linux distribution: 1281767c5feSopenharmony_ci $ sudo apt-get install libboost-dev libboost-thread-dev libboost-system-dev 1291767c5feSopenharmony_ci 1301767c5feSopenharmony_ci Note: Boost Thread is the only library needed at link time. 1311767c5feSopenharmony_ci 1321767c5feSopenharmony_ci 1331767c5feSopenharmony_ci - abseil-cpp 1341767c5feSopenharmony_ci As this dependency package might not be very common, we are downloading, 1351767c5feSopenharmony_ci building and linking this library as part of the regular build process i.e 1361767c5feSopenharmony_ci part of CMake/Make instructions. If you wish to install this C++ developer 1371767c5feSopenharmony_ci library at your system level and avoid building every time, you can try 1381767c5feSopenharmony_ci below instruction set. 1391767c5feSopenharmony_ci 1401767c5feSopenharmony_ci Installation: 1411767c5feSopenharmony_ci - Official [installation guide](https://abseil.io/docs/cpp/tools/cmake-installs). 1421767c5feSopenharmony_ci Something that we followed in Linux system. 1431767c5feSopenharmony_ci $ git clone https://github.com/abseil/abseil-cpp.git 1441767c5feSopenharmony_ci $ cd abseil-cpp 1451767c5feSopenharmony_ci $ cmake . -DCMAKE_INSTALL_PREFIX="$HOME/lpn-deps" -DCMAKE_POSITION_INDEPENDENT_CODE=ON 1461767c5feSopenharmony_ci $ cmake --build . --target install 1471767c5feSopenharmony_ci - When building libphonenumber library, if abseil-cpp is still getting downloaded and 1481767c5feSopenharmony_ci built, use flags like ```CMAKE_PREFIX_PATH="$HOME/lpn-deps"``` 1491767c5feSopenharmony_ci - Notes: 1501767c5feSopenharmony_ci - We are cloning only a particular version of the abseil-cpp so that we 1511767c5feSopenharmony_ci are not commiting to catch up with new build requirements of that 1521767c5feSopenharmony_ci library. Eg: After the above tag version C++14 is made as minimum 1531767c5feSopenharmony_ci version to build abseil-cpp library. 1541767c5feSopenharmony_ci - libphonenumber is presently using C++11 by default, you can always 1551767c5feSopenharmony_ci change it by passing ```CMAKE_CXX_STANDARD``` flag. 1561767c5feSopenharmony_ci 1571767c5feSopenharmony_ciBuilding and testing the library 1581767c5feSopenharmony_ci-------------------------------- 1591767c5feSopenharmony_ci $ cd libphonenumber/cpp 1601767c5feSopenharmony_ci $ mkdir build 1611767c5feSopenharmony_ci $ cd build 1621767c5feSopenharmony_ci $ cmake .. 1631767c5feSopenharmony_ci $ make 1641767c5feSopenharmony_ci $ ./libphonenumber_test 1651767c5feSopenharmony_ci 1661767c5feSopenharmony_ci 1671767c5feSopenharmony_ciManually installing the library on Mac 1681767c5feSopenharmony_ci-------------------------------------- 1691767c5feSopenharmony_ci 1701767c5feSopenharmony_ciYou can easily install dependencies on Mac using a package manager. In these 1711767c5feSopenharmony_ciinstructions we use Homebrew (http://brew.sh). 1721767c5feSopenharmony_ci 1731767c5feSopenharmony_ciInstall Homebrew package manager and use it to install dependencies: 1741767c5feSopenharmony_ci $ /usr/bin/ruby -e "$(curl -fsSL \ 1751767c5feSopenharmony_ci https://raw.githubusercontent.com/Homebrew/install/master/install)" 1761767c5feSopenharmony_ci $ brew install boost cmake icu4c pkg-config protobuf wget 1771767c5feSopenharmony_ci 1781767c5feSopenharmony_ciSee https://github.com/Homebrew/homebrew/issues/14099 - homebrew does not have 1791767c5feSopenharmony_cigtest. We don't need to install gtest, we only copy sources. For example: 1801767c5feSopenharmony_ci $ mkdir ~/googletest_clone 1811767c5feSopenharmony_ci $ cd ~/googletest_clone 1821767c5feSopenharmony_ci $ git clone https://github.com/google/googletest.git 1831767c5feSopenharmony_ci 1841767c5feSopenharmony_ciGet the libphonenumber source. For example: 1851767c5feSopenharmony_ci $ mkdir ~/libphonenumber_clone 1861767c5feSopenharmony_ci $ cd ~/libphonenumber_clone 1871767c5feSopenharmony_ci $ git clone https://github.com/google/libphonenumber.git 1881767c5feSopenharmony_ci 1891767c5feSopenharmony_ciBuild and test the library: 1901767c5feSopenharmony_ci $ cd libphonenumber/cpp 1911767c5feSopenharmony_ci $ mkdir build 1921767c5feSopenharmony_ci $ cd build 1931767c5feSopenharmony_ci Replace XXX in the commands below with the appropriate version number: 1941767c5feSopenharmony_ci $ cmake \ 1951767c5feSopenharmony_ci -DGTEST_SOURCE_DIR=~/googletest_clone/googletest/googletest/ \ 1961767c5feSopenharmony_ci -DGTEST_INCLUDE_DIR=~/googletest_clone/googletest/googletest/include/ \ 1971767c5feSopenharmony_ci -DICU_UC_INCLUDE_DIR=/usr/local/Cellar/icu4c/XXX/include/ \ 1981767c5feSopenharmony_ci -DICU_UC_LIB=/usr/local/Cellar/icu4c/XXX/lib/libicuuc.dylib \ 1991767c5feSopenharmony_ci -DICU_I18N_INCLUDE_DIR=/usr/local/Cellar/icu4c/XXX/include/ \ 2001767c5feSopenharmony_ci -DICU_I18N_LIB=/usr/local/Cellar/icu4c/XXX/lib/libicui18n.dylib \ 2011767c5feSopenharmony_ci -DUSE_STD_MAP=ON \ 2021767c5feSopenharmony_ci .. 2031767c5feSopenharmony_ci $ make 2041767c5feSopenharmony_ci $ ./libphonenumber_test 2051767c5feSopenharmony_ci 2061767c5feSopenharmony_ciOptional: Deleting & uninstalling everything again: 2071767c5feSopenharmony_ci $ cd 2081767c5feSopenharmony_ci $ rm -rf ~/libphonenumber_clone ~/googletest_clone 2091767c5feSopenharmony_ci 2101767c5feSopenharmony_ci openssl is a dependency of wget and installed with it by Homebrew. If you had 2111767c5feSopenharmony_ci openssl before installing wget don't uninstall here. 2121767c5feSopenharmony_ci $ brew uninstall boost cmake icu4c openssl pkg-config protobuf wget 2131767c5feSopenharmony_ci 2141767c5feSopenharmony_ci $ /usr/bin/ruby -e "$(curl -fsSL \ 2151767c5feSopenharmony_ci https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" 2161767c5feSopenharmony_ci 2171767c5feSopenharmony_ci Homebrew will have changed permissions at installation. See output of previous 2181767c5feSopenharmony_ci command for how to change them back, for example: 2191767c5feSopenharmony_ci $ sudo chmod 0755 /usr/local 2201767c5feSopenharmony_ci $ sudo chgrp wheel /usr/local 2211767c5feSopenharmony_ci 2221767c5feSopenharmony_ci 2231767c5feSopenharmony_ciTroubleshooting CMake via ccmake 2241767c5feSopenharmony_ci-------------------------------- 2251767c5feSopenharmony_ci Follow these instructions if the build steps above don't work for you. 2261767c5feSopenharmony_ci 2271767c5feSopenharmony_ci - Incorrect protocol buffer library issues 2281767c5feSopenharmony_ci If the build process complains that the version of protoc being used is too 2291767c5feSopenharmony_ci old or that it cannot find the correct libprotobuf library, you may need to 2301767c5feSopenharmony_ci change the library path of the project. 2311767c5feSopenharmony_ci 2321767c5feSopenharmony_ci This issue should typically only occur in cases where you have two (or more) 2331767c5feSopenharmony_ci versions of the protocol buffer libraries installed on your system. This 2341767c5feSopenharmony_ci step assumes that you have already manually downloaded and installed the 2351767c5feSopenharmony_ci protocol buffer libraries into /usr/local (as described above). 2361767c5feSopenharmony_ci 2371767c5feSopenharmony_ci To make cmake use the manually installed version of the protocol buffer 2381767c5feSopenharmony_ci libraries, install cmake-curses-gui and use ccmake as follows. 2391767c5feSopenharmony_ci 2401767c5feSopenharmony_ci From within libphonenumber/cpp/build: 2411767c5feSopenharmony_ci $ ccmake . 2421767c5feSopenharmony_ci 2431767c5feSopenharmony_ci You should set the following values: 2441767c5feSopenharmony_ci PROTOBUF_INCLUDE_DIR /usr/local/include 2451767c5feSopenharmony_ci PROTOBUF_LIB /usr/local/lib/libprotobuf.dylib 2461767c5feSopenharmony_ci PROTOC_BIN /usr/local/bin/protoc 2471767c5feSopenharmony_ci 2481767c5feSopenharmony_ci Now press 'c' then 'g' to configure the new parameters and exit ccmake. 2491767c5feSopenharmony_ci Finally regenerate the make files and rebuild via: 2501767c5feSopenharmony_ci $ cmake .. 2511767c5feSopenharmony_ci $ make 2521767c5feSopenharmony_ci 2531767c5feSopenharmony_ci - Protoc binary not executing properly 2541767c5feSopenharmony_ci If you still have issues with the protoc binary tool in /usr/local/bin not 2551767c5feSopenharmony_ci running correctly (cannot find libprotobuf.so.x) then you may need to 2561767c5feSopenharmony_ci configure the LD_LIBRARY_PATH. To do this, as a superuser, add the following 2571767c5feSopenharmony_ci file: 2581767c5feSopenharmony_ci /etc/ld.so.conf.d/libprotobuf.conf 2591767c5feSopenharmony_ci 2601767c5feSopenharmony_ci with the contents: 2611767c5feSopenharmony_ci # Use the manually installed version of the protocol buffer libraries. 2621767c5feSopenharmony_ci /usr/local/lib 2631767c5feSopenharmony_ci 2641767c5feSopenharmony_ci And then run: 2651767c5feSopenharmony_ci $ sudo chmod 644 /etc/ld.so.conf.d/libprotobuf.conf 2661767c5feSopenharmony_ci $ sudo ldconfig 2671767c5feSopenharmony_ci 2681767c5feSopenharmony_ci - Incorrect ICU library issues 2691767c5feSopenharmony_ci Similar to the protocol buffer library issue above, it is possible that your 2701767c5feSopenharmony_ci build may fail if you have two conflicting versions of the ICU libraries 2711767c5feSopenharmony_ci installed on your system. This step assumes that you have already manually 2721767c5feSopenharmony_ci downloaded and installed a recent version of the ICU libraries into 2731767c5feSopenharmony_ci /usr/local. 2741767c5feSopenharmony_ci 2751767c5feSopenharmony_ci Install and run the ccmake tool (as described above) and set the following 2761767c5feSopenharmony_ci values: 2771767c5feSopenharmony_ci ICU_I18N_INCLUDE_DIR /usr/local/include 2781767c5feSopenharmony_ci ICU_I18N_LIB /usr/local/lib/libicui18n.so 2791767c5feSopenharmony_ci ICU_UC_INCLUDE_DIR /usr/local/include 2801767c5feSopenharmony_ci ICU_UC_LIB /usr/local/lib/libicuuc.so 2811767c5feSopenharmony_ci 2821767c5feSopenharmony_ci Now press 'c' then 'g' to configure the new parameters and exit ccmake. 2831767c5feSopenharmony_ci Finally regenerate the make files and rebuild via: 2841767c5feSopenharmony_ci $ cmake .. 2851767c5feSopenharmony_ci $ make 2861767c5feSopenharmony_ci 2871767c5feSopenharmony_ci 2881767c5feSopenharmony_ciBuilding the library on Windows (Visual Studio) 2891767c5feSopenharmony_ci----------------------------------------------- 2901767c5feSopenharmony_ciWe recommend that libphonenumber on Windows be built with Visual Studio 2015 2911767c5feSopenharmony_ciUpdate 2 (https://www.visualstudio.com/en-us/news/releasenotes/vs2015-update2-vs) 2921767c5feSopenharmony_cior later. 2931767c5feSopenharmony_ci 2941767c5feSopenharmony_ciThis enables support of plain UTF-8 source files, for which you also need to specify 2951767c5feSopenharmony_cithe /utf-8 option in build files; see "New Options in VS2015 Update 2" at 2961767c5feSopenharmony_cihttps://blogs.msdn.microsoft.com/vcblog/2016/02/22/new-options-for-managing-character-sets-in-the-microsoft-cc-compiler/, 2971767c5feSopenharmony_cior a Chrome patch for an example: 2981767c5feSopenharmony_cihttps://codereview.chromium.org/2488853002/diff/80001/build/config/compiler/BUILD.gn 2991767c5feSopenharmony_ci 3001767c5feSopenharmony_ciWithout this version and the option, your compilation will have warnings when 3011767c5feSopenharmony_cisetting the codepage for non-Unicode applications on Windows to one of the CJK 3021767c5feSopenharmony_cicode pages, since libphonenumber has UTF-8 strings in source files. While these 3031767c5feSopenharmony_ciare only comments (as opposed to string literals) the warnings can be 3041767c5feSopenharmony_cisuppressed, but we reserve the right to introduce UTF-8 string literals. 3051767c5feSopenharmony_ci 3061767c5feSopenharmony_ciThe library was tested with Visual Studio 2010. 3071767c5feSopenharmony_ci 3081767c5feSopenharmony_ciYou will need to manually fetch and install the following dependencies: 3091767c5feSopenharmony_ci - CMake (tested with v2.8.6): 3101767c5feSopenharmony_ci http://cmake.org/cmake/resources/software.html 3111767c5feSopenharmony_ci * Download and install the Win32 installer. 3121767c5feSopenharmony_ci 3131767c5feSopenharmony_ci - Boost (tested with v1.44) from BoostPro: 3141767c5feSopenharmony_ci http://www.boostpro.com/download/ 3151767c5feSopenharmony_ci * Select all the variants and Boost DateTime and Boost Thread during the 3161767c5feSopenharmony_ci installation process. 3171767c5feSopenharmony_ci See Linux instructions for information about thread-safety. 3181767c5feSopenharmony_ci 3191767c5feSopenharmony_ci - GTest (tested with v1.6.0): 3201767c5feSopenharmony_ci http://code.google.com/p/googletest/downloads/list 3211767c5feSopenharmony_ci * Open msvc/gtest-md.sln with Visual Studio and build the whole solution. 3221767c5feSopenharmony_ci 3231767c5feSopenharmony_ci - ICU (MSVC binaries, tested with v4.8.1): 3241767c5feSopenharmony_ci http://site.icu-project.org/download/48#ICU4C-Download 3251767c5feSopenharmony_ci * Simply extract the archive. 3261767c5feSopenharmony_ci 3271767c5feSopenharmony_ci - Protocol Buffers: 3281767c5feSopenharmony_ci http://code.google.com/p/protobuf/downloads/list 3291767c5feSopenharmony_ci * Open vsprojects/protobuf.sln with Visual Studio and build the whole 3301767c5feSopenharmony_ci solution. 3311767c5feSopenharmony_ci 3321767c5feSopenharmony_ciThen run cmake-gui and specify the path to the libphonenumber's cpp directory 3331767c5feSopenharmony_ciand its build directory which must be created (e.g. cpp/build). 3341767c5feSopenharmony_ci 3351767c5feSopenharmony_ciWhen clicking on "Configure", specify the appropriate Visual Studio version 3361767c5feSopenharmony_ci(tested with 2010). 3371767c5feSopenharmony_ci 3381767c5feSopenharmony_ciThen CMake will need your help to locate the dependencies. You will have to set 3391767c5feSopenharmony_cithe following variables (this example assumes that you extracted the 3401767c5feSopenharmony_cidependencies to C:/). 3411767c5feSopenharmony_ci 3421767c5feSopenharmony_ciGTEST_INCLUDE_DIR C:/gtest-1.6.0/include 3431767c5feSopenharmony_ciGTEST_LIB C:/gtest-1.6.0/msvc/gtest-md/Release/gtest.lib 3441767c5feSopenharmony_ci 3451767c5feSopenharmony_ciICU_I18N_INCLUDE_DIR C:/icu/include 3461767c5feSopenharmony_ciICU_I18N_LIB C:/icu/lib/icuin.lib 3471767c5feSopenharmony_ci 3481767c5feSopenharmony_ciICU_UC_INCLUDE_DIR C:/icu/include 3491767c5feSopenharmony_ciICU_UC_LIB C:/icu/lib/icuuc.lib 3501767c5feSopenharmony_ci 3511767c5feSopenharmony_ciPROTOBUF_INCLUDE_DIR C:/protobuf-3.6.1/src 3521767c5feSopenharmony_ciPROTOBUF_LIB C:/protobuf-3.6.1/vsprojects/Release/libprotobuf.lib 3531767c5feSopenharmony_ciPROTOC_BIN C:/protobuf-3.6.1/vsprojects/Release/protoc.exe 3541767c5feSopenharmony_ci 3551767c5feSopenharmony_ciThen you can click on "Configure" again. CMake should have located all the 3561767c5feSopenharmony_cidependencies. 3571767c5feSopenharmony_ciThen click on "Generate" to generate the appropriate Visual Studio project. 3581767c5feSopenharmony_ciThen open cpp/build/libphonenumber.sln with Visual Studio and build the INSTALL 3591767c5feSopenharmony_citarget. 3601767c5feSopenharmony_ci 3611767c5feSopenharmony_ciAs a result the library's headers and binaries should have been installed to 3621767c5feSopenharmony_ciC:/Program Files/libphonenumber/. 3631767c5feSopenharmony_ciNote that this path can be set by overriding the CMAKE_INSTALL_PREFIX variable 3641767c5feSopenharmony_ciwith cmake-gui. 3651767c5feSopenharmony_ci 3661767c5feSopenharmony_ci 3671767c5feSopenharmony_ciSupported build parameters 3681767c5feSopenharmony_ci-------------------------- 3691767c5feSopenharmony_ci Build parameters can be specified invoking CMake with '-DKEY=VALUE' or using a 3701767c5feSopenharmony_ci CMake user interface (ccmake or cmake-gui). 3711767c5feSopenharmony_ci 3721767c5feSopenharmony_ci USE_ALTERNATE_FORMATS = ON | OFF [ON] -- Use alternate formats for the phone 3731767c5feSopenharmony_ci number matcher. 3741767c5feSopenharmony_ci USE_BOOST = ON | OFF [ON] -- Use Boost. This is only needed in 3751767c5feSopenharmony_ci multi-threaded environments that 3761767c5feSopenharmony_ci are not Linux and Mac. 3771767c5feSopenharmony_ci Libphonenumber relies on Boost for 3781767c5feSopenharmony_ci non-POSIX, non-Windows and non-C++ 2011 3791767c5feSopenharmony_ci multi-threading. 3801767c5feSopenharmony_ci USE_ICU_REGEXP = ON | OFF [ON] -- Use ICU regexp engine. 3811767c5feSopenharmony_ci USE_LITE_METADATA = ON | OFF [OFF] -- Generates smaller metadata that 3821767c5feSopenharmony_ci doesn't include example numbers. 3831767c5feSopenharmony_ci USE_POSIX_THREAD = ON | OFF [OFF] -- Use Posix thread for multi-threading. 3841767c5feSopenharmony_ci USE_RE2 = ON | OFF [OFF] -- Use RE2. 3851767c5feSopenharmony_ci USE_STD_MAP = ON | OFF [OFF] -- Force the use of std::map. 3861767c5feSopenharmony_ci USE_STDMUTEX = ON | OFF [OFF] -- Detect and use C++2011 for multi-threading. 3871767c5feSopenharmony_ci REGENERATE_METADATA = ON | OFF [ON] -- When this is set to OFF it will skip 3881767c5feSopenharmony_ci regenerating the metadata with 3891767c5feSopenharmony_ci BuildMetadataCppFromXml. Since the 3901767c5feSopenharmony_ci metadata is included in the source 3911767c5feSopenharmony_ci tree anyway, it is beneficial for 3921767c5feSopenharmony_ci packagers to turn this OFF: it saves 3931767c5feSopenharmony_ci some time, and it also makes it 3941767c5feSopenharmony_ci unnecessary to have java in the build 3951767c5feSopenharmony_ci environment. 396