CMakeLists.txt 34 KB

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