<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body dir="auto">
<div><base href="https://www.cloudcompare.org/doc/wiki/index.php?title=Compilation"><style id="print">
        @media print {
            body {
                margin: 2mm 9mm;
            }

            .original-url {
                display: none;
            }

            #article .float.left {
                float: left !important;
            }

            #article .float.right {
                float: right !important;
            }

            #article .float {
                margin-top: 0 !important;
                margin-bottom: 0 !important;
            }
        }
    </style>
<title>Compilation - CloudCompareWiki</title>
<div class="original-url">Wondering if anyone has used XIOT with CloudCompare for X3D export or import?  We are looking for paths for utilizing E57 data.</div>
<div class="original-url"><br>
</div>
<div class="original-url">
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica;">
<span style="font-size: 12pt;"><a href="https://github.com/Supporting/xiot">https://github.com/Supporting/xiot</a> </span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica;">
<span style="font-size: 12pt;"><br>
</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica;">
<span style="font-size: 12pt;">=========================</span></p>
</div>
<div class="original-url"><br>
<a href="https://www.cloudcompare.org/doc/wiki/index.php?title=Compilation">https://www.cloudcompare.org/doc/wiki/index.php?title=Compilation</a><br>
<br>
</div>
<div id="article" role="article" style="text-rendering: optimizeLegibility; font-family: -apple-system-font; font-size: 1.2em; line-height: 1.5em; margin: 0px; padding: 0px;" class="system exported">
<!-- This node will contain a number of div.page. -->
<div class="page" style="text-align: start; word-wrap: break-word; max-width: 100%;">
<h1 class="title" style="font-weight: bold; font-size: 1.95552em; line-height: 1.2141em; margin-top: 0px; margin-bottom: 0.5em; text-align: start; -webkit-hyphens: manual; display: block; max-width: 100%;">
Compilation</h1>
<h1 style="font-weight: bold; font-size: 1.5em; line-height: 1.4em; max-width: 100%;">
<span style="max-width: 100%;">Compilation with CMake <a href="/doc/wiki/index.php?title=File:Cmake-icon.png" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
<img alt="Cmake-icon.png" src="https://www.cloudcompare.org/doc/wiki/images/1/1d/Cmake-icon.png" width="16" height="16" class="reader-image-tiny" style="max-width: 100%; height: auto; display: inline; margin: 0px;"></a></span></h1>
<p style="max-width: 100%;">For compilation instructions for the latest version (2.7 and later), please refer to the
<a rel="nofollow" href="http://github.com/cloudcompare/trunk/blob/master/BUILD.md" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
BUILD.md file</a> on github. </p>
<p style="max-width: 100%;">The instructions below are for the 2.6 or earlier versions.
</p>
<p style="max-width: 100%;"><span style="max-width: 100%;">WARNING: if you already have a clone of the CloudCompare git repository (prior to July 2015), you may want to update/checkout the submodules with
<i style="max-width: 100%;">git submodule update --init --recursive</i></span> </p>
<h2 style="font-weight: bold; font-size: 1.43em; max-width: 100%;"><span style="max-width: 100%;">Prerequisites</span></h2>
<ol style="max-width: 100%;">
<li style="max-width: 100%;">Clone the main repository and its submodules from the main git(hub) server:
<a rel="nofollow" href="https://github.com/cloudcompare/trunk" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
https://github.com/cloudcompare/trunk</a>
<dl style="max-width: 100%;"><dd style="max-width: 100%;">syntax: <i style="max-width: 100%;">
git clone --recursive <a rel="nofollow" href="https://github.com/cloudcompare/trunk.git" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
https://github.com/cloudcompare/trunk.git</a></i></dd></dl>
</li><li style="max-width: 100%;">Install <a rel="nofollow" href="http://www.cmake.org" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
CMake</a> (2.8 or newer) </li><li style="max-width: 100%;">Install all necessary dependencies:
<dl style="max-width: 100%;"><dd style="max-width: 100%;">[<i style="max-width: 100%;">WINDOWS</i>]
<a rel="nofollow" href="http://qt-project.org/" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
Qt</a> (<b style="max-width: 100%;">version 5 WITH OPENGL</b> preferably but the version 4.8 is still supported)
</dd><dd style="max-width: 100%;">[<i style="max-width: 100%;">LINUX/MAC OS X</i>] qt-sdk, opengl</dd></dl>
</li></ol>
<p style="max-width: 100%;"><i style="max-width: 100%;">(refer to the <span class="converted-anchor" style="max-width: 100%;">
Appendix</span> section if your version of Qt is older than 4.8 or if you need to compile with Qt 4.8 in 64 bits mode on Windows)</i>
</p>
<h2 style="font-weight: bold; font-size: 1.43em; max-width: 100%;"><span style="max-width: 100%;">Generating the project</span></h2>
<ol style="max-width: 100%;">
<li style="max-width: 100%;">Launch CMake GUI ('cmake-qt-gui' on linux)
<ol style="max-width: 100%;">
<li style="max-width: 100%;"><i style="max-width: 100%;">(for more convenience, you should check the "Grouped" check-box)</i>
</li><li style="max-width: 100%;">make the <span style="max-width: 100%;"><i style="max-width: 100%;">Where is the source code</i></span> field point to your local repository (for instance
<span style="max-width: 100%;"><i style="max-width: 100%;">C:\trunk_CC</i></span>).
</li><li style="max-width: 100%;">make the <span style="max-width: 100%;"><i style="max-width: 100%;">Where to build the binaries</i></span> field point to ... almost anywhere you want (<b style="max-width: 100%;">apart from the same folder as above!</b>). For instance:
<span style="max-width: 100%;"><i style="max-width: 100%;">C:\trunk_CC\build</i></span>.
</li><li style="max-width: 100%;">click on the "Configure" button </li><li style="max-width: 100%;">select your generator [<span style="max-width: 100%;">already tested: Visual 2008 (32/64 bits), Visual 2010 Express (32/64 bits - see appendix), Visual 2012 Express (64 bits/Qt 5), Code::Blocks (Linux & Windows 32 bits), gcc (Linux
 32/64 bits, Mac OS X)</span>] </li><li style="max-width: 100%;">Wait for CMake configuration/tests to finish... </li><li style="max-width: 100%;">...and you should see something like this:</li></ol>
