diff -Nru texworks-0.4.3~svn858~natty1/CMake/docs/html/docs/CMake/packaging/CMakeLists.html texworks-0.4.4~svn1004~natty1/CMake/docs/html/docs/CMake/packaging/CMakeLists.html --- texworks-0.4.3~svn858~natty1/CMake/docs/html/docs/CMake/packaging/CMakeLists.html 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/docs/html/docs/CMake/packaging/CMakeLists.html 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,151 @@ + + +
+ +CMake/packaging/CMakeLists.txt |
+ + |
---|---|
+
+ ¶
+
+
+ Packaging Tasks+ |
+
+
+ |
+
+
+ ¶
+
+
+ Create a CMake script containing packaging tasks specific to Apple. All
+variables of the form |
+
+ IF ( APPLE )
+ CONFIGURE_FILE(
+ ${PROJECT_SOURCE_DIR}/cmake/packaging/mac/MacPackagingTasks.cmake.in
+ ${PROJECT_BINARY_DIR}/CPackPackagingTasks.cmake
+ @ONLY
+ )
+ELSE () |
+
+
+ ¶
+
+
+ Create a dummy script for other platforms. + |
+
+ FILE(WRITE ${PROJECT_BINARY_DIR}/CPackPackagingTasks.cmake "")
+ENDIF () |
+
+
+ ¶
+
+
+ Execute the packaging tasks. |
+
+ INSTALL(SCRIPT ${PROJECT_BINARY_DIR}/CPackPackagingTasks.cmake) |
+
CMake/packaging/mac/MacPackagingTasks.cmake.in |
+ + |
---|---|
+
+ ¶
+
+
+ OS X packaging tasks + |
+
+
+ |
+
+
+ ¶
+
+
+ This file is processed by |
+
+ SET(PROJECT_NAME @PROJECT_NAME@)
+SET(PROJECT_SOURCE_DIR @PROJECT_SOURCE_DIR@)
+SET(PROJECT_BINARY_DIR @PROJECT_BINARY_DIR@)
+SET(TeXworks_LIB_DIRS @TeXworks_LIB_DIRS@)
+SET(CMAKE_SHARED_LIBRARY_SUFFIX @CMAKE_SHARED_LIBRARY_SUFFIX@)
+SET(QT_PLUGINS @QT_PLUGINS@) |
+
+
+ ¶
+
+
+ This |
+
+ IF ( ${CMAKE_INSTALL_PREFIX} MATCHES .*/_CPack_Packages/.* ) |
+
+
+ ¶
+
+
+ Download and install Poppler data+ |
+
+ IF ( NOT EXISTS ${PROJECT_SOURCE_DIR}/poppler-data-0.4.4.tar.gz )
+ MESSAGE(STATUS "Downloading Poppler data files")
+ FILE(DOWNLOAD "http://poppler.freedesktop.org/poppler-data-0.4.4.tar.gz"
+ ${PROJECT_SOURCE_DIR}/poppler-data-0.4.4.tar.gz
+ EXPECTED_MD5 f3a1afa9218386b50ffd262c00b35b31
+ SHOW_PROGRESS
+ )
+ ENDIF ()
+
+ IF ( NOT EXISTS ${PROJECT_SOURCE_DIR}/poppler-data-0.4.4 )
+ EXECUTE_PROCESS(COMMAND tar xzf ${PROJECT_SOURCE_DIR}/poppler-data-0.4.4.tar.gz
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+ )
+ ENDIF ()
+
+ FILE(INSTALL ${PROJECT_SOURCE_DIR}/poppler-data-0.4.4/
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app/Contents/poppler-data
+ PATTERN CMakeLists.txt EXCLUDE
+ PATTERN Makefile EXCLUDE
+ ) |
+
+
+ ¶
+
+
+ Download and install TeXworks manual+ |
+
+ IF ( NOT EXISTS ${PROJECT_SOURCE_DIR}/TeXworks-manual-html-r814.zip )
+ MESSAGE(STATUS "Downloading TeXworks HTML manual")
+ FILE(DOWNLOAD "http://texworks.googlecode.com/files/TeXworks-manual-html-r814.zip"
+ ${PROJECT_SOURCE_DIR}/TeXworks-manual-html-r814.zip
+ EXPECTED_MD5 2894969a6ac4bba31953264e04553717
+ SHOW_PROGRESS
+ )
+ ENDIF ()
+
+ IF ( NOT EXISTS ${PROJECT_SOURCE_DIR}/TeXworks-manual )
+ EXECUTE_PROCESS(COMMAND unzip ${PROJECT_SOURCE_DIR}/TeXworks-manual-html-r814.zip
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+ )
+ ENDIF ()
+
+ FILE(INSTALL ${PROJECT_SOURCE_DIR}/TeXworks-manual
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app/Contents/texworks-help/
+ ) |
+
+
+ ¶
+
+
+ Copy all runtime dependencies and rewrite loader paths+ |
+
+
+ |
+
+
+ ¶
+
+
+ Bring in This module offers the
|
+
+ SET(CMAKE_MODULE_PATH @CMAKE_MODULE_PATH@)
+ INCLUDE(DeployQt4) |
+
+
+ ¶
+
+
+ Gather all TeXworks Plugin libraries. + |
+
+ FILE(GLOB TeXworks_PLUGINS
+ ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app/Contents/PlugIns/*${CMAKE_SHARED_LIBRARY_SUFFIX}) |
+
+
+ ¶
+
+
+ If |
+
+ SET(BU_CHMOD_BUNDLE_ITEMS ON)
+
+ FIXUP_QT4_BUNDLE(${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app "${QT_PLUGINS}" "${TeXworks_PLUGINS}" "${TeXworks_LIB_DIRS}") |
+
+
+ ¶
+
+
+ Remove unecessary architectures from universal binaries+ |
+
+
+ |
+
+
+ ¶
+
+
+ Some libraries copied from the OS X system, such as X11 libraries, may
+contain up to 4 different architectures. Here we will iterate over these
+libraries and use |
+
+
+ |
+
+
+ ¶
+
+
+ Another useful function from |
+
+ GET_BUNDLE_MAIN_EXECUTABLE(${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app APP_MAIN) |
+
+
+ ¶
+
+
+ We look at the TeXworks binary that was built rather than consulting the
+value of the |
+
+ MESSAGE(STATUS "Reducing the size of bundled libraries.")
+ MESSAGE(STATUS "Scanning architectures of: ${APP_MAIN}")
+ EXECUTE_PROCESS( |
+
+
+ ¶
+
+
+
+
+Piping this output to |
+
+ COMMAND lipo -info ${APP_MAIN}
+ COMMAND cut -d : -f 3-
+ OUTPUT_VARIABLE APP_ARCHS
+ ) |
+
+
+ ¶
+
+
+ Strip leading and trailing whitespace. + |
+
+ STRING(STRIP ${APP_ARCHS} APP_ARCHS) |
+
+
+ ¶
+
+
+ Convert spaces to semicolons so CMake will interpret the string as a list. + |
+
+ STRING(REPLACE " " ";" APP_ARCHS ${APP_ARCHS})
+
+ MESSAGE(STATUS "Will reduce bundled libraries to: ${APP_ARCHS}")
+
+ FOREACH(ARCH IN LISTS APP_ARCHS)
+ SET(ARCHS_TO_EXTRACT "${ARCHS_TO_EXTRACT} -extract ${ARCH}")
+ ENDFOREACH () |
+
+
+ ¶
+
+
+ NOTE: This will not process any dylibs from Frameworks copied by
+ |
+
+ FILE(GLOB BUNDLED_DYLIBS
+ ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app/Contents/MacOS/*${CMAKE_SHARED_LIBRARY_SUFFIX})
+
+ FOREACH(DYLIB IN LISTS BUNDLED_DYLIBS)
+ MESSAGE(STATUS "Processing included library: ${DYLIB}") |
+
+
+ ¶
+
+
+
|
+
+ EXECUTE_PROCESS(COMMAND bash -c "lipo ${ARCHS_TO_EXTRACT} ${DYLIB} -output ${DYLIB}")
+ ENDFOREACH ()
+
+ MESSAGE(STATUS "Finished stripping architectures from bundled libraries.")
+
+ENDIF () |
+
CMakeLists.txt |
+ + |
---|---|
+
+ ¶
+
+
+ Top-level build file for TeXworks, a simple editor for TeX and friends. + +This buildsystem uses CMake and consists of the following files: + ++ TeXworks + ├── CMakeLists.txt + ├── src + │ └── CMakeLists.txt + ├── plugins-src + │ ├── TWLuaPlugin + │ │ └── CMakeLists.txt + │ └── TWPythonPlugin + │ └── CMakeLists.txt + └── CMake + └── packaging + ├── CMakeLists.html + └── mac + └── MacPackagingTasks.cmake.in ++ + Using CMake as a buildsystem offers some nice advantages: + +
Comments in the CMake files follow Markdown formatting conventions.
+This convention allows the |
+
+
+ |
+
+
+ ¶
+
+
+ Setup and User Options+ |
+
+
+ |
+
+
+ ¶
+
+
+ Set project name. + |
+
+ PROJECT(TeXworks) |
+
+
+ ¶
+
+
+ We require CMake v2.8 or greater because it is the first version that +provides support for certain parts of Qt, such as the ScriptTools. + |
+
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+SET(CMAKE_COLOR_MAKEFILE ON) |
+
+
+ ¶
+
+
+ Always add the current source and binary directories to the header include +path when compiling. + |
+
+ SET(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+IF ( WIN32 )
+ MESSAGE( WARNING
+ "The CMake build system has only been tested on Mac OS X and Linux."
+ "\nIt probably won't work on Windows. Patches containing fixes are"
+ "\nwelcomed at:"
+ "\n https://github.com/Sharpie/TeXworks"
+ )
+ENDIF () |
+
+
+ ¶
+
+
+ Determine Version Numbers+ |
+
+
+ |
+
+
+ ¶
+
+
+ The values recovered here are used in the filenames of packaged builds and +influence parts of the application such as the “About” dialog. + |
+
+
+ |
+
+
+ ¶
+
+
+ Recover canonical (x.y.z) version number from |
+
+ FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/TWVersion.h TeXworks_VER_MAJOR REGEX "VER_MAJOR")
+STRING(REGEX MATCH "([0-9]+)" TeXworks_VER_MAJOR ${TeXworks_VER_MAJOR})
+FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/TWVersion.h TeXworks_VER_MINOR REGEX "VER_MINOR")
+STRING(REGEX MATCH "([0-9]+)" TeXworks_VER_MINOR ${TeXworks_VER_MINOR})
+FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/TWVersion.h TeXworks_VER_PATCH REGEX "VER_BUGFIX")
+STRING(REGEX MATCH "([0-9]+)" TeXworks_VER_PATCH ${TeXworks_VER_PATCH})
+SET(TeXworks_VERSION ${TeXworks_VER_MAJOR}.${TeXworks_VER_MINOR}.${TeXworks_VER_PATCH}) |
+
+
+ ¶
+
+
+ Recover SVN revision from |
+
+ FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/SvnRev.h TeXworks_SVN_REV LIMIT_COUNT 1)
+STRING(REGEX MATCH "([0-9]+)" TeXworks_SVN_REV ${TeXworks_SVN_REV}) |
+
+
+ ¶
+
+
+ Declare Project Options+ |
+
+
+ |
+
+
+ ¶
+
+
+ These are options that users can set at configure-time to determine how the +application is built and what functionalities it will have. Here we declare +these options by setting default values. + |
+
+ SET(TW_BUILD_ID "personal" CACHE STRING "A distribution-specific identifier for TeXworks") |
+
+
+ ¶
+
+
+ On UNIX, CMake installs to |
+
+ IF( APPLE AND CMAKE_INSTALL_PREFIX MATCHES "/usr/local" )
+ SET( CMAKE_INSTALL_PREFIX "/Applications" )
+ENDIF() |
+
+
+ ¶
+
+
+ Do an optimized release build by default + |
+
+ IF ( NOT CMAKE_BUILD_TYPE )
+ SET(CMAKE_BUILD_TYPE "Release")
+ENDIF () |
+
+
+ ¶
+
+
+ Options controlling the creation of scripting language plugins. + |
+
+ OPTION(WITH_LUA "Build TeXworks Lua plugin?" ON)
+OPTION(WITH_PYTHON "Build TeXworks Python plugin?" ON) |
+
+
+ ¶
+
+
+ On OS X we default to linking against the Python libraries provided by Apple
+even if other Pythons are available. This helps when building
+re-distributable |
+
+ IF ( APPLE )
+ OPTION(USE_SYSTEM_PYTHON "Link against Python Framework distributed with OS X?" ON)
+ENDIF () |
+
+
+ ¶
+
+
+ Dependency Configuration+ |
+
+
+ |
+
+
+ ¶
+
+
+ Make the contents of |
+
+ SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/Modules ${CMAKE_MODULE_PATH}) |
+
+
+ ¶
+
+
+ Declare Qt libraries required by this project. + |
+
+ SET (QT_COMPONENTS
+ QtCore
+ QtGui
+ QtUiTools
+ QtScript
+ QtScriptTools
+ QtXML
+)
+
+IF ( UNIX AND NOT APPLE )
+ LIST(APPEND QT_COMPONENTS QtDbus)
+ENDIF () |
+
+
+ ¶
+
+
+ Locate Qt. |
+
+ FIND_PACKAGE(Qt4 COMPONENTS ${QT_COMPONENTS} REQUIRED)
+INCLUDE(UseQt4)
+
+FIND_PACKAGE(ZLIB REQUIRED)
+FIND_PACKAGE(Hunspell REQUIRED)
+FIND_PACKAGE(Poppler REQUIRED) |
+
+
+ ¶
+
+
+ The only thing Poppler should need is the location of the include directories +in order to access header files. The library loader should be able to find +libfontconfig on standard search paths. + |
+
+ IF ( POPPLER_NEEDS_FONTCONFIG )
+ FIND_PACKAGE(Fontconfig REQUIRED)
+ENDIF () |
+
+
+ ¶
+
+
+ Aggregate library names and include directories into variables for easy +access. + |
+
+ SET(TeXworks_INCLUDE_DIRS
+ ${QT_INCLUDE_DIR}
+ ${HUNSPELL_INCLUDE_DIR}
+ ${POPPLER_QT4_INCLUDE_DIR}
+ ${ZLIB_INCLUDE_DIR}
+)
+IF ( POPPLER_NEEDS_FONTCONFIG )
+ LIST(APPEND TeXworks_INCLUDE_DIRS ${FONTCONFIG_INCLUDE_DIR})
+ENDIF ()
+
+SET(TeXworks_LIB_DIRS ${QT_LIBRARY_DIR})
+
+SET(TeXworks_LIBS
+ ${QT_LIBRARIES}
+ ${POPPLER_LIBRARIES}
+ ${HUNSPELL_LIBRARIES}
+ ${ZLIB_LIBRARIES}
+) |
+
+
+ ¶
+
+
+ Configure Optional Dependencies+ |
+
+
+ |
+
+
+ ¶
+
+
+ CMake 2.8 has separate find scripts for Lua 5.1 and Lua 5.0. We assume that +the most recent Lua version is installed. + |
+
+ IF ( WITH_LUA )
+ FIND_PACKAGE(Lua51)
+ENDIF()
+
+IF ( WITH_PYTHON )
+ IF ( USE_SYSTEM_PYTHON )
+ SET(PYTHON_LIBRARIES "-F/System/Library/Frameworks -framework Python" CACHE PATH "Python library.")
+ SET(PYTHON_INCLUDE_DIR "/System/Library/Framework/Python.framework/Headers" CACHE PATH "Python framework.")
+ MARK_AS_ADVANCED(PYTHON_LIBRARIES)
+ MARK_AS_ADVANCED(PYTHON_INCLUDE_DIR)
+ SET(PYTHONLIBS_FOUND TRUE)
+ ELSE () |
+
+
+ ¶
+
+
+ NOTE For some reason, FindPythonLibs.cmake always seems to default to
+ |
+
+ FIND_PACKAGE(PythonLibs)
+ ENDIF ()
+ENDIF() |
+
+
+ ¶
+
+
+ Update Header Templates+ |
+
+
+ |
+
+
+ ¶
+
+
+ Some header files contain components that must be dynamically generated. For
+example, |
+
+ IF ( UNIX )
+ IF ( NOT EXISTS ${TeXworks_SOURCE_DIR}/src/DefaultBinaryPaths.h )
+ MESSAGE(STATUS "Generating DefaultBinaryPaths.h")
+
+ EXECUTE_PROCESS(
+ COMMAND ${TeXworks_SOURCE_DIR}/getDefaultBinPaths.sh
+ WORKING_DIRECTORY ${TeXworks_SOURCE_DIR}
+ )
+ ENDIF ()
+ENDIF () |
+
+
+ ¶
+
+
+ Building+ |
+
+
+ |
+
+
+ ¶
+
+
+ Build main TeXworks application+ |
+
+ ADD_SUBDIRECTORY(src) |
+
+
+ ¶
+
+
+ Build Plugins+ |
+
+
+ |
+
+
+ ¶
+
+
+ Set the plugin installation path. This is a good default for UNIX-like +systems, but is not appropriate for Windows. + |
+
+ SET(TeXworks_PLUGIN_DIR lib) |
+
+
+ ¶
+
+
+ On OS X, the plugins should live inside the application bundle. + |
+
+ IF ( APPLE )
+ SET(TeXworks_PLUGIN_DIR ${PROJECT_NAME}.app/Contents/PlugIns)
+ENDIF () |
+
+
+ ¶
+
+
+ Build scripting language plugins if the required libraries are available. + |
+
+ IF ( LUA51_FOUND )
+ ADD_SUBDIRECTORY(${TeXworks_SOURCE_DIR}/plugins-src/TWLuaPlugin)
+ENDIF ()
+
+IF ( PYTHONLIBS_FOUND )
+ ADD_SUBDIRECTORY(${TeXworks_SOURCE_DIR}/plugins-src/TWPythonPlugin)
+ENDIF () |
+
+
+ ¶
+
+
+ Packaging+ |
+
+
+ |
+
+
+ ¶
+
+
+ This section is responsible for executing all tasks that run when a user
+invokes
|
+
+
+ |
+
+
+ ¶
+
+
+ Gather all libraries related to Qt plugins used by TeXworks so that they can +be bundled into packages. + |
+
+ SET(QT_PLUGINS
+ ${QT_QTACCESSIBLEWIDGETS_PLUGIN_RELEASE}
+ ${QT_QCNCODECS_PLUGIN_RELEASE}
+ ${QT_QJPCODECS_PLUGIN_RELEASE}
+ ${QT_QKRCODECS_PLUGIN_RELEASE}
+ ${QT_QTWCODECS_PLUGIN_RELEASE}
+ ${QT_QGIF_PLUGIN_RELEASE}
+ ${QT_QJPEG_PLUGIN_RELEASE}
+ ${QT_QTIFF_PLUGIN_RELEASE}
+) |
+
+
+ ¶
+
+
+ The file |
+
+ ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/cmake/packaging) |
+
+
+ ¶
+
+
+ Set CPack variables. + |
+
+ SET(CPACK_PACKAGE_VERSION_MAJOR ${TeXworks_VER_MAJOR})
+SET(CPACK_PACKAGE_VERSION_MINOR ${TeXworks_VER_MINOR})
+SET(CPACK_PACKAGE_VERSION_PATCH ${TeXworks_VER_PATCH})
+SET(CPACK_PACKAGE_VERSION ${TeXworks_VERSION})
+
+SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
+SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}.${CPACK_PACKAGE_VERSION}-${TeXworks_SVN_REV}") |
+
+
+ ¶
+
+
+ Configure Drag N' Drop installer. + |
+
+ IF ( APPLE )
+ SET(MAC_PACK_BITS "${CMAKE_SOURCE_DIR}/cmake/packaging/mac")
+ SET(CPACK_GENERATOR DragNDrop)
+ SET( CPACK_DMG_BACKGROUND_IMAGE "${MAC_PACK_BITS}/texworks_dmg_background.png" ) |
+
+
+ ¶
+
+
+ Configure an AppleScript for applying a nice window layout to Drag N' Drop disk +image. + |
+
+ CONFIGURE_FILE( ${MAC_PACK_BITS}/set_dmg_layout.scpt.in
+ ${PROJECT_BINARY_DIR}/set_dmg_layout.scpt
+ @ONLY
+ )
+ENDIF ()
+
+INCLUDE(CPack) |
+
+
+ ¶
+
+
+ Summary+ |
+
+
+ |
+
+
+ ¶
+
+
+ This section displays a nice configuration summary for the user. + |
+
+
+ |
+
+
+ ¶
+
+
+ These macros borrowed from the Poppler CMake scripts. They add some nice +formatting to configuration info. + |
+
+ MACRO(CONFIG_INFO what value)
+ STRING(LENGTH ${what} length_what)
+ MATH(EXPR left_char "35 - ${length_what}")
+ SET(blanks)
+ FOREACH(_i RANGE 1 ${left_char})
+ SET(blanks "${blanks} ")
+ ENDFOREACH()
+
+ MESSAGE(" ${what}:${blanks} ${value}")
+ENDMACRO()
+
+MACRO(CONFIG_YESNO what enabled)
+ IF(${enabled})
+ SET(enabled_string "yes")
+ ELSE(${enabled})
+ SET(enabled_string "no")
+ ENDIF()
+
+ CONFIG_INFO("${what}" "${enabled_string}")
+ENDMACRO() |
+
+
+ ¶
+
+
+ Print out configuration summary. + + |
+
+ MESSAGE("TeXworks has been configured:\n")
+
+CONFIG_INFO("Version" ${TeXworks_VERSION})
+CONFIG_INFO("SVN Revision" ${TeXworks_SVN_REV})
+CONFIG_INFO("Build ID" ${TW_BUILD_ID})
+CONFIG_INFO("Compiler optimization" ${CMAKE_BUILD_TYPE})
+MESSAGE("")
+
+CONFIG_YESNO("Lua scripting plugin" LUA51_FOUND)
+CONFIG_YESNO("Python scripting plugin" PYTHONLIBS_FOUND)
+IF( APPLE )
+ CONFIG_YESNO(" OS X system python" USE_SYSTEM_PYTHON)
+ENDIF()
+MESSAGE("")
+
+MESSAGE(" TeXworks will be installed to:")
+MESSAGE(" ${CMAKE_INSTALL_PREFIX}")
+MESSAGE("") |
+
plugins-src/TWLuaPlugin/CMakeLists.txt |
+ + |
---|---|
+
+ ¶
+
+
+ Build Lua Plugin+ |
+
+ INCLUDE_DIRECTORIES(
+ ${TeXworks_SOURCE_DIR}/src
+ ${QT_INCLUDE_DIR}
+ ${LUA_INCLUDE_DIR}
+)
+
+LINK_DIRECTORIES(${QT_LIBRARY_DIR}) |
+
+
+ ¶
+
+
+ NOTE: Re-moccing headers from the main source directory that have +already been mocced during the build of the main program seems redundant, but +I’m not wise enough in the ways of Qt and CMake to figure out a good +alternative. + + |
+
+ QT4_WRAP_CPP(LUA_PLUGIN_MOC ${TeXworks_SCRIPT_API_H} TWLuaPlugin.h)
+
+ADD_LIBRARY(TWLuaPlugin SHARED
+ TWLuaPlugin.cpp
+ ${TeXworks_SCRIPT_API}
+ ${LUA_PLUGIN_MOC}
+)
+TARGET_LINK_LIBRARIES(TWLuaPlugin ${QT_LIBRARIES} ${LUA_LIBRARIES})
+
+INSTALL(TARGETS TWLuaPlugin
+ LIBRARY DESTINATION ${TeXworks_PLUGIN_DIR}
+) |
+
plugins-src/TWPythonPlugin/CMakeLists.txt |
+ + |
---|---|
+
+ ¶
+
+
+ Build Python Plugin+ |
+
+ INCLUDE_DIRECTORIES(
+ ${TeXworks_SOURCE_DIR}/src
+ ${QT_INCLUDE_DIR}
+ ${PYTHON_INCLUDE_DIRS}
+)
+
+LINK_DIRECTORIES(${QT_LIBRARY_DIR}) |
+
+
+ ¶
+
+
+ NOTE: Re-moccing headers from the main source directory that have +already been mocced during the build of the main program seems redundant, but +I’m not wise enough in the ways of Qt and CMake to figure out an +alternative. + + |
+
+ QT4_WRAP_CPP(PYTHON_PLUGIN_MOC ${TeXworks_SCRIPT_API_H} TWPythonPlugin.h)
+
+ADD_LIBRARY(TWPythonPlugin SHARED
+ TWPythonPlugin.cpp
+ ${TeXworks_SCRIPT_API}
+ ${PYTHON_PLUGIN_MOC}
+)
+TARGET_LINK_LIBRARIES(TWPythonPlugin ${QT_LIBRARIES} ${PYTHON_LIBRARIES})
+
+INSTALL(TARGETS TWPythonPlugin
+ LIBRARY DESTINATION ${TeXworks_PLUGIN_DIR}
+) |
+
src/CMakeLists.txt |
+ + |
---|---|
+
+ ¶
+
+
+ Build TeXworks+ |
+
+
+ |
+
+
+ ¶
+
+
+ Collect Source Files+ |
+
+
+ |
+
+
+ ¶
+
+
+ NOTE: A |
+
+ FILE(GLOB TEXWORKS_SRCS "*.cpp" "*.c")
+FILE(GLOB TEXWORKS_MOC_HDRS "*.h")
+FILE(GLOB TEXWORKS_UIS "*.ui")
+FILE(GLOB TEXWORKS_RCS "${TeXworks_SOURCE_DIR}/res/*.qrc")
+FILE(GLOB TEXWORKS_TRANS "${TeXworks_SOURCE_DIR}/trans/*.ts") |
+
+
+ ¶
+
+
+ These source files along with the |
+
+ SET(TeXworks_SCRIPT_API
+ ${CMAKE_CURRENT_SOURCE_DIR}/TWScript.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/TWScriptAPI.cpp
+ PARENT_SCOPE
+)
+
+SET(TeXworks_SCRIPT_API_H
+ ${CMAKE_CURRENT_SOURCE_DIR}/TWScript.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/TWScriptAPI.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/TWSystemCmd.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/ConfigurableApp.h
+ PARENT_SCOPE
+) |
+
+
+ ¶
+
+
+ App Setup+ |
+
+
+ |
+
+
+ ¶
+
+
+ On OS X, set GUI type to an |
+
+ IF ( APPLE )
+ SET(GUI_TYPE MACOSX_BUNDLE)
+
+ LIST(APPEND TeXworks_LIBS "-framework CoreServices")
+
+ FILE(GLOB TeXworks_APP_ICONS ${TeXworks_SOURCE_DIR}/*.icns)
+ SET_SOURCE_FILES_PROPERTIES( ${TeXworks_APP_ICONS}
+ PROPERTIES
+ MACOSX_PACKAGE_LOCATION Resources
+ )
+ENDIF () |
+
+
+ ¶
+
+
+ WARNING: Windows is untested + |
+
+ IF ( WIN32 )
+ SET(GUI_TYPE WIN32)
+ENDIF () |
+
+
+ ¶
+
+
+ Make sure the compiler can find include files. + |
+
+ INCLUDE_DIRECTORIES(${TeXworks_INCLUDE_DIRS}) |
+
+
+ ¶
+
+
+ Make sure the compiler can find library files. + |
+
+ LINK_DIRECTORIES(${TeXworks_LIB_DIRS})
+
+ADD_DEFINITIONS(-DTW_BUILD_ID=${TW_BUILD_ID}) |
+
+
+ ¶
+
+
+ Poppler supports XPDF API calls? + |
+
+ IF (POPPLER_HAS_XPDF)
+ INCLUDE_DIRECTORIES(${POPPLER_XPDF_INCLUDE_DIR})
+ ADD_DEFINITIONS(-DHAVE_POPPLER_XPDF_HEADERS)
+ENDIF () |
+
+
+ ¶
+
+
+ Qt-Specific Source Code Processing+ |
+
+
+ |
+
+
+ ¶
+
+
+ Run moc on header files. + |
+
+ QT4_WRAP_CPP(TEXWORKS_GEN_MOC ${TEXWORKS_MOC_HDRS}) |
+
+
+ ¶
+
+
+ Run uic on user interface files. + |
+
+ QT4_WRAP_UI(TEXWORKS_GEN_UI ${TEXWORKS_UIS}) |
+
+
+ ¶
+
+
+ Run rcc on reasource files. + |
+
+ QT4_ADD_RESOURCES(TEXWORKS_GEN_RCS ${TEXWORKS_RCS}) |
+
+
+ ¶
+
+
+ Prep language translations. + |
+
+ QT4_ADD_TRANSLATION(TEXWORKS_GEN_TRANS ${TEXWORKS_TRANS})
+
+IF ( APPLE OR NOT UNIX )
+ SET(EXE_NAME TeXworks)
+ELSE ( APPLE OR NOT UNIX )
+ SET(EXE_NAME texworks)
+ENDIF ( APPLE OR NOT UNIX ) |
+
+
+ ¶
+
+
+ Compilation+ |
+
+
+ |
+
+
+ ¶
+
+
+ Build the executible. + |
+
+ ADD_EXECUTABLE( ${EXE_NAME} ${GUI_TYPE}
+ ${TEXWORKS_SRCS}
+ ${TEXWORKS_GEN_MOC} ${TEXWORKS_GEN_UI} ${TEXWORKS_GEN_RCS} ${TEXWORKS_GEN_TRANS}
+ ${TeXworks_APP_ICONS}
+) |
+
+
+ ¶
+
+
+ Specify libraries to be linked to TeXworks. + |
+
+ TARGET_LINK_LIBRARIES( ${EXE_NAME} ${TeXworks_LIBS} ) |
+
+
+ ¶
+
+
+ For OS X, generate |
+
+ IF (APPLE)
+ SET(VER ${TeXworks_VERSION})
+ SET(REV ${TeXworks_SVN_REV})
+ CONFIGURE_FILE(${TeXworks_SOURCE_DIR}/TeXworks.plist.in
+ ${TeXworks_SOURCE_DIR}/TeXworks.plist
+ @ONLY
+ )
+
+ SET_TARGET_PROPERTIES( TeXworks PROPERTIES
+ MACOSX_BUNDLE_INFO_PLIST
+ ${TeXworks_SOURCE_DIR}/TeXworks.plist
+ )
+ENDIF () |
+
+
+ ¶
+
+
+ Installation+ |
+
+ INSTALL( TARGETS ${EXE_NAME}
+ RUNTIME DESTINATION bin COMPONENT
+ BUNDLE DESTINATION . COMPONENT
+) |
+
+
+ ¶
+
+
+ On OS X, ensure there is always a Protip: If there are wierd errors like “Qt libraries loaded twice” or
+“looking for a tablet device”, then something may have gone pear shaped with
+ |
+
+ IF ( APPLE )
+ SET(QTCONF_DIR ${PROJECT_NAME}.app/Contents/Resources)
+ SET(QTCONF_CONTENTS "[Paths]\nPlugins = PlugIns")
+
+ INSTALL( CODE
+ "
+ FILE(WRITE \"\${CMAKE_INSTALL_PREFIX}/${QTCONF_DIR}/qt.conf\"
+ \"${QTCONF_CONTENTS}\"
+ )
+ "
+ )
+ENDIF() |
+
This page should redirect to docs/CMakeLists.html. If it does not, the link should work.
+ + diff -Nru texworks-0.4.3~svn858~natty1/CMake/docs/html/resources/docs.css texworks-0.4.4~svn1004~natty1/CMake/docs/html/resources/docs.css --- texworks-0.4.3~svn858~natty1/CMake/docs/html/resources/docs.css 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/docs/html/resources/docs.css 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,305 @@ +/*--------------------- Layout and Typography ----------------------------*/ +body { + font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; + font-size: 15px; + line-height: 22px; + color: #252519; + margin: 0; padding: 0; +} +a { + color: #261a3b; +} + a:visited { + color: #261a3b; + } +p { + margin: 0 0 15px 0; +} +h1, h2, h3, h4, h5, h6 { + margin: 0px 0 15px 0; +} +#container { + position: relative; +} +#background { + position: fixed; + top: 0; left: 525px; right: 0; bottom: 0; + background: #f5f5ff; + border-left: 1px solid #e5e5ee; + z-index: -1; +} +table { + margin-top: 100px; +} +thead tr { + display: none; +} +table td { + border: 0; + outline: 0; +} + td.docs, th.docs { + max-width: 450px; + min-width: 450px; + min-height: 5px; + padding: 10px 25px 1px 50px; + overflow-x: hidden; + vertical-align: top; + text-align: left; + } + .docs pre { + margin: 15px 0 15px; + padding-left: 15px; + } + .docs p tt, .docs p code { + background: #f8f8ff; + border: 1px solid #dedede; + font-size: 12px; + padding: 0 0.2em; + } + .pilwrap { + position: relative; + } + .pilcrow { + font: 12px Arial; + text-decoration: none; + color: #454545; + position: absolute; + top: 3px; left: -20px; + padding: 1px 2px; + opacity: 0; + -webkit-transition: opacity 0.2s linear; + } + td.docs:hover .pilcrow { + opacity: 1; + } + td.code, th.code { + padding: 14px 15px 16px 25px; + width: 100%; + vertical-align: top; + background: #f5f5ff; + border-left: 1px solid #e5e5ee; + } + pre, tt, code { + font-size: 12px; line-height: 18px; + font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace; + margin: 0; padding: 0; + } + +/*---------------------- Navbar: Cribbed from Coffee-Script -----------------------------*/ +.bookmark { + display: block; + width: 0; height: 0; + position: relative; + top: -100px; +} + +#fadeout { + z-index: 50; + position: fixed; + left: 0; top: 0; right: 0; + height: 100px; + background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 255)), to(rgba(255, 255, 255, 0))); + background: -moz-linear-gradient(top, rgba(255, 255, 255, 255), rgba(255, 255, 255, 0)); +} + +#flybar { + position: fixed; + z-index: 100; + height: 50px; + min-width: 600px; + left: 40px; right: 40px; top: 25px; + padding-left: 250px; + background: #eee; + background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#dadada)); + background: -moz-linear-gradient(top, #f8f8f8, #dadada); + border: 1px solid #aaa; + border-top: 1px solid #bbb; + border-bottom: 1px solid #888; + -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; + -webkit-box-shadow: 0 3px 5px rgba(0,0,0,0.1); + -moz-box-shadow: 0 3px 5px rgba(0,0,0,0.1); + box-shadow: 0 3px 5px rgba(0,0,0,0.1); +} + #title { + height: 50px; + line-height: 50px; + text-decoration: none; + top: 0px; left: 10px; + padding: 0px; + position: absolute; + } + #title h1 { + margin: 0px; + display: inline; + } + #error { + position: absolute; + -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; + -webkit-border-top-left-radius: 0; -moz-border-radius-topleft: 0; border-top-left-radius: 0; + -webkit-border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; border-bottom-left-radius: 0; + right: 0px; top: 0px; left: 726px; bottom: 0; + padding: 0 0 0 15px; + background: #fdcdcc; + background: -webkit-gradient(linear, left top, left bottom, from(#ffedec), to(#ff9a95)); + background: -moz-linear-gradient(top, #f8f8f8, #dadada); + color: #862322; + font-size: 10px; + line-height: 50px; + overflow: hidden; + text-transform: uppercase; + } + .navigation { + height: 30px; + line-height: 30px; + text-transform: uppercase; + position: relative; + padding: 0px 20px; + margin-top: 10px; + border: 1px solid #aaa; + cursor: pointer; + } + .navigation.about { + float: right; + margin-right: 260px; + } + .navigation.toc { + float: right; + margin-right: 30px; + } + .navigation:hover, + .navigation.active { + background: #eee; + background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#f8f8f8)); + background: -moz-linear-gradient(top, #eee, #f8f8f8); + } + .navigation.active { + height: 51px; + color: #000; + background: -webkit-gradient(linear, left top, left bottom, from(#e5e5e5), to(#fff)); + background: -moz-linear-gradient(top, #e5e5e5, #fff); + } + .navigation .button { + font-weight: bold; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -o-user-select: none; + user-select: none; + } + .navigation .button::selection { + background: transparent; + } + .navigation .contents { + display: none; + position: absolute; + background: #fff; + opacity: 0.97; + top: 40px; left: 0; + padding: 5px 0; + margin-left: -1px; + border: 1px solid #aaa; + border-top: 0; + -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; + -webkit-border-top-left-radius: 0; -moz-border-radius-topleft: 0; border-top-left-radius: 0; + -webkit-border-top-right-radius: 0; -moz-border-radius-topright: 0; border-top-right-radius: 0; + -webkit-box-shadow: 0 3px 5px rgba(0,0,0,0.2); + -moz-box-shadow: 0 3px 5px rgba(0,0,0,0.2); + box-shadow: 0 3px 5px rgba(0,0,0,0.2); + } + .navigation .contents p { + width: 335px; + display: block; + text-transform: none; + margin: 0px; + padding: 4px 10px; + border: 1px solid transparent; + border-left: 0; border-right: 0; + } + .navigation.about .contents a { + display: block; + text-transform: none; + padding: 4px 20px; + border: 1px solid transparent; + border-left: 0; border-right: 0; + } + .navigation .contents.menu a { + display: block; + text-transform: none; + text-decoration: none; + padding: 4px 10px; + border: 1px solid transparent; + border-left: 0; border-right: 0; + } + .navigation .contents.menu a:hover { + border-color: #ddd; + background: #eee; + } + .navigation.active .contents { + display: block; + } + +/*---------------------- Syntax Highlighting -----------------------------*/ +td.linenos { background-color: #f0f0f0; padding-right: 10px; } +span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; } +body .hll { background-color: #ffffcc } +body .c { color: #408080; font-style: italic } /* Comment */ +body .err { border: 1px solid #FF0000 } /* Error */ +body .k { color: #954121 } /* Keyword */ +body .o { color: #666666 } /* Operator */ +body .cm { color: #408080; font-style: italic } /* Comment.Multiline */ +body .cp { color: #BC7A00 } /* Comment.Preproc */ +body .c1 { color: #408080; font-style: italic } /* Comment.Single */ +body .cs { color: #408080; font-style: italic } /* Comment.Special */ +body .gd { color: #A00000 } /* Generic.Deleted */ +body .ge { font-style: italic } /* Generic.Emph */ +body .gr { color: #FF0000 } /* Generic.Error */ +body .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +body .gi { color: #00A000 } /* Generic.Inserted */ +body .go { color: #808080 } /* Generic.Output */ +body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +body .gs { font-weight: bold } /* Generic.Strong */ +body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +body .gt { color: #0040D0 } /* Generic.Traceback */ +body .kc { color: #954121 } /* Keyword.Constant */ +body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */ +body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */ +body .kp { color: #954121 } /* Keyword.Pseudo */ +body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */ +body .kt { color: #B00040 } /* Keyword.Type */ +body .m { color: #666666 } /* Literal.Number */ +body .s { color: #219161 } /* Literal.String */ +body .na { color: #7D9029 } /* Name.Attribute */ +body .nb { color: #954121 } /* Name.Builtin */ +body .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +body .no { color: #880000 } /* Name.Constant */ +body .nd { color: #AA22FF } /* Name.Decorator */ +body .ni { color: #999999; font-weight: bold } /* Name.Entity */ +body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +body .nf { color: #0000FF } /* Name.Function */ +body .nl { color: #A0A000 } /* Name.Label */ +body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +body .nt { color: #954121; font-weight: bold } /* Name.Tag */ +body .nv { color: #19469D } /* Name.Variable */ +body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +body .w { color: #bbbbbb } /* Text.Whitespace */ +body .mf { color: #666666 } /* Literal.Number.Float */ +body .mh { color: #666666 } /* Literal.Number.Hex */ +body .mi { color: #666666 } /* Literal.Number.Integer */ +body .mo { color: #666666 } /* Literal.Number.Oct */ +body .sb { color: #219161 } /* Literal.String.Backtick */ +body .sc { color: #219161 } /* Literal.String.Char */ +body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */ +body .s2 { color: #219161 } /* Literal.String.Double */ +body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +body .sh { color: #219161 } /* Literal.String.Heredoc */ +body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +body .sx { color: #954121 } /* Literal.String.Other */ +body .sr { color: #BB6688 } /* Literal.String.Regex */ +body .s1 { color: #219161 } /* Literal.String.Single */ +body .ss { color: #19469D } /* Literal.String.Symbol */ +body .bp { color: #954121 } /* Name.Builtin.Pseudo */ +body .vc { color: #19469D } /* Name.Variable.Class */ +body .vg { color: #19469D } /* Name.Variable.Global */ +body .vi { color: #19469D } /* Name.Variable.Instance */ +body .il { color: #666666 } /* Literal.Number.Integer.Long */ diff -Nru texworks-0.4.3~svn858~natty1/CMake/docs/layout.mustache texworks-0.4.4~svn1004~natty1/CMake/docs/layout.mustache --- texworks-0.4.3~svn858~natty1/CMake/docs/layout.mustache 1970-01-01 00:00:00.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/CMake/docs/layout.mustache 2012-04-29 16:24:01.000000000 +0000 @@ -0,0 +1,105 @@ + + + + +{{ file }} |
+ + |
---|---|
+
+ ¶
+
+
+ {{{ docs }}}
+ |
+
+ {{{ code }}} |
+
+# TeXworks +# ├── CMakeLists.txt +# ├── src +# │ └── CMakeLists.txt +# ├── plugins-src +# │ ├── TWLuaPlugin +# │ │ └── CMakeLists.txt +# │ └── TWPythonPlugin +# │ └── CMakeLists.txt +# └── CMake +# └── packaging +# ├── CMakeLists.html +# └── mac +# └── MacPackagingTasks.cmake.in +#+# +# Using CMake as a buildsystem offers some nice advantages: +# +# * Supports component discovery and configuration for all three major +# operating systems and can set TeXworks up to be built using GNU +# Makefiles, XCode or Visual Studio. +# +# * Includes CPack, a tool which simplifies the task of packaging the +# TeXworks app for release after it has been built. CPack can generate +# Drag N' Drop installers for the Mac, Nullsoft installers for Windows and +# `.deb` or `.rpm` packages for Linux. +# +# Comments in the CMake files follow [Markdown][md] formatting conventions. +# This convention allows the `CMakeLists.txt` files to be passed through a tool +# such as [Docco][docco] to create a nicely annotated README for the benefit of +# future developers and maintainers. +# +# [cmake]: http://www.cmake.org +# [docco]: http://jashkenas.github.com/docco +# [md]: http://daringfireball.net/projects/markdown/ +# [tw]: http://code.google.com/p/texworks + + +# Setup and User Options +# ====================== + +# Set project name. +PROJECT(TeXworks) + +# We require CMake v2.8 or greater because it is the first version that +# provides support for certain parts of Qt, such as the ScriptTools. +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +SET(CMAKE_COLOR_MAKEFILE ON) +# Always add the current source and binary directories to the header include +# path when compiling. +SET(CMAKE_INCLUDE_CURRENT_DIR ON) + +IF ( WIN32 ) + MESSAGE( WARNING + "The CMake build system has only been tested on Mac OS X and Linux." + "\nIt probably won't work on Windows. Patches containing fixes are" + "\nwelcomed at:" + "\n https://github.com/Sharpie/TeXworks" + ) +ENDIF () + +# Determine Version Numbers +# ------------------------- + +# The values recovered here are used in the filenames of packaged builds and +# influence parts of the application such as the "About" dialog. + +# Recover canonical (x.y.z) version number from `src/TWVersion.h`. +FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/TWVersion.h TeXworks_VER_MAJOR REGEX "VER_MAJOR") +STRING(REGEX MATCH "([0-9]+)" TeXworks_VER_MAJOR ${TeXworks_VER_MAJOR}) +FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/TWVersion.h TeXworks_VER_MINOR REGEX "VER_MINOR") +STRING(REGEX MATCH "([0-9]+)" TeXworks_VER_MINOR ${TeXworks_VER_MINOR}) +FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/TWVersion.h TeXworks_VER_PATCH REGEX "VER_BUGFIX") +STRING(REGEX MATCH "([0-9]+)" TeXworks_VER_PATCH ${TeXworks_VER_PATCH}) +SET(TeXworks_VERSION ${TeXworks_VER_MAJOR}.${TeXworks_VER_MINOR}.${TeXworks_VER_PATCH}) + +# Recover SVN revision from `src/SvnRev.h`. +FILE(STRINGS ${PROJECT_SOURCE_DIR}/src/SvnRev.h TeXworks_SVN_REV LIMIT_COUNT 1) +STRING(REGEX MATCH "([0-9]+)" TeXworks_SVN_REV ${TeXworks_SVN_REV}) + + +# Declare Project Options +# ----------------------- + +# These are options that users can set at configure-time to determine how the +# application is built and what functionalities it will have. Here we declare +# these options by setting default values. + +SET(TW_BUILD_ID "personal" CACHE STRING "A distribution-specific identifier for TeXworks") + +# On UNIX, CMake installs to `/usr/local` by default. However, Mac users +# will probably find `/Applications` a more convenient default. +IF( APPLE AND CMAKE_INSTALL_PREFIX MATCHES "/usr/local" ) + SET( CMAKE_INSTALL_PREFIX "/Applications" ) +ENDIF() + +# Do an optimized release build by default +IF ( NOT CMAKE_BUILD_TYPE ) + SET(CMAKE_BUILD_TYPE "Release") +ENDIF () + +# Options controlling the creation of scripting language plugins. +OPTION(WITH_LUA "Build TeXworks Lua plugin?" ON) +OPTION(WITH_PYTHON "Build TeXworks Python plugin?" ON) + +# On OS X we default to linking against the Python libraries provided by Apple +# even if other Pythons are available. This helps when building +# re-distributable `.app` packages. By disabling this option, a Mac user can +# link against whatever Python they wish for a personal build. +IF ( APPLE ) + OPTION(USE_SYSTEM_PYTHON "Link against Python Framework distributed with OS X?" ON) +ENDIF () + + +# Dependency Configuration +# ======================== + +# Make the contents of `CMake/Modules` available. Among other things, this +# directory contains scripts that locate project components such as Poppler. +SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/Modules ${CMAKE_MODULE_PATH}) + +# Declare Qt libraries required by this project. +SET (QT_COMPONENTS + QtCore + QtGui + QtUiTools + QtScript + QtScriptTools + QtXML +) + +IF ( UNIX AND NOT APPLE ) + LIST(APPEND QT_COMPONENTS QtDbus) +ENDIF () + +# Locate Qt. `INCLUDE(UseQt4)` brings in a set of macros that helps us deal +# with Qt-specific tasks such as compiling resources or running `moc`. +FIND_PACKAGE(Qt4 COMPONENTS ${QT_COMPONENTS} REQUIRED) +INCLUDE(UseQt4) + +FIND_PACKAGE(ZLIB REQUIRED) +FIND_PACKAGE(Hunspell REQUIRED) +FIND_PACKAGE(Poppler REQUIRED) + +# The only thing Poppler should need is the location of the include directories +# in order to access header files. The library loader should be able to find +# libfontconfig on standard search paths. +IF ( POPPLER_NEEDS_FONTCONFIG ) + FIND_PACKAGE(Fontconfig REQUIRED) +ENDIF () + +# Aggregate library names and include directories into variables for easy +# access. +SET(TeXworks_INCLUDE_DIRS + ${QT_INCLUDE_DIR} + ${HUNSPELL_INCLUDE_DIR} + ${POPPLER_QT4_INCLUDE_DIR} + ${ZLIB_INCLUDE_DIR} +) +IF ( POPPLER_NEEDS_FONTCONFIG ) + LIST(APPEND TeXworks_INCLUDE_DIRS ${FONTCONFIG_INCLUDE_DIR}) +ENDIF () + +SET(TeXworks_LIB_DIRS ${QT_LIBRARY_DIR}) + +SET(TeXworks_LIBS + ${QT_LIBRARIES} + ${POPPLER_LIBRARIES} + ${HUNSPELL_LIBRARIES} + ${ZLIB_LIBRARIES} +) + +# Configure Optional Dependencies +# ------------------------------- + +# CMake 2.8 has separate find scripts for Lua 5.1 and Lua 5.0. We assume that +# the most recent Lua version is installed. +IF ( WITH_LUA ) + FIND_PACKAGE(Lua51) +ENDIF() + +IF ( WITH_PYTHON ) + IF ( USE_SYSTEM_PYTHON ) + SET(PYTHON_LIBRARIES "-F/System/Library/Frameworks -framework Python" CACHE PATH "Python library.") + SET(PYTHON_INCLUDE_DIR "/System/Library/Framework/Python.framework/Headers" CACHE PATH "Python framework.") + MARK_AS_ADVANCED(PYTHON_LIBRARIES) + MARK_AS_ADVANCED(PYTHON_INCLUDE_DIR) + SET(PYTHONLIBS_FOUND TRUE) + ELSE () + # **NOTE** For some reason, FindPythonLibs.cmake always seems to default to + # `/System/Library/Frameworks/Python.framework/Headers` as the include path + # on OS X. + FIND_PACKAGE(PythonLibs) + ENDIF () +ENDIF() + +# Update Header Templates +# ----------------------- + +# Some header files contain components that must be dynamically generated. For +# example, `getDefaultBinPaths.sh` is a script that tries to figure out the +# appropriate path to TeX binaries on UNIX-like systems. +IF ( UNIX ) + IF ( NOT EXISTS ${TeXworks_SOURCE_DIR}/src/DefaultBinaryPaths.h ) + MESSAGE(STATUS "Generating DefaultBinaryPaths.h") + + EXECUTE_PROCESS( + COMMAND ${TeXworks_SOURCE_DIR}/getDefaultBinPaths.sh + WORKING_DIRECTORY ${TeXworks_SOURCE_DIR} + ) + ENDIF () +ENDIF () + + +# Building +# ======== + +# Build main TeXworks application +# ------------------------------- +ADD_SUBDIRECTORY(src) + +# Build Plugins +# ------------- + +# Set the plugin installation path. This is a good default for UNIX-like +# systems, but is not appropriate for Windows. +SET(TeXworks_PLUGIN_DIR lib) + +# On OS X, the plugins should live inside the application bundle. +IF ( APPLE ) + SET(TeXworks_PLUGIN_DIR ${PROJECT_NAME}.app/Contents/PlugIns) + # Plugins are build as shared libraries that contain undefined symbols. + # Pass `-undefined dynamic_lookup` so that the Apple linker does not + # freak out about this. + SET(CMAKE_MODULE_LINKER_FLAGS + "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS} -undefined dynamic_lookup") +ENDIF () + + +# Build scripting language plugins if the required libraries are available. +IF ( LUA51_FOUND ) + ADD_SUBDIRECTORY(${TeXworks_SOURCE_DIR}/plugins-src/TWLuaPlugin) +ENDIF () + +IF ( PYTHONLIBS_FOUND ) + ADD_SUBDIRECTORY(${TeXworks_SOURCE_DIR}/plugins-src/TWPythonPlugin) +ENDIF () + + +# Packaging +# ========= + +# This section is responsible for executing all tasks that run when a user +# invokes `cpack` or `make package` after executing their platform's equivalent +# of of `make`. The packaging tasks are responsible for two things: +# +# * Applying transformations to the compiled binaries such that they can be +# distributed to another machine. +# +# * Gathering all binaries and libraries and packaging them into an archive +# suitable for distribution such as a Windows installer or Mac disk image +# file. + +# Gather all libraries related to Qt plugins used by TeXworks so that they can +# be bundled into packages. +SET(QT_PLUGINS + ${QT_QTACCESSIBLEWIDGETS_PLUGIN_RELEASE} + ${QT_QCNCODECS_PLUGIN_RELEASE} + ${QT_QJPCODECS_PLUGIN_RELEASE} + ${QT_QKRCODECS_PLUGIN_RELEASE} + ${QT_QTWCODECS_PLUGIN_RELEASE} + ${QT_QGIF_PLUGIN_RELEASE} + ${QT_QJPEG_PLUGIN_RELEASE} + ${QT_QTIFF_PLUGIN_RELEASE} +) + +# The file `CMake/packaging/CMakeLists.txt` controls the execution of tasks +# specific to preparing binaries for packaging on a given platform. This script +# is invoked via `ADD_SUBDIRECTORY` so that it executes after TeXworks and its +# components are built and installed. You cannot fixup an application bundle +# before it has been created... +ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/CMake/packaging) + +# Set CPack variables. +SET(CPACK_PACKAGE_VERSION_MAJOR ${TeXworks_VER_MAJOR}) +SET(CPACK_PACKAGE_VERSION_MINOR ${TeXworks_VER_MINOR}) +SET(CPACK_PACKAGE_VERSION_PATCH ${TeXworks_VER_PATCH}) +SET(CPACK_PACKAGE_VERSION ${TeXworks_VERSION}) + +SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) +SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}.${CPACK_PACKAGE_VERSION}-${TeXworks_SVN_REV}") + +# Configure Drag N' Drop installer. +IF ( APPLE ) + SET(MAC_PACK_BITS "${CMAKE_SOURCE_DIR}/cmake/packaging/mac") + SET(CPACK_GENERATOR DragNDrop) + SET( CPACK_DMG_BACKGROUND_IMAGE "${MAC_PACK_BITS}/texworks_dmg_background.png" ) + + # Configure an AppleScript for applying a nice window layout to Drag N' Drop disk + # image. + CONFIGURE_FILE( ${MAC_PACK_BITS}/set_dmg_layout.scpt.in + ${PROJECT_BINARY_DIR}/set_dmg_layout.scpt + @ONLY + ) +ENDIF () + +INCLUDE(CPack) + + +# Summary +# ======= + +# This section displays a nice configuration summary for the user. + +# These macros borrowed from the Poppler CMake scripts. They add some nice +# formatting to configuration info. +MACRO(CONFIG_INFO what value) + STRING(LENGTH ${what} length_what) + MATH(EXPR left_char "35 - ${length_what}") + SET(blanks) + FOREACH(_i RANGE 1 ${left_char}) + SET(blanks "${blanks} ") + ENDFOREACH() + + MESSAGE(" ${what}:${blanks} ${value}") +ENDMACRO() + +MACRO(CONFIG_YESNO what enabled) + IF(${enabled}) + SET(enabled_string "yes") + ELSE(${enabled}) + SET(enabled_string "no") + ENDIF() + + CONFIG_INFO("${what}" "${enabled_string}") +ENDMACRO() + +# Print out configuration summary. +MESSAGE("TeXworks has been configured:\n") + +CONFIG_INFO("Version" ${TeXworks_VERSION}) +CONFIG_INFO("SVN Revision" ${TeXworks_SVN_REV}) +CONFIG_INFO("Build ID" ${TW_BUILD_ID}) +CONFIG_INFO("Compiler optimization" ${CMAKE_BUILD_TYPE}) +MESSAGE("") + +CONFIG_YESNO("Lua scripting plugin" LUA51_FOUND) +CONFIG_YESNO("Python scripting plugin" PYTHONLIBS_FOUND) +IF( APPLE ) + CONFIG_YESNO(" OS X system python" USE_SYSTEM_PYTHON) +ENDIF() +MESSAGE("") + +MESSAGE(" TeXworks will be installed to:") +MESSAGE(" ${CMAKE_INSTALL_PREFIX}") +MESSAGE("") + + diff -Nru texworks-0.4.3~svn858~natty1/debian/changelog texworks-0.4.4~svn1004~natty1/debian/changelog --- texworks-0.4.3~svn858~natty1/debian/changelog 2011-06-29 17:09:08.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/debian/changelog 2012-04-29 16:24:01.000000000 +0000 @@ -1,5 +1,31 @@ -texworks (0.4.3~svn858~natty1) natty; urgency=low +texworks (0.4.4~svn1004~natty1) natty; urgency=low - * Fix bug in autocompletion that could cause data loss + * Fix crash caused by Qt when adding lines at the beginning of a document + * Fix search/replace for multi-line strings + * Work around layout issues which cause lines to disappear + * Fix building with BSD make + * Fix block selection of last paragraph + * Fix overwrite of "Find all occurrences" option + * Improve "Unable to execute..." error dialog + * Rename "Show/Hide Output Panel" to "Show/Hide Console Output" in the menu + and the preferences dialog + * Remove subject and add instructions to body of the "email to mailinglist" + * Bring the window running TeX to the top at the beginning of typesetting to + ensure that the console output is visible + * Allow symlinks and display only folders in "path for programs" in the + preferences dialog + * Add "Clear Recent Files" to "Open Recent" menu + * Add an autocompletion entry to the preferences dialog + * Add Lua(La)TeX to the default tools (and drop LaTeXmk by default) + * Add an option to open log files + * Add CMake support (experimental) + * Update SyncTeX to version 1.17 + * Update URLs to http://www.tug.org/texworks/ + * Some enhancements to functions available to scripting + * Avoid showing an empty message box for script results + * Resolve symlinks when looking for scripts + * Expose the scripts' titles, authors, filenames, etc. to scripting + * Update/improve scripts: open pdf in default viewer, derive spellchecking + language from babel package, log parser - -- Stefan Löffler
Microsoft, Windows, and the Windows logo are diff -Nru texworks-0.4.3~svn858~natty1/manual/en/AdvanceduseScripting.html texworks-0.4.4~svn1004~natty1/manual/en/AdvanceduseScripting.html --- texworks-0.4.3~svn858~natty1/manual/en/AdvanceduseScripting.html 2011-06-29 17:09:08.000000000 +0000 +++ texworks-0.4.4~svn1004~natty1/manual/en/AdvanceduseScripting.html 2012-04-29 16:24:01.000000000 +0000 @@ -16,7 +16,7 @@ "TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" /> - +