Permalink
Browse files

Some build fixes for OS X but they are useful generally.

OS X specific:

- GLib is now found correctly.

General:

- Fix the inclusion of optional things like GdkPixbuf when they aren't present.
  • Loading branch information...
1 parent 11ebd5c commit b9383c2b0c60d1fdcbf75bccf95a2aa1fc0da4c0 Rich Wareham committed Aug 3, 2009
View
@@ -32,11 +32,14 @@ if(NOT APPLE)
pkg_check_modules(GLIB REQUIRED glib-2.0 gobject-2.0 gdk-pixbuf-2.0)
include_directories(${GLIB_INCLUDE_DIRS})
else(NOT APPLE)
+ # Now, almost everything in this block is a horrible hack.
+ # I'm most terribly sorry about that.
find_library(GLIB_LIBRARIES GLib)
if(NOT GLIB_LIBRARIES)
message(SEND_ERROR "GLib framework is required.")
endif(NOT GLIB_LIBRARIES)
-
+ set(GLIB_PREFIX "${GLIB_LIBRARIES}/Resources/dev/")
+ set(GLIB_CFLAGS "-I${GLIB_LIBRARIES}/Headers")
find_path(GLIB_INCLUDE_DIRS glib.h)
include_directories(${GLIB_INCLUDE_DIRS})
endif(NOT APPLE)
View
@@ -0,0 +1,13 @@
+Installation instructions for Mac OS X
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+== Required software
+
+ - CMake (http://cmake.org/)
+ - GLib/GObject (part of GTK, http://gtk.org/)
+ - llvm-gcc (http://llvm.org/)
+
+ - Styx (http://speculate.de/)
+ - LLVM (http://llvm.org/)
+
+ vim:spell:spelllang=en_gb:tw=77
@@ -15,13 +15,13 @@
set(GTKDOC_FOUND 1)
-find_program(GTKDOC_SCAN_EXE gtkdoc-scan)
+find_program(GTKDOC_SCAN_EXE gtkdoc-scan PATH "${GLIB_PREFIX}/bin")
if(NOT GTKDOC_SCAN_EXE)
message(STATUS "gtkdoc-scan not found")
set(GTKDOC_FOUND 0)
endif(NOT GTKDOC_SCAN_EXE)
-find_program(GTKDOC_SCANGOBJ_EXE gtkdoc-scangobj)
+find_program(GTKDOC_SCANGOBJ_EXE gtkdoc-scangobj PATH "${GLIB_PREFIX}/bin")
if(NOT GTKDOC_SCANGOBJ_EXE)
message(STATUS "gtkdoc-scangobj not found")
set(GTKDOC_FOUND 0)
@@ -34,25 +34,25 @@ if(NOT GTKDOC_SCANGOBJ_WRAPPER)
set(GTKDOC_FOUND 0)
endif(NOT GTKDOC_SCANGOBJ_WRAPPER)
-find_program(GTKDOC_MKTMPL_EXE gtkdoc-mktmpl)
+find_program(GTKDOC_MKTMPL_EXE gtkdoc-mktmpl PATH "${GLIB_PREFIX}/bin")
if(NOT GTKDOC_MKTMPL_EXE)
message(STATUS "gtkdoc-mktmpl not found")
set(GTKDOC_FOUND 0)
endif(NOT GTKDOC_MKTMPL_EXE)
-find_program(GTKDOC_MKDB_EXE gtkdoc-mkdb)
+find_program(GTKDOC_MKDB_EXE gtkdoc-mkdb PATH "${GLIB_PREFIX}/bin")
if(NOT GTKDOC_MKDB_EXE)
message(STATUS "gtkdoc-mkdb not found")
set(GTKDOC_FOUND 0)
endif(NOT GTKDOC_MKDB_EXE)
-find_program(GTKDOC_MKHTML_EXE gtkdoc-mkhtml)
+find_program(GTKDOC_MKHTML_EXE gtkdoc-mkhtml PATH "${GLIB_PREFIX}/bin")
if(NOT GTKDOC_MKHTML_EXE)
message(STATUS "gtkdoc-mkhtml not found")
set(GTKDOC_FOUND 0)
endif(NOT GTKDOC_MKHTML_EXE)
-find_program(GTKDOC_FIXXREF_EXE gtkdoc-fixxref)
+find_program(GTKDOC_FIXXREF_EXE gtkdoc-fixxref PATH "${GLIB_PREFIX}/bin")
if(NOT GTKDOC_FIXXREF_EXE)
message(STATUS "gtkdoc-fixxref not found")
set(GTKDOC_FOUND 0)
View
@@ -23,6 +23,7 @@ if(NOT APPLE)
find_package(PkgConfig)
pkg_check_modules(CAIRO cairo)
pkg_check_modules(CLUTTER clutter-0.8)
+ pkg_check_modules(GDK_PIXBUF gdk-pixbuf-2.0)
endif(NOT APPLE)
set(ENGINE_EXTRA_LIBS "")
@@ -41,6 +42,13 @@ if(CLUTTER_FOUND)
set(ENGINE_EXTRA_LIBS ${ENGINE_EXTRA_LIBS} ${CLUTTER_LIBRARIES})
endif(CLUTTER_FOUND)
+set(FIRTREE_HAVE_GDK_PIXBUF 0)
+if(GDK_PIXBUF_FOUND)
+ set(FIRTREE_HAVE_GDK_PIXBUF 1)
+ include_directories(${GDK_PIXBUF_INCLUDE_DIRS})
+ set(ENGINE_EXTRA_LIBS ${ENGINE_EXTRA_LIBS} ${GDK_PIXBUF_LIBRARIES})
+endif(GDK_PIXBUF_FOUND)
+
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/firtree.h.in"
"${CMAKE_CURRENT_SOURCE_DIR}/firtree.h"
@@ -49,16 +57,48 @@ configure_file(
set(_firtree_public_headers
firtree-affine-transform.h
firtree-buffer-sampler.h
- firtree-cairo-surface-sampler.h
- firtree-cogl-texture-sampler.h
firtree-debug.h
firtree-kernel.h
firtree-kernel-sampler.h
- firtree-pixbuf-sampler.h
firtree-sampler.h
firtree-types.h
firtree-vector.h
firtree.h)
+
+set(_firtree_source_files
+ ${CMAKE_CURRENT_BINARY_DIR}/firtree-type-builtins.c
+
+ firtree-affine-transform.c
+ firtree-buffer-sampler.cc
+ firtree-debug.cc
+ firtree-engine.cc
+ firtree-kernel.cc
+ firtree-kernel-sampler.cc
+ firtree-sampler.cc
+ firtree-vector.c
+
+ ${LLVM_STATIC_OBJS})
+
+if(FIRTREE_HAVE_CAIRO)
+ set(_firtree_public_headers ${_firtree_public_headers}
+ firtree-cairo-surface-sampler.h)
+ set(_firtree_source_files ${_firtree_source_files}
+ firtree-cairo-surface-sampler.cc)
+endif(FIRTREE_HAVE_CAIRO)
+
+if(FIRTREE_HAVE_CLUTTER)
+ set(_firtree_public_headers ${_firtree_public_headers}
+ firtree-cogl-texture-sampler.h)
+ set(_firtree_source_files ${_firtree_source_files}
+ firtree-cogl-texture-sampler.cc)
+endif(FIRTREE_HAVE_CLUTTER)
+
+if(FIRTREE_HAVE_GDK_PIXBUF)
+ set(_firtree_public_headers ${_firtree_public_headers}
+ firtree-pixbuf-sampler.h)
+ set(_firtree_source_files ${_firtree_source_files}
+ firtree-pixbuf-sampler.cc)
+endif(FIRTREE_HAVE_GDK_PIXBUF)
add_custom_command(OUTPUT firtree-type-builtins.h ${CMAKE_CURRENT_BINARY_DIR}/firtree-type-builtins.c
COMMAND ${GLIB_MKENUMS}
@@ -82,28 +122,14 @@ set(_firtree_internal_headers
internal/firtree-engine-intl.hh
internal/firtree-kernel-intl.hh
internal/firtree-sampler-intl.hh
+
+ firtree-type-builtins.h
)
add_library(firtree SHARED
${_firtree_public_headers}
${_firtree_internal_headers}
-
- firtree-type-builtins.h
- ${CMAKE_CURRENT_BINARY_DIR}/firtree-type-builtins.c
-
- firtree-affine-transform.c
- firtree-buffer-sampler.cc
- firtree-cairo-surface-sampler.cc
- firtree-cogl-texture-sampler.cc
- firtree-debug.cc
- firtree-engine.cc
- firtree-kernel.cc
- firtree-kernel-sampler.cc
- firtree-pixbuf-sampler.cc
- firtree-sampler.cc
- firtree-vector.c
-
- ${LLVM_STATIC_OBJS})
+ ${_firtree_source_files})
set_source_files_properties(
firtree-type-builtins.h
@@ -723,6 +723,8 @@ firtree_cpu_engine_perform_render(FirtreeCpuEngine* self,
firtree_sampler_unlock(p->sampler);
}
+#if FIRTREE_HAVE_GDK_PIXBUF
+
gboolean
firtree_cpu_engine_render_into_pixbuf (FirtreeCpuEngine* self,
FirtreeVec4* extents, GdkPixbuf* pixbuf)
@@ -769,6 +771,8 @@ firtree_cpu_engine_render_into_pixbuf (FirtreeCpuEngine* self,
return TRUE;
}
+#endif
+
#if FIRTREE_HAVE_CAIRO
gboolean
firtree_cpu_engine_render_into_cairo_surface (FirtreeCpuEngine* self,
@@ -21,7 +21,6 @@
#define _FIRTREE_CPU_ENGINE
#include <glib-object.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
#include <firtree/firtree.h>
#include <firtree/firtree-sampler.h>
@@ -30,6 +29,10 @@
# include <cairo/cairo.h>
#endif
+#if FIRTREE_HAVE_GDK_PIXBUF
+# include <gdk-pixbuf/gdk-pixbuf.h>
+#endif
+
/**
* SECTION:firtree-cpu-engine
* @short_description: A rendering engine which uses a CPU JIT.
@@ -85,6 +88,8 @@ GType firtree_cpu_engine_get_type (void);
FirtreeCpuEngine*
firtree_cpu_engine_new (void);
+#if FIRTREE_HAVE_GDK_PIXBUF
+
/**
* firtree_cpu_engine_render_into_pixbuf:
* @self: A FirtreeCpuEngine object.
@@ -99,6 +104,8 @@ gboolean
firtree_cpu_engine_render_into_pixbuf (FirtreeCpuEngine* self,
FirtreeVec4* extents, GdkPixbuf* pixbuf);
+#endif
+
#if FIRTREE_HAVE_CAIRO
/**

0 comments on commit b9383c2

Please sign in to comment.