TinyTIFF
a lightweight C/C++ library for reading and writing TIFF files
|
This page explains how to link against TinyTIFF.
After building and installing TinyTIFF you have all files that you need inside the instal directory:
<INSTALLDIR>/include contains all required header files
<INSTALLDIR>/bin contains the shared libraries
<INSTALLDIR>/lib contains the link libraries
<INSTALLDIR>/lib/cmake contains files necessary for CMake's find_package()
to workWhen using CMake to build you application, you can simply use target_link_libraries()
to link against TinyTIFF and use CMake's find_package()
to enable that (see https://github.com/jkriege2/TinyTIFF/tree/master/tests/extcmake_tinytiff_test for an example):
Note that you may have to provide the CMake variables TinyTIFF_DIR
(or TinyTIFFShared_DIR
to )
<INSTALLDIR>/lib/cmake/TinyTIFF so CMake finds the
TinyTIFFConfig.cmake
file there.
You can also link against TinyTIFF without using CMake. For this you simply have to supply the library as a parameter to your compile/link run, e.g. for GCC:
The -I
-option provides the search directory for include-files (i.e. headers) and the -L
-option the search path for the link libraries. Here we link against the release version TinyTIFF_Release
, i.e. with config-decorated filename (see build options!). Check for the actual name of the libs on your system and plug in the appropriate name! If you build the library as a shared lib, you have to link e.g. against TinyTIFFShared_Release
, as the build-scripts add the word hared
to the library name for shared libs to distinguish them from the static libs.
Note that you might also have to provide additional libraries, depending on your system.