CMakeLists.txt
changeset 9208 acb2492288e5
parent 9205 abce6011f86c
child 9211 6235925d0fa1
equal deleted inserted replaced
9207:16373565692a 9208:acb2492288e5
    18 
    18 
    19 #libraries are built shared unless explicitly added as a static
    19 #libraries are built shared unless explicitly added as a static
    20 option(BUILD_SHARED_LIBS "Build libraries as shared modules (on)" ON)
    20 option(BUILD_SHARED_LIBS "Build libraries as shared modules (on)" ON)
    21 #set this to ON when 2.1.0 becomes more widespread (and only for linux)
    21 #set this to ON when 2.1.0 becomes more widespread (and only for linux)
    22 option(PHYSFS_SYSTEM "Use system physfs (off)" OFF)
    22 option(PHYSFS_SYSTEM "Use system physfs (off)" OFF)
       
    23 
       
    24 if(WIN32 OR APPLE)
       
    25     option(LUA_SYSTEM "Use system lua (off)" OFF)
       
    26 else()
       
    27     option(LUA_SYSTEM "Use system lua (on)" ON)
       
    28 endif()
    23 
    29 
    24 option(BUILD_ENGINE_LIBRARY "Enable hwengine library (off)" OFF)
    30 option(BUILD_ENGINE_LIBRARY "Enable hwengine library (off)" OFF)
    25 option(ANDROID "Enable Android build (off)" OFF)
    31 option(ANDROID "Enable Android build (off)" OFF)
    26 
    32 
    27 if(UNIX AND NOT APPLE)
    33 if(UNIX AND NOT APPLE)
   133 endif()
   139 endif()
   134 
   140 
   135 include(${CMAKE_MODULE_PATH}/utils.cmake)
   141 include(${CMAKE_MODULE_PATH}/utils.cmake)
   136 
   142 
   137 #lua discovery
   143 #lua discovery
   138 find_package(Lua)
   144 if (${LUA_SYSTEM})
   139 if(LUA_FOUND)
   145     if (NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR)
   140     message(STATUS "Found LUA: ${LUA_DEFAULT}")
   146         find_package(Lua)
       
   147     endif()
       
   148 
       
   149     if (LUA_LIBRARY AND LUA_INCLUDE_DIR)
       
   150         set(LUA_FOUND TRUE)
       
   151     else()
       
   152         message(FATAL_ERROR "Missing Lua! Rerun cmake with -DLUA_SYSTEM=off to build the internal version")
       
   153     endif()
   141 else()
   154 else()
   142     message(STATUS "LUA will be provided by the bundled sources")
   155     message(STATUS "LUA will be provided by the bundled sources")
   143     add_subdirectory(misc/liblua)
   156     add_subdirectory(misc/liblua)
       
   157     set(lua_output_name "hwlua")
       
   158     list(APPEND pascal_flags "-XLAlua=${lua_output_name}" "-dLUA_INTERNAL")
   144 endif()
   159 endif()
   145 
   160 
   146 
   161 
   147 #physfs discovery
   162 #physfs discovery
   148 if (${PHYSFS_SYSTEM})
   163 if (${PHYSFS_SYSTEM})