[sword-svn] r2522 - in trunk: . cmake cmake/toolchains examples/cmdline tests tests/testsuite utilities

scribe at crosswire.org scribe at crosswire.org
Fri Jun 25 15:19:58 MST 2010


Author: scribe
Date: 2010-06-25 15:19:58 -0700 (Fri, 25 Jun 2010)
New Revision: 2522

Added:
   trunk/CMakeLists.txt
   trunk/cmake/
   trunk/cmake/FindCLucene.cmake
   trunk/cmake/FindICU.cmake
   trunk/cmake/FindLibraryWithDebug.cmake
   trunk/cmake/FindRegex.cmake
   trunk/cmake/README
   trunk/cmake/configure-iphone-simulator.sh
   trunk/cmake/configure-iphone.sh
   trunk/cmake/install.cmake
   trunk/cmake/muxsources.cmake
   trunk/cmake/sources.cmake
   trunk/cmake/toolchains/
   trunk/cmake/toolchains/iphone-2.2.1.toolchain-broken
   trunk/cmake/toolchains/iphone-3.0.toolchain
   trunk/cmake/toolchains/iphone-3.1.2.toolchain
   trunk/cmake/toolchains/iphone-3.1.3.toolchain
   trunk/cmake/toolchains/iphone-3.1.toolchain
   trunk/cmake/toolchains/iphone-simulator-2.2.1.toolchain-broken
   trunk/cmake/toolchains/iphone-simulator-3.0.toolchain
   trunk/cmake/toolchains/iphone-simulator-3.1.2.toolchain
   trunk/cmake/toolchains/iphone-simulator-3.1.3.toolchain
   trunk/cmake/toolchains/iphone-simulator-3.1.toolchain
   trunk/examples/cmdline/CMakeLists.txt
   trunk/tests/CMakeLists.txt
   trunk/tests/testsuite/CMakeLists.txt
   trunk/utilities/CMakeLists.txt
Modified:
   trunk/ChangeLog
   trunk/README
Log:

	Added CMake build system, contributed by GHellings



