CMakeLists.txt 34 KB

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