2002-09-17 00:27:00 +04:00
|
|
|
#include "cmCPluginAPI.h"
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char *LibraryName;
|
|
|
|
} cmVTKWrapTclData;
|
|
|
|
|
|
|
|
|
|
|
|
/* do almost everything in the initial pass */
|
|
|
|
int InitialPass(void *inf, void *mf, int argc, char *argv[])
|
|
|
|
{
|
|
|
|
cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
|
|
|
|
|
|
|
|
cmVTKWrapTclData *cdata =
|
|
|
|
(cmVTKWrapTclData *)malloc(sizeof(cmVTKWrapTclData));
|
|
|
|
cdata->LibraryName = "BOO";
|
|
|
|
info->CAPI->SetClientData(info,cdata);
|
|
|
|
|
2002-09-20 18:06:00 +04:00
|
|
|
/* Now check and see if the value has been stored in the cache */
|
|
|
|
/* already, if so use that value and don't look for the program */
|
2002-09-17 00:27:00 +04:00
|
|
|
if(!info->CAPI->IsOn(mf,"TEST_COMMAND_TEST1"))
|
|
|
|
{
|
|
|
|
info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO");
|
|
|
|
cdata->LibraryName = "HOO";
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FinalPass(void *inf, void *mf)
|
|
|
|
{
|
|
|
|
cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
|
2002-09-20 18:06:00 +04:00
|
|
|
/* get our client data from initial pass */
|
2002-09-17 00:27:00 +04:00
|
|
|
cmVTKWrapTclData *cdata =
|
|
|
|
(cmVTKWrapTclData *)info->CAPI->GetClientData(info);
|
|
|
|
if (strcmp(info->CAPI->GetDefinition(mf, "TEST_DEF"),"HOO") ||
|
|
|
|
strcmp(cdata->LibraryName,"HOO"))
|
|
|
|
{
|
|
|
|
fprintf(stderr,"*** Failed LOADED COMMAND Final Pass\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-09-17 18:38:34 +04:00
|
|
|
void Destructor(void *inf)
|
|
|
|
{
|
|
|
|
cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
|
2002-09-20 18:06:00 +04:00
|
|
|
/* get our client data from initial pass */
|
2002-09-17 18:38:34 +04:00
|
|
|
cmVTKWrapTclData *cdata =
|
|
|
|
(cmVTKWrapTclData *)info->CAPI->GetClientData(info);
|
|
|
|
free(cdata);
|
|
|
|
}
|
|
|
|
|
2002-09-17 00:27:00 +04:00
|
|
|
CM_PLUGIN_EXPORT const char *cmGetName()
|
|
|
|
{
|
|
|
|
return "CMAKE_TEST_COMMAND";
|
|
|
|
}
|
|
|
|
|
2002-09-18 19:38:15 +04:00
|
|
|
#ifdef MUCHO_MUDSLIDE
|
2002-09-17 00:27:00 +04:00
|
|
|
void CM_PLUGIN_EXPORT cmInitializeCommand(cmLoadedCommandInfo *info)
|
|
|
|
{
|
|
|
|
info->InitialPass = InitialPass;
|
|
|
|
info->FinalPass = FinalPass;
|
2002-09-17 18:38:34 +04:00
|
|
|
info->Destructor = Destructor;
|
2002-09-17 00:27:00 +04:00
|
|
|
info->m_Inherited = 0;
|
|
|
|
}
|
2002-09-18 19:38:15 +04:00
|
|
|
#endif
|
2002-09-17 00:27:00 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|