Added: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	                        (rev 0)
+++ trunk/CMakeLists.txt	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,186 @@
+# TODO: write FindICU (icu-config only for 2.2 and up) -- currently taken from another CMake system
+#       limit pkg-config version to >= 0.14, demo, utilities, doc, tests
+#
+# NOTES: Defaults to build type of Shared
+#        Forces out-of-source tree build
+#        
+#
+# 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.
+#
+#
+# A CMake port of the SWORD build system... we hope
+PROJECT(libsword CXX C)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
+SET(SWORD_VERSION 1.6.1)
+
+# Make sure it's an out-of-stream build
+IF(${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
+	MESSAGE(FATAL_ERROR "Please invoke CMake from a different directory than the source.")
+ENDIF(${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
+
+MESSAGE(STATUS "Configuring your system to build libsword.")
+
+###########################################################################################
+# Here are some basic CMake variables we need to setup in order for things to work properly
+#
+# Our include directory, for our own internally created "FIND_PACKAGE" calls, like CLucene
+SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+# Source variables
+INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/sources.cmake")
+# Our local includes
+INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/include")
+
+###########################################################################################
+# This will look for various libraries that libsword builds against.  There is no REQUIRED
+# attribute added here, since all of the libraries here are not, in actuality, required.
+#
+# Find our packages
+FIND_PACKAGE(ZLIB QUIET)
+FIND_PACKAGE(ICU QUIET)
+FIND_PACKAGE(CURL QUIET)
+FIND_PACKAGE(CLucene QUIET)
+FIND_PACKAGE(PkgConfig QUIET)
+FIND_PACKAGE(Regex QUIET)
+
+###########################################################################################
+# Based on user input and the results of the above tests, we may need to mux with the source
+# files to use an internal version of ZLib, cURL-like stuff, or CLucene replacements.  These
+# lines below will modify the source files directories so that the required files are only
+# included if the option is needed.
+#
+# Modify the source variables and set necessary definitions, this is a rather long segment,
+# so I have sorted it out into its own file
+INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/muxsources.cmake)
+
+################################################################################################
+# Some random user settings
+#
+
+IF(SWORD_ENABLE_PROFILE STREQUAL "Yes")
+	SET_TARGET_PROPERTIES(libsword
+		PROPERTIES COMPILE_FLAGS "-pg"
+	)
+ENDIF(SWORD_ENABLE_PROFILE STREQUAL "Yes")
+
+IF(SWORD_ENABLE_PROFILEFN STREQUAL "Yes")
+	SET_TARGET_PROPERTIES(libsword
+		PROPERTIES COMPILE_FLAGS "-g -finstrument-functions"
+	)
+	TARGET_LINK_LIBRARIES(libsword fnccheck)
+ENDIF(SWORD_ENABLE_PROFILEFN STREQUAL "Yes")
+
+IF(NOT SWORD_GLOBAL_CONF_DIR STREQUAL "")
+	ADD_DEFINITIONS(-DGLOBCONFPATH="${SWORD_GLOBAL_CONF_DIR}/sword.conf")
+ENDIF(NOT SWORD_GLOBAL_CONF_DIR STREQUAL "")
+
+################################################################################################
+# This actually creates the build target that is the libsword building target to be generated.
+# Most of the work for configuration is done above, already.
+#
+# I want to do this manually, there might be reason in the future
+IF(LIBSWORD_LIBRARY_TYPE STREQUAL "Shared")
+	ADD_LIBRARY(sword SHARED ${sword_SOURCES})
+ELSE(LIBSWORD_LIBRARY_TYPE STREQUAL "Shared")
+	ADD_LIBRARY(sword STATIC ${sword_SOURCES})
+#ELSE(LIBSWORD_LIBRARY_TYPE STREQUAL "Static")
+#	MESSAGE(ERROR "Please set library build type to either 'Static' or 'Shared'")
+ENDIF(LIBSWORD_LIBRARY_TYPE STREQUAL "Shared")
+
+###############################################################################################
+# Some options are only needed if we're going to be building a debug option into the library
+# These are generally only for developer building and testing
+#
+# Debug testing
+IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
+	SET_TARGET_PROPERTIES(sword
+		PROPERTIES COMPILE_FLAGS "-g3 -Wall -Werror -O0"
+	)
+ELSE(CMAKE_BUILD_TYPE STREQUAL "Debug")
+	SET_TARGET_PROPERTIES(sword
+		PROPERTIES COMPILE_FLAGS "-O3"
+	)
+ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
+
+IF(SWORD_ENABLE_WARNINGS STREQUAL "Yes")
+	SET_TARGET_PROPERTIES(sword
+		PROPERTIES
+			COMPILE_FLAGS "-Werror"
+	)
+ENDIF(SWORD_ENABLE_WARNINGS STREQUAL "Yes")
+
+##############################################################################################
+# Setting libraries and includes
+#
+
+IF(WITH_ZLIB)
+	INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
+	TARGET_LINK_LIBRARIES(sword ${ZLIB_LIBRARY})
+ENDIF(WITH_ZLIB)
+IF(WITH_CURL)
+	INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
+	TARGET_LINK_LIBRARIES(sword ${CURL_LIBRARY})
+ENDIF(WITH_CURL)
+IF(WITH_CLUCENE)
+	INCLUDE_DIRECTORIES(${CLUCENE_INCLUDE_DIR})
+	TARGET_LINK_LIBRARIES(sword ${CLUCENE_LIBRARY})
+	LINK_DIRECTORIES(${CLUCENE_LIBRARY_DIR})
+ENDIF(WITH_CLUCENE)
+IF(WITH_ICU)
+	TARGET_LINK_LIBRARIES(sword ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES})
+	INCLUDE_DIRECTORIES(${ICU_INCLUDE_DIRS})
+ENDIF(WITH_ICU)
+
+##############################################################################################
+#########
+### TODO: Not sure about these...
+#########
+##############################################################################################
+ADD_DEFINITIONS(-D_FTPLIB_NO_COMPAT)
+
+#############################################################################################
+# Platform-specifc bits that I will eventually refactor out into their own files, once I am happy
+# with the stuff that is here.
+# 
+IF(APPLE OR iPhone)
+	ADD_DEFINITIONS(-Dunix)
+ENDIF(APPLE OR iPhone)
+
+##############################################################################################
+# Our build test
+#
+
+ADD_EXECUTABLE(buildtest buildtest.cpp)
+TARGET_LINK_LIBRARIES(buildtest sword)
+
+##############################################################################################
+# Installing the library, headers, utilies, etc
+# 
+
+INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/install.cmake")
+
+##############################################################################################
+# Utilities are hawt
+# 
+
+IF(NOT SWORD_BUILD_UTILS STREQUAL "No")
+	ADD_SUBDIRECTORY("${CMAKE_CURRENT_SOURCE_DIR}/utilities")
+ENDIF(NOT SWORD_BUILD_UTILS STREQUAL "No")
+
+##############################################################################################
+# Demos are also hawt
+# 
+
+IF(SWORD_BUILD_EXAMPLES STREQUAL "Yes")
+	ADD_SUBDIRECTORY("${CMAKE_CURRENT_SOURCE_DIR}/examples/cmdline")
+ENDIF(SWORD_BUILD_EXAMPLES STREQUAL "Yes")
+
+##############################################################################################
+# Tests, however, are not
+
+IF(SWORD_BUILD_TESTS STREQUAL "Yes")
+	ADD_SUBDIRECTORY("${CMAKE_CURRENT_SOURCE_DIR}/tests")
+ENDIF(SWORD_BUILD_TESTS STREQUAL "Yes")

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-06-18 18:55:04 UTC (rev 2521)
+++ trunk/ChangeLog	2010-06-25 22:19:58 UTC (rev 2522)
@@ -1,6 +1,8 @@
 API ChangeLog 
 
 
+25-Jun-2010	Troy A. Griffitts <scribe at crosswire.org>
+	Added CMake build system, contributed by GHellings
 
 29-Mar-2010	Troy A. Griffitts <scribe at crosswire.org>
 	Set verse to 1 when changing chapter and book in VerseKey

Modified: trunk/README
===================================================================
--- trunk/README	2010-06-18 18:55:04 UTC (rev 2521)
+++ trunk/README	2010-06-25 22:19:58 UTC (rev 2522)
@@ -5,33 +5,39 @@
 	http://www.crosswire.org
 
 UNIX DEVELOPERS
-		You can try a './configure' (or optionally './usrinst.sh'
-		for a useful development options configuration), then 'make' from
-		this directory.  This should compile everthing needed.  You may type
-		'./configure --help' to see a list of options.
-		If all compiles fine, a 'make install' (as root, probably) will
-		install libs to your system and you may begin using the library.
-		There are a few basic tests (tests/), start of a test suite
-		(tests/testsuite/), utilities (utilities/), and examples
-		(examples/), in the tree.
+	You can try a './configure' (or optionally './usrinst.sh'
+	for a useful development options configuration), then 'make' from
+	this directory.  This should compile everthing needed.  You may type
+	'./configure --help' to see a list of options.
+	If all compiles fine, a 'make install' (as root, probably) will
+	install libs to your system and you may begin using the library.
+	There are a few basic tests (tests/), start of a test suite
+	(tests/testsuite/), utilities (utilities/), and examples
+	(examples/), in the tree.
 
-		To install modules, have a look at utilities/installmgr
+	To install modules, have a look at utilities/installmgr
 
-		For some basic lookup and search utilities, see
-			examples/cmdline/search
-			examples/cmdline/lookup
-			utilities/diatheke/
+	For some basic lookup and search utilities, see
+		examples/cmdline/search
+		examples/cmdline/lookup
+		utilities/diatheke/
 
-		If you are an end user looking for a nice SWORD, graphical Bible study
-		software suite, then you'll probably want to download one of the
-		many nice frontends found at http://crosswire.org
+	If you are an end user looking for a nice SWORD, graphical Bible study
+	software suite, then you'll probably want to download one of the
+	many nice frontends found at http://crosswire.org
 
-		./buildtest.cpp compiles to the executable 'buildtest' as a test to
-		see if the libs have compiled and can be linked against successfully.
-		This is NOT the final target of the build, nor does anything useful.
-			:)
+	./buildtest.cpp compiles to the executable 'buildtest' as a test to
+	see if the libs have compiled and can be linked against successfully.
+	This is NOT the final target of the build, nor does anything useful.
+		:)
 
