diff --git a/.gitmodules b/.gitmodules index b20d189ec..275772e0e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "depends/clsocket"] path = depends/clsocket url = git://github.com/DFHack/clsocket.git +[submodule "scripts/3rdparty/lethosor"] + path = scripts/3rdparty/lethosor + url = https://github.com/lethosor/dfhack-scripts diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a8dabd13..50fca68f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,6 +184,8 @@ IF(BUILD_PLUGINS) add_subdirectory (plugins) endif() +add_subdirectory(scripts) + # Packaging with CPack! IF(UNIX) if(APPLE) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 328443f48..e653555f9 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -376,6 +376,7 @@ install(DIRECTORY ${dfhack_SOURCE_DIR}/scripts DESTINATION ${DFHACK_DATA_DESTINATION} FILES_MATCHING PATTERN "*.lua" PATTERN "*.rb" + PATTERN "3rdparty" EXCLUDE ) install(DIRECTORY ${dfhack_SOURCE_DIR}/patches diff --git a/scripts/3rdparty/lethosor b/scripts/3rdparty/lethosor new file mode 160000 index 000000000..ceed207e3 --- /dev/null +++ b/scripts/3rdparty/lethosor @@ -0,0 +1 @@ +Subproject commit ceed207e38220e21067a91b8d6f7b9680a476f69 diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt new file mode 100644 index 000000000..ed5cc1ffc --- /dev/null +++ b/scripts/CMakeLists.txt @@ -0,0 +1,2 @@ +include(Scripts.cmake) +DFHACK_3RDPARTY_SCRIPT_REPO(lethosor) diff --git a/scripts/Scripts.cmake b/scripts/Scripts.cmake new file mode 100644 index 000000000..8ef0d1161 --- /dev/null +++ b/scripts/Scripts.cmake @@ -0,0 +1,19 @@ +include(../plugins/Plugins.cmake) + +MACRO(DFHACK_SCRIPTS) + PARSE_ARGUMENTS(SCRIPT + "SUBDIRECTORY" + "SOME_OPT" + ${ARGN} + ) + CAR(SCRIPT_SUBDIRECTORY ${SCRIPT_SUBDIRECTORY}) + install(FILES ${SCRIPT_DEFAULT_ARGS} + DESTINATION ${DFHACK_DATA_DESTINATION}/scripts/${SCRIPT_SUBDIRECTORY}) +ENDMACRO() + +MACRO(DFHACK_3RDPARTY_SCRIPT_REPO repo_path) + if(NOT EXISTS ${dfhack_SOURCE_DIR}/scripts/3rdparty/${repo_path}/CMakeLists.txt) + MESSAGE(FATAL_ERROR "Script submodule scripts/3rdparty/${repo_path} does not exist - run `git submodule update`.") + endif() + add_subdirectory(3rdparty/${repo_path}) +ENDMACRO()