diff --git a/doc/tutorials/content/sources/qt_colorize_cloud/CMakeLists.txt b/doc/tutorials/content/sources/qt_colorize_cloud/CMakeLists.txt index 60d279764bf..bcd391c604c 100644 --- a/doc/tutorials/content/sources/qt_colorize_cloud/CMakeLists.txt +++ b/doc/tutorials/content/sources/qt_colorize_cloud/CMakeLists.txt @@ -1,28 +1,31 @@ -cmake_minimum_required (VERSION 2.6 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.11) -project (pcl-colorize_cloud) -find_package (Qt4 REQUIRED) -find_package (VTK REQUIRED) -find_package (PCL 1.7.1 REQUIRED) +project(pcl_colorize_cloud) -include_directories (${PCL_INCLUDE_DIRS}) -link_directories (${PCL_LIBRARY_DIRS}) -add_definitions (${PCL_DEFINITIONS}) +# init_qt: Let's do the CMake job for us +set(CMAKE_AUTOMOC ON) # For meta object compiler +set(CMAKE_AUTORCC ON) # Resource files +set(CMAKE_AUTOUIC ON) # UI files -set (project_SOURCES main.cpp pclviewer.cpp) -set (project_HEADERS pclviewer.h) -set (project_FORMS pclviewer.ui) -set (VTK_LIBRARIES vtkRendering vtkGraphics vtkHybrid QVTK) +# Find includes in corresponding build directories +set(CMAKE_INCLUDE_CURRENT_DIR ON) -QT4_WRAP_CPP (project_HEADERS_MOC ${project_HEADERS}) -QT4_WRAP_UI (project_FORMS_HEADERS ${project_FORMS}) +# Find the QtWidgets library +find_package(Qt5 REQUIRED Widgets) -INCLUDE (${QT_USE_FILE}) -ADD_DEFINITIONS (${QT_DEFINITIONS}) +find_package(VTK REQUIRED) +find_package(PCL 1.7.1 REQUIRED) -ADD_EXECUTABLE (colorize_cloud ${project_SOURCES} - ${project_FORMS_HEADERS} - ${project_HEADERS_MOC}) +# Fix a compilation bug under ubuntu 16.04 (Xenial) +list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4") -TARGET_LINK_LIBRARIES (colorize_cloud ${QT_LIBRARIES} ${PCL_LIBRARIES} ${VTK_LIBRARIES}) +include_directories(${PCL_INCLUDE_DIRS}) +add_definitions(${PCL_DEFINITIONS}) +set(project_SOURCES main.cpp pclviewer.cpp) + +add_executable(${PROJECT_NAME} ${project_SOURCES}) + +target_link_libraries(${PROJECT_NAME} ${PCL_LIBRARIES}) + +qt5_use_modules(${PROJECT_NAME} Widgets) diff --git a/doc/tutorials/content/sources/qt_colorize_cloud/pclviewer.cpp b/doc/tutorials/content/sources/qt_colorize_cloud/pclviewer.cpp index 7ed3034a4a1..cbb21533115 100644 --- a/doc/tutorials/content/sources/qt_colorize_cloud/pclviewer.cpp +++ b/doc/tutorials/content/sources/qt_colorize_cloud/pclviewer.cpp @@ -1,5 +1,5 @@ #include "pclviewer.h" -#include "../build/ui_pclviewer.h" +#include "ui_pclviewer.h" PCLViewer::PCLViewer (QWidget *parent) : QMainWindow (parent), diff --git a/doc/tutorials/content/sources/qt_visualizer/CMakeLists.txt b/doc/tutorials/content/sources/qt_visualizer/CMakeLists.txt index 914dc610181..6eea0260c70 100644 --- a/doc/tutorials/content/sources/qt_visualizer/CMakeLists.txt +++ b/doc/tutorials/content/sources/qt_visualizer/CMakeLists.txt @@ -1,28 +1,31 @@ -cmake_minimum_required (VERSION 2.6 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.11) -project (pcl-visualizer) -find_package (Qt4 REQUIRED) -find_package (VTK REQUIRED) -find_package (PCL 1.7.1 REQUIRED) +project(pcl_visualizer) -include_directories (${PCL_INCLUDE_DIRS}) -link_directories (${PCL_LIBRARY_DIRS}) -add_definitions (${PCL_DEFINITIONS}) +# init_qt: Let's do the CMake job for us +set(CMAKE_AUTOMOC ON) # For meta object compiler +set(CMAKE_AUTORCC ON) # Resource files +set(CMAKE_AUTOUIC ON) # UI files -set (project_SOURCES main.cpp pclviewer.cpp) -set (project_HEADERS pclviewer.h) -set (project_FORMS pclviewer.ui) -set (VTK_LIBRARIES vtkRendering vtkGraphics vtkHybrid QVTK) +# Find includes in corresponding build directories +set(CMAKE_INCLUDE_CURRENT_DIR ON) -QT4_WRAP_CPP (project_HEADERS_MOC ${project_HEADERS}) -QT4_WRAP_UI (project_FORMS_HEADERS ${project_FORMS}) +# Find the QtWidgets library +find_package(Qt5 REQUIRED Widgets) -INCLUDE (${QT_USE_FILE}) -ADD_DEFINITIONS (${QT_DEFINITIONS}) +find_package(VTK REQUIRED) +find_package(PCL 1.7.1 REQUIRED) -ADD_EXECUTABLE (pcl_visualizer ${project_SOURCES} - ${project_FORMS_HEADERS} - ${project_HEADERS_MOC}) +# Fix a compilation bug under ubuntu 16.04 (Xenial) +list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4") -TARGET_LINK_LIBRARIES (pcl_visualizer ${QT_LIBRARIES} ${PCL_LIBRARIES} ${VTK_LIBRARIES}) +include_directories(${PCL_INCLUDE_DIRS}) +add_definitions(${PCL_DEFINITIONS}) +set(project_SOURCES main.cpp pclviewer.cpp) + +add_executable(${PROJECT_NAME} ${project_SOURCES}) + +target_link_libraries(${PROJECT_NAME} ${PCL_LIBRARIES}) + +qt5_use_modules(${PROJECT_NAME} Widgets) diff --git a/doc/tutorials/content/sources/qt_visualizer/pclviewer.cpp b/doc/tutorials/content/sources/qt_visualizer/pclviewer.cpp index beff918b1de..a38a40dfa98 100644 --- a/doc/tutorials/content/sources/qt_visualizer/pclviewer.cpp +++ b/doc/tutorials/content/sources/qt_visualizer/pclviewer.cpp @@ -1,5 +1,5 @@ #include "pclviewer.h" -#include "../build/ui_pclviewer.h" +#include "ui_pclviewer.h" PCLViewer::PCLViewer (QWidget *parent) : QMainWindow (parent),