+CMAKE
+	Alternatively, you can try building with CMake.  CMake is an alternative
+	make system for muliple platforms.  You might have a great experience
+	using the CMake build system.  See:
+	cmake/README for more information
 
+
 LANGUAGE BINDINGS
 	Other language bindings can be found in the ./bindings directory:
 	flatapi.cpp is a useful extern "C" interface for making bindings easier.

Added: trunk/cmake/FindCLucene.cmake
===================================================================
--- trunk/cmake/FindCLucene.cmake	                        (rev 0)
+++ trunk/cmake/FindCLucene.cmake	2010-06-25 22:19:58 UTC (rev 2522)
@@ -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
+	)

Added: trunk/cmake/FindICU.cmake
===================================================================
--- trunk/cmake/FindICU.cmake	                        (rev 0)
+++ trunk/cmake/FindICU.cmake	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,51 @@
+# 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)
+
+# 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)
+
+# 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)

Added: trunk/cmake/FindLibraryWithDebug.cmake
===================================================================
--- trunk/cmake/FindLibraryWithDebug.cmake	                        (rev 0)
+++ trunk/cmake/FindLibraryWithDebug.cmake	2010-06-25 22:19:58 UTC (rev 2522)
@@ -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 at 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)

Added: trunk/cmake/FindRegex.cmake
===================================================================
--- trunk/cmake/FindRegex.cmake	                        (rev 0)
+++ trunk/cmake/FindRegex.cmake	2010-06-25 22:19:58 UTC (rev 2522)
@@ -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
+)
+

