CMakeLists.txt 30 KB

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