PageRenderTime 44ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llwindow/CMakeLists.txt

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 172 lines | 139 code | 21 blank | 12 comment | 8 complexity | 07331767ad957073201bc1c6bcf5c7c0 MD5 | raw file
Possible License(s): LGPL-2.1
  1. # -*- cmake -*-
  2. #
  3. # Compared to other libraries, compiling this one is a mess. The
  4. # reason is that we have several source files that have two different
  5. # sets of behaviour, depending on whether they're intended to be part
  6. # of the viewer or the map server.
  7. #
  8. # Unfortunately, the affected code is a rat's nest of #ifdefs, so it's
  9. # easier to play compilation tricks than to actually fix the problem.
  10. project(llwindow)
  11. include(00-Common)
  12. include(DirectX)
  13. include(DragDrop)
  14. include(LLCommon)
  15. include(LLImage)
  16. include(LLMath)
  17. include(LLRender)
  18. include(LLVFS)
  19. include(LLWindow)
  20. include(LLXML)
  21. include(UI)
  22. include_directories(
  23. ${LLCOMMON_INCLUDE_DIRS}
  24. ${LLIMAGE_INCLUDE_DIRS}
  25. ${LLMATH_INCLUDE_DIRS}
  26. ${LLRENDER_INCLUDE_DIRS}
  27. ${LLVFS_INCLUDE_DIRS}
  28. ${LLWINDOW_INCLUDE_DIRS}
  29. ${LLXML_INCLUDE_DIRS}
  30. ${DIRECTX_INCLUDE_DIR}
  31. )
  32. set(llwindow_SOURCE_FILES
  33. llkeyboard.cpp
  34. llkeyboardheadless.cpp
  35. llwindowheadless.cpp
  36. llwindowcallbacks.cpp
  37. )
  38. set(llwindow_HEADER_FILES
  39. CMakeLists.txt
  40. llkeyboard.h
  41. llkeyboardheadless.h
  42. llwindowheadless.h
  43. llwindowcallbacks.h
  44. )
  45. set(viewer_SOURCE_FILES
  46. llwindow.cpp
  47. llmousehandler.cpp
  48. )
  49. set(viewer_HEADER_FILES
  50. llwindow.h
  51. llpreeditor.h
  52. llmousehandler.h
  53. )
  54. # Libraries on which this library depends, needed for Linux builds
  55. # Sort by high-level to low-level
  56. if (LINUX AND VIEWER)
  57. set(llwindow_LINK_LIBRARIES
  58. ${UI_LIBRARIES} # for GTK
  59. ${SDL_LIBRARY}
  60. fontconfig # For FCInit and other FC* functions.
  61. )
  62. endif (LINUX AND VIEWER)
  63. if (DARWIN)
  64. list(APPEND llwindow_SOURCE_FILES
  65. llkeyboardmacosx.cpp
  66. llwindowmacosx.cpp
  67. llwindowmacosx-objc.mm
  68. )
  69. list(APPEND llwindow_HEADER_FILES
  70. llkeyboardmacosx.h
  71. llwindowmacosx.h
  72. llwindowmacosx-objc.h
  73. )
  74. # We use a bunch of deprecated system APIs.
  75. set_source_files_properties(
  76. llkeyboardmacosx.cpp
  77. llwindowmacosx.cpp
  78. PROPERTIES
  79. COMPILE_FLAGS "-Wno-deprecated-declarations -fpascal-strings"
  80. )
  81. endif (DARWIN)
  82. if (LINUX AND VIEWER)
  83. list(APPEND viewer_SOURCE_FILES
  84. llkeyboardsdl.cpp
  85. llwindowsdl.cpp
  86. )
  87. list(APPEND viewer_HEADER_FILES
  88. llkeyboardsdl.h
  89. llwindowsdl.h
  90. )
  91. endif (LINUX AND VIEWER)
  92. if (WINDOWS)
  93. list(APPEND llwindow_SOURCE_FILES
  94. llwindowwin32.cpp
  95. lldxhardware.cpp
  96. llkeyboardwin32.cpp
  97. lldragdropwin32.cpp
  98. )
  99. list(APPEND llwindow_HEADER_FILES
  100. llwindowwin32.h
  101. lldxhardware.h
  102. llkeyboardwin32.h
  103. lldragdropwin32.h
  104. )
  105. list(APPEND llwindow_LINK_LIBRARIES
  106. comdlg32 # Common Dialogs for ChooseColor
  107. ole32
  108. )
  109. endif (WINDOWS)
  110. if (SOLARIS)
  111. list(APPEND llwindow_SOURCE_FILES
  112. llwindowsolaris.cpp
  113. )
  114. list(APPEND llwindow_HEADER_FILES
  115. llwindowsolaris.h
  116. )
  117. endif (SOLARIS)
  118. set_source_files_properties(${llwindow_HEADER_FILES}
  119. PROPERTIES HEADER_FILE_ONLY TRUE)
  120. if (SERVER AND NOT WINDOWS AND NOT DARWIN)
  121. set(server_SOURCE_FILES
  122. llwindowmesaheadless.cpp
  123. )
  124. set(server_HEADER_FILES
  125. llwindowmesaheadless.h
  126. )
  127. copy_server_sources(
  128. llwindow
  129. )
  130. set_source_files_properties(
  131. ${server_SOURCE_FILES}
  132. PROPERTIES
  133. COMPILE_FLAGS "-DLL_MESA=1 -DLL_MESA_HEADLESS=1"
  134. )
  135. add_library (llwindowheadless
  136. ${llwindow_SOURCE_FILES}
  137. ${server_SOURCE_FILES}
  138. )
  139. target_link_libraries (llwindowheadless ${llwindow_LINK_LIBRARIES})
  140. endif (SERVER AND NOT WINDOWS AND NOT DARWIN)
  141. if (llwindow_HEADER_FILES)
  142. list(APPEND llwindow_SOURCE_FILES ${llwindow_HEADER_FILES})
  143. endif (llwindow_HEADER_FILES)
  144. list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES})
  145. if (VIEWER)
  146. add_library (llwindow
  147. ${llwindow_SOURCE_FILES}
  148. ${viewer_SOURCE_FILES}
  149. )
  150. target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES})
  151. endif (VIEWER)