1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# CMake project file for firtree
#
# Copyright (C) 2009 Rich Wareham <richwareham@gmail.com>
#
# See LICENSE file for distribution rights.
# The name of this project is 'Firtree'.
project(Firtree)
# Set the minimum CMake version
cmake_minimum_required(VERSION 2.6)
# Update the module path to include any extra CMake modiles we might ship.
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
# Set some variables indicating the version number of Firtree.
set(FIRTREE_VERSION_MAJOR "0")
set(FIRTREE_VERSION_MINOR "2")
set(FIRTREE_VERSION_PATCH "0")
set(FIRTREE_VERSION "${FIRTREE_VERSION_MAJOR}.${FIRTREE_VERSION_MINOR}.${FIRTREE_VERSION_PATCH}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
# Add the root source dir as an include dir
include_directories("${CMAKE_SOURCE_DIR}")
if(NOT APPLE)
# We use pkg-config to fing glib et al
find_package(PkgConfig)
# Find glib et al
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)
# Magic to set GCC-specific compile flags
set(GCC_FLAGS "-Wall -O9 -g")
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GCC_FLAGS}")
endif(CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_FLAGS}")
endif(CMAKE_COMPILER_IS_GNUCXX)
# On x86_64 we need to compile with -fPIC
if(UNIX AND NOT WIN32)
find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
if(CMAKE_UNAME)
exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR)
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}
CACHE INTERNAL "processor type (i386 and x86_64)")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
endif(CMAKE_UNAME)
endif(UNIX AND NOT WIN32)
# Build the common C++ support libraries
add_subdirectory(common)
# Build the Kernel language -> LLVM frontend.
add_subdirectory(llvm-frontend)
# Build the example command line tools
add_subdirectory(tools)
# The Firtree library itself
add_subdirectory(firtree)
# Build the library bindings
add_subdirectory(bindings)
# Build the documentation
add_subdirectory(doc)
# The test suite
add_subdirectory(testing)
# vim:sw=4:ts=4:autoindent:et
|