Skip to content

Commit

Permalink
Use import target OpenGL::GL
Browse files Browse the repository at this point in the history
  • Loading branch information
Heiko Thiel committed Dec 5, 2018
1 parent ef26232 commit fc6a99f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 27 deletions.
5 changes: 1 addition & 4 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,8 @@ if(build)

# OpenGL and GLUT
if(OPENGL_FOUND AND GLUT_FOUND)
if(NOT WIN32)
include_directories("${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})
target_link_libraries (pcl_grabcut_2d pcl_common pcl_io pcl_segmentation pcl_search GLUT::GLUT OpenGL::GL)
endif()

collect_subproject_directory_names("${CMAKE_CURRENT_SOURCE_DIR}" "CMakeLists.txt" PCL_APPS_MODULES_NAMES PCL_APPS_MODULES_DIRS ${SUBSYS_NAME})
Expand Down
4 changes: 2 additions & 2 deletions apps/in_hand_scanner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ if(build)

set(EXE_NAME "pcl_${SUBSUBSYS_NAME}")
pcl_add_executable_opt_bundle("${EXE_NAME}" "${SUBSUBSYS_NAME}" ${SRCS} ${INCS} ${IMPL_INCS})
target_link_libraries("${EXE_NAME}" ${SUBSUBSYS_LIBS} ${OPENGL_LIBRARIES} ${QT_LIBRARIES})
target_link_libraries("${EXE_NAME}" ${SUBSUBSYS_LIBS} OpenGL::GL ${QT_LIBRARIES})

pcl_add_includes("${SUBSUBSYS_NAME}" "${SUBSUBSYS_NAME}" ${INCS})
pcl_add_includes("${SUBSUBSYS_NAME}" "${SUBSUBSYS_NAME}/impl" ${IMPL_INCS})
Expand All @@ -135,6 +135,6 @@ if(build)
list(APPEND OI_SRCS "${MOC_OPENGL_VIEWER_SRC}" "${MOC_OFFLINE_INTEGRATION_SRC}")

pcl_add_executable_opt_bundle(pcl_offline_integration "${SUBSUBSYS_NAME}" ${OI_SRCS} ${OI_INCS})
target_link_libraries(pcl_offline_integration ${SUBSUBSYS_LIBS} ${OPENGL_LIBRARIES} ${QT_LIBRARIES})
target_link_libraries(pcl_offline_integration ${SUBSUBSYS_LIBS} OpenGL::GL ${QT_LIBRARIES})

endif()
2 changes: 1 addition & 1 deletion apps/point_cloud_editor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ if(BUILD)
TARGET_LINK_LIBRARIES("${EXE_NAME}"
${QT_LIBRARIES}
${QT_QTOPENGL_LIBRARY}
${OPENGL_LIBRARIES}
OpenGL::GL
${BOOST_LIBRARIES}
pcl_common
pcl_io
Expand Down
3 changes: 1 addition & 2 deletions simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ if(build)

PCL_ADD_LIBRARY("${LIB_NAME}" "${SUBSYS_NAME}" ${srcs} ${incs})

target_link_libraries("${LIB_NAME}" pcl_common pcl_io
${OPENGL_LIBRARIES} GLEW::GLEW)
target_link_libraries("${LIB_NAME}" pcl_common pcl_io OpenGL::GL GLEW::GLEW)

set(EXT_DEPS eigen3)
PCL_MAKE_PKGCONFIG("${LIB_NAME}" "${SUBSYS_NAME}" "${SUBSYS_DESC}"
Expand Down
14 changes: 7 additions & 7 deletions simulation/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ if(GLEW_FOUND)
target_link_libraries (pcl_sim_viewer
${VTK_IO_TARGET_LINK_LIBRARIES} pcl_kdtree
pcl_simulation pcl_common pcl_io pcl_visualization
GLEW::GLEW GLUT::GLUT ${OPENGL_LIBRARIES})
GLEW::GLEW GLUT::GLUT OpenGL::GL)

PCL_ADD_EXECUTABLE(pcl_sim_test_simple ${SUBSYS_NAME} sim_test_simple.cpp)
target_link_libraries (pcl_sim_test_simple
${VTK_IO_TARGET_LINK_LIBRARIES}
pcl_simulation pcl_common pcl_io pcl_visualization
GLEW::GLEW GLUT::GLUT ${OPENGL_LIBRARIES})
GLEW::GLEW GLUT::GLUT OpenGL::GL)

PCL_ADD_EXECUTABLE(pcl_sim_test_performance ${SUBSYS_NAME} sim_test_performance.cpp)
target_link_libraries (pcl_sim_test_performance
${VTK_IO_TARGET_LINK_LIBRARIES}
pcl_simulation pcl_common pcl_io pcl_visualization
GLEW::GLEW GLUT::GLUT ${OPENGL_LIBRARIES})
GLEW::GLEW GLUT::GLUT OpenGL::GL)

set(srcs simulation_io.cpp)
set(incs simulation_io.hpp)
Expand All @@ -30,12 +30,12 @@ if(GLEW_FOUND)
${VTK_IO_TARGET_LINK_LIBRARIES}
${OPENNI_INCLUDES})
target_link_libraries(${LIB_NAME} pcl_simulation pcl_common pcl_io
${VTK_IO_TARGET_LINK_LIBRARIES} ${OPENGL_LIBRARIES} GLUT::GLUT)
${VTK_IO_TARGET_LINK_LIBRARIES} OpenGL::GL GLUT::GLUT)

PCL_ADD_EXECUTABLE(pcl_sim_terminal_demo ${SUBSYS_NAME} sim_terminal_demo.cpp)
target_link_libraries (pcl_sim_terminal_demo
${VTK_IO_TARGET_LINK_LIBRARIES}
pcl_simulation pcl_common pcl_io pcl_visualization pcl_simulation_io
GLEW::GLEW GLUT::GLUT ${OPENGL_LIBRARIES})
${VTK_IO_TARGET_LINK_LIBRARIES}
pcl_simulation pcl_common pcl_io pcl_visualization pcl_simulation_io
GLEW::GLEW GLUT::GLUT OpenGL::GL)
endif()
endif()
13 changes: 2 additions & 11 deletions visualization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ if(ANDROID)
message("VTK was found, but cannot be compiled for Android. Please use VES instead.")
endif()

if(OPENGL_FOUND)
if(OPENGL_INCLUDE_DIR)
include_directories("${OPENGL_INCLUDE_DIR}")
endif()
if(OPENGL_DEFINITIONS)
add_definitions("${OPENGL_DEFINITIONS}")
endif()
endif()

PCL_ADD_DOC("${SUBSYS_NAME}")

if(build)
Expand Down Expand Up @@ -159,9 +150,9 @@ if(build)
endif()

if("${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" VERSION_LESS "5.6")
target_link_libraries("${LIB_NAME}" pcl_common pcl_io pcl_kdtree vtkCommon vtkWidgets vtkHybrid vtkFiltering vtkRendering ${OPENGL_LIBRARIES})
target_link_libraries("${LIB_NAME}" pcl_common pcl_io pcl_kdtree vtkCommon vtkWidgets vtkHybrid vtkFiltering vtkRendering OpenGL::GL)
else()
target_link_libraries("${LIB_NAME}" pcl_common pcl_io pcl_kdtree ${VTK_LIBRARIES} ${OPENGL_LIBRARIES})
target_link_libraries("${LIB_NAME}" pcl_common pcl_io pcl_kdtree ${VTK_LIBRARIES} OpenGL::GL)
endif()

set(EXT_DEPS "")
Expand Down

0 comments on commit fc6a99f

Please sign in to comment.