CMakeLists.txt 31 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_COMPRESS_INCLUDES}
96
  ${CMake_HAIKU_INCLUDE_DIRS}
97
  )
98
99

# let cmake know it is supposed to use it
100
add_definitions(-DCMAKE_BUILD_WITH_CMAKE)
101

Brad King's avatar
Brad King committed
102
# Check if we can build the ELF parser.
103
104
if(CMAKE_USE_ELF_PARSER)
  set(ELF_SRCS cmELF.h cmELF.cxx)
105
endif()
Brad King's avatar
Brad King committed
106

107
108
109
110
111
# Check if we can build the Mach-O parser.
if(CMAKE_USE_MACH_PARSER)
  set(MACH_SRCS cmMachO.h cmMachO.cxx)
endif()

112
113
114
#
# Sources for CMakeLib
#
115
set(SRCS
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
  # 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

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

401
402
  cmCommand.cxx
  cmCommand.h
403
404
  cmCommands.cxx
  cmCommands.h
405
406
  cmAddCompileDefinitionsCommand.cxx
  cmAddCompileDefinitionsCommand.h
407
408
  cmAddCompileOptionsCommand.cxx
  cmAddCompileOptionsCommand.h
409
410
  cmAddLinkOptionsCommand.cxx
  cmAddLinkOptionsCommand.h
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
  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
427
428
  cmAuxSourceDirectoryCommand.cxx
  cmAuxSourceDirectoryCommand.h
429
430
431
432
  cmBreakCommand.cxx
  cmBreakCommand.h
  cmBuildCommand.cxx
  cmBuildCommand.h
433
434
435
436
  cmBuildNameCommand.cxx
  cmBuildNameCommand.h
  cmCMakeHostSystemInformationCommand.cxx
  cmCMakeHostSystemInformationCommand.h
437
438
439
440
441
442
  cmCMakeMinimumRequired.cxx
  cmCMakeMinimumRequired.h
  cmCMakePolicyCommand.cxx
  cmCMakePolicyCommand.h
  cmCommandArgumentsHelper.cxx
  cmCommandArgumentsHelper.h
443
444
  cmConditionEvaluator.cxx
  cmConditionEvaluator.h
445
446
447
448
449
450
451
452
453
454
  cmConfigureFileCommand.cxx
  cmConfigureFileCommand.h
  cmContinueCommand.cxx
  cmContinueCommand.h
  cmCoreTryCompile.cxx
  cmCoreTryCompile.h
  cmCreateTestSourceList.cxx
  cmCreateTestSourceList.h
  cmDefinePropertyCommand.cxx
  cmDefinePropertyCommand.h
455
456
  cmDisallowedCommand.cxx
  cmDisallowedCommand.h
457
458
459
460
461
462
463
464
  cmEnableLanguageCommand.cxx
  cmEnableLanguageCommand.h
  cmEnableTestingCommand.cxx
  cmEnableTestingCommand.h
  cmExecProgramCommand.cxx
  cmExecProgramCommand.h
  cmExecuteProcessCommand.cxx
  cmExecuteProcessCommand.h
465
466
  cmExpandedCommandArgument.cxx
  cmExpandedCommandArgument.h
467
468
469
470
471
472
  cmExportCommand.cxx
  cmExportCommand.h
  cmExportLibraryDependenciesCommand.cxx
  cmExportLibraryDependenciesCommand.h
  cmFLTKWrapUICommand.cxx
  cmFLTKWrapUICommand.h
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
  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
  cmFunctionCommand.cxx
  cmFunctionCommand.h
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
  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
515
516
  cmIncludeExternalMSProjectCommand.cxx
  cmIncludeExternalMSProjectCommand.h
517
518
  cmIncludeGuardCommand.cxx
  cmIncludeGuardCommand.h
519
520
521
522
523
524
525
526
  cmIncludeRegularExpressionCommand.cxx
  cmIncludeRegularExpressionCommand.h
  cmInstallCommand.cxx
  cmInstallCommand.h
  cmInstallCommandArguments.cxx
  cmInstallCommandArguments.h
  cmInstallFilesCommand.cxx
  cmInstallFilesCommand.h
527
528
  cmInstallProgramsCommand.cxx
  cmInstallProgramsCommand.h
529
530
531
532
  cmInstallTargetsCommand.cxx
  cmInstallTargetsCommand.h
  cmLinkDirectoriesCommand.cxx
  cmLinkDirectoriesCommand.h
533
534
  cmLinkLibrariesCommand.cxx
  cmLinkLibrariesCommand.h
535
536
  cmListCommand.cxx
  cmListCommand.h
537
538
539
540
  cmLoadCacheCommand.cxx
  cmLoadCacheCommand.h
  cmLoadCommandCommand.cxx
  cmLoadCommandCommand.h
541
542
543
544
545
546
547
548
549
550
551
552
  cmMacroCommand.cxx
  cmMacroCommand.h
  cmMakeDirectoryCommand.cxx
  cmMakeDirectoryCommand.h
  cmMarkAsAdvancedCommand.cxx
  cmMarkAsAdvancedCommand.h
  cmMathCommand.cxx
  cmMathCommand.h
  cmMessageCommand.cxx
  cmMessageCommand.h
  cmOptionCommand.cxx
  cmOptionCommand.h
553
554
  cmOutputRequiredFilesCommand.cxx
  cmOutputRequiredFilesCommand.h
555
556
557
558
  cmParseArgumentsCommand.cxx
  cmParseArgumentsCommand.h
  cmPathLabel.cxx
  cmPathLabel.h
559
560
  cmProjectCommand.cxx
  cmProjectCommand.h
561
562
563
564
565
566
567
568
  cmQTWrapCPPCommand.cxx
  cmQTWrapCPPCommand.h
  cmQTWrapUICommand.cxx
  cmQTWrapUICommand.h
  cmRemoveCommand.cxx
  cmRemoveCommand.h
  cmRemoveDefinitionsCommand.cxx
  cmRemoveDefinitionsCommand.h
569
570
  cmReturnCommand.cxx
  cmReturnCommand.h
571
572
  cmSearchPath.cxx
  cmSearchPath.h
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
  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
589
590
  cmSourceGroupCommand.cxx
  cmSourceGroupCommand.h
Brad King's avatar
Brad King committed
591
592
  cmString.cxx
  cmString.hxx
593
  cmStringReplaceHelper.cxx
594
595
596
597
  cmStringCommand.cxx
  cmStringCommand.h
  cmSubdirCommand.cxx
  cmSubdirCommand.h
598
599
600
601
602
603
604
605
606
607
  cmSubdirDependsCommand.cxx
  cmSubdirDependsCommand.h
  cmTargetCompileDefinitionsCommand.cxx
  cmTargetCompileDefinitionsCommand.h
  cmTargetCompileFeaturesCommand.cxx
  cmTargetCompileFeaturesCommand.h
  cmTargetCompileOptionsCommand.cxx
  cmTargetCompileOptionsCommand.h
  cmTargetIncludeDirectoriesCommand.cxx
  cmTargetIncludeDirectoriesCommand.h
608
609
  cmTargetLinkOptionsCommand.cxx
  cmTargetLinkOptionsCommand.h
610
611
  cmTargetLinkDirectoriesCommand.cxx
  cmTargetLinkDirectoriesCommand.h
612
613
  cmTargetLinkLibrariesCommand.cxx
  cmTargetLinkLibrariesCommand.h
614
615
616
617
  cmTargetPropCommandBase.cxx
  cmTargetPropCommandBase.h
  cmTargetSourcesCommand.cxx
  cmTargetSourcesCommand.h
618
619
620
621
622
623
  cmTimestamp.cxx
  cmTimestamp.h
  cmTryCompileCommand.cxx
  cmTryCompileCommand.h
  cmTryRunCommand.cxx
  cmTryRunCommand.h
624
625
  cmUnexpectedCommand.cxx
  cmUnexpectedCommand.h
626
627
  cmUnsetCommand.cxx
  cmUnsetCommand.h
628
629
630
631
632
633
634
635
  cmUseMangledMesaCommand.cxx
  cmUseMangledMesaCommand.h
  cmUtilitySourceCommand.cxx
  cmUtilitySourceCommand.h
  cmVariableRequiresCommand.cxx
  cmVariableRequiresCommand.h
  cmVariableWatchCommand.cxx
  cmVariableWatchCommand.h
636
637
  cmWhileCommand.cxx
  cmWhileCommand.h
638
639
  cmWriteFileCommand.cxx
  cmWriteFileCommand.h
640

641
642
  cm_get_date.h
  cm_get_date.c
643
644
  cm_utf8.h
  cm_utf8.c
645
646
  cm_codecvt.hxx
  cm_codecvt.cxx
647
  cm_thread.hxx
648
649
650

  cmDuration.h
  cmDuration.cxx
Andy Cedilnik's avatar
Andy Cedilnik committed
651
  )
