CMakeLists.txt 33.2 KB
Newer Older
1
2
3
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

4
include(CheckIncludeFile)
Brad King's avatar
Brad King committed
5
# Check if we can build support for ELF parsing.
6
7
8
9
10
if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
  CHECK_INCLUDE_FILES("stdint.h;elf_abi.h" HAVE_ELF_H)
else()
  CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H)
endif()
11
12
if(HAVE_ELF_H)
  set(CMAKE_USE_ELF_PARSER 1)
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
elseif(HAIKU)
  # On Haiku, we need to include elf32.h from the private headers
  set(CMake_HAIKU_INCLUDE_DIRS
    /boot/system/develop/headers/private/system
    /boot/system/develop/headers/private/system/arch/x86
    )

  set(CMAKE_REQUIRED_INCLUDES ${CMake_HAIKU_INCLUDE_DIRS})
  CHECK_INCLUDE_FILE("elf32.h" HAVE_ELF32_H)
  unset(CMAKE_REQUIRED_INCLUDES)

  if(HAVE_ELF32_H)
    set(CMAKE_USE_ELF_PARSER 1)
  else()
    unset(CMake_HAIKU_INCLUDE_DIRS)
    set(CMAKE_USE_ELF_PARSER)
  endif()
30
else()
31
  set(CMAKE_USE_ELF_PARSER)
32
endif()
Brad King's avatar
Brad King committed
33

34
35
36
37
38
39
40
41
42
43
if(NOT CMake_DEFAULT_RECURSION_LIMIT)
  if(DEFINED ENV{DASHBOARD_TEST_FROM_CTEST})
    set(CMake_DEFAULT_RECURSION_LIMIT 100)
  elseif(MINGW)
    set(CMake_DEFAULT_RECURSION_LIMIT 400)
  else()
    set(CMake_DEFAULT_RECURSION_LIMIT 1000)
  endif()
endif()

44
45
46
47
if(APPLE)
  set(CMAKE_USE_MACH_PARSER 1)
endif()

48
set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
49

50
if(WIN32)
51
  # ensure Unicode friendly APIs are used on Windows
52
  add_definitions(-DUNICODE -D_UNICODE)
53
54
55

  # minimize windows.h content
  add_definitions(-DWIN32_LEAN_AND_MEAN)
56
57
endif()

58
59
60
61
62
63
64
65
66
# configure the .dox.in file
if(CMake_BUILD_DEVELOPER_REFERENCE)
  configure_file(
    "${CMake_SOURCE_DIR}/Source/dir.dox.in"
    "${CMake_BINARY_DIR}/Source/dir.dox"
    @ONLY
    )
endif()

67
# configure the .h file
68
configure_file(
69
70
71
  "${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in"
  "${CMake_BINARY_DIR}/Source/cmConfigure.h"
  )
72
configure_file(
73
74
75
  "${CMake_SOURCE_DIR}/Source/cmVersionConfig.h.in"
  "${CMake_BINARY_DIR}/Source/cmVersionConfig.h"
  )
76
configure_file(
Andy Cedilnik's avatar
Andy Cedilnik committed
77
78
79
  "${CMake_SOURCE_DIR}/Source/CPack/cmCPackConfigure.h.in"
  "${CMake_BINARY_DIR}/Source/CPack/cmCPackConfigure.h"
  )
80

81
82
83
84
85
86
# Tell CMake executable in the build tree where to find the source tree.
configure_file(
  "${CMake_SOURCE_DIR}/Source/CMakeSourceDir.txt.in"
  "${CMake_BINARY_DIR}/CMakeFiles/CMakeSourceDir.txt" @ONLY
  )

Andy Cedilnik's avatar
Andy Cedilnik committed
87
# add the include path to find the .h
88
include_directories(
89
90
  "${CMake_BINARY_DIR}/Source"
  "${CMake_SOURCE_DIR}/Source"
91
  "${CMake_SOURCE_DIR}/Source/LexerParser"
92
93
  ${CMAKE_ZLIB_INCLUDES}
  ${CMAKE_EXPAT_INCLUDES}
94
  ${CMAKE_TAR_INCLUDES}
95
  ${CMake_HAIKU_INCLUDE_DIRS}
96
  )
97

Brad King's avatar
Brad King committed
98
# Check if we can build the ELF parser.
99
100
if(CMAKE_USE_ELF_PARSER)
  set(ELF_SRCS cmELF.h cmELF.cxx)
101
endif()
Brad King's avatar
Brad King committed
102

103
104
105
106
107
# Check if we can build the Mach-O parser.
if(CMAKE_USE_MACH_PARSER)
  set(MACH_SRCS cmMachO.h cmMachO.cxx)
endif()

