TerraLib and TerraView Wiki Page

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
wiki:documentation:devguide:build [2018/09/17 15:35]
marisa [Building on Microsoft Windows with Microsoft Visual C++ 2017]
wiki:documentation:devguide:build [2018/09/18 16:03] (current)
marisa
Line 87: Line 87:
  
   * Press ''​Configure''​ again. ​   ​   * Press ''​Configure''​ again. ​   ​
-  * Press ''​Generate'':​ this will generate a solution file for Visual Studio 2017 under the folder ''​c:​\terralib5\build''​ ((The location set in "Where to build the binaries"​)).+  * Press ''​Generate'':​ this will generate a solution file for Visual Studio 2017 under the folder ''​c:​\terralib5\build\terralib.sln''​ ((The location set in "Where to build the binaries"​)). 
 +  * Press ''​Open Project''​ to open Visual Studio 2017
  
-**5.** ​Open the solution file located ​at:+**5.** ​Inside Visual Studio right click over the project ALL_BUILD and build. Before running, set it as ''​StartUp''​ Project and set the local environment of terraview project ((terraview->​Properties->​Configuration Properties->​ Debugging, set the Environment entry as ''​PATH=c:​\terralib5\3rdparty\lib;​c:​\<​Qt5 path>​\bin''​)). 
 + 
 +**6.** If TERRALIB_BUILD_EXAMPLES_ENABLED => ON or TERRALIB_BUILD_EXAMPLES_ENABLED => ON: to run and debug one of the terralib_example_* or terralib_unitest_*,​ set it as ''​StartUp''​ Project and make sure the data ([[http://​www.dpi.inpe.br/​terralib5-devel/​data/​data.zip| data.zip]]) used by these examples/​unittest are uncompressed ​at the default directory specified by TERRALIB_DATA_DIR :    
 +   ​TERRALIB_DATA_DIR ​  ​C:​\terralib\build-win64\data 
 +    
 +===== Adding Plugin TerraPrint as part of TerraView/​TerraLib ===== 
 + 
 +==== Building Plugin TerraPrint with Visual C++ 2017 ==== 
 + 
 +TerraPrint is a plugin originally developed externally and its source code is maintained in a separated directory structure. As it depends on TerraLib, firstly it is necessary to built TerraPrint according with the instructions below: 
 + 
 +  *Make a new folder to host TerraPrint source code: 
 +<code bash> 
 +$ mkdir C:/TPrint 
 +$cd TPrint 
 +</​code>​ 
 + 
 +  * Make a local copy of TerraPrint repository and go to the right branch: 
 +<code bash> 
 +$ GIT_SSL_NO_VERIFY=true git clone -b release-1.4 https://​gitlab.dpi.inpe.br/​terralib/​terraprint.git . 
 +$ git pull 
 +</​code>​ 
 + 
 +  *Open the CMake GUI: 
 +  * Set the "Where is the source code" edit text to:
 <​code>​ <​code>​
-c:\terralib5\build\terralib.sln or press ''​Open Project''​+   C:/TPrint/build/cmake
 </​code>​ </​code>​
  
-**6.** Build ALL_BUILD ((Inside Visual Studio, right click over the project ALL_BUILD and build)), and before running, set it as ''​StartUp''​ Project and set the local environment of terraview project ((terraview->Properties->​Configuration Properties->​ Debugging, set the Environment entry as ''​PATH=c:​\terralib5\3rdparty\lib;​c:\<Qt5 path>\bin''​)).+  ​Set the "Where to build the binaries"​ edit text to: 
 +<code> 
 +   C:/​TPrint_build 
 +</code>
  
-**7.** If TERRALIB_BUILD_EXAMPLES_ENABLED => ON or TERRALIB_BUILD_EXAMPLES_ENABLED => ONto run and debug one of the terralib_example_* ​or terralib_unitest_*, set it as ''​StartUp'' ​Project and make sure the data ([[http://www.dpi.inpe.br/terralib5-devel/data/data.zip| data.zip]]) used by these examples/unittest are uncompressed at the default directory specified by TERRALIB_DATA_DIR ​  ​ +  ​Mark the "​Grouped"​ and "​Advanced"​ check box. 
-   TERRALIB_DATA_DIR ​  C:\terralib\build-win64\data+ 
 +  ​Click in "Add entry":​ 
 +    ​Add new variable named **CMAKE_PREFIX_PATH**((as a example c:\terralib5\3rdparty;​c:​\terralib5\3rdparty/​lib/​cmake/​terralib-4.2.2;​C:/​Qt/​Qt5.10.1/​5.10.1/​msvc2017_64/​lib/​cmake/​Qt5;​C:/​Qt/​Qt5.10.1/​5.10.1/​msvc2017_64/​lib/​cmake/​Qt5LinguistTools)),​ select type as **PATH** ​and fill its value with the following dependencies paths separated by semicolon (;) 
 + 
 +^Dependencies^PATH^ 
 +|third-party| ''​c:​\terralib5\3rdparty''​| 
 +|Terralib4 | ''​c:​\terralib5\3rdparty\lib\cmake\terralib-4.2.2''​| 
 +|Qt         | ''​C:/​Qt/​Qt5.10.1/​5.10.1/​msvc2017_64/​lib/​cmake/​Qt5;''​ (or something similar)((This is the folder where the dir **Qt5** containing the **Qt5Config.cmake** file can be find))| 
 +|Qt| ''​C:/​Qt/​Qt5.10.1/​5.10.1/​msvc2017_64/​lib/​cmake/​Qt5LinguistTools''​|  
 + 
 +  * Click in "​Configure"​ button. 
 +    * Select option "​Visual Studio 15 2017 Win64"​ 
 +    * If the output folder (C:/​TPrint_build) does not exist, CMake GUI will prompt you for creating it: just confirm the creation. 
 + 
 +  * if no problem occurs, set the following variables:​ 
 + 
 +^Entry^Variable^Value^ 
 +|CPACK| CPACK_BINARY_NSYS| ON ((package generator (used in release)-disable the others))| 
 +|TERRALIB| TERRALIB_BUILD_AS_BUNDLE| OFF| 
 +|TERRALIB| TERRALIB_BUILD_EXAMPLES_ENABLED| OFF| 
 +|TERRALIB| TERRALIB_BUILD_LAYOUT_TEST_ENABLED| OFF| 
 +|TERRALIB| TERRALIB_MOD_LAYOUT_ENABLED |ON| 
 +|TERRALIB| TERRALIB_MOD_QT_PLUGINS_ENABLED |ON| 
 +|TERRALIB| TERRALIB_TRACK_3RDPARTY_DEPENDENCIES| ON| 
 +|TERRALIB_DIR_VAR_NAME|<​remove ​it because you will use your build version specified in terralib_DIR>​| 
 + 
 +  * Press ''​Configure'' ​again. 
 +  * Some entries might be filled automatically by cmake with the wrong values.  
 +  Check under ''​Ungrouged Entries''​ which terralib is set ((in my case an old one were set C:/Program Files/terralib5.2.2/lib/cmake/terralib-5.2.2)): 
 +and set the one you just built before: 
 + 
 +|terralib_DIR|''​c:​\terralib5\build''​ |building dir used by terralib/terraview| 
 + 
 +  * Press ''​Configure''​ again. ​    
 +  * Press ''​Generate'':​ this will generate a solution file for Visual Studio 2017 under the folder ''​C:/​TPrint_build''​ ((The location set in "Where to build the binaries"​)). 
 +  * Press ''​Open Project''​ to open Visual C++ interface using ''​C:/​TPrint_build\terralib_layout.sln''​ ((or Open the solution file located at ''​C:/​TPrint_build\terralib_layout.sln'' ​TerraPrint is internally defined by terralib_layout_DIR)) 
 + 
 +  * On Visual Studio C++ 2017 interface, build ''​ALL_BUILD''​ on ''​debug''​ version first (some problems must be solved here) and afterwards the ''​release''​ version. 
 +  * Close Visual Studio ​  
 + 
 +  * Go back to **Terralib/​TerraView** CMAKE and set the path to the plugin just built: 
 + 
 + 
 +|terralib_layout_DIR| ''​C:/​TPrint_build''​| informe where is Directory containing a CMake configuration file for TerraPrint| 
 + 
 +  * Press ''​Configure''​ and ''​Generate''​ to generate the solution including the plugin as part of package. 
 +  * Press ''​Open Project''​ to open Visual C++ 
 + 
 +  * On Visual Studio C++ 2017 interface, build ''​ALL_BUILD''​ to build TerraView with TerraPrint as its plugin 
 +  * Rebuild the project called PACKAGE to generate the TerraView installer with TerraPrint plugin. 
 + 
 +  * Install the  c:​\terralib5\_CPack_Packages\win64\NSIS\TerraView-5.4.1-win64.exe to check the TerraPrint plugin ((Plugins|Manage Plugins...|TerraPrint))
  
 ===== Building on Linux Ubuntu 14.04 and 16.04 with GNU G++ ===== ===== Building on Linux Ubuntu 14.04 and 16.04 with GNU G++ =====