mirror of https://github.com/CGAL/cgal
Corrections for CMakeLists.txt and minor changes regarding Qt5 moc requirements
This commit is contained in:
parent
25be730c1c
commit
6e2616a9fa
|
|
@ -1,117 +1,53 @@
|
||||||
# Created by the script cgal_create_CMakeLists
|
# Created by the script cgal_create_cmake_script
|
||||||
# This is the CMake script for compiling a set of CGAL applications.
|
# This is the CMake script for compiling a CGAL application.
|
||||||
|
|
||||||
project( Hyperbolic_triangulation_2 )
|
project (Hyperbolic_triangulation_2_demo)
|
||||||
|
|
||||||
|
# Find includes in corresponding build directories
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.6.2)
|
# Instruct CMake to run moc automatically when needed.
|
||||||
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6)
|
set(CMAKE_AUTOMOC ON)
|
||||||
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3)
|
|
||||||
cmake_policy(VERSION 2.8.4)
|
cmake_minimum_required(VERSION 2.8.11)
|
||||||
else()
|
if(POLICY CMP0043)
|
||||||
cmake_policy(VERSION 2.6)
|
cmake_policy(SET CMP0043 OLD)
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )
|
find_package(CGAL COMPONENTS Qt5)
|
||||||
|
include(${CGAL_USE_FILE})
|
||||||
if ( COMMAND cmake_policy )
|
|
||||||
|
|
||||||
cmake_policy( SET CMP0003 NEW )
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# CGAL and its components
|
|
||||||
find_package( CGAL QUIET COMPONENTS Qt5Core Qt5Giu Qt5Widgets )
|
|
||||||
|
|
||||||
# Find the QtWidgets library
|
|
||||||
find_package(Qt5Core)
|
|
||||||
find_package(Qt5Gui)
|
|
||||||
find_package(Qt5Widgets)
|
|
||||||
|
|
||||||
# Add the include directories for the Qt 5 Widgets module to
|
|
||||||
# the compile lines.
|
|
||||||
include_directories(${Qt5Core_INCLUDE_DIRS})
|
|
||||||
include_directories(${Qt5Gui_INCLUDE_DIRS})
|
|
||||||
include_directories(${Qt5Widgets_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
# Use the compile definitions defined in the Qt 5 Widgets module
|
|
||||||
add_definitions(${Qt5Core_DEFINITIONS})
|
|
||||||
add_definitions(${Qt5Gui_DEFINITIONS})
|
|
||||||
add_definitions(${Qt5Widgets_DEFINITIONS})
|
|
||||||
|
|
||||||
# Add compiler flags for building executables (-fPIE)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Gui_EXECUTABLE_COMPILE_FLAGS}")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
|
|
||||||
|
|
||||||
if ( NOT CGAL_FOUND )
|
|
||||||
|
|
||||||
message(STATUS "This project requires the CGAL library, and will not be compiled.")
|
|
||||||
return()
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# include helper file
|
|
||||||
include( ${CGAL_USE_FILE} )
|
|
||||||
|
|
||||||
|
|
||||||
# Boost and its components
|
|
||||||
find_package( Boost REQUIRED )
|
|
||||||
|
|
||||||
if ( NOT Boost_FOUND )
|
|
||||||
|
|
||||||
message(STATUS "This project requires the Boost library, and will not be compiled.")
|
|
||||||
|
|
||||||
return()
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# include for local directory
|
|
||||||
include_directories( BEFORE include )
|
|
||||||
|
|
||||||
# include for local package
|
|
||||||
include_directories( BEFORE ../../include )
|
|
||||||
|
|
||||||
|
|
||||||
# Creating entries for all .cpp/.C files with "main" routine
|
|
||||||
# ##########################################################
|
|
||||||
|
|
||||||
include( CGAL_CreateSingleSourceCGALProgram )
|
|
||||||
|
|
||||||
|
|
||||||
qt5_generate_moc( Hyperbolic_Delaunay_triangulation_2_demo.cpp Hyperbolic_Delaunay_triangulation_2_demo.moc )
|
|
||||||
create_single_source_cgal_program( "Hyperbolic_Delaunay_triangulation_2_demo.cpp" )
|
|
||||||
target_link_libraries(Hyperbolic_Delaunay_triangulation_2_demo CGAL CGAL_Qt5 Qt5::Core Qt5::Gui Qt5::Widgets)
|
|
||||||
|
|
||||||
################
|
|
||||||
|
|
||||||
|
|
||||||
qt5_generate_moc( Hyperbolic_Dirichlet_region_2_demo.cpp Hyperbolic_Dirichlet_region_2_demo.moc )
|
|
||||||
create_single_source_cgal_program( "Hyperbolic_Dirichlet_region_2_demo.cpp" )
|
|
||||||
target_link_libraries(Hyperbolic_Dirichlet_region_2_demo CGAL CGAL_Qt5 Qt5::Core Qt5::Gui Qt5::Widgets)
|
|
||||||
|
|
||||||
################
|
|
||||||
|
|
||||||
|
|
||||||
qt5_generate_moc( Periodic_2_Delaunay_hyperbolic_triangulation_2_demo.cpp Periodic_2_Delaunay_hyperbolic_triangulation_2_demo.moc )
|
|
||||||
create_single_source_cgal_program( "Periodic_2_Delaunay_hyperbolic_triangulation_2_demo.cpp" )
|
|
||||||
target_link_libraries(Periodic_2_Delaunay_hyperbolic_triangulation_2_demo CGAL CGAL_Qt5 Qt5::Core Qt5::Gui Qt5::Widgets)
|
|
||||||
|
|
||||||
################
|
|
||||||
|
|
||||||
qt5_generate_moc( Hyperbolic_translations_2_demo.cpp Hyperbolic_translations_2_demo.moc )
|
|
||||||
create_single_source_cgal_program( "Hyperbolic_translations_2_demo.cpp" )
|
|
||||||
target_link_libraries(Hyperbolic_translations_2_demo CGAL CGAL_Qt5 Qt5::Core Qt5::Gui Qt5::Widgets)
|
|
||||||
|
|
||||||
|
find_package(Qt5 QUIET COMPONENTS Widgets)
|
||||||
|
|
||||||
|
include_directories (BEFORE ../../include include ui)
|
||||||
|
|
||||||
|
# ui files, created with Qt Designer
|
||||||
|
qt5_wrap_ui( uis Hyperbolic_translations_2.ui )
|
||||||
|
|
||||||
|
# qrc files (resources files, that contain icons, at least)
|
||||||
|
qt5_add_resources ( RESOURCE_FILES resources/Hyperbolic_translations_2.qrc )
|
||||||
|
|
||||||
|
|
||||||
|
# cpp files
|
||||||
|
add_executable ( Hyperbolic_Dirichlet_region_2_demo Hyperbolic_Dirichlet_region_2_demo.cpp )
|
||||||
|
add_executable ( Hyperbolic_Delaunay_triangulation_2_demo Hyperbolic_Delaunay_triangulation_2_demo.cpp )
|
||||||
|
add_executable ( Periodic_2_Delaunay_hyperbolic_triangulation_2_demo Periodic_2_Delaunay_hyperbolic_triangulation_2_demo.cpp )
|
||||||
|
add_executable ( Hyperbolic_translations_2_demo Hyperbolic_translations_2_demo.cpp )
|
||||||
|
|
||||||
|
qt5_use_modules( Hyperbolic_Dirichlet_region_2_demo Widgets)
|
||||||
|
qt5_use_modules( Hyperbolic_Delaunay_triangulation_2_demo Widgets)
|
||||||
|
qt5_use_modules( Periodic_2_Delaunay_hyperbolic_triangulation_2_demo Widgets)
|
||||||
|
qt5_use_modules( Hyperbolic_translations_2_demo Widgets)
|
||||||
|
|
||||||
|
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Hyperbolic_Dirichlet_region_2_demo )
|
||||||
|
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Hyperbolic_Delaunay_triangulation_2_demo )
|
||||||
|
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Periodic_2_Delaunay_hyperbolic_triangulation_2_demo )
|
||||||
|
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Hyperbolic_translations_2_demo )
|
||||||
|
|
||||||
|
target_link_libraries( Hyperbolic_Dirichlet_region_2_demo ${CGAL_LIBRARIES} ${QT_LIBRARIES} ${CGAL_QT_LIBRARIES} )
|
||||||
|
target_link_libraries( Hyperbolic_Delaunay_triangulation_2_demo ${CGAL_LIBRARIES} ${QT_LIBRARIES} ${CGAL_QT_LIBRARIES} )
|
||||||
|
target_link_libraries( Periodic_2_Delaunay_hyperbolic_triangulation_2_demo ${CGAL_LIBRARIES} ${QT_LIBRARIES} ${CGAL_QT_LIBRARIES} )
|
||||||
|
target_link_libraries( Hyperbolic_translations_2_demo ${CGAL_LIBRARIES} ${QT_LIBRARIES} ${CGAL_QT_LIBRARIES} )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@
|
||||||
#include "ui_Delaunay_triangulation_2.h"
|
#include "ui_Delaunay_triangulation_2.h"
|
||||||
#include <CGAL/Qt/DemosMainWindow.h>
|
#include <CGAL/Qt/DemosMainWindow.h>
|
||||||
|
|
||||||
|
|
||||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel InR;
|
typedef CGAL::Exact_predicates_inexact_constructions_kernel InR;
|
||||||
typedef CGAL::Exact_predicates_exact_constructions_kernel R;
|
typedef CGAL::Exact_predicates_exact_constructions_kernel R;
|
||||||
typedef CGAL::Triangulation_hyperbolic_traits_2<R> K;
|
typedef CGAL::Triangulation_hyperbolic_traits_2<R> K;
|
||||||
|
|
@ -809,7 +810,7 @@ MainWindow::on_actionRecenter_triggered()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include "Hyperbolic_Delaunay_triangulation_2_demo.moc"
|
#include "Hyperbolic_Dirichlet_region_2_demo.moc"
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -410,7 +410,7 @@ MainWindow::on_actionRecenter_triggered()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include "Hyperbolic_Delaunay_triangulation_2_demo.moc"
|
#include "Periodic_2_Delaunay_hyperbolic_triangulation_2_demo.moc"
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue