diff options
| author | Barbz <BarbzYHOOL@users.noreply.github.com> | 2017-09-23 11:30:22 +0200 |
|---|---|---|
| committer | Yehonal <yehonal.azeroth@gmail.com> | 2017-09-23 11:30:22 +0200 |
| commit | efbcb8f65d35736cb7ecf6977237b47c07ae3292 (patch) | |
| tree | 807fce908b49540ad56c9b57cc952699f7a2be7c /src | |
| parent | 23cb1a18e546d6a51cdea2e2cd36f39fc6c8e888 (diff) | |
Fix CMake custom script (#658)
* CMake - CMake now detects custom scripts in the Custom directory
* CMake - CMake now detects the custom script headers
* CMake - Added an example in the README on how to make a CMakeLists.txt for a custom script
Diffstat (limited to 'src')
| -rw-r--r-- | src/scripts/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/scripts/Custom/README.md | 16 | ||||
| -rw-r--r-- | src/scripts/ScriptLoader.h | 1 |
3 files changed, 18 insertions, 1 deletions
diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index 769bf26c5e..27945f8391 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -51,7 +51,7 @@ if(SCRIPTS) include(Pet/CMakeLists.txt) endif() -if(EXISTS "Custom/CMakeLists.txt") +if(EXISTS "${AC_SCRIPTS_DIR}/Custom/CMakeLists.txt") include(Custom/CMakeLists.txt) endif() diff --git a/src/scripts/Custom/README.md b/src/scripts/Custom/README.md index 8473a630fd..7b9e83d4e0 100644 --- a/src/scripts/Custom/README.md +++ b/src/scripts/Custom/README.md @@ -8,3 +8,19 @@ add scripts to project solution. BTW, **We strongly suggest you** to use our module system to create your custom powerful module instead of simple scripts. + + + + +----------------- +CMakeLists.txt example: + +set(scripts_STAT_SRCS + ${scripts_STAT_SRCS} + ${AC_SCRIPTS_DIR}/Custom/your_script.cpp + ${AC_SCRIPTS_DIR}/Custom/your_script.h +) + +AC_ADD_SCRIPT_LOADER("Custom" "ScriptLoader.h") + +message(" -> Prepared: My custom scripts") diff --git a/src/scripts/ScriptLoader.h b/src/scripts/ScriptLoader.h index b9a86d3089..6ac5ef0fe2 100644 --- a/src/scripts/ScriptLoader.h +++ b/src/scripts/ScriptLoader.h @@ -7,6 +7,7 @@ #ifndef SC_SCRIPTLOADER_H #define SC_SCRIPTLOADER_H +void AddCustomScripts(); void AddScripts(); void AddSpellScripts(); void AddCommandScripts(); |
