CMakeLists.txt 33 KB

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