CMakeLists.txt 31 KB

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