Added: trunk/cmake/README
===================================================================
--- trunk/cmake/README	                        (rev 0)
+++ trunk/cmake/README	2010-06-25 22:19:58 UTC (rev 2522)
@@ -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. 

Added: trunk/cmake/configure-iphone-simulator.sh
===================================================================
--- trunk/cmake/configure-iphone-simulator.sh	                        (rev 0)
+++ trunk/cmake/configure-iphone-simulator.sh	2010-06-25 22:19:58 UTC (rev 2522)
@@ -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 $*


Property changes on: trunk/cmake/configure-iphone-simulator.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/cmake/configure-iphone.sh
===================================================================
--- trunk/cmake/configure-iphone.sh	                        (rev 0)
+++ trunk/cmake/configure-iphone.sh	2010-06-25 22:19:58 UTC (rev 2522)
@@ -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 $*


Property changes on: trunk/cmake/configure-iphone.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/cmake/install.cmake
===================================================================
--- trunk/cmake/install.cmake	                        (rev 0)
+++ trunk/cmake/install.cmake	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,55 @@
+#####################################################################
+# 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
+INSTALL(TARGETS sword
+	DESTINATION ${SWORD_INSTALL_DIR}/lib)
+
+# 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")

Added: trunk/cmake/muxsources.cmake
===================================================================
--- trunk/cmake/muxsources.cmake	                        (rev 0)
+++ trunk/cmake/muxsources.cmake	2010-06-25 22:19:58 UTC (rev 2522)
@@ -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)

Added: trunk/cmake/sources.cmake
===================================================================
--- trunk/cmake/sources.cmake	                        (rev 0)
+++ trunk/cmake/sources.cmake	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,407 @@
+# 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
+)

