Commit 904dad89 authored by Jan Möbius's avatar Jan Möbius

Moved cmake directory contents into cmake dir in OpenFlipper to reduce number of toplevel dirs

parent 9196920b
This diff is collapsed.
################################################################################
# Custom settings for compiler flags and similar
################################################################################
if ( WIN32 )
################################################################################
# Windows large memory support
################################################################################
if ( NOT DEFINED WINDOWS_LARGE_MEMORY_SUPPORT )
set( WINDOWS_LARGE_MEMORY_SUPPORT true CACHE BOOL "Enable or disable binary support for large memory" )
endif()
set( ADDITIONAL_CMAKE_EXE_LINKER_FLAGS )
set( ADDITIONAL_CMAKE_SHARED_LINKER_FLAGS )
set( ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS )
if ( WINDOWS_LARGE_MEMORY_SUPPORT )
list(APPEND ADDITIONAL_CMAKE_EXE_LINKER_FLAGS "/LARGEADDRESSAWARE" )
list(APPEND ADDITIONAL_CMAKE_SHARED_LINKER_FLAGS "/LARGEADDRESSAWARE" )
list(APPEND ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS "/LARGEADDRESSAWARE" )
endif()
foreach( flag ${ADDITIONAL_CMAKE_EXE_LINKER_FLAGS} )
if( NOT CMAKE_EXE_LINKER_FLAGS MATCHES "${flag}" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flag} ")
endif()
endforeach()
foreach( flag ${ADDITIONAL_CMAKE_SHARED_LINKER_FLAGS} )
if( NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "${flag}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${flag} ")
endif()
endforeach()
foreach( flag ${ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS} )
if( NOT CMAKE_MODULE_LINKER_FLAGS MATCHES "${flag}" )
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${flag} ")
endif()
endforeach()
endif( WIN32 )
if (UNIX)
set ( ADDITIONAL_CXX_DEBUG_FLAGS )
set ( ADDITIONAL_CXX_RELEASE_FLAGS )
set ( ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS )
set ( ADDITIONAL_C_DEBUG_FLAGS )
set ( ADDITIONAL_C_RELEASE_FLAGS )
set ( ADDITIONAL_C_RELWITHDEBINFO_FLAGS )
################################################################################
# Defaults
################################################################################
# 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" )
# 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()
################################################################################
# Build/Release Defines
################################################################################
IF( NOT CMAKE_SYSTEM MATCHES "SunOS*")
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-DDEBUG" )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-DNDEBUG" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-DDEBUG" )
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-DDEBUG" )
list(APPEND ADDITIONAL_C_RELEASE_FLAGS "-DNDEBUG" )
list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS "-DDEBUG" )
ENDIF()
################################################################################
# Warnings
################################################################################
# Add the standard compiler warnings
if ( NOT COMPILER_WARNINGS )
IF ( APPLE )
# Skip unused parameters as it has to be used for the documentation via doxygen and the interfaces
set ( COMPILER_WARNINGS "-W" "-Wall" "-Wno-unused" "-Wextra" "-Wno-non-virtual-dtor" "-Wno-unused-parameter" "-Wno-variadic-macros" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
elseif ("${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}" MATCHES ".*clang")
set ( COMPILER_WARNINGS "-W" "-Wall" "-Wextra" "-Wno-non-virtual-dtor" "-Wno-unused-parameter" "-Wno-variadic-macros" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
ELSEIF ( CMAKE_SYSTEM MATCHES "SunOS*" )
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 ( 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} )
################################################################################
# STL Vector checks
################################################################################
# Pre initialize stl vector check variable
if ( NOT STL_VECTOR_CHECKS )
set ( STL_VECTOR_CHECKS false CACHE BOOL "Include full stl vector checks in debug mode (This option is only used in debug Mode!)" )
endif ( NOT STL_VECTOR_CHECKS )
# Add a flag to check stl vectors in debugging mode
if ( STL_VECTOR_CHECKS AND NOT CMAKE_SYSTEM MATCHES "SunOS*" )
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
endif()
################################################################################
# Process the additional flags:
################################################################################
# Add the debug flags
foreach( flag ${ADDITIONAL_CXX_DEBUG_FLAGS} )
if( NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "${flag}" )
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}" )
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}" )
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}" )
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}" )
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}" )
set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
#TODO : Test and remove it?!
IF( CMAKE_SYSTEM MATCHES "SunOS*")
set (CMAKE_CFLAGS_RELEASE "-xO3")
set (CMAKE_CXX_FLAGS_RELEASE "-xO3")
endif ( CMAKE_SYSTEM MATCHES "SunOS*" )
endif ()
# -helper macro to add a "doc" target with CMake build system.
# and configure doxy.config.in to doxy.config
#
# target "doc" allows building the documentation with doxygen/dot on WIN32 and Linux
# Creates .chm windows help file if MS HTML help workshop
# (available from http://msdn.microsoft.com/workshop/author/htmlhelp)
# is installed with its DLLs in PATH.
#
#
# Please note, that the tools, e.g.:
# doxygen, dot, latex, dvips, makeindex, gswin32, etc.
# must be in path.
#
# Note about Visual Studio Projects:
# MSVS hast its own path environment which may differ from the shell.
# See "Menu Tools/Options/Projects/VC++ Directories" in VS 7.1
#
# author Jan Woetzel 2004-2006
# www.mip.informatik.uni-kiel.de/~jw
FIND_PACKAGE(Doxygen)
IF (DOXYGEN_FOUND)
# click+jump in Emacs and Visual Studio (for doxy.config) (jw)
IF (CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
SET(DOXY_WARN_FORMAT "\"$file($line) : $text \"")
ELSE (CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
SET(DOXY_WARN_FORMAT "\"$file:$line: $text \"")
ENDIF (CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
# we need latex for doxygen because of the formulas
FIND_PACKAGE(LATEX)
IF (NOT LATEX_COMPILER)
MESSAGE(STATUS "latex command LATEX_COMPILER not found but usually required. You will probably get warnings and user inetraction on doxy run.")
ENDIF (NOT LATEX_COMPILER)
IF (NOT MAKEINDEX_COMPILER)
MESSAGE(STATUS "makeindex command MAKEINDEX_COMPILER not found but usually required.")
ENDIF (NOT MAKEINDEX_COMPILER)
IF (NOT DVIPS_CONVERTER)
MESSAGE(STATUS "dvips command DVIPS_CONVERTER not found but usually required.")
ENDIF (NOT DVIPS_CONVERTER)
# This macro generates a new doc target. acg_create_doc_target( targetName [directory with the doxy.config.in] [dependency])
# if no parameter is used except the target, a target of the given name will be created from the current source directories doxyfile and added as a dependency to the doc target
# The first additional parameter is used to specify a directory where the doxyfile will be used
# The second parameter defines a target, that will depend on the newly generated one. (Default is doc)
macro (acg_create_doc_target target)
set( DOC_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
set( DOC_DEPENDENCY "doc")
# collect arguments
if ( ${ARGC} EQUAL 2)
set( DOC_DIRECTORY "${ARGV1}" )
elseif ( ${ARGC} EQUAL 3)
set( DOC_DIRECTORY "${ARGV1}" )
set( DOC_DEPENDENCY "${ARGV2}" )
elseif( $ARGC GREATER 3 )
set( DOC_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
# failed as we do not know how to handle the parameters
MESSAGE(SEND_ERROR "Unknown parameter for acg_create_doc_target!")
endif()
# If there exists an doxy.config.in, we configure it.
IF (EXISTS "${DOC_DIRECTORY}/doxy.config.in")
#MESSAGE(STATUS "configured ${DOC_DIRECTORY}/doxy.config.in --> ${CMAKE_CURRENT_BINARY_DIR}/doxy.config")
CONFIGURE_FILE(${DOC_DIRECTORY}/doxy.config.in
${CMAKE_CURRENT_BINARY_DIR}/doxy.config
@ONLY )
# use (configured) doxy.config from (out of place) BUILD tree:
SET(DOXY_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/doxy.config")
ELSE (EXISTS "${DOC_DIRECTORY}/doxy.config.in")
# use static hand-edited doxy.config from SOURCE tree:
SET(DOXY_CONFIG "${DOC_DIRECTORY}/doxy.config")
IF (EXISTS "${DOC_DIRECTORY}/doxy.config")
MESSAGE(STATUS "WARNING: using existing ${DOC_DIRECTORY}/doxy.config instead of configuring from doxy.config.in file.")
ELSE (EXISTS "${DOC_DIRECTORY}/doxy.config")
IF (EXISTS "${CMAKE_MODULE_PATH}/doxy.config.in")
# using template doxy.config.in
#MESSAGE(STATUS "configured ${CMAKE_CMAKE_MODULE_PATH}/doxy.config.in --> ${CMAKE_CURRENT_BINARY_DIR}/doxy.config")
CONFIGURE_FILE(${CMAKE_MODULE_PATH}/doxy.config.in
${CMAKE_CURRENT_BINARY_DIR}/doxy.config
@ONLY )
SET(DOXY_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/doxy.config")
ELSE (EXISTS "${CMAKE_MODULE_PATH}/doxy.config.in")
# failed completely...
MESSAGE(SEND_ERROR "Please create ${DOC_DIRECTORY}/doxy.config.in (or doxy.config as fallback)")
ENDIF(EXISTS "${CMAKE_MODULE_PATH}/doxy.config.in")
ENDIF(EXISTS "${DOC_DIRECTORY}/doxy.config")
ENDIF(EXISTS "${DOC_DIRECTORY}/doxy.config.in")
ADD_CUSTOM_TARGET(${target} ${DOXYGEN_EXECUTABLE} ${DOXY_CONFIG})
# Group by folders on MSVC
GROUP_PROJECT( ${target} "Documentation")
add_dependencies( ${DOC_DEPENDENCY} ${target} )
# # Add winhelp target only once!
# GET_TARGET_PROPERTY(target_location winhelp EchoString)
# if ( NOT target_location STREQUAL "Building Windows Documentation" )
# ADD_CUSTOM_TARGET( winhelp )
# SET_TARGET_PROPERTIES( winhelp PROPERTIES EchoString "Building Windows Documentation" )
# endif()
# create a windows help .chm file using hhc.exe
# HTMLHelp DLL must be in path!
# fallback: use hhw.exe interactively
# IF (WIN32)
# FIND_PACKAGE(HTMLHelp)
# IF (HTML_HELP_COMPILER)
# SET (TMP "${CMAKE_CURRENT_BINARY_DIR}\\Doc\\html\\index.hhp")
# STRING(REGEX REPLACE "[/]" "\\\\" HHP_FILE ${TMP} )
# # MESSAGE(SEND_ERROR "DBG HHP_FILE=${HHP_FILE}")
# ADD_CUSTOM_TARGET(winhelp-${target} ${HTML_HELP_COMPILER} ${HHP_FILE})
# ADD_DEPENDENCIES (winhelp-${target} ${target})
#
# add_dependencies(winhelp winhelp-${target})
#
#
# IF (NOT TARGET_DOC_SKIP_INSTALL)
# # install windows help?
# # determine useful name for output file
# # should be project and version unique to allow installing
# # multiple projects into one global directory
# IF (EXISTS "${PROJECT_BINARY_DIR}/Doc/html/index.chm")
# IF (PROJECT_NAME)
# SET(OUT "${PROJECT_NAME}")
# ELSE (PROJECT_NAME)
# SET(OUT "Documentation") # default
# ENDIF(PROJECT_NAME)
# IF (${PROJECT_NAME}_VERSION_MAJOR)
# SET(OUT "${OUT}-${${PROJECT_NAME}_VERSION_MAJOR}")
# IF (${PROJECT_NAME}_VERSION_MINOR)
# SET(OUT "${OUT}.${${PROJECT_NAME}_VERSION_MINOR}")
# IF (${PROJECT_NAME}_VERSION_PATCH)
# SET(OUT "${OUT}.${${PROJECT_NAME}_VERSION_PATCH}")
# ENDIF(${PROJECT_NAME}_VERSION_PATCH)
# ENDIF(${PROJECT_NAME}_VERSION_MINOR)
# ENDIF(${PROJECT_NAME}_VERSION_MAJOR)
# # keep suffix
# SET(OUT "${OUT}.chm")
#
# #MESSAGE("DBG ${PROJECT_BINARY_DIR}/Doc/html/index.chm \n${OUT}")
# # create target used by install and package commands
# INSTALL(FILES "${PROJECT_BINARY_DIR}/Doc/html/index.chm"
# DESTINATION "doc"
# RENAME "${OUT}"
# )
# ENDIF(EXISTS "${PROJECT_BINARY_DIR}/Doc/html/index.chm")
# ENDIF(NOT TARGET_DOC_SKIP_INSTALL)
#
# ENDIF(HTML_HELP_COMPILER)
# # MESSAGE(SEND_ERROR "HTML_HELP_COMPILER=${HTML_HELP_COMPILER}")
# ENDIF (WIN32)
endmacro ()
ENDIF(DOXYGEN_FOUND)
# fill string with spaces
macro (acg_format_string str length return)
string (LENGTH "${str}" _str_len)
math (EXPR _add_chr "${length} - ${_str_len}")
set (${return} "${str}")
while (_add_chr GREATER 0)
set (${return} "${${return}} ")
math (EXPR _add_chr "${_add_chr} - 1")
endwhile ()
endmacro ()
# print message with color escape sequences if CMAKE_COLOR_MAKEFILE is set
string (ASCII 27 _escape)
function (acg_color_message _str)
if (CMAKE_COLOR_MAKEFILE AND NOT WIN32)
message (${_str})
else ()
string (REGEX REPLACE "${_escape}.[0123456789;]*m" "" __str ${_str})
message (${__str})
endif ()
endfunction ()
# info header
function (acg_print_configure_header _id _name)
acg_format_string ("${_name}" 40 _project)
acg_format_string ("${${_id}_VERSION}" 40 _version)
acg_color_message ("\n${_escape}[40;37m************************************************************${_escape}[0m")
acg_color_message ("${_escape}[40;37m* ${_escape}[1;31mACG ${_escape}[0;40;34mBuildsystem${_escape}[0m${_escape}[40;37m *${_escape}[0m")
acg_color_message ("${_escape}[40;37m* *${_escape}[0m")
acg_color_message ("${_escape}[40;37m* Package : ${_escape}[32m${_project} ${_escape}[37m *${_escape}[0m")
acg_color_message ("${_escape}[40;37m* Version : ${_escape}[32m${_version} ${_escape}[37m *${_escape}[0m")
acg_color_message ("${_escape}[40;37m************************************************************${_escape}[0m")
endfunction ()
# info line
function (acg_print_configure_footer)
acg_color_message ("${_escape}[40;37m************************************************************${_escape}[0m\n")
endfunction ()
This diff is collapsed.
# 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 )
if ( MSVC )
set(CGAL_AUTO_LINK_ENABLED TRUE)
endif()
if (MSVC12)
set(CGAL_TOOLSET "vc120")
elseif ( MSVC11 )
set(CGAL_TOOLSET "vc110")
elseif ( MSVC10 )
set(CGAL_TOOLSET "vc100")
elseif ( MSVC90 )
set(CGAL_TOOLSET "vc90")
elseif ( MSVC80 )
set(CGAL_TOOLSET "vc80")
elseif ( MSVC71 )
set(CGAL_TOOLSET "vc71")
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})
if (DARWIN_VERSION GREATER 8)
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" )
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.
# - Try to find ACG
# Once done this will define
#
# ACG_FOUND - system has ACG
# ACG_INCLUDE_DIR - theACG include directory
# ACG_LIBRARY - Link these to use ACG
# ACG_LIBRARY_DIR - Library DIR of ACG
#
IF (ACG_INCLUDE_DIRS)
# Already in cache, be silent
SET(ACG_FIND_QUIETLY TRUE)
ENDIF (ACG_INCLUDE_DIRS)
#SET(ACG_LIBRARY_DIR "" CACHE INTERNAL "Path to ACG Library")
FIND_PATH(ACG_INCLUDE_DIR ACG/QtWidgets/QtBaseViewer.hh
PATHS /usr/local/include
/usr/include
"${CMAKE_SOURCE_DIR}/"
"${CMAKE_SOURCE_DIR}/../"
/ACG/acgdev/gcc-4.3-x86_64/OM2/ACG-2.0/include
)
IF (ACG_INCLUDE_DIR )
SET(ACG_FOUND TRUE)
# TODO: Set correct library path!!
SET(ACG_LIBRARY_DIR "${ACG_INCLUDE_DIR}/../lib/" CACHE PATH "Path to ACG Library")
SET(ACG_LIBRARY "ACG")
IF(WIN32)
add_definitions (-DACGDLL -DUSEACG )
ENDIF(WIN32)
ELSE (ACG_INCLUDE_DIR)
SET(ACG_FOUND FALSE )
ENDIF (ACG_INCLUDE_DIR )
# - Try to find ADOLC
# Once done this will define
# ADOLC_FOUND - System has ADOLC
# ADOLC_INCLUDE_DIRS - The ADOLC include directories
# ADOLC_LIBRARIES - The libraries needed to use ADOLC
if (ADOLC_INCLUDE_DIR)
# in cache already
set(ADOLC_FOUND TRUE)
set(ADOLC_INCLUDE_DIRS "${ADOLC_INCLUDE_DIR}" )
set(ADOLC_LIBRARIES "${ADOLC_LIBRARY}" )
else (ADOLC_INCLUDE_DIR)
message( status "adolc include dir: ${ADOLC_DIR}/include/")
find_path( ADOLC_INCLUDE_DIR
NAMES adolc/adolc.h
PATHS $ENV{ADOLC_DIR}/include/
/usr/include/adolc
/usr/local/include
/usr/local/include/adolc/
/opt/local/include/adolc/
"c:\\libs\\adolc\\include"
"c:\\libs\\adolc\\include"
${PROJECT_SOURCE_DIR}/MacOS/Libs/adolc/include
../../External/include
${module_file_path}/../../../External/include
)
find_library( ADOLC_LIBRARY
adolc
PATHS $ENV{ADOLC_DIR}/lib
$ENV{ADOLC_DIR}/lib64
/usr/lib/adolc