summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindCLucene.cmake122
-rw-r--r--cmake/FindICU.cmake98
-rw-r--r--cmake/FindLibraryWithDebug.cmake117
-rw-r--r--cmake/FindRegex.cmake37
-rw-r--r--cmake/README87
-rw-r--r--cmake/bindings.cmake135
-rwxr-xr-xcmake/configure-iphone-simulator.sh30
-rwxr-xr-xcmake/configure-iphone.sh30
-rw-r--r--cmake/install.cmake91
-rw-r--r--cmake/muxsources.cmake83
-rw-r--r--cmake/sources.cmake420
-rw-r--r--cmake/toolchains/iphone-2.2.1.toolchain-broken51
-rw-r--r--cmake/toolchains/iphone-3.0.toolchain51
-rw-r--r--cmake/toolchains/iphone-3.1.2.toolchain51
-rw-r--r--cmake/toolchains/iphone-3.1.3.toolchain51
-rw-r--r--cmake/toolchains/iphone-3.1.toolchain51
-rw-r--r--cmake/toolchains/iphone-simulator-2.2.1.toolchain-broken51
-rw-r--r--cmake/toolchains/iphone-simulator-3.0.toolchain52
-rw-r--r--cmake/toolchains/iphone-simulator-3.1.2.toolchain52
-rw-r--r--cmake/toolchains/iphone-simulator-3.1.3.toolchain52
-rw-r--r--cmake/toolchains/iphone-simulator-3.1.toolchain52
21 files changed, 1764 insertions, 0 deletions
diff --git a/cmake/FindCLucene.cmake b/cmake/FindCLucene.cmake
new file mode 100644
index 0000000..c5a6450
--- /dev/null
+++ b/cmake/FindCLucene.cmake
@@ -0,0 +1,122 @@
+#
+# SOURCE: http://websvn.kde.org/trunk/kdesupport/strigi/cmake/FindCLucene.cmake?view=log
+#
+# ONE FIX: /usr/lib64 added to work on Fedora
+#
+
+
+#
+# This module looks for clucene (http://clucene.sf.net) support
+# It will define the following values
+#
+# CLUCENE_INCLUDE_DIR = where CLucene/StdHeader.h can be found
+# CLUCENE_LIBRARY_DIR = where CLucene/clucene-config.h can be found
+# CLUCENE_LIBRARY = the library to link against CLucene
+# CLUCENE_VERSION = The CLucene version string
+# CLucene_FOUND = set to 1 if clucene is found
+#
+
+INCLUDE(CheckSymbolExists)
+INCLUDE(FindLibraryWithDebug)
+
+if(NOT CLUCENE_MIN_VERSION)
+ set(CLUCENE_MIN_VERSION "0.9.19")
+endif(NOT CLUCENE_MIN_VERSION)
+
+IF(EXISTS ${PROJECT_CMAKE}/CLuceneConfig.cmake)
+ INCLUDE(${PROJECT_CMAKE}/CLuceneConfig.cmake)
+ENDIF(EXISTS ${PROJECT_CMAKE}/CLuceneConfig.cmake)
+
+IF(MSVC)
+ IF(CMAKE_BUILD_TYPE STREQUAL "Release")
+ SET(WIN_CLUCENE_SEARCH_PATH ../clucene-core/src/CLucene/Release)
+ ELSE(CMAKE_BUILD_TYPE STREQUAL "Release")
+ SET(WIN_CLUCENE_SEARCH_PATH ../clucene-core/src/CLucene/debug)
+ ENDIF(CMAKE_BUILD_TYPE STREQUAL "Release")
+ SET(WIN_CLUCENE_INCLUDE_PATH ../clucene-core/src)
+ELSE(MSVC)
+ SET(WIN_CLUCENE_SEARCH_PATH "")
+ SET(WIN_CLUCENE_INCLUDE_PATH "")
+ENDIF(MSVC)
+
+SET(TRIAL_LIBRARY_PATHS
+ $ENV{CLUCENE_HOME}/lib${LIB_SUFFIX}
+ ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
+ /usr/local/lib${LIB_SUFFIX}
+ /opt/local/lib${LIB_SUFFIX}
+ /usr/lib${LIB_SUFFIX}
+ /usr/lib64
+ /sw/lib${LIB_SUFFIX}
+ /usr/pkg/lib${LIB_SUFFIX}
+ ${WIN_CLUCENE_SEARCH_PATH}
+ )
+SET(TRIAL_INCLUDE_PATHS
+ $ENV{CLUCENE_HOME}/include
+ ${CMAKE_INSTALL_PREFIX}/include
+ /usr/local/include
+ /usr/include
+ /sw/include
+ /usr/pkg/include
+ ${WIN_CLUCENE_INCLUDE_PATH}
+ )
+FIND_LIBRARY_WITH_DEBUG(CLUCENE_LIBRARY
+ NAMES clucene clucene-core
+ PATHS ${TRIAL_LIBRARY_PATHS})
+IF (CLUCENE_LIBRARY)
+ MESSAGE(STATUS "Found CLucene library: ${CLUCENE_LIBRARY}")
+ENDIF (CLUCENE_LIBRARY)
+FIND_PATH(CLUCENE_INCLUDE_DIR
+ NAMES CLucene.h
+ PATHS ${TRIAL_INCLUDE_PATHS}
+ ONLY_CMAKE_FIND_ROOT_PATH)
+
+IF (CLUCENE_INCLUDE_DIR)
+ MESSAGE(STATUS "Found CLucene include dir: ${CLUCENE_INCLUDE_DIR}")
+ENDIF (CLUCENE_INCLUDE_DIR)
+
+IF(WIN32)
+ SET(TRIAL_LIBRARY_PATHS ${CLUCENE_INCLUDE_DIR})
+ENDIF(WIN32)
+
+SET(CLUCENE_GOOD_VERSION TRUE)
+
+FIND_PATH(CLUCENE_LIBRARY_DIR
+ NAMES CLucene/clucene-config.h PATHS ${TRIAL_LIBRARY_PATHS} ${TRIAL_INCLUDE_PATHS} NO_DEFAULT_PATH)
+IF (CLUCENE_LIBRARY_DIR)
+ MESSAGE(STATUS "Found CLucene library dir: ${CLUCENE_LIBRARY_DIR}")
+ FILE(READ ${CLUCENE_LIBRARY_DIR}/CLucene/clucene-config.h CLCONTENT)
+ STRING(REGEX MATCH "_CL_VERSION +\".*\"" CLMATCH ${CLCONTENT})
+ IF (CLMATCH)
+ STRING(REGEX REPLACE "_CL_VERSION +\"(.*)\"" "\\1" CLUCENE_VERSION ${CLMATCH})
+ IF (CLUCENE_VERSION STRLESS "${CLUCENE_MIN_VERSION}")
+ MESSAGE(ERROR " CLucene version ${CLUCENE_VERSION} is less than the required minimum ${CLUCENE_MIN_VERSION}")
+ SET(CLUCENE_GOOD_VERSION FALSE)
+ ENDIF (CLUCENE_VERSION STRLESS "${CLUCENE_MIN_VERSION}")
+ IF (CLUCENE_VERSION STREQUAL "0.9.17")
+ MESSAGE(ERROR "CLucene version 0.9.17 is not supported.")
+ SET(CLUCENE_GOOD_VERSION FALSE)
+ ENDIF (CLUCENE_VERSION STREQUAL "0.9.17")
+ ENDIF (CLMATCH)
+ELSE (CLUCENE_LIBRARY_DIR)
+ MESSAGE(STATUS "CLucene library dir not found.")
+ENDIF (CLUCENE_LIBRARY_DIR)
+
+IF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)
+ SET(CLucene_FOUND TRUE)
+ENDIF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)
+
+IF(CLucene_FOUND)
+ IF(NOT CLucene_FIND_QUIETLY)
+ MESSAGE(STATUS "Found CLucene: ${CLUCENE_LIBRARY}")
+ ENDIF(NOT CLucene_FIND_QUIETLY)
+ELSE(CLucene_FOUND)
+ IF(CLucene_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find CLucene.")
+ ENDIF(CLucene_FIND_REQUIRED)
+ENDIF(CLucene_FOUND)
+
+MARK_AS_ADVANCED(
+ CLUCENE_INCLUDE_DIR
+ CLUCENE_LIBRARY_DIR
+ CLUCENE_LIBRARY
+ )
diff --git a/cmake/FindICU.cmake b/cmake/FindICU.cmake
new file mode 100644
index 0000000..7b84bed
--- /dev/null
+++ b/cmake/FindICU.cmake
@@ -0,0 +1,98 @@
+# Finds the International Components for Unicode (ICU) Library
+#
+# ICU_FOUND - True if ICU found.
+# ICU_I18N_FOUND - True if ICU's internationalization library found.
+# ICU_INCLUDE_DIRS - Directory to include to get ICU headers
+# Note: always include ICU headers as, e.g.,
+# unicode/utypes.h
+# ICU_LIBRARIES - Libraries to link against for the common ICU
+# ICU_I18N_LIBRARIES - Libraries to link against for ICU internationaliation
+# (note: in addition to ICU_LIBRARIES)
+
+# Our first goal is to find the icu-config script, if possible
+find_program(
+ ICU_CONFIG_BIN
+ icu-config
+)
+find_program(
+ ICU_GENRB
+ genrb
+)
+
+if(ICU_CONFIG_BIN)
+ MESSAGE(STATUS "icu-config found at ${ICU_CONFIG_BIN}: Using that for configuration")
+ MESSAGE(STATUS "genrb found at ${ICU_GENRB}: Using that for generating transliteration data")
+
+ # Get include directories
+ execute_process(COMMAND "${ICU_CONFIG_BIN}" "--cppflags"
+ OUTPUT_VARIABLE ICU_INCLUDE_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ # Sanitize output
+ string(REPLACE "-I" "" ICU_INCLUDE_DIR ${ICU_INCLUDE_DIR})
+ string(REGEX REPLACE "^[ ]+" "" ICU_INCLUDE_DIR ${ICU_INCLUDE_DIR})
+
+ # Try to get the Libraries we need
+ execute_process(COMMAND "${ICU_CONFIG_BIN}" "--ldflags"
+ OUTPUT_VARIABLE ICU_LIBRARY_RAW
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ execute_process(COMMAND "${ICU_CONFIG_BIN}" "--ldflags-icuio"
+ OUTPUT_VARIABLE ICU_LIBRARY_IO_RAW
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ string(REGEX REPLACE "^[ ]+" "" ICU_LIBRARY ${ICU_LIBRARY_RAW})
+ string(REGEX REPLACE "^[ ]+" "" ICU_LIBRARY_IO ${ICU_LIBRARY_IO_RAW})
+ # Combine them
+ set(ICU_LIBRARY "${ICU_LIBRARY} ${ICU_LIBRARY_IO_RAW}")
+
+ # Get the version
+ execute_process(COMMAND "${ICU_CONFIG_BIN}" "--version"
+ OUTPUT_VARIABLE ICU_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+else(ICU_CONFIG_BIN)
+
+ # Look for the header file.
+ find_path(
+ ICU_INCLUDE_DIR
+ NAMES unicode/utypes.h
+ DOC "Include directory for the ICU library")
+ mark_as_advanced(ICU_INCLUDE_DIR)
+
+ # Look for the library.
+ find_library(
+ ICU_LIBRARY
+ NAMES icuuc cygicuuc cygicuuc32
+ DOC "Libraries to link against for the common parts of ICU")
+ mark_as_advanced(ICU_LIBRARY)
+endif(ICU_CONFIG_BIN)
+
+# Copy the results to the output variables.
+if(ICU_INCLUDE_DIR AND ICU_LIBRARY)
+ set(ICU_FOUND 1)
+ set(ICU_LIBRARIES ${ICU_LIBRARY})
+ set(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})
+
+ # Look for the ICU internationalization libraries
+ find_library(
+ ICU_I18N_LIBRARY
+ NAMES icuin icui18n cygicuin cygicuin32
+ DOC "Libraries to link against for ICU internationalization")
+ mark_as_advanced(ICU_I18N_LIBRARY)
+ if (ICU_I18N_LIBRARY)
+ set(ICU_I18N_FOUND 1)
+ set(ICU_I18N_LIBRARIES ${ICU_I18N_LIBRARY})
+ else (ICU_I18N_LIBRARY)
+ set(ICU_I18N_FOUND 0)
+ set(ICU_I18N_LIBRARIES)
+ endif (ICU_I18N_LIBRARY)
+else(ICU_INCLUDE_DIR AND ICU_LIBRARY)
+ set(ICU_FOUND 0)
+ set(ICU_I18N_FOUND 0)
+ set(ICU_LIBRARIES)
+ set(ICU_I18N_LIBRARIES)
+ set(ICU_INCLUDE_DIRS)
+endif(ICU_INCLUDE_DIR AND ICU_LIBRARY)
diff --git a/cmake/FindLibraryWithDebug.cmake b/cmake/FindLibraryWithDebug.cmake
new file mode 100644
index 0000000..0844a1e
--- /dev/null
+++ b/cmake/FindLibraryWithDebug.cmake
@@ -0,0 +1,117 @@
+#
+# SOURCE KDE4 cmake additional files
+#
+
+#
+# FIND_LIBRARY_WITH_DEBUG
+# -> enhanced FIND_LIBRARY to allow the search for an
+# optional debug library with a WIN32_DEBUG_POSTFIX similar
+# to CMAKE_DEBUG_POSTFIX when creating a shared lib
+# it has to be the second and third argument
+
+# Copyright (c) 2007, Christian Ehrlicher, <ch.ehrlicher@gmx.de>
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+MACRO(FIND_LIBRARY_WITH_DEBUG var_name win32_dbg_postfix_name dgb_postfix libname)
+
+ IF(NOT "${win32_dbg_postfix_name}" STREQUAL "WIN32_DEBUG_POSTFIX")
+
+ # no WIN32_DEBUG_POSTFIX -> simply pass all arguments to FIND_LIBRARY
+ FIND_LIBRARY(${var_name}
+ ${win32_dbg_postfix_name}
+ ${dgb_postfix}
+ ${libname}
+ ${ARGN}
+ )
+
+ ELSE(NOT "${win32_dbg_postfix_name}" STREQUAL "WIN32_DEBUG_POSTFIX")
+
+ IF(NOT WIN32)
+ # on non-win32 we don't need to take care about WIN32_DEBUG_POSTFIX
+
+ FIND_LIBRARY(${var_name} ${libname} ${ARGN})
+
+ ELSE(NOT WIN32)
+
+ # 1. get all possible libnames
+ SET(args ${ARGN})
+ SET(newargs "")
+ SET(libnames_release "")
+ SET(libnames_debug "")
+
+ LIST(LENGTH args listCount)
+
+ IF("${libname}" STREQUAL "NAMES")
+ SET(append_rest 0)
+ LIST(APPEND args " ")
+
+ FOREACH(i RANGE ${listCount})
+ LIST(GET args ${i} val)
+
+ IF(append_rest)
+ LIST(APPEND newargs ${val})
+ ELSE(append_rest)
+ IF("${val}" STREQUAL "PATHS")
+ LIST(APPEND newargs ${val})
+ SET(append_rest 1)
+ ELSE("${val}" STREQUAL "PATHS")
+ LIST(APPEND libnames_release "${val}")
+ LIST(APPEND libnames_debug "${val}${dgb_postfix}")
+ ENDIF("${val}" STREQUAL "PATHS")
+ ENDIF(append_rest)
+
+ ENDFOREACH(i)
+
+ ELSE("${libname}" STREQUAL "NAMES")
+
+ # just one name
+ LIST(APPEND libnames_release "${libname}")
+ LIST(APPEND libnames_debug "${libname}${dgb_postfix}")
+
+ SET(newargs ${args})
+
+ ENDIF("${libname}" STREQUAL "NAMES")
+
+ # search the release lib
+ FIND_LIBRARY(${var_name}_RELEASE
+ NAMES ${libnames_release}
+ ${newargs}
+ )
+
+ # search the debug lib
+ FIND_LIBRARY(${var_name}_DEBUG
+ NAMES ${libnames_debug}
+ ${newargs}
+ )
+
+ IF(${var_name}_RELEASE AND ${var_name}_DEBUG)
+
+ # both libs found
+ SET(${var_name} optimized ${${var_name}_RELEASE}
+ debug ${${var_name}_DEBUG})
+
+ ELSE(${var_name}_RELEASE AND ${var_name}_DEBUG)
+
+ IF(${var_name}_RELEASE)
+
+ # only release found
+ SET(${var_name} ${${var_name}_RELEASE})
+
+ ELSE(${var_name}_RELEASE)
+
+ # only debug (or nothing) found
+ SET(${var_name} ${${var_name}_DEBUG})
+
+ ENDIF(${var_name}_RELEASE)
+
+ ENDIF(${var_name}_RELEASE AND ${var_name}_DEBUG)
+
+ MARK_AS_ADVANCED(${var_name}_RELEASE)
+ MARK_AS_ADVANCED(${var_name}_DEBUG)
+
+ ENDIF(NOT WIN32)
+
+ ENDIF(NOT "${win32_dbg_postfix_name}" STREQUAL "WIN32_DEBUG_POSTFIX")
+
+ENDMACRO(FIND_LIBRARY_WITH_DEBUG)
diff --git a/cmake/FindRegex.cmake b/cmake/FindRegex.cmake
new file mode 100644
index 0000000..8973d8d
--- /dev/null
+++ b/cmake/FindRegex.cmake
@@ -0,0 +1,37 @@
+######################################################################
+# This will test to see if the system has a regex.h file. If so, then
+# that header will be included and the library will not build its own
+# regex support. If the regex.h is located, then it is assumed that the
+# Standard C Library has built-in support for Regex and it will not be
+# necessary for SWORD to use its own system internally.
+#
+# Variables:
+# REGEX_INCLUDE_DIR - the directory containing the regex.h file
+# REGEX_FOUND - Set to true if the system's regex.h exists
+
+# We call this twice because on Mac, at least for me, it finds a regex.h
+# inside of /System/Library/Frameworks/Ruby.framework/Headers, which is
+# the paramount of useless. By calling it the first time with some basic
+# Unix/Linux compatible forced paths, if it finds it there, then we won't
+# have to search again, the value will be cached. However, if the first
+# call to FIND_PATH fails, then the search will be run again below.
+FIND_PATH(REGEX_INCLUDE_DIR regex.h
+ PATHS /usr/include /usr/local/include
+ NO_DEFAULT_PATH
+ ONLY_CMAKE_FIND_ROOT_PATH
+)
+# Second call
+IF(NOT REGEX_INCLUDE_DIR)
+ FIND_PATH(REGEX_INCLUDE_DIR regex.h
+ ONLY_CMAKE_FIND_ROOT_PATH # Hopefully that will assist in iPhone stuffs
+ )
+ENDIF(NOT REGEX_INCLUDE_DIR)
+
+IF(REGEX_INCLUDE_DIR)
+ SET(REGEX_FOUND 1)
+ENDIF(REGEX_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(
+ REGEX_INCLUDE_DIR
+)
+
diff --git a/cmake/README b/cmake/README
new file mode 100644
index 0000000..1a8c8ef
--- /dev/null
+++ b/cmake/README
@@ -0,0 +1,87 @@
+
+BUILDING WITH CMAKE
+
+First, you'll be required to install CMake. You can get pre-built binaries here: [1]. There are versions for Linux/Unix, OS X, Windows, SunOS/Sparc, IRIX64, HPUX and AIX. Most of them have GUIs, but can also be run from the command line. If you are in Linux/Unix there is almost certainly a package available from your system. I have tested the build with versions 2.6.4 and 2.8 of CMake - if you have something from the 2.4 series and are feeling brave enough to try it, please edit the file CMakeLists.txt and, near the top of the file, change the line that reads CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0) to require a version low enough so you can test with your version. I have set the minimum at 2.6.0 because that is the minimum I have tested with and not because I am aware of any limitations of versions earlier than 2.4 which would break the system. Please report any success or failures you have as a result of changes.
+
+If you have the SWORD supporting libraries you want to use installed, and also have CMake installed, it is now time to try to configure the system. Follow the appropriate steps laid out below:
+
+
+Bash or other command-line tool, probably Unix/Linux environment
+
+ * Create a new directory where the actual configure or build will take place - this can be an empty subdirectory of SWORD (e.g. sword/cmakebuild) or a parallel directory (sword/../swordbuild) or anywhere else you would like. I personally use the parallel directory and following example commands will reflect a directory structure with cmake_sword/ as the base of the SWORD sources and a parallel directory cmake_build/ as the build directory.
+ * Change into your build directory: cd cmake_build
+ * Issue the call to CMake with any options you want to test and point it to the root of your SWORD sources: cmake <options> ../cmake_sword/
+ * Check that there are no error messages and that CMake ends with the messages "Configuring done", "Generating done", and "Build files have been written to: <object directory>"
+ * From here on out, building should be just like building with Autotools - make -j4/sudo make install
+
+GUI users
+
+For those of you using the GUI interfaces with, for example, Windows or OS X or even the CMake GUIs for Linux:
+
+ * Open the CMake GUI.
+ * For the line where the GUI asks "Where is the source code:" browse to the directory where you checked out the SWORD source: C:\Users\Greg\Documents\Projects\cmake_sword
+ * For the line where the GUI asks "Where to build the binaries:" browse to a directory (does not need to exist yet for the GUI to operate) that is not the same as the path with the source: C:\Users\Greg\Documents\Projects\cmake_build
+ * If you wish to specify certain options (see the section on options), click the "Add Entry" button and enter the argument you wish to specify under "Name" and the value of that argument under "Value".
+ * Click "Configure"
+ o If prompted to create the build directory, say "Yes"
+ o Select the "generator" for this project... for this, select the system you wish to use to actually do the compile. Some examples are different versions of Microsoft Visual Studio, Unix Makefiles, MSYS Makefiles, Cygwin Makefiles, Xcode projects, Eclipse projects, Borland projects and more.
+ o Unless you are building for the iPhone (in which case you should skip to the section especially for iPhones!), you will probably want to leave "Use default native compilers" unless you are a power user and know what compiler you would like to use. You could use special options here if you need to select special cross-compilers or similar.
+ * After configure is completed, if there were errors, you will have a chance to correct them. If certain libraries were not located or you wish to use other values, you can select the Advanced View or check Show Advanced and manually edit any of the cached values.
+ * If you are happy with the results and there are no errors or after you have corrected any errors, click Configure a second time.
+ * Click Generate
+ * Navigate to the directory where you specified to build the binaries and invoke your build system through its native mechanics - open the project file, execute the Makefiles, etc.
+
+iPhone
+
+There are special steps to be taken to build for the iPhone, if you so wish. When I next get on my Mac, I will post these directions especially for you.
+
+ * alternatively, talk to me about how I do things for PocketSword. I use neither the Make system or CMake. --Niccarter 12:10, 19 April 2010 (UTC)
+
+How can I customize my options?
+
+While not all of the options and functionality of the original SWORD automake system are necessarily supported, I would like to document those which I know about and their status. Also, I want to document the basic method of specifying these options.
+CMake Options
+
+Probably the only important CMake option for normal users is the "Generator" option. For those of you using a GUI, you will be prompted for the Generator to use the first time you click Configure. For command-line users, the default will generally be Unix Makefiles - this goes for Linux, Mac OS X and MinGW in my experience - (possibly different if you're using the DOS prompt in Windows, I haven't checked there) unless you specify otherwise. To get a list of the generators supported by your version of CMake run "cmake --help". The generators will be listed at the bottom. Select the one you would like, for example Xcode, and add the option string: -G Xcode to your invocation of CMake. Other examples might be -G "KDevelop3 - Unix Makefiles" if you wanted to use KDevelop3 but have it managing Unix Makefiles.
+SWORD Options
+
+For all of these options if you are using a GUI, you can set these options by clicking "Add Entry" before configuring and setting the Name and Value fields. For command line users, you would set an option named SWORD_OPTION to value VALUE by adding -DSWORD_OPTION=VALUE to your CMake options. This would look like cmake -DSWORD_OPTION=VALUE ../cmake_build or similar.
+
+The options are listed here by name, grouped roughly by their functioning.
+General, interesting options
+
+ * SWORD_GLOBAL_CONF - If this has a non-empty value, then the option "-DGLOBCONFPATH=${SWORD_GLOBAL_CONF}/sword.conf" is passed to the compiler. If SWORD_GLOBAL_CONF is unset or is empty, then no additional options are passed to the compiler. I believe support for this is only half implemented at the moment. I believe that, if this is set, then an actual sword.conf should be written to the directory specified. At present this is not the case. I am unsure of the correct default behavior if this is not specified.
+ * CMAKE_INSTALL_PREFIX - The location on disk where the files will be installed. If left unset this will default to /opt/local on OS X, C:\Program Files (x86)\libsword\ under Microsoft Visual Studio and /usr/local for anything else. Executables will be installed in the bin/ subdirectory, libraries under lib/ and headers under include/sword. A package config file will be installed in lib/pkgconfig. There is currently no support for installing the different components to other locations, although one could be supplied without much extra effort if it is useful.
+ * SWORD_BUILD_UTILS - If this has the value "No" then utilities will not be built. If this has any other value or is left unspecified, the Utilities will be built and installed.
+ * SWORD_BUILD_EXAMPLES - If this is given the value "Yes" then the examples/cmdline demos will be built. If this has any other value or is left blank, then demos will not be built.
+ * SWORD_BUILD_TESTS - If this is given the value "Yes" then the SWORD tests will be run. They are still run using the same system as before (or as closely as it could be replicated). If this has any other value or is left unspecified, tests will not be run. The exception to that is the simple buildtest.cpp in the root of the sword/ folder which will always be built when the library is built.
+
+Optional dependencies
+
+ * SWORD_NO_ZLIB and SWORD_USE_INTERNAL_ZLIB - If SWORD_NO_ZLIB has value "Yes" then No ZLib support will be built into the library. If SWORD_NO_ZLIB has any other value, then ZLib support will be built into the library. If support is to be built in, and either a system-wide ZLib is not found OR SWORD_USE_INTERNAL_ZLIB is set to "Yes", then the internal version will be built. If a system library is found AND SWORD_USE_INTERNAL_ZLIB is set to anything other than "Yes" or has no value, then the system library will be linked against. If both SWORD_NO_ZLIB and SWORD_USE_INTERNAL_ZLIB are set to "Yes" then SWORD_NO_ZLIB will be used, and no ZLib support will be built.
+ * SWORD_NO_CURL - If this is set to "Yes" then cURL support will not be included regardless of whether cURL is found on the system. If this is any other value or has no value set, then cURL will be built against if it is located and ignored if it cannot be located.
+ * SWORD_NO_CLUCENE - If this is set to "Yes" then CLucene will be ignored if found. If this is set to any other value or has no value, then the library will be built against CLucene if it can be located and ignored if it cannot be located.
+
+Developer or Packager specific options
+
+ * LIBSWORD_LIBRARY_TYPE - If this has the value "Shared" then a shared library will be build (DLL or .so) along with the exported linking stub. If this is unspecified, then a static library will be built.
+ * CMAKE_BUILD_TYPE - If this is given the value of "Debug" then the default SWORD debugging flags (-g3 -Wall -Werror -O0) will be enabled. If this is unspecified or any value other than "Debug" then the flag -O3 will be enabled.
+ * SWORD_ENABLE_WARNINGS - If this has the value "Yes" then -Werror will be passed to the compiler. This would allow independent specification of -Werror without needing to enable actual debugging. Should this also enable -Wall?
+ * SWORD_ENABLE_PROFILE - if this has the value of "Yes" then the -pg option will be passed to the compiler. I don't know what this does, but it was available with Autotools, so it has been replicated here. This defaults to off.
+ * SWORD_ENABLE_PROFILEN - if this has the value of "Yes" then the "-g -finstrument-functions" options will be passed to the compiler. The same disclaimer goes for this as goes for the previous option. This also defaults to off.
+
+How do I hack the code?
+
+If you want to directly hack the SWORD library for reasons other than CMake, I suggest you go elsewhere on this wiki for that.
+
+If you have suggestions and edits for this system, you are welcome to create patches and submit them to the sword-devel mailing list. Also, you can find my email on the list's archives and send them directly to me (Greg Hellings) or, if you are ambitious, you are welcome to create a branch using your favorite DVCS and publish it somewhere and let me know. Bazaar has amazing support for allowing me interface with whatever system you wish, so you can publish a git, Mercurial, Bazaar, SVN or CVS repository with the code in it and I should be able to review your changes and integrate them.
+
+For a basic overview - all of the files are contained within the sword/cmake directory except for a few CMakeLists.txt files in strategic locations. CMakeLists.txt is the file that is the entry point for the system. Any calls to functions like FIND(ICU QUIET) will look for a module either included with your CMake system (ZLib) or included within the directory specified by the line SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") CMake will try to find a file titled FindICU.cmake in one of those paths to satisfy your call to FIND(ICU).
+
+Source lists are in sword/cmake/sources.cmake. I have kept them broken out evenly into their separate base directories under sword/src. Additionally any sources which are only included for conditional reasons have their own set of variables down towards the bottom of that file with what are hopefully successfully mnemonic names.
+
+After calls to FIND(<library>), the system then has to react to which files were found and which were not. This is handled with some semi-complicated logic in sword/cmake/muxsources.cmake.
+
+Since utilities, tests and examples are all optional compilations, they have their own CMakeLists.txt files located in their own directories. These are invoked with a call to ADD_SUBDIRECTORY([path to directory]). Additional CMakeLists.txt files could also be created for things like the bindings and other self-contained paths.
+
+After build, install is handled in the sword/cmake/install.cmake file.
diff --git a/cmake/bindings.cmake b/cmake/bindings.cmake
new file mode 100644
index 0000000..8704390
--- /dev/null
+++ b/cmake/bindings.cmake
@@ -0,0 +1,135 @@
+#####################################################################################################
+#
+# A system to, hopefully, build the Sword bindings which are asked for. Currently I only know and
+# therefore only support Python & Perl bindings. YMMV for it, please submit patches or suggestions.
+# I will try to get them integrated into the system if I can. If there are bindings that you need
+# other than the Python|Perl/Swig bindings, then you should probably speak up now.
+
+#####################################################################################################
+# SWIG
+# We need to find the SWIG executable in order to be able to do this, right?
+FIND_PACKAGE(SWIG)
+
+IF(NOT SWIG_FOUND)
+ MESSAGE(FATAL_ERROR "Swig not found. Bindings will not be built.")
+ELSE(NOT SWIG_FOUND)
+ MESSAGE(STATUS "Swig found at ${SWIG_EXECUTABLE}")
+
+ SET(SWORD_SWIG_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/bindings/swig")
+ SET(SWORD_SWIG_BINARY "${CMAKE_CURRENT_BINARY_DIR}/bindings/swig")
+
+ # This code that is commented out is basically how CMake suggests that you do it. I, on the
+ # other hand, can't seem to get it to do that. The manual seems to work though, so go with that
+ # instead.
+ #INCLUDE(${SWIG_USE_FILE})
+
+ #FIND_PACKAGE(PythonLibs)
+ #INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
+ #INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/bindings/swig)
+
+ #SET(CMAKE_SWIG_FLAGS "")
+
+ #SET_SOURCE_FILES_PROPERTIES(sword.i PROPERTIES CPLUSPLUS ON)
+ #SET_SOURCE_FILES_PROPERTIES(sword.i PROPERTIES SWIG_FLAGS "-shadow")
+
+ #SWIG_ADD_MODULE(sword python
+ # "${CMAKE_CURRENT_SOURCE_DIR}/bindings/swig/sword.i"
+ #"${CMAKE_CURRENT_SOURCE_DIR}/bindings/swig/python/Sword.cxx"
+ # )
+ #SWIG_LINK_LIBRARIES(sword ${PYTHON_LIBRARIES})
+
+ # Borrowed this from the CMake UseSWIG.cmake file
+ GET_DIRECTORY_PROPERTY(cmake_include_directories INCLUDE_DIRECTORIES)
+ SET(SWIG_INCLUDES)
+ FOREACH(direct ${cmake_include_directories})
+ SET(SWIG_INCLUDES ${SWIG_INCLUDES} "-I${direct}")
+ ENDFOREACH(direct ${cmake_include_directories})
+# MESSAGE(STATUS "${SWIG_INCLUDES} include directories")
+
+ IF(SWORD_BINDINGS MATCHES ".*Python.*")
+ # This should add the pythonswig target to be built when the "make" command is executed
+ ADD_CUSTOM_TARGET(pythonswig ALL
+ mkdir -p "${SWORD_SWIG_BINARY}/python"
+ COMMAND ${SWIG_EXECUTABLE} "-w503,+509" -python -c++ -shadow -o "${SWORD_SWIG_BINARY}/python/Sword.cxx" "-I${SWORD_SWIG_SOURCE}" ${SWIG_INCLUDES} "${SWORD_SWIG_SOURCE}/sword.i"
+ COMMAND echo "#! /usr/bin/python" > ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo "" >> ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo "from distutils.core import setup, Extension" >> ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo "setup (name = \"sword\"," >> ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo " version = \"${SWORD_VERSION}\"," >> ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo " maintainer = \"Sword Developers\"," >> ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo " maintainer_email = \"sword-devel@crosswire.org\"," >> ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo " url = \"http://www.crosswire.org/sword\"," >> ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo " py_modules = [\"Sword\"]," >> ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo " include_dirs=['${SWORD_SWIG_SOURCE}', '${CMAKE_CURRENT_SOURCE_DIR}/include', '${SWORD_SWIG_SOURCE}/..', '${SWORD_SWIG_SOURCE}/../..']," >> ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo " ext_modules = [Extension(\"_Sword\", [\"Sword.cxx\"]," >> ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo " libraries=[('sword')], " >> ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo " library_dirs=[('${CMAKE_CURRENT_BINARY_DIR}')], " >> ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo " )], " >> ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo ")" >> ${SWORD_SWIG_BINARY}/python/setup.py
+ COMMAND echo "Python bindings built, to install change into ${SWORD_SWIG_BINARY}/python and type 'python setup.py install'"
+ DEPENDS sword
+ WORKING_DIRECTORY "${SWORD_SWIG_SOURCE}"
+ VERBATIM
+ )
+
+ MESSAGE(STATUS "Configured for building Python bindings.")
+ ENDIF(SWORD_BINDINGS MATCHES ".*Python.*")
+
+ IF(SWORD_BINDINGS MATCHES ".*Perl.*")
+ FIND_PACKAGE(Perl REQUIRED)
+ IF(PERL_FOUND)
+ # This is a terrible hack. Don't leave it stay here. It's ugly
+ SET(LIB_SWORD "${CMAKE_CURRENT_BINARY_DIR}/libsword.a")
+# MESSAGE(STATUS "LIB_SWORD is ${LIB_SWORD}")
+ # This should add the perlswig target to be build with the "make" command is executed
+ ADD_CUSTOM_TARGET(perlswig ALL
+ mkdir -p "${SWORD_SWIG_BINARY}/perl"
+ COMMAND ${SWIG_EXECUTABLE} "-w503,+509" -perl -c++ -shadow -o "${SWORD_SWIG_BINARY}/perl/Sword.cxx" "-I${SWORD_SWIG_SOURCE}" ${SWIG_INCLUDES} "${SWORD_SWIG_SOURCE}/sword.i"
+ COMMAND echo "Writing ${SWORD_SWIG_BINARY}/perl/Makefile.PL"
+ COMMAND echo "#! /usr/bin/perl" > ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "use ExtUtils::MakeMaker;" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "# See lib/ExtUtils/MakeMaker.pm for details of how to influence" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "# the contents of the Makefile that is written." >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "WriteMakefile(" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo " 'NAME' => 'Sword'," >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo " 'VERSION' => '${SWORD_VERSION}'," >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo " 'INC' => '-I${CMAKE_CURRENT_SOURCE_DIR}/include -I${SWORD_SWIG_SOURCE}'," >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo " 'DEFINE' => '-DSWIG'," >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo " 'LIBS' => '-lsword -lz'," >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo " 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo " ($] >= 5.005 ? ## Add these new keywords supported since 5.005" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo " (ABSTRACT => 'Sword Project perl bindings', # retrieve abstract from module" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo " AUTHOR => 'Sword Project <sword-devel@crosswire.org>') : ())," >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo ");" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "rename 'Makefile', 'Makefile.old' or die \"can't rename Makefile\";" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "open(INPUT, '<Makefile.old') or die \"can't open input Makefile.old\";" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "open(OUTPUT, '>Makefile') or die \"can't open output Makefile\";" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "while (<INPUT>) {" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo " s/\\-lsword/\\-lsword \\-lstdc\\+\\+/;" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo " print OUTPUT \"$_\";" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "}" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "close INPUT;" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND echo "close OUTPUT;" >> ${SWORD_SWIG_BINARY}/perl/Makefile.PL
+ COMMAND cd ${SWORD_SWIG_BINARY}/perl && ${PERL_EXECUTABLE} Makefile.PL && make clean
+ COMMAND echo "\\.old" > ${SWORD_SWIG_BINARY}/perl/MANIFEST.SKIP
+ COMMAND echo "~$" >> ${SWORD_SWIG_BINARY}/perl/MANIFEST.SKIP
+ COMMAND echo "\\.bak" >> ${SWORD_SWIG_BINARY}/perl/MANIFEST.SKIP
+ COMMAND echo "^CVS" >> ${SWORD_SWIG_BINARY}/perl/MANIFEST.SKIP
+ COMMAND echo "Makefile$" >> ${SWORD_SWIG_BINARY}/perl/MANIFEST.SKIP
+ COMMAND cd ${SWORD_SWIG_BINARY}/perl && ${PERL_EXECUTABLE} Makefile.PL && make manifest
+ COMMAND echo "Perl bindings built, to install change into ${SWORD_SWIG_BINARY}/perl and type 'make install'"
+ DEPENDS sword
+ WORKING_DIRECTORY "${SWORD_SWIG_SOURCE}"
+ VERBATIM
+ )
+
+ MESSAGE(STATUS "Configured for building Perl bindings.")
+ ELSE(PERL_FOUND)
+ MESSAGE(FATAL_ERROR "Perl not found. Can't create perl bindings without Perl to bind")
+ ENDIF(PERL_FOUND)
+ ENDIF(SWORD_BINDINGS MATCHES ".*Perl.*")
+ENDIF(NOT SWIG_FOUND)
diff --git a/cmake/configure-iphone-simulator.sh b/cmake/configure-iphone-simulator.sh
new file mode 100755
index 0000000..0b9d5c0
--- /dev/null
+++ b/cmake/configure-iphone-simulator.sh
@@ -0,0 +1,30 @@
+#! /bin/bash
+# Usage: accepts 2 arguments - in order - SDK version, root of the source
+# Anything after those first two commands are passed to CMake
+if [ $# -lt 2 ]
+then
+ echo "usage: $0 <SDK Version> <root of build> [additional CMake parameters]"
+ exit
+fi
+
+unset CPATH
+unset C_INCLUDE_PATH
+unset CPLUS_INCLUDE_PATH
+unset OBJC_INCLUDE_PATH
+unset LIBS
+unset DYLD_FALLBACK_LIBRARY_PATH
+unset DYLD_FALLBACK_FRAMEWORK_PATH
+
+export SDKVER="$1"
+shift
+export DEVROOT="/Developer/Platforms/iPhoneSimulator.platform/Developer"
+export SDKROOT="$DEVROOT/SDKs/iPhoneSimulator$SDKVER.sdk"
+export PKG_CONFIG_PATH="$SDKROOT/usr/lib/pkgconfig":"/opt/iphone-$SDKVER/lib/pkgconfig":"/usr/local/iphone-$SDKVER/lib/pkgconfig"
+export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH"
+export MAINFOLDER=$1
+shift
+
+cmake \
+ -DCMAKE_TOOLCHAIN_FILE="$MAINFOLDER/cmake/toolchains/iphone-simulator-$SDKVER.toolchain" \
+ -DCMAKE_INSTALL_PREFIX="/opt/iphone-simultaor-$SDKVER" \
+ $MAINFOLDER $*
diff --git a/cmake/configure-iphone.sh b/cmake/configure-iphone.sh
new file mode 100755
index 0000000..3596e48
--- /dev/null
+++ b/cmake/configure-iphone.sh
@@ -0,0 +1,30 @@
+#! /bin/bash
+# Usage: accepts 2 arguments - in order - SDK version, root of the source
+# Anything after those first two commands are passed to CMake
+if [ $# -lt 2 ]
+then
+ echo "usage: $0 <SDK Version> <root of build> [additional CMake parameters]"
+ exit
+fi
+
+unset CPATH
+unset C_INCLUDE_PATH
+unset CPLUS_INCLUDE_PATH
+unset OBJC_INCLUDE_PATH
+unset LIBS
+unset DYLD_FALLBACK_LIBRARY_PATH
+unset DYLD_FALLBACK_FRAMEWORK_PATH
+
+export SDKVER="$1"
+shift
+export DEVROOT="/Developer/Platforms/iPhoneOS.platform/Developer"
+export SDKROOT="$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk"
+export PKG_CONFIG_PATH="$SDROOT/usr/lib/pkgconfig":"/opt/iphone-$SDKVER/lib/pkgconfig":"/usr/local/iphone-$SDKVER/lib/pkgconfig"
+export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH"
+export MAINFOLDER=$1
+shift
+
+cmake \
+ -DCMAKE_TOOLCHAIN_FILE="$MAINFOLDER/cmake/toolchains/iphone-$SDKVER.toolchain" \
+ -DCMAKE_INSTALL_PREFIX="/opt/iphone-$SDKVER" \
+ $MAINFOLDER $*
diff --git a/cmake/install.cmake b/cmake/install.cmake
new file mode 100644
index 0000000..a34381d
--- /dev/null
+++ b/cmake/install.cmake
@@ -0,0 +1,91 @@
+#####################################################################
+# First, install the library itself
+#
+IF(NOT CMAKE_INSTALL_PREFIX)
+ IF(APPLE)
+ SET(SWORD_INSTALL_DIR "/opt/local")
+ ELSEIF(MSVC)
+ SET(SWORD_INSTALL_DIR "C:\\Program Files (x86)\\libsword\\")
+ ELSE(APPLE)
+ SET(SWORD_INSTALL_DIR "/usr/local")
+ ENDIF(APPLE)
+ELSE(NOT CMAKE_INSTALL_PREFIX)
+ SET(SWORD_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
+ENDIF(NOT CMAKE_INSTALL_PREFIX)
+
+# Install the library
+IF(BUILDING_SHARED)
+ INSTALL(TARGETS sword
+ DESTINATION ${SWORD_INSTALL_DIR}/lib)
+ENDIF(BUILDING_SHARED)
+IF(BUILDING_STATIC)
+ INSTALL(TARGETS sword_static
+ DESTINATION ${SWORD_INSTALL_DIR}/lib)
+ENDIF(BUILDING_STATIC)
+
+# Install the headers
+INSTALL(FILES ${SWORD_INSTALL_HEADERS}
+ DESTINATION "${SWORD_INSTALL_DIR}/include/sword")
+
+IF(SWORD_INTERNAL_REGEX)
+ INSTALL(FILES ${INTERNAL_REGEX_HEADER}
+ DESTINATION "${SWORD_INSTALL_DIR}/include/sword")
+ENDIF(SWORD_INTERNAL_REGEX)
+
+MESSAGE(STATUS "Installation destination: ${SWORD_INSTALL_DIR}")
+
+# Configuration files, of course
+SET(prefix ${SWORD_INSTALL_DIR})
+SET(exec_prefix ${SWORD_INSTALL_DIR})
+SET(libdir ${SWORD_INSTALL_DIR}/lib)
+SET(includedir ${SWORD_INSTALL_DIR}/include)
+SET(VERSION ${SWORD_VERSION})
+IF(WITH_CURL)
+ SET(CURL_LIBS ${CURL_LIBRARY})
+ENDIF(WITH_CURL)
+IF(WITH_CLUCENE)
+ SET(CLUCENE_LIBS ${CLUCENE_LIBRARY})
+ENDIF(WITH_CLUCENE)
+IF(WITH_ICU)
+ SET(ICU_LIBS "${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES}")
+ENDIF(WITH_ICU)
+
+IF(LIBSWORD_LIBRARY_TYPE STREQUAL "Static")
+ SET(SHAREDLIB_TRUE "#")
+ELSE(LIBSWORD_LIBRARY_TYPE STREQUAL "Static")
+ SET(SHAREDLIB_FALSE "#")
+ENDIF(LIBSWORD_LIBRARY_TYPE STREQUAL "Static")
+# The @ONLY restricts it because our ${variable} which are left there as part of pkg-config
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/sword.pc.in ${CMAKE_CURRENT_BINARY_DIR}/sword.pc @ONLY)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/sword.pc
+ DESTINATION "${SWORD_INSTALL_DIR}/lib/pkgconfig")
+
+# Need to build/install the
+IF(WITH_ICU AND ICU_GENRB)
+ ADD_DEFINITIONS(-DSWICU_DATA="${libdir}/${SWORD_VERSION}_icu_${ICU_VERSION}")
+ FILE(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/icu")
+ FOREACH(translit ${translit_SOURCES})
+ STRING(REPLACE ".txt" ".res" translit_OUTPUT ${translit})
+ # Only needs to be run once, really, so we'll hook it to the end of either
+ IF(BUILDING_SHARED)
+ ADD_CUSTOM_COMMAND(TARGET sword
+ POST_BUILD
+ COMMAND ${ICU_GENRB} -s . -d "${CMAKE_CURRENT_BINARY_DIR}/icu" ${translit}
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/icu"
+ COMMENT "Converting ${translit}"
+ VERBATIM
+ )
+ ELSE(BUILDING_SHARED)
+ ADD_CUSTOM_COMMAND(TARGET sword_static
+ POST_BUILD
+ COMMAND ${ICU_GENRB} -s . -d "${CMAKE_CURRENT_BINARY_DIR}/icu" ${translit}
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/icu"
+ COMMENT "Converting ${translit}"
+ VERBATIM
+ )
+ ENDIF(BUILDING_SHARED)
+
+ INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/icu/${translit_OUTPUT}"
+ DESTINATION "${libdir}/${SWORD_VERSION}_icu_${ICU_VERSION}")
+ ENDFOREACH(translit ${translit_SOURCES})
+ENDIF(WITH_ICU AND ICU_GENRB) \ No newline at end of file
diff --git a/cmake/muxsources.cmake b/cmake/muxsources.cmake
new file mode 100644
index 0000000..423dd2c
--- /dev/null
+++ b/cmake/muxsources.cmake
@@ -0,0 +1,83 @@
+################################################################################################
+#
+# This file will mess with the sources lists, as well as set variables, such as the WITH_* to be
+# used later in the configure process.
+#
+# Written by Greg Hellings
+SET(sword_SOURCES ${sword_base_SOURCES})
+# Check for if we've found ZLIB
+# This one is a bit more unique, since we still allow compilation without
+# a ZLIB at all, and allowing a user to disable it does not bring about use
+# of some internal fall-back but just leaves the ability to read ZLIB files
+# out of the library altogether
+IF(SWORD_NO_ZLIB STREQUAL "Yes")
+ MESSAGE(STATUS "ZLib support excluded")
+ ADD_DEFINITIONS(-DEXCLUDEZLIB)
+ SET(WITH_ZLIB 0)
+ELSE(SWORD_NO_ZLIB STREQUAL "Yes")
+ SET(sword_SOURCES ${sword_SOURCES} ${sword_zlib_used_SOURCES})
+ IF(NOT ZLIB_FOUND OR SWORD_USE_INTERNAL_ZLIB STREQUAL "Yes")
+ MESSAGE(STATUS "No system ZLib found or user forcing internal")
+ SET(sword_SOURCES ${sword_SOURCES} ${sword_zlib_nofound_SOURCES})
+ SET(WITH_INTERNAL_ZLIB 1)
+ ELSE(NOT ZLIB_FOUND OR SWORD_USE_INTERNAL_ZLIB STREQUAL "Yes")
+ MESSAGE(STATUS "Using system ZLib: ${ZLIB_LIBRARY}")
+ SET(WITH_ZLIB 1)
+ ENDIF(NOT ZLIB_FOUND OR SWORD_USE_INTERNAL_ZLIB STREQUAL "Yes")
+ENDIF(SWORD_NO_ZLIB STREQUAL "Yes")
+
+# Check for if we've found ICU
+IF(CURL_FOUND AND NOT SWORD_NO_CURL STREQUAL "Yes")
+ MESSAGE(STATUS "cURL found , using ${CURL_LIBRARY} and ${CURL_INCLUDE_DIRS}")
+ ADD_DEFINITIONS(-DCURLAVAILABLE)
+ SET(sword_SOURCES ${sword_SOURCES} ${sword_curl_found_SOURCES})
+ SET(WITH_CURL 1)
+ELSE(CURL_FOUND AND NOT SWORD_NO_CURL STREQUAL "Yes")
+ MESSAGE(STATUS "cURL not found or being ignored")
+ SET(sword_SOURCES ${sword_SOURCES} ${sword_curl_nofound_SOURCES})
+ SET(WITH_CURL 0)
+ENDIF(CURL_FOUND AND NOT SWORD_NO_CURL STREQUAL "Yes")
+
+# And for CLucene
+IF(CLucene_FOUND AND NOT SWORD_NO_CLUCENE STREQUAL "Yes")
+ MESSAGE(STATUS "CLucene found, using ${CLUCENE_LIBRARY} in ${CLUCENE_LIBRARY_DIR} and ${CLUCENE_INCLUDE_DIR}")
+ SET(sword_SOURCES ${sword_SOURCES} ${sword_clucene_found_SOURCES})
+ SET(WITH_CLUCENE 1)
+ELSE(CLucene_FOUND AND NOT SWORD_NO_CLUCENE STREQUAL "Yes")
+ MESSAGE(STATUS "CLucene not found or being ignored")
+ SET(sword_SOURCES ${sword_SOURCES} ${sword_clucene_nofound_SOURCES})
+ SET(WITH_CLUCENE 0)
+ENDIF(CLucene_FOUND AND NOT SWORD_NO_CLUCENE STREQUAL "Yes")
+
+# Alert the user if PkgConfig is unavailalbe
+IF(NOT PKG_CONFIG_FOUND)
+ MESSAGE(STATUS "PkgConfig not found on the system. Proceeding without it.")
+ SET(WITH_PKG_CONFIG 1)
+ELSE(NOT PKG_CONFIG_FOUND)
+ MESSAGE(STATUS "PkgConfig found. Using.")
+ SET(WITH_PKG_CONFIG 0)
+ENDIF(NOT PKG_CONFIG_FOUND)
+
+# ICU needs some lovin' too
+IF(ICU_FOUND AND NOT SWORD_NO_ICU STREQUAL "No")
+ MESSAGE(STATUS "ICU Found, using ${ICU_LIBRARY} and ${ICU_INCLUDE_DIRS}")
+ ADD_DEFINITIONS(-D_ICU_)
+ SET(sword_SOURCES ${sword_SOURCES} ${sword_icu_found_SOURCES})
+ SET(WITH_ICU 1)
+ELSE(ICU_FOUND AND NOT SWORD_NO_ICU STREQUAL "No")
+ MESSAGE(STATUS "ICU not found or ignored.")
+ SET(WITH_ICU 0)
+ENDIF(ICU_FOUND AND NOT SWORD_NO_ICU STREQUAL "No")
+
+# Internal or external regex.h
+IF(REGEX_FOUND)
+ MESSAGE(STATUS "System Regex found: ${REGEX_INCLUDE_DIR}")
+ INCLUDE_DIRECTORIES(${REGEX_INCLUDE_DIR})
+ SET(sword_SOURCES ${sword_SOURCES} ${sword_external_regex_SOURCES})
+ SET(WITH_REGEX 1)
+ELSE(REGEX_FOUND)
+ MESSAGE(STATUS "Using internal regex")
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/internal/regex)
+ SET(sword_SOURCES ${sword_SOURCES} ${sword_internal_regex_SOURCES})
+ SET(WITH_REGEX 0)
+ENDIF(REGEX_FOUND)
diff --git a/cmake/sources.cmake b/cmake/sources.cmake
new file mode 100644
index 0000000..0465509
--- /dev/null
+++ b/cmake/sources.cmake
@@ -0,0 +1,420 @@
+# This file started on 18 January 2010 by Gregory Hellings
+# It is ceded to The SWORD Library developers and CrossWire under the terms
+# of their own GPLv2 license and all copyright is transferred to them for
+# all posterity and eternity, wherever such transfer is possible. Where it is
+# not, then this file is released under the GPLv2 by myself.
+#
+#
+SET(sword_base_frontend_SOURCES
+ src/frontend/swdisp.cpp
+ src/frontend/swlog.cpp
+)
+SOURCE_GROUP("src\\frontend" FILES ${sword_base_frontend_SOURCES})
+
+SET(sword_base_keys_SOURCES
+ src/keys/swkey.cpp
+ src/keys/listkey.cpp
+ src/keys/strkey.cpp
+ src/keys/treekey.cpp
+ src/keys/treekeyidx.cpp
+ src/keys/versekey.cpp
+ src/keys/versetreekey.cpp
+)
+SOURCE_GROUP("src\\keys" FILES ${sword_base_keys_SOURCES})
+
+SET(sword_base_mgr_SOURCES
+ src/mgr/swconfig.cpp
+ src/mgr/swmgr.cpp
+ src/mgr/swfiltermgr.cpp
+ src/mgr/encfiltmgr.cpp
+ src/mgr/markupfiltmgr.cpp
+ src/mgr/filemgr.cpp
+ src/mgr/versemgr.cpp
+ src/mgr/ftptrans.cpp
+ src/mgr/swlocale.cpp
+ src/mgr/localemgr.cpp
+ src/mgr/swcacher.cpp
+ src/mgr/swsearchable.cpp
+ src/mgr/installmgr.cpp
+ src/mgr/stringmgr.cpp
+)
+SOURCE_GROUP("src\\mgr" FILES ${sword_base_mgr_SOURCES})
+
+SET(sword_base_module_SOURCES
+ src/modules/swmodule.cpp
+ src/modules/comments/swcom.cpp
+ src/modules/comments/hrefcom/hrefcom.cpp
+ src/modules/comments/rawcom/rawcom.cpp
+ src/modules/comments/rawcom4/rawcom4.cpp
+ src/modules/comments/rawfiles/rawfiles.cpp
+ src/modules/comments/zcom/zcom.cpp
+ src/modules/common/rawstr.cpp
+ src/modules/common/rawstr4.cpp
+ src/modules/common/swcomprs.cpp
+ src/modules/common/lzsscomprs.cpp
+ src/modules/common/rawverse.cpp
+ src/modules/common/rawverse4.cpp
+ src/modules/common/swcipher.cpp
+ src/modules/common/zverse.cpp
+ src/modules/common/zstr.cpp
+ src/modules/common/entriesblk.cpp
+ src/modules/common/sapphire.cpp
+ src/modules/filters/swbasicfilter.cpp
+ src/modules/filters/swoptfilter.cpp
+
+ src/modules/filters/gbfhtml.cpp
+ src/modules/filters/gbfhtmlhref.cpp
+ src/modules/filters/gbfwebif.cpp
+ src/modules/filters/gbfplain.cpp
+ src/modules/filters/gbfrtf.cpp
+ src/modules/filters/gbfstrongs.cpp
+ src/modules/filters/gbffootnotes.cpp
+ src/modules/filters/gbfheadings.cpp
+ src/modules/filters/gbfredletterwords.cpp
+ src/modules/filters/gbfmorph.cpp
+ src/modules/filters/gbfwordjs.cpp
+
+ src/modules/filters/thmlstrongs.cpp
+ src/modules/filters/thmlfootnotes.cpp
+ src/modules/filters/thmlheadings.cpp
+ src/modules/filters/thmlmorph.cpp
+ src/modules/filters/thmllemma.cpp
+ src/modules/filters/thmlscripref.cpp
+ src/modules/filters/thmlvariants.cpp
+ src/modules/filters/thmlgbf.cpp
+ src/modules/filters/thmlrtf.cpp
+ src/modules/filters/thmlhtml.cpp
+ src/modules/filters/thmlhtmlhref.cpp
+ src/modules/filters/thmlwebif.cpp
+ src/modules/filters/thmlwordjs.cpp
+
+ src/modules/filters/teiplain.cpp
+ src/modules/filters/teirtf.cpp
+ src/modules/filters/teihtmlhref.cpp
+
+ src/modules/filters/gbfthml.cpp
+ src/modules/filters/gbfosis.cpp
+ src/modules/filters/thmlosis.cpp
+ src/modules/filters/thmlplain.cpp
+ src/modules/filters/osisosis.cpp
+
+ src/modules/filters/osisheadings.cpp
+ src/modules/filters/osisfootnotes.cpp
+ src/modules/filters/osishtmlhref.cpp
+ src/modules/filters/osiswebif.cpp
+ src/modules/filters/osismorph.cpp
+ src/modules/filters/osisstrongs.cpp
+ src/modules/filters/osisplain.cpp
+ src/modules/filters/osisrtf.cpp
+ src/modules/filters/osislemma.cpp
+ src/modules/filters/osisredletterwords.cpp
+ src/modules/filters/osisscripref.cpp
+ src/modules/filters/osisvariants.cpp
+ src/modules/filters/osiswordjs.cpp
+ src/modules/filters/osismorphsegmentation.cpp
+ src/modules/filters/osisruby.cpp
+
+ src/modules/filters/latin1utf8.cpp
+ src/modules/filters/latin1utf16.cpp
+ src/modules/filters/utf8utf16.cpp
+ src/modules/filters/utf16utf8.cpp
+ src/modules/filters/utf8html.cpp
+ src/modules/filters/utf8latin1.cpp
+
+ src/modules/filters/utf8cantillation.cpp
+ src/modules/filters/utf8hebrewpoints.cpp
+ src/modules/filters/utf8arabicpoints.cpp
+ src/modules/filters/utf8greekaccents.cpp
+
+ src/modules/filters/cipherfil.cpp
+
+ src/modules/filters/rtfhtml.cpp
+ src/modules/filters/plainfootnotes.cpp
+ src/modules/filters/plainhtml.cpp
+ src/modules/filters/greeklexattribs.cpp
+ src/modules/filters/unicodertf.cpp
+ src/modules/filters/papyriplain.cpp
+
+ src/modules/genbook/swgenbook.cpp
+ src/modules/genbook/rawgenbook/rawgenbook.cpp
+
+ src/modules/lexdict/swld.cpp
+ src/modules/lexdict/rawld/rawld.cpp
+ src/modules/lexdict/rawld4/rawld4.cpp
+ src/modules/lexdict/zld/zld.cpp
+
+ src/modules/texts/swtext.cpp
+ src/modules/texts/rawtext/rawtext.cpp
+ src/modules/texts/rawtext4/rawtext4.cpp
+ src/modules/texts/ztext/ztext.cpp
+)
+SOURCE_GROUP("src\\modules" FILES ${sword_base_module_SOURCES})
+
+SET(sword_base_utilfns_SOURCES
+ src/utilfuns/swobject.cpp
+ src/utilfuns/utilstr.cpp
+ src/utilfuns/utilxml.cpp
+ src/utilfuns/swunicod.cpp
+ src/utilfuns/swversion.cpp
+ src/utilfuns/swbuf.cpp
+ src/utilfuns/ftpparse.c
+ src/utilfuns/url.cpp
+ src/utilfuns/roman.cpp
+)
+SOURCE_GROUP("src\\utilfns" FILES ${sword_base_utilfns_SOURCES})
+
+SET(sword_base_binding_SOURCES
+ bindings/flatapi.cpp
+)
+
+# Universal sources
+SET(sword_base_SOURCES
+ ${sword_base_frontend_SOURCES}
+ ${sword_base_keys_SOURCES}
+ ${sword_base_mgr_SOURCES}
+ ${sword_base_module_SOURCES}
+ ${sword_base_utilfns_SOURCES}
+ ${sword_base_binding_SOURCES}
+)
+
+# Sources relying on ZLib
+SET(sword_zlib_used_SOURCES
+ src/modules/common/zipcomprs.cpp
+ src/utilfuns/zlib/untgz.c
+)
+SET(sword_zlib_nofound_SOURCES
+ src/utilfuns/zlib/gzio.c
+ src/utilfuns/zlib/zutil.c
+ src/utilfuns/zlib/uncompr.c
+ src/utilfuns/zlib/trees.c
+ src/utilfuns/zlib/maketree.c
+ src/utilfuns/zlib/infutil.c
+ src/utilfuns/zlib/inftrees.c
+ src/utilfuns/zlib/inflate.c
+ src/utilfuns/zlib/inffast.c
+ src/utilfuns/zlib/infcodes.c
+ src/utilfuns/zlib/infblock.c
+ src/utilfuns/zlib/deflate.c
+ src/utilfuns/zlib/crc32.c
+ src/utilfuns/zlib/compress.c
+ src/utilfuns/zlib/adler32.c
+)
+
+# Sources relying on cURL
+SET(sword_curl_found_SOURCES
+ src/mgr/curlftpt.cpp
+ src/mgr/curlhttpt.cpp
+)
+SET(sword_curl_nofound_SOURCES
+ src/mgr/ftplibftpt.cpp
+ src/utilfuns/ftplib.c
+)
+
+# Sources relying on CLucene
+SET(sword_clucene_found_SOURCES)
+SET(sword_clucene_nofound_SOURCES)
+
+# Sources based on the regex stuff
+SET(sword_internal_regex_SOURCES
+ src/utilfuns/regex.c
+)
+SET(sword_external_regex_SOURCES)
+
+# Sources based on the ICU status
+SET(sword_icu_found_SOURCES
+ src/modules/filters/utf8transliterator.cpp
+ src/modules/filters/utf8nfc.cpp
+ src/modules/filters/utf8nfkd.cpp
+ src/modules/filters/utf8arshaping.cpp
+ src/modules/filters/utf8bidireorder.cpp
+)
+
+# Headers
+SET(SWORD_INSTALL_HEADERS
+ include/Greek2Greek.h
+ include/GreekChars.h
+ include/canon.h
+ include/canon_abbrevs.h
+ include/cipherfil.h
+ include/curlftpt.h
+ include/curlhttpt.h
+ include/defs.h
+ include/echomod.h
+ include/encfiltmgr.h
+ include/entriesblk.h
+ include/femain.h
+ include/filemgr.h
+ include/versemgr.h
+ include/flatapi.h
+ include/ftpparse.h
+ include/ftptrans.h
+ include/ftplibftpt.h
+ include/ftplib.h
+
+ include/gbffootnotes.h
+ include/gbfheadings.h
+ include/gbfhtml.h
+ include/gbfhtmlhref.h
+ include/gbfwebif.h
+ include/gbfmorph.h
+ include/gbfosis.h
+ include/gbfplain.h
+ include/gbfredletterwords.h
+ include/gbfrtf.h
+ include/gbfstrongs.h
+ include/gbfwordjs.h
+ include/gbfthml.h
+ include/greeklexattribs.h
+
+ include/hebrewmcim.h
+ include/hrefcom.h
+ include/installmgr.h
+ include/latin1utf16.h
+ include/latin1utf8.h
+ include/listkey.h
+ include/localemgr.h
+ include/lzsscomprs.h
+ include/markupfiltmgr.h
+ include/multimapwdef.h
+ include/nullim.h
+
+ include/osisheadings.h
+ include/osishtmlhref.h
+ include/osiswebif.h
+ include/osismorph.h
+ include/osismorphsegmentation.h
+ include/osisplain.h
+ include/osisrtf.h
+ include/osisosis.h
+ include/osisstrongs.h
+ include/osisfootnotes.h
+ include/osislemma.h
+ include/osisredletterwords.h
+ include/osisscripref.h
+ include/osiswordjs.h
+ include/osisvariants.h
+
+ include/papyriplain.h
+ include/plainfootnotes.h
+ include/plainhtml.h
+ include/rawcom.h
+ include/rawfiles.h
+ include/rawgenbook.h
+ include/rawld.h
+ include/rawld4.h
+ include/rawstr.h
+ include/rawstr4.h
+ include/rawtext.h
+ include/rawverse.h
+
+ include/roman.h
+ include/rtfhtml.h
+ include/sapphire.h
+ include/strkey.h
+ include/swbasicfilter.h
+ include/swbuf.h
+ include/swcacher.h
+ include/swcipher.h
+ include/swcom.h
+ include/swcomprs.h
+ include/swconfig.h
+ include/swdisp.h
+ include/swfilter.h
+ include/swfiltermgr.h
+ include/swgenbook.h
+ include/swinputmeth.h
+ include/swkey.h
+ include/swld.h
+ include/swlocale.h
+ include/swlog.h
+ include/swmacs.h
+ include/swmgr.h
+ include/stringmgr.h
+ include/swmodule.h
+ include/swoptfilter.h
+ include/swobject.h
+ include/swsearchable.h
+ include/swtext.h
+ include/swunicod.h
+ include/swversion.h
+ include/sysdata.h
+
+ include/thmlfootnotes.h
+ include/thmlgbf.h
+ include/thmlheadings.h
+ include/thmlhtml.h
+ include/thmlhtmlhref.h
+ include/thmlwebif.h
+ include/thmllemma.h
+ include/thmlmorph.h
+ include/thmlosis.h
+ include/thmlplain.h
+ include/thmlrtf.h
+ include/thmlscripref.h
+ include/thmlstrongs.h
+ include/thmlvariants.h
+ include/thmlwordjs.h
+
+ include/teiplain.h
+ include/teirtf.h
+ include/teihtmlhref.h
+
+ include/treekey.h
+ include/treekeyidx.h
+ include/unicodertf.h
+ include/url.h
+ include/untgz.h
+ include/utf16utf8.h
+ include/utf8arshaping.h
+ include/utf8bidireorder.h
+ include/utf8cantillation.h
+ include/utf8greekaccents.h
+ include/utf8hebrewpoints.h
+ include/utf8arabicpoints.h
+ include/utf8html.h
+ include/utf8latin1.h
+ include/utf8nfc.h
+ include/utf8nfkd.h
+ include/utf8transliterator.h
+ include/utf8utf16.h
+ include/utilstr.h
+ include/utilxml.h
+
+ include/versekey.h
+ include/versetreekey.h
+ include/zcom.h
+ include/zconf.h
+ include/zipcomprs.h
+ include/zld.h
+ include/zstr.h
+ include/ztext.h
+ include/zverse.h
+
+ include/canon_kjva.h
+ include/canon_leningrad.h
+ include/canon_mt.h
+ include/canon_nrsv.h
+ include/canon_nrsva.h
+ include/canon_synodal.h
+ include/canon_vulg.h
+ include/canon_german.h
+ include/canon_luther.h
+ include/canon_null.h
+)
+
+SET(INTERNAL_REGEX_HEADER
+ include/internal/regex/regex.h
+)
+
+SET(translit_SOURCES
+ translit_Any_Latex.txt
+ translit_Any_Latin1.txt
+ translit_BETA_Greek.txt
+ translit_BGreek_Greek.txt
+ translit_CCAT_Hebrew.txt
+ translit_CCAT_Syriac.txt
+ translit_Latin_Coptic.txt
+ translit_Latin_Gothic.txt
+ translit_Latin_Ugaritic.txt
+ translit_swordindex.txt
+) \ No newline at end of file
diff --git a/cmake/toolchains/iphone-2.2.1.toolchain-broken b/cmake/toolchains/iphone-2.2.1.toolchain-broken
new file mode 100644
index 0000000..215c637
--- /dev/null
+++ b/cmake/toolchains/iphone-2.2.1.toolchain-broken
@@ -0,0 +1,51 @@
+# Michael Aaron Safyan (michaelsafyan@gmail.com). Copyright (C) 2009-2010. Simplified BSD License.
+SET (CMAKE_SYSTEM_NAME Generic)
+SET (CMAKE_SYSTEM_VERSION 1)
+SET (CMAKE_SYSTEM_PROCESSOR arm)
+SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+
+SET (SDKVER "2.2.1")
+SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
+SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk")
+SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
+SET (CMAKE_OSX_ARCHITECTURES "armv6" "armv7")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_FLAGS "-std=c99" "-x objective-c")
+SET (CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+SET (CMAKE_CXX_FLAGS "-x objective-c++")
+SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+ADD_DEFINITIONS("-arch armv6")
+ADD_DEFINITIONS("-arch armv7")
+ADD_DEFINITIONS("-pipe")
+ADD_DEFINITIONS("-no-cpp-precomp")
+ADD_DEFINITIONS("--sysroot=${SDKROOT}")
+ADD_DEFINITIONS("-miphoneos-version-min=${SDKVER}")
+
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/opt/iphone-${SDKVER}/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/local/iphone-${SDKVER}/include")
+
+LINK_DIRECTORIES("${SDKROOT}/usr/lib")
+LINK_DIRECTORIES("${SDKROOT}/opt/iphone-${SDKVER}/lib")
+LINK_DIRECTORIES("${SDKROOT}/usr/local/iphone-${SDKVER}/lib")
+
+SET (CMAKE_FIND_ROOT_PATH "${SDKROOT}" "/opt/iphone-${SDKVER}/" "/usr/local/iphone-${SDKVER}/")
+SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+SET (iPhone 1)
+SET (iPhoneOS 1)
+SET (iPhoneOS_VERSION ${SDKVER})
diff --git a/cmake/toolchains/iphone-3.0.toolchain b/cmake/toolchains/iphone-3.0.toolchain
new file mode 100644
index 0000000..5026b4e
--- /dev/null
+++ b/cmake/toolchains/iphone-3.0.toolchain
@@ -0,0 +1,51 @@
+# Michael Aaron Safyan (michaelsafyan@gmail.com). Copyright (C) 2009-2010. Simplified BSD License.
+SET (CMAKE_SYSTEM_NAME Generic)
+SET (CMAKE_SYSTEM_VERSION 1)
+SET (CMAKE_SYSTEM_PROCESSOR arm)
+SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+
+SET (SDKVER "3.0")
+SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
+SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk")
+SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
+SET (CMAKE_OSX_ARCHITECTURES "armv6" "armv7")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_FLAGS "-std=c99" "-x objective-c")
+SET (CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+SET (CMAKE_CXX_FLAGS "-x objective-c++")
+SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+ADD_DEFINITIONS("-arch armv6")
+ADD_DEFINITIONS("-arch armv7")
+ADD_DEFINITIONS("-pipe")
+ADD_DEFINITIONS("-no-cpp-precomp")
+ADD_DEFINITIONS("--sysroot=${SDKROOT}")
+ADD_DEFINITIONS("-miphoneos-version-min=${SDKVER}")
+
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/opt/iphone-${SDKVER}/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/local/iphone-${SDKVER}/include")
+
+LINK_DIRECTORIES("${SDKROOT}/usr/lib")
+LINK_DIRECTORIES("${SDKROOT}/opt/iphone-${SDKVER}/lib")
+LINK_DIRECTORIES("${SDKROOT}/usr/local/iphone-${SDKVER}/lib")
+
+SET (CMAKE_FIND_ROOT_PATH "${SDKROOT}" "/opt/iphone-${SDKVER}/" "/usr/local/iphone-${SDKVER}/")
+SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+SET (iPhone 1)
+SET (iPhoneOS 1)
+SET (iPhoneOS_VERSION ${SDKVER})
diff --git a/cmake/toolchains/iphone-3.1.2.toolchain b/cmake/toolchains/iphone-3.1.2.toolchain
new file mode 100644
index 0000000..8102cd6
--- /dev/null
+++ b/cmake/toolchains/iphone-3.1.2.toolchain
@@ -0,0 +1,51 @@
+# Michael Aaron Safyan (michaelsafyan@gmail.com). Copyright (C) 2009-2010. Simplified BSD License.
+SET (CMAKE_SYSTEM_NAME Generic)
+SET (CMAKE_SYSTEM_VERSION 1)
+SET (CMAKE_SYSTEM_PROCESSOR arm)
+SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+
+SET (SDKVER "3.1.2")
+SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
+SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk")
+SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
+SET (CMAKE_OSX_ARCHITECTURES "armv6" "armv7")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_FLAGS "-std=c99" "-x objective-c")
+SET (CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+SET (CMAKE_CXX_FLAGS "-x objective-c++")
+SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+ADD_DEFINITIONS("-arch armv6")
+ADD_DEFINITIONS("-arch armv7")
+ADD_DEFINITIONS("-pipe")
+ADD_DEFINITIONS("-no-cpp-precomp")
+ADD_DEFINITIONS("--sysroot=${SDKROOT}")
+ADD_DEFINITIONS("-miphoneos-version-min=${SDKVER}")
+
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/opt/iphone-${SDKVER}/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/local/iphone-${SDKVER}/include")
+
+LINK_DIRECTORIES("${SDKROOT}/usr/lib")
+LINK_DIRECTORIES("${SDKROOT}/opt/iphone-${SDKVER}/lib")
+LINK_DIRECTORIES("${SDKROOT}/usr/local/iphone-${SDKVER}/lib")
+
+SET (CMAKE_FIND_ROOT_PATH "${SDKROOT}" "/opt/iphone-${SDKVER}/" "/usr/local/iphone-${SDKVER}/")
+SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+SET (iPhone 1)
+SET (iPhoneOS 1)
+SET (iPhoneOS_VERSION ${SDKVER})
diff --git a/cmake/toolchains/iphone-3.1.3.toolchain b/cmake/toolchains/iphone-3.1.3.toolchain
new file mode 100644
index 0000000..c23b3fc
--- /dev/null
+++ b/cmake/toolchains/iphone-3.1.3.toolchain
@@ -0,0 +1,51 @@
+# Michael Aaron Safyan (michaelsafyan@gmail.com). Copyright (C) 2009-2010. Simplified BSD License.
+SET (CMAKE_SYSTEM_NAME Generic)
+SET (CMAKE_SYSTEM_VERSION 1)
+SET (CMAKE_SYSTEM_PROCESSOR arm)
+SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+
+SET (SDKVER "3.1.3")
+SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
+SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk")
+SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
+SET (CMAKE_OSX_ARCHITECTURES "armv6" "armv7")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_FLAGS "-std=c99" "-x objective-c")
+SET (CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+SET (CMAKE_CXX_FLAGS "-x objective-c++")
+SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+ADD_DEFINITIONS("-arch armv6")
+ADD_DEFINITIONS("-arch armv7")
+ADD_DEFINITIONS("-pipe")
+ADD_DEFINITIONS("-no-cpp-precomp")
+ADD_DEFINITIONS("--sysroot=${SDKROOT}")
+ADD_DEFINITIONS("-miphoneos-version-min=${SDKVER}")
+
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/opt/iphone-${SDKVER}/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/local/iphone-${SDKVER}/include")
+
+LINK_DIRECTORIES("${SDKROOT}/usr/lib")
+LINK_DIRECTORIES("${SDKROOT}/opt/iphone-${SDKVER}/lib")
+LINK_DIRECTORIES("${SDKROOT}/usr/local/iphone-${SDKVER}/lib")
+
+SET (CMAKE_FIND_ROOT_PATH "${SDKROOT}" "/opt/iphone-${SDKVER}/" "/usr/local/iphone-${SDKVER}/")
+SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+SET (iPhone 1)
+SET (iPhoneOS 1)
+SET (iPhoneOS_VERSION ${SDKVER})
diff --git a/cmake/toolchains/iphone-3.1.toolchain b/cmake/toolchains/iphone-3.1.toolchain
new file mode 100644
index 0000000..bd15810
--- /dev/null
+++ b/cmake/toolchains/iphone-3.1.toolchain
@@ -0,0 +1,51 @@
+# Michael Aaron Safyan (michaelsafyan@gmail.com). Copyright (C) 2009-2010. Simplified BSD License.
+SET (CMAKE_SYSTEM_NAME Generic)
+SET (CMAKE_SYSTEM_VERSION 1)
+SET (CMAKE_SYSTEM_PROCESSOR arm)
+SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+
+SET (SDKVER "3.1")
+SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
+SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk")
+SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
+SET (CMAKE_OSX_ARCHITECTURES "armv6" "armv7")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_FLAGS "-std=c99" "-x objective-c")
+SET (CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+SET (CMAKE_CXX_FLAGS "-x objective-c++")
+SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+ADD_DEFINITIONS("-arch armv6")
+ADD_DEFINITIONS("-arch armv7")
+ADD_DEFINITIONS("-pipe")
+ADD_DEFINITIONS("-no-cpp-precomp")
+ADD_DEFINITIONS("--sysroot=${SDKROOT}")
+ADD_DEFINITIONS("-miphoneos-version-min=${SDKVER}")
+
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/opt/iphone-${SDKVER}/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/local/iphone-${SDKVER}/include")
+
+LINK_DIRECTORIES("${SDKROOT}/usr/lib")
+LINK_DIRECTORIES("${SDKROOT}/opt/iphone-${SDKVER}/lib")
+LINK_DIRECTORIES("${SDKROOT}/usr/local/iphone-${SDKVER}/lib")
+
+SET (CMAKE_FIND_ROOT_PATH "${SDKROOT}" "/opt/iphone-${SDKVER}/" "/usr/local/iphone-${SDKVER}/")
+SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+SET (iPhone 1)
+SET (iPhoneOS 1)
+SET (iPhoneOS_VERSION ${SDKVER})
diff --git a/cmake/toolchains/iphone-simulator-2.2.1.toolchain-broken b/cmake/toolchains/iphone-simulator-2.2.1.toolchain-broken
new file mode 100644
index 0000000..d6b7fa7
--- /dev/null
+++ b/cmake/toolchains/iphone-simulator-2.2.1.toolchain-broken
@@ -0,0 +1,51 @@
+# Michael Aaron Safyan (michaelsafyan@gmail.com). Copyright (C) 2009-2010. Simplified BSD License.
+SET (CMAKE_SYSTEM_NAME Generic)
+SET (CMAKE_SYSTEM_VERSION 1)
+SET (CMAKE_SYSTEM_PROCESSOR i686)
+SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+
+SET (SDKVER "2.2.1")
+SET (DEVROOT "/Developer/Platforms/iPhoneSimulator.platform/Developer")
+SET (SDKROOT "${DEVROOT}/SDKs/iPhoneSimulator${SDKVER}.sdk")
+SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
+SET (CMAKE_OSX_ARCHITECTURES "i386" "x86_64")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_FLAGS "-std=c99 -x objective-c")
+SET (CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+SET (CMAKE_CXX_FLAGS "-x objective-c++")
+SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+ADD_DEFINITIONS("-arch i386")
+ADD_DEFINITIONS("-arch x86_64")
+ADD_DEFINITIONS("-pipe")
+ADD_DEFINITIONS("-no-cpp-precomp")
+ADD_DEFINITIONS("--sysroot=${SDKROOT}")
+ADD_DEFINITIONS("-miphoneos-version-min=${SDKVER}")
+
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/opt/iphone-simulator-${SDKVER}/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/local/iphone-simulator-${SDKVER}/include")
+
+LINK_DIRECTORIES("${SDKROOT}/usr/lib")
+LINK_DIRECTORIES("${SDKROOT}/opt/iphone-simulator-${SDKVER}/lib")
+LINK_DIRECTORIES("${SDKROOT}/usr/local/iphone-simulator-${SDKVER}/lib")
+
+SET (CMAKE_FIND_ROOT_PATH "${SDKROOT}" "/opt/iphone-simulator-${SDKVER}/" "/usr/local/iphone-simulator-${SDKVER}/")
+SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+SET (iPhone 1)
+SET (iPhoneSimulator 1)
+SET (iPhoneSimulator_VERSION ${SDKVER})
diff --git a/cmake/toolchains/iphone-simulator-3.0.toolchain b/cmake/toolchains/iphone-simulator-3.0.toolchain
new file mode 100644
index 0000000..e4acec5
--- /dev/null
+++ b/cmake/toolchains/iphone-simulator-3.0.toolchain
@@ -0,0 +1,52 @@
+# Michael Aaron Safyan (michaelsafyan@gmail.com). Copyright (C) 2009-2010. Simplified BSD License.
+SET (CMAKE_SYSTEM_NAME Generic)
+SET (CMAKE_SYSTEM_VERSION 1)
+SET (CMAKE_SYSTEM_PROCESSOR i686)
+SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+
+SET (SDKVER "3.0")
+SET (DEVROOT "/Developer/Platforms/iPhoneSimulator.platform/Developer")
+SET (SDKROOT "${DEVROOT}/SDKs/iPhoneSimulator${SDKVER}.sdk")
+SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
+SET (CMAKE_OSX_ARCHITECTURES "i386" "x86_64")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_FLAGS "-std=c99 -x objective-c")
+SET (CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+SET (CMAKE_CXX_FLAGS "-x objective-c++")
+SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+ADD_DEFINITIONS("-arch i386")
+ADD_DEFINITIONS("-arch x86_64")
+ADD_DEFINITIONS("-pipe")
+ADD_DEFINITIONS("-no-cpp-precomp")
+ADD_DEFINITIONS("--sysroot=${SDKROOT}")
+ADD_DEFINITIONS("-miphoneos-version-min=${SDKVER}")
+
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/opt/iphone-simulator-${SDKVER}/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/local/iphone-simulator-${SDKVER}/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include/c++/4.2.1/i686-apple-darwin9")
+
+LINK_DIRECTORIES("${SDKROOT}/usr/lib")
+LINK_DIRECTORIES("${SDKROOT}/opt/iphone-simulator-${SDKVER}/lib")
+LINK_DIRECTORIES("${SDKROOT}/usr/local/iphone-simulator-${SDKVER}/lib")
+
+SET (CMAKE_FIND_ROOT_PATH "${SDKROOT}" "/opt/iphone-simulator-${SDKVER}/" "/usr/local/iphone-simulator-${SDKVER}/")
+SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+SET (iPhone 1)
+SET (iPhoneSimulator 1)
+SET (iPhoneSimulator_VERSION ${SDKVER})
diff --git a/cmake/toolchains/iphone-simulator-3.1.2.toolchain b/cmake/toolchains/iphone-simulator-3.1.2.toolchain
new file mode 100644
index 0000000..8cf1b4a
--- /dev/null
+++ b/cmake/toolchains/iphone-simulator-3.1.2.toolchain
@@ -0,0 +1,52 @@
+# Michael Aaron Safyan (michaelsafyan@gmail.com). Copyright (C) 2009-2010. Simplified BSD License.
+SET (CMAKE_SYSTEM_NAME Generic)
+SET (CMAKE_SYSTEM_VERSION 1)
+SET (CMAKE_SYSTEM_PROCESSOR i686)
+SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+
+SET (SDKVER "3.1.2")
+SET (DEVROOT "/Developer/Platforms/iPhoneSimulator.platform/Developer")
+SET (SDKROOT "${DEVROOT}/SDKs/iPhoneSimulator${SDKVER}.sdk")
+SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
+SET (CMAKE_OSX_ARCHITECTURES "i386" "x86_64")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_FLAGS "-std=c99 -x objective-c")
+SET (CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+SET (CMAKE_CXX_FLAGS "-x objective-c++")
+SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+ADD_DEFINITIONS("-arch i386")
+ADD_DEFINITIONS("-arch x86_64")
+ADD_DEFINITIONS("-pipe")
+ADD_DEFINITIONS("-no-cpp-precomp")
+ADD_DEFINITIONS("--sysroot=${SDKROOT}")
+ADD_DEFINITIONS("-miphoneos-version-min=${SDKVER}")
+
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/opt/iphone-simulator-${SDKVER}/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/local/iphone-simulator-${SDKVER}/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include/c++/4.2.1/i686-apple-darwin9")
+
+LINK_DIRECTORIES("${SDKROOT}/usr/lib")
+LINK_DIRECTORIES("${SDKROOT}/opt/iphone-simulator-${SDKVER}/lib")
+LINK_DIRECTORIES("${SDKROOT}/usr/local/iphone-simulator-${SDKVER}/lib")
+
+SET (CMAKE_FIND_ROOT_PATH "${SDKROOT}" "/opt/iphone-simulator-${SDKVER}/" "/usr/local/iphone-simulator-${SDKVER}/")
+SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+SET (iPhone 1)
+SET (iPhoneSimulator 1)
+SET (iPhoneSimulator_VERSION ${SDKVER})
diff --git a/cmake/toolchains/iphone-simulator-3.1.3.toolchain b/cmake/toolchains/iphone-simulator-3.1.3.toolchain
new file mode 100644
index 0000000..6d7025c
--- /dev/null
+++ b/cmake/toolchains/iphone-simulator-3.1.3.toolchain
@@ -0,0 +1,52 @@
+# Michael Aaron Safyan (michaelsafyan@gmail.com). Copyright (C) 2009-2010. Simplified BSD License.
+SET (CMAKE_SYSTEM_NAME Generic)
+SET (CMAKE_SYSTEM_VERSION 1)
+SET (CMAKE_SYSTEM_PROCESSOR i686)
+SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+
+SET (SDKVER "3.1.3")
+SET (DEVROOT "/Developer/Platforms/iPhoneSimulator.platform/Developer")
+SET (SDKROOT "${DEVROOT}/SDKs/iPhoneSimulator${SDKVER}.sdk")
+SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
+SET (CMAKE_OSX_ARCHITECTURES "i386" "x86_64")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_FLAGS "-std=c99 -x objective-c")
+SET (CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+SET (CMAKE_CXX_FLAGS "-x objective-c++")
+SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+ADD_DEFINITIONS("-arch i386")
+ADD_DEFINITIONS("-arch x86_64")
+ADD_DEFINITIONS("-pipe")
+ADD_DEFINITIONS("-no-cpp-precomp")
+ADD_DEFINITIONS("--sysroot=${SDKROOT}")
+ADD_DEFINITIONS("-miphoneos-version-min=${SDKVER}")
+
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/opt/iphone-simulator-${SDKVER}/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/local/iphone-simulator-${SDKVER}/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include/c++/4.2.1/i686-apple-darwin9")
+
+LINK_DIRECTORIES("${SDKROOT}/usr/lib")
+LINK_DIRECTORIES("${SDKROOT}/opt/iphone-simulator-${SDKVER}/lib")
+LINK_DIRECTORIES("${SDKROOT}/usr/local/iphone-simulator-${SDKVER}/lib")
+
+SET (CMAKE_FIND_ROOT_PATH "${SDKROOT}" "/opt/iphone-simulator-${SDKVER}/" "/usr/local/iphone-simulator-${SDKVER}/")
+SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+SET (iPhone 1)
+SET (iPhoneSimulator 1)
+SET (iPhoneSimulator_VERSION ${SDKVER})
diff --git a/cmake/toolchains/iphone-simulator-3.1.toolchain b/cmake/toolchains/iphone-simulator-3.1.toolchain
new file mode 100644
index 0000000..98dbbad
--- /dev/null
+++ b/cmake/toolchains/iphone-simulator-3.1.toolchain
@@ -0,0 +1,52 @@
+# Michael Aaron Safyan (michaelsafyan@gmail.com). Copyright (C) 2009-2010. Simplified BSD License.
+SET (CMAKE_SYSTEM_NAME Generic)
+SET (CMAKE_SYSTEM_VERSION 1)
+SET (CMAKE_SYSTEM_PROCESSOR i686)
+SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+
+SET (SDKVER "3.1")
+SET (DEVROOT "/Developer/Platforms/iPhoneSimulator.platform/Developer")
+SET (SDKROOT "${DEVROOT}/SDKs/iPhoneSimulator${SDKVER}.sdk")
+SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
+SET (CMAKE_OSX_ARCHITECTURES "i386" "x86_64")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
+SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
+
+SET (CMAKE_C_FLAGS "-std=c99 -x objective-c")
+SET (CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+SET (CMAKE_CXX_FLAGS "-x objective-c++")
+SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS} "-DDEBUG=1" "-ggdb")
+SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS} "-DNDEBUG=1")
+SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS} "-DNDEBUG=1" "-ggdb")
+
+ADD_DEFINITIONS("-arch i386")
+ADD_DEFINITIONS("-arch x86_64")
+ADD_DEFINITIONS("-pipe")
+ADD_DEFINITIONS("-no-cpp-precomp")
+ADD_DEFINITIONS("--sysroot=${SDKROOT}")
+ADD_DEFINITIONS("-miphoneos-version-min=${SDKVER}")
+
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/opt/iphone-simulator-${SDKVER}/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/local/iphone-simulator-${SDKVER}/include")
+INCLUDE_DIRECTORIES(SYSTEM "${SDKROOT}/usr/include/c++/4.2.1/i686-apple-darwin9")
+
+LINK_DIRECTORIES("${SDKROOT}/usr/lib")
+LINK_DIRECTORIES("${SDKROOT}/opt/iphone-simulator-${SDKVER}/lib")
+LINK_DIRECTORIES("${SDKROOT}/usr/local/iphone-simulator-${SDKVER}/lib")
+
+SET (CMAKE_FIND_ROOT_PATH "${SDKROOT}" "/opt/iphone-simulator-${SDKVER}/" "/usr/local/iphone-simulator-${SDKVER}/")
+SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+SET (iPhone 1)
+SET (iPhoneSimulator 1)
+SET (iPhoneSimulator_VERSION ${SDKVER})