PageRenderTime 30ms CodeModel.GetById 25ms app.highlight 3ms RepoModel.GetById 1ms 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
  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
 11project(llwindow)
 12
 13include(00-Common)
 14include(DirectX)
 15include(DragDrop)
 16include(LLCommon)
 17include(LLImage)
 18include(LLMath)
 19include(LLRender)
 20include(LLVFS)
 21include(LLWindow)
 22include(LLXML)
 23include(UI)
 24
 25include_directories(
 26    ${LLCOMMON_INCLUDE_DIRS}
 27    ${LLIMAGE_INCLUDE_DIRS}
 28    ${LLMATH_INCLUDE_DIRS}
 29    ${LLRENDER_INCLUDE_DIRS}
 30    ${LLVFS_INCLUDE_DIRS}
 31    ${LLWINDOW_INCLUDE_DIRS}
 32    ${LLXML_INCLUDE_DIRS}
 33    ${DIRECTX_INCLUDE_DIR}
 34    )
 35
 36set(llwindow_SOURCE_FILES
 37    llkeyboard.cpp
 38    llkeyboardheadless.cpp
 39    llwindowheadless.cpp
 40    llwindowcallbacks.cpp
 41    )
 42
 43set(llwindow_HEADER_FILES
 44    CMakeLists.txt
 45
 46    llkeyboard.h
 47    llkeyboardheadless.h
 48    llwindowheadless.h
 49    llwindowcallbacks.h
 50    )
 51
 52set(viewer_SOURCE_FILES
 53    llwindow.cpp
 54    llmousehandler.cpp
 55    )
 56
 57set(viewer_HEADER_FILES
 58    llwindow.h
 59    llpreeditor.h
 60    llmousehandler.h
 61    )
 62
 63# Libraries on which this library depends, needed for Linux builds
 64# Sort by high-level to low-level
 65if (LINUX AND VIEWER)
 66  set(llwindow_LINK_LIBRARIES
 67      ${UI_LIBRARIES}     # for GTK
 68      ${SDL_LIBRARY}
 69      fontconfig          # For FCInit and other FC* functions.
 70      )
 71endif (LINUX AND VIEWER)
 72
 73if (DARWIN)
 74  list(APPEND llwindow_SOURCE_FILES
 75    llkeyboardmacosx.cpp
 76    llwindowmacosx.cpp
 77    llwindowmacosx-objc.mm
 78    )
 79  list(APPEND llwindow_HEADER_FILES
 80    llkeyboardmacosx.h
 81    llwindowmacosx.h
 82    llwindowmacosx-objc.h
 83    )
 84
 85  # We use a bunch of deprecated system APIs.
 86  set_source_files_properties(
 87      llkeyboardmacosx.cpp
 88      llwindowmacosx.cpp
 89      PROPERTIES
 90      COMPILE_FLAGS "-Wno-deprecated-declarations -fpascal-strings"
 91      )
 92endif (DARWIN)
 93
 94if (LINUX AND VIEWER)
 95  list(APPEND viewer_SOURCE_FILES 
 96       llkeyboardsdl.cpp 
 97       llwindowsdl.cpp
 98       )
 99  list(APPEND viewer_HEADER_FILES
100       llkeyboardsdl.h
101       llwindowsdl.h
102       )
103endif (LINUX AND VIEWER)
104
105if (WINDOWS)
106  list(APPEND llwindow_SOURCE_FILES
107       llwindowwin32.cpp
108       lldxhardware.cpp
109       llkeyboardwin32.cpp
110       lldragdropwin32.cpp
111       )
112  list(APPEND llwindow_HEADER_FILES
113       llwindowwin32.h
114       lldxhardware.h
115       llkeyboardwin32.h
116       lldragdropwin32.h
117       )
118  list(APPEND llwindow_LINK_LIBRARIES
119       comdlg32     # Common Dialogs for ChooseColor
120       ole32
121       )
122endif (WINDOWS)
123
124if (SOLARIS)
125  list(APPEND llwindow_SOURCE_FILES
126       llwindowsolaris.cpp
127       )
128  list(APPEND llwindow_HEADER_FILES
129       llwindowsolaris.h
130       )
131endif (SOLARIS)
132
133set_source_files_properties(${llwindow_HEADER_FILES}
134                            PROPERTIES HEADER_FILE_ONLY TRUE)
135
136if (SERVER AND NOT WINDOWS AND NOT DARWIN)
137  set(server_SOURCE_FILES
138       llwindowmesaheadless.cpp
139       )
140  set(server_HEADER_FILES
141       llwindowmesaheadless.h
142       )
143  copy_server_sources(
144      llwindow
145      )
146
147
148  set_source_files_properties(
149    ${server_SOURCE_FILES}
150    PROPERTIES
151    COMPILE_FLAGS "-DLL_MESA=1 -DLL_MESA_HEADLESS=1"
152    )
153  add_library (llwindowheadless
154    ${llwindow_SOURCE_FILES}
155    ${server_SOURCE_FILES}
156    )
157  target_link_libraries (llwindowheadless ${llwindow_LINK_LIBRARIES})
158endif (SERVER AND NOT WINDOWS AND NOT DARWIN)
159
160if (llwindow_HEADER_FILES)
161  list(APPEND llwindow_SOURCE_FILES ${llwindow_HEADER_FILES})
162endif (llwindow_HEADER_FILES)
163  list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES})
164
165if (VIEWER)
166  add_library (llwindow
167    ${llwindow_SOURCE_FILES}
168    ${viewer_SOURCE_FILES}
169    )
170  target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES})
171endif (VIEWER)
172