LLWindow.cmake 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # -*- cmake -*-
  2. if (LLWINDOW_CMAKE_INCLUDED)
  3. return()
  4. endif (LLWINDOW_CMAKE_INCLUDED)
  5. set (LLWINDOW_CMAKE_INCLUDED TRUE)
  6. include(00-BuildOptions)
  7. include(Prebuilt)
  8. if (LINUX)
  9. if (USESYSTEMLIBS)
  10. set(SDL2_FIND_QUIETLY ON)
  11. set(SDL2_FIND_REQUIRED OFF)
  12. include(FindSDL2)
  13. # This should be done by FindSDL2.
  14. mark_as_advanced(
  15. SDLMAIN_LIBRARY
  16. SDL2_INCLUDE_DIR
  17. SDL2_LIBRARY
  18. )
  19. set (SDL_LIBRARY ${SDL2_LIBRARY})
  20. set (SDL_INCLUDE_DIR ${SDL2_INCLUDE_DIR})
  21. endif (USESYSTEMLIBS)
  22. if (NOT SDL_INCLUDE_DIR)
  23. use_prebuilt_binary(libSDL2)
  24. set (SDL_LIBRARY SDL2)
  25. set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
  26. set (SDL_FOUND "YES")
  27. endif (NOT SDL_INCLUDE_DIR)
  28. include_directories(SYSTEM ${SDL2_INCLUDE_DIR})
  29. endif (LINUX)
  30. include_directories(
  31. # Note: GL/ includes are inside llrender
  32. ${CMAKE_SOURCE_DIR}/llrender
  33. ${CMAKE_SOURCE_DIR}/llwindow
  34. )
  35. set(LLWINDOW_LIBRARIES llwindow)
  36. # llwindowsdl.cpp uses X11 and fontconfig...
  37. if (LINUX)
  38. list(APPEND LLWINDOW_LIBRARIES X11)
  39. if (USESYSTEMLIBS)
  40. include(FindPkgConfig)
  41. pkg_check_modules(FONTCONFIG REQUIRED fontconfig)
  42. link_directories(${FONTCONFIG_LIBRARY_DIRS})
  43. list(APPEND LLWINDOW_LIBRARIES ${FONTCONFIG_LIBRARIES})
  44. else (USESYSTEMLIBS)
  45. use_prebuilt_binary(fontconfig)
  46. list(APPEND LLWINDOW_LIBRARIES fontconfig)
  47. set(FONTCONFIG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/fontconfig)
  48. endif (USESYSTEMLIBS)
  49. include_directories(SYSTEM ${FONTCONFIG_INCLUDE_DIRS})
  50. endif (LINUX)
  51. # llwindowwin32.cpp and lldxhardware.cpp use COMDLG32, IMM32, WMI and DXGI.
  52. if (WINDOWS)
  53. list(APPEND LLWINDOW_LIBRARIES comdlg32 imm32 wbemuuid dxgi)
  54. endif (WINDOWS)