Ken Martin's avatar
Ken Martin committed
652

653
654
655
SET_PROPERTY(SOURCE cmProcessOutput.cxx APPEND PROPERTY COMPILE_DEFINITIONS
  KWSYS_ENCODING_DEFAULT_CODEPAGE=${KWSYS_ENCODING_DEFAULT_CODEPAGE})

656
# Xcode only works on Apple
657
658
if(APPLE)
  set(SRCS ${SRCS}
659
    cmXCodeObject.cxx
660
    cmXCode21Object.cxx
661
    cmXCodeScheme.cxx
662
    cmGlobalXCodeGenerator.cxx
663
    cmGlobalXCodeGenerator.h
664
665
    cmLocalXCodeGenerator.cxx
    cmLocalXCodeGenerator.h)
666
endif()
667
668


669
670
if (WIN32)
  set(SRCS ${SRCS}
671
672
    cmCallVisualStudioMacro.cxx
    cmCallVisualStudioMacro.h
673
    bindexplib.cxx
674
675
    )

676
677
  if(NOT UNIX)
    set(SRCS ${SRCS}
678
      cmGlobalBorlandMakefileGenerator.cxx
679
      cmGlobalBorlandMakefileGenerator.h
680
681
      cmGlobalMSYSMakefileGenerator.cxx
      cmGlobalMinGWMakefileGenerator.cxx
682
      cmGlobalNMakeMakefileGenerator.cxx
683
      cmGlobalNMakeMakefileGenerator.h
684
685
      cmGlobalJOMMakefileGenerator.cxx
      cmGlobalJOMMakefileGenerator.h
686
687
688
689
690
691
      cmGlobalVisualStudio71Generator.cxx
      cmGlobalVisualStudio71Generator.h
      cmGlobalVisualStudio7Generator.cxx
      cmGlobalVisualStudio7Generator.h
      cmGlobalVisualStudio8Generator.cxx
      cmGlobalVisualStudio8Generator.h
692
693
      cmGlobalVisualStudio9Generator.cxx
      cmGlobalVisualStudio9Generator.h
694
695
696
697
      cmVisualStudioGeneratorOptions.h
      cmVisualStudioGeneratorOptions.cxx
      cmVisualStudio10TargetGenerator.h
      cmVisualStudio10TargetGenerator.cxx
698
699
      cmVisualStudio10ToolsetOptions.h
      cmVisualStudio10ToolsetOptions.cxx
700
701
702
703
      cmLocalVisualStudio10Generator.cxx
      cmLocalVisualStudio10Generator.h
      cmGlobalVisualStudio10Generator.h
      cmGlobalVisualStudio10Generator.cxx
704
705
      cmGlobalVisualStudio11Generator.h
      cmGlobalVisualStudio11Generator.cxx
706
707
      cmGlobalVisualStudio12Generator.h
      cmGlobalVisualStudio12Generator.cxx
708
709
      cmGlobalVisualStudio14Generator.h
      cmGlobalVisualStudio14Generator.cxx
710
711
      cmGlobalVisualStudioGenerator.cxx
      cmGlobalVisualStudioGenerator.h
712
713
      cmGlobalVisualStudioVersionedGenerator.h
      cmGlobalVisualStudioVersionedGenerator.cxx
Brad King's avatar
Brad King committed
714
      cmIDEFlagTable.h
715
716
      cmIDEOptions.cxx
      cmIDEOptions.h
717
718
      cmLocalVisualStudio7Generator.cxx
      cmLocalVisualStudio7Generator.h
719
720
      cmLocalVisualStudioGenerator.cxx
      cmLocalVisualStudioGenerator.h
721
722
723
724
      cmVisualStudioSlnData.h
      cmVisualStudioSlnData.cxx
      cmVisualStudioSlnParser.h
      cmVisualStudioSlnParser.cxx
725
726
      cmVisualStudioWCEPlatformParser.h
      cmVisualStudioWCEPlatformParser.cxx
727
728
729
730
731
732
733
734
      cmGlobalGhsMultiGenerator.cxx
      cmGlobalGhsMultiGenerator.h
      cmLocalGhsMultiGenerator.cxx
      cmLocalGhsMultiGenerator.h
      cmGhsMultiTargetGenerator.cxx
      cmGhsMultiTargetGenerator.h
      cmGhsMultiGpj.cxx
      cmGhsMultiGpj.h
735
736
      cmVSSetupHelper.cxx
      cmVSSetupHelper.h
737
      )
