Add a framework for including 3rd-party script repos
Repos need to include a CMakeLists.txt file with calls to the DFHACK_SCRIPTS macro, which functions similarly to DFHACK_PLUGIN. The `open-legends` script from lethosor/dfhack-scripts is included as an example.develop
parent
f46d3d137f
commit
418d2831ef
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 213826bd6feba0b16a582e0c4a74c5678ddc3be8
|
@ -0,0 +1,2 @@
|
|||||||
|
include(Scripts.cmake)
|
||||||
|
DFHACK_3RDPARTY_SCRIPT_REPO(lethosor)
|
@ -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()
|
Loading…
Reference in New Issue