Commit f4f74e62 authored by Kitware Robot's avatar Kitware Robot Committed by Shawn Waldon

libharu 2018-01-31 (c87803c4)

Code extracted from:

    https://gitlab.kitware.com/third-party/libharu.git

at commit c87803c4155acc7daeefb91f311677a964057e83 (for/vtk-old).
parent f34d6b90
Makefile
Makefile.in
acconfig.h
aclocal.m4
autom4te.cache
buildmk.stamp
config.h.in
config.cache
config.log
config.status
meta_cc
meta_ccld
mkinstalldirs
missing
install-sh
*.lo
*.la
.deps
*.plg
*.opt
*.ncb
.libs
_libs
*.o
*.a
*.tmp
*.so
*.so.*
cscope.out
config.guess
config.sub
configure
configure.in~
libtool
ltmain.sh
_configs.sed
CMakeCache.txt
CMakeFiles
CPackConfig.cmake
CPackSourceConfig.cmake
cmake_install.cmake
depcomp
This diff is collapsed.
Installation
------------
Installing libHaru on Linux/Unix is as easy as this:
./configure && make && make install
You might want to look at ./configure options though.
See more details installation instructions here:
http://libharu.org/wiki/Documentation/Install
Windows binaries are available in the download section:
http://libharu.org/wiki/Download
Copyright (C) 1999-2006 Takeshi Kanno
Copyright (C) 2007-2009 Antony Dovgal
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the
use of this software.
Permission is granted to anyone to use this software for any purpose,including
commercial applications, and to alter it and redistribute it freely, subject
to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim
that you wrote the original software. If you use this software in a
product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
This directory contains a clone of the libharu repository for VTK.
# libharu fork for VTK
You can search the code for "KITWARE_LIBHARU_CHANGE" to find
modifications, and this file contains a summary of changes.
This branch contains changes required to embed libharu into VTK. This
includes changes made primarily to the build system to allow it to be embedded
into another source tree as well as a header to facilitate mangling of the
symbols to avoid conflicts with other copies of the library within a single
process.
* Added vtk_haru_mangle.h to mangle symbol names.
* Skip upstream install rules.
* Replace CMAKE_SOURCE_DIR/BINARY_DIR with PROJECT_ variants.
* Standardize library names for platform conventions.
* Set LIBHPDF_STATIC/SHARED based on BUILD_SHARED_LIBS.
* Force exception support.
* Force extra debug output off.
* Remove call to summary() command to silence configuration process.
* Remove unused MATH_LIB cmake variable.
* Renamed various cmake objects to have 'vtk' prefix.
* Link to / include vtk's png and zlib libraries.
* Add .gitattributes file to ignore whitespace from commit checks.
* Edited a comment in hpdf_objects.h to remove invalid UTF8 characters.
* Update API to add support for HPDF_Shading objects (Upstream MR #157).
* Add link to libm on unix.
* Add .gitattributes file to ignore whitespace from commit checks.
* Remove invalid UTF8 characters.
* Integrate with VTK's module system.
* Mangle symbols to start with a `vtklibharu_` prefix.
Instruction for the CMake Build System
======================================
CMake is a family of tools designed to build, test and
package software and it is cross-platform and open
source. CMake and can obtained from http://www.cmake.org.
0 Setup CMake
-------------
CMake is available in most of Linux repositories and can
be therefore easily installed. In Cygwin just use the
usual method with setup.exe to get the latest version of CMake.
For Windows and Mac OS X go to http://www.cmake.org and
download the appropriate binary packge. Make sure that the
bin directory of the extracted CMake package is in the
PATH environment variable. Check in the CLI with
cmake --version
that CMake can be found. There is also a graphical interface
to CMake available which can be run with ccmake (Linux, Mac OS X)
or cmake-gui (Windows, Linux, Mac OS X). In the next section
the command line tool cmake is used, but the graphical interface
works similar. Note, that CMake should always operate in a
out-of-source directory. If you need to run CMake again it's best
to remove the whole folder and start with the directory creation
in order to prevent problems with stale CMake cache files.
X Specific instructions for Linux and Mac OS X
==============================================
Create a directory at the same level as the libharu source directory,
e.g. "mkdir libharu_build". Cd into this directory.
Than run cmake with the command
cmake ../libharu
CMake will configure the build and create the appropriate makefiles.
Run "make" to create the library and the examples. There are some
options available which are described below.
X Specific instructions for Windows
===================================
Create a directory at the same level as the libharu source directory,
e.g. "mkdir libharu_build". Cd into this directory.
Since there are more compiler toolsets available for Windows than
the standard gcc compiler, you need to tell cmake which makefile
generator to use
cmake -G "Makefile Generator" ..\libharu
where Make Generator is one of the following (most important listed)
Borland Makefiles = Generates Borland makefiles.
MSYS Makefiles = Generates MSYS makefiles.
MinGW Makefiles = Generates a make file for use with
mingw32-make.
NMake Makefiles = Generates NMake makefiles.
Visual Studio 6 = Generates Visual Studio 6 project files.
Visual Studio 9 2008 = Generates Visual Studio 9 2008 project files.
You get a complete list of all available generators for your platfrom
with "cmake --help". I'll go into details for one specific compiler toolset.
The other generators work similar.
Using CMake to produce Visual C++ 2008 Makfiles
-----------------------------------------------
First you need to have the command line interface setup correctly. Start
cmd.exe and run "%VS90COMNTOOLS%vsvars32.bat". This will set up the
command line tools of Visual C++ 2008. Cd into the created build
directory and run
cmake -G "NMake Makefiles" ..\libharu
After the configuration and creation of the makefile run "nmake" to create
the libraries and demonstrations. By default a shared library will be
created therefore you need to copy the haru.dll from the src directory
in the demo directory in order for the demonstrations to run correctly.
X Useful CMake options
======================
There are some options available where you can influence the configuration
stage. These options must be given at the command line with the -D flag, e.g.
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug ..\libharu
CMAKE_BUILD_TYPE=Debug|Release - debug or release build
BUILD_SHARED_LIBS=ON|OFF - shared or static build
CMAKE_COLOR_MAKEFILE=ON|OFF - color output
CMAKE_VERBOSE_MAKEFILE=ON|OFF - verbose makefile output
More options can be found here: http://www.cmake.org/Wiki/CMake_Useful_Variables
X How does CMake find libraries
===============================
CMake searches usually in the standard locations to find libraries, which
works well on Linux und Mac OS X. This is not the case for Windows (where
there are simply no standard locations for libraries) or if you want to
use a library at a non-standard location. You can help CMake to find
libraries via two environment variables, e.g. for Windows:
set CMAKE_INCLUDE_PATH=path_to_zlib_headers
set CMAKE_LIBRARY_PATH=path_to_zlib
and then CMake will be able to find zlib.
# cmake/modules/haru.cmake
#
# Copyright (C) 2008 Werner Smekal
#
# check if headers exist
# Need these modules to do subsequent checks.
include(CheckIncludeFiles)
# =======================================================================
# check header availability
# =======================================================================
# check if header file exists
check_include_files(dlfcn.h LIBHPDF_HAVE_DLFCN_H)
check_include_files(inttypes.h LIBHPDF_HAVE_INTTYPES_H)
check_include_files(memory.h LIBHPDF_HAVE_MEMORY_H)
check_include_files(stdint.h LIBHPDF_HAVE_STDINT_H)
check_include_files(stdlib.h LIBHPDF_HAVE_STDLIB_H)
check_include_files(strings.h LIBHPDF_HAVE_STRINGS_H)
check_include_files(string.h LIBHPDF_HAVE_STRING_H)
check_include_files(sys/stat.h LIBHPDF_HAVE_SYS_STAT_H)
check_include_files(sys/types.h LIBHPDF_HAVE_SYS_TYPES_H)
check_include_files(unistd.h LIBHPDF_HAVE_UNISTD_H)
# =======================================================================
# additional library support
# =======================================================================
# On windows systems the math library is not separated so do not specify
# it unless you are on a non-windows system.
# KITWARE_LIBHARU_CHANGE MATH_LIB does not appear to be referenced:
if(FALSE)
if(NOT WIN32)
find_library(MATH_LIB NAMES m PATHS /usr/local/lib /usr/lib)
if(NOT MATH_LIB)
message(FATAL_ERROR "Cannot find required math library")
endif(NOT MATH_LIB)
else(NOT WIN32)
set(MATH_LIB)
endif(NOT WIN32)
endif()
# cmake/modules/summary.cmake
#
# Copyright (C) 2008 Werner Smekal
#
# Macro for outputting all the most important CMake variables for haru
# =======================================================================
# print summary of configuration to screen
# =======================================================================
macro(summary)
set(_output_results "
Summary of CMake build system results for the haru library
Install location variables which can be set by the user:
CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}
CMAKE_INSTALL_EXEC_PREFIX ${CMAKE_INSTALL_EXEC_PREFIX}
CMAKE_INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR}
CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}
CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}
Other important CMake variables:
CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}
UNIX: ${UNIX}
WIN32: ${WIN32}
APPLE: ${APPLE}
MSVC: ${MSVC} (MSVC_VERSION: ${MSVC_VERSION})
MINGW: ${MINGW}
MSYS: ${MSYS}
CYGWIN: ${CYGWIN}
BORLAND: ${BORLAND}
WATCOM: ${WATCOM}
CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}
CMAKE_C_COMPILER CMAKE_C_FLAGS: ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS}
Library options:
LIBHPDF_SHARED: ${LIBHPDF_SHARED}
LIBHPDF_STATIC: ${LIBHPDF_STATIC}
LIBHPDF_EXAMPLES: ${LIBHPDF_EXAMPLES}
DEVPAK: ${DEVPAK}
Optional libraries:
HAVE_LIBZ: ${LIBHPDF_HAVE_LIBZ}
HAVE_LIBPNG: ${LIBHPDF_HAVE_LIBPNG}
")
message("${_output_results}")
endmacro(summary)
hpdf_config.h.in*
hpdf_config.h
config.h.in*
config.h
Makefile.in
stamp-h1
Makefile
*.lo
*.la
.deps
.libs
*.o
*.a
......@@ -17,7 +17,6 @@
#ifndef _HPDF_H
#define _HPDF_H
/* KITWARE_LIBHARU_CHANGE Include the symbol name mangler: */
#include "vtk_haru_mangle.h"
#include "hpdf_config.h"
......
......@@ -80,8 +80,6 @@ extern "C" {
* 3 reserved
* 4 shadow-object
* 5-8 reserved
* KITWARE_LIBHARU_CHANGE Modified this next line to make commit checks happy.
* It had some unsupported UTF-8 characters (looked like garbage?)
* 9-32 object-id
*
* the real Object-ID is described "obj_id & 0x00FFFFFF"
......
This diff is collapsed.
Makefile.in
Makefile
*.lo
*.la
.deps
.libs
*.o
*.a
stamp-h1
......@@ -71,48 +71,45 @@ set(
# =======================================================================
# create static and shared haru library
# =======================================================================
# KITWARE_LIBHARU_CHANGE Let VTK handle install:
if(FALSE)
if(LIBHPDF_STATIC)
add_library(${LIBHPDF_NAME_STATIC} STATIC ${LIBHPDF_SRCS})
target_link_libraries(${LIBHPDF_NAME_STATIC} ${ADDITIONAL_LIBRARIES})
install(
TARGETS ${LIBHPDF_NAME_STATIC}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
if(WIN32 AND NOT CYGWIN)
foreach(addlib ${ADDITIONAL_LIBRARIES})
install(FILES ${addlib} DESTINATION lib)
endforeach(addlib)
endif(WIN32 AND NOT CYGWIN)
endif(LIBHPDF_STATIC)
if(LIBHPDF_SHARED)
add_library(${LIBHPDF_NAME} SHARED ${LIBHPDF_SRCS})
target_link_libraries(${LIBHPDF_NAME} ${ADDITIONAL_LIBRARIES})
if(WIN32 AND NOT CYGWIN)
set_target_properties(${LIBHPDF_NAME} PROPERTIES DEFINE_SYMBOL HPDF_DLL_MAKE)
endif(WIN32 AND NOT CYGWIN)
install(
TARGETS ${LIBHPDF_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
endif(LIBHPDF_SHARED)
else()
# Shared/static are mutually exclusive in the VTK build:
if(LIBHPDF_SHARED)
vtk_add_library(${LIBHPDF_NAME} ${LIBHPDF_SRCS})
target_link_libraries(${LIBHPDF_NAME} LINK_PRIVATE ${ADDITIONAL_LIBRARIES})
if(WIN32 AND NOT CYGWIN)
set_target_properties(${LIBHPDF_NAME} PROPERTIES DEFINE_SYMBOL HPDF_DLL_MAKE)
endif(WIN32 AND NOT CYGWIN)
elseif(LIBHPDF_STATIC)
vtk_add_library(${LIBHPDF_NAME_STATIC} ${LIBHPDF_SRCS})
target_link_libraries(${LIBHPDF_NAME_STATIC} LINK_PRIVATE ${ADDITIONAL_LIBRARIES})
else()
message(FATAL_ERROR "Neither STATIC nor SHARED specified for libharu.")
endif()
endif()
if (FALSE) # XXX(kitware): Use VTK's module system
if(LIBHPDF_STATIC)
add_library(${LIBHPDF_NAME_STATIC} STATIC ${LIBHPDF_SRCS})
target_link_libraries(${LIBHPDF_NAME_STATIC} ${ADDITIONAL_LIBRARIES})
install(
TARGETS ${LIBHPDF_NAME_STATIC}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
if(WIN32 AND NOT CYGWIN)
foreach(addlib ${ADDITIONAL_LIBRARIES})
install(FILES ${addlib} DESTINATION lib)
endforeach(addlib)
endif(WIN32 AND NOT CYGWIN)
endif(LIBHPDF_STATIC)
if(LIBHPDF_SHARED)
add_library(${LIBHPDF_NAME} SHARED ${LIBHPDF_SRCS})
target_link_libraries(${LIBHPDF_NAME} ${ADDITIONAL_LIBRARIES})
if(WIN32 AND NOT CYGWIN)
set_target_properties(${LIBHPDF_NAME} PROPERTIES DEFINE_SYMBOL HPDF_DLL_MAKE)
endif(WIN32 AND NOT CYGWIN)
install(
TARGETS ${LIBHPDF_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
endif(LIBHPDF_SHARED)
else ()
vtk_add_library(vtklibharu ${LIBHPDF_SRCS})
target_link_libraries(vtklibharu PRIVATE ${vtkzlib_LIBRARIES} ${vtkpng_LIBRARIES})
if (WIN32)
set_target_properties(vtklibharu
PROPERTIES
DEFINE_SYMBOL HPDF_DLL_MAKE)
endif ()
target_include_directories(vtklibharu
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../include>")
endif ()
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