CMakeLists.txt 29 KB

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