CMakeLists.txt 34 KB

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