CMakeLists.txt 30 KB

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