Commit 79916b47 authored by David Bommes's avatar David Bommes

(1) removed CGAL finder since a better one is shipped with CGAL. (2) adapted...

(1) removed CGAL finder since a better one is shipped with CGAL. (2) adapted PhySim finder to handle qwt as optional dependency. (3) added Geogram finder
parent 4cbd0db4
# - 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)
# 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
"/usr/lib"
"/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}"
)
find_path (GEOGRAM_INCLUDE_DIR
geogram/basic/common.h
PATHS ${GEOGRAM_SEARCH_PATHS}
PATH_SUFFIXES include/geogram1
)
find_library (GEOGRAM_LIBRARY
NAMES geogram
PATHS ${GEOGRAM_SEARCH_PATHS}
PATH_SUFFIXES lib
)
find_library (GEOGRAM_GFX_LIBRARY
NAMES geogram_gfx
PATHS ${GEOGRAM_SEARCH_PATHS}
PATH_SUFFIXES lib
)
# This one we search in both Geogram search path and
# system search path since it may be already installed
# in the system
find_library (GEOGRAM_GLFW3_LIBRARY
NAMES glfw3 glfw geogram_glfw3
PATHS ${GEOGRAM_SEARCH_PATHS} ${GEOGRAM_SEARCH_PATHS_SYSTEM}
PATH_SUFFIXES lib
)
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args(
GEOGRAM DEFAULT_MSG GEOGRAM_LIBRARY GEOGRAM_INCLUDE_DIR
)
# Create an imported target for Geogram
If (GEOGRAM_FOUND)
set(GEOGRAM_INSTALL_PREFIX ${GEOGRAM_INCLUDE_DIR}/..)
if (NOT TARGET Geogram::geogram)
add_library (Geogram::geogram UNKNOWN IMPORTED)
# Interface include directory
set_target_Properties(Geogram::geogram PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GEOGRAM_INCLUDE_DIR}"
)
# Link to library file
Set_Target_Properties(Geogram::geogram PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GEOGRAM_LIBRARY}"
)
endif ()
if (NOT TARGET Geogram::geogram_gfx)
add_library (Geogram::geogram_gfx UNKNOWN IMPORTED)
set_target_properties(Geogram::geogram_gfx PROPERTIES
INTERFACE_LINK_LIBRARIES ${GEOGRAM_GLFW3_LIBRARY}
)
# Interface include directory
set_target_properties(Geogram::geogram_gfx PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GEOGRAM_INCLUDE_DIR}"
)
# Link to library file
set_target_properties(Geogram::geogram_gfx PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GEOGRAM_GFX_LIBRARY}"
)
endif ()
endif ()
# Hide variables from the default CMake-Gui options
mark_as_advanced (GEOGRAM_LIBRARY GEOGRAM_GFX_LIBRARY GEOGRAM_INCLUDE_DIR)
# Some specific settings for Windows
if(WIN32)
# Default mode for Windows uses static libraries. Use this variable to
# link with geogram compiled as DLLs.
set(VORPALINE_BUILD_DYNAMIC FALSE CACHE BOOL "Installed Geogram uses DLLs")
# remove warning for multiply defined symbols (caused by multiple
# instanciations of STL templates)
add_definitions(/wd4251)
# remove all unused stuff from windows.h
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-DVC_EXTRALEAN)
# do not define a min() and a max() macro, breaks
# std::min() and std::max() !!
add_definitions(-DNOMINMAX )
# we want M_PI etc...
add_definitions(-D_USE_MATH_DEFINES)
if(NOT VORPALINE_BUILD_DYNAMIC)
# If we use static library, we link with the static C++ runtime.
foreach(config ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${config} config)
string(REPLACE /MD /MT CMAKE_C_FLAGS_${config} "${CMAKE_C_FLAGS_${config}}")
string(REPLACE /MD /MT CMAKE_CXX_FLAGS_${config} "${CMAKE_CXX_FLAGS_${config}}")
endforeach()
endif()
endif()
# - Try to find PHYSIM
# Once done this will define
#
#
# PHYSIM_FOUND - system has PHYSIM
# PHYSIM_INCLUDE_DIRS - the PHYSIM include directory
# PHYSIM_LIBRARY_DIR - where the libraries are
# PHYSIM_LIBRARY - Link these to use PHYSIM
#
#
IF (PHYSIM_INCLUDE_DIRS)
# Already in cache, be silent
SET(PHYSIM_FIND_QUIETLY TRUE)
......@@ -20,17 +20,18 @@ file (
FIND_PATH(PHYSIM_INCLUDE_DIR PhySim/Config/PhySimDefines.hh
PATHS ${_libdirs}
PATHS ${_libdirs}
${CMAKE_SOURCE_DIR}/libs )
add_definitions (-DPHYSIMDLL -DUSEPHYSIM )
if (PHYSIM_ENABLE_QWT)
if (QT5_FOUND)
SET( PHYSIM_DEPS "Qwt6;GMP" )
SET( PHYSIM_DEPS "Qwt6" )
else ()
SET( PHYSIM_DEPS "Qwt5;GMP" )
SET( PHYSIM_DEPS "Qwt5" )
endif ()
endif (PHYSIM_ENABLE_QWT)
IF (PHYSIM_INCLUDE_DIR)
SET(PHYSIM_FOUND TRUE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment