mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
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
This commit is contained in:
@@ -51,7 +51,7 @@ if(SCRIPTS)
|
|||||||
include(Pet/CMakeLists.txt)
|
include(Pet/CMakeLists.txt)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(EXISTS "Custom/CMakeLists.txt")
|
if(EXISTS "${AC_SCRIPTS_DIR}/Custom/CMakeLists.txt")
|
||||||
include(Custom/CMakeLists.txt)
|
include(Custom/CMakeLists.txt)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -8,3 +8,19 @@ add scripts to project solution.
|
|||||||
|
|
||||||
BTW, **We strongly suggest you** to use our module system to create your custom
|
BTW, **We strongly suggest you** to use our module system to create your custom
|
||||||
powerful module instead of simple scripts.
|
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")
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#ifndef SC_SCRIPTLOADER_H
|
#ifndef SC_SCRIPTLOADER_H
|
||||||
#define SC_SCRIPTLOADER_H
|
#define SC_SCRIPTLOADER_H
|
||||||
|
|
||||||
|
void AddCustomScripts();
|
||||||
void AddScripts();
|
void AddScripts();
|
||||||
void AddSpellScripts();
|
void AddSpellScripts();
|
||||||
void AddCommandScripts();
|
void AddCommandScripts();
|
||||||
|
|||||||
Reference in New Issue
Block a user