[cmake-developers] [CMake 0016022]: GenerateExportHeader DEFINE_NO_DEPRECATED define conflicts

Mantis Bug Tracker mantis at public.kitware.com
Wed Mar 16 17:28:00 EDT 2016


The following issue has been SUBMITTED. 
====================================================================== 
https://cmake.org/Bug/view.php?id=16022 
====================================================================== 
Reported By:                Andreas Schuh
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   16022
Category:                   Modules
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2016-03-16 17:27 EDT
Last Modified:              2016-03-16 17:28 EDT
====================================================================== 
Summary:                    GenerateExportHeader DEFINE_NO_DEPRECATED define
conflicts
Description: 
The header file generated by generate_export_header adds a

    #define DEFINE_NO_DEPRECATED 0|1

macro which is used to decide whether or not to define the respective macro with
the desired library prefix and base name. But this macro has the same name for
all libraries and is not undefined when it is no longer needed. In my project,
this for example created a conflict with the VTK library which uses such
generated header file which must of course be included in the public header
files.

To solve this conflict, I am using now (temporarily) a custom
exportheader.cmake.in template file by changing the
_GENERATE_EXPORT_HEADER_MODULE_DIR path to a directory in my project after
including the GenerateExportHeader module. Find the modified template file
attached.

There is certainly a better fix for this bug.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2016-03-16 17:27 Andreas Schuh  New Issue                                    
2016-03-16 17:28 Andreas Schuh  File Added: exportheader.cmake.in               
    
======================================================================



More information about the cmake-developers mailing list