Modern usage of Qt5 CMake scripts, to allow CMAKE_WARN_DEPRECATED

This commit is contained in:
Laurent Rineau 2017-11-17 12:54:13 +01:00
parent 0c5ffa9968
commit 25dffa1710
26 changed files with 71 additions and 167 deletions

View File

@ -59,15 +59,12 @@ if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FO
"${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp" )
add_executable ( AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules(AABB_demo Gui OpenGL Xml Script Svg )
# Link with Qt libraries
target_link_libraries( AABB_demo ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( AABB_demo ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )
# Link with libQGLViewer, OpenGL
target_link_libraries( AABB_demo ${QGLVIEWER_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
target_link_libraries( AABB_demo PRIVATE
Qt5::OpenGL Qt5::Gui
CGAL::CGAL
CGAL::CGAL_Qt5
${QGLVIEWER_LIBRARIES})
add_to_cached_list( CGAL_EXECUTABLE_TARGETS AABB_demo )

View File

@ -40,12 +40,12 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_
qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Alpha_shape_3.qrc )
add_executable ( Alpha_shape_3 Alpha_shape_3.cpp MainWindow.cpp Viewer.cpp ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules(Alpha_shape_3 Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Alpha_shape_3 )
target_link_libraries( Alpha_shape_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Alpha_shape_3 ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} )
target_link_libraries( Alpha_shape_3 ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
target_link_libraries( Alpha_shape_3 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5
Qt5::OpenGL Qt5::Gui
${QGLVIEWER_LIBRARIES} )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Alpha_shapes_3)

View File

@ -11,7 +11,7 @@ endif()
find_package(CGAL COMPONENTS Core Qt5 )
include( ${CGAL_USE_FILE} )
find_package( Qt5 QUIET COMPONENTS Script Widgets )
find_package( Qt5 QUIET COMPONENTS Gui )
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND)
include_directories( ./ )
@ -68,11 +68,9 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND)
${arrangement_2_uis}
${CGAL_Qt5_RESOURCE_FILES}
)
qt5_use_modules(arrangement_2 Widgets Script)
target_link_libraries( arrangement_2
${CGAL_LIBRARIES}
${CGAL_3RD_PARTY_LIBRARIES}
${QT_LIBRARIES}
target_link_libraries( arrangement_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 CGAL::CGAL_Core
Qt5::Gui
)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS arrangement_2 )

View File

@ -22,13 +22,11 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_
add_executable (Circular_kernel_3 Circular_kernel_3.cpp Viewer.cpp ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules( Circular_kernel_3 Xml Script OpenGL)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Circular_kernel_3 )
target_link_libraries( Circular_kernel_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Circular_kernel_3 ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} )
target_link_libraries( Circular_kernel_3 ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
target_link_libraries( Circular_kernel_3 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5
Qt5::OpenGL Qt5::Gui ${QGLVIEWER_LIBRARIES} )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Circular_kernel_3)

View File

