diff options
author | Roberto C. Sanchez <roberto@connexer.com> | 2014-10-21 22:58:34 -0400 |
---|---|---|
committer | Roberto C. Sanchez <roberto@connexer.com> | 2014-10-21 22:58:34 -0400 |
commit | 1ea03c0fce8066c1e22188447b4a6ca4dcef1201 (patch) | |
tree | 1ad46980fdca402062502b20b7e16468b89393f8 /cmake | |
parent | 579657c8cb4ecd8a313221e70bdbbc7267f20286 (diff) |
Imported Upstream version 2.10.1
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/BTBinaryPackageMacOS.cmake | 49 | ||||
-rw-r--r-- | cmake/BTBinaryPackageWindows.cmake | 112 | ||||
-rw-r--r-- | cmake/BTDeveloper.cmake | 16 | ||||
-rw-r--r-- | cmake/BTDocumentation.cmake | 6 | ||||
-rw-r--r-- | cmake/BTSourceFileList.cmake | 227 | ||||
-rw-r--r-- | cmake/BTUITranslation.cmake | 41 | ||||
-rw-r--r-- | cmake/FindCLucene.cmake | 176 | ||||
-rw-r--r-- | cmake/FindGit.cmake | 70 | ||||
-rw-r--r-- | cmake/FindICU.cmake | 51 | ||||
-rw-r--r-- | cmake/FindSword.cmake | 259 | ||||
-rw-r--r-- | cmake/KDE4FindLibraryWithDebug.cmake (renamed from cmake/FindLibraryWithDebug.cmake) | 0 | ||||
-rw-r--r-- | cmake/platforms/linux/bibletime.desktop.cmake | 16 | ||||
-rw-r--r-- | cmake/platforms/macos/Info.plist | 16 | ||||
-rw-r--r-- | cmake/platforms/macos/bt_start.sh | 21 | ||||
-rw-r--r-- | cmake/platforms/windows/qt.conf | 2 | ||||
-rw-r--r-- | cmake/platforms/windows/rawfiles.cpp | 228 | ||||
-rw-r--r-- | cmake/platforms/windows/rawfiles.h | 94 | ||||
-rw-r--r-- | cmake/sword_linker_check.cpp | 27 | ||||
-rw-r--r-- | cmake/sword_version_print.cpp (renamed from cmake/sword_version_compare.cpp) | 13 |
19 files changed, 746 insertions, 678 deletions
diff --git a/cmake/BTBinaryPackageMacOS.cmake b/cmake/BTBinaryPackageMacOS.cmake index abe359a..62a6f42 100644 --- a/cmake/BTBinaryPackageMacOS.cmake +++ b/cmake/BTBinaryPackageMacOS.cmake @@ -1,32 +1,60 @@ IF(APPLE) # Qt Plugins - INSTALL( - DIRECTORY "${QT_PLUGINS_DIR}/iconengines" "${QT_PLUGINS_DIR}/imageformats" - DESTINATION "${BT_DESTINATION}/plugins" - ) + IF(Qt5Core_FOUND) + GET_TARGET_PROPERTY(ICON_PLUGIN Qt5::QICOPlugin LOCATION) + GET_TARGET_PROPERTY(GIF_PLUGIN Qt5::QGifPlugin LOCATION) + GET_TARGET_PROPERTY(JPG_PLUGIN Qt5::QJpegPlugin LOCATION) + GET_TARGET_PROPERTY(SVG_PLUGIN Qt5::QSvgPlugin LOCATION) + GET_TARGET_PROPERTY(TIFF_PLUGIN Qt5::QTiffPlugin LOCATION) + GET_TARGET_PROPERTY(BMP_PLUGIN Qt5::QWbmpPlugin LOCATION) + GET_TARGET_PROPERTY(MNG_PLUGIN Qt5::QMngPlugin LOCATION) + INSTALL( + FILES + "${ICON_PLUGIN}" + "${GIF_PLUGIN}" + "${JPG_PLUGIN}" + "${SVG_PLUGIN}" + "${TIFF_PLUGIN}" + "${BMP_PLUGIN}" + "${MNG_PLUGIN}" + DESTINATION "${BT_DESTINATION}/plugins" + ) + ELSE(Qt5Core_FOUND) + INSTALL( + DIRECTORY "${QT_PLUGINS_DIR}/iconengines" "${QT_PLUGINS_DIR}/imageformats" + DESTINATION "${BT_DESTINATION}/plugins" + ) - INSTALL( - DIRECTORY "${QT_LIBRARY_DIR}/QtGui.framework/Resources/qt_menu.nib" - DESTINATION "${BT_DESTINATION}/../Frameworks/QtGui.framework/Resources" - ) + INSTALL( + DIRECTORY "${QT_LIBRARY_DIR}/QtGui.framework/Resources/qt_menu.nib" + DESTINATION "${BT_DESTINATION}/../Frameworks/QtGui.framework/Resources" + ) + ENDIF(Qt5Core_FOUND) INSTALL( FILES "${CMAKE_CURRENT_SOURCE_DIR}/cmake/platforms/macos/qt.conf" DESTINATION "${BT_SHARE_PATH}/../Resources" ) + # Install the Sword library + INSTALL( + FILES "${Sword_LIBRARY_DIRS}/lib${Sword_LIBRARIES}-${Sword_VERSION}.dylib" + DESTINATION "${BT_DESTINATION}/" + ) + IF (CMAKE_BUILD_TYPE STREQUAL "Release") INSTALL(CODE " FILE(GLOB_RECURSE QTPLUGINS \"\${CMAKE_INSTALL_PREFIX}/${BT_DESTINATION}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}\") + SET(BU_CHMOD_BUNDLE_ITEMS ON) # Add write permissions for libs that need it like libssl INCLUDE(BundleUtilities) FIXUP_BUNDLE( - \"\${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_PREFIX}/${BT_DESTINATION}/BibleTime\" + \"\${CMAKE_INSTALL_PREFIX}/${BT_DESTINATION}/BibleTime\" \"\${QTPLUGINS}\" - \"\${CMAKE_INSTALL_PREFIX}/${BT_DESTINATION}/plugins/imageformats;\${CMAKE_INSTALL_PREFIX}/${BT_DESTINATION}/plugins/iconengines\" + \"\" ) ") @@ -43,3 +71,4 @@ IF(APPLE) INCLUDE(CPack) ENDIF(APPLE) + diff --git a/cmake/BTBinaryPackageWindows.cmake b/cmake/BTBinaryPackageWindows.cmake index 10bfa17..28b7a11 100644 --- a/cmake/BTBinaryPackageWindows.cmake +++ b/cmake/BTBinaryPackageWindows.cmake @@ -1,10 +1,14 @@ IF(WIN32 AND NOT UNIX) + # Libs needed for packaging + FIND_PACKAGE(ZLIB REQUIRED) + FIND_PACKAGE(CURL REQUIRED) + SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "BibleTime for Windows svn") SET(CPACK_PACKAGE_VENDOR "http://www.bibletime.info") SET(CPACK_PACKAGE_VERSION_MAJOR ${BT_VERSION_MAJOR}) SET(CPACK_PACKAGE_VERSION_MINOR ${BT_VERSION_MINOR}) - SET(CPACK_PACKAGE_VERSION_PATCH ${BT_REVISION_PATCH}) + SET(CPACK_PACKAGE_VERSION_PATCH ${BT_VERSION_PATCH}) SET(CPACK_PACKAGE_INSTALL_DIRECTORY "BibleTime") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") @@ -13,8 +17,93 @@ IF(WIN32 AND NOT UNIX) # sure there is at least one set of four (4) backlasshes. # We need the libraries, and they're not pulled in automatically - INCLUDE(${QT_USE_FILE}) SET(CMAKE_INSTALL_DEBUG_LIBRARIES TRUE) + +IF (Qt5Core_FOUND) + SET(QT_BINARY_DIR "${Qt5Core_DIR}/../../../bin") + INSTALL(FILES + "${QT_BINARY_DIR}/icudt51d.dll" + "${QT_BINARY_DIR}/icuin51d.dll" + "${QT_BINARY_DIR}/icuuc51d.dll" + "${QT_BINARY_DIR}/libEGLd.dll" + "${QT_BINARY_DIR}/libGLESv2d.dll" + "${QT_BINARY_DIR}/Qt5Cored.dll" + "${QT_BINARY_DIR}/Qt5Guid.dll" + "${QT_BINARY_DIR}/Qt5Multimediad.dll" + "${QT_BINARY_DIR}/Qt5MultimediaWidgetsd.dll" + "${QT_BINARY_DIR}/Qt5Networkd.dll" + "${QT_BINARY_DIR}/Qt5OpenGLd.dll" + "${QT_BINARY_DIR}/Qt5Qmld.dll" + "${QT_BINARY_DIR}/Qt5Quickd.dll" + "${QT_BINARY_DIR}/Qt5Positioningd.dll" + "${QT_BINARY_DIR}/Qt5PrintSupportd.dll" + "${QT_BINARY_DIR}/Qt5Sensorsd.dll" + "${QT_BINARY_DIR}/Qt5Sqld.dll" + "${QT_BINARY_DIR}/Qt5Svgd.dll" + "${QT_BINARY_DIR}/Qt5WebKitd.dll" + "${QT_BINARY_DIR}/Qt5WebKitWidgetsd.dll" + "${QT_BINARY_DIR}/Qt5Widgetsd.dll" + "${QT_BINARY_DIR}/Qt5Xmld.dll" + "${QT_BINARY_DIR}/Qt5XmlPatternsd.dll" + DESTINATION "${BT_DESTINATION}" + CONFIGURATIONS "Debug" + ) + INSTALL(FILES + "${QT_BINARY_DIR}/icudt51.dll" + "${QT_BINARY_DIR}/icuin51.dll" + "${QT_BINARY_DIR}/icuuc51.dll" + "${QT_BINARY_DIR}/libEGL.dll" + "${QT_BINARY_DIR}/libGLESv2.dll" + "${QT_BINARY_DIR}/Qt5Core.dll" + "${QT_BINARY_DIR}/Qt5Gui.dll" + "${QT_BINARY_DIR}/Qt5Multimedia.dll" + "${QT_BINARY_DIR}/Qt5MultimediaWidgets.dll" + "${QT_BINARY_DIR}/Qt5Network.dll" + "${QT_BINARY_DIR}/Qt5OpenGL.dll" + "${QT_BINARY_DIR}/Qt5Qml.dll" + "${QT_BINARY_DIR}/Qt5Quick.dll" + "${QT_BINARY_DIR}/Qt5Positioning.dll" + "${QT_BINARY_DIR}/Qt5PrintSupport.dll" + "${QT_BINARY_DIR}/Qt5Sensors.dll" + "${QT_BINARY_DIR}/Qt5Sql.dll" + "${QT_BINARY_DIR}/Qt5Svg.dll" + "${QT_BINARY_DIR}/Qt5WebKit.dll" + "${QT_BINARY_DIR}/Qt5WebKitWidgets.dll" + "${QT_BINARY_DIR}/Qt5Widgets.dll" + "${QT_BINARY_DIR}/Qt5Xml.dll" + "${QT_BINARY_DIR}/Qt5XmlPatterns.dll" + DESTINATION "${BT_DESTINATION}" + CONFIGURATIONS "Release" + ) + INSTALL(FILES + "cmake/platforms/windows/qt.conf" + DESTINATION "${BT_DESTINATION}" + CONFIGURATIONS "Release" + ) + SET(QT_PLUGINS_DIR "${Qt5Core_DIR}/../../../plugins") + INSTALL(FILES + "${QT_PLUGINS_DIR}/iconengines/qsvgicon.dll" + DESTINATION "${BT_DESTINATION}/plugins/iconengines" + CONFIGURATIONS "Release" + ) + INSTALL(FILES + "${QT_PLUGINS_DIR}/platforms/qminimal.dll" + "${QT_PLUGINS_DIR}/platforms/qoffscreen.dll" + "${QT_PLUGINS_DIR}/platforms/qwindows.dll" + DESTINATION "${BT_DESTINATION}/plugins/platforms" + CONFIGURATIONS "Release" + ) + INSTALL(FILES + "${QT_PLUGINS_DIR}/imageformats/qgif.dll" + "${QT_PLUGINS_DIR}/imageformats/qico.dll" + "${QT_PLUGINS_DIR}/imageformats/qjpeg.dll" + "${QT_PLUGINS_DIR}/imageformats/qmng.dll" + "${QT_PLUGINS_DIR}/imageformats/qsvg.dll" + "${QT_PLUGINS_DIR}/imageformats/qtiff.dll" + DESTINATION "${BT_DESTINATION}/plugins/imageformats" + CONFIGURATIONS "Release" + ) +ELSE (Qt5Core_FOUND) SET(QT_BINARY_DIR "${QT_LIBRARY_DIR}/../bin") INSTALL(FILES "${QT_BINARY_DIR}/QtWebKitd4.dll" @@ -42,7 +131,6 @@ IF(WIN32 AND NOT UNIX) DESTINATION "${BT_DESTINATION}" CONFIGURATIONS "Release" ) - # Qt Plugins INSTALL(FILES "${QT_PLUGINS_DIR}/iconengines/qsvgicon4.dll" @@ -59,17 +147,27 @@ IF(WIN32 AND NOT UNIX) DESTINATION "${BT_DESTINATION}/plugins/imageformats" CONFIGURATIONS "Release" ) +ENDIF (Qt5Core_FOUND) # This adds in the required Windows system libraries + MESSAGE(STATUS "INSTALL Microsoft Redist ${MSVC_REDIST}" ) INSTALL(PROGRAMS ${MSVC_REDIST} DESTINATION bin) SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS " - ExecWait \\\"$INSTDIR\\\\bin\\\\vcredist_x86.exe /q:a\\\" + ExecWait \\\"$INSTDIR\\\\bin\\\\vcredist_x86.exe /q\\\" Delete \\\"$INSTDIR\\\\bin\\\\vcredist_x86.exe\\\" ") - # add the libsword.dll - STRING(REPLACE ".lib" ".dll" SWORD_DLL "${SWORD_LIBRARY}") - INSTALL(FILES ${SWORD_DLL} DESTINATION ${BT_DESTINATION}) # This will also take effect in the regular install + MESSAGE(STATUS "INSTALL CLucene_LIBRARY ${CLucene_LIBRARY}" ) + STRING(REPLACE ".lib" ".dll" CLUCENE_DLL "${CLucene_LIBRARY}") + INSTALL(FILES ${CLUCENE_DLL} DESTINATION ${BT_DESTINATION}) + + MESSAGE(STATUS "INSTALL CLucene_LIBRARY ${CLucene_SHARED_LIB}" ) + STRING(REPLACE ".lib" ".dll" CLUCENE_SHARED_DLL "${CLucene_SHARED_LIB}") + INSTALL(FILES ${CLUCENE_SHARED_DLL} DESTINATION ${BT_DESTINATION}) + + MESSAGE(STATUS "INSTALL CURL_LIBRARY ${CURL_LIBRARY}" ) + STRING(REPLACE "_imp.lib" ".dll" CURL_DLL "${CURL_LIBRARY}") + INSTALL(FILES ${CURL_DLL} DESTINATION ${BT_DESTINATION}) # Some options for the CPack system. These should be pretty self-evident SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\pics\\\\icons\\\\bibletime.png") diff --git a/cmake/BTDeveloper.cmake b/cmake/BTDeveloper.cmake deleted file mode 100644 index 483dc2b..0000000 --- a/cmake/BTDeveloper.cmake +++ /dev/null @@ -1,16 +0,0 @@ -FILE(GLOB_RECURSE ORIG_SOURCE_FILES - RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src/" - "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h" -) -FOREACH(FILE ${ORIG_SOURCE_FILES}) - SET(REFORMAT_FILES "${REFORMAT_FILES} ${FILE}") -ENDFOREACH(FILE ${ORIG_SOURCE_FILES}) - -SET(ASTYLE_OPTIONS "--indent=spaces=4 --brackets=attach --indent-classes --indent-switches --brackets=break-closing --pad=oper --suffix=none --options=none") - -ADD_CUSTOM_TARGET("reformat_codebase" - COMMAND "sh" "-c" "astyle ${ASTYLE_OPTIONS} ${REFORMAT_FILES}" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/" - VERBATIM -)
\ No newline at end of file diff --git a/cmake/BTDocumentation.cmake b/cmake/BTDocumentation.cmake index 49e5994..c696014 100644 --- a/cmake/BTDocumentation.cmake +++ b/cmake/BTDocumentation.cmake @@ -3,10 +3,10 @@ FILE(GLOB INSTALL_HANDBOOK_IMAGES "${CMAKE_CURRENT_SOURCE_DIR}/docs/handbook/en/ FOREACH(HANDBOOK_LOCALE_LANG ${HANDBOOK_LOCALE_LANGS} "en") FILE(GLOB INSTALL_HANDBOOK_HTML_FILES_${HANDBOOK_LOCALE_LANG} "${CMAKE_CURRENT_SOURCE_DIR}/docs/handbook/${HANDBOOK_LOCALE_LANG}/html/*.html") INSTALL(FILES ${INSTALL_HANDBOOK_HTML_FILES_${HANDBOOK_LOCALE_LANG}} - DESTINATION "${BT_SHARE_PATH}bibletime/docs/handbook/${HANDBOOK_LOCALE_LANG}/" + DESTINATION "${BT_SHARE_PATH}/bibletime/docs/handbook/${HANDBOOK_LOCALE_LANG}/" ) INSTALL(FILES ${INSTALL_HANDBOOK_IMAGES} - DESTINATION "${BT_SHARE_PATH}bibletime/docs/handbook/${HANDBOOK_LOCALE_LANG}/" + DESTINATION "${BT_SHARE_PATH}/bibletime/docs/handbook/${HANDBOOK_LOCALE_LANG}/" ) ENDFOREACH(HANDBOOK_LOCALE_LANG ${HANDBOOK_LOCALE_LANGS} "en") @@ -14,7 +14,7 @@ ENDFOREACH(HANDBOOK_LOCALE_LANG ${HANDBOOK_LOCALE_LANGS} "en") FOREACH(HOWTO_LOCALE_LANG ${HOWTO_LOCALE_LANGS} "en") FILE(GLOB INSTALL_HOWTO_HTML_FILES_${HOWTO_LOCALE_LANG} "${CMAKE_CURRENT_SOURCE_DIR}/docs/howto/${HOWTO_LOCALE_LANG}/html/*.html") INSTALL(FILES ${INSTALL_HOWTO_HTML_FILES_${HOWTO_LOCALE_LANG}} - DESTINATION "${BT_SHARE_PATH}bibletime/docs/howto/${HOWTO_LOCALE_LANG}/" + DESTINATION "${BT_SHARE_PATH}/bibletime/docs/howto/${HOWTO_LOCALE_LANG}/" ) ENDFOREACH(HOWTO_LOCALE_LANG ${HOWTO_LOCALE_LANGS} "en") diff --git a/cmake/BTSourceFileList.cmake b/cmake/BTSourceFileList.cmake index f5c4ab5..ed7273b 100644 --- a/cmake/BTSourceFileList.cmake +++ b/cmake/BTSourceFileList.cmake @@ -1,6 +1,3 @@ -SET(bibletime_UIS - src/frontend/display/bthtmlfindtext.ui -) SET(bibletime_SRC # Toplevel files: @@ -10,6 +7,7 @@ SET(bibletime_SRC src/bibletime_init.cpp src/bibletime_slots.cpp src/bibletimeapp.cpp + src/btglobal.cpp src/main.cpp ) @@ -20,6 +18,8 @@ SET(bibletime_SRC_BACKEND src/backend/btmoduletreeitem.cpp src/backend/cswordmodulesearch.cpp src/backend/btinstallbackend.cpp + src/backend/btinstallmgr.cpp + src/backend/btinstallthread.cpp ) SOURCE_GROUP("src\\backend" FILES ${bibletime_SRC_BACKEND}) @@ -40,7 +40,8 @@ SOURCE_GROUP("src\\backend\\bookshelfmodel" FILES ${bibletime_SRC_BACKEND_BOOKSH SET(bibletime_SRC_BACKEND_CONFIG # Backend config: - src/backend/config/cbtconfig.cpp + src/backend/config/btconfig.cpp + src/backend/config/btconfigcore.cpp ) SOURCE_GROUP("src\\backend\\config" FILES ${bibletime_SRC_BACKEND_CONFIG}) @@ -64,7 +65,7 @@ SET(bibletime_SRC_BACKEND_FILTERS src/backend/filters/teitohtml.cpp src/backend/filters/thmltohtml.cpp src/backend/filters/thmltoplain.cpp - src/backend/filters/osismorphsegmentation.cpp + src/backend/filters/btosismorphsegmentation.cpp ) SOURCE_GROUP("src\\backend\\filters" FILES ${bibletime_SRC_BACKEND_FILTERS}) @@ -106,9 +107,9 @@ SOURCE_GROUP("src\\backend\\managers" FILES ${bibletime_SRC_BACKEND_MANAGERS}) SET(bibletime_SRC_UTIL # Utilities: src/util/cresmgr.cpp - src/util/dialogutil.cpp src/util/directory.cpp src/util/btmodules.cpp + src/util/geticon.cpp src/util/tool.cpp ) @@ -131,6 +132,7 @@ SET(bibletime_SRC_FRONTEND src/frontend/cmdiarea.cpp src/frontend/cprinter.cpp src/frontend/crossrefrendering.cpp + src/frontend/messagedialog.cpp ) SOURCE_GROUP("src\\frontend" FILES ${bibletime_SRC_FRONTEND}) @@ -138,7 +140,6 @@ SOURCE_GROUP("src\\frontend" FILES ${bibletime_SRC_FRONTEND}) SET(bibletime_SRC_FRONTEND_BOOKSHELFMANAGER # Bookshelf manager frontend: src/frontend/bookshelfmanager/btconfigdialog.cpp - src/frontend/bookshelfmanager/btinstallmgr.cpp src/frontend/bookshelfmanager/btmodulemanagerdialog.cpp src/frontend/bookshelfmanager/cswordsetupinstallsourcesdialog.cpp ) @@ -160,7 +161,6 @@ SET(bibletime_SRC_FRONTEND_BOOKSHELFMANAGER_INSTALLPAGE src/frontend/bookshelfmanager/installpage/btinstallpageworkswidget.cpp src/frontend/bookshelfmanager/installpage/btinstallpathdialog.cpp src/frontend/bookshelfmanager/installpage/btinstallprogressdialog.cpp - src/frontend/bookshelfmanager/installpage/btinstallthread.cpp src/frontend/bookshelfmanager/installpage/btinstallpagemodel.cpp src/frontend/bookshelfmanager/installpage/btrefreshprogressdialog.cpp ) @@ -216,6 +216,8 @@ SET(bibletime_SRC_FRONTEND_SETTINGSDIALOG # Settings dialog (configuration): src/frontend/settingsdialogs/btshortcutsdialog.cpp src/frontend/settingsdialogs/btshortcutseditor.cpp + src/frontend/settingsdialogs/bttextfilterstab.cpp + src/frontend/settingsdialogs/btstandardworkstab.cpp src/frontend/settingsdialogs/cacceleratorsettings.cpp src/frontend/settingsdialogs/cconfigurationdialog.cpp src/frontend/settingsdialogs/cdisplaysettings.cpp @@ -228,15 +230,6 @@ SET(bibletime_SRC_FRONTEND_SETTINGSDIALOG SOURCE_GROUP("src\\frontend\\settingsdialog" FILES ${bibletime_SRC_FRONTEND_SETTINGSDIALOG}) -SET(bibletime_SRC_FRONTEND_PROFILE - # Profile manager frontend: - src/frontend/profile/cprofile.cpp - src/frontend/profile/cprofilemgr.cpp - src/frontend/profile/cprofilewindow.cpp -) - -SOURCE_GROUP("src\\frontend\\profile" FILES ${bibletime_SRC_FRONTEND_PROFILE}) - SET(bibletime_SRC_FRONTEND_TIPDIALOG # Tip dialog: src/frontend/tips/bttipdialog.cpp @@ -271,15 +264,14 @@ SOURCE_GROUP("src\\frontend\\keychooser\\versekeychooser" FILES ${bibletime_SRC_ SET(bibletime_SRC_FRONTEND_DISPLAY # Behaviour for display areas: src/frontend/display/btcolorwidget.cpp + src/frontend/display/btfindwidget.cpp src/frontend/display/btfontsizewidget.cpp - src/frontend/display/bthtmlfindtext.cpp src/frontend/display/bthtmljsobject.cpp src/frontend/display/bthtmlreaddisplay.cpp src/frontend/display/cdisplay.cpp src/frontend/display/chtmlwritedisplay.cpp src/frontend/display/cplainwritedisplay.cpp src/frontend/display/creaddisplay.cpp - src/frontend/display/cwritedisplay.cpp ) SOURCE_GROUP("src\\frontend\\display" FILES ${bibletime_SRC_FRONTEND_DISPLAY}) @@ -302,15 +294,12 @@ SET(bibletime_SRC_FRONTEND_DISPLAYWINDOW src/frontend/displaywindow/clexiconreadwindow.cpp src/frontend/displaywindow/cplainwritewindow.cpp src/frontend/displaywindow/creadwindow.cpp - src/frontend/displaywindow/cwritewindow.cpp ) SOURCE_GROUP("src\\frontend\\displaywindow" FILES ${bibletime_SRC_FRONTEND_DISPLAYWINDOW}) # Mocable headers: -SET(bibletime_MOCABLE_HEADERS - src/bibletime.h - src/bibletime_dbus_adaptor.h +SET(bibletime_COMMON_MOCABLE_HEADERS src/backend/bookshelfmodel/btbookshelffiltermodel.h src/backend/bookshelfmodel/btbookshelfmodel.h src/backend/bookshelfmodel/btbookshelftreemodel.h @@ -321,10 +310,22 @@ SET(bibletime_MOCABLE_HEADERS src/backend/drivers/cswordlexiconmoduleinfo.h src/backend/drivers/cswordmoduleinfo.h src/backend/managers/cswordbackend.h + src/util/btsignal.h + src/backend/btinstallmgr.h + src/backend/btinstallthread.h +) + +IF(BT_Use_DBus) + SET(bibletime_FRONTEND_DESKTOP_DBUS_MOCABLE_HEADERS src/bibletime_dbus_adaptor.h) +ENDIF() + +SET(bibletime_FRONTEND_DESKTOP_MOCABLE_HEADERS + ${bibletime_FRONTEND_DESKTOP_DBUS_MOCABLE_HEADERS} + src/bibletime.h + src/bibletimeapp.h src/frontend/bookmarks/bteditbookmarkdialog.h src/frontend/bookmarks/cbookmarkindex.h src/frontend/bookshelfmanager/btconfigdialog.h - src/frontend/bookshelfmanager/btinstallmgr.h src/frontend/bookshelfmanager/btmodulemanagerdialog.h src/frontend/bookshelfmanager/cswordsetupinstallsourcesdialog.h src/frontend/bookshelfmanager/indexpage/btindexpage.h @@ -334,7 +335,6 @@ SET(bibletime_MOCABLE_HEADERS src/frontend/bookshelfmanager/installpage/btinstallpageworkswidget.h src/frontend/bookshelfmanager/installpage/btinstallpathdialog.h src/frontend/bookshelfmanager/installpage/btinstallprogressdialog.h - src/frontend/bookshelfmanager/installpage/btinstallthread.h src/frontend/bookshelfmanager/installpage/btinstallpagemodel.h src/frontend/bookshelfmanager/installpage/btrefreshprogressdialog.h src/frontend/bookshelfmanager/removepage/btremovepage.h @@ -354,8 +354,8 @@ SET(bibletime_MOCABLE_HEADERS src/frontend/cmdiarea.h src/frontend/cprinter.h src/frontend/display/btcolorwidget.h + src/frontend/display/btfindwidget.h src/frontend/display/btfontsizewidget.h - src/frontend/display/bthtmlfindtext.h src/frontend/display/bthtmljsobject.h src/frontend/display/bthtmlreaddisplay.h src/frontend/display/cdisplay.h @@ -375,7 +375,6 @@ SET(bibletime_MOCABLE_HEADERS src/frontend/displaywindow/clexiconreadwindow.h src/frontend/displaywindow/cplainwritewindow.h src/frontend/displaywindow/creadwindow.h - src/frontend/displaywindow/cwritewindow.h src/frontend/keychooser/bthistory.h src/frontend/keychooser/cbookkeychooser.h src/frontend/keychooser/cbooktreechooser.h @@ -401,6 +400,8 @@ SET(bibletime_MOCABLE_HEADERS src/frontend/searchdialog/csearchresultview.h src/frontend/settingsdialogs/btshortcutsdialog.h src/frontend/settingsdialogs/btshortcutseditor.h + src/frontend/settingsdialogs/bttextfilterstab.h + src/frontend/settingsdialogs/btstandardworkstab.h src/frontend/settingsdialogs/cacceleratorsettings.h src/frontend/settingsdialogs/cconfigurationdialog.h src/frontend/settingsdialogs/cdisplaysettings.h @@ -410,11 +411,9 @@ SET(bibletime_MOCABLE_HEADERS src/frontend/settingsdialogs/clistwidget.h src/frontend/settingsdialogs/cswordsettings.h src/frontend/tips/bttipdialog.h - src/util/btsignal.h ) -SET(bibletime_SOURCES - ${bibletime_SRC} +SET(bibletime_COMMON_SOURCES ${bibletime_SRC_BACKEND} ${bibletime_SRC_BACKEND_BOOKSHELFMODEL} ${bibletime_SRC_BACKEND_CONFIG} @@ -423,7 +422,10 @@ SET(bibletime_SOURCES ${bibletime_SRC_BACKEND_KEYS} ${bibletime_SRC_BACKEND_RENDERING} ${bibletime_SRC_BACKEND_MANAGERS} - ${bibletime_SRC_UTIL} + ${bibletime_SRC_UTIL}) + +SET(bibletime_FRONTEND_DESKTOP_SOURCES + ${bibletime_SRC} ${bibletime_SRC_FRONTEND} ${bibletime_SRC_FRONTEND_BOOKMARKS} ${bibletime_SRC_FRONTEND_BOOKSHELFMANAGER} @@ -434,9 +436,170 @@ SET(bibletime_SOURCES ${bibletime_SRC_FRONTEND_SEARCHDIALOG_ANALYSIS} ${bibletime_SRC_FRONTEND_SETTINGSDIALOG} ${bibletime_SRC_FRONTEND_TIPDIALOG} - ${bibletime_SRC_FRONTEND_PROFILE} ${bibletime_SRC_FRONTEND_KEYCHOOSER} ${bibletime_SRC_FRONTEND_KEYCHOOSER_VERSEKEYCHOOSER} ${bibletime_SRC_FRONTEND_DISPLAY} ${bibletime_SRC_FRONTEND_DISPLAYWINDOW} ) + + + +SET(bibletime_SRC_MOBILE_SOURCES + src/mobile/bibletime.cpp + src/mobile/bibletime.h + src/mobile/btmmain.cpp + src/mobile/bibletimeapp.cpp +) + +SET(bibletime_SRC_MOBILE_MODEL_SOURCES + src/mobile/models/bibletextmodelbuilder.cpp + src/mobile/models/bibletextmodelbuilder.h + src/mobile/models/booktextmodelbuilder.cpp + src/mobile/models/booktextmodelbuilder.h + src/mobile/models/roleitemmodel.cpp + src/mobile/models/roleitemmodel.h +) + +SET(bibletime_SRC_MOBILE_UTIL_SOURCES + src/mobile/util/findqmlobject.cpp + src/mobile/util/findqmlobject.h + src/mobile/util/messagedialog.cpp + src/mobile/util/messagedialog.h +) + +SET(bibletime_SRC_MOBILE_UI_SOURCES + src/mobile/bookshelfmanager/installmanager.cpp + src/mobile/bookshelfmanager/installmanager.h + src/mobile/bookshelfmanager/installprogress.cpp + src/mobile/bookshelfmanager/installprogress.h + src/mobile/bookshelfmanager/installsourcesmanager.cpp + src/mobile/bookshelfmanager/installsourcesmanager.h + src/mobile/bookshelfmanager/installsources.cpp + src/mobile/bookshelfmanager/installsources.h + src/mobile/keychooser/bookkeychooser.cpp + src/mobile/keychooser/bookkeychooser.h + src/mobile/keychooser/versechooser.cpp + src/mobile/keychooser/versechooser.h + src/mobile/ui/btstyle.cpp + src/mobile/ui/btstyle.h + src/mobile/ui/btwindowinterface.cpp + src/mobile/ui/btwindowinterface.h + src/mobile/ui/modulechooser.cpp + src/mobile/ui/modulechooser.h + src/mobile/ui/moduleinterface.cpp + src/mobile/ui/moduleinterface.h + src/mobile/ui/qtquick2applicationviewer.cpp + src/mobile/ui/qtquick2applicationviewer.h + src/mobile/ui/gridchooser.cpp + src/mobile/ui/gridchooser.h + src/mobile/ui/viewmanager.cpp + src/mobile/ui/viewmanager.h +) + +SET(bibletime_SRC_MOBILE_MOCABLE_HEADERS + src/mobile/bookshelfmanager/installmanager.h + src/mobile/bookshelfmanager/installprogress.h + src/mobile/bookshelfmanager/installsourcesmanager.h + src/mobile/bookshelfmanager/installsources.h + src/mobile/keychooser/bookkeychooser.h + src/mobile/keychooser/versechooser.h + src/mobile/bibletime.h + src/mobile/bibletimeapp.h + src/mobile/ui/btstyle.h + src/mobile/ui/btwindowinterface.h + src/mobile/ui/modulechooser.h + src/mobile/ui/moduleinterface.h + src/mobile/ui/qtquick2applicationviewer.h + src/mobile/ui/gridchooser.h + src/mobile/ui/viewmanager.h +) + +SET(bibletime_MOBILE_QML_FILES + src/mobile/qml/ContextMenu.qml + src/mobile/qml/GridChooserButton.qml + src/mobile/qml/GridChooser.qml + src/mobile/qml/ImageButton.qml + src/mobile/qml/InstallManagerChooser.qml + src/mobile/qml/ListTextView.qml + src/mobile/qml/ListWorksView.qml + src/mobile/qml/main.qml + src/mobile/qml/MainToolbar.qml + src/mobile/qml/Menus.qml + src/mobile/qml/MenuButton.qml + src/mobile/qml/MenuView.qml + src/mobile/qml/ModuleChooser.qml + src/mobile/qml/Progress.qml + src/mobile/qml/Settings.qml + src/mobile/qml/FontSizeSlider.qml + src/mobile/qml/TreeChooser.qml + src/mobile/qml/Window.qml + src/mobile/qml/WindowManager.qml + src/mobile/qml/checkmark.svg + src/mobile/qml/leftarrow.svg + src/mobile/qml/rightarrow.svg +) + +SET(bibletime_FRONTEND_MOBILE_SOURCES + ${bibletime_SRC_MOBILE_SOURCES} + ${bibletime_SRC_MOBILE_MOCABLE_HEADERS} + ${bibletime_SRC_MOBILE_MODEL_SOURCES} + ${bibletime_SRC_MOBILE_UI_SOURCES} + ${bibletime_SRC_MOBILE_UTIL_SOURCES} +) + +SET(bibletime_FRONTEND_MOBILE_MOCABLE_HEADERS + ${bibletime_SRC_MOBILE_MOCABLE_HEADERS} +) + +# Default to building a desktop frontend: +IF(NOT (DEFINED BIBLETIME_FRONTEND)) + SET(BIBLETIME_FRONTEND "DESKTOP") +ENDIF(NOT (DEFINED BIBLETIME_FRONTEND)) + +# Check for valid frontend: +SET(bibletime_AVAILABLE_FRONTENDS DESKTOP MOBILE) +#SET(bibletime_AVAILABLE_FRONTENDS DESKTOP QML_SYMBIAN) +LIST(FIND bibletime_AVAILABLE_FRONTENDS ${BIBLETIME_FRONTEND} bibletime_FRONTEND_INDEX) +IF(${bibletime_FRONTEND_INDEX} EQUAL -1) + MESSAGE(STATUS "Invalid frontend specified: ${BIBLETIME_FRONTEND}.") + MESSAGE(STATUS "Available frontends are:") + FOREACH(frontend ${bibletime_AVAILABLE_FRONTENDS}) + MESSAGE(STATUS " ${frontend}") + ENDFOREACH(frontend ${bibletime_AVAILABLE_FRONTENDS}) + MESSAGE(FATAL_ERROR "Aborting processing because of invalid BIBLETIME_FRONTEND") +ENDIF(${bibletime_FRONTEND_INDEX} EQUAL -1) +MESSAGE(STATUS "Selected frontend: ${BIBLETIME_FRONTEND}") + +SET(bibletime_SOURCES + ${bibletime_COMMON_SOURCES} + ${bibletime_FRONTEND_${BIBLETIME_FRONTEND}_SOURCES}) +SET(bibletime_MOCABLE_HEADERS + ${bibletime_COMMON_MOCABLE_HEADERS} + ${bibletime_FRONTEND_${BIBLETIME_FRONTEND}_MOCABLE_HEADERS}) +SET(bibletime_QML_FILES + ${bibletime_${BIBLETIME_FRONTEND}_QML_FILES}) + +IF(Qt5Core_FOUND) + QT5_WRAP_UI(bibletime_UIS_H ${bibletime_UIS}) + QT5_WRAP_CPP(bibletime_MOC_SOURCES ${bibletime_MOCABLE_HEADERS}) +ELSE() + QT4_WRAP_UI(bibletime_UIS_H ${bibletime_UIS}) + QT4_WRAP_CPP(bibletime_MOC_SOURCES ${bibletime_MOCABLE_HEADERS}) +ENDIF() + +SET(common_bibletime_SOURCES + ${bibletime_SOURCES} + ${bibletime_UIS_H} + ${bibletime_MOC_SOURCES} + ${bibletime_QML_FILES} + ${bibletime_RC} + ${bibletime_UI_translations} +) + +# For the Windows Application Icon +IF(MSVC) + LIST(APPEND common_bibletime_SOURCES "cmake/BTWinIcon.rc") + SOURCE_GROUP("Icon Files" FILES "cmake/BTWinIcon.rc") +ENDIF() + +SOURCE_GROUP("QM Files" REGULAR_EXPRESSION ".*\\.qm") diff --git a/cmake/BTUITranslation.cmake b/cmake/BTUITranslation.cmake index cf6c6b7..2af0f61 100644 --- a/cmake/BTUITranslation.cmake +++ b/cmake/BTUITranslation.cmake @@ -17,33 +17,42 @@ ELSE (Qt5Core_FOUND) ) ENDIF (Qt5Core_FOUND) -FOREACH(MESSAGE_LOCALE_LANG ${MESSAGE_LOCALE_LANGS}) - ADD_CUSTOM_COMMAND(OUTPUT "bibletime_ui_${MESSAGE_LOCALE_LANG}.qm" - PRE_BUILD - COMMAND ${QT_LRELEASE_EXECUTABLE} "bibletime_ui_${MESSAGE_LOCALE_LANG}.ts" -qm "${CMAKE_CURRENT_BINARY_DIR}/bibletime_ui_${MESSAGE_LOCALE_LANG}.qm" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/i18n/messages/" - COMMENT "Updating UI translation for ${MESSAGE_LOCALE_LANG}" +SET(TS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/i18n/messages") +FILE(GLOB TS_FILES "${TS_DIR}/bibletime_ui_*.ts") +FOREACH(TSFILE_FULLPATH ${TS_FILES}) + STRING(REGEX REPLACE "${TS_DIR}/bibletime_ui_(..(_..)?).ts" "\\1" + TS_LANG "${TSFILE_FULLPATH}") + SET(TS_LANGS ${TS_LANGS} ${TS_LANG}) + SET(QMFILE "bibletime_ui_${TS_LANG}.qm") + ADD_CUSTOM_COMMAND( + TARGET "bibletime" + POST_BUILD + COMMAND ${QT_LRELEASE_EXECUTABLE} "${TSFILE_FULLPATH}" -qm "${QMFILE}" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Updating UI translation for ${TS_LANG}" VERBATIM ) SET(bibletime_UI_translations ${bibletime_UI_translations} - "bibletime_ui_${MESSAGE_LOCALE_LANG}.qm" + "${QMFILE}" ) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/bibletime_ui_${MESSAGE_LOCALE_LANG}.qm" - DESTINATION "${BT_SHARE_PATH}bibletime/locale/" + INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${QMFILE}" + DESTINATION "${BT_SHARE_PATH}/bibletime/locale/" ) -ENDFOREACH(MESSAGE_LOCALE_LANG) +ENDFOREACH(TSFILE_FULLPATH) # Update source catalog files (this is the basis for the translator's work) # Invoke this with "make messages" ADD_CUSTOM_TARGET("messages") -FOREACH(MESSAGE_LOCALE_LANG ${MESSAGE_LOCALE_LANGS}) - ADD_CUSTOM_TARGET("messages_${MESSAGE_LOCALE_LANG}" - COMMAND ${QT_LUPDATE_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/src" -ts "${CMAKE_CURRENT_SOURCE_DIR}/i18n/messages/bibletime_ui_${MESSAGE_LOCALE_LANG}.ts") - ADD_DEPENDENCIES("messages" "messages_${MESSAGE_LOCALE_LANG}") -ENDFOREACH(MESSAGE_LOCALE_LANG) +FOREACH(TS_LANG ${TS_LANGS}) + ADD_CUSTOM_TARGET("messages_${TS_LANG}" + COMMAND ${QT_LUPDATE_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/src" -ts "${TS_DIR}/bibletime_ui_${TS_LANG}.ts") + ADD_DEPENDENCIES("messages" "messages_${TS_LANG}") +ENDFOREACH(TS_LANG) + + # Template file for translators ADD_CUSTOM_TARGET("messages_default" - COMMAND ${QT_LUPDATE_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/src" -ts "${CMAKE_CURRENT_SOURCE_DIR}/i18n/messages/bibletime_ui.ts") + COMMAND ${QT_LUPDATE_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/src" -ts "${TS_DIR}/bibletime_ui.ts") ADD_DEPENDENCIES(messages "messages_default") diff --git a/cmake/FindCLucene.cmake b/cmake/FindCLucene.cmake index 173f69d..0930d95 100644 --- a/cmake/FindCLucene.cmake +++ b/cmake/FindCLucene.cmake @@ -4,135 +4,81 @@ # 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_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) +INCLUDE(KDE4FindLibraryWithDebug) -SET(TRIAL_LIBRARY_PATHS - $ENV{CLUCENE_HOME}/lib${LIB_SUFFIX} - ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} - /usr/lib/i386-linux-gnu - /usr/lib/x86_64-linux-gnu - /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 - /opt/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}) +IF(NOT CLucene_MIN_VERSION) + SET(CLucene_MIN_VERSION "0.9.19") +ENDIF() -IF (CLUCENE_INCLUDE_DIR) - MESSAGE(STATUS "Found CLucene include dir: ${CLUCENE_INCLUDE_DIR}") -ENDIF (CLUCENE_INCLUDE_DIR) +FIND_LIBRARY_WITH_DEBUG(CLucene_LIBRARY + NAMES clucene clucene-core clucene-cored) +IF(CLucene_LIBRARY) + MESSAGE(STATUS "Found CLucene library: ${CLucene_LIBRARY}") +ENDIF() +FIND_PATH(CLucene_INCLUDE_DIR NAMES CLucene.h) -IF(WIN32) - SET(TRIAL_LIBRARY_PATHS ${CLUCENE_INCLUDE_DIR}) -ENDIF(WIN32) +IF(CLucene_INCLUDE_DIR) + MESSAGE(STATUS "Found CLucene include dir: ${CLucene_INCLUDE_DIR}") +ENDIF() -SET(CLUCENE_GOOD_VERSION TRUE) +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 VERSION_LESS "${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 VERSION_LESS "${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") - IF (CLUCENE_VERSION VERSION_GREATER "2.0.0") - ADD_DEFINITIONS(-DCLUCENE2) - FIND_LIBRARY_WITH_DEBUG(CLUCENE_SHARED_LIB - NAMES clucene-shared - PATHS ${TRIAL_LIBRARY_PATHS}) +# Work around clucene-config.h being installed in weird places on some distros: +GET_FILENAME_COMPONENT(CLucene_LIBRARY_DIR_HINTS "${CLucene_LIBRARY}" PATH) - IF (CLUCENE_SHARED_LIB) - MESSAGE(STATUS "Found CLucene shared library: ${CLUCENE_SHARED_LIB}") - SET(CLUCENE_LIBRARY ${CLUCENE_LIBRARY} ${CLUCENE_SHARED_LIB}) - ELSE (CLUCENE_SHARED_LIB) - MESSAGE(FATAL_ERROR "Unable to find CLucene shared library.") - SET(CLUCENE_GOOD_VERSION FALSE) - ENDIF(CLUCENE_SHARED_LIB) - ENDIF (CLUCENE_VERSION VERSION_GREATER "2.0.0") - ENDIF (CLMATCH) -ELSE (CLUCENE_LIBRARY_DIR) - MESSAGE(STATUS "CLucene library dir not found.") -ENDIF (CLUCENE_LIBRARY_DIR) +FIND_PATH(CLucene_LIBRARY_DIR + NAMES "CLucene/clucene-config.h" + HINTS "${CLucene_LIBRARY_DIR_HINTS}") +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 VERSION_LESS "${CLucene_MIN_VERSION}") + MESSAGE(ERROR " CLucene version ${CLucene_VERSION} is less than the required minimum ${CLucene_MIN_VERSION}") + SET(CLucene_GOOD_VERSION FALSE) + ENDIF() + IF(CLucene_VERSION VERSION_GREATER "2.0.0") + ADD_DEFINITIONS(-DCLUCENE2) + FIND_LIBRARY_WITH_DEBUG(CLucene_SHARED_LIB + NAMES clucene-shared clucene-sharedd) + IF(CLucene_SHARED_LIB) + MESSAGE(STATUS "Found CLucene shared library: ${CLucene_SHARED_LIB}") + SET(CLucene_LIBRARY ${CLucene_LIBRARY} ${CLucene_SHARED_LIB}) + ELSE() + MESSAGE(FATAL_ERROR "Unable to find CLucene shared library.") + SET(CLucene_GOOD_VERSION FALSE) + ENDIF() + ENDIF() + ENDIF() +ELSE() + MESSAGE(STATUS "CLucene library dir not found.") +ENDIF() -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_INCLUDE_DIR AND CLucene_LIBRARY AND CLucene_LIBRARY_DIR AND CLucene_GOOD_VERSION) + SET(CLucene_FOUND TRUE) +ENDIF() 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) + IF(NOT CLucene_FIND_QUIETLY) + MESSAGE(STATUS "Found CLucene: ${CLucene_LIBRARY}") + ENDIF() +ELSE() + IF(CLucene_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find CLucene.") + ENDIF() +ENDIF() -MARK_AS_ADVANCED( - CLUCENE_INCLUDE_DIR - CLUCENE_LIBRARY_DIR - CLUCENE_LIBRARY - ) +MARK_AS_ADVANCED(CLucene_INCLUDE_DIR CLucene_LIBRARY_DIR CLucene_LIBRARY) diff --git a/cmake/FindGit.cmake b/cmake/FindGit.cmake deleted file mode 100644 index 1e2e96e..0000000 --- a/cmake/FindGit.cmake +++ /dev/null @@ -1,70 +0,0 @@ -# Original source: -# PISM: a Parallel Ice Sheet Model, -# http://www.pism-docs.org/ -# http://svn.gna.org/viewcvs/*checkout*/pism/trunk/CMake/FindGit.cmake?rev=569 -# -# Licence: -# GPL-2, -# http://svn.gna.org/viewcvs/*checkout*/pism/trunk/COPYING?rev=569 - -SET(Git_FOUND FALSE) - -FIND_PROGRAM(Git_EXECUTABLE git DOC "git command line client") -MARK_AS_ADVANCED(Git_EXECUTABLE) - -IF(Git_EXECUTABLE) - SET(Git_FOUND TRUE) - MACRO(Git_WC_INFO dir prefix) - EXECUTE_PROCESS(COMMAND ${Git_EXECUTABLE} rev-list -n 1 HEAD - WORKING_DIRECTORY ${dir} - RESULT_VARIABLE Git_result - OUTPUT_VARIABLE ${prefix}_WC_REVISION_HASH - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET) - IF(NOT ((${Git_result} EQUAL 0) AND (NOT ${${prefix}_WC_REVISION_HASH} MATCHES "^$"))) - # MESSAGE(STATUS "Unable to find a git setup.") - UNSET(${prefix}_WC_REVISION_HASH) - ELSE(NOT ((${Git_result} EQUAL 0) AND (NOT ${${prefix}_WC_REVISION_HASH} MATCHES "^$"))) - EXECUTE_PROCESS(COMMAND ${Git_EXECUTABLE} rev-list -n 1 --abbrev-commit HEAD - WORKING_DIRECTORY ${dir} - RESULT_VARIABLE Git_result - OUTPUT_VARIABLE ${prefix}_WC_REVISION_HASH_SHORT - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET) - # MESSAGE(STATUS "Found git HEAD: ${${prefix}_WC_REVISION_HASH_SHORT}") - EXECUTE_PROCESS(COMMAND ${Git_EXECUTABLE} rev-list --grep=git-svn-id: -n 1 HEAD - WORKING_DIRECTORY ${dir} - RESULT_VARIABLE Git_result2 - OUTPUT_VARIABLE ${prefix}_WC_SVN_REVISION_HASH - OUTPUT_STRIP_TRAILING_WHITESPACE) - IF(NOT ((${Git_result2} EQUAL 0) AND (NOT ${${prefix}_WC_SVN_REVISION_HASH} MATCHES "^$"))) - # MESSAGE(STATUS "Unable to find a git-svn setup.") - UNSET(${prefix}_WC_SVN_REVISION_HASH) - ELSE(NOT ((${Git_result2} EQUAL 0) AND (NOT ${${prefix}_WC_SVN_REVISION_HASH} MATCHES "^$"))) - # MESSAGE(STATUS "Latest commit also in SVN is ${${prefix}_WC_REVISION_HASH}") - EXECUTE_PROCESS(COMMAND ${Git_EXECUTABLE} svn find-rev ${${prefix}_WC_SVN_REVISION_HASH} - WORKING_DIRECTORY ${dir} - RESULT_VARIABLE Git_result3 - OUTPUT_VARIABLE ${prefix}_WC_SVN_REVISION - OUTPUT_STRIP_TRAILING_WHITESPACE) - IF((${Git_result3} EQUAL 0) AND (NOT ${${prefix}_WC_SVN_REVISION} MATCHES "^$")) - # MESSAGE(STATUS " which is in SVN as revision ${${prefix}_WC_SVN_REVISION}") - ELSE((${Git_result3} EQUAL 0) AND (NOT ${${prefix}_WC_SVN_REVISION} MATCHES "^$")) - # MESSAGE(WARNING "Unable to determine the SVN revision number!") - UNSET(${prefix}_WC_SVN_REVISION) - ENDIF((${Git_result3} EQUAL 0) AND (NOT ${${prefix}_WC_SVN_REVISION} MATCHES "^$")) - ENDIF(NOT ((${Git_result2} EQUAL 0) AND (NOT ${${prefix}_WC_SVN_REVISION_HASH} MATCHES "^$"))) - ENDIF(NOT ((${Git_result} EQUAL 0) AND (NOT ${${prefix}_WC_REVISION_HASH} MATCHES "^$"))) - ENDMACRO(Git_WC_INFO) -ENDIF(Git_EXECUTABLE) - -IF(NOT Git_FOUND) - IF(NOT Git_FIND_QUIETLY) - MESSAGE(STATUS "Git was not found") - ELSE(NOT Git_FIND_QUIETLY) - if(Git_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Git was not found") - ENDIF(Git_FIND_REQUIRED) - ENDIF(NOT Git_FIND_QUIETLY) -ENDIF(NOT Git_FOUND) - diff --git a/cmake/FindICU.cmake b/cmake/FindICU.cmake deleted file mode 100644 index 9dff9f3..0000000 --- a/cmake/FindICU.cmake +++ /dev/null @@ -1,51 +0,0 @@ -# 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) diff --git a/cmake/FindSword.cmake b/cmake/FindSword.cmake index 17fbae2..1458765 100644 --- a/cmake/FindSword.cmake +++ b/cmake/FindSword.cmake @@ -1,145 +1,134 @@ -SET (REQUIRED_SWORD_VERSION 1.6.0) - -# This module looks for installed sword # -# It will define the following values -# SWORD_INCLUDE_DIR -# SWORD_LIBRARY -# SWORD_LIBRARY_DIR - -IF(MSVC) - SET(SWORD_WIN32_LIBRARY_PATH ../sword/lib/vcppmake/vc8/ICUDebug) - SET(SWORD_WIN32_INCLUDE_PATH ../sword/include) -ENDIF(MSVC) - -SET(TRIAL_LIBRARY_PATHS - $ENV{SWORD_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 - /usr/pkg/lib${LIB_SUFFIX} - ${SWORD_WIN32_LIBRARY_PATH} -) -SET(TRIAL_INCLUDE_PATHS - $ENV{SWORD_HOME}/include/sword - $ENV{SWORD_HOME}/include - ${CMAKE_INSTALL_PREFIX}/include/sword - ${CMAKE_INSTALL_PREFIX}/include - /usr/local/include/sword - /usr/local/include - /opt/local/include/sword - /opt/local/include - /usr/include/sword - /usr/include - /sw/include/sword - /sw/include - /usr/pkg/include/sword - /usr/pkg/include - ${SWORD_WIN32_INCLUDE_PATH} -) - -IF(MSVC) - FIND_LIBRARY(SWORD_LIBRARY NAMES libsword PATHS ${TRIAL_LIBRARY_PATHS}) -ELSE(MSVC) - FIND_LIBRARY(SWORD_LIBRARY sword NAMES libsword PATHS ${TRIAL_LIBRARY_PATHS}) -ENDIF(MSVC) - -IF (SWORD_LIBRARY) - MESSAGE(STATUS "Found Sword library: ${SWORD_LIBRARY}") -# SET(SWORD_LIBRARY "sword") -ELSE (SWORD_LIBRARY) - MESSAGE(FATAL_ERROR "Could not find the Sword library.") -ENDIF (SWORD_LIBRARY) - -FIND_PATH(SWORD_LIBRARY_DIR NAMES libsword.a libsword.la libsword.so libsword.lib PATHS ${TRIAL_LIBRARY_PATHS} ENV CMAKE_LIBRARY_PATH) -IF (SWORD_LIBRARY_DIR) - MESSAGE(STATUS "Found Sword library dir: ${SWORD_LIBRARY_DIR}") -ELSE (SWORD_LIBRARY_DIR) - MESSAGE(FATAL_ERROR "Could not find the Sword library dir.") -ENDIF (SWORD_LIBRARY_DIR) - -FIND_PATH(SWORD_INCLUDE_DIR NAMES swmgr.h PATHS ${TRIAL_INCLUDE_PATHS}) -IF (SWORD_INCLUDE_DIR) - MESSAGE(STATUS "Found Sword include dir: ${SWORD_INCLUDE_DIR}") -ELSE (SWORD_INCLUDE_DIR) - MESSAGE(FATAL_ERROR "Sword include dir could not be found.") -ENDIF (SWORD_INCLUDE_DIR) - +# In the name of the Father, and of the Son, and of the Holy Spirit. +# +# This file is part of BibleTime's source code, http://www.bibletime.info/. # -# Check for minimum Sword version +# Copyright 1999-2014 by the BibleTime developers. +# The BibleTime source code is licensed under the GNU General Public License version 2.0. # -MACRO(CHECK_SWORD_VERSION VERSION) - IF(MSVC) - SET(CHECK_SWORD_VERSION_DEFINES "/DSWUSINGDLL") - ENDIF(MSVC) - TRY_RUN(SWVERSIONTEST_RUN_RESULT SWVERSIONTEST_COMPILE_RESULT - ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sword_version_compare.cpp - CMAKE_FLAGS - "-DINCLUDE_DIRECTORIES:STRING=${SWORD_INCLUDE_DIR}" - "-DLINK_DIRECTORIES:STRING=${SWORD_LIBRARY_DIR}" - "-DLINK_LIBRARIES:STRING=${SWORD_LIBRARY}" - ${SWORD_LIBRARY} - COMPILE_DEFINITIONS - ${CHECK_SWORD_VERSION_DEFINES} - COMPILE_OUTPUT_VARIABLE SWVERSIONTEST_COMPILE_OUTPUT - RUN_OUTPUT_VARIABLE SWVERSIONTEST_RUN_OUTPUT - ARGS ${VERSION} - ) - IF(NOT SWVERSIONTEST_COMPILE_RESULT) - MESSAGE(FATAL_ERROR "Sword version check program could NOT be compiled: ${SWVERSIONTEST_COMPILE_OUTPUT}") - ENDIF(NOT SWVERSIONTEST_COMPILE_RESULT) -ENDMACRO(CHECK_SWORD_VERSION VERSION) -MESSAGE(STATUS "Checking for required Sword version ${REQUIRED_SWORD_VERSION}...") -CHECK_SWORD_VERSION(${REQUIRED_SWORD_VERSION}) +# This module looks for the Sword library by the Crosswire Bible Society +# +# It might define the following values similarly to pkg_search_module() +# Sword_FOUND +# Sword_LIBRARIES +# Sword_LIBRARY_DIRS +# Sword_LDFLAGS +# Sword_LDFLAGS_OTHER +# Sword_INCLUDE_DIRS +# Sword_CFLAGS +# Sword_CFLAGS_OTHER +# Sword_VERSION -IF(SWVERSIONTEST_RUN_RESULT EQUAL 0) - MESSAGE(STATUS "Installed Sword version is ok. Check program said: ${SWVERSIONTEST_RUN_OUTPUT}") -ELSE(SWVERSIONTEST_RUN_RESULT EQUAL 0) - MESSAGE(FATAL_ERROR "Installed Sword version is NOT ok! Check program said: ${SWVERSIONTEST_RUN_OUTPUT}") -ENDIF(SWVERSIONTEST_RUN_RESULT EQUAL 0) +MACRO(FindSword_unset_all) + UNSET(Sword_FOUND) + UNSET(Sword_LIBRARIES) + UNSET(Sword_LIBRARY_DIRS) + UNSET(Sword_LDFLAGS) + UNSET(Sword_LDFLAGS_OTHER) + UNSET(Sword_INCLUDE_DIRS) + UNSET(Sword_CFLAGS) + UNSET(Sword_CFLAGS_OTHER) + UNSET(Sword_VERSION) +ENDMACRO() +FindSword_unset_all() -# -# Sword linker flag detection -# -MACRO(CHECK_SWORD_LINK_LIBRARIES FLAGS) - IF(MSVC) - SET(CHECK_SWORD_CXX_FLAGS "/Zc:wchar_t- /MDd") - SET(CHECK_SWORD_LINK_DEFINES "/DSWUSINGDLL") - ELSE(MSVC) - SET(CHECK_SWORD_CXX_FLAGS "") - SET(CHECK_SWORD_LINK_DEFINES "") - ENDIF(MSVC) - TRY_COMPILE(SWLINKER_CHECK_COMPILE_RESULT - ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sword_linker_check.cpp - CMAKE_FLAGS - "-DINCLUDE_DIRECTORIES:STRING=${SWORD_INCLUDE_DIR}" - "-DLINK_DIRECTORIES:STRING=${SWORD_LIBRARY_DIR};${CLUCENE_LIBRARY_DIR}" - "-DLINK_LIBRARIES:STRING=${FLAGS}" - "-DCMAKE_CXX_FLAGS_DEBUG:STRING=${CHECK_SWORD_CXX_FLAGS}" - COMPILE_DEFINITIONS - ${CHECK_SWORD_LINK_DEFINES} - OUTPUT_VARIABLE SWLINKER_CHECK_COMPILE_OUTPUT -) -ENDMACRO(CHECK_SWORD_LINK_LIBRARIES FLAGS) +INCLUDE(FindPkgConfig) + +IF(PKG_CONFIG_FOUND) + # Workaround PKG_CONFIG_PATH set to include CMAKE_PREFIX_PATH paths: + IF(WIN32) + SET(FindSword_s ";") + ELSE() + SET(FindSword_s ":") + ENDIF() + FOREACH(d IN LISTS CMAKE_PREFIX_PATH) + SET(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}${FindSword_s}${d}/lib/pkgconfig${FindSword_s}${d}/share/pkgconfig${FindSword_s}${d}/lib32/pkgconfig${FindSword_s}${d}/lib64/pkgconfig") + ENDFOREACH() + UNSET(FindSword_s) + + IF(Sword_FIND_VERSION_EXACT) + SET(FindSword_Version_Comp "=") + ELSE() + SET(FindSword_Version_Comp ">=") + ENDIF() + pkg_search_module(Sword QUIET + "sword${FindSword_Version_Comp}${Sword_FIND_VERSION}" + "sword-${Sword_FIND_VERSION_MAJOR}${FindSword_Version_Comp}${Sword_FIND_VERSION}" + "sword-${Sword_FIND_VERSION_MAJOR}.${Sword_FIND_VERSION_MINOR}${FindSword_Version_Comp}${Sword_FIND_VERSION}" + "sword${Sword_FIND_VERSION_MAJOR}${FindSword_Version_Comp}${Sword_FIND_VERSION}" + "sword${Sword_FIND_VERSION_MAJOR}.${Sword_FIND_VERSION_MINOR}${FindSword_Version_Comp}${Sword_FIND_VERSION}") + UNSET(FindSword_Version_Comp) +ENDIF() -#CURL_LIBRARIES and ICU_LIBRARIES are optional, empty if not found -CHECK_SWORD_LINK_LIBRARIES("${CLUCENE_LIBRARY};${SWORD_LIBRARY};${CURL_LIBRARIES};${ICU_LIBRARIES};${ICU_I18N_LIBRARIES};${ZLIB_LIBRARIES}") +# If pkg-config fails we try this: +IF(NOT Sword_FOUND) + IF(NOT Sword_FIND_QUIETLY) + MESSAGE(WARNING "Falling back to manual Sword detection...") + ENDIF() + FIND_LIBRARY(FindSword_LIBS NAMES sword libsword) + IF(FindSword_LIBS) + FIND_PATH(FindSword_INCS NAMES "sword/swmgr.h") + IF(FindSword_INCS) + SET(FindSword_INCS "${FindSword_INCS}/sword") + TRY_RUN(RUN_RESULT COMPILE_RESULT + "${CMAKE_CURRENT_BINARY_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/sword_version_print.cpp" + CMAKE_FLAGS + "-DINCLUDE_DIRECTORIES:STRING=${FindSword_INCS}" + COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT + RUN_OUTPUT_VARIABLE RUN_OUTPUT) + IF(NOT COMPILE_RESULT) + IF(NOT Sword_FIND_QUIETLY) + MESSAGE(WARNING "Failed to compile Sword version check: ${COMPILE_OUTPUT}") + ENDIF() + ELSEIF(RUN_RESULT) + IF(NOT Sword_FIND_QUIETLY) + MESSAGE(WARNING "Failed to run Sword version check: ${COMPILE_OUTPUT}") + ENDIF() + ELSE() + SET(Sword_FOUND TRUE) + SET(Sword_VERSION "${RUN_OUTPUT}") + GET_FILENAME_COMPONENT(Sword_LIBRARY_DIRS "${FindSword_LIBS}" PATH) + SET(Sword_LIBRARIES "sword") + SET(Sword_LDFLAGS "-L${Sword_LIBRARY_DIRS};-l${Sword_LIBRARIES}") + SET(Sword_INCLUDE_DIRS "${FindSword_INCS}") + SET(Sword_CFLAGS "-I${Sword_INCLUDE_DIRS}") + ENDIF() + ENDIF() + UNSET(FindSword_INCS) + ENDIF() + UNSET(FindSword_LIBS) +ENDIF() -IF(SWLINKER_CHECK_COMPILE_RESULT) - MESSAGE(STATUS "Sword linker check compiled ok.") - # SWORD_LIBRARY can stay unchanged -ELSE(SWLINKER_CHECK_COMPILE_RESULT) - MESSAGE(STATUS "Sword linker check could NOT be compiled. It seems that you need additional libraries for the linker.") - MESSAGE(STATUS "Here is the detailed output of the compilation and linking process:") - MESSAGE(FATAL_ERROR "${SWLINKER_CHECK_COMPILE_OUTPUT}") -ENDIF(SWLINKER_CHECK_COMPILE_RESULT) +IF(Sword_FOUND) + SET(FindSword_Sword_FOUND "YES") +ENDIF() +INCLUDE(FindPackageHandleStandardArgs) +IF(CMAKE_VERSION VERSION_LESS 2.8.11) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sword + REQUIRED_VARS FindSword_Sword_FOUND + VERSION_VAR Sword_VERSION) + IF(SWORD_FOUND) + SET(Sword_FOUND TRUE) + ENDIF() + UNSET(SWORD_FOUND) +ELSE() + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sword + FOUND_VAR Sword_FOUND + REQUIRED_VARS FindSword_Sword_FOUND + VERSION_VAR Sword_VERSION) +ENDIF() +UNSET(FindSword_Sword_FOUND) -MARK_AS_ADVANCED( - SWORD_INCLUDE_DIR - SWORD_LIBRARY - SWORD_LIBRARY_DIR -) +IF(Sword_FOUND AND NOT Sword_FIND_QUIETLY) + MESSAGE(STATUS "Sword ${Sword_VERSION} details:") + MESSAGE(STATUS " CFLAGS: ${Sword_CFLAGS}") + MESSAGE(STATUS " INCLUDE_DIRS: ${Sword_INCLUDE_DIRS}") + MESSAGE(STATUS " CFLAGS_OTHER: ${Sword_CFLAGS_OTHER}") + MESSAGE(STATUS " LDFLAGS: ${Sword_LDFLAGS}") + MESSAGE(STATUS " LIBRARIES: ${Sword_LIBRARIES}") + MESSAGE(STATUS " LIBRARY_DIRS: ${Sword_LIBRARY_DIRS}") + MESSAGE(STATUS " LDFLAGS_OTHER: ${Sword_LDFLAGS_OTHER}") +ENDIF() diff --git a/cmake/FindLibraryWithDebug.cmake b/cmake/KDE4FindLibraryWithDebug.cmake index 0844a1e..0844a1e 100644 --- a/cmake/FindLibraryWithDebug.cmake +++ b/cmake/KDE4FindLibraryWithDebug.cmake diff --git a/cmake/platforms/linux/bibletime.desktop.cmake b/cmake/platforms/linux/bibletime.desktop.cmake index e97d80b..f3c0849 100644 --- a/cmake/platforms/linux/bibletime.desktop.cmake +++ b/cmake/platforms/linux/bibletime.desktop.cmake @@ -11,14 +11,14 @@ Comment[it]=Un semplice strumento per studiare la Bibbia Exec=bibletime Icon=bibletime MimeType= -Name=BibleTime ${BT_VERSION} -Name[C]=BibleTime ${BT_VERSION} -Name[cs]=BibleTime ${BT_VERSION} -Name[da]=Bibletime ${BT_VERSION} -Name[de]=BibleTime ${BT_VERSION} -Name[et]=BibleTime ${BT_VERSION} -Name[fr]=BibleTime ${BT_VERSION} -Name[it]=BibleTime ${BT_VERSION} +Name=BibleTime @BT_VERSION@ +Name[C]=BibleTime @BT_VERSION@ +Name[cs]=BibleTime @BT_VERSION@ +Name[da]=Bibletime @BT_VERSION@ +Name[de]=BibleTime @BT_VERSION@ +Name[et]=BibleTime @BT_VERSION@ +Name[fr]=BibleTime @BT_VERSION@ +Name[it]=BibleTime @BT_VERSION@ GenericName=Bible Study Tool Terminal=false Type=Application diff --git a/cmake/platforms/macos/Info.plist b/cmake/platforms/macos/Info.plist index 5d69434..1417798 100644 --- a/cmake/platforms/macos/Info.plist +++ b/cmake/platforms/macos/Info.plist @@ -4,7 +4,23 @@ <dict> <key>CFBundleIconFile</key> <string>BibleTime.icns</string> + <key>CFBundleDevelopmentRegion</key> <string>English</string> + + <key>CFBundleName</key> + <string>BibleTime</string> + + <key>CFBundleDisplayName</key> + <string>BibleTime</string> + + <key>CFBundleIdentifier</key> + <string>info.bibletime.BibleTime</string> + + <key>CFBundlePackageType</key> + <string>APPL</string> + + <key>MDItemKeywords</key> + <string>BibleTime Bible bible time study</string> </dict> </plist> diff --git a/cmake/platforms/macos/bt_start.sh b/cmake/platforms/macos/bt_start.sh deleted file mode 100644 index ad3128a..0000000 --- a/cmake/platforms/macos/bt_start.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# Author: Gregory Hellings -# Copyright: BibleTime development team -# Initial creation date: 23 April 2009 -# This is a Mac-only shell script that makes it possible for us to avoid having to run -# lots of annoying commands on the Qt frameworks for the Mac build of BibleTime. -# It is inspired and draws heavily from th example at http://www.cmake.org/Wiki/CMake:CPackPackageGenerators - -BT_BUNDLE="`echo "$0" | sed -e 's/\/Contents\/MacOS\/BibleTime//'`" - -echo "running $0" -echo "BT_BUNDLE: $BT_BUNDLE" - -export DYLD_LIBRARY_PATH=$BT_BUNDLE/Contents/Resources/Library -export DYLD_FRAMEWORK_PATH=$BT_BUNDLE/Contents/Resources/Library/Frameworks -export PATH=$BT_BUNDLE/Contents/Resources/bin:$PATH -export QT_PLUGIN_PATH=$BT_BUNDLE/Contents/plugins - -cd $BT_BUNDLE/Contents/Resources/bin -# Run BibleTime -exec "BibleTime" diff --git a/cmake/platforms/windows/qt.conf b/cmake/platforms/windows/qt.conf new file mode 100644 index 0000000..dfc4208 --- /dev/null +++ b/cmake/platforms/windows/qt.conf @@ -0,0 +1,2 @@ +[Paths] +Plugins=plugins diff --git a/cmake/platforms/windows/rawfiles.cpp b/cmake/platforms/windows/rawfiles.cpp index 3901c22..25bbcac 100644 --- a/cmake/platforms/windows/rawfiles.cpp +++ b/cmake/platforms/windows/rawfiles.cpp @@ -1,13 +1,13 @@ /****************************************************************************** * rawfiles.cpp - code for class 'RawFiles'- a module that produces HTML HREFs - * pointing to actual text desired. Uses standard - * files: ot and nt using indexs ??.bks ??.cps ??.vss + * pointing to actual text desired. Uses standard + * files: ot and nt using indexs ??.bks ??.cps ??.vss * * * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org) - * CrossWire Bible Society - * P. O. Box 2528 - * Tempe, AZ 85280-2528 + * CrossWire Bible Society + * P. O. Box 2528 + * Tempe, AZ 85280-2528 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -35,9 +35,9 @@ SWORD_NAMESPACE_START /****************************************************************************** * RawFiles Constructor - Initializes data for instance of RawFiles * - * ENT: iname - Internal name for module - * idesc - Name to display to user for module - * idisp - Display object to use for displaying + * ENT: iname - Internal name for module + * idesc - Name to display to user for module + * idisp - Display object to use for displaying */ RawFiles::RawFiles(const char *ipath, const char *iname, const char *idesc, SWDisplay *idisp, SWTextEncoding enc, SWTextDirection dir, SWTextMarkup mark, const char* ilang) : RawVerse(ipath, FileMgr::RDWR), SWCom(iname, idesc, idisp, enc, dir, mark, ilang) @@ -58,169 +58,169 @@ RawFiles::~RawFiles() * @return yes or no */ bool RawFiles::isWritable() { - return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR)); + return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR)); } /****************************************************************************** - * RawFiles::getRawEntry - Retrieve the unprocessed entry contents at - * the current key position of this module + * RawFiles::getRawEntry - Retrieve the unprocessed entry contents at + * the current key position of this module * * RET: entry contents */ SWBuf &RawFiles::getRawEntryBuf() { - FileDesc *datafile; - long start = 0; - unsigned short size = 0; - VerseKey *key = &getVerseKey(); - - findOffset(key->Testament(), key->TestamentIndex(), &start, &size); - - entryBuf = ""; - if (size) { - SWBuf tmpbuf = path; - tmpbuf += '/'; - readText(key->Testament(), start, size, entryBuf); - tmpbuf += entryBuf; - entryBuf = ""; - datafile = FileMgr::getSystemFileMgr()->open(tmpbuf.c_str(), FileMgr::RDONLY); - if (datafile->getFd() > 0) { - size = datafile->seek(0, SEEK_END); - char *tmpBuf = new char [ size + 1 ]; - memset(tmpBuf, 0, size + 1); - datafile->seek(0, SEEK_SET); - datafile->read(tmpBuf, size); - entryBuf = tmpBuf; - delete [] tmpBuf; -// preptext(entrybuf); - } - FileMgr::getSystemFileMgr()->close(datafile); - } - return entryBuf; + FileDesc *datafile; + long start = 0; + unsigned short size = 0; + VerseKey *key = &getVerseKey(); + + findOffset(key->Testament(), key->TestamentIndex(), &start, &size); + + entryBuf = ""; + if (size) { + SWBuf tmpbuf = path; + tmpbuf += '/'; + readText(key->Testament(), start, size, entryBuf); + tmpbuf += entryBuf; + entryBuf = ""; + datafile = FileMgr::getSystemFileMgr()->open(tmpbuf.c_str(), FileMgr::RDONLY); + if (datafile->getFd() > 0) { + size = datafile->seek(0, SEEK_END); + char *tmpBuf = new char [ size + 1 ]; + memset(tmpBuf, 0, size + 1); + datafile->seek(0, SEEK_SET); + datafile->read(tmpBuf, size); + entryBuf = tmpBuf; + delete [] tmpBuf; +// preptext(entrybuf); + } + FileMgr::getSystemFileMgr()->close(datafile); + } + return entryBuf; } /****************************************************************************** * RawFiles::setEntry(char *)- Update the module's current key entry with - * provided text + * provided text */ void RawFiles::setEntry(const char *inbuf, long len) { - FileDesc *datafile; - long start; - unsigned short size; - VerseKey *key = &getVerseKey(); - - len = (len<0)?strlen(inbuf):len; - - findOffset(key->Testament(), key->TestamentIndex(), &start, &size); - - if (size) { - SWBuf tmpbuf; - entryBuf = path; - entryBuf += '/'; - readText(key->Testament(), start, size, tmpbuf); - entryBuf += tmpbuf; - } - else { - SWBuf tmpbuf; - entryBuf = path; - entryBuf += '/'; - tmpbuf = getNextFilename(); - doSetText(key->Testament(), key->TestamentIndex(), tmpbuf); - entryBuf += tmpbuf; - } - datafile = FileMgr::getSystemFileMgr()->open(entryBuf, FileMgr::CREAT|FileMgr::WRONLY|FileMgr::TRUNC); - if (datafile->getFd() > 0) { - datafile->write(inbuf, len); - } - FileMgr::getSystemFileMgr()->close(datafile); + FileDesc *datafile; + long start; + unsigned short size; + VerseKey *key = &getVerseKey(); + + len = (len<0)?strlen(inbuf):len; + + findOffset(key->Testament(), key->TestamentIndex(), &start, &size); + + if (size) { + SWBuf tmpbuf; + entryBuf = path; + entryBuf += '/'; + readText(key->Testament(), start, size, tmpbuf); + entryBuf += tmpbuf; + } + else { + SWBuf tmpbuf; + entryBuf = path; + entryBuf += '/'; + tmpbuf = getNextFilename(); + doSetText(key->Testament(), key->TestamentIndex(), tmpbuf); + entryBuf += tmpbuf; + } + datafile = FileMgr::getSystemFileMgr()->open(entryBuf, FileMgr::CREAT|FileMgr::WRONLY|FileMgr::TRUNC); + if (datafile->getFd() > 0) { + datafile->write(inbuf, len); + } + FileMgr::getSystemFileMgr()->close(datafile); } /****************************************************************************** * RawFiles::linkEntry(SWKey *)- Link the modules current key entry with - * another module entry + * another module entry * * RET: *this */ void RawFiles::linkEntry(const SWKey *inkey) { - long start; - unsigned short size; - const VerseKey *key = &getVerseKey(); + long start; + unsigned short size; + const VerseKey *key = &getVerseKey(); - findOffset(key->Testament(), key->TestamentIndex(), &start, &size); + findOffset(key->Testament(), key->TestamentIndex(), &start, &size); - if (size) { - SWBuf tmpbuf; - readText(key->Testament(), start, size + 2, tmpbuf); + if (size) { + SWBuf tmpbuf; + readText(key->Testament(), start, size + 2, tmpbuf); - key = &getVerseKey(inkey); - doSetText(key->Testament(), key->TestamentIndex(), tmpbuf.c_str()); - } + key = &getVerseKey(inkey); + doSetText(key->Testament(), key->TestamentIndex(), tmpbuf.c_str()); + } } /****************************************************************************** - * RawFiles::deleteEntry - deletes this entry + * RawFiles::deleteEntry - deletes this entry * * RET: *this */ void RawFiles::deleteEntry() { - VerseKey *key = &getVerseKey(); - doSetText(key->Testament(), key->TestamentIndex(), ""); + VerseKey *key = &getVerseKey(); + doSetText(key->Testament(), key->TestamentIndex(), ""); } /****************************************************************************** * RawFiles::getNextfilename - generates a valid filename in which to store - * an entry + * an entry * * RET: filename */ const char *RawFiles::getNextFilename() { - static SWBuf incfile; - __u32 number = 0; - FileDesc *datafile; - - incfile.setFormatted("%s/incfile", path); - datafile = FileMgr::getSystemFileMgr()->open(incfile, FileMgr::RDONLY); - if (datafile->getFd() != -1) { - if (datafile->read(&number, 4) != 4) number = 0; - number = swordtoarch32(number); - } - number++; - FileMgr::getSystemFileMgr()->close(datafile); - - datafile = FileMgr::getSystemFileMgr()->open(incfile, FileMgr::CREAT|FileMgr::WRONLY|FileMgr::TRUNC); - incfile.setFormatted("%.7d", number-1); - - number = archtosword32(number); - datafile->write(&number, 4); - - FileMgr::getSystemFileMgr()->close(datafile); - return incfile; + static SWBuf incfile; + __u32 number = 0; + FileDesc *datafile; + + incfile.setFormatted("%s/incfile", path); + datafile = FileMgr::getSystemFileMgr()->open(incfile, FileMgr::RDONLY); + if (datafile->getFd() != -1) { + if (datafile->read(&number, 4) != 4) number = 0; + number = swordtoarch32(number); + } + number++; + FileMgr::getSystemFileMgr()->close(datafile); + + datafile = FileMgr::getSystemFileMgr()->open(incfile, FileMgr::CREAT|FileMgr::WRONLY|FileMgr::TRUNC); + incfile.setFormatted("%.7d", number-1); + + number = archtosword32(number); + datafile->write(&number, 4); + + FileMgr::getSystemFileMgr()->close(datafile); + return incfile; } char RawFiles::createModule(const char *path) { - char *incfile = new char [ strlen (path) + 16 ]; + char *incfile = new char [ strlen (path) + 16 ]; - __u32 zero = 0; - zero = archtosword32(zero); + __u32 zero = 0; + zero = archtosword32(zero); - FileDesc *datafile; + FileDesc *datafile; - sprintf(incfile, "%s/incfile", path); - datafile = FileMgr::getSystemFileMgr()->open(incfile, FileMgr::CREAT|FileMgr::WRONLY|FileMgr::TRUNC); - delete [] incfile; - datafile->write(&zero, 4); - FileMgr::getSystemFileMgr()->close(datafile); + sprintf(incfile, "%s/incfile", path); + datafile = FileMgr::getSystemFileMgr()->open(incfile, FileMgr::CREAT|FileMgr::WRONLY|FileMgr::TRUNC); + delete [] incfile; + datafile->write(&zero, 4); + FileMgr::getSystemFileMgr()->close(datafile); return RawVerse::createModule (path); } diff --git a/cmake/platforms/windows/rawfiles.h b/cmake/platforms/windows/rawfiles.h index 014f40d..4903788 100644 --- a/cmake/platforms/windows/rawfiles.h +++ b/cmake/platforms/windows/rawfiles.h @@ -1,14 +1,14 @@ /****************************************************************************** * rawfiles.h - code for class 'RawFiles'- a module that produces HTML HREFs - * pointing to actual text desired. Uses standard - * files: ot and nt using indexs ??.bks ??.cps ??.vss + * pointing to actual text desired. Uses standard + * files: ot and nt using indexs ??.bks ??.cps ??.vss * * $Id: rawfiles.h 2599 2011-02-12 05:11:09Z scribe $ * * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org) - * CrossWire Bible Society - * P. O. Box 2528 - * Tempe, AZ 85280-2528 + * CrossWire Bible Society + * P. O. Box 2528 + * Tempe, AZ 85280-2528 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -33,52 +33,52 @@ SWORD_NAMESPACE_START class SWDLLEXPORT RawFiles : public RawVerse, public SWCom { - const char *getNextFilename(); + const char *getNextFilename(); public: - RawFiles(const char *ipath, const char *iname = 0, const char *idesc = 0, - SWDisplay *idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, - SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, - const char *ilang = 0); - virtual ~RawFiles(); - virtual SWBuf &getRawEntryBuf(); - - // write interface ---------------------------- - /** Is the module writable? :) - * @return yes or no - */ - virtual bool isWritable(); - - /** Creates a new module - * @param path The first parameter is path of the new module - * @return error - */ - static char createModule(const char *); - - /** Modify the current module entry text - * - only if module @ref isWritable - * @return *this - */ - virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry - - /** Link the current module entry to another module entry - * - only if module @ref isWritable - * @return *this - */ - virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry - - /** Delete current module entry - only if module @ref isWritable - * - */ - virtual void deleteEntry(); - // end write interface ------------------------ - - - // OPERATORS ----------------------------------------------------------------- - - SWMODULE_OPERATORS + RawFiles(const char *ipath, const char *iname = 0, const char *idesc = 0, + SWDisplay *idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, + SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, + const char *ilang = 0); + virtual ~RawFiles(); + virtual SWBuf &getRawEntryBuf(); + + // write interface ---------------------------- + /** Is the module writable? :) + * @return yes or no + */ + virtual bool isWritable(); + + /** Creates a new module + * @param path The first parameter is path of the new module + * @return error + */ + static char createModule(const char *); + + /** Modify the current module entry text + * - only if module @ref isWritable + * @return *this + */ + virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry + + /** Link the current module entry to another module entry + * - only if module @ref isWritable + * @return *this + */ + virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry + + /** Delete current module entry - only if module @ref isWritable + * + */ + virtual void deleteEntry(); + // end write interface ------------------------ + + + // OPERATORS ----------------------------------------------------------------- + + SWMODULE_OPERATORS }; diff --git a/cmake/sword_linker_check.cpp b/cmake/sword_linker_check.cpp deleted file mode 100644 index 97d33b8..0000000 --- a/cmake/sword_linker_check.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/********* -* -* This file is part of BibleTime's source code, http://www.bibletime.info/. -* -* Copyright 1999-2008 by the BibleTime developers. -* The BibleTime source code is licensed under the GNU General Public License version 2.0. -* -**********/ - -/* - * Use some important Sword classes to see if the linker flags work correctly - */ - -#include <iostream> - -#include <swmgr.h> -#include <installmgr.h> -#include <ftptrans.h> - -int main(int argc, char* argv[]) -{ - sword::SWMgr mgr; - sword::InstallMgr imgr; - sword::FTPTransport trans("example.com"); - - return 0; -} diff --git a/cmake/sword_version_compare.cpp b/cmake/sword_version_print.cpp index 1da9594..f9cc8e6 100644 --- a/cmake/sword_version_compare.cpp +++ b/cmake/sword_version_print.cpp @@ -12,12 +12,13 @@ */ #include <iostream> - #include <swversion.h> -int main(int argc, char* argv[]) -{ - sword::SWVersion testversion(argv[1]); - std::cout << "Your installed Sword version is: " << sword::SWVersion::currentVersion.getText(); - return (sword::SWVersion::currentVersion >= testversion) ? 0 : 1; +#ifndef SWORD_VERSION_STR +#error SWORD_VERSION_STR not defined! +#endif + +int main() { + std::cout << (SWORD_VERSION_STR); + return 0; } |