Added: trunk/cmake/toolchains/iphone-2.2.1.toolchain-broken
===================================================================
--- trunk/cmake/toolchains/iphone-2.2.1.toolchain-broken	                        (rev 0)
+++ trunk/cmake/toolchains/iphone-2.2.1.toolchain-broken	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,51 @@
+# Michael Aaron Safyan (michaelsafyan at 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})

Added: trunk/cmake/toolchains/iphone-3.0.toolchain
===================================================================
--- trunk/cmake/toolchains/iphone-3.0.toolchain	                        (rev 0)
+++ trunk/cmake/toolchains/iphone-3.0.toolchain	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,51 @@
+# Michael Aaron Safyan (michaelsafyan at 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})

Added: trunk/cmake/toolchains/iphone-3.1.2.toolchain
===================================================================
--- trunk/cmake/toolchains/iphone-3.1.2.toolchain	                        (rev 0)
+++ trunk/cmake/toolchains/iphone-3.1.2.toolchain	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,51 @@
+# Michael Aaron Safyan (michaelsafyan at 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})

Added: trunk/cmake/toolchains/iphone-3.1.3.toolchain
===================================================================
--- trunk/cmake/toolchains/iphone-3.1.3.toolchain	                        (rev 0)
+++ trunk/cmake/toolchains/iphone-3.1.3.toolchain	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,51 @@
+# Michael Aaron Safyan (michaelsafyan at 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})

Added: trunk/cmake/toolchains/iphone-3.1.toolchain
===================================================================
--- trunk/cmake/toolchains/iphone-3.1.toolchain	                        (rev 0)
+++ trunk/cmake/toolchains/iphone-3.1.toolchain	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,51 @@
+# Michael Aaron Safyan (michaelsafyan at 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})

Added: trunk/cmake/toolchains/iphone-simulator-2.2.1.toolchain-broken
===================================================================
--- trunk/cmake/toolchains/iphone-simulator-2.2.1.toolchain-broken	                        (rev 0)
+++ trunk/cmake/toolchains/iphone-simulator-2.2.1.toolchain-broken	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,51 @@
+# Michael Aaron Safyan (michaelsafyan at 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})

Added: trunk/cmake/toolchains/iphone-simulator-3.0.toolchain
===================================================================
--- trunk/cmake/toolchains/iphone-simulator-3.0.toolchain	                        (rev 0)
+++ trunk/cmake/toolchains/iphone-simulator-3.0.toolchain	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,52 @@
+# Michael Aaron Safyan (michaelsafyan at 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})

Added: trunk/cmake/toolchains/iphone-simulator-3.1.2.toolchain
===================================================================
--- trunk/cmake/toolchains/iphone-simulator-3.1.2.toolchain	                        (rev 0)
+++ trunk/cmake/toolchains/iphone-simulator-3.1.2.toolchain	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,52 @@
+# Michael Aaron Safyan (michaelsafyan at 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})

Added: trunk/cmake/toolchains/iphone-simulator-3.1.3.toolchain
===================================================================
--- trunk/cmake/toolchains/iphone-simulator-3.1.3.toolchain	                        (rev 0)
+++ trunk/cmake/toolchains/iphone-simulator-3.1.3.toolchain	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,52 @@
+# Michael Aaron Safyan (michaelsafyan at 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})

Added: trunk/cmake/toolchains/iphone-simulator-3.1.toolchain
===================================================================
--- trunk/cmake/toolchains/iphone-simulator-3.1.toolchain	                        (rev 0)
+++ trunk/cmake/toolchains/iphone-simulator-3.1.toolchain	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,52 @@
+# Michael Aaron Safyan (michaelsafyan at 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})

