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
125 cmDependsFortranLexer.cxx
126 cmDependsFortranParser.cxx
127 cmDependsFortranParser.h
130 cmDependsJavaLexer.cxx
131 cmDependsJavaParser.cxx
132 cmDependsJavaParserHelper.cxx
133 cmDependsJavaParserHelper.h
135 cmDocumentationFormatter.cxx
136 cmDocumentationFormatterHTML.cxx
137 cmDocumentationFormatterDocbook.cxx
138 cmDocumentationFormatterMan.cxx
139 cmDocumentationFormatterText.cxx
140 cmDocumentationFormatterUsage.cxx
141 cmDocumentationSection.cxx
142 cmDocumentVariables.cxx
148 cmExprParserHelper.cxx
149 cmExportBuildFileGenerator.h
150 cmExportBuildFileGenerator.cxx
151 cmExportFileGenerator.h
152 cmExportFileGenerator.cxx
153 cmExportInstallFileGenerator.h
154 cmExportInstallFileGenerator.cxx
155 cmExtraEclipseCDT4Generator.cxx
156 cmExtraEclipseCDT4Generator.h
157 cmFileTimeComparison.cxx
158 cmFileTimeComparison.h
159 cmGeneratedFileStream.cxx
160 cmGlobalGenerator.cxx
162 cmGlobalUnixMakefileGenerator3.cxx
163 cmGlobalUnixMakefileGenerator3.h
164 cmGraphAdjacencyList.h
166 cmInstallGenerator.cxx
167 cmInstallExportGenerator.cxx
168 cmInstallFilesGenerator.h
169 cmInstallFilesGenerator.cxx
170 cmInstallScriptGenerator.h
171 cmInstallScriptGenerator.cxx
172 cmInstallTargetGenerator.h
173 cmInstallTargetGenerator.cxx
174 cmInstallDirectoryGenerator.h
175 cmInstallDirectoryGenerator.cxx
181 cmLocalUnixMakefileGenerator3.cxx
186 cmMakefileTargetGenerator.cxx
187 cmMakefileExecutableTargetGenerator.cxx
188 cmMakefileLibraryTargetGenerator.cxx
189 cmMakefileUtilityTargetGenerator.cxx
190 cmOrderDirectories.cxx
198 cmPropertyDefinition.cxx
199 cmPropertyDefinition.h
200 cmPropertyDefinitionMap.cxx
201 cmPropertyDefinitionMap.h
205 cmScriptGenerator.cxx
208 cmSourceFileLocation.cxx
209 cmSourceFileLocation.h
234 # Kdevelop only works on UNIX and not windows
236 SET(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx)
240 SET(SRCS ${SRCS} cmExtraCodeBlocksGenerator.cxx)
243 # XCode only works on apple
248 cmGlobalXCodeGenerator.cxx
249 cmGlobalXCodeGenerator.h
250 cmGlobalXCode21Generator.cxx
251 cmGlobalXCode21Generator.h
252 cmLocalXCodeGenerator.cxx
253 cmLocalXCodeGenerator.h)
259 cmCallVisualStudioMacro.cxx
260 cmCallVisualStudioMacro.h
265 cmGlobalBorlandMakefileGenerator.cxx
266 cmGlobalBorlandMakefileGenerator.h
267 cmGlobalMSYSMakefileGenerator.cxx
268 cmGlobalMinGWMakefileGenerator.cxx
269 cmGlobalNMakeMakefileGenerator.cxx
270 cmGlobalNMakeMakefileGenerator.h
271 cmGlobalVisualStudio6Generator.cxx
272 cmGlobalVisualStudio6Generator.h
273 cmGlobalVisualStudio71Generator.cxx
274 cmGlobalVisualStudio71Generator.h
275 cmGlobalVisualStudio7Generator.cxx
276 cmGlobalVisualStudio7Generator.h
277 cmGlobalVisualStudio8Generator.cxx
278 cmGlobalVisualStudio8Generator.h
279 cmGlobalVisualStudio9Generator.cxx
280 cmGlobalVisualStudio9Generator.h
281 cmGlobalVisualStudio8Win64Generator.cxx
282 cmGlobalVisualStudio8Win64Generator.h
283 cmGlobalVisualStudio9Win64Generator.cxx
284 cmGlobalVisualStudio9Win64Generator.h
285 cmGlobalVisualStudioGenerator.cxx
286 cmGlobalVisualStudioGenerator.h
287 cmGlobalWatcomWMakeGenerator.cxx
288 cmLocalVisualStudio6Generator.cxx
289 cmLocalVisualStudio6Generator.h
290 cmLocalVisualStudio7Generator.cxx
291 cmLocalVisualStudio7Generator.h
292 cmLocalVisualStudioGenerator.cxx
293 cmLocalVisualStudioGenerator.h
294 cmWin32ProcessExecution.cxx
295 cmWin32ProcessExecution.h
300 # create a library used by the command line and the GUI
301 ADD_LIBRARY(CMakeLib ${SRCS})
302 TARGET_LINK_LIBRARIES(CMakeLib cmsys
303 ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES}
304 ${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES}
305 ${CMAKE_CURL_LIBRARIES})
307 # On Apple we need Carbon
309 TARGET_LINK_LIBRARIES(CMakeLib "-framework CoreFoundation")
312 # On some platforms we need the rpcrt4 library for the VS 7 generators.
313 IF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
314 TARGET_LINK_LIBRARIES(CMakeLib rpcrt4)
315 ENDIF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
321 "${CMAKE_SOURCE_DIR}/Source/CTest"
322 ${CMAKE_XMLRPC_INCLUDES}
323 ${CMAKE_CURL_INCLUDES}
326 # Sources for CTestLib
328 SET(CTEST_SRCS cmCTest.cxx
330 CTest/cmCTestBuildAndTestHandler.cxx
331 CTest/cmCTestBuildCommand.cxx
332 CTest/cmCTestBuildHandler.cxx
333 CTest/cmCTestConfigureCommand.cxx
334 CTest/cmCTestConfigureHandler.cxx
335 CTest/cmCTestCoverageCommand.cxx
336 CTest/cmCTestCoverageHandler.cxx
337 CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
338 CTest/cmCTestGenericHandler.cxx
339 CTest/cmCTestHandlerCommand.cxx
340 CTest/cmCTestLaunch.cxx
341 CTest/cmCTestMemCheckCommand.cxx
342 CTest/cmCTestMemCheckHandler.cxx
343 CTest/cmCTestMultiProcessHandler.cxx
344 CTest/cmCTestReadCustomFilesCommand.cxx
345 CTest/cmCTestRunScriptCommand.cxx
346 CTest/cmCTestScriptHandler.cxx
347 CTest/cmCTestSleepCommand.cxx
348 CTest/cmCTestStartCommand.cxx
349 CTest/cmCTestSubmitCommand.cxx
350 CTest/cmCTestSubmitHandler.cxx
351 CTest/cmCTestTestCommand.cxx
352 CTest/cmCTestTestHandler.cxx
353 CTest/cmCTestUpdateCommand.cxx
354 CTest/cmCTestUpdateHandler.cxx
365 ADD_LIBRARY(CTestLib ${CTEST_SRCS})
366 TARGET_LINK_LIBRARIES(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES})
372 CPack/cmCPackComponentGroup.cxx
373 CPack/cmCPackGeneratorFactory.cxx
374 CPack/cmCPackGenerator.cxx
376 CPack/cmCPackNSISGenerator.cxx
377 CPack/cmCPackSTGZGenerator.cxx
378 CPack/cmCPackTGZGenerator.cxx
379 CPack/cmCPackTarBZip2Generator.cxx
380 CPack/cmCPackTarCompressGenerator.cxx
381 CPack/cmCPackZIPGenerator.cxx
385 SET(CPACK_SRCS ${CPACK_SRCS}
386 CPack/cmCPackCygwinBinaryGenerator.cxx
387 CPack/cmCPackCygwinSourceGenerator.cxx
389 ENDIF(WIN32 AND UNIX)
392 SET(CPACK_SRCS ${CPACK_SRCS}
393 CPack/cmCPackDebGenerator.cxx
394 CPack/cmCPackRPMGenerator.cxx
399 SET(CPACK_SRCS ${CPACK_SRCS}
400 CPack/cmCPackBundleGenerator.cxx
401 CPack/cmCPackDragNDropGenerator.cxx
402 CPack/cmCPackOSXX11Generator.cxx
403 CPack/cmCPackPackageMakerGenerator.cxx
408 ADD_LIBRARY(CPackLib ${CPACK_SRCS})
409 TARGET_LINK_LIBRARIES(CPackLib CMakeLib)
412 ADD_EXECUTABLE(cmakexbuild cmakexbuild.cxx)
413 TARGET_LINK_LIBRARIES(cmakexbuild CMakeLib)
414 ADD_EXECUTABLE(OSXScriptLauncher
415 CPack/OSXScriptLauncher.cxx)
416 TARGET_LINK_LIBRARIES(OSXScriptLauncher cmsys)
417 TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework Carbon")
420 # Build CMake executable
421 ADD_EXECUTABLE(cmake cmakemain.cxx)
422 TARGET_LINK_LIBRARIES(cmake CMakeLib)
423 ADD_EXECUTABLE(DumpDocumentation cmDumpDocumentation)
424 TARGET_LINK_LIBRARIES(DumpDocumentation CMakeLib)
426 # Build special executable for running programs on Windows 98
429 ADD_EXECUTABLE(cmw9xcom cmw9xcom.cxx)
430 TARGET_LINK_LIBRARIES(cmw9xcom CMakeLib)
431 INSTALL_TARGETS(/bin cmw9xcom)
435 # Build CTest executable
436 ADD_EXECUTABLE(ctest ctest.cxx)
437 TARGET_LINK_LIBRARIES(ctest CTestLib)
439 # Build CPack executable
440 ADD_EXECUTABLE(cpack CPack/cpack.cxx)
441 TARGET_LINK_LIBRARIES(cpack CPackLib)
444 IF(BUILD_CursesDialog)
445 INCLUDE(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt)
446 ENDIF(BUILD_CursesDialog)
449 # MFC libraries are only available on Visual Studio
452 ENDIF(BUILD_MFCDialog)
455 OPTION(BUILD_QtDialog "Build Qt dialog for CMake" FALSE)
458 ENDIF(BUILD_QtDialog)
461 OPTION(BUILD_WXDialog "Build wxWidgets dialog for CMake" FALSE)
462 MARK_AS_ADVANCED(BUILD_WXDialog)
465 ENDIF(BUILD_WXDialog)
467 # FLTK GUI, needs some work: generator selection, paths with spaces, ...
468 # OPTION(BUILD_FLTKDialog "Build FLTK dialog for CMake" FALSE)
469 # MARK_AS_ADVANCED(BUILD_FLTKDialog)
470 # IF(BUILD_FLTKDialog)
471 # SUBDIRS(FLTKDialog)
472 # ENDIF(BUILD_FLTKDialog)
474 INCLUDE (${CMAKE_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
475 INCLUDE (${CMAKE_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
477 INSTALL_TARGETS(/bin cmake)
478 INSTALL_TARGETS(/bin ctest)
479 INSTALL_TARGETS(/bin cpack)
481 INSTALL_TARGETS(/bin cmakexbuild)
484 INSTALL_FILES(${CMAKE_DATA_DIR}/include cmCPluginAPI.h)