</li></ol>
<div style="max-width: 100%;">
<div style="max-width: 100%;"><a href="/doc/wiki/index.php?title=File:Cmake_init.jpg" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;"><img alt="Cmake init.jpg" src="https://www.cloudcompare.org/doc/wiki/images/f/f1/Cmake_init.jpg" width="610" height="464" class="" style="max-width: 100%; margin: 0.5em auto; display: block; height: auto;"></a></div>
</div>
<p style="max-width: 100%;">Before clicking on the 'Generate' button, you may want to set some options:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;">if you expand the "OPTION" group, you'll be able to set some general options:
<ol style="max-width: 100%;">
<li style="max-width: 100%;"><b style="max-width: 100%;">OPTION_BUILD_CC_VIEWER</b>: whether to build or not the ccViewer side project (activated by default)
</li><li style="max-width: 100%;"><b style="max-width: 100%;">OPTION_EXPORT_TARGETS</b>: not documented
</li><li style="max-width: 100%;"><b style="max-width: 100%;">OPTION_MP_BUILD</b>: for MSVC only
<i style="max-width: 100%;">(mutli-process build --> much faster, but takes almost all available CPU)</i>
</li><li style="max-width: 100%;"><b style="max-width: 100%;">OPTION_SUPPORT_3D_CONNEXION_DEVICES</b>: for 3D mouses handling
</li><li style="max-width: 100%;"><b style="max-width: 100%;">OPTION_SUPPORT_MAC_PDMS_FORMAT</b>: to activate support for PDMS .mac scripts (CAD)
</li><li style="max-width: 100%;"><b style="max-width: 100%;">OPTION_USE_DXFLIB</b>: to activate support for DXF files in CloudCompare/ccViewer with
<b style="max-width: 100%;">dxflib</b> - see <span class="converted-anchor" style="max-width: 100%;">
below</span> </li><li style="max-width: 100%;"><b style="max-width: 100%;">OPTION_USE_FBX_SDK</b>: to activate support for FBX files in CloudCompare/ccViewer with the official
<b style="max-width: 100%;">FBX SDK</b> - see <span class="converted-anchor" style="max-width: 100%;">
below</span> </li><li style="max-width: 100%;"><b style="max-width: 100%;">OPTION_USE_GDAL</b>: to activate support for a lot of raster files in CloudCompare/ccViewer with
<b style="max-width: 100%;">GDAL</b> libray - see <span class="converted-anchor" style="max-width: 100%;">
below</span> </li><li style="max-width: 100%;"><b style="max-width: 100%;">OPTION_USE_LIBE57</b>: to activate support for E57 files in CloudCompare/ccViewer with
<b style="max-width: 100%;">libE57</b> - see <span class="converted-anchor" style="max-width: 100%;">
below</span> </li><li style="max-width: 100%;"><b style="max-width: 100%;">OPTION_USE_LIBLAS</b>: to activate support for LAS files in CloudCompare/ccViewer with
<b style="max-width: 100%;">libLAS</b> - see <span class="converted-anchor" style="max-width: 100%;">
below</span> </li><li style="max-width: 100%;"><b style="max-width: 100%;">OPTION_USE_VISUAL_LEAK_DETECTOR</b>: to use the Visual Leak Detector library for MSVC (<a rel="nofollow" href="http://vld.codeplex.com/" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">http://vld.codeplex.com/</a>)
</li><li style="max-width: 100%;"><b style="max-width: 100%;">OPTION_USE_XIOT</b>: to activate support for X3D files in qCC (and ccViewer) with
<b style="max-width: 100%;">XIOT</b> - see <span class="converted-anchor" style="max-width: 100%;">
below</span></li></ol>
</li><li style="max-width: 100%;">if you expand the "INSTALL" group, you'll be able to select which [plugin(s)|Plugins] you want to compile (by default, none are selected)
<ol style="max-width: 100%;">
<li style="max-width: 100%;">qBLUR <i style="max-width: 100%;">(warning: does not compile with Code::Blocks on Windows for the moment)</i>
</li><li style="max-width: 100%;">qCork (see <span class="converted-anchor" style="max-width: 100%;">
below</span>) </li><li style="max-width: 100%;">qDummy <i style="max-width: 100%;">(warning: does nothing, template for developers)</i>
</li><li style="max-width: 100%;">qEDL </li><li style="max-width: 100%;">qHPR </li><li style="max-width: 100%;">qKinect (see <span class="converted-anchor" style="max-width: 100%;">
below</span>) </li><li style="max-width: 100%;">qPCL (requires PCL - see <span class="converted-anchor" style="max-width: 100%;">
below</span>) </li><li style="max-width: 100%;">qPCV </li><li style="max-width: 100%;">qPoissonRecon (see <span class="converted-anchor" style="max-width: 100%;">
below</span>) </li><li style="max-width: 100%;">qRansacSD <i style="max-width: 100%;">(only tested on Windows for the moment)</i>
</li><li style="max-width: 100%;">qSRA </li><li style="max-width: 100%;">qSSAO</li></ol>
</li><li style="max-width: 100%;">eventually, the "CMAKE" group contains a <b style="max-width: 100%;">
CMAKE_INSTALL_PREFIX</b> which is where CloudCompare and ccViewer will be installed (when you compile the
<b style="max-width: 100%;">INSTALL</b> project)
<ol style="max-width: 100%;">
<li style="max-width: 100%;">On Linux, default install dir is <span style="max-width: 100%;">
<i style="max-width: 100%;">/usr/local</i></span> (be sure to have administrative rights if you want to install CloudCompare there: once configured, you can call 'sudo make install' from the sources directory)
</li><li style="max-width: 100%;">On Windows Seven, you may not have the right to 'install' files in the default "Program Files" folder</li></ol>
</li></ol>
<p style="max-width: 100%;"></p>
<h3 style="font-weight: bold; font-size: 1.25em; max-width: 100%;"><span style="max-width: 100%;">[Optional] Setup for LibLAS support</span></h3>
<p style="max-width: 100%;"><span style="max-width: 100%;"></span></p>
<p style="max-width: 100%;">If you want to compile CloudCompare (and ccViewer) with LAS/LAZ files support, you'll need:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;"><a rel="nofollow" href="http://liblas.org" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">LibLAS</a> (<i style="max-width: 100%;">last tested version: 1.8 on Windows</i>)
</li><li style="max-width: 100%;">and optionally <a rel="nofollow" href="http://www.laszip.org/" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
laszip</a> for LAZ files support (<i style="max-width: 100%;">last tested version: 2.2.0 on Windows</i>) --> prefer the static version (<code style="max-width: 100%;">BUILD_STATIC</code> in LASzip CMake configuration) and mind the
<code style="max-width: 100%;">WITH_STATIC_LASZIP</code> option in libLAS CMake configuration! (<i style="max-width: 100%;">only appears in 'Advanced' mode</i>)
</li><li style="max-width: 100%;"><a rel="nofollow" href="http://www.boost.org/" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">Boost</a> multi-thread static libraries
<ol style="max-width: 100%;">
<li style="max-width: 100%;">make the <span style="max-width: 100%;">BOOST_ROOT</span> environment variable point to your Boost installation before launching CMake in order for the automatic 'find_package' script to work properly
</li><li style="max-width: 100%;">otherwise refer to LibLAS <a rel="nofollow" href="http://liblas.org/compilation.html" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
documentation</a> for more directions</li></ol>
</li></ol>
<p style="max-width: 100%;">Then, the CloudCompare CMake project will request that you set the 3 following variables:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;">LIBLAS_INCLUDE_DIR: LibLAS include directory (pretty straightforward ;)
</li><li style="max-width: 100%;">LIBLAS_RELEASE_LIBRARY_FILE: main LibLAS release library (the .lib or .a file itself!)
</li><li style="max-width: 100%;">[Windows] LIBLAS_SHARED_LIBRARY_FILE: full path to the
<span style="max-width: 100%;"><i style="max-width: 100%;">liblas.dll</i></span> file</li></ol>
<p style="max-width: 100%;"><span style="max-width: 100%;"><i style="max-width: 100%;">For the moment, only the release version of CloudCompare supports LibLAS files</i></span>
</p>
<h3 style="font-weight: bold; font-size: 1.25em; max-width: 100%;"><span style="max-width: 100%;">[Optional] Setup for LibE57 support</span></h3>
<p style="max-width: 100%;"><span style="max-width: 100%;"></span></p>
<p style="max-width: 100%;">If you want to compile CloudCompare (and ccViewer) with LibE57 files support, you'll need:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;"><a rel="nofollow" href="http://www.boost.org/" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">Boost</a> multi-thread static libraries (same as
<span class="converted-anchor" style="max-width: 100%;">libLAS</span>) </li><li style="max-width: 100%;"><a rel="nofollow" href="http://xerces.apache.org/xerces-c" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">Xerces-C++</a> multi-thread
<b style="max-width: 100%;">static</b> libraries
<ol style="max-width: 100%;">
<li style="max-width: 100%;">On Visual C++ (Windows):
<ol style="max-width: 100%;">
<li style="max-width: 100%;">select the 'Static Debug' or 'Static Release' configurations
</li><li style="max-width: 100%;">you'll have to manually modify the <b style="max-width: 100%;">
XercesLib</b> project options so that the 'C/C++ > Code Generation > Runtime Library' are of DLL type in both release and debug modes (i.e. /MD in release or /MDd in debug)
</li><li style="max-width: 100%;">for 64 bits version be sure to select the right platform (x64 instead of Win32). If you use Visual Studio Express 2010, be sure also that the 'toolset' (in the project properties) is set to something like
<i style="max-width: 100%;">Windows7.1SDK</i></li></ol>
</li><li style="max-width: 100%;">only the XercesLib project neet to be compiled </li><li style="max-width: 100%;">eventually, CMake will look for the resulting files in '/include' (instead of /src) and /lib (without the Release or Debug subfolders). By default the visual project will put them in /Build/WinXX/VCXX/StaticXXX. Therefore you should
 create a custom folder with the right organization and copy the files there.</li></ol>
