From 8b9b8e1676887a5b35dca0fb39e8538c10b2b00a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 25 Aug 2011 18:56:02 +0200 Subject: [PATCH] Add documentation about the prefix and no_deprecated options. --- Modules/GenerateExportHeader.cmake | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake index 7ed7edcc2..8d6cab986 100644 --- a/Modules/GenerateExportHeader.cmake +++ b/Modules/GenerateExportHeader.cmake @@ -15,6 +15,9 @@ # [DEPRECATED_MACRO_NAME ] # [NO_EXPORT_MACRO_NAME ] # [STATIC_DEFINE ] +# [NO_DEPRECATED_MACRO_NAME ] +# [DEFINE_NO_DEPRECATED] +# [PREFIX_NAME ] # ) # # ADD_COMPILER_EXPORT_FLAGS( [FATAL_WARNINGS] ) @@ -97,6 +100,45 @@ # set_target_properties(static_variant PROPERTIES COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE) # # This will cause the export macros to expand to nothing when building the static library. +# +# If DEFINE_NO_DEPRECATED is specified, then a macro ${BASE_NAME}_NO_DEPRECATED will be defined +# This macro can be used to remove deprecated code from preprocessor output. +# +# option(EXCLUDE_DEPRECATED "Exclude deprecated parts of the library" FALSE) +# +# if (EXCLUDE_DEPRECATED) +# set(NO_BUILD_DEPRECATED DEFINE_NO_DEPRECATED) +# endif() +# +# generate_export_header(somelib ${NO_BUILD_DEPRECATED}) +# +# And then in somelib: +# +# \code +# class SOMELIB_EXPORT SomeClass +# { +# public: +# #ifndef SOMELIB_NO_DEPRECATED +# SOMELIB_DEPRECATED void oldMethod(); +# #endif +# }; +# +# // ... +# +# #ifndef SOMELIB_NO_DEPRECATED +# void SomeClass::oldMethod() { } +# #endif +# +# \endcode +# +# If PREFIX_NAME is specified, the argument will be used as a prefix to all +# generated macros. +# +# For example: +# +# generate_export_header(somelib PREFIX_NAME VTK_) +# +# Generates the macros VTK_SOMELIB_EXPORT etc. #=============================================================================