cmCPluginAPI.cxx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. /*
  14. this file contains the implementation of the C API to CMake. Generally
  15. these routines just manipulate arguments and then call the associated
  16. methods on the CMake classes. */
  17. #include "cmMakefile.h"
  18. #include "cmCPluginAPI.h"
  19. #include "cmVersion.h"
  20. #include "cmSourceFile.h"
  21. #include <stdlib.h>
  22. #ifdef __QNX__
  23. # include <malloc.h> /* for malloc/free on QNX */
  24. #endif
  25. extern "C"
  26. {
  27. void CCONV *cmGetClientData(void *info)
  28. {
  29. return ((cmLoadedCommandInfo *)info)->ClientData;
  30. }
  31. void CCONV cmSetClientData(void *info, void *cd)
  32. {
  33. ((cmLoadedCommandInfo *)info)->ClientData = cd;
  34. }
  35. void CCONV cmSetError(void *info, const char *err)
  36. {
  37. if (((cmLoadedCommandInfo *)info)->Error)
  38. {
  39. free(((cmLoadedCommandInfo *)info)->Error);
  40. }
  41. ((cmLoadedCommandInfo *)info)->Error = strdup(err);
  42. }
  43. unsigned int CCONV cmGetCacheMajorVersion(void *arg)
  44. {
  45. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  46. return mf->GetCacheMajorVersion();
  47. }
  48. unsigned int CCONV cmGetCacheMinorVersion(void *arg)
  49. {
  50. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  51. return mf->GetCacheMinorVersion();
  52. }
  53. unsigned int CCONV cmGetMajorVersion(void *)
  54. {
  55. return cmVersion::GetMajorVersion();
  56. }
  57. unsigned int CCONV cmGetMinorVersion(void *)
  58. {
  59. return cmVersion::GetMinorVersion();
  60. }
  61. void CCONV cmAddDefinition(void *arg, const char* name, const char* value)
  62. {
  63. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  64. mf->AddDefinition(name,value);
  65. }
  66. /* Add a definition to this makefile and the global cmake cache. */
  67. void CCONV cmAddCacheDefinition(void *arg, const char* name,
  68. const char* value, const char* doc, int type)
  69. {
  70. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  71. switch (type)
  72. {
  73. case CM_CACHE_BOOL:
  74. mf->AddCacheDefinition(name,value,doc,
  75. cmCacheManager::BOOL);
  76. break;
  77. case CM_CACHE_PATH:
  78. mf->AddCacheDefinition(name,value,doc,
  79. cmCacheManager::PATH);
  80. break;
  81. case CM_CACHE_FILEPATH:
  82. mf->AddCacheDefinition(name,value,doc,
  83. cmCacheManager::FILEPATH);
  84. break;
  85. case CM_CACHE_STRING:
  86. mf->AddCacheDefinition(name,value,doc,
  87. cmCacheManager::STRING);
  88. break;
  89. case CM_CACHE_INTERNAL:
  90. mf->AddCacheDefinition(name,value,doc,
  91. cmCacheManager::INTERNAL);
  92. break;
  93. case CM_CACHE_STATIC:
  94. mf->AddCacheDefinition(name,value,doc,
  95. cmCacheManager::STATIC);
  96. break;
  97. }
  98. }
  99. const char* CCONV cmGetProjectName(void *arg)
  100. {
  101. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  102. return mf->GetProjectName();
  103. }
  104. const char* CCONV cmGetHomeDirectory(void *arg)
  105. {
  106. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  107. return mf->GetHomeDirectory();
  108. }
  109. const char* CCONV cmGetHomeOutputDirectory(void *arg)
  110. {
  111. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  112. return mf->GetHomeOutputDirectory();
  113. }
  114. const char* CCONV cmGetStartDirectory(void *arg)
  115. {
  116. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  117. return mf->GetStartDirectory();
  118. }
  119. const char* CCONV cmGetStartOutputDirectory(void *arg)
  120. {
  121. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  122. return mf->GetStartOutputDirectory();
  123. }
  124. const char* CCONV cmGetCurrentDirectory(void *arg)
  125. {
  126. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  127. return mf->GetCurrentDirectory();
  128. }
  129. const char* CCONV cmGetCurrentOutputDirectory(void *arg)
  130. {
  131. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  132. return mf->GetCurrentOutputDirectory();
  133. }
  134. const char* CCONV cmGetDefinition(void *arg,const char*def)
  135. {
  136. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  137. return mf->GetDefinition(def);
  138. }
  139. int CCONV cmIsOn(void *arg, const char* name)
  140. {
  141. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  142. return static_cast<int>(mf->IsOn(name));
  143. }
  144. /** Check if a command exists. */
  145. int CCONV cmCommandExists(void *arg, const char* name)
  146. {
  147. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  148. return static_cast<int>(mf->CommandExists(name));
  149. }
  150. void CCONV cmAddDefineFlag(void *arg, const char* definition)
  151. {
  152. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  153. mf->AddDefineFlag(definition);
  154. }
  155. void CCONV cmAddLinkDirectoryForTarget(void *arg, const char *tgt,
  156. const char* d)
  157. {
  158. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  159. mf->AddLinkDirectoryForTarget(tgt,d);
  160. }
  161. void CCONV cmAddExecutable(void *arg, const char *exename,
  162. int numSrcs, const char **srcs, int win32)
  163. {
  164. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  165. std::vector<std::string> srcs2;
  166. int i;
  167. for (i = 0; i < numSrcs; ++i)
  168. {
  169. srcs2.push_back(srcs[i]);
  170. }
  171. cmTarget* tg = mf->AddExecutable(exename, srcs2);
  172. if ( win32 )
  173. {
  174. tg->SetProperty("WIN32_EXECUTABLE", "ON");
  175. }
  176. }
  177. void CCONV cmAddUtilityCommand(void *arg, const char* utilityName,
  178. const char* command,
  179. const char* arguments,
  180. int all,
  181. int numDepends,
  182. const char **depends,
  183. int,
  184. const char **)
  185. {
  186. // Get the makefile instance. Perform an extra variable expansion
  187. // now because the API caller expects it.
  188. cmMakefile* mf = static_cast<cmMakefile*>(arg);
  189. // Construct the command line for the command.
  190. cmCustomCommandLine commandLine;
  191. std::string expand = command;
  192. commandLine.push_back(mf->ExpandVariablesInString(expand));
  193. if(arguments && arguments[0])
  194. {
  195. // TODO: Parse arguments!
  196. expand = arguments;
  197. commandLine.push_back(mf->ExpandVariablesInString(expand));
  198. }
  199. cmCustomCommandLines commandLines;
  200. commandLines.push_back(commandLine);
  201. // Accumulate the list of dependencies.
  202. std::vector<std::string> depends2;
  203. for(int i = 0; i < numDepends; ++i)
  204. {
  205. expand = depends[i];
  206. depends2.push_back(mf->ExpandVariablesInString(expand));
  207. }
  208. // Pass the call to the makefile instance.
  209. mf->AddUtilityCommand(utilityName, (all ? false : true),
  210. 0, depends2, commandLines);
  211. }
  212. void CCONV cmAddCustomCommand(void *arg, const char* source,
  213. const char* command,
  214. int numArgs, const char **args,
  215. int numDepends, const char **depends,
  216. int numOutputs, const char **outputs,
  217. const char *target)
  218. {
  219. // Get the makefile instance. Perform an extra variable expansion
  220. // now because the API caller expects it.
  221. cmMakefile* mf = static_cast<cmMakefile*>(arg);
  222. // Construct the command line for the command.
  223. cmCustomCommandLine commandLine;
  224. std::string expand = command;
  225. commandLine.push_back(mf->ExpandVariablesInString(expand));
  226. for(int i=0; i < numArgs; ++i)
  227. {
  228. expand = args[i];
  229. commandLine.push_back(mf->ExpandVariablesInString(expand));
  230. }
  231. cmCustomCommandLines commandLines;
  232. commandLines.push_back(commandLine);
  233. // Accumulate the list of dependencies.
  234. std::vector<std::string> depends2;
  235. for(int i = 0; i < numDepends; ++i)
  236. {
  237. expand = depends[i];
  238. depends2.push_back(mf->ExpandVariablesInString(expand));
  239. }
  240. // Accumulate the list of outputs.
  241. std::vector<std::string> outputs2;
  242. for(int i = 0; i < numOutputs; ++i)
  243. {
  244. expand = outputs[i];
  245. outputs2.push_back(mf->ExpandVariablesInString(expand));
  246. }
  247. // Pass the call to the makefile instance.
  248. const char* no_comment = 0;
  249. mf->AddCustomCommandOldStyle(target, outputs2, depends2, source,
  250. commandLines, no_comment);
  251. }
  252. void CCONV cmAddCustomCommandToOutput(void *arg, const char* output,
  253. const char* command,
  254. int numArgs, const char **args,
  255. const char* main_dependency,
  256. int numDepends, const char **depends)
  257. {
  258. // Get the makefile instance. Perform an extra variable expansion
  259. // now because the API caller expects it.
  260. cmMakefile* mf = static_cast<cmMakefile*>(arg);
  261. // Construct the command line for the command.
  262. cmCustomCommandLine commandLine;
  263. std::string expand = command;
  264. commandLine.push_back(mf->ExpandVariablesInString(expand));
  265. for(int i=0; i < numArgs; ++i)
  266. {
  267. expand = args[i];
  268. commandLine.push_back(mf->ExpandVariablesInString(expand));
  269. }
  270. cmCustomCommandLines commandLines;
  271. commandLines.push_back(commandLine);
  272. // Accumulate the list of dependencies.
  273. std::vector<std::string> depends2;
  274. for(int i = 0; i < numDepends; ++i)
  275. {
  276. expand = depends[i];
  277. depends2.push_back(mf->ExpandVariablesInString(expand));
  278. }
  279. // Pass the call to the makefile instance.
  280. const char* no_comment = 0;
  281. const char* no_working_dir = 0;
  282. mf->AddCustomCommandToOutput(output, depends2, main_dependency,
  283. commandLines, no_comment, no_working_dir);
  284. }
  285. void CCONV cmAddCustomCommandToTarget(void *arg, const char* target,
  286. const char* command,
  287. int numArgs, const char **args,
  288. int commandType)
  289. {
  290. // Get the makefile instance.
  291. cmMakefile* mf = static_cast<cmMakefile*>(arg);
  292. // Construct the command line for the command. Perform an extra
  293. // variable expansion now because the API caller expects it.
  294. cmCustomCommandLine commandLine;
  295. std::string expand = command;
  296. commandLine.push_back(mf->ExpandVariablesInString(expand));
  297. for(int i=0; i < numArgs; ++i)
  298. {
  299. expand = args[i];
  300. commandLine.push_back(mf->ExpandVariablesInString(expand));
  301. }
  302. cmCustomCommandLines commandLines;
  303. commandLines.push_back(commandLine);
  304. // Select the command type.
  305. cmTarget::CustomCommandType cctype = cmTarget::POST_BUILD;
  306. switch (commandType)
  307. {
  308. case CM_PRE_BUILD:
  309. cctype = cmTarget::PRE_BUILD;
  310. break;
  311. case CM_PRE_LINK:
  312. cctype = cmTarget::PRE_LINK;
  313. break;
  314. case CM_POST_BUILD:
  315. cctype = cmTarget::POST_BUILD;
  316. break;
  317. }
  318. // Pass the call to the makefile instance.
  319. std::vector<std::string> no_depends;
  320. const char* no_comment = 0;
  321. const char* no_working_dir = 0;
  322. mf->AddCustomCommandToTarget(target, no_depends, commandLines,
  323. cctype, no_comment, no_working_dir);
  324. }
  325. void CCONV cmAddLinkLibraryForTarget(void *arg, const char *tgt,
  326. const char*value, int libtype)
  327. {
  328. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  329. switch (libtype)
  330. {
  331. case CM_LIBRARY_GENERAL:
  332. mf->AddLinkLibraryForTarget(tgt,value, cmTarget::GENERAL);
  333. break;
  334. case CM_LIBRARY_DEBUG:
  335. mf->AddLinkLibraryForTarget(tgt,value, cmTarget::DEBUG);
  336. break;
  337. case CM_LIBRARY_OPTIMIZED:
  338. mf->AddLinkLibraryForTarget(tgt,value, cmTarget::OPTIMIZED);
  339. break;
  340. }
  341. }
  342. void CCONV cmAddLibrary(void *arg, const char *libname, int shared,
  343. int numSrcs, const char **srcs)
  344. {
  345. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  346. std::vector<std::string> srcs2;
  347. int i;
  348. for (i = 0; i < numSrcs; ++i)
  349. {
  350. srcs2.push_back(srcs[i]);
  351. }
  352. mf->AddLibrary(libname, (shared ? true : false), srcs2);
  353. }
  354. char CCONV *cmExpandVariablesInString(void *arg, const char *source,
  355. int escapeQuotes, int atOnly)
  356. {
  357. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  358. std::string barf = source;
  359. std::string result =
  360. mf->ExpandVariablesInString(barf,
  361. (escapeQuotes ? true : false),
  362. (atOnly ? true : false));
  363. char *res = static_cast<char *>(malloc(result.size() + 1));
  364. if (result.size())
  365. {
  366. strcpy(res,result.c_str());
  367. }
  368. res[result.size()] = '\0';
  369. return res;
  370. }
  371. int CCONV cmExecuteCommand(void *arg, const char *name,
  372. int numArgs, const char **args)
  373. {
  374. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  375. cmListFileFunction lff;
  376. lff.Name = name;
  377. for(int i = 0; i < numArgs; ++i)
  378. {
  379. // Assume all arguments are quoted.
  380. lff.Arguments.push_back(cmListFileArgument(args[i], true,
  381. "[CMake-Plugin]", 0));
  382. }
  383. return mf->ExecuteCommand(lff);
  384. }
  385. void CCONV cmExpandSourceListArguments(void *arg,
  386. int numArgs,
  387. const char **args,
  388. int *resArgc,
  389. char ***resArgv,
  390. unsigned int startArgumentIndex)
  391. {
  392. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  393. std::vector<std::string> result;
  394. std::vector<std::string> args2;
  395. int i;
  396. for (i = 0; i < numArgs; ++i)
  397. {
  398. args2.push_back(args[i]);
  399. }
  400. mf->ExpandSourceListArguments(args2, result, startArgumentIndex);
  401. int resargc = static_cast<int>(result.size());
  402. char **resargv = 0;
  403. if (resargc)
  404. {
  405. resargv = (char **)malloc(resargc*sizeof(char *));
  406. }
  407. for (i = 0; i < resargc; ++i)
  408. {
  409. resargv[i] = strdup(result[i].c_str());
  410. }
  411. *resArgc = resargc;
  412. *resArgv = resargv;
  413. }
  414. void CCONV cmFreeArguments(int argc, char **argv)
  415. {
  416. int i;
  417. for (i = 0; i < argc; ++i)
  418. {
  419. free(argv[i]);
  420. }
  421. if (argv)
  422. {
  423. free(argv);
  424. }
  425. }
  426. int CCONV cmGetTotalArgumentSize(int argc, char **argv)
  427. {
  428. int i;
  429. int result = 0;
  430. for (i = 0; i < argc; ++i)
  431. {
  432. if (argv[i])
  433. {
  434. result = result + static_cast<int>(strlen(argv[i]));
  435. }
  436. }
  437. return result;
  438. }
  439. void CCONV *cmGetSource(void *arg, const char *name)
  440. {
  441. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  442. return (void *)mf->GetSource(name);
  443. }
  444. void * CCONV cmAddSource(void *arg, void *arg2)
  445. {
  446. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  447. cmSourceFile *sf = static_cast<cmSourceFile *>(arg2);
  448. return (void *)mf->AddSource(*sf);
  449. }
  450. void * CCONV cmCreateSourceFile()
  451. {
  452. return (void *)(new cmSourceFile);
  453. }
  454. void * CCONV cmCreateNewSourceFile(void *arg)
  455. {
  456. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  457. cmSourceFile *sf = new cmSourceFile;
  458. sf->SetMakefile(mf);
  459. return (void *)sf;
  460. }
  461. void CCONV cmDestroySourceFile(void *arg)
  462. {
  463. cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
  464. delete sf;
  465. }
  466. const char * CCONV cmSourceFileGetSourceName(void *arg)
  467. {
  468. cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
  469. return sf->GetSourceName().c_str();
  470. }
  471. const char * CCONV cmSourceFileGetFullPath(void *arg)
  472. {
  473. cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
  474. return sf->GetFullPath().c_str();
  475. }
  476. const char * CCONV cmSourceFileGetProperty(void *arg,const char *prop)
  477. {
  478. cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
  479. return sf->GetProperty(prop);
  480. }
  481. int CCONV cmSourceFileGetPropertyAsBool(void *arg,const char *prop)
  482. {
  483. cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
  484. return (sf->GetPropertyAsBool(prop) ? 1: 0);
  485. }
  486. void CCONV cmSourceFileSetProperty(void *arg,const char *prop,
  487. const char *val)
  488. {
  489. cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
  490. sf->SetProperty(prop,val);
  491. }
  492. void CCONV cmSourceFileAddDepend(void *arg, const char *depend)
  493. {
  494. cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
  495. sf->GetDepends().push_back(depend);
  496. }
  497. void CCONV cmSourceFileSetName(void *arg, const char* name, const char* dir,
  498. int numSourceExtensions,
  499. const char **sourceExtensions,
  500. int numHeaderExtensions,
  501. const char **headerExtensions)
  502. {
  503. cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
  504. std::vector<std::string> srcs;
  505. std::vector<std::string> hdrs;
  506. int i;
  507. for (i = 0; i < numSourceExtensions; ++i)
  508. {
  509. srcs.push_back(sourceExtensions[i]);
  510. }
  511. for (i = 0; i < numHeaderExtensions; ++i)
  512. {
  513. hdrs.push_back(headerExtensions[i]);
  514. }
  515. sf->SetName(name,dir, srcs, hdrs);
  516. }
  517. void CCONV cmSourceFileSetName2(void *arg, const char* name, const char* dir,
  518. const char *ext, int headerFileOnly)
  519. {
  520. cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
  521. sf->SetName(name,dir,ext,(headerFileOnly ? true : false));
  522. }
  523. char * CCONV cmGetFilenameWithoutExtension(const char *name)
  524. {
  525. std::string sres = cmSystemTools::GetFilenameWithoutExtension(name);
  526. char *result = (char *)malloc(sres.size()+1);
  527. strcpy(result,sres.c_str());
  528. return result;
  529. }
  530. char * CCONV cmGetFilenamePath(const char *name)
  531. {
  532. std::string sres = cmSystemTools::GetFilenamePath(name);
  533. char *result = (char *)malloc(sres.size()+1);
  534. strcpy(result,sres.c_str());
  535. return result;
  536. }
  537. char * CCONV cmCapitalized(const char *name)
  538. {
  539. std::string sres = cmSystemTools::Capitalized(name);
  540. char *result = (char *)malloc(sres.size()+1);
  541. strcpy(result,sres.c_str());
  542. return result;
  543. }
  544. void CCONV cmCopyFileIfDifferent(const char *name1, const char *name2)
  545. {
  546. cmSystemTools::CopyFileIfDifferent(name1,name2);
  547. }
  548. void CCONV cmRemoveFile(const char *name)
  549. {
  550. cmSystemTools::RemoveFile(name);
  551. }
  552. void CCONV cmDisplayStatus(void *arg, const char* message)
  553. {
  554. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  555. mf->DisplayStatus(message, -1);
  556. }
  557. void CCONV cmFree(void *data)
  558. {
  559. free(data);
  560. }
  561. void CCONV DefineSourceFileProperty (void *arg, const char *name,
  562. const char *briefDocs,
  563. const char *longDocs,
  564. int chained)
  565. {
  566. cmMakefile *mf = static_cast<cmMakefile *>(arg);
  567. mf->GetCMakeInstance()->DefineProperty(name,cmProperty::SOURCE_FILE,
  568. briefDocs, longDocs,
  569. chained != 0);
  570. }
  571. } // close the extern "C" scope
  572. cmCAPI cmStaticCAPI =
  573. {
  574. cmGetClientData,
  575. cmGetTotalArgumentSize,
  576. cmFreeArguments,
  577. cmSetClientData,
  578. cmSetError,
  579. cmAddCacheDefinition,
  580. cmAddCustomCommand,
  581. cmAddDefineFlag,
  582. cmAddDefinition,
  583. cmAddExecutable,
  584. cmAddLibrary,
  585. cmAddLinkDirectoryForTarget,
  586. cmAddLinkLibraryForTarget,
  587. cmAddUtilityCommand,
  588. cmCommandExists,
  589. cmExecuteCommand,
  590. cmExpandSourceListArguments,
  591. cmExpandVariablesInString,
  592. cmGetCacheMajorVersion,
  593. cmGetCacheMinorVersion,
  594. cmGetCurrentDirectory,
  595. cmGetCurrentOutputDirectory,
  596. cmGetDefinition,
  597. cmGetHomeDirectory,
  598. cmGetHomeOutputDirectory,
  599. cmGetMajorVersion,
  600. cmGetMinorVersion,
  601. cmGetProjectName,
  602. cmGetStartDirectory,
  603. cmGetStartOutputDirectory,
  604. cmIsOn,
  605. cmAddSource,
  606. cmCreateSourceFile,
  607. cmDestroySourceFile,
  608. cmGetSource,
  609. cmSourceFileAddDepend,
  610. cmSourceFileGetProperty,
  611. cmSourceFileGetPropertyAsBool,
  612. cmSourceFileGetSourceName,
  613. cmSourceFileGetFullPath,
  614. cmSourceFileSetName,
  615. cmSourceFileSetName2,
  616. cmSourceFileSetProperty,
  617. cmCapitalized,
  618. cmCopyFileIfDifferent,
  619. cmGetFilenameWithoutExtension,
  620. cmGetFilenamePath,
  621. cmRemoveFile,
  622. cmFree,
  623. cmAddCustomCommandToOutput,
  624. cmAddCustomCommandToTarget,
  625. cmDisplayStatus,
  626. cmCreateNewSourceFile,
  627. DefineSourceFileProperty,
  628. };