Changeset 132 in pacpusframework for branches/2.0-beta1/cmake/PacpusUtilities.cmake


Ignore:
Timestamp:
Jul 30, 2013, 2:51:18 PM (11 years ago)
Author:
Marek Kurdej
Message:

Update: PacpusUtilities.cmake: renamed export_${PLUGIN_NAME}.h -> ${PLUGIN_NAME}Config.h.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0-beta1/cmake/PacpusUtilities.cmake

    r124 r132  
    374374# ========================================
    375375# Create export header for plugins
     376#
     377# Usage: `create_export(PluginExportHeader "MyPluginName")`
     378#
     379# DLL export/import will depend on macro `${PLUGIN_NAME_UPPER}_EXPORTS`
     380# which can be set using `add_definitions( -D${PLUGIN_NAME_UPPER}_EXPORTS )`
    376381# ========================================
    377382function(CREATE_EXPORT OUT_H PLUGIN_NAME)
    378 
    379     set(${OUT_H} "export_${PLUGIN_NAME}.h" PARENT_SCOPE)
    380 
     383    # set file name to the input variable
     384    set(${OUT_H} "${PLUGIN_NAME}Config.h" PARENT_SCOPE)
     385   
     386    # create the header file
    381387    string(TOUPPER ${PLUGIN_NAME} PLUGIN_NAME_UPPER)
    382 
    383     # create the header file
    384     file(WRITE "export_${PLUGIN_NAME}.h"
     388    file(WRITE "${${OUT_H}}"
    385389        "// Autogenerated file by PacpusUtilities.cmake\n"
    386390        "// DO NOT EDIT!!! ALL CHANGES WOULD BE REMOVED BY THE NEXT CALL OF CMAKE\n"
    387391        "\n"
    388392
    389         "#ifndef __EXPORT_${PLUGIN_NAME_UPPER}__H__\n"
    390         "#define __EXPORT_${PLUGIN_NAME_UPPER}_H__\n"
     393        "#ifndef __${PLUGIN_NAME_UPPER}_CONFIG_H__\n"
     394        "#define __${PLUGIN_NAME_UPPER}_CONFIG_H__\n"
    391395        "\n"
    392396        "// Export macro for use DLL for Windows only\n"
    393397        "#ifdef WIN32\n"
    394         "   #ifdef ${PLUGIN_NAME_UPPER}_EXPORT\n"
     398        "   #ifdef ${PLUGIN_NAME_UPPER}_EXPORTS\n"
    395399        "//      make DLL\n"
    396400        "       #define ${PLUGIN_NAME_UPPER}_API __declspec(dllexport)\n"
     
    404408        "#endif\n\n"
    405409
    406         "#endif // __EXPORT_${PLUGIN_NAME_UPPER}_H__\n"
     410        "#endif // __${PLUGIN_NAME_UPPER}_CONFIG_H__\n"
    407411        )
    408412endfunction(CREATE_EXPORT)
Note: See TracChangeset for help on using the changeset viewer.