108
109
110
#
# Sources for CMakeLib
#
111
set(SRCS
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
  # Lexers/Parsers
  LexerParser/cmCommandArgumentLexer.cxx
  LexerParser/cmCommandArgumentLexer.h
  LexerParser/cmCommandArgumentLexer.in.l
  LexerParser/cmCommandArgumentParser.cxx
  LexerParser/cmCommandArgumentParserTokens.h
  LexerParser/cmCommandArgumentParser.y
  LexerParser/cmDependsJavaLexer.cxx
  LexerParser/cmDependsJavaLexer.h
  LexerParser/cmDependsJavaLexer.in.l
  LexerParser/cmDependsJavaParser.cxx
  LexerParser/cmDependsJavaParserTokens.h
  LexerParser/cmDependsJavaParser.y
  LexerParser/cmExprLexer.cxx
  LexerParser/cmExprLexer.h
  LexerParser/cmExprLexer.in.l
  LexerParser/cmExprParser.cxx
  LexerParser/cmExprParserTokens.h
  LexerParser/cmExprParser.y
  LexerParser/cmFortranLexer.cxx
  LexerParser/cmFortranLexer.h
  LexerParser/cmFortranLexer.in.l
  LexerParser/cmFortranParser.cxx
  LexerParser/cmFortranParserTokens.h
  LexerParser/cmFortranParser.y
  LexerParser/cmListFileLexer.c
  LexerParser/cmListFileLexer.in.l

140
141
  cmAffinity.cxx
  cmAffinity.h
142
  cmAlgorithms.h
143
  cmArchiveWrite.cxx
wahikihiki's avatar
wahikihiki committed
144
145
  cmArgumentParser.cxx
  cmArgumentParser.h
146
  cmBase32.cxx
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
  cmBinUtilsLinker.cxx
  cmBinUtilsLinker.h
  cmBinUtilsLinuxELFGetRuntimeDependenciesTool.cxx
  cmBinUtilsLinuxELFGetRuntimeDependenciesTool.h
  cmBinUtilsLinuxELFLinker.cxx
  cmBinUtilsLinuxELFLinker.h
  cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx
  cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.h
  cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.cxx
  cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.h
  cmBinUtilsMacOSMachOLinker.cxx
  cmBinUtilsMacOSMachOLinker.h
  cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx
  cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.h
  cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx
  cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.h
  cmBinUtilsWindowsPEGetRuntimeDependenciesTool.cxx
  cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h
  cmBinUtilsWindowsPELinker.cxx
  cmBinUtilsWindowsPELinker.h
  cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx
  cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.h
Andy Cedilnik's avatar
Andy Cedilnik committed
169
170
  cmCacheManager.cxx
  cmCacheManager.h
171
172
  cmCheckCustomOutputs.h
  cmCheckCustomOutputs.cxx
173
174
  cmCLocaleEnvironmentScope.h
  cmCLocaleEnvironmentScope.cxx
175
  cmCommandArgumentParserHelper.cxx
176
177
  cmCommonTargetGenerator.cxx
  cmCommonTargetGenerator.h
178
179
  cmComputeComponentGraph.cxx
  cmComputeComponentGraph.h
180
181
  cmComputeLinkDepends.cxx
  cmComputeLinkDepends.h
182
183
  cmComputeLinkInformation.cxx
  cmComputeLinkInformation.h
184
185
  cmComputeTargetDepends.h
  cmComputeTargetDepends.cxx
186
187
  cmCPackPropertiesGenerator.h
  cmCPackPropertiesGenerator.cxx
188
189
  cmCryptoHash.cxx
  cmCryptoHash.h
190
191
  cmCurl.cxx
  cmCurl.h
Andy Cedilnik's avatar
Andy Cedilnik committed
192
193
  cmCustomCommand.cxx
  cmCustomCommand.h
194
195
  cmCustomCommandGenerator.cxx
  cmCustomCommandGenerator.h
196
197
  cmCustomCommandLines.cxx
  cmCustomCommandLines.h
198
  cmCustomCommandTypes.h
199
200
  cmDefinitions.cxx
  cmDefinitions.h
Andy Cedilnik's avatar
Andy Cedilnik committed
201
202
203
204
205
206
  cmDepends.cxx
  cmDepends.h
  cmDependsC.cxx
  cmDependsC.h
  cmDependsFortran.cxx
  cmDependsFortran.h
207
208
  cmDependsJava.cxx
  cmDependsJava.h
Andy Cedilnik's avatar
Andy Cedilnik committed
209
210
  cmDependsJavaParserHelper.cxx
  cmDependsJavaParserHelper.h
Andy Cedilnik's avatar
Andy Cedilnik committed
211
  cmDocumentation.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
212
  cmDocumentationFormatter.cxx
213
  cmDocumentationSection.cxx
Andy Cedilnik's avatar
Andy Cedilnik committed
214
215
  cmDynamicLoader.cxx
  cmDynamicLoader.h
Brad King's avatar
Brad King committed
216
  ${ELF_SRCS}
217
  cmExprParserHelper.cxx
218
219
  cmExportBuildAndroidMKGenerator.h
  cmExportBuildAndroidMKGenerator.cxx
220
221
222
223
  cmExportBuildFileGenerator.h
  cmExportBuildFileGenerator.cxx
  cmExportFileGenerator.h
  cmExportFileGenerator.cxx
224
225
  cmExportInstallAndroidMKGenerator.h
  cmExportInstallAndroidMKGenerator.cxx
226
227
  cmExportInstallFileGenerator.h
  cmExportInstallFileGenerator.cxx
228
229
  cmExportTryCompileFileGenerator.h
  cmExportTryCompileFileGenerator.cxx
230
231
  cmExportSet.h
  cmExportSet.cxx
232
233
  cmExternalMakefileProjectGenerator.cxx
  cmExternalMakefileProjectGenerator.h
234
235
  cmExtraCodeBlocksGenerator.cxx
  cmExtraCodeBlocksGenerator.h
236
237
  cmExtraCodeLiteGenerator.cxx
  cmExtraCodeLiteGenerator.h
Alexander Neundorf's avatar
 
Alexander Neundorf committed
238
239
  cmExtraEclipseCDT4Generator.cxx
  cmExtraEclipseCDT4Generator.h
240
241
  cmExtraKateGenerator.cxx
  cmExtraKateGenerator.h
242
243
  cmExtraSublimeTextGenerator.cxx
  cmExtraSublimeTextGenerator.h
244
245
  cmFileAPI.cxx
  cmFileAPI.h
Brad King's avatar
Brad King committed
246
247
  cmFileAPICache.cxx
  cmFileAPICache.h
Brad King's avatar
Brad King committed
248
249
  cmFileAPICodemodel.cxx
  cmFileAPICodemodel.h
Brad King's avatar
Brad King committed
250
251
  cmFileAPICMakeFiles.cxx
  cmFileAPICMakeFiles.h
252
253
254
255
  cmFileCopier.cxx
  cmFileCopier.h
  cmFileInstaller.cxx
  cmFileInstaller.h
256
257
258
259
260
261
  cmFileLock.cxx
  cmFileLock.h
  cmFileLockPool.cxx
  cmFileLockPool.h
  cmFileLockResult.cxx
  cmFileLockResult.h
262
263
  cmFilePathChecksum.cxx
  cmFilePathChecksum.h
Sebastian Holtermann's avatar
Sebastian Holtermann committed
264
265
  cmFileTime.cxx
  cmFileTime.h
266
267
  cmFileTimeCache.cxx
  cmFileTimeCache.h
268
269
  cmFileTimes.cxx
  cmFileTimes.h
270
  cmFortranParserImpl.cxx
271
272
  cmFSPermissions.cxx
  cmFSPermissions.h
Andy Cedilnik's avatar
Andy Cedilnik committed
273
  cmGeneratedFileStream.cxx
274
275
  cmGeneratorExpressionContext.cxx
  cmGeneratorExpressionContext.h
276
277
  cmGeneratorExpressionDAGChecker.cxx
  cmGeneratorExpressionDAGChecker.h
278
279
  cmGeneratorExpressionEvaluationFile.cxx
  cmGeneratorExpressionEvaluationFile.h
280
281
282
283
  cmGeneratorExpressionEvaluator.cxx
  cmGeneratorExpressionEvaluator.h
  cmGeneratorExpressionLexer.cxx
  cmGeneratorExpressionLexer.h
284
285
  cmGeneratorExpressionNode.cxx
  cmGeneratorExpressionNode.h
286
287
  cmGeneratorExpressionParser.cxx
  cmGeneratorExpressionParser.h
288
289
  cmGeneratorExpression.cxx
  cmGeneratorExpression.h
290
291
  cmGeneratorTarget.cxx
  cmGeneratorTarget.h
292
293
  cmGetPipes.cxx
  cmGetPipes.h
294
295
  cmGlobalCommonGenerator.cxx
  cmGlobalCommonGenerator.h
Andy Cedilnik's avatar
Andy Cedilnik committed
296
297
  cmGlobalGenerator.cxx
  cmGlobalGenerator.h
298
  cmGlobalGeneratorFactory.h
Ken Martin's avatar
Ken Martin committed
299
300
  cmGlobalUnixMakefileGenerator3.cxx
  cmGlobalUnixMakefileGenerator3.h
301
302
  cmGlobVerificationManager.cxx
  cmGlobVerificationManager.h
303
  cmGraphAdjacencyList.h
304
305
  cmGraphVizWriter.cxx
  cmGraphVizWriter.h
306
307
  cmInstallGenerator.h
  cmInstallGenerator.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
308
  cmInstallExportGenerator.cxx
309
310
  cmInstalledFile.h
  cmInstalledFile.cxx
311
312
  cmInstallFilesGenerator.h
  cmInstallFilesGenerator.cxx
313
314
  cmInstallScriptGenerator.h
  cmInstallScriptGenerator.cxx
315
316
  cmInstallSubdirectoryGenerator.h
  cmInstallSubdirectoryGenerator.cxx
317
318
  cmInstallTargetGenerator.h
  cmInstallTargetGenerator.cxx
319
320
  cmInstallDirectoryGenerator.h
  cmInstallDirectoryGenerator.cxx
321
322
323
324
  cmLDConfigLDConfigTool.cxx
  cmLDConfigLDConfigTool.h
  cmLDConfigTool.cxx
  cmLDConfigTool.h
325
  cmLinkedTree.h
326
  cmLinkItem.cxx
327
  cmLinkItem.h
328
329
  cmLinkLineComputer.cxx
  cmLinkLineComputer.h
330
331
  cmLinkLineDeviceComputer.cxx
  cmLinkLineDeviceComputer.h
Andy Cedilnik's avatar
Andy Cedilnik committed
332
333
  cmListFileCache.cxx
  cmListFileCache.h
334
335
  cmLocalCommonGenerator.cxx
  cmLocalCommonGenerator.h
Andy Cedilnik's avatar
Andy Cedilnik committed
336
337
  cmLocalGenerator.cxx
  cmLocalGenerator.h
338
339
  cmRulePlaceholderExpander.cxx
  cmRulePlaceholderExpander.h
Ken Martin's avatar
Ken Martin committed
340
  cmLocalUnixMakefileGenerator3.cxx
341
  cmLocale.h
342
  ${MACH_SRCS}
Andy Cedilnik's avatar
Andy Cedilnik committed
343
344
  cmMakefile.cxx
  cmMakefile.h
345
346
347
348
  cmMakefileTargetGenerator.cxx
  cmMakefileExecutableTargetGenerator.cxx
  cmMakefileLibraryTargetGenerator.cxx
  cmMakefileUtilityTargetGenerator.cxx
349
  cmMessageType.h
350
351
  cmMessenger.cxx
  cmMessenger.h
352
353
  cmMSVC60LinkLineComputer.cxx
  cmMSVC60LinkLineComputer.h
354
355
  cmOSXBundleGenerator.cxx
  cmOSXBundleGenerator.h
356
357
  cmOutputConverter.cxx
  cmOutputConverter.h
358
359
  cmNewLineStyle.h
  cmNewLineStyle.cxx
360
361
  cmOrderDirectories.cxx
  cmOrderDirectories.h
362
363
  cmPolicies.h
  cmPolicies.cxx
364
365
  cmProcessOutput.cxx
  cmProcessOutput.h
366
367
  cmProcessTools.cxx
  cmProcessTools.h
368
369
370
  cmProperty.h
  cmPropertyDefinition.cxx
  cmPropertyDefinition.h
371
372
373
374
  cmPropertyDefinitionMap.cxx
  cmPropertyDefinitionMap.h
  cmPropertyMap.cxx
  cmPropertyMap.h
375
376
  cmQtAutoGen.cxx
  cmQtAutoGen.h
377
378
  cmQtAutoGenerator.cxx
  cmQtAutoGenerator.h
379
380
  cmQtAutoGenGlobalInitializer.cxx
  cmQtAutoGenGlobalInitializer.h
381
382
  cmQtAutoGenInitializer.cxx
  cmQtAutoGenInitializer.h
383
384
  cmQtAutoMocUic.cxx
  cmQtAutoMocUic.h
385
386
  cmQtAutoRcc.cxx
  cmQtAutoRcc.h
387
388
  cmRST.cxx
  cmRST.h
389
390
  cmRuntimeDependencyArchive.cxx
  cmRuntimeDependencyArchive.h
391
392
  cmScriptGenerator.h
  cmScriptGenerator.cxx
Andy Cedilnik's avatar
Andy Cedilnik committed
393
394
  cmSourceFile.cxx
  cmSourceFile.h
395
396
  cmSourceFileLocation.cxx
  cmSourceFileLocation.h
397
  cmSourceFileLocationKind.h
Andy Cedilnik's avatar
Andy Cedilnik committed
398
399
  cmSourceGroup.cxx
  cmSourceGroup.h
Stephen Kelly's avatar
Stephen Kelly committed
400
401
  cmState.cxx
  cmState.h
402
403
404
405
  cmStateDirectory.cxx
  cmStateDirectory.h
  cmStateSnapshot.cxx
  cmStateSnapshot.h
406
  cmStateTypes.h
407
  cmStringAlgorithms.cxx
408
  cmStringAlgorithms.h
Andy Cedilnik's avatar
Andy Cedilnik committed
409
410
411
412
  cmSystemTools.cxx
  cmSystemTools.h
  cmTarget.cxx
  cmTarget.h
413
414
  cmTargetPropertyComputer.cxx
  cmTargetPropertyComputer.h
415
  cmTargetExport.h
416
417
  cmTest.cxx
  cmTest.h
418
419
  cmTestGenerator.cxx
  cmTestGenerator.h
420
  cmUuid.cxx
421
422
  cmUVHandlePtr.cxx
  cmUVHandlePtr.h
423
424
  cmUVProcessChain.cxx
  cmUVProcessChain.h
425
  cmUVStreambuf.h
Brad King's avatar
Brad King committed
426
  cmUVSignalHackRAII.h
Andy Cedilnik's avatar
Andy Cedilnik committed
427
428
429
430
  cmVariableWatch.cxx
  cmVariableWatch.h
  cmVersion.cxx
  cmVersion.h
431
432
  cmWorkerPool.cxx
  cmWorkerPool.h
433
434
  cmWorkingDirectory.cxx
  cmWorkingDirectory.h
Andy Cedilnik's avatar
Andy Cedilnik committed
435
436
  cmXMLParser.cxx
  cmXMLParser.h
437
438
  cmXMLSafe.cxx
  cmXMLSafe.h
439
440
  cmXMLWriter.cxx
  cmXMLWriter.h
Andy Cedilnik's avatar
Andy Cedilnik committed
441
442
  cmake.cxx
  cmake.h
443

444
445
  cmCommand.cxx
  cmCommand.h
446
447
  cmCommands.cxx
  cmCommands.h
448
449
  cmAddCompileDefinitionsCommand.cxx
  cmAddCompileDefinitionsCommand.h
450
451
  cmAddCompileOptionsCommand.cxx
  cmAddCompileOptionsCommand.h
452
453
  cmAddLinkOptionsCommand.cxx
  cmAddLinkOptionsCommand.h
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
  cmAddCustomCommandCommand.cxx
  cmAddCustomCommandCommand.h
  cmAddCustomTargetCommand.cxx
  cmAddCustomTargetCommand.h
  cmAddDefinitionsCommand.cxx
  cmAddDefinitionsCommand.h
  cmAddDependenciesCommand.cxx
  cmAddDependenciesCommand.h
  cmAddExecutableCommand.cxx
  cmAddExecutableCommand.h
  cmAddLibraryCommand.cxx
  cmAddLibraryCommand.h
  cmAddSubDirectoryCommand.cxx
  cmAddSubDirectoryCommand.h
  cmAddTestCommand.cxx
  cmAddTestCommand.h
470
471
  cmAuxSourceDirectoryCommand.cxx
  cmAuxSourceDirectoryCommand.h
472
473
474
475
  cmBreakCommand.cxx
  cmBreakCommand.h
  cmBuildCommand.cxx
  cmBuildCommand.h
476
477
478
479
  cmBuildNameCommand.cxx
  cmBuildNameCommand.h
  cmCMakeHostSystemInformationCommand.cxx
  cmCMakeHostSystemInformationCommand.h
480
481
482
483
  cmCMakeMinimumRequired.cxx
  cmCMakeMinimumRequired.h
  cmCMakePolicyCommand.cxx
  cmCMakePolicyCommand.h
484
485
  cmConditionEvaluator.cxx
  cmConditionEvaluator.h
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
  cmConfigureFileCommand.cxx
  cmConfigureFileCommand.h
  cmContinueCommand.cxx
  cmContinueCommand.h
  cmCoreTryCompile.cxx
  cmCoreTryCompile.h
  cmCreateTestSourceList.cxx
  cmCreateTestSourceList.h
  cmDefinePropertyCommand.cxx
  cmDefinePropertyCommand.h
  cmEnableLanguageCommand.cxx
  cmEnableLanguageCommand.h
  cmEnableTestingCommand.cxx
  cmEnableTestingCommand.h
  cmExecProgramCommand.cxx
  cmExecProgramCommand.h
  cmExecuteProcessCommand.cxx
  cmExecuteProcessCommand.h
504
505
  cmExpandedCommandArgument.cxx
  cmExpandedCommandArgument.h
506
507
508
509
510
511
  cmExportCommand.cxx
  cmExportCommand.h
  cmExportLibraryDependenciesCommand.cxx
  cmExportLibraryDependenciesCommand.h
  cmFLTKWrapUICommand.cxx
  cmFLTKWrapUICommand.h
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
  cmFileCommand.cxx
  cmFileCommand.h
  cmFindBase.cxx
  cmFindBase.h
  cmFindCommon.cxx
  cmFindCommon.h
  cmFindFileCommand.cxx
  cmFindFileCommand.h
  cmFindLibraryCommand.cxx
  cmFindLibraryCommand.h
  cmFindPackageCommand.cxx
  cmFindPackageCommand.h
  cmFindPathCommand.cxx
  cmFindPathCommand.h
  cmFindProgramCommand.cxx
  cmFindProgramCommand.h
  cmForEachCommand.cxx
  cmForEachCommand.h
530
531
  cmFunctionBlocker.cxx
  cmFunctionBlocker.h
532
533
  cmFunctionCommand.cxx
  cmFunctionCommand.h
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
  cmGetCMakePropertyCommand.cxx
  cmGetCMakePropertyCommand.h
  cmGetDirectoryPropertyCommand.cxx
  cmGetDirectoryPropertyCommand.h
  cmGetFilenameComponentCommand.cxx
  cmGetFilenameComponentCommand.h
  cmGetPropertyCommand.cxx
  cmGetPropertyCommand.h
  cmGetSourceFilePropertyCommand.cxx
  cmGetSourceFilePropertyCommand.h
  cmGetTargetPropertyCommand.cxx
  cmGetTargetPropertyCommand.h
  cmGetTestPropertyCommand.cxx
  cmGetTestPropertyCommand.h
  cmHexFileConverter.cxx
  cmHexFileConverter.h
  cmIfCommand.cxx
  cmIfCommand.h
  cmIncludeCommand.cxx
  cmIncludeCommand.h
  cmIncludeDirectoryCommand.cxx
  cmIncludeDirectoryCommand.h
556
557
  cmIncludeExternalMSProjectCommand.cxx
  cmIncludeExternalMSProjectCommand.h
558
559
  cmIncludeGuardCommand.cxx
  cmIncludeGuardCommand.h
560
561
562
563
564
565
566
567
  cmIncludeRegularExpressionCommand.cxx
  cmIncludeRegularExpressionCommand.h
  cmInstallCommand.cxx
  cmInstallCommand.h
  cmInstallCommandArguments.cxx
  cmInstallCommandArguments.h
  cmInstallFilesCommand.cxx
  cmInstallFilesCommand.h
568
569
  cmInstallProgramsCommand.cxx
  cmInstallProgramsCommand.h
570
571
572
573
  cmInstallTargetsCommand.cxx
  cmInstallTargetsCommand.h
  cmLinkDirectoriesCommand.cxx
  cmLinkDirectoriesCommand.h
574
575
  cmLinkLibrariesCommand.cxx
  cmLinkLibrariesCommand.h
576
577
  cmListCommand.cxx
  cmListCommand.h
578
579
580
581
  cmLoadCacheCommand.cxx
  cmLoadCacheCommand.h
  cmLoadCommandCommand.cxx
  cmLoadCommandCommand.h
582
583
584
585
586
587
588
589
590
591
592
593
  cmMacroCommand.cxx
  cmMacroCommand.h
  cmMakeDirectoryCommand.cxx
  cmMakeDirectoryCommand.h
  cmMarkAsAdvancedCommand.cxx
  cmMarkAsAdvancedCommand.h
  cmMathCommand.cxx
  cmMathCommand.h
  cmMessageCommand.cxx
  cmMessageCommand.h
  cmOptionCommand.cxx
  cmOptionCommand.h
594
595
  cmOutputRequiredFilesCommand.cxx
  cmOutputRequiredFilesCommand.h
596
597
598
599
  cmParseArgumentsCommand.cxx
  cmParseArgumentsCommand.h
  cmPathLabel.cxx
  cmPathLabel.h
600
601
  cmProjectCommand.cxx
  cmProjectCommand.h
602
603
604
605
606
607
608
609
  cmQTWrapCPPCommand.cxx
  cmQTWrapCPPCommand.h
  cmQTWrapUICommand.cxx
  cmQTWrapUICommand.h
  cmRemoveCommand.cxx
  cmRemoveCommand.h
  cmRemoveDefinitionsCommand.cxx
  cmRemoveDefinitionsCommand.h
610
611
  cmReturnCommand.cxx
  cmReturnCommand.h
612
613
  cmSearchPath.cxx
  cmSearchPath.h
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
  cmSeparateArgumentsCommand.cxx
  cmSeparateArgumentsCommand.h
  cmSetCommand.cxx
  cmSetCommand.h
  cmSetDirectoryPropertiesCommand.cxx
  cmSetDirectoryPropertiesCommand.h
  cmSetPropertyCommand.cxx
  cmSetPropertyCommand.h
  cmSetSourceFilesPropertiesCommand.cxx
  cmSetSourceFilesPropertiesCommand.h
  cmSetTargetPropertiesCommand.cxx
  cmSetTargetPropertiesCommand.h
  cmSetTestsPropertiesCommand.cxx
  cmSetTestsPropertiesCommand.h
  cmSiteNameCommand.cxx
  cmSiteNameCommand.h
630
631
  cmSourceGroupCommand.cxx
  cmSourceGroupCommand.h
Brad King's avatar
Brad King committed
632
633
  cmString.cxx
  cmString.hxx
634
  cmStringReplaceHelper.cxx
635
636
  cmStringCommand.cxx
  cmStringCommand.h
wahikihiki's avatar
wahikihiki committed
637
638
  cmSubcommandTable.cxx
  cmSubcommandTable.h
639
640
  cmSubdirCommand.cxx
  cmSubdirCommand.h
641
642
643
644
645
646
647
648
649
650
  cmSubdirDependsCommand.cxx
  cmSubdirDependsCommand.h
  cmTargetCompileDefinitionsCommand.cxx
  cmTargetCompileDefinitionsCommand.h
  cmTargetCompileFeaturesCommand.cxx
  cmTargetCompileFeaturesCommand.h
  cmTargetCompileOptionsCommand.cxx
  cmTargetCompileOptionsCommand.h
  cmTargetIncludeDirectoriesCommand.cxx
  cmTargetIncludeDirectoriesCommand.h
651
652
  cmTargetLinkOptionsCommand.cxx
  cmTargetLinkOptionsCommand.h
653
654
  cmTargetLinkDirectoriesCommand.cxx
  cmTargetLinkDirectoriesCommand.h
655
656
  cmTargetLinkLibrariesCommand.cxx
  cmTargetLinkLibrariesCommand.h
657
658
  cmTargetPrecompileHeadersCommand.cxx
  cmTargetPrecompileHeadersCommand.h
659
660
661
662
  cmTargetPropCommandBase.cxx
  cmTargetPropCommandBase.h
  cmTargetSourcesCommand.cxx
  cmTargetSourcesCommand.h
663
664
665
666
667
668
669
670
  cmTimestamp.cxx
  cmTimestamp.h
  cmTryCompileCommand.cxx
  cmTryCompileCommand.h
  cmTryRunCommand.cxx
  cmTryRunCommand.h
  cmUnsetCommand.cxx
  cmUnsetCommand.h
671
672
673
674
675
676
677
678
  cmUseMangledMesaCommand.cxx
  cmUseMangledMesaCommand.h
  cmUtilitySourceCommand.cxx
  cmUtilitySourceCommand.h
  cmVariableRequiresCommand.cxx
  cmVariableRequiresCommand.h
  cmVariableWatchCommand.cxx
  cmVariableWatchCommand.h
679
680
  cmWhileCommand.cxx
  cmWhileCommand.h
681
682
  cmWriteFileCommand.cxx
  cmWriteFileCommand.h
683

684
  cm_static_string_view.hxx
685
686
  cm_get_date.h
  cm_get_date.c
687
688
  cm_utf8.h
  cm_utf8.c
689
690
  cm_codecvt.hxx
  cm_codecvt.cxx
691
692
693

  cmDuration.h
  cmDuration.cxx
Andy Cedilnik's avatar
Andy Cedilnik committed
694
  )
