diff --git a/CMakeLists.txt b/CMakeLists.txt index 91429ee31..c3b2ccb20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,14 +3,21 @@ project(LAS_VEGAS VERSION 2) # OPTIONS option(BUILD_EXAMPLES "Build the examples" OFF) +option(BUILD_VIEWER "Build lvr2_viewer" OFF) +option(BUILD_TOOLS "Build tools including lvr2_reconstruct" ON) +option(BUILD_TOOLS_EXPERIMENTAL "Build experimental tools" OFF) +option(WITH_DRACO "Build libraries with draco enabled" OFF) set_property(GLOBAL PROPERTY USE_FOLDERS On) set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON) + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) include(GNUInstallDirs) + + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) @@ -54,9 +61,6 @@ if(MSVC) list(APPEND LVR2_DEFINITIONS -DNOMINMAX) else(MSVC) add_compile_options(-fmessage-length=0 -fPIC -Wno-deprecated) - # with cmake 3.3 - add_compile_options($<$:-std=c++1z>) - set(CMAKE_CXX_STANDARD 17) endif(MSVC) ############################################################################### @@ -86,7 +90,7 @@ endif(GDAL_FOUND) #------------------------------------------------------------------------------ option(WITH_CUDA "Compile with CUDA support" ON) if(NOT APPLE AND WITH_CUDA) -find_package( CUDA 8) +find_package( CUDA ) if(CUDA_FOUND) message(STATUS "Found CUDA") include_directories(${CUDA_INCLUDE_DIRS}) @@ -160,63 +164,75 @@ endif() #------------------------------------------------------------------------------ # Searching for Draco #------------------------------------------------------------------------------ +if(WITH_DRACO) find_package(Draco) if(draco_FOUND) message(STATUS "Found Draco") include_directories(${draco_INCLUDE_DIRS}) list(APPEND LVR2_DEFINITIONS -DLVR2_USE_DRACO) endif(draco_FOUND) +else(WITH_DRACO) + set(draco_FOUND False) +endif(WITH_DRACO) #------------------------------------------------------------------------------ # Searching for VTK #------------------------------------------------------------------------------ -set(VTK_QT_VERSION 5) -find_package(VTK REQUIRED) +if(BUILD_VIEWER) +#------ +# Here I assume VTK is only required for the lvr2_viewer +# - VTK doesnt occur in the core library +#------ -if(DEFINED VTK_MAJOR_VERSION AND VTK_MAJOR_VERSION VERSION_EQUAL "8") - # patched QVTKOpenGL header because of name clash with signals. - add_subdirectory(ext/QVTKOpenGLWidget) - include_directories(BEFORE ${QVTK_PATCHED_INCLUDE_DIR} ) - list(APPEND LVR2_INSTALL_INCLUDE_DIRS ${QVTK_PATCHED_INCLUDE_DIR}) + set(VTK_QT_VERSION 5) + find_package(VTK REQUIRED) - list(APPEND LVR2_DEFINITIONS -DLVR2_USE_VTK8) -endif() + if(DEFINED VTK_MAJOR_VERSION AND VTK_MAJOR_VERSION VERSION_EQUAL "8") + # patched QVTKOpenGL header because of name clash with signals. + add_subdirectory(ext/QVTKOpenGLWidget) + include_directories(BEFORE ${QVTK_PATCHED_INCLUDE_DIR} ) + list(APPEND LVR2_INSTALL_INCLUDE_DIRS ${QVTK_PATCHED_INCLUDE_DIR}) -if(DEFINED VTK_MAJOR_VERSION AND VTK_MAJOR_VERSION VERSION_LESS "6") - list(APPEND LVR2_DEFINITIONS -DLVR2_USE_VTK5) -endif() + list(APPEND LVR2_DEFINITIONS -DLVR2_USE_VTK8) + endif() -if(VTK_MAJOR_VERSION VERSION_EQUAL "7") - if(VTK_MINOR_VERSION VERSION_GREATER "0") - list(APPEND LVR2_DEFINITIONS -DLVR2_USE_VTK_GE_7_1) - endif() -endif() + if(DEFINED VTK_MAJOR_VERSION AND VTK_MAJOR_VERSION VERSION_LESS "6") + list(APPEND LVR2_DEFINITIONS -DLVR2_USE_VTK5) + endif() -if(VTK_MAJOR_VERSION VERSION_GREATER "7") - list(APPEND LVR2_DEFINITIONS -DLVR2_USE_VTK_GE_7_1) -endif() + if(VTK_MAJOR_VERSION VERSION_EQUAL "7") + if(VTK_MINOR_VERSION VERSION_GREATER "0") + list(APPEND LVR2_DEFINITIONS -DLVR2_USE_VTK_GE_7_1) + endif() + endif() -if(VTK_VERSION VERSION_GREATER "7") + if(VTK_MAJOR_VERSION VERSION_GREATER "7") + list(APPEND LVR2_DEFINITIONS -DLVR2_USE_VTK_GE_7_1) + endif() - list(APPEND LVR2_DEFINITIONS -DLVR2_USE_VTK_GE_7_1) - set(VTK_COMPONENTS "${VTK_AVAILABLE_COMPONENTS}") - set(VTK_HAS_QT OFF) - foreach(VTK_COMPONENT ${VTK_COMPONENTS}) - if("${VTK_COMPONENT}" STREQUAL "GUISupportQt") - set(VTK_HAS_QT ON) - endif() - endforeach() + if(VTK_VERSION VERSION_GREATER "7") - message(STATUS "VTK > 7 found") - if(VTK_HAS_QT) - message(STATUS "Found VTK compoment QVTK") + list(APPEND LVR2_DEFINITIONS -DLVR2_USE_VTK_GE_7_1) + set(VTK_COMPONENTS "${VTK_AVAILABLE_COMPONENTS}") + set(VTK_HAS_QT OFF) + foreach(VTK_COMPONENT ${VTK_COMPONENTS}) + if("${VTK_COMPONENT}" STREQUAL "GUISupportQt") + set(VTK_HAS_QT ON) + endif() + endforeach() + + message(STATUS "VTK > 7 found") + if(VTK_HAS_QT) + message(STATUS "Found VTK compoment QVTK") + endif() endif() -endif() + +endif(BUILD_VIEWER) #------------------------------------------------------------------------------ # Searching for NABO #------------------------------------------------------------------------------ -find_package(Nabo) +find_package(NABO) if(NABO_FOUND) include_directories(${NABO_INCLUDE_DIRS}) list(APPEND LVR2_DEFINITIONS -DLVR2_USE_NABO) @@ -426,17 +442,19 @@ option(WITH_KINFU "Compile LVR Kinfu" OFF) # compatible to gcc4.8. Older CUDA versions require GCC lower # than 4.8 ############################################################################### -if(CUDA_FOUND AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" - AND CUDA_VERSION VERSION_GREATER 8 - AND CUDA_VERSION VERSION_LESS 10) - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5 ) - message(STATUS "******************************************************************") - message(STATUS "* Your gcc version needs to be lower than 6 to compile the LVR *") - message(STATUS "* CUDA library and apps with CUDA. Setting CUDA_HOST_COMPILER to *") - message(STATUS "* g++-6*. Please ensure that g++ 6 is installed on your system. *") - message(STATUS "******************************************************************") - set(CUDA_HOST_COMPILER "g++-6" CACHE STRING "" FORCE) - endif() +if(CUDA_FOUND) + include(max_cuda_gcc_version) + max_cuda_gcc_version(CUDA_VERSION MAX_CUDA_GCC_VERSION) + message(STATUS "Highest supported GCC version for CUDA: ${MAX_CUDA_GCC_VERSION}") + + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER ${MAX_CUDA_GCC_VERSION}) + message(STATUS "******************************************************************") + message(STATUS "* Your gcc version needs to be lower than or equal ${MAX_CUDA_GCC_VERSION} to compile *") + message(STATUS "* the CUDA library and apps. Setting CUDA_HOST_COMPILER to *") + message(STATUS "* g++-${MAX_CUDA_GCC_VERSION}. Please ensure that g++-${MAX_CUDA_GCC_VERSION} is installed on your system. *") + message(STATUS "******************************************************************") + set(CUDA_HOST_COMPILER "g++-${MAX_CUDA_GCC_VERSION}" CACHE STRING "" FORCE) + endif() endif() if(CUDA_FOUND AND "${OpenCV_VERSION_PATCH}" VERSION_GREATER "8" AND WITH_KINFU) @@ -472,12 +490,9 @@ endif() ############################################################################### # HEADERS ############################################################################### - install(DIRECTORY include/lvr2 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) list(APPEND LVR2_INSTALL_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}) - - ############################################################################### # VTK use file include. Has to be called after all CUDA code # was generated and compiled. The VTK definitions corrupt the @@ -492,19 +507,20 @@ endif() ############################################################################### # LVR2 VIEWER CHECKS ############################################################################### - -find_package(Qt5 COMPONENTS Core Widgets Xml OpenGL) -if(Qt5_FOUND) - message(STATUS "Found QT5") - find_package(QVTK) - if(QVTK_FOUND) - message(STATUS "Found QVTK ${QVTK_INCLUDE_DIR}") - include_directories(${QVTK_INCLUDE_DIR}) - add_subdirectory(src/tools/lvr2_viewer) - elseif(DEFINED VTK_VERSION AND VTK_VERSION VERSION_GREATER "7" AND VTK_HAS_QT) - add_subdirectory(src/tools/lvr2_viewer) - endif(QVTK_FOUND) -endif(Qt5_FOUND) +if(BUILD_VIEWER) + find_package(Qt5 COMPONENTS Core Widgets Xml OpenGL) + if(Qt5_FOUND) + message(STATUS "Found QT5") + find_package(QVTK) + if(QVTK_FOUND) + message(STATUS "Found QVTK ${QVTK_INCLUDE_DIR}") + include_directories(${QVTK_INCLUDE_DIR}) + add_subdirectory(src/tools/lvr2_viewer) + elseif(DEFINED VTK_VERSION AND VTK_VERSION VERSION_GREATER "7" AND VTK_HAS_QT) + add_subdirectory(src/tools/lvr2_viewer) + endif(QVTK_FOUND) + endif(Qt5_FOUND) +endif(BUILD_VIEWER) ############################################################################### # LVR2 ASCII VIEWER CHECKS @@ -584,45 +600,51 @@ add_subdirectory(src/liblvr2) # BINARIES ############################################################################### -add_subdirectory(src/tools/lvr2_reconstruct) -add_subdirectory(src/tools/lvr2_dmc_reconstruction) -add_subdirectory(src/tools/lvr2_gs_reconstruction) -add_subdirectory(src/tools/lvr2_largescale_reconstruct) -add_subdirectory(src/tools/lvr2_asciiconverter) -add_subdirectory(src/tools/lvr2_transform) -add_subdirectory(src/tools/lvr2_kaboom) -add_subdirectory(src/tools/lvr2_octree_test) -add_subdirectory(src/tools/lvr2_image_normals) -add_subdirectory(src/tools/lvr2_plymerger) -# add_subdirectory(src/tools/lvr2_hdf5_builder) -add_subdirectory(src/tools/lvr2_hdf5_builder_2) -add_subdirectory(src/tools/lvr2_hdf5_mesh_builder) -add_subdirectory(src/tools/lvr2_slam2hdf5) -add_subdirectory(src/tools/lvr2_hdf5togeotiff) -add_subdirectory(src/tools/lvr2_slam6d_merger) -add_subdirectory(src/tools/lvr2_chunking) -add_subdirectory(src/tools/lvr2_registration) -add_subdirectory(src/tools/lvr2_mesh_reducer) -add_subdirectory(src/tools/lvr2_chunking_server) -add_subdirectory(src/tools/lvr2_scanproject_parser) - -if(CURSES_FOUND AND embree_FOUND) - add_subdirectory(src/tools/lvr2_ascii_viewer) -endif() +if(BUILD_TOOLS) + add_subdirectory(src/tools/lvr2_reconstruct) + add_subdirectory(src/tools/lvr2_mesh_reducer) +endif(BUILD_TOOLS) + +if(BUILD_TOOLS_EXPERIMENTAL) + add_subdirectory(src/tools/lvr2_dmc_reconstruction) + add_subdirectory(src/tools/lvr2_gs_reconstruction) + add_subdirectory(src/tools/lvr2_largescale_reconstruct) + add_subdirectory(src/tools/lvr2_asciiconverter) + add_subdirectory(src/tools/lvr2_transform) + add_subdirectory(src/tools/lvr2_kaboom) + add_subdirectory(src/tools/lvr2_octree_test) + add_subdirectory(src/tools/lvr2_image_normals) + add_subdirectory(src/tools/lvr2_plymerger) + # add_subdirectory(src/tools/lvr2_hdf5_builder) + add_subdirectory(src/tools/lvr2_hdf5_builder_2) + add_subdirectory(src/tools/lvr2_hdf5_mesh_builder) + add_subdirectory(src/tools/lvr2_slam2hdf5) + add_subdirectory(src/tools/lvr2_hdf5togeotiff) + add_subdirectory(src/tools/lvr2_slam6d_merger) + add_subdirectory(src/tools/lvr2_chunking) + add_subdirectory(src/tools/lvr2_registration) + add_subdirectory(src/tools/lvr2_chunking_server) + add_subdirectory(src/tools/lvr2_scanproject_parser) + + if(CURSES_FOUND AND embree_FOUND) + add_subdirectory(src/tools/lvr2_ascii_viewer) + endif() -if (RiVLib_FOUND) - #add_subdirectory(src/tools/lvr2_riegl_project_converter) -endif() + if (RiVLib_FOUND) + #add_subdirectory(src/tools/lvr2_riegl_project_converter) + endif() -if(CUDA_FOUND) -# cuda_include_directories(ext/CTPL) - add_subdirectory(src/tools/lvr2_cuda_normals) -endif() + if(CUDA_FOUND) + # cuda_include_directories(ext/CTPL) + add_subdirectory(src/tools/lvr2_cuda_normals) + endif() -if(OPENCL_FOUND) - add_subdirectory(src/tools/lvr2_cl_normals) - add_subdirectory(src/tools/lvr2_cl_sor) -endif() + if(OPENCL_FOUND) + add_subdirectory(src/tools/lvr2_cl_normals) + add_subdirectory(src/tools/lvr2_cl_sor) + endif() + +endif(BUILD_TOOLS_EXPERIMENTAL) if(BUILD_EXAMPLES) add_subdirectory(examples) @@ -635,7 +657,7 @@ endif() include(CMakePackageConfigHelpers) set(INCLUDE_INSTALL_DIR include/) -set(LIB_INSTALL_DIR lib/) +set(LIB_INSTALL_DIR lib) set(SYSCONFIG_INSTALL_DIR etc/lvr2/) install(EXPORT lvr2Targets @@ -664,7 +686,7 @@ install(FILES CMakeModules/FindEigen3.cmake CMakeModules/FindFLANN.cmake CMakeModules/FindLz4.cmake - CMakeModules/FindNabo.cmake + CMakeModules/FindNABO.cmake CMakeModules/FindOpenNI.cmake CMakeModules/FindOpenNI2.cmake CMakeModules/FindQVTK.cmake @@ -695,3 +717,5 @@ if( DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND ) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMENT "Generating API documentation with Doxygen" VERBATIM ) endif( DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND ) + + diff --git a/CMakeModules/FindLz4.cmake b/CMakeModules/FindLz4.cmake index da6ecd961..4ba578fbd 100644 --- a/CMakeModules/FindLz4.cmake +++ b/CMakeModules/FindLz4.cmake @@ -42,18 +42,18 @@ find_path(LZ4_INCLUDE_DIR lz4.h PATHS ) find_library(LZ4_LIB_PATH NAMES liblz4.so liblz4.dylib PATHS ${LZ4_SEARCH_LIB_PATH} NO_DEFAULT_PATH) +find_library(LZ4_STATIC_LIB NAMES liblz4.a PATHS ${LZ4_SEARCH_LIB_PATH} NO_DEFAULT_PATH) message(STATUS "Header ${LZ4_INCLUDE_DIR} LIB ") if (LZ4_INCLUDE_DIR AND LZ4_LIB_PATH) set(LZ4_FOUND TRUE) set(LZ4_LIBS ${LZ4_SEARCH_LIB_PATH}) - set(LZ4_STATIC_LIB ${LZ4__LIB_PATH}/liblz4.a) # mac os is using dylib instead of so for lz4 if (APPLE) set(LZ4_LIBRARY liblz4.dylib) else () - set(LZ4_LIBRARY liblz4.so) + set(LZ4_LIBRARY ${LZ4_LIB_PATH}) endif () else () set(LZ4_FOUND FALSE) diff --git a/CMakeModules/FindNabo.cmake b/CMakeModules/FindNABO.cmake similarity index 100% rename from CMakeModules/FindNabo.cmake rename to CMakeModules/FindNABO.cmake diff --git a/CMakeModules/FindQVTK.cmake b/CMakeModules/FindQVTK.cmake index b203afc03..34f80d976 100644 --- a/CMakeModules/FindQVTK.cmake +++ b/CMakeModules/FindQVTK.cmake @@ -13,7 +13,7 @@ find_package(VTK) -find_path (QVTK_INCLUDE_DIR QVTKWidget.h HINT ${VTK_INCLUDE_DIRS}) +find_path (QVTK_INCLUDE_DIR QVTKOpenGLWidget.h HINT ${VTK_INCLUDE_DIRS}) if(VTK_MAJOR_VERSION VERSION_LESS "6") find_library (QVTK_LIBRARY QVTK HINTS ${VTK_DIR} ${VTK_DIR}/bin diff --git a/CMakeModules/max_cuda_gcc_version.cmake b/CMakeModules/max_cuda_gcc_version.cmake new file mode 100644 index 000000000..91da1d7d0 --- /dev/null +++ b/CMakeModules/max_cuda_gcc_version.cmake @@ -0,0 +1,51 @@ +# CUDA GCC Compatibility +# See here: https://stackoverflow.com/questions/6622454/cuda-incompatible-with-my-gcc-version + +# CUDA version max GCC version +# 11.4.1+, 11.5 11 +# 11.1, 11.2, 11.3, 11.4.0 10 +# 11 9 +# 10.1, 10.2 8 +# 9.2, 10.0 7 +# 9.0, 9.1 6 +# 8 5.3 +# 7 4.9 +# 5.5, 6 4.8 +# 4.2, 5 4.6 +# 4.1 4.5 +# 4.0 4.4 + +# Usage: +# max_cuda_gcc_version(CUDA_VERSION MAX_CUDA_GCC_VERSION) +# message(STATUS "Maximum allowed gcc version for cuda is: ${MAX_CUDA_GCC_VERSION}") +function(max_cuda_gcc_version _CUDA_VERSION _MAX_GCC_VERSION) + +if(${_CUDA_VERSION} VERSION_GREATER_EQUAL 12.0.0) + set(${_MAX_GCC_VERSION} 12 PARENT_SCOPE) +elseif(${_CUDA_VERSION} VERSION_GREATER 11.4.0) # 11.4.1+, 11.5 -> 11 + set(${_MAX_GCC_VERSION} 11 PARENT_SCOPE) +elseif(${_CUDA_VERSION} VERSION_GREATER 11.0) # 11.1, 11.2, 11.3, 11.4.0 -> 10 + set(${_MAX_GCC_VERSION} 10 PARENT_SCOPE) +elseif(${_CUDA_VERSION} VERSION_GREATER 10.2) # 11 -> 9 + set(${_MAX_GCC_VERSION} 9 PARENT_SCOPE) +elseif(${_CUDA_VERSION} VERSION_GREATER 10.0) # 10.1 10.2 -> 8 + set(${_MAX_GCC_VERSION} 8 PARENT_SCOPE) +elseif(${_CUDA_VERSION} VERSION_GREATER 9.1) # 9.2 10.0 -> 7 + set(${_MAX_GCC_VERSION} 7 PARENT_SCOPE) +elseif(${_CUDA_VERSION} VERSION_GREATER 8) # 9.0 9.1 -> 6 + set(${_MAX_GCC_VERSION} 6 PARENT_SCOPE) +elseif(${_CUDA_VERSION} VERSION_GREATER 7) # 8 -> 5.3 + set(${_MAX_GCC_VERSION} 5.3 PARENT_SCOPE) +elseif(${_CUDA_VERSION} VERSION_GREATER 6) # 7 -> 4.9 + set(${_MAX_GCC_VERSION} 4.9 PARENT_SCOPE) +elseif(${_CUDA_VERSION} VERSION_GREATER 5.4) # 5.5 6 -> 4.8 + set(${_MAX_GCC_VERSION} 4.8 PARENT_SCOPE) +elseif(${_CUDA_VERSION} VERSION_GREATER 4.1) # 4.2 5 -> 4.6 + set(${_MAX_GCC_VERSION} 4.6 PARENT_SCOPE) +elseif(${_CUDA_VERSION} VERSION_GREATER 4.0) # 4.1 -> 4.5 + set(${_MAX_GCC_VERSION} 4.5 PARENT_SCOPE) +elseif(${_CUDA_VERSION} VERSION_GREATER 3) # 4.0 -> 4.4 + set(${_MAX_GCC_VERSION} 4.4 PARENT_SCOPE) +endif() + +endfunction() \ No newline at end of file diff --git a/LVR2Config.cmake.in b/LVR2Config.cmake.in index f92ea8bc8..aa92103fa 100644 --- a/LVR2Config.cmake.in +++ b/LVR2Config.cmake.in @@ -27,12 +27,16 @@ set(LVR2_DEFINITIONS @LVR2_DEFINITIONS@) find_package(PkgConfig REQUIRED) +set(LVR2_LIB_DIR @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@) + option(LVR2_USE_STATIC_LIBS OFF) if(LVR2_USE_STATIC_LIBS) - find_library(LVR2_LIBRARY NAMES lvr2_static) + # find_library(LVR2_LIBRARY NAMES lvr2_static) + set(LVR2_LIBRARY ${LVR2_LIB_DIR}/liblvr2_static.so) set(LVR2_LIBRARIES ${LVR2_LIBRARY}) else() - find_library(LVR2_LIBRARY NAMES lvr2) + # find_library(LVR2_LIBRARY NAMES lvr2) + set(LVR2_LIBRARY ${LVR2_LIB_DIR}/liblvr2.so) set(LVR2_LIBRARIES ${LVR2_LIBRARY}) endif() @@ -48,7 +52,7 @@ list(APPEND LVR2_DEFINITIONS ${VTK_DEFINTIONS}) # nabo if(@NABO_FOUND@) - find_package(Nabo REQUIRED) + find_package(NABO REQUIRED) list(APPEND LVR2_INCLUDE_DIRS ${NABO_INCLUDE_DIRS}) endif() diff --git a/ext/HighFive/CMake/portability/CheckCXX11Portability.cmake b/ext/HighFive/CMake/portability/CheckCXX11Portability.cmake index 525f054a4..32ebfe11e 100644 --- a/ext/HighFive/CMake/portability/CheckCXX11Portability.cmake +++ b/ext/HighFive/CMake/portability/CheckCXX11Portability.cmake @@ -16,6 +16,6 @@ endif() if(NOT CXX11_INCOMPATIBLE_COMPILER) set(CMAKE_REQUIRED_QUIET ON) - CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) + # CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) endif() diff --git a/ext/HighFive/CMakeLists.txt b/ext/HighFive/CMakeLists.txt index bad30f6a0..25955a0ab 100644 --- a/ext/HighFive/CMakeLists.txt +++ b/ext/HighFive/CMakeLists.txt @@ -22,8 +22,6 @@ option(USE_BOOST "enable Boost Support" TRUE) option(HIGHFIVE_EXAMPLES "Compile examples" TRUE) option(HIGHFIVE_PARALLEL_HDF5 "Enable Parallel HDF5 support" FALSE) -set(HIGHFIVE_CPP_STD_FLAG "-std=c++11" CACHE STRING "flag to use to enforce c++ standard (default:c++11)") - if(HIGHFIVE_PARALLEL_HDF5) set(HDF5_PREFER_PARALLEL TRUE) endif() @@ -42,9 +40,9 @@ if(HIGHFIVE_PARALLEL_HDF5) find_package(MPI) endif() -if(NOT COMPILER_SUPPORTS_CXX11) - message(FATAL "HighFive version >=2.0 requires c++ standard >= c++11") -endif() +# if(NOT COMPILER_SUPPORTS_CXX11) +# message(FATAL "HighFive version >=2.0 requires c++ standard >= c++11") +# endif() # Absolute include used to avoid interaction with downstream projects including # HighFive as a subproject and using the the same filename diff --git a/ext/kintinuous/qt_app/KinfuMainWindow.ui b/ext/kintinuous/qt_app/KinfuMainWindow.ui index 01bd6be0b..5df4b9513 100644 --- a/ext/kintinuous/qt_app/KinfuMainWindow.ui +++ b/ext/kintinuous/qt_app/KinfuMainWindow.ui @@ -211,7 +211,7 @@ - + @@ -233,9 +233,9 @@ - QVTKWidget + QVTKOpenGLWidget QWidget -
QVTKWidget.h
+
QVTKOpenGLWidget.h
diff --git a/ext/slam6d/CMakeLists.txt b/ext/slam6d/CMakeLists.txt index 592c3f11c..56833f17c 100644 --- a/ext/slam6d/CMakeLists.txt +++ b/ext/slam6d/CMakeLists.txt @@ -14,7 +14,6 @@ set(SLAM_SOURCES searchTree.cc scan_io_oct.cc ) -set_source_files_properties(${SLAM_SOURCES} PROPERTIES COMPILE_FLAGS "-std=gnu++0x") add_library(lvr2slam6d_static STATIC ${SLAM_SOURCES}) diff --git a/include/lvr2/io/descriptions/ScanProjectSchema.hpp b/include/lvr2/io/descriptions/ScanProjectSchema.hpp index 3023da664..dafdf78a1 100644 --- a/include/lvr2/io/descriptions/ScanProjectSchema.hpp +++ b/include/lvr2/io/descriptions/ScanProjectSchema.hpp @@ -61,6 +61,7 @@ class ScanProjectSchema d.groupName = group; d.dataSetName = "timestamps"; d.metaData = boost::none; + return d; } virtual Description hyperSpectralFrames(const std::string& group) const @@ -70,6 +71,7 @@ class ScanProjectSchema d.groupName = group; d.dataSetName = "frames"; d.metaData = boost::none; + return d; } protected: @@ -95,4 +97,4 @@ using HDF5SchemaPtr = std::shared_ptr; } // namespace lvr2 -#endif \ No newline at end of file +#endif diff --git a/package.xml b/package.xml index c0a238ee5..ceddd69ad 100644 --- a/package.xml +++ b/package.xml @@ -1,5 +1,5 @@ - + lvr2 20.11.3 @@ -31,22 +31,16 @@ The Las Vegas Surface Reconstruction Toolkit is an Open Source toolkit to recons libgdal-dev eigen ocl-icd-opencl-dev - libvtk - libvtk-qt boost glut libxi-dev libxmu-dev libhdf5-dev - qtbase5-dev - libqt5-opengl-dev lz4 libopencv-dev yaml-cpp - cmake - - cmake + ament_cmake diff --git a/src/liblvr2/CMakeLists.txt b/src/liblvr2/CMakeLists.txt index 68eedb932..9f667f4d8 100644 --- a/src/liblvr2/CMakeLists.txt +++ b/src/liblvr2/CMakeLists.txt @@ -149,15 +149,6 @@ set(LVR2_INTERNAL_DEPENDENCIES_SHARED lvr2las lvr2slam6d) -##################################################################################### -# Set c++0x flags for gcc compilers (needed for boctree io) -##################################################################################### - -if(UNIX) - SET_SOURCE_FILES_PROPERTIES(io/BoctreeIO.cpp PROPERTIES COMPILE_FLAGS "-std=c++14") -endif(UNIX) - - ##################################################################################### # Compile object files for static and dynamic library ##################################################################################### @@ -200,25 +191,27 @@ endif( NOT MSVC) ##################################################################################### if(CUDA_FOUND) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # List of CUDA kernel code sources set(LVR2_CUDA_SRC reconstruction/cuda/CudaSurface.cu ) - # Fix broken VTK flags - get_directory_property(dir_defs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS) - set(vtk_flags) - foreach(it ${dir_defs}) - if(it MATCHES "vtk*") - list(APPEND vtk_flags ${it}) - endif() - endforeach() - - foreach(d ${vtk_flags}) - remove_definitions(-D${d}) - endforeach() + if(VTK_FOUND) + # Fix broken VTK flags + get_directory_property(dir_defs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS) + set(vtk_flags) + foreach(it ${dir_defs}) + if(it MATCHES "vtk*") + list(APPEND vtk_flags ${it}) + endif() + endforeach() + + foreach(d ${vtk_flags}) + remove_definitions(-D${d}) + endforeach() + endif(VTK_FOUND) message(STATUS "Building static LVR CUDA library") cuda_add_library(lvr2cuda_static STATIC ${LVR2_CUDA_SRC}) diff --git a/src/liblvr2/io/DracoEncoder.cpp b/src/liblvr2/io/DracoEncoder.cpp index d0b5927fc..ebd3bbd23 100644 --- a/src/liblvr2/io/DracoEncoder.cpp +++ b/src/liblvr2/io/DracoEncoder.cpp @@ -60,8 +60,7 @@ int saveAttributeToDraco(ArrayType array, draco::PointCloud* drcPointcloud, } draco::PointAttribute attribute; - attribute.Init(geometryType, nullptr, size, dracoDataType, normalized, sizeof(DataType) * size, - 0); + attribute.Init(geometryType, size, dracoDataType, normalized, sizeof(DataType) * size); int attribute_id = drcPointcloud->AddAttribute(attribute, true, numPoints); std::array tmp; @@ -678,4 +677,4 @@ std::unique_ptr encodeDraco(ModelPtr mod return std::unique_ptr(nullptr); } -} // namespace lvr \ No newline at end of file +} // namespace lvr diff --git a/src/liblvr2/io/descriptions/DirectoryKernel.cpp b/src/liblvr2/io/descriptions/DirectoryKernel.cpp index d0a76e4e5..f482aa992 100644 --- a/src/liblvr2/io/descriptions/DirectoryKernel.cpp +++ b/src/liblvr2/io/descriptions/DirectoryKernel.cpp @@ -78,6 +78,7 @@ MeshBufferPtr DirectoryKernel::loadMeshBuffer( { return model->m_mesh; } + return nullptr; } PointBufferPtr DirectoryKernel::loadPointBuffer( @@ -93,6 +94,7 @@ PointBufferPtr DirectoryKernel::loadPointBuffer( std::cout << model->m_pointCloud->numPoints() << std::endl; return model->m_pointCloud; } + return nullptr; } boost::optional DirectoryKernel::loadImage( @@ -211,4 +213,4 @@ void DirectoryKernel::saveUCharArray(const std::string& groupName, const std::st saveArray(groupName, datasetName, dimensions, data); } -} // namespace lvr2 \ No newline at end of file +} // namespace lvr2 diff --git a/src/liblvr2/io/descriptions/MetaFormatFactory.cpp b/src/liblvr2/io/descriptions/MetaFormatFactory.cpp index 922fbe3ec..b25d8716d 100644 --- a/src/liblvr2/io/descriptions/MetaFormatFactory.cpp +++ b/src/liblvr2/io/descriptions/MetaFormatFactory.cpp @@ -113,6 +113,7 @@ YAML::Node loadMetaInformation(const std::string &in) } return node; } + return YAML::Node(); } -} // namespace lvr2 \ No newline at end of file +} // namespace lvr2 diff --git a/src/tools/lvr2_largescale_reconstruct/CMakeLists.txt b/src/tools/lvr2_largescale_reconstruct/CMakeLists.txt index 6f98a0493..a4dbc4e32 100755 --- a/src/tools/lvr2_largescale_reconstruct/CMakeLists.txt +++ b/src/tools/lvr2_largescale_reconstruct/CMakeLists.txt @@ -17,6 +17,7 @@ set(LVR2_LS_RECONSTRUCT_DEPENDENCIES lvr2las_static lvr2rply_static ${LVR2_LIB_DEPENDENCIES} + ${LZ4_LIBRARY} ) ##################################################################################### diff --git a/src/tools/lvr2_reconstruct/CMakeLists.txt b/src/tools/lvr2_reconstruct/CMakeLists.txt index 4fba5a968..c8357c533 100644 --- a/src/tools/lvr2_reconstruct/CMakeLists.txt +++ b/src/tools/lvr2_reconstruct/CMakeLists.txt @@ -16,7 +16,9 @@ set(LVR2_RECONSTRUCT_DEPENDENCIES lvr2las_static lvr2rply_static lvr2slam6d_static + # TODO(lucasw) LZ4 should be in these already, but wasn't making it through in one case ${LVR2_LIB_DEPENDENCIES} + ${LZ4_LIBRARY} ) if(CUDA_FOUND) diff --git a/src/tools/lvr2_viewer/ui/LVRMainWindowUI.ui b/src/tools/lvr2_viewer/ui/LVRMainWindowUI.ui index ee694703f..774ceafa3 100644 --- a/src/tools/lvr2_viewer/ui/LVRMainWindowUI.ui +++ b/src/tools/lvr2_viewer/ui/LVRMainWindowUI.ui @@ -22,7 +22,7 @@ - + @@ -1582,9 +1582,9 @@ - QVTKWidget + QVTKOpenGLWidget QWidget -
QVTKWidget.h
+
QVTKOpenGLWidget.h
lvr2::LVRPlotter diff --git a/src/tools/lvr2_viewer/vtkBridge/LVRLabelInteractor.cpp b/src/tools/lvr2_viewer/vtkBridge/LVRLabelInteractor.cpp index 96b2b3f91..aea37ae8c 100644 --- a/src/tools/lvr2_viewer/vtkBridge/LVRLabelInteractor.cpp +++ b/src/tools/lvr2_viewer/vtkBridge/LVRLabelInteractor.cpp @@ -184,7 +184,7 @@ void LVRLabelInteractorStyle::labelSelectedPoints(QString label) void LVRLabelInteractorStyle::extractLabel() { - ofstream outfile("Test.txt"); + std::ofstream outfile("Test.txt"); for (int i = 0; i < m_pointLabels.size(); i++) { if (m_pointLabels[i] != 0)