diff --git a/CMakeLists.txt b/CMakeLists.txt index 15118fdb0e6..02dd72ac794 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -220,46 +220,6 @@ if(APPLE) endif() endif() -file(GLOB_RECURSE lua_files RELATIVE "${CMAKE_HOME_DIRECTORY}/src/mudlet-lua/lua/" "${CMAKE_HOME_DIRECTORY}/src/mudlet-lua/lua/*.lua") -list(LENGTH lua_files lua_file_count) -if(lua_file_count EQUAL 28) - message(STATUS "Found Mudlet & Geyser lua files") -else() - message(WARNING "Found ${lua_file_count} Mudlet & Geyser lua files but 28 were expected:") - foreach(lua_file ${lua_files}) - message(STATUS " ${lua_file}") - endforeach(lua_file) -endif() - -file(GLOB_RECURSE lua_test_files RELATIVE "${CMAKE_HOME_DIRECTORY}/src/mudlet-lua/tests/" "${CMAKE_HOME_DIRECTORY}/src/mudlet-lua/tests/*.lua") -list(LENGTH lua_test_files lua_test_file_count) -if(lua_test_file_count EQUAL 5) - message(STATUS "Found Mudlet Lua test files") -else() - message(WARNING "Found ${lua_test_file_count} Mudlet Lua test files but 5 were expected:") - foreach(lua_test_file ${lua_test_files}) - message(STATUS " ${lua_test_file}") - endforeach() -endif() - -if(EXISTS "${CMAKE_HOME_DIRECTORY}/3rdparty/lcf/lcf-scm-1.rockspec") - file(GLOB_RECURSE lcf_files RELATIVE "${CMAKE_HOME_DIRECTORY}/3rdparty/" "${CMAKE_HOME_DIRECTORY}/3rdparty/lcf/*") - list(REMOVE_ITEM lcf_files "lcf/.git") - list(LENGTH lcf_files lcf_file_count) - if(lcf_file_count EQUAL 275) - message(STATUS "Found Lua Code Formatter files") - else() - message(WARNING "Found ${lcf_file_count} Lua Code Formatter files but 275 were expected:") - foreach(lcf_file ${lcf_files}) - message(STATUS " ${lcf_file}") - endforeach(lcf_file) - endif() -elseif() - message(FATAL_ERROR "Cannot locate lua code formatter submodule source code, build abandoned!") -endif() - - - find_program(CCACHE_FOUND ccache) if(CCACHE_FOUND) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d02baf6bc4c..573ae682144 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -311,7 +311,6 @@ endif() if(UNIX) set(LUA_DEFAULT_DIR "${CMAKE_INSTALL_PREFIX}/share/mudlet/lua") - set(LCF_DIR "${CMAKE_INSTALL_PREFIX}/share/mudlet/lua/lcf") endif(UNIX) # Define a preprocessor symbol with the default fallback location from which @@ -400,30 +399,24 @@ target_compile_options(mudlet if(UNIX) # CMAKE_INSTALL_PREFIX is automagically set on Unix to DESTDIR environment # variable and is prefixed onto relative DESTINATION values - foreach(lua_file ${lua_files}) - get_filename_component(lua_file_name ${lua_file} NAME) - get_filename_component(lua_file_path ${lua_file} DIRECTORY) - install(FILES "${CMAKE_HOME_DIRECTORY}/src/mudlet-lua/lua/${lua_file}" - DESTINATION "share/mudlet/lua/${lua_file_path}" - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - CONFIGURATIONS Debug Release) - endforeach() - foreach(lua_test_file ${lua_test_files}) - get_filename_component(lua_test_file_name ${lua_test_file} NAME) - get_filename_component(lua_test_file_path ${lua_test_file} DIRECTORY) - install(FILES "${CMAKE_HOME_DIRECTORY}/src/mudlet-lua/tests/${lua_test_file}" - DESTINATION "share/mudlet/tests/${lua_test_file_path}" - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - CONFIGURATIONS Debug Release) - endforeach() - foreach(lcf_file ${lcf_files}) - get_filename_component(lcf_file_name ${lcf_file} NAME) - get_filename_component(lcf_file_path ${lcf_file} DIRECTORY) - install(FILES "${CMAKE_HOME_DIRECTORY}/3rdparty/${lcf_file}" - DESTINATION "share/mudlet/lua/${lcf_file_path}" - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - CONFIGURATIONS Debug Release) - endforeach(lcf_file) + install( + DIRECTORY "mudlet-lua/lua" + DESTINATION "share/mudlet" + FILES_MATCHING PATTERN "*.lua" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) + install( + DIRECTORY "mudlet-lua/tests" + DESTINATION "share/mudlet" + FILES_MATCHING PATTERN "*.lua" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) + install( + DIRECTORY "../3rdparty/lcf" + DESTINATION "share/mudlet/lua" + PATTERN ".git" EXCLUDE + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) install(TARGETS mudlet RUNTIME DESTINATION "bin"