CMakeLists.txt 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319
  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. cmFileAPICommand.cxx
  221. cmFileAPICommand.h
  222. cmFileAPIToolchains.cxx
  223. cmFileAPIToolchains.h
  224. cmFileCopier.cxx
  225. cmFileCopier.h
  226. cmFileInstaller.cxx
  227. cmFileInstaller.h
  228. cmFileLock.cxx
  229. cmFileLock.h
  230. cmFileLockPool.cxx
  231. cmFileLockPool.h
  232. cmFileLockResult.cxx
  233. cmFileLockResult.h
  234. cmFilePathChecksum.cxx
  235. cmFilePathChecksum.h
  236. cmFileSet.cxx
  237. cmFileSet.h
  238. cmFileTime.cxx
  239. cmFileTime.h
  240. cmFileTimeCache.cxx
  241. cmFileTimeCache.h
  242. cmFileTimes.cxx
  243. cmFileTimes.h
  244. cmFortranParserImpl.cxx
  245. cmFSPermissions.cxx
  246. cmFSPermissions.h
  247. cmGccDepfileLexerHelper.cxx
  248. cmGccDepfileLexerHelper.h
  249. cmGccDepfileReader.cxx
  250. cmGccDepfileReader.h
  251. cmGeneratedFileStream.cxx
  252. cmGeneratorExpressionContext.cxx
  253. cmGeneratorExpressionContext.h
  254. cmGeneratorExpressionDAGChecker.cxx
  255. cmGeneratorExpressionDAGChecker.h
  256. cmGeneratorExpressionEvaluationFile.cxx
  257. cmGeneratorExpressionEvaluationFile.h
  258. cmGeneratorExpressionEvaluator.cxx
  259. cmGeneratorExpressionEvaluator.h
  260. cmGeneratorExpressionLexer.cxx
  261. cmGeneratorExpressionLexer.h
  262. cmGeneratorExpressionNode.cxx
  263. cmGeneratorExpressionNode.h
  264. cmGeneratorExpressionParser.cxx
  265. cmGeneratorExpressionParser.h
  266. cmGeneratorExpression.cxx
  267. cmGeneratorExpression.h
  268. cmGeneratorTarget.cxx
  269. cmGeneratorTarget.h
  270. cmLinkItemGraphVisitor.cxx
  271. cmLinkItemGraphVisitor.h
  272. cmGetPipes.cxx
  273. cmGetPipes.h
  274. cmGlobalCommonGenerator.cxx
  275. cmGlobalCommonGenerator.h
  276. cmGlobalGenerator.cxx
  277. cmGlobalGenerator.h
  278. cmGlobalGeneratorFactory.h
  279. cmGlobalUnixMakefileGenerator3.cxx
  280. cmGlobalUnixMakefileGenerator3.h
  281. cmGlobVerificationManager.cxx
  282. cmGlobVerificationManager.h
  283. cmGraphAdjacencyList.h
  284. cmGraphVizWriter.cxx
  285. cmGraphVizWriter.h
  286. cmInstallGenerator.h
  287. cmInstallGenerator.cxx
  288. cmInstallGetRuntimeDependenciesGenerator.h
  289. cmInstallGetRuntimeDependenciesGenerator.cxx
  290. cmInstallExportGenerator.cxx
  291. cmInstalledFile.h
  292. cmInstalledFile.cxx
  293. cmInstallFileSetGenerator.h
  294. cmInstallFileSetGenerator.cxx
  295. cmInstallFilesGenerator.h
  296. cmInstallFilesGenerator.cxx
  297. cmInstallImportedRuntimeArtifactsGenerator.h
  298. cmInstallImportedRuntimeArtifactsGenerator.cxx
  299. cmInstallRuntimeDependencySet.h
  300. cmInstallRuntimeDependencySet.cxx
  301. cmInstallRuntimeDependencySetGenerator.h
  302. cmInstallRuntimeDependencySetGenerator.cxx
  303. cmInstallScriptGenerator.h
  304. cmInstallScriptGenerator.cxx
  305. cmInstallSubdirectoryGenerator.h
  306. cmInstallSubdirectoryGenerator.cxx
  307. cmInstallTargetGenerator.h
  308. cmInstallTargetGenerator.cxx
  309. cmInstallDirectoryGenerator.h
  310. cmInstallDirectoryGenerator.cxx
  311. cmJSONHelpers.h
  312. cmJSONState.cxx
  313. cmJSONState.h
  314. cmLDConfigLDConfigTool.cxx
  315. cmLDConfigLDConfigTool.h
  316. cmLDConfigTool.cxx
  317. cmLDConfigTool.h
  318. cmLinkedTree.h
  319. cmLinkItem.cxx
  320. cmLinkItem.h
  321. cmLinkLineComputer.cxx
  322. cmLinkLineComputer.h
  323. cmLinkLineDeviceComputer.cxx
  324. cmLinkLineDeviceComputer.h
  325. cmList.h
  326. cmList.cxx
  327. cmListFileCache.cxx
  328. cmListFileCache.h
  329. cmLocalCommonGenerator.cxx
  330. cmLocalCommonGenerator.h
  331. cmLocalGenerator.cxx
  332. cmLocalGenerator.h
  333. cmPlaceholderExpander.cxx
  334. cmPlaceholderExpander.h
  335. cmRulePlaceholderExpander.cxx
  336. cmRulePlaceholderExpander.h
  337. cmLocalUnixMakefileGenerator3.cxx
  338. cmLocale.h
  339. cmMakefile.cxx
  340. cmMakefile.h
  341. cmMakefileTargetGenerator.cxx
  342. cmMakefileExecutableTargetGenerator.cxx
  343. cmMakefileLibraryTargetGenerator.cxx
  344. cmMakefileProfilingData.cxx
  345. cmMakefileUtilityTargetGenerator.cxx
  346. cmMessageType.h
  347. cmMessenger.cxx
  348. cmMessenger.h
  349. cmMSVC60LinkLineComputer.cxx
  350. cmMSVC60LinkLineComputer.h
  351. cmOSXBundleGenerator.cxx
  352. cmOSXBundleGenerator.h
  353. cmOutputConverter.cxx
  354. cmOutputConverter.h
  355. cmNewLineStyle.h
  356. cmNewLineStyle.cxx
  357. cmOrderDirectories.cxx
  358. cmOrderDirectories.h
  359. cmPlistParser.cxx
  360. cmPlistParser.h
  361. cmPolicies.h
  362. cmPolicies.cxx
  363. cmProcessOutput.cxx
  364. cmProcessOutput.h
  365. cmProcessTools.cxx
  366. cmProcessTools.h
  367. cmValue.cxx
  368. cmValue.h
  369. cmProperty.h
  370. cmPropertyDefinition.cxx
  371. cmPropertyDefinition.h
  372. cmPropertyMap.cxx
  373. cmPropertyMap.h
  374. cmQtAutoGen.cxx
  375. cmQtAutoGen.h
  376. cmQtAutoGenerator.cxx
  377. cmQtAutoGenerator.h
  378. cmQtAutoGenGlobalInitializer.cxx
  379. cmQtAutoGenGlobalInitializer.h
  380. cmQtAutoGenInitializer.cxx
  381. cmQtAutoGenInitializer.h
  382. cmQtAutoMocUic.cxx
  383. cmQtAutoMocUic.h
  384. cmQtAutoRcc.cxx
  385. cmQtAutoRcc.h
  386. cmRST.cxx
  387. cmRST.h
  388. cmRuntimeDependencyArchive.cxx
  389. cmRuntimeDependencyArchive.h
  390. cmScriptGenerator.h
  391. cmScriptGenerator.cxx
  392. cmSourceFile.cxx
  393. cmSourceFile.h
  394. cmSourceFileLocation.cxx
  395. cmSourceFileLocation.h
  396. cmSourceFileLocationKind.h
  397. cmSourceGroup.cxx
  398. cmSourceGroup.h
  399. cmStandardLevelResolver.cxx
  400. cmStandardLevelResolver.h
  401. cmState.cxx
  402. cmState.h
  403. cmStateDirectory.cxx
  404. cmStateDirectory.h
  405. cmStateSnapshot.cxx
  406. cmStateSnapshot.h
  407. cmStateTypes.h
  408. cmStringAlgorithms.cxx
  409. cmStringAlgorithms.h
  410. cmSystemTools.cxx
  411. cmSystemTools.h
  412. cmTarget.cxx
  413. cmTarget.h
  414. cmTargetPropertyComputer.cxx
  415. cmTargetPropertyComputer.h
  416. cmTargetExport.h
  417. cmTest.cxx
  418. cmTest.h
  419. cmTestGenerator.cxx
  420. cmTestGenerator.h
  421. cmTransformDepfile.cxx
  422. cmTransformDepfile.h
  423. cmUuid.cxx
  424. cmUVHandlePtr.cxx
  425. cmUVHandlePtr.h
  426. cmUVProcessChain.cxx
  427. cmUVProcessChain.h
  428. cmUVStream.h
  429. cmUVStreambuf.h
  430. cmUVSignalHackRAII.h
  431. cmVariableWatch.cxx
  432. cmVariableWatch.h
  433. cmVersion.cxx
  434. cmVersion.h
  435. cmWindowsRegistry.cxx
  436. cmWindowsRegistry.h
  437. cmWorkerPool.cxx
  438. cmWorkerPool.h
  439. cmWorkingDirectory.cxx
  440. cmWorkingDirectory.h
  441. cmXcFramework.cxx
  442. cmXcFramework.h
  443. cmXMLParser.cxx
  444. cmXMLParser.h
  445. cmXMLSafe.cxx
  446. cmXMLSafe.h
  447. cmXMLWriter.cxx
  448. cmXMLWriter.h
  449. cmake.cxx
  450. cmake.h
  451. cmCommand.cxx
  452. cmCommand.h
  453. cmCommands.cxx
  454. cmCommands.h
  455. cmAddCompileDefinitionsCommand.cxx
  456. cmAddCompileDefinitionsCommand.h
  457. cmAddCompileOptionsCommand.cxx
  458. cmAddCompileOptionsCommand.h
  459. cmAddLinkOptionsCommand.cxx
  460. cmAddLinkOptionsCommand.h
  461. cmAddCustomCommandCommand.cxx
  462. cmAddCustomCommandCommand.h
  463. cmAddCustomTargetCommand.cxx
  464. cmAddCustomTargetCommand.h
  465. cmAddDefinitionsCommand.cxx
  466. cmAddDefinitionsCommand.h
  467. cmAddDependenciesCommand.cxx
  468. cmAddDependenciesCommand.h
  469. cmAddExecutableCommand.cxx
  470. cmAddExecutableCommand.h
  471. cmAddLibraryCommand.cxx
  472. cmAddLibraryCommand.h
  473. cmAddSubDirectoryCommand.cxx
  474. cmAddSubDirectoryCommand.h
  475. cmAddTestCommand.cxx
  476. cmAddTestCommand.h
  477. cmAuxSourceDirectoryCommand.cxx
  478. cmAuxSourceDirectoryCommand.h
  479. cmBreakCommand.cxx
  480. cmBreakCommand.h
  481. cmBuildCommand.cxx
  482. cmBuildCommand.h
  483. cmBuildNameCommand.cxx
  484. cmBuildNameCommand.h
  485. cmCMakeHostSystemInformationCommand.cxx
  486. cmCMakeHostSystemInformationCommand.h
  487. cmCMakeLanguageCommand.cxx
  488. cmCMakeLanguageCommand.h
  489. cmCMakeMinimumRequired.cxx
  490. cmCMakeMinimumRequired.h
  491. cmCMakePathCommand.h
  492. cmCMakePathCommand.cxx
  493. cmCMakePolicyCommand.cxx
  494. cmCMakePolicyCommand.h
  495. cmConditionEvaluator.cxx
  496. cmConditionEvaluator.h
  497. cmConfigureFileCommand.cxx
  498. cmConfigureFileCommand.h
  499. cmContinueCommand.cxx
  500. cmContinueCommand.h
  501. cmCoreTryCompile.cxx
  502. cmCoreTryCompile.h
  503. cmCreateTestSourceList.cxx
  504. cmCreateTestSourceList.h
  505. cmDefinePropertyCommand.cxx
  506. cmDefinePropertyCommand.h
  507. cmEnableLanguageCommand.cxx
  508. cmEnableLanguageCommand.h
  509. cmEnableTestingCommand.cxx
  510. cmEnableTestingCommand.h
  511. cmExecProgramCommand.cxx
  512. cmExecProgramCommand.h
  513. cmExecuteProcessCommand.cxx
  514. cmExecuteProcessCommand.h
  515. cmExpandedCommandArgument.cxx
  516. cmExpandedCommandArgument.h
  517. cmExperimental.cxx
  518. cmExperimental.h
  519. cmExportCommand.cxx
  520. cmExportCommand.h
  521. cmExportLibraryDependenciesCommand.cxx
  522. cmExportLibraryDependenciesCommand.h
  523. cmFLTKWrapUICommand.cxx
  524. cmFLTKWrapUICommand.h
  525. cmFileCommand.cxx
  526. cmFileCommand.h
  527. cmFindBase.cxx
  528. cmFindBase.h
  529. cmFindCommon.cxx
  530. cmFindCommon.h
  531. cmFindFileCommand.cxx
  532. cmFindFileCommand.h
  533. cmFindLibraryCommand.cxx
  534. cmFindLibraryCommand.h
  535. cmFindPackageCommand.cxx
  536. cmFindPackageCommand.h
  537. cmFindPathCommand.cxx
  538. cmFindPathCommand.h
  539. cmFindProgramCommand.cxx
  540. cmFindProgramCommand.h
  541. cmForEachCommand.cxx
  542. cmForEachCommand.h
  543. cmBlockCommand.cxx
  544. cmBlockCommand.h
  545. cmFunctionBlocker.cxx
  546. cmFunctionBlocker.h
  547. cmFunctionCommand.cxx
  548. cmFunctionCommand.h
  549. cmGetCMakePropertyCommand.cxx
  550. cmGetCMakePropertyCommand.h
  551. cmGetDirectoryPropertyCommand.cxx
  552. cmGetDirectoryPropertyCommand.h
  553. cmGetFilenameComponentCommand.cxx
  554. cmGetFilenameComponentCommand.h
  555. cmGetPropertyCommand.cxx
  556. cmGetPropertyCommand.h
  557. cmGetSourceFilePropertyCommand.cxx
  558. cmGetSourceFilePropertyCommand.h
  559. cmGetTargetPropertyCommand.cxx
  560. cmGetTargetPropertyCommand.h
  561. cmGetTestPropertyCommand.cxx
  562. cmGetTestPropertyCommand.h
  563. cmHexFileConverter.cxx
  564. cmHexFileConverter.h
  565. cmIfCommand.cxx
  566. cmIfCommand.h
  567. cmIncludeCommand.cxx
  568. cmIncludeCommand.h
  569. cmIncludeDirectoryCommand.cxx
  570. cmIncludeDirectoryCommand.h
  571. cmIncludeExternalMSProjectCommand.cxx
  572. cmIncludeExternalMSProjectCommand.h
  573. cmIncludeGuardCommand.cxx
  574. cmIncludeGuardCommand.h
  575. cmIncludeRegularExpressionCommand.cxx
  576. cmIncludeRegularExpressionCommand.h
  577. cmInstallCommand.cxx
  578. cmInstallCommand.h
  579. cmInstallCommandArguments.cxx
  580. cmInstallCommandArguments.h
  581. cmInstallCxxModuleBmiGenerator.cxx
  582. cmInstallCxxModuleBmiGenerator.h
  583. cmInstallFilesCommand.cxx
  584. cmInstallFilesCommand.h
  585. cmInstallProgramsCommand.cxx
  586. cmInstallProgramsCommand.h
  587. cmInstallTargetsCommand.cxx
  588. cmInstallTargetsCommand.h
  589. cmLinkDirectoriesCommand.cxx
  590. cmLinkDirectoriesCommand.h
  591. cmLinkLibrariesCommand.cxx
  592. cmLinkLibrariesCommand.h
  593. cmListCommand.cxx
  594. cmListCommand.h
  595. cmLoadCacheCommand.cxx
  596. cmLoadCacheCommand.h
  597. cmLoadCommandCommand.cxx
  598. cmLoadCommandCommand.h
  599. cmMacroCommand.cxx
  600. cmMacroCommand.h
  601. cmMakeDirectoryCommand.cxx
  602. cmMakeDirectoryCommand.h
  603. cmMarkAsAdvancedCommand.cxx
  604. cmMarkAsAdvancedCommand.h
  605. cmMathCommand.cxx
  606. cmMathCommand.h
  607. cmMessageCommand.cxx
  608. cmMessageCommand.h
  609. cmMessageMetadata.h
  610. cmOptionCommand.cxx
  611. cmOptionCommand.h
  612. cmOutputRequiredFilesCommand.cxx
  613. cmOutputRequiredFilesCommand.h
  614. cmParseArgumentsCommand.cxx
  615. cmParseArgumentsCommand.h
  616. cmPathLabel.cxx
  617. cmPathLabel.h
  618. cmProjectCommand.cxx
  619. cmProjectCommand.h
  620. cmQTWrapCPPCommand.cxx
  621. cmQTWrapCPPCommand.h
  622. cmQTWrapUICommand.cxx
  623. cmQTWrapUICommand.h
  624. cmRemoveCommand.cxx
  625. cmRemoveCommand.h
  626. cmRemoveDefinitionsCommand.cxx
  627. cmRemoveDefinitionsCommand.h
  628. cmReturnCommand.cxx
  629. cmReturnCommand.h
  630. cmSearchPath.cxx
  631. cmSearchPath.h
  632. cmSeparateArgumentsCommand.cxx
  633. cmSeparateArgumentsCommand.h
  634. cmSetCommand.cxx
  635. cmSetCommand.h
  636. cmSetDirectoryPropertiesCommand.cxx
  637. cmSetDirectoryPropertiesCommand.h
  638. cmSetPropertyCommand.cxx
  639. cmSetPropertyCommand.h
  640. cmSetSourceFilesPropertiesCommand.cxx
  641. cmSetSourceFilesPropertiesCommand.h
  642. cmSetTargetPropertiesCommand.cxx
  643. cmSetTargetPropertiesCommand.h
  644. cmSetTestsPropertiesCommand.cxx
  645. cmSetTestsPropertiesCommand.h
  646. cmSiteNameCommand.cxx
  647. cmSiteNameCommand.h
  648. cmSourceGroupCommand.cxx
  649. cmSourceGroupCommand.h
  650. cmString.cxx
  651. cmString.hxx
  652. cmStringReplaceHelper.cxx
  653. cmStringCommand.cxx
  654. cmStringCommand.h
  655. cmSubcommandTable.cxx
  656. cmSubcommandTable.h
  657. cmSubdirCommand.cxx
  658. cmSubdirCommand.h
  659. cmSubdirDependsCommand.cxx
  660. cmSubdirDependsCommand.h
  661. cmTargetCompileDefinitionsCommand.cxx
  662. cmTargetCompileDefinitionsCommand.h
  663. cmTargetCompileFeaturesCommand.cxx
  664. cmTargetCompileFeaturesCommand.h
  665. cmTargetCompileOptionsCommand.cxx
  666. cmTargetCompileOptionsCommand.h
  667. cmTargetIncludeDirectoriesCommand.cxx
  668. cmTargetIncludeDirectoriesCommand.h
  669. cmTargetLinkOptionsCommand.cxx
  670. cmTargetLinkOptionsCommand.h
  671. cmTargetLinkDirectoriesCommand.cxx
  672. cmTargetLinkDirectoriesCommand.h
  673. cmTargetLinkLibrariesCommand.cxx
  674. cmTargetLinkLibrariesCommand.h
  675. cmTargetPrecompileHeadersCommand.cxx
  676. cmTargetPrecompileHeadersCommand.h
  677. cmTargetPropCommandBase.cxx
  678. cmTargetPropCommandBase.h
  679. cmTargetSourcesCommand.cxx
  680. cmTargetSourcesCommand.h
  681. cmTimestamp.cxx
  682. cmTimestamp.h
  683. cmTryCompileCommand.cxx
  684. cmTryCompileCommand.h
  685. cmTryRunCommand.cxx
  686. cmTryRunCommand.h
  687. cmUnsetCommand.cxx
  688. cmUnsetCommand.h
  689. cmUseMangledMesaCommand.cxx
  690. cmUseMangledMesaCommand.h
  691. cmUtilitySourceCommand.cxx
  692. cmUtilitySourceCommand.h
  693. cmVariableRequiresCommand.cxx
  694. cmVariableRequiresCommand.h
  695. cmVariableWatchCommand.cxx
  696. cmVariableWatchCommand.h
  697. cmWhileCommand.cxx
  698. cmWhileCommand.h
  699. cmWriteFileCommand.cxx
  700. cmWriteFileCommand.h
  701. # Ninja support
  702. cmScanDepFormat.cxx
  703. cmGlobalNinjaGenerator.cxx
  704. cmGlobalNinjaGenerator.h
  705. cmNinjaTypes.h
  706. cmLocalNinjaGenerator.cxx
  707. cmLocalNinjaGenerator.h
  708. cmNinjaTargetGenerator.cxx
  709. cmNinjaTargetGenerator.h
  710. cmNinjaNormalTargetGenerator.cxx
  711. cmNinjaNormalTargetGenerator.h
  712. cmNinjaUtilityTargetGenerator.cxx
  713. cmNinjaUtilityTargetGenerator.h
  714. cmNinjaLinkLineComputer.cxx
  715. cmNinjaLinkLineComputer.h
  716. cmNinjaLinkLineDeviceComputer.cxx
  717. cmNinjaLinkLineDeviceComputer.h
  718. cm_get_date.h
  719. cm_get_date.c
  720. cm_utf8.h
  721. cm_utf8.c
  722. cm_codecvt.hxx
  723. cm_codecvt.cxx
  724. cm_fileno.hxx
  725. cm_fileno.cxx
  726. cmDuration.h
  727. cmDuration.cxx
  728. bindexplib.cxx
  729. )
  730. target_include_directories(
  731. CMakeLib
  732. PUBLIC
  733. # add the include path to find the .h
  734. "${CMAKE_CURRENT_BINARY_DIR}"
  735. "${CMAKE_CURRENT_SOURCE_DIR}"
  736. "${CMAKE_CURRENT_SOURCE_DIR}/LexerParser"
  737. ${CMake_HAIKU_INCLUDE_DIRS}
  738. )
  739. target_link_libraries(
  740. CMakeLib
  741. PUBLIC
  742. cmstd
  743. cmsys
  744. CURL::libcurl
  745. EXPAT::EXPAT
  746. JsonCpp::JsonCpp
  747. $<TARGET_NAME_IF_EXISTS:kwiml::kwiml>
  748. LibArchive::LibArchive
  749. LibRHash::LibRHash
  750. LibUV::LibUV
  751. Threads::Threads
  752. ZLIB::ZLIB
  753. )
  754. if(CMake_ENABLE_DEBUGGER)
  755. target_sources(
  756. CMakeLib
  757. PRIVATE
  758. cmDebuggerAdapter.cxx
  759. cmDebuggerAdapter.h
  760. cmDebuggerBreakpointManager.cxx
  761. cmDebuggerBreakpointManager.h
  762. cmDebuggerExceptionManager.cxx
  763. cmDebuggerExceptionManager.h
  764. cmDebuggerPipeConnection.cxx
  765. cmDebuggerPipeConnection.h
  766. cmDebuggerProtocol.cxx
  767. cmDebuggerProtocol.h
  768. cmDebuggerSourceBreakpoint.cxx
  769. cmDebuggerSourceBreakpoint.h
  770. cmDebuggerStackFrame.cxx
  771. cmDebuggerStackFrame.h
  772. cmDebuggerThread.cxx
  773. cmDebuggerThread.h
  774. cmDebuggerThreadManager.cxx
  775. cmDebuggerThreadManager.h
  776. cmDebuggerVariables.cxx
  777. cmDebuggerVariables.h
  778. cmDebuggerVariablesHelper.cxx
  779. cmDebuggerVariablesHelper.h
  780. cmDebuggerVariablesManager.cxx
  781. cmDebuggerVariablesManager.h
  782. )
  783. target_link_libraries(CMakeLib PUBLIC cppdap::cppdap)
  784. endif()
  785. # Check if we can build the Mach-O parser.
  786. if(CMake_USE_MACH_PARSER)
  787. target_sources(
  788. CMakeLib
  789. PRIVATE
  790. cmMachO.h
  791. cmMachO.cxx
  792. )
  793. endif()
  794. # Check if we can build the XCOFF parser.
  795. if(CMake_USE_XCOFF_PARSER)
  796. target_sources(
  797. CMakeLib
  798. PRIVATE
  799. cmXCOFF.h
  800. cmXCOFF.cxx
  801. )
  802. endif()
  803. # Xcode only works on Apple
  804. if(APPLE)
  805. target_sources(
  806. CMakeLib
  807. PRIVATE
  808. cmXCodeObject.cxx
  809. cmXCode21Object.cxx
  810. cmXCodeScheme.cxx
  811. cmGlobalXCodeGenerator.cxx
  812. cmGlobalXCodeGenerator.h
  813. cmLocalXCodeGenerator.cxx
  814. cmLocalXCodeGenerator.h
  815. )
  816. endif()
  817. if(WIN32)
  818. target_sources(
  819. CMakeLib
  820. PRIVATE
  821. cmCallVisualStudioMacro.cxx
  822. cmCallVisualStudioMacro.h
  823. )
  824. if(NOT UNIX)
  825. target_sources(
  826. CMakeLib
  827. PRIVATE
  828. cmGlobalBorlandMakefileGenerator.cxx
  829. cmGlobalBorlandMakefileGenerator.h
  830. cmGlobalMSYSMakefileGenerator.cxx
  831. cmGlobalMinGWMakefileGenerator.cxx
  832. cmGlobalNMakeMakefileGenerator.cxx
  833. cmGlobalNMakeMakefileGenerator.h
  834. cmGlobalJOMMakefileGenerator.cxx
  835. cmGlobalJOMMakefileGenerator.h
  836. cmGlobalVisualStudio71Generator.cxx
  837. cmGlobalVisualStudio71Generator.h
  838. cmGlobalVisualStudio7Generator.cxx
  839. cmGlobalVisualStudio7Generator.h
  840. cmGlobalVisualStudio8Generator.cxx
  841. cmGlobalVisualStudio8Generator.h
  842. cmGlobalVisualStudio9Generator.cxx
  843. cmGlobalVisualStudio9Generator.h
  844. cmVisualStudioGeneratorOptions.h
  845. cmVisualStudioGeneratorOptions.cxx
  846. cmVsProjectType.h
  847. cmVisualStudio10TargetGenerator.h
  848. cmVisualStudio10TargetGenerator.cxx
  849. cmLocalVisualStudio10Generator.cxx
  850. cmLocalVisualStudio10Generator.h
  851. cmGlobalVisualStudio10Generator.h
  852. cmGlobalVisualStudio10Generator.cxx
  853. cmGlobalVisualStudio11Generator.h
  854. cmGlobalVisualStudio11Generator.cxx
  855. cmGlobalVisualStudio12Generator.h
  856. cmGlobalVisualStudio12Generator.cxx
  857. cmGlobalVisualStudio14Generator.h
  858. cmGlobalVisualStudio14Generator.cxx
  859. cmGlobalVisualStudioGenerator.cxx
  860. cmGlobalVisualStudioGenerator.h
  861. cmGlobalVisualStudioVersionedGenerator.h
  862. cmGlobalVisualStudioVersionedGenerator.cxx
  863. cmIDEFlagTable.h
  864. cmIDEOptions.cxx
  865. cmIDEOptions.h
  866. cmLocalVisualStudio7Generator.cxx
  867. cmLocalVisualStudio7Generator.h
  868. cmLocalVisualStudioGenerator.cxx
  869. cmLocalVisualStudioGenerator.h
  870. cmVisualStudioSlnData.h
  871. cmVisualStudioSlnData.cxx
  872. cmVisualStudioSlnParser.h
  873. cmVisualStudioSlnParser.cxx
  874. cmVisualStudioWCEPlatformParser.h
  875. cmVisualStudioWCEPlatformParser.cxx
  876. cmVSSetupHelper.cxx
  877. cmVSSetupHelper.h
  878. )
  879. # Add a manifest file to executables on Windows to allow for
  880. # GetVersion to work properly on Windows 8 and above.
  881. target_sources(ManifestLib INTERFACE cmake.version.manifest)
  882. endif()
  883. endif()
  884. # Watcom support
  885. if(CMAKE_USE_WMAKE)
  886. target_sources(
  887. CMakeLib
  888. PRIVATE
  889. cmGlobalWatcomWMakeGenerator.cxx
  890. cmGlobalWatcomWMakeGenerator.h
  891. )
  892. endif()
  893. # GHS support
  894. # Works only for windows and linux
  895. if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
  896. target_sources(
  897. CMakeLib
  898. PRIVATE
  899. cmGlobalGhsMultiGenerator.cxx
  900. cmGlobalGhsMultiGenerator.h
  901. cmLocalGhsMultiGenerator.cxx
  902. cmLocalGhsMultiGenerator.h
  903. cmGhsMultiTargetGenerator.cxx
  904. cmGhsMultiTargetGenerator.h
  905. cmGhsMultiGpj.cxx
  906. cmGhsMultiGpj.h
  907. )
  908. endif()
  909. if(CMake_BUILD_PCH)
  910. target_precompile_headers(CMakeLib PRIVATE
  911. "$<$<COMPILE_LANGUAGE:CXX>:<string$<ANGLE-R>>"
  912. "$<$<COMPILE_LANGUAGE:CXX>:<iostream$<ANGLE-R>>"
  913. "$<$<COMPILE_LANGUAGE:CXX>:<sstream$<ANGLE-R>>"
  914. "$<$<COMPILE_LANGUAGE:CXX>:<iomanip$<ANGLE-R>>"
  915. "$<$<COMPILE_LANGUAGE:CXX>:<cm/memory$<ANGLE-R>>"
  916. "$<$<COMPILE_LANGUAGE:CXX>:<cm3p/cppdap/protocol.h$<ANGLE-R>>"
  917. "$<$<COMPILE_LANGUAGE:CXX>:cmMakefile.h>"
  918. "$<$<COMPILE_LANGUAGE:CXX>:cmGlobalGenerator.h>"
  919. "$<$<COMPILE_LANGUAGE:CXX>:cmLocalGenerator.h>"
  920. "$<$<COMPILE_LANGUAGE:CXX>:cmGeneratorTarget.h>"
  921. "$<$<COMPILE_LANGUAGE:CXX>:cmGeneratorExpression.h>"
  922. "$<$<COMPILE_LANGUAGE:CXX>:cmArgumentParser.h>"
  923. "$<$<COMPILE_LANGUAGE:CXX>:cmake.h>"
  924. "$<$<COMPILE_LANGUAGE:CXX>:cmCMakePath.h>"
  925. "$<$<COMPILE_LANGUAGE:CXX>:cmDebuggerPipeConnection.h>"
  926. "$<$<COMPILE_LANGUAGE:CXX>:cmCurl.h>")
  927. set_source_files_properties(
  928. "LexerParser/cmFortranLexer.cxx"
  929. PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
  930. if(WIN32)
  931. target_precompile_headers(CMakeLib PRIVATE
  932. "$<$<COMPILE_LANGUAGE:CXX>:<cm3p/uv.h$<ANGLE-R>>"
  933. "$<$<COMPILE_LANGUAGE:CXX>:cmVSSetupHelper.h>")
  934. set_source_files_properties("LexerParser/cmFortranParser.cxx" PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
  935. else()
  936. set_source_files_properties(
  937. "LexerParser/cmCommandArgumentLexer.cxx"
  938. "LexerParser/cmGccDepfileLexer.cxx"
  939. "LexerParser/cmExprLexer.cxx"
  940. "LexerParser/cmDependsJavaLexer.cxx"
  941. PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
  942. endif()
  943. endif()
  944. # Temporary variable for tools targets
  945. set(_tools)
  946. if(WIN32 AND NOT CYGWIN)
  947. set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
  948. add_executable(cmcldeps cmcldeps.cxx)
  949. target_link_libraries(cmcldeps PRIVATE CMakeLib ManifestLib)
  950. list(APPEND _tools cmcldeps)
  951. endif()
  952. # Some atomic instructions are implemented using libatomic on some platforms.
  953. if(CMake_HAVE_CXX_ATOMIC_LIB)
  954. target_link_libraries(CMakeLib PUBLIC atomic)
  955. endif()
  956. # On Apple we need CoreFoundation and CoreServices
  957. if(APPLE)
  958. target_link_libraries(CMakeLib PUBLIC "-framework CoreFoundation")
  959. target_link_libraries(CMakeLib PUBLIC "-framework CoreServices")
  960. endif()
  961. if(WIN32 AND NOT UNIX)
  962. # We need the rpcrt4 library on Windows.
  963. # We need the crypt32 library on Windows for crypto/cert APIs.
  964. target_link_libraries(CMakeLib PUBLIC rpcrt4 crypt32)
  965. endif()
  966. target_compile_definitions(CMakeLib PUBLIC ${CLANG_TIDY_DEFINITIONS})
  967. #
  968. # Build CTestLib
  969. #
  970. add_library(
  971. CTestLib
  972. cmCTest.cxx
  973. CTest/cmProcess.cxx
  974. CTest/cmCTestBinPacker.cxx
  975. CTest/cmCTestBuildAndTestHandler.cxx
  976. CTest/cmCTestBuildCommand.cxx
  977. CTest/cmCTestBuildHandler.cxx
  978. CTest/cmCTestConfigureCommand.cxx
  979. CTest/cmCTestConfigureHandler.cxx
  980. CTest/cmCTestCoverageCommand.cxx
  981. CTest/cmCTestCoverageHandler.cxx
  982. CTest/cmCTestCurl.cxx
  983. CTest/cmParseMumpsCoverage.cxx
  984. CTest/cmParseCacheCoverage.cxx
  985. CTest/cmParseGTMCoverage.cxx
  986. CTest/cmParseJacocoCoverage.cxx
  987. CTest/cmParseBlanketJSCoverage.cxx
  988. CTest/cmParsePHPCoverage.cxx
  989. CTest/cmParseCoberturaCoverage.cxx
  990. CTest/cmParseDelphiCoverage.cxx
  991. CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
  992. CTest/cmCTestGenericHandler.cxx
  993. CTest/cmCTestHandlerCommand.cxx
  994. CTest/cmCTestResourceAllocator.cxx
  995. CTest/cmCTestResourceSpec.cxx
  996. CTest/cmCTestLaunch.cxx
  997. CTest/cmCTestLaunchReporter.cxx
  998. CTest/cmCTestMemCheckCommand.cxx
  999. CTest/cmCTestMemCheckHandler.cxx
  1000. CTest/cmCTestMultiProcessHandler.cxx
  1001. CTest/cmCTestReadCustomFilesCommand.cxx
  1002. CTest/cmCTestResourceGroupsLexerHelper.cxx
  1003. CTest/cmCTestRunScriptCommand.cxx
  1004. CTest/cmCTestRunTest.cxx
  1005. CTest/cmCTestScriptHandler.cxx
  1006. CTest/cmCTestSleepCommand.cxx
  1007. CTest/cmCTestStartCommand.cxx
  1008. CTest/cmCTestSubmitCommand.cxx
  1009. CTest/cmCTestSubmitHandler.cxx
  1010. CTest/cmCTestTestCommand.cxx
  1011. CTest/cmCTestTestHandler.cxx
  1012. CTest/cmCTestTestMeasurementXMLParser.cxx
  1013. CTest/cmCTestUpdateCommand.cxx
  1014. CTest/cmCTestUpdateHandler.cxx
  1015. CTest/cmCTestUploadCommand.cxx
  1016. CTest/cmCTestUploadHandler.cxx
  1017. CTest/cmCTestVC.cxx
  1018. CTest/cmCTestVC.h
  1019. CTest/cmCTestGlobalVC.cxx
  1020. CTest/cmCTestGlobalVC.h
  1021. CTest/cmCTestCVS.cxx
  1022. CTest/cmCTestCVS.h
  1023. CTest/cmCTestSVN.cxx
  1024. CTest/cmCTestSVN.h
  1025. CTest/cmCTestBZR.cxx
  1026. CTest/cmCTestBZR.h
  1027. CTest/cmCTestGIT.cxx
  1028. CTest/cmCTestGIT.h
  1029. CTest/cmCTestHG.cxx
  1030. CTest/cmCTestHG.h
  1031. CTest/cmCTestP4.cxx
  1032. CTest/cmCTestP4.h
  1033. LexerParser/cmCTestResourceGroupsLexer.cxx
  1034. LexerParser/cmCTestResourceGroupsLexer.h
  1035. LexerParser/cmCTestResourceGroupsLexer.in.l
  1036. )
  1037. target_include_directories(
  1038. CTestLib
  1039. PUBLIC
  1040. "${CMAKE_CURRENT_SOURCE_DIR}/CTest"
  1041. )
  1042. target_link_libraries(CTestLib PUBLIC CMakeLib)
  1043. if(CMake_BUILD_PCH)
  1044. target_precompile_headers(CTestLib PRIVATE
  1045. "cmDuration.h"
  1046. "cmMakefile.h"
  1047. "cmSystemTools.h"
  1048. "cmGlobalGenerator.h"
  1049. "cmake.h"
  1050. "CTest/cmCTestGenericHandler.h"
  1051. "<sstream>"
  1052. "<cm3p/uv.h>")
  1053. if(WIN32)
  1054. target_precompile_headers(CTestLib PRIVATE "cmCurl.h" "CTest/cmCTestMultiProcessHandler.h")
  1055. else()
  1056. set_source_files_properties("LexerParser/cmCTestResourceGroupsLexer.cxx" PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
  1057. endif()
  1058. endif()
  1059. #
  1060. # Build CPackLib
  1061. #
  1062. add_library(
  1063. CPackLib
  1064. CPack/cmCPackArchiveGenerator.cxx
  1065. CPack/cmCPackComponentGroup.cxx
  1066. CPack/cmCPackDebGenerator.cxx
  1067. CPack/cmCPackExternalGenerator.cxx
  1068. CPack/cmCPackGeneratorFactory.cxx
  1069. CPack/cmCPackGenerator.cxx
  1070. CPack/cmCPackLog.cxx
  1071. CPack/cmCPackInnoSetupGenerator.cxx
  1072. CPack/cmCPackNSISGenerator.cxx
  1073. CPack/cmCPackNuGetGenerator.cxx
  1074. CPack/cmCPackSTGZGenerator.cxx
  1075. # CPack IFW generator
  1076. CPack/IFW/cmCPackIFWCommon.cxx
  1077. CPack/IFW/cmCPackIFWCommon.h
  1078. CPack/IFW/cmCPackIFWGenerator.cxx
  1079. CPack/IFW/cmCPackIFWGenerator.h
  1080. CPack/IFW/cmCPackIFWInstaller.cxx
  1081. CPack/IFW/cmCPackIFWInstaller.h
  1082. CPack/IFW/cmCPackIFWPackage.cxx
  1083. CPack/IFW/cmCPackIFWPackage.h
  1084. CPack/IFW/cmCPackIFWRepository.cxx
  1085. CPack/IFW/cmCPackIFWRepository.h
  1086. )
  1087. target_include_directories(
  1088. CPackLib
  1089. PUBLIC
  1090. "${CMAKE_CURRENT_SOURCE_DIR}/CPack"
  1091. "${CMAKE_CURRENT_BINARY_DIR}/CPack"
  1092. )
  1093. target_link_libraries(CPackLib PUBLIC CMakeLib)
  1094. option(CPACK_ENABLE_FREEBSD_PKG "Add FreeBSD pkg(8) generator to CPack." OFF)
  1095. if(UNIX)
  1096. target_sources(
  1097. CPackLib
  1098. PRIVATE
  1099. CPack/cmCPackRPMGenerator.cxx
  1100. )
  1101. # Optionally, try to use pkg(8)
  1102. if(CPACK_ENABLE_FREEBSD_PKG)
  1103. # On UNIX, you may find FreeBSD's pkg(8) and attendant
  1104. # library -- it can be used on FreeBSD, Dragonfly, NetBSD,
  1105. # OpenBSD and also Linux and OSX. Look for the header and
  1106. # the library; it's a warning on FreeBSD if they're not
  1107. # found, and informational on other platforms.
  1108. find_path(FREEBSD_PKG_INCLUDE_DIRS "pkg.h")
  1109. if(FREEBSD_PKG_INCLUDE_DIRS)
  1110. find_library(FREEBSD_PKG_LIBRARIES
  1111. pkg
  1112. DOC "FreeBSD pkg(8) library")
  1113. if(FREEBSD_PKG_LIBRARIES)
  1114. set(ENABLE_BUILD_FREEBSD_PKG 1)
  1115. target_sources(CPackLib PRIVATE CPack/cmCPackFreeBSDGenerator.cxx)
  1116. target_include_directories(CPackLib PUBLIC ${FREEBSD_PKG_INCLUDE_DIRS})
  1117. target_link_libraries(CPackLib PUBLIC ${FREEBSD_PKG_LIBRARIES})
  1118. endif()
  1119. endif()
  1120. if(NOT FREEBSD_PKG_INCLUDE_DIRS OR NOT FREEBSD_PKG_LIBRARIES)
  1121. message(FATAL_ERROR "CPack needs libpkg(3) to produce FreeBSD packages natively.")
  1122. endif()
  1123. else()
  1124. set(FREEBSD_PKG_INCLUDE_DIRS NOTFOUND)
  1125. set(FREEBSD_PKG_LIBRARIES NOTFOUND)
  1126. endif()
  1127. endif()
  1128. if(CYGWIN)
  1129. target_sources(
  1130. CPackLib
  1131. PRIVATE
  1132. CPack/cmCPackCygwinBinaryGenerator.cxx
  1133. CPack/cmCPackCygwinSourceGenerator.cxx
  1134. )
  1135. find_package(LibUUID)
  1136. endif()
  1137. if(WIN32 OR (CYGWIN AND TARGET LibUUID::LibUUID))
  1138. set(ENABLE_BUILD_WIX_GENERATOR 1)
  1139. target_sources(
  1140. CPackLib
  1141. PRIVATE
  1142. CPack/WiX/cmCMakeToWixPath.cxx
  1143. CPack/WiX/cmCMakeToWixPath.h
  1144. CPack/WiX/cmCPackWIXGenerator.cxx
  1145. CPack/WiX/cmCPackWIXGenerator.h
  1146. CPack/WiX/cmWIXAccessControlList.cxx
  1147. CPack/WiX/cmWIXAccessControlList.h
  1148. CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
  1149. CPack/WiX/cmWIXDirectoriesSourceWriter.h
  1150. CPack/WiX/cmWIXFeaturesSourceWriter.cxx
  1151. CPack/WiX/cmWIXFeaturesSourceWriter.h
  1152. CPack/WiX/cmWIXFilesSourceWriter.cxx
  1153. CPack/WiX/cmWIXFilesSourceWriter.h
  1154. CPack/WiX/cmWIXPatch.cxx
  1155. CPack/WiX/cmWIXPatch.h
  1156. CPack/WiX/cmWIXPatchParser.cxx
  1157. CPack/WiX/cmWIXPatchParser.h
  1158. CPack/WiX/cmWIXRichTextFormatWriter.cxx
  1159. CPack/WiX/cmWIXRichTextFormatWriter.h
  1160. CPack/WiX/cmWIXShortcut.cxx
  1161. CPack/WiX/cmWIXShortcut.h
  1162. CPack/WiX/cmWIXSourceWriter.cxx
  1163. CPack/WiX/cmWIXSourceWriter.h
  1164. )
  1165. target_link_libraries(CPackLib PUBLIC $<TARGET_NAME_IF_EXISTS:LibUUID::LibUUID>)
  1166. endif()
  1167. if(APPLE)
  1168. target_sources(
  1169. CPackLib
  1170. PRIVATE
  1171. CPack/cmCPackBundleGenerator.cxx
  1172. CPack/cmCPackDragNDropGenerator.cxx
  1173. CPack/cmCPackPKGGenerator.cxx
  1174. CPack/cmCPackProductBuildGenerator.cxx
  1175. )
  1176. endif()
  1177. if(APPLE)
  1178. # Some compilers produce errors in the CoreServices framework headers.
  1179. # Ideally such errors should be fixed by either the compiler vendor
  1180. # or the framework source, but we try to workaround it and build anyway.
  1181. # If it does not work, build with reduced functionality and warn.
  1182. check_include_file("CoreServices/CoreServices.h" HAVE_CoreServices)
  1183. if(HAVE_CoreServices)
  1184. target_link_libraries(CPackLib PUBLIC "-framework CoreServices")
  1185. else()
  1186. message(WARNING "This compiler does not appear to support\n"
  1187. " #include <CoreServices/CoreServices.h>\n"
  1188. "Some CPack functionality may be limited.\n"
  1189. "See CMakeFiles/CMakeError.log for details of the failure.")
  1190. endif()
  1191. endif()
  1192. # Render config header file for CPackLib
  1193. configure_file(CPack/cmCPackConfigure.h.in CPack/cmCPackConfigure.h)
  1194. # Build CMake executable
  1195. add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h)
  1196. target_link_libraries(cmake PRIVATE CMakeLib ManifestLib)
  1197. list(APPEND _tools cmake)
  1198. # Build CTest executable
  1199. add_executable(ctest ctest.cxx)
  1200. target_link_libraries(ctest PRIVATE CTestLib ManifestLib)
  1201. list(APPEND _tools ctest)
  1202. # Build CPack executable
  1203. add_executable(cpack CPack/cpack.cxx)
  1204. target_link_libraries(cpack PRIVATE CPackLib ManifestLib)
  1205. list(APPEND _tools cpack)
  1206. # Curses GUI
  1207. if(BUILD_CursesDialog)
  1208. add_subdirectory(CursesDialog)
  1209. endif()
  1210. # Qt GUI
  1211. option(BUILD_QtDialog "Build Qt dialog for CMake" FALSE)
  1212. if(BUILD_QtDialog)
  1213. add_subdirectory(QtDialog)
  1214. endif()
  1215. include(${CMAKE_CURRENT_BINARY_DIR}/LocalUserOptions.cmake OPTIONAL)
  1216. include(${CMAKE_CURRENT_SOURCE_DIR}/LocalUserOptions.cmake OPTIONAL)
  1217. if(WIN32)
  1218. # Compute the binary version that appears in the RC file. Version
  1219. # components in the RC file are 16-bit integers so we may have to
  1220. # split the patch component.
  1221. if(CMake_VERSION_PATCH MATCHES "^([0-9]+)([0-9][0-9][0-9][0-9])$")
  1222. set(CMake_RCVERSION_YEAR "${CMAKE_MATCH_1}")
  1223. set(CMake_RCVERSION_MONTH_DAY "${CMAKE_MATCH_2}")
  1224. string(REGEX REPLACE "^0+" "" CMake_RCVERSION_MONTH_DAY "${CMake_RCVERSION_MONTH_DAY}")
  1225. set(CMake_RCVERSION ${CMake_VERSION_MAJOR},${CMake_VERSION_MINOR},${CMake_RCVERSION_YEAR},${CMake_RCVERSION_MONTH_DAY})
  1226. unset(CMake_RCVERSION_MONTH_DAY)
  1227. unset(CMake_RCVERSION_YEAR)
  1228. else()
  1229. set(CMake_RCVERSION ${CMake_VERSION_MAJOR},${CMake_VERSION_MINOR},${CMake_VERSION_PATCH},0)
  1230. endif()
  1231. set(CMake_RCVERSION_STR ${CMake_VERSION})
  1232. # Add Windows executable version information.
  1233. configure_file(CMakeVersion.rc.in CMakeVersion.rc @ONLY)
  1234. # We use a separate object library for this to work around a limitation of
  1235. # MinGW's windres tool with spaces in the path to the include directories.
  1236. add_library(CMakeVersion OBJECT "${CMAKE_CURRENT_BINARY_DIR}/CMakeVersion.rc")
  1237. set_property(TARGET CMakeVersion PROPERTY INCLUDE_DIRECTORIES "")
  1238. foreach(_tool IN LISTS _tools)
  1239. target_link_libraries(${_tool} PRIVATE CMakeVersion)
  1240. endforeach()
  1241. endif()
  1242. if(CMake_JOB_POOL_LINK_BIN)
  1243. set_property(TARGET ${_tools} PROPERTY JOB_POOL_LINK "link-bin")
  1244. set_property(GLOBAL APPEND PROPERTY JOB_POOLS "link-bin=${CMake_JOB_POOL_LINK_BIN}")
  1245. endif()
  1246. # Install tools
  1247. foreach(_tool IN LISTS _tools)
  1248. CMake_OPTIONAL_COMPONENT(${_tool})
  1249. install(TARGETS ${_tool} DESTINATION ${CMAKE_BIN_DIR} ${COMPONENT})
  1250. endforeach()
  1251. install(FILES cmCPluginAPI.h DESTINATION ${CMAKE_DATA_DIR}/include)
  1252. # Unset temporary variables
  1253. unset(_tools)