738
739
740
741

    # 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)
742
743
  endif()
endif ()
Ken Martin's avatar
Ken Martin committed
744

745
# Watcom support
746
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
747
748
749
750
751
752
753
  set_property(SOURCE cmake.cxx APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_USE_WMAKE)
  list(APPEND SRCS
    cmGlobalWatcomWMakeGenerator.cxx
    cmGlobalWatcomWMakeGenerator.h
    )
endif()

754
# Ninja support
755
set(SRCS ${SRCS}
756
757
758
759
760
761
762
763
764
765
766
  cmGlobalNinjaGenerator.cxx
  cmGlobalNinjaGenerator.h
  cmNinjaTypes.h
  cmLocalNinjaGenerator.cxx
  cmLocalNinjaGenerator.h
  cmNinjaTargetGenerator.cxx
  cmNinjaTargetGenerator.h
  cmNinjaNormalTargetGenerator.cxx
  cmNinjaNormalTargetGenerator.h
  cmNinjaUtilityTargetGenerator.cxx
  cmNinjaUtilityTargetGenerator.h
767
768
  cmNinjaLinkLineComputer.cxx
  cmNinjaLinkLineComputer.h
769
  )
770

771
772
773
# Temporary variable for tools targets
set(_tools)

Stephen Kelly's avatar
Stephen Kelly committed
774
if(WIN32 AND NOT CYGWIN)
775
  set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
