mirror of https://github.com/CGAL/cgal
Merge pull request #1436 from lrineau/CGAL-new_cmake-GF
Renewal of CMake scripts: header-only, ctest, CMake>=3.1 # Conflicts: # Installation/config/testfiles/CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG.cpp
This commit is contained in:
commit
3c6640bf59
|
|
@ -1094,6 +1094,9 @@ cgal_test_with_cmake.log
|
|||
# File created by the Semantic Bovinator (an Emacs package)
|
||||
semantic.cache
|
||||
|
||||
# Python cache files
|
||||
*.pyc
|
||||
|
||||
# Files produced by a Qt compilation/execution
|
||||
.qglviewer.xml
|
||||
*.moc
|
||||
|
|
|
|||
|
|
@ -27,15 +27,12 @@ find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Gui Svg)
|
|||
|
||||
include( ${CGAL_USE_FILE} )
|
||||
|
||||
# Find OpenGL
|
||||
find_package(OpenGL)
|
||||
|
||||
# Find QGLViewer
|
||||
if(Qt5_FOUND)
|
||||
find_package(QGLViewer)
|
||||
endif(Qt5_FOUND)
|
||||
|
||||
if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND)
|
||||
if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
|
||||
|
||||
include_directories ( ${QGLVIEWER_INCLUDE_DIR} )
|
||||
|
||||
|
|
@ -59,20 +56,19 @@ 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 )
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
cgal_add_compilation_test(AABB_demo)
|
||||
|
||||
else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND)
|
||||
else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
|
||||
|
||||
set(AABB_MISSING_DEPS "")
|
||||
|
||||
|
|
@ -88,14 +84,10 @@ else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER
|
|||
set(AABB_MISSING_DEPS "Qt5, ${AABB_MISSING_DEPS}")
|
||||
endif()
|
||||
|
||||
if(NOT OPENGL_FOUND)
|
||||
set(AABB_MISSING_DEPS "OpenGL, ${AABB_MISSING_DEPS}")
|
||||
endif()
|
||||
|
||||
if(NOT QGLVIEWER_FOUND)
|
||||
set(AABB_MISSING_DEPS "QGLViewer, ${AABB_MISSING_DEPS}")
|
||||
endif()
|
||||
|
||||
message(STATUS "NOTICE: This demo requires ${AABB_MISSING_DEPS}and will not be compiled.")
|
||||
|
||||
endif (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND)
|
||||
endif (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
|
||||
|
|
|
|||
|
|
@ -595,6 +595,7 @@ void Scene::draw(QGLViewer* viewer)
|
|||
initGL();
|
||||
if(!are_buffers_initialized)
|
||||
initialize_buffers();
|
||||
gl->glEnable(GL_DEPTH_TEST);
|
||||
QColor color;
|
||||
QMatrix4x4 fMatrix;
|
||||
fMatrix.setToIdentity();
|
||||
|
|
@ -663,7 +664,7 @@ void Scene::draw(QGLViewer* viewer)
|
|||
|
||||
//cutting_segments
|
||||
fMatrix.setToIdentity();
|
||||
::glLineWidth(2.0f);
|
||||
gl->glLineWidth(2.0f);
|
||||
vao[3].bind();
|
||||
attrib_buffers(viewer);
|
||||
rendering_program.bind();
|
||||
|
|
@ -671,7 +672,7 @@ void Scene::draw(QGLViewer* viewer)
|
|||
rendering_program.setUniformValue(colorLocation, color);
|
||||
rendering_program.setUniformValue(fLocation, fMatrix);
|
||||
gl->glDrawArrays(GL_LINES, 0, static_cast<GLsizei>(pos_cut_segments.size()/3));
|
||||
::glLineWidth(1.0f);
|
||||
gl->glLineWidth(1.0f);
|
||||
rendering_program.release();
|
||||
vao[3].release();
|
||||
//grid
|
||||
|
|
@ -690,8 +691,8 @@ void Scene::draw(QGLViewer* viewer)
|
|||
//cutting_plane
|
||||
// for(int i=0; i< 16 ; i++)
|
||||
// fMatrix.data()[i] = m_frame->matrix()[i];
|
||||
::glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
|
||||
::glEnable(GL_BLEND);
|
||||
gl->glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
|
||||
gl->glEnable(GL_BLEND);
|
||||
vao[4].bind();
|
||||
attrib_buffers(viewer);
|
||||
rendering_program.bind();
|
||||
|
|
@ -699,7 +700,7 @@ void Scene::draw(QGLViewer* viewer)
|
|||
rendering_program.setUniformValue(colorLocation, color);
|
||||
rendering_program.setUniformValue(fLocation, fMatrix);
|
||||
gl->glDrawArrays(GL_TRIANGLES, 0, static_cast<GLsizei>(pos_plane.size()/3));
|
||||
::glDisable(GL_BLEND);
|
||||
gl->glDisable(GL_BLEND);
|
||||
rendering_program.release();
|
||||
vao[4].release();
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ void Viewer::setScene(Scene* pScene)
|
|||
|
||||
void Viewer::draw()
|
||||
{
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
QGLViewer::draw();
|
||||
if(m_pScene != NULL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,22 +1,21 @@
|
|||
# Created by the script cgal_create_cmake_script
|
||||
# This is the CMake script for compiling a CGAL application.
|
||||
|
||||
|
||||
project( Algebraic_kernel_d_Examples )
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
|
||||
find_package(CGAL QUIET COMPONENTS Core MPFI)
|
||||
find_package(CGAL QUIET COMPONENTS Core)
|
||||
|
||||
if ( CGAL_FOUND )
|
||||
|
||||
include( ${CGAL_USE_FILE} )
|
||||
find_package(MPFI QUIET)
|
||||
endif()
|
||||
|
||||
if( CGAL_FOUND AND MPFI_FOUND)
|
||||
|
||||
include( ${MPFI_USE_FILE} )
|
||||
include( CGAL_CreateSingleSourceCGALProgram )
|
||||
include( CGAL_VersionUtils )
|
||||
|
||||
include_directories (BEFORE ../../include)
|
||||
|
||||
create_single_source_cgal_program( "Compare_1.cpp" )
|
||||
create_single_source_cgal_program( "Construct_algebraic_real_1.cpp" )
|
||||
create_single_source_cgal_program( "Isolate_1.cpp" )
|
||||
|
|
@ -25,7 +24,6 @@ if ( CGAL_FOUND )
|
|||
|
||||
else()
|
||||
|
||||
message(STATUS "This program requires the CGAL library, and will not be compiled.")
|
||||
message(STATUS "This program requires the CGAL library and MPFI, and will not be compiled.")
|
||||
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
# Created by the script cgal_create_CMakeLists
|
||||
# This is the CMake script for compiling a set of CGAL applications.
|
||||
|
||||
project( Algebraic_kernel_d_Tests )
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
|
||||
# CGAL and its components
|
||||
find_package( CGAL QUIET COMPONENTS Core RS3)
|
||||
find_package( CGAL QUIET COMPONENTS Core)
|
||||
|
||||
if ( NOT CGAL_FOUND )
|
||||
|
||||
|
|
@ -19,6 +16,15 @@ endif()
|
|||
# include helper file
|
||||
include( ${CGAL_USE_FILE} )
|
||||
|
||||
find_package(RS3 QUIET)
|
||||
|
||||
if(MPFI_FOUND)
|
||||
include( ${MPFI_USE_FILE} )
|
||||
endif()
|
||||
if(RS3_FOUND)
|
||||
include( ${RS3_USE_FILE} )
|
||||
endif()
|
||||
|
||||
include( CGAL_CreateSingleSourceCGALProgram )
|
||||
|
||||
# Boost and its components
|
||||
|
|
|
|||
|
|
@ -21,10 +21,9 @@ include(${CGAL_USE_FILE})
|
|||
|
||||
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)
|
||||
|
||||
find_package(OpenGL)
|
||||
find_package(QGLViewer)
|
||||
|
||||
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND )
|
||||
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND )
|
||||
|
||||
add_definitions(-DQT_NO_KEYWORDS)
|
||||
|
||||
|
|
@ -40,15 +39,18 @@ 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_shape_3)
|
||||
|
||||
else()
|
||||
|
||||
message(STATUS "NOTICE: This demo requires CGAL, the QGLViewer, OpenGL and Qt5, and will not be compiled.")
|
||||
message(STATUS "NOTICE: This demo requires CGAL, the QGLViewer, and Qt5, and will not be compiled.")
|
||||
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ Viewer::draw()
|
|||
rendering_program_points.bind();
|
||||
color.setRgbF(1.0f, 0.0f, 0.0f);
|
||||
glPointSize(5);
|
||||
::glEnable(GL_POINT_SMOOTH);
|
||||
glEnable(GL_POINT_SMOOTH);
|
||||
rendering_program_points.setUniformValue(colorLocation_points, color);
|
||||
glDrawArrays(GL_POINTS, 0, static_cast<GLsizei>(pos_points.size()/3));
|
||||
rendering_program_points.release();
|
||||
|
|
|
|||
|
|
@ -8,12 +8,14 @@ cmake_minimum_required(VERSION 2.8.11)
|
|||
|
||||
|
||||
|
||||
find_package(CGAL QUIET COMPONENTS Core GMP MPFR)
|
||||
find_package(CGAL QUIET COMPONENTS Core)
|
||||
|
||||
if ( CGAL_FOUND)
|
||||
include( ${CGAL_USE_FILE} )
|
||||
endif()
|
||||
|
||||
find_package(GMP QUIET)
|
||||
|
||||
if ( CGAL_FOUND AND GMP_FOUND )
|
||||
|
||||
include( CGAL_VersionUtils )
|
||||
|
|
@ -30,6 +32,8 @@ if ( CGAL_FOUND AND GMP_FOUND )
|
|||
find_package( MPFI )
|
||||
|
||||
if( MPFI_FOUND )
|
||||
include( ${MPFI_USE_FILE} )
|
||||
|
||||
# for the testsuite, the version of MPFI shipped with RS is used; this
|
||||
# version needs GMP>=4.2, so we require this dependency only here and
|
||||
# not in FindMPFI.cmake
|
||||
|
|
|
|||
|
|
@ -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,15 +68,15 @@ 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 )
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
cgal_add_compilation_test(arrangement_2)
|
||||
else()
|
||||
|
||||
message(STATUS "NOTICE: This demo requires CGAL, CGAL-Core and Qt5, and will not be compiled.")
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ include_directories( BEFORE ../../include )
|
|||
include( CGAL_CreateSingleSourceCGALProgram )
|
||||
|
||||
if(OpenMesh_FOUND)
|
||||
create_single_source_cgal_program( "TriMesh.cpp" )
|
||||
target_link_libraries( TriMesh ${OPENMESH_LIBRARIES} )
|
||||
create_single_source_cgal_program( "TriMesh.cpp" )
|
||||
target_link_libraries( TriMesh PRIVATE ${OPENMESH_LIBRARIES} )
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -69,6 +69,6 @@ create_single_source_cgal_program( "copy_polyhedron.cpp" )
|
|||
|
||||
|
||||
if(OpenMesh_FOUND)
|
||||
target_link_libraries( copy_polyhedron ${OPENMESH_LIBRARIES} )
|
||||
target_link_libraries( copy_polyhedron PRIVATE ${OPENMESH_LIBRARIES} )
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ include( CGAL_CreateSingleSourceCGALProgram )
|
|||
|
||||
if(OpenMesh_FOUND)
|
||||
create_single_source_cgal_program( "graph_concept_OpenMesh.cpp" )
|
||||
target_link_libraries( graph_concept_OpenMesh ${OPENMESH_LIBRARIES} )
|
||||
target_link_libraries( graph_concept_OpenMesh PRIVATE ${OPENMESH_LIBRARIES} )
|
||||
endif()
|
||||
|
||||
create_single_source_cgal_program( "next.cpp" )
|
||||
|
|
@ -101,10 +101,10 @@ create_single_source_cgal_program( "test_graph_traits.cpp" )
|
|||
create_single_source_cgal_program( "test_Properties.cpp" )
|
||||
|
||||
if(OpenMesh_FOUND)
|
||||
target_link_libraries( test_clear ${OPENMESH_LIBRARIES})
|
||||
target_link_libraries( test_Euler_operations ${OPENMESH_LIBRARIES})
|
||||
target_link_libraries( test_Face_filtered_graph ${OPENMESH_LIBRARIES})
|
||||
target_link_libraries( test_graph_traits ${OPENMESH_LIBRARIES} )
|
||||
target_link_libraries( test_Properties ${OPENMESH_LIBRARIES})
|
||||
target_link_libraries( test_clear PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_link_libraries( test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_link_libraries( test_Face_filtered_graph PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_link_libraries( test_graph_traits PRIVATE ${OPENMESH_LIBRARIES} )
|
||||
target_link_libraries( test_Properties PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_link_libraries( test_bgl_read_write PRIVATE ${OPENMESH_LIBRARIES})
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
#
|
||||
# This file points to the CGALConfig.cmake for a pure header-only
|
||||
# CGAL installation.
|
||||
#
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/Installation/lib/cmake/CGAL/CGALConfig.cmake)
|
||||
|
|
@ -160,12 +160,12 @@ struct NodeInfo {
|
|||
// Members: private: int refCount,
|
||||
// public: NodeInfo* nodeInfo,
|
||||
// filteredFp ffVal.
|
||||
class ExprRep {
|
||||
class CGAL_CORE_EXPORT ExprRep {
|
||||
public:
|
||||
/// \name Constructor and Destructor
|
||||
//@{
|
||||
/// default constructor
|
||||
CGAL_CORE_EXPORT ExprRep();
|
||||
ExprRep();
|
||||
/// virtual destructor for this base class
|
||||
virtual ~ExprRep() {
|
||||
if (nodeInfo != NULL) // This check is only for optimization.
|
||||
|
|
@ -197,8 +197,8 @@ public:
|
|||
/// \name Helper Functions
|
||||
//@{
|
||||
/// Get the approximate value
|
||||
CGAL_CORE_EXPORT const Real & getAppValue(const extLong& relPrec = get_static_defRelPrec(),
|
||||
const extLong& absPrec = get_static_defAbsPrec());
|
||||
const Real & getAppValue(const extLong& relPrec = get_static_defRelPrec(),
|
||||
const extLong& absPrec = get_static_defAbsPrec());
|
||||
/// Get the sign.
|
||||
int getSign();
|
||||
int getExactSign();
|
||||
|
|
@ -433,23 +433,23 @@ public:
|
|||
/// compute the sign, uMSB, lMSB, etc.
|
||||
virtual void computeExactFlags() = 0;
|
||||
/// compute the minimal root bound
|
||||
CGAL_CORE_EXPORT extLong computeBound();
|
||||
extLong computeBound();
|
||||
/// driver function to approximate
|
||||
CGAL_CORE_EXPORT void approx(const extLong& relPrec, const extLong& absPrec);
|
||||
void approx(const extLong& relPrec, const extLong& absPrec);
|
||||
/// compute an approximate value satifying the specified precisions
|
||||
virtual void computeApproxValue(const extLong&, const extLong&) = 0;
|
||||
/// Test whether the current approx. value satisfies [relPrec, absPrec]
|
||||
CGAL_CORE_EXPORT bool withinKnownPrecision(const extLong&, const extLong&);
|
||||
bool withinKnownPrecision(const extLong&, const extLong&);
|
||||
//@}
|
||||
|
||||
/// \name Misc Functions
|
||||
//@{
|
||||
/// reduce current node
|
||||
CGAL_CORE_EXPORT void reduceToBigRat(const BigRat&);
|
||||
void reduceToBigRat(const BigRat&);
|
||||
/// reduce current node
|
||||
CGAL_CORE_EXPORT void reduceTo(const ExprRep*);
|
||||
void reduceTo(const ExprRep*);
|
||||
/// reduce current node to zero
|
||||
CGAL_CORE_EXPORT void reduceToZero();
|
||||
void reduceToZero();
|
||||
/// return operator string
|
||||
virtual const std::string op() const {
|
||||
return "UNKNOWN";
|
||||
|
|
@ -459,7 +459,7 @@ public:
|
|||
/// \name Degree Bound Functions
|
||||
//@{
|
||||
/// compute "d_e" based on # of sqrts
|
||||
CGAL_CORE_EXPORT extLong degreeBound();
|
||||
extLong degreeBound();
|
||||
/// count actually computes the degree bound of current node.
|
||||
virtual extLong count() = 0;
|
||||
/// reset the flag "visited"
|
||||
|
|
@ -473,7 +473,7 @@ public:
|
|||
|
||||
/// \class ConstRep
|
||||
/// \brief constant node
|
||||
class ConstRep : public ExprRep {
|
||||
class CGAL_CORE_EXPORT ConstRep : public ExprRep {
|
||||
public:
|
||||
/// \name Constructors and Destructor
|
||||
//@{
|
||||
|
|
@ -486,20 +486,20 @@ public:
|
|||
/// \name Debug Functions
|
||||
//@{
|
||||
/// print debug information in list mode
|
||||
CGAL_CORE_EXPORT void debugList(int level, int depthLimit) const;
|
||||
void debugList(int level, int depthLimit) const;
|
||||
/// print debug information in tree mode
|
||||
CGAL_CORE_EXPORT void debugTree(int level, int indent, int depthLimit) const;
|
||||
void debugTree(int level, int indent, int depthLimit) const;
|
||||
//@}
|
||||
protected:
|
||||
/// initialize nodeInfo
|
||||
CGAL_CORE_EXPORT virtual void initNodeInfo();
|
||||
virtual void initNodeInfo();
|
||||
/// return operator in string
|
||||
const std::string op() const {
|
||||
return "C";
|
||||
}
|
||||
/// count returns the degree of current node
|
||||
//extLong count() { return d_e(); }
|
||||
CGAL_CORE_EXPORT extLong count();
|
||||
extLong count();
|
||||
/// clear visited flag
|
||||
void clearFlag() {
|
||||
visited() = false;
|
||||
|
|
|
|||
|
|
@ -1,33 +1,18 @@
|
|||
include(CGAL_SetupCGAL_CoreDependencies)
|
||||
|
||||
message("Configuring libCGAL_Core")
|
||||
if(CGAL_Core_FOUND)
|
||||
|
||||
use_essential_libs()
|
||||
collect_cgal_library(CGAL_Core "")
|
||||
|
||||
if (NOT MSVC)
|
||||
# See the release notes of CGAL-4.10: CGAL_Core now requires
|
||||
# Boost.Thread, with all compilers but MSVC.
|
||||
find_package( Boost 1.48 REQUIRED thread system )
|
||||
cache_set(CGAL_Core_3RD_PARTY_LIBRARIES ${CGAL_Core_3RD_PARTY_LIBRARIES} ${Boost_LIBRARIES} )
|
||||
endif(NOT MSVC)
|
||||
if(CGAL_HEADER_ONLY)
|
||||
set(keyword INTERFACE)
|
||||
else()
|
||||
set(keyword PUBLIC)
|
||||
endif()
|
||||
|
||||
include_directories (SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS})
|
||||
CGAL_setup_CGAL_Core_dependencies(CGAL_Core ${keyword})
|
||||
|
||||
add_definitions(${CGAL_3RD_PARTY_DEFINITIONS})
|
||||
|
||||
link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} )
|
||||
|
||||
collect_cgal_library(CGAL_Core "")
|
||||
|
||||
if(NOT CGAL_HEADER_ONLY)
|
||||
# CGAL_Core does not depend on CGAL in either DEBUG or RELEASE, but we
|
||||
# still link it.
|
||||
target_link_libraries( CGAL_Core CGAL ${CGAL_3RD_PARTY_LIBRARIES} )
|
||||
target_link_libraries( CGAL_Core ${CGAL_Core_3RD_PARTY_LIBRARIES} )
|
||||
|
||||
add_dependencies( CGAL_Core CGAL )
|
||||
else()
|
||||
target_link_libraries( CGAL_Core INTERFACE ${CGAL_3RD_PARTY_LIBRARIES} )
|
||||
target_link_libraries( CGAL_Core INTERFACE ${CGAL_Core_3RD_PARTY_LIBRARIES} )
|
||||
message("libCGAL_Core is configured")
|
||||
endif()
|
||||
|
||||
message("libCGAL_Core is configured")
|
||||
|
||||
|
|
|
|||
|
|
@ -1,52 +1,22 @@
|
|||
message("Configuring libCGAL_ImageIO")
|
||||
|
||||
find_package( ZLIB )
|
||||
|
||||
if(ZLIB_FOUND)
|
||||
get_dependency_version(ZLIB)
|
||||
cache_set(CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS ${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} )
|
||||
cache_set(CGAL_ImageIO_3RD_PARTY_LIBRARIES ${CGAL_ImageIO_3RD_PARTY_LIBRARIES} ${ZLIB_LIBRARY} )
|
||||
cache_set(CGAL_ImageIO_3RD_PARTY_DEFINITIONS "-DCGAL_USE_ZLIB")
|
||||
cache_set(CGAL_ImageIO_USE_ZLIB "ON")
|
||||
endif(ZLIB_FOUND)
|
||||
|
||||
set( CGAL_ImageIO_BASENAME CGAL_ImageIO)
|
||||
|
||||
if(COMMAND add_config_flag)
|
||||
set( CGAL_HAS_IMAGEIO TRUE )
|
||||
add_config_flag( CGAL_HAS_IMAGEIO )
|
||||
endif()
|
||||
|
||||
use_essential_libs()
|
||||
|
||||
if (CGAL_HEADER_ONLY)
|
||||
cache_set(CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS ${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
else()
|
||||
include_directories( SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS} )
|
||||
link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} )
|
||||
add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_ImageIO_3RD_PARTY_DEFINITIONS} )
|
||||
endif()
|
||||
|
||||
collect_cgal_library( CGAL_ImageIO "")
|
||||
|
||||
if (NOT CGAL_HEADER_ONLY)
|
||||
include(CGAL_SetupCGAL_ImageIODependencies)
|
||||
|
||||
add_dependencies( CGAL_ImageIO CGAL )
|
||||
if(CGAL_HEADER_ONLY)
|
||||
set(keyword "INTERFACE")
|
||||
endif()
|
||||
|
||||
# CGAL_ImageIO only depends on CGAL in DEBUG, but we still link it
|
||||
# in both build types.
|
||||
target_link_libraries( CGAL_ImageIO CGAL ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_ImageIO_3RD_PARTY_LIBRARIES} )
|
||||
CGAL_setup_CGAL_ImageIO_dependencies(CGAL_ImageIO ${keyword})
|
||||
|
||||
else()
|
||||
|
||||
target_link_libraries( CGAL_ImageIO INTERFACE ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_ImageIO_3RD_PARTY_LIBRARIES} )
|
||||
target_include_directories( CGAL_ImageIO INTERFACE ${CGAL_3RD_PARTY_LIBRARIES_DIRS})
|
||||
if(COMMAND add_config_flag)
|
||||
set( CGAL_HAS_IMAGEIO TRUE )
|
||||
add_config_flag( CGAL_HAS_IMAGEIO )
|
||||
endif()
|
||||
|
||||
if(ZLIB_FOUND)
|
||||
get_dependency_version(ZLIB)
|
||||
endif()
|
||||
|
||||
message("libCGAL_ImageIO is configured")
|
||||
|
||||
if(NOT ZLIB_FOUND)
|
||||
message( STATUS "NOTICE: libCGAL_ImageIO needs ZLib to read compressed files. That feature will not be activated.")
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -125,22 +125,28 @@ if ( CGAL_FOUND )
|
|||
message(STATUS "Set Ipelets install dir: ${IPELET_INSTALL_DIR}")
|
||||
endif()
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
|
||||
foreach(IPELET ${CGAL_IPELETS})
|
||||
add_library(CGAL_${IPELET} MODULE ${IPELET}.cpp)
|
||||
add_to_cached_list(CGAL_EXECUTABLE_TARGETS CGAL_${IPELET})
|
||||
target_link_libraries(CGAL_${IPELET} ${IPE_LIBRARIES})
|
||||
target_link_libraries(CGAL_${IPELET} PRIVATE CGAL::CGAL ${IPE_LIBRARIES})
|
||||
if ( IPELET_INSTALL_DIR )
|
||||
install(TARGETS CGAL_${IPELET} DESTINATION ${IPELET_INSTALL_DIR})
|
||||
if (WITH_IPE_7)
|
||||
install(FILES ./lua/libCGAL_${IPELET}.lua DESTINATION ${IPELET_INSTALL_DIR}) #only for ipe 7
|
||||
endif()
|
||||
endif ()
|
||||
cgal_add_compilation_test(CGAL_${IPELET})
|
||||
endforeach(IPELET)
|
||||
target_link_libraries(CGAL_cone_spanners PRIVATE CGAL::CGAL_Core)
|
||||
#example in doc not installed
|
||||
add_library(simple_triangulation MODULE simple_triangulation.cpp)
|
||||
add_to_cached_list(CGAL_EXECUTABLE_TARGETS simple_triangulation)
|
||||
target_link_libraries(simple_triangulation ${IPE_LIBRARIES})
|
||||
|
||||
cgal_add_compilation_test(simple_triangulation)
|
||||
|
||||
else()
|
||||
message(STATUS "NOTICE: This program requires the Ipe include files and library, and will not be compiled.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 2.8.11)
|
|||
set( CGAL_BRANCH_BUILD ON CACHE INTERNAL "Create CGAL from a Git branch" FORCE)
|
||||
|
||||
include(${CMAKE_SOURCE_DIR}/Installation/cmake/modules/CGAL_SCM.cmake)
|
||||
CGAL_detect_git(${CMAKE_SOURCE_DIR})
|
||||
|
||||
# add option for duplicate file detection
|
||||
option( CGAL_REPORT_DUPLICATE_FILES "Switch on to start (naive) detection of duplicate source- and headerfiles in packages" OFF)
|
||||
|
|
|
|||
|
|
@ -11,10 +11,9 @@ include(${CGAL_USE_FILE})
|
|||
|
||||
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL)
|
||||
|
||||
find_package(OpenGL)
|
||||
find_package(QGLViewer)
|
||||
|
||||
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND )
|
||||
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND )
|
||||
|
||||
|
||||
include_directories (${QGLVIEWER_INCLUDE_DIR})
|
||||
|
|
@ -22,16 +21,20 @@ 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)
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
cgal_add_compilation_test(Circular_kernel_3)
|
||||
|
||||
else()
|
||||
|
||||
message(STATUS "NOTICE: This demo requires CGAL, the QGLViewer, OpenGL and Qt5, and will not be compiled.")
|
||||
message(STATUS "NOTICE: This demo requires CGAL, the QGLViewer, and Qt5, and will not be compiled.")
|
||||
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -860,10 +860,10 @@ void Viewer::init()
|
|||
compile_shaders();
|
||||
compute_elements();
|
||||
initialize_buffers();
|
||||
::glEnable(GL_BLEND);
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
::glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
|
||||
::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glEnable(GL_POINT_SMOOTH);
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,11 +32,6 @@ if ( NOT Boost_FOUND )
|
|||
endif()
|
||||
|
||||
find_package( TBB )
|
||||
if( TBB_FOUND )
|
||||
include(${TBB_USE_FILE})
|
||||
list(APPEND CGAL_3RD_PARTY_LIBRARIES ${TBB_LIBRARIES})
|
||||
endif()
|
||||
|
||||
|
||||
find_package(OpenCV QUIET)
|
||||
|
||||
|
|
@ -54,13 +49,16 @@ include( CGAL_CreateSingleSourceCGALProgram )
|
|||
|
||||
set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates)
|
||||
create_single_source_cgal_program( "example_classification.cpp" CXX_FEATURES ${needed_cxx_features} )
|
||||
if(TBB_FOUND)
|
||||
CGAL_target_use_TBB(example_classification)
|
||||
endif()
|
||||
create_single_source_cgal_program( "example_generation_and_training.cpp" CXX_FEATURES ${needed_cxx_features} )
|
||||
create_single_source_cgal_program( "example_feature.cpp" CXX_FEATURES ${needed_cxx_features} )
|
||||
|
||||
if( OpenCV_FOUND )
|
||||
include_directories( ${OpenCV_INCLUDE_DIRS} )
|
||||
create_single_source_cgal_program( "example_random_forest.cpp" CXX_FEATURES ${needed_cxx_features} )
|
||||
target_link_libraries( example_random_forest ${OpenCV_LIBS} )
|
||||
target_link_libraries( example_random_forest PRIVATE ${OpenCV_LIBS} )
|
||||
else()
|
||||
message(STATUS "OpenCV not found, random forest example won't be compiled.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -38,10 +38,6 @@ if ( NOT Boost_FOUND )
|
|||
endif()
|
||||
|
||||
find_package( TBB )
|
||||
if( TBB_FOUND )
|
||||
include(${TBB_USE_FILE})
|
||||
list(APPEND CGAL_3RD_PARTY_LIBRARIES ${TBB_LIBRARIES})
|
||||
endif()
|
||||
|
||||
# include for local directory
|
||||
include_directories( BEFORE include )
|
||||
|
|
@ -60,3 +56,6 @@ include( CGAL_CreateSingleSourceCGALProgram )
|
|||
set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates)
|
||||
create_single_source_cgal_program( "test_classification_point_set.cpp" CXX_FEATURES ${needed_cxx_features} )
|
||||
|
||||
if(TBB_FOUND)
|
||||
CGAL_target_use_TBB( test_classification_point_set )
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -69,6 +69,6 @@ if(OpenMesh_FOUND)
|
|||
create_single_source_cgal_program( "quickhull_OM_3.cpp" )
|
||||
create_single_source_cgal_program( "dynamic_hull_OM_3.cpp" )
|
||||
|
||||
target_link_libraries( quickhull_OM_3 ${OPENMESH_LIBRARIES} )
|
||||
target_link_libraries( dynamic_hull_OM_3 ${OPENMESH_LIBRARIES} )
|
||||
target_link_libraries( quickhull_OM_3 PRIVATE ${OPENMESH_LIBRARIES} )
|
||||
target_link_libraries( dynamic_hull_OM_3 PRIVATE ${OPENMESH_LIBRARIES} )
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ variable `BUILD_SHARED_LIBS` to `FALSE`. If you use
|
|||
|
||||
\subsection subsection_headeronly Header-only option
|
||||
|
||||
Since \cgal 4.9, \cgal can be used in headers only mode, i.e. without compiling the \cgal libraries and linking with these libraries when compiling examples, tests and demos. This possibility can be enabled by setting the value of the CMake variable `CGAL_HEADER_ONLY` to `ON`. CMake version 3.0.0 or higher is required to use this option.
|
||||
Since \cgal 4.11, \cgal can be used in header-only mode, i.e. without configuring nor building any \cgal library. In this case, the program using \cgal (example, test, demo, etc.) must be directly configured using CMake. The variable `CGAL_DIR` must point to the root directory of the CGAL source code.
|
||||
|
||||
One advantage of using \cgal in header-only mode is that you do not need to compile and install \cgal libraries before compiling a given example or demo. Note that even in header-only mode we still need to run CMake on \cgal in order to generate different configuration files. So, setting up \cgal becomes now:
|
||||
|
||||
|
|
|
|||
|
|
@ -35,14 +35,16 @@ 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)
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
cgal_add_compilation_test(Alpha_shapes_2)
|
||||
|
||||
else()
|
||||
|
||||
|
|
|
|||
|
|
@ -33,14 +33,17 @@ 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)
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
cgal_add_compilation_test(Apollonius_graph_2)
|
||||
|
||||
else()
|
||||
|
||||
|
|
|
|||
|
|
@ -38,14 +38,16 @@ 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)
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
cgal_add_compilation_test(Bounding_volumes)
|
||||
|
||||
else()
|
||||
|
||||
|
|
|
|||
|
|
@ -38,14 +38,16 @@ 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)
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
cgal_add_compilation_test(Circular_kernel_2)
|
||||
|
||||
else()
|
||||
|
||||
|
|
|
|||
|
|
@ -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,15 +32,13 @@ 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)
|
||||
else()
|
||||
|
||||
message(STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled.")
|
||||
|
|
|
|||
|
|
@ -20,15 +20,13 @@ 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)
|
||||
else()
|
||||
|
||||
message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
|
||||
|
|
|
|||
|
|
@ -37,14 +37,16 @@ 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)
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
cgal_add_compilation_test(L1_voronoi_diagram_2)
|
||||
|
||||
else()
|
||||
|
||||
|
|
|
|||
|
|
@ -36,15 +36,13 @@ 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)
|
||||
else()
|
||||
|
||||
message(STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled.")
|
||||
|
|
|
|||
|
|
@ -53,14 +53,13 @@ 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)
|
||||
else()
|
||||
|
||||
message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
|
||||
|
|
|
|||
|
|
@ -43,16 +43,13 @@ 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 )
|
||||
|
||||
target_link_libraries( Polygon_2 PRIVATE
|
||||
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui )
|
||||
|
||||
# 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} )
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
cgal_add_compilation_test(Polygon_2)
|
||||
else()
|
||||
|
||||
message(STATUS "NOTICE: This demo requires CGAL, CGAL_Core, and Qt5, and will not be compiled.")
|
||||
|
|
|
|||
|
|
@ -43,15 +43,13 @@ 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)
|
||||
|
||||
else()
|
||||
|
||||
|
|
|
|||
|
|
@ -43,16 +43,13 @@ 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)
|
||||
else()
|
||||
|
||||
message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
|
||||
|
|
|
|||
|
|
@ -35,14 +35,16 @@ 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)
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
cgal_add_compilation_test(Snap_rounding_2)
|
||||
|
||||
else()
|
||||
|
||||
|
|
|
|||
|
|
@ -37,15 +37,14 @@ 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)
|
||||
else()
|
||||
|
||||
message(STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled.")
|
||||
|
|
|
|||
|
|
@ -36,14 +36,16 @@ 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)
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
cgal_add_compilation_test(Stream_lines_2)
|
||||
|
||||
else()
|
||||
|
||||
|
|
|
|||
|
|
@ -9,99 +9,68 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
|
|||
cmake_policy(SET CMP0053 OLD)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0071)
|
||||
cmake_policy(SET CMP0071 NEW)
|
||||
endif()
|
||||
|
||||
set(CMAKE_AUTOMOC TRUE)
|
||||
set(CMAKE_AUTOUIC TRUE)
|
||||
set(CMAKE_AUTORCC TRUE)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
|
||||
|
||||
find_package(CGAL COMPONENTS Qt5)
|
||||
find_package(Qt5 QUIET COMPONENTS Widgets)
|
||||
|
||||
include(${CGAL_USE_FILE})
|
||||
|
||||
|
||||
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)
|
||||
|
||||
include_directories (BEFORE ../../include)
|
||||
include_directories (BEFORE ./include)
|
||||
include_directories (BEFORE ../../../Number_types/include)
|
||||
|
||||
include_directories (BEFORE ../../../Triangulation_2/include)
|
||||
|
||||
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )
|
||||
if ( NOT CGAL_FOUND OR NOT CGAL_Qt5_FOUND OR NOT Qt5_FOUND )
|
||||
message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_definitions(-DQT_NO_KEYWORDS)
|
||||
|
||||
|
||||
|
||||
#--------------------------------
|
||||
# The "constrained Delaunay" demo: Constrained_Delaunay_triangulation_2
|
||||
#--------------------------------
|
||||
# UI files (Qt Designer files)
|
||||
qt5_wrap_ui( CDT_UI_FILES Constrained_Delaunay_triangulation_2.ui )
|
||||
|
||||
# qrc files (resources files, that contain icons, at least)
|
||||
qt5_add_resources ( CDT_RESOURCE_FILES ./Constrained_Delaunay_triangulation_2.qrc )
|
||||
|
||||
# use the Qt MOC preprocessor on classes that derives from QObject
|
||||
qt5_generate_moc( "Constrained_Delaunay_triangulation_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Constrained_Delaunay_triangulation_2.moc" )
|
||||
|
||||
# The executable itself.
|
||||
add_executable ( Constrained_Delaunay_triangulation_2 Constrained_Delaunay_triangulation_2.cpp Constrained_Delaunay_triangulation_2.moc ${CDT_UI_FILES} ${CDT_RESOURCE_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
|
||||
add_executable( Constrained_Delaunay_triangulation_2
|
||||
Constrained_Delaunay_triangulation_2.cpp)
|
||||
target_link_libraries( Constrained_Delaunay_triangulation_2
|
||||
PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Widgets)
|
||||
target_include_directories( Constrained_Delaunay_triangulation_2
|
||||
PRIVATE ./include)
|
||||
|
||||
qt5_use_modules(Constrained_Delaunay_triangulation_2 Xml Script OpenGL Svg)
|
||||
|
||||
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Constrained_Delaunay_triangulation_2 )
|
||||
|
||||
# Link with Qt libraries
|
||||
target_link_libraries( Constrained_Delaunay_triangulation_2 ${QT_LIBRARIES} )
|
||||
# Link with CGAL
|
||||
target_link_libraries( Constrained_Delaunay_triangulation_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
|
||||
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Constrained_Delaunay_triangulation_2)
|
||||
|
||||
#--------------------------------
|
||||
# The "Delaunay" demo: Delaunay_triangulation_2
|
||||
#--------------------------------
|
||||
# UI files (Qt Designer files)
|
||||
qt5_wrap_ui( DT_UI_FILES Delaunay_triangulation_2.ui )
|
||||
|
||||
# qrc files (resources files, that contain icons, at least)
|
||||
qt5_add_resources ( DT_RESOURCE_FILES ./Delaunay_triangulation_2.qrc )
|
||||
|
||||
# use the Qt MOC preprocessor on classes that derives from QObject
|
||||
qt5_generate_moc( "Delaunay_triangulation_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Delaunay_triangulation_2.moc" )
|
||||
|
||||
# The executable itself.
|
||||
add_executable ( Delaunay_triangulation_2 Delaunay_triangulation_2.cpp Delaunay_triangulation_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
|
||||
|
||||
qt5_use_modules(Delaunay_triangulation_2 Xml Script OpenGL Svg)
|
||||
add_executable ( Delaunay_triangulation_2
|
||||
Delaunay_triangulation_2.cpp)
|
||||
target_link_libraries( Delaunay_triangulation_2
|
||||
PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Widgets)
|
||||
|
||||
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Delaunay_triangulation_2 )
|
||||
|
||||
# Link with Qt libraries
|
||||
target_link_libraries( Delaunay_triangulation_2 ${QT_LIBRARIES} )
|
||||
# Link with CGAL
|
||||
target_link_libraries( Delaunay_triangulation_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
|
||||
|
||||
#--------------------------------
|
||||
# The "Regular" demo: Regular_triangulation_2
|
||||
#--------------------------------
|
||||
# UI files (Qt Designer files)
|
||||
qt5_wrap_ui( DT_UI_FILES Regular_triangulation_2.ui )
|
||||
|
||||
# qrc files (resources files, that contain icons, at least)
|
||||
qt5_add_resources ( DT_RESOURCE_FILES ./Regular_triangulation_2.qrc )
|
||||
|
||||
# use the Qt MOC preprocessor on classes that derives from QObject
|
||||
qt5_generate_moc( "Regular_triangulation_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Regular_triangulation_2.moc" )
|
||||
|
||||
# The executable itself.
|
||||
add_executable ( Regular_triangulation_2 Regular_triangulation_2.cpp Regular_triangulation_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
|
||||
|
||||
qt5_use_modules(Regular_triangulation_2 Xml Script OpenGL Svg)
|
||||
add_executable ( Regular_triangulation_2
|
||||
Regular_triangulation_2.cpp)
|
||||
target_link_libraries(Regular_triangulation_2
|
||||
PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Widgets)
|
||||
|
||||
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Regular_triangulation_2 )
|
||||
|
||||
# Link with Qt libraries
|
||||
target_link_libraries( Regular_triangulation_2 ${QT_LIBRARIES} )
|
||||
# Link with CGAL
|
||||
target_link_libraries( Regular_triangulation_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
foreach(target
|
||||
Constrained_Delaunay_triangulation_2
|
||||
Delaunay_triangulation_2
|
||||
Regular_triangulation_2)
|
||||
cgal_add_compilation_test(${target})
|
||||
endforeach()
|
||||
|
||||
else()
|
||||
|
||||
message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
|
||||
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -48,7 +48,33 @@ CGAL_QT_EXPORT void traverse_resources(const QString& name,
|
|||
/**
|
||||
* Call this in the end of an OpenGL implementation to check if it returns errors.
|
||||
*/
|
||||
CGAL_QT_EXPORT void opengl_check_errors(unsigned int line);
|
||||
template <typename QtOpenGLFunctions>
|
||||
void opengl_check_errors(QtOpenGLFunctions* gl,
|
||||
unsigned int line) {
|
||||
GLenum error = gl->glGetError();
|
||||
while (error != GL_NO_ERROR)
|
||||
{
|
||||
if(error == GL_INVALID_ENUM)
|
||||
std::cerr << "An unacceptable value is specified for an enumerated argument." << "@" << line << std::endl;
|
||||
if(error == GL_INVALID_VALUE)
|
||||
std::cerr << "A numeric argument is out of range." << "@" << line << std::endl;
|
||||
if(error == GL_INVALID_OPERATION)
|
||||
std::cerr << "The specified operation is not allowed in the current state." << "@" << line << std::endl;
|
||||
if(error == GL_INVALID_FRAMEBUFFER_OPERATION)
|
||||
std::cerr << "The framebuffer object is not complete." << "@" << line << std::endl;
|
||||
if(error == GL_OUT_OF_MEMORY)
|
||||
std::cerr << "There is not enough memory left to execute the command." << "@" << line << std::endl;
|
||||
#ifdef GL_STACK_UNDERFLOW
|
||||
if(error == GL_STACK_UNDERFLOW)
|
||||
std::cerr << "An attempt has been made to perform an operation that would cause an internal stack to underflow." << "@" << line << std::endl;
|
||||
#endif
|
||||
#ifdef GL_STACK_OVERFLOW
|
||||
if(error == GL_STACK_OVERFLOW)
|
||||
std::cerr << "An attempt has been made to perform an operation that would cause an internal stack to overflow." << "@" << line << std::endl;
|
||||
#endif
|
||||
error = gl->glGetError();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Qt
|
||||
} // namespace CGAL
|
||||
|
|
|
|||
|
|
@ -60,32 +60,5 @@ void traverse_resources(const QString& name, const QString& dirname, int indent)
|
|||
}
|
||||
}
|
||||
|
||||
CGAL_INLINE_FUNCTION
|
||||
void opengl_check_errors(unsigned int line)
|
||||
{
|
||||
GLenum error = ::glGetError();
|
||||
while (error != GL_NO_ERROR)
|
||||
{
|
||||
if(error == GL_INVALID_ENUM)
|
||||
std::cerr << "An unacceptable value is specified for an enumerated argument." << "@" << line << std::endl;
|
||||
if(error == GL_INVALID_VALUE)
|
||||
std::cerr << "A numeric argument is out of range." << "@" << line << std::endl;
|
||||
if(error == GL_INVALID_OPERATION)
|
||||
std::cerr << "The specified operation is not allowed in the current state." << "@" << line << std::endl;
|
||||
if(error == GL_INVALID_FRAMEBUFFER_OPERATION)
|
||||
std::cerr << "The framebuffer object is not complete." << "@" << line << std::endl;
|
||||
if(error == GL_OUT_OF_MEMORY)
|
||||
std::cerr << "There is not enough memory left to execute the command." << "@" << line << std::endl;
|
||||
#ifdef GL_STACK_UNDERFLOW
|
||||
if(error == GL_STACK_UNDERFLOW)
|
||||
std::cerr << "An attempt has been made to perform an operation that would cause an internal stack to underflow." << "@" << line << std::endl;
|
||||
#endif
|
||||
#ifdef GL_STACK_OVERFLOW
|
||||
if(error == GL_STACK_OVERFLOW)
|
||||
std::cerr << "An attempt has been made to perform an operation that would cause an internal stack to overflow." << "@" << line << std::endl;
|
||||
#endif
|
||||
error = ::glGetError();
|
||||
}
|
||||
}
|
||||
} // namesapce Qt
|
||||
} // namespace CGAL
|
||||
|
|
|
|||
|
|
@ -5,107 +5,36 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
|
|||
cmake_policy(SET CMP0053 OLD)
|
||||
endif()
|
||||
|
||||
if($ENV{CGAL_FAKE_PUBLIC_RELEASE})
|
||||
add_definitions( -DCGAL_FAKE_PUBLIC_RELEASE )
|
||||
include(CGAL_SetupCGAL_Qt5Dependencies)
|
||||
|
||||
if(CGAL_Qt5_MISSING_DEPS)
|
||||
message(STATUS "libCGAL_Qt5 is missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.")
|
||||
return()
|
||||
endif()
|
||||
|
||||
message( STATUS "USING Qt5_VERSION = '${Qt5Core_VERSION_STRING}'" )
|
||||
|
||||
if(NOT CGAL_HEADER_ONLY)
|
||||
collect_cgal_library( CGAL_Qt5 "${_CGAL_Qt5_MOC_FILES_private};${_CGAL_Qt5_RESOURCE_FILES_private}")
|
||||
else()
|
||||
collect_cgal_library( CGAL_Qt5 "")
|
||||
endif()
|
||||
|
||||
if(CGAL_HEADER_ONLY)
|
||||
cache_set(CGAL_Qt5_3RD_PARTY_LIBRARIES Qt5::OpenGL Qt5::Svg )
|
||||
else(CGAL_HEADER_ONLY)
|
||||
find_package(Qt5 QUIET COMPONENTS OpenGL Svg)
|
||||
find_package(OpenGL QUIET)
|
||||
set(keyword "INTERFACE")
|
||||
endif()
|
||||
|
||||
set(CGAL_Qt5_MISSING_DEPS "")
|
||||
if(NOT Qt5OpenGL_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "Qt5OpenGL")
|
||||
endif()
|
||||
if(NOT Qt5Svg_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5Svg")
|
||||
endif()
|
||||
if(NOT Qt5_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5")
|
||||
endif()
|
||||
if(NOT OPENGL_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} OpenGL")
|
||||
endif()
|
||||
CGAL_setup_CGAL_Qt5_dependencies( CGAL_Qt5 ${keyword})
|
||||
|
||||
if(CGAL_Qt5_MISSING_DEPS)
|
||||
message(STATUS "libCGAL_Qt5 is missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.")
|
||||
return()
|
||||
endif()
|
||||
|
||||
include_directories (BEFORE ../../include)
|
||||
|
||||
message( STATUS "USING Qt5_VERSION = '${Qt5Core_VERSION_STRING}'" )
|
||||
if(COMMAND add_config_flag)
|
||||
set( CGAL_HAS_QT5 TRUE )
|
||||
add_config_flag( CGAL_HAS_QT5 )
|
||||
endif()
|
||||
|
||||
get_property(QT_UIC_EXECUTABLE TARGET Qt5::uic PROPERTY LOCATION)
|
||||
message( STATUS "OpenGL include: ${OPENGL_INCLUDE_DIR}" )
|
||||
message( STATUS "OpenGL libraries: ${OPENGL_LIBRARIES}" )
|
||||
message( STATUS "OpenGL definitions: ${OPENGL_DEFINITIONS}" )
|
||||
message( STATUS "Qt5Core include: ${Qt5Core_INCLUDE_DIRS}" )
|
||||
message( STATUS "Qt5 libraries: ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Svg_LIBRARIES} ${Qt5OpenGL_LIBRARIES}" )
|
||||
message( STATUS "Qt5Core definitions: ${Qt5Core_DEFINITIONS}" )
|
||||
message( STATUS "moc executable: ${QT_MOC_EXECUTABLE}" )
|
||||
message( STATUS "uic executable: ${QT_UIC_EXECUTABLE}" )
|
||||
|
||||
cache_set(CGAL_Qt5_3RD_PARTY_INCLUDE_DIRS ${QT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} )
|
||||
cache_set(CGAL_Qt5_3RD_PARTY_LIBRARIES ${QT_LIBRARIES} ${OPENGL_LIBRARIES} )
|
||||
cache_set(CGAL_Qt5_3RD_PARTY_DEFINITIONS ${QT_DEFINITIONS} ${OPENGL_DEFINITIONS} )
|
||||
|
||||
set(mocfiles "")
|
||||
set(RESOURCE_FILES "")
|
||||
|
||||
foreach (package ${CGAL_CONFIGURED_PACKAGES} )
|
||||
file(GLOB PACKAGE_QTMOC_FILES "${package}/src/CGAL_Qt5/*.qtmoc.cmake")
|
||||
list(SORT PACKAGE_QTMOC_FILES)
|
||||
foreach(package_qtmoc_file ${PACKAGE_QTMOC_FILES})
|
||||
# includes 'moccing' for sources/headers in package + collects lists of moc-files for dependency (to properly build the lib)
|
||||
include(${package_qtmoc_file})
|
||||
# message(STATUS QTMOC------------FILE: ${package_qtmoc_file})
|
||||
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
foreach(mocfile ${mocfiles})
|
||||
list(APPEND additional_files ${mocfile})
|
||||
endforeach()
|
||||
foreach(resfile ${RESOURCE_FILES})
|
||||
list(APPEND additional_files ${resfile})
|
||||
endforeach()
|
||||
|
||||
# message(STATUS "Additional input files: ${additional_files}")
|
||||
|
||||
use_essential_libs()
|
||||
|
||||
include_directories( SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_Qt5_3RD_PARTY_INCLUDE_DIRS} )
|
||||
|
||||
link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} )
|
||||
|
||||
add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt5_3RD_PARTY_DEFINITIONS} )
|
||||
endif(CGAL_HEADER_ONLY)
|
||||
|
||||
collect_cgal_library( CGAL_Qt5 "${additional_files}")
|
||||
|
||||
if (NOT CGAL_HEADER_ONLY)
|
||||
|
||||
qt5_use_modules(CGAL_Qt5 OpenGL Svg)
|
||||
|
||||
add_dependencies( CGAL_Qt5 CGAL )
|
||||
|
||||
# CGAL_Qt5 only depends on CGAL in DEBUG, but we still link it in
|
||||
# both build types.
|
||||
target_link_libraries( CGAL_Qt5 CGAL ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_Qt5_3RD_PARTY_LIBRARIES} )
|
||||
|
||||
else()
|
||||
|
||||
install(DIRECTORY "../../include/CGAL/Qt/" DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/include/CGAL/Qt")
|
||||
install(DIRECTORY "../../demo/resources/" DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/demo/resources")
|
||||
install(DIRECTORY "../../demo/icons/" DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/demo/icons")
|
||||
if(COMMAND add_config_flag)
|
||||
set( CGAL_HAS_QT5 TRUE )
|
||||
add_config_flag( CGAL_HAS_QT5 )
|
||||
endif()
|
||||
|
||||
if (CGAL_HEADER_ONLY)
|
||||
install(DIRECTORY "../../include/CGAL/Qt/" DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/include/CGAL/Qt" COMPONENT CGAL_Qt5)
|
||||
install(DIRECTORY "../../demo/resources/" DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/demo/resources" COMPONENT CGAL_Qt5)
|
||||
install(DIRECTORY "../../demo/icons/" DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/demo/icons" COMPONENT CGAL_Qt5)
|
||||
endif()
|
||||
|
||||
message("libCGAL_Qt5 is configured")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
#
|
||||
# This file points to the CGALConfig.cmake for a header-only
|
||||
# CGAL installation.
|
||||
#
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig.cmake)
|
||||
|
|
@ -35,12 +35,11 @@ include(GNUInstallDirs)
|
|||
if(CMAKE_MAJOR_VERSION GREATER 2)
|
||||
# In header only mode, we use INTERFACE libraries, which was introduced in cmake 3.0.
|
||||
# Thus this option is only enabled for cmake >= 3.0.
|
||||
option(CGAL_HEADER_ONLY "Enable the header only version of CGAL" OFF )
|
||||
|
||||
if (CGAL_HEADER_ONLY)
|
||||
set(CGAL_HEADER_ONLY TRUE CACHE BOOL "Enable cgal header only" FORCE)
|
||||
add_definitions(-DCGAL_HEADER_ONLY)
|
||||
endif (CGAL_HEADER_ONLY)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
|
|
@ -551,12 +550,18 @@ message( "== Generate version files (DONE) ==\n")
|
|||
# -= External libraries =-
|
||||
#
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
|
||||
message("== Set up flags ==")
|
||||
|
||||
include(CGAL_SetupFlags)
|
||||
if( RUNNING_CGAL_AUTO_TEST )
|
||||
message("== Set up flags ==")
|
||||
|
||||
message("== Set up flags (DONE) ==\n")
|
||||
# Ugly hack to be compatible with current CGAL testsuite process (as of
|
||||
# Nov. 2017). -- Laurent Rineau
|
||||
include(CGAL_SetupFlags)
|
||||
|
||||
message("== Set up flags (DONE) ==\n")
|
||||
else()
|
||||
include( CGAL_display_flags )
|
||||
endif()
|
||||
|
||||
message("== Detect external libraries ==")
|
||||
|
||||
|
|
@ -673,7 +678,9 @@ option( CGAL_ENABLE_PRECONFIG "Select to allow to preconfiguration of external l
|
|||
# this; e.g. in MPFI/RS in Algebraic_kernel_d. For these cases CGAL
|
||||
# and the example/test must be configured with MPFI (just one is not sufficient)
|
||||
|
||||
include(CGAL_SetupDependencies)
|
||||
if(NOT CGAL_HEADER_ONLY)
|
||||
include(CGAL_SetupDependencies)
|
||||
endif()
|
||||
|
||||
message("== Detect external libraries (DONE) ==\n")
|
||||
|
||||
|
|
@ -683,6 +690,7 @@ message("== Detect external libraries (DONE) ==\n")
|
|||
#
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
|
||||
if(NOT CGAL_HEADER_ONLY)
|
||||
# The variables set are the #defines expected by compiler_config.h
|
||||
# Note: CMake will not notice when files are added or removed
|
||||
# but this is probably OK for the installation procedure.
|
||||
|
|
@ -742,6 +750,10 @@ if ( RUNNING_CGAL_AUTO_TEST AND MSVC )
|
|||
file( APPEND "${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h" "#include <CGAL/Testsuite/vc_debug_hook.h>\n\n" )
|
||||
endif()
|
||||
|
||||
message("== Write compiler_config.h (DONE) ==\n")
|
||||
|
||||
endif(NOT CGAL_HEADER_ONLY)
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
#
|
||||
# -= Installation Setup =-
|
||||
|
|
@ -760,7 +772,7 @@ set ( CGAL_INSTALL_BIN_DIR "${CMAKE_INSTALL_BINDIR}"
|
|||
CACHE STRING "The folder where CGAL user-side scripts will be installed, relative to CMAKE_INSTALL_PREFIX"
|
||||
)
|
||||
|
||||
set ( CGAL_INSTALL_CMAKE_DIR "${CGAL_INSTALL_LIB_DIR}/CGAL"
|
||||
set ( CGAL_INSTALL_CMAKE_DIR "${CGAL_INSTALL_LIB_DIR}/cmake/CGAL"
|
||||
CACHE STRING "The folder where CGAL CMake modules will be installed, relative to CMAKE_INSTALL_PREFIX"
|
||||
)
|
||||
|
||||
|
|
@ -772,8 +784,6 @@ set ( CGAL_INSTALL_MAN_DIR "${CMAKE_INSTALL_DATAROOTDIR}/man/man1"
|
|||
CACHE STRING "The folder where manual pages for CGAL scripts will be installed, relative to CMAKE_INSTALL_PREFIX"
|
||||
)
|
||||
|
||||
message("== Write compiler_config.h (DONE) ==\n")
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
#
|
||||
# -= Build =-
|
||||
|
|
@ -788,7 +798,9 @@ set(CGAL_LIBRARIES_DIR ${CMAKE_BINARY_DIR}/lib)
|
|||
set(CGAL_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/include)
|
||||
|
||||
foreach (package ${CGAL_CONFIGURED_PACKAGES})
|
||||
set(CGAL_INCLUDE_DIRS ${CGAL_INCLUDE_DIRS} ${package}/include)
|
||||
if(EXISTS ${package}/include)
|
||||
set(CGAL_INCLUDE_DIRS ${CGAL_INCLUDE_DIRS} ${package}/include)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
include_directories (${CGAL_INCLUDE_DIRS})
|
||||
|
|
@ -847,7 +859,12 @@ if (CGAL_BRANCH_BUILD AND CGAL_REPORT_DUPLICATE_FILES )
|
|||
|
||||
endif()
|
||||
|
||||
create_CGALconfig_files()
|
||||
if(NOT CGAL_HEADER_ONLY)
|
||||
create_CGALconfig_files()
|
||||
else()
|
||||
configure_file("${CGAL_MODULES_DIR}/CGALConfig_binary_header_only.cmake.in"
|
||||
"${CMAKE_BINARY_DIR}/CGALConfig.cmake" @ONLY)
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
#
|
||||
|
|
@ -892,10 +909,17 @@ if ( ZLIB_IN_AUXILIARY )
|
|||
endif()
|
||||
|
||||
|
||||
install(FILES
|
||||
${CMAKE_BINARY_DIR}/CGALConfigVersion.cmake
|
||||
${CMAKE_BINARY_DIR}/config/CGALConfig.cmake
|
||||
DESTINATION ${CGAL_INSTALL_CMAKE_DIR} )
|
||||
if(NOT CGAL_HEADER_ONLY)
|
||||
install(FILES
|
||||
${CMAKE_BINARY_DIR}/CGALConfigVersion.cmake
|
||||
${CMAKE_BINARY_DIR}/config/CGALConfig.cmake
|
||||
DESTINATION ${CGAL_INSTALL_CMAKE_DIR} )
|
||||
else()
|
||||
install(FILES
|
||||
${CMAKE_BINARY_DIR}/CGALConfigVersion.cmake
|
||||
${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig.cmake
|
||||
DESTINATION ${CGAL_INSTALL_CMAKE_DIR} )
|
||||
endif()
|
||||
|
||||
if(CGAL_INSTALL_MAN_DIR)
|
||||
install(FILES auxiliary/cgal_create_cmake_script.1 DESTINATION ${CGAL_INSTALL_MAN_DIR} )
|
||||
|
|
|
|||
|
|
@ -15,30 +15,9 @@ set(CGAL_HEADER_ONLY "@CGAL_HEADER_ONLY@" )
|
|||
# The code for including exported targets is different from
|
||||
# CGAL_Config_install.cmake. We do not have separate export files in
|
||||
# an installed version and we need to make sure that we are not
|
||||
# currently building CGAL. Note that for CMake<=2.8.11 (detected by
|
||||
# the absence of CMP0024), the else() condition is never used.
|
||||
if(NOT POLICY CMP0024 OR NOT CGAL_BUILDING_LIBS)
|
||||
# currently building CGAL.
|
||||
if(NOT CGAL_BUILDING_LIBS)
|
||||
include("${CGAL_CONFIG_DIR}/CGALExports.cmake")
|
||||
|
||||
macro(CGAL_get_property_optional VAR TARGET PROPERTY)
|
||||
if(TARGET ${TARGET})
|
||||
get_property(${VAR} TARGET ${TARGET} PROPERTY ${PROPERTY})
|
||||
else()
|
||||
set(${VAR} "")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
if(NOT MSVC AND NOT CGAL_HEADER_ONLY)
|
||||
CGAL_get_property_optional(CGAL_LIBRARY CGAL::CGAL LOCATION)
|
||||
CGAL_get_property_optional(CGAL_Core_LIBRARY CGAL::CGAL_Core LOCATION)
|
||||
CGAL_get_property_optional(CGAL_ImageIO_LIBRARY CGAL::CGAL_ImageIO LOCATION)
|
||||
CGAL_get_property_optional(CGAL_Qt5_LIBRARY CGAL::CGAL_Qt5 LOCATION)
|
||||
else()
|
||||
set(CGAL_LIBRARY "")
|
||||
set(CGAL_Core_LIBRARY "")
|
||||
set(CGAL_ImageIO_LIBRARY "")
|
||||
set(CGAL_Qt5_LIBRARY "")
|
||||
endif()
|
||||
else()
|
||||
# We are currently in a CGAL Build and CGALExports.cmake has not
|
||||
# necessarily been created yet. Just alias the targets. Also don't
|
||||
|
|
@ -48,9 +27,6 @@ else()
|
|||
macro(CGAL_alias_library lib)
|
||||
if(TARGET ${lib} AND NOT TARGET CGAL::${lib})
|
||||
add_library(CGAL::${lib} ALIAS ${lib})
|
||||
set(${lib}_LIBRARY CGAL::${lib})
|
||||
else()
|
||||
set(${lib}_LIBRARY "")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
|
@ -60,6 +36,19 @@ else()
|
|||
CGAL_alias_library(CGAL_Qt5)
|
||||
endif()
|
||||
|
||||
macro(CGAL_set_LIB_LIBRARY_var lib)
|
||||
if(TARGET CGAL::${lib})
|
||||
set(${lib}_LIBRARY CGAL::${lib})
|
||||
else()
|
||||
set(${lib}_LIBRARY "")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
CGAL_set_LIB_LIBRARY_var(CGAL)
|
||||
CGAL_set_LIB_LIBRARY_var(CGAL_Core)
|
||||
CGAL_set_LIB_LIBRARY_var(CGAL_ImageIO)
|
||||
CGAL_set_LIB_LIBRARY_var(CGAL_Qt5)
|
||||
|
||||
# Check for possible config files of our libraries and include them.
|
||||
file(GLOB CGAL_CONFIG_FILES LIST_DIRECTORIES false
|
||||
RELATIVE "${CGAL_CONFIG_DIR}" "${CGAL_CONFIG_DIR}/*LibConfig.cmake")
|
||||
|
|
@ -130,47 +119,30 @@ macro(check_cgal_component COMPONENT)
|
|||
set( CHECK_CGAL_ERROR_TAIL "" )
|
||||
else( "${CGAL_LIB}" STREQUAL "CGAL" )
|
||||
if ( WITH_${CGAL_LIB} )
|
||||
if(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB})
|
||||
if(TARGET CGAL::${CGAL_LIB})
|
||||
if ("${CGAL_LIB}" STREQUAL "CGAL_Qt5")
|
||||
find_package(Qt5 QUIET COMPONENTS OpenGL Svg)
|
||||
find_package(OpenGL QUIET)
|
||||
|
||||
set(CGAL_Qt5_MISSING_DEPS "")
|
||||
if(NOT Qt5OpenGL_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "Qt5OpenGL")
|
||||
endif()
|
||||
if(NOT Qt5Svg_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5Svg")
|
||||
endif()
|
||||
if(NOT Qt5_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5")
|
||||
endif()
|
||||
if(NOT OPENGL_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} OpenGL")
|
||||
endif()
|
||||
|
||||
include("${CGAL_MODULES_DIR}/CGAL_SetupCGAL_Qt5Dependencies.cmake")
|
||||
|
||||
if(CGAL_Qt5_MISSING_DEPS)
|
||||
set( ${CGAL_LIB}_FOUND FALSE )
|
||||
set( CGAL_Qt5_FOUND FALSE )
|
||||
message(STATUS "libCGAL_Qt5 is missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.")
|
||||
else()
|
||||
set( ${CGAL_LIB}_FOUND TRUE )
|
||||
if (CGAL_HEADER_ONLY)
|
||||
include("${CGAL_MODULES_DIR}/Use_CGAL_Qt5_headers.cmake")
|
||||
endif()
|
||||
set( CGAL_Qt5_FOUND TRUE )
|
||||
endif()
|
||||
else("${CGAL_LIB}" STREQUAL "CGAL_Qt5")
|
||||
# Librairies that have no dependencies
|
||||
set( ${CGAL_LIB}_FOUND TRUE )
|
||||
endif("${CGAL_LIB}" STREQUAL "CGAL_Qt5")
|
||||
else(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB})
|
||||
else(TARGET CGAL::${CGAL_LIB})
|
||||
set( ${CGAL_LIB}_FOUND FALSE )
|
||||
set( CHECK_${CGAL_LIB}_ERROR_TAIL " CGAL was configured with WITH_${CGAL_LIB}=ON, but one of the dependencies of ${CGAL_LIB} was not configured properly." )
|
||||
endif(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB})
|
||||
endif(TARGET CGAL::${CGAL_LIB})
|
||||
else( WITH_${CGAL_LIB} )
|
||||
set( ${CGAL_LIB}_FOUND FALSE )
|
||||
set( CHECK_${CGAL_LIB}_ERROR_TAIL " Please configure CGAL using WITH_${CGAL_LIB}=ON." )
|
||||
endif( WITH_${CGAL_LIB} )
|
||||
endif( "${CGAL_LIB}" STREQUAL "CGAL" )
|
||||
endif()
|
||||
|
||||
if ( NOT ${CGAL_LIB}_FOUND AND CHECK_CGAL_COMPONENT_MSG_ON_ERROR )
|
||||
message( ${CHECK_CGAL_COMPONENT_ERROR_TYPE} "${CHECK_CGAL_COMPONENT_ERROR_TITLE} The ${CGAL_LIB} library was not configured.${CHECK_${CGAL_LIB}_ERROR_TAIL}" )
|
||||
|
|
@ -198,3 +170,15 @@ set(CGAL_SUPPORTING_3RD_PARTY_LIBRARIES "@CGAL_SUPPORTING_3RD_PARTY_LIBRARIES@")
|
|||
set(CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES "@CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES@")
|
||||
|
||||
set(CGAL_DISABLE_GMP "@CGAL_DISABLE_GMP@")
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_CreateSingleSourceCGALProgram.cmake)
|
||||
include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake)
|
||||
|
||||
# Temporary? Change the CMAKE module path
|
||||
cgal_setup_module_path()
|
||||
|
||||
if( RUNNING_CGAL_AUTO_TEST )
|
||||
# Ugly hack to be compatible with current CGAL testsuite process (as of
|
||||
# Nov. 2017). -- Laurent Rineau
|
||||
include(CGAL_SetupFlags)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
#
|
||||
# This file points to the CGALConfig.cmake for header-only CGAL.
|
||||
#
|
||||
|
||||
include(@CGAL_INSTALLATION_PACKAGE_DIR@/lib/cmake/CGAL/CGALConfig.cmake)
|
||||
|
|
@ -91,42 +91,25 @@ macro(check_cgal_component COMPONENT)
|
|||
endif()
|
||||
|
||||
if ( WITH_${CGAL_LIB} )
|
||||
if(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB})
|
||||
if(TARGET CGAL::${CGAL_LIB})
|
||||
if ("${CGAL_LIB}" STREQUAL "CGAL_Qt5")
|
||||
find_package(Qt5 QUIET COMPONENTS OpenGL Svg)
|
||||
find_package(OpenGL QUIET)
|
||||
|
||||
set(CGAL_Qt5_MISSING_DEPS "")
|
||||
if(NOT Qt5OpenGL_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "Qt5OpenGL")
|
||||
endif()
|
||||
if(NOT Qt5Svg_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5Svg")
|
||||
endif()
|
||||
if(NOT Qt5_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5")
|
||||
endif()
|
||||
if(NOT OPENGL_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} OpenGL")
|
||||
endif()
|
||||
|
||||
include("${CGAL_MODULES_DIR}/CGAL_SetupCGAL_Qt5Dependencies.cmake")
|
||||
|
||||
if(CGAL_Qt5_MISSING_DEPS)
|
||||
set( ${CGAL_LIB}_FOUND FALSE )
|
||||
set( CGAL_Qt5_FOUND FALSE )
|
||||
message(STATUS "libCGAL_Qt5 is missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.")
|
||||
else()
|
||||
set( ${CGAL_LIB}_FOUND TRUE )
|
||||
if (CGAL_HEADER_ONLY)
|
||||
include("${CGAL_MODULES_DIR}/Use_CGAL_Qt5_headers.cmake")
|
||||
endif()
|
||||
set( CGAL_Qt5_FOUND TRUE )
|
||||
endif()
|
||||
else("${CGAL_LIB}" STREQUAL "CGAL_Qt5")
|
||||
# Librairies that have no dependencies
|
||||
set( ${CGAL_LIB}_FOUND TRUE )
|
||||
endif("${CGAL_LIB}" STREQUAL "CGAL_Qt5")
|
||||
else(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB})
|
||||
else(TARGET CGAL::${CGAL_LIB})
|
||||
set( ${CGAL_LIB}_FOUND FALSE )
|
||||
set( CHECK_${CGAL_LIB}_ERROR_TAIL " CGAL was configured with WITH_${CGAL_LIB}=ON, but one of the dependencies of ${CGAL_LIB} was not configured properly." )
|
||||
endif(CGAL_HEADER_ONLY OR TARGET CGAL::${CGAL_LIB})
|
||||
endif(TARGET CGAL::${CGAL_LIB})
|
||||
else( WITH_${CGAL_LIB} )
|
||||
set( ${CGAL_LIB}_FOUND FALSE )
|
||||
set( CHECK_${CGAL_LIB}_ERROR_TAIL " Please configure CGAL using WITH_${CGAL_LIB}=ON." )
|
||||
|
|
@ -159,3 +142,15 @@ set(CGAL_SUPPORTING_3RD_PARTY_LIBRARIES "@CGAL_SUPPORTING_3RD_PARTY_LIBRARIES@")
|
|||
set(CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES "@CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES@")
|
||||
|
||||
set(CGAL_DISABLE_GMP "@CGAL_DISABLE_GMP@")
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_CreateSingleSourceCGALProgram.cmake)
|
||||
include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake)
|
||||
|
||||
# Temporary? Change the CMAKE module path
|
||||
cgal_setup_module_path()
|
||||
|
||||
if( RUNNING_CGAL_AUTO_TEST )
|
||||
# Ugly hack to be compatible with current CGAL testsuite process (as of
|
||||
# Nov. 2017). -- Laurent Rineau
|
||||
include(CGAL_SetupFlags)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
include(CGAL_Macros)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake)
|
||||
|
||||
if(RUNNING_CGAL_AUTO_TEST)
|
||||
# Just to avoid a warning from CMake if that variable is set on the command line...
|
||||
|
|
@ -43,7 +43,7 @@ if( NOT CGAL_COMMON_FILE_INCLUDED )
|
|||
hide_variable(CMAKE_UNAME)
|
||||
|
||||
# Optionally setup the Visual Leak Detector
|
||||
include(CGAL_SetupVLD)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SetupVLD.cmake)
|
||||
CGAL_SetupVLD()
|
||||
if(VLD_FOUND)
|
||||
message(STATUS "Visual Leak Detector (VLD) is enabled.")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
include(CGAL_add_test)
|
||||
if(CGAL_CreateSingleSourceCGALProgram_included)
|
||||
return()
|
||||
endif(CGAL_CreateSingleSourceCGALProgram_included)
|
||||
set(CGAL_CreateSingleSourceCGALProgram_included TRUE)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_add_test.cmake)
|
||||
include(CMakeParseArguments)
|
||||
|
||||
function(create_single_source_cgal_program firstfile )
|
||||
|
|
@ -11,7 +16,7 @@ function(create_single_source_cgal_program firstfile )
|
|||
set(NO_TESTING ${create_single_source_cgal_program_NO_TESTING})
|
||||
|
||||
if(NOT IS_ABSOLUTE "${firstfile}")
|
||||
set(firstfile "${CGAL_CURRENT_SOURCE_DIR}/${firstfile}")
|
||||
set(firstfile "${CMAKE_CURRENT_SOURCE_DIR}/${firstfile}")
|
||||
endif()
|
||||
|
||||
get_filename_component(exe_name ${firstfile} NAME_WE)
|
||||
|
|
@ -52,22 +57,22 @@ function(create_single_source_cgal_program firstfile )
|
|||
set(NO_TESTING TRUE)
|
||||
endif()
|
||||
|
||||
if(NOT NO_TESTING)
|
||||
cgal_add_test(${exe_name})
|
||||
endif(NOT NO_TESTING)
|
||||
if(POLICY CMP0064)
|
||||
# CMake 3.4 or later
|
||||
if(NOT NO_TESTING)
|
||||
cgal_add_test(${exe_name})
|
||||
else()
|
||||
cgal_add_test(${exe_name} NO_EXECUTION)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${exe_name} )
|
||||
|
||||
# Link the executable to CGAL and third-party libraries
|
||||
if ( CGAL_AUTO_LINK_ENABLED )
|
||||
|
||||
target_link_libraries(${exe_name} ${CGAL_3RD_PARTY_LIBRARIES} )
|
||||
|
||||
else()
|
||||
|
||||
target_link_libraries(${exe_name} ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )
|
||||
|
||||
target_link_libraries(${exe_name} PRIVATE CGAL::CGAL)
|
||||
if(CGAL_3RD_PARTY_LIBRARIES)
|
||||
target_link_libraries(${exe_name} PRIVATE ${CGAL_3RD_PARTY_LIBRARIES})
|
||||
endif()
|
||||
|
||||
else()
|
||||
message(AUTHOR_WARNING "The executable ${exe_name} will not be created because the source file ${firstfile} does not exist.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
# CGAL_TAUCS_LIBRARIES_DIR -list of folders (using full path name) containing
|
||||
# TAUCS (and optionaly BLAS and LAPACK) libraries
|
||||
|
||||
include(CGAL_Macros)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake)
|
||||
|
||||
if ( NOT CGAL_TAUCS_FOUND )
|
||||
|
||||
|
|
|
|||
|
|
@ -159,16 +159,20 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
|
|||
|
||||
set ( ${LIB}_VERSION "unknown" )
|
||||
|
||||
try_run( ${LIB}_RUN_RES
|
||||
${LIB}_COMPILE_RES
|
||||
"${CMAKE_BINARY_DIR}"
|
||||
"${CGAL_INSTALLATION_PACKAGE_DIR}/config/support/print_${LIB}_version.cpp"
|
||||
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${${PKG}_INCLUDE_DIR};${${PKG}_DEPENDENCY_INCLUDE_DIR}"
|
||||
"-DLINK_LIBRARIES:STRING=${${PKG}_LIBRARIES};${${PKG}_DEPENDENCY_LIBRARIES}"
|
||||
"-DLINK_DIRECTORIES:STRING=${${PKG}_LIBRARIES_DIR};${${PKG}_DEPENDENCY_LIBRARIES_DIR}"
|
||||
OUTPUT_VARIABLE ${LIB}_OUTPUT
|
||||
)
|
||||
|
||||
if(NOT CMAKE_CROSSCOMPILING)
|
||||
try_run( ${LIB}_RUN_RES
|
||||
${LIB}_COMPILE_RES
|
||||
"${CMAKE_BINARY_DIR}"
|
||||
"${CGAL_INSTALLATION_PACKAGE_DIR}/config/support/print_${LIB}_version.cpp"
|
||||
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${${PKG}_INCLUDE_DIR};${${PKG}_DEPENDENCY_INCLUDE_DIR}"
|
||||
"-DLINK_LIBRARIES:STRING=${${PKG}_LIBRARIES};${${PKG}_DEPENDENCY_LIBRARIES}"
|
||||
"-DLINK_DIRECTORIES:STRING=${${PKG}_LIBRARIES_DIR};${${PKG}_DEPENDENCY_LIBRARIES_DIR}"
|
||||
OUTPUT_VARIABLE ${LIB}_OUTPUT
|
||||
)
|
||||
else()
|
||||
set(${LIB}_COMPILE_RES FALSE)
|
||||
message(STATUS "CROSS-COMPILING!")
|
||||
endif()
|
||||
if ( ${LIB}_COMPILE_RES )
|
||||
|
||||
if ( ${LIB}_RUN_RES EQUAL "0" )
|
||||
|
|
@ -268,7 +272,9 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
|
|||
message (STATUS "Requested component: ${component}")
|
||||
|
||||
if(WITH_CGAL_${component})
|
||||
if(TARGET CGAL_${component})
|
||||
if(TARGET CGAL::CGAL_${component})
|
||||
add_to_list( CGAL_LIBRARIES CGAL::CGAL_${component} )
|
||||
elseif(TARGET CGAL_${component})
|
||||
add_to_list( CGAL_LIBRARIES CGAL_${component} )
|
||||
else()
|
||||
add_to_list( CGAL_LIBRARIES ${CGAL_${component}_LIBRARY} )
|
||||
|
|
@ -298,7 +304,6 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
|
|||
endif()
|
||||
|
||||
if (${component} STREQUAL "Qt5")
|
||||
find_package(OpenGL QUIET)
|
||||
find_package(Qt5 COMPONENTS OpenGL Gui Core Script ScriptTools QUIET)
|
||||
endif()
|
||||
|
||||
|
|
@ -335,7 +340,6 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
|
|||
|
||||
if (${component} STREQUAL "Qt5")
|
||||
set(CGAL_${component}_FOUND TRUE)
|
||||
find_package(OpenGL QUIET)
|
||||
find_package(Qt5 COMPONENTS OpenGL Gui Core Script ScriptTools QUIET)
|
||||
endif()
|
||||
####message( STATUS "External library ${vlib} after find")
|
||||
|
|
|
|||
|
|
@ -1,13 +1,17 @@
|
|||
qt5_wrap_cpp(CGAL_Qt5_MOC_FILES
|
||||
if(CGAL_Qt5_moc_and_resource_files_included)
|
||||
return()
|
||||
endif()
|
||||
set(CGAL_Qt5_moc_and_resource_files_included TRUE)
|
||||
|
||||
qt5_wrap_cpp(_CGAL_Qt5_MOC_FILES_private
|
||||
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/GraphicsViewNavigation.h
|
||||
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/DemosMainWindow.h
|
||||
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/GraphicsItem.h
|
||||
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/GraphicsViewInput.h)
|
||||
|
||||
# qrc files (resources files, that contain icons, at least)
|
||||
qt5_add_resources (CGAL_Qt5_RESOURCE_FILES
|
||||
qt5_add_resources (_CGAL_Qt5_RESOURCE_FILES_private
|
||||
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/resources/CGAL.qrc
|
||||
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/Input.qrc
|
||||
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/File.qrc
|
||||
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/Triangulation_2.qrc)
|
||||
|
||||
|
|
@ -1,50 +1,58 @@
|
|||
# Common settings for CGAL cmake scripts
|
||||
if( NOT CGAL_SCM_FILE_INCLUDED )
|
||||
set(CGAL_SCM_FILE_INCLUDED 1 )
|
||||
if(CGAL_SCM_FILE_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
set(CGAL_SCM_FILE_INCLUDED 1)
|
||||
|
||||
# CGAL_SCM_NAME can be either git or n/a as an indicator if we have a
|
||||
# build system or not
|
||||
|
||||
# TODO: make that scm agnostic and turn it into a boolean
|
||||
set(GIT_PARENT_DIR "${CMAKE_SOURCE_DIR}")
|
||||
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
|
||||
if (EXISTS "${GIT_DIR}")
|
||||
set( CGAL_SCM_NAME "git" )
|
||||
else()
|
||||
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
|
||||
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
|
||||
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
|
||||
if( "${GIT_PARENT_DIR}" STREQUAL "${GIT_PREVIOUS_PARENT}" )
|
||||
# We have reached the root directory, we are not in git
|
||||
set( _refspecvar "GITDIR-NOTFOUND" )
|
||||
set( _hashvar "GITDIR-NOTFOUND" )
|
||||
set( CGAL_SCM_NAME "n/a" )
|
||||
break()
|
||||
else()
|
||||
set( GIT_DIR "${GIT_PARENT_DIR}/.git" )
|
||||
set( CGAL_SCM_NAME "git" )
|
||||
endif()
|
||||
endwhile()
|
||||
endif()
|
||||
function(CGAL_detect_git GIT_PARENT_DIR)
|
||||
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
|
||||
if (EXISTS "${GIT_DIR}")
|
||||
set( CGAL_SCM_NAME "git" )
|
||||
else()
|
||||
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
|
||||
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
|
||||
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
|
||||
if( "${GIT_PARENT_DIR}" STREQUAL "${GIT_PREVIOUS_PARENT}" )
|
||||
# We have reached the root directory, we are not in git
|
||||
set( _refspecvar "GITDIR-NOTFOUND" )
|
||||
set( _hashvar "GITDIR-NOTFOUND" )
|
||||
set( CGAL_SCM_NAME "n/a" )
|
||||
break()
|
||||
else()
|
||||
set( GIT_DIR "${GIT_PARENT_DIR}/.git" )
|
||||
set( CGAL_SCM_NAME "git" )
|
||||
endif()
|
||||
endwhile()
|
||||
endif()
|
||||
|
||||
if ( "${CGAL_SCM_NAME}" STREQUAL "git" )
|
||||
find_program(GIT_EXECUTABLE git DOC "git command line client")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir=${GIT_DIR} rev-parse --symbolic --abbrev-ref HEAD
|
||||
OUTPUT_VARIABLE CGAL_GIT_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if ( "${CGAL_SCM_NAME}" STREQUAL "git" )
|
||||
find_program(GIT_EXECUTABLE git DOC "git command line client")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir=${GIT_DIR} rev-parse --symbolic --abbrev-ref HEAD
|
||||
OUTPUT_VARIABLE CGAL_GIT_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
set( CGAL_SCM_BRANCH_NAME "${CGAL_GIT_BRANCH}" )
|
||||
set( CGAL_SCM_BRANCH_NAME "${CGAL_GIT_BRANCH}" )
|
||||
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir=${GIT_DIR} rev-parse HEAD
|
||||
OUTPUT_VARIABLE CGAL_GIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir=${GIT_DIR} rev-parse HEAD
|
||||
OUTPUT_VARIABLE CGAL_CREATED_GIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
# backward compatible
|
||||
set( CGAL_CREATED_SVN_REVISION "99999" )
|
||||
else()
|
||||
set( CGAL_SCM_BRANCH_NAME "n/a")
|
||||
set( CGAL_CREATED_GIT_HASH "n/a" )
|
||||
set( CGAL_CREATED_SVN_REVISION "n/a" )
|
||||
endif()
|
||||
# backward compatible
|
||||
set( CGAL_CREATED_SVN_REVISION "99999" )
|
||||
else()
|
||||
set( CGAL_SCM_BRANCH_NAME "n/a" )
|
||||
set( CGAL_CREATED_GIT_HASH "n/a" )
|
||||
set( CGAL_CREATED_SVN_REVISION "n/a" )
|
||||
endif()
|
||||
|
||||
# export the variables to PARENT_SCOPE
|
||||
set( CGAL_SCM_NAME ${CGAL_SCM_NAME} PARENT_SCOPE )
|
||||
set( CGAL_SCM_BRANCH_NAME ${CGAL_SCM_BRANCH_NAME} PARENT_SCOPE )
|
||||
set( CGAL_CREATED_GIT_HASH ${CGAL_CREATED_GIT_HASH} PARENT_SCOPE )
|
||||
set( CGAL_CREATED_SVN_REVISION ${CGAL_CREATED_SVN_REVISION} PARENT_SCOPE )
|
||||
endfunction()
|
||||
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,21 @@
|
|||
if ( NOT CGAL_Boost_Setup )
|
||||
#.rst:
|
||||
# CGAL_SetupBoost
|
||||
# ---------------
|
||||
#
|
||||
# The module searchs for the `Boost` headers and library, by calling
|
||||
#
|
||||
# .. code-block:: cmake
|
||||
#
|
||||
# find_package(Boost)
|
||||
#
|
||||
# and defines the function :command:`use_CGAL_Boost_support`.
|
||||
|
||||
include(CGAL_TweakFindBoost)
|
||||
if ( CGAL_Boost_Setup )
|
||||
return()
|
||||
endif()
|
||||
set ( CGAL_Boost_Setup TRUE )
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_TweakFindBoost.cmake)
|
||||
|
||||
set ( CGAL_requires_Boost_libs TRUE )
|
||||
if ( DEFINED MSVC_VERSION AND "${MSVC_VERSION}" GREATER 1800)
|
||||
|
|
@ -17,40 +32,54 @@ if ( NOT CGAL_Boost_Setup )
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if (CGAL_requires_Boost_libs)
|
||||
find_package( Boost 1.48 REQUIRED thread system )
|
||||
else()
|
||||
find_package( Boost 1.48 REQUIRED )
|
||||
endif()
|
||||
|
||||
if(Boost_FOUND)
|
||||
if(DEFINED Boost_DIR AND NOT Boost_DIR)
|
||||
# Unset that cache variable that is set in the cache by FindBoost
|
||||
# (while it was searching for boost-cmake).
|
||||
unset(Boost_DIR CACHE)
|
||||
set(Boost_NO_BOOST_CMAKE TRUE CACHE INTERNAL "Avoid future search of boost-cmake")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message( STATUS "Boost include: ${Boost_INCLUDE_DIRS}" )
|
||||
message( STATUS "Boost libraries: ${Boost_LIBRARIES}" )
|
||||
message( STATUS "Boost definitions: ${Boost_DEFINITIONS}" )
|
||||
|
||||
set ( CGAL_USE_BOOST 1 )
|
||||
|
||||
include(CGAL_Macros)
|
||||
|
||||
add_to_cached_list(CGAL_3RD_PARTY_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} )
|
||||
add_to_cached_list(CGAL_3RD_PARTY_LIBRARIES_DIRS ${Boost_LIBRARY_DIRS} )
|
||||
add_to_cached_list(CGAL_3RD_PARTY_DEFINITIONS ${Boost_DEFINITIONS} )
|
||||
|
||||
if ( NOT MSVC )
|
||||
add_to_cached_list(CGAL_3RD_PARTY_LIBRARIES ${Boost_LIBRARIES} )
|
||||
endif()
|
||||
|
||||
message( STATUS "USING BOOST_VERSION = '${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}'" )
|
||||
|
||||
set ( CGAL_Boost_Setup TRUE )
|
||||
|
||||
if (CGAL_requires_Boost_libs)
|
||||
find_package( Boost 1.48 REQUIRED thread system )
|
||||
else()
|
||||
find_package( Boost 1.48 REQUIRED )
|
||||
endif()
|
||||
|
||||
if(Boost_FOUND)
|
||||
if(DEFINED Boost_DIR AND NOT Boost_DIR)
|
||||
# Unset that cache variable that is set in the cache by FindBoost
|
||||
# (while it was searching for boost-cmake).
|
||||
unset(Boost_DIR CACHE)
|
||||
set(Boost_NO_BOOST_CMAKE TRUE CACHE INTERNAL "Avoid future search of boost-cmake")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message( STATUS "Boost include dirs: ${Boost_INCLUDE_DIRS}" )
|
||||
message( STATUS "Boost libraries: ${Boost_LIBRARIES}" )
|
||||
|
||||
set ( CGAL_USE_BOOST 1 )
|
||||
|
||||
|
||||
#.rst:
|
||||
# Provided Functions
|
||||
# ^^^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# .. command:: use_CGAL_Boost_support
|
||||
#
|
||||
# Link the target with the `Boost` libraries::
|
||||
#
|
||||
# use_CGAL_Boost_support( target [INTERFACE] )
|
||||
#
|
||||
# If the option ``INTERFACE`` is passed, the dependencies are
|
||||
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
||||
# keyword, or ``PUBLIC`` otherwise.
|
||||
|
||||
function(use_CGAL_Boost_support target)
|
||||
if(ARGV1 STREQUAL INTERFACE)
|
||||
set(keyword INTERFACE)
|
||||
else()
|
||||
set(keyword PUBLIC)
|
||||
endif()
|
||||
if(NOT Boost_FOUND)
|
||||
message(FATAL_ERROR "use_CGAL_Boost_support is use whereas Boost_FOUND is false.")
|
||||
return()
|
||||
endif()
|
||||
if(NOT CGAL_Boost_USE_STATIC_LIBS AND CGAL_AUTO_LINK_ENABLED)
|
||||
target_compile_definitions(${target} ${keyword} BOOST_ALL_DYN_LINK=1)
|
||||
endif()
|
||||
target_include_directories(${target} SYSTEM ${keyword} ${Boost_INCLUDE_DIRS})
|
||||
target_link_libraries(${target} ${keyword} ${Boost_LIBRARIES})
|
||||
endfunction()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,150 @@
|
|||
#.rst:
|
||||
# CGAL_SetupCGALDependencies
|
||||
# --------------------------
|
||||
#
|
||||
# The module searchs for the dependencies of the CGAL library:
|
||||
# - the `GMP/MPFR` couple,
|
||||
# - `LEDA` (optional)
|
||||
# - the `Boost` libraries (mostly the header-only libraries)
|
||||
#
|
||||
# and defines the variable :variable:`CGAL_FOUND` and the function
|
||||
# :command:`CGAL_setup_CGAL_dependencies`.
|
||||
#
|
||||
# Module Input Variables
|
||||
# ^^^^^^^^^^^^^^^^^^^^^^
|
||||
# .. variable:: CGAL_DISABLE_GMP
|
||||
#
|
||||
# If set, the `GMP` library will not be used. If
|
||||
# :variable:`WITH_LEDA` is not used either, a efficient exact
|
||||
# number types are used by CGAL kernels for exact computation.
|
||||
#
|
||||
# .. variable:: WITH_LEDA
|
||||
#
|
||||
# If set, the `LEDA` library will be searched and used to provide
|
||||
# the exact number types used by CGAL kernels.
|
||||
#
|
||||
# .. variable:: CGAL_HEADER_ONLY
|
||||
#
|
||||
# Set this variable if you are using the CGAL libraries as
|
||||
# header-only libraries.
|
||||
#
|
||||
if(CGAL_SetupCGALDependencies_included)
|
||||
return()
|
||||
endif()
|
||||
set(CGAL_SetupCGALDependencies_included TRUE)
|
||||
|
||||
#.rst:
|
||||
# Used Modules
|
||||
# ^^^^^^^^^^^^
|
||||
# - :module:`CGAL_SetupGMP`
|
||||
if(NOT CGAL_DISABLE_GMP)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SetupGMP.cmake)
|
||||
endif()
|
||||
|
||||
#.rst:
|
||||
# - :module:`CGAL_SetupLEDA`
|
||||
if(WITH_LEDA)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SetupLEDA.cmake)
|
||||
endif()
|
||||
|
||||
#.rst:
|
||||
# - :module:`CGAL_SetupBoost`
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SetupBoost.cmake)
|
||||
|
||||
#.rst:
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# .. variable:: CGAL_FOUND
|
||||
#
|
||||
# Set to `TRUE` if the dependencies of CGAL were found.
|
||||
if(Boost_FOUND)
|
||||
set(CGAL_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
#.rst:
|
||||
#
|
||||
# Provided Functions
|
||||
# ^^^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# .. command:: CGAL_setup_CGAL_dependencies
|
||||
#
|
||||
# Link the target with the dependencies of CGAL::
|
||||
#
|
||||
# CGAL_setup_CGAL_dependencies( target [INTERFACE] )
|
||||
#
|
||||
# If the option ``INTERFACE`` is passed, the dependencies are
|
||||
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
||||
# keyword, or ``PUBLIC`` otherwise.
|
||||
#
|
||||
function(CGAL_setup_CGAL_dependencies target)
|
||||
if(ARGV1 STREQUAL INTERFACE)
|
||||
set(keyword INTERFACE)
|
||||
else()
|
||||
set(keyword PUBLIC)
|
||||
endif()
|
||||
if(NOT CGAL_DISABLE_GMP)
|
||||
use_CGAL_GMP_support(${target} ${keyword})
|
||||
set(CGAL_USE_GMP TRUE CACHE INTERNAL "CGAL library is configured to use GMP")
|
||||
set(CGAL_USE_MPFR TRUE CACHE INTERNAL "CGAL library is configured to use MPFR")
|
||||
endif()
|
||||
|
||||
if(WITH_LEDA)
|
||||
use_CGAL_LEDA_support(${target} ${keyword})
|
||||
endif()
|
||||
|
||||
if (CGAL_HEADER_ONLY)
|
||||
target_compile_definitions(${target} ${keyword} CGAL_HEADER_ONLY=1)
|
||||
endif()
|
||||
if (RUNNING_CGAL_AUTO_TEST)
|
||||
target_compile_definitions(${target} ${keyword} CGAL_TEST_SUITE=1)
|
||||
endif()
|
||||
|
||||
use_CGAL_Boost_support(${target} ${keyword})
|
||||
|
||||
foreach(dir ${CGAL_INCLUDE_DIRS})
|
||||
target_include_directories(${target} ${keyword}
|
||||
$<BUILD_INTERFACE:${dir}>)
|
||||
endforeach()
|
||||
target_include_directories(${target} ${keyword}
|
||||
$<INSTALL_INTERFACE:include/CGAL>)
|
||||
|
||||
# Now setup compilation flags
|
||||
if(MSVC)
|
||||
target_compile_options(${target} ${keyword}
|
||||
"-D_CRT_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_DEPRECATE;-D_CRT_SECURE_NO_WARNINGS;-D_SCL_SECURE_NO_WARNINGS"
|
||||
"/fp:strict"
|
||||
"/fp:except-"
|
||||
"/wd4503" # Suppress warnings C4503 about "decorated name length exceeded"
|
||||
"/bigobj" # Use /bigobj by default
|
||||
)
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
message( STATUS "Using Intel Compiler. Adding -fp-model strict" )
|
||||
if(WIN32)
|
||||
target_compile_options(${target} ${keyword} "/fp:strict")
|
||||
else()
|
||||
target_compile_options(${target} ${keyword} "-fp-model" "strict")
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
|
||||
message( STATUS "Using SunPro compiler, using STLPort 4." )
|
||||
target_compile_options(${target} ${keyword}
|
||||
"-features=extensions;-library=stlport4;-D_GNU_SOURCE")
|
||||
target_link_libraries(${target} ${keyword} "-library=stlport4")
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
if ( RUNNING_CGAL_AUTO_TEST )
|
||||
target_compile_options(${target} ${keyword} "-Wall")
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3)
|
||||
message( STATUS "Using gcc version 4 or later. Adding -frounding-math" )
|
||||
target_compile_options(${target} ${keyword} "-frounding-math")
|
||||
endif()
|
||||
if ( "${GCC_VERSION}" MATCHES "^4.2" )
|
||||
message( STATUS "Using gcc version 4.2. Adding -fno-strict-aliasing" )
|
||||
target_compile_options(${target} ${keyword} "-fno-strict-aliasing" )
|
||||
endif()
|
||||
if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "alpha" )
|
||||
message( STATUS "Using gcc on alpha. Adding -mieee -mfp-rounding-mode=d" )
|
||||
target_compile_options(${target} ${keyword} "-mieee -mfp-rounding-mode=d" )
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
#.rst:
|
||||
# CGAL_SetupCGAL_CoreDependencies
|
||||
# -------------------------------
|
||||
#
|
||||
# The module searchs for the dependencies of the `CGAL_Core` library:
|
||||
# - the `GMP/MPFR` couple,
|
||||
#
|
||||
# and defines the variable :variable:`CGAL_Core_FOUND` and the function
|
||||
# :command:`CGAL_setup_CGAL_Core_dependencies`.
|
||||
#
|
||||
# Module Input Variables
|
||||
# ^^^^^^^^^^^^^^^^^^^^^^
|
||||
# - :variable:`CGAL_DISABLE_GMP`
|
||||
|
||||
if(CGAL_SetupCGAL_CoreDependencies_included)
|
||||
return()
|
||||
endif()
|
||||
set(CGAL_SetupCGAL_CoreDependencies_included TRUE)
|
||||
|
||||
#.rst:
|
||||
# Used Modules
|
||||
# ^^^^^^^^^^^^
|
||||
# - :module:`CGAL_SetupGMP`
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# .. variable:: CGAL_Core_FOUND
|
||||
#
|
||||
# Set to `TRUE` if the dependencies of `CGAL_Core` were found.
|
||||
|
||||
if(NOT CGAL_DISABLE_GMP)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SetupGMP.cmake)
|
||||
if(GMP_FOUND)
|
||||
set(CGAL_Core_FOUND TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#.rst:
|
||||
#
|
||||
# Provided Functions
|
||||
# ^^^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# .. command:: CGAL_setup_CGAL_Core_dependencies
|
||||
#
|
||||
# Link the target with the dependencies of `CGAL_Core`::
|
||||
#
|
||||
# CGAL_setup_CGAL_Core_dependencies( target [INTERFACE] )
|
||||
#
|
||||
# If the option ``INTERFACE`` is passed, the dependencies are
|
||||
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
||||
# keyword, or ``PUBLIC`` otherwise.
|
||||
#
|
||||
|
||||
# See the release notes of CGAL-4.10: CGAL_Core now requires
|
||||
# Boost.Thread, with all compilers but MSVC.
|
||||
if (NOT MSVC)
|
||||
find_package( Boost 1.48 REQUIRED thread system )
|
||||
endif()
|
||||
|
||||
function(CGAL_setup_CGAL_Core_dependencies target)
|
||||
if(ARGV1 STREQUAL INTERFACE)
|
||||
set(keyword INTERFACE)
|
||||
else()
|
||||
set(keyword PUBLIC)
|
||||
endif()
|
||||
use_CGAL_GMP_support(CGAL_Core ${keyword})
|
||||
target_compile_definitions(${target} ${keyword} CGAL_USE_CORE=1)
|
||||
target_link_libraries( CGAL_Core ${keyword} CGAL::CGAL ${Boost_LIBRARIES})
|
||||
endfunction()
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
#.rst:
|
||||
# CGAL_SetupCGAL_ImageIODependencies
|
||||
# ----------------------------------
|
||||
#
|
||||
# The module searchs for the dependencies of the `CGAL_ImageIO` library:
|
||||
# - the `Zlib` library (optional)
|
||||
#
|
||||
# by calling
|
||||
#
|
||||
# .. code-block:: cmake
|
||||
#
|
||||
# find_package(ZLIB)
|
||||
#
|
||||
# and defines the variable :variable:`CGAL_ImageIO_FOUND` and the function
|
||||
# :command:`CGAL_setup_CGAL_ImageIO_dependencies`.
|
||||
#
|
||||
if(CGAL_SetupCGAL_ImageIODependencies_included)
|
||||
return()
|
||||
endif()
|
||||
set(CGAL_SetupCGAL_ImageIODependencies_included TRUE)
|
||||
|
||||
#.rst:
|
||||
# Used Modules
|
||||
# ^^^^^^^^^^^^
|
||||
# - :module:`FindZLIB`
|
||||
find_package( ZLIB )
|
||||
|
||||
define_property(TARGET PROPERTY CGAL_TARGET_USES_ZLIB
|
||||
BRIEF_DOCS "Tells if the target uses ZLIB as a dependency"
|
||||
FULL_DOCS "Tells if the target uses ZLIB as a dependency")
|
||||
|
||||
#.rst:
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# .. variable:: CGAL_ImageIO_USE_ZLIB
|
||||
#
|
||||
# Set to `TRUE` if `CGAL_ImageIO` was compiled with `Zlib`.
|
||||
#
|
||||
# .. variable:: CGAL_ImageIO_FOUND
|
||||
#
|
||||
# Always set to `TRUE`.
|
||||
|
||||
if(ZLIB_FOUND)
|
||||
set(CGAL_ImageIO_USE_ZLIB ON CACHE BOOL "CGAL_ImageIO uses ZLIB")
|
||||
endif(ZLIB_FOUND)
|
||||
|
||||
set( CGAL_ImageIO_BASENAME CGAL_ImageIO)
|
||||
|
||||
set(CGAL_ImageIO_FOUND TRUE)
|
||||
|
||||
function(CGAL_setup_CGAL_ImageIO_dependencies target)
|
||||
if(ARGV1 STREQUAL INTERFACE)
|
||||
set(keyword INTERFACE)
|
||||
else()
|
||||
set(keyword PUBLIC)
|
||||
endif()
|
||||
|
||||
target_link_libraries( CGAL_ImageIO ${keyword} CGAL::CGAL)
|
||||
|
||||
if(ZLIB_FOUND)
|
||||
target_include_directories( CGAL_ImageIO SYSTEM ${keyword} ${ZLIB_INCLUDE_DIRS})
|
||||
target_link_libraries( CGAL_ImageIO ${keyword} ${ZLIB_LIBRARIES})
|
||||
|
||||
target_compile_definitions( CGAL_ImageIO ${keyword} CGAL_USE_ZLIB=1)
|
||||
if(NOT ARGV1 STREQUAL INTERFACE)
|
||||
set_target_properties(CGAL_ImageIO PROPERTIES CGAL_TARGET_USES_ZLIB TRUE)
|
||||
endif()
|
||||
else()
|
||||
message( STATUS "NOTICE: libCGAL_ImageIO needs ZLib to read compressed files. That feature will not be activated.")
|
||||
endif()
|
||||
endfunction()
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
#.rst:
|
||||
# CGAL_SetupCGAL_Qt5Dependencies
|
||||
# ------------------------------
|
||||
#
|
||||
# The module searchs for the dependencies of the `CGAL_Qt5` library:
|
||||
# - the `Qt5` libraries
|
||||
#
|
||||
# by calling
|
||||
#
|
||||
# .. code-block:: cmake
|
||||
#
|
||||
# find_package(Qt5 QUIET COMPONENTS OpenGL Svg)
|
||||
#
|
||||
# and defines the variable :variable:`CGAL_Qt5_FOUND` and the function
|
||||
# :command:`CGAL_setup_CGAL_Qt5_dependencies`.
|
||||
#
|
||||
|
||||
if(CGAL_SetupCGAL_Qt5Dependencies_included)
|
||||
return()
|
||||
endif()
|
||||
set(CGAL_SetupCGAL_Qt5Dependencies_included TRUE)
|
||||
|
||||
#.rst:
|
||||
# Used Modules
|
||||
# ^^^^^^^^^^^^
|
||||
# - :module:`Qt5Config`
|
||||
find_package(Qt5 QUIET COMPONENTS OpenGL Svg)
|
||||
|
||||
set(CGAL_Qt5_MISSING_DEPS "")
|
||||
if(NOT Qt5OpenGL_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "Qt5OpenGL")
|
||||
endif()
|
||||
if(NOT Qt5Svg_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5Svg")
|
||||
endif()
|
||||
if(NOT Qt5_FOUND)
|
||||
set(CGAL_Qt5_MISSING_DEPS "${CGAL_Qt5_MISSING_DEPS} Qt5")
|
||||
endif()
|
||||
|
||||
|
||||
#.rst:
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# .. variable:: CGAL_Qt5_FOUND
|
||||
#
|
||||
# Set to `TRUE` if the dependencies of `CGAL_Qt5` were found.
|
||||
#
|
||||
if(NOT CGAL_Qt5_MISSING_DEPS)
|
||||
set(CGAL_Qt5_FOUND TRUE)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Qt5_moc_and_resource_files.cmake)
|
||||
|
||||
if(NOT TARGET CGAL_Qt5_moc_and_resources)
|
||||
add_library(CGAL_Qt5_moc_and_resources STATIC ${_CGAL_Qt5_MOC_FILES_private} ${_CGAL_Qt5_RESOURCE_FILES_private})
|
||||
set_target_properties(CGAL_Qt5_moc_and_resources PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE TRUE
|
||||
EXCLUDE_FROM_ALL TRUE)
|
||||
target_link_libraries(CGAL_Qt5_moc_and_resources CGAL::CGAL Qt5::Widgets Qt5::OpenGL Qt5::Svg)
|
||||
|
||||
add_library(CGAL::CGAL_Qt5_moc_and_resources ALIAS CGAL_Qt5_moc_and_resources)
|
||||
add_library(CGAL::Qt5_moc_and_resources ALIAS CGAL_Qt5_moc_and_resources)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
#get_property(QT_UIC_EXECUTABLE TARGET Qt5::uic PROPERTY LOCATION)
|
||||
#message( STATUS "Qt5Core include: ${Qt5Core_INCLUDE_DIRS}" )
|
||||
#message( STATUS "Qt5 libraries: ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Svg_LIBRARIES} ${Qt5OpenGL_LIBRARIES}" )
|
||||
#message( STATUS "Qt5Core definitions: ${Qt5Core_DEFINITIONS}" )
|
||||
#message( STATUS "moc executable: ${QT_MOC_EXECUTABLE}" )
|
||||
#message( STATUS "uic executable: ${QT_UIC_EXECUTABLE}" )
|
||||
|
||||
#.rst:
|
||||
#
|
||||
# Provided Functions
|
||||
# ^^^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# .. command:: CGAL_setup_CGAL_Qt5_dependencies
|
||||
#
|
||||
# Link the target with the dependencies of `CGAL_Qt5`::
|
||||
#
|
||||
# CGAL_setup_CGAL_Qt5_dependencies( target [INTERFACE] )
|
||||
#
|
||||
# If the option ``INTERFACE`` is passed, the dependencies are
|
||||
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
||||
# keyword, or ``PUBLIC`` otherwise.
|
||||
#
|
||||
function(CGAL_setup_CGAL_Qt5_dependencies target)
|
||||
if(ARGV1 STREQUAL INTERFACE)
|
||||
set(keyword INTERFACE)
|
||||
else()
|
||||
set(keyword PUBLIC)
|
||||
endif()
|
||||
|
||||
if($ENV{CGAL_FAKE_PUBLIC_RELEASE})
|
||||
target_compile_definitions( ${target} ${keyword} CGAL_FAKE_PUBLIC_RELEASE=1 )
|
||||
endif()
|
||||
target_link_libraries( ${target} ${keyword} CGAL::CGAL)
|
||||
if(CGAL_HEADER_ONLY)
|
||||
target_link_libraries( ${target} ${keyword} CGAL::Qt5_moc_and_resources)
|
||||
endif()
|
||||
target_link_libraries( ${target} ${keyword} Qt5::OpenGL Qt5::Svg)
|
||||
endfunction()
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
include(CGAL_Macros)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake)
|
||||
|
||||
message ( STATUS "External libraries supported: ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES}")
|
||||
|
||||
|
|
@ -82,4 +82,4 @@ if( NOT GMP_FOUND )
|
|||
endif( NOT GMP_FOUND )
|
||||
|
||||
# finally setup Boost
|
||||
include(CGAL_SetupBoost)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SetupBoost.cmake)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
#.rst:
|
||||
# CGAL_SetupGMP
|
||||
# -------------
|
||||
#
|
||||
# The module searchs for the `GMP` and `MPFR` headers and libraries,
|
||||
# by calling
|
||||
#
|
||||
# .. code-block:: cmake
|
||||
#
|
||||
# find_package(GMP)
|
||||
# find_package(MPFR)
|
||||
#
|
||||
# and defines the function :command:`use_CGAL_GMP_support`.
|
||||
|
||||
if(CGAL_SetupGMP_included OR CGAL_DISABLE_GMP)
|
||||
return()
|
||||
endif()
|
||||
set(CGAL_SetupGMP_included TRUE)
|
||||
|
||||
find_package(GMP)
|
||||
find_package(MPFR)
|
||||
|
||||
#.rst:
|
||||
# Provided Functions
|
||||
# ^^^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# .. command:: use_CGAL_GMP_support
|
||||
#
|
||||
# Link the target with the `GMP` and `MPFR` libraries::
|
||||
#
|
||||
# use_CGAL_GMP_support( target [INTERFACE] )
|
||||
#
|
||||
# If the option ``INTERFACE`` is passed, the dependencies are
|
||||
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
||||
# keyword, or ``PUBLIC`` otherwise.
|
||||
|
||||
function(use_CGAL_GMP_support target)
|
||||
if(ARGV1 STREQUAL INTERFACE)
|
||||
set(keyword INTERFACE)
|
||||
else()
|
||||
set(keyword PUBLIC)
|
||||
endif()
|
||||
if(NOT GMP_FOUND OR NOT MPFR_FOUND)
|
||||
message(FATAL_ERROR "CGAL requires GMP and MPFR.")
|
||||
return()
|
||||
endif()
|
||||
|
||||
target_include_directories(${target} SYSTEM ${keyword} ${GMP_INCLUDE_DIR} ${MPFR_INCLUDE_DIR})
|
||||
target_link_libraries(${target} ${keyword} ${GMP_LIBRARIES} ${MPFR_LIBRARIES})
|
||||
endfunction()
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
#.rst:
|
||||
# CGAL_SetupLEDA
|
||||
# --------------
|
||||
#
|
||||
# The module searchs for the `LEDA` headers and library, by calling
|
||||
#
|
||||
# .. code-block:: cmake
|
||||
#
|
||||
# find_package(LEDA)
|
||||
#
|
||||
# and defines the function :command:`use_CGAL_LEDA_support`.
|
||||
|
||||
if(CGAL_SetupLEDA_included)
|
||||
return()
|
||||
endif()
|
||||
set(CGAL_SetupLEDA_included TRUE)
|
||||
|
||||
find_package(LEDA)
|
||||
|
||||
#.rst:
|
||||
# Provided Functions
|
||||
# ^^^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# .. command:: use_CGAL_LEDA_support
|
||||
#
|
||||
# Link the target with the `LEDA` libraries::
|
||||
#
|
||||
# use_CGAL_LEDA_support( target [INTERFACE] )
|
||||
#
|
||||
# If the option ``INTERFACE`` is passed, the dependencies are
|
||||
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
||||
# keyword, or ``PUBLIC`` otherwise.
|
||||
|
||||
function(use_CGAL_LEDA_support target)
|
||||
if(ARGV1 STREQUAL INTERFACE)
|
||||
set(keyword INTERFACE)
|
||||
else()
|
||||
set(keyword PUBLIC)
|
||||
endif()
|
||||
if(NOT LEDA_FOUND)
|
||||
message(FATAL_ERROR "use_CGAL_LEDA_support is use whereas LEDA_FOUND is false.")
|
||||
return()
|
||||
endif()
|
||||
target_compile_options(${target} ${keyword} ${LEDA_CXX_FLAGS} ${LEDA_DEFINITIONS})
|
||||
target_include_directories(${target} SYSTEM ${keyword} ${LEDA_INCLUDE_DIR})
|
||||
target_link_libraries(${target} ${keyword} ${LEDA_LIBRARIES} ${LEDA_LINKER_FLAGS})
|
||||
endfunction()
|
||||
|
|
@ -52,10 +52,9 @@ if( NOT CGAL_TweakFindBoost )
|
|||
# One must add -DBOOST_ALL_DYN_LINK to DEFINITIONS to use Boost
|
||||
# auto-link with shared libraries.
|
||||
|
||||
# First, add the variable to cache, if it was loaded from CGALConfig.cmake
|
||||
cache_set(CGAL_3RD_PARTY_DEFINITIONS "${CGAL_3RD_PARTY_DEFINITIONS}")
|
||||
# Then amend it
|
||||
add_to_cached_list(CGAL_3RD_PARTY_DEFINITIONS -DBOOST_ALL_DYN_LINK)
|
||||
list(APPEND CGAL_3RD_PARTY_DEFINITIONS -DBOOST_ALL_DYN_LINK)
|
||||
set(CGAL_3RD_PARTY_DEFINITIONS "${CGAL_3RD_PARTY_DEFINITIONS}"
|
||||
CACHE INTERNAL "3rd party definitions for CGAL")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ if( RS_FOUND AND NOT RS_SETUP )
|
|||
message( STATUS "RS libraries: ${RS_LIBRARIES}" )
|
||||
|
||||
if( APPLE AND CMAKE_COMPILER_IS_GNUCXX )
|
||||
include( CGAL_VersionUtils )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/CGAL_VersionUtils.cmake )
|
||||
EXEC_PROGRAM( ${CMAKE_CXX_COMPILER}
|
||||
ARGS -dumpversion
|
||||
OUTPUT_VARIABLE RS_GXX_VERSION )
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
if( RS3_FOUND AND NOT RS3_SETUP )
|
||||
|
||||
include( CGAL_UseRS )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/CGAL_UseRS.cmake )
|
||||
|
||||
# add rs3 parameters, if necessary (rs3 must be always after rsexport)
|
||||
message( STATUS "UseRS3" )
|
||||
|
|
@ -40,7 +40,7 @@ if( RS3_FOUND AND NOT RS3_SETUP )
|
|||
message( STATUS "Using old RS signatures" )
|
||||
endif( RS3_OLD_INCLUDES )
|
||||
|
||||
include(CGAL_UseMPFI)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_UseMPFI.cmake)
|
||||
|
||||
set (RS3_SETUP TRUE)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,26 @@ if(CGAL_add_test_included)
|
|||
endif(CGAL_add_test_included)
|
||||
set(CGAL_add_test_included TRUE)
|
||||
|
||||
if(POLICY CMP0064)
|
||||
cmake_policy(SET CMP0064 NEW)
|
||||
if(NOT POLICY CMP0064)
|
||||
# CMake <= 3.3
|
||||
if(BUILD_TESTING)
|
||||
message(WARNING
|
||||
"CGAL CTest support requires CMake 3.4 or later.\n"
|
||||
"You must either disable BUILD_TESTING or upgrade CMake.")
|
||||
endif()
|
||||
|
||||
# Add a fake function to avoid CMake errors
|
||||
function(cgal_add_compilation_test)
|
||||
endfunction()
|
||||
|
||||
# Then return, to exit the file
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(CTest)
|
||||
|
||||
cmake_policy(SET CMP0064 NEW)
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
option(CGAL_CTEST_DISPLAY_MEM_AND_TIME
|
||||
|
|
@ -19,6 +35,11 @@ if(CGAL_CTEST_DISPLAY_MEM_AND_TIME)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
set(ANDROID_DIR_PREFIX /data/local/tmp/)
|
||||
find_program(adb_executable adb)
|
||||
endif()
|
||||
|
||||
# Process a list, and replace items contains a file pattern (like
|
||||
# `*.off`) by the sublist that corresponds to the globbing of the
|
||||
# pattern in the directory `${CGAL_CURRENT_SOURCE_DIR}`.
|
||||
|
|
@ -61,7 +82,7 @@ function(expand_list_with_globbing list_name)
|
|||
endfunction()
|
||||
|
||||
function(cgal_add_compilation_test exe_name)
|
||||
if(TEST compilation_of__${exe_name})
|
||||
if(NOT POLICY CMP0064 OR TEST compilation_of__${exe_name})
|
||||
return()
|
||||
endif()
|
||||
add_test(NAME "compilation_of__${exe_name}"
|
||||
|
|
@ -78,7 +99,7 @@ function(cgal_setup_test_properties test_name)
|
|||
APPEND PROPERTY LABELS "${PROJECT_NAME}")
|
||||
# message(STATUS " working dir: ${CGAL_CURRENT_SOURCE_DIR}")
|
||||
set_property(TEST "${test_name}"
|
||||
PROPERTY WORKING_DIRECTORY ${CGAL_CURRENT_SOURCE_DIR})
|
||||
PROPERTY WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
if(exe_name)
|
||||
set_property(TEST "${test_name}"
|
||||
APPEND PROPERTY DEPENDS "compilation_of__${exe_name}")
|
||||
|
|
@ -86,20 +107,47 @@ function(cgal_setup_test_properties test_name)
|
|||
|
||||
if(POLICY CMP0066) # CMake 3.7 or later
|
||||
if(NOT TEST ${PROJECT_NAME}_SetupFixture)
|
||||
add_test(NAME ${PROJECT_NAME}_SetupFixture
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/__exec_test_dir
|
||||
)
|
||||
if(ANDROID)
|
||||
add_test(NAME ${PROJECT_NAME}_SetupFixture
|
||||
COMMAND
|
||||
${adb_executable} push
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${ANDROID_DIR_PREFIX}${PROJECT_NAME}
|
||||
)
|
||||
add_test(NAME ${PROJECT_NAME}_copy_GMP_MPFR
|
||||
COMMAND
|
||||
${adb_executable} push
|
||||
${GMP_LIBRARIES} ${MPFR_LIBRARIES}
|
||||
${ANDROID_DIR_PREFIX}${PROJECT_NAME}
|
||||
)
|
||||
set_property(TEST ${PROJECT_NAME}_copy_GMP_MPFR
|
||||
APPEND PROPERTY DEPENDS ${PROJECT_NAME}_SetupFixture)
|
||||
set_property(TEST ${PROJECT_NAME}_copy_GMP_MPFR
|
||||
PROPERTY FIXTURES_SETUP ${PROJECT_NAME})
|
||||
else()
|
||||
add_test(NAME ${PROJECT_NAME}_SetupFixture
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/__exec_test_dir
|
||||
)
|
||||
endif()
|
||||
set_property(TEST ${PROJECT_NAME}_SetupFixture
|
||||
PROPERTY FIXTURES_SETUP ${PROJECT_NAME})
|
||||
|
||||
add_test(NAME ${PROJECT_NAME}_CleanupFixture
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E remove_directory
|
||||
${CMAKE_CURRENT_BINARY_DIR}/__exec_test_dir
|
||||
)
|
||||
if(ANDROID)
|
||||
add_test(NAME ${PROJECT_NAME}_CleanupFixture
|
||||
COMMAND
|
||||
${adb_executable} shell rm -rf
|
||||
${ANDROID_DIR_PREFIX}${PROJECT_NAME}
|
||||
)
|
||||
else()
|
||||
add_test(NAME ${PROJECT_NAME}_CleanupFixture
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E remove_directory
|
||||
${CMAKE_CURRENT_BINARY_DIR}/__exec_test_dir
|
||||
)
|
||||
endif()
|
||||
set_property(TEST ${PROJECT_NAME}_CleanupFixture
|
||||
PROPERTY FIXTURES_CLEANUP ${PROJECT_NAME})
|
||||
|
||||
|
|
@ -107,15 +155,26 @@ function(cgal_setup_test_properties test_name)
|
|||
${PROJECT_NAME}_CleanupFixture ${PROJECT_NAME}_SetupFixture
|
||||
APPEND PROPERTY LABELS "${PROJECT_NAME}")
|
||||
endif()
|
||||
set_tests_properties("${test_name}"
|
||||
PROPERTIES
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/__exec_test_dir
|
||||
FIXTURES_REQUIRED "${PROJECT_NAME}")
|
||||
if(NOT ANDROID)
|
||||
set_property(TEST "${test_name}"
|
||||
PROPERTY
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/__exec_test_dir)
|
||||
endif()
|
||||
set_property(TEST "${test_name}"
|
||||
APPEND PROPERTY FIXTURES_REQUIRED "${PROJECT_NAME}")
|
||||
if(exe_name)
|
||||
set_property(TEST ${test_name}
|
||||
APPEND PROPERTY FIXTURES_REQUIRED "${exe_name}")
|
||||
set_property(TEST "compilation_of__${exe_name}"
|
||||
PROPERTY FIXTURES_SETUP "${exe_name}")
|
||||
if(ANDROID)
|
||||
add_test(NAME "push_of__${exe_name}"
|
||||
COMMAND ${adb_executable} push $<TARGET_FILE:${exe_name}> ${ANDROID_DIR_PREFIX}${PROJECT_NAME}/${exe_name})
|
||||
set_property(TEST "push_of__${exe_name}"
|
||||
APPEND PROPERTY FIXTURES_SETUP "${exe_name}")
|
||||
set_property(TEST "push_of__${exe_name}"
|
||||
APPEND PROPERTY DEPENDS "compilation_of__${exe_name}")
|
||||
endif()
|
||||
endif()
|
||||
endif() # end CMake 3.7 or later
|
||||
endfunction(cgal_setup_test_properties)
|
||||
|
|
@ -124,7 +183,7 @@ function(cgal_add_test exe_name)
|
|||
cgal_add_compilation_test(${exe_name})
|
||||
|
||||
cmake_parse_arguments("cgal_add_test" # prefix
|
||||
"" # optional arguments
|
||||
"NO_EXECUTION" # optional arguments
|
||||
"TEST_NAME" # single arguments
|
||||
"ARGUMENTS" # multivalue arguments
|
||||
${ARGN})
|
||||
|
|
@ -135,7 +194,7 @@ function(cgal_add_test exe_name)
|
|||
set(test_name "execution___of__${exe_name}")
|
||||
endif()
|
||||
# message(" test_name: ${test_name}")
|
||||
if(TEST ${test_name})
|
||||
if(cgal_add_test_NO_EXECUTION OR NOT POLICY CMP0064 OR TEST ${test_name})
|
||||
return()
|
||||
endif()
|
||||
# message("Add test ${test_name}")
|
||||
|
|
@ -145,7 +204,11 @@ function(cgal_add_test exe_name)
|
|||
COMMAND ${TIME_COMMAND} ${CMAKE_COMMAND}
|
||||
-DCMD:STRING=$<TARGET_FILE:${exe_name}>
|
||||
-DCIN:STRING=${cin_file}
|
||||
-DANDROID_DIR_PREFIX=${ANDROID_DIR_PREFIX}
|
||||
-DPROJECT_NAME=${PROJECT_NAME}
|
||||
-P "${CGAL_MODULES_DIR}/run_test_with_cin.cmake")
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${cin_file})
|
||||
# message(STATUS "add test: ${exe_name} < ${cin_file}")
|
||||
else()
|
||||
if(NOT ARGS AND NOT cgal_add_test_TEST_NAME)
|
||||
|
|
@ -168,10 +231,16 @@ function(cgal_add_test exe_name)
|
|||
list(APPEND ARGS ${CMD_LINE_ARGS})
|
||||
endforeach()
|
||||
expand_list_with_globbing(ARGS)
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${cmd_file})
|
||||
endif()
|
||||
endif()
|
||||
# message(STATUS "add test: ${exe_name} ${ARGS}")
|
||||
add_test(NAME ${test_name} COMMAND ${TIME_COMMAND} $<TARGET_FILE:${exe_name}> ${ARGS})
|
||||
if(ANDROID)
|
||||
add_test(NAME ${test_name} COMMAND ${TIME_COMMAND} ${adb_executable} shell cd ${ANDROID_DIR_PREFIX}${PROJECT_NAME} && LD_LIBRARY_PATH=${ANDROID_DIR_PREFIX}${PROJECT_NAME} ${ANDROID_DIR_PREFIX}${PROJECT_NAME}/${exe_name} ${ARGS})
|
||||
else()
|
||||
add_test(NAME ${test_name} COMMAND ${TIME_COMMAND} $<TARGET_FILE:${exe_name}> ${ARGS})
|
||||
endif()
|
||||
endif()
|
||||
cgal_setup_test_properties(${test_name} ${exe_name})
|
||||
return()
|
||||
|
|
@ -197,3 +266,6 @@ function(cgal_add_test exe_name)
|
|||
set_property(TEST "${test_name}"
|
||||
APPEND PROPERTY LABELS "${PROJECT_NAME}")
|
||||
endfunction()
|
||||
|
||||
function(CGAL_add_compilation_tests_for_all_targets)
|
||||
endfunction()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
if(CMAKE_CONFIGURATION_TYPES)
|
||||
# Multi-configuration CMake generator,
|
||||
message( STATUS "Multi-configuration CMake generator: cannot display flags" )
|
||||
return()
|
||||
endif()
|
||||
|
||||
message( STATUS "Build type: ${CMAKE_BUILD_TYPE}" )
|
||||
|
||||
string( TOUPPER "${CMAKE_BUILD_TYPE}" CGAL_BUILD_TYPE_UPPER )
|
||||
|
||||
message( STATUS "USING CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
|
||||
if ( CGAL_BUILDING_LIBS )
|
||||
if ( BUILD_SHARED_LIBS )
|
||||
message( STATUS "USING LDFLAGS = '${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
else()
|
||||
message( STATUS "USING LDFLAGS = '${CMAKE_STATIC_LINKER_FLAGS} ${CMAKE_STATIC_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
endif()
|
||||
else()
|
||||
message( STATUS "USING EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CGAL_BUILD_TYPE_UPPER}}'" )
|
||||
endif()
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
function(CGAL_setup_target_dependencies target)
|
||||
if(ARGV1 STREQUAL INTERFACE)
|
||||
set(keyword INTERFACE)
|
||||
else()
|
||||
set(keyword PUBLIC)
|
||||
endif()
|
||||
|
||||
if(${target} STREQUAL CGAL)
|
||||
CGAL_setup_CGAL_dependencies(${target} ${keyword})
|
||||
elseif(${target} STREQUAL CGAL_Core)
|
||||
CGAL_setup_CGAL_Core_dependencies(${target} ${keyword})
|
||||
elseif(${target} STREQUAL CGAL_ImageIO)
|
||||
CGAL_setup_CGAL_ImageIO_dependencies(${target} ${keyword})
|
||||
elseif(${target} STREQUAL CGAL_Qt5)
|
||||
CGAL_setup_CGAL_Qt5_dependencies(${target} ${keyword})
|
||||
endif()
|
||||
endfunction()
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
if (CGAL_target_use_TBB_included)
|
||||
return()
|
||||
endif()
|
||||
set(CGAL_target_use_TBB_included TRUE)
|
||||
|
||||
function(CGAL_target_use_TBB target)
|
||||
target_include_directories ( ${target} SYSTEM PRIVATE ${TBB_INCLUDE_DIRS} )
|
||||
target_link_libraries( ${target} PRIVATE ${TBB_LIBRARIES} )
|
||||
target_compile_options( ${target} PRIVATE -DNOMINMAX -DCGAL_LINKED_WITH_TBB )
|
||||
endfunction()
|
||||
|
|
@ -32,8 +32,8 @@
|
|||
|
||||
include(CheckFunctionExists)
|
||||
|
||||
include(CGAL_GeneratorSpecificSettings)
|
||||
include(CGAL_Macros)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake)
|
||||
|
||||
|
||||
# This macro checks for the existence of the combination of fortran libraries
|
||||
|
|
@ -161,7 +161,7 @@ else()
|
|||
|
||||
# Look first for the TAUCS library distributed with CGAL in auxiliary/taucs.
|
||||
# Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR.
|
||||
include(CGAL_Locate_CGAL_TAUCS)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake)
|
||||
|
||||
# Search for BLAS in CGAL_TAUCS_INCLUDE_DIR/CGAL_TAUCS_LIBRARIES_DIR (TAUCS shipped with CGAL)...
|
||||
if(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ else(F2C_LIBRARIES)
|
|||
|
||||
# F2C shipped with CGAL (as part of TAUCS)?
|
||||
# If found, we will search for f2c library in ${CGAL_TAUCS_LIBRARIES_DIR}.
|
||||
include(CGAL_Locate_CGAL_TAUCS)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake)
|
||||
|
||||
find_library(F2C_LIBRARIES NAMES f2c g2c vcf2c
|
||||
PATHS ${CGAL_TAUCS_LIBRARIES_DIR}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
# TODO: support MacOSX
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include(CGAL_GeneratorSpecificSettings)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake)
|
||||
|
||||
if(GMP_INCLUDE_DIR)
|
||||
set(GMP_in_cache TRUE)
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@
|
|||
|
||||
include(CheckFunctionExists)
|
||||
|
||||
include(CGAL_GeneratorSpecificSettings)
|
||||
include(CGAL_Macros)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake)
|
||||
|
||||
|
||||
# This macro checks for the existence of the combination of fortran libraries
|
||||
|
|
@ -172,7 +172,7 @@ else()
|
|||
|
||||
# Look first for the TAUCS library distributed with CGAL in auxiliary/taucs.
|
||||
# Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR.
|
||||
include(CGAL_Locate_CGAL_TAUCS)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake)
|
||||
|
||||
# Search for LAPACK in CGAL_TAUCS_INCLUDE_DIR/CGAL_TAUCS_LIBRARIES_DIR (TAUCS shipped with CGAL)...
|
||||
if(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED)
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@
|
|||
|
||||
include(CheckFunctionExists)
|
||||
|
||||
include(CGAL_GeneratorSpecificSettings)
|
||||
include(CGAL_Macros)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake)
|
||||
|
||||
|
||||
# This macro checks for the existence of the combination of fortran libraries
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
# TODO: support MacOSX
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include(CGAL_GeneratorSpecificSettings)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake)
|
||||
|
||||
if(MPFR_INCLUDE_DIR)
|
||||
set(MPFR_in_cache TRUE)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ if( (TARGET CGAL AND NOT WITH_GMP) OR NOT GMP_FOUND )
|
|||
|
||||
else( (TARGET CGAL AND NOT WITH_GMP) OR NOT GMP_FOUND )
|
||||
|
||||
include( CGAL_VersionUtils )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/CGAL_VersionUtils.cmake )
|
||||
|
||||
get_dependency_version( GMP )
|
||||
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
if ( NOT FIND_OPENGL_WRAPPER )
|
||||
|
||||
set ( FIND_OPENGL_WRAPPER 1 )
|
||||
|
||||
set(SAVED_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} )
|
||||
|
||||
set(CMAKE_MODULE_PATH ${ORIG_CMAKE_MODULE_PATH} )
|
||||
|
||||
find_package(OpenGL)
|
||||
|
||||
if ( OPENGL_FOUND AND CGAL_APPLE_LEOPARD )
|
||||
|
||||
if ( BUILD_SHARED_LIBS )
|
||||
|
||||
uniquely_add_flags( CMAKE_SHARED_LINKER_FLAGS
|
||||
"-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
|
||||
)
|
||||
|
||||
else()
|
||||
|
||||
uniquely_add_flags( CMAKE_MODULE_LINKER_FLAGS
|
||||
"-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
endif()
|
||||
|
||||
set(CMAKE_MODULE_PATH ${SAVED_CMAKE_MODULE_PATH} )
|
||||
|
||||
endif()
|
||||
|
|
@ -6,6 +6,12 @@
|
|||
# QGLVIEWER_LIBRARIES - Link these to use QGLViewer
|
||||
# QGLVIEWER_DEFINITIONS - Compiler switches required for using QGLViewer
|
||||
#
|
||||
if(POLICY CMP0072)
|
||||
# About the use of OpenGL
|
||||
cmake_policy(SET CMP0072 NEW)
|
||||
endif()
|
||||
find_package(OpenGL QUIET)
|
||||
find_package(Qt5 QUIET COMPONENTS OpenGL Xml)
|
||||
|
||||
# first look in user defined locations
|
||||
find_path(QGLVIEWER_INCLUDE_DIR
|
||||
|
|
@ -50,9 +56,9 @@ endif()
|
|||
|
||||
if(QGLVIEWER_LIBRARY_RELEASE)
|
||||
if(QGLVIEWER_LIBRARY_DEBUG)
|
||||
set(QGLVIEWER_LIBRARIES_ optimized ${QGLVIEWER_LIBRARY_RELEASE} debug ${QGLVIEWER_LIBRARY_DEBUG})
|
||||
set(QGLVIEWER_LIBRARIES_ Qt5::Xml Qt5::OpenGL ${OPENGL_LIBRARIES} optimized ${QGLVIEWER_LIBRARY_RELEASE} debug ${QGLVIEWER_LIBRARY_DEBUG})
|
||||
else()
|
||||
set(QGLVIEWER_LIBRARIES_ ${QGLVIEWER_LIBRARY_RELEASE})
|
||||
set(QGLVIEWER_LIBRARIES_ Qt5::Xml Qt5::OpenGL ${OPENGL_LIBRARIES} ${QGLVIEWER_LIBRARY_RELEASE})
|
||||
endif()
|
||||
|
||||
set(QGLVIEWER_LIBRARIES ${QGLVIEWER_LIBRARIES_} CACHE FILEPATH "The QGLViewer library")
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ endif()
|
|||
|
||||
if( MPFI_FOUND )
|
||||
|
||||
include( CGAL_VersionUtils )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/CGAL_VersionUtils.cmake )
|
||||
|
||||
find_path(RS_INCLUDE_DIR
|
||||
NAMES rs_exports.h
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ if ( RS_FOUND )
|
|||
|
||||
if( MPFI_FOUND )
|
||||
|
||||
include( CGAL_VersionUtils )
|
||||
include( ${CMAKE_CURRENT_LIST_DIR}/CGAL_VersionUtils.cmake )
|
||||
|
||||
find_path(RS3_INCLUDE_DIR
|
||||
NAMES rs3_fncts.h
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
# TAUCS_USE_FILE - The name of the cmake module to include to compile
|
||||
# applications or libraries using TAUCS.
|
||||
|
||||
include(CGAL_GeneratorSpecificSettings)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake)
|
||||
|
||||
# TAUCS requires LAPACK
|
||||
if(TAUCS_FIND_QUIETLY OR NOT TAUCS_FIND_REQUIRED)
|
||||
|
|
@ -43,7 +43,7 @@ else()
|
|||
|
||||
# Look first for the TAUCS library distributed with CGAL in auxiliary/taucs.
|
||||
# Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR.
|
||||
include(CGAL_Locate_CGAL_TAUCS)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake)
|
||||
|
||||
# Search for TAUCS headers in ${CGAL_TAUCS_INCLUDE_DIR} (TAUCS shipped with CGAL),
|
||||
# else in $TAUCS_INC_DIR environment variable.
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ if (TBB_FOUND)
|
|||
endif (TBB_FOUND)
|
||||
|
||||
set(TBB_USE_FILE "UseTBB")
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_TBB.cmake)
|
||||
### ** Emacs settings **
|
||||
### Local Variables:
|
||||
### cmake-tab-width: 4
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
.. cmake-module:: ../CGAL_SetupBoost.cmake
|
||||
|
|
@ -0,0 +1 @@
|
|||
.. cmake-module:: ../CGAL_SetupCGALDependencies.cmake
|
||||
|
|
@ -0,0 +1 @@
|
|||
.. cmake-module:: ../CGAL_SetupCGAL_CoreDependencies.cmake
|
||||
|
|
@ -0,0 +1 @@
|
|||
.. cmake-module:: ../CGAL_SetupCGAL_ImageIODependencies.cmake
|
||||
|
|
@ -0,0 +1 @@
|
|||
.. cmake-module:: ../CGAL_SetupCGAL_Qt5Dependencies.cmake
|
||||
|
|
@ -0,0 +1 @@
|
|||
.. cmake-module:: ../CGAL_SetupGMP.cmake
|
||||
|
|
@ -0,0 +1 @@
|
|||
.. cmake-module:: ../CGAL_SetupLEDA.cmake
|
||||
|
|
@ -0,0 +1,393 @@
|
|||
#=============================================================================
|
||||
# CMake - Cross Platform Makefile Generator
|
||||
# Copyright 2000-2013 Kitware, Inc., Insight Software Consortium
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
import os
|
||||
import re
|
||||
|
||||
# Monkey patch for pygments reporting an error when generator expressions are
|
||||
# used.
|
||||
# https://bitbucket.org/birkenfeld/pygments-main/issue/942/cmake-generator-expressions-not-handled
|
||||
from pygments.lexers import CMakeLexer
|
||||
from pygments.token import Name, Operator
|
||||
from pygments.lexer import bygroups
|
||||
CMakeLexer.tokens["args"].append(('(\\$<)(.+?)(>)',
|
||||
bygroups(Operator, Name.Variable, Operator)))
|
||||
|
||||
# Monkey patch for sphinx generating invalid content for qcollectiongenerator
|
||||
# https://bitbucket.org/birkenfeld/sphinx/issue/1435/qthelp-builder-should-htmlescape-keywords
|
||||
from sphinx.util.pycompat import htmlescape
|
||||
from sphinx.builders.qthelp import QtHelpBuilder
|
||||
old_build_keywords = QtHelpBuilder.build_keywords
|
||||
def new_build_keywords(self, title, refs, subitems):
|
||||
old_items = old_build_keywords(self, title, refs, subitems)
|
||||
new_items = []
|
||||
for item in old_items:
|
||||
before, rest = item.split("ref=\"", 1)
|
||||
ref, after = rest.split("\"")
|
||||
if ("<" in ref and ">" in ref):
|
||||
new_items.append(before + "ref=\"" + htmlescape(ref) + "\"" + after)
|
||||
else:
|
||||
new_items.append(item)
|
||||
return new_items
|
||||
QtHelpBuilder.build_keywords = new_build_keywords
|
||||
|
||||
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
from docutils.transforms import Transform
|
||||
try:
|
||||
from docutils.utils.error_reporting import SafeString, ErrorString
|
||||
except ImportError:
|
||||
# error_reporting was not in utils before version 0.11:
|
||||
from docutils.error_reporting import SafeString, ErrorString
|
||||
|
||||
from docutils import io, nodes
|
||||
|
||||
from sphinx.directives import ObjectDescription
|
||||
from sphinx.domains import Domain, ObjType
|
||||
from sphinx.roles import XRefRole
|
||||
from sphinx.util.nodes import make_refnode
|
||||
from sphinx import addnodes
|
||||
|
||||
class CMakeModule(Directive):
|
||||
required_arguments = 1
|
||||
optional_arguments = 0
|
||||
final_argument_whitespace = True
|
||||
option_spec = {'encoding': directives.encoding}
|
||||
|
||||
def __init__(self, *args, **keys):
|
||||
self.re_start = re.compile(r'^#\[(?P<eq>=*)\[\.rst:$')
|
||||
Directive.__init__(self, *args, **keys)
|
||||
|
||||
def run(self):
|
||||
settings = self.state.document.settings
|
||||
if not settings.file_insertion_enabled:
|
||||
raise self.warning('"%s" directive disabled.' % self.name)
|
||||
|
||||
env = self.state.document.settings.env
|
||||
rel_path, path = env.relfn2path(self.arguments[0])
|
||||
path = os.path.normpath(path)
|
||||
encoding = self.options.get('encoding', settings.input_encoding)
|
||||
e_handler = settings.input_encoding_error_handler
|
||||
try:
|
||||
settings.record_dependencies.add(path)
|
||||
f = io.FileInput(source_path=path, encoding=encoding,
|
||||
error_handler=e_handler)
|
||||
except UnicodeEncodeError as error:
|
||||
raise self.severe('Problems with "%s" directive path:\n'
|
||||
'Cannot encode input file path "%s" '
|
||||
'(wrong locale?).' %
|
||||
(self.name, SafeString(path)))
|
||||
except IOError as error:
|
||||
raise self.severe('Problems with "%s" directive path:\n%s.' %
|
||||
(self.name, ErrorString(error)))
|
||||
raw_lines = f.read().splitlines()
|
||||
f.close()
|
||||
rst = None
|
||||
lines = []
|
||||
for line in raw_lines:
|
||||
if rst is not None and rst != '#':
|
||||
# Bracket mode: check for end bracket
|
||||
pos = line.find(rst)
|
||||
if pos >= 0:
|
||||
if line[0] == '#':
|
||||
line = ''
|
||||
else:
|
||||
line = line[0:pos]
|
||||
rst = None
|
||||
else:
|
||||
# Line mode: check for .rst start (bracket or line)
|
||||
m = self.re_start.match(line)
|
||||
if m:
|
||||
rst = ']%s]' % m.group('eq')
|
||||
line = ''
|
||||
elif line == '#.rst:':
|
||||
rst = '#'
|
||||
line = ''
|
||||
elif rst == '#':
|
||||
if line == '#' or line[:2] == '# ':
|
||||
line = line[2:]
|
||||
else:
|
||||
rst = None
|
||||
line = ''
|
||||
elif rst is None:
|
||||
line = ''
|
||||
lines.append(line)
|
||||
if rst is not None and rst != '#':
|
||||
raise self.warning('"%s" found unclosed bracket "#[%s[.rst:" in %s' %
|
||||
(self.name, rst[1:-1], path))
|
||||
self.state_machine.insert_input(lines, path)
|
||||
return []
|
||||
|
||||
class _cmake_index_entry:
|
||||
def __init__(self, desc):
|
||||
self.desc = desc
|
||||
|
||||
def __call__(self, title, targetid, main = 'main'):
|
||||
# return (targetid, title, main, targetid, '', '', 0)
|
||||
return ('pair', u'%s ; %s' % (self.desc, title), targetid, main)
|
||||
|
||||
_cmake_index_objs = {
|
||||
'command': _cmake_index_entry('command'),
|
||||
'generator': _cmake_index_entry('generator'),
|
||||
'manual': _cmake_index_entry('manual'),
|
||||
'module': _cmake_index_entry('module'),
|
||||
'policy': _cmake_index_entry('policy'),
|
||||
'prop_cache': _cmake_index_entry('cache property'),
|
||||
'prop_dir': _cmake_index_entry('directory property'),
|
||||
'prop_gbl': _cmake_index_entry('global property'),
|
||||
'prop_inst': _cmake_index_entry('installed file property'),
|
||||
'prop_sf': _cmake_index_entry('source file property'),
|
||||
'prop_test': _cmake_index_entry('test property'),
|
||||
'prop_tgt': _cmake_index_entry('target property'),
|
||||
'variable': _cmake_index_entry('variable'),
|
||||
}
|
||||
|
||||
def _cmake_object_inventory(env, document, line, objtype, targetid):
|
||||
inv = env.domaindata['cmake']['objects']
|
||||
if targetid in inv:
|
||||
document.reporter.warning(
|
||||
'CMake object "%s" also described in "%s".' %
|
||||
(targetid, env.doc2path(inv[targetid][0])), line=line)
|
||||
inv[targetid] = (env.docname, objtype)
|
||||
|
||||
class CMakeTransform(Transform):
|
||||
|
||||
# Run this transform early since we insert nodes we want
|
||||
# treated as if they were written in the documents.
|
||||
default_priority = 210
|
||||
|
||||
def __init__(self, document, startnode):
|
||||
Transform.__init__(self, document, startnode)
|
||||
self.titles = {}
|
||||
|
||||
def parse_title(self, docname):
|
||||
"""Parse a document title as the first line starting in [A-Za-z0-9<]
|
||||
or fall back to the document basename if no such line exists.
|
||||
The cmake --help-*-list commands also depend on this convention.
|
||||
Return the title or False if the document file does not exist.
|
||||
"""
|
||||
env = self.document.settings.env
|
||||
title = self.titles.get(docname)
|
||||
if title is None:
|
||||
fname = os.path.join(env.srcdir, docname+'.rst')
|
||||
try:
|
||||
f = open(fname, 'r')
|
||||
except IOError:
|
||||
title = False
|
||||
else:
|
||||
for line in f:
|
||||
if len(line) > 0 and (line[0].isalnum() or line[0] == '<'):
|
||||
title = line.rstrip()
|
||||
break
|
||||
f.close()
|
||||
if title is None:
|
||||
title = os.path.basename(docname)
|
||||
self.titles[docname] = title
|
||||
return title
|
||||
|
||||
def apply(self):
|
||||
env = self.document.settings.env
|
||||
|
||||
# Treat some documents as cmake domain objects.
|
||||
objtype, sep, tail = env.docname.rpartition('/')
|
||||
make_index_entry = _cmake_index_objs.get(objtype)
|
||||
if make_index_entry:
|
||||
title = self.parse_title(env.docname)
|
||||
# Insert the object link target.
|
||||
if objtype == 'command':
|
||||
targetname = title.lower()
|
||||
else:
|
||||
targetname = title
|
||||
targetid = '%s:%s' % (objtype, targetname)
|
||||
targetnode = nodes.target('', '', ids=[targetid])
|
||||
self.document.note_explicit_target(targetnode)
|
||||
self.document.insert(0, targetnode)
|
||||
# Insert the object index entry.
|
||||
indexnode = addnodes.index()
|
||||
indexnode['entries'] = [make_index_entry(title, targetid)]
|
||||
self.document.insert(0, indexnode)
|
||||
# Add to cmake domain object inventory
|
||||
_cmake_object_inventory(env, self.document, 1, objtype, targetid)
|
||||
|
||||
class CMakeObject(ObjectDescription):
|
||||
|
||||
def handle_signature(self, sig, signode):
|
||||
# called from sphinx.directives.ObjectDescription.run()
|
||||
signode += addnodes.desc_name(sig, sig)
|
||||
return sig
|
||||
|
||||
def add_target_and_index(self, name, sig, signode):
|
||||
if self.objtype == 'command':
|
||||
targetname = name.lower()
|
||||
else:
|
||||
targetname = name
|
||||
targetid = '%s:%s' % (self.objtype, targetname)
|
||||
if targetid not in self.state.document.ids:
|
||||
signode['names'].append(targetid)
|
||||
signode['ids'].append(targetid)
|
||||
signode['first'] = (not self.names)
|
||||
self.state.document.note_explicit_target(signode)
|
||||
_cmake_object_inventory(self.env, self.state.document,
|
||||
self.lineno, self.objtype, targetid)
|
||||
|
||||
make_index_entry = _cmake_index_objs.get(self.objtype)
|
||||
if make_index_entry:
|
||||
self.indexnode['entries'].append(make_index_entry(name, targetid))
|
||||
|
||||
class CMakeXRefRole(XRefRole):
|
||||
|
||||
# See sphinx.util.nodes.explicit_title_re; \x00 escapes '<'.
|
||||
_re = re.compile(r'^(.+?)(\s*)(?<!\x00)<(.*?)>$', re.DOTALL)
|
||||
_re_sub = re.compile(r'^([^()\s]+)\s*\(([^()]*)\)$', re.DOTALL)
|
||||
|
||||
def __call__(self, typ, rawtext, text, *args, **keys):
|
||||
# Translate CMake command cross-references of the form:
|
||||
# `command_name(SUB_COMMAND)`
|
||||
# to have an explicit target:
|
||||
# `command_name(SUB_COMMAND) <command_name>`
|
||||
if typ == 'cmake:command':
|
||||
m = CMakeXRefRole._re_sub.match(text)
|
||||
if m:
|
||||
text = '%s <%s>' % (text, m.group(1))
|
||||
# CMake cross-reference targets frequently contain '<' so escape
|
||||
# any explicit `<target>` with '<' not preceded by whitespace.
|
||||
while True:
|
||||
m = CMakeXRefRole._re.match(text)
|
||||
if m and len(m.group(2)) == 0:
|
||||
text = '%s\x00<%s>' % (m.group(1), m.group(3))
|
||||
else:
|
||||
break
|
||||
return XRefRole.__call__(self, typ, rawtext, text, *args, **keys)
|
||||
|
||||
# We cannot insert index nodes using the result_nodes method
|
||||
# because CMakeXRefRole is processed before substitution_reference
|
||||
# nodes are evaluated so target nodes (with 'ids' fields) would be
|
||||
# duplicated in each evaluted substitution replacement. The
|
||||
# docutils substitution transform does not allow this. Instead we
|
||||
# use our own CMakeXRefTransform below to add index entries after
|
||||
# substitutions are completed.
|
||||
#
|
||||
# def result_nodes(self, document, env, node, is_ref):
|
||||
# pass
|
||||
|
||||
class CMakeXRefTransform(Transform):
|
||||
|
||||
# Run this transform early since we insert nodes we want
|
||||
# treated as if they were written in the documents, but
|
||||
# after the sphinx (210) and docutils (220) substitutions.
|
||||
default_priority = 221
|
||||
|
||||
def apply(self):
|
||||
env = self.document.settings.env
|
||||
|
||||
# Find CMake cross-reference nodes and add index and target
|
||||
# nodes for them.
|
||||
for ref in self.document.traverse(addnodes.pending_xref):
|
||||
if not ref['refdomain'] == 'cmake':
|
||||
continue
|
||||
|
||||
objtype = ref['reftype']
|
||||
make_index_entry = _cmake_index_objs.get(objtype)
|
||||
if not make_index_entry:
|
||||
continue
|
||||
|
||||
objname = ref['reftarget']
|
||||
targetnum = env.new_serialno('index-%s:%s' % (objtype, objname))
|
||||
|
||||
targetid = 'index-%s-%s:%s' % (targetnum, objtype, objname)
|
||||
targetnode = nodes.target('', '', ids=[targetid])
|
||||
self.document.note_explicit_target(targetnode)
|
||||
|
||||
indexnode = addnodes.index()
|
||||
indexnode['entries'] = [make_index_entry(objname, targetid, '')]
|
||||
ref.replace_self([indexnode, targetnode, ref])
|
||||
|
||||
class CMakeDomain(Domain):
|
||||
"""CMake domain."""
|
||||
name = 'cmake'
|
||||
label = 'CMake'
|
||||
object_types = {
|
||||
'command': ObjType('command', 'command'),
|
||||
'generator': ObjType('generator', 'generator'),
|
||||
'variable': ObjType('variable', 'variable'),
|
||||
'module': ObjType('module', 'module'),
|
||||
'policy': ObjType('policy', 'policy'),
|
||||
'prop_cache': ObjType('prop_cache', 'prop_cache'),
|
||||
'prop_dir': ObjType('prop_dir', 'prop_dir'),
|
||||
'prop_gbl': ObjType('prop_gbl', 'prop_gbl'),
|
||||
'prop_inst': ObjType('prop_inst', 'prop_inst'),
|
||||
'prop_sf': ObjType('prop_sf', 'prop_sf'),
|
||||
'prop_test': ObjType('prop_test', 'prop_test'),
|
||||
'prop_tgt': ObjType('prop_tgt', 'prop_tgt'),
|
||||
'manual': ObjType('manual', 'manual'),
|
||||
}
|
||||
directives = {
|
||||
'command': CMakeObject,
|
||||
'variable': CMakeObject,
|
||||
# Other object types cannot be created except by the CMakeTransform
|
||||
# 'generator': CMakeObject,
|
||||
# 'module': CMakeObject,
|
||||
# 'policy': CMakeObject,
|
||||
# 'prop_cache': CMakeObject,
|
||||
# 'prop_dir': CMakeObject,
|
||||
# 'prop_gbl': CMakeObject,
|
||||
# 'prop_inst': CMakeObject,
|
||||
# 'prop_sf': CMakeObject,
|
||||
# 'prop_test': CMakeObject,
|
||||
# 'prop_tgt': CMakeObject,
|
||||
# 'manual': CMakeObject,
|
||||
}
|
||||
roles = {
|
||||
'command': CMakeXRefRole(fix_parens = True, lowercase = True),
|
||||
'generator': CMakeXRefRole(),
|
||||
'variable': CMakeXRefRole(),
|
||||
'module': CMakeXRefRole(),
|
||||
'policy': CMakeXRefRole(),
|
||||
'prop_cache': CMakeXRefRole(),
|
||||
'prop_dir': CMakeXRefRole(),
|
||||
'prop_gbl': CMakeXRefRole(),
|
||||
'prop_inst': CMakeXRefRole(),
|
||||
'prop_sf': CMakeXRefRole(),
|
||||
'prop_test': CMakeXRefRole(),
|
||||
'prop_tgt': CMakeXRefRole(),
|
||||
'manual': CMakeXRefRole(),
|
||||
}
|
||||
initial_data = {
|
||||
'objects': {}, # fullname -> docname, objtype
|
||||
}
|
||||
|
||||
def clear_doc(self, docname):
|
||||
to_clear = set()
|
||||
for fullname, (fn, _) in self.data['objects'].items():
|
||||
if fn == docname:
|
||||
to_clear.add(fullname)
|
||||
for fullname in to_clear:
|
||||
del self.data['objects'][fullname]
|
||||
|
||||
def resolve_xref(self, env, fromdocname, builder,
|
||||
typ, target, node, contnode):
|
||||
targetid = '%s:%s' % (typ, target)
|
||||
obj = self.data['objects'].get(targetid)
|
||||
if obj is None:
|
||||
# TODO: warn somehow?
|
||||
return None
|
||||
return make_refnode(builder, fromdocname, obj[0], targetid,
|
||||
contnode, target)
|
||||
|
||||
def get_objects(self):
|
||||
for refname, (docname, type) in self.data['objects'].items():
|
||||
yield (refname, refname, type, docname, refname, 1)
|
||||
|
||||
def setup(app):
|
||||
app.add_directive('cmake-module', CMakeModule)
|
||||
app.add_transform(CMakeTransform)
|
||||
app.add_transform(CMakeXRefTransform)
|
||||
app.add_domain(CMakeDomain)
|
||||
|
|
@ -0,0 +1,340 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# CGAL CMake Modules documentation build configuration file, created by
|
||||
# sphinx-quickstart on Fri Sep 23 22:51:32 2016.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its
|
||||
# containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
primary_domain = 'cmake'
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#
|
||||
# needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = ['cmake']
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix(es) of source filenames.
|
||||
# You can specify multiple suffix as a list of string:
|
||||
#
|
||||
# source_suffix = ['.rst', '.md']
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#
|
||||
# source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'CGAL CMake Modules'
|
||||
copyright = u'2016, The CGAL Project'
|
||||
author = u'The CGAL Project'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = u'4.10'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = u'4.10'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#
|
||||
# today = ''
|
||||
#
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#
|
||||
# today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This patterns also effect to html_static_path and html_extra_path
|
||||
exclude_patterns = []
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
#
|
||||
# default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#
|
||||
# add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#
|
||||
# add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#
|
||||
# show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
# modindex_common_prefix = []
|
||||
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
# keep_warnings = False
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = False
|
||||
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
html_theme = 'alabaster'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#
|
||||
# html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
# html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents.
|
||||
# "<project> v<release> documentation" by default.
|
||||
#
|
||||
# html_title = u'CGAL CMake Modules v4.10'
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#
|
||||
# html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#
|
||||
# html_logo = None
|
||||
|
||||
# The name of an image file (relative to this directory) to use as a favicon of
|
||||
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#
|
||||
# html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
# Add any extra paths that contain custom files (such as robots.txt or
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
# directly to the root of the documentation.
|
||||
#
|
||||
# html_extra_path = []
|
||||
|
||||
# If not None, a 'Last updated on:' timestamp is inserted at every page
|
||||
# bottom, using the given strftime format.
|
||||
# The empty string is equivalent to '%b %d, %Y'.
|
||||
#
|
||||
# html_last_updated_fmt = None
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#
|
||||
# html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#
|
||||
# html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#
|
||||
# html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#
|
||||
# html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#
|
||||
# html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#
|
||||
# html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#
|
||||
# html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#
|
||||
# html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
#
|
||||
# html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#
|
||||
# html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
# html_file_suffix = None
|
||||
|
||||
# Language to be used for generating the HTML full-text search index.
|
||||
# Sphinx supports the following languages:
|
||||
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
|
||||
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
|
||||
#
|
||||
# html_search_language = 'en'
|
||||
|
||||
# A dictionary with options for the search language support, empty by default.
|
||||
# 'ja' uses this config value.
|
||||
# 'zh' user can custom change `jieba` dictionary path.
|
||||
#
|
||||
# html_search_options = {'type': 'default'}
|
||||
|
||||
# The name of a javascript file (relative to the configuration directory) that
|
||||
# implements a search results scorer. If empty, the default will be used.
|
||||
#
|
||||
# html_search_scorer = 'scorer.js'
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'CGALModulesdoc'
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#
|
||||
# 'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#
|
||||
# 'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#
|
||||
# 'preamble': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#
|
||||
# 'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
(master_doc, 'CGALModules.tex', u'CGAL CMake Modules Documentation',
|
||||
u'Laurent Rineau', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#
|
||||
# latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#
|
||||
# latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#
|
||||
# latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#
|
||||
# latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#
|
||||
# latex_appendices = []
|
||||
|
||||
# It false, will not define \strong, \code, itleref, \crossref ... but only
|
||||
# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
|
||||
# packages.
|
||||
#
|
||||
# latex_keep_old_macro_names = True
|
||||
|
||||
# If false, no module index is generated.
|
||||
#
|
||||
# latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
(master_doc, 'cgalmodules', u'CGAL CMake Modules Documentation',
|
||||
[author], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#
|
||||
# man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(master_doc, 'CGALModules', u'CGAL CMake Modules Documentation',
|
||||
author, 'CGALModules', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#
|
||||
# texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#
|
||||
# texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#
|
||||
# texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
#
|
||||
# texinfo_no_detailmenu = False
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
.. CGAL CMake Modules documentation master file, created by
|
||||
sphinx-quickstart on Fri Sep 23 22:51:32 2016.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to CGAL CMake Modules's documentation!
|
||||
==============================================
|
||||
|
||||
Contents:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
CGAL_SetupGMP
|
||||
CGAL_SetupLEDA
|
||||
CGAL_SetupBoost
|
||||
CGAL_SetupCGALDependencies
|
||||
CGAL_SetupCGAL_CoreDependencies
|
||||
CGAL_SetupCGAL_Qt5Dependencies
|
||||
CGAL_SetupCGAL_ImageIODependencies
|
||||
|
||||
TODO
|
||||
^^^^
|
||||
- ``CGAL_SetupDependencies.cmake``
|
||||
- ``CGAL_SetupFlags.cmake``
|
||||
- ``CGAL_SetupVLD.cmake``
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
|
|
@ -0,0 +1,225 @@
|
|||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = build
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) Help
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) Help
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " applehelp to make an Apple Help Book"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " epub3 to make an epub3"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " xml to make Docutils-native XML files"
|
||||
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
@echo " coverage to run coverage check of the documentation (if enabled)"
|
||||
@echo " dummy to check syntax errors of document sources"
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(BUILDDIR)/*
|
||||
|
||||
.PHONY: html
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
.PHONY: dirhtml
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
.PHONY: singlehtml
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
.PHONY: pickle
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
.PHONY: json
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
.PHONY: htmlhelp
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
.PHONY: qthelp
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/CGALModules.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/CGALModules.qhc"
|
||||
|
||||
.PHONY: applehelp
|
||||
applehelp:
|
||||
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
|
||||
@echo
|
||||
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
|
||||
@echo "N.B. You won't be able to view it unless you put it in" \
|
||||
"~/Library/Documentation/Help or install it in your application" \
|
||||
"bundle."
|
||||
|
||||
.PHONY: devhelp
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/CGALModules"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/CGALModules"
|
||||
@echo "# devhelp"
|
||||
|
||||
.PHONY: epub
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
.PHONY: epub3
|
||||
epub3:
|
||||
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
|
||||
@echo
|
||||
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
|
||||
|
||||
.PHONY: latex
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
.PHONY: latexpdf
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
.PHONY: latexpdfja
|
||||
latexpdfja:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through platex and dvipdfmx..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
.PHONY: text
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
.PHONY: man
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
.PHONY: texinfo
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
.PHONY: info
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
.PHONY: gettext
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
.PHONY: changes
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
.PHONY: linkcheck
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
.PHONY: doctest
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
||||
|
||||
.PHONY: coverage
|
||||
coverage:
|
||||
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
|
||||
@echo "Testing of coverage in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/coverage/python.txt."
|
||||
|
||||
.PHONY: xml
|
||||
xml:
|
||||
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
|
||||
@echo
|
||||
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
|
||||
|
||||
.PHONY: pseudoxml
|
||||
pseudoxml:
|
||||
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
||||
@echo
|
||||
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
||||
|
||||
.PHONY: dummy
|
||||
dummy:
|
||||
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
|
||||
@echo
|
||||
@echo "Build finished. Dummy builder generates no files."
|
||||
|
|
@ -17,16 +17,21 @@ set(CGAL_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
|||
if(NOT USE_CGAL_FILE_INCLUDED)
|
||||
set(USE_CGAL_FILE_INCLUDED 1)
|
||||
|
||||
include(CGAL_Common)
|
||||
include(CGAL_SetupFlags)
|
||||
include(CGAL_GeneratorSpecificSettings)
|
||||
include(CGAL_TweakFindBoost)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Common.cmake)
|
||||
if( RUNNING_CGAL_AUTO_TEST )
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SetupFlags.cmake)
|
||||
else()
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_display_flags.cmake)
|
||||
endif()
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_TweakFindBoost.cmake)
|
||||
|
||||
set(CGAL_INSTALLED_SCM_BRANCH_NAME ${CGAL_SCM_BRANCH_NAME})
|
||||
set(CGAL_SCM_BRANCH_NAME "")
|
||||
|
||||
if( NOT "${CGAL_INSTALLED_SCM_BRANCH_NAME}" STREQUAL "" )
|
||||
include(CGAL_SCM)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SCM.cmake)
|
||||
CGAL_detect_git(${CMAKE_SOURCE_DIR})
|
||||
if ( NOT "${CGAL_SCM_BRANCH_NAME}" STREQUAL "" )
|
||||
message ( STATUS "Code taken from Git branch: ${CGAL_SCM_BRANCH_NAME}" )
|
||||
if ( NOT "${CGAL_SCM_BRANCH_NAME}" STREQUAL "${CGAL_INSTALLED_SCM_BRANCH_NAME}")
|
||||
|
|
@ -45,7 +50,9 @@ if(NOT USE_CGAL_FILE_INCLUDED)
|
|||
|
||||
include_directories( "${CMAKE_CURRENT_BINARY_DIR}" )
|
||||
|
||||
if(TARGET CGAL)
|
||||
if(TARGET CGAL::CGAL)
|
||||
add_to_list( CGAL_LIBRARIES CGAL::CGAL )
|
||||
elseif(TARGET CGAL)
|
||||
add_to_list( CGAL_LIBRARIES CGAL )
|
||||
else()
|
||||
add_to_list( CGAL_LIBRARIES ${CGAL_LIBRARY} )
|
||||
|
|
@ -62,7 +69,7 @@ if(NOT USE_CGAL_FILE_INCLUDED)
|
|||
add_definitions(-DCGAL_HEADER_ONLY)
|
||||
if(NOT CGAL_NO_BLANKET_LINKING)
|
||||
link_directories ( ${CGAL_3RD_PARTY_LIBRARIES_DIRS} )
|
||||
link_libraries ( ${CGAL_3RD_PARTY_LIBRARIES} )
|
||||
link_libraries ( ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )
|
||||
endif()
|
||||
else()
|
||||
if(NOT CGAL_NO_BLANKET_LINKING)
|
||||
|
|
|
|||
|
|
@ -4,3 +4,5 @@
|
|||
include_directories ( ${TBB_INCLUDE_DIRS} )
|
||||
link_directories( ${TBB_LIBRARY_DIRS} )
|
||||
add_definitions( -DNOMINMAX -DCGAL_LINKED_WITH_TBB )
|
||||
|
||||
message(DEPRECATION "This file UseTBB.cmake is deprecated, and the function `CGAL_target_use_TBB` from CGAL_target_use_TBB.cmake should be used instead.")
|
||||
|
|
|
|||
|
|
@ -8,10 +8,17 @@ if(NOT CIN OR NOT EXISTS ${CIN})
|
|||
"The variable `CIN` should be defined to the input file for the test!")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${CMD}
|
||||
INPUT_FILE ${CIN}
|
||||
RESULT_VARIABLE error_result)
|
||||
if(ANDROID)
|
||||
execute_process(
|
||||
COMMAND adb shell "cd ${ANDROID_DIR_PREFIX}${PROJECT_NAME} && ${ANDROID_DIR_PREFIX}${CMD}"
|
||||
INPUT_FILE ${CIN}
|
||||
RESULT_VARIABLE error_result)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND ${CMD}
|
||||
INPUT_FILE ${CIN}
|
||||
RESULT_VARIABLE error_result)
|
||||
endif()
|
||||
|
||||
if(error_result)
|
||||
message(SEND_ERROR
|
||||
|
|
|
|||
|
|
@ -1,79 +0,0 @@
|
|||
// Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 3 of the License,
|
||||
// or (at your option) any later version.
|
||||
//
|
||||
// Licensees holding a valid commercial license may use this file in
|
||||
// accordance with the commercial license agreement provided with the software.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: LGPL-3.0+
|
||||
//
|
||||
//
|
||||
// Author(s) : Menelaos Karavelas <mkaravel@tem.uoc.gr>
|
||||
|
||||
//| The flag CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG is set
|
||||
//| if the compiler cannot recognize the declaration of a nested
|
||||
//| class as friend.
|
||||
//| Compilers such as the Intel compiler 8.x (for linux or windows),
|
||||
//| MSVC 7.1 or pgCC have this "bug". It should be noted that the C++
|
||||
//| standard is a bit vague on this issue, in other words what is referred
|
||||
//| to as "bug" above, may not really be a bug. Hopefully, the next standard
|
||||
//| will resolve this issue.
|
||||
|
||||
#include <iostream>
|
||||
|
||||
template<class T>
|
||||
struct A
|
||||
{
|
||||
void do_something() const {
|
||||
std::cerr << "A's do_something" << std::endl;
|
||||
T().do_something();
|
||||
}
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct B
|
||||
{
|
||||
typedef A<T> Nested;
|
||||
|
||||
void do_something() const {
|
||||
std::cerr << "B's do_something" << std::endl;
|
||||
T().do_something();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template<class T>
|
||||
class C
|
||||
{
|
||||
friend struct B< C<T> >;
|
||||
friend struct B< C<T> >::Nested;
|
||||
// the following declaration (instead of the one above) is what
|
||||
// pgCC, Intel 8.x and MSVC 7.1 would accept:
|
||||
// friend class A< C<T> >;
|
||||
|
||||
protected:
|
||||
void do_something() const {
|
||||
std::cerr << "C's do_something" << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
A< C<int> > a;
|
||||
B< C<int> > b;
|
||||
|
||||
a.do_something();
|
||||
b.do_something();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
// Copyright (c) 2016 GeometryFactory (France). All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 3 of the License,
|
||||
// or (at your option) any later version.
|
||||
//
|
||||
// Licensees holding a valid commercial license may use this file in
|
||||
// accordance with the commercial license agreement provided with the software.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// Author(s) : Laurent Rineau
|
||||
|
||||
#ifndef CGAL_MSVC_COMPILER_CONFIG_H
|
||||
#define CGAL_MSVC_COMPILER_CONFIG_H
|
||||
|
||||
// For all known version of MSVC. Actually we do not really have a
|
||||
// test for that bug.
|
||||
#define CGAL_CFG_MATCHING_BUG_6 1
|
||||
|
||||
// Fixed since MSVC 2015
|
||||
#define CGAL_CFG_MATCHING_BUG_7 1
|
||||
|
||||
// for all known version of MSVC
|
||||
#define CGAL_CFG_MATCHING_BUG_8 1
|
||||
|
||||
// Should be only for MSVC 2012 and 2013 in Release
|
||||
#define CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG 1
|
||||
|
||||
#endif // CGAL_MSVC_COMPILER_CONFIG_H
|
||||
|
|
@ -140,7 +140,18 @@
|
|||
// platform specific workaround flags (CGAL_CFG_...)
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
#include <CGAL/compiler_config.h>
|
||||
#if CGAL_HEADER_ONLY
|
||||
# include <CGAL/internal/enable_third_party_libraries.h>
|
||||
# if(BOOST_MSVC)
|
||||
# include <CGAL/MSVC_compiler_config.h>
|
||||
# endif
|
||||
#else
|
||||
# include <CGAL/compiler_config.h>
|
||||
#endif
|
||||
|
||||
#if BOOST_MSVC && CGAL_TEST_SUITE
|
||||
# include <CGAL/Testsuite/vc_debug_hook.h>
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
// Support for DLL on Windows (CGAL_EXPORT macro)
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue