Eluna add support for extentions and create lua_scripts folder automatically again

This commit is contained in:
Rochet2
2014-04-19 01:02:31 +03:00
committed by Foereaper
parent 4537a7f8f0
commit ab617b4f7f

View File

@@ -132,3 +132,25 @@ target_link_libraries(LuaEngine
)
add_dependencies(LuaEngine game)
if( WIN32 )
if ( MSVC )
add_custom_command(TARGET LuaEngine
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/lua_scripts/extensions/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/extensions ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/lua_scripts/extensions/
)
elseif ( MINGW )
add_custom_command(TARGET LuaEngine
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/lua_scripts/extensions/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/extensions ${CMAKE_BINARY_DIR}/bin/lua_scripts/extensions/
)
endif()
endif()
if( UNIX )
install(DIRECTORY extensions DESTINATION bin/lua_scripts/)
elseif( WIN32 )
install(DIRECTORY extensions DESTINATION "${CMAKE_INSTALL_PREFIX}/lua_scripts/")
endif()