diff options
author | Stephen Kelly <steveire@gmail.com> | 2011-08-25 16:56:02 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2011-08-25 16:56:13 (GMT) |
commit | 8b9b8e1676887a5b35dca0fb39e8538c10b2b00a (patch) | |
tree | f4b63804b680a4eb469060b218ca752cd775b030 /Modules/GenerateExportHeader.cmake | |
parent | 51bc63a7cb524bd9f9942bd0d49491cf9d1e36f8 (diff) | |
download | CMake-8b9b8e1676887a5b35dca0fb39e8538c10b2b00a.zip CMake-8b9b8e1676887a5b35dca0fb39e8538c10b2b00a.tar.gz CMake-8b9b8e1676887a5b35dca0fb39e8538c10b2b00a.tar.bz2 |
Add documentation about the prefix and no_deprecated options.
Diffstat (limited to 'Modules/GenerateExportHeader.cmake')
-rw-r--r-- | Modules/GenerateExportHeader.cmake | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake index 7ed7edc..8d6cab9 100644 --- a/Modules/GenerateExportHeader.cmake +++ b/Modules/GenerateExportHeader.cmake @@ -15,6 +15,9 @@ # [DEPRECATED_MACRO_NAME <deprecated_macro_name>] # [NO_EXPORT_MACRO_NAME <no_export_macro_name>] # [STATIC_DEFINE <static_define>] +# [NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>] +# [DEFINE_NO_DEPRECATED] +# [PREFIX_NAME <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. #============================================================================= |