Added: trunk/examples/cmdline/CMakeLists.txt
===================================================================
--- trunk/examples/cmdline/CMakeLists.txt	                        (rev 0)
+++ trunk/examples/cmdline/CMakeLists.txt	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,33 @@
+##################################################################################
+# These are some examples.  If you want examples to be built, you need to define
+# SWORD_BUILD_EXAMPLES="Yes".  These will not be installed, so don't worry about
+# that.
+# 
+SET(example_PROGRAMS
+	listoptions
+	lookup
+	outplain
+	outrender
+	search
+	verserangeparse
+)
+
+FOREACH(DEMO ${example_PROGRAMS})
+	ADD_EXECUTABLE("${DEMO}"	"${DEMO}.cpp")
+	TARGET_LINK_LIBRARIES("${DEMO}" sword)
+ENDFOREACH(DEMO ${example_PROGRAMS})
+
+##################################################################################
+# This example uses pthreads explicity.  I don't know if it supports anything else,
+# but until I find out, I will force it to find PTHREADS only
+# 
+
+FIND_PACKAGE(Threads)
+
+IF(CMAKE_USE_PTHREADS_INIT OR CMAKE_HP_PTHREADS_INIT)
+	ADD_EXECUTABLE(threaded_search	threaded_search.cpp)
+	TARGET_LINK_LIBRARIES(threaded_search
+		sword
+		${CMAKE_THREAD_LIBS_INIT}
+	)
+ENDIF(CMAKE_USE_PTHREADS_INIT OR CMAKE_HP_PTHREADS_INIT)

Added: trunk/tests/CMakeLists.txt
===================================================================
--- trunk/tests/CMakeLists.txt	                        (rev 0)
+++ trunk/tests/CMakeLists.txt	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,75 @@
+#########################################################################################
+# A test suite - that is awesome.
+#
+# I should probably learn the proper usage of such things as CTest for this, but for the
+# time being, I'll see what I can do.
+# 
+#
+# I need some help deciphering tests/cppunit/Makefile.am.  I'm not quite sure what it is
+# trying to do in there.
+# Also, the contents of the tests/testsuite directory are slightly beyond my knowledge
+# level.  It looks like I can do a very simple interface to this all, but I need to know
+# more about how these tests work.
+# 
+
+SET(test_PROGRAMS
+	casttest
+	ciphertest
+	complzss
+	compnone
+	configtest
+	filtertest
+	introtest
+	indextest
+	keycast
+	keytest
+	lextest
+	listtest
+	localetest
+	mgrtest
+	modtest
+	parsekey
+	rawldidxtest
+	romantest
+	striptest
+	swaptest
+	swbuftest
+	testblocks
+	utf8norm
+	versekeytest
+	vtreekeytest
+	versemgrtest
+	webiftest
+	xmltest
+)
+
+IF(WITH_ICU)
+	SET(test_PROGRAMS
+		${test_PROGRAMS}
+		icutest
+#		tlitmgrtest
+		translittest
+	)
+ENDIF(WITH_ICU)
+
+IF(WITH_ZLIB OR WITH_INTERNAL_ZLIB)
+	SET(test_PROGRAMS
+		${test_PROGRAMS}
+		compzip
+	)
+ENDIF(WITH_ZLIB OR WITH_INTERNAL_ZLIB)
+
+FOREACH(TEST ${test_PROGRAMS})
+	ADD_EXECUTABLE(${TEST} EXCLUDE_FROM_ALL	${TEST}.cpp)
+	TARGET_LINK_LIBRARIES(${TEST}	sword)
+ENDFOREACH(TEST ${test_PROGRAMS})
+
+########################################################################################
+# The following tests require extra libraries to run
+# 
+FOREACH(ICUTEST icutest translittest)
+	TARGET_LINK_LIBRARIES(${ICUTEST} ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES})
+ENDFOREACH(ICUTEST icutest translittest)
+
+# Excluded until I know we have the tests working
+ADD_SUBDIRECTORY(testsuite)