@ -35,14 +35,10 @@ qt5_generate_moc( Alpha_shapes_2.cpp Alpha_shapes_2.moc )
# The executable itself.
add_executable ( Alpha_shapes_2 Alpha_shapes_2.cpp Alpha_shapes_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules(Alpha_shapes_2 Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Alpha_shapes_2 )
# Link with Qt libraries
target_link_libraries( Alpha_shapes_2 ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( Alpha_shapes_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Alpha_shapes_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Alpha_shapes_2)

View File

@ -33,14 +33,11 @@ qt5_generate_moc( Apollonius_graph_2.cpp Apollonius_graph_2.moc )
# The executable itself.
add_executable ( Apollonius_graph_2 Apollonius_graph_2.cpp Apollonius_graph_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules(Apollonius_graph_2 Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Apollonius_graph_2 )
# Link with Qt libraries
target_link_libraries( Apollonius_graph_2 ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( Apollonius_graph_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Apollonius_graph_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5
Qt5::Gui )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Apollonius_graph_2)

View File

@ -38,14 +38,10 @@ qt5_generate_moc( "Bounding_volumes.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Bounding_v
# The executable itself.
add_executable ( Bounding_volumes Bounding_volumes.cpp Bounding_volumes.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules(Bounding_volumes Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Bounding_volumes )
# Link with Qt libraries
target_link_libraries( Bounding_volumes ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( Bounding_volumes ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Bounding_volumes PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Bounding_volumes)

View File

@ -38,14 +38,10 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )
# The executable itself.
add_executable ( Circular_kernel_2 Circular_kernel_2.cpp Circular_kernel_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules(Circular_kernel_2 Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Circular_kernel_2 )
# Link with Qt libraries
target_link_libraries( Circular_kernel_2 ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( Circular_kernel_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Circular_kernel_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Circular_kernel_2)

View File

@ -1,4 +1,3 @@
# Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application.
project (Generator_Demo)
@ -15,8 +14,6 @@ include(${CGAL_USE_FILE})
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)
include_directories (BEFORE ../../include)
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )
add_definitions(-DQT_NO_KEYWORDS)
@ -35,14 +32,10 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )
# The executable itself.
add_executable ( Generator_2 Generator_2.cpp Generator_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} )
qt5_use_modules(Generator_2 Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Generator_2 )
# Link with Qt libraries
target_link_libraries( Generator_2 ${QT_LIBRARIES} )
# And with CGAL libraries
target_link_libraries( Generator_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )
target_link_libraries( Generator_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Generator_2)

View File

@ -20,14 +20,10 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )
add_executable ( min min.cpp ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules(min Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS min )
# Link with Qt libraries
target_link_libraries( min ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( min ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( min PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(min)

View File

@ -37,14 +37,10 @@ qt5_generate_moc( L1_voronoi_diagram_2.cpp L1_voronoi_diagram_2.moc )
# The executable itself.
add_executable ( L1_voronoi_diagram_2 L1_voronoi_diagram_2.cpp L1_voronoi_diagram_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} )
qt5_use_modules(L1_voronoi_diagram_2 Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS L1_voronoi_diagram_2 )
# Link with Qt libraries
target_link_libraries( L1_voronoi_diagram_2 ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( L1_voronoi_diagram_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( L1_voronoi_diagram_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(L1_voronoi_diagram_2)

View File

@ -36,14 +36,10 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )
# The executable itself.
add_executable ( Largest_empty_rectangle_2 Largest_empty_rectangle_2.cpp Largest_empty_rectangle_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} )
qt5_use_modules(Largest_empty_rectangle_2 Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Largest_empty_rectangle_2 )
# Link with Qt libraries
target_link_libraries( Largest_empty_rectangle_2 ${QT_LIBRARIES} )
# And with CGAL libraries
target_link_libraries( Largest_empty_rectangle_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )
target_link_libraries( Largest_empty_rectangle_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Largest_empty_rectangle_2)

View File

@ -53,14 +53,10 @@ add_executable ( Periodic_2_Delaunay_triangulation_2
${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}
${headers} ${QT_headers} ${P2T2_headers})
qt5_use_modules( Periodic_2_Delaunay_triangulation_2 Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Periodic_2_Delaunay_triangulation_2 )
# Link with Qt libraries
target_link_libraries( Periodic_2_Delaunay_triangulation_2 ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( Periodic_2_Delaunay_triangulation_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Periodic_2_Delaunay_triangulation_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Periodic_2_Delaunay_triangulation_2)

View File

@ -43,15 +43,10 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )
# The executable itself.
add_executable ( Polygon_2 Polygon_2.cpp Polygon_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} )
qt5_use_modules(Polygon_2 Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Polygon_2 )
# Link with Qt libraries
target_link_libraries( Polygon_2 ${QT_LIBRARIES} )
# And with CGAL libraries
target_link_libraries( Polygon_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )
target_link_libraries( Polygon_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Polygon_2)

View File

@ -43,14 +43,10 @@ qt5_generate_moc( "Segment_voronoi_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Segment_v
# The executable itself.
add_executable ( Segment_voronoi_2 Segment_voronoi_2.cpp Segment_voronoi_2.moc ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules(Segment_voronoi_2 Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Segment_voronoi_2 )
# Link with Qt libraries
target_link_libraries( Segment_voronoi_2 ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( Segment_voronoi_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Segment_voronoi_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Segment_voronoi_2)

View File

@ -43,14 +43,10 @@ qt5_generate_moc( "Segment_voronoi_linf_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Segm
# The executable itself.
add_executable ( Segment_voronoi_linf_2 Segment_voronoi_linf_2.cpp Segment_voronoi_linf_2.moc ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules(Segment_voronoi_linf_2 Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Segment_voronoi_linf_2 )
# Link with Qt libraries
target_link_libraries( Segment_voronoi_linf_2 ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( Segment_voronoi_linf_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Segment_voronoi_linf_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Segment_voronoi_linf_2)

View File

@ -35,14 +35,10 @@ qt5_generate_moc( Snap_rounding_2.cpp Snap_rounding_2.moc )
# The executable itself.
add_executable ( Snap_rounding_2 Snap_rounding_2.cpp Snap_rounding_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} )
qt5_use_modules(Snap_rounding_2 Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Snap_rounding_2 )
# Link with Qt libraries
target_link_libraries( Snap_rounding_2 ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( Snap_rounding_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Snap_rounding_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Snap_rounding_2)

View File

@ -37,14 +37,11 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )
# The executable itself.
add_executable ( Spatial_searching_2 Spatial_searching_2.cpp Spatial_searching_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} )
qt5_use_modules(Spatial_searching_2 Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Spatial_searching_2 )
# Link with Qt libraries
target_link_libraries( Spatial_searching_2 ${QT_LIBRARIES} )
# And with CGAL libraries
target_link_libraries( Spatial_searching_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )
target_link_libraries( Spatial_searching_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Spatial_searching_2)

View File

@ -36,14 +36,10 @@ qt5_generate_moc( Stream_lines_2.cpp Stream_lines_2.moc )
# The executable itself.
add_executable ( Stream_lines_2 Stream_lines_2.cpp Stream_lines_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} )
qt5_use_modules(Stream_lines_2 Xml Script OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Stream_lines_2 )
# Link with Qt libraries
target_link_libraries( Stream_lines_2 ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( Stream_lines_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Stream_lines_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Stream_lines_2)

View File

@ -71,15 +71,11 @@ add_executable(Linear_cell_complex_3_demo
typedefs.h import_moka.h
${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules(Linear_cell_complex_3_demo Xml Script OpenGL Svg)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Linear_cell_complex_3_demo)
target_link_libraries(Linear_cell_complex_3_demo ${CGAL_LIBRARIES}
${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries(Linear_cell_complex_3_demo ${QT_LIBRARIES}
${QGLVIEWER_LIBRARIES} )
target_link_libraries(Linear_cell_complex_3_demo ${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY} )
target_link_libraries(Linear_cell_complex_3_demo PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui Qt5::OpenGL
${QGLVIEWER_LIBRARIES} )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Linear_cell_complex_3_demo)

View File

@ -31,8 +31,6 @@ find_path(CIMG_INCLUDE_DIR
DOC "Path to the header of the CImg library")
if (CIMG_INCLUDE_DIR)
add_definitions(-DCGAL_USE_CIMG)
include_directories(${CIMG_INCLUDE_DIR})
MESSAGE(STATUS "CImg library found, the demo can load point set from image files.")
else()
MESSAGE(STATUS "CImg library was not found, the demo will not be able to load point set from image files. "
@ -79,24 +77,18 @@ if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND)
add_executable ( Otr2_demo ${SRCS} ${CGAL_Qt5_MOC_FILES} ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES})
qt5_use_modules(Otr2_demo OpenGL)
# Link with Qt libraries
target_link_libraries( Otr2_demo ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( Otr2_demo ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )
# Link with OpenGL
target_link_libraries( Otr2_demo ${OPENGL_gl_LIBRARY} )
target_link_libraries( Otr2_demo PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui Qt5::OpenGL )
# Link with pthread if necessary
if (CIMG_INCLUDE_DIR)
target_compile_definitions( Otr2_demo PRIVATE -DCGAL_USE_CIMG )
target_include_directories( Otr2_demo PRIVATE ${CIMG_INCLUDE_DIR} )
# Is pthread around? If yes, we need to link against it
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package (Threads)
if (CMAKE_USE_PTHREADS_INIT)
target_link_libraries( Otr2_demo ${CMAKE_THREAD_LIBS_INIT} )
target_link_libraries( Otr2_demo PRIVATE ${CMAKE_THREAD_LIBS_INIT} )
endif()
endif()

View File

@ -67,12 +67,10 @@ if (CGAL_FOUND AND CGAL_Qt5_FOUND AND OPENGL_FOUND AND Qt5_FOUND AND QGLVIEWER_F
MainWindow.ui moc_MainWindow.cpp
${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} Periodic_3_triangulation_3.qhc)
qt5_use_modules(periodic_3_triangulation_3_demo Xml Help OpenGL)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS periodic_3_triangulation_3_demo)
# Link the executable to CGAL and third-party libraries
target_link_libraries(periodic_3_triangulation_3_demo ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
target_link_libraries(periodic_3_triangulation_3_demo PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::OpenGL Qt5::Help ${QGLVIEWER_LIBRARIES})
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(periodic_3_triangulation_3_demo)

View File

@ -58,12 +58,11 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_
add_executable ( Periodic_Lloyd_3 Periodic_Lloyd_3.qhc Periodic_Lloyd_3.cpp MainWindow.cpp Viewer.cpp ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules(Periodic_Lloyd_3 Xml Script Help OpenGL Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Periodic_Lloyd_3 )
target_link_libraries( Periodic_Lloyd_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Periodic_Lloyd_3 ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} )
target_link_libraries( Periodic_Lloyd_3 ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
target_link_libraries( Periodic_Lloyd_3 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::OpenGL Qt5::Help
${QGLVIEWER_LIBRARIES} )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Periodic_Lloyd_3)

View File

@ -36,12 +36,8 @@ qt5_generate_moc( ${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.cpp Poly
# The executable itself.
add_executable ( Polyline_simplification_2 ${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.cpp Polyline_simplification_2.moc ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules(Polyline_simplification_2 Xml Script OpenGL Widgets Svg)
# Link with Qt libraries
target_link_libraries( Polyline_simplification_2 ${QT_LIBRARIES} )
# Link with CGAL
target_link_libraries( Polyline_simplification_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( Polyline_simplification_2 PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Polyline_simplification_2 )

View File

@ -47,18 +47,12 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND)
qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES PCA_demo.qrc )
add_file_dependencies( PCA_demo.cpp "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" )
add_executable ( PCA_demo PCA_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules( PCA_demo Xml Script OpenGL)
# Link with Qt libraries
target_link_libraries( PCA_demo ${QT_LIBRARIES} )
add_file_dependencies( PCA_demo.cpp "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" )
add_executable ( PCA_demo PCA_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
# Link with CGAL
target_link_libraries( PCA_demo ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )
# Link with libQGLViewer, OpenGL
target_link_libraries( PCA_demo ${QGLVIEWER_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
target_link_libraries( PCA_demo PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
add_to_cached_list( CGAL_EXECUTABLE_TARGETS PCA_demo )

View File

@ -97,8 +97,6 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND)
add_executable ( ${prj} ${sources} ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
qt5_use_modules(${prj} OpenGL Xml Svg)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${prj} )
set(VTK_LIBS "")
@ -116,10 +114,10 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND)
message(STATUS "For reading Dicom files install VTK first")
endif()
# Link the executable to CGAL and third-party libraries
target_link_libraries( ${prj} ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_link_libraries( ${prj} ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${VTK_LIBS})
target_link_libraries( ${prj} PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 CGAL::CGAL_ImageIO
${QGLVIEWER_LIBRARIES}
${VTK_LIBS} )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(${prj})