diff --git a/3rdparty/cmake/CopyImportFiles.cmake b/3rdparty/cmake/CopyImportFiles.cmake new file mode 100644 index 0000000000..73ef39dc4c --- /dev/null +++ b/3rdparty/cmake/CopyImportFiles.cmake @@ -0,0 +1,22 @@ +function(copy_import_files SRC_DIR DST_DIR FILE_LIST) + + file(MAKE_DIRECTORY ${DST_DIR}) + + file(GLOB FILES_IMPORTED + LIST_DIRECTORIES false + RELATIVE ${DST_DIR}/ ${DST_DIR}/*) + + + # message("files to import are: " "${FILE_LIST}") + # message("Already made fs are: " "${FILES_IMPORTED}") + + list(REMOVE_ITEM FILE_LIST ${FILES_IMPORTED}) + + # message(" rest of files are: " ${FILE_LIST}) + + foreach(FILE ${FILE_LIST}) + message("Importing ${FILE}") + file(COPY ${SRC_DIR}/${FILE} DESTINATION ${DST_DIR}) + endforeach() +endfunction() + diff --git a/CMakeLists.txt b/CMakeLists.txt index 612223031e..1deab2cf50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,5 +58,12 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib/${suffixInsta set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +# For windows, we need to copy scripts over +if (WIN32) + +endif() + +add_subdirectory(db) +add_subdirectory(conf) add_subdirectory(3rdparty) add_subdirectory(src) diff --git a/conf/CMakeLists.txt b/conf/CMakeLists.txt new file mode 100644 index 0000000000..66c76bd982 --- /dev/null +++ b/conf/CMakeLists.txt @@ -0,0 +1,35 @@ +include(CopyImportFiles) + +set(CONF_FILES_TO_IMPORT + "atcommands.yml" + "battle_conf.txt" + "char_conf.txt" + "groups.yml" + "inter_conf.txt" + "inter_server.yml" + "log_conf.txt" + "login_conf.txt" + "map_conf.txt" + "packet_conf.txt" + "script_conf.txt" + "web_conf.txt") + +copy_import_files(${CMAKE_CURRENT_SOURCE_DIR}/import-tmpl/ + ${CMAKE_CURRENT_SOURCE_DIR}/import + "${CONF_FILES_TO_IMPORT}") + +set(MSG_FILES_TO_IMPORT + "map_msg_chn_conf.txt" + "map_msg_eng_conf.txt" + "map_msg_frn_conf.txt" + "map_msg_grm_conf.txt" + "map_msg_idn_conf.txt" + "map_msg_mal_conf.txt" + "map_msg_por_conf.txt" + "map_msg_rus_conf.txt" + "map_msg_spn_conf.txt" + "map_msg_tha_conf.txt") + +copy_import_files(${CMAKE_CURRENT_SOURCE_DIR}/msg_conf/import-tmpl/ + ${CMAKE_CURRENT_SOURCE_DIR}/msg_conf/import + "${MSG_FILES_TO_IMPORT}") diff --git a/db/CMakeLists.txt b/db/CMakeLists.txt new file mode 100644 index 0000000000..8c73ff86dd --- /dev/null +++ b/db/CMakeLists.txt @@ -0,0 +1,72 @@ +include(CopyImportFiles) + +# Why do we list all the files instead of using glob? +# This way, if we add a new file, the build system will know to regenerate +# and the new file will be copied over. + +set(DB_FILES_TO_IMPORT + "abra_db.yml" + "achievement_db.yml" + "achievement_level_db.yml" + "attendance.yml" + "attr_fix.yml" + "battleground_db.yml" + "captcha_db.yml" + "castle_db.yml" + "const.yml" + "create_arrow_db.yml" + "elemental_db.yml" + "enchantgrade.yml" + "exp_guild.yml" + "exp_homun.yml" + "guild_skill_tree.yml" + "homunculus_db.yml" + "instance_db.yml" + "item_cash.yml" + "item_combos.yml" + "item_db.yml" + "item_enchant.yml" + "item_group_db.yml" + "item_noequip.txt" + "item_packages.yml" + "item_randomopt_db.yml" + "item_randomopt_group.yml" + "item_reform.yml" + "job_noenter_map.txt" + "job_stats.yml" + "laphine_synthesis.yml" + "laphine_upgrade.yml" + "level_penalty.yml" + "magicmushroom_db.yml" + "map_cache.dat" + "map_drops.yml" + "map_index.txt" + "mercenary_db.yml" + "mob_avail.yml" + "mob_chat_db.yml" + "mob_db.yml" + "mob_item_ratio.yml" + "mob_skill_db.txt" + "mob_summon.yml" + "pet_db.yml" + "produce_db.txt" + "quest_db.yml" + "refine.yml" + "reputation_group.yml" + "reputation.yml" + "size_fix.yml" + "skill_changematerial_db.txt" + "skill_damage_db.txt" + "skill_db.yml" + "skill_nocast_db.txt" + "skill_tree.yml" + "spellbook_db.yml" + "statpoint.yml" + "status_disabled.txt" + "status.yml" + "stylist.yml" +) + +copy_import_files(${CMAKE_CURRENT_SOURCE_DIR}/import-tmpl/ + ${CMAKE_CURRENT_SOURCE_DIR}/import + "${DB_FILES_TO_IMPORT}")