CMakeLists.txt
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:4k
源码类别:

游戏引擎

开发平台:

C++ Builder

  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.     )
  31. set(llwindow_SOURCE_FILES
  32.     llkeyboard.cpp
  33.     llwindowheadless.cpp
  34.     llwindowcallbacks.cpp
  35.     )
  36. set(llwindow_HEADER_FILES
  37.     CMakeLists.txt
  38.     llkeyboard.h
  39.     llwindowheadless.h
  40.     llwindowcallbacks.h
  41.     )
  42. set(viewer_SOURCE_FILES
  43.     llwindow.cpp
  44.     llmousehandler.cpp
  45.     )
  46. set(viewer_HEADER_FILES
  47.     llwindow.h
  48.     llpreeditor.h
  49.     llmousehandler.h
  50.     )
  51. # Libraries on which this library depends, needed for Linux builds
  52. # Sort by high-level to low-level
  53. if (NOT LINUX OR VIEWER)
  54.   set(llwindow_LINK_LIBRARIES
  55.       ${UI_LIBRARIES}     # for GTK
  56.       ${SDL_LIBRARY}
  57.       )
  58. endif (NOT LINUX OR VIEWER)
  59. if (DARWIN)
  60.   list(APPEND llwindow_SOURCE_FILES
  61.     llkeyboardmacosx.cpp
  62.     llwindowmacosx.cpp
  63.     llwindowmacosx-objc.mm
  64.     )
  65.   list(APPEND llwindow_HEADER_FILES
  66.     llkeyboardmacosx.h
  67.     llwindowmacosx.h
  68.     llwindowmacosx-objc.h
  69.     )
  70.   # We use a bunch of deprecated system APIs.
  71.   set_source_files_properties(
  72.       llkeyboardmacosx.cpp
  73.       llwindowmacosx.cpp
  74.       PROPERTIES
  75.       COMPILE_FLAGS "-Wno-deprecated-declarations -fpascal-strings"
  76.       )
  77. endif (DARWIN)
  78. if (LINUX AND VIEWER)
  79.   list(APPEND viewer_SOURCE_FILES 
  80.        llkeyboardsdl.cpp 
  81.        llwindowsdl.cpp
  82.        )
  83.   list(APPEND viewer_HEADER_FILES
  84.        llkeyboardsdl.h
  85.        llwindowsdl.h
  86.        )
  87. endif (LINUX AND VIEWER)
  88. if (WINDOWS)
  89.   list(APPEND llwindow_SOURCE_FILES
  90.        llwindowwin32.cpp
  91.        lldxhardware.cpp
  92.        llkeyboardwin32.cpp
  93.        lldragdropwin32.cpp
  94.        )
  95.   list(APPEND llwindow_HEADER_FILES
  96.        llwindowwin32.h
  97.        lldxhardware.h
  98.        llkeyboardwin32.h
  99.        lldragdropwin32.h
  100.        )
  101.   list(APPEND llwindow_LINK_LIBRARIES
  102.        comdlg32     # Common Dialogs for ChooseColor
  103.        ole32
  104.        )
  105. endif (WINDOWS)
  106. if (SOLARIS)
  107.   list(APPEND llwindow_SOURCE_FILES
  108.        llwindowsolaris.cpp
  109.        )
  110.   list(APPEND llwindow_HEADER_FILES
  111.        llwindowsolaris.h
  112.        )
  113. endif (SOLARIS)
  114. set_source_files_properties(${llwindow_HEADER_FILES}
  115.                             PROPERTIES HEADER_FILE_ONLY TRUE)
  116. if (SERVER AND NOT WINDOWS AND NOT DARWIN)
  117.   set(server_SOURCE_FILES
  118.        llwindowmesaheadless.cpp
  119.        )
  120.   set(server_HEADER_FILES
  121.        llwindowmesaheadless.h
  122.        )
  123.   copy_server_sources(
  124.       llwindow
  125.       )
  126.   set_source_files_properties(
  127.     ${server_SOURCE_FILES}
  128.     PROPERTIES
  129.     COMPILE_FLAGS "-DLL_MESA=1 -DLL_MESA_HEADLESS=1"
  130.     )
  131.   add_library (llwindowheadless
  132.     ${llwindow_SOURCE_FILES}
  133.     ${server_SOURCE_FILES}
  134.     )
  135.   target_link_libraries (llwindowheadless ${llwindow_LINK_LIBRARIES})
  136. endif (SERVER AND NOT WINDOWS AND NOT DARWIN)
  137. if (llwindow_HEADER_FILES)
  138.   list(APPEND llwindow_SOURCE_FILES ${llwindow_HEADER_FILES})
  139. endif (llwindow_HEADER_FILES)
  140.   list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES})
  141. if (VIEWER)
  142.   add_library (llwindow
  143.     ${llwindow_SOURCE_FILES}
  144.     ${viewer_SOURCE_FILES}
  145.     )
  146.   target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES})
  147. endif (VIEWER)