PageRenderTime 47ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/lscript/lscript_compile/CMakeLists.txt

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 150 lines | 128 code | 20 blank | 2 comment | 4 complexity | 63f2c03569e164bb287c4fbe404b3558 MD5 | raw file
Possible License(s): LGPL-2.1
  1. # -*- cmake -*-
  2. include(00-Common)
  3. include(LLCommon)
  4. include(LLMath)
  5. include(LLMessage)
  6. include(LLInventory)
  7. include(LLPrimitive)
  8. include(LScript)
  9. include(FindCygwin)
  10. find_program(FLEX flex
  11. "C:/Program Files/GnuWin32/bin"
  12. ${CYGWIN_INSTALL_PATH}/bin
  13. /bin
  14. /usr/bin
  15. /usr/local/bin
  16. )
  17. mark_as_advanced(FLEX)
  18. find_program(BISON bison
  19. "C:/Program Files/GnuWin32/bin"
  20. ${CYGWIN_INSTALL_PATH}/bin
  21. /bin
  22. /usr/bin
  23. /usr/local/bin
  24. )
  25. mark_as_advanced(BISON)
  26. find_program(M4 m4
  27. "C:/Program Files/GnuWin32/bin"
  28. ${CYGWIN_INSTALL_PATH}/bin
  29. /bin
  30. /usr/bin
  31. /usr/local/bin
  32. )
  33. mark_as_advanced(M4)
  34. include_directories(
  35. ${LLCOMMON_INCLUDE_DIRS}
  36. ${LLMATH_INCLUDE_DIRS}
  37. ${LLMESSAGE_INCLUDE_DIRS}
  38. ${LLINVENTORY_INCLUDE_DIRS}
  39. ${LLPRIMITIVE_INCLUDE_DIRS}
  40. ${LSCRIPT_INCLUDE_DIRS}
  41. )
  42. set(lscript_generated_SOURCE_FILES
  43. indra.l.cpp
  44. indra.y.cpp
  45. )
  46. set(lscript_compile_SOURCE_FILES
  47. lscript_alloc.cpp
  48. lscript_bytecode.cpp
  49. lscript_error.cpp
  50. lscript_heap.cpp
  51. lscript_resource.cpp
  52. lscript_scope.cpp
  53. lscript_tree.cpp
  54. lscript_typecheck.cpp
  55. )
  56. set(lscript_compile_HEADER_FILES
  57. CMakeLists.txt
  58. indra.l
  59. indra.y
  60. ../lscript_alloc.h
  61. ../lscript_byteformat.h
  62. ../lscript_byteconvert.h
  63. ../lscript_http.h
  64. lscript_error.h
  65. lscript_bytecode.h
  66. lscript_heap.h
  67. lscript_resource.h
  68. lscript_scope.h
  69. lscript_tree.h
  70. lscript_typecheck.h
  71. )
  72. set_source_files_properties(${lscript_compile_HEADER_FILES}
  73. PROPERTIES HEADER_FILE_ONLY TRUE)
  74. set_source_files_properties(${lscript_generated_SOURCE_FILES}
  75. PROPERTIES HEADER_FILE_ONLY FALSE GENERATED TRUE)
  76. list(APPEND lscript_compile_SOURCE_FILES ${lscript_generated_SOURCE_FILES} ${lscript_compile_HEADER_FILES})
  77. add_custom_command(
  78. OUTPUT
  79. ${CMAKE_CURRENT_BINARY_DIR}/indra.l.cpp
  80. COMMAND ${FLEX}
  81. ARGS
  82. -o${CMAKE_CURRENT_BINARY_DIR}/indra.l.cpp
  83. ${CMAKE_CURRENT_SOURCE_DIR}/indra.l
  84. DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/indra.l
  85. )
  86. if (WINDOWS)
  87. set_source_files_properties(indra.l.cpp
  88. PROPERTIES COMPILE_FLAGS /DYY_NO_UNISTD_H)
  89. endif (WINDOWS)
  90. if (WINDOWS)
  91. get_filename_component(M4_PATH ${M4} PATH)
  92. add_custom_command(
  93. OUTPUT
  94. ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
  95. ${CMAKE_CURRENT_BINARY_DIR}/indra.y.hpp
  96. COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bison.bat
  97. ${BISON} ${M4_PATH}
  98. ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
  99. ${CMAKE_CURRENT_SOURCE_DIR}/indra.y
  100. DEPENDS
  101. ${CMAKE_CURRENT_SOURCE_DIR}/bison.bat
  102. ${CMAKE_CURRENT_SOURCE_DIR}/indra.y
  103. )
  104. include_directories(${CMAKE_CURRENT_SOURCE_DIR}/windows)
  105. else (WINDOWS)
  106. add_custom_command(
  107. OUTPUT
  108. ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
  109. ${CMAKE_CURRENT_BINARY_DIR}/indra.y.hpp
  110. COMMAND
  111. ${BISON}
  112. ARGS
  113. -d -o ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
  114. ${CMAKE_CURRENT_SOURCE_DIR}/indra.y
  115. DEPENDS
  116. ${CMAKE_CURRENT_SOURCE_DIR}/indra.y
  117. )
  118. endif (WINDOWS)
  119. if (DARWIN)
  120. # Mac OS X 10.4 compatibility
  121. add_custom_command(
  122. OUTPUT
  123. ${CMAKE_CURRENT_BINARY_DIR}/indra.y.hpp
  124. COMMAND
  125. mv
  126. ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp.h
  127. ${CMAKE_CURRENT_BINARY_DIR}/indra.y.hpp
  128. )
  129. endif (DARWIN)
  130. add_library (lscript_compile ${lscript_compile_SOURCE_FILES})