November 25, 2015

CMake compile PCL 1.7.2 VTK 6.3 Qt 5.5 in VS2013 64bit

download compiled PCL with dependencies(you must have already installed QT 5.5)
https://drive.google.com/file/d/0B9NzHDWA7ywCWjZ0Vy04Tkk5Smc/view?usp=sharing

How to do it yourself


CMake
3.4.0
https://cmake.org
download and install
general hints:
-set source code dir and dir for build binaries (do not set it to the same folder for yourself :)
-tick Grouped and Advanced to better organize your variables
-use search for looking for variables
-to set a variable you cannot see use Add Entry button
-red variables are changes after last configure
-in appropriate BUILD_... variables turn on/off building examples and apps and tests
-set CMAKE_INSTALL_PREFIX to the folder where you want to get result in include, lib and bin directories
-set CMAKE_DEBUG_POSTFIX as a postfix for .dll and .lib debug files
-set special variables according to needs
-choose your compiler after you are asked for
-several times configure and change variables until successful configuration, then generate
-in build binaries dir you will find solution
-open solution in Visual Studio 2013 (as admin if you potentially set CMAKE_INSTALL_PREFIX to folders like Program Files, what is default) and build project INSTALL in both debug and release. It usually compiles ALL BUILD as its dependency.

Boost
1.59.0
http://www.boost.org
download already compiled version

Eigen
3.2.7
http://eigen.tuxfamily.org/index.php?title=Main_Page
download (library consists of only header files)

FLANN
1.8.4
http://www.cs.ubc.ca/research/flann
download source files and compile by CMake
BUILD_PYTHON_BINDINGS = OFF
BUILD_MATLAB_BINDINGS = OFF
edit flann/src/cpp/flann/util/serialization.h
after BASIC_TYPE_SERIALIZER(bool);// in version 1.8.4 line#91
add three lines
#ifdef _MSC_VER 
BASIC_TYPE_SERIALIZER(unsigned __int64);
#endif

QHULL
2012.1
http://www.qhull.org/download
download source files and compile by CMake

OpenNI2
2.2.0
http://structure.io/openni
download compiled

(not necessary, if you want to visualize 3D PointCloud or use QVTKwidget or pcl::visualization::PCLVisualizer inside QT widgets)
QT
5.5
http://www.qt.io/download-open-source
install

VTK
6.3.0
http://www.vtk.org/download
download source files and compile by CMake
if you do not need QT{
  you can use precompiled pcl with dependencies in
http://unanancyowen.com/?p=1255&lang=en
}
else {
VTK_Group_Qt = ON
VTK_QT_VERSION = 5
note this post, which explores similar problems as some our problems
http://vtk.1045678.n5.nabble.com/VTK-build-with-postfix-d-error-td5721543.html
ALL BUILD successful, but by INSTALL there are several issues
1. QVTKWidgetPlugin.dll appears not in bin directory, but in plugins/designer (I think better to relocate among other dlls)
2. in debug mode error arises, because it wants to find QVTKWidgetPlugin.dll but not my debug dll(according to GUISupport\Qt\PluginInstall.cmake). Easy fix is to rewrite by real name of debug dll in PluginInstall.cmake before INSTALL is build in debug
3. QVTKWidgetPlugin.lib and QVTKWidgetPlugin-gd.lib (in my case I added CMAKE_DEBUG_POSTFIX="-gd" for debug). Easy fix is to copy it on your own.
}

PCL
1.7.2
https://github.com/PointCloudLibrary/pcl/releases
download source files and compile by CMake

BUILD_visualization = ON
BUILD_apps... = OFF
BUILD_examples = OFF
BUILD_global_tests = OFF
BOOST_INCLUDE_DIR = parent of Boost folder
BOOST_LIBRARY_DIR_DEBUG = .../lib64-msvc-12.0
BOOST_LIBRARY_DIR_RELEASE = .../lib64-msvc-12.0
set BOOST_... to appropriate .lib files if not found automatically
EIGEN_INCLUDE_DIR  = parent of Eigen folder
FLANN_LIBRARY  = .../flann/lib/flann_cpp_s.lib
FLANN_LIBRARY_DEBUG  = .../flann/lib/flann_cpp_s-gd.lib (in my case was "-gd" the postfix in flann library)
set OPENNI2_INCLUDE_DIRS
set OPENNI2_LIBRARY to the .lib file
set QHULL_INCLUDE_DIR
set QHULL_LIBRARY to qhullstatic.lib
set QHULL_LIBRARY_DEBUG to qhullstatic_d.lib (in my case was "_d" the postfix in qhull library)
set VTK_DIR to folder where VTKConfig.cmake is (in my case .../lib/cmake/vtk-6.3)

for more information check
http://pointclouds.org/documentation/tutorials/compiling_pcl_windows.php
http://www.pointclouds.org/downloads/windows.html
http://stackoverflow.com/questions/26782972/c-cmake-flann-failling-when-building-pcl-in-vs2012

compiled builds with dependencies for vs 2012/2013/2015 without QT
http://unanancyowen.com/?p=1255&lang=en

No comments:

Post a Comment