</li><li style="max-width: 100%;"><a rel="nofollow" href="http://libe57.org" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">LibE57</a> (<i style="max-width: 100%;">last tested version: 1.1.312 on Windows</i>)
<ol style="max-width: 100%;">
<li style="max-width: 100%;">WARNING: with Visual Studio (at least), you'll need the libraries compiled with /MD (=DLL Multithreaded) in release mode and /MDd in debug mode. You may have to replace all '/MT' by '/MD' in the main libE57 root CMake file (or in
 'cmake/c_flag_overrides.cmake' and 'cmake/cxx_flag_overrides.cmake' if there's no "/MT" in it)
</li><li style="max-width: 100%;">If you found <code style="max-width: 100%;">set(Boost_USE_STATIC_RUNTIME ON)</code> in the CMake file, comment it
</li><li style="max-width: 100%;"><b style="max-width: 100%;">the version 1.1.312 of libE57 has a small glitch that must be manually patched</b>:
<ol style="max-width: 100%;">
<li style="max-width: 100%;">open <i style="max-width: 100%;">E57FoundationImpl.cpp</i> and browse to the
<i style="max-width: 100%;">CheckedFile::operator<<(float f)</i> method (line 4670)
</li><li style="max-width: 100%;">set the output precision to 8 instead of 7! (otherwise the interal checks for precision loss may fail and libE57 will throw an exception)</li></ol>
</li></ol>
</li></ol>
<p style="max-width: 100%;">The CloudCompare CMake project will only require that you set the path where libE57 has been installed (LIBE57_INSTALL_DIR)
</p>
<h3 style="font-weight: bold; font-size: 1.25em; max-width: 100%;"><span style="max-width: 100%;">[Optional] Setup for libfreenect support</span></h3>
<p style="max-width: 100%;"><span style="max-width: 100%;"></span></p>
<p style="max-width: 100%;">If you want to compile qKinect you'll need: </p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;"><a rel="nofollow" href="https://github.com/OpenKinect/libfreenect" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">OpenKinect / libfreenect</a> (<i style="max-width: 100%;">last tested version: v0.5.0
 Saturn, compiled on Windows 7 32 & 64 bits - you'll need <a rel="nofollow" href="http://libusb.info/" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
libusb</a></i>)</li></ol>
<p style="max-width: 100%;">Then, the CloudCompare CMake project will request that you set the 3 following variables:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;">LIBFREENECT_INCLUDE_DIR: libfreenect include directory (pretty straightforward ;)
</li><li style="max-width: 100%;">LIBFREENECT_LIBRARY_FILE: main libfreenect library (the
<span style="max-width: 100%;">freenect.lib</span> or <span style="max-width: 100%;">
libfreenect.a</span> file itself!) </li><li style="max-width: 100%;">[Windows] LIBFREENECT_SHARED_LIBRARY_FILE: full path to the
<span style="max-width: 100%;"><i style="max-width: 100%;">freenect.dll</i></span> file</li></ol>
<h3 style="font-weight: bold; font-size: 1.25em; max-width: 100%;"><span style="max-width: 100%;">[Optional] Setup for the qPoissonRecon plugin</span></h3>
<p style="max-width: 100%;"><span style="max-width: 100%;"></span></p>
<p style="max-width: 100%;">The version of the Poisson Surface Reconstruction library (M. Kazhdan et al.) used by the is
<a rel="nofollow" href="https://github.com/cloudcompare/PoissonRecon" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
[1]</a>. It is declared as a submodule of CC's repository. You have to explicitly synchronize it (see
<a rel="nofollow" href="https://git-scm.com/docs/git-submodule" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
[2]</a>). </p>
<p style="max-width: 100%;">Then simply check the INSTALL_QPOISSON_RECON_PLUGIN option in CMake.
</p>
<h3 style="font-weight: bold; font-size: 1.25em; max-width: 100%;"><span style="max-width: 100%;">[Optional] Setup for X3D/XIOT support</span></h3>
<p style="max-width: 100%;"><span style="max-width: 100%;"></span></p>
<p style="max-width: 100%;">Not ready yet. </p>
<h3 style="font-weight: bold; font-size: 1.25em; max-width: 100%;"><span style="max-width: 100%;">[Optional] Setup for PCL (required by qPCL)</span></h3>
<p style="max-width: 100%;"><span style="max-width: 100%;"></span></p>
<p style="max-width: 100%;">If you want to compile qPCL you'll need: </p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;"><a rel="nofollow" href="http://pointclouds.org/" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">PCL</a> (<i style="max-width: 100%;">last tested version: 1.7 on Windows and 1.6 on Linux</i>)</li></ol>
<p style="max-width: 100%;">Follow the online instructions/tutorials. Basically, you'll need Boost, Qt, Flann and Eigen.
</p>
<p style="max-width: 100%;">Once properly installed, the CloudCompare CMake script should automatically find PCL definitions. However, you'll have to set again the parameters related to Flann and Eigen.
</p>
<h3 style="font-weight: bold; font-size: 1.25em; max-width: 100%;"><span style="max-width: 100%;">[Optional] Setup for dxflib support</span></h3>
<p style="max-width: 100%;"><span style="max-width: 100%;"></span></p>
<p style="max-width: 100%;">If you want to compile CloudCompare (and ccViewer) with DXF files support, you'll need:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;">Ribbonsoft's dxflib v3.3.4 or newer (<a rel="nofollow" href="http://www.ribbonsoft.com/en/dxflib-downloads" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">http://www.ribbonsoft.com/en/dxflib-downloads</a>
 - last tested version: v3.3.4 on Windows)</li></ol>
