summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2011-07-15 14:27:49 +0100
committerJosé Fonseca <jfonseca@vmware.com>2011-07-15 14:27:49 +0100
commitd4263e22f1a405652b80c7bd6ebf0be380b30c4d (patch)
tree61d0b6f892c50d987ad83ed04bbb620519abbc3e
parentcf022fe9dce1406803fea72b8a4b011a1d41303d (diff)
Support building with CMake.
Tested with Linux GCC, MSVC, and MinGW crosscompilers.
-rw-r--r--doc/html/build.html1
-rw-r--r--doc/html/buildcmake.html116
-rw-r--r--src/CMakeLists.txt65
-rw-r--r--src/glean/CMakeLists.txt30
-rw-r--r--src/libs/CMakeLists.txt5
-rw-r--r--src/libs/dsurf/CMakeLists.txt3
-rw-r--r--src/libs/image/CMakeLists.txt3
-rw-r--r--src/libs/lex/CMakeLists.txt3
-rw-r--r--src/libs/stats/CMakeLists.txt3
-rw-r--r--src/libs/timer/CMakeLists.txt3
-rw-r--r--src/tiff/CMakeLists.txt113
-rw-r--r--src/tiff/tif_config.h.in260
-rw-r--r--src/tiff/tiffconf.h.in (renamed from src/tiff/tiffconf.h)47
-rw-r--r--src/tools/CMakeLists.txt7
-rw-r--r--src/tools/difftiff/CMakeLists.txt31
-rw-r--r--src/tools/showtiff/CMakeLists.txt31
-rw-r--r--src/tools/showvis/CMakeLists.txt30
17 files changed, 729 insertions, 22 deletions
diff --git a/doc/html/build.html b/doc/html/build.html
index 369df4c..28b3a81 100644
--- a/doc/html/build.html
+++ b/doc/html/build.html
@@ -58,6 +58,7 @@ Once you've completed those tasks, choose one of the following:
<UL>
<LI><A HREF="buildgnu.html">Building <I>glean</I> for GNU/Linux</A></LI>
<LI><A HREF="buildwin.html">Building <I>glean</I> for Windows</A></LI>
+ <LI><A HREF="buildcmake.html">Building <I>glean</I> for GNU/Linux or Windows using cmake</A></LI>
<LI><A HREF="buildscons.html">Building <I>glean</I> for GNU/Linux or Windows using scons</A></LI>
</UL>
diff --git a/doc/html/buildcmake.html b/doc/html/buildcmake.html
new file mode 100644
index 0000000..d315a86
--- /dev/null
+++ b/doc/html/buildcmake.html
@@ -0,0 +1,116 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+
+<HEAD>
+ <TITLE>Building glean using cmake</TITLE>
+ <META NAME="description" CONTENT="building glean using cmake">
+ <META NAME="author" CONTENT="Jose Fonseca">
+ <LINK REV="made" HREF="mailto:jfonseca@vmware.com">
+</HEAD>
+
+<BODY bgcolor=#FFFFFF topmargin="10" bottommargin="10" leftmargin="10"
+ rightmargin="10" marginheight="0" marginwidth="0">
+
+<H1>Building <I>glean</I> with cmake</H1>
+
+<P>
+Now you can build glean on GNU/Linux or Windows using
+<A HREF="http://www.cmake.org/">cmake</A>. The advantages over GNU make are:
+<UL TYPE=DISC>
+ <LI> no need to set build options &mdash; everything is autodetected;
+ <LI> automatically uses an included tiff library if none can be found;
+ <LI> support to cross build from GNU/Linux to Windows using MinGW cross
+ compilers.
+</UL>
+
+<H2>Build <I>glean</I> on GNU/Linux</H2>
+
+<P>
+Simply type
+<PRE>
+ cmake -Hsrc -Bbuild
+ make -C build
+</PRE>
+
+<P>
+Everything should be autodetected for you.
+
+<H2>Build <I>glean</I> on Windows</H2>
+
+<P>
+Simply type
+<PRE>
+ cmake -G "Visual Studio 9 2008" -Hsrc -Bbuild
+ cmake --build build --config Debug %*
+</PRE>
+
+<P>
+Everything should be autodetected for you.
+
+<H2>Build <I>glean</I> for Windows on GNU/Linux</H2>
+
+<p>
+Create a <b>Toolchain.cmake</b> file containing:
+</p>
+<pre>
+# the name of the target operating system
+SET(CMAKE_SYSTEM_NAME Windows)
+
+# which compilers to use for C and C++
+SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
+SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
+
+# here is the target environment located
+SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc)
+
+# adjust the default behaviour of the FIND_XXX() commands:
+# search headers and libraries in the target environment, search
+# programs in the host environment
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+</pre>
+
+<p>
+Create a <b>Cache.cmake</b> file containing:
+</p>
+<pre>
+set(GLUT_INCLUDE_DIR "/path/to/glut/include" CACHE PATH "" FORCE)
+set(GLUT_glut_LIBRARY "/path/to/glut/lib/libglut32.a" CACHE FILEPATH "" FORCE)
+</pre>
+
+<p>
+Then do:
+</p>
+<pre>
+cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/path/to/install -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=/path/to/Toolchain.cmake -C /path/to/Cache.cmake -Hsrc -Bbuild
+make -C build
+</pre>
+
+<p>
+Read <a href="http://www.vtk.org/Wiki/CmakeMingw">this</a> for more information about CMake and MinGW cross compilation.
+</p>
+
+
+<HR>
+<SMALL>
+ <UL TYPE=DISC>
+ <LI> <A HREF="index.html"><I>glean</I> home</A>
+ <LI> <A HREF="whatis.html">What is <I>glean</I>?</A>
+ <LI> <A HREF="build.html">How do I build <I>glean</I>?</A>
+ <LI> <A HREF="run.html">How do I run <I>glean</I>?</A>
+ <LI> <A HREF="next.html">Where do we go from here?</A>
+ <UL TYPE=CIRCLE>
+ <LI> <A HREF="newtest.html">Adding new tests</A>
+ <LI> <A HREF="newfeat.html">Adding new infrastructure features</A>
+ <LI> <A HREF="overview.html">Overview of <I>glean</I> internals</A>
+ <LI> <A HREF="repo.html">Creating a repository of results</A>
+ <LI> <A HREF="port.html">Porting <I>glean</I></A>
+ <LI> <A HREF="cleanup.html">Cleaning up loose ends</A>
+ </UL>
+ <LI> <A HREF="changes.html">What has changed recently?</A>
+ </UL>
+</SMALL>
+
+</BODY>
+</HTML>
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..5b807e9
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,65 @@
+cmake_minimum_required(VERSION 2.8)
+
+include (CheckCCompilerFlag)
+include (CheckCXXCompilerFlag)
+
+project (glean)
+
+find_package(OpenGL REQUIRED)
+find_package(TIFF)
+find_package(GLUT)
+
+if (NOT MSVC)
+ check_c_compiler_flag ("-Wall" C_COMPILER_FLAG_WALL)
+ if (C_COMPILER_FLAG_WALL)
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
+ endif (C_COMPILER_FLAG_WALL)
+ check_cxx_compiler_flag("-Wall" CXX_COMPILER_FLAG_WALL)
+ if (CXX_COMPILER_FLAG_WALL)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+ endif (CXX_COMPILER_FLAG_WALL)
+else ()
+ # -Wall or (/Wall) is actually supported by MSVC and would be detected
+ # by CHECK_C_COMPILER_FLAG above, but is very pedantic, causing
+ # thousand of warnings when including windows.h.
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W4")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W4")
+
+ add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
+ add_definitions (-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
+endif ()
+
+set (GLEXT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/glext)
+
+if (NOT TIFF_FOUND)
+ set (TIFF_INCLUDE_DIR ${CMAKE_BINARY_DIR}/tiff ${CMAKE_SOURCE_DIR}/tiff)
+ set (TIFF_LIBRARY bundled_tiff)
+ add_subdirectory (tiff)
+endif ()
+
+if (WIN32)
+ add_definitions (-D__WIN__ -D__MS__)
+elseif (APPLE)
+ add_definitions (-D__AGL__ -D__UNIX__)
+ find_library (CARBON_LIBRARY Carbon)
+ set (CMAKE_OSX_ARCHITECTURES i386)
+else ()
+ add_definitions (-D__X11__ -D__UNIX__)
+endif ()
+
+include_directories (
+ libs/dsurf
+ libs/image
+ libs/lex
+ libs/rand
+ libs/stats
+ libs/timer
+ glh
+ ${GLEXT_INCLUDE_DIR}
+ ${OPENGL_INCLUDE_DIR}
+ ${TIFF_INCLUDE_DIR}
+)
+
+add_subdirectory(libs)
+add_subdirectory(glean)
+add_subdirectory(tools)
diff --git a/src/glean/CMakeLists.txt b/src/glean/CMakeLists.txt
new file mode 100644
index 0000000..5dc6661
--- /dev/null
+++ b/src/glean/CMakeLists.txt
@@ -0,0 +1,30 @@
+file (GLOB sources "*.cpp")
+
+add_executable (glean ${sources})
+
+target_link_libraries (glean
+ dsurf
+ lex
+ image
+ stats
+ timer
+ ${TIFF_LIBRARY}
+ ${OPENGL_gl_LIBRARY}
+ ${OPENGL_glu_LIBRARY}
+)
+
+if (WIN32)
+ target_link_libraries (glean
+ gdi32
+ user32
+ kernel32
+ )
+elseif (APPLE)
+ target_link_libraries (glean
+ ${CARBON_LIBRARY}
+ )
+else ()
+ target_link_libraries (glean
+ ${X11_X11_LIB}
+ )
+endif ()
diff --git a/src/libs/CMakeLists.txt b/src/libs/CMakeLists.txt
new file mode 100644
index 0000000..c5460c9
--- /dev/null
+++ b/src/libs/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_subdirectory (dsurf)
+add_subdirectory (image)
+add_subdirectory (lex)
+add_subdirectory (stats)
+add_subdirectory (timer)
diff --git a/src/libs/dsurf/CMakeLists.txt b/src/libs/dsurf/CMakeLists.txt
new file mode 100644
index 0000000..9cb0dcf
--- /dev/null
+++ b/src/libs/dsurf/CMakeLists.txt
@@ -0,0 +1,3 @@
+file (GLOB sources "*.cpp")
+
+add_library(dsurf ${sources})
diff --git a/src/libs/image/CMakeLists.txt b/src/libs/image/CMakeLists.txt
new file mode 100644
index 0000000..11dbad6
--- /dev/null
+++ b/src/libs/image/CMakeLists.txt
@@ -0,0 +1,3 @@
+file (GLOB sources "*.cpp")
+
+add_library(image ${sources})
diff --git a/src/libs/lex/CMakeLists.txt b/src/libs/lex/CMakeLists.txt
new file mode 100644
index 0000000..1f45075
--- /dev/null
+++ b/src/libs/lex/CMakeLists.txt
@@ -0,0 +1,3 @@
+file (GLOB sources "*.cpp")
+
+add_library(lex ${sources})
diff --git a/src/libs/stats/CMakeLists.txt b/src/libs/stats/CMakeLists.txt
new file mode 100644
index 0000000..eacb70a
--- /dev/null
+++ b/src/libs/stats/CMakeLists.txt
@@ -0,0 +1,3 @@
+file (GLOB sources "*.cpp")
+
+add_library(stats ${sources})
diff --git a/src/libs/timer/CMakeLists.txt b/src/libs/timer/CMakeLists.txt
new file mode 100644
index 0000000..69d5a99
--- /dev/null
+++ b/src/libs/timer/CMakeLists.txt
@@ -0,0 +1,3 @@
+file (GLOB sources "*.cpp")
+
+add_library(timer ${sources})
diff --git a/src/tiff/CMakeLists.txt b/src/tiff/CMakeLists.txt
new file mode 100644
index 0000000..d7404ee
--- /dev/null
+++ b/src/tiff/CMakeLists.txt
@@ -0,0 +1,113 @@
+include (CheckFunctionExists)
+include (CheckIncludeFile)
+include (TestBigEndian)
+include (CheckTypeSize)
+
+check_type_size (int SIZEOF_INT BUILTIN_TYPES_ONLY)
+check_type_size (long SIZEOF_LONG BUILTIN_TYPES_ONLY)
+check_type_size (int8 INT8)
+check_type_size (int16 INT16)
+check_type_size (int32 INT32)
+
+# Check for system headers
+check_include_file (assert.h HAVE_ASSERT_H)
+check_include_file (fcntl.h HAVE_FCNTL_H)
+check_include_file (limits.h HAVE_LIMITS_H)
+check_include_file (malloc.h HAVE_MALLOC_H)
+check_include_file (search.h HAVE_SEARCH_H)
+check_include_file (sys/time.h HAVE_SYS_TIME_H)
+check_include_file (unistd.h HAVE_UNISTD_H)
+check_include_file (string.h HAVE_STRING_H)
+check_include_file (windows.h HAVE_WINDOWS_H)
+
+# Check for standard library functions
+check_function_exists (floor HAVE_FLOOR)
+check_function_exists (isascii HAVE_ISASCII)
+check_function_exists (memmove HAVE_MEMMOVE)
+check_function_exists (memset HAVE_MEMSET)
+check_function_exists (mmap HAVE_MMAP)
+check_function_exists (pow HAVE_POW)
+check_function_exists (sqrt HAVE_SQRT)
+check_function_exists (strchr HAVE_STRCHR)
+check_function_exists (strrchr HAVE_STRRCHR)
+check_function_exists (strstr HAVE_STRSTR)
+check_function_exists (strtol HAVE_STRTOL)
+
+test_big_endian (HOST_BIGENDIAN)
+if (HOST_BIGENDIAN)
+ set (HOST_FILLORDER FILLORDER_MSB2LSB)
+else ()
+ set (HOST_FILLORDER FILLORDER_LSB2MSB)
+endif ()
+
+set (HAVE_IEEEFP 1)
+
+set (CCITT_SUPPORT 1)
+set (PACKBITS_SUPPORT 1)
+set (LZW_SUPPORT 1)
+set (THUNDER_SUPPORT 1)
+set (NEXT_SUPPORT 1)
+set (LOGLUV_SUPPORT 1)
+set (STRIP_CHOPPING_SUPPORT 1)
+set (EXTRASAMPLE_AS_ALPHA_SUPPORT 1)
+set (CHECK_YCBCR_SUBSAMPLING_SUPPORT 1)
+
+configure_file (tif_config.h.in tif_config.h)
+configure_file (tiffconf.h.in tiffconf.h)
+
+include_directories (${CMAKE_CURRENT_BINARY_DIR})
+
+set (sources
+ tif_aux.c
+ tif_close.c
+ tif_codec.c
+ tif_color.c
+ tif_compress.c
+ tif_dir.c
+ tif_dirinfo.c
+ tif_dirread.c
+ tif_dirwrite.c
+ tif_dumpmode.c
+ tif_error.c
+ tif_extension.c
+ tif_fax3.c
+ tif_fax3sm.c
+ tif_flush.c
+ tif_getimage.c
+ tif_jpeg.c
+ tif_luv.c
+ tif_lzw.c
+ tif_next.c
+ tif_ojpeg.c
+ tif_open.c
+ tif_packbits.c
+ tif_pixarlog.c
+ tif_predict.c
+ tif_print.c
+ tif_read.c
+ tif_strip.c
+ tif_swab.c
+ tif_thunder.c
+ tif_tile.c
+ tif_version.c
+ tif_warning.c
+ tif_write.c
+ tif_zip.c
+)
+
+if (MSVC)
+ set (inline __inline)
+else ()
+ set (inline inline)
+endif ()
+
+if (WIN32)
+ set (sources ${sources} tif_win32.c)
+elseif (APPLE)
+ set (sources ${sources} tif_apple.c)
+ include_directories (/Developer/Headers/FlatCarbon)
+else ()
+ set (sources ${sources} tif_unix.c)
+endif ()
+
+add_library(bundled_tiff ${sources})
diff --git a/src/tiff/tif_config.h.in b/src/tiff/tif_config.h.in
new file mode 100644
index 0000000..e86dc48
--- /dev/null
+++ b/src/tiff/tif_config.h.in
@@ -0,0 +1,260 @@
+/* libtiff/tif_config.h.in. Generated from configure.ac by autoheader. */
+
+/* Support CCITT Group 3 & 4 algorithms */
+#cmakedefine CCITT_SUPPORT
+
+/* Pick up YCbCr subsampling info from the JPEG data stream to support files
+ lacking the tag (default enabled). */
+#cmakedefine CHECK_JPEG_YCBCR_SUBSAMPLING
+
+/* Support C++ stream API (requires C++ compiler) */
+#cmakedefine CXX_SUPPORT
+
+/* Treat extra sample as alpha (default enabled). The RGBA interface will
+ treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
+ packages produce RGBA files but don't mark the alpha properly. */
+#cmakedefine DEFAULT_EXTRASAMPLE_AS_ALPHA
+
+/* Use the Apple OpenGL framework. */
+#cmakedefine HAVE_APPLE_OPENGL_FRAMEWORK
+
+/* Define to 1 if you have the <assert.h> header file. */
+#cmakedefine HAVE_ASSERT_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#cmakedefine HAVE_DLFCN_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#cmakedefine HAVE_FCNTL_H
+
+/* Define to 1 if you have the `floor' function. */
+#cmakedefine HAVE_FLOOR
+
+/* Define to 1 if you have the `getopt' function. */
+#cmakedefine HAVE_GETOPT
+
+/* Define as 0 or 1 according to the floating point format suported by the
+ machine */
+#cmakedefine HAVE_IEEEFP
+
+/* Define to 1 if the system has the type `int16'. */
+#cmakedefine HAVE_INT16
+
+/* Define to 1 if the system has the type `int32'. */
+#cmakedefine HAVE_INT32
+
+/* Define to 1 if the system has the type `int8'. */
+#cmakedefine HAVE_INT8
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#cmakedefine HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `isascii' function. */
+#cmakedefine HAVE_ISASCII
+
+/* Define to 1 if you have the `lfind' function. */
+#cmakedefine HAVE_LFIND
+
+/* Define to 1 if you have the `c' library (-lc). */
+#cmakedefine HAVE_LIBC
+
+/* Define to 1 if you have the `m' library (-lm). */
+#cmakedefine HAVE_LIBM
+
+/* Define to 1 if you have the <limits.h> header file. */
+#cmakedefine HAVE_LIMITS_H
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#cmakedefine HAVE_MALLOC_H
+
+/* Define to 1 if you have the `memmove' function. */
+#cmakedefine HAVE_MEMMOVE
+
+/* Define to 1 if you have the <memory.h> header file. */
+#cmakedefine HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
+#cmakedefine HAVE_MEMSET
+
+/* Define to 1 if you have the `mmap' function. */
+#cmakedefine HAVE_MMAP
+
+/* Define to 1 if you have the `pow' function. */
+#cmakedefine HAVE_POW
+
+/* Define if you have POSIX threads libraries and header files. */
+#cmakedefine HAVE_PTHREAD
+
+/* Define to 1 if you have the <search.h> header file. */
+#cmakedefine HAVE_SEARCH_H
+
+/* Define to 1 if you have the `sqrt' function. */
+#cmakedefine HAVE_SQRT
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#cmakedefine HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#cmakedefine HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#cmakedefine HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strchr' function. */
+#cmakedefine HAVE_STRCHR
+
+/* Define to 1 if you have the <strings.h> header file. */
+#cmakedefine HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#cmakedefine HAVE_STRING_H
+
+/* Define to 1 if you have the `strrchr' function. */
+#cmakedefine HAVE_STRRCHR
+
+/* Define to 1 if you have the `strstr' function. */
+#cmakedefine HAVE_STRSTR
+
+/* Define to 1 if you have the `strtol' function. */
+#cmakedefine HAVE_STRTOL
+
+/* Define to 1 if you have the `strtoul' function. */
+#cmakedefine HAVE_STRTOUL
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#cmakedefine HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#cmakedefine HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#cmakedefine HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#cmakedefine HAVE_UNISTD_H
+
+/* Define to 1 if you have the <windows.h> header file. */
+#cmakedefine HAVE_WINDOWS_H
+
+/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
+ (Intel) */
+#cmakedefine HOST_BIGENDIAN
+
+/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
+#define HOST_FILLORDER @HOST_FILLORDER@
+
+/* Support JPEG compression (requires IJG JPEG library) */
+#cmakedefine JPEG_SUPPORT
+
+/* Support LogLuv high dynamic range encoding */
+#cmakedefine LOGLUV_SUPPORT
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#cmakedefine LT_OBJDIR
+
+/* Support LZW algorithm */
+#cmakedefine LZW_SUPPORT
+
+/* Support Microsoft Document Imaging format */
+#cmakedefine MDI_SUPPORT
+
+/* Support NeXT 2-bit RLE algorithm */
+#cmakedefine NEXT_SUPPORT
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#cmakedefine NO_MINUS_C_MINUS_O
+
+/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation
+ fails with unpatched IJG JPEG library) */
+#cmakedefine OJPEG_SUPPORT
+
+/* Name of package */
+#cmakedefine PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#cmakedefine PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#cmakedefine PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#cmakedefine PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#cmakedefine PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#cmakedefine PACKAGE_VERSION
+
+/* Support Macintosh PackBits algorithm */
+#cmakedefine PACKBITS_SUPPORT
+
+/* Support Pixar log-format algorithm (requires Zlib) */
+#cmakedefine PIXARLOG_SUPPORT
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+ your system. */
+#cmakedefine PTHREAD_CREATE_JOINABLE
+
+/* The size of a `int', as computed by sizeof. */
+#define SIZEOF_INT @SIZEOF_INT@
+
+/* The size of a `long', as computed by sizeof. */
+#define SIZEOF_LONG @SIZEOF_LONG@
+
+/* Define to 1 if you have the ANSI C header files. */
+#cmakedefine STDC_HEADERS
+
+/* Support strip chopping (whether or not to convert single-strip uncompressed
+ images to mutiple strips of specified size to reduce memory usage) */
+#cmakedefine STRIPCHOP_DEFAULT
+
+/* Default size of the strip in bytes (when strip chopping enabled) */
+#cmakedefine STRIP_SIZE_DEFAULT
+
+/* Enable SubIFD tag (330) support */
+#cmakedefine SUBIFD_SUPPORT
+
+/* Support ThunderScan 4-bit RLE algorithm */
+#cmakedefine THUNDER_SUPPORT
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#cmakedefine TIME_WITH_SYS_TIME
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#cmakedefine TM_IN_SYS_TIME
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if your processor stores words with the most significant byte
+ first (like Motorola and SPARC, unlike Intel and VAX). */
+#cmakedefine WORDS_BIGENDIAN
+
+/* Define to 1 if the X Window System is missing or not being used. */
+#cmakedefine X_DISPLAY_MISSING
+
+/* Support Deflate compression */
+#cmakedefine ZIP_SUPPORT
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#cmakedefine _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#cmakedefine _LARGE_FILES
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#define inline @inline@
+#endif
+
+/* Define to `long' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
diff --git a/src/tiff/tiffconf.h b/src/tiff/tiffconf.h.in
index 18c0a1b..9cbf2cc 100644
--- a/src/tiff/tiffconf.h
+++ b/src/tiff/tiffconf.h.in
@@ -8,79 +8,82 @@
#define _TIFFCONF_
/* Define to 1 if the system has the type `int16'. */
-/* #undef HAVE_INT16 */
+#cmakedefine HAVE_INT16
/* Define to 1 if the system has the type `int32'. */
-/* #undef HAVE_INT32 */
+#cmakedefine HAVE_INT32
/* Define to 1 if the system has the type `int8'. */
-/* #undef HAVE_INT8 */
+#cmakedefine HAVE_INT8
/* The size of a `int', as computed by sizeof. */
-#define SIZEOF_INT 4
+#define SIZEOF_INT @SIZEOF_INT@
/* The size of a `long', as computed by sizeof. */
-#define SIZEOF_LONG 4
+#define SIZEOF_LONG @SIZEOF_LONG@
/* Compatibility stuff. */
/* Define as 0 or 1 according to the floating point format suported by the
machine */
-#define HAVE_IEEEFP 1
+#cmakedefine HAVE_IEEEFP
/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
-#define HOST_FILLORDER FILLORDER_LSB2MSB
+#define HOST_FILLORDER @HOST_FILLORDER@
/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
(Intel) */
-#define HOST_BIGENDIAN 0
+#cmakedefine HOST_BIGENDIAN
/* Support CCITT Group 3 & 4 algorithms */
-#define CCITT_SUPPORT 1
+#cmakedefine CCITT_SUPPORT
/* Support JPEG compression (requires IJG JPEG library) */
-/* #undef JPEG_SUPPORT */
+#cmakedefine JPEG_SUPPORT
/* Support LogLuv high dynamic range encoding */
-#define LOGLUV_SUPPORT 1
+#cmakedefine LOGLUV_SUPPORT
/* Support LZW algorithm */
-#define LZW_SUPPORT 1
+#cmakedefine LZW_SUPPORT
/* Support NeXT 2-bit RLE algorithm */
-#define NEXT_SUPPORT 1
+#cmakedefine NEXT_SUPPORT
/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation
fails with unpatched IJG JPEG library) */
-/* #undef OJPEG_SUPPORT */
+#cmakedefine OJPEG_SUPPORT
/* Support Macintosh PackBits algorithm */
-#define PACKBITS_SUPPORT 1
+#cmakedefine PACKBITS_SUPPORT
/* Support Pixar log-format algorithm (requires Zlib) */
-/* #undef PIXARLOG_SUPPORT */
+#cmakedefine PIXARLOG_SUPPORT
/* Support ThunderScan 4-bit RLE algorithm */
-#define THUNDER_SUPPORT 1
+#cmakedefine THUNDER_SUPPORT
/* Support Deflate compression */
-/* #undef ZIP_SUPPORT */
+#cmakedefine ZIP_SUPPORT
/* Support strip chopping (whether or not to convert single-strip uncompressed
images to mutiple strips of ~8Kb to reduce memory usage) */
-#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP
+#cmakedefine STRIPCHOP_DEFAULT
/* Enable SubIFD tag (330) support */
-#define SUBIFD_SUPPORT 1
+#cmakedefine SUBIFD_SUPPORT
/* Treat extra sample as alpha (default enabled). The RGBA interface will
treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
packages produce RGBA files but don't mark the alpha properly. */
-#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1
+#cmakedefine DEFAULT_EXTRASAMPLE_AS_ALPHA
/* Pick up YCbCr subsampling info from the JPEG data stream to support files
lacking the tag (default enabled). */
-#define CHECK_JPEG_YCBCR_SUBSAMPLING 1
+#cmakedefine CHECK_JPEG_YCBCR_SUBSAMPLING
+
+/* Support MS MDI magic number files as TIFF */
+#cmakedefine MDI_SUPPORT
/*
* Feature support definitions.
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
new file mode 100644
index 0000000..09a0fc8
--- /dev/null
+++ b/src/tools/CMakeLists.txt
@@ -0,0 +1,7 @@
+if (GLUT_FOUND)
+ add_subdirectory (difftiff)
+ add_subdirectory (showtiff)
+endif (GLUT_FOUND)
+
+add_subdirectory (showvis)
+
diff --git a/src/tools/difftiff/CMakeLists.txt b/src/tools/difftiff/CMakeLists.txt
new file mode 100644
index 0000000..b7436af
--- /dev/null
+++ b/src/tools/difftiff/CMakeLists.txt
@@ -0,0 +1,31 @@
+file (GLOB sources "*.cpp")
+
+add_executable (difftiff ${sources})
+
+target_link_libraries (difftiff
+ dsurf
+ lex
+ image
+ stats
+ timer
+ ${TIFF_LIBRARY}
+ ${OPENGL_gl_LIBRARY}
+ ${OPENGL_glu_LIBRARY}
+ ${GLUT_glut_LIBRARY}
+)
+
+if (WIN32)
+ target_link_libraries (difftiff
+ gdi32
+ user32
+ kernel32
+ )
+elseif (APPLE)
+ target_link_libraries (difftiff
+ ${CARBON_LIBRARY}
+ )
+else ()
+ target_link_libraries (difftiff
+ ${X11_X11_LIB}
+ )
+endif ()
diff --git a/src/tools/showtiff/CMakeLists.txt b/src/tools/showtiff/CMakeLists.txt
new file mode 100644
index 0000000..8b9bbf8
--- /dev/null
+++ b/src/tools/showtiff/CMakeLists.txt
@@ -0,0 +1,31 @@
+file (GLOB sources "*.cpp")
+
+add_executable (showtiff ${sources})
+
+target_link_libraries (showtiff
+ dsurf
+ lex
+ image
+ stats
+ timer
+ ${TIFF_LIBRARY}
+ ${OPENGL_gl_LIBRARY}
+ ${OPENGL_glu_LIBRARY}
+ ${GLUT_glut_LIBRARY}
+)
+
+if (WIN32)
+ target_link_libraries (showtiff
+ gdi32
+ user32
+ kernel32
+ )
+elseif (APPLE)
+ target_link_libraries (showtiff
+ ${CARBON_LIBRARY}
+ )
+else ()
+ target_link_libraries (showtiff
+ ${X11_X11_LIB}
+ )
+endif ()
diff --git a/src/tools/showvis/CMakeLists.txt b/src/tools/showvis/CMakeLists.txt
new file mode 100644
index 0000000..c6d6739
--- /dev/null
+++ b/src/tools/showvis/CMakeLists.txt
@@ -0,0 +1,30 @@
+file (GLOB sources "*.cpp")
+
+add_executable (showvis ${sources})
+
+target_link_libraries (showvis
+ dsurf
+ lex
+ image
+ stats
+ timer
+ ${TIFF_LIBRARY}
+ ${OPENGL_glu_LIBRARY}
+ ${OPENGL_gl_LIBRARY}
+)
+
+if (WIN32)
+ target_link_libraries (showvis
+ gdi32
+ user32
+ kernel32
+ )
+elseif (APPLE)
+ target_link_libraries (showvis
+ ${CARBON_LIBRARY}
+ )
+else ()
+ target_link_libraries (showvis
+ ${X11_X11_LIB}
+ )
+endif ()