CMakeLists.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # -*- cmake -*-
  2. project(llfilesystem)
  3. include(00-Common)
  4. include(LLCommon)
  5. set(llfilesystem_SOURCE_FILES
  6. lldir.cpp
  7. lldiriterator.cpp
  8. lldiskcache.cpp
  9. llfilesystem.cpp
  10. )
  11. set(llfilesystem_HEADER_FILES
  12. CMakeLists.txt
  13. lldir.h
  14. lldiriterator.h
  15. lldiskcache.h
  16. llfilesystem.h
  17. )
  18. if (DARWIN)
  19. LIST(APPEND llfilesystem_SOURCE_FILES lldir_macos.cpp)
  20. LIST(APPEND llfilesystem_SOURCE_FILES lldir_macos_objc.mm)
  21. LIST(APPEND llfilesystem_HEADER_FILES lldir_macos_objc.h)
  22. endif (DARWIN)
  23. if (LINUX)
  24. LIST(APPEND llfilesystem_SOURCE_FILES lldir_linux.cpp)
  25. endif (LINUX)
  26. if (WINDOWS)
  27. LIST(APPEND llfilesystem_SOURCE_FILES lldir_windows.cpp)
  28. endif (WINDOWS)
  29. set_source_files_properties(${llfilesystem_HEADER_FILES}
  30. PROPERTIES HEADER_FILE_ONLY TRUE)
  31. list(APPEND llfilesystem_SOURCE_FILES ${llfilesystem_HEADER_FILES})
  32. add_library (llfilesystem ${llfilesystem_SOURCE_FILES})
  33. add_dependencies(llfilesystem prepare)
  34. if (DARWIN)
  35. include(CMakeFindFrameworks)
  36. find_library(COCOA_LIBRARY Cocoa)
  37. endif (DARWIN)
  38. target_link_libraries(llfilesystem
  39. ${COCOA_LIBRARY}
  40. ${BOOST_FILESYSTEM_LIBRARY}
  41. )
  42. if (NOT ${CMAKE_VERSION} VERSION_LESS "3.16.0")
  43. if (USEUNITYBUILD)
  44. set_target_properties(llfilesystem PROPERTIES UNITY_BUILD ON UNITY_BUILD_BATCH_SIZE 0)
  45. else (USEUNITYBUILD)
  46. target_precompile_headers(llfilesystem PRIVATE <linden_common.h>)
  47. endif (USEUNITYBUILD)
  48. endif ()
  49. get_directory_property(ALLDEFINES COMPILE_DEFINITIONS)
  50. message("llfilesystem COMPILE_DEFINITIONS = ${ALLDEFINES}")