PageRenderTime 25ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/lyx-2.0.4/development/cmake/src/support/CMakeLists.txt

#
CMake | 84 lines | 59 code | 18 blank | 7 comment | 4 complexity | 92e708c352f0503452001da0efb2367b MD5 | raw file
Possible License(s): LGPL-2.0, GPL-2.0
  1. # This file is part of LyX, the document processor.
  2. # Licence details can be found in the file COPYING.
  3. #
  4. # Copyright (c) 2006-2011 Peter K?mmel, <syntheticpp@gmx.net>
  5. #
  6. project(support)
  7. file(GLOB support_sources ${TOP_SRC_DIR}/src/support/${LYX_CPP_FILES})
  8. file(GLOB moc_files ${TOP_SRC_DIR}/src/support/${LYX_MOC_FILES})
  9. list(REMOVE_ITEM support_sources ${moc_files} .)
  10. if(APPLE)
  11. list(APPEND dont_merge ${TOP_SRC_DIR}/src/support/AppleSpeller.m)
  12. endif()
  13. file(GLOB support_headers ${TOP_SRC_DIR}/src/support/${LYX_HPP_FILES})
  14. file(GLOB support_mythes_sources ${TOP_SRC_DIR}/src/support/mythes/*.cxx)
  15. file(GLOB support_mythes_headers ${TOP_SRC_DIR}/src/support/mythes/*.hxx)
  16. file(GLOB support_linkback_sources ${TOP_SRC_DIR}/src/support/linkback/*.m*)
  17. file(GLOB support_linkback_headers ${TOP_SRC_DIR}/src/support/linkback/*.h)
  18. list(REMOVE_ITEM support_sources
  19. ${TOP_SRC_DIR}/src/support/os_win32.cpp
  20. ${TOP_SRC_DIR}/src/support/os_unix.cpp
  21. ${TOP_SRC_DIR}/src/support/os_cygwin.cpp
  22. ${TOP_SRC_DIR}/src/support/os_os2.C
  23. ${TOP_SRC_DIR}/src/support/atexit.c
  24. ${TOP_SRC_DIR}/src/support/strerror.c
  25. ${TOP_SRC_DIR}/src/support/gettext.cpp)
  26. if(APPLE)
  27. message(STATUS "Mac LinkBack support")
  28. else()
  29. set(support_linkback_sources "")
  30. set(support_linkback_headers "")
  31. endif()
  32. # needed to compile tex2lyx in merged mode
  33. set(dont_merge ${dont_merge} ${TOP_SRC_DIR}/src/support/gettext.cpp)
  34. lyx_add_msvc_pch(support)
  35. lyx_automoc(${support_sources})
  36. include_directories(${TOP_SRC_DIR}/src/support
  37. ${CMAKE_BINARY_DIR}/src/support
  38. ${TOP_SRC_DIR}/src/support/mythes
  39. ${QT_INCLUDES}
  40. ${ICONV_INCLUDE_DIR}
  41. ${ZLIB_INCLUDE_DIR})
  42. if(NOT LYX_MERGE_FILES)
  43. set(support_sources ${support_sources} ${support_mythes_sources} ${support_linkback_sources})
  44. set(support_headers ${support_headers} ${support_mythes_headers} ${support_linkback_headers})
  45. add_library(support ${library_type} ${support_sources} ${support_headers} ${dont_merge})
  46. else()
  47. # GCC bug: gcc resolves ::bind as boost::bind
  48. set(support_separate ${TOP_SRC_DIR}/src/support/socktools.cpp ${TOP_SRC_DIR}/src/support/Messages.cpp)
  49. list(REMOVE_ITEM support_sources ${support_separate})
  50. lyx_const_touched_files(_allinone support_sources)
  51. set(depends_moc ${support_headers})
  52. set_source_files_properties(_allinone_const.C
  53. PROPERTIES OBJECT_DEPENDS "${depends_moc}")
  54. set_source_files_properties(_allinone_touched.C
  55. PROPERTIES OBJECT_DEPENDS "${depends_moc}")
  56. add_library(support ${library_type} ${_allinone_files} ${support_separate}
  57. ${support_mythes_sources} ${support_linkback_sources} ${support_headers} ${dont_merge})
  58. endif()
  59. target_link_libraries(support ${Lyx_Boost_Libraries} ${QT_QTCORE_LIBRARY} ${ZLIB_LIBRARY})
  60. lyx_add_gcc_pch(support)
  61. if(APPLE)
  62. target_link_libraries(support "objc" "-framework AppKit" "-framework CoreFoundation")
  63. elseif(WIN32)
  64. target_link_libraries(support shlwapi psapi)
  65. endif()
  66. project_source_group("${GROUP_CODE}" support_sources support_headers)