summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/CppcheckTargets.cmake231
-rw-r--r--cmake/FindBZIP2.cmake28
-rw-r--r--cmake/FindCLucene.cmake1
-rw-r--r--cmake/FindXZ.cmake28
-rw-r--r--cmake/Findcppcheck.cmake167
-rw-r--r--cmake/Findcppcheck.cpp16
-rw-r--r--cmake/muxsources.cmake30
-rw-r--r--cmake/options.cmake6
-rw-r--r--cmake/sources.cmake54
9 files changed, 543 insertions, 18 deletions
diff --git a/cmake/CppcheckTargets.cmake b/cmake/CppcheckTargets.cmake
new file mode 100644
index 0000000..b465ba8
--- /dev/null
+++ b/cmake/CppcheckTargets.cmake
@@ -0,0 +1,231 @@
+# - Run cppcheck on c++ source files as a custom target and a test
+#
+# include(CppcheckTargets)
+# add_cppcheck(<target-name> [UNUSED_FUNCTIONS] [STYLE] [POSSIBLE_ERROR] [FORCE] [FAIL_ON_WARNINGS]) -
+# Create a target to check a target's sources with cppcheck and the indicated options
+# add_cppcheck_sources(<target-name> [UNUSED_FUNCTIONS] [STYLE] [POSSIBLE_ERROR] [FORCE] [FAIL_ON_WARNINGS]) -
+# Create a target to check standalone sources with cppcheck and the indicated options
+#
+# Requires these CMake modules:
+# Findcppcheck
+#
+# Requires CMake 2.6 or newer (uses the 'function' command)
+#
+# Original Author:
+# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
+# http://academic.cleardefinition.com
+# Iowa State University HCI Graduate Program/VRAC
+#
+# Copyright Iowa State University 2009-2010.
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+if(__add_cppcheck)
+ return()
+endif()
+set(__add_cppcheck YES)
+
+if(NOT CPPCHECK_FOUND)
+ find_package(cppcheck QUIET)
+endif()
+
+if(CPPCHECK_FOUND)
+ if(NOT TARGET all_cppcheck)
+ add_custom_target(all_cppcheck)
+ set_target_properties(all_cppcheck PROPERTIES EXCLUDE_FROM_ALL TRUE)
+ endif()
+endif()
+
+function(add_cppcheck_sources _targetname)
+ if(CPPCHECK_FOUND)
+ set(_cppcheck_args)
+ set(_input ${ARGN})
+ list(FIND _input UNUSED_FUNCTIONS _unused_func)
+ if("${_unused_func}" GREATER "-1")
+ list(APPEND _cppcheck_args ${CPPCHECK_UNUSEDFUNC_ARG})
+ list(REMOVE_AT _input ${_unused_func})
+ endif()
+
+ list(FIND _input STYLE _style)
+ if("${_style}" GREATER "-1")
+ list(APPEND _cppcheck_args ${CPPCHECK_STYLE_ARG})
+ list(REMOVE_AT _input ${_style})
+ endif()
+
+ list(FIND _input POSSIBLE_ERROR _poss_err)
+ if("${_poss_err}" GREATER "-1")
+ list(APPEND _cppcheck_args ${CPPCHECK_POSSIBLEERROR_ARG})
+ list(REMOVE_AT _input ${_poss_err})
+ endif()
+
+ list(FIND _input FORCE _force)
+ if("${_force}" GREATER "-1")
+ list(APPEND _cppcheck_args "--force")
+ list(REMOVE_AT _input ${_force})
+ endif()
+
+ list(FIND _input FAIL_ON_WARNINGS _fail_on_warn)
+ if("${_fail_on_warn}" GREATER "-1")
+ list(APPEND
+ CPPCHECK_FAIL_REGULAR_EXPRESSION
+ ${CPPCHECK_WARN_REGULAR_EXPRESSION})
+ list(REMOVE_AT _input ${_fail_on_warn})
+ endif()
+
+ set(_files)
+ foreach(_source ${_input})
+ get_source_file_property(_cppcheck_loc "${_source}" LOCATION)
+ if(_cppcheck_loc)
+ # This file has a source file property, carry on.
+ get_source_file_property(_cppcheck_lang "${_source}" LANGUAGE)
+ if("${_cppcheck_lang}" MATCHES "CXX")
+ list(APPEND _files "${_cppcheck_loc}")
+ endif()
+ else()
+ # This file doesn't have source file properties - figure it out.
+ get_filename_component(_cppcheck_loc "${_source}" ABSOLUTE)
+ if(EXISTS "${_cppcheck_loc}")
+ list(APPEND _files "${_cppcheck_loc}")
+ else()
+ message(FATAL_ERROR
+ "Adding CPPCHECK for file target ${_targetname}: "
+ "File ${_source} does not exist or needs a corrected path location "
+ "since we think its absolute path is ${_cppcheck_loc}")
+ endif()
+ endif()
+ endforeach()
+
+ if("1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0")
+ # Older than CMake 2.8.0
+ add_test(${_targetname}_cppcheck_test
+ "${CPPCHECK_EXECUTABLE}"
+ ${CPPCHECK_TEMPLATE_ARG}
+ ${_cppcheck_args}
+ ${_files})
+ else()
+ # CMake 2.8.0 and newer
+ add_test(NAME
+ ${_targetname}_cppcheck_test
+ COMMAND
+ "${CPPCHECK_EXECUTABLE}"
+ ${CPPCHECK_TEMPLATE_ARG}
+ ${_cppcheck_args}
+ ${_files})
+ endif()
+
+ set_tests_properties(${_targetname}_cppcheck_test
+ PROPERTIES
+ FAIL_REGULAR_EXPRESSION
+ "${CPPCHECK_FAIL_REGULAR_EXPRESSION}")
+
+ add_custom_command(TARGET
+ all_cppcheck
+ PRE_BUILD
+ COMMAND
+ ${CPPCHECK_EXECUTABLE}
+ ${CPPCHECK_QUIET_ARG}
+ ${CPPCHECK_TEMPLATE_ARG}
+ ${_cppcheck_args}
+ ${_files}
+ WORKING_DIRECTORY
+ "${CMAKE_CURRENT_SOURCE_DIR}"
+ COMMENT
+ "${_targetname}_cppcheck: Running cppcheck on target ${_targetname}..."
+ VERBATIM)
+ endif()
+endfunction()
+
+function(add_cppcheck _name)
+ if(NOT TARGET ${_name})
+ message(FATAL_ERROR
+ "add_cppcheck given a target name that does not exist: '${_name}' !")
+ endif()
+ if(CPPCHECK_FOUND)
+ set(_cppcheck_args)
+
+ list(FIND ARGN UNUSED_FUNCTIONS _unused_func)
+ if("${_unused_func}" GREATER "-1")
+ list(APPEND _cppcheck_args ${CPPCHECK_UNUSEDFUNC_ARG})
+ endif()
+
+ list(FIND ARGN STYLE _style)
+ if("${_style}" GREATER "-1")
+ list(APPEND _cppcheck_args ${CPPCHECK_STYLE_ARG})
+ endif()
+
+ list(FIND ARGN POSSIBLE_ERROR _poss_err)
+ if("${_poss_err}" GREATER "-1")
+ list(APPEND _cppcheck_args ${CPPCHECK_POSSIBLEERROR_ARG})
+ endif()
+
+ list(FIND ARGN FORCE _force)
+ if("${_force}" GREATER "-1")
+ list(APPEND _cppcheck_args "--force")
+ endif()
+
+ list(FIND _input FAIL_ON_WARNINGS _fail_on_warn)
+ if("${_fail_on_warn}" GREATER "-1")
+ list(APPEND
+ CPPCHECK_FAIL_REGULAR_EXPRESSION
+ ${CPPCHECK_WARN_REGULAR_EXPRESSION})
+ list(REMOVE_AT _input ${_unused_func})
+ endif()
+
+ get_target_property(_cppcheck_includes "${_name}" INCLUDE_DIRECTORIES)
+ set(_includes)
+ foreach(_include ${_cppcheck_includes})
+ list(APPEND _includes "-I${_include}")
+ endforeach()
+
+ get_target_property(_cppcheck_sources "${_name}" SOURCES)
+ set(_files)
+ foreach(_source ${_cppcheck_sources})
+ get_source_file_property(_cppcheck_lang "${_source}" LANGUAGE)
+ get_source_file_property(_cppcheck_loc "${_source}" LOCATION)
+ if("${_cppcheck_lang}" MATCHES "CXX")
+ list(APPEND _files "${_cppcheck_loc}")
+ endif()
+ endforeach()
+
+ if("1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0")
+ # Older than CMake 2.8.0
+ add_test(${_name}_cppcheck_test
+ "${CPPCHECK_EXECUTABLE}"
+ ${CPPCHECK_TEMPLATE_ARG}
+ ${_cppcheck_args}
+ ${_files})
+ else()
+ # CMake 2.8.0 and newer
+ add_test(NAME
+ ${_name}_cppcheck_test
+ COMMAND
+ "${CPPCHECK_EXECUTABLE}"
+ ${CPPCHECK_TEMPLATE_ARG}
+ ${_cppcheck_args}
+ ${_files})
+ endif()
+
+ set_tests_properties(${_name}_cppcheck_test
+ PROPERTIES
+ FAIL_REGULAR_EXPRESSION
+ "${CPPCHECK_FAIL_REGULAR_EXPRESSION}")
+
+ add_custom_command(TARGET
+ all_cppcheck
+ PRE_BUILD
+ COMMAND
+ ${CPPCHECK_EXECUTABLE}
+ ${CPPCHECK_QUIET_ARG}
+ ${CPPCHECK_TEMPLATE_ARG}
+ ${_cppcheck_args}
+ ${_includes}
+ ${_files}
+ WORKING_DIRECTORY
+ "${CMAKE_CURRENT_SOURCE_DIR}"
+ COMMENT
+ "${_name}_cppcheck: Running cppcheck on target ${_name}..."
+ VERBATIM)
+ endif()
+
+endfunction()
diff --git a/cmake/FindBZIP2.cmake b/cmake/FindBZIP2.cmake
new file mode 100644
index 0000000..3f0c3eb
--- /dev/null
+++ b/cmake/FindBZIP2.cmake
@@ -0,0 +1,28 @@
+# - Try to find BZIP2
+# Once done this will define
+#
+# BZIP2_FOUND - system has BZIP2
+# BZIP2_INCLUDE_DIR - the BZIP2 include directory
+# BZIP2_LIBRARY - Link these to use BZIP2
+# BZIP2_DEFINITIONS - Compiler switches required for using BZIP2
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+IF (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARY)
+ SET(BZIP2_FIND_QUIETLY TRUE)
+ENDIF (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARY)
+
+FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h )
+
+FIND_LIBRARY(BZIP2_LIBRARY bz2 )
+
+# handle the QUIETLY and REQUIRED arguments and set BZIP2_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZIP2 DEFAULT_MSG BZIP2_LIBRARY BZIP2_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR BZIP2_LIBRARY)
diff --git a/cmake/FindCLucene.cmake b/cmake/FindCLucene.cmake
index 00d2055..386dc75 100644
--- a/cmake/FindCLucene.cmake
+++ b/cmake/FindCLucene.cmake
@@ -46,6 +46,7 @@ SET(TRIAL_LIBRARY_PATHS
/opt/local/lib${LIB_SUFFIX}
/usr/lib${LIB_SUFFIX}
/usr/lib64
+ ${LIB_INSTALL_DIR}
/sw/lib${LIB_SUFFIX}
/usr/pkg/lib${LIB_SUFFIX}
${WIN_CLUCENE_SEARCH_PATH}
diff --git a/cmake/FindXZ.cmake b/cmake/FindXZ.cmake
new file mode 100644
index 0000000..9654c9e
--- /dev/null
+++ b/cmake/FindXZ.cmake
@@ -0,0 +1,28 @@
+# - Try to find XZ
+# Once done this will define
+#
+# XZ_FOUND - system has XZ
+# XZ_INCLUDE_DIR - the XZ include directory
+# XZ_LIBRARY - Link these to use XZ
+# XZ_DEFINITIONS - Compiler switches required for using XZ
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+IF (XZ_INCLUDE_DIR AND XZ_LIBRARY)
+ SET(XZ_FIND_QUIETLY TRUE)
+ENDIF (XZ_INCLUDE_DIR AND XZ_LIBRARY)
+
+FIND_PATH(XZ_INCLUDE_DIR lzma.h )
+
+FIND_LIBRARY(XZ_LIBRARY lzma )
+
+# handle the QUIETLY and REQUIRED arguments and set XZ_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(XZ DEFAULT_MSG XZ_LIBRARY XZ_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(XZ_INCLUDE_DIR XZ_LIBRARY)
diff --git a/cmake/Findcppcheck.cmake b/cmake/Findcppcheck.cmake
new file mode 100644
index 0000000..2dcf799
--- /dev/null
+++ b/cmake/Findcppcheck.cmake
@@ -0,0 +1,167 @@
+# - try to find cppcheck tool
+#
+# Cache Variables:
+# CPPCHECK_EXECUTABLE
+#
+# Non-cache variables you might use in your CMakeLists.txt:
+# CPPCHECK_FOUND
+# CPPCHECK_POSSIBLEERROR_ARG
+# CPPCHECK_UNUSEDFUNC_ARG
+# CPPCHECK_STYLE_ARG
+# CPPCHECK_QUIET_ARG
+# CPPCHECK_INCLUDEPATH_ARG
+# CPPCHECK_FAIL_REGULAR_EXPRESSION
+# CPPCHECK_WARN_REGULAR_EXPRESSION
+# CPPCHECK_MARK_AS_ADVANCED - whether to mark our vars as advanced even
+# if we don't find this program.
+#
+# Requires these CMake modules:
+# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
+#
+# Original Author:
+# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
+# http://academic.cleardefinition.com
+# Iowa State University HCI Graduate Program/VRAC
+#
+# Copyright Iowa State University 2009-2010.
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+file(TO_CMAKE_PATH "${CPPCHECK_ROOT_DIR}" CPPCHECK_ROOT_DIR)
+set(CPPCHECK_ROOT_DIR
+ "${CPPCHECK_ROOT_DIR}"
+ CACHE
+ PATH
+ "Path to search for cppcheck")
+
+# cppcheck app bundles on Mac OS X are GUI, we want command line only
+set(_oldappbundlesetting ${CMAKE_FIND_APPBUNDLE})
+set(CMAKE_FIND_APPBUNDLE NEVER)
+
+if(CPPCHECK_EXECUTABLE AND NOT EXISTS "${CPPCHECK_EXECUTABLE}")
+ set(CPPCHECK_EXECUTABLE "notfound" CACHE PATH FORCE "")
+endif()
+
+# If we have a custom path, look there first.
+if(CPPCHECK_ROOT_DIR)
+ find_program(CPPCHECK_EXECUTABLE
+ NAMES
+ cppcheck
+ cli
+ PATHS
+ "${CPPCHECK_ROOT_DIR}"
+ PATH_SUFFIXES
+ cli
+ NO_DEFAULT_PATH)
+endif()
+
+find_program(CPPCHECK_EXECUTABLE NAMES cppcheck)
+
+# Restore original setting for appbundle finding
+set(CMAKE_FIND_APPBUNDLE ${_oldappbundlesetting})
+
+# Find out where our test file is
+get_filename_component(_cppcheckmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
+set(_cppcheckdummyfile "${_cppcheckmoddir}/Findcppcheck.cpp")
+if(NOT EXISTS "${_cppcheckdummyfile}")
+ message(FATAL_ERROR
+ "Missing file ${_cppcheckdummyfile} - should be alongside Findcppcheck.cmake, can be found at https://github.com/rpavlik/cmake-modules")
+endif()
+
+function(_cppcheck_test_arg _resultvar _arg)
+ if(NOT CPPCHECK_EXECUTABLE)
+ set(${_resultvar} NO)
+ return()
+ endif()
+ execute_process(COMMAND
+ "${CPPCHECK_EXECUTABLE}"
+ "${_arg}"
+ "--quiet"
+ "${_cppcheckdummyfile}"
+ RESULT_VARIABLE
+ _cppcheck_result
+ OUTPUT_QUIET
+ ERROR_QUIET)
+ if("${_cppcheck_result}" EQUAL 0)
+ set(${_resultvar} YES PARENT_SCOPE)
+ else()
+ set(${_resultvar} NO PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(_cppcheck_set_arg_var _argvar _arg)
+ if("${${_argvar}}" STREQUAL "")
+ _cppcheck_test_arg(_cppcheck_arg "${_arg}")
+ if(_cppcheck_arg)
+ set(${_argvar} "${_arg}" PARENT_SCOPE)
+ endif()
+ endif()
+endfunction()
+
+if(CPPCHECK_EXECUTABLE)
+
+ # Check for the two types of command line arguments by just trying them
+ _cppcheck_set_arg_var(CPPCHECK_STYLE_ARG "--enable=style")
+ _cppcheck_set_arg_var(CPPCHECK_STYLE_ARG "--style")
+ if("${CPPCHECK_STYLE_ARG}" STREQUAL "--enable=style")
+
+ _cppcheck_set_arg_var(CPPCHECK_UNUSEDFUNC_ARG
+ "--enable=unusedFunction")
+ _cppcheck_set_arg_var(CPPCHECK_INFORMATION_ARG "--enable=information")
+ _cppcheck_set_arg_var(CPPCHECK_MISSINGINCLUDE_ARG
+ "--enable=missingInclude")
+ _cppcheck_set_arg_var(CPPCHECK_POSIX_ARG "--enable=posix")
+ _cppcheck_set_arg_var(CPPCHECK_POSSIBLEERROR_ARG
+ "--enable=possibleError")
+ _cppcheck_set_arg_var(CPPCHECK_POSSIBLEERROR_ARG "--enable=all")
+
+ if(MSVC)
+ set(CPPCHECK_TEMPLATE_ARG --template vs)
+ set(CPPCHECK_FAIL_REGULAR_EXPRESSION "[(]error[)]")
+ set(CPPCHECK_WARN_REGULAR_EXPRESSION "[(]style[)]")
+ elseif(CMAKE_COMPILER_IS_GNUCXX)
+ set(CPPCHECK_TEMPLATE_ARG --template gcc)
+ set(CPPCHECK_FAIL_REGULAR_EXPRESSION " error: ")
+ set(CPPCHECK_WARN_REGULAR_EXPRESSION " style: ")
+ else()
+ set(CPPCHECK_TEMPLATE_ARG --template gcc)
+ set(CPPCHECK_FAIL_REGULAR_EXPRESSION " error: ")
+ set(CPPCHECK_WARN_REGULAR_EXPRESSION " style: ")
+ endif()
+ elseif("${CPPCHECK_STYLE_ARG}" STREQUAL "--style")
+ # Old arguments
+ _cppcheck_set_arg_var(CPPCHECK_UNUSEDFUNC_ARG "--unused-functions")
+ _cppcheck_set_arg_var(CPPCHECK_POSSIBLEERROR_ARG "--all")
+ set(CPPCHECK_FAIL_REGULAR_EXPRESSION "error:")
+ set(CPPCHECK_WARN_REGULAR_EXPRESSION "[(]style[)]")
+ else()
+ # No idea - some other issue must be getting in the way
+ message(STATUS
+ "WARNING: Can't detect whether CPPCHECK wants new or old-style arguments!")
+ endif()
+
+ set(CPPCHECK_QUIET_ARG "--quiet")
+ set(CPPCHECK_INCLUDEPATH_ARG "-I")
+
+endif()
+
+set(CPPCHECK_ALL
+ "${CPPCHECK_EXECUTABLE} ${CPPCHECK_POSSIBLEERROR_ARG} ${CPPCHECK_UNUSEDFUNC_ARG} ${CPPCHECK_STYLE_ARG} ${CPPCHECK_QUIET_ARG} ${CPPCHECK_INCLUDEPATH_ARG} some/include/path")
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(cppcheck
+ DEFAULT_MSG
+ CPPCHECK_ALL
+ CPPCHECK_EXECUTABLE
+ CPPCHECK_POSSIBLEERROR_ARG
+ CPPCHECK_UNUSEDFUNC_ARG
+ CPPCHECK_STYLE_ARG
+ CPPCHECK_INCLUDEPATH_ARG
+ CPPCHECK_QUIET_ARG)
+
+if(CPPCHECK_FOUND OR CPPCHECK_MARK_AS_ADVANCED)
+ mark_as_advanced(CPPCHECK_ROOT_DIR)
+endif()
+
+mark_as_advanced(CPPCHECK_EXECUTABLE)
diff --git a/cmake/Findcppcheck.cpp b/cmake/Findcppcheck.cpp
new file mode 100644
index 0000000..84350db
--- /dev/null
+++ b/cmake/Findcppcheck.cpp
@@ -0,0 +1,16 @@
+/**
+ * \file Findcppcheck.cpp
+ * \brief Dummy C++ source file used by CMake module Findcppcheck.cmake
+ *
+ * \author
+ * Ryan Pavlik, 2009-2010
+ * <rpavlik@iastate.edu>
+ * http://academic.cleardefinition.com/
+ *
+ */
+
+
+
+int main(int argc, char* argv[]) {
+ return 0;
+}
diff --git a/cmake/muxsources.cmake b/cmake/muxsources.cmake
index cf60af6..40c42bd 100644
--- a/cmake/muxsources.cmake
+++ b/cmake/muxsources.cmake
@@ -5,12 +5,14 @@
#
# Written by Greg Hellings
SET(sword_SOURCES ${sword_base_SOURCES})
+
+MESSAGE(STATUS "\n-- CONFIGURING SOURCE LIST")
+
# 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
-MESSAGE(STATUS "\n-- CONFIGURING SOURCE LIST")
IF(SWORD_NO_ZLIB STREQUAL "Yes")
MESSAGE(STATUS "ZLib: excluded by use option")
ADD_DEFINITIONS(-DEXCLUDEZLIB)
@@ -27,6 +29,32 @@ ELSE(SWORD_NO_ZLIB STREQUAL "Yes")
ENDIF(NOT ZLIB_FOUND OR SWORD_USE_INTERNAL_ZLIB STREQUAL "Yes")
ENDIF(SWORD_NO_ZLIB STREQUAL "Yes")
+# Check for if we've found bzip2 (libbz2)
+IF(BZIP2_FOUND AND NOT SWORD_NO_BZIP2 STREQUAL "Yes")
+ SET(sword_SOURCES ${sword_SOURCES} ${sword_bzip2_used_SOURCES})
+ IF(BZIP2_FOUND)
+ MESSAGE(STATUS "bzip2: system ${BZIP2_LIBRARY}")
+ SET(WITH_BZIP2 1)
+ ENDIF(BZIP2_FOUND)
+ELSE(BZIP2_FOUND AND NOT SWORD_NO_BZIP2 STREQUAL "Yes")
+ MESSAGE(STATUS "bzip2: no")
+ ADD_DEFINITIONS(-DEXCLUDEBZIP2)
+ SET(WITH_BZIP2 0)
+ENDIF(BZIP2_FOUND AND NOT SWORD_NO_BZIP2 STREQUAL "Yes")
+
+# Check for if we've found xz (liblzma)
+IF(XZ_FOUND AND NOT SWORD_NO_XZ STREQUAL "Yes")
+ SET(sword_SOURCES ${sword_SOURCES} ${sword_xz_used_SOURCES})
+ IF(XZ_FOUND)
+ MESSAGE(STATUS "xz: system ${XZ_LIBRARY}")
+ SET(WITH_XZ 1)
+ ENDIF(XZ_FOUND)
+ELSE(XZ_FOUND AND NOT SWORD_NO_XZ STREQUAL "Yes")
+ MESSAGE(STATUS "xz: no")
+ ADD_DEFINITIONS(-DEXCLUDEXZ)
+ SET(WITH_XZ 0)
+ENDIF(XZ_FOUND AND NOT SWORD_NO_XZ STREQUAL "Yes")
+
# Check for if we've found cURL
IF(CURL_FOUND AND NOT SWORD_NO_CURL STREQUAL "Yes")
MESSAGE(STATUS "cURL: system ${CURL_LIBRARY} and ${CURL_INCLUDE_DIRS}")
diff --git a/cmake/options.cmake b/cmake/options.cmake
index 4ca7b19..81981c8 100644
--- a/cmake/options.cmake
+++ b/cmake/options.cmake
@@ -22,9 +22,6 @@ macro(_SET_FANCY _var _value _comment)
endif()
endmacro(_SET_FANCY)
-# A list of the options that the library supports
-SET(SWORD_PYTHON_INSTALL_DIR "" CACHE STRING "Directory where the Python bindings will be installed. Defaults to default Python path.")
-
# Installation options
IF(APPLE)
SET(SWORD_INSTALL_DIR "/opt/local")
@@ -34,6 +31,7 @@ ELSE(APPLE)
SET(SWORD_INSTALL_DIR "/usr/local")
ENDIF(APPLE)
+# A list of the options that the library supports
_SET_FANCY(CMAKE_INSTALL_PREFIX "${SWORD_INSTALL_DIR}" "Directory into which to install architecture-dependent files. Defaults to ${SWORD_INSTALL_DIR}.")
_SET_FANCY(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" "Object code library install directory. Defaults to ${SWORD_INSTALL_DIR}/lib")
@@ -46,6 +44,8 @@ _SET_FANCY(SYSCONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/etc" "Directory to insta
_SET_FANCY(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share" "Directory to install global data files. Defaults to ${SWORD_INSTALL_DIR}/share.")
+_SET_FANCY(SWORD_PYTHON_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE STRING "Directory where the Python bindings will be installed. Defaults to default Python path.")
+
# Post-processing of variables
MACRO(PROCESS_VERSION LEVEL VALUE)
SET(SWORD_VERSION_${LEVEL} ${VALUE})
diff --git a/cmake/sources.cmake b/cmake/sources.cmake
index 040c81b..29dbaa2 100644
--- a/cmake/sources.cmake
+++ b/cmake/sources.cmake
@@ -48,6 +48,7 @@ SET(sword_base_module_SOURCES
src/modules/comments/rawcom4/rawcom4.cpp
src/modules/comments/rawfiles/rawfiles.cpp
src/modules/comments/zcom/zcom.cpp
+ src/modules/comments/zcom4/zcom4.cpp
src/modules/common/rawstr.cpp
src/modules/common/rawstr4.cpp
src/modules/common/swcomprs.cpp
@@ -56,6 +57,7 @@ SET(sword_base_module_SOURCES
src/modules/common/rawverse4.cpp
src/modules/common/swcipher.cpp
src/modules/common/zverse.cpp
+ src/modules/common/zverse4.cpp
src/modules/common/zstr.cpp
src/modules/common/entriesblk.cpp
src/modules/common/sapphire.cpp
@@ -74,6 +76,7 @@ SET(sword_base_module_SOURCES
src/modules/filters/gbfredletterwords.cpp
src/modules/filters/gbfmorph.cpp
src/modules/filters/gbfwordjs.cpp
+ src/modules/filters/gbflatex.cpp
src/modules/filters/thmlstrongs.cpp
src/modules/filters/thmlfootnotes.cpp
@@ -89,11 +92,13 @@ SET(sword_base_module_SOURCES
src/modules/filters/thmlhtmlhref.cpp
src/modules/filters/thmlwebif.cpp
src/modules/filters/thmlwordjs.cpp
+ src/modules/filters/thmllatex.cpp
src/modules/filters/teiplain.cpp
src/modules/filters/teirtf.cpp
src/modules/filters/teixhtml.cpp
src/modules/filters/teihtmlhref.cpp
+ src/modules/filters/teilatex.cpp
src/modules/filters/gbfthml.cpp
src/modules/filters/gbfosis.cpp
@@ -101,11 +106,11 @@ SET(sword_base_module_SOURCES
src/modules/filters/thmlplain.cpp
src/modules/filters/osisosis.cpp
- src/modules/filters/osisenum.cpp
- src/modules/filters/osisglosses.cpp
- src/modules/filters/osisxlit.cpp
+ src/modules/filters/osisenum.cpp
+ src/modules/filters/osisglosses.cpp
+ src/modules/filters/osisxlit.cpp
src/modules/filters/osisheadings.cpp
- src/modules/filters/osisfootnotes.cpp
+ src/modules/filters/osisfootnotes.cpp
src/modules/filters/osishtmlhref.cpp
src/modules/filters/osisxhtml.cpp
src/modules/filters/osiswebif.cpp
@@ -120,6 +125,7 @@ SET(sword_base_module_SOURCES
src/modules/filters/osiswordjs.cpp
src/modules/filters/osismorphsegmentation.cpp
src/modules/filters/osisreferencelinks.cpp
+ src/modules/filters/osislatex.cpp
src/modules/filters/latin1utf8.cpp
src/modules/filters/latin1utf16.cpp
@@ -129,6 +135,7 @@ SET(sword_base_module_SOURCES
src/modules/filters/utf8latin1.cpp
src/modules/filters/unicodertf.cpp
src/modules/filters/scsuutf8.cpp
+ src/modules/filters/utf8scsu.cpp
src/modules/filters/utf8cantillation.cpp
src/modules/filters/utf8hebrewpoints.cpp
@@ -153,6 +160,7 @@ SET(sword_base_module_SOURCES
src/modules/texts/rawtext/rawtext.cpp
src/modules/texts/rawtext4/rawtext4.cpp
src/modules/texts/ztext/ztext.cpp
+ src/modules/texts/ztext4/ztext4.cpp
)
SOURCE_GROUP("src\\modules" FILES ${sword_base_module_SOURCES})
@@ -201,8 +209,6 @@ ENDIF(NOT MSVC)
# Sources relying on ZLib
SET(sword_zlib_used_SOURCES
src/modules/common/zipcomprs.cpp
- src/modules/common/bz2comprs.cpp
- src/modules/common/xzcomprs.cpp
src/utilfuns/zlib/untgz.c
)
SET(sword_zlib_nofound_SOURCES
@@ -223,6 +229,16 @@ SET(sword_zlib_nofound_SOURCES
src/utilfuns/zlib/zutil.c
)
+# Sources relying on bzip2 (libbz2)
+SET(sword_bzip2_used_SOURCES
+ src/modules/common/bz2comprs.cpp
+)
+
+# Sources relying on xz (liblzma)
+SET(sword_xz_used_SOURCES
+ src/modules/common/xzcomprs.cpp
+)
+
# Sources relying on cURL
SET(sword_curl_found_SOURCES
src/mgr/curlftpt.cpp
@@ -254,6 +270,7 @@ SET(sword_icu_found_SOURCES
# Headers
SET(SWORD_INSTALL_HEADERS
+ include/bz2comprs.h
include/canon.h
include/canon_abbrevs.h
include/cipherfil.h
@@ -286,8 +303,9 @@ SET(SWORD_INSTALL_HEADERS
include/gbfstrongs.h
include/gbfwordjs.h
include/gbfthml.h
- include/greeklexattribs.h
+ include/gbflatex.h
+ include/greeklexattribs.h
include/hebrewmcim.h
include/hrefcom.h
include/installmgr.h
@@ -313,13 +331,14 @@ SET(SWORD_INSTALL_HEADERS
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/osisreferencelinks.h
+ include/osisfootnotes.h
+ include/osislemma.h
+ include/osisredletterwords.h
+ include/osisscripref.h
+ include/osiswordjs.h
+ include/osisvariants.h
+ include/osisreferencelinks.h
+ include/osislatex.h
include/papyriplain.h
include/rawcom.h
@@ -380,11 +399,13 @@ SET(SWORD_INSTALL_HEADERS
include/thmlstrongs.h
include/thmlvariants.h
include/thmlwordjs.h
+ include/thmllatex.h
include/teiplain.h
include/teirtf.h
include/teixhtml.h
include/teihtmlhref.h
+ include/teilatex.h
include/treekey.h
include/treekeyidx.h
@@ -402,6 +423,7 @@ SET(SWORD_INSTALL_HEADERS
include/utf8latin1.h
include/utf8nfc.h
include/utf8nfkd.h
+ include/utf8scsu.h
include/utf8transliterator.h
include/utf8utf16.h
include/utilstr.h
@@ -409,13 +431,17 @@ SET(SWORD_INSTALL_HEADERS
include/versekey.h
include/versetreekey.h
+ include/xzcomprs.h
include/zcom.h
+ include/zcom4.h
include/zconf.h
include/zipcomprs.h
include/zld.h
include/zstr.h
include/ztext.h
+ include/ztext4.h
include/zverse.h
+ include/zverse4.h
include/canon_kjva.h
include/canon_leningrad.h