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

游戏引擎

开发平台:

C++ Builder

  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.     
  57. set(lscript_compile_HEADER_FILES
  58.     CMakeLists.txt
  59.     indra.l
  60.     indra.y
  61.     ../lscript_alloc.h
  62.     ../lscript_byteformat.h
  63.     ../lscript_byteconvert.h
  64.     ../lscript_http.h
  65.     lscript_error.h
  66.     lscript_bytecode.h
  67.     lscript_heap.h
  68.     lscript_resource.h
  69.     lscript_scope.h
  70.     lscript_tree.h
  71.     lscript_typecheck.h
  72.     )
  73. set_source_files_properties(${lscript_compile_HEADER_FILES}
  74.                             PROPERTIES HEADER_FILE_ONLY TRUE)
  75. set_source_files_properties(${lscript_generated_SOURCE_FILES}
  76.                             PROPERTIES HEADER_FILE_ONLY FALSE GENERATED TRUE)
  77. list(APPEND lscript_compile_SOURCE_FILES ${lscript_generated_SOURCE_FILES} ${lscript_compile_HEADER_FILES})
  78. add_custom_command(
  79.     OUTPUT
  80.       ${CMAKE_CURRENT_BINARY_DIR}/indra.l.cpp
  81.     COMMAND ${FLEX}
  82.     ARGS
  83.       -o${CMAKE_CURRENT_BINARY_DIR}/indra.l.cpp
  84.       ${CMAKE_CURRENT_SOURCE_DIR}/indra.l
  85.     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/indra.l
  86.     )
  87. if (WINDOWS)
  88.   set_source_files_properties(indra.l.cpp
  89.                               PROPERTIES COMPILE_FLAGS /DYY_NO_UNISTD_H)
  90. endif (WINDOWS)
  91. if (WINDOWS)
  92.   get_filename_component(M4_PATH ${M4} PATH)
  93.   add_custom_command(
  94.       OUTPUT
  95.         ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
  96.         ${CMAKE_CURRENT_BINARY_DIR}/indra.y.hpp
  97.       COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bison.bat
  98.         ${BISON} ${M4_PATH}
  99.         ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
  100.         ${CMAKE_CURRENT_SOURCE_DIR}/indra.y
  101.       DEPENDS
  102.         ${CMAKE_CURRENT_SOURCE_DIR}/bison.bat
  103.         ${CMAKE_CURRENT_SOURCE_DIR}/indra.y
  104.       )
  105.   include_directories(${CMAKE_CURRENT_SOURCE_DIR}/windows)
  106. else (WINDOWS)
  107.   add_custom_command(
  108.       OUTPUT
  109.         ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
  110.         ${CMAKE_CURRENT_BINARY_DIR}/indra.y.hpp
  111.       COMMAND
  112.         ${BISON}
  113.       ARGS
  114.         -d -o ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
  115.         ${CMAKE_CURRENT_SOURCE_DIR}/indra.y
  116.       DEPENDS
  117.         ${CMAKE_CURRENT_SOURCE_DIR}/indra.y
  118.       )
  119. endif (WINDOWS)
  120. if (DARWIN)
  121.   # Mac OS X 10.4 compatibility
  122.   add_custom_command(
  123.     OUTPUT
  124.       ${CMAKE_CURRENT_BINARY_DIR}/indra.y.hpp
  125.     COMMAND
  126.       mv
  127.       ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp.h
  128.       ${CMAKE_CURRENT_BINARY_DIR}/indra.y.hpp
  129.     )
  130. endif (DARWIN)
  131. add_library (lscript_compile ${lscript_compile_SOURCE_FILES})