Advertisement
tangentia

CMakeLists.txt for LUA 5.3

May 28th, 2024
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 2.27 KB | Source Code | 0 0
  1. project ( lua C )
  2. cmake_minimum_required ( VERSION 2.8 )
  3.  
  4. include(GNUInstallDirs)
  5.  
  6. include_directories ( src ${CMAKE_CURRENT_BINARY_DIR} )
  7. set ( SRC_CORE src/lapi.c src/lcode.c src/lctype.c src/ldebug.c src/ldo.c src/ldump.c src/lfunc.c src/lgc.c src/llex.c
  8.   src/lmem.c src/lobject.c src/lopcodes.c src/lparser.c src/lstate.c src/lstring.c src/ltable.c
  9.   src/ltm.c src/lundump.c src/lvm.c src/lzio.c )
  10. set ( SRC_LIB src/lauxlib.c src/lbaselib.c src/lbitlib.c src/lcorolib.c src/ldblib.c src/liolib.c
  11.   src/lmathlib.c src/loslib.c src/lstrlib.c src/ltablib.c src/lutf8lib.c src/loadlib.c src/linit.c )
  12.  
  13. set ( SRC_LUA src/lua.c )
  14. set ( SRC_LUAC src/luac.c )
  15.  
  16. add_library ( liblua ${SRC_CORE} ${SRC_LIB} )
  17. set_target_properties ( liblua PROPERTIES OUTPUT_NAME lua )
  18.  
  19. add_library ( libluadll SHARED ${SRC_CORE} ${SRC_LIB} )
  20. target_compile_definitions ( libluadll PRIVATE _CRT_SECURE_NO_WARNINGS LUA_BUILD_AS_DLL LUA_COMPAT_ALL )
  21. set_target_properties ( libluadll PROPERTIES OUTPUT_NAME lua53 )
  22.  
  23. add_executable ( lua ${SRC_LUA} )
  24. target_link_libraries ( lua libluadll )
  25.  
  26. add_executable ( luac ${SRC_LUAC} )
  27. target_link_libraries ( luac liblua )
  28.  
  29. set ( LUA_INCLUDES src/lua.h src/lualib.h src/lauxlib.h src/lua.hpp src/luaconf.h )
  30.  
  31. # Installation
  32. if(NOT BUNDLED_MODE)
  33.   install(
  34.     TARGETS lua
  35.     RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
  36.   )
  37.  
  38.   install(
  39.     TARGETS luac
  40.     RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
  41.   )
  42.  
  43.   install(
  44.     TARGETS liblua
  45.     ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
  46.     LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
  47.     RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
  48.   )
  49.  
  50.   install(
  51.     TARGETS libluadll
  52.     ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
  53.     LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
  54.     RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
  55.   )
  56.  
  57.   install(
  58.     FILES src/lua.h src/lualib.h src/lauxlib.h src/lua.hpp src/luaconf.h
  59.     DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
  60.   )
  61. endif()
  62.  
  63.  
  64. ## install_executable ( lua luac )
  65. ## install_library ( liblua )
  66. ## install_data ( README.md )
  67. ## #install_lua_module ( strict etc/strict.lua )
  68. ## install_header ( src/lua.h src/lualib.h src/lauxlib.h src/lua.hpp ${CMAKE_CURRENT_BINARY_DIR}/luaconf.h )
  69. ## #install_doc ( doc/ )
  70. ## #install_test ( test/ )
  71.  
  72.  
Tags: cmake
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement