Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark include directories of 3rd-party libraries as system includes #2733

Merged
merged 1 commit into from Dec 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions CMakeLists.txt
Expand Up @@ -296,14 +296,14 @@ if(NOT PCL_SHARED_LIBS OR ((WIN32 AND NOT MINGW) AND NOT PCL_BUILD_WITH_FLANN_DY
set(FLANN_USE_STATIC ON)
endif()
find_package(FLANN 1.7.0 REQUIRED)
include_directories(${FLANN_INCLUDE_DIRS})
include_directories(SYSTEM ${FLANN_INCLUDE_DIRS})

# libusb-1.0
option(WITH_LIBUSB "Build USB RGBD-Camera drivers" TRUE)
if(WITH_LIBUSB)
find_package(libusb-1.0)
if(LIBUSB_1_FOUND)
include_directories("${LIBUSB_1_INCLUDE_DIR}")
include_directories(SYSTEM "${LIBUSB_1_INCLUDE_DIR}")
endif()
endif()

Expand All @@ -321,12 +321,12 @@ if(PKG_CONFIG_FOUND)
pkg_check_modules(METSLIB metslib)
if(METSLIB_FOUND)
set(HAVE_METSLIB ON)
include_directories(${METSLIB_INCLUDE_DIRS})
include_directories(SYSTEM ${METSLIB_INCLUDE_DIRS})
else()
include_directories("${PCL_SOURCE_DIR}/recognition/include/pcl/recognition/3rdparty/")
include_directories(SYSTEM "${PCL_SOURCE_DIR}/recognition/include/pcl/recognition/3rdparty/")
endif()
else()
include_directories(${PCL_SOURCE_DIR}/recognition/include/pcl/recognition/3rdparty/)
include_directories(SYSTEM ${PCL_SOURCE_DIR}/recognition/include/pcl/recognition/3rdparty/)
endif()

# LibPNG
Expand All @@ -335,7 +335,7 @@ if(WITH_PNG)
find_package(PNG)
if(PNG_FOUND)
set(HAVE_PNG ON)
include_directories("${PNG_INCLUDE_DIR}")
include_directories(SYSTEM "${PNG_INCLUDE_DIR}")
endif()
endif()

Expand All @@ -347,7 +347,7 @@ if(WITH_QHULL)
endif()
find_package(Qhull)
if(QHULL_FOUND)
include_directories(${QHULL_INCLUDE_DIRS})
include_directories(SYSTEM ${QHULL_INCLUDE_DIRS})
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion apps/CMakeLists.txt
Expand Up @@ -188,7 +188,7 @@ endif() # VTK_FOUND
# OpenGL and GLUT
if(OPENGL_FOUND AND GLUT_FOUND)
if(NOT WIN32)
include_directories("${OPENGL_INCLUDE_DIR}")
include_directories(SYSTEM "${OPENGL_INCLUDE_DIR}")
endif()
PCL_ADD_EXECUTABLE_OPT_BUNDLE(pcl_grabcut_2d "${SUBSYS_NAME}" src/grabcut_2d.cpp)
target_link_libraries (pcl_grabcut_2d pcl_common pcl_io pcl_segmentation pcl_search GLUT::GLUT ${OPENGL_LIBRARIES})
Expand Down
Expand Up @@ -13,7 +13,7 @@ add_definitions(${PCL_DEFINITIONS})
find_package(HDF5 REQUIRED)
find_package(FLANN REQUIRED)

include_directories(
include_directories(SYSTEM
${FLANN_INCLUDE_DIRS}
${HDF5_INCLUDE_DIR}
)
Expand Down
3 changes: 2 additions & 1 deletion gpu/features/test/CMakeLists.txt
Expand Up @@ -23,4 +23,5 @@ get_filename_component(INC7 "${DIR}/../../../octree/include" REALPATH)

file(GLOB test_src *.cpp *.hpp)
list(APPEND test_src ${pcl_gtest_sources})
include_directories("${INC1}" "${INC2}" "${INC3}" "${INC4}" "${INC5}" "${INC6}" "${INC7}" ${VTK_INCLUDE_DIRS})
include_directories("${INC1}" "${INC2}" "${INC3}" "${INC4}" "${INC5}" "${INC6}" "${INC7}")
include_directories(SYSTEM ${VTK_INCLUDE_DIRS})
3 changes: 2 additions & 1 deletion gpu/kinfu/CMakeLists.txt
Expand Up @@ -32,7 +32,8 @@ source_group("Source Files\\cuda" FILES ${cuda})
source_group("Source Files" FILES ${srcs})

set(LIB_NAME "pcl_${SUBSYS_NAME}")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/src" ${CUDA_INCLUDE_DIRS})
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/src")
include_directories(SYSTEM ${CUDA_INCLUDE_DIRS})

if(UNIX OR APPLE)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;-fPIC;")
Expand Down
2 changes: 1 addition & 1 deletion gpu/kinfu/tools/CMakeLists.txt
Expand Up @@ -14,7 +14,7 @@ else()
endif()

file(GLOB hdrs "*.h*")
include_directories(${VTK_INCLUDE_DIRS} ${OPENNI_INCLUDE_DIRS})
include_directories(SYSTEM ${VTK_INCLUDE_DIRS} ${OPENNI_INCLUDE_DIRS})

## KINECT FUSION
set(the_target pcl_kinfu_app)
Expand Down
2 changes: 1 addition & 1 deletion gpu/kinfu_large_scale/tools/CMakeLists.txt
Expand Up @@ -14,7 +14,7 @@ else()
endif()

file(GLOB hdrs "*.h*")
include_directories(${VTK_INCLUDE_DIRS})
include_directories(SYSTEM ${VTK_INCLUDE_DIRS})

## STANDALONE TEXTURE MAPPING
set(the_target pcl_kinfu_largeScale_texture_output)
Expand Down
5 changes: 4 additions & 1 deletion gpu/people/CMakeLists.txt
Expand Up @@ -48,11 +48,14 @@ source_group("Source files\\cuda" FILES ${srcs_cuda})
source_group("Source files" FILES ${srcs})

include_directories(
${VTK_INCLUDE_DIRS}
"${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}/src"
"${CMAKE_CURRENT_SOURCE_DIR}/src/cuda"
"${CMAKE_CURRENT_SOURCE_DIR}/src/cuda/nvidia"
)

include_directories(SYSTEM
${VTK_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${CUDA_INCLUDE_DIRS}
)
Expand Down
2 changes: 1 addition & 1 deletion gpu/people/tools/CMakeLists.txt
Expand Up @@ -11,7 +11,7 @@ endif()

set(the_target people_tracking)

include_directories(${VTK_INCLUDE_DIRS})
include_directories(SYSTEM ${VTK_INCLUDE_DIRS})

#PCL_ADD_EXECUTABLE("${the_target}" "${SUBSYS_NAME}" people_tracking.cpp)
#target_link_libraries("${the_target}" pcl_common pcl_filters pcl_kdtree pcl_segmentation pcl_kdtree pcl_gpu_people pcl_filters pcl_io pcl_visualization)
Expand Down
2 changes: 1 addition & 1 deletion gpu/surface/CMakeLists.txt
Expand Up @@ -26,7 +26,7 @@ source_group("Source Files\\cuda" FILES ${cuda})
list(APPEND srcs ${utils} ${cuda})


include_directories(${VTK_INCLUDE_DIRS})
include_directories(SYSTEM ${VTK_INCLUDE_DIRS})

set(LIB_NAME "pcl_${SUBSYS_NAME}")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_SOURCE_DIR}/src/cuda")
Expand Down
3 changes: 2 additions & 1 deletion gpu/surface/test/CMakeLists.txt
Expand Up @@ -13,7 +13,8 @@ get_filename_component(INC_SURF_CPU "${DIR}/../../../surface/include" REALPATH)
get_filename_component(INC_SEA "${DIR}/../../../search/include" REALPATH)
get_filename_component(INC_KD "${DIR}/../../../kdtree/include" REALPATH)
get_filename_component(INC_OCT "${DIR}/../../../octree/include" REALPATH)
include_directories("${INC_SURF}" "${INC_IO}" "${INC_VIZ}" "${INC_GEO}" "${INC_SURF_CPU}" "${INC_SEA}" "${INC_KD}" "${INC_OCT}" ${VTK_INCLUDE_DIRS})
include_directories("${INC_SURF}" "${INC_IO}" "${INC_VIZ}" "${INC_GEO}" "${INC_SURF_CPU}" "${INC_SEA}" "${INC_KD}" "${INC_OCT}")
include_directories(SYSTEM ${VTK_INCLUDE_DIRS})

file(GLOB test_src *.cpp *.hpp)
#PCL_ADD_TEST(a_gpu_surface_test ${the_test_target} FILES ${test_src} LINK_WITH pcl_io pcl_gpu_containers pcl_gpu_surface pcl_visualization pcl_surface pcl_octree pcl_kdtree pcl_search)
Expand Down
2 changes: 1 addition & 1 deletion io/CMakeLists.txt
Expand Up @@ -249,7 +249,7 @@ endif()

if(PCAP_FOUND)
set(PCAP_DEFINES -DHAVE_PCAP)
include_directories(${PCAP_INCLUDE_DIRS})
include_directories(SYSTEM ${PCAP_INCLUDE_DIRS})
add_definitions(${PCAP_DEFINES})
endif()

Expand Down
2 changes: 1 addition & 1 deletion simulation/tools/CMakeLists.txt
Expand Up @@ -5,7 +5,7 @@ if(NOT (GLEW_FOUND AND GLUT_FOUND))
return()
endif()

include_directories(${VTK_INCLUDE_DIRS})
include_directories(SYSTEM ${VTK_INCLUDE_DIRS})

PCL_ADD_EXECUTABLE(pcl_sim_viewer ${SUBSYS_NAME} sim_viewer.cpp)
target_link_libraries (pcl_sim_viewer
Expand Down
8 changes: 7 additions & 1 deletion surface/CMakeLists.txt
Expand Up @@ -152,7 +152,13 @@ set(impl_incs
)

set(LIB_NAME "pcl_${SUBSYS_NAME}")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include" ${VTK_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}")
include_directories(
"${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}"
)
include_directories(SYSTEM
${VTK_INCLUDE_DIRS}
)
link_directories(${VTK_LIBRARY_DIRS})
PCL_ADD_LIBRARY("${LIB_NAME}" "${SUBSYS_NAME}" ${srcs} ${incs} ${impl_incs} ${VTK_SMOOTHING_INCLUDES} ${POISSON_INCLUDES} ${OPENNURBS_INCLUDES} ${ON_NURBS_INCLUDES})
target_link_libraries("${LIB_NAME}" pcl_common pcl_search pcl_kdtree pcl_octree ${VTK_LIBRARIES} ${ON_NURBS_LIBRARIES})
Expand Down
2 changes: 1 addition & 1 deletion test/io/CMakeLists.txt
Expand Up @@ -35,7 +35,7 @@ PCL_ADD_TEST(io_ply_io test_ply_io

# Uses VTK readers to verify
if(VTK_FOUND AND NOT ANDROID)
include_directories(${VTK_INCLUDE_DIRS})
include_directories(SYSTEM ${VTK_INCLUDE_DIRS})
PCL_ADD_TEST (io_ply_mesh_io test_ply_mesh_io
FILES test_ply_mesh_io.cpp
LINK_WITH pcl_gtest pcl_io
Expand Down
2 changes: 1 addition & 1 deletion test/outofcore/CMakeLists.txt
Expand Up @@ -12,7 +12,7 @@ if(NOT build)
return()
endif()

include_directories(${VTK_INCLUDE_DIRS})
include_directories(SYSTEM ${VTK_INCLUDE_DIRS})
PCL_ADD_TEST (outofcore_test test_outofcore
FILES test_outofcore.cpp
LINK_WITH pcl_gtest pcl_common pcl_io pcl_filters pcl_outofcore pcl_visualization)
2 changes: 1 addition & 1 deletion test/people/CMakeLists.txt
Expand Up @@ -12,7 +12,7 @@ if(NOT build)
return()
endif()

include_directories(${VTK_INCLUDE_DIRS})
include_directories(SYSTEM ${VTK_INCLUDE_DIRS})
PCL_ADD_TEST(a_people_detection_test test_people_detection
FILES test_people_groundBasedPeopleDetectionApp.cpp
LINK_WITH pcl_gtest pcl_common pcl_io pcl_kdtree pcl_search pcl_features pcl_sample_consensus pcl_filters pcl_io pcl_segmentation pcl_people
Expand Down
2 changes: 1 addition & 1 deletion tools/CMakeLists.txt
Expand Up @@ -270,7 +270,7 @@ target_link_libraries (pcl_transform_from_viewpoint pcl_common pcl_io pcl_regist

find_package(tide QUIET)
if(Tide_FOUND)
include_directories(${Tide_INCLUDE_DIRS})
include_directories(SYSTEM ${Tide_INCLUDE_DIRS})
add_definitions(${Tide_DEFINITIONS})
PCL_ADD_EXECUTABLE(pcl_video "${SUBSYS_NAME}" pcl_video.cpp)
target_link_libraries(pcl_video pcl_common pcl_io pcl_visualization
Expand Down
4 changes: 2 additions & 2 deletions visualization/CMakeLists.txt
Expand Up @@ -23,7 +23,7 @@ endif()

if(OPENGL_FOUND)
if(OPENGL_INCLUDE_DIR)
include_directories("${OPENGL_INCLUDE_DIR}")
include_directories(SYSTEM "${OPENGL_INCLUDE_DIR}")
endif()
if(OPENGL_DEFINITIONS)
add_definitions("${OPENGL_DEFINITIONS}")
Expand Down Expand Up @@ -136,7 +136,7 @@ endif()
set(LIB_NAME "pcl_${SUBSYS_NAME}")
PCL_ADD_LIBRARY("${LIB_NAME}" "${SUBSYS_NAME}" ${srcs} ${incs} ${common_incs} ${impl_incs} ${common_impl_incs} ${vtk_incs})

target_include_directories("${LIB_NAME}" PUBLIC ${VTK_INCLUDE_DIRS})
target_include_directories("${LIB_NAME}" SYSTEM PUBLIC ${VTK_INCLUDE_DIRS})

# apple workaround (continued)
if(APPLE)
Expand Down