-project(lyx-qt4)
+# This file is part of LyX, the document processor.
+# Licence details can be found in the file COPYING.
+#
+# Copyright (c) 2006, Peter Kümmel, <syntheticpp@gmx.net>
+#
+
+set(_lyx ${PACKAGE_BASE}${PROGRAM_SUFFIX})
+project(${_lyx})
include_directories(${TOP_SRC_DIR}/src)
-add_subdirectory(frontends)
-add_subdirectory(graphics)
-add_subdirectory(insets)
-add_subdirectory(mathed)
-add_subdirectory(support)
-#add_subdirectory(tex2lyx)
+add_subdirectory(frontends)
+add_subdirectory(graphics)
+add_subdirectory(insets)
+add_subdirectory(mathed)
+add_subdirectory(support)
+add_subdirectory(tex2lyx)
+if (UNIX)
+ add_subdirectory(client)
+endif()
+file(GLOB lyx_sources ${TOP_SRC_DIR}/src/${LYX_CPP_FILES})
+file(GLOB moc_files ${TOP_SRC_DIR}/src/${LYX_MOC_FILES})
+list(REMOVE_ITEM lyx_sources ${moc_files} .)
+file(GLOB lyx_headers ${TOP_SRC_DIR}/src/${LYX_HPP_FILES})
-configure_file(version.C.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.C)
+list(REMOVE_ITEM lyx_sources
+ ${TOP_SRC_DIR}/src/EnchantChecker.cpp
+ ${TOP_SRC_DIR}/src/AspellChecker.cpp
+ ${TOP_SRC_DIR}/src/HunspellChecker.cpp
+ ${TOP_SRC_DIR}/src/Variables.cpp
+ ${TOP_SRC_DIR}/src/Section.cpp
+ ${TOP_SRC_DIR}/src/lyxcore.cpp)
-set(lyx_sources
- Bidi.C
- Bidi.h
- BufferView.C
- BufferView.h
- BufferView_pimpl.C
- BufferView_pimpl.h
- Bullet.C
- Bullet.h
- BranchList.C
- BranchList.h
- Chktex.C
- Chktex.h
- Color.C
- Color.h
- CutAndPaste.C
- CutAndPaste.h
- DepTable.C
- DepTable.h
- FloatList.C
- FloatList.h
- Floating.C
- Floating.h
- FontIterator.C
- FontIterator.h
- FuncStatus.C
- FuncStatus.h
- InsetList.C
- InsetList.h
- LColor.C
- LColor.h
- LaTeX.C
- LaTeX.h
- LaTeXFeatures.C
- LaTeXFeatures.h
- LyXAction.C
- LyXAction.h
- MenuBackend.C
- MenuBackend.h
- ParagraphList.h
- ParagraphList_fwd.h
- ParagraphParameters.C
- ParagraphParameters.h
- PrinterParams.C
- PrinterParams.h
- RowList_fwd.h
- Spacing.C
- Spacing.h
- Thesaurus.C
- Thesaurus.h
- ToolbarBackend.C
- ToolbarBackend.h
- WordLangTuple.h
- author.C
- author.h
- boost.C
- box.h
- box.C
- buffer.C
- buffer.h
- buffer_funcs.C
- buffer_funcs.h
- bufferlist.C
- bufferlist.h
- bufferparams.C
- bufferparams.h
- bufferview_funcs.C
- bufferview_funcs.h
- changes.C
- changes.h
- chset.C
- chset.h
- converter.C
- converter.h
- counters.C
- counters.h
- coordcache.C
- coordcache.h
- cursor.C
- cursor.h
- cursor_slice.C
- cursor_slice.h
- debug.C
- debug.h
- dimension.C
- dimension.h
- dociterator.C
- dociterator.h
- dispatchresult.h
- encoding.C
- encoding.h
- errorlist.C
- errorlist.h
- exporter.C
- exporter.h
- gettext.C
- gettext.h
- factory.h
- factory.C
- format.C
- format.h
- funcrequest.h
- funcrequest.C
- graph.C
- graph.h
- importer.C
- importer.h
- intl.C
- intl.h
- insetiterator.C
- insetiterator.h
- kbmap.C
- kbmap.h
- kbsequence.C
- kbsequence.h
- language.C
- language.h
- session.C
- session.h
- layout.h
- lengthcommon.C
- lengthcommon.h
- lfuns.h
- lyx_cb.C
- lyx_cb.h
- lyx_main.C
- lyx_main.h
- lyx_sty.C
- lyx_sty.h
- lyxfont.C
- lyxfont.h
- lyxfind.C
- lyxfind.h
- lyxfunc.C
- lyxfunc.h
- lyxgluelength.C
- lyxgluelength.h
- lyxlayout.C
- lyxlayout.h
- lyxlayout_ptr_fwd.h
- lyxlength.C
- lyxlength.h
- lyxlex.C
- lyxlex.h
- lyxlex_pimpl.C
- lyxlex_pimpl.h
- lyxrc.C
- lyxrc.h
- lyxrow.C
- lyxrow.h
- lyxrow_funcs.C
- lyxrow_funcs.h
- lyxserver.C
- lyxserver.h
- lyxsocket.C
- lyxsocket.h
- lyxtext.h
- lyxtextclass.C
- lyxtextclass.h
- lyxtextclasslist.C
- lyxtextclasslist.h
- lyxvc.C
- lyxvc.h
- main.C
- messages.C
- messages.h
- metricsinfo.C
- metricsinfo.h
- mover.C
- mover.h
- output.C
- output.h
- outputparams.C
- outputparams.h
- output_docbook.C
- output_docbook.h
- output_latex.C
- output_latex.h
- output_linuxdoc.C
- output_linuxdoc.h
- output_plaintext.C
- output_plaintext.h
- paper.h
- paragraph.C
- paragraph.h
- paragraph_funcs.C
- paragraph_funcs.h
- paragraph_pimpl.C
- paragraph_pimpl.h
- pariterator.C
- pariterator.h
- #$(PSPELL)
- #$(ISPELL)
- SpellBase.C
- SpellBase.h
- rowpainter.C
- rowpainter.h
- sgml.C
- sgml.h
- tabular.C
- tabular.h
- tex-accent.C
- tex-accent.h
- tex-strings.C
- tex-strings.h
- texrow.C
- texrow.h
- text.C
- text2.C
- text3.C
- TocBackend.C
- TocBackend.h
- toc.C
- toc.h
- trans.C
- trans.h
- trans_decl.h
- trans_mgr.C
- trans_mgr.h
- undo.C
- undo.h
- vc-backend.C
- vc-backend.h
- version.h
- vspace.C
- vspace.h
-)
+if(NOT APPLE)
+ list(REMOVE_ITEM lyx_sources
+ ${TOP_SRC_DIR}/src/AppleSpellChecker.cpp)
+ list(REMOVE_ITEM lyx_headers
+ ${TOP_SRC_DIR}/src/AppleSpellChecker.h)
+endif()
+
+list(REMOVE_ITEM lyx_headers
+ ${TOP_SRC_DIR}/src/EnchantChecker.h
+ ${TOP_SRC_DIR}/src/AspellChecker.h
+ ${TOP_SRC_DIR}/src/HunspellChecker.h
+ ${TOP_SRC_DIR}/src/Variables.h
+ ${TOP_SRC_DIR}/src/Section.h)
-if(ASPELL_FOUND)
+if (HUNSPELL_FOUND)
+ list(APPEND lyx_sources ${TOP_SRC_DIR}/src/HunspellChecker.cpp)
+ list(APPEND lyx_headers ${TOP_SRC_DIR}/src/HunspellChecker.h)
+endif()
+
+if (ASPELL_FOUND)
include_directories(${ASPELL_INCLUDE_DIR})
- set(lyx_sources ${lyx_sources} aspell.C)
-endif(ASPELL_FOUND)
+ list(APPEND lyx_sources ${TOP_SRC_DIR}/src/AspellChecker.cpp)
+ list(APPEND lyx_headers ${TOP_SRC_DIR}/src/AspellChecker.h)
+endif()
+
+if (ENCHANT_FOUND)
+ include_directories("${ENCHANT_INCLUDE_DIR}")
+ list(APPEND lyx_sources ${TOP_SRC_DIR}/src/EnchantChecker.cpp)
+ list(APPEND lyx_headers ${TOP_SRC_DIR}/src/EnchantChecker.h)
+endif()
+lyx_automoc(${TOP_SRC_DIR}/src/Compare.cpp)
+if (WIN32)
+ lyx_automoc(${TOP_SRC_DIR}/src/Server.cpp)
+endif()
-lyx_add_path(lyx_sources ${TOP_SRC_DIR}/src)
+include_directories(${CMAKE_CURRENT_BINARY_DIR}
+ ${ZLIB_INCLUDE_DIR} ${QT_INCLUDES})
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
+lyx_add_msvc_pch(lyx)
-add_executable(lyx-qt4 ${lyx_sources} ${CMAKE_CURRENT_BINARY_DIR}/version.C)
-target_link_libraries(lyx-qt4
+if (LYX_MERGE_FILES)
+ lyx_const_touched_files(_allinone lyx_sources)
+ set(lyx_sources ${_allinone_files})
+endif()
+
+if (LYX_VLD)
+ configure_file(${vld_path}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/vld.ini COPYONLY)
+ configure_file(${vld_path}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt COPYONLY)
+ set(vld_files ${CMAKE_CURRENT_BINARY_DIR}/vld.ini ${CMAKE_CURRENT_BINARY_DIR}/memory_leak_report.txt)
+endif()
+
+if(WIN32)
+ set(FILE_RC ${CMAKE_SOURCE_DIR}/lyx.rc)
+ message(STATUS "Using icon defined in resource file: ${FILE_RC}")
+endif()
+
+add_executable(${_lyx}
+ ${WIN32_CONSOLE}
+ ${lyx_sources}
+ ${lyx_headers}
+ ${vld_files}
+ ${FILE_RC}
+)
+
+lyx_add_gcc_pch(${_lyx})
+
+target_link_libraries(${_lyx}
mathed
insets
frontends
frontend_qt4
graphics
support
- intl
+ ${LIBINTL_LIBRARIES}
+ ${ICONV_LIBRARY}
${QT_QTMAIN_LIBRARY}
- boost_iostreams
-)
+ ${vld_dll})
+
+if (HUNSPELL_FOUND)
+ target_link_libraries(${_lyx} ${HUNSPELL_LIBRARY})
+endif()
+if (ASPELL_FOUND)
+ target_link_libraries(${_lyx} ${ASPELL_LIBRARY})
+endif()
+if (ENCHANT_FOUND)
+ target_link_libraries(${_lyx} ${ENCHANT_LIBRARY})
+endif()
+
+if (APPLE)
+ target_link_libraries(${_lyx} "-bind_at_load")
+ target_link_libraries(${_lyx} "-framework Carbon")
+endif()
+
+if (MINGW)
+ target_link_libraries(${_lyx} ole32)
+endif()
+
+project_source_group("${GROUP_CODE}" lyx_sources lyx_headers)
+
+install(TARGETS ${_lyx} DESTINATION bin)
-if(ASPELL_FOUND)
- target_link_libraries(lyx-qt4 ${ASPELL_LIBRARY})
-endif(ASPELL_FOUND)