CMakeLists.txt 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  3. #
  4. # SPDX-License-Identifier: Apache-2.0 OR MIT
  5. #
  6. #
  7. # CMake definition for Lua 5.3.5
  8. cmake_minimum_required(VERSION 3.17)
  9. PROJECT ( lua )
  10. # Headers
  11. SET(HDR_LIBLUA
  12. lapi.h
  13. lauxlib.h
  14. lcode.h
  15. lctype.h
  16. ldebug.h
  17. ldo.h
  18. lfunc.h
  19. lgc.h
  20. llex.h
  21. llimits.h
  22. lmem.h
  23. lobject.h
  24. lopcodes.h
  25. lparser.h
  26. lprefix.h
  27. lstate.h
  28. lstring.h
  29. ltable.h
  30. ltests.h
  31. ltm.h
  32. lua.h
  33. luaconf.h
  34. lualib.h
  35. lundump.h
  36. lvm.h
  37. lzio.h
  38. )
  39. # Build Libraries
  40. SET(SRC_LIBLUA
  41. lapi.c
  42. lauxlib.c
  43. lbaselib.c
  44. lbitlib.c
  45. lcode.c
  46. lcorolib.c
  47. lctype.c
  48. ldblib.c
  49. ldebug.c
  50. ldo.c
  51. ldump.c
  52. lfunc.c
  53. lgc.c
  54. linit.c
  55. liolib.c
  56. llex.c
  57. lmathlib.c
  58. lmem.c
  59. loadlib.c
  60. lobject.c
  61. lopcodes.c
  62. loslib.c
  63. lparser.c
  64. lstate.c
  65. lstring.c
  66. lstrlib.c
  67. ltable.c
  68. ltablib.c
  69. ltests.c
  70. ltm.c
  71. lundump.c
  72. lutf8lib.c
  73. lvm.c
  74. lzio.c
  75. )
  76. LIST(APPEND SRC_LIBLUA ${HDR_LIBLUA})
  77. #Library
  78. ADD_LIBRARY ( lualib STATIC ${SRC_LIBLUA} )
  79. TARGET_LINK_LIBRARIES (lualib)
  80. target_include_directories( lualib PUBLIC include/ )
  81. set_target_properties(lualib
  82. PROPERTIES
  83. ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/lib/debug/"
  84. ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/lib/release/"
  85. LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/lib/debug/"
  86. LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/lib/release/"
  87. RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin/debug/"
  88. RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin/release/"
  89. PUBLIC_HEADER "${HDR_LIBLUA}"
  90. )
  91. include(GNUInstallDirs)
  92. install(TARGETS lualib
  93. PUBLIC_HEADER
  94. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Lua
  95. LIBRARY
  96. DESTINATION ${CMAKE_INSTALL_LIBDIR}/$<$<CONFIG:Debug>:debug>$<$<CONFIG:Release>:release>
  97. RUNTIME
  98. DESTINATION ${CMAKE_INSTALL_BINDIR}/$<$<CONFIG:Debug>:debug>$<$<CONFIG:Release>:release>
  99. ARCHIVE
  100. DESTINATION ${CMAKE_INSTALL_LIBDIR}/$<$<CONFIG:Debug>:debug>$<$<CONFIG:Release>:release>
  101. )