776
  add_executable(cmcldeps cmcldeps.cxx ${MANIFEST_FILE})
777
  list(APPEND _tools cmcldeps)
778
779
  target_link_libraries(cmcldeps CMakeLib)
endif()
780

781
782
783
784
785
786
foreach(v CURL_CA_BUNDLE CURL_CA_PATH)
  if(${v})
    set_property(SOURCE cmCurl.cxx APPEND PROPERTY COMPILE_DEFINITIONS ${v}="${${v}}")
  endif()
endforeach()

787
788
foreach(check
    STAT_HAS_ST_MTIM
789
    STAT_HAS_ST_MTIMESPEC
790
791
792
793
794
795
796
797
798
799
    )
  if(KWSYS_CXX_${check}_COMPILED) # abuse KWSys check cache entry
    set(CMake_${check} 1)
  else()
    set(CMake_${check} 0)
  endif()
  set_property(SOURCE cmFileTimeComparison.cxx APPEND PROPERTY
    COMPILE_DEFINITIONS CMake_${check}=${CMake_${check}})
endforeach()

800
# create a library used by the command line and the GUI
801
802
add_library(CMakeLib ${SRCS})
target_link_libraries(CMakeLib cmsys
803
  ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES}
804
  ${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES}
805
  ${CMAKE_CURL_LIBRARIES}
806
  ${CMAKE_JSONCPP_LIBRARIES}
807
  ${CMAKE_LIBUV_LIBRARIES}
808
  ${CMAKE_LIBRHASH_LIBRARIES}
809
  ${CMake_KWIML_LIBRARIES}
810
  ${CMAKE_THREAD_LIBS_INIT}
811
  )
812

813
814
815
816
817
818
819
820
821
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()

822
# On Apple we need CoreFoundation and CoreServices
823
824
if(APPLE)
  target_link_libraries(CMakeLib "-framework CoreFoundation")
825
  target_link_libraries(CMakeLib "-framework CoreServices")
826
endif()
827

828
829
if(WIN32 AND NOT UNIX)
  # We need the rpcrt4 library on Windows.
830
831
  # We need the crypt32 library on Windows for crypto/cert APIs.
  target_link_libraries(CMakeLib rpcrt4 crypt32)
832
endif()
833

834
835
target_compile_definitions(CMakeLib PUBLIC ${CLANG_TIDY_DEFINITIONS})

