diff options
author | David Strickland <Davidstrickland0@hotmail.com> | 2022-08-25 15:30:24 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-25 17:30:24 -0300 |
commit | 89251253506d3d1a6baabdf4b40306941789774b (patch) | |
tree | 69083d0a829768eccfad16a69accc3d5ab88c768 | |
parent | 11bac9ace104021c54267f6ff23152feb0dc7dcc (diff) |
feat(CMake): Minor CMake Update to Modules Cmake File to Allow Custom Modules to make changes without changing Core. (#12846)
* Added in a the ability for module developers to create a cmake file that gets run inline with the module CMakeLists.txt. Minor Perf hit on the build but will allow for Modules to be more flexible in how they work with CMake.
* Comments and Documentation
-rw-r--r-- | modules/CMakeLists.txt | 5 | ||||
-rw-r--r-- | modules/how_to_make_a_module.md | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index a8d199edfd..afdfe2c5a5 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -288,6 +288,11 @@ target_include_directories(modules ${CMAKE_CURRENT_SOURCE_DIR} ${PUBLIC_INCLUDES}) +# Enables Devs to Include a cmake file in their module that will get run inline with the config. +foreach(SOURCE_MODULE ${MODULES_MODULE_LIST}) + include("${CMAKE_SOURCE_DIR}/modules/${SOURCE_MODULE}/${SOURCE_MODULE}.cmake" OPTIONAL) +endforeach() + set_target_properties(modules PROPERTIES FOLDER diff --git a/modules/how_to_make_a_module.md b/modules/how_to_make_a_module.md index 8a803c456a..52db7a86cf 100644 --- a/modules/how_to_make_a_module.md +++ b/modules/how_to_make_a_module.md @@ -18,3 +18,5 @@ NOTE: You can also clone our skeleton-module manually, clean the history, and co 3) Share it with the community! Join us on our discord, share it there, then we might fork it officially and it will appear in the module catalogue. + +Note: For Advanced CMake implementations a <ModuleName>.cmake file in your module folder will be included in the config of Modules if it exists. See: ./CMakeList.txt around line #290
\ No newline at end of file |