Ken Martin's avatar
Ken Martin committed
695

696
697
698
SET_PROPERTY(SOURCE cmProcessOutput.cxx APPEND PROPERTY COMPILE_DEFINITIONS
  KWSYS_ENCODING_DEFAULT_CODEPAGE=${KWSYS_ENCODING_DEFAULT_CODEPAGE})

699
# Xcode only works on Apple
700
701
if(APPLE)
  set(SRCS ${SRCS}
702
    cmXCodeObject.cxx
703
    cmXCode21Object.cxx
704
    cmXCodeScheme.cxx
705
    cmGlobalXCodeGenerator.cxx
706
    cmGlobalXCodeGenerator.h
707
708
    cmLocalXCodeGenerator.cxx
    cmLocalXCodeGenerator.h)
709
endif()
710
711


712
713
if (WIN32)
  set(SRCS ${SRCS}
714
715
    cmCallVisualStudioMacro.cxx
    cmCallVisualStudioMacro.h
716
    bindexplib.cxx
717
718
    )

719
720
  if(NOT UNIX)
    set(SRCS ${SRCS}
721
      cmGlobalBorlandMakefileGenerator.cxx
722
      cmGlobalBorlandMakefileGenerator.h
723
724
      cmGlobalMSYSMakefileGenerator.cxx
      cmGlobalMinGWMakefileGenerator.cxx
725
      cmGlobalNMakeMakefileGenerator.cxx
726
      cmGlobalNMakeMakefileGenerator.h
727
728
      cmGlobalJOMMakefileGenerator.cxx
      cmGlobalJOMMakefileGenerator.h
729
730
731
732
733
734
      cmGlobalVisualStudio71Generator.cxx
      cmGlobalVisualStudio71Generator.h
      cmGlobalVisualStudio7Generator.cxx
      cmGlobalVisualStudio7Generator.h
      cmGlobalVisualStudio8Generator.cxx
      cmGlobalVisualStudio8Generator.h
735
736
      cmGlobalVisualStudio9Generator.cxx
      cmGlobalVisualStudio9Generator.h
737
738
739
740
      cmVisualStudioGeneratorOptions.h
      cmVisualStudioGeneratorOptions.cxx
      cmVisualStudio10TargetGenerator.h
      cmVisualStudio10TargetGenerator.cxx
741
742
      cmVisualStudio10ToolsetOptions.h
      cmVisualStudio10ToolsetOptions.cxx
743
744
745
746
      cmLocalVisualStudio10Generator.cxx
      cmLocalVisualStudio10Generator.h
      cmGlobalVisualStudio10Generator.h
      cmGlobalVisualStudio10Generator.cxx
747
748
      cmGlobalVisualStudio11Generator.h
      cmGlobalVisualStudio11Generator.cxx
749
750
      cmGlobalVisualStudio12Generator.h
      cmGlobalVisualStudio12Generator.cxx
751
752
      cmGlobalVisualStudio14Generator.h
      cmGlobalVisualStudio14Generator.cxx
753
754
      cmGlobalVisualStudioGenerator.cxx
      cmGlobalVisualStudioGenerator.h
755
756
      cmGlobalVisualStudioVersionedGenerator.h
      cmGlobalVisualStudioVersionedGenerator.cxx
Brad King's avatar
Brad King committed
757
      cmIDEFlagTable.h
758
759
      cmIDEOptions.cxx
      cmIDEOptions.h
760
761
      cmLocalVisualStudio7Generator.cxx
      cmLocalVisualStudio7Generator.h
762
763
      cmLocalVisualStudioGenerator.cxx
      cmLocalVisualStudioGenerator.h
764
765
766
767
      cmVisualStudioSlnData.h
      cmVisualStudioSlnData.cxx
      cmVisualStudioSlnParser.h
      cmVisualStudioSlnParser.cxx
768
769
      cmVisualStudioWCEPlatformParser.h
      cmVisualStudioWCEPlatformParser.cxx
770
771
      cmVSSetupHelper.cxx
      cmVSSetupHelper.h
772
      )
773
774
775
776

    # Add a manifest file to executables on Windows to allow for
    # GetVersion to work properly on Windows 8 and above.
    set(MANIFEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmake.version.manifest)
777
778
  endif()
endif ()
Ken Martin's avatar
Ken Martin committed
779

780
# Watcom support
781
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
782
783
784
785
786
787
788
  set_property(SOURCE cmake.cxx APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_USE_WMAKE)
  list(APPEND SRCS
    cmGlobalWatcomWMakeGenerator.cxx
    cmGlobalWatcomWMakeGenerator.h
    )
endif()

789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
# GHS support
# Works only for windows and linux
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
  set(SRCS ${SRCS}
      cmGlobalGhsMultiGenerator.cxx
      cmGlobalGhsMultiGenerator.h
      cmLocalGhsMultiGenerator.cxx
      cmLocalGhsMultiGenerator.h
      cmGhsMultiTargetGenerator.cxx
      cmGhsMultiTargetGenerator.h
      cmGhsMultiGpj.cxx
      cmGhsMultiGpj.h
    )
endif()


805
# Ninja support
806
set(SRCS ${SRCS}
807
808
809
810
811
812
813
814
815
816
817
  cmGlobalNinjaGenerator.cxx
  cmGlobalNinjaGenerator.h
  cmNinjaTypes.h
  cmLocalNinjaGenerator.cxx
  cmLocalNinjaGenerator.h
  cmNinjaTargetGenerator.cxx
  cmNinjaTargetGenerator.h
  cmNinjaNormalTargetGenerator.cxx
  cmNinjaNormalTargetGenerator.h
  cmNinjaUtilityTargetGenerator.cxx
  cmNinjaUtilityTargetGenerator.h
818
819
  cmNinjaLinkLineComputer.cxx
  cmNinjaLinkLineComputer.h
820
821
  cmNinjaLinkLineDeviceComputer.cxx
  cmNinjaLinkLineDeviceComputer.h
822
  )
823

824
825
826
# Temporary variable for tools targets
set(_tools)

Stephen Kelly's avatar
Stephen Kelly committed
827
if(WIN32 AND NOT CYGWIN)
828
  set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
829
  add_executable(cmcldeps cmcldeps.cxx ${MANIFEST_FILE})
830
  list(APPEND _tools cmcldeps)
831
832
  target_link_libraries(cmcldeps CMakeLib)
endif()
833

834
835
836
837
838
839
foreach(v CURL_CA_BUNDLE CURL_CA_PATH)
  if(${v})
    set_property(SOURCE cmCurl.cxx APPEND PROPERTY COMPILE_DEFINITIONS ${v}="${${v}}")
  endif()
endforeach()

840
841
foreach(check
    STAT_HAS_ST_MTIM
842
    STAT_HAS_ST_MTIMESPEC
843
844
845
846
847
848
    )
  if(KWSYS_CXX_${check}_COMPILED) # abuse KWSys check cache entry
    set(CMake_${check} 1)
  else()
    set(CMake_${check} 0)
  endif()
Sebastian Holtermann's avatar
Sebastian Holtermann committed
849
850
  set_property(SOURCE cmFileTime.cxx APPEND PROPERTY
    COMPILE_DEFINITIONS CMake_${check}=${CMake_${check}})
851
852
endforeach()

853
# create a library used by the command line and the GUI
854
855
add_library(CMakeLib ${SRCS})
target_link_libraries(CMakeLib cmsys
856
  ${CMAKE_STD_LIBRARY}
857
  ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES}
858
  ${CMAKE_TAR_LIBRARIES}
859
  ${CMAKE_CURL_LIBRARIES}
860
  ${CMAKE_JSONCPP_LIBRARIES}
861
  ${CMAKE_LIBUV_LIBRARIES}
862
  ${CMAKE_LIBRHASH_LIBRARIES}
863
  ${CMake_KWIML_LIBRARIES}
864
  ${CMAKE_THREAD_LIBS_INIT}
865
  )
866

867
868
869
870
871
872
873
874
875
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc")
  # the atomic instructions are implemented using libatomic on some platforms,
  # so linking to that may be required
  check_library_exists(atomic __atomic_fetch_add_4 "" LIBATOMIC_NEEDED)
  if(LIBATOMIC_NEEDED)
    target_link_libraries(CMakeLib atomic)
  endif()
endif()

876
# On Apple we need CoreFoundation and CoreServices
877
878
if(APPLE)
  target_link_libraries(CMakeLib "-framework CoreFoundation")
879
  target_link_libraries(CMakeLib "-framework CoreServices")
880
endif()
881

882
883
if(WIN32 AND NOT UNIX)
  # We need the rpcrt4 library on Windows.
884
885
  # We need the crypt32 library on Windows for crypto/cert APIs.
  target_link_libraries(CMakeLib rpcrt4 crypt32)
886
endif()
887

888
889
target_compile_definitions(CMakeLib PUBLIC ${CLANG_TIDY_DEFINITIONS})

890
891
892
#
# CTestLib
#
893
include_directories(
894
  "${CMake_SOURCE_DIR}/Source/CTest"
Andy Cedilnik's avatar
Andy Cedilnik committed
895
  ${CMAKE_CURL_INCLUDES}
896
  )
897
898
899
#
# Sources for CTestLib
#
900
set(CTEST_SRCS cmCTest.cxx
901
  CTest/cmProcess.cxx
902
  CTest/cmCTestBinPacker.cxx
903
  CTest/cmCTestBuildAndTestHandler.cxx
904
  CTest/cmCTestBuildCommand.cxx
Ken Martin's avatar
Ken Martin committed
905
  CTest/cmCTestBuildHandler.cxx
906
  CTest/cmCTestConfigureCommand.cxx
Ken Martin's avatar
Ken Martin committed
907
  CTest/cmCTestConfigureHandler.cxx
908
  CTest/cmCTestCoverageCommand.cxx
Ken Martin's avatar
Ken Martin committed
909
  CTest/cmCTestCoverageHandler.cxx
910
  CTest/cmCTestCurl.cxx
911
  CTest/cmParseMumpsCoverage.cxx
Bill Hoffman's avatar
Bill Hoffman committed
912
  CTest/cmParseCacheCoverage.cxx
913
  CTest/cmParseGTMCoverage.cxx
914
  CTest/cmParseJacocoCoverage.cxx
915
  CTest/cmParseBlanketJSCoverage.cxx
Bill Hoffman's avatar
Bill Hoffman committed
916
  CTest/cmParsePHPCoverage.cxx
917
  CTest/cmParseCoberturaCoverage.cxx
918
  CTest/cmParseDelphiCoverage.cxx
919
  CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
920
  CTest/cmCTestGenericHandler.cxx
921
  CTest/cmCTestHandlerCommand.cxx
922
  CTest/cmCTestHardwareAllocator.cxx
923
  CTest/cmCTestHardwareSpec.cxx
924
  CTest/cmCTestLaunch.cxx
925
  CTest/cmCTestMemCheckCommand.cxx
926
  CTest/cmCTestMemCheckHandler.cxx
927
  CTest/cmCTestMultiProcessHandler.cxx
Andy Cedilnik's avatar
Andy Cedilnik committed
928
  CTest/cmCTestReadCustomFilesCommand.cxx
929
  CTest/cmCTestResourceGroupsLexerHelper.cxx
930
  CTest/cmCTestRunScriptCommand.cxx
931
  CTest/cmCTestRunTest.cxx
932
  CTest/cmCTestScriptHandler.cxx
933
  CTest/cmCTestSleepCommand.cxx
934
  CTest/cmCTestStartCommand.cxx
935
936
937
  CTest/cmCTestSubmitCommand.cxx
  CTest/cmCTestSubmitHandler.cxx
  CTest/cmCTestTestCommand.cxx
938
939
940
  CTest/cmCTestTestHandler.cxx
  CTest/cmCTestUpdateCommand.cxx
  CTest/cmCTestUpdateHandler.cxx
Zach's avatar
Zach committed
941
942
  CTest/cmCTestUploadCommand.cxx
  CTest/cmCTestUploadHandler.cxx
943
944
945

  CTest/cmCTestVC.cxx
  CTest/cmCTestVC.h
946
947
  CTest/cmCTestGlobalVC.cxx
  CTest/cmCTestGlobalVC.h
Brad King's avatar
Brad King committed
948
949
950
951
  CTest/cmCTestCVS.cxx
  CTest/cmCTestCVS.h
  CTest/cmCTestSVN.cxx
  CTest/cmCTestSVN.h
952
953
  CTest/cmCTestBZR.cxx
  CTest/cmCTestBZR.h
954
955
  CTest/cmCTestGIT.cxx
  CTest/cmCTestGIT.h
956
957
  CTest/cmCTestHG.cxx
  CTest/cmCTestHG.h
958
959
  CTest/cmCTestP4.cxx
  CTest/cmCTestP4.h
960

961
962
963
  LexerParser/cmCTestResourceGroupsLexer.cxx
  LexerParser/cmCTestResourceGroupsLexer.h
  LexerParser/cmCTestResourceGroupsLexer.in.l
Andy Cedilnik's avatar
Andy Cedilnik committed
964
  )
