CMakeLists.txt 35 KB

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