836
837
838
#
# CTestLib
#
839
include_directories(
840
  "${CMake_SOURCE_DIR}/Source/CTest"
Andy Cedilnik's avatar
Andy Cedilnik committed
841
  ${CMAKE_CURL_INCLUDES}
842
  )
843
844
845
#
# Sources for CTestLib
#
846
set(CTEST_SRCS cmCTest.cxx
847
  CTest/cmProcess.cxx
848
  CTest/cmCTestBuildAndTestHandler.cxx
849
  CTest/cmCTestBuildCommand.cxx
Ken Martin's avatar
Ken Martin committed
850
  CTest/cmCTestBuildHandler.cxx
851
  CTest/cmCTestConfigureCommand.cxx
Ken Martin's avatar
Ken Martin committed
852
  CTest/cmCTestConfigureHandler.cxx
853
  CTest/cmCTestCoverageCommand.cxx
Ken Martin's avatar
Ken Martin committed
854
  CTest/cmCTestCoverageHandler.cxx
855
  CTest/cmCTestCurl.cxx
856
  CTest/cmParseMumpsCoverage.cxx
Bill Hoffman's avatar
Bill Hoffman committed
857
  CTest/cmParseCacheCoverage.cxx
858
  CTest/cmParseGTMCoverage.cxx
859
  CTest/cmParseJacocoCoverage.cxx
860
  CTest/cmParseBlanketJSCoverage.cxx
Bill Hoffman's avatar
Bill Hoffman committed
861
  CTest/cmParsePHPCoverage.cxx
862
  CTest/cmParseCoberturaCoverage.cxx
863
  CTest/cmParseDelphiCoverage.cxx
864
  CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
865
  CTest/cmCTestGenericHandler.cxx
866
  CTest/cmCTestHandlerCommand.cxx
867
  CTest/cmCTestLaunch.cxx
868
  CTest/cmCTestMemCheckCommand.cxx
869
  CTest/cmCTestMemCheckHandler.cxx
870
  CTest/cmCTestMultiProcessHandler.cxx
Andy Cedilnik's avatar
Andy Cedilnik committed
871
  CTest/cmCTestReadCustomFilesCommand.cxx
872
  CTest/cmCTestRunScriptCommand.cxx
873
  CTest/cmCTestRunTest.cxx
874
  CTest/cmCTestScriptHandler.cxx
875
  CTest/cmCTestSleepCommand.cxx
876
  CTest/cmCTestStartCommand.cxx
877
878
879
  CTest/cmCTestSubmitCommand.cxx
  CTest/cmCTestSubmitHandler.cxx
  CTest/cmCTestTestCommand.cxx
880
881
882
  CTest/cmCTestTestHandler.cxx
  CTest/cmCTestUpdateCommand.cxx
  CTest/cmCTestUpdateHandler.cxx
Zach's avatar
Zach committed
883
884
  CTest/cmCTestUploadCommand.cxx
  CTest/cmCTestUploadHandler.cxx
885
886
887

  CTest/cmCTestVC.cxx
  CTest/cmCTestVC.h
888
889
  CTest/cmCTestGlobalVC.cxx
  CTest/cmCTestGlobalVC.h
Brad King's avatar
Brad King committed
890
891
892
893
  CTest/cmCTestCVS.cxx
  CTest/cmCTestCVS.h
  CTest/cmCTestSVN.cxx
  CTest/cmCTestSVN.h
894
895
  CTest/cmCTestBZR.cxx
  CTest/cmCTestBZR.h
896
897
  CTest/cmCTestGIT.cxx
  CTest/cmCTestGIT.h
898
899
  CTest/cmCTestHG.cxx
  CTest/cmCTestHG.h
900
901
  CTest/cmCTestP4.cxx
  CTest/cmCTestP4.h
Andy Cedilnik's avatar
Andy Cedilnik committed
902
  )
Ken Martin's avatar
oops    
Ken Martin committed
903

904
# Build CTestLib
905
add_library(CTestLib ${CTEST_SRCS})
906
target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES})
907

908
909
910
911
912
913
#
# CPack
#
include_directories(
  "${CMake_SOURCE_DIR}/Source/CPack"
  )
