mirror of https://github.com/CGAL/cgal
Update CMakeLists for QT6
This commit is contained in:
parent
4740f81a1b
commit
0303b8dfd5
|
|
@ -4,39 +4,24 @@
|
||||||
cmake_minimum_required(VERSION 3.1...3.23)
|
cmake_minimum_required(VERSION 3.1...3.23)
|
||||||
project(Polyline_simplification_2_Demo)
|
project(Polyline_simplification_2_Demo)
|
||||||
|
|
||||||
if(NOT POLICY CMP0070 AND POLICY CMP0053)
|
|
||||||
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
|
|
||||||
cmake_policy(SET CMP0053 OLD)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(POLICY CMP0071)
|
|
||||||
cmake_policy(SET CMP0071 NEW)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
|
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
|
||||||
|
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Widgets)
|
find_package(Qt6 QUIET COMPONENTS Widgets)
|
||||||
|
|
||||||
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||||
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
|
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
|
||||||
set(CMAKE_AUTOMOC ON)
|
|
||||||
|
|
||||||
add_definitions(-DQT_NO_KEYWORDS)
|
add_definitions(-DQT_NO_KEYWORDS)
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
# UI files (Qt Designer files)
|
|
||||||
qt6_wrap_ui(CDT_UI_FILES Polyline_simplification_2.ui)
|
|
||||||
|
|
||||||
# qrc files (resources files, that contain icons, at least)
|
|
||||||
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.qrc)
|
|
||||||
|
|
||||||
# The executable itself.
|
# The executable itself.
|
||||||
add_executable(
|
qt_add_executable(
|
||||||
Polyline_simplification_2
|
Polyline_simplification_2
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.cpp ${CDT_UI_FILES}
|
Polyline_simplification_2.cpp Polyline_simplification_2.ui Polyline_simplification_2.qrc)
|
||||||
${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES})
|
|
||||||
|
|
||||||
target_link_libraries(Polyline_simplification_2
|
target_link_libraries(Polyline_simplification_2
|
||||||
PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 Qt6::Widgets)
|
PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 Qt6::Widgets)
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,6 @@
|
||||||
cmake_minimum_required(VERSION 3.1...3.23)
|
cmake_minimum_required(VERSION 3.1...3.23)
|
||||||
project(Surface_mesh_deformation_Demo)
|
project(Surface_mesh_deformation_Demo)
|
||||||
|
|
||||||
if(NOT POLICY CMP0070 AND POLICY CMP0053)
|
|
||||||
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
|
|
||||||
cmake_policy(SET CMP0053 OLD)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set_property(DIRECTORY PROPERTY CGAL_NO_TESTING TRUE)
|
set_property(DIRECTORY PROPERTY CGAL_NO_TESTING TRUE)
|
||||||
|
|
||||||
find_package(CGAL REQUIRED)
|
find_package(CGAL REQUIRED)
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,6 @@
|
||||||
cmake_minimum_required(VERSION 3.1...3.23)
|
cmake_minimum_required(VERSION 3.1...3.23)
|
||||||
project(Triangulation_3_Demo)
|
project(Triangulation_3_Demo)
|
||||||
|
|
||||||
if(NOT POLICY CMP0070 AND POLICY CMP0053)
|
|
||||||
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
|
|
||||||
cmake_policy(SET CMP0053 OLD)
|
|
||||||
endif()
|
|
||||||
if(POLICY CMP0071)
|
|
||||||
cmake_policy(SET CMP0071 NEW)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Find includes in corresponding build directories
|
# Find includes in corresponding build directories
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
|
|
@ -20,7 +12,7 @@ set(CMAKE_AUTOMOC ON)
|
||||||
|
|
||||||
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
|
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
|
||||||
|
|
||||||
find_package(Qt6 QUIET COMPONENTS Widgets OpenGLWidgets OpenGL)
|
find_package(Qt6 QUIET COMPONENTS Widgets OpenGL)
|
||||||
|
|
||||||
if(Qt6_FOUND)
|
if(Qt6_FOUND)
|
||||||
add_definitions(-DQT_NO_KEYWORDS)
|
add_definitions(-DQT_NO_KEYWORDS)
|
||||||
|
|
@ -48,24 +40,19 @@ endif()
|
||||||
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
|
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
|
||||||
|
|
||||||
include_directories(BEFORE ./)
|
include_directories(BEFORE ./)
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
# ui files, created with Qt Designer
|
set(CMAKE_AUTORCC ON)
|
||||||
qt6_wrap_ui(uis MainWindow.ui)
|
|
||||||
|
|
||||||
# qrc files (resources files, that contain icons, at least)
|
|
||||||
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./T3_demo.qrc)
|
|
||||||
|
|
||||||
# cpp files
|
# cpp files
|
||||||
add_executable(
|
qt_add_executable(
|
||||||
T3_demo
|
T3_demo
|
||||||
T3_demo.cpp
|
T3_demo.cpp
|
||||||
MainWindow.cpp
|
MainWindow.cpp
|
||||||
Viewer.cpp
|
Viewer.cpp
|
||||||
PreferenceDlg.cpp
|
PreferenceDlg.cpp
|
||||||
Scene.cpp
|
Scene.cpp
|
||||||
${uis}
|
MainWindow.ui
|
||||||
${CGAL_Qt6_RESOURCE_FILES}
|
T3_demo.qrc)
|
||||||
${CGAL_Qt6_MOC_FILES})
|
|
||||||
|
|
||||||
add_to_cached_list(CGAL_EXECUTABLE_TARGETS T3_demo)
|
add_to_cached_list(CGAL_EXECUTABLE_TARGETS T3_demo)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue