From cde75737ae9d367282950a1a340f780fb38de34d Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 17 Sep 2024 19:14:29 +0200 Subject: [PATCH 01/18] First attempt at including the cmake system include dirs functionality in ViSP modules, allowing to ignore 3rd party warnings --- cmake/FindMyPanda3D.cmake | 2 +- cmake/VISPModule.cmake | 7 +++++-- cmake/VISPUtils.cmake | 38 ++++++++++++++++++++++++++++++-------- modules/ar/CMakeLists.txt | 19 +++++-------------- 4 files changed, 41 insertions(+), 25 deletions(-) diff --git a/cmake/FindMyPanda3D.cmake b/cmake/FindMyPanda3D.cmake index 22bbde66c8..fff1399d55 100644 --- a/cmake/FindMyPanda3D.cmake +++ b/cmake/FindMyPanda3D.cmake @@ -83,7 +83,7 @@ foreach(lib_name ${PANDA3D_LIBS}) endforeach() find_path(Panda3D_INCLUDE_DIRS panda.h PATHS ${PANDA3D_INCLUDE_SEARCH_PATHS}) -message(${Panda3D_INCLUDE_DIRS}) + include(FindPackageHandleStandardArgs) # Handle the QUIETLY and REQUIRED arguments and set the Panda3D_FOUND to TRUE # if all listed variables are TRUE diff --git a/cmake/VISPModule.cmake b/cmake/VISPModule.cmake index 0089104ad9..21d5365880 100644 --- a/cmake/VISPModule.cmake +++ b/cmake/VISPModule.cmake @@ -586,15 +586,18 @@ endfunction() # setup include paths for the list of passed modules macro(vp_target_include_modules target) + set(is_system "") foreach(d ${ARGN}) - if(d MATCHES "^visp_" AND HAVE_${d}) + if("${d}" STREQUAL "SYSTEM") + set(is_system "SYSTEM") + elseif(d MATCHES "^visp_" AND HAVE_${d}) if (EXISTS "${VISP_MODULE_${d}_LOCATION}/include") vp_target_include_directories(${target} "${VISP_MODULE_${d}_LOCATION}/include") endif() elseif(EXISTS "${d}") # FS keep external deps inc set(VISP_MODULE_${the_module}_INC_DEPS "${VISP_MODULE_${the_module}_INC_DEPS};${d}" CACHE INTERNAL "") - vp_target_include_directories(${target} "${d}") + vp_target_include_directories(${target} "${is_system}" "${d}") endif() endforeach() vp_list_unique(VISP_MODULE_${the_module}_INC_DEPS) diff --git a/cmake/VISPUtils.cmake b/cmake/VISPUtils.cmake index 6207c74f0f..b4cc098e8d 100644 --- a/cmake/VISPUtils.cmake +++ b/cmake/VISPUtils.cmake @@ -182,18 +182,26 @@ endfunction() # adds include directories in such way that directories from the ViSP source tree go first function(vp_target_include_directories target) set(__params "") + set(__system_params "") + set(__var_name __params) + foreach(dir ${ARGN}) - get_filename_component(__abs_dir "${dir}" ABSOLUTE) - string(REPLACE "+" "\\+" __VISP_BINARY_DIR_filtered ${VISP_BINARY_DIR}) -# if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}") # not compatible with cmake 2.8.12.2 - if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}") - list(APPEND __params "${__abs_dir}") - elseif("${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}") - list(APPEND __params "${__abs_dir}") + if("${dir}" STREQUAL "SYSTEM") + set(__var_name __system_params) else() - list(APPEND __params "${dir}") + get_filename_component(__abs_dir "${dir}" ABSOLUTE) + string(REPLACE "+" "\\+" __VISP_BINARY_DIR_filtered ${VISP_BINARY_DIR}) + # if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}") # not compatible with cmake 2.8.12.2 + if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}") + list(APPEND ${__var_name} "${__abs_dir}") + elseif("${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}") + list(APPEND ${__var_name} "${__abs_dir}") + else() + list(APPEND ${__var_name} "${dir}") + endif() endif() endforeach() + if(__params) if(TARGET ${target}) target_include_directories(${target} PRIVATE ${__params}) @@ -202,6 +210,16 @@ function(vp_target_include_directories target) set(VP_TARGET_INCLUDE_DIRS_${target} "${__new_inc}" CACHE INTERNAL "") endif() endif() + if(__system_params) + if(TARGET ${target}) + target_include_directories(${target} SYSTEM PRIVATE ${__system_params}) + else() + set(__new_inc ${VP_TARGET_INCLUDE_SYSTEM_DIRS_${target}}) + list(APPEND __new_inc ${__system_params}) + set(VP_TARGET_INCLUDE_SYSTEM_DIRS_${target} "${__new_inc}" CACHE INTERNAL "") + endif() + endif() + endfunction() # clears all passed variables @@ -780,6 +798,10 @@ function(_vp_append_target_includes target) target_include_directories(${target} PRIVATE ${VP_TARGET_INCLUDE_DIRS_${target}}) unset(VP_TARGET_INCLUDE_DIRS_${target} CACHE) endif() + if(DEFINED VP_TARGET_INCLUDE_SYSTEM_DIRS_${target}) + target_include_directories(${target} SYSTEM PRIVATE ${VP_TARGET_INCLUDE_SYSTEM_DIRS_${target}}) + unset(VP_TARGET_INCLUDE_SYSTEM_DIRS_${target} CACHE) + endif() endfunction() function(vp_add_executable target) diff --git a/modules/ar/CMakeLists.txt b/modules/ar/CMakeLists.txt index 4185627be7..cee2716121 100644 --- a/modules/ar/CMakeLists.txt +++ b/modules/ar/CMakeLists.txt @@ -35,6 +35,8 @@ # Add optional 3rd parties set(opt_incs "") +set(opt_system_incs "") + set(opt_libs "") if(USE_OGRE) @@ -175,7 +177,8 @@ endif() if(USE_PANDA3D) if(Panda3D_INCLUDE_DIRS) - list(APPEND opt_incs ${Panda3D_INCLUDE_DIRS}) + #vp_module_include_directories(SYSTEM ${Panda3D_INCLUDE_DIRS}) + list(APPEND opt_system_incs ${Panda3D_INCLUDE_DIRS}) endif() if(Panda3D_LIBRARIES) list(APPEND opt_libs ${Panda3D_LIBRARIES}) @@ -190,17 +193,5 @@ if(USE_OGRE) vp_set_source_file_compile_flag(src/ogre-simulator/vpAROgre.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) endif() -if(USE_PANDA3D) - set(PANDA3D_CXX_FLAGS -Wno-unused-parameter -Wno-unused-variable -Wno-extra -Wno-reorder-ctor) - set(PANDA3D_MODULE_SOURCES - vpPanda3DBaseRenderer.cpp vpPanda3DGeometryRenderer.cpp - vpPanda3DRGBRenderer.cpp vpPanda3DRenderParameters.cpp - vpPanda3DRendererSet.cpp vpPanda3DPostProcessFilter.cpp vpPanda3DCommonFilters.cpp - ) - foreach(panda_src_name ${PANDA3D_MODULE_SOURCES}) - vp_set_source_file_compile_flag(src/panda3d-simulator/${panda_src_name} ${PANDA3D_CXX_FLAGS}) - endforeach() -endif() - -vp_module_include_directories(${opt_incs}) +vp_module_include_directories(${opt_incs} SYSTEM ${opt_system_incs}) vp_create_module(${opt_libs}) From a1cc31089bd3237d2a57a929626a5dad3d4b235e Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 17 Sep 2024 19:23:32 +0200 Subject: [PATCH 02/18] Removed warning ignore in tutorial to check, still not working --- tutorial/ar/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tutorial/ar/CMakeLists.txt b/tutorial/ar/CMakeLists.txt index d8591335f6..56b03ae4e0 100644 --- a/tutorial/ar/CMakeLists.txt +++ b/tutorial/ar/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5) -project(color_segmentation) +project(tutorial-panda3d) find_package(VISP REQUIRED visp_core visp_gui visp_ar) @@ -9,7 +9,6 @@ set(tutorial_cpp tutorial-panda3d-renderer.cpp ) -visp_set_source_file_compile_flag(tutorial-panda3d-renderer.cpp -Wno-extra -Wno-unused-parameter -Wno-unused-variable) foreach(cpp ${tutorial_cpp}) visp_add_target(${cpp}) From aa5fb52786eb327c8e9fc1963835a3ddb9c88637 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Tue, 17 Sep 2024 21:17:04 +0200 Subject: [PATCH 03/18] Fixed system include exports to external targets --- cmake/VISPGenerateConfig.cmake | 2 ++ cmake/VISPModule.cmake | 11 ++++++++++- cmake/VISPUtils.cmake | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cmake/VISPGenerateConfig.cmake b/cmake/VISPGenerateConfig.cmake index 340cff6308..84710a2903 100644 --- a/cmake/VISPGenerateConfig.cmake +++ b/cmake/VISPGenerateConfig.cmake @@ -113,6 +113,8 @@ foreach(m ${VISP_MODULES_BUILD}) list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE "${VISP_MODULE_${m}_LOCATION}/include") endif() list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS}) + list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_SYSTEM_INC_DEPS}) + endforeach() vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE) diff --git a/cmake/VISPModule.cmake b/cmake/VISPModule.cmake index 21d5365880..24c1574f88 100644 --- a/cmake/VISPModule.cmake +++ b/cmake/VISPModule.cmake @@ -596,11 +596,17 @@ macro(vp_target_include_modules target) endif() elseif(EXISTS "${d}") # FS keep external deps inc - set(VISP_MODULE_${the_module}_INC_DEPS "${VISP_MODULE_${the_module}_INC_DEPS};${d}" CACHE INTERNAL "") + if(is_system) + set(VISP_MODULE_${the_module}_SYSTEM_INC_DEPS "${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS};${d}" CACHE INTERNAL "") + else() + set(VISP_MODULE_${the_module}_INC_DEPS "${VISP_MODULE_${the_module}_INC_DEPS};${d}" CACHE INTERNAL "") + endif() vp_target_include_directories(${target} "${is_system}" "${d}") endif() endforeach() vp_list_unique(VISP_MODULE_${the_module}_INC_DEPS) + vp_list_unique(VISP_MODULE_${the_module}_SYSTEM_INC_DEPS) + endmacro() # setup include paths for the list of passed modules and recursively add dependent modules @@ -834,6 +840,9 @@ macro(_vp_create_module) set_property(TARGET ${the_module} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_INC_DEPS} ) + set_property(TARGET ${the_module} APPEND PROPERTY + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS} + ) # For dynamic link numbering convenions if(NOT ANDROID) diff --git a/cmake/VISPUtils.cmake b/cmake/VISPUtils.cmake index b4cc098e8d..4a332e02a2 100644 --- a/cmake/VISPUtils.cmake +++ b/cmake/VISPUtils.cmake @@ -1643,6 +1643,8 @@ macro(vp_get_all_includes _includes_modules _includes_extra _system_include_dirs foreach(m ${VISP_MODULES_BUILD}) list(APPEND ${_includes_extra} ${VISP_MODULE_${m}_INC_DEPS}) + list(APPEND ${_system_include_dirs} ${VISP_MODULE_${m}_SYSTEM_INC_DEPS}) + if(EXISTS "${VISP_MODULE_${m}_LOCATION}/include") list(INSERT ${_includes_modules} 0 "${VISP_MODULE_${m}_LOCATION}/include") endif() From 6e35f720f22990f023df59f60467986b3bd6f87d Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Tue, 17 Sep 2024 22:10:08 +0200 Subject: [PATCH 04/18] Fix warning: unused variable --- modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp b/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp index 41edf3e0f0..c1f98c116b 100644 --- a/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp +++ b/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp @@ -203,8 +203,6 @@ void vpPanda3DGeometryRenderer::getRender(vpImage &normals, vpImage(std::max(0.0, bb.getTop())); const unsigned left = static_cast(std::max(0.0, bb.getLeft())); - const unsigned bottom = static_cast(std::min(static_cast(h), bb.getBottom())); - const unsigned right = static_cast(std::min(static_cast(w), bb.getRight())); const unsigned numComponents = m_normalDepthTexture->get_num_components(); const unsigned rowIncrement = m_renderParameters.getImageWidth() * numComponents; // we ask for only 8 bits image, but we may get an rgb image const float *data = (float *)(&(m_normalDepthTexture->get_ram_image().front())); From 496a1d25859849731d0fb2d61288668f86d9d123 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Tue, 17 Sep 2024 22:11:15 +0200 Subject: [PATCH 05/18] Fix warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] --- modules/ar/src/panda3d-simulator/vpPanda3DRGBRenderer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ar/src/panda3d-simulator/vpPanda3DRGBRenderer.cpp b/modules/ar/src/panda3d-simulator/vpPanda3DRGBRenderer.cpp index cc429ab31d..93b441f14e 100644 --- a/modules/ar/src/panda3d-simulator/vpPanda3DRGBRenderer.cpp +++ b/modules/ar/src/panda3d-simulator/vpPanda3DRGBRenderer.cpp @@ -221,15 +221,15 @@ void vpPanda3DRGBRenderer::addNodeToScene(const NodePath &object) NodePath objectInScene = object.copy_to(m_renderRoot); objectInScene.set_name(object.get_name()); TextureCollection txs = objectInScene.find_all_textures(); - bool hasTexture = txs.size() > 0; + bool hasTexture = (static_cast(txs.size()) > 0); // gltf2bam and other tools may store some fallback textures. We shouldnt use them as they whiten the result if (hasTexture) { std::vector fallbackNames { "pbr-fallback", "normal-fallback", "emission-fallback" }; - unsigned numMatches = 0; + unsigned int numMatches = 0; for (const std::string &fallbackName: fallbackNames) { numMatches += static_cast(txs.find_texture(fallbackName) != nullptr); } - hasTexture = txs.size() > numMatches; // Some textures are not fallback textures + hasTexture = (static_cast(txs.size()) > numMatches); // Some textures are not fallback textures } PT(Shader) shader = Shader::make(Shader::ShaderLanguage::SL_GLSL, From 96c9ae4125b9b6616c5281c631d2d63377427eb2 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Tue, 17 Sep 2024 22:12:50 +0200 Subject: [PATCH 06/18] Fix warning: unused parameter --- modules/ar/src/panda3d-simulator/vpPanda3DRendererSet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ar/src/panda3d-simulator/vpPanda3DRendererSet.cpp b/modules/ar/src/panda3d-simulator/vpPanda3DRendererSet.cpp index a59b481812..a9730e0f90 100644 --- a/modules/ar/src/panda3d-simulator/vpPanda3DRendererSet.cpp +++ b/modules/ar/src/panda3d-simulator/vpPanda3DRendererSet.cpp @@ -114,7 +114,7 @@ void vpPanda3DRendererSet::setNodePose(const std::string &name, const vpHomogene } } -void vpPanda3DRendererSet::setNodePose(NodePath &object, const vpHomogeneousMatrix &wTo) +void vpPanda3DRendererSet::setNodePose(NodePath &, const vpHomogeneousMatrix &) { throw vpException(vpException::badValue, "NodePath setNodePose is not supported in renderer set, prefer the string version"); } @@ -130,7 +130,7 @@ vpHomogeneousMatrix vpPanda3DRendererSet::getNodePose(const std::string &name) return m_subRenderers[0]->getNodePose(name); } -vpHomogeneousMatrix vpPanda3DRendererSet::getNodePose(NodePath &object) +vpHomogeneousMatrix vpPanda3DRendererSet::getNodePose(NodePath &) { throw vpException(vpException::badValue, "NodePath getNodePose is not supported in renderer set, prefer the string version"); } From 0b86152836723eade60776639526d169e06756b0 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Tue, 17 Sep 2024 22:13:09 +0200 Subject: [PATCH 07/18] Remove empty line --- tutorial/ar/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tutorial/ar/CMakeLists.txt b/tutorial/ar/CMakeLists.txt index 56b03ae4e0..375e8f054b 100644 --- a/tutorial/ar/CMakeLists.txt +++ b/tutorial/ar/CMakeLists.txt @@ -9,7 +9,6 @@ set(tutorial_cpp tutorial-panda3d-renderer.cpp ) - foreach(cpp ${tutorial_cpp}) visp_add_target(${cpp}) if(COMMAND visp_add_dependency) From e73827f584b46473d310e1125f707d4048f38dd5 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Tue, 17 Sep 2024 22:15:48 +0200 Subject: [PATCH 08/18] Fix warning: unused variable 't1' --- modules/ar/src/panda3d-simulator/vpPanda3DBaseRenderer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/ar/src/panda3d-simulator/vpPanda3DBaseRenderer.cpp b/modules/ar/src/panda3d-simulator/vpPanda3DBaseRenderer.cpp index 948d999f7a..734a00b6b9 100644 --- a/modules/ar/src/panda3d-simulator/vpPanda3DBaseRenderer.cpp +++ b/modules/ar/src/panda3d-simulator/vpPanda3DBaseRenderer.cpp @@ -199,7 +199,6 @@ void vpPanda3DBaseRenderer::computeNearAndFarPlanesFromNode(const std::string &n } if (!fast) { LPoint3 minP, maxP; - double t1 = vpTime::measureTimeMs(); object.calc_tight_bounds(minP, maxP); const BoundingBox box(minP, maxP); float minZ = std::numeric_limits::max(), maxZ = 0.f; From 3d62e748c41555eb0937fae86031a89d415ce139 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Tue, 17 Sep 2024 22:19:24 +0200 Subject: [PATCH 09/18] Fix warning: unused var and sign comparison --- tutorial/ar/tutorial-panda3d-renderer.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tutorial/ar/tutorial-panda3d-renderer.cpp b/tutorial/ar/tutorial-panda3d-renderer.cpp index 39cf1d8aba..c1e734df1b 100644 --- a/tutorial/ar/tutorial-panda3d-renderer.cpp +++ b/tutorial/ar/tutorial-panda3d-renderer.cpp @@ -32,7 +32,7 @@ void displayNormals(const vpImage &normalsImage, #if defined(_OPENMP) #pragma omp parallel for #endif - for (int i = 0; i < normalsImage.getSize(); ++i) { + for (int i = 0; i < static_cast(normalsImage.getSize()); ++i) { normalDisplayImage.bitmap[i].R = static_cast((normalsImage.bitmap[i].R + 1.0) * 127.5f); normalDisplayImage.bitmap[i].G = static_cast((normalsImage.bitmap[i].G + 1.0) * 127.5f); normalDisplayImage.bitmap[i].B = static_cast((normalsImage.bitmap[i].B + 1.0) * 127.5f); @@ -48,7 +48,7 @@ void displayDepth(const vpImage &depthImage, #if defined(_OPENMP) #pragma omp parallel for #endif - for (int i = 0; i < depthImage.getSize(); ++i) { + for (int i = 0; i < static_cast(depthImage.getSize()); ++i) { float val = std::max(0.f, (depthImage.bitmap[i] - nearV) / (farV - nearV)); depthDisplayImage.bitmap[i] = static_cast(val * 255.f); } @@ -61,7 +61,7 @@ void displayLightDifference(const vpImage &colorImage, const vpImage(colorImage.getSize()); ++i) { float I1 = 0.299 * colorImage.bitmap[i].R + 0.587 * colorImage.bitmap[i].G + 0.114 * colorImage.bitmap[i].B; float I2 = 0.299 * colorDiffuseOnly.bitmap[i].R + 0.587 * colorDiffuseOnly.bitmap[i].G + 0.114 * colorDiffuseOnly.bitmap[i].B; lightDifference.bitmap[i] = static_cast(round(abs(I1 - I2))); @@ -76,7 +76,7 @@ void displayCanny(const vpImage &cannyRawData, #if defined(_OPENMP) #pragma omp parallel for #endif - for (int i = 0; i < cannyRawData.getSize(); ++i) { + for (int i = 0; i < static_cast(cannyRawData.getSize()); ++i) { vpRGBf &px = cannyRawData.bitmap[i]; canny.bitmap[i] = 255 * (px.R * px.R + px.G * px.G > 0); //canny.bitmap[i] = static_cast(127.5f + 127.5f * atan(px.B)); @@ -258,10 +258,8 @@ int main(int argc, const char **argv) } renderer.renderFrame(); bool end = false; - bool firstFrame = true; std::vector renderTime, fetchTime, displayTime; while (!end) { - const double beforeComputeBB = vpTime::measureTimeMs(); //! [Updating render parameters] float nearV = 0, farV = 0; geometryRenderer->computeNearAndFarPlanesFromNode(objectName, nearV, farV, true); From 2fcca40fce55f5ab7583445cf5c11060315169b1 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 18 Sep 2024 01:27:15 +0200 Subject: [PATCH 10/18] resolve merge --- tutorial/ar/tutorial-panda3d-renderer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorial/ar/tutorial-panda3d-renderer.cpp b/tutorial/ar/tutorial-panda3d-renderer.cpp index c1e734df1b..617938e784 100644 --- a/tutorial/ar/tutorial-panda3d-renderer.cpp +++ b/tutorial/ar/tutorial-panda3d-renderer.cpp @@ -32,7 +32,7 @@ void displayNormals(const vpImage &normalsImage, #if defined(_OPENMP) #pragma omp parallel for #endif - for (int i = 0; i < static_cast(normalsImage.getSize()); ++i) { + for (unsigned int i = 0; i < normalsImage.getSize(); ++i) { normalDisplayImage.bitmap[i].R = static_cast((normalsImage.bitmap[i].R + 1.0) * 127.5f); normalDisplayImage.bitmap[i].G = static_cast((normalsImage.bitmap[i].G + 1.0) * 127.5f); normalDisplayImage.bitmap[i].B = static_cast((normalsImage.bitmap[i].B + 1.0) * 127.5f); @@ -48,7 +48,7 @@ void displayDepth(const vpImage &depthImage, #if defined(_OPENMP) #pragma omp parallel for #endif - for (int i = 0; i < static_cast(depthImage.getSize()); ++i) { + for (unsigned int i = 0; i < depthImage.getSize(); ++i) { float val = std::max(0.f, (depthImage.bitmap[i] - nearV) / (farV - nearV)); depthDisplayImage.bitmap[i] = static_cast(val * 255.f); } @@ -61,7 +61,7 @@ void displayLightDifference(const vpImage &colorImage, const vpImage(colorImage.getSize()); ++i) { + for (unsigned int i = 0; i < colorImage.getSize(); ++i) { float I1 = 0.299 * colorImage.bitmap[i].R + 0.587 * colorImage.bitmap[i].G + 0.114 * colorImage.bitmap[i].B; float I2 = 0.299 * colorDiffuseOnly.bitmap[i].R + 0.587 * colorDiffuseOnly.bitmap[i].G + 0.114 * colorDiffuseOnly.bitmap[i].B; lightDifference.bitmap[i] = static_cast(round(abs(I1 - I2))); @@ -76,7 +76,7 @@ void displayCanny(const vpImage &cannyRawData, #if defined(_OPENMP) #pragma omp parallel for #endif - for (int i = 0; i < static_cast(cannyRawData.getSize()); ++i) { + for (unsigned int i = 0; i < cannyRawData.getSize(); ++i) { vpRGBf &px = cannyRawData.bitmap[i]; canny.bitmap[i] = 255 * (px.R * px.R + px.G * px.G > 0); //canny.bitmap[i] = static_cast(127.5f + 127.5f * atan(px.B)); From 37d4c592a763bdb2c48fe55cfda724eb9902cc4a Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Wed, 18 Sep 2024 01:32:44 +0200 Subject: [PATCH 11/18] Add missing visp_io requirement to tutorial --- tutorial/ar/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorial/ar/CMakeLists.txt b/tutorial/ar/CMakeLists.txt index 375e8f054b..bb3d849a2c 100644 --- a/tutorial/ar/CMakeLists.txt +++ b/tutorial/ar/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.5) project(tutorial-panda3d) -find_package(VISP REQUIRED visp_core visp_gui visp_ar) +find_package(VISP REQUIRED visp_core visp_gui visp_ar visp_io) # set the list of source files set(tutorial_cpp From e41aa4881e0d58c182f0c140cc003b37afb99d39 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Thu, 19 Sep 2024 08:38:07 +0200 Subject: [PATCH 12/18] Fix compat with AppleClang that comes with Sonoma 14.7 --- 3rdparty/clapack/CMakeLists.txt | 2 +- 3rdparty/simdlib/CMakeLists.txt | 8 ++-- cmake/AddExtraCompilationFlags.cmake | 57 +--------------------------- 3 files changed, 6 insertions(+), 61 deletions(-) diff --git a/3rdparty/clapack/CMakeLists.txt b/3rdparty/clapack/CMakeLists.txt index 21e86557a7..3fe5ac29b8 100644 --- a/3rdparty/clapack/CMakeLists.txt +++ b/3rdparty/clapack/CMakeLists.txt @@ -37,7 +37,7 @@ if(NOT BUILD_SHARED_LIBS) vp_install_target(${LAPACK_LIBRARY} EXPORT VISPModules ARCHIVE DESTINATION ${VISP_3P_LIB_INSTALL_PATH} COMPONENT dev) endif() -if(MSVC AND NOT ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) +if(MSVC AND NOT ((CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) # Disable Visual C++ warnings foreach(f ${lib_srcs}) vp_set_source_file_compile_flag(${f} /wd4244 /wd4267 /wd4273 /wd4554 /wd4723 /wd4996) diff --git a/3rdparty/simdlib/CMakeLists.txt b/3rdparty/simdlib/CMakeLists.txt index b0a605b8be..baade3ea2e 100644 --- a/3rdparty/simdlib/CMakeLists.txt +++ b/3rdparty/simdlib/CMakeLists.txt @@ -25,7 +25,7 @@ if(X86 OR X86_64) set(AVX_FLAG "") set(AVX2_FLAG "") - if(MSVC AND NOT ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) + if(MSVC AND NOT ((CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) if(NOT MSVC64) vp_check_compiler_flag(CXX "/arch:SSE2" HAVE_SSE2_FLAG "${VISP_SOURCE_DIR}/cmake/checks/cpu_sse2.cpp") endif() @@ -137,7 +137,7 @@ if(X86 OR X86_64) set(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -Wno-missing-field-initializers") endif() - if(MSVC AND ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) + if(MSVC AND ((CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))) # Clang under windows needs AVX flags set(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} ${AVX_FLAG} ${AVX2_FLAG}") endif() @@ -175,7 +175,7 @@ elseif(ARM OR AARCH64) vp_check_compiler_flag(CXX "-Wno-switch" HAVE_NO_SWITCH_FLAG "${VISP_SOURCE_DIR}/cmake/checks/cpu_warning.cpp") if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") - if( NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER MATCHES "clang"))) + if( NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))) set(CXX_NEON_FLAG "-mfpu=neon -mfpu=neon-fp16") endif() if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") @@ -195,7 +195,7 @@ elseif(ARM OR AARCH64) set(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -Wno-unused-command-line-argument") endif() - if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER MATCHES "clang")) + if((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) add_definitions(-DSIMD_NEON_FP16_DISABLE) endif() diff --git a/cmake/AddExtraCompilationFlags.cmake b/cmake/AddExtraCompilationFlags.cmake index 7adb63f986..fb17311bd6 100644 --- a/cmake/AddExtraCompilationFlags.cmake +++ b/cmake/AddExtraCompilationFlags.cmake @@ -137,9 +137,7 @@ if(BUILD_COVERAGE) endif() if(CMAKE_COMPILER_IS_GNUCXX) - #if(NOT (WIN32 AND ((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")))) - add_extra_compiler_option(-fvisibility=hidden) - #endif() + add_extra_compiler_option(-fvisibility=hidden) if(ENABLE_AVX AND X86_64) add_extra_compiler_option(-mavx) @@ -191,59 +189,6 @@ if(MSVC) # Avoid build error C1128 list(APPEND VISP_EXTRA_CXX_FLAGS "/bigobj") endif() - #if((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - # add_extra_compiler_option("-Wno-c++98-compat") # turn off warning due to json - # add_extra_compiler_option("-Wno-c++98-compat-pedantic") - # add_extra_compiler_option("-Wno-c11-extensions") - # add_extra_compiler_option("-Wno-covered-switch-default") - # add_extra_compiler_option("-Wno-unused-template") # turn off warning due to eigen - # add_extra_compiler_option("-Wno-deprecated-copy-with-dtor") - # add_extra_compiler_option("-Wno-anon-enum-enum-conversion") # turn off warning due to opencv - # add_extra_compiler_option("-Wno-cast-align") - # add_extra_compiler_option("-Wno-cast-qual") - # add_extra_compiler_option("-Wno-covered-switch-default") - # add_extra_compiler_option("-Wno-deprecated-copy-with-user-provided-dtor") - # add_extra_compiler_option("-Wno-documentation") - # add_extra_compiler_option("-Wno-documentation-deprecated-sync") - # add_extra_compiler_option("-Wno-documentation-unknown-command") - # add_extra_compiler_option("-Wno-double-promotion") - # add_extra_compiler_option("-Wno-enum-enum-conversion") - # add_extra_compiler_option("-Wno-exit-time-destructors") - # add_extra_compiler_option("-Wno-extra-semi") - # add_extra_compiler_option("-Wno-extra-semi-stmt") - # add_extra_compiler_option("-Wno-float-equal") - # add_extra_compiler_option("-Wno-implicit-int-float-conversion") - # add_extra_compiler_option("-Wno-implicit-float-conversion") - # add_extra_compiler_option("-Wno-inconsistent-missing-destructor-override") - # add_extra_compiler_option("-Wno-language-extension-token") - # add_extra_compiler_option("-Wno-microsoft-enum-value") - # add_extra_compiler_option("-Wno-newline-eof") - # add_extra_compiler_option("-Wno-old-style-cast") - # add_extra_compiler_option("-Wno-reserved-identifier") - # add_extra_compiler_option("-Wno-shift-sign-overflow") - # add_extra_compiler_option("-Wno-sign-conversion") - # add_extra_compiler_option("-Wno-undefined-reinterpret-cast") - # add_extra_compiler_option("-Wno-zero-as-null-pointer-constant") - # add_extra_compiler_option("-Wno-cast-function-type") # ViSP - # add_extra_compiler_option("-Wno-comma") - # add_extra_compiler_option("-Wno-deprecated-copy-dtor") - # add_extra_compiler_option("-Wno-deprecated-dynamic-exception-spec") - # add_extra_compiler_option("-Wno-format-nonliteral") - # add_extra_compiler_option("-Wno-global-constructors") - # add_extra_compiler_option("-Wno-implicit-int-conversion") - # add_extra_compiler_option("-Wno-implicit-fallthrough") - # add_extra_compiler_option("-Wno-missing-noreturn") - # add_extra_compiler_option("-Wno-missing-variable-declarations") - # add_extra_compiler_option("-Wno-missing-prototypes") - # add_extra_compiler_option("-Wno-nonportable-system-include-path") - # add_extra_compiler_option("-Wno-shadow") - # add_extra_compiler_option("-Wno-suggest-destructor-override") - # add_extra_compiler_option("-Wno-suggest-override") - # add_extra_compiler_option("-Wno-switch-enum") - # add_extra_compiler_option("-Wno-unreachable-code") - # add_extra_compiler_option("-Wno-unused-macros") - # add_extra_compiler_option("-Wno-unused-member-function") - #endif() endif() # adjust -Wl,-rpath-link From 9357ddb2efce60cf419ec204f046f783d0680012 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Thu, 19 Sep 2024 09:12:22 +0200 Subject: [PATCH 13/18] Clean cmake code --- cmake/VISPModule.cmake | 1 - modules/ar/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/VISPModule.cmake b/cmake/VISPModule.cmake index 24c1574f88..fa4d1a54c8 100644 --- a/cmake/VISPModule.cmake +++ b/cmake/VISPModule.cmake @@ -836,7 +836,6 @@ macro(_vp_create_module) target_compile_definitions(${the_module} PRIVATE visp_EXPORTS) endif() - set_property(TARGET ${the_module} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_INC_DEPS} ) diff --git a/modules/ar/CMakeLists.txt b/modules/ar/CMakeLists.txt index cee2716121..47717d8f7a 100644 --- a/modules/ar/CMakeLists.txt +++ b/modules/ar/CMakeLists.txt @@ -177,7 +177,7 @@ endif() if(USE_PANDA3D) if(Panda3D_INCLUDE_DIRS) - #vp_module_include_directories(SYSTEM ${Panda3D_INCLUDE_DIRS}) + # Add Panda3D include dirs as system to avoid warnings due to Panda3D headers list(APPEND opt_system_incs ${Panda3D_INCLUDE_DIRS}) endif() if(Panda3D_LIBRARIES) From dc477b29cc0fa856451798a6a8c7fab085228279 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Thu, 19 Sep 2024 11:10:35 +0200 Subject: [PATCH 14/18] Generalize usage of system include dirs for 3rdparties that are known to produce warnings --- modules/ar/CMakeLists.txt | 10 +- modules/core/CMakeLists.txt | 111 +------------------ modules/detection/CMakeLists.txt | 10 +- modules/gui/CMakeLists.txt | 26 ----- modules/imgproc/CMakeLists.txt | 16 --- modules/io/CMakeLists.txt | 15 --- modules/robot/CMakeLists.txt | 107 ++---------------- modules/sensor/CMakeLists.txt | 123 +-------------------- modules/tracker/blob/CMakeLists.txt | 2 - modules/tracker/klt/CMakeLists.txt | 6 - modules/tracker/mbt/CMakeLists.txt | 36 +----- modules/tracker/me/CMakeLists.txt | 9 +- modules/tracker/tt/CMakeLists.txt | 4 - modules/tracker/tt_mi/CMakeLists.txt | 3 - modules/vision/CMakeLists.txt | 11 -- modules/visual_features/CMakeLists.txt | 9 -- tutorial/gui/pcl-visualizer/CMakeLists.txt | 5 - 17 files changed, 23 insertions(+), 480 deletions(-) diff --git a/modules/ar/CMakeLists.txt b/modules/ar/CMakeLists.txt index 47717d8f7a..15c70e9c76 100644 --- a/modules/ar/CMakeLists.txt +++ b/modules/ar/CMakeLists.txt @@ -47,14 +47,14 @@ if(USE_OGRE) mark_as_advanced(OGRE_SAMPLES_INCLUDEPATH) #message("OGRE_SAMPLES_INCLUDEPATH: ${OGRE_SAMPLES_INCLUDEPATH}") if(OGRE_SAMPLES_INCLUDEPATH) - list(APPEND opt_incs ${OGRE_SAMPLES_INCLUDEPATH}) + list(APPEND opt_system_incs ${OGRE_SAMPLES_INCLUDEPATH}) endif() # hack to fix possible presence of NOTFOUND in OGRE_INCLUDE_DIRS #message("OGRE_INCLUDE_DIRS: ${OGRE_INCLUDE_DIRS}") foreach(inc_ ${OGRE_INCLUDE_DIRS}) if(NOT ${inc_} MATCHES "NOTFOUND") - list(APPEND opt_incs ${inc_}) + list(APPEND opt_system_incs ${inc_}) endif() endforeach() if(WIN32) @@ -71,7 +71,7 @@ if(USE_OGRE) endif(USE_OGRE) if(USE_OIS AND USE_OGRE) - list(APPEND opt_incs ${OIS_INCLUDE_DIR}) + list(APPEND opt_system_incs ${OIS_INCLUDE_DIR}) list(APPEND opt_libs ${OIS_LIBRARIES}) if(APPLE) # With Ogre 1.7.4 and 1.8.1 to be able to link with libOIS.a, Cocoa framework is requested. @@ -188,10 +188,6 @@ endif() vp_add_module(ar visp_core) vp_glob_module_sources() -if(USE_OGRE) - # Add specific build flag to turn off warnings coming from libogre and libois 3rd party - vp_set_source_file_compile_flag(src/ogre-simulator/vpAROgre.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) -endif() vp_module_include_directories(${opt_incs} SYSTEM ${opt_system_incs}) vp_create_module(${opt_libs}) diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index 69db0c63a3..bb3b8c74e8 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -37,6 +37,7 @@ # Add optional 3rd parties set(opt_incs "") +set(opt_system_incs "") set(opt_libs "") set(opt_libs_private "") @@ -156,6 +157,7 @@ if(USE_OPENCV) list(APPEND opt_libs ${OpenCV_LIBS}) endif() if(OpenCV_INCLUDE_DIRS) + # Append OpenCV include dirs as system to avoid warnings coming from OpenCV headers list(APPEND opt_incs ${OpenCV_INCLUDE_DIRS}) endif() endif(USE_OPENCV) @@ -206,9 +208,9 @@ endif(USE_YARP) # Math: eigen3, gsl, mkl, openblas, atlas, netlib, OpenCV if(USE_EIGEN3) if(EIGEN3_INCLUDE_DIRS) - list(APPEND opt_incs ${EIGEN3_INCLUDE_DIRS}) + list(APPEND opt_system_incs ${EIGEN3_INCLUDE_DIRS}) else() - list(APPEND opt_incs ${EIGEN3_INCLUDE_DIR}) + list(APPEND opt_system_incs ${EIGEN3_INCLUDE_DIR}) endif() endif() @@ -300,109 +302,6 @@ if(WITH_SIMDLIB) list(APPEND opt_libs_private ${SIMDLIB_LIBRARIES}) endif() -if(MSVC) - # Disable Visual C++ C4996 warning - # warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead - # warning C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead - # warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead - if(BUILD_SHARED_LIBS) - vp_set_source_file_compile_flag(src/tools/network/vpClient.cpp /wd4996) - vp_set_source_file_compile_flag(src/tools/network/vpServer.cpp /wd4996) - vp_set_source_file_compile_flag(src/tools/network/vpNetwork.cpp /wd4996) - vp_set_source_file_compile_flag(src/math/random-generator/vpUniRand.cpp /wd4146) - if(BUILD_TESTS) - vp_set_source_file_compile_flag(test/network/testClient.cpp /wd4996) - vp_set_source_file_compile_flag(test/network/testServer.cpp /wd4996) - endif() - else() - vp_warnings_disable(CMAKE_CXX_FLAGS /wd4996) - endif() -endif() - -if(USE_EIGEN3) - vp_set_source_file_compile_flag(src/math/matrix/vpMatrix_svd.cpp -Wno-float-equal -Wno-strict-overflow -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-deprecated-copy -Wno-shadow -Wno-maybe-uninitialized) - vp_set_source_file_compile_flag(src/math/matrix/vpMatrix_lu.cpp -Wno-float-equal -Wno-strict-overflow -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-deprecated-copy -Wno-shadow) - vp_set_source_file_compile_flag(src/math/matrix/vpEigenConversion.cpp -Wno-float-equal -Wno-strict-overflow -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-shadow) - vp_set_source_file_compile_flag(test/math/testEigenConversion.cpp -Wno-float-equal -Wno-strict-overflow -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-shadow) - vp_set_source_file_compile_flag(test/math/perfMatrixMultiplication.cpp -Wno-strict-overflow -Wno-misleading-indentation -Wno-float-equal -Wno-deprecated-copy -Wno-int-in-bool-context -Wno-shadow) - vp_set_source_file_compile_flag(test/math/perfMatrixTranspose.cpp -Wno-misleading-indentation -Wno-float-equal -Wno-deprecated-copy -Wno-int-in-bool-context -Wno-shadow) -endif() - -vp_set_source_file_compile_flag(src/image/vpImageConvert.cpp -Wno-strict-overflow -Wno-sign-compare -Wno-float-equal) -vp_set_source_file_compile_flag(src/image/vpImageFilter.cpp -Wno-strict-overflow -Wno-float-equal) -vp_set_source_file_compile_flag(src/image/vpImageTools.cpp -Wno-strict-overflow -Wno-float-equal) -vp_set_source_file_compile_flag(src/tools/network/vpServer.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/tools/optimization/vpQuadProg.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/tools/optimization/vpLinProg.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/tools/histogram/vpHistogram.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/image/vpFont.cpp -Wno-float-equal -Wno-strict-overflow) -# To avoid warnings with basisu_miniz.h such as: -# basisu_miniz.h:1184:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] -vp_set_source_file_compile_flag(src/tools/file/vpIoTools.cpp -Wno-misleading-indentation -Wno-strict-aliasing -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/munkres/vpMunkres.cpp /wd26812 /wd4244) -vp_set_source_file_compile_flag(test/image/testImageBinarise.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(test/image/testImageOwnership.cpp -Wno-pessimizing-move) -vp_set_source_file_compile_flag(test/network/testClient.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(test/network/testServer.cpp -Wno-strict-overflow) - -if(USE_OPENCV) - vp_set_source_file_compile_flag(src/camera/vpColorDepthConversion.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/camera/vpMeterPixelConversion.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/camera/vpPixelMeterConversion.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/display/vpDisplay.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/display/vpDisplay_rgba.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/display/vpDisplay_uchar.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/display/vpFeatureDisplay.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/image/vpGaussianFilter.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/image/vpImageDraw.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/math/matrix/vpMatrix_cholesky.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/tools/convert/vpConvert.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/tools/geometry/vpPolygon.cpp -Wno-float-equal -Wno-strict-overflow) - vp_set_source_file_compile_flag(src/tools/geometry/vpPolygon3D.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/tools/histogram/vpHistogram.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/tracking/moments/vpMomentObject.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/camera/testCameraParametersConversion.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image/testImageResize.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image/testImageMorphology.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testColorConversion.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testConversion.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testCrop.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testCropAdvanced.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testGaussianFilter.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testImageAddSub.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testImageFilter.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testImageComparison.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testImageNormalizedCorrelation.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testImageTemplateMatching.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testImageWarp.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testIoPGM.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testIoPPM.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testReadImage.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testPerformanceLUT.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/testUndistortImage.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/perfImageAddSub.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/perfImageMorphology.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/perfImageResize.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/perfImageWarp.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/perfGaussianFilter.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/perfColorConversion.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image/testImageDraw.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image/testImageDifference.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/math/testMomentAlpha.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/tools/convert/testConvert.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/tools/histogram-with-dataset/testHistogram.cpp -Wno-float-equal) -endif() - -if(USE_XML2) - if(MSVC) - vp_set_source_file_compile_flag(src/tools/xml/vpXmlParser.cpp /wd4996) - vp_set_source_file_compile_flag(test/tools/xml/testXmlParser.cpp /wd4996) - else() - vp_set_source_file_compile_flag(src/tools/xml/vpXmlParser.cpp -Wno-deprecated-declarations) - vp_set_source_file_compile_flag(test/tools/xml/testXmlParser.cpp -Wno-deprecated-declarations) - endif() -endif() - vp_add_module(core PRIVATE_OPTIONAL ${opt_libs_private} WRAP java) #----------------------------------------------------------------------------- @@ -421,7 +320,7 @@ endif() vp_source_group("Src" FILES "${VISP_MODULE_visp_core_BINARY_DIR}/version_string.inc") vp_glob_module_sources(SOURCES "${VISP_MODULE_visp_core_BINARY_DIR}/version_string.inc") -vp_module_include_directories(${opt_incs}) +vp_module_include_directories(${opt_incs} SYSTEM ${opt_system_incs}) vp_create_module(${opt_libs}) vp_create_compat_headers("include/visp3/core/vpConfig.h") vp_add_tests(CTEST_EXCLUDE_PATH network DEPENDS_ON visp_io visp_gui) diff --git a/modules/detection/CMakeLists.txt b/modules/detection/CMakeLists.txt index 1d6faf556e..fc62ba2f44 100644 --- a/modules/detection/CMakeLists.txt +++ b/modules/detection/CMakeLists.txt @@ -35,10 +35,11 @@ # Add optional 3rd parties set(opt_incs "") +set(opt_system_incs "") set(opt_libs "") if(USE_ZBAR) - list(APPEND opt_incs ${ZBAR_INCLUDE_DIRS}) + list(APPEND opt_system_incs ${ZBAR_INCLUDE_DIRS}) list(APPEND opt_libs ${ZBAR_LIBRARIES}) endif() @@ -47,11 +48,6 @@ if(USE_DMTX) list(APPEND opt_libs ${DMTX_LIBRARIES}) endif() -if(USE_ZBAR) - # Add specific build flag to turn off warnings coming from zbar 3rd party - vp_set_source_file_compile_flag(src/barcode/vpDetectorQRCode.cpp -Wno-unused-parameter -Wno-deprecated-declarations) -endif() - if(WITH_APRILTAG) # April Tag is private include_directories(${APRILTAG_INCLUDE_DIRS}) @@ -195,6 +191,6 @@ endif(USE_OPENCV) vp_add_module(detection visp_core visp_vision PRIVATE_OPTIONAL ${APRILTAG_LIBRARIES} WRAP java) vp_glob_module_sources() -vp_module_include_directories(${opt_incs}) +vp_module_include_directories(${opt_incs} SYSTEM ${opt_system_incs}) vp_create_module(${opt_libs}) vp_add_tests(DEPENDS_ON visp_detection visp_gui visp_io) diff --git a/modules/gui/CMakeLists.txt b/modules/gui/CMakeLists.txt index 67d27e5ccf..d9cd8ac7b8 100644 --- a/modules/gui/CMakeLists.txt +++ b/modules/gui/CMakeLists.txt @@ -76,29 +76,3 @@ vp_glob_module_sources() vp_module_include_directories(${opt_incs}) vp_create_module(${opt_libs}) vp_add_tests(DEPENDS_ON visp_io) - -if(USE_X11) - vp_set_source_file_compile_flag(src/display/vpDisplayX.cpp -Wno-strict-overflow) -endif() -if(USE_OPENCV) - vp_set_source_file_compile_flag(src/display/vpDisplayOpenCV.cpp -Wno-strict-overflow -Wno-float-equal) - vp_set_source_file_compile_flag(src/forward-projection/vpProjectionDisplay.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/plot/vpPlot.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/plot/vpPlotCurve.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/plot/vpPlotGraph.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display/testDisplayPolygonLines.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display/testDisplayRoi.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display/testDisplays.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display/testVideoDevice.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display/testVideoDeviceDual.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display-with-dataset/testMouseEvent.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display-with-dataset/testDisplayScaled.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/display-with-dataset/testClick.cpp -Wno-float-equal) -endif() -if(USE_GTK2) - vp_set_source_file_compile_flag(src/display/vpDisplayGTK.cpp -Wno-deprecated-declarations) -endif() -if(USE_PCL) - vp_set_source_file_compile_flag(src/pointcloud/vpDisplayPCL.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/pointcloud/vpPclViewer.cpp -Wno-unused-parameter) -endif() diff --git a/modules/imgproc/CMakeLists.txt b/modules/imgproc/CMakeLists.txt index 5d281d34f4..114f9d2e5f 100644 --- a/modules/imgproc/CMakeLists.txt +++ b/modules/imgproc/CMakeLists.txt @@ -49,19 +49,3 @@ vp_module_include_directories() vp_create_module() vp_add_tests(DEPENDS_ON visp_imgproc visp_io) - -vp_set_source_file_compile_flag(src/vpCLAHE.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/vpThreshold.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/vpFloodFill.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(test/testContours.cpp -Wno-strict-overflow) - -if(USE_OPENCV) - vp_set_source_file_compile_flag(src/vpCLAHE.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/vpImgproc.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/with-dataset/testAutoThreshold.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/with-dataset/testImgproc.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/with-dataset/testConnectedComponents.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/with-dataset/testFloodFill.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/with-dataset/testContours.cpp -Wno-float-equal) - vp_set_source_file_compile_flag( -Wno-float-equal) -endif() diff --git a/modules/io/CMakeLists.txt b/modules/io/CMakeLists.txt index f93ece86d2..fb65d48983 100644 --- a/modules/io/CMakeLists.txt +++ b/modules/io/CMakeLists.txt @@ -199,20 +199,5 @@ vp_module_include_directories(${opt_incs}) vp_create_module(${opt_libs}) vp_add_tests() -vp_set_source_file_compile_flag(src/tools/vpParseArgv.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/image/vpImageIo.cpp -Wno-missing-field-initializers) # since stb_image_write.h update from v1.13 to v1.16 vp_set_source_file_compile_flag(src/image/private/vpImageIoStb.cpp -Wno-missing-field-initializers -Wno-strict-overflow) vp_set_source_file_compile_flag(src/image/private/vpImageIoTinyEXR.cpp -Wno-strict-overflow -Wno-sign-compare -Wno-type-limits -Wno-unused-but-set-variable) - -if(USE_OPENCV) - vp_set_source_file_compile_flag(src/image/private/vpImageIoLibjpeg.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/image/private/vpImageIoLibpng.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/image/private/vpImageIoOpenCV.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/image/private/vpImageIoPortable.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/image/vpImageIo.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/video/vpDiskGrabber.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/video/vpVideoReader.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/video/vpVideoWriter.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/video/testVideo.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/image-with-dataset/perfImageLoadSave.cpp -Wno-float-equal) -endif() diff --git a/modules/robot/CMakeLists.txt b/modules/robot/CMakeLists.txt index 0287a79924..1cc26584d3 100644 --- a/modules/robot/CMakeLists.txt +++ b/modules/robot/CMakeLists.txt @@ -35,6 +35,7 @@ # Add optional 3rd parties set(opt_incs "") +set(opt_system_incs "") set(opt_libs "") set(opt_libs_private "") @@ -47,7 +48,7 @@ set(opt_libs_private "") # Haption Virtuose SDK. # This 3rd party should be the first used by the module (see warning below) if(USE_VIRTUOSE) - list(APPEND opt_incs ${VIRTUOSE_INCLUDE_DIRS}) + list(APPEND opt_system_incs ${VIRTUOSE_INCLUDE_DIRS}) list(APPEND opt_libs ${VIRTUOSE_LIBRARIES}) if(USE_THREADS AND RT_FOUND AND DL_FOUND) @@ -61,21 +62,6 @@ if(USE_VIRTUOSE) if(MSVC) # Work around to remove warning LNK4099; PDB vc120.pdb not found with virtuoseDLL.lib set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /ignore:4099") - - # Disable Visual C++ C4312 warning occuring on 3rd party VirtuoseAPI.h file - # VirtuoseAPI.h(280): warning C4312: 'type cast': conversion from 'int' to 'char *' of greater size - # VirtuoseAPI.h(302): warning C4312: 'type cast': conversion from 'int' to 'VirtContext' of greater size - if(BUILD_SHARED_LIBS) - vp_set_source_file_compile_flag(src/haptic-device/virtuose/vpVirtuose.cpp /wd4312) - vp_set_source_file_compile_flag(test/virtuose/testVirtuose.cpp /wd4312) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseAfma6.cpp /wd4312) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseHapticBox.cpp /wd4312) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseJointLimits.cpp /wd4312) - vp_set_source_file_compile_flag(test/virtuose/testVirtuosePeriodicFunction.cpp /wd4312) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseWithGlove.cpp /wd4312) - else() - vp_warnings_disable(CMAKE_CXX_FLAGS /wd4312) - endif() endif() endif() @@ -124,7 +110,7 @@ endif() if(USE_ARIA AND UNIX AND USE_PTHREAD AND RT_FOUND AND DL_FOUND) # Under Unix we need Aria, pthread, dl and rt libraries - list(APPEND opt_incs ${ARIA_INCLUDE_DIRS}) + list(APPEND opt_system_incs ${ARIA_INCLUDE_DIRS}) list(APPEND opt_libs ${ARIA_LIBRARIES}) if(CMAKE_THREAD_LIBS_INIT) list(APPEND opt_libs "${CMAKE_THREAD_LIBS_INIT}") @@ -132,7 +118,7 @@ if(USE_ARIA AND UNIX AND USE_PTHREAD AND RT_FOUND AND DL_FOUND) list(APPEND opt_libs ${RT_LIBRARIES}) list(APPEND opt_libs ${DL_LIBRARIES}) elseif(USE_ARIA AND NOT UNIX) - list(APPEND opt_incs ${ARIA_INCLUDE_DIRS}) + list(APPEND opt_system_incs ${ARIA_INCLUDE_DIRS}) list(APPEND opt_libs ${ARIA_LIBRARIES}) endif() @@ -196,96 +182,17 @@ vp_glob_module_sources() vp_set_source_file_compile_flag(src/wireframe-simulator/vpKeyword.cpp -Wno-sign-conversion) -if(USE_VIRTUOSE) - # Add specific build flag to turn off warnings coming from VirtuoseAPI 3rd party - vp_set_source_file_compile_flag(src/haptic-device/virtuose/vpVirtuose.cpp -Wno-int-to-pointer-cast) -endif() - -if(USE_ARIA) - # Add specific build flag to turn off warnings coming from libaria 3rd party - vp_set_source_file_compile_flag(src/real-robot/pioneer/vpRobotPioneer.cpp -Wno-unused-parameter -Wno-type-limits) -endif() - -if(USE_COIN3D) - # Add specific build flag to turn off warnings coming from libcoin 3rd party - vp_set_source_file_compile_flag(src/wireframe-simulator/vpWireFrameSimulator.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/wireframe-simulator/vpScene.cpp -Wno-unused-parameter -Wno-deprecated-copy) - vp_set_source_file_compile_flag(src/image-simulator/vpImageSimulator.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/robot-simulator/vpRobotCamera.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/robot-simulator/vpSimulatorCamera.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/robot-simulator/vpSimulatorViper850.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/robot-simulator/vpSimulatorAfma6.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/robot-simulator/vpRobotWireFrameSimulator.cpp -Wno-unused-parameter) - - if(USE_VIPER850) - vp_set_source_file_compile_flag(src/real-robot/viper/vpRobotViper850.cpp -Wno-unused-parameter) - endif() -else() - vp_set_source_file_compile_flag(src/wireframe-simulator/vpWireFrameSimulator.cpp -Wno-strict-overflow) -endif() - -if(USE_UR_RTDE) - vp_set_source_file_compile_flag(src/real-robot/universal-robots/vpRobotUniversalRobots.cpp -Wno-unused-parameter) -endif() - -if(USE_MAVSDK) - vp_set_source_file_compile_flag(src/real-robot/mavsdk/vpRobotMavsdk.cp -Wno-unused-but-set-variable) -endif() - -if(USE_BICLOPS) - vp_set_source_file_compile_flag(src/real-robot/biclops/vpRobotBiclops.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(src/real-robot/biclops/private/vpRobotBiclopsController_impl.cpp -Wno-unused-parameter) -endif() - -vp_set_source_file_compile_flag(src/light/vpRingLight.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/wireframe-simulator/vpClipping.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/wireframe-simulator/vpBoundio.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/wireframe-simulator/vpCoreDisplay.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/wireframe-simulator/vpLex.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/wireframe-simulator/vpBound.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/wireframe-simulator/vpArit.cpp -Wno-strict-overflow) - # copy robot and wireframe simulator data vp_glob_module_copy_data("src/robot-simulator/arms/*.bnd" data/robot-simulator) vp_glob_module_copy_data("src/wireframe-simulator/scene/*.bnd" data/wireframe-simulator) vp_glob_module_copy_data("src/wireframe-simulator/scene/*.sld" data/wireframe-simulator) -vp_module_include_directories(${opt_incs}) +vp_module_include_directories(${opt_incs} SYSTEM ${opt_system_incs}) vp_create_module(${opt_libs}) vp_add_tests( DEPENDS_ON visp_sensor visp_vision visp_blob visp_gui CTEST_EXCLUDE_PATH bebop2 qbdevice servo-afma4 servo-afma6 servo-franka servo-pixhawk servo-pololu servo-universal-robots - servo-viper virtuose) - -if(USE_VIRTUOSE) - # Add specific build flag to turn off warnings coming from VirtuoseAPI 3rd party - vp_set_source_file_compile_flag(test/virtuose/testVirtuose.cpp -Wno-int-to-pointer-cast) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseAfma6.cpp -Wno-int-to-pointer-cast) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseWithGlove.cpp -Wno-int-to-pointer-cast) - vp_set_source_file_compile_flag(test/virtuose/testVirtuose.cpp -Wno-int-to-pointer-cast) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseHapticBox.cpp -Wno-int-to-pointer-cast) - vp_set_source_file_compile_flag(test/virtuose/testVirtuoseJointLimits.cpp -Wno-int-to-pointer-cast) - vp_set_source_file_compile_flag(test/virtuose/testVirtuosePeriodicFunction.cpp -Wno-int-to-pointer-cast) -endif() - -if(USE_ARSDK) - vp_set_source_file_compile_flag(src/real-robot/bebop2/vpRobotBebop2.cpp -Wno-old-style-cast -Wno-implicit-fallthrough -Wno-cast-qual -Wno-deprecated-declarations) -endif() - -if(USE_FRANKA) - vp_set_source_file_compile_flag(src/real-robot/franka/vpForceTorqueGenerator_impl.cpp -Wno-shadow -Wno-deprecated-copy) -endif() - -if(USE_FLIRPTUSDK) - vp_set_source_file_compile_flag(test/servo-flir-ptu/testRobotFlirPtu.cpp -Wno-unused-result) -endif() - -if(USE_UR_RTDE) - vp_set_source_file_compile_flag(test/servo-universal-robots/testUniversalRobotsCartPosition.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(test/servo-universal-robots/testUniversalRobotsCartVelocity.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(test/servo-universal-robots/testUniversalRobotsGetData.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(test/servo-universal-robots/testUniversalRobotsJointPosition.cpp -Wno-unused-parameter) - vp_set_source_file_compile_flag(test/servo-universal-robots/testUniversalRobotsJointVelocity.cpp -Wno-unused-parameter) -endif() + servo-viper virtuose +) diff --git a/modules/sensor/CMakeLists.txt b/modules/sensor/CMakeLists.txt index ccd858c29c..5f8596fac0 100644 --- a/modules/sensor/CMakeLists.txt +++ b/modules/sensor/CMakeLists.txt @@ -37,6 +37,7 @@ # Add optional 3rd parties set(opt_incs "") +set(opt_system_incs "") set(opt_libs "") # camera devices: v4l, dc1394, cmu1394, directshow ?, freenect, @@ -86,7 +87,7 @@ if(USE_REALSENSE) list(APPEND opt_libs ${REALSENSE_LIBRARIES}) endif() if(USE_REALSENSE2) - list(APPEND opt_incs ${REALSENSE2_INCLUDE_DIRS}) + list(APPEND opt_system_incs ${REALSENSE2_INCLUDE_DIRS}) list(APPEND opt_libs ${REALSENSE2_LIBRARIES}) endif() if(USE_OCCIPITAL_STRUCTURE) @@ -123,127 +124,9 @@ endif() vp_add_module(sensor visp_core PRIVATE_OPTIONAL ${ATIDAQ_LIBRARIES}) vp_glob_module_sources() -vp_module_include_directories(${opt_incs}) +vp_module_include_directories(${opt_incs} SYSTEM ${opt_system_incs}) vp_create_module(${opt_libs}) vp_add_tests(CTEST_EXCLUDE_PATH force-torque framegrabber mocap rgb-depth DEPENDS_ON visp_io visp_gui) # Add configuration file for IIT FT sensor besides testForceTorqueIitSensor.cpp binary configure_file(test/force-torque/configurationSettings.ini configurationSettings.ini COPYONLY) - -if(USE_FLYCAPTURE) - # Add specific build flag to turn off warnings coming from PointGrey flycapture 3rd party - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unknown-pragmas") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-ignored-qualifiers") -endif() - -if(USE_PYLON) - # Add specific build flag to turn off warnings coming from Basler - # pylon headers - if(MSVC) - list(APPEND CXX_FLAGS_MUTE_WARNINGS "/wd4244") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "/wd4267") - else() - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unknown-pragmas") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-parameter") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-overloaded-virtual") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-deprecated-copy") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-variable") - endif() -endif() - -if(USE_REALSENSE) - # Add specific build flag to turn off warnings coming from RealSense 3rd party - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-strict-aliasing") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-pessimizing-move") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-parameter") -endif() - -if(USE_REALSENSE2) - if(UNIX) - # Add specific build flag to turn off warnings coming from PCL 3rd party - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-reorder") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-function") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-sign-compare") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-overloaded-virtual") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-deprecated-declarations") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-inconsistent-missing-override") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-sign-conversion") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-float-equal") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-pessimizing-move") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-parameter") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-comment") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-ignored-qualifiers") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-deprecated-copy") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unqualified-std-cast-call") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-missing-field-initializers") - else() - list(APPEND CXX_FLAGS_MUTE_WARNINGS "/wd4244") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "/wd4267") - endif() -endif() - -if(USE_LIBFREENECT) - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-parameter") -endif() - -if(USE_UEYE) - if(UNIX) - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-deprecated-declarations") - else() - list(APPEND CXX_FLAGS_MUTE_WARNINGS "/wd4996") - endif() -endif() - -if(USE_OPENCV) - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-float-equal") -endif() - -if(USE_OCCIPITAL_STRUCTURE) - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-reorder") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-function") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unused-parameter") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-sign-compare") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-overloaded-virtual") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-ignored-qualifiers") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-maybe-uninitialized") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-deprecated-declarations") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-inconsistent-missing-override") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-sign-conversion") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-float-equal") - list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-pessimizing-move") -endif() - -vp_set_source_file_compile_flag(src/force-torque/vpForceTorqueAtiNetFTSensor.cpp "-Wno-strict-aliasing") - -if(CXX_FLAGS_MUTE_WARNINGS) - # Add specific build flag to turn off warnings - vp_set_source_file_compile_flag(src/framegrabber/1394/vp1394TwoGrabber.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/framegrabber/directshow/vpDirectShowSampleGrabberI.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/framegrabber/flycapture/vpFlyCaptureGrabber.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/framegrabber/pylon/vpPylonFactory.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/framegrabber/pylon/vpPylonGrabberGigE.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/framegrabber/pylon/vpPylonGrabberUsb.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/framegrabber/ueye/vpUeyeGrabber.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/rgb-depth/kinect/vpKinect.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/rgb-depth/occipital_structure/vpOccipitalStructure.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/rgb-depth/realsense/vpRealSense.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(src/rgb-depth/realsense/vpRealSense2.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - - vp_set_source_file_compile_flag(test/framegrabber/test1394TwoResetBus.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/framegrabber/test1394TwoGrabber.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/framegrabber/testPylonGrabber.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testOccipitalStructure_Core_images.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testOccipitalStructure_Core_imu.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testOccipitalStructure_Core_pcl.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_SR300.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_D435.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_D435_align.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_D435_opencv.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_D435_pcl.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_T265_images.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_T265_images_odometry.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_T265_images_odometry_async.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_T265_imu.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_T265_odometry.cpp ${CXX_FLAGS_MUTE_WARNINGS}) - vp_set_source_file_compile_flag(test/rgb-depth/testRealSense2_T265_undistort.cpp ${CXX_FLAGS_MUTE_WARNINGS}) -endif() diff --git a/modules/tracker/blob/CMakeLists.txt b/modules/tracker/blob/CMakeLists.txt index 59184123ef..2d1de0ee2a 100644 --- a/modules/tracker/blob/CMakeLists.txt +++ b/modules/tracker/blob/CMakeLists.txt @@ -38,5 +38,3 @@ vp_glob_module_sources() vp_module_include_directories() vp_create_module() vp_add_tests(DEPENDS_ON visp_visual_features visp_gui visp_io) - -vp_set_source_file_compile_flag(src/dots/vpDot2.cpp -Wno-strict-overflow) diff --git a/modules/tracker/klt/CMakeLists.txt b/modules/tracker/klt/CMakeLists.txt index b7893a5f3f..f001ed5962 100644 --- a/modules/tracker/klt/CMakeLists.txt +++ b/modules/tracker/klt/CMakeLists.txt @@ -149,9 +149,3 @@ vp_glob_module_sources() vp_module_include_directories(${opt_incs}) vp_create_module(${opt_libs}) vp_add_tests() - -vp_set_source_file_compile_flag(src/vpKltOpencv.cpp -Wno-strict-overflow) - -if(USE_OPENCV) - vp_set_source_file_compile_flag(src/vpKltOpencv.cpp -Wno-float-equal) -endif() diff --git a/modules/tracker/mbt/CMakeLists.txt b/modules/tracker/mbt/CMakeLists.txt index 9b87e7c378..55c643170f 100644 --- a/modules/tracker/mbt/CMakeLists.txt +++ b/modules/tracker/mbt/CMakeLists.txt @@ -35,6 +35,7 @@ # Add optional 3rd parties set(opt_incs "") +set(opt_system_incs "") set(opt_libs "") set(opt_libs_private "") @@ -145,29 +146,6 @@ endif() vp_add_module(mbt visp_vision visp_core visp_me visp_visual_features OPTIONAL visp_ar visp_klt visp_gui PRIVATE_OPTIONAL ${opt_libs_private} WRAP java) vp_glob_module_sources() -if(USE_OGRE) - # Add specific build flag to turn off warnings coming from libogre and libois 3rd party - vp_set_source_file_compile_flag(src/edge/vpMbEdgeTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-deprecated-declarations -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/edge/vpMbtDistanceCircle.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/edge/vpMbtDistanceCylinder.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/edge/vpMbtDistanceLine.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/hybrid/vpMbEdgeKltTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/klt/vpMbKltTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-strict-overflow -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/klt/vpMbtDistanceKltCylinder.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/klt/vpMbtDistanceKltPoints.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/vpMbTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-strict-overflow -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/depth/vpMbtFaceDepthDense.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/depth/vpMbtFaceDepthNormal.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-deprecated-declarations -Wno-float-equal -Wno-deprecated-copy -Wno-shadow -Wno-register) - vp_set_source_file_compile_flag(src/depth/vpMbDepthDenseTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/depth/vpMbDepthNormalTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/vpMbtXmlGenericParser.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(src/vpMbGenericTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) -else() - vp_set_source_file_compile_flag(src/vpMbTracker.cpp -Wno-strict-overflow) - vp_set_source_file_compile_flag(src/klt/vpMbKltTracker.cpp -Wno-strict-overflow) - vp_set_source_file_compile_flag(src/edge/vpMbEdgeTracker.cpp -Wno-deprecated-declarations) - vp_set_source_file_compile_flag(src/depth/vpMbtFaceDepthNormal.cpp -Wno-deprecated-declarations -Wno-shadow -Wno-deprecated-copy) -endif() if(MSVC) if(BUILD_SHARED_LIBS) vp_set_source_file_compile_flag(src/depth/vpMbtTukeyEstimator.cpp /wd4244) @@ -183,18 +161,6 @@ endif() vp_module_include_directories(${opt_incs}) vp_create_module(${opt_libs}) -if(BUILD_TESTS) - if(USE_OGRE) - vp_set_source_file_compile_flag(test/generic-with-dataset/perfGenericTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(test/generic-with-dataset/testGenericTracker.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(test/generic-with-dataset/testGenericTrackerCAOParsing.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(test/generic-with-dataset/testGenericTrackerDepth.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(test/generic-with-dataset/testGenericTrackerDeterminist.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(test/generic-with-dataset/testMbtXmlGenericParser.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(test/generic-with-dataset/testMbtJsonSettings.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - endif() -endif() - vp_add_tests(DEPENDS_ON visp_core visp_gui visp_io) if(VISP_DATASET_FOUND) diff --git a/modules/tracker/me/CMakeLists.txt b/modules/tracker/me/CMakeLists.txt index 282745524a..aa254e19fb 100644 --- a/modules/tracker/me/CMakeLists.txt +++ b/modules/tracker/me/CMakeLists.txt @@ -39,14 +39,7 @@ vp_module_include_directories() vp_create_module() vp_add_tests(DEPENDS_ON visp_io visp_gui) -vp_set_source_file_compile_flag(src/moving-edges/vpMeSite.cpp -Wno-strict-overflow) - -if(USE_OPENCV) - vp_set_source_file_compile_flag(src/moving-edges/vpMeNurbs.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(test/testNurbs.cpp -Wno-float-equal) -endif() - if(WITH_CATCH2) # catch2 is private include_directories(${CATCH2_INCLUDE_DIRS}) -endif() \ No newline at end of file +endif() diff --git a/modules/tracker/tt/CMakeLists.txt b/modules/tracker/tt/CMakeLists.txt index 7d6792ffd4..3cf492d48a 100644 --- a/modules/tracker/tt/CMakeLists.txt +++ b/modules/tracker/tt/CMakeLists.txt @@ -37,7 +37,3 @@ vp_add_module(tt visp_vision visp_core) vp_glob_module_sources() vp_module_include_directories() vp_create_module() - -vp_set_source_file_compile_flag(src/vpTemplateTracker.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/warp/vpTemplateTrackerWarp.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/warp/vpTemplateTrackerWarpHomographySL3.cpp -Wno-strict-overflow) diff --git a/modules/tracker/tt_mi/CMakeLists.txt b/modules/tracker/tt_mi/CMakeLists.txt index d43c03efdc..048db737ac 100644 --- a/modules/tracker/tt_mi/CMakeLists.txt +++ b/modules/tracker/tt_mi/CMakeLists.txt @@ -35,9 +35,6 @@ vp_define_module(tt_mi visp_tt) -vp_set_source_file_compile_flag(src/mi/vpTemplateTrackerMIInverseCompositional.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/tools/vpTemplateTrackerMIBSpline.cpp -Wno-strict-overflow) - # The previous line is similar to the following: #vp_add_module(tt_mi visp_tt) #vp_glob_module_sources() diff --git a/modules/vision/CMakeLists.txt b/modules/vision/CMakeLists.txt index b2a93126ab..7538843b83 100644 --- a/modules/vision/CMakeLists.txt +++ b/modules/vision/CMakeLists.txt @@ -159,17 +159,6 @@ vp_module_include_directories(${opt_incs}) vp_create_module(${opt_libs}) vp_add_tests(DEPENDS_ON visp_mbt visp_gui visp_io) -if(USE_OGRE) - # Add specific build flag to turn off warnings coming from libogre and libois 3rd party - vp_set_source_file_compile_flag(test/keypoint-with-dataset/testKeyPoint-2.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) - vp_set_source_file_compile_flag(test/keypoint-with-dataset/testKeyPoint-4.cpp -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-overloaded-virtual -Wno-float-equal -Wno-deprecated-copy -Wno-register) -endif() - -vp_set_source_file_compile_flag(src/pose-estimation/vpPoseFeatures.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/pose-estimation/vpPoseRansac.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/pose-estimation/private/vpLevenbergMarquartd.cpp -Wno-strict-overflow) -vp_set_source_file_compile_flag(src/keypoint/vpKeyPoint.cpp -Wno-strict-overflow) - if(BUILD_MODULE_visp_mbt AND BUILD_MODULE_visp_gui AND BUILD_MODULE_visp_io) if(VISP_DATASET_FOUND) add_test(testKeyPoint-2-multithreaded testKeyPoint-2 -c ${OPTION_TO_DESACTIVE_DISPLAY} -p) diff --git a/modules/visual_features/CMakeLists.txt b/modules/visual_features/CMakeLists.txt index 0789619ec8..a878b3765a 100644 --- a/modules/visual_features/CMakeLists.txt +++ b/modules/visual_features/CMakeLists.txt @@ -43,12 +43,3 @@ if(WITH_CATCH2) # catch2 is private include_directories(${CATCH2_INCLUDE_DIRS}) endif() - -if(USE_OPENCV) - vp_set_source_file_compile_flag(src/feature-builder/vpFeatureBuilderEllipse.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/feature-builder/vpFeatureBuilderLine.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/feature-builder/vpFeatureBuilderPoint.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/feature-builder/vpFeatureBuilderPoint3D.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/feature-builder/vpFeatureBuilderPointPolar.cpp -Wno-float-equal) - vp_set_source_file_compile_flag(src/feature-builder/vpFeatureBuilderSegment.cpp -Wno-float-equal) -endif() diff --git a/tutorial/gui/pcl-visualizer/CMakeLists.txt b/tutorial/gui/pcl-visualizer/CMakeLists.txt index 088dcaf465..de775cc076 100644 --- a/tutorial/gui/pcl-visualizer/CMakeLists.txt +++ b/tutorial/gui/pcl-visualizer/CMakeLists.txt @@ -15,8 +15,3 @@ foreach(cpp ${tutorial_cpp}) visp_add_dependency(${cpp} "tutorials") endif() endforeach() - -if(VISP_HAVE_PCL) -vp_set_source_file_compile_flag(tutorial-pcl-viewer.cpp -Wno-unused-parameter) -vp_set_source_file_compile_flag(ClassUsingPclViewer.cpp -Wno-unused-parameter) -endif() From e0ce967acc4de71aa6c475608128fe6c36012171 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Thu, 19 Sep 2024 11:11:40 +0200 Subject: [PATCH 15/18] Fix warnings detected with Apple clang version 16.0.0 (clang-1600.0.26.3) on Sonoma 14.7 --- modules/core/include/visp3/core/vpIoTools.h | 2 +- .../core/test/image/testImageOwnership.cpp | 4 +-- .../src/rgb-depth/realsense/vpRealSense2.cpp | 2 ++ .../rgb-depth/testRealSense2_D435_opencv.cpp | 30 ------------------- 4 files changed, 5 insertions(+), 33 deletions(-) diff --git a/modules/core/include/visp3/core/vpIoTools.h b/modules/core/include/visp3/core/vpIoTools.h index 246624d377..511b1333b5 100644 --- a/modules/core/include/visp3/core/vpIoTools.h +++ b/modules/core/include/visp3/core/vpIoTools.h @@ -316,7 +316,7 @@ template void npz_save(std::string zipname, std::string fname, const //write everything fwrite(&local_header[0], sizeof(char), local_header.size(), fp); fwrite(&npy_header[0], sizeof(char), npy_header.size(), fp); - fwrite(data, sizeof(T), nels, fp); + fwrite(&data[0], sizeof(T), nels, fp); fwrite(&global_header[0], sizeof(char), global_header.size(), fp); fwrite(&footer[0], sizeof(char), footer.size(), fp); fclose(fp); diff --git a/modules/core/test/image/testImageOwnership.cpp b/modules/core/test/image/testImageOwnership.cpp index 516284ec92..90399154d9 100644 --- a/modules/core/test/image/testImageOwnership.cpp +++ b/modules/core/test/image/testImageOwnership.cpp @@ -143,7 +143,7 @@ int main(int /* argc */, const char ** /* argv */) #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) { unsigned char *bitmap = new unsigned char[12]; - vpImage I = std::move(vpImage(bitmap, 3, 4, false)); + vpImage I = vpImage(bitmap, 3, 4, false); if (bitmap != I.bitmap) { std::cout << "std::move(vpImage) failed" << std::endl; return EXIT_FAILURE; @@ -152,7 +152,7 @@ int main(int /* argc */, const char ** /* argv */) } { unsigned char *bitmap = new unsigned char[12]; - vpImage I(std::move(vpImage(bitmap, 3, 4, false))); + vpImage I(vpImage(bitmap, 3, 4, false)); if (bitmap != I.bitmap) { std::cout << "vpImage(td::move(vpImage)) failed" << std::endl; return EXIT_FAILURE; diff --git a/modules/sensor/src/rgb-depth/realsense/vpRealSense2.cpp b/modules/sensor/src/rgb-depth/realsense/vpRealSense2.cpp index 3b51fe78f0..e63d1df584 100644 --- a/modules/sensor/src/rgb-depth/realsense/vpRealSense2.cpp +++ b/modules/sensor/src/rgb-depth/realsense/vpRealSense2.cpp @@ -45,6 +45,7 @@ #define MANUAL_POINTCLOUD 1 +#if defined(VISP_HAVE_PCL) && defined(VISP_HAVE_PCL_COMMON) namespace { bool operator==(const rs2_extrinsics &lhs, const rs2_extrinsics &rhs) @@ -64,6 +65,7 @@ bool operator==(const rs2_extrinsics &lhs, const rs2_extrinsics &rhs) return true; } } // namespace +#endif BEGIN_VISP_NAMESPACE /*! diff --git a/modules/sensor/test/rgb-depth/testRealSense2_D435_opencv.cpp b/modules/sensor/test/rgb-depth/testRealSense2_D435_opencv.cpp index b58015fe2d..06b4a146a3 100644 --- a/modules/sensor/test/rgb-depth/testRealSense2_D435_opencv.cpp +++ b/modules/sensor/test/rgb-depth/testRealSense2_D435_opencv.cpp @@ -101,36 +101,6 @@ unsigned char getDepthColor(const std::vector &histogram, float z, flo return static_cast(histogram[static_cast(z * depth_scale)] * 255 / histogram[0xFFFF]); } -void getNativeFrame(const rs2::frame &frame, unsigned char *const data) -{ - auto vf = frame.as(); - int size = vf.get_width() * vf.get_height(); - - switch (frame.get_profile().format()) { - case RS2_FORMAT_RGB8: - case RS2_FORMAT_BGR8: - memcpy(data, frame.get_data(), size * 3); - break; - - case RS2_FORMAT_RGBA8: - case RS2_FORMAT_BGRA8: - memcpy(data, frame.get_data(), size * 4); - break; - - case RS2_FORMAT_Y16: - case RS2_FORMAT_Z16: - memcpy(data, frame.get_data(), size * 2); - break; - - case RS2_FORMAT_Y8: - memcpy(data, frame.get_data(), size); - break; - - default: - break; - } -} - void frame_to_mat(const rs2::frame &f, cv::Mat &img) { auto vf = f.as(); From f4c5e13bde12a8154612da1bb96066ed45521dd7 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 20 Sep 2024 09:31:33 +0200 Subject: [PATCH 16/18] Mute warning due to basisu_miniz.h --- modules/core/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index bb3b8c74e8..77f4685a4e 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -329,3 +329,5 @@ vp_add_tests(CTEST_EXCLUDE_PATH network DEPENDS_ON visp_io visp_gui) vp_glob_module_copy_data("test/math/data/*.pgm" "modules/core" NO_INSTALL) # copy font vp_glob_module_copy_data("src/image/private/Rubik-Regular.ttf" "data/font") + +vp_set_source_file_compile_flag(src/tools/file/vpIoTools_npy.cpp -Wno-misleading-indentation) From 47c4a2d7816a0ed821d519d903827b2e0553da4f Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 20 Sep 2024 14:59:58 +0200 Subject: [PATCH 17/18] Fix issues related to system include dir --- cmake/VISPGenerateConfig.cmake | 2 ++ cmake/VISPModule.cmake | 25 ++++++++++++++++++------- cmake/VISPUtils.cmake | 8 ++++---- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/cmake/VISPGenerateConfig.cmake b/cmake/VISPGenerateConfig.cmake index 84710a2903..589dad8dc5 100644 --- a/cmake/VISPGenerateConfig.cmake +++ b/cmake/VISPGenerateConfig.cmake @@ -144,6 +144,7 @@ if(UNIX) set(VISP_INCLUDE_DIRS_CONFIGCMAKE "\${VISP_INSTALL_PATH}/${VISP_INC_INSTALL_PATH}") foreach(m ${VISP_MODULES_BUILD}) list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS}) + list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_SYSTEM_INC_DEPS}) endforeach() vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE) endif() @@ -164,6 +165,7 @@ if(WIN32) set(VISP_INCLUDE_DIRS_CONFIGCMAKE "\${VISP_CONFIG_PATH}/${VISP_INC_INSTALL_PATH}") foreach(m ${VISP_MODULES_BUILD}) list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS}) + list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_SYSTEM_INC_DEPS}) endforeach() vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE) diff --git a/cmake/VISPModule.cmake b/cmake/VISPModule.cmake index fa4d1a54c8..c4fc939f4e 100644 --- a/cmake/VISPModule.cmake +++ b/cmake/VISPModule.cmake @@ -86,6 +86,7 @@ foreach(mod ${VISP_MODULES_BUILD} ${VISP_MODULES_DISABLED_USER} ${VISP_MODULES_D unset(VISP_MODULE_${mod}_PRIVATE_OPT_DEPS CACHE) unset(VISP_MODULE_${mod}_LINK_DEPS CACHE) unset(VISP_MODULE_${mod}_INC_DEPS CACHE) + unset(VISP_MODULE_${mod}_SYSTEM_INC_DEPS CACHE) unset(VISP_MODULE_${mod}_WRAPPERS CACHE) endforeach() @@ -179,6 +180,7 @@ macro(vp_add_module _name) set(VISP_MODULE_${the_module}_LINK_DEPS "" CACHE INTERNAL "") set(VISP_MODULE_${the_module}_INC_DEPS "" CACHE INTERNAL "") + set(VISP_MODULE_${the_module}_SYSTEM_INC_DEPS "" CACHE INTERNAL "") # parse list of dependencies if("${ARGV1}" STREQUAL "INTERNAL" OR "${ARGV1}" STREQUAL "BINDINGS") @@ -606,7 +608,6 @@ macro(vp_target_include_modules target) endforeach() vp_list_unique(VISP_MODULE_${the_module}_INC_DEPS) vp_list_unique(VISP_MODULE_${the_module}_SYSTEM_INC_DEPS) - endmacro() # setup include paths for the list of passed modules and recursively add dependent modules @@ -836,12 +837,22 @@ macro(_vp_create_module) target_compile_definitions(${the_module} PRIVATE visp_EXPORTS) endif() - set_property(TARGET ${the_module} APPEND PROPERTY - INTERFACE_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_INC_DEPS} - ) - set_property(TARGET ${the_module} APPEND PROPERTY - INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS} - ) + #set_property(TARGET ${the_module} APPEND PROPERTY + # # Here we need also to add system include dirs, otherwise they are missing + # INTERFACE_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_INC_DEPS} ${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS} + #) + #set_property(TARGET ${the_module} APPEND PROPERTY + # INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS} + #) + set(inc "${VISP_MODULE_${the_module}_INC_DEPS};${VISP_MODULE_${the_module}_SYSTEM_INC_DEPS}") + if(NOT (CMAKE_VERSION VERSION_LESS "3.11.0")) # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/1264 : eliminates "Cannot specify compile definitions for imported target" error message + target_include_directories(${the_module} SYSTEM INTERFACE "$") + else() + set_target_properties(${the_module} PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "$" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "$" + ) + endif() # For dynamic link numbering convenions if(NOT ANDROID) diff --git a/cmake/VISPUtils.cmake b/cmake/VISPUtils.cmake index 4a332e02a2..e3094740e1 100644 --- a/cmake/VISPUtils.cmake +++ b/cmake/VISPUtils.cmake @@ -214,12 +214,10 @@ function(vp_target_include_directories target) if(TARGET ${target}) target_include_directories(${target} SYSTEM PRIVATE ${__system_params}) else() - set(__new_inc ${VP_TARGET_INCLUDE_SYSTEM_DIRS_${target}}) - list(APPEND __new_inc ${__system_params}) + set(__new_inc "${VP_TARGET_INCLUDE_SYSTEM_DIRS_${target}};${__system_params}") set(VP_TARGET_INCLUDE_SYSTEM_DIRS_${target} "${__new_inc}" CACHE INTERNAL "") endif() endif() - endfunction() # clears all passed variables @@ -794,10 +792,12 @@ function(vp_target_link_libraries target) endfunction() function(_vp_append_target_includes target) + # Only defined for visp_ targets if(DEFINED VP_TARGET_INCLUDE_DIRS_${target}) target_include_directories(${target} PRIVATE ${VP_TARGET_INCLUDE_DIRS_${target}}) unset(VP_TARGET_INCLUDE_DIRS_${target} CACHE) endif() + # Only defined for visp_ targets if(DEFINED VP_TARGET_INCLUDE_SYSTEM_DIRS_${target}) target_include_directories(${target} SYSTEM PRIVATE ${VP_TARGET_INCLUDE_SYSTEM_DIRS_${target}}) unset(VP_TARGET_INCLUDE_SYSTEM_DIRS_${target} CACHE) @@ -1643,7 +1643,7 @@ macro(vp_get_all_includes _includes_modules _includes_extra _system_include_dirs foreach(m ${VISP_MODULES_BUILD}) list(APPEND ${_includes_extra} ${VISP_MODULE_${m}_INC_DEPS}) - list(APPEND ${_system_include_dirs} ${VISP_MODULE_${m}_SYSTEM_INC_DEPS}) + list(APPEND ${_includes_extra} ${VISP_MODULE_${m}_SYSTEM_INC_DEPS}) if(EXISTS "${VISP_MODULE_${m}_LOCATION}/include") list(INSERT ${_includes_modules} 0 "${VISP_MODULE_${m}_LOCATION}/include") From 4ffa1badf50a6c8b5c6ea663419645aa762387f4 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 20 Sep 2024 18:51:39 +0200 Subject: [PATCH 18/18] Fix build issues and warnings on uwp --- modules/core/CMakeLists.txt | 6 ++- .../src/math/random-generator/vpUniRand.cpp | 4 +- modules/core/src/tools/network/vpClient.cpp | 46 ++++++++++--------- modules/core/src/tools/network/vpNetwork.cpp | 20 ++++---- modules/core/src/tools/network/vpServer.cpp | 19 +++++--- .../vpFeatureLuminanceMapping.cpp | 2 +- 6 files changed, 58 insertions(+), 39 deletions(-) diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index 77f4685a4e..dad571c119 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -330,4 +330,8 @@ vp_glob_module_copy_data("test/math/data/*.pgm" "modules/core" NO_INSTALL) # copy font vp_glob_module_copy_data("src/image/private/Rubik-Regular.ttf" "data/font") -vp_set_source_file_compile_flag(src/tools/file/vpIoTools_npy.cpp -Wno-misleading-indentation) +if(UNIX) + vp_set_source_file_compile_flag(src/tools/file/vpIoTools_npy.cpp -Wno-misleading-indentation) +else() + vp_set_source_file_compile_flag(src/tools/file/vpIoTools_npy.cpp /wd4333) +endif() diff --git a/modules/core/src/math/random-generator/vpUniRand.cpp b/modules/core/src/math/random-generator/vpUniRand.cpp index 79157f99e8..b6829b8c3a 100644 --- a/modules/core/src/math/random-generator/vpUniRand.cpp +++ b/modules/core/src/math/random-generator/vpUniRand.cpp @@ -121,7 +121,7 @@ uint32_t vpUniRand::boundedRand(uint32_t bound) // because this version will calculate the same modulus, but the LHS // value is less than 2^32. - uint32_t threshold = -bound % bound; + uint32_t threshold = static_cast(-static_cast(bound) % bound); // Uniformity guarantees that this loop will terminate. In practice, it // should usually terminate quickly; on average (assuming all bounds are @@ -148,7 +148,7 @@ uint32_t vpUniRand::next() m_rng.state = (oldstate * 6364136223846793005ULL) + m_rng.inc; uint32_t xorshifted = static_cast(((oldstate >> 18u) ^ oldstate) >> 27u); uint32_t rot = oldstate >> 59u; - return (xorshifted >> rot) | (xorshifted << ((-rot) & 31)); + return (xorshifted >> rot) | (xorshifted << (static_cast((-static_cast(rot)) & 31))); } /*! diff --git a/modules/core/src/tools/network/vpClient.cpp b/modules/core/src/tools/network/vpClient.cpp index c57366dd24..12fc072ba3 100644 --- a/modules/core/src/tools/network/vpClient.cpp +++ b/modules/core/src/tools/network/vpClient.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -30,17 +29,22 @@ * * Description: * TCP Client - * - * Authors: - * Aurelien Yol - * -*****************************************************************************/ + */ -#include +#include + +// Specific case for UWP to introduce a workaround +// error C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings +#if defined(WINRT) +#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS +#define _WINSOCK_DEPRECATED_NO_WARNINGS +#endif +#endif // inet_ntop() not supported on win XP #ifdef VISP_HAVE_FUNC_INET_NTOP +#include #include BEGIN_VISP_NAMESPACE @@ -97,18 +101,18 @@ bool vpClient::connectToHostname(const std::string &hostname, const unsigned int serv.receptorIP = inet_ntoa(*(in_addr *)server->h_addr); return connectServer(serv); -} + } -/*! - Connect to the server represented by the given ip, and at a given port. + /*! + Connect to the server represented by the given ip, and at a given port. - \sa vpClient::connectToHostname() + \sa vpClient::connectToHostname() - \param ip : IP of the server. - \param port_serv : Port used for the connection. + \param ip : IP of the server. + \param port_serv : Port used for the connection. - \return True if the connection has been etablished, false otherwise. -*/ + \return True if the connection has been etablished, false otherwise. + */ bool vpClient::connectToIP(const std::string &ip, const unsigned int &port_serv) { vpNetwork::vpReceptor serv; @@ -130,13 +134,13 @@ bool vpClient::connectToIP(const std::string &ip, const unsigned int &port_serv) serv.receptorAddress.sin_port = htons((unsigned short)port_serv); return connectServer(serv); -} + } -/*! - Deconnect from the server at a specific index. + /*! + Deconnect from the server at a specific index. - \param index : Index of the server. -*/ + \param index : Index of the server. + */ void vpClient::deconnect(const unsigned int &index) { if (index < receptor_list.size()) { diff --git a/modules/core/src/tools/network/vpNetwork.cpp b/modules/core/src/tools/network/vpNetwork.cpp index 77feb13bd2..194c6d631b 100644 --- a/modules/core/src/tools/network/vpNetwork.cpp +++ b/modules/core/src/tools/network/vpNetwork.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -30,17 +29,22 @@ * * Description: * TCP Network - * - * Authors: - * Aurelien Yol - * -*****************************************************************************/ + */ -#include +#include + +// Specific case for UWP to introduce a workaround +// error C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings +#if defined(WINRT) +#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS +#define _WINSOCK_DEPRECATED_NO_WARNINGS +#endif +#endif // inet_ntop() not supported on win XP #ifdef VISP_HAVE_FUNC_INET_NTOP +#include #include BEGIN_VISP_NAMESPACE vpNetwork::vpNetwork() diff --git a/modules/core/src/tools/network/vpServer.cpp b/modules/core/src/tools/network/vpServer.cpp index b8f23c8663..4b71f22158 100644 --- a/modules/core/src/tools/network/vpServer.cpp +++ b/modules/core/src/tools/network/vpServer.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -30,16 +29,24 @@ * * Description: * TCP Server - * -*****************************************************************************/ + */ -#include +#include -#include +// Specific case for UWP to introduce a workaround +// error C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings +#if defined(WINRT) +#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS +#define _WINSOCK_DEPRECATED_NO_WARNINGS +#endif +#endif // inet_ntop() not supported on win XP #ifdef VISP_HAVE_FUNC_INET_NTOP +#include + +#include #include #if defined(__APPLE__) && defined(__MACH__) // Apple OSX and iOS (Darwin) diff --git a/modules/visual_features/src/visual-feature/vpFeatureLuminanceMapping.cpp b/modules/visual_features/src/visual-feature/vpFeatureLuminanceMapping.cpp index 71a4e77f08..a7ff48337e 100644 --- a/modules/visual_features/src/visual-feature/vpFeatureLuminanceMapping.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureLuminanceMapping.cpp @@ -470,7 +470,7 @@ void vpLuminanceDCT::inverse(const vpColVector &s, vpImage &I) I.resize(Ir.getRows(), Ir.getCols()); for (unsigned int i = 0; i < I.getRows(); ++i) { for (unsigned int j = 0; j < I.getCols(); ++j) { - I[i][j] = std::max(0.0, std::min(Ir[i][j], 255.0)); + I[i][j] = static_cast(std::max(0.0, std::min(Ir[i][j], 255.0))); } } }