Skip to content
Snippets Groups Projects
Commit 2ddf4658 authored by Mattias Ellert's avatar Mattias Ellert Committed by Pere Mato Vila
Browse files

Implement builtin-gl2ps option

ROOT uses builtin gl2ps sources, but has no switch to use the system
library instead. This adds this missing option.
parent c0bdb875
No related branches found
No related tags found
No related merge requests found
# - Locate gl2ps library
# Defines:
#
# GL2PS_FOUND
# GL2PS_INCLUDE_DIR
# GL2PS_INCLUDE_DIRS (not cached)
# GL2PS_LIBRARIES
find_path(GL2PS_INCLUDE_DIR NAMES gl2ps.h HINTS ${GL2PS_DIR}/include $ENV{GL2PS_DIR}/include /usr/include)
find_library(GL2PS_LIBRARY NAMES gl2ps HINTS ${GL2PS_DIR}/lib $ENV{GL2PS_DIR}/lib)
set(GL2PS_INCLUDE_DIRS ${GL2PS_INCLUDE_DIR})
set(GL2PS_LIBRARIES ${GL2PS_LIBRARY})
# handle the QUIETLY and REQUIRED arguments and set GL2PS_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GL2PS DEFAULT_MSG GL2PS_LIBRARY GL2PS_INCLUDE_DIR)
mark_as_advanced(GL2PS_FOUND GL2PS_INCLUDE_DIR GL2PS_LIBRARY)
...@@ -70,6 +70,7 @@ ROOT_BUILD_OPTION(builtin_afterimage ON "Build included libAfterImage, or use sy ...@@ -70,6 +70,7 @@ ROOT_BUILD_OPTION(builtin_afterimage ON "Build included libAfterImage, or use sy
ROOT_BUILD_OPTION(builtin_fftw3 OFF "Build the FFTW3 library internally (downloading tarfile from the Web)") ROOT_BUILD_OPTION(builtin_fftw3 OFF "Build the FFTW3 library internally (downloading tarfile from the Web)")
ROOT_BUILD_OPTION(builtin_ftgl ON "Build included libFTGL, or use system libftgl") ROOT_BUILD_OPTION(builtin_ftgl ON "Build included libFTGL, or use system libftgl")
ROOT_BUILD_OPTION(builtin_freetype OFF "Build included libfreetype, or use system libfreetype") ROOT_BUILD_OPTION(builtin_freetype OFF "Build included libfreetype, or use system libfreetype")
ROOT_BUILD_OPTION(builtin_gl2ps OFF "Build included libgl2ps, or use system libgl2ps")
ROOT_BUILD_OPTION(builtin_glew ON "Build included libGLEW, or use system libGLEW") ROOT_BUILD_OPTION(builtin_glew ON "Build included libGLEW, or use system libGLEW")
ROOT_BUILD_OPTION(builtin_openssl OFF "Build OpenSSL internally, or use system OpenSSL") ROOT_BUILD_OPTION(builtin_openssl OFF "Build OpenSSL internally, or use system OpenSSL")
ROOT_BUILD_OPTION(builtin_pcre OFF "Build included libpcre, or use system libpcre") ROOT_BUILD_OPTION(builtin_pcre OFF "Build included libpcre, or use system libpcre")
......
...@@ -153,6 +153,11 @@ set(openglulib ${OPENGL_glu_LIBRARY}) ...@@ -153,6 +153,11 @@ set(openglulib ${OPENGL_glu_LIBRARY})
set(opengllib ${OPENGL_gl_LIBRARY}) set(opengllib ${OPENGL_gl_LIBRARY})
set(openglincdir ${OPENGL_INCLUDE_DIR}) set(openglincdir ${OPENGL_INCLUDE_DIR})
set(builtingl2ps ${value${builtin_gl2ps}})
set(gl2pslibdir ${GL2PS_LIBRARY_DIR})
set(gl2pslib ${GL2PS_LIBRARY})
set(gl2psincdir ${GL2PS_INCLUDE_DIR})
set(buildldap ${value${ldap}}) set(buildldap ${value${ldap}})
set(ldaplibdir ${LDAP_LIBRARY_DIR}) set(ldaplibdir ${LDAP_LIBRARY_DIR})
set(ldaplib ${LDAP_LIBRARY}) set(ldaplib ${LDAP_LIBRARY})
......
...@@ -450,6 +450,16 @@ if(opengl) ...@@ -450,6 +450,16 @@ if(opengl)
endif() endif()
endif() endif()
#---Check for gl2ps ------------------------------------------------------------------
if(NOT builtin_gl2ps)
message(STATUS "Looking for gl2ps")
find_Package(gl2ps)
if(NOT GL2PS_FOUND)
message(STATUS "gl2ps not found. Switching on builtin_gl2ps option")
set(builtin_gl2ps ON CACHE BOOL "" FORCE)
endif()
endif()
#---Check for Graphviz installation------------------------------------------------------- #---Check for Graphviz installation-------------------------------------------------------
if(gviz) if(gviz)
message(STATUS "Looking for Graphviz") message(STATUS "Looking for Graphviz")
......
...@@ -143,6 +143,11 @@ OPENGLULIB := @openglulib@ ...@@ -143,6 +143,11 @@ OPENGLULIB := @openglulib@
OPENGLLIB := @opengllib@ OPENGLLIB := @opengllib@
OPENGLINCDIR := $(filter-out /usr/include, @openglincdir@) OPENGLINCDIR := $(filter-out /usr/include, @openglincdir@)
BUILTINGL2PS := @builtingl2ps@
GL2PSLIBDIR := @gl2pslibdir@
GL2PSCLILIB := @gl2pslib@
GL2PSINCDIR := $(filter-out /usr/include, @gl2psincdir@)
BUILDLDAP := @buildldap@ BUILDLDAP := @buildldap@
LDAPLIBDIR := @ldaplibdir@ LDAPLIBDIR := @ldaplibdir@
LDAPCLILIB := @ldaplib@ LDAPCLILIB := @ldaplib@
......
...@@ -53,6 +53,7 @@ options=" \ ...@@ -53,6 +53,7 @@ options=" \
enable_builtin_afterimage \ enable_builtin_afterimage \
enable_builtin_ftgl \ enable_builtin_ftgl \
enable_builtin_freetype \ enable_builtin_freetype \
enable_builtin_gl2ps \
enable_builtin_glew \ enable_builtin_glew \
enable_builtin_pcre \ enable_builtin_pcre \
enable_builtin_unuran \ enable_builtin_unuran \
...@@ -186,6 +187,7 @@ enable_werror=no ...@@ -186,6 +187,7 @@ enable_werror=no
enable_winrtdebug= enable_winrtdebug=
enable_builtin_freetype=no enable_builtin_freetype=no
enable_builtin_ftgl=no enable_builtin_ftgl=no
enable_builtin_gl2ps=no
enable_builtin_glew=no enable_builtin_glew=no
enable_builtin_pcre=no enable_builtin_pcre=no
enable_builtin_unuran=no enable_builtin_unuran=no
...@@ -1709,6 +1711,7 @@ enable/disable options, prefix with either --enable- or --disable- ...@@ -1709,6 +1711,7 @@ enable/disable options, prefix with either --enable- or --disable-
builtin-afterimage Build included libAfterImage, or use system libAfterImage builtin-afterimage Build included libAfterImage, or use system libAfterImage
builtin-ftgl Build included libFTGL, or use system libftgl builtin-ftgl Build included libFTGL, or use system libftgl
builtin-freetype Build included libfreetype, or use system libfreetype builtin-freetype Build included libfreetype, or use system libfreetype
builtin-gl2ps Build included libgl2ps, or use system libgl2ps
builtin-glew Build included libGLEW, or use system libGLEW builtin-glew Build included libGLEW, or use system libGLEW
builtin-pcre Build included libpcre, or use system libpcre builtin-pcre Build included libpcre, or use system libpcre
builtin-unuran Build included libunuran, or use system libunuran builtin-unuran Build included libunuran, or use system libunuran
...@@ -2058,6 +2061,7 @@ win32) ...@@ -2058,6 +2061,7 @@ win32)
logmsg "Will use by default builtin versions of libraries on Win32" logmsg "Will use by default builtin versions of libraries on Win32"
enable_builtin_freetype="yes" enable_builtin_freetype="yes"
enable_builtin_ftgl="yes" enable_builtin_ftgl="yes"
enable_builtin_gl2ps="yes"
enable_builtin_glew="yes" enable_builtin_glew="yes"
enable_builtin_pcre="yes" enable_builtin_pcre="yes"
enable_builtin_unuran="yes" enable_builtin_unuran="yes"
...@@ -3254,6 +3258,38 @@ fi ...@@ -3254,6 +3258,38 @@ fi
message "Checking whether to build included libfreetype6" message "Checking whether to build included libfreetype6"
result "$enable_builtin_freetype" result "$enable_builtin_freetype"
######################################################################
#
### echo %%% libgl2ps (builtin or system)
#
if test "x$enable_builtin_gl2ps" = "xno" ; then
check_header "gl2ps.h" "" \
$GL2PS ${GL2PS:+$GL2PS/include} /usr/include
if test "x$found_dir" = "x" ; then
enable_builtin_gl2ps=yes
else
gl2psinc=$found_hdr
gl2psincdir=$found_dir
fi
check_library "libgl2ps" "$enable_shared" "" \
$GL2PS ${GL2PS:+$GL2PS/lib} /usr/lib
if test "x$found_lib" = "x" ; then
gl2pslib=""
gl2pslibdir=""
enable_builtin_gl2ps="yes"
else
gl2pslib="$found_lib"
gl2pslibdir="$found_dir"
fi
if test "x$gl2psincdir" = "x" || test "x$gl2pslib" = "x"; then
enable_builtin_gl2ps="yes"
fi
fi
message "Checking whether to build included gl2ps"
result "$enable_builtin_gl2ps"
###################################################################### ######################################################################
# #
### echo %%% libpcre (builtin or system) - Mandatory lib ### echo %%% libpcre (builtin or system) - Mandatory lib
...@@ -7738,6 +7774,10 @@ sed -e "s|@aclocaldir@|$aclocaldir|" \ ...@@ -7738,6 +7774,10 @@ sed -e "s|@aclocaldir@|$aclocaldir|" \
-e "s|@ftglincdir@|$ftglincdir|" \ -e "s|@ftglincdir@|$ftglincdir|" \
-e "s|@ftgllibdir@|$ftgllibdir|" \ -e "s|@ftgllibdir@|$ftgllibdir|" \
-e "s|@ftgllibs@|$ftgllibs|" \ -e "s|@ftgllibs@|$ftgllibs|" \
-e "s|@builtingl2ps@|$enable_builtin_gl2ps|" \
-e "s|@gl2psincdir@|$gl2psincdir|" \
-e "s|@gl2pslib@|$gl2pslib|" \
-e "s|@gl2pslibdir@|$gl2pslibdir|" \
-e "s|@glewincdir@|$glewincdir|" \ -e "s|@glewincdir@|$glewincdir|" \
-e "s|@glewlibdir@|$glewlibdir|" \ -e "s|@glewlibdir@|$glewlibdir|" \
-e "s|@glewlibs@|$glewlibs|" \ -e "s|@glewlibs@|$glewlibs|" \
......
...@@ -5,14 +5,22 @@ ...@@ -5,14 +5,22 @@
include_directories(${OPENGL_INCLUDE_DIR} ${FTGL_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS}) include_directories(${OPENGL_INCLUDE_DIR} ${FTGL_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS})
ROOT_GLOB_HEADERS(headers RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/inc ${CMAKE_CURRENT_SOURCE_DIR}/inc/*.h) ROOT_GLOB_HEADERS(headers RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/inc ${CMAKE_CURRENT_SOURCE_DIR}/inc/*.h)
list(REMOVE_ITEM headers CsgOps.h TGLIncludes.h TGLWSIncludes.h list(REMOVE_ITEM headers gl2ps.h CsgOps.h TGLIncludes.h TGLWSIncludes.h
TGLMarchingCubes.h TKDEAdapter.h TGL5DPainter.h TKDEFGT.h TGLIsoMesh.h) TGLMarchingCubes.h TKDEAdapter.h TGL5DPainter.h TKDEFGT.h TGLIsoMesh.h)
set (installoptions OPTIONS REGEX gl2ps.h EXCLUDE)
ROOT_GLOB_SOURCES(sources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cxx) ROOT_GLOB_SOURCES(sources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cxx)
if(WIN32 OR cocoa) if(WIN32 OR cocoa)
list(REMOVE_ITEM headers TX11GL.h) list(REMOVE_ITEM headers TX11GL.h)
list(REMOVE_ITEM sources TX11GL.cxx) list(REMOVE_ITEM sources TX11GL.cxx)
set(installoptions OPTIONS REGEX "TX11GL" EXCLUDE) set(installoptions ${installoptions} REGEX TX11GL.h EXCLUDE)
endif()
if(builtin_gl2ps)
include_directories(AFTER ${CMAKE_CURRENT_SOURCE_DIR}/inc)
else()
list(REMOVE_ITEM sources gl2ps.cxx)
include_directories(${GL2PS_INCLUDE_DIRS})
endif() endif()
if(WIN32) if(WIN32)
...@@ -36,6 +44,6 @@ set_source_files_properties(src/TGLText.cxx PROPERTIES COMPILE_FLAGS "${FTGL_CFL ...@@ -36,6 +44,6 @@ set_source_files_properties(src/TGLText.cxx PROPERTIES COMPILE_FLAGS "${FTGL_CFL
ROOT_GENERATE_DICTIONARY(G__GL ${headers} MODULE RGL LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM") ROOT_GENERATE_DICTIONARY(G__GL ${headers} MODULE RGL LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM")
ROOT_LINKER_LIBRARY(RGL ${sources} G__GL.cxx LIBRARIES ${gllibs} GLEW ${FTGL_LIBRARIES} DEPENDENCIES Hist Gui Ged) ROOT_LINKER_LIBRARY(RGL ${sources} G__GL.cxx LIBRARIES ${gllibs} ${GL2PS_LIBRARIES} GLEW ${FTGL_LIBRARIES} DEPENDENCIES Hist Gui Ged)
ROOT_INSTALL_HEADERS(${installoptions}) ROOT_INSTALL_HEADERS(${installoptions})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment