...
 
Commits (89)
......@@ -164,7 +164,7 @@ int viewerId() {
return viewerId_;
}
void setViewers( std::vector< glViewer* > _viewerWidgets ) {
void setViewers( const std::vector< glViewer* >& _viewerWidgets ) {
PluginFunctions::examiner_widgets_ = _viewerWidgets;
PluginFunctions::examiner_widget_ = examiner_widgets_[0];
......@@ -174,7 +174,7 @@ void setViewers( std::vector< glViewer* > _viewerWidgets ) {
viewerId_ = qrand();
}
void setViewerProperties( std::vector< Viewer::ViewerProperties* > _viewerProperties ) {
void setViewerProperties( const std::vector< Viewer::ViewerProperties* >& _viewerProperties ) {
PluginFunctions::viewerProperties_ = _viewerProperties;
}
......@@ -221,9 +221,11 @@ void setEncodedExaminerView( QString _view ) {
void setEncodedExaminerView(int _viewerId , QString _view ) {
// Consistency check. If viewer id is wrong, we set the currently active viewer.
if ( _viewerId < 0 || _viewerId >= (int)examiner_widgets_.size() ) {
std::cerr << "Requested unknown viewer with id : " << _viewerId << std::endl;
examiner_widgets_[activeExaminer()]->decodeView ( _view );
return;
}
examiner_widgets_[_viewerId]->decodeView ( _view );
......
......@@ -79,7 +79,7 @@ namespace PluginFunctions {
//=======================================
/// Set the internal Viewer pointer ( DO NOT USE!! )
DLLEXPORT
void setViewers( std::vector< glViewer* > _viewerWidgets );
void setViewers( const std::vector< glViewer* >& _viewerWidgets );
/// Get a Viewer
DLLEXPORT
......@@ -87,7 +87,7 @@ glViewer* viewer(int _viewerId );
/// Set the internal viewerProperties pointer ( DO NOT USE!! )
DLLEXPORT
void setViewerProperties( std::vector< Viewer::ViewerProperties* > _viewerProperties );
void setViewerProperties( const std::vector< Viewer::ViewerProperties* >& _viewerProperties );
/** Set the internal scenegraph root node pointer. This is the topmost
* node of the whole scenegraph ( DO NOT USE!! )
......
......@@ -566,35 +566,49 @@ Core::init() {
// Set renderer
// ====================================================
QString defaultRendererKey = "Viewer" + QString::number(i)+"/DefaultRenderer";
QString defaultRendererName = OpenFlipperSettings().value(defaultRendererKey,"Default Classical Renderer Plugin").toString();
// Check if the renderer is there
int defaultRendererId = renderManager().getRendererId(defaultRendererName);
// Choose one of the two possible renderers. Shader Pipeline for Core Profile or Classical for Compatibility Profile
QString rendererDefault;
if ( defaultRendererId == -1 ) {
emit log(LOGERR,tr("Stored default renderer \"") + defaultRendererName + tr("\" is not available, trying Classical!"));
if ( OpenFlipper::Options::coreProfile() )
rendererDefault = "Shader Pipeline Renderer Plugin";
else
rendererDefault = "Default Classical Renderer Plugin";
// Check if the renderer is there
defaultRendererId = renderManager().getRendererId("Default Classical Renderer Plugin");
// Try to get a default renderer Name from the settings file. If it's not there, we fall back to the default set above
// based on the current OpenGL Profile
QString rendererKey = "Viewer" + QString::number(i)+"/DefaultRenderer";
QString rendererName = OpenFlipperSettings().value(rendererKey,rendererDefault).toString();
// Classical available?
if ( defaultRendererId != -1 ) {
renderManager().setActive(defaultRendererId,i);
// Check if the renderer is there. If a setting was in the options file, we try it here. Otherwise we are checking the default one.
int rendererId = renderManager().getRendererId(rendererName);
if ( rendererId == -1 ) {
// That failed. So either the one stored in the settings is not available or our default failed.
emit log(LOGERR,tr("Stored default renderer \"") + rendererName + tr("\" is not available, trying") + rendererDefault + "!");
// Anyway, lets try the default fallback:
rendererId = renderManager().getRendererId(rendererDefault);
// Successful?
if ( rendererId != -1 ) {
// Lets set it as the active one
renderManager().setActive(rendererId,i);
} else {
emit log(LOGERR,tr("Default classical renderer is also not available. Trying to use any other renderer i can find!"));
emit log(LOGERR,rendererDefault + tr(" renderer is also not available. Trying to use any other renderer i can find!"));
// debug information for this case, print renderer count and their names
const unsigned int rendererCount = renderManager().available();
emit log(LOGERR,tr("Currently ") + QString::number(rendererCount) + tr(" renderers are available:") );
for (unsigned int i = 0 ; i < rendererCount ; ++i )
emit log(LOGERR, tr("Renderer ") + QString::number(i) + ": " + renderManager()[i]->name );
for (unsigned int rendererId = 0 ; rendererId < rendererCount ; ++rendererId )
emit log(LOGERR, tr("Renderer ") + QString::number(rendererId) + ": " + renderManager()[rendererId]->name );
}
} else {
renderManager().setActive(defaultRendererId,i);
renderManager().setActive(rendererId,i);
}
}
// Warn the user in the log and via messagebox, that he is using the build in renderer only
......@@ -1901,8 +1915,8 @@ void Core::slotDeleteAllObjects( ){
bool Core::checkLibraryVersions() {
bool ok = true;
bool warn = false;
// bool ok = true;
// bool warn = false;
QString messages;
......@@ -1916,39 +1930,40 @@ bool Core::checkLibraryVersions() {
messages += tr("Link time QT Version:\t\t") + QString( QT_VERSION_STR ) + "\n";
messages += tr("This inconsistency may lead to an unstable behavior of OpenFlipper!");
warn = true;
// warn = true;
}
if ( !ok ) {
QString message = tr("Error! Library tests failed!\n");
message += tr("The following problems have been found:\n\n");
message += messages;
std::cerr << message.toStdString() << std::endl;
if ( OpenFlipper::Options::gui() ) {
finishSplash();
StaysOnTopMessageBox::critical ( 0, tr( "Library incompatibilities found!"),message );
}
// Unsafe operation, so quit the application
exitFailure();
} else if ( warn ) {
QString message = tr("Warning! The OpenGL capabilities of your current machine/driver could be insufficient!\n\n");
message += tr("The following checks failed:\n\n");
message += messages;
std::cerr << message.toStdString() << std::endl;
if ( OpenFlipper::Options::gui() ) {
finishSplash();
StaysOnTopMessageBox::warning ( 0, tr( "Library incompatibilities found!"),message );
}
// if ( !ok ) {
// QString message = tr("Error! Library tests failed!\n");
// message += tr("The following problems have been found:\n\n");
//
// message += messages;
//
// std::cerr << message.toStdString() << std::endl;
//
// if ( OpenFlipper::Options::gui() ) {
// finishSplash();
// StaysOnTopMessageBox::critical ( 0, tr( "Library incompatibilities found!"),message );
// }
//
// // Unsafe operation, so quit the application
// exitFailure();
//
// } else if ( warn ) {
}
// QString message = tr("Warning! The OpenGL capabilities of your current machine/driver could be insufficient!\n\n");
// message += tr("The following checks failed:\n\n");
// message += messages;
//
// std::cerr << message.toStdString() << std::endl;
//
// if ( OpenFlipper::Options::gui() ) {
// finishSplash();
// StaysOnTopMessageBox::warning ( 0, tr( "Library incompatibilities found!"),message );
// }
//
// }
#ifndef NDEBUG
else {
std::cerr << "Library Check succeeded" << std::endl;
......
......@@ -108,8 +108,8 @@ void Core::readApplicationOptions(INIFile& _ini) {
// Check if the mode already exists
bool found = false;
for (int i=0; i < viewModes_.size(); i++)
if (viewModes_[i]->name == mode)
for (int modeNr = 0; modeNr < viewModes_.size(); modeNr++)
if (viewModes_[modeNr]->name == mode)
found = true;
if (!found){
......
......@@ -66,6 +66,11 @@ void Core::startVideoCapture(QString _baseName, int _fps, bool _captureViewers)
// set track to true;
videoTimer_.setSingleShot(false);
// sanitize input
if (_fps == 0) {
_fps = 25;
}
// 25 fps
videoTimer_.start( 1000 / _fps);
......
......@@ -9,7 +9,7 @@ OpenFlipper.
\section reqlibs Required libraries
<ul>
<li> 5.9 <= Qt <= 5.11 ( http://www.qt.io/download/ ) Use the OpenGL version. If you install Qt, please make sure that QtScript is also installed.</li>
<li> 5.9 <= Qt <= 5.13 ( http://www.qt.io/download/ ) Use the OpenGL version. If you install Qt, please make sure that QtScript is also installed.</li>
</ul>
\section optlibs Optional libraries ( Without these libraries some functionality might not be available)
......@@ -17,6 +17,13 @@ OpenFlipper.
<li> QWT (>=6.0) ( optional, used for histogram plottings, http://qwt.sourceforge.net/)</li>
</ul>
On Debian, you can install the prerequisites this way (tested on Debian buster):
<code>
apt install cmake make g++ libeigen3-dev python3-dev qt5-default libqt5script5 libqt5scripttools5 libqt5svg5-dev libqt5quick5 libqt5x11extras5-dev libqt5help5 qtscript5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev qttools5-dev qtdeclarative5-dev libqt5opengl5-dev libglew-dev
</code>
\section bs Build System
The build system uses cmake to generate all makefiles.
......
/*! \page changelog Changelog
- <b>OpenFlipper 4.1 ( ?/?/? )</b>
- <b>ACG</b>
- GlutPrimitiveNode: Added cone support
- <b>Python Subsystem</b>
- Exit application on error in scripting with batch mode
- Correctly output logging information
......@@ -10,6 +12,7 @@
- Type Light: Python Interface added
- Primitives Generator: Python Interface added
- Mesh Compare: Python Interface added
- Noise: New plugin to add noise to meshes or splats
- <b>OpenFlipper 4.0 ( 05/03/2019 )</b>
......
......@@ -24,5 +24,50 @@
\subsection python_scripting_idlisttype IDList data type
The IdList type used in the C++ code is mapped from python. Details can be found here:
\subpage python_scripting_IDList_type
\section python_scripting_examples Examples
Here is a simple example of a python script using the holefiller:
\code
# Load an object from a specific path
id = fileoff.loadObject("OpenFlipper-Free/OpenFlipper/cube1.off")
# Prints the id of the new object
print("ID of new object is : " + str(id) )
# Selects a set of faces
meshobjectselection.selectFaces(id,[0,1,2,3,4,5,6,7,8,9,10])
# deletes the selected faces
meshobjectselection.deleteFaceSelection(id)
# And runs the hole filler to close the holes produced by the previous operation
holefiller.fillAllHoles(id)
\endcode
Another example produces an animation of a rotating object:
\code
# We need numpy for array and vectors
import numpy as np
# Generate a cube via the primitivesgenerator plugin
primitivesgenerator.addCube()
# Set our animation parameters
animation_axis = np.array([-1.0,1.0,0.0]);
rotation_center = np.array([0.0,0.0,0.0])
# Loop over 360 degrees
for angle in range(0,360,1):
# Apply rotation
viewcontrol.rotate(animation_axis,1,rotation_center,0)
# Update the current view
core.updateView()
# Update the ui
core.updateUI()
\endcode
*/
......@@ -178,7 +178,7 @@ STRIP_FROM_INC_PATH = @CMAKE_SOURCE_DIR@/
# support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO.
SHORT_NAMES = YES
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief
......
......@@ -178,7 +178,7 @@ STRIP_FROM_INC_PATH = @CMAKE_SOURCE_DIR@/
# support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO.
SHORT_NAMES = YES
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief
......
......@@ -178,7 +178,7 @@ STRIP_FROM_INC_PATH =
# support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO.
SHORT_NAMES = YES
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief
......
......@@ -178,7 +178,7 @@ STRIP_FROM_INC_PATH =
# support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO.
SHORT_NAMES = YES
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief
......
......@@ -178,7 +178,7 @@ STRIP_FROM_INC_PATH =
# support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO.
SHORT_NAMES = YES
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief
......
......@@ -74,6 +74,7 @@ License File format:
#include <QString>
#include <QCryptographicHash>
#include <QNetworkInterface>
#include <QTime>
#include <limits>
......
......@@ -51,15 +51,15 @@
#include "salt.hh"
KeyGen::KeyGen(QString n, QString cHash, QString pHash, QString cpHash, QString prHash, QStringList mHashes, QString request)
KeyGen::KeyGen(QString n, QString cHash, QString pHash, QString cpHash, QString prHash, QStringList mHashes, QString request) :
name (n),
coreHash(cHash),
pluginHash(pHash),
cpuHash(cpHash),
productHash(prHash),
macHashes(mHashes),
requestSig(request)
{
name = n;
coreHash = cHash;
pluginHash = pHash;
cpuHash = cpHash;
productHash = prHash;
macHashes = mHashes;
requestSig = request;
}
QString KeyGen::computeSignature(const bool _utf8 ) const {
......
......@@ -88,7 +88,7 @@
class StackWalkerToConsole : public StackWalker
{
protected:
virtual void OnOutput(LPCSTR szText)
virtual void OnOutput(LPCSTR szText) override
{
// Writes crash dump to .OpenFlipper config directory
std::ofstream crashFile;
......
......@@ -126,7 +126,7 @@ macro (acg_set_target_props target)
if (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE AND NOT (CMAKE_MAJOR_VERSION LESS 3))
set_target_properties (${target} PROPERTIES MACOSX_RPATH 1)
else()
set_target_properties(${target} PROPERTIES MACOSX_RPPATH 0) #disable "@rpath" option since fixup_bundle has some problems finding dependencies
set_target_properties(${target} PROPERTIES MACOSX_RPATH 0) #disable "@rpath" option since fixup_bundle has some problems finding dependencies
endif()
if (WIN32)
......
......@@ -46,10 +46,12 @@ endif( WIN32 )
if (UNIX)
set ( ADDITIONAL_CXX_FLAGS )
set ( ADDITIONAL_CXX_DEBUG_FLAGS )
set ( ADDITIONAL_CXX_RELEASE_FLAGS )
set ( ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS )
set ( ADDITIONAL_C_FLAGS )
set ( ADDITIONAL_C_DEBUG_FLAGS )
set ( ADDITIONAL_C_RELEASE_FLAGS )
set ( ADDITIONAL_C_RELWITHDEBINFO_FLAGS )
......@@ -59,28 +61,21 @@ if (UNIX)
################################################################################
# add our standard flags for Template inclusion
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_CXX_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_C_FLAGS "-DINCLUDE_TEMPLATES" )
# Deprecated setting. Remove in future release, as the default template depth
# should be enough with state of the art compilers
# Increase the template depth as this might be exceeded from time to time
#IF( NOT CMAKE_SYSTEM MATCHES "SunOS*")
# list(APPEND ADDITIONAL_CXX_FLAGS "-ftemplate-depth-100" )
#ENDIF()
# add our standard flags for Template inclusion
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_C_RELEASE_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS "-DINCLUDE_TEMPLATES" )
# Deprecated setting. Remove in future release, as the default template depth
# should be enough with state of the art compilers
# # Increase the template depth as this might be exceeded from time to time
# IF( NOT CMAKE_SYSTEM MATCHES "SunOS*")
# list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-ftemplate-depth-100" )
# list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-ftemplate-depth-100" )
# list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-ftemplate-depth-100" )
# ENDIF()
################################################################################
# OS Defines
################################################################################
if (APPLE)
add_definitions( -DARCH_DARWIN )
endif()
......@@ -101,7 +96,7 @@ if (UNIX)
################################################################################
# Warnings
################################################################################
# Add the standard compiler warnings
if ( NOT COMPILER_WARNINGS )
......@@ -114,18 +109,13 @@ if (UNIX)
set ( COMPILER_WARNINGS "" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
ELSE ()
set ( COMPILER_WARNINGS "-W" "-Wall" "-Wno-unused" "-Wextra" "-Wno-variadic-macros" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
ENDIF()
ENDIF()
endif ( NOT COMPILER_WARNINGS )
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_C_DEBUG_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_C_RELEASE_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_CXX_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_C_FLAGS ${COMPILER_WARNINGS} )
################################################################################
# STL Vector checks
################################################################################
......@@ -153,43 +143,49 @@ if (UNIX)
################################################################################
# Add the debug flags
foreach( flag ${ADDITIONAL_CXX_DEBUG_FLAGS} )
if( NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_DEBUG_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_DEBUG} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${flag} ")
endif()
endforeach()
# Add the release flags
foreach( flag ${ADDITIONAL_CXX_RELEASE_FLAGS} )
if( NOT CMAKE_CXX_FLAGS_RELEASE MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_RELEASE_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_RELEASE} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${flag} ")
endif()
endforeach()
# Add the release with debug info flags
foreach( flag ${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} )
if( NOT CMAKE_CXX_FLAGS_RELWITHDEBINFO MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
# Add the debug flags
foreach( flag ${ADDITIONAL_C_DEBUG_FLAGS} )
if( NOT CMAKE_C_FLAGS_DEBUG MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_DEBUG_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_DEBUG} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${flag} ")
endif()
endforeach()
# Add the release flags
foreach( flag ${ADDITIONAL_C_RELEASE_FLAGS} )
if( NOT CMAKE_C_FLAGS_RELEASE MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_RELEASE_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_RELEASE} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${flag} ")
endif()
endforeach()
# Add the release with debug info flags
foreach( flag ${ADDITIONAL_C_RELWITHDEBINFO_FLAGS} )
if( NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES "${flag}" )
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_RELWITHDEBINFO_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_RELWITHDEBINFO} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
......@@ -199,5 +195,5 @@ if (UNIX)
set (CMAKE_CFLAGS_RELEASE "-xO3")
set (CMAKE_CXX_FLAGS_RELEASE "-xO3")
endif ( CMAKE_SYSTEM MATCHES "SunOS*" )
endif ()
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... )
# This macro is intended to be used in FindXXX.cmake modules files.
# It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and
# it also sets the <UPPERCASED_NAME>_FOUND variable.
# The package is found if all variables listed are TRUE.
# Example:
#
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
#
# LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and
# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
# independent whether QUIET was used or not.
# If it is found, the location is reported using the VAR1 argument, so
# here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out.
# If the second argument is DEFAULT_MSG, the message in the failure case will
# be "Could NOT find LibXml2", if you don't like this message you can specify
# your own custom failure message there.
macro(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
if("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
set(_FAIL_MESSAGE "Could NOT find ${_NAME}")
else()
set(_FAIL_MESSAGE "${_FAIL_MSG}")
endif()
string(TOUPPER ${_NAME} _NAME_UPPER)
set(${_NAME_UPPER}_FOUND TRUE)
if(NOT ${_VAR1})
set(${_NAME_UPPER}_FOUND FALSE)
endif()
foreach(_CURRENT_VAR ${ARGN})
if(NOT ${_CURRENT_VAR})
set(${_NAME_UPPER}_FOUND FALSE)
endif()
endforeach()
if (${_NAME_UPPER}_FOUND)
if (NOT ${_NAME}_FIND_QUIETLY)
message(STATUS "Found ${_NAME}: ${${_VAR1}}")
endif()
else()
if (${_NAME}_FIND_REQUIRED)
message(FATAL_ERROR "${_FAIL_MESSAGE}")
else()
if (NOT ${_NAME}_FIND_QUIETLY)
message(STATUS "${_FAIL_MESSAGE}")
endif()
endif()
endif()
endmacro()
if ( NOT CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED )
set( CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED 1 )
message( STATUS "Targetting ${CMAKE_GENERATOR}")
if ( MSVC )
message( STATUS "Target build enviroment supports auto-linking" )
set(CGAL_AUTO_LINK_ENABLED TRUE)
endif()
if ( MSVC15 )
set(CGAL_TOOLSET "vc150")
message( STATUS "Using VC15 compiler." )
elseif ( MSVC14 )
set(CGAL_TOOLSET "vc140")
message( STATUS "Using VC14 compiler." )
elseif ( MSVC12 )
set(CGAL_TOOLSET "vc120")
message( STATUS "Using VC12 compiler." )
elseif ( MSVC11 )
set(CGAL_TOOLSET "vc110")
message( STATUS "Using VC11 compiler." )
elseif ( MSVC10 )
set(CGAL_TOOLSET "vc100")
message( STATUS "Using VC10 compiler." )
elseif ( MSVC90 )
set(CGAL_TOOLSET "vc90")
message( STATUS "Using VC90 compiler." )
elseif ( MSVC80 )
set(CGAL_TOOLSET "vc80")
message( STATUS "Using VC80 compiler." )
elseif ( MSVC71 )
set(CGAL_TOOLSET "vc71")
message( STATUS "Using VC71 compiler." )
else()
message( STATUS "Using ${CMAKE_CXX_COMPILER} compiler." )
endif()
# From james Bigler, in the cmake users list.
IF (APPLE)
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
message(STATUS "DARWIN_VERSION=${DARWIN_VERSION}")
if (DARWIN_VERSION GREATER 8)
message(STATUS "Mac Leopard detected")
set(CGAL_APPLE_LEOPARD 1)
endif()
endif()
if ( NOT "${CMAKE_CFG_INTDIR}" STREQUAL "." )
set(HAS_CFG_INTDIR TRUE CACHE INTERNAL "Generator uses intermediate configuration directory" )
message( STATUS "Generator uses intermediate configuration directory: ${CMAKE_CFG_INTDIR}" )
endif()
endif()
# Find TAUCS library shipped with CGAL
#
# This module searches for TAUCS in CGAL "auxiliary" folder
# and in in $CGAL_TAUCS_DIR environment variable.
#
# This module sets the following variables:
# CGAL_TAUCS_FOUND - set to true if TAUCS library shipped with CGAL
# is found
# CGAL_TAUCS_PLATFORM - name of TAUCS subfolder corresponding to the current compiler
# CGAL_TAUCS_INCLUDE_DIR - list of folders (using full path name) containing
# TAUCS (and optionaly BLAS and LAPACK) headers
# CGAL_TAUCS_LIBRARIES_DIR -list of folders (using full path name) containing
# TAUCS (and optionaly BLAS and LAPACK) libraries
include(CGAL_Macros)
if ( NOT CGAL_TAUCS_FOUND )
#
# Find out TAUCS name for the current platform.
# This code is a translation of TAUCS "configure" script.
#
# The first task is to figure out CMAKE_SYSTEM_NAME
# (on unix this is uname -s, for windows it is Windows).
#message("DEBUG: CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
#message("DEBUG: CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}")
set( CGAL_TAUCS_PLATFORM "${CMAKE_SYSTEM_NAME}" )
# Convert to lower case
STRING(TOLOWER "${CGAL_TAUCS_PLATFORM}" CGAL_TAUCS_PLATFORM)
# Sometimes uname returns a value that is
# inconsistent with the way CGAL_TAUCS_PLATFORM is set. For example, on
# Solaris, CGAL_TAUCS_PLATFORM=solaris but uname returns SunOS.
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "sunos" )
set( CGAL_TAUCS_PLATFORM "solaris" )
endif()
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "windows" )
set( CGAL_TAUCS_PLATFORM "win32" )
endif()
# LS 2007: added "darwin_intel" for Intel Macs.
# "darwin" = original Darwin platform = PowerPC architecture.
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "darwin" )
# CMAKE_SYSTEM_PROCESSOR=uname -p
if ( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386" )
set( CGAL_TAUCS_PLATFORM "darwin_intel" )
endif()
endif()
# LS 2007: append "64" if 64 bits processor (tested on Linux only)
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "linux" )
# CMAKE_SYSTEM_PROCESSOR=uname -p
if ( ${CMAKE_SYSTEM_PROCESSOR} MATCHES ".*64.*" )
set( CGAL_TAUCS_PLATFORM "${CGAL_TAUCS_PLATFORM}64" )
endif()
endif()
#message("DEBUG: CGAL_TAUCS_PLATFORM = ${CGAL_TAUCS_PLATFORM}")
#
# Search for TAUCS folder.
#
#message("DEBUG: CGAL_SOURCE_DIRECTORY = ${CGAL_SOURCE_DIRECTORY}")
# VC++ uses auto-link, thus we search for a folder containing the output of
# build_taucs_win32_for_CGAL.bat/build_taucs_win64_for_CGAL.bat,
# ie TAUCS libraries compiled for all Windows runtimes.
if ( MSVC )
# Check $CGAL_TAUCS_DIR environment variable
fetch_env_var(CGAL_TAUCS_DIR)
#message("DEBUG: CGAL_TAUCS_DIR = ${CGAL_TAUCS_DIR}")
if (NOT "${CGAL_TAUCS_DIR}" STREQUAL "" AND EXISTS ${CGAL_TAUCS_DIR})
set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_TAUCS_DIR}/include")
set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_DIR}/lib" )
set( CGAL_TAUCS_FOUND TRUE )
# Else, search for TAUCS in CGAL "auxiliary" folder
elseif ( EXISTS "${CGAL_SOURCE_DIRECTORY}/auxiliary/taucs" )
set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_SOURCE_DIRECTORY}/auxiliary/taucs/include")
set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_SOURCE_DIRECTORY}/auxiliary/taucs/lib" )
set( CGAL_TAUCS_FOUND TRUE )
endif()
# On Unix, search for TAUCS "taucs_full" folder
else ( MSVC )
# Check $CGAL_TAUCS_DIR environment variable
fetch_env_var(CGAL_TAUCS_DIR)
#message("DEBUG: CGAL_TAUCS_DIR = ${CGAL_TAUCS_DIR}")
if (NOT "${CGAL_TAUCS_DIR}" STREQUAL "" AND EXISTS ${CGAL_TAUCS_DIR})
set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_TAUCS_DIR}/build/${CGAL_TAUCS_PLATFORM}"
"${CGAL_TAUCS_DIR}/src" )
set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_DIR}/external/lib/${CGAL_TAUCS_PLATFORM}"
"${CGAL_TAUCS_DIR}/lib/${CGAL_TAUCS_PLATFORM}" )
set( CGAL_TAUCS_FOUND TRUE )
endif()
endif ( MSVC )
# Add variables to cache
set( CGAL_TAUCS_DIR "${CGAL_TAUCS_DIR}"
CACHE PATH "Directory containing BLAS, LAPACK and TAUCS" )
#message("DEBUG: CGAL_TAUCS_INCLUDE_DIR = ${CGAL_TAUCS_INCLUDE_DIR}")
#message("DEBUG: CGAL_TAUCS_LIBRARIES_DIR = ${CGAL_TAUCS_LIBRARIES_DIR}")
#message("DEBUG: CGAL_TAUCS_FOUND = ${CGAL_TAUCS_FOUND}")
endif ( NOT CGAL_TAUCS_FOUND )
This diff is collapsed.
......@@ -20,10 +20,10 @@ set( CMAKE_CXX_STANDARD_REQUIRED TRUE )
set( CMAKE_CXX_STANDARD 11 )
# ACG Environment default settings
# This is ugly but currently we need to work around the default installed 5.3 on debian
if ( EXISTS /ACG/acgdev/gcc-x86_64/qt-5.11.2/5.11.2/gcc_64 )
# This is ugly but currently we need to work around the default installed on debian
if ( EXISTS /ACG/acgdev/gcc-x86_64/qt-5.13.0/5.13.0/gcc_64 )
# Default to this install path for QT%_INSTALL_DIR
set (QT5_INSTALL_PATH /ACG/acgdev/gcc-x86_64/qt-5.11.2/5.11.2/gcc_64/ CACHE PATH "Qt5 install path set for ACG environment using QT 5.11.2" )
set (QT5_INSTALL_PATH /ACG/acgdev/gcc-x86_64/qt-5.13.0/5.13.0/gcc_64/ CACHE PATH "Qt5 install path set for ACG environment using QT 5.13.0" )
endif()
if ( WIN32 )
......@@ -128,7 +128,7 @@ if ( WIN32 )
endif()
endif()
set (OF_MAX_QT_VERSION "5.9.0")
set (OF_MAX_QT_VERSION "5.13.0")
if (${Qt5Core_VERSION_STRING} STRGREATER ${OF_MAX_QT_VERSION})
message(WARNING "Detected QT Version higher than ${OF_MAX_QT_VERSION}!\n" "OpenFlipper has not been tested with this QT Version.")
......@@ -217,6 +217,11 @@ if(NO_DECREMENT_DEPRECATED_WARNINGS)
add_definitions( -DNO_DECREMENT_DEPRECATED_WARNINGS )
endif()
# do not show "opengl is deprecated" warnings
if (APPLE)
add_definitions( -DGL_SILENCE_DEPRECATION )
endif()
find_package(ACG)
# OpenMesh is a dependent project (in libs_required) so no finder is needed.
......@@ -262,9 +267,24 @@ file (
set( REMAINING_LOCAL_LIBS "" )
# move the following libraries to the front of the list
# to have add_subdirectory() order match the dependency graph.
set( _local_libs_ordered "" )
foreach(_pattern CoMISo OpenVolumeMesh libHexEx)
foreach (_localLib ${_local_libs_in})
if ( "${_localLib}" MATCHES ".*${_pattern}.*" )
LIST(APPEND _local_libs_ordered ${_localLib})
endif()
endforeach()
endforeach()
LIST(APPEND _local_libs_ordered ${_local_libs_in})
LIST(REMOVE_DUPLICATES _local_libs_ordered)
# Special Comiso case:
# The library has to be configured first
foreach (_localLib ${_local_libs_in})
foreach (_localLib ${_local_libs_ordered})
if ( "${_localLib}" MATCHES .*CoMISo.* )
get_filename_component (_local_lib_dir ${_localLib} PATH)
if ( NOT DEFINED LIB_COMISO_BUILD )
......@@ -281,7 +301,6 @@ foreach (_localLib ${_local_libs_in})
endif()
endforeach ()
# add all found libs to the build
foreach (_localLib ${REMAINING_LOCAL_LIBS})
......
This diff is collapsed.
# - Find CGAL
# Find the CGAL autolinking headers.
#
# CGAL_INCLUDE_DIR - where to find CGAL.h, etc.
# CGAL_FOUND - True if CGAL found.
IF (CGAL_INCLUDE_DIR)
# Already in cache, be silent
SET(CGAL_FIND_QUIETLY TRUE)
ENDIF (CGAL_INCLUDE_DIR)
GET_FILENAME_COMPONENT(module_file_path ${CMAKE_CURRENT_LIST_FILE} PATH )
# Check if the base path is set
if ( NOT CMAKE_WINDOWS_LIBS_DIR )
# This is the base directory for windows library search used in the finders we shipp.
set(CMAKE_WINDOWS_LIBS_DIR "c:/libs" CACHE STRING "Default Library search dir on windows." )
endif()
if ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2012/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2012/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2013/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2013/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x32/")
endif()
IF (NOT APPLE )
# Look for the header file.
FIND_PATH(CGAL_INCLUDE_DIR NAMES CGAL/auto_link/auto_link.h
PATHS "${VS_SEARCH_PATH}/CGAL-4.12/include"
"${VS_SEARCH_PATH}/CGAL-4.7/include"
/usr/include
../../External/include
$ENV{CGAL_DIR}/include
"C:/libs/CGAL-3.6/include"
"C:/Program Files/CGAL-3.5/include"
"C:/Programme/CGAL-3.5/include"
"C:/libs/CGAL-3.5/include"
"C:/Program Files/CGAL-3.4/include"
"C:/Programme/CGAL-3.4/include"
"C:/libs/CGAL-3.4/include"
"C:/Programme/CGAL-3.9/include"
"C:/Program Files/CGAL-3.9/include"
"C:/Program Files (x86)/CGAL-3.9/include"
${module_file_path}/../../../External/include )
ELSE( NOT APPLE)
# Look for the header file.
FIND_PATH(CGAL_INCLUDE_DIR NAMES CGAL/auto_link/auto_link.h
PATHS "/opt/local/include"
)
ENDIF( NOT APPLE )
MARK_AS_ADVANCED(CGAL_INCLUDE_DIR)
if ("${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}" MATCHES ".*clang.*")
SET(CXX_IS_CLANG true)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[cC][lL][aA][nN][gG]")
SET(CXX_IS_CLANG true)
else()
SET(CXX_IS_CLANG false)
endif()
# Copy the results to the output variables.
IF(CGAL_INCLUDE_DIR )
SET(CGAL_FOUND 1)
SET(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIR})
# Look for the taucs dir.
FIND_PATH(CGAL_TAUCS_DIR NAMES include/taucs.h
PATHS ${CGAL_INCLUDE_DIR}/../auxiliary/taucs)
IF(WIN32)
include(CGAL_GeneratorSpecificSettings)
find_path(CGAL_LIBRARY_DIR
NAMES "CGAL-${CGAL_TOOLSET}-mt.lib"
"CGAL-${CGAL_TOOLSET}-mt-gd.lib"
"CGAL-${CGAL_TOOLSET}-mt-4.12.lib"
"CGAL-${CGAL_TOOLSET}-mt-4.7.lib"
"CGAL-${CGAL_TOOLSET}-mt-4.5.lib"
PATHS "${CGAL_INCLUDE_DIR}/../lib"
DOC "Directory containing the CGAL library"
)
# Binary dir for DLLs
find_path(CGAL_BIN_DIR
NAMES "CGAL-${CGAL_TOOLSET}-mt-4.12.dll"
"CGAL-${CGAL_TOOLSET}-mt-4.7.dll"
"CGAL-${CGAL_TOOLSET}-mt-4.5.dll"
"CGAL-${CGAL_TOOLSET}-mt-gd.dll"
PATHS "${CGAL_INCLUDE_DIR}/../bin"
DOC "Directory containing the CGAL DLLs"
)
MARK_AS_ADVANCED(CGAL_BIN_DIR )
#add_definitions (-DCGAL_AUTOLINK)
ELSEIF( APPLE)
find_path(CGAL_LIBRARY_DIR
NAMES "libCGAL.dylib"
PATHS "/opt/local/lib/"
DOC "Directory containing the CGAL library"
)
list ( APPEND CGAL_LIBRARIES CGAL CGAL_Core CGAL_ImageIO mpfr )
if (NOT CXX_IS_CLANG)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -frounding-math")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -frounding-math")
endif()
ELSE( WIN32 )
find_path(CGAL_LIBRARY_DIR
NAMES "libCGAL.so"
PATHS "/usr/lib/" "/usr/lib64"
DOC "Directory containing the CGAL library"
)
list ( APPEND CGAL_LIBRARIES CGAL CGAL_Core CGAL_ImageIO)
if (NOT CXX_IS_CLANG)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frounding-math")
endif()
# This is needed to link correctly against lapack
add_definitions (-DCGAL_USE_F2C)
ENDIF(WIN32)
ELSE(CGAL_INCLUDE_DIR )
SET(CGAL_FOUND 0)
SET(CGAL_INCLUDE_DIR)
ENDIF(CGAL_INCLUDE_DIR )
#use eigen if available
find_package(EIGEN3)
if ( EIGEN3_FOUND )
add_definitions(-DCGAL_EIGEN3_ENABLED)
endif()
# Report the results.
IF(NOT CGAL_FOUND)
SET(CGAL_DIR_MESSAGE
"CGAL was not found. Make sure CGAL_INCLUDE_DIR is set to the directories containing the include files for CGAL. .")
IF(CGAL_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "${CGAL_DIR_MESSAGE}")
ELSEIF(NOT CGAL_FIND_QUIETLY)
MESSAGE(STATUS "${CGAL_DIR_MESSAGE}")
ELSE(NOT CGAL_FIND_QUIETLY)
ENDIF(CGAL_FIND_REQUIRED)
ELSE (NOT CGAL_FOUND)
IF(NOT CGAL_FIND_QUIETLY)
MESSAGE(STATUS "Looking for CGAL - found")
ENDIF(NOT CGAL_FIND_QUIETLY)
ENDIF(NOT CGAL_FOUND)
GET_FILENAME_COMPONENT(module_file_path ${CMAKE_CURRENT_LIST_FILE} PATH )
# Check if the base path is set
if ( NOT CMAKE_WINDOWS_LIBS_DIR )
# This is the base directory for windows library search used in the finders we shipp.
set(CMAKE_WINDOWS_LIBS_DIR "c:/libs" CACHE STRING "Default Library search dir on windows." )
endif()
if ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2012/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2012/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2013/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2013/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x32/")
endif()
FIND_PACKAGE( CGAL REQUIRED CONFIG
HINTS $ENV{CGAL_DIR}
"${VS_SEARCH_PATH}/CGAL-4.13"
"${VS_SEARCH_PATH}/CGAL-4.12"
/usr/
../../External
${module_file_path}/../../../External
PATH_SUFFIXES lib lib/cmake
NO_CMAKE_PATH # if CMAKE_PREFIX_PATH is set we find CGAL 4.12 instead of 4.13. I dont know why that is.
NO_CMAKE_ENVIRONMENT_PATH) # Set NO_CMAKE_PATH and NO_CMAKE_ENVIRONMENT_PATH to ignore CMAKE_PREFIX_PATH
if (CGAL_FOUND)
set(CGAL_BIN_DIRS ${CGAL_BIN_DIR} ${CGAL_BIN_DIR}/../auxiliary/gmp/lib)
endif()
if (NOT TARGET CGAL::CGAL)
message(FATAL_ERROR "Your CGAL version does not define the CGAL::CGAL target which probably means it is too old")
endif()
\ No newline at end of file
# Try to find the GMP libraries
# GMP_FOUND - system has GMP lib
# GMP_INCLUDE_DIR - the GMP include directory
# GMP_LIBRARY_DIR - Directory where the GMP libraries are located
# GMP_LIBRARIES - the GMP libraries
# GMP_IN_CGAL_AUXILIARY - TRUE if the GMP found is the one distributed with CGAL in the auxiliary folder
include(CGAL_FindPackageHandleStandardArgs)
include(CGAL_GeneratorSpecificSettings)
# Is it already configured?
if (GMP_INCLUDE_DIR AND GMP_LIBRARY_DIR )
set(GMP_FOUND TRUE)
if ( WIN32 )
list ( APPEND GMP_LIBRARIES libgmp-10.lib;libmpfr-4.lib )
endif()
else()
find_package(CGAL)
if (NOT CGAL_FOUND)
message(STATUS "CGAL not found .. required to use taucs!")
set(GMP_FOUND FALSE)
else ()
if ( WIN32 )
find_path(GMP_INCLUDE_DIR
NAMES gmp.h
PATHS "${CGAL_INCLUDE_DIR}/../auxiliary/gmp/include"
DOC "The directory containing the GMP header files"
)
if ( GMP_INCLUDE_DIR STREQUAL "${CMAKE_SOURCE_DIR}/auxiliary/gmp/include" )
cache_set( GMP_IN_CGAL_AUXILIARY TRUE )
endif()
if ( CGAL_AUTO_LINK_ENABLED )
find_path(GMP_LIBRARY_DIR
NAMES "gmp-${CGAL_TOOLSET}-mt.lib" "gmp-${CGAL_TOOLSET}-mt-gd.lib" libgmp-10.lib
PATHS "${CGAL_INCLUDE_DIR}/../auxiliary/gmp/lib"
DOC "Directory containing the GMP library"
)
list ( APPEND GMP_LIBRARIES libgmp-10.lib;libmpfr-4.lib )
else()
find_library(GMP_LIBRARIES NAMES gmp
PATHS ENV GMP_LIB_DIR
DOC "Path to the GMP library"
)
if ( GMP_LIBRARIES )
get_filename_component(GMP_LIBRARY_DIR ${GMP_LIBRARIES} PATH CACHE )
endif()
endif()
# MacOS and Linux
else()
find_path(GMP_INCLUDE_DIR
NAMES gmp.h
PATHS
/usr/include/
/usr/local/include/
/usr/local/include/
/opt/local/include/
${PROJECT_SOURCE_DIR}/MacOS/Libs/include
../../External/include
${module_file_path}/../../../External/include
DOC "The directory containing the GMP header files"
)
find_path(GMP_LIBRARY_DIR
NAMES "libgmp.so" "libgmp.dylib"
PATHS
/usr/lib/
/usr/lib64/
/usr/lib/x86_64-linux-gnu/
/usr/local/lib/
/usr/local/lib/
/opt/local/lib/
${PROJECT_SOURCE_DIR}/MacOS/Libs/lib/
../../External/lib/
${module_file_path}/../../../External/lib/
DOC "Directory containing the GMP library"
)
find_library(GMP_LIBRARIES NAMES gmp
PATHS ENV GMP_LIBRARY_DIR
DOC "Path to the GMP library"
)
endif()
# Attempt to load a user-defined configuration for GMP if couldn't be found
if ( NOT GMP_INCLUDE_DIR OR NOT GMP_LIBRARY_DIR )
include( GMPConfig OPTIONAL )
endif()
find_package_handle_standard_args(GMP "DEFAULT_MSG" GMP_INCLUDE_DIR GMP_LIBRARY_DIR)
endif()
endif()
......@@ -12,7 +12,7 @@ set (GUROBI_ENABLE OFF CACHE BOOL "Enable gurobi?")
if ( GUROBI_ENABLE )
set (GUROBI_BASE "c:" CACHE PATH "Base path of your gurobi installation")
if (GUROBI_INCLUDE_DIR)
if (GUROBI_INCLUDE_DIR AND GUROBI_CXX_LIBRARY AND GUROBI_LIBRARY)
# in cache already
set(GUROBI_FOUND TRUE)
set(GUROBI_INCLUDE_DIRS "${GUROBI_INCLUDE_DIR}" )
......@@ -94,6 +94,6 @@ find_package_handle_standard_args(GUROBI DEFAULT_MSG
mark_as_advanced(GUROBI_INCLUDE_DIR GUROBI_LIBRARY GUROBI_CXX_LIBRARY GUROBI_BIN_DIR )
endif(GUROBI_INCLUDE_DIR)
endif()
endif()
# Find Geogram
# ------------
#
# Find Geogram include dirs and libraries
#
# This module defines the following variables:
#
# Geogram_FOUND - True if geogram has been found.
# Geogram::geogram - Imported target for the main Geogram library.
# Geogram::geogram_gfx - Imported target for Geogram graphics library.
#
# This module reads hints about the Geogram location from the following
# environment variables:
#
# GEOGRAM_INSTALL_PREFIX - Directory where Geogram is installed.
#
# Authors: Jeremie Dumas
# Pierre Moulon
# Bruno Levy
set (GEOGRAM_SEARCH_PATHS
${GEOGRAM_INSTALL_PREFIX}
"$ENV{GEOGRAM_INSTALL_PREFIX}"
"/usr/local/"
"$ENV{PROGRAMFILES}/Geogram"
"$ENV{PROGRAMW6432}/Geogram"
)
set (GEOGRAM_SEARCH_PATHS_SYSTEM