<p style="max-width: 100%;">The CMake project will only require that you set the path where dxflib sources are (DXF_LIB_SRC_DIR), i.e
<b style="max-width: 100%;">the 'src' folder full path</b> </p>
<p style="max-width: 100%;"><span style="max-width: 100%;">Warning, if you use version 3.3.4:</span>
</p>
<ul style="max-width: 100%;">
<li style="max-width: 100%;">edit the <b style="max-width: 100%;">dl_dxf.cpp</b> file
</li><li style="max-width: 100%;">browse to method <b style="max-width: 100%;">DL_Dxf::writeStyle</b>
</li><li style="max-width: 100%;">un-comment all commented lines (<b style="max-width: 100%;">but the "dw.dxfHex(330, 0)" call</b>) at the beginning and end of the method (i.e. lines 4130 to 4134, lines 4136 to 4139, and line 4181)</li></ul>
<p style="max-width: 100%;"><span style="max-width: 100%;">Warning, version 3.7.5 syntax has changed so much that it can't be used to compile with CloudCompare anymore!</span>
</p>
<h3 style="font-weight: bold; font-size: 1.25em; max-width: 100%;"><span style="max-width: 100%;">[Optional] Setup for FBX SDK support</span></h3>
<p style="max-width: 100%;"><span style="max-width: 100%;"></span></p>
<p style="max-width: 100%;">If you want to compile CloudCompare (and ccViewer) with FBX files support, you'll need:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;">The official Autodesk's FBX SDK (<i style="max-width: 100%;">use google for this</i> - last tested version: 2014.2 Windows)</li></ol>
<p style="max-width: 100%;">Then, the CloudCompare CMake project will request that you set the 3 following variables:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;">FBX_SDK_INCLUDE_DIR: FBX SDK include directory (pretty straightforward ;)
</li><li style="max-width: 100%;">FBX_SDK_LIBRARY_FILE: main FBX SDK library (e.g. <span style="max-width: 100%;">
libfbxsdk-md.lib</span>) </li><li style="max-width: 100%;">FBX_SDK_LIBRARY_FILE_DEBUG: main FBX SDK library for debug mode (if any)</li></ol>
<h3 style="font-weight: bold; font-size: 1.25em; max-width: 100%;"><span style="max-width: 100%;">[Optional] Setup for GDAL support</span></h3>
<p style="max-width: 100%;"><span style="max-width: 100%;"></span></p>
<p style="max-width: 100%;">If you want to compile CloudCompare (and ccViewer) with GDAL (raster) files support, you'll need:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;">A compiled version of the GDAL library (<a rel="nofollow" href="http://www.gdal.org/" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">http://www.gdal.org/</a> - last tested version: 1.10 on Windows)</li></ol>
<p style="max-width: 100%;">Then, the CloudCompare CMake project will request that you set the 2 following variables:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;">GDAL_INCLUDE_DIR: GDAL include directory (pretty straightforward ;)
</li><li style="max-width: 100%;">GFAL_LIBRARY: the static library (e.g. <span style="max-width: 100%;">
gdal_i.lib</span>)</li></ol>
<h3 style="font-weight: bold; font-size: 1.25em; max-width: 100%;"><span style="max-width: 100%;">[Optional] Setup for Cork + MPIR support (for qCork)</span></h3>
<p style="max-width: 100%;"><span style="max-width: 100%;"></span></p>
<p style="max-width: 100%;">If you want to compile the qCork plugin (<b style="max-width: 100%;">on Windows only for now</b>), you'll need:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;"><a rel="nofollow" href="http://www.mpir.org/" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">MPIR 2.6.0</a>
</li><li style="max-width: 100%;">the forked version of the Cork library for CC: <a rel="nofollow" href="https://github.com/cloudcompare/cork" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
https://github.com/cloudcompare/cork</a>
<ol style="max-width: 100%;">
<li style="max-width: 100%;">on Windows see the VS2010, VS2012 and VS2013 projects shipped with this fork
</li><li style="max-width: 100%;">for VS2010 and VS2012 you'll have to edti the "wincork" project and update the include path for MPIR (for all configurations/platforms)
</li><li style="max-width: 100%;">for VS2013 just edit the 'mpir' property sheet (in the Properties manager) and update the MPIR macro (in the 'User macros' tab)</li></ol>
</li></ol>
<p style="max-width: 100%;">Then, the CloudCompare CMake project will request that you set the following variables:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;">CORK_INCLUDE_DIR and MPIR_INCLUDE_DIR: both libraries include directories (pretty straightforward ;)
</li><li style="max-width: 100%;">CORK_RELEASE_LIBRARY_FILE and MPIR_RELEASE_LIBRARY_FILE: both main library files
</li><li style="max-width: 100%;">and optionally CORK_DEBUG_LIBRARY_FILE and MPIR_DEBUG_LIBRARY_FILE: both main library files (for debug mode)</li></ol>
<h3 style="font-weight: bold; font-size: 1.25em; max-width: 100%;"><span style="max-width: 100%;">Generate the project files</span></h3>
<p style="max-width: 100%;">Once all red items have disappeared (click multiple times on 'Configure' if necessary), you should get something like that:
</p>
<div style="max-width: 100%;">
<div style="max-width: 100%;"><a href="/doc/wiki/index.php?title=File:Cmake_final.jpg" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;"><img alt="Cmake final.jpg" src="https://www.cloudcompare.org/doc/wiki/images/3/32/Cmake_final.jpg" width="1088" height="983" class="" style="max-width: 100%; margin: 0.5em auto; display: block; height: auto;"></a></div>
</div>
<p style="max-width: 100%;">Click on the 'Generate' button to create the corresponding project files.
</p>
<h2 style="font-weight: bold; font-size: 1.43em; max-width: 100%;"><span style="max-width: 100%;">Compiling the project</span></h2>
<p style="max-width: 100%;">Open the resulting project with the generator you have previously chosen (the file(s) should be where you told CMake to
<i style="max-width: 100%;">build the binaries</i> - e.g. <span style="max-width: 100%;">
<i style="max-width: 100%;">C:\trunk_CC\build</i></span>). </p>
<p style="max-width: 100%;">You should (always?) found the two following configuration/sub-projects:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;"><span style="max-width: 100%;">'build all'</span> should do all the compilation work (in the right order) but the binaries and libraries will be generated (by default) among all the other compilation files, in a somewhat complicated
 folder tree structure. </li><li style="max-width: 100%;"><span style="max-width: 100%;">'install'</span> should export all these files to the CMAKE_INSTALL_PREFIX folder, placing everything where it should be (and almost exactly as the official binary build)</li></ol>
<h3 style="font-weight: bold; font-size: 1.25em; max-width: 100%;"><span style="max-width: 100%;">Working with Visual Studio on Windows</span></h3>
<p style="max-width: 100%;">As all the files (executables, plugins and other DLLs) are copied in the CMAKE_INSTALL_PREFIX directory, the standard Visual Studio mechanism is broken and you won't be able to 'run' the CloudCompare or ccViewer projects as is. See
<a rel="nofollow" href="http://www.danielgm.net/cc/forum/viewtopic.php?t=992" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
this post</a> on the forum to setup Visual correctly. </p>
<h1 style="font-weight: bold; font-size: 1.5em; line-height: 1.4em; max-width: 100%;">
<span style="max-width: 100%;">Appendix</span></h1>
<p style="max-width: 100%;"><span style="max-width: 100%;"></span></p>
<h2 style="font-weight: bold; font-size: 1.43em; max-width: 100%;"><span style="max-width: 100%;">Common issues</span></h2>
<p style="max-width: 100%;">On Linux, you may encounter issues with shared libraries (.so files) if the project is not installed in
<span style="max-width: 100%;"><i style="max-width: 100%;">/usr</i></span>. In this case:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;">either set the <span style="max-width: 100%;">LD_LIBRARY_PATH</span> variable so that it points to the qCC and ccViewer installation folders (<span style="max-width: 100%;"><i style="max-width: 100%;">export LD_LIBRARY_PATH=...</i></span>).
</li><li style="max-width: 100%;">or call 'sudo /sbin/ldconfig -v' once as suggested <a rel="nofollow" href="http://www.danielgm.net/cc/forum/viewtopic.php?f=10&t=195&p=602#p600" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
here</a></li></ol>
<p style="max-width: 100%;">If you use a version of Qt older than 4.7, you'll get issues with "QElapsedTimer" (for instance with Ubuntu Lucid or Scientific Linux). In this case you'll have to replace the "#include <QElapsedTimer>" lines by:
</p>
<div class="scrollable" style="max-width: 100%; overflow-x: scroll; word-wrap: normal;">
<pre style="white-space: pre-wrap; max-width: 100%; font-size: 0.9em; line-height: 1.45em;">        //#include <QElapsedTimer>
        #include <QTime>
        typedef QTime QElapsedTimer;
