diff options
author | Joerg Mayer <jmayer@loplof.de> | 2014-09-18 08:05:48 +0200 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2014-09-18 07:02:00 +0000 |
commit | 3b46e6eaf61a29f9bd8f8c162caa54cc2ea81fe2 (patch) | |
tree | 529bfa2bd7e8a0da4b95b392efa9c8a834e04789 /cmake | |
parent | 84629f43cb6c19ca2e0e512ac2429584925be896 (diff) | |
download | wireshark-3b46e6eaf61a29f9bd8f8c162caa54cc2ea81fe2.tar.gz |
Having CmakeListsCustom.txt in git defeats the purpose of its existence:
If it is used, there is a modified file in git.
Fix this by only including the file if it exists.
Other changes:
- Rename the existing Custom files to CMakeListsCustom.txt.example.
- Move the plugins custom file to the top level (same level as its
including parent).
- Optionally allow a list of custom includes instead of the default one.
Change-Id: I8960eac6222f741c045055d43d1d5a2d4979caf6
Reviewed-on: https://code.wireshark.org/review/4163
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/UseCustomIncludes.cmake | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cmake/modules/UseCustomIncludes.cmake b/cmake/modules/UseCustomIncludes.cmake new file mode 100644 index 0000000000..15e93f7043 --- /dev/null +++ b/cmake/modules/UseCustomIncludes.cmake @@ -0,0 +1,20 @@ +# +# - Include a custom CMake file relative to the current source directory. +# - If no filename is provided, CMakeListsCustom.txt is used. +# +macro( ADD_CUSTOM_CMAKE_INCLUDE ) + if( ${ARGN} ) + set( _file_list ${ARGN} ) + else() + set( _file_list CMakeListsCustom.txt ) + endif() + foreach (_include ${_file_list}) + set( _include_file ${CMAKE_CURRENT_SOURCE_DIR}/${_include} ) + if( EXISTS ${_include_file} ) + message ( STATUS "Including ${_include_file}" ) + include( ${_include_file} ) + else() + message ( STATUS "No custom file found in ${CMAKE_CURRENT_SOURCE_DIR}" ) + endif() + endforeach() +endmacro() |