summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-24 13:52:59 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-01-24 13:53:05 (GMT)
commit05e9cdb81ecddba496f21d0c9e35e9536261337f (patch)
tree8df6882afc2654302b6256eab19bec78e5caa84a /Modules
parent1a9da3c055d84479dc011ff66ecf887d92fadf23 (diff)
parentb1ae9aaf790757d3fa43cccbb0e935171c191fff (diff)
downloadCMake-05e9cdb81ecddba496f21d0c9e35e9536261337f.zip
CMake-05e9cdb81ecddba496f21d0c9e35e9536261337f.tar.gz
CMake-05e9cdb81ecddba496f21d0c9e35e9536261337f.tar.bz2
Merge topic 'GenerateExportHeader-include-guard'
b1ae9aaf GenerateExportHeader: add release notes, tests for include guard changes f4082b0e GenerateExportHeader: add INCLUDE_GUARD_NAME option Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1643
Diffstat (limited to 'Modules')
-rw-r--r--Modules/GenerateExportHeader.cmake9
-rw-r--r--Modules/exportheader.cmake.in2
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@ */