Changeset 132 in pacpusframework
- Timestamp:
- Jul 30, 2013, 2:51:18 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0-beta1/cmake/PacpusUtilities.cmake
r124 r132 374 374 # ======================================== 375 375 # 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 )` 376 381 # ======================================== 377 382 function(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 381 387 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}}" 385 389 "// Autogenerated file by PacpusUtilities.cmake\n" 386 390 "// DO NOT EDIT!!! ALL CHANGES WOULD BE REMOVED BY THE NEXT CALL OF CMAKE\n" 387 391 "\n" 388 392 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" 391 395 "\n" 392 396 "// Export macro for use DLL for Windows only\n" 393 397 "#ifdef WIN32\n" 394 " #ifdef ${PLUGIN_NAME_UPPER}_EXPORT \n"398 " #ifdef ${PLUGIN_NAME_UPPER}_EXPORTS\n" 395 399 "// make DLL\n" 396 400 " #define ${PLUGIN_NAME_UPPER}_API __declspec(dllexport)\n" … … 404 408 "#endif\n\n" 405 409 406 "#endif // __ EXPORT_${PLUGIN_NAME_UPPER}_H__\n"410 "#endif // __${PLUGIN_NAME_UPPER}_CONFIG_H__\n" 407 411 ) 408 412 endfunction(CREATE_EXPORT)
Note:
See TracChangeset
for help on using the changeset viewer.