Andy Cedilnik's avatar
Andy Cedilnik committed
914
915
916
#
# Sources for CPack
#
917
set(CPACK_SRCS
918
  CPack/cmCPackArchiveGenerator.cxx
919
  CPack/cmCPackComponentGroup.cxx
920
  CPack/cmCPackDebGenerator.cxx
921
  CPack/cmCPackExternalGenerator.cxx
Bill Hoffman's avatar
Bill Hoffman committed
922
  CPack/cmCPackGeneratorFactory.cxx
Bill Hoffman's avatar
Bill Hoffman committed
923
  CPack/cmCPackGenerator.cxx
924
  CPack/cmCPackLog.cxx
Andy Cedilnik's avatar
Andy Cedilnik committed
925
  CPack/cmCPackNSISGenerator.cxx
Alex Turbov's avatar
Alex Turbov committed
926
  CPack/cmCPackNuGetGenerator.cxx
927
928
  CPack/cmCPackSTGZGenerator.cxx
  CPack/cmCPackTGZGenerator.cxx
929
  CPack/cmCPackTXZGenerator.cxx
930
  CPack/cmCPackTarBZip2Generator.cxx
931
  CPack/cmCPackTarCompressGenerator.cxx
932
  CPack/cmCPackZIPGenerator.cxx
933
  CPack/cmCPack7zGenerator.cxx
Andy Cedilnik's avatar
Andy Cedilnik committed
934
  )
935
936
937
938
939
940
941
942
943
944
945
946
947
# 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
948

949
950
if(CYGWIN)
  set(CPACK_SRCS ${CPACK_SRCS}
Alexander Neundorf's avatar
   
Alexander Neundorf committed
951
952
953
    CPack/cmCPackCygwinBinaryGenerator.cxx
    CPack/cmCPackCygwinSourceGenerator.cxx
    )
954
endif()
955

956
957
option(CPACK_ENABLE_FREEBSD_PKG "Add FreeBSD pkg(8) generator to CPack." OFF)

958
959
if(UNIX)
  set(CPACK_SRCS ${CPACK_SRCS}
Alexander Neundorf's avatar
   
Alexander Neundorf committed
960
961
    CPack/cmCPackRPMGenerator.cxx
    )
962
963
964
965
966
967
968
969

  # 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.
970
    find_path(FREEBSD_PKG_INCLUDE_DIRS "pkg.h")
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
    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()
989
endif()
Alexander Neundorf's avatar
   
Alexander Neundorf committed
990

991
992
993
994
if(CYGWIN)
  find_package(LibUUID)
endif()
if(WIN32 OR (CYGWIN AND LibUUID_FOUND))
995
  set(CPACK_SRCS ${CPACK_SRCS}
996
997
    CPack/WiX/cmCMakeToWixPath.cxx
    CPack/WiX/cmCMakeToWixPath.h
998
    CPack/WiX/cmCPackWIXGenerator.cxx
999
    CPack/WiX/cmCPackWIXGenerator.h
1000
    CPack/WiX/cmWIXAccessControlList.cxx
1001
    CPack/WiX/cmWIXAccessControlList.h
Nils Gladitz's avatar
Nils Gladitz committed
1002
    CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
1003
    CPack/WiX/cmWIXDirectoriesSourceWriter.h
Nils Gladitz's avatar
Nils Gladitz committed
1004
    CPack/WiX/cmWIXFeaturesSourceWriter.cxx
1005
    CPack/WiX/cmWIXFeaturesSourceWriter.h
Nils Gladitz's avatar
Nils Gladitz committed
1006
    CPack/WiX/cmWIXFilesSourceWriter.cxx
1007
    CPack/WiX/cmWIXFilesSourceWriter.h
Nils Gladitz's avatar
Nils Gladitz committed
1008
    CPack/WiX/cmWIXPatch.cxx
1009
    CPack/WiX/cmWIXPatch.h
1010
    CPack/WiX/cmWIXPatchParser.cxx
1011
    CPack/WiX/cmWIXPatchParser.h
1012
    CPack/WiX/cmWIXRichTextFormatWriter.cxx
1013
    CPack/WiX/cmWIXRichTextFormatWriter.h
1014
    CPack/WiX/cmWIXShortcut.cxx
1015
    CPack/WiX/cmWIXShortcut.h
1016
    CPack/WiX/cmWIXSourceWriter.cxx
1017
    CPack/WiX/cmWIXSourceWriter.h
1018
    )
1019
1020
endif()

1021
1022
if(APPLE)
  set(CPACK_SRCS ${CPACK_SRCS}
1023
    CPack/cmCPackBundleGenerator.cxx
1024
    CPack/cmCPackDragNDropGenerator.cxx
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1025
    CPack/cmCPackOSXX11Generator.cxx
1026
    CPack/cmCPackPKGGenerator.cxx
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1027
    CPack/cmCPackPackageMakerGenerator.cxx
1028
    CPack/cmCPackProductBuildGenerator.cxx
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1029
    )
1030
endif()
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1031

Andy Cedilnik's avatar
Andy Cedilnik committed
1032
# Build CPackLib
1033
1034
add_library(CPackLib ${CPACK_SRCS})
target_link_libraries(CPackLib CMakeLib)
1035
if(APPLE)
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
  # Some compilers produce errors in the CoreServices framework headers.
  # Ideally such errors should be fixed by either the compiler vendor
  # or the framework source, but we try to workaround it and build anyway.
  # If it does not work, build with reduced functionality and warn.
  check_include_file("CoreServices/CoreServices.h" HAVE_CoreServices)
  if(HAVE_CoreServices)
    set_property(SOURCE CPack/cmCPackDragNDropGenerator.cxx PROPERTY COMPILE_DEFINITIONS HAVE_CoreServices)
    target_link_libraries(CPackLib "-framework CoreServices")
  else()
    message(WARNING "This compiler does not appear to support\n"
      "  #include <CoreServices/CoreServices.h>\n"
      "Some CPack functionality may be limited.\n"
      "See CMakeFiles/CMakeError.log for details of the failure.")
  endif()
1050
endif()
1051
1052
1053
1054
1055
if(CYGWIN AND LibUUID_FOUND)
  target_link_libraries(CPackLib ${LibUUID_LIBRARIES})
  include_directories(CPackLib ${LibUUID_INCLUDE_DIRS})
  set_property(SOURCE CPack/cmCPackGeneratorFactory.cxx PROPERTY COMPILE_DEFINITIONS HAVE_LIBUUID)
endif()
1056
1057
1058
1059
1060
if(CPACK_ENABLE_FREEBSD_PKG AND FREEBSD_PKG_INCLUDE_DIRS AND FREEBSD_PKG_LIBRARIES)
  target_link_libraries(CPackLib ${FREEBSD_PKG_LIBRARIES})
  include_directories(${FREEBSD_PKG_INCLUDE_DIRS})
  add_definitions(-DHAVE_FREEBSD_PKG)
endif()
Andy Cedilnik's avatar
Andy Cedilnik committed
1061

1062
1063
if(APPLE)
  add_executable(cmakexbuild cmakexbuild.cxx)
1064
  list(APPEND _tools cmakexbuild)
1065
1066
  target_link_libraries(cmakexbuild CMakeLib)
  add_executable(OSXScriptLauncher
1067
    CPack/OSXScriptLauncher.cxx)
1068
1069
  target_link_libraries(OSXScriptLauncher cmsys)
  target_link_libraries(OSXScriptLauncher "-framework CoreFoundation")
1070
endif()
1071

1072
# Build CMake executable
1073
add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h ${MANIFEST_FILE})
1074
list(APPEND _tools cmake)
1075
target_link_libraries(cmake CMakeLib)
1076

Daniel Pfeifer's avatar
Daniel Pfeifer committed
1077
1078
1079
add_library(CMakeServerLib
  cmConnection.h cmConnection.cxx
  cmFileMonitor.cxx cmFileMonitor.h
1080
1081
1082
  cmJsonObjectDictionary.h
  cmJsonObjects.h
  cmJsonObjects.cxx
Daniel Pfeifer's avatar
Daniel Pfeifer committed
1083
1084
1085
1086
1087
1088
1089
  cmPipeConnection.cxx cmPipeConnection.h
  cmServer.cxx cmServer.h
  cmServerConnection.cxx cmServerConnection.h
  cmServerProtocol.cxx cmServerProtocol.h
  )
target_link_libraries(CMakeServerLib CMakeLib)
target_link_libraries(cmake CMakeServerLib)
1090

1091
# Build CTest executable
1092
add_executable(ctest ctest.cxx ${MANIFEST_FILE})
1093