Ken Martin's avatar
oops  
Ken Martin committed
965

966
# Build CTestLib
967
add_library(CTestLib ${CTEST_SRCS})
968
target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES})
969

970
971
972
973
974
975
#
# CPack
#
include_directories(
  "${CMake_SOURCE_DIR}/Source/CPack"
  )
Andy Cedilnik's avatar
Andy Cedilnik committed
976
977
978
#
# Sources for CPack
#
979
set(CPACK_SRCS
980
  CPack/cmCPackArchiveGenerator.cxx
981
  CPack/cmCPackComponentGroup.cxx
982
  CPack/cmCPackDebGenerator.cxx
983
  CPack/cmCPackExternalGenerator.cxx
Bill Hoffman's avatar
Bill Hoffman committed
984
  CPack/cmCPackGeneratorFactory.cxx
Bill Hoffman's avatar
Bill Hoffman committed
985
  CPack/cmCPackGenerator.cxx
986
  CPack/cmCPackLog.cxx
Andy Cedilnik's avatar
Andy Cedilnik committed
987
  CPack/cmCPackNSISGenerator.cxx
Alex Turbov's avatar
Alex Turbov committed
988
  CPack/cmCPackNuGetGenerator.cxx
989
  CPack/cmCPackSTGZGenerator.cxx
Andy Cedilnik's avatar
Andy Cedilnik committed
990
  )
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
# CPack IFW generator
set(CPACK_SRCS ${CPACK_SRCS}
  CPack/IFW/cmCPackIFWCommon.cxx
  CPack/IFW/cmCPackIFWCommon.h
  CPack/IFW/cmCPackIFWGenerator.cxx
  CPack/IFW/cmCPackIFWGenerator.h
  CPack/IFW/cmCPackIFWInstaller.cxx
  CPack/IFW/cmCPackIFWInstaller.h
  CPack/IFW/cmCPackIFWPackage.cxx
  CPack/IFW/cmCPackIFWPackage.h
  CPack/IFW/cmCPackIFWRepository.cxx
  CPack/IFW/cmCPackIFWRepository.h
  )
Alexander Neundorf's avatar
 
Alexander Neundorf committed
1004

1005
1006
if(CYGWIN)
  set(CPACK_SRCS ${CPACK_SRCS}
Alexander Neundorf's avatar
 
Alexander Neundorf committed
1007
1008
1009
    CPack/cmCPackCygwinBinaryGenerator.cxx
    CPack/cmCPackCygwinSourceGenerator.cxx
    )
1010
endif()
1011

1012
1013
option(CPACK_ENABLE_FREEBSD_PKG "Add FreeBSD pkg(8) generator to CPack." OFF)

1014
1015
if(UNIX)
  set(CPACK_SRCS ${CPACK_SRCS}
Alexander Neundorf's avatar
 
Alexander Neundorf committed
1016
1017
    CPack/cmCPackRPMGenerator.cxx
    )
1018
1019
1020
1021
1022
1023
1024
1025

  # Optionally, try to use pkg(8)
  if(CPACK_ENABLE_FREEBSD_PKG)
    # On UNIX, you may find FreeBSD's pkg(8) and attendant
    # library -- it can be used on FreeBSD, Dragonfly, NetBSD,
    # OpenBSD and also Linux and OSX. Look for the header and
    # the library; it's a warning on FreeBSD if they're not
    # found, and informational on other platforms.
1026
    find_path(FREEBSD_PKG_INCLUDE_DIRS "pkg.h")
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
    if(FREEBSD_PKG_INCLUDE_DIRS)
      find_library(FREEBSD_PKG_LIBRARIES
        pkg
        DOC "FreeBSD pkg(8) library")
      if(FREEBSD_PKG_LIBRARIES)
        set(CPACK_SRCS ${CPACK_SRCS}
          CPack/cmCPackFreeBSDGenerator.cxx
          )
      endif()
    endif()

    if (NOT FREEBSD_PKG_INCLUDE_DIRS OR NOT FREEBSD_PKG_LIBRARIES)
      message(FATAL_ERROR "CPack needs libpkg(3) to produce FreeBSD packages natively.")
    endif()
  else()
    set(FREEBSD_PKG_INCLUDE_DIRS NOTFOUND)
    set(FREEBSD_PKG_LIBRARIES NOTFOUND)
  endif()
1045
endif()
Alexander Neundorf's avatar
 
Alexander Neundorf committed
1046

1047
1048
1049
1050
if(CYGWIN)
  find_package(LibUUID)
endif()
if(WIN32 OR (CYGWIN AND LibUUID_FOUND))
1051
  set(CPACK_SRCS ${CPACK_SRCS}
1052
1053
    CPack/WiX/cmCMakeToWixPath.cxx
    CPack/WiX/cmCMakeToWixPath.h
1054
    CPack/WiX/cmCPackWIXGenerator.cxx
1055
    CPack/WiX/cmCPackWIXGenerator.h
1056
    CPack/WiX/cmWIXAccessControlList.cxx
1057
    CPack/WiX/cmWIXAccessControlList.h
Nils Gladitz's avatar
Nils Gladitz committed
1058
    CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
1059
    CPack/WiX/cmWIXDirectoriesSourceWriter.h
Nils Gladitz's avatar
Nils Gladitz committed
1060
    CPack/WiX/cmWIXFeaturesSourceWriter.cxx
1061
    CPack/WiX/cmWIXFeaturesSourceWriter.h
Nils Gladitz's avatar
Nils Gladitz committed
1062
    CPack/WiX/cmWIXFilesSourceWriter.cxx
1063
    CPack/WiX/cmWIXFilesSourceWriter.h
Nils Gladitz's avatar
Nils Gladitz committed
1064
    CPack/WiX/cmWIXPatch.cxx
1065
    CPack/WiX/cmWIXPatch.h
1066
    CPack/WiX/cmWIXPatchParser.cxx
1067
    CPack/WiX/cmWIXPatchParser.h
1068
    CPack/WiX/cmWIXRichTextFormatWriter.cxx
1069
    CPack/WiX/cmWIXRichTextFormatWriter.h