</pre>
</div>
<div class="scrollable" style="max-width: 100%; overflow-x: scroll; word-wrap: normal;">
<pre style="white-space: pre-wrap; max-width: 100%; font-size: 0.9em; line-height: 1.45em;">       (in cloudcompare/libs/qCC_db/ccTimer.h , after //Qt
        in cloudcompare/libs/qCC/ccCommandLineParse.cpp , after #include <QDateTime>
        in cloudcompare/libs/qCC/ccComparisonDlg.cpp , after //Qt
        in cloudcompare/libs/qCC/ccGLWindow.cpp , after #include <QWheelEvent>
        in cloudcompare/libs/qCC/ccSubsamplingDlg.cpp , after //Qt
        in cloudcompare/libs/qCC/mainwindow.cpp , after #include <QMessageBox>)
</pre>
</div>
<h2 style="font-weight: bold; font-size: 1.43em; max-width: 100%;"><span style="max-width: 100%;">Compiling the 64 bits version with Qt 4.8 on Windows</span></h2>
<p style="max-width: 100%;">Here are several "hints" regarding the compilation on Windows 64 bits:
</p>
<ol style="max-width: 100%;">
<li style="max-width: 100%;">if only Visual 2010 Express is installed, Cmake will require you to install Microsoft Windows SDK 7.1
</li><li style="max-width: 100%;">to compile with Visual 2010 you must then apply the following patch:
<a rel="nofollow" href="http://support.microsoft.com/kb/2280741" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
[3]</a> (this solves a bug from the MSVC 2010 compiler that prevents Qt from running correctly in release mode)
</li><li style="max-width: 100%;">you'll also have to compile Qt 4.8 yourself, as Nokia never provided the corresponding binaries:
<ol style="max-width: 100%;">
<li style="max-width: 100%;">download and decompress the Qt sources </li><li style="max-width: 100%;">start the Microsoft Windows SDK 7.1 command line mode with the dedicated shortcut (you'll have to add "/Release" at the end of the shortcut - edit the shortcut properties for that). Something like: << C:\Windows\System32\cmd.exe
 /E:ON /V:ON /T:0E /K "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /Release >>
</li><li style="max-width: 100%;">if you don't have perl installed, just delete the "bin/syncqt.bat" file
</li><li style="max-width: 100%;">And follow this <a rel="nofollow" href="http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/" style="color: rgb(65, 110, 210); max-width: 100%; text-decoration: underline;">
guide</a></li></ol>
</li></ol>
<p style="max-width: 100%;">Otherwise use Visual 2012 with Qt 5 64 bits ;) </p>
<!-- 
NewPP limit report
Cached time: 20180727013501
Cache expiry: 86400
Dynamic content: false
CPU time usage: 0.069 seconds
Real time usage: 0.070 seconds
Preprocessor visited node count: 108/1000000
Preprocessor generated node count: 148/1000000
Post‐expand include size: 0/2097152 bytes
Template argument size: 0/2097152 bytes
Highest expansion depth: 2/40
Expensive parser function count: 0/100
--><!-- 
Transclusion expansion time report (%,ms,calls,template)
100.00%    0.000      1 - -total
--><!-- Saved in parser cache with key danielgm_wiki:pcache:idhash:50-0!*!*!!en!5!* and timestamp 20180727013501 and revision id 47013
 --></div>
</div>
</div>
<br>
<br>
<div id="AppleMailSignature"><span style="font-family: Helvetica; font-size: medium; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); -webkit-text-size-adjust: auto; ">Sent
 from my handheld device</span></div>
</body>
</html>