diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2018-01-08 19:00:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-01-23 15:42:47 (GMT) |
commit | f4082b0e9b1ce139a29fba5951cec068862fe28b (patch) | |
tree | bd0b98178ade01773f5e4eecd56a909008b047bc /Modules | |
parent | 9c52b587b6dfa54266bcebbe7e111d7dde437a75 (diff) | |
download | CMake-f4082b0e9b1ce139a29fba5951cec068862fe28b.zip CMake-f4082b0e9b1ce139a29fba5951cec068862fe28b.tar.gz CMake-f4082b0e9b1ce139a29fba5951cec068862fe28b.tar.bz2 |
GenerateExportHeader: add INCLUDE_GUARD_NAME option
Fixes #16968.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/GenerateExportHeader.cmake | 9 | ||||
-rw-r--r-- | Modules/exportheader.cmake.in | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake index 4573c2e..17a3357 100644 --- a/Modules/GenerateExportHeader.cmake +++ b/Modules/GenerateExportHeader.cmake @@ -19,6 +19,7 @@ # [EXPORT_FILE_NAME <export_file_name>] # [DEPRECATED_MACRO_NAME <deprecated_macro_name>] # [NO_EXPORT_MACRO_NAME <no_export_macro_name>] +# [INCLUDE_GUARD_NAME <include_guard_name>] # [STATIC_DEFINE <static_define>] # [NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>] # [DEFINE_NO_DEPRECATED] @@ -277,7 +278,7 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY) set(options DEFINE_NO_DEPRECATED) set(oneValueArgs PREFIX_NAME BASE_NAME EXPORT_MACRO_NAME EXPORT_FILE_NAME DEPRECATED_MACRO_NAME NO_EXPORT_MACRO_NAME STATIC_DEFINE - NO_DEPRECATED_MACRO_NAME CUSTOM_CONTENT_FROM_VARIABLE) + NO_DEPRECATED_MACRO_NAME CUSTOM_CONTENT_FROM_VARIABLE INCLUDE_GUARD_NAME) set(multiValueArgs) cmake_parse_arguments(_GEH "${options}" "${oneValueArgs}" "${multiValueArgs}" @@ -341,7 +342,11 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY) endif() string(MAKE_C_IDENTIFIER ${NO_DEPRECATED_MACRO_NAME} NO_DEPRECATED_MACRO_NAME) - set(INCLUDE_GUARD_NAME "${EXPORT_MACRO_NAME}_H") + if(_GEH_INCLUDE_GUARD_NAME) + set(INCLUDE_GUARD_NAME ${_GEH_INCLUDE_GUARD_NAME}) + else() + set(INCLUDE_GUARD_NAME "${EXPORT_MACRO_NAME}_H") + endif() get_target_property(EXPORT_IMPORT_CONDITION ${TARGET_LIBRARY} DEFINE_SYMBOL) diff --git a/Modules/exportheader.cmake.in b/Modules/exportheader.cmake.in index 9dd75bf..c518b3d 100644 --- a/Modules/exportheader.cmake.in +++ b/Modules/exportheader.cmake.in @@ -39,4 +39,4 @@ # endif #endif @CUSTOM_CONTENT@ -#endif +#endif /* @INCLUDE_GUARD_NAME@ */ |