CMakeLists.txt 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091
  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. cmUVSignalHackRAII.h
  339. cmVariableWatch.cxx
  340. cmVariableWatch.h
  341. cmVersion.cxx
  342. cmVersion.h
  343. cmWorkingDirectory.cxx
  344. cmWorkingDirectory.h
  345. cmXMLParser.cxx
  346. cmXMLParser.h
  347. cmXMLSafe.cxx
  348. cmXMLSafe.h
  349. cmXMLWriter.cxx
  350. cmXMLWriter.h
  351. cmake.cxx
  352. cmake.h
  353. cmCommand.cxx
  354. cmCommand.h
  355. cmCommands.cxx
  356. cmCommands.h
  357. cmAddCompileOptionsCommand.cxx
  358. cmAddCompileOptionsCommand.h
  359. cmAddCustomCommandCommand.cxx
  360. cmAddCustomCommandCommand.h
  361. cmAddCustomTargetCommand.cxx
  362. cmAddCustomTargetCommand.h
  363. cmAddDefinitionsCommand.cxx
  364. cmAddDefinitionsCommand.h
  365. cmAddDependenciesCommand.cxx
  366. cmAddDependenciesCommand.h
  367. cmAddExecutableCommand.cxx
  368. cmAddExecutableCommand.h
  369. cmAddLibraryCommand.cxx
  370. cmAddLibraryCommand.h
  371. cmAddSubDirectoryCommand.cxx
  372. cmAddSubDirectoryCommand.h
  373. cmAddTestCommand.cxx
  374. cmAddTestCommand.h
  375. cmAuxSourceDirectoryCommand.cxx
  376. cmAuxSourceDirectoryCommand.h
  377. cmBreakCommand.cxx
  378. cmBreakCommand.h
  379. cmBuildCommand.cxx
  380. cmBuildCommand.h
  381. cmBuildNameCommand.cxx
  382. cmBuildNameCommand.h
  383. cmCMakeHostSystemInformationCommand.cxx
  384. cmCMakeHostSystemInformationCommand.h
  385. cmCMakeMinimumRequired.cxx
  386. cmCMakeMinimumRequired.h
  387. cmCMakePolicyCommand.cxx
  388. cmCMakePolicyCommand.h
  389. cmCommandArgumentsHelper.cxx
  390. cmCommandArgumentsHelper.h
  391. cmConditionEvaluator.cxx
  392. cmConditionEvaluator.h
  393. cmConfigureFileCommand.cxx
  394. cmConfigureFileCommand.h
  395. cmContinueCommand.cxx
  396. cmContinueCommand.h
  397. cmCoreTryCompile.cxx
  398. cmCoreTryCompile.h
  399. cmCreateTestSourceList.cxx
  400. cmCreateTestSourceList.h
  401. cmDefinePropertyCommand.cxx
  402. cmDefinePropertyCommand.h
  403. cmDisallowedCommand.cxx
  404. cmDisallowedCommand.h
  405. cmEnableLanguageCommand.cxx
  406. cmEnableLanguageCommand.h
  407. cmEnableTestingCommand.cxx
  408. cmEnableTestingCommand.h
  409. cmExecProgramCommand.cxx
  410. cmExecProgramCommand.h
  411. cmExecuteProcessCommand.cxx
  412. cmExecuteProcessCommand.h
  413. cmExpandedCommandArgument.cxx
  414. cmExpandedCommandArgument.h
  415. cmExportCommand.cxx
  416. cmExportCommand.h
  417. cmExportLibraryDependenciesCommand.cxx
  418. cmExportLibraryDependenciesCommand.h
  419. cmFLTKWrapUICommand.cxx
  420. cmFLTKWrapUICommand.h
  421. cmFileCommand.cxx
  422. cmFileCommand.h
  423. cmFindBase.cxx
  424. cmFindBase.h
  425. cmFindCommon.cxx
  426. cmFindCommon.h
  427. cmFindFileCommand.cxx
  428. cmFindFileCommand.h
  429. cmFindLibraryCommand.cxx
  430. cmFindLibraryCommand.h
  431. cmFindPackageCommand.cxx
  432. cmFindPackageCommand.h
  433. cmFindPathCommand.cxx
  434. cmFindPathCommand.h
  435. cmFindProgramCommand.cxx
  436. cmFindProgramCommand.h
  437. cmForEachCommand.cxx
  438. cmForEachCommand.h
  439. cmFunctionCommand.cxx
  440. cmFunctionCommand.h
  441. cmGetCMakePropertyCommand.cxx
  442. cmGetCMakePropertyCommand.h
  443. cmGetDirectoryPropertyCommand.cxx
  444. cmGetDirectoryPropertyCommand.h
  445. cmGetFilenameComponentCommand.cxx
  446. cmGetFilenameComponentCommand.h
  447. cmGetPropertyCommand.cxx
  448. cmGetPropertyCommand.h
  449. cmGetSourceFilePropertyCommand.cxx
  450. cmGetSourceFilePropertyCommand.h
  451. cmGetTargetPropertyCommand.cxx
  452. cmGetTargetPropertyCommand.h
  453. cmGetTestPropertyCommand.cxx
  454. cmGetTestPropertyCommand.h
  455. cmHexFileConverter.cxx
  456. cmHexFileConverter.h
  457. cmIfCommand.cxx
  458. cmIfCommand.h
  459. cmIncludeCommand.cxx
  460. cmIncludeCommand.h
  461. cmIncludeDirectoryCommand.cxx
  462. cmIncludeDirectoryCommand.h
  463. cmIncludeExternalMSProjectCommand.cxx
  464. cmIncludeExternalMSProjectCommand.h
  465. cmIncludeGuardCommand.cxx
  466. cmIncludeGuardCommand.h
  467. cmIncludeRegularExpressionCommand.cxx
  468. cmIncludeRegularExpressionCommand.h
  469. cmInstallCommand.cxx
  470. cmInstallCommand.h
  471. cmInstallCommandArguments.cxx
  472. cmInstallCommandArguments.h
  473. cmInstallFilesCommand.cxx
  474. cmInstallFilesCommand.h
  475. cmInstallProgramsCommand.cxx
  476. cmInstallProgramsCommand.h
  477. cmInstallTargetsCommand.cxx
  478. cmInstallTargetsCommand.h
  479. cmLinkDirectoriesCommand.cxx
  480. cmLinkDirectoriesCommand.h
  481. cmLinkLibrariesCommand.cxx
  482. cmLinkLibrariesCommand.h
  483. cmListCommand.cxx
  484. cmListCommand.h
  485. cmLoadCacheCommand.cxx
  486. cmLoadCacheCommand.h
  487. cmLoadCommandCommand.cxx
  488. cmLoadCommandCommand.h
  489. cmMacroCommand.cxx
  490. cmMacroCommand.h
  491. cmMakeDirectoryCommand.cxx
  492. cmMakeDirectoryCommand.h
  493. cmMarkAsAdvancedCommand.cxx
  494. cmMarkAsAdvancedCommand.h
  495. cmMathCommand.cxx
  496. cmMathCommand.h
  497. cmMessageCommand.cxx
  498. cmMessageCommand.h
  499. cmOptionCommand.cxx
  500. cmOptionCommand.h
  501. cmOutputRequiredFilesCommand.cxx
  502. cmOutputRequiredFilesCommand.h
  503. cmParseArgumentsCommand.cxx
  504. cmParseArgumentsCommand.h
  505. cmPathLabel.cxx
  506. cmPathLabel.h
  507. cmProjectCommand.cxx
  508. cmProjectCommand.h
  509. cmQTWrapCPPCommand.cxx
  510. cmQTWrapCPPCommand.h
  511. cmQTWrapUICommand.cxx
  512. cmQTWrapUICommand.h
  513. cmRemoveCommand.cxx
  514. cmRemoveCommand.h
  515. cmRemoveDefinitionsCommand.cxx
  516. cmRemoveDefinitionsCommand.h
  517. cmReturnCommand.cxx
  518. cmReturnCommand.h
  519. cmSearchPath.cxx
  520. cmSearchPath.h
  521. cmSeparateArgumentsCommand.cxx
  522. cmSeparateArgumentsCommand.h
  523. cmSetCommand.cxx
  524. cmSetCommand.h
  525. cmSetDirectoryPropertiesCommand.cxx
  526. cmSetDirectoryPropertiesCommand.h
  527. cmSetPropertyCommand.cxx
  528. cmSetPropertyCommand.h
  529. cmSetSourceFilesPropertiesCommand.cxx
  530. cmSetSourceFilesPropertiesCommand.h
  531. cmSetTargetPropertiesCommand.cxx
  532. cmSetTargetPropertiesCommand.h
  533. cmSetTestsPropertiesCommand.cxx
  534. cmSetTestsPropertiesCommand.h
  535. cmSiteNameCommand.cxx
  536. cmSiteNameCommand.h
  537. cmSourceGroupCommand.cxx
  538. cmSourceGroupCommand.h
  539. cmStringCommand.cxx
  540. cmStringCommand.h
  541. cmSubdirCommand.cxx
  542. cmSubdirCommand.h
  543. cmSubdirDependsCommand.cxx
  544. cmSubdirDependsCommand.h
  545. cmTargetCompileDefinitionsCommand.cxx
  546. cmTargetCompileDefinitionsCommand.h
  547. cmTargetCompileFeaturesCommand.cxx
  548. cmTargetCompileFeaturesCommand.h
  549. cmTargetCompileOptionsCommand.cxx
  550. cmTargetCompileOptionsCommand.h
  551. cmTargetIncludeDirectoriesCommand.cxx
  552. cmTargetIncludeDirectoriesCommand.h
  553. cmTargetLinkLibrariesCommand.cxx
  554. cmTargetLinkLibrariesCommand.h
  555. cmTargetPropCommandBase.cxx
  556. cmTargetPropCommandBase.h
  557. cmTargetSourcesCommand.cxx
  558. cmTargetSourcesCommand.h
  559. cmTimestamp.cxx
  560. cmTimestamp.h
  561. cmTryCompileCommand.cxx
  562. cmTryCompileCommand.h
  563. cmTryRunCommand.cxx
  564. cmTryRunCommand.h
  565. cmUnexpectedCommand.cxx
  566. cmUnexpectedCommand.h
  567. cmUnsetCommand.cxx
  568. cmUnsetCommand.h
  569. cmUseMangledMesaCommand.cxx
  570. cmUseMangledMesaCommand.h
  571. cmUtilitySourceCommand.cxx
  572. cmUtilitySourceCommand.h
  573. cmVariableRequiresCommand.cxx
  574. cmVariableRequiresCommand.h
  575. cmVariableWatchCommand.cxx
  576. cmVariableWatchCommand.h
  577. cmWhileCommand.cxx
  578. cmWhileCommand.h
  579. cmWriteFileCommand.cxx
  580. cmWriteFileCommand.h
  581. cm_get_date.h
  582. cm_get_date.c
  583. cm_utf8.h
  584. cm_utf8.c
  585. cm_codecvt.hxx
  586. cm_codecvt.cxx
  587. cm_thread.hxx
  588. cmDuration.h
  589. cmDuration.cxx
  590. )
  591. SET_PROPERTY(SOURCE cmProcessOutput.cxx APPEND PROPERTY COMPILE_DEFINITIONS
  592. KWSYS_ENCODING_DEFAULT_CODEPAGE=${KWSYS_ENCODING_DEFAULT_CODEPAGE})
  593. # Xcode only works on Apple
  594. if(APPLE)
  595. set(SRCS ${SRCS}
  596. cmXCodeObject.cxx
  597. cmXCode21Object.cxx
  598. cmXCodeScheme.cxx
  599. cmGlobalXCodeGenerator.cxx
  600. cmGlobalXCodeGenerator.h
  601. cmLocalXCodeGenerator.cxx
  602. cmLocalXCodeGenerator.h)
  603. endif()
  604. if (WIN32)
  605. set(SRCS ${SRCS}
  606. cmCallVisualStudioMacro.cxx
  607. cmCallVisualStudioMacro.h
  608. bindexplib.cxx
  609. )
  610. if(NOT UNIX)
  611. set(SRCS ${SRCS}
  612. cmGlobalBorlandMakefileGenerator.cxx
  613. cmGlobalBorlandMakefileGenerator.h
  614. cmGlobalMSYSMakefileGenerator.cxx
  615. cmGlobalMinGWMakefileGenerator.cxx
  616. cmGlobalNMakeMakefileGenerator.cxx
  617. cmGlobalNMakeMakefileGenerator.h
  618. cmGlobalJOMMakefileGenerator.cxx
  619. cmGlobalJOMMakefileGenerator.h
  620. cmGlobalVisualStudio71Generator.cxx
  621. cmGlobalVisualStudio71Generator.h
  622. cmGlobalVisualStudio7Generator.cxx
  623. cmGlobalVisualStudio7Generator.h
  624. cmGlobalVisualStudio8Generator.cxx
  625. cmGlobalVisualStudio8Generator.h
  626. cmGlobalVisualStudio9Generator.cxx
  627. cmGlobalVisualStudio9Generator.h
  628. cmVisualStudioGeneratorOptions.h
  629. cmVisualStudioGeneratorOptions.cxx
  630. cmVisualStudio10TargetGenerator.h
  631. cmVisualStudio10TargetGenerator.cxx
  632. cmVisualStudio10ToolsetOptions.h
  633. cmVisualStudio10ToolsetOptions.cxx
  634. cmLocalVisualStudio10Generator.cxx
  635. cmLocalVisualStudio10Generator.h
  636. cmGlobalVisualStudio10Generator.h
  637. cmGlobalVisualStudio10Generator.cxx
  638. cmGlobalVisualStudio11Generator.h
  639. cmGlobalVisualStudio11Generator.cxx
  640. cmGlobalVisualStudio12Generator.h
  641. cmGlobalVisualStudio12Generator.cxx
  642. cmGlobalVisualStudio14Generator.h
  643. cmGlobalVisualStudio14Generator.cxx
  644. cmGlobalVisualStudio15Generator.h
  645. cmGlobalVisualStudio15Generator.cxx
  646. cmGlobalVisualStudioGenerator.cxx
  647. cmGlobalVisualStudioGenerator.h
  648. cmIDEFlagTable.h
  649. cmIDEOptions.cxx
  650. cmIDEOptions.h
  651. cmLocalVisualStudio7Generator.cxx
  652. cmLocalVisualStudio7Generator.h
  653. cmLocalVisualStudioGenerator.cxx
  654. cmLocalVisualStudioGenerator.h
  655. cmVisualStudioSlnData.h
  656. cmVisualStudioSlnData.cxx
  657. cmVisualStudioSlnParser.h
  658. cmVisualStudioSlnParser.cxx
  659. cmVisualStudioWCEPlatformParser.h
  660. cmVisualStudioWCEPlatformParser.cxx
  661. cmGlobalGhsMultiGenerator.cxx
  662. cmGlobalGhsMultiGenerator.h
  663. cmLocalGhsMultiGenerator.cxx
  664. cmLocalGhsMultiGenerator.h
  665. cmGhsMultiTargetGenerator.cxx
  666. cmGhsMultiTargetGenerator.h
  667. cmGhsMultiGpj.cxx
  668. cmGhsMultiGpj.h
  669. cmVSSetupHelper.cxx
  670. cmVSSetupHelper.h
  671. )
  672. # Add a manifest file to executables on Windows to allow for
  673. # GetVersion to work properly on Windows 8 and above.
  674. set(MANIFEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmake.version.manifest)
  675. endif()
  676. endif ()
  677. # Watcom support
  678. if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
  679. set_property(SOURCE cmake.cxx APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_USE_WMAKE)
  680. list(APPEND SRCS
  681. cmGlobalWatcomWMakeGenerator.cxx
  682. cmGlobalWatcomWMakeGenerator.h
  683. )
  684. endif()
  685. # Ninja support
  686. set(SRCS ${SRCS}
  687. cmGlobalNinjaGenerator.cxx
  688. cmGlobalNinjaGenerator.h
  689. cmNinjaTypes.h
  690. cmLocalNinjaGenerator.cxx
  691. cmLocalNinjaGenerator.h
  692. cmNinjaTargetGenerator.cxx
  693. cmNinjaTargetGenerator.h
  694. cmNinjaNormalTargetGenerator.cxx
  695. cmNinjaNormalTargetGenerator.h
  696. cmNinjaUtilityTargetGenerator.cxx
  697. cmNinjaUtilityTargetGenerator.h
  698. cmNinjaLinkLineComputer.cxx
  699. cmNinjaLinkLineComputer.h
  700. )
  701. # Temporary variable for tools targets
  702. set(_tools)
  703. if(WIN32 AND NOT CYGWIN)
  704. set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
  705. add_executable(cmcldeps cmcldeps.cxx ${MANIFEST_FILE})
  706. list(APPEND _tools cmcldeps)
  707. target_link_libraries(cmcldeps CMakeLib)
  708. endif()
  709. foreach(v CURL_CA_BUNDLE CURL_CA_PATH)
  710. if(${v})
  711. set_property(SOURCE cmCurl.cxx APPEND PROPERTY COMPILE_DEFINITIONS ${v}="${${v}}")
  712. endif()
  713. endforeach()
  714. foreach(check
  715. STAT_HAS_ST_MTIM
  716. STAT_HAS_ST_MTIMESPEC
  717. )
  718. if(KWSYS_CXX_${check}_COMPILED) # abuse KWSys check cache entry
  719. set(CMake_${check} 1)
  720. else()
  721. set(CMake_${check} 0)
  722. endif()
  723. set_property(SOURCE cmFileTimeComparison.cxx APPEND PROPERTY
  724. COMPILE_DEFINITIONS CMake_${check}=${CMake_${check}})
  725. endforeach()
  726. # create a library used by the command line and the GUI
  727. add_library(CMakeLib ${SRCS})
  728. target_link_libraries(CMakeLib cmsys
  729. ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES}
  730. ${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES}
  731. ${CMAKE_CURL_LIBRARIES}
  732. ${CMAKE_JSONCPP_LIBRARIES}
  733. ${CMAKE_LIBUV_LIBRARIES}
  734. ${CMAKE_LIBRHASH_LIBRARIES}
  735. ${CMake_KWIML_LIBRARIES}
  736. ${CMAKE_THREAD_LIBS_INIT}
  737. )
  738. if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc")
  739. # the atomic instructions are implemented using libatomic on some platforms,
  740. # so linking to that may be required
  741. check_library_exists(atomic __atomic_fetch_add_4 "" LIBATOMIC_NEEDED)
  742. if(LIBATOMIC_NEEDED)
  743. target_link_libraries(CMakeLib atomic)
  744. endif()
  745. endif()
  746. # On Apple we need CoreFoundation
  747. if(APPLE)
  748. target_link_libraries(CMakeLib "-framework CoreFoundation")
  749. endif()
  750. if(WIN32 AND NOT UNIX)
  751. # We need the rpcrt4 library on Windows.
  752. # We need the crypt32 library on Windows for crypto/cert APIs.
  753. target_link_libraries(CMakeLib rpcrt4 crypt32)
  754. endif()
  755. target_compile_definitions(CMakeLib PUBLIC ${CLANG_TIDY_DEFINITIONS})
  756. #
  757. # CTestLib
  758. #
  759. include_directories(
  760. "${CMake_SOURCE_DIR}/Source/CTest"
  761. ${CMAKE_XMLRPC_INCLUDES}
  762. ${CMAKE_CURL_INCLUDES}
  763. )
  764. #
  765. # Sources for CTestLib
  766. #
  767. set(CTEST_SRCS cmCTest.cxx
  768. CTest/cmProcess.cxx
  769. CTest/cmCTestBuildAndTestHandler.cxx
  770. CTest/cmCTestBuildCommand.cxx
  771. CTest/cmCTestBuildHandler.cxx
  772. CTest/cmCTestConfigureCommand.cxx
  773. CTest/cmCTestConfigureHandler.cxx
  774. CTest/cmCTestCoverageCommand.cxx
  775. CTest/cmCTestCoverageHandler.cxx
  776. CTest/cmCTestCurl.cxx
  777. CTest/cmParseMumpsCoverage.cxx
  778. CTest/cmParseCacheCoverage.cxx
  779. CTest/cmParseGTMCoverage.cxx
  780. CTest/cmParseJacocoCoverage.cxx
  781. CTest/cmParseBlanketJSCoverage.cxx
  782. CTest/cmParsePHPCoverage.cxx
  783. CTest/cmParseCoberturaCoverage.cxx
  784. CTest/cmParseDelphiCoverage.cxx
  785. CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
  786. CTest/cmCTestGenericHandler.cxx
  787. CTest/cmCTestHandlerCommand.cxx
  788. CTest/cmCTestLaunch.cxx
  789. CTest/cmCTestMemCheckCommand.cxx
  790. CTest/cmCTestMemCheckHandler.cxx
  791. CTest/cmCTestMultiProcessHandler.cxx
  792. CTest/cmCTestReadCustomFilesCommand.cxx
  793. CTest/cmCTestRunScriptCommand.cxx
  794. CTest/cmCTestRunTest.cxx
  795. CTest/cmCTestScriptHandler.cxx
  796. CTest/cmCTestSleepCommand.cxx
  797. CTest/cmCTestStartCommand.cxx
  798. CTest/cmCTestSubmitCommand.cxx
  799. CTest/cmCTestSubmitHandler.cxx
  800. CTest/cmCTestTestCommand.cxx
  801. CTest/cmCTestTestHandler.cxx
  802. CTest/cmCTestUpdateCommand.cxx
  803. CTest/cmCTestUpdateHandler.cxx
  804. CTest/cmCTestUploadCommand.cxx
  805. CTest/cmCTestUploadHandler.cxx
  806. CTest/cmCTestVC.cxx
  807. CTest/cmCTestVC.h
  808. CTest/cmCTestGlobalVC.cxx
  809. CTest/cmCTestGlobalVC.h
  810. CTest/cmCTestCVS.cxx
  811. CTest/cmCTestCVS.h
  812. CTest/cmCTestSVN.cxx
  813. CTest/cmCTestSVN.h
  814. CTest/cmCTestBZR.cxx
  815. CTest/cmCTestBZR.h
  816. CTest/cmCTestGIT.cxx
  817. CTest/cmCTestGIT.h
  818. CTest/cmCTestHG.cxx
  819. CTest/cmCTestHG.h
  820. CTest/cmCTestP4.cxx
  821. CTest/cmCTestP4.h
  822. )
  823. # Build CTestLib
  824. add_library(CTestLib ${CTEST_SRCS})
  825. target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES})
  826. #
  827. # CPack
  828. #
  829. include_directories(
  830. "${CMake_SOURCE_DIR}/Source/CPack"
  831. )
  832. #
  833. # Sources for CPack
  834. #
  835. set(CPACK_SRCS
  836. CPack/cmCPackArchiveGenerator.cxx
  837. CPack/cmCPackComponentGroup.cxx
  838. CPack/cmCPackGeneratorFactory.cxx
  839. CPack/cmCPackGenerator.cxx
  840. CPack/cmCPackLog.cxx
  841. CPack/cmCPackNSISGenerator.cxx
  842. CPack/cmCPackSTGZGenerator.cxx
  843. CPack/cmCPackTGZGenerator.cxx
  844. CPack/cmCPackTXZGenerator.cxx
  845. CPack/cmCPackTarBZip2Generator.cxx
  846. CPack/cmCPackTarCompressGenerator.cxx
  847. CPack/cmCPackZIPGenerator.cxx
  848. CPack/cmCPack7zGenerator.cxx
  849. CPack/cmCPackDebGenerator.cxx
  850. )
  851. # CPack IFW generator
  852. set(CPACK_SRCS ${CPACK_SRCS}
  853. CPack/IFW/cmCPackIFWCommon.cxx
  854. CPack/IFW/cmCPackIFWCommon.h
  855. CPack/IFW/cmCPackIFWGenerator.cxx
  856. CPack/IFW/cmCPackIFWGenerator.h
  857. CPack/IFW/cmCPackIFWInstaller.cxx
  858. CPack/IFW/cmCPackIFWInstaller.h
  859. CPack/IFW/cmCPackIFWPackage.cxx
  860. CPack/IFW/cmCPackIFWPackage.h
  861. CPack/IFW/cmCPackIFWRepository.cxx
  862. CPack/IFW/cmCPackIFWRepository.h
  863. )
  864. if(CYGWIN)
  865. set(CPACK_SRCS ${CPACK_SRCS}
  866. CPack/cmCPackCygwinBinaryGenerator.cxx
  867. CPack/cmCPackCygwinSourceGenerator.cxx
  868. )
  869. endif()
  870. option(CPACK_ENABLE_FREEBSD_PKG "Add FreeBSD pkg(8) generator to CPack." OFF)
  871. if(UNIX)
  872. set(CPACK_SRCS ${CPACK_SRCS}
  873. CPack/cmCPackRPMGenerator.cxx
  874. )
  875. # Optionally, try to use pkg(8)
  876. if(CPACK_ENABLE_FREEBSD_PKG)
  877. # On UNIX, you may find FreeBSD's pkg(8) and attendant
  878. # library -- it can be used on FreeBSD, Dragonfly, NetBSD,
  879. # OpenBSD and also Linux and OSX. Look for the header and
  880. # the library; it's a warning on FreeBSD if they're not
  881. # found, and informational on other platforms.
  882. find_path(FREEBSD_PKG_INCLUDE_DIRS "pkg.h")
  883. if(FREEBSD_PKG_INCLUDE_DIRS)
  884. find_library(FREEBSD_PKG_LIBRARIES
  885. pkg
  886. DOC "FreeBSD pkg(8) library")
  887. if(FREEBSD_PKG_LIBRARIES)
  888. set(CPACK_SRCS ${CPACK_SRCS}
  889. CPack/cmCPackFreeBSDGenerator.cxx
  890. )
  891. endif()
  892. endif()
  893. if (NOT FREEBSD_PKG_INCLUDE_DIRS OR NOT FREEBSD_PKG_LIBRARIES)
  894. message(FATAL_ERROR "CPack needs libpkg(3) to produce FreeBSD packages natively.")
  895. endif()
  896. else()
  897. set(FREEBSD_PKG_INCLUDE_DIRS NOTFOUND)
  898. set(FREEBSD_PKG_LIBRARIES NOTFOUND)
  899. endif()
  900. endif()
  901. if(CYGWIN)
  902. find_package(LibUUID)
  903. endif()
  904. if(WIN32 OR (CYGWIN AND LibUUID_FOUND))
  905. set(CPACK_SRCS ${CPACK_SRCS}
  906. CPack/Wix/cmCMakeToWixPath.cxx
  907. CPack/Wix/cmCMakeToWixPath.h
  908. CPack/WiX/cmCPackWIXGenerator.cxx
  909. CPack/WiX/cmCPackWIXGenerator.h
  910. CPack/WiX/cmWIXAccessControlList.cxx
  911. CPack/WiX/cmWIXAccessControlList.h
  912. CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
  913. CPack/WiX/cmWIXDirectoriesSourceWriter.h
  914. CPack/WiX/cmWIXFeaturesSourceWriter.cxx
  915. CPack/WiX/cmWIXFeaturesSourceWriter.h
  916. CPack/WiX/cmWIXFilesSourceWriter.cxx
  917. CPack/WiX/cmWIXFilesSourceWriter.h
  918. CPack/WiX/cmWIXPatch.cxx
  919. CPack/WiX/cmWIXPatch.h
  920. CPack/WiX/cmWIXPatchParser.cxx
  921. CPack/WiX/cmWIXPatchParser.h
  922. CPack/WiX/cmWIXRichTextFormatWriter.cxx
  923. CPack/WiX/cmWIXRichTextFormatWriter.h
  924. CPack/WiX/cmWIXShortcut.cxx
  925. CPack/WiX/cmWIXShortcut.h
  926. CPack/WiX/cmWIXSourceWriter.cxx
  927. CPack/WiX/cmWIXSourceWriter.h
  928. )
  929. endif()
  930. if(APPLE)
  931. set(CPACK_SRCS ${CPACK_SRCS}
  932. CPack/cmCPackBundleGenerator.cxx
  933. CPack/cmCPackDragNDropGenerator.cxx
  934. CPack/cmCPackOSXX11Generator.cxx
  935. CPack/cmCPackPKGGenerator.cxx
  936. CPack/cmCPackPackageMakerGenerator.cxx
  937. CPack/cmCPackProductBuildGenerator.cxx
  938. )
  939. endif()
  940. # Build CPackLib
  941. add_library(CPackLib ${CPACK_SRCS})
  942. target_link_libraries(CPackLib CMakeLib)
  943. if(APPLE)
  944. # Some compilers produce errors in the CoreServices framework headers.
  945. # Ideally such errors should be fixed by either the compiler vendor
  946. # or the framework source, but we try to workaround it and build anyway.
  947. # If it does not work, build with reduced functionality and warn.
  948. check_include_file("CoreServices/CoreServices.h" HAVE_CoreServices)
  949. if(HAVE_CoreServices)
  950. set_property(SOURCE CPack/cmCPackDragNDropGenerator.cxx PROPERTY COMPILE_DEFINITIONS HAVE_CoreServices)
  951. target_link_libraries(CPackLib "-framework CoreServices")
  952. else()
  953. message(WARNING "This compiler does not appear to support\n"
  954. " #include <CoreServices/CoreServices.h>\n"
  955. "Some CPack functionality may be limited.\n"
  956. "See CMakeFiles/CMakeError.log for details of the failure.")
  957. endif()
  958. endif()
  959. if(CYGWIN AND LibUUID_FOUND)
  960. target_link_libraries(CPackLib ${LibUUID_LIBRARIES})
  961. include_directories(CPackLib ${LibUUID_INCLUDE_DIRS})
  962. set_property(SOURCE CPack/cmCPackGeneratorFactory.cxx PROPERTY COMPILE_DEFINITIONS HAVE_LIBUUID)
  963. endif()
  964. if(CPACK_ENABLE_FREEBSD_PKG AND FREEBSD_PKG_INCLUDE_DIRS AND FREEBSD_PKG_LIBRARIES)
  965. target_link_libraries(CPackLib ${FREEBSD_PKG_LIBRARIES})
  966. include_directories(${FREEBSD_PKG_INCLUDE_DIRS})
  967. add_definitions(-DHAVE_FREEBSD_PKG)
  968. endif()
  969. if(APPLE)
  970. add_executable(cmakexbuild cmakexbuild.cxx)
  971. list(APPEND _tools cmakexbuild)
  972. target_link_libraries(cmakexbuild CMakeLib)
  973. add_executable(OSXScriptLauncher
  974. CPack/OSXScriptLauncher.cxx)
  975. target_link_libraries(OSXScriptLauncher cmsys)
  976. target_link_libraries(OSXScriptLauncher "-framework CoreFoundation")
  977. endif()
  978. # Build CMake executable
  979. add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h ${MANIFEST_FILE})
  980. list(APPEND _tools cmake)
  981. target_link_libraries(cmake CMakeLib)
  982. add_library(CMakeServerLib
  983. cmConnection.h cmConnection.cxx
  984. cmFileMonitor.cxx cmFileMonitor.h
  985. cmPipeConnection.cxx cmPipeConnection.h
  986. cmServer.cxx cmServer.h
  987. cmServerConnection.cxx cmServerConnection.h
  988. cmServerProtocol.cxx cmServerProtocol.h
  989. )
  990. target_link_libraries(CMakeServerLib CMakeLib)
  991. target_link_libraries(cmake CMakeServerLib)
  992. # Build CTest executable
  993. add_executable(ctest ctest.cxx ${MANIFEST_FILE})
  994. list(APPEND _tools ctest)
  995. target_link_libraries(ctest CTestLib)
  996. # Build CPack executable
  997. add_executable(cpack CPack/cpack.cxx ${MANIFEST_FILE})
  998. list(APPEND _tools cpack)
  999. target_link_libraries(cpack CPackLib)
  1000. # Curses GUI
  1001. if(BUILD_CursesDialog)
  1002. include(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt)
  1003. endif()
  1004. # Qt GUI
  1005. option(BUILD_QtDialog "Build Qt dialog for CMake" FALSE)
  1006. if(BUILD_QtDialog)
  1007. add_subdirectory(QtDialog)
  1008. endif()
  1009. include (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
  1010. include (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
  1011. if(WIN32)
  1012. # Add Windows executable version information.
  1013. configure_file("CMakeVersion.rc.in" "CMakeVersion.rc" @ONLY)
  1014. # We use a separate object library for this to work around a limitation of
  1015. # MinGW's windres tool with spaces in the path to the include directories.
  1016. add_library(CMakeVersion OBJECT "${CMAKE_CURRENT_BINARY_DIR}/CMakeVersion.rc")
  1017. set_property(TARGET CMakeVersion PROPERTY INCLUDE_DIRECTORIES "")
  1018. foreach(_tool ${_tools})
  1019. target_sources(${_tool} PRIVATE $<TARGET_OBJECTS:CMakeVersion>)
  1020. endforeach()
  1021. endif()
  1022. # Install tools
  1023. foreach(_tool ${_tools})
  1024. CMake_OPTIONAL_COMPONENT(${_tool})
  1025. install(TARGETS ${_tool} DESTINATION ${CMAKE_BIN_DIR} ${COMPONENT})
  1026. endforeach()
  1027. install(FILES cmCPluginAPI.h DESTINATION ${CMAKE_DATA_DIR}/include)
  1028. # Unset temporary variables
  1029. unset(_tools)