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
358 CTest/cmCTestGlobalVC.cxx
359 CTest/cmCTestGlobalVC.h
371 ADD_LIBRARY(CTestLib ${CTEST_SRCS})
372 TARGET_LINK_LIBRARIES(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES})
378 CPack/cmCPackComponentGroup.cxx
379 CPack/cmCPackGeneratorFactory.cxx
380 CPack/cmCPackGenerator.cxx
382 CPack/cmCPackNSISGenerator.cxx
383 CPack/cmCPackSTGZGenerator.cxx
384 CPack/cmCPackTGZGenerator.cxx
385 CPack/cmCPackTarBZip2Generator.cxx
386 CPack/cmCPackTarCompressGenerator.cxx
387 CPack/cmCPackZIPGenerator.cxx
391 SET(CPACK_SRCS ${CPACK_SRCS}
392 CPack/cmCPackCygwinBinaryGenerator.cxx
393 CPack/cmCPackCygwinSourceGenerator.cxx
395 ENDIF(WIN32 AND UNIX)
398 SET(CPACK_SRCS ${CPACK_SRCS}
399 CPack/cmCPackDebGenerator.cxx
400 CPack/cmCPackRPMGenerator.cxx
405 SET(CPACK_SRCS ${CPACK_SRCS}
406 CPack/cmCPackBundleGenerator.cxx
407 CPack/cmCPackDragNDropGenerator.cxx
408 CPack/cmCPackOSXX11Generator.cxx
409 CPack/cmCPackPackageMakerGenerator.cxx
414 ADD_LIBRARY(CPackLib ${CPACK_SRCS})
415 TARGET_LINK_LIBRARIES(CPackLib CMakeLib)
418 ADD_EXECUTABLE(cmakexbuild cmakexbuild.cxx)
419 TARGET_LINK_LIBRARIES(cmakexbuild CMakeLib)
420 ADD_EXECUTABLE(OSXScriptLauncher
421 CPack/OSXScriptLauncher.cxx)
422 TARGET_LINK_LIBRARIES(OSXScriptLauncher cmsys)
423 TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework Carbon")
426 # Build CMake executable
427 ADD_EXECUTABLE(cmake cmakemain.cxx)
428 TARGET_LINK_LIBRARIES(cmake CMakeLib)
429 ADD_EXECUTABLE(DumpDocumentation cmDumpDocumentation)
430 TARGET_LINK_LIBRARIES(DumpDocumentation CMakeLib)
432 # Build special executable for running programs on Windows 98
435 ADD_EXECUTABLE(cmw9xcom cmw9xcom.cxx)
436 TARGET_LINK_LIBRARIES(cmw9xcom CMakeLib)
437 INSTALL_TARGETS(/bin cmw9xcom)
441 # Build CTest executable
442 ADD_EXECUTABLE(ctest ctest.cxx)
443 TARGET_LINK_LIBRARIES(ctest CTestLib)
445 # Build CPack executable
446 ADD_EXECUTABLE(cpack CPack/cpack.cxx)
447 TARGET_LINK_LIBRARIES(cpack CPackLib)
450 IF(BUILD_CursesDialog)
451 INCLUDE(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt)
452 ENDIF(BUILD_CursesDialog)
455 # MFC libraries are only available on Visual Studio
458 ENDIF(BUILD_MFCDialog)
461 OPTION(BUILD_QtDialog "Build Qt dialog for CMake" FALSE)
464 ENDIF(BUILD_QtDialog)
467 OPTION(BUILD_WXDialog "Build wxWidgets dialog for CMake" FALSE)
468 MARK_AS_ADVANCED(BUILD_WXDialog)
471 ENDIF(BUILD_WXDialog)
473 # FLTK GUI, needs some work: generator selection, paths with spaces, ...
474 # OPTION(BUILD_FLTKDialog "Build FLTK dialog for CMake" FALSE)
475 # MARK_AS_ADVANCED(BUILD_FLTKDialog)
476 # IF(BUILD_FLTKDialog)
477 # SUBDIRS(FLTKDialog)
478 # ENDIF(BUILD_FLTKDialog)
480 INCLUDE (${CMAKE_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
481 INCLUDE (${CMAKE_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
483 INSTALL_TARGETS(/bin cmake)
484 INSTALL_TARGETS(/bin ctest)
485 INSTALL_TARGETS(/bin cpack)
487 INSTALL_TARGETS(/bin cmakexbuild)
490 INSTALL_FILES(${CMAKE_DATA_DIR}/include cmCPluginAPI.h)