Added: trunk/tests/testsuite/CMakeLists.txt
===================================================================
--- trunk/tests/testsuite/CMakeLists.txt	                        (rev 0)
+++ trunk/tests/testsuite/CMakeLists.txt	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,25 @@
+#############################################################################
+# This file will actually be responsible for running the tests
+# 
+
+ADD_CUSTOM_TARGET(
+	tests_configure
+	COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/*.sh ${CMAKE_CURRENT_BINARY_DIR}
+	COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/*.good ${CMAKE_CURRENT_BINARY_DIR}
+	COMMAND echo \"[Install]\\nLocalePath=${CMAKE_CURRENT_SOURCE_DIR}/../../\" > ${CMAKE_CURRENT_BINARY_DIR}/sword.conf
+	DEPENDS ${test_PROGRAMS}
+	WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+ADD_CUSTOM_TARGET(
+	tests
+	COMMAND ./runall.sh
+	WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+ADD_DEPENDENCIES(
+	tests
+	tests_configure
+)
+
+MESSAGE(STATUS "Testing configured.")

Added: trunk/utilities/CMakeLists.txt
===================================================================
--- trunk/utilities/CMakeLists.txt	                        (rev 0)
+++ trunk/utilities/CMakeLists.txt	2010-06-25 22:19:58 UTC (rev 2522)
@@ -0,0 +1,86 @@
+######################################################################
+# Basic utility programs and their joy.
+#
+# The general assumption is that each of these utilities is built from
+# a single source file, which shares its name with the utility itself (appended with .cpp),
+# and then linked against the SWORD library.
+# 
+# This list will be built and installed, if so chosen
+#
+# These are in alphbetical order now - please keep them that way
+# if you edit this list in the future.
+# 
+SET(install_UTILITIES
+	addld
+	imp2gbs
+	imp2ld
+	imp2vs
+	installmgr
+	mkfastmod
+	mod2imp
+	mod2osis
+	mod2vpl
+	tei2mod
+	vpl2mod
+	vs2osisref
+	vs2osisreftxt
+	xml2gbs
+)
+
+IF(WITH_ZLIB OR WITH_INTERNAL_ZLIB)
+	SET(install_UTILITIES ${install_UTILITIES} mod2zmod)
+ENDIF(WITH_ZLIB OR WITH_INTERNAL_ZLIB)
+
+######################################################################
+# These utilities will be built, but they will not be installed
+# 
+# Again, I have gone to great lengths of travail to make this list
+# alphabetical.  If you add utilities to this list, please do so in a
+# way that maintains this.
+SET(noinstall_UTILITIES
+	addgb
+	addvs
+	cipherraw
+	emptyvss
+	gbfidx
+	genbookutil
+	modwrite
+	step2vpl
+	stepdump
+	treeidxutil
+)
+
+#####################################################################
+# This will loop over both of the above utility lists and add build targets
+# to the system for each one of them.
+# 
+
+FOREACH(UTIL ${install_UTILITIES} ${noinstall_UTILITIES})
+	ADD_EXECUTABLE("${UTIL}"	"${UTIL}.cpp")
+	TARGET_LINK_LIBRARIES("${UTIL}" sword)
+ENDFOREACH(UTIL ${install_UTILITIES})
+
+####################################################################
+# Just to be difficult, we have a single C file that is a utility
+# and, therefore, needs its own treatment.
+# 
+
+ADD_EXECUTABLE(lexdump	lexdump.c)
+TARGET_LINK_LIBRARIES(lexdump sword)
+
+####################################################################
+# Install the utilities
+#
+# We do this here, rather than up in the main install file, because
+# a) it fits more logically and b) the scope of ${install_UTILITIES}
+# is limited to CMake files in this directory and below, so rather than
+# replicate the above list in another place, we'll just handle our
+# own install, since this whole directory is optional, anyway.
+# 
+FOREACH(UTIL ${install_UTILITIES})
+	INSTALL(TARGETS ${UTIL}
+		DESTINATION ${SWORD_INSTALL_DIR}/bin
+		COMPONENT utilities
+	)
+ENDFOREACH(UTIL ${install_UTILITIES})
+




More information about the sword-cvs mailing list