CMakeLists.txt 30 KB

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