1
0

CMakeLists.txt 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. # To ensure maximum portability across various compilers and platforms
  4. # deactivate any compiler extensions. Skip this for QNX, where additional
  5. # work is needed to build without compiler extensions.
  6. if(NOT CMAKE_SYSTEM_NAME STREQUAL "QNX")
  7. set(CMAKE_C_EXTENSIONS FALSE)
  8. set(CMAKE_CXX_EXTENSIONS FALSE)
  9. endif()
  10. include(CheckIncludeFile)
  11. if(APPLE)
  12. set(CMake_USE_MACH_PARSER 1)
  13. endif()
  14. if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
  15. set(CMake_USE_XCOFF_PARSER 1)
  16. endif()
  17. # Watcom support
  18. if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
  19. set(CMAKE_USE_WMAKE 1)
  20. endif()
  21. set(CMake_STAT_HAS_ST_MTIM ${KWSYS_CXX_STAT_HAS_ST_MTIM_COMPILED})
  22. set(CMake_STAT_HAS_ST_MTIMESPEC ${KWSYS_CXX_STAT_HAS_ST_MTIMESPEC_COMPILED})
  23. set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
  24. if(WIN32)
  25. # ensure Unicode friendly APIs are used on Windows
  26. add_compile_definitions(UNICODE _UNICODE)
  27. # minimize windows.h content
  28. add_compile_definitions(WIN32_LEAN_AND_MEAN)
  29. endif()
  30. # configure the .dox.in file
  31. if(CMake_BUILD_DEVELOPER_REFERENCE)
  32. configure_file(dir.dox.in dir.dox @ONLY)
  33. endif()
  34. # configure the .h file
  35. configure_file(cmConfigure.cmake.h.in cmConfigure.h)
  36. configure_file(cmVersionConfig.h.in cmVersionConfig.h)
  37. # Tell CMake executable in the build tree where to find the source tree.
  38. configure_file(
  39. CMakeSourceDir.txt.in
  40. "${CMake_BINARY_DIR}/CMakeFiles/CMakeSourceDir.txt"
  41. @ONLY
  42. )
  43. # Add a dummy library and add sources later depends on condition
  44. add_library(ManifestLib INTERFACE)
  45. #
  46. # create a library used by the command line and the GUI
  47. #
  48. add_library(
  49. CMakeLib
  50. # Lexers/Parsers
  51. LexerParser/cmCommandArgumentLexer.cxx
  52. LexerParser/cmCommandArgumentLexer.h
  53. LexerParser/cmCommandArgumentLexer.in.l
  54. LexerParser/cmCommandArgumentParser.cxx
  55. LexerParser/cmCommandArgumentParserTokens.h
  56. LexerParser/cmCommandArgumentParser.y
  57. LexerParser/cmDependsJavaLexer.cxx
  58. LexerParser/cmDependsJavaLexer.h
  59. LexerParser/cmDependsJavaLexer.in.l
  60. LexerParser/cmDependsJavaParser.cxx
  61. LexerParser/cmDependsJavaParserTokens.h
  62. LexerParser/cmDependsJavaParser.y
  63. LexerParser/cmExprLexer.cxx
  64. LexerParser/cmExprLexer.h
  65. LexerParser/cmExprLexer.in.l
  66. LexerParser/cmExprParser.cxx
  67. LexerParser/cmExprParserTokens.h
  68. LexerParser/cmExprParser.y
  69. LexerParser/cmFortranLexer.cxx
  70. LexerParser/cmFortranLexer.h
  71. LexerParser/cmFortranLexer.in.l
  72. LexerParser/cmFortranParser.cxx
  73. LexerParser/cmFortranParserTokens.h
  74. LexerParser/cmFortranParser.y
  75. LexerParser/cmGccDepfileLexer.cxx
  76. LexerParser/cmGccDepfileLexer.h
  77. LexerParser/cmGccDepfileLexer.in.l
  78. LexerParser/cmListFileLexer.c
  79. LexerParser/cmListFileLexer.in.l
  80. cmAffinity.cxx
  81. cmAffinity.h
  82. cmAlgorithms.h
  83. cmArchiveWrite.cxx
  84. cmArgumentParser.cxx
  85. cmArgumentParser.h
  86. cmBase32.cxx
  87. cmBinUtilsLinker.cxx
  88. cmBinUtilsLinker.h
  89. cmBinUtilsLinuxELFGetRuntimeDependenciesTool.cxx
  90. cmBinUtilsLinuxELFGetRuntimeDependenciesTool.h
  91. cmBinUtilsLinuxELFLinker.cxx
  92. cmBinUtilsLinuxELFLinker.h
  93. cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx
  94. cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.h
  95. cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.cxx
  96. cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.h
  97. cmBinUtilsMacOSMachOLinker.cxx
  98. cmBinUtilsMacOSMachOLinker.h
  99. cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx
  100. cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.h
  101. cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx
  102. cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.h
  103. cmBinUtilsWindowsPEGetRuntimeDependenciesTool.cxx
  104. cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h
  105. cmBinUtilsWindowsPELinker.cxx
  106. cmBinUtilsWindowsPELinker.h
  107. cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx
  108. cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.h
  109. cmBuildOptions.h
  110. cmCacheManager.cxx
  111. cmCacheManager.h
  112. cmCLocaleEnvironmentScope.h
  113. cmCLocaleEnvironmentScope.cxx
  114. cmCMakePath.h
  115. cmCMakePath.cxx
  116. cmCMakePresetErrors.h
  117. cmCMakePresetsGraph.cxx
  118. cmCMakePresetsGraph.h
  119. cmCMakePresetsGraphInternal.h
  120. cmCMakePresetsGraphReadJSON.cxx
  121. cmCMakePresetsGraphReadJSONBuildPresets.cxx
  122. cmCMakePresetsGraphReadJSONConfigurePresets.cxx
  123. cmCMakePresetsGraphReadJSONPackagePresets.cxx
  124. cmCMakePresetsGraphReadJSONTestPresets.cxx
  125. cmCMakePresetsGraphReadJSONWorkflowPresets.cxx
  126. cmCommandArgumentParserHelper.cxx
  127. cmCommonTargetGenerator.cxx
  128. cmCommonTargetGenerator.h
  129. cmComputeComponentGraph.cxx
  130. cmComputeComponentGraph.h
  131. cmComputeLinkDepends.cxx
  132. cmComputeLinkDepends.h
  133. cmComputeLinkInformation.cxx
  134. cmComputeLinkInformation.h
  135. cmComputeTargetDepends.h
  136. cmComputeTargetDepends.cxx
  137. cmConfigureLog.h
  138. cmConfigureLog.cxx
  139. cmConsoleBuf.h
  140. cmConsoleBuf.cxx
  141. cmConstStack.h
  142. cmConstStack.tcc
  143. cmCPackPropertiesGenerator.h
  144. cmCPackPropertiesGenerator.cxx
  145. cmCryptoHash.cxx
  146. cmCryptoHash.h
  147. cmCurl.cxx
  148. cmCurl.h
  149. cmCustomCommand.cxx
  150. cmCustomCommand.h
  151. cmCustomCommandGenerator.cxx
  152. cmCustomCommandGenerator.h
  153. cmCustomCommandLines.cxx
  154. cmCustomCommandLines.h
  155. cmCustomCommandTypes.h
  156. cmCxxModuleMapper.cxx
  157. cmCxxModuleMapper.h
  158. cmDefinitions.cxx
  159. cmDefinitions.h
  160. cmDependencyProvider.h
  161. cmDepends.cxx
  162. cmDepends.h
  163. cmDependsC.cxx
  164. cmDependsC.h
  165. cmDependsFortran.cxx
  166. cmDependsFortran.h
  167. cmDependsJava.cxx
  168. cmDependsJava.h
  169. cmDependsJavaParserHelper.cxx
  170. cmDependsJavaParserHelper.h
  171. cmDependsCompiler.cxx
  172. cmDependsCompiler.h
  173. cmDocumentation.cxx
  174. cmDocumentationFormatter.cxx
  175. cmDynamicLoader.cxx
  176. cmDynamicLoader.h
  177. cmDyndepCollation.cxx
  178. cmDyndepCollation.h
  179. cmELF.h
  180. cmELF.cxx
  181. cmEvaluatedTargetProperty.cxx
  182. cmEvaluatedTargetProperty.h
  183. cmExprParserHelper.cxx
  184. cmExportBuildAndroidMKGenerator.h
  185. cmExportBuildAndroidMKGenerator.cxx
  186. cmExportBuildFileGenerator.h
  187. cmExportBuildFileGenerator.cxx
  188. cmExportFileGenerator.h
  189. cmExportFileGenerator.cxx
  190. cmExportInstallAndroidMKGenerator.h
  191. cmExportInstallAndroidMKGenerator.cxx
  192. cmExportInstallFileGenerator.h
  193. cmExportInstallFileGenerator.cxx
  194. cmExportTryCompileFileGenerator.h
  195. cmExportTryCompileFileGenerator.cxx
  196. cmExportSet.h
  197. cmExportSet.cxx
  198. cmExternalMakefileProjectGenerator.cxx
  199. cmExternalMakefileProjectGenerator.h
  200. cmExtraCodeBlocksGenerator.cxx
  201. cmExtraCodeBlocksGenerator.h
  202. cmExtraCodeLiteGenerator.cxx
  203. cmExtraCodeLiteGenerator.h
  204. cmExtraEclipseCDT4Generator.cxx
  205. cmExtraEclipseCDT4Generator.h
  206. cmExtraKateGenerator.cxx
  207. cmExtraKateGenerator.h
  208. cmExtraSublimeTextGenerator.cxx
  209. cmExtraSublimeTextGenerator.h
  210. cmFileAPI.cxx
  211. cmFileAPI.h
  212. cmFileAPICache.cxx
  213. cmFileAPICache.h
  214. cmFileAPICodemodel.cxx
  215. cmFileAPICodemodel.h
  216. cmFileAPIConfigureLog.cxx
  217. cmFileAPIConfigureLog.h
  218. cmFileAPICMakeFiles.cxx
  219. cmFileAPICMakeFiles.h
  220. cmFileAPIToolchains.cxx
  221. cmFileAPIToolchains.h
  222. cmFileCopier.cxx
  223. cmFileCopier.h
  224. cmFileInstaller.cxx
  225. cmFileInstaller.h
  226. cmFileLock.cxx
  227. cmFileLock.h
  228. cmFileLockPool.cxx
  229. cmFileLockPool.h
  230. cmFileLockResult.cxx
  231. cmFileLockResult.h
  232. cmFilePathChecksum.cxx
  233. cmFilePathChecksum.h
  234. cmFileSet.cxx
  235. cmFileSet.h
  236. cmFileTime.cxx
  237. cmFileTime.h
  238. cmFileTimeCache.cxx
  239. cmFileTimeCache.h
  240. cmFileTimes.cxx
  241. cmFileTimes.h
  242. cmFortranParserImpl.cxx
  243. cmFSPermissions.cxx
  244. cmFSPermissions.h
  245. cmGccDepfileLexerHelper.cxx
  246. cmGccDepfileLexerHelper.h
  247. cmGccDepfileReader.cxx
  248. cmGccDepfileReader.h
  249. cmGeneratedFileStream.cxx
  250. cmGeneratorExpressionContext.cxx
  251. cmGeneratorExpressionContext.h
  252. cmGeneratorExpressionDAGChecker.cxx
  253. cmGeneratorExpressionDAGChecker.h
  254. cmGeneratorExpressionEvaluationFile.cxx
  255. cmGeneratorExpressionEvaluationFile.h
  256. cmGeneratorExpressionEvaluator.cxx
  257. cmGeneratorExpressionEvaluator.h
  258. cmGeneratorExpressionLexer.cxx
  259. cmGeneratorExpressionLexer.h
  260. cmGeneratorExpressionNode.cxx
  261. cmGeneratorExpressionNode.h
  262. cmGeneratorExpressionParser.cxx
  263. cmGeneratorExpressionParser.h
  264. cmGeneratorExpression.cxx
  265. cmGeneratorExpression.h
  266. cmGeneratorTarget.cxx
  267. cmGeneratorTarget.h
  268. cmLinkItemGraphVisitor.cxx
  269. cmLinkItemGraphVisitor.h
  270. cmGetPipes.cxx
  271. cmGetPipes.h
  272. cmGlobalCommonGenerator.cxx
  273. cmGlobalCommonGenerator.h
  274. cmGlobalGenerator.cxx
  275. cmGlobalGenerator.h
  276. cmGlobalGeneratorFactory.h
  277. cmGlobalUnixMakefileGenerator3.cxx
  278. cmGlobalUnixMakefileGenerator3.h
  279. cmGlobVerificationManager.cxx
  280. cmGlobVerificationManager.h
  281. cmGraphAdjacencyList.h
  282. cmGraphVizWriter.cxx
  283. cmGraphVizWriter.h
  284. cmInstallGenerator.h
  285. cmInstallGenerator.cxx
  286. cmInstallGetRuntimeDependenciesGenerator.h
  287. cmInstallGetRuntimeDependenciesGenerator.cxx
  288. cmInstallExportGenerator.cxx
  289. cmInstalledFile.h
  290. cmInstalledFile.cxx
  291. cmInstallFileSetGenerator.h
  292. cmInstallFileSetGenerator.cxx
  293. cmInstallFilesGenerator.h
  294. cmInstallFilesGenerator.cxx
  295. cmInstallImportedRuntimeArtifactsGenerator.h
  296. cmInstallImportedRuntimeArtifactsGenerator.cxx
  297. cmInstallRuntimeDependencySet.h
  298. cmInstallRuntimeDependencySet.cxx
  299. cmInstallRuntimeDependencySetGenerator.h
  300. cmInstallRuntimeDependencySetGenerator.cxx
  301. cmInstallScriptGenerator.h
  302. cmInstallScriptGenerator.cxx
  303. cmInstallSubdirectoryGenerator.h
  304. cmInstallSubdirectoryGenerator.cxx
  305. cmInstallTargetGenerator.h
  306. cmInstallTargetGenerator.cxx
  307. cmInstallDirectoryGenerator.h
  308. cmInstallDirectoryGenerator.cxx
  309. cmJSONHelpers.h
  310. cmJSONState.cxx
  311. cmJSONState.h
  312. cmLDConfigLDConfigTool.cxx
  313. cmLDConfigLDConfigTool.h
  314. cmLDConfigTool.cxx
  315. cmLDConfigTool.h
  316. cmLinkedTree.h
  317. cmLinkItem.cxx
  318. cmLinkItem.h
  319. cmLinkLineComputer.cxx
  320. cmLinkLineComputer.h
  321. cmLinkLineDeviceComputer.cxx
  322. cmLinkLineDeviceComputer.h
  323. cmList.h
  324. cmList.cxx
  325. cmListFileCache.cxx
  326. cmListFileCache.h
  327. cmLocalCommonGenerator.cxx
  328. cmLocalCommonGenerator.h
  329. cmLocalGenerator.cxx
  330. cmLocalGenerator.h
  331. cmPlaceholderExpander.cxx
  332. cmPlaceholderExpander.h
  333. cmRulePlaceholderExpander.cxx
  334. cmRulePlaceholderExpander.h
  335. cmLocalUnixMakefileGenerator3.cxx
  336. cmLocale.h
  337. cmMakefile.cxx
  338. cmMakefile.h
  339. cmMakefileTargetGenerator.cxx
  340. cmMakefileExecutableTargetGenerator.cxx
  341. cmMakefileLibraryTargetGenerator.cxx
  342. cmMakefileProfilingData.cxx
  343. cmMakefileUtilityTargetGenerator.cxx
  344. cmMessageType.h
  345. cmMessenger.cxx
  346. cmMessenger.h
  347. cmMSVC60LinkLineComputer.cxx
  348. cmMSVC60LinkLineComputer.h
  349. cmOSXBundleGenerator.cxx
  350. cmOSXBundleGenerator.h
  351. cmOutputConverter.cxx
  352. cmOutputConverter.h
  353. cmNewLineStyle.h
  354. cmNewLineStyle.cxx
  355. cmOrderDirectories.cxx
  356. cmOrderDirectories.h
  357. cmPolicies.h
  358. cmPolicies.cxx
  359. cmProcessOutput.cxx
  360. cmProcessOutput.h
  361. cmProcessTools.cxx
  362. cmProcessTools.h
  363. cmValue.cxx
  364. cmValue.h
  365. cmProperty.h
  366. cmPropertyDefinition.cxx
  367. cmPropertyDefinition.h
  368. cmPropertyMap.cxx
  369. cmPropertyMap.h
  370. cmQtAutoGen.cxx
  371. cmQtAutoGen.h
  372. cmQtAutoGenerator.cxx
  373. cmQtAutoGenerator.h
  374. cmQtAutoGenGlobalInitializer.cxx
  375. cmQtAutoGenGlobalInitializer.h
  376. cmQtAutoGenInitializer.cxx
  377. cmQtAutoGenInitializer.h
  378. cmQtAutoMocUic.cxx
  379. cmQtAutoMocUic.h
  380. cmQtAutoRcc.cxx
  381. cmQtAutoRcc.h
  382. cmRST.cxx
  383. cmRST.h
  384. cmRuntimeDependencyArchive.cxx
  385. cmRuntimeDependencyArchive.h
  386. cmScriptGenerator.h
  387. cmScriptGenerator.cxx
  388. cmSourceFile.cxx
  389. cmSourceFile.h
  390. cmSourceFileLocation.cxx
  391. cmSourceFileLocation.h
  392. cmSourceFileLocationKind.h
  393. cmSourceGroup.cxx
  394. cmSourceGroup.h
  395. cmStandardLevelResolver.cxx
  396. cmStandardLevelResolver.h
  397. cmState.cxx
  398. cmState.h
  399. cmStateDirectory.cxx
  400. cmStateDirectory.h
  401. cmStateSnapshot.cxx
  402. cmStateSnapshot.h
  403. cmStateTypes.h
  404. cmStringAlgorithms.cxx
  405. cmStringAlgorithms.h
  406. cmSystemTools.cxx
  407. cmSystemTools.h
  408. cmTarget.cxx
  409. cmTarget.h
  410. cmTargetPropertyComputer.cxx
  411. cmTargetPropertyComputer.h
  412. cmTargetExport.h
  413. cmTest.cxx
  414. cmTest.h
  415. cmTestGenerator.cxx
  416. cmTestGenerator.h
  417. cmTransformDepfile.cxx
  418. cmTransformDepfile.h
  419. cmUuid.cxx
  420. cmUVHandlePtr.cxx
  421. cmUVHandlePtr.h
  422. cmUVProcessChain.cxx
  423. cmUVProcessChain.h
  424. cmUVStreambuf.h
  425. cmUVSignalHackRAII.h
  426. cmVariableWatch.cxx
  427. cmVariableWatch.h
  428. cmVersion.cxx
  429. cmVersion.h
  430. cmWindowsRegistry.cxx
  431. cmWindowsRegistry.h
  432. cmWorkerPool.cxx
  433. cmWorkerPool.h
  434. cmWorkingDirectory.cxx
  435. cmWorkingDirectory.h
  436. cmXMLParser.cxx
  437. cmXMLParser.h
  438. cmXMLSafe.cxx
  439. cmXMLSafe.h
  440. cmXMLWriter.cxx
  441. cmXMLWriter.h
  442. cmake.cxx
  443. cmake.h
  444. cmCommand.cxx
  445. cmCommand.h
  446. cmCommands.cxx
  447. cmCommands.h
  448. cmAddCompileDefinitionsCommand.cxx
  449. cmAddCompileDefinitionsCommand.h
  450. cmAddCompileOptionsCommand.cxx
  451. cmAddCompileOptionsCommand.h
  452. cmAddLinkOptionsCommand.cxx
  453. cmAddLinkOptionsCommand.h
  454. cmAddCustomCommandCommand.cxx
  455. cmAddCustomCommandCommand.h
  456. cmAddCustomTargetCommand.cxx
  457. cmAddCustomTargetCommand.h
  458. cmAddDefinitionsCommand.cxx
  459. cmAddDefinitionsCommand.h
  460. cmAddDependenciesCommand.cxx
  461. cmAddDependenciesCommand.h
  462. cmAddExecutableCommand.cxx
  463. cmAddExecutableCommand.h
  464. cmAddLibraryCommand.cxx
  465. cmAddLibraryCommand.h
  466. cmAddSubDirectoryCommand.cxx
  467. cmAddSubDirectoryCommand.h
  468. cmAddTestCommand.cxx
  469. cmAddTestCommand.h
  470. cmAuxSourceDirectoryCommand.cxx
  471. cmAuxSourceDirectoryCommand.h
  472. cmBreakCommand.cxx
  473. cmBreakCommand.h
  474. cmBuildCommand.cxx
  475. cmBuildCommand.h
  476. cmBuildNameCommand.cxx
  477. cmBuildNameCommand.h
  478. cmCMakeHostSystemInformationCommand.cxx
  479. cmCMakeHostSystemInformationCommand.h
  480. cmCMakeLanguageCommand.cxx
  481. cmCMakeLanguageCommand.h
  482. cmCMakeMinimumRequired.cxx
  483. cmCMakeMinimumRequired.h
  484. cmCMakePathCommand.h
  485. cmCMakePathCommand.cxx
  486. cmCMakePolicyCommand.cxx
  487. cmCMakePolicyCommand.h
  488. cmConditionEvaluator.cxx
  489. cmConditionEvaluator.h
  490. cmConfigureFileCommand.cxx
  491. cmConfigureFileCommand.h
  492. cmContinueCommand.cxx
  493. cmContinueCommand.h
  494. cmCoreTryCompile.cxx
  495. cmCoreTryCompile.h
  496. cmCreateTestSourceList.cxx
  497. cmCreateTestSourceList.h
  498. cmDefinePropertyCommand.cxx
  499. cmDefinePropertyCommand.h
  500. cmEnableLanguageCommand.cxx
  501. cmEnableLanguageCommand.h
  502. cmEnableTestingCommand.cxx
  503. cmEnableTestingCommand.h
  504. cmExecProgramCommand.cxx
  505. cmExecProgramCommand.h
  506. cmExecuteProcessCommand.cxx
  507. cmExecuteProcessCommand.h
  508. cmExpandedCommandArgument.cxx
  509. cmExpandedCommandArgument.h
  510. cmExperimental.cxx
  511. cmExperimental.h
  512. cmExportCommand.cxx
  513. cmExportCommand.h
  514. cmExportLibraryDependenciesCommand.cxx
  515. cmExportLibraryDependenciesCommand.h
  516. cmFLTKWrapUICommand.cxx
  517. cmFLTKWrapUICommand.h
  518. cmFileCommand.cxx
  519. cmFileCommand.h
  520. cmFindBase.cxx
  521. cmFindBase.h
  522. cmFindCommon.cxx
  523. cmFindCommon.h
  524. cmFindFileCommand.cxx
  525. cmFindFileCommand.h
  526. cmFindLibraryCommand.cxx
  527. cmFindLibraryCommand.h
  528. cmFindPackageCommand.cxx
  529. cmFindPackageCommand.h
  530. cmFindPathCommand.cxx
  531. cmFindPathCommand.h
  532. cmFindProgramCommand.cxx
  533. cmFindProgramCommand.h
  534. cmForEachCommand.cxx
  535. cmForEachCommand.h
  536. cmBlockCommand.cxx
  537. cmBlockCommand.h
  538. cmFunctionBlocker.cxx
  539. cmFunctionBlocker.h
  540. cmFunctionCommand.cxx
  541. cmFunctionCommand.h
  542. cmGetCMakePropertyCommand.cxx
  543. cmGetCMakePropertyCommand.h
  544. cmGetDirectoryPropertyCommand.cxx
  545. cmGetDirectoryPropertyCommand.h
  546. cmGetFilenameComponentCommand.cxx
  547. cmGetFilenameComponentCommand.h
  548. cmGetPropertyCommand.cxx
  549. cmGetPropertyCommand.h
  550. cmGetSourceFilePropertyCommand.cxx
  551. cmGetSourceFilePropertyCommand.h
  552. cmGetTargetPropertyCommand.cxx
  553. cmGetTargetPropertyCommand.h
  554. cmGetTestPropertyCommand.cxx
  555. cmGetTestPropertyCommand.h
  556. cmHexFileConverter.cxx
  557. cmHexFileConverter.h
  558. cmIfCommand.cxx
  559. cmIfCommand.h
  560. cmIncludeCommand.cxx
  561. cmIncludeCommand.h
  562. cmIncludeDirectoryCommand.cxx
  563. cmIncludeDirectoryCommand.h
  564. cmIncludeExternalMSProjectCommand.cxx
  565. cmIncludeExternalMSProjectCommand.h
  566. cmIncludeGuardCommand.cxx
  567. cmIncludeGuardCommand.h
  568. cmIncludeRegularExpressionCommand.cxx
  569. cmIncludeRegularExpressionCommand.h
  570. cmInstallCommand.cxx
  571. cmInstallCommand.h
  572. cmInstallCommandArguments.cxx
  573. cmInstallCommandArguments.h
  574. cmInstallCxxModuleBmiGenerator.cxx
  575. cmInstallCxxModuleBmiGenerator.h
  576. cmInstallFilesCommand.cxx
  577. cmInstallFilesCommand.h
  578. cmInstallProgramsCommand.cxx
  579. cmInstallProgramsCommand.h
  580. cmInstallTargetsCommand.cxx
  581. cmInstallTargetsCommand.h
  582. cmLinkDirectoriesCommand.cxx
  583. cmLinkDirectoriesCommand.h
  584. cmLinkLibrariesCommand.cxx
  585. cmLinkLibrariesCommand.h
  586. cmListCommand.cxx
  587. cmListCommand.h
  588. cmLoadCacheCommand.cxx
  589. cmLoadCacheCommand.h
  590. cmLoadCommandCommand.cxx
  591. cmLoadCommandCommand.h
  592. cmMacroCommand.cxx
  593. cmMacroCommand.h
  594. cmMakeDirectoryCommand.cxx
  595. cmMakeDirectoryCommand.h
  596. cmMarkAsAdvancedCommand.cxx
  597. cmMarkAsAdvancedCommand.h
  598. cmMathCommand.cxx
  599. cmMathCommand.h
  600. cmMessageCommand.cxx
  601. cmMessageCommand.h
  602. cmMessageMetadata.h
  603. cmOptionCommand.cxx
  604. cmOptionCommand.h
  605. cmOutputRequiredFilesCommand.cxx
  606. cmOutputRequiredFilesCommand.h
  607. cmParseArgumentsCommand.cxx
  608. cmParseArgumentsCommand.h
  609. cmPathLabel.cxx
  610. cmPathLabel.h
  611. cmProjectCommand.cxx
  612. cmProjectCommand.h
  613. cmQTWrapCPPCommand.cxx
  614. cmQTWrapCPPCommand.h
  615. cmQTWrapUICommand.cxx
  616. cmQTWrapUICommand.h
  617. cmRemoveCommand.cxx
  618. cmRemoveCommand.h
  619. cmRemoveDefinitionsCommand.cxx
  620. cmRemoveDefinitionsCommand.h
  621. cmReturnCommand.cxx
  622. cmReturnCommand.h
  623. cmSearchPath.cxx
  624. cmSearchPath.h
  625. cmSeparateArgumentsCommand.cxx
  626. cmSeparateArgumentsCommand.h
  627. cmSetCommand.cxx
  628. cmSetCommand.h
  629. cmSetDirectoryPropertiesCommand.cxx
  630. cmSetDirectoryPropertiesCommand.h
  631. cmSetPropertyCommand.cxx
  632. cmSetPropertyCommand.h
  633. cmSetSourceFilesPropertiesCommand.cxx
  634. cmSetSourceFilesPropertiesCommand.h
  635. cmSetTargetPropertiesCommand.cxx
  636. cmSetTargetPropertiesCommand.h
  637. cmSetTestsPropertiesCommand.cxx
  638. cmSetTestsPropertiesCommand.h
  639. cmSiteNameCommand.cxx
  640. cmSiteNameCommand.h
  641. cmSourceGroupCommand.cxx
  642. cmSourceGroupCommand.h
  643. cmString.cxx
  644. cmString.hxx
  645. cmStringReplaceHelper.cxx
  646. cmStringCommand.cxx
  647. cmStringCommand.h
  648. cmSubcommandTable.cxx
  649. cmSubcommandTable.h
  650. cmSubdirCommand.cxx
  651. cmSubdirCommand.h
  652. cmSubdirDependsCommand.cxx
  653. cmSubdirDependsCommand.h
  654. cmTargetCompileDefinitionsCommand.cxx
  655. cmTargetCompileDefinitionsCommand.h
  656. cmTargetCompileFeaturesCommand.cxx
  657. cmTargetCompileFeaturesCommand.h
  658. cmTargetCompileOptionsCommand.cxx
  659. cmTargetCompileOptionsCommand.h
  660. cmTargetIncludeDirectoriesCommand.cxx
  661. cmTargetIncludeDirectoriesCommand.h
  662. cmTargetLinkOptionsCommand.cxx
  663. cmTargetLinkOptionsCommand.h
  664. cmTargetLinkDirectoriesCommand.cxx
  665. cmTargetLinkDirectoriesCommand.h
  666. cmTargetLinkLibrariesCommand.cxx
  667. cmTargetLinkLibrariesCommand.h
  668. cmTargetPrecompileHeadersCommand.cxx
  669. cmTargetPrecompileHeadersCommand.h
  670. cmTargetPropCommandBase.cxx
  671. cmTargetPropCommandBase.h
  672. cmTargetSourcesCommand.cxx
  673. cmTargetSourcesCommand.h
  674. cmTimestamp.cxx
  675. cmTimestamp.h
  676. cmTryCompileCommand.cxx
  677. cmTryCompileCommand.h
  678. cmTryRunCommand.cxx
  679. cmTryRunCommand.h
  680. cmUnsetCommand.cxx
  681. cmUnsetCommand.h
  682. cmUseMangledMesaCommand.cxx
  683. cmUseMangledMesaCommand.h
  684. cmUtilitySourceCommand.cxx
  685. cmUtilitySourceCommand.h
  686. cmVariableRequiresCommand.cxx
  687. cmVariableRequiresCommand.h
  688. cmVariableWatchCommand.cxx
  689. cmVariableWatchCommand.h
  690. cmWhileCommand.cxx
  691. cmWhileCommand.h
  692. cmWriteFileCommand.cxx
  693. cmWriteFileCommand.h
  694. # Ninja support
  695. cmScanDepFormat.cxx
  696. cmGlobalNinjaGenerator.cxx
  697. cmGlobalNinjaGenerator.h
  698. cmNinjaTypes.h
  699. cmLocalNinjaGenerator.cxx
  700. cmLocalNinjaGenerator.h
  701. cmNinjaTargetGenerator.cxx
  702. cmNinjaTargetGenerator.h
  703. cmNinjaNormalTargetGenerator.cxx
  704. cmNinjaNormalTargetGenerator.h
  705. cmNinjaUtilityTargetGenerator.cxx
  706. cmNinjaUtilityTargetGenerator.h
  707. cmNinjaLinkLineComputer.cxx
  708. cmNinjaLinkLineComputer.h
  709. cmNinjaLinkLineDeviceComputer.cxx
  710. cmNinjaLinkLineDeviceComputer.h
  711. cm_get_date.h
  712. cm_get_date.c
  713. cm_utf8.h
  714. cm_utf8.c
  715. cm_codecvt.hxx
  716. cm_codecvt.cxx
  717. cmDuration.h
  718. cmDuration.cxx
  719. bindexplib.cxx
  720. )
  721. target_include_directories(
  722. CMakeLib
  723. PUBLIC
  724. # add the include path to find the .h
  725. "${CMAKE_CURRENT_BINARY_DIR}"
  726. "${CMAKE_CURRENT_SOURCE_DIR}"
  727. "${CMAKE_CURRENT_SOURCE_DIR}/LexerParser"
  728. ${CMake_HAIKU_INCLUDE_DIRS}
  729. )
  730. target_link_libraries(
  731. CMakeLib
  732. PUBLIC
  733. cmstd
  734. cmsys
  735. CURL::libcurl
  736. EXPAT::EXPAT
  737. JsonCpp::JsonCpp
  738. $<TARGET_NAME_IF_EXISTS:kwiml::kwiml>
  739. LibArchive::LibArchive
  740. LibRHash::LibRHash
  741. LibUV::LibUV
  742. Threads::Threads
  743. ZLIB::ZLIB
  744. )
  745. if(CMake_ENABLE_DEBUGGER)
  746. target_sources(
  747. CMakeLib
  748. PRIVATE
  749. cmDebuggerAdapter.cxx
  750. cmDebuggerAdapter.h
  751. cmDebuggerBreakpointManager.cxx
  752. cmDebuggerBreakpointManager.h
  753. cmDebuggerExceptionManager.cxx
  754. cmDebuggerExceptionManager.h
  755. cmDebuggerPipeConnection.cxx
  756. cmDebuggerPipeConnection.h
  757. cmDebuggerProtocol.cxx
  758. cmDebuggerProtocol.h
  759. cmDebuggerSourceBreakpoint.cxx
  760. cmDebuggerSourceBreakpoint.h
  761. cmDebuggerStackFrame.cxx
  762. cmDebuggerStackFrame.h
  763. cmDebuggerThread.cxx
  764. cmDebuggerThread.h
  765. cmDebuggerThreadManager.cxx
  766. cmDebuggerThreadManager.h
  767. cmDebuggerVariables.cxx
  768. cmDebuggerVariables.h
  769. cmDebuggerVariablesHelper.cxx
  770. cmDebuggerVariablesHelper.h
  771. cmDebuggerVariablesManager.cxx
  772. cmDebuggerVariablesManager.h
  773. )
  774. target_link_libraries(CMakeLib PUBLIC cppdap::cppdap)
  775. endif()
  776. # Check if we can build the Mach-O parser.
  777. if(CMake_USE_MACH_PARSER)
  778. target_sources(
  779. CMakeLib
  780. PRIVATE
  781. cmMachO.h
  782. cmMachO.cxx
  783. )
  784. endif()
  785. # Check if we can build the XCOFF parser.
  786. if(CMake_USE_XCOFF_PARSER)
  787. target_sources(
  788. CMakeLib
  789. PRIVATE
  790. cmXCOFF.h
  791. cmXCOFF.cxx
  792. )
  793. endif()
  794. # Xcode only works on Apple
  795. if(APPLE)
  796. target_sources(
  797. CMakeLib
  798. PRIVATE
  799. cmXCodeObject.cxx
  800. cmXCode21Object.cxx
  801. cmXCodeScheme.cxx
  802. cmGlobalXCodeGenerator.cxx
  803. cmGlobalXCodeGenerator.h
  804. cmLocalXCodeGenerator.cxx
  805. cmLocalXCodeGenerator.h
  806. )
  807. endif()
  808. if(WIN32)
  809. target_sources(
  810. CMakeLib
  811. PRIVATE
  812. cmCallVisualStudioMacro.cxx
  813. cmCallVisualStudioMacro.h
  814. )
  815. if(NOT UNIX)
  816. target_sources(
  817. CMakeLib
  818. PRIVATE
  819. cmGlobalBorlandMakefileGenerator.cxx
  820. cmGlobalBorlandMakefileGenerator.h
  821. cmGlobalMSYSMakefileGenerator.cxx
  822. cmGlobalMinGWMakefileGenerator.cxx
  823. cmGlobalNMakeMakefileGenerator.cxx
  824. cmGlobalNMakeMakefileGenerator.h
  825. cmGlobalJOMMakefileGenerator.cxx
  826. cmGlobalJOMMakefileGenerator.h
  827. cmGlobalVisualStudio71Generator.cxx
  828. cmGlobalVisualStudio71Generator.h
  829. cmGlobalVisualStudio7Generator.cxx
  830. cmGlobalVisualStudio7Generator.h
  831. cmGlobalVisualStudio8Generator.cxx
  832. cmGlobalVisualStudio8Generator.h
  833. cmGlobalVisualStudio9Generator.cxx
  834. cmGlobalVisualStudio9Generator.h
  835. cmVisualStudioGeneratorOptions.h
  836. cmVisualStudioGeneratorOptions.cxx
  837. cmVsProjectType.h
  838. cmVisualStudio10TargetGenerator.h
  839. cmVisualStudio10TargetGenerator.cxx
  840. cmLocalVisualStudio10Generator.cxx
  841. cmLocalVisualStudio10Generator.h
  842. cmGlobalVisualStudio10Generator.h
  843. cmGlobalVisualStudio10Generator.cxx
  844. cmGlobalVisualStudio11Generator.h
  845. cmGlobalVisualStudio11Generator.cxx
  846. cmGlobalVisualStudio12Generator.h
  847. cmGlobalVisualStudio12Generator.cxx
  848. cmGlobalVisualStudio14Generator.h
  849. cmGlobalVisualStudio14Generator.cxx
  850. cmGlobalVisualStudioGenerator.cxx
  851. cmGlobalVisualStudioGenerator.h
  852. cmGlobalVisualStudioVersionedGenerator.h
  853. cmGlobalVisualStudioVersionedGenerator.cxx
  854. cmIDEFlagTable.h
  855. cmIDEOptions.cxx
  856. cmIDEOptions.h
  857. cmLocalVisualStudio7Generator.cxx
  858. cmLocalVisualStudio7Generator.h
  859. cmLocalVisualStudioGenerator.cxx
  860. cmLocalVisualStudioGenerator.h
  861. cmVisualStudioSlnData.h
  862. cmVisualStudioSlnData.cxx
  863. cmVisualStudioSlnParser.h
  864. cmVisualStudioSlnParser.cxx
  865. cmVisualStudioWCEPlatformParser.h
  866. cmVisualStudioWCEPlatformParser.cxx
  867. cmVSSetupHelper.cxx
  868. cmVSSetupHelper.h
  869. )
  870. # Add a manifest file to executables on Windows to allow for
  871. # GetVersion to work properly on Windows 8 and above.
  872. target_sources(ManifestLib INTERFACE cmake.version.manifest)
  873. endif()
  874. endif()
  875. # Watcom support
  876. if(CMAKE_USE_WMAKE)
  877. target_sources(
  878. CMakeLib
  879. PRIVATE
  880. cmGlobalWatcomWMakeGenerator.cxx
  881. cmGlobalWatcomWMakeGenerator.h
  882. )
  883. endif()
  884. # GHS support
  885. # Works only for windows and linux
  886. if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
  887. target_sources(
  888. CMakeLib
  889. PRIVATE
  890. cmGlobalGhsMultiGenerator.cxx
  891. cmGlobalGhsMultiGenerator.h
  892. cmLocalGhsMultiGenerator.cxx
  893. cmLocalGhsMultiGenerator.h
  894. cmGhsMultiTargetGenerator.cxx
  895. cmGhsMultiTargetGenerator.h
  896. cmGhsMultiGpj.cxx
  897. cmGhsMultiGpj.h
  898. )
  899. endif()
  900. # Temporary variable for tools targets
  901. set(_tools)
  902. if(WIN32 AND NOT CYGWIN)
  903. set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
  904. add_executable(cmcldeps cmcldeps.cxx)
  905. target_link_libraries(cmcldeps PRIVATE CMakeLib ManifestLib)
  906. list(APPEND _tools cmcldeps)
  907. endif()
  908. if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc")
  909. # the atomic instructions are implemented using libatomic on some platforms,
  910. # so linking to that may be required
  911. check_library_exists(atomic __atomic_fetch_add_4 "" LIBATOMIC_NEEDED)
  912. if(LIBATOMIC_NEEDED)
  913. target_link_libraries(CMakeLib PUBLIC atomic)
  914. endif()
  915. endif()
  916. # On Apple we need CoreFoundation and CoreServices
  917. if(APPLE)
  918. target_link_libraries(CMakeLib PUBLIC "-framework CoreFoundation")
  919. target_link_libraries(CMakeLib PUBLIC "-framework CoreServices")
  920. endif()
  921. if(WIN32 AND NOT UNIX)
  922. # We need the rpcrt4 library on Windows.
  923. # We need the crypt32 library on Windows for crypto/cert APIs.
  924. target_link_libraries(CMakeLib PUBLIC rpcrt4 crypt32)
  925. endif()
  926. target_compile_definitions(CMakeLib PUBLIC ${CLANG_TIDY_DEFINITIONS})
  927. #
  928. # Build CTestLib
  929. #
  930. add_library(
  931. CTestLib
  932. cmCTest.cxx
  933. CTest/cmProcess.cxx
  934. CTest/cmCTestBinPacker.cxx
  935. CTest/cmCTestBuildAndTestHandler.cxx
  936. CTest/cmCTestBuildCommand.cxx
  937. CTest/cmCTestBuildHandler.cxx
  938. CTest/cmCTestConfigureCommand.cxx
  939. CTest/cmCTestConfigureHandler.cxx
  940. CTest/cmCTestCoverageCommand.cxx
  941. CTest/cmCTestCoverageHandler.cxx
  942. CTest/cmCTestCurl.cxx
  943. CTest/cmParseMumpsCoverage.cxx
  944. CTest/cmParseCacheCoverage.cxx
  945. CTest/cmParseGTMCoverage.cxx
  946. CTest/cmParseJacocoCoverage.cxx
  947. CTest/cmParseBlanketJSCoverage.cxx
  948. CTest/cmParsePHPCoverage.cxx
  949. CTest/cmParseCoberturaCoverage.cxx
  950. CTest/cmParseDelphiCoverage.cxx
  951. CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
  952. CTest/cmCTestGenericHandler.cxx
  953. CTest/cmCTestHandlerCommand.cxx
  954. CTest/cmCTestResourceAllocator.cxx
  955. CTest/cmCTestResourceSpec.cxx
  956. CTest/cmCTestLaunch.cxx
  957. CTest/cmCTestLaunchReporter.cxx
  958. CTest/cmCTestMemCheckCommand.cxx
  959. CTest/cmCTestMemCheckHandler.cxx
  960. CTest/cmCTestMultiProcessHandler.cxx
  961. CTest/cmCTestReadCustomFilesCommand.cxx
  962. CTest/cmCTestResourceGroupsLexerHelper.cxx
  963. CTest/cmCTestRunScriptCommand.cxx
  964. CTest/cmCTestRunTest.cxx
  965. CTest/cmCTestScriptHandler.cxx
  966. CTest/cmCTestSleepCommand.cxx
  967. CTest/cmCTestStartCommand.cxx
  968. CTest/cmCTestSubmitCommand.cxx
  969. CTest/cmCTestSubmitHandler.cxx
  970. CTest/cmCTestTestCommand.cxx
  971. CTest/cmCTestTestHandler.cxx
  972. CTest/cmCTestTestMeasurementXMLParser.cxx
  973. CTest/cmCTestUpdateCommand.cxx
  974. CTest/cmCTestUpdateHandler.cxx
  975. CTest/cmCTestUploadCommand.cxx
  976. CTest/cmCTestUploadHandler.cxx
  977. CTest/cmCTestVC.cxx
  978. CTest/cmCTestVC.h
  979. CTest/cmCTestGlobalVC.cxx
  980. CTest/cmCTestGlobalVC.h
  981. CTest/cmCTestCVS.cxx
  982. CTest/cmCTestCVS.h
  983. CTest/cmCTestSVN.cxx
  984. CTest/cmCTestSVN.h
  985. CTest/cmCTestBZR.cxx
  986. CTest/cmCTestBZR.h
  987. CTest/cmCTestGIT.cxx
  988. CTest/cmCTestGIT.h
  989. CTest/cmCTestHG.cxx
  990. CTest/cmCTestHG.h
  991. CTest/cmCTestP4.cxx
  992. CTest/cmCTestP4.h
  993. LexerParser/cmCTestResourceGroupsLexer.cxx
  994. LexerParser/cmCTestResourceGroupsLexer.h
  995. LexerParser/cmCTestResourceGroupsLexer.in.l
  996. )
  997. target_include_directories(
  998. CTestLib
  999. PUBLIC
  1000. "${CMAKE_CURRENT_SOURCE_DIR}/CTest"
  1001. )
  1002. target_link_libraries(CTestLib PUBLIC CMakeLib)
  1003. #
  1004. # Build CPackLib
  1005. #
  1006. add_library(
  1007. CPackLib
  1008. CPack/cmCPackArchiveGenerator.cxx
  1009. CPack/cmCPackComponentGroup.cxx
  1010. CPack/cmCPackDebGenerator.cxx
  1011. CPack/cmCPackExternalGenerator.cxx
  1012. CPack/cmCPackGeneratorFactory.cxx
  1013. CPack/cmCPackGenerator.cxx
  1014. CPack/cmCPackLog.cxx
  1015. CPack/cmCPackInnoSetupGenerator.cxx
  1016. CPack/cmCPackNSISGenerator.cxx
  1017. CPack/cmCPackNuGetGenerator.cxx
  1018. CPack/cmCPackSTGZGenerator.cxx
  1019. # CPack IFW generator
  1020. CPack/IFW/cmCPackIFWCommon.cxx
  1021. CPack/IFW/cmCPackIFWCommon.h
  1022. CPack/IFW/cmCPackIFWGenerator.cxx
  1023. CPack/IFW/cmCPackIFWGenerator.h
  1024. CPack/IFW/cmCPackIFWInstaller.cxx
  1025. CPack/IFW/cmCPackIFWInstaller.h
  1026. CPack/IFW/cmCPackIFWPackage.cxx
  1027. CPack/IFW/cmCPackIFWPackage.h
  1028. CPack/IFW/cmCPackIFWRepository.cxx
  1029. CPack/IFW/cmCPackIFWRepository.h
  1030. )
  1031. target_include_directories(
  1032. CPackLib
  1033. PUBLIC
  1034. "${CMAKE_CURRENT_SOURCE_DIR}/CPack"
  1035. "${CMAKE_CURRENT_BINARY_DIR}/CPack"
  1036. )
  1037. target_link_libraries(CPackLib PUBLIC CMakeLib)
  1038. option(CPACK_ENABLE_FREEBSD_PKG "Add FreeBSD pkg(8) generator to CPack." OFF)
  1039. if(UNIX)
  1040. target_sources(
  1041. CPackLib
  1042. PRIVATE
  1043. CPack/cmCPackRPMGenerator.cxx
  1044. )
  1045. # Optionally, try to use pkg(8)
  1046. if(CPACK_ENABLE_FREEBSD_PKG)
  1047. # On UNIX, you may find FreeBSD's pkg(8) and attendant
  1048. # library -- it can be used on FreeBSD, Dragonfly, NetBSD,
  1049. # OpenBSD and also Linux and OSX. Look for the header and
  1050. # the library; it's a warning on FreeBSD if they're not
  1051. # found, and informational on other platforms.
  1052. find_path(FREEBSD_PKG_INCLUDE_DIRS "pkg.h")
  1053. if(FREEBSD_PKG_INCLUDE_DIRS)
  1054. find_library(FREEBSD_PKG_LIBRARIES
  1055. pkg
  1056. DOC "FreeBSD pkg(8) library")
  1057. if(FREEBSD_PKG_LIBRARIES)
  1058. set(ENABLE_BUILD_FREEBSD_PKG 1)
  1059. target_sources(CPackLib PRIVATE CPack/cmCPackFreeBSDGenerator.cxx)
  1060. target_include_directories(CPackLib PUBLIC ${FREEBSD_PKG_INCLUDE_DIRS})
  1061. target_link_libraries(CPackLib PUBLIC ${FREEBSD_PKG_LIBRARIES})
  1062. endif()
  1063. endif()
  1064. if(NOT FREEBSD_PKG_INCLUDE_DIRS OR NOT FREEBSD_PKG_LIBRARIES)
  1065. message(FATAL_ERROR "CPack needs libpkg(3) to produce FreeBSD packages natively.")
  1066. endif()
  1067. else()
  1068. set(FREEBSD_PKG_INCLUDE_DIRS NOTFOUND)
  1069. set(FREEBSD_PKG_LIBRARIES NOTFOUND)
  1070. endif()
  1071. endif()
  1072. if(CYGWIN)
  1073. target_sources(
  1074. CPackLib
  1075. PRIVATE
  1076. CPack/cmCPackCygwinBinaryGenerator.cxx
  1077. CPack/cmCPackCygwinSourceGenerator.cxx
  1078. )
  1079. find_package(LibUUID)
  1080. endif()
  1081. if(WIN32 OR (CYGWIN AND TARGET LibUUID::LibUUID))
  1082. set(ENABLE_BUILD_WIX_GENERATOR 1)
  1083. target_sources(
  1084. CPackLib
  1085. PRIVATE
  1086. CPack/WiX/cmCMakeToWixPath.cxx
  1087. CPack/WiX/cmCMakeToWixPath.h
  1088. CPack/WiX/cmCPackWIXGenerator.cxx
  1089. CPack/WiX/cmCPackWIXGenerator.h
  1090. CPack/WiX/cmWIXAccessControlList.cxx
  1091. CPack/WiX/cmWIXAccessControlList.h
  1092. CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
  1093. CPack/WiX/cmWIXDirectoriesSourceWriter.h
  1094. CPack/WiX/cmWIXFeaturesSourceWriter.cxx
  1095. CPack/WiX/cmWIXFeaturesSourceWriter.h
  1096. CPack/WiX/cmWIXFilesSourceWriter.cxx
  1097. CPack/WiX/cmWIXFilesSourceWriter.h
  1098. CPack/WiX/cmWIXPatch.cxx
  1099. CPack/WiX/cmWIXPatch.h
  1100. CPack/WiX/cmWIXPatchParser.cxx
  1101. CPack/WiX/cmWIXPatchParser.h
  1102. CPack/WiX/cmWIXRichTextFormatWriter.cxx
  1103. CPack/WiX/cmWIXRichTextFormatWriter.h
  1104. CPack/WiX/cmWIXShortcut.cxx
  1105. CPack/WiX/cmWIXShortcut.h
  1106. CPack/WiX/cmWIXSourceWriter.cxx
  1107. CPack/WiX/cmWIXSourceWriter.h
  1108. )
  1109. target_link_libraries(CPackLib PUBLIC $<TARGET_NAME_IF_EXISTS:LibUUID::LibUUID>)
  1110. endif()
  1111. if(APPLE)
  1112. target_sources(
  1113. CPackLib
  1114. PRIVATE
  1115. CPack/cmCPackBundleGenerator.cxx
  1116. CPack/cmCPackDragNDropGenerator.cxx
  1117. CPack/cmCPackPKGGenerator.cxx
  1118. CPack/cmCPackProductBuildGenerator.cxx
  1119. )
  1120. endif()
  1121. if(APPLE)
  1122. # Some compilers produce errors in the CoreServices framework headers.
  1123. # Ideally such errors should be fixed by either the compiler vendor
  1124. # or the framework source, but we try to workaround it and build anyway.
  1125. # If it does not work, build with reduced functionality and warn.
  1126. check_include_file("CoreServices/CoreServices.h" HAVE_CoreServices)
  1127. if(HAVE_CoreServices)
  1128. target_link_libraries(CPackLib PUBLIC "-framework CoreServices")
  1129. else()
  1130. message(WARNING "This compiler does not appear to support\n"
  1131. " #include <CoreServices/CoreServices.h>\n"
  1132. "Some CPack functionality may be limited.\n"
  1133. "See CMakeFiles/CMakeError.log for details of the failure.")
  1134. endif()
  1135. endif()
  1136. # Render config header file for CPackLib
  1137. configure_file(CPack/cmCPackConfigure.h.in CPack/cmCPackConfigure.h)
  1138. # Build CMake executable
  1139. add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h)
  1140. target_link_libraries(cmake PRIVATE CMakeLib ManifestLib)
  1141. list(APPEND _tools cmake)
  1142. # Build CTest executable
  1143. add_executable(ctest ctest.cxx)
  1144. target_link_libraries(ctest PRIVATE CTestLib ManifestLib)
  1145. list(APPEND _tools ctest)
  1146. # Build CPack executable
  1147. add_executable(cpack CPack/cpack.cxx)
  1148. target_link_libraries(cpack PRIVATE CPackLib ManifestLib)
  1149. list(APPEND _tools cpack)
  1150. # Curses GUI
  1151. if(BUILD_CursesDialog)
  1152. add_subdirectory(CursesDialog)
  1153. endif()
  1154. # Qt GUI
  1155. option(BUILD_QtDialog "Build Qt dialog for CMake" FALSE)
  1156. if(BUILD_QtDialog)
  1157. add_subdirectory(QtDialog)
  1158. endif()
  1159. include(${CMAKE_CURRENT_BINARY_DIR}/LocalUserOptions.cmake OPTIONAL)
  1160. include(${CMAKE_CURRENT_SOURCE_DIR}/LocalUserOptions.cmake OPTIONAL)
  1161. if(WIN32)
  1162. # Compute the binary version that appears in the RC file. Version
  1163. # components in the RC file are 16-bit integers so we may have to
  1164. # split the patch component.
  1165. if(CMake_VERSION_PATCH MATCHES "^([0-9]+)([0-9][0-9][0-9][0-9])$")
  1166. set(CMake_RCVERSION_YEAR "${CMAKE_MATCH_1}")
  1167. set(CMake_RCVERSION_MONTH_DAY "${CMAKE_MATCH_2}")
  1168. string(REGEX REPLACE "^0+" "" CMake_RCVERSION_MONTH_DAY "${CMake_RCVERSION_MONTH_DAY}")
  1169. set(CMake_RCVERSION ${CMake_VERSION_MAJOR},${CMake_VERSION_MINOR},${CMake_RCVERSION_YEAR},${CMake_RCVERSION_MONTH_DAY})
  1170. unset(CMake_RCVERSION_MONTH_DAY)
  1171. unset(CMake_RCVERSION_YEAR)
  1172. else()
  1173. set(CMake_RCVERSION ${CMake_VERSION_MAJOR},${CMake_VERSION_MINOR},${CMake_VERSION_PATCH},0)
  1174. endif()
  1175. set(CMake_RCVERSION_STR ${CMake_VERSION})
  1176. # Add Windows executable version information.
  1177. configure_file(CMakeVersion.rc.in CMakeVersion.rc @ONLY)
  1178. # We use a separate object library for this to work around a limitation of
  1179. # MinGW's windres tool with spaces in the path to the include directories.
  1180. add_library(CMakeVersion OBJECT "${CMAKE_CURRENT_BINARY_DIR}/CMakeVersion.rc")
  1181. set_property(TARGET CMakeVersion PROPERTY INCLUDE_DIRECTORIES "")
  1182. foreach(_tool IN LISTS _tools)
  1183. target_link_libraries(${_tool} PRIVATE CMakeVersion)
  1184. endforeach()
  1185. endif()
  1186. if(CMake_JOB_POOL_LINK_BIN)
  1187. set_property(TARGET ${_tools} PROPERTY JOB_POOL_LINK "link-bin")
  1188. set_property(GLOBAL APPEND PROPERTY JOB_POOLS "link-bin=${CMake_JOB_POOL_LINK_BIN}")
  1189. endif()
  1190. # Install tools
  1191. foreach(_tool IN LISTS _tools)
  1192. CMake_OPTIONAL_COMPONENT(${_tool})
  1193. install(TARGETS ${_tool} DESTINATION ${CMAKE_BIN_DIR} ${COMPONENT})
  1194. endforeach()
  1195. install(FILES cmCPluginAPI.h DESTINATION ${CMAKE_DATA_DIR}/include)
  1196. # Unset temporary variables
  1197. unset(_tools)