From a248f91e55db10e7444087d740dbd6ce8e3c1a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20J=2E=20Padr=C3=B3n=20Gonz=C3=A1lez?= Date: Thu, 23 Apr 2020 11:04:22 +0200 Subject: [PATCH] Update CMake stuff to get it compiled in my up-to-date Debian system - Changes regarding PCL: + PCL now requires C++14 compatibility => std=gnu++14 instead of previous std=gnu++0x + PCL uses some Boost components I needed to include as link deps - Added GLVND as OpenGL preference --- CMakeLists.txt | 12 ++++++++---- src/CMakeLists.txt | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4cd51b..08b652c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ endif(NOT GLEW_FOUND) ######################################################### # FIND OPENGL ######################################################### +set(OpenGL_GL_PREFERENCE "GLVND") find_package(OpenGL REQUIRED) include_directories(${OpenGL_INCLUDE_DIRS}) link_directories(${OpenGL_LIBRARY_DIRS}) @@ -45,12 +46,15 @@ find_package(PCL 1.3 REQUIRED COMPONENTS common io features segmentation) include_directories(${PCL_INCLUDE_DIRS}) link_directories(${PCL_LIBRARY_DIRS}) add_definitions(${PCL_DEFINITIONS}) - - - +######################################################### +# FIND BOOST (used by PCL) +######################################################### +find_package(Boost REQUIRED COMPONENTS system) +link_directories(${BOOST_LIBRARY_DIRS}) +add_definitions(${BOOST_DEFINITIONS}) if(CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "-Wall -std=gnu++0x") + set(CMAKE_CXX_FLAGS "-Wall -std=gnu++14") endif() add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f93334b..d49846d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,7 +14,7 @@ add_executable(cube main.cpp globals.h globals.cpp file.h file.cpp vao.h vao.cpp ######################################################### # create the program -target_link_libraries(cube ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} ${GLFW_LIBRARIES} ${PCL_COMMON_LIBRARIES} ${PCL_IO_LIBRARIES} ${PCL_FEATURES_LIBRARIES} ${PCL_SEGMENTATION_LIBRARIES}) +target_link_libraries(cube ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} ${GLFW_LIBRARIES} ${PCL_COMMON_LIBRARIES} ${PCL_IO_LIBRARIES} ${PCL_FEATURES_LIBRARIES} ${PCL_SEGMENTATION_LIBRARIES} ${Boost_LIBRARIES}) if(CMAKE_GENERATOR STREQUAL Xcode) set_target_properties( cube PROPERTIES