Skip to content
  • Danny Hindson's avatar
    Further work on applying cmake GenerateExportHeader · a8c3109c
    Danny Hindson authored
    Apply change to insert export macros into class definition using cmake GenerateExportHeader
    feature to 3 more projects: API, Crystal and CurveFitting
    Have replaced DllExport with the cmake macro except in these places:
    
    a) class templates - the definitions of class template member functions need to be in the
    same unit as the declaration so dllimport gives a compilation error in the client code
    (C2491 in VS) eg SingleValueParameter, SingleValueParameterParser
    b) headers which are in a project but aren't included by any .cpp units in the project
    eg IBackgroundFunction.h, ICatalogInfoService.h. In these cases I've removed the DLLExport
    attribute completely
    
    For the API target there were a couple of special cases\extras:
    
    API has some conditional use of the extern keyword to control instantiation of template
    classes. This has been inserted into the automatically created dllconfig.h using a cmake
    switch that allows some custom content to be appended to the end of the file. Few of the
    targets require this so I've added a boolean parameter to the wrapper function to handle
    this GENERATE_MANTID_EXPORT_HEADER
    
    I also had to add explicit include directories to PythonInterfaceCore where it imports an
    API target header (in the unit ExtractWorkspace.h) without having API as a dependency
    a8c3109c