1 INCLUDE(CheckIncludeFile)
2 # Check if we can build support for ELF parsing.
3 CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H)
5 SET(CMAKE_USE_ELF_PARSER 1)
7 SET(CMAKE_USE_ELF_PARSER)
10 # configure the .h file
12 "${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in"
13 "${CMake_BINARY_DIR}/Source/cmConfigure.h"
16 "${CMake_SOURCE_DIR}/Source/cmVersionConfig.h.in"
17 "${CMake_BINARY_DIR}/Source/cmVersionConfig.h"
20 "${CMake_SOURCE_DIR}/Source/CPack/cmCPackConfigure.h.in"
21 "${CMake_BINARY_DIR}/Source/CPack/cmCPackConfigure.h"
24 # add the include path to find the .h
26 "${CMake_BINARY_DIR}/Source"
27 "${CMake_SOURCE_DIR}/Source"
28 ${CMAKE_ZLIB_INCLUDES}
29 ${CMAKE_EXPAT_INCLUDES}
31 ${CMAKE_COMPRESS_INCLUDES}
34 # let cmake know it is supposed to use it
35 ADD_DEFINITIONS(-DCMAKE_BUILD_WITH_CMAKE)
37 OPTION(CMAKE_REGENERATE_YACCLEX
38 "Regenerate YACC and LEXX files" OFF)
39 MARK_AS_ADVANCED(CMAKE_REGENERATE_YACCLEX)
40 IF(CMAKE_REGENERATE_YACCLEX)
41 SET(parsersLexers cmDependsFortran cmCommandArgument cmExpr)
42 FIND_PROGRAM(YACC_EXECUTABLE
45 DOC "Yacc or Bison executable")
46 FIND_PROGRAM(FLEX_EXECUTABLE
49 DOC "Flex executable")
50 MARK_AS_ADVANCED(YACC_EXECUTABLE FLEX_EXECUTABLE)
53 IF(YACC_EXECUTABLE MATCHES "bison")
54 SET(BISON_FLAGS "--yacc")
55 ENDIF(YACC_EXECUTABLE MATCHES "bison")
57 FOREACH(name ${parsersLexers})
58 SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Parser.y")
59 SET(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Parser.cxx")
60 SET(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}ParserTokens.h")
66 --name-prefix=${name}_yy --defines=${hdr} -o${dst} ${src}
68 SET(yacc_files ${yacc_files} "${dst}")
70 ADD_CUSTOM_TARGET(RerunYacc DEPENDS ${yacc_files})
71 ENDIF(YACC_EXECUTABLE)
74 FOREACH(name ${parsersLexers})
75 SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Lexer.in.l")
76 SET(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.cxx")
77 SET(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.h")
83 --prefix=${name}_yy --header-file=${hdr} -o${dst} ${src}
85 SET(lex_files ${lex_files} "${dst}")
87 ADD_CUSTOM_TARGET(RerunLex DEPENDS ${lex_files})
88 ENDIF(FLEX_EXECUTABLE)
90 ENDIF(CMAKE_REGENERATE_YACCLEX)
92 # Check if we can build the ELF parser.
93 IF(CMAKE_USE_ELF_PARSER)
94 SET(ELF_SRCS cmELF.h cmELF.cxx)
95 ENDIF(CMAKE_USE_ELF_PARSER)
98 # Sources for CMakeLib
101 cmBootstrapCommands.cxx
106 cmCommandArgumentLexer.cxx
107 cmCommandArgumentParser.cxx
108 cmCommandArgumentParserHelper.cxx
109 cmComputeComponentGraph.cxx
110 cmComputeComponentGraph.h
111 cmComputeLinkDepends.cxx
112 cmComputeLinkDepends.h
113 cmComputeLinkInformation.cxx
114 cmComputeLinkInformation.h
115 cmComputeTargetDepends.h
116 cmComputeTargetDepends.cxx
127 cmDependsFortranLexer.cxx
128 cmDependsFortranParser.cxx
129 cmDependsFortranParser.h
132 cmDependsJavaLexer.cxx
133 cmDependsJavaParser.cxx
134 cmDependsJavaParserHelper.cxx
135 cmDependsJavaParserHelper.h
137 cmDocumentationFormatter.cxx
138 cmDocumentationFormatterHTML.cxx
139 cmDocumentationFormatterDocbook.cxx
140 cmDocumentationFormatterMan.cxx
141 cmDocumentationFormatterText.cxx
142 cmDocumentationFormatterUsage.cxx
143 cmDocumentationSection.cxx
144 cmDocumentVariables.cxx
150 cmExprParserHelper.cxx
151 cmExportBuildFileGenerator.h
152 cmExportBuildFileGenerator.cxx
153 cmExportFileGenerator.h
154 cmExportFileGenerator.cxx
155 cmExportInstallFileGenerator.h
156 cmExportInstallFileGenerator.cxx
157 cmExtraEclipseCDT4Generator.cxx
158 cmExtraEclipseCDT4Generator.h
159 cmFileTimeComparison.cxx
160 cmFileTimeComparison.h
161 cmGeneratedFileStream.cxx
162 cmGeneratorExpression.cxx
163 cmGeneratorExpression.h
164 cmGlobalGenerator.cxx
166 cmGlobalUnixMakefileGenerator3.cxx
167 cmGlobalUnixMakefileGenerator3.h
168 cmGraphAdjacencyList.h
170 cmInstallGenerator.cxx
171 cmInstallExportGenerator.cxx
172 cmInstallFilesGenerator.h
173 cmInstallFilesGenerator.cxx
174 cmInstallScriptGenerator.h
175 cmInstallScriptGenerator.cxx
176 cmInstallTargetGenerator.h
177 cmInstallTargetGenerator.cxx
178 cmInstallDirectoryGenerator.h
179 cmInstallDirectoryGenerator.cxx
185 cmLocalUnixMakefileGenerator3.cxx
190 cmMakefileTargetGenerator.cxx
191 cmMakefileExecutableTargetGenerator.cxx
192 cmMakefileLibraryTargetGenerator.cxx
193 cmMakefileUtilityTargetGenerator.cxx
194 cmOrderDirectories.cxx
202 cmPropertyDefinition.cxx
203 cmPropertyDefinition.h
204 cmPropertyDefinitionMap.cxx
205 cmPropertyDefinitionMap.h
209 cmScriptGenerator.cxx
212 cmSourceFileLocation.cxx
213 cmSourceFileLocation.h
238 # Kdevelop only works on UNIX and not windows
240 SET(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx)
244 SET(SRCS ${SRCS} cmExtraCodeBlocksGenerator.cxx)
247 # XCode only works on apple
252 cmGlobalXCodeGenerator.cxx
253 cmGlobalXCodeGenerator.h
254 cmLocalXCodeGenerator.cxx
255 cmLocalXCodeGenerator.h)
261 cmCallVisualStudioMacro.cxx
262 cmCallVisualStudioMacro.h
267 cmGlobalBorlandMakefileGenerator.cxx
268 cmGlobalBorlandMakefileGenerator.h
269 cmGlobalMSYSMakefileGenerator.cxx
270 cmGlobalMinGWMakefileGenerator.cxx
271 cmGlobalNMakeMakefileGenerator.cxx
272 cmGlobalNMakeMakefileGenerator.h
273 cmGlobalVisualStudio6Generator.cxx
274 cmGlobalVisualStudio6Generator.h
275 cmGlobalVisualStudio71Generator.cxx
276 cmGlobalVisualStudio71Generator.h
277 cmGlobalVisualStudio7Generator.cxx
278 cmGlobalVisualStudio7Generator.h
279 cmGlobalVisualStudio8Generator.cxx
280 cmGlobalVisualStudio8Generator.h
281 cmGlobalVisualStudio9Generator.cxx
282 cmGlobalVisualStudio9Generator.h
283 cmGlobalVisualStudio8Win64Generator.cxx
284 cmGlobalVisualStudio8Win64Generator.h
285 cmGlobalVisualStudio9Win64Generator.cxx
286 cmGlobalVisualStudio9Win64Generator.h
287 cmVisualStudioGeneratorOptions.h
288 cmVisualStudioGeneratorOptions.cxx
289 cmVisualStudio10TargetGenerator.h
290 cmVisualStudio10TargetGenerator.cxx
291 cmLocalVisualStudio10Generator.cxx
292 cmLocalVisualStudio10Generator.h
293 cmGlobalVisualStudio10Generator.h
294 cmGlobalVisualStudio10Generator.cxx
295 cmGlobalVisualStudioGenerator.cxx
296 cmGlobalVisualStudioGenerator.h
297 cmGlobalWatcomWMakeGenerator.cxx
301 cmLocalVisualStudio6Generator.cxx
302 cmLocalVisualStudio6Generator.h
303 cmLocalVisualStudio7Generator.cxx
304 cmLocalVisualStudio7Generator.h
305 cmLocalVisualStudioGenerator.cxx
306 cmLocalVisualStudioGenerator.h
307 cmWin32ProcessExecution.cxx
308 cmWin32ProcessExecution.h
313 # create a library used by the command line and the GUI
314 ADD_LIBRARY(CMakeLib ${SRCS})
315 TARGET_LINK_LIBRARIES(CMakeLib cmsys
316 ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES}
317 ${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES}
318 ${CMAKE_CURL_LIBRARIES})
320 # On Apple we need Carbon
322 TARGET_LINK_LIBRARIES(CMakeLib "-framework CoreFoundation")
325 # On some platforms we need the rpcrt4 library for the VS 7 generators.
326 IF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
327 TARGET_LINK_LIBRARIES(CMakeLib rpcrt4)
328 ENDIF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
334 "${CMAKE_SOURCE_DIR}/Source/CTest"
335 ${CMAKE_XMLRPC_INCLUDES}
336 ${CMAKE_CURL_INCLUDES}
339 # Sources for CTestLib
341 SET(CTEST_SRCS cmCTest.cxx
343 CTest/cmCTestBatchTestHandler.cxx
344 CTest/cmCTestBuildAndTestHandler.cxx
345 CTest/cmCTestBuildCommand.cxx
346 CTest/cmCTestBuildHandler.cxx
347 CTest/cmCTestConfigureCommand.cxx
348 CTest/cmCTestConfigureHandler.cxx
349 CTest/cmCTestCoverageCommand.cxx
350 CTest/cmCTestCoverageHandler.cxx
351 CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
352 CTest/cmCTestGenericHandler.cxx
353 CTest/cmCTestHandlerCommand.cxx
354 CTest/cmCTestLaunch.cxx
355 CTest/cmCTestMemCheckCommand.cxx
356 CTest/cmCTestMemCheckHandler.cxx
357 CTest/cmCTestMultiProcessHandler.cxx
358 CTest/cmCTestReadCustomFilesCommand.cxx
359 CTest/cmCTestRunScriptCommand.cxx
360 CTest/cmCTestRunTest.cxx
361 CTest/cmCTestScriptHandler.cxx
362 CTest/cmCTestSleepCommand.cxx
363 CTest/cmCTestStartCommand.cxx
364 CTest/cmCTestSubmitCommand.cxx
365 CTest/cmCTestSubmitHandler.cxx
366 CTest/cmCTestTestCommand.cxx
367 CTest/cmCTestTestHandler.cxx
368 CTest/cmCTestUpdateCommand.cxx
369 CTest/cmCTestUpdateHandler.cxx
373 CTest/cmCTestGlobalVC.cxx
374 CTest/cmCTestGlobalVC.h
388 ADD_LIBRARY(CTestLib ${CTEST_SRCS})
389 TARGET_LINK_LIBRARIES(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES})
395 CPack/cmCPackComponentGroup.cxx
396 CPack/cmCPackGeneratorFactory.cxx
397 CPack/cmCPackGenerator.cxx
399 CPack/cmCPackNSISGenerator.cxx
400 CPack/cmCPackSTGZGenerator.cxx
401 CPack/cmCPackTGZGenerator.cxx
402 CPack/cmCPackTarBZip2Generator.cxx
403 CPack/cmCPackTarCompressGenerator.cxx
404 CPack/cmCPackZIPGenerator.cxx
408 SET(CPACK_SRCS ${CPACK_SRCS}
409 CPack/cmCPackCygwinBinaryGenerator.cxx
410 CPack/cmCPackCygwinSourceGenerator.cxx
412 ENDIF(WIN32 AND UNIX)
415 SET(CPACK_SRCS ${CPACK_SRCS}
416 CPack/cmCPackDebGenerator.cxx
417 CPack/cmCPackRPMGenerator.cxx
422 SET(CPACK_SRCS ${CPACK_SRCS}
423 CPack/cmCPackBundleGenerator.cxx
424 CPack/cmCPackDragNDropGenerator.cxx
425 CPack/cmCPackOSXX11Generator.cxx
426 CPack/cmCPackPackageMakerGenerator.cxx
431 ADD_LIBRARY(CPackLib ${CPACK_SRCS})
432 TARGET_LINK_LIBRARIES(CPackLib CMakeLib)
435 ADD_EXECUTABLE(cmakexbuild cmakexbuild.cxx)
436 TARGET_LINK_LIBRARIES(cmakexbuild CMakeLib)
437 ADD_EXECUTABLE(OSXScriptLauncher
438 CPack/OSXScriptLauncher.cxx)
439 TARGET_LINK_LIBRARIES(OSXScriptLauncher cmsys)
440 TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework Carbon")
443 # Build CMake executable
444 ADD_EXECUTABLE(cmake cmakemain.cxx)
445 TARGET_LINK_LIBRARIES(cmake CMakeLib)
446 ADD_EXECUTABLE(DumpDocumentation cmDumpDocumentation)
447 TARGET_LINK_LIBRARIES(DumpDocumentation CMakeLib)
449 # Build special executable for running programs on Windows 98
452 ADD_EXECUTABLE(cmw9xcom cmw9xcom.cxx)
453 TARGET_LINK_LIBRARIES(cmw9xcom CMakeLib)
454 INSTALL_TARGETS(/bin cmw9xcom)
458 # Build CTest executable
459 ADD_EXECUTABLE(ctest ctest.cxx)
460 TARGET_LINK_LIBRARIES(ctest CTestLib)
462 # Build CPack executable
463 ADD_EXECUTABLE(cpack CPack/cpack.cxx)
464 TARGET_LINK_LIBRARIES(cpack CPackLib)
467 IF(BUILD_CursesDialog)
468 INCLUDE(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt)
469 ENDIF(BUILD_CursesDialog)
472 OPTION(BUILD_QtDialog "Build Qt dialog for CMake" FALSE)
475 ENDIF(BUILD_QtDialog)
477 INCLUDE (${CMAKE_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
478 INCLUDE (${CMAKE_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
480 INSTALL_TARGETS(/bin cmake)
481 INSTALL_TARGETS(/bin ctest)
482 INSTALL_TARGETS(/bin cpack)
484 INSTALL_TARGETS(/bin cmakexbuild)
487 INSTALL_FILES(${CMAKE_DATA_DIR}/include cmCPluginAPI.h)