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/CPack/cmCPackConfigure.h.in"
17 "${CMake_BINARY_DIR}/Source/CPack/cmCPackConfigure.h"
20 # add the include path to find the .h
22 "${CMake_BINARY_DIR}/Source"
23 "${CMake_SOURCE_DIR}/Source"
24 ${CMAKE_ZLIB_INCLUDES}
25 ${CMAKE_EXPAT_INCLUDES}
27 ${CMAKE_COMPRESS_INCLUDES}
30 # let cmake know it is supposed to use it
31 ADD_DEFINITIONS(-DCMAKE_BUILD_WITH_CMAKE)
33 OPTION(CMAKE_REGENERATE_YACCLEX
34 "Regenerate YACC and LEXX files" OFF)
35 MARK_AS_ADVANCED(CMAKE_REGENERATE_YACCLEX)
36 IF(CMAKE_REGENERATE_YACCLEX)
37 SET(parsersLexers cmDependsFortran cmCommandArgument cmExpr)
38 FIND_PROGRAM(YACC_EXECUTABLE
41 DOC "Yacc or Bison executable")
42 FIND_PROGRAM(FLEX_EXECUTABLE
45 DOC "Flex executable")
46 MARK_AS_ADVANCED(YACC_EXECUTABLE FLEX_EXECUTABLE)
49 IF(YACC_EXECUTABLE MATCHES "bison")
50 SET(BISON_FLAGS "--yacc")
51 ENDIF(YACC_EXECUTABLE MATCHES "bison")
53 FOREACH(name ${parsersLexers})
54 SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Parser.y")
55 SET(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Parser.cxx")
56 SET(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}ParserTokens.h")
62 --name-prefix=${name}_yy --defines=${hdr} -o${dst} ${src}
64 SET(yacc_files ${yacc_files} "${dst}")
66 ADD_CUSTOM_TARGET(RerunYacc DEPENDS ${yacc_files})
67 ENDIF(YACC_EXECUTABLE)
70 FOREACH(name ${parsersLexers})
71 SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Lexer.in.l")
72 SET(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.cxx")
73 SET(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.h")
79 --prefix=${name}_yy --header-file=${hdr} -o${dst} ${src}
81 SET(lex_files ${lex_files} "${dst}")
83 ADD_CUSTOM_TARGET(RerunLex DEPENDS ${lex_files})
84 ENDIF(FLEX_EXECUTABLE)
86 ENDIF(CMAKE_REGENERATE_YACCLEX)
88 # Check if we can build the ELF parser.
89 IF(CMAKE_USE_ELF_PARSER)
90 SET(ELF_SRCS cmELF.h cmELF.cxx)
91 ENDIF(CMAKE_USE_ELF_PARSER)
94 # Sources for CMakeLib
97 cmBootstrapCommands.cxx
102 cmCommandArgumentLexer.cxx
103 cmCommandArgumentParser.cxx
104 cmCommandArgumentParserHelper.cxx
105 cmComputeComponentGraph.cxx
106 cmComputeComponentGraph.h
107 cmComputeLinkDepends.cxx
108 cmComputeLinkDepends.h
109 cmComputeLinkInformation.cxx
110 cmComputeLinkInformation.h
111 cmComputeTargetDepends.h
112 cmComputeTargetDepends.cxx
121 cmDependsFortranLexer.cxx
122 cmDependsFortranParser.cxx
123 cmDependsFortranParser.h
126 cmDependsJavaLexer.cxx
127 cmDependsJavaParser.cxx
128 cmDependsJavaParserHelper.cxx
129 cmDependsJavaParserHelper.h
131 cmDocumentationFormatter.cxx
132 cmDocumentationFormatterHTML.cxx
133 cmDocumentationFormatterDocbook.cxx
134 cmDocumentationFormatterMan.cxx
135 cmDocumentationFormatterText.cxx
136 cmDocumentationFormatterUsage.cxx
137 cmDocumentationSection.cxx
138 cmDocumentVariables.cxx
144 cmExprParserHelper.cxx
145 cmExportBuildFileGenerator.h
146 cmExportBuildFileGenerator.cxx
147 cmExportFileGenerator.h
148 cmExportFileGenerator.cxx
149 cmExportInstallFileGenerator.h
150 cmExportInstallFileGenerator.cxx
151 cmExtraEclipseCDT4Generator.cxx
152 cmExtraEclipseCDT4Generator.h
153 cmFileTimeComparison.cxx
154 cmFileTimeComparison.h
155 cmGeneratedFileStream.cxx
156 cmGlobalGenerator.cxx
158 cmGlobalUnixMakefileGenerator3.cxx
159 cmGlobalUnixMakefileGenerator3.h
160 cmGraphAdjacencyList.h
162 cmInstallGenerator.cxx
163 cmInstallExportGenerator.cxx
164 cmInstallFilesGenerator.h
165 cmInstallFilesGenerator.cxx
166 cmInstallScriptGenerator.h
167 cmInstallScriptGenerator.cxx
168 cmInstallTargetGenerator.h
169 cmInstallTargetGenerator.cxx
170 cmInstallDirectoryGenerator.h
171 cmInstallDirectoryGenerator.cxx
177 cmLocalUnixMakefileGenerator3.cxx
182 cmMakefileTargetGenerator.cxx
183 cmMakefileExecutableTargetGenerator.cxx
184 cmMakefileLibraryTargetGenerator.cxx
185 cmMakefileUtilityTargetGenerator.cxx
186 cmOrderDirectories.cxx
192 cmPropertyDefinition.cxx
193 cmPropertyDefinition.h
194 cmPropertyDefinitionMap.cxx
195 cmPropertyDefinitionMap.h
200 cmSourceFileLocation.cxx
201 cmSourceFileLocation.h
222 # Kdevelop only works on UNIX and not windows
224 SET(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx)
228 SET(SRCS ${SRCS} cmExtraCodeBlocksGenerator.cxx)
231 # XCode only works on apple
236 cmGlobalXCodeGenerator.cxx
237 cmGlobalXCodeGenerator.h
238 cmGlobalXCode21Generator.cxx
239 cmGlobalXCode21Generator.h
240 cmLocalXCodeGenerator.cxx
241 cmLocalXCodeGenerator.h)
247 cmCallVisualStudioMacro.cxx
248 cmCallVisualStudioMacro.h
253 cmGlobalBorlandMakefileGenerator.cxx
254 cmGlobalBorlandMakefileGenerator.h
255 cmGlobalMSYSMakefileGenerator.cxx
256 cmGlobalMinGWMakefileGenerator.cxx
257 cmGlobalNMakeMakefileGenerator.cxx
258 cmGlobalNMakeMakefileGenerator.h
259 cmGlobalVisualStudio6Generator.cxx
260 cmGlobalVisualStudio6Generator.h
261 cmGlobalVisualStudio71Generator.cxx
262 cmGlobalVisualStudio71Generator.h
263 cmGlobalVisualStudio7Generator.cxx
264 cmGlobalVisualStudio7Generator.h
265 cmGlobalVisualStudio8Generator.cxx
266 cmGlobalVisualStudio8Generator.h
267 cmGlobalVisualStudio9Generator.cxx
268 cmGlobalVisualStudio9Generator.h
269 cmGlobalVisualStudio8Win64Generator.cxx
270 cmGlobalVisualStudio8Win64Generator.h
271 cmGlobalVisualStudio9Win64Generator.cxx
272 cmGlobalVisualStudio9Win64Generator.h
273 cmGlobalVisualStudioGenerator.cxx
274 cmGlobalVisualStudioGenerator.h
275 cmGlobalWatcomWMakeGenerator.cxx
276 cmLocalVisualStudio6Generator.cxx
277 cmLocalVisualStudio6Generator.h
278 cmLocalVisualStudio7Generator.cxx
279 cmLocalVisualStudio7Generator.h
280 cmLocalVisualStudioGenerator.cxx
281 cmLocalVisualStudioGenerator.h
282 cmWin32ProcessExecution.cxx
283 cmWin32ProcessExecution.h
288 # create a library used by the command line and the GUI
289 ADD_LIBRARY(CMakeLib ${SRCS})
290 TARGET_LINK_LIBRARIES(CMakeLib cmsys
291 ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES}
292 ${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES}
293 ${CMAKE_CURL_LIBRARIES})
295 # On Apple we need Carbon
297 TARGET_LINK_LIBRARIES(CMakeLib "-framework CoreFoundation")
300 # On some platforms we need the rpcrt4 library for the VS 7 generators.
301 IF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
302 TARGET_LINK_LIBRARIES(CMakeLib rpcrt4)
303 ENDIF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
309 "${CMAKE_SOURCE_DIR}/Source/CTest"
310 ${CMAKE_XMLRPC_INCLUDES}
311 ${CMAKE_CURL_INCLUDES}
314 # Sources for CTestLib
316 SET(CTEST_SRCS cmCTest.cxx
318 CTest/cmCTestBuildAndTestHandler.cxx
319 CTest/cmCTestBuildCommand.cxx
320 CTest/cmCTestBuildHandler.cxx
321 CTest/cmCTestConfigureCommand.cxx
322 CTest/cmCTestConfigureHandler.cxx
323 CTest/cmCTestCoverageCommand.cxx
324 CTest/cmCTestCoverageHandler.cxx
325 CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
326 CTest/cmCTestGenericHandler.cxx
327 CTest/cmCTestHandlerCommand.cxx
328 CTest/cmCTestMemCheckCommand.cxx
329 CTest/cmCTestMemCheckHandler.cxx
330 CTest/cmCTestMultiProcessHandler.cxx
331 CTest/cmCTestReadCustomFilesCommand.cxx
332 CTest/cmCTestRunScriptCommand.cxx
333 CTest/cmCTestScriptHandler.cxx
334 CTest/cmCTestSleepCommand.cxx
335 CTest/cmCTestStartCommand.cxx
336 CTest/cmCTestSubmitCommand.cxx
337 CTest/cmCTestSubmitHandler.cxx
338 CTest/cmCTestTestCommand.cxx
339 CTest/cmCTestTestHandler.cxx
340 CTest/cmCTestUpdateCommand.cxx
341 CTest/cmCTestUpdateHandler.cxx
345 ADD_LIBRARY(CTestLib ${CTEST_SRCS})
346 TARGET_LINK_LIBRARIES(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES})
352 CPack/cmCPackComponentGroup.cxx
353 CPack/cmCPackGeneratorFactory.cxx
354 CPack/cmCPackGenerator.cxx
356 CPack/cmCPackNSISGenerator.cxx
357 CPack/cmCPackSTGZGenerator.cxx
358 CPack/cmCPackTGZGenerator.cxx
359 CPack/cmCPackTarBZip2Generator.cxx
360 CPack/cmCPackTarCompressGenerator.cxx
361 CPack/cmCPackZIPGenerator.cxx
365 SET(CPACK_SRCS ${CPACK_SRCS}
366 CPack/cmCPackCygwinBinaryGenerator.cxx
367 CPack/cmCPackCygwinSourceGenerator.cxx
369 ENDIF(WIN32 AND UNIX)
372 SET(CPACK_SRCS ${CPACK_SRCS}
373 CPack/cmCPackDebGenerator.cxx
374 CPack/cmCPackRPMGenerator.cxx
379 SET(CPACK_SRCS ${CPACK_SRCS}
380 CPack/cmCPackBundleGenerator.cxx
381 CPack/cmCPackOSXX11Generator.cxx
382 CPack/cmCPackPackageMakerGenerator.cxx
387 ADD_LIBRARY(CPackLib ${CPACK_SRCS})
388 TARGET_LINK_LIBRARIES(CPackLib CMakeLib)
391 ADD_EXECUTABLE(cmakexbuild cmakexbuild.cxx)
392 TARGET_LINK_LIBRARIES(cmakexbuild CMakeLib)
393 ADD_EXECUTABLE(OSXScriptLauncher
394 CPack/OSXScriptLauncher.cxx)
395 TARGET_LINK_LIBRARIES(OSXScriptLauncher cmsys)
396 TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework Carbon")
399 # Build CMake executable
400 ADD_EXECUTABLE(cmake cmakemain.cxx)
401 TARGET_LINK_LIBRARIES(cmake CMakeLib)
402 ADD_EXECUTABLE(DumpDocumentation cmDumpDocumentation)
403 TARGET_LINK_LIBRARIES(DumpDocumentation CMakeLib)
405 # Build special executable for running programs on Windows 98
408 ADD_EXECUTABLE(cmw9xcom cmw9xcom.cxx)
409 TARGET_LINK_LIBRARIES(cmw9xcom CMakeLib)
410 INSTALL_TARGETS(/bin cmw9xcom)
414 # Build CTest executable
415 ADD_EXECUTABLE(ctest ctest.cxx)
416 TARGET_LINK_LIBRARIES(ctest CTestLib)
418 # Build CPack executable
419 ADD_EXECUTABLE(cpack CPack/cpack.cxx)
420 TARGET_LINK_LIBRARIES(cpack CPackLib)
423 IF(BUILD_CursesDialog)
424 INCLUDE(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt)
425 ENDIF(BUILD_CursesDialog)
428 # MFC libraries are only available on Visual Studio
431 ENDIF(BUILD_MFCDialog)
434 OPTION(BUILD_QtDialog "Build Qt dialog for CMake" FALSE)
437 ENDIF(BUILD_QtDialog)
440 OPTION(BUILD_WXDialog "Build wxWidgets dialog for CMake" FALSE)
441 MARK_AS_ADVANCED(BUILD_WXDialog)
444 ENDIF(BUILD_WXDialog)
446 # FLTK GUI, needs some work: generator selection, paths with spaces, ...
447 # OPTION(BUILD_FLTKDialog "Build FLTK dialog for CMake" FALSE)
448 # MARK_AS_ADVANCED(BUILD_FLTKDialog)
449 # IF(BUILD_FLTKDialog)
450 # SUBDIRS(FLTKDialog)
451 # ENDIF(BUILD_FLTKDialog)
453 INCLUDE (${CMAKE_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
454 INCLUDE (${CMAKE_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
456 INSTALL_TARGETS(/bin cmake)
457 INSTALL_TARGETS(/bin ctest)
458 INSTALL_TARGETS(/bin cpack)
460 INSTALL_TARGETS(/bin cmakexbuild)
463 INSTALL_FILES(${CMAKE_DATA_DIR}/include cmCPluginAPI.h)