summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitattributes6
-rw-r--r--CMakeLists.txt46
-rw-r--r--ChangeLog.manual2
-rw-r--r--Docs/cmake-completion190
-rw-r--r--Modules/AddFileDependencies.cmake2
-rw-r--r--Modules/BundleUtilities.cmake294
-rw-r--r--Modules/CMake.cmake2
-rw-r--r--Modules/CMakeASM-ATTInformation.cmake2
-rw-r--r--Modules/CMakeASMInformation.cmake23
-rw-r--r--Modules/CMakeASM_MASMInformation.cmake2
-rw-r--r--Modules/CMakeBackwardCompatibilityC.cmake2
-rw-r--r--Modules/CMakeBackwardCompatibilityCXX.cmake2
-rw-r--r--Modules/CMakeBorlandFindMake.cmake2
-rw-r--r--Modules/CMakeCInformation.cmake4
-rw-r--r--Modules/CMakeCXXCompiler.cmake.in4
-rw-r--r--Modules/CMakeCXXInformation.cmake4
-rw-r--r--Modules/CMakeCommonLanguageInclude.cmake2
-rw-r--r--Modules/CMakeDependentOption.cmake2
-rw-r--r--Modules/CMakeDetermineASM-ATTCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake31
-rw-r--r--Modules/CMakeDetermineASM_MASMCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake2
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake30
-rw-r--r--Modules/CMakeDetermineFortranCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineJavaCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineRCCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineSystem.cmake8
-rw-r--r--Modules/CMakeDetermineVSServicePack.cmake8
-rw-r--r--Modules/CMakeExportBuildSettings.cmake2
-rw-r--r--Modules/CMakeFindBinUtils.cmake2
-rw-r--r--Modules/CMakeFindCodeBlocks.cmake2
-rw-r--r--Modules/CMakeFindEclipseCDT4.cmake57
-rw-r--r--Modules/CMakeFindFrameworks.cmake2
-rw-r--r--Modules/CMakeFindKDevelop3.cmake2
-rw-r--r--Modules/CMakeFindWMake.cmake2
-rw-r--r--Modules/CMakeFindXCode.cmake2
-rw-r--r--Modules/CMakeForceCompiler.cmake2
-rw-r--r--Modules/CMakeFortranInformation.cmake4
-rw-r--r--Modules/CMakeGenericSystem.cmake104
-rw-r--r--Modules/CMakeImportBuildSettings.cmake2
-rw-r--r--Modules/CMakeJOMFindMake.cmake2
-rw-r--r--Modules/CMakeJavaInformation.cmake2
-rw-r--r--Modules/CMakeMSYSFindMake.cmake2
-rw-r--r--Modules/CMakeMinGWFindMake.cmake2
-rw-r--r--Modules/CMakeNMakeFindMake.cmake2
-rw-r--r--Modules/CMakeParseArguments.cmake138
-rw-r--r--Modules/CMakeParseImplicitLinkInfo.cmake2
-rw-r--r--Modules/CMakePrintSystemInformation.cmake2
-rw-r--r--Modules/CMakeRCInformation.cmake2
-rw-r--r--Modules/CMakeSystemSpecificInformation.cmake2
-rw-r--r--Modules/CMakeTestASM-ATTCompiler.cmake2
-rw-r--r--Modules/CMakeTestASMCompiler.cmake2
-rw-r--r--Modules/CMakeTestASM_MASMCompiler.cmake2
-rw-r--r--Modules/CMakeTestCCompiler.cmake2
-rw-r--r--Modules/CMakeTestCXXCompiler.cmake2
-rw-r--r--Modules/CMakeTestCompilerCommon.cmake2
-rw-r--r--Modules/CMakeTestFortranCompiler.cmake2
-rw-r--r--Modules/CMakeTestJavaCompiler.cmake2
-rw-r--r--Modules/CMakeTestRCCompiler.cmake2
-rw-r--r--Modules/CMakeUnixFindMake.cmake2
-rw-r--r--Modules/CMakeVS10FindMake.cmake2
-rw-r--r--Modules/CMakeVS6BackwardCompatibility.cmake2
-rw-r--r--Modules/CMakeVS6FindMake.cmake3
-rw-r--r--Modules/CMakeVS71FindMake.cmake3
-rw-r--r--Modules/CMakeVS7BackwardCompatibility.cmake2
-rw-r--r--Modules/CMakeVS7FindMake.cmake3
-rw-r--r--Modules/CMakeVS8FindMake.cmake2
-rw-r--r--Modules/CMakeVS9FindMake.cmake2
-rw-r--r--Modules/CMakeVerifyManifest.cmake2
-rw-r--r--Modules/CPack.cmake45
-rw-r--r--Modules/CPackDeb.cmake147
-rw-r--r--Modules/CPackRPM.cmake257
-rw-r--r--Modules/CPackZIP.cmake2
-rw-r--r--Modules/CTest.cmake17
-rw-r--r--Modules/CTestScriptMode.cmake2
-rw-r--r--Modules/CTestTargets.cmake2
-rw-r--r--Modules/CheckCCompilerFlag.cmake2
-rw-r--r--Modules/CheckCSourceCompiles.cmake2
-rw-r--r--Modules/CheckCSourceRuns.cmake2
-rw-r--r--Modules/CheckCXXCompilerFlag.cmake2
-rw-r--r--Modules/CheckCXXSourceCompiles.cmake2
-rw-r--r--Modules/CheckCXXSourceRuns.cmake2
-rw-r--r--Modules/CheckFortranFunctionExists.cmake2
-rw-r--r--Modules/CheckFunctionExists.cmake2
-rw-r--r--Modules/CheckIncludeFile.cmake2
-rw-r--r--Modules/CheckIncludeFileCXX.cmake2
-rw-r--r--Modules/CheckIncludeFiles.cmake2
-rw-r--r--Modules/CheckLibraryExists.cmake2
-rw-r--r--Modules/CheckSizeOf.cmake2
-rw-r--r--Modules/CheckStructHasMember.cmake2
-rw-r--r--Modules/CheckSymbolExists.cmake2
-rw-r--r--Modules/CheckTypeSize.cmake2
-rw-r--r--Modules/CheckVariableExists.cmake2
-rw-r--r--Modules/Compiler/GNU.cmake2
-rw-r--r--Modules/Compiler/PGI.cmake2
-rw-r--r--Modules/Compiler/PathScale.cmake2
-rw-r--r--Modules/Dart.cmake2
-rw-r--r--Modules/DartConfiguration.tcl.in4
-rw-r--r--Modules/Documentation.cmake2
-rw-r--r--Modules/ExternalProject.cmake249
-rw-r--r--Modules/FLTKCompatibility.cmake2
-rw-r--r--Modules/FeatureSummary.cmake215
-rw-r--r--Modules/FindALSA.cmake2
-rw-r--r--Modules/FindASPELL.cmake2
-rw-r--r--Modules/FindAVIFile.cmake2
-rw-r--r--Modules/FindBISON.cmake10
-rw-r--r--Modules/FindBLAS.cmake2
-rw-r--r--Modules/FindBZip2.cmake2
-rw-r--r--Modules/FindBoost.cmake390
-rw-r--r--Modules/FindBullet.cmake2
-rw-r--r--Modules/FindCABLE.cmake2
-rw-r--r--Modules/FindCUDA.cmake66
-rw-r--r--Modules/FindCURL.cmake2
-rw-r--r--Modules/FindCVS.cmake2
-rw-r--r--Modules/FindCoin3D.cmake2
-rw-r--r--Modules/FindCups.cmake2
-rw-r--r--Modules/FindCurses.cmake2
-rw-r--r--Modules/FindCxxTest.cmake104
-rw-r--r--Modules/FindCygwin.cmake5
-rw-r--r--Modules/FindDCMTK.cmake2
-rw-r--r--Modules/FindDart.cmake2
-rw-r--r--Modules/FindDevIL.cmake2
-rw-r--r--Modules/FindDoxygen.cmake2
-rw-r--r--Modules/FindEXPAT.cmake2
-rw-r--r--Modules/FindFLEX.cmake15
-rw-r--r--Modules/FindFLTK.cmake7
-rw-r--r--Modules/FindFLTK2.cmake6
-rw-r--r--Modules/FindFreetype.cmake2
-rw-r--r--Modules/FindGCCXML.cmake2
-rw-r--r--Modules/FindGDAL.cmake2
-rw-r--r--Modules/FindGIF.cmake2
-rw-r--r--Modules/FindGLU.cmake2
-rw-r--r--Modules/FindGLUT.cmake2
-rw-r--r--Modules/FindGTK.cmake2
-rw-r--r--Modules/FindGTK2.cmake51
-rw-r--r--Modules/FindGTest.cmake2
-rw-r--r--Modules/FindGettext.cmake2
-rw-r--r--Modules/FindGit.cmake2
-rw-r--r--Modules/FindGnuTLS.cmake2
-rw-r--r--Modules/FindGnuplot.cmake2
-rw-r--r--Modules/FindHDF5.cmake2
-rw-r--r--Modules/FindHSPELL.cmake2
-rw-r--r--Modules/FindHTMLHelp.cmake2
-rw-r--r--Modules/FindITK.cmake2
-rw-r--r--Modules/FindImageMagick.cmake2
-rw-r--r--Modules/FindJNI.cmake63
-rw-r--r--Modules/FindJPEG.cmake2
-rw-r--r--Modules/FindJasper.cmake2
-rw-r--r--Modules/FindJava.cmake46
-rw-r--r--Modules/FindKDE3.cmake2
-rw-r--r--Modules/FindKDE4.cmake2
-rw-r--r--Modules/FindLAPACK.cmake2
-rw-r--r--Modules/FindLATEX.cmake2
-rw-r--r--Modules/FindLibArchive.cmake63
-rw-r--r--Modules/FindLibXml2.cmake2
-rw-r--r--Modules/FindLibXslt.cmake2
-rw-r--r--Modules/FindLua50.cmake2
-rw-r--r--Modules/FindLua51.cmake2
-rw-r--r--Modules/FindMFC.cmake2
-rw-r--r--Modules/FindMPEG.cmake2
-rw-r--r--Modules/FindMPEG2.cmake2
-rw-r--r--Modules/FindMPI.cmake30
-rw-r--r--Modules/FindMatlab.cmake2
-rw-r--r--Modules/FindMotif.cmake2
-rw-r--r--Modules/FindOpenAL.cmake2
-rw-r--r--Modules/FindOpenGL.cmake2
-rw-r--r--Modules/FindOpenMP.cmake2
-rw-r--r--Modules/FindOpenSSL.cmake24
-rw-r--r--Modules/FindOpenSceneGraph.cmake2
-rw-r--r--Modules/FindOpenThreads.cmake2
-rw-r--r--Modules/FindPHP4.cmake2
-rw-r--r--Modules/FindPNG.cmake2
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake262
-rw-r--r--Modules/FindPackageMessage.cmake2
-rw-r--r--Modules/FindPerl.cmake2
-rw-r--r--Modules/FindPerlLibs.cmake10
-rw-r--r--Modules/FindPhysFS.cmake2
-rw-r--r--Modules/FindPike.cmake2
-rw-r--r--Modules/FindPkgConfig.cmake2
-rw-r--r--Modules/FindPostgreSQL.cmake181
-rw-r--r--Modules/FindProducer.cmake2
-rw-r--r--Modules/FindProtobuf.cmake2
-rw-r--r--Modules/FindPythonInterp.cmake7
-rw-r--r--Modules/FindPythonLibs.cmake15
-rw-r--r--Modules/FindQt.cmake2
-rw-r--r--Modules/FindQt3.cmake2
-rw-r--r--Modules/FindQt4.cmake480
-rw-r--r--Modules/FindQuickTime.cmake2
-rw-r--r--Modules/FindRTI.cmake2
-rw-r--r--Modules/FindRuby.cmake28
-rw-r--r--Modules/FindSDL.cmake2
-rw-r--r--Modules/FindSDL_image.cmake2
-rw-r--r--Modules/FindSDL_mixer.cmake2
-rw-r--r--Modules/FindSDL_net.cmake2
-rw-r--r--Modules/FindSDL_sound.cmake2
-rw-r--r--Modules/FindSDL_ttf.cmake2
-rw-r--r--Modules/FindSWIG.cmake22
-rw-r--r--Modules/FindSelfPackers.cmake2
-rw-r--r--Modules/FindSquish.cmake5
-rw-r--r--Modules/FindSubversion.cmake51
-rw-r--r--Modules/FindTCL.cmake2
-rw-r--r--Modules/FindTIFF.cmake4
-rw-r--r--Modules/FindTclStub.cmake2
-rw-r--r--Modules/FindTclsh.cmake2
-rw-r--r--Modules/FindThreads.cmake4
-rw-r--r--Modules/FindUnixCommands.cmake2
-rw-r--r--Modules/FindVTK.cmake2
-rw-r--r--Modules/FindWget.cmake2
-rw-r--r--Modules/FindWish.cmake2
-rw-r--r--Modules/FindX11.cmake2
-rw-r--r--Modules/FindXMLRPC.cmake2
-rw-r--r--Modules/FindZLIB.cmake42
-rw-r--r--Modules/Findosg.cmake2
-rw-r--r--Modules/FindosgAnimation.cmake2
-rw-r--r--Modules/FindosgDB.cmake2
-rw-r--r--Modules/FindosgFX.cmake2
-rw-r--r--Modules/FindosgGA.cmake2
-rw-r--r--Modules/FindosgIntrospection.cmake2
-rw-r--r--Modules/FindosgManipulator.cmake2
-rw-r--r--Modules/FindosgParticle.cmake2
-rw-r--r--Modules/FindosgProducer.cmake2
-rw-r--r--Modules/FindosgShadow.cmake2
-rw-r--r--Modules/FindosgSim.cmake2
-rw-r--r--Modules/FindosgTerrain.cmake2
-rw-r--r--Modules/FindosgText.cmake2
-rw-r--r--Modules/FindosgUtil.cmake2
-rw-r--r--Modules/FindosgViewer.cmake2
-rw-r--r--Modules/FindosgVolume.cmake2
-rw-r--r--Modules/FindosgWidget.cmake2
-rw-r--r--Modules/Findosg_functions.cmake2
-rw-r--r--Modules/FindwxWidgets.cmake67
-rw-r--r--Modules/FindwxWindows.cmake2
-rw-r--r--Modules/FortranCInterface.cmake8
-rw-r--r--Modules/GetPrerequisites.cmake243
-rw-r--r--Modules/ITKCompatibility.cmake2
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake2
-rw-r--r--Modules/KDE3Macros.cmake2
-rw-r--r--Modules/MacroAddFileDependencies.cmake4
-rw-r--r--Modules/Platform/AIX-GNU.cmake2
-rw-r--r--Modules/Platform/BlueGeneP-base.cmake118
-rw-r--r--Modules/Platform/BlueGeneP-dynamic-GNU-C.cmake16
-rw-r--r--Modules/Platform/BlueGeneP-dynamic-GNU-CXX.cmake16
-rw-r--r--Modules/Platform/BlueGeneP-dynamic-GNU-Fortran.cmake16
-rw-r--r--Modules/Platform/BlueGeneP-dynamic-XL-C.cmake16
-rw-r--r--Modules/Platform/BlueGeneP-dynamic-XL-CXX.cmake16
-rw-r--r--Modules/Platform/BlueGeneP-dynamic-XL-Fortran.cmake16
-rw-r--r--Modules/Platform/BlueGeneP-dynamic.cmake19
-rw-r--r--Modules/Platform/BlueGeneP-static-GNU-C.cmake16
-rw-r--r--Modules/Platform/BlueGeneP-static-GNU-CXX.cmake16
-rw-r--r--Modules/Platform/BlueGeneP-static-GNU-Fortran.cmake16
-rw-r--r--Modules/Platform/BlueGeneP-static-XL-C.cmake16
-rw-r--r--Modules/Platform/BlueGeneP-static-XL-CXX.cmake16
-rw-r--r--Modules/Platform/BlueGeneP-static-XL-Fortran.cmake16
-rw-r--r--Modules/Platform/BlueGeneP-static.cmake19
-rw-r--r--Modules/Platform/CYGWIN-GNU.cmake2
-rw-r--r--Modules/Platform/Darwin-GNU.cmake2
-rw-r--r--Modules/Platform/Darwin.cmake5
-rw-r--r--Modules/Platform/GNU.cmake3
-rw-r--r--Modules/Platform/HP-UX-GNU.cmake2
-rw-r--r--Modules/Platform/HP-UX.cmake2
-rw-r--r--Modules/Platform/Linux-GNU.cmake2
-rw-r--r--Modules/Platform/Linux-Intel.cmake2
-rw-r--r--Modules/Platform/Linux-PGI.cmake2
-rw-r--r--Modules/Platform/Linux-PathScale.cmake2
-rw-r--r--Modules/Platform/SunOS-GNU.cmake2
-rw-r--r--Modules/Platform/UnixPaths.cmake6
-rw-r--r--Modules/Platform/Windows-Borland.cmake2
-rw-r--r--Modules/Platform/Windows-GNU-Fortran.cmake1
-rw-r--r--Modules/Platform/Windows-GNU.cmake46
-rw-r--r--Modules/Platform/Windows-df.cmake2
-rw-r--r--Modules/Platform/Windows-icl.cmake4
-rw-r--r--Modules/Platform/Windows-wcl386.cmake19
-rw-r--r--Modules/Platform/WindowsPaths.cmake2
-rw-r--r--Modules/Qt4ConfigDependentSettings.cmake118
-rw-r--r--Modules/Qt4Macros.cmake13
-rw-r--r--Modules/SelectLibraryConfigurations.cmake2
-rw-r--r--Modules/SquishTestScript.cmake2
-rw-r--r--Modules/SystemInformation.cmake2
-rw-r--r--Modules/TestBigEndian.cmake2
-rw-r--r--Modules/TestCXXAcceptsFlag.cmake2
-rw-r--r--Modules/TestForANSIForScope.cmake2
-rw-r--r--Modules/TestForANSIStreamHeaders.cmake2
-rw-r--r--Modules/TestForSSTREAM.cmake2
-rw-r--r--Modules/TestForSTDNamespace.cmake2
-rw-r--r--Modules/UseEcos.cmake2
-rw-r--r--Modules/UsePkgConfig.cmake2
-rw-r--r--Modules/UseQt4.cmake6
-rw-r--r--Modules/UseSWIG.cmake2
-rw-r--r--Modules/UseVTK40.cmake2
-rw-r--r--Modules/UseVTKBuildSettings40.cmake2
-rw-r--r--Modules/UseVTKConfig40.cmake2
-rw-r--r--Modules/Use_wxWindows.cmake2
-rw-r--r--Modules/UsewxWidgets.cmake20
-rw-r--r--Modules/VTKCompatibility.cmake2
-rw-r--r--Modules/ecos_clean.cmake2
-rw-r--r--Modules/kde3uic.cmake2
-rw-r--r--Source/CMakeLists.txt7
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx446
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.h49
-rw-r--r--Source/CPack/cmCPackBundleGenerator.cxx6
-rw-r--r--Source/CPack/cmCPackBundleGenerator.h3
-rw-r--r--Source/CPack/cmCPackCygwinBinaryGenerator.cxx9
-rw-r--r--Source/CPack/cmCPackCygwinBinaryGenerator.h3
-rw-r--r--Source/CPack/cmCPackCygwinSourceGenerator.cxx28
-rw-r--r--Source/CPack/cmCPackCygwinSourceGenerator.h3
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx37
-rw-r--r--Source/CPack/cmCPackDebGenerator.h3
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx11
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.h6
-rw-r--r--Source/CPack/cmCPackGenerator.cxx173
-rw-r--r--Source/CPack/cmCPackGenerator.h69
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx16
-rw-r--r--Source/CPack/cmCPackNSISGenerator.h3
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx10
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.h3
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx10
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.h3
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx10
-rw-r--r--Source/CPack/cmCPackRPMGenerator.h3
-rw-r--r--Source/CPack/cmCPackSTGZGenerator.cxx7
-rw-r--r--Source/CPack/cmCPackSTGZGenerator.h3
-rw-r--r--Source/CPack/cmCPackTGZGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackTarBZip2Generator.cxx4
-rw-r--r--Source/CPack/cmCPackTarCompressGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackZIPGenerator.cxx4
-rw-r--r--Source/CPack/cpack.cxx2
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx29
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx6
-rw-r--r--Source/CTest/cmCTestGIT.cxx86
-rw-r--r--Source/CTest/cmCTestGIT.h3
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx68
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.h3
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx184
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h6
-rw-r--r--Source/CTest/cmCTestRunScriptCommand.h2
-rw-r--r--Source/CTest/cmCTestRunTest.cxx28
-rw-r--r--Source/CTest/cmCTestRunTest.h1
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx37
-rw-r--r--Source/CTest/cmCTestSubmitCommand.h17
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx188
-rw-r--r--Source/CTest/cmCTestSubmitHandler.h1
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx17
-rw-r--r--Source/CursesDialog/cmCursesLongMessageForm.cxx8
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx38
-rw-r--r--Source/CursesDialog/cmCursesMainForm.h7
-rw-r--r--Source/CursesDialog/form/fld_info.c2
-rw-r--r--Source/CursesDialog/form/fld_user.c4
-rw-r--r--Source/CursesDialog/form/frm_user.c4
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx175
-rw-r--r--Source/cmArchiveWrite.cxx299
-rw-r--r--Source/cmArchiveWrite.h94
-rw-r--r--Source/cmCTest.cxx26
-rw-r--r--Source/cmCTest.h3
-rw-r--r--Source/cmComputeComponentGraph.cxx13
-rw-r--r--Source/cmComputeComponentGraph.h3
-rw-r--r--Source/cmComputeLinkDepends.cxx23
-rw-r--r--Source/cmComputeLinkDepends.h1
-rw-r--r--Source/cmComputeTargetDepends.cxx149
-rw-r--r--Source/cmComputeTargetDepends.h11
-rw-r--r--Source/cmCoreTryCompile.cxx17
-rw-r--r--Source/cmDocumentVariables.cxx34
-rw-r--r--Source/cmELF.cxx5
-rw-r--r--Source/cmExportCommand.cxx12
-rw-r--r--Source/cmFileCommand.cxx103
-rw-r--r--Source/cmFindBase.cxx5
-rw-r--r--Source/cmFindCommon.cxx57
-rw-r--r--Source/cmFindCommon.h8
-rw-r--r--Source/cmFindPackageCommand.cxx171
-rw-r--r--Source/cmFindPackageCommand.h7
-rw-r--r--Source/cmGlobalGenerator.cxx32
-rw-r--r--Source/cmGlobalGenerator.h4
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx5
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h2
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio10Win64Generator.cxx1
-rw-r--r--Source/cmGlobalVisualStudio10Win64Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio6Generator.cxx99
-rw-r--r--Source/cmGlobalVisualStudio6Generator.h1
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx83
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx134
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h1
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx19
-rw-r--r--Source/cmGlobalVisualStudio8Generator.h7
-rw-r--r--Source/cmGlobalVisualStudio8Win64Generator.cxx6
-rw-r--r--Source/cmGlobalVisualStudio8Win64Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio9Generator.cxx5
-rw-r--r--Source/cmGlobalVisualStudio9Win64Generator.cxx6
-rw-r--r--Source/cmGlobalVisualStudio9Win64Generator.h2
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx193
-rw-r--r--Source/cmGlobalVisualStudioGenerator.h19
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx378
-rw-r--r--Source/cmGraphAdjacencyList.h22
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx2
-rw-r--r--Source/cmInstallCommand.h1
-rw-r--r--Source/cmInstallGenerator.cxx23
-rw-r--r--Source/cmLocalGenerator.cxx64
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx11
-rw-r--r--Source/cmLocalVisualStudio10Generator.cxx2
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx6
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx17
-rw-r--r--Source/cmMakefile.cxx44
-rw-r--r--Source/cmMakefile.h6
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx7
-rw-r--r--Source/cmOptionCommand.h5
-rw-r--r--Source/cmPolicies.cxx55
-rw-r--r--Source/cmPolicies.h7
-rw-r--r--Source/cmProjectCommand.h2
-rw-r--r--Source/cmSetCommand.cxx2
-rw-r--r--Source/cmSourceFile.cxx15
-rw-r--r--Source/cmSourceFile.h4
-rw-r--r--Source/cmStringCommand.cxx2
-rw-r--r--Source/cmSystemTools.cxx236
-rw-r--r--Source/cmSystemTools.h12
-rw-r--r--Source/cmTarget.cxx40
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx63
-rw-r--r--Source/cmTryRunCommand.cxx2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx142
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h4
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx13
-rw-r--r--Source/cmXCodeObject.cxx2
-rw-r--r--Source/cm_utf8.c6
-rw-r--r--Source/cmake.cxx20
-rw-r--r--Source/ctest.cxx5
-rw-r--r--Source/kwsys/CMakeLists.txt39
-rw-r--r--Source/kwsys/Configure.hxx.in9
-rw-r--r--Source/kwsys/MD5.c9
-rw-r--r--Source/kwsys/SystemTools.cxx96
-rw-r--r--Source/kwsys/SystemTools.hxx.in6
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake4
-rw-r--r--Source/kwsys/testProcess.c4
-rw-r--r--Tests/CMakeInstall.cmake2
-rw-r--r--Tests/CMakeLists.txt92
-rw-r--r--Tests/CMakeTests/CheckSourceTreeTest.cmake.in63
-rw-r--r--Tests/CMakeTests/FindBaseTest.cmake.in2
-rw-r--r--Tests/CMakeTests/ModuleNoticesTest.cmake.in4
-rw-r--r--Tests/CTestSubmitLargeOutput/CMakeLists.txt8
-rw-r--r--Tests/CTestSubmitLargeOutput/GenerateRandomOutput.cmake31
-rw-r--r--Tests/CTestSubmitLargeOutput/test.cmake.in27
-rw-r--r--Tests/CTestTestChecksum/test.cmake.in28
-rw-r--r--Tests/CTestTestCycle/CMakeLists.txt13
-rw-r--r--Tests/CTestTestCycle/CTestConfig.cmake (renamed from Tests/CTestSubmitLargeOutput/CTestConfig.cmake)5
-rw-r--r--Tests/CTestTestCycle/simple.cxx5
-rw-r--r--Tests/CTestTestCycle/test.cmake.in22
-rw-r--r--Tests/CTestTestDepends/CMakeLists.txt12
-rw-r--r--Tests/CTestTestDepends/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestDepends/simple.cxx5
-rw-r--r--Tests/CTestTestDepends/test.cmake.in22
-rw-r--r--Tests/CTestUpdateGIT.cmake.in5
-rw-r--r--Tests/CheckCompilerRelatedVariables/CMakeLists.txt3
-rw-r--r--Tests/CheckFortran.cmake2
-rw-r--r--Tests/CustomCommand/CMakeLists.txt24
-rw-r--r--Tests/CxxOnly/CMakeLists.txt7
-rw-r--r--Tests/CxxOnly/cxxonly.cxx6
-rw-r--r--Tests/CxxOnly/test.CPP1
-rw-r--r--Tests/Dependency/Four/CMakeLists.txt3
-rw-r--r--Tests/Dependency/Four/FourSrc.c1
-rw-r--r--Tests/EmptyLibrary/CMakeLists.txt4
-rw-r--r--Tests/EmptyLibrary/subdir/CMakeLists.txt1
-rw-r--r--Tests/EmptyLibrary/subdir/test.h1
-rw-r--r--Tests/ExternalProject/CMakeLists.txt8
-rw-r--r--Tests/FindPackageTest/CMakeLists.txt4
-rw-r--r--Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake4
-rw-r--r--Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config.cmake2
-rw-r--r--Tests/FunctionTest/CMakeLists.txt8
-rw-r--r--Tests/MissingSourceFile/CMakeLists.txt3
-rw-r--r--Utilities/Doxygen/CMakeLists.txt10
-rwxr-xr-xUtilities/Doxygen/doc_makeall.sh.in4
-rw-r--r--Utilities/Doxygen/doxyfile.in20
-rw-r--r--Utilities/KWStyle/CMake.kws.xml.in2
-rw-r--r--Utilities/KWStyle/CMakeFiles.txt.in24
-rw-r--r--Utilities/KWStyle/CMakeLists.txt20
-rw-r--r--Utilities/KWStyle/CMakeMoreChecks.kws.xml.in2
-rw-r--r--Utilities/Release/README31
-rw-r--r--Utilities/Release/create-cmake-release.cmake7
-rw-r--r--Utilities/Release/dash2win64_cygwin.cmake3
-rw-r--r--Utilities/Release/dashmacmini2_release.cmake2
-rw-r--r--Utilities/Release/dashsgi1_release.cmake11
-rw-r--r--Utilities/Release/dashsgi1_release64.cmake15
-rw-r--r--Utilities/Release/destiny_release.cmake12
-rw-r--r--Utilities/Release/muse_release.cmake10
-rw-r--r--Utilities/Release/muse_release64.cmake14
-rw-r--r--Utilities/Release/r15n65_aix_release.cmake22
-rw-r--r--Utilities/Release/r36n11_aix_release.cmake22
-rw-r--r--Utilities/Release/release_cmake.cmake6
-rwxr-xr-xUtilities/Release/release_cmake.sh.in2
-rw-r--r--Utilities/Release/v20n17_aix_release.cmake22
-rw-r--r--Utilities/Release/v60n177_aix_release.cmake21
-rw-r--r--Utilities/Release/vogon_cygwin.cmake11
-rw-r--r--Utilities/Release/vogon_release.cmake17
-rw-r--r--Utilities/Release/vogon_release_qt.cmake16
-rw-r--r--Utilities/cmThirdParty.h.in1
-rw-r--r--Utilities/cm_libarchive.h25
-rw-r--r--Utilities/cmbzip2/bzlib_private.h3
-rw-r--r--Utilities/cmcompress/cmcompress.c2
-rw-r--r--Utilities/cmcurl/CMakeLists.txt1
-rw-r--r--Utilities/cmcurl/curl/multi.h2
-rw-r--r--Utilities/cmcurl/setup.h4
-rw-r--r--Utilities/cmcurl/url.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_check_magic.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c10
-rwxr-xr-xbootstrap73
503 files changed, 7432 insertions, 3586 deletions
diff --git a/.gitattributes b/.gitattributes
index 878221f..43676a9 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -12,3 +12,9 @@ configure crlf=input
*.dsw -crlf
*.sln -crlf
*.vcproj -crlf
+
+*.c whitespace=tab-in-indent
+*.h whitespace=tab-in-indent
+*.cxx whitespace=tab-in-indent
+*.txt whitespace=tab-in-indent
+*.cmake whitespace=tab-in-indent
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f5ec0f6..c8337f7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,18 +69,25 @@ MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
CACHE BOOL "Use system-installed expat" FORCE)
SET(CMAKE_USE_SYSTEM_ZLIB "${CMAKE_USE_SYSTEM_LIBRARIES}"
CACHE BOOL "Use system-installed zlib" FORCE)
+ SET(CMAKE_USE_SYSTEM_BZIP2 "${CMAKE_USE_SYSTEM_LIBRARIES}"
+ CACHE BOOL "Use system-installed bzip2" FORCE)
+ SET(CMAKE_USE_SYSTEM_LIBARCHIVE "${CMAKE_USE_SYSTEM_LIBRARIES}"
+ CACHE BOOL "Use system-installed libarchive" FORCE)
ENDIF(CMAKE_USE_SYSTEM_LIBRARIES_USER)
# Optionally use system utility libraries.
+ OPTION(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" ${CMAKE_USE_SYSTEM_LIBRARIES})
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl"
${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CTEST_USE_XMLRPC" ON)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat"
${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CTEST_USE_XMLRPC" ON)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib"
- ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_CURL" ON)
+ ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_LIBARCHIVE;NOT CMAKE_USE_SYSTEM_CURL" ON)
+ CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_BZIP2 "Use system-installed bzip2"
+ ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
# Mention to the user what system libraries are being used.
- FOREACH(util CURL EXPAT XMLRPC ZLIB)
+ FOREACH(util BZIP2 CURL EXPAT LIBARCHIVE ZLIB)
IF(CMAKE_USE_SYSTEM_${util})
MESSAGE(STATUS "Using system-installed ${util}")
ENDIF(CMAKE_USE_SYSTEM_${util})
@@ -308,9 +315,20 @@ MACRO (CMAKE_BUILD_UTILITIES)
ADD_SUBDIRECTORY(Utilities/cmbzip2)
CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty")
ENDIF()
+
+ #---------------------------------------------------------------------
+ # Build or use system libarchive for CMake and CTest.
IF(CMAKE_USE_SYSTEM_LIBARCHIVE)
- FIND_PACKAGE(libarchive)
- SET(CMAKE_TAR_LIBRARIES libarchive)
+ IF(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake)
+ FIND_PACKAGE(LibArchive)
+ ELSE()
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
+ INCLUDE(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake)
+ ENDIF()
+ IF(NOT LibArchive_FOUND)
+ MESSAGE(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
+ ENDIF()
+ SET(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE)
SET(HAVE_LIBZ 1)
SET(HAVE_ZLIB_H 1)
@@ -377,7 +395,21 @@ MACRO (CMAKE_BUILD_UTILITIES)
ENDIF(BUILD_CursesDialog)
ENDMACRO (CMAKE_BUILD_UTILITIES)
-
+#-----------------------------------------------------------------------
+IF(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
+ EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER}
+ ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
+ OUTPUT_VARIABLE _GXX_VERSION
+ )
+ STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
+ _GXX_VERSION_SHORT ${_GXX_VERSION})
+ IF(_GXX_VERSION_SHORT EQUAL 33)
+ MESSAGE(FATAL_ERROR
+ "GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n"
+ "Please use GXX 4.2 or greater to build CMake on OpenBSD\n"
+ "${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}")
+ ENDIF()
+ENDIF()
#-----------------------------------------------------------------------
# The main section of the CMakeLists file
@@ -387,8 +419,8 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 8)
SET(CMake_VERSION_PATCH 2)
-SET(CMake_VERSION_TWEAK 0)
-SET(CMake_VERSION_RC 4)
+#SET(CMake_VERSION_TWEAK 0)
+#SET(CMake_VERSION_RC 1)
# Releases define a tweak level.
IF(DEFINED CMake_VERSION_TWEAK)
diff --git a/ChangeLog.manual b/ChangeLog.manual
index ada7fc2..7b0a901 100644
--- a/ChangeLog.manual
+++ b/ChangeLog.manual
@@ -1,3 +1,5 @@
+No changes in CMake 2.8.2 since 2.8.2-rc4.
+
Changes in CMake 2.8.2-rc4 (since 2.8.2-rc3)
--------------------------------------------
Bill Hoffman (1):
diff --git a/Docs/cmake-completion b/Docs/cmake-completion
new file mode 100644
index 0000000..011f3fa
--- /dev/null
+++ b/Docs/cmake-completion
@@ -0,0 +1,190 @@
+#
+# bash-completion file for CMake
+# Provided by Eric NOULARD - eric.noulard@gmail.com
+#
+# see http://bash-completion.alioth.debian.org/
+# and http://www.cmake.org
+#
+# We will try to complete cmake commands options
+# at 2 (or may be 3 levels)
+# [cmake|cpack|ctest] <level0> <level1> <level2>
+#
+# level0 is top level cmake/cpack/ctest options
+# level1 is the first argument of level0 option
+# level2 is the seconf argument of level1 argument
+# FIXME: I don't know how to handle level2
+#
+# The file has been proposed for inclusion in the bash-completion package
+# https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312632&group_id=100114
+# In the meantime,
+# 1) If you want to test bash completion for cmake/cpack/ctest
+# just source the current file at bash prompt
+# . ./cmake-completion
+#
+# 2) If you want to install it for good copy this file to
+# cp cmake-completion /etc/bash_completion.d/cmake
+#
+
+#
+# cmake command
+#
+# have cmake &&
+_cmake()
+{
+ local cur prev opts words cword
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ # seems to be only available on bash-completion 1.2
+ #_get_comp_words_by_ref cur prev
+
+ # cmake command line option we want to complete
+ opts=`cmake --help | grep "^ \-.*=\ .*" | cut -d" " -f 3 | cut -d= -f 1 | cut -d[ -f 1`
+
+ #
+ # Complete the arguments to some of
+ # the most commonly used commands (Level 1).
+ #
+ case "${prev}" in
+ -E)
+ local running=$(for x in `cmake -E |& grep "^ " | cut -d" " -f 3`; do echo ${x} ; done )
+ COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+ return 0
+ ;;
+ --help-command)
+ local running=$(for x in `cmake --help-command-list`; do echo ${x} ; done )
+ COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+ return 0
+ ;;
+ --help-module)
+ local running=$(for x in `cmake --help-module-list`; do echo ${x} ; done )
+ COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+ return 0
+ ;;
+ --help-policy)
+ local running=$(for x in `cmake --help-policies | grep "^ CMP"`; do echo ${x} ; done )
+ COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+ return 0
+ ;;
+ --help-property)
+ local running=$(for x in `cmake --help-property-list`; do echo ${x} ; done )
+ COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+ return 0
+ ;;
+ --help-variable)
+ local running=$(for x in `cmake --help-variable-list`; do echo ${x} ; done )
+ COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+ return 0
+ ;;
+ *)
+ ;;
+ esac
+
+ #
+ # Complete the arguments to some of
+ # the most commonly used commands (Level 2).
+ # ?? How to do that ..
+
+ #
+ # Complete the option (Level 0 - right after cmake)
+ #
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+} &&
+complete -F _cmake -o default cmake
+
+#
+# cpack command
+#
+#have cpack &&
+_cpack()
+{
+ local cur prev opts words cword
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ # seems to be only available on bash-completion 1.2
+ #_get_comp_words_by_ref cur prev
+
+ # cpack command line option we want to complete
+ opts=`cpack --help | grep "^ \-.*=\ .*" | cut -d" " -f 3 | cut -d= -f 1`
+ opts="${opts} --help -V"
+
+ #
+ # Complete the arguments to some of
+ # the most commonly used commands (Level 1).
+ #
+ case "${prev}" in
+ -G)
+ local running=$(for x in `cpack --help | grep "^ .*=\ .*" | grep -v "^ -" | cut -d" " -f 3`; do echo ${x} ; done )
+ COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+ return 0
+ ;;
+ --config)
+ COMPREPLY=( $(compgen -f ${cur}) )
+ return 0
+ ;;
+ *)
+ ;;
+ esac
+
+ #
+ # Complete the option (Level 0 - right after cmake)
+ #
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+} &&
+complete -F _cpack -o default cpack
+
+#
+# cmake command
+#
+# have ctest &&
+_ctest()
+{
+ local cur prev opts words cword
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ # seems to be only available on bash-completion 1.2
+ #_get_comp_words_by_ref cur prev
+
+ # cmake command line option we want to complete
+ opts=`ctest --help | grep "\-\-.*" | cut -d" " -f 3 | sed s/,/\\\n/g`
+
+ #
+ # Complete the arguments to some of
+ # the most commonly used commands (Level 1).
+ #
+ case "${prev}" in
+ --help-command)
+ local running=$(for x in `ctest --help-command-list`; do echo ${x} ; done )
+ COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+ return 0
+ ;;
+ -R)
+ local running=$(for x in `ctest -N 2> /dev/null | grep "^ Test" | cut -d: -f 2`; do echo ${x} ; done )
+ COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+ return 0
+ ;;
+ *)
+ ;;
+ esac
+
+ #
+ # Complete the arguments to some of
+ # the most commonly used commands (Level 2).
+ # ?? How to do that ..
+
+ #
+ # Complete the option (Level 0 - right after cmake)
+ #
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+} &&
+complete -F _ctest -o default ctest
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh \ No newline at end of file
diff --git a/Modules/AddFileDependencies.cmake b/Modules/AddFileDependencies.cmake
index ae2e803..f971e37 100644
--- a/Modules/AddFileDependencies.cmake
+++ b/Modules/AddFileDependencies.cmake
@@ -12,7 +12,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(ADD_FILE_DEPENDENCIES _file)
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index d9c41f4..c7ead5b 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -1,9 +1,11 @@
-# BundleUtilities.cmake
+# - Functions to help assemble a standalone bundle application.
+# A collection of CMake utility functions useful for dealing with .app
+# bundles on the Mac and bundle-like directories on any OS.
#
-# A collection of CMake utility functions useful for dealing with .app bundles
-# on the Mac and bundle-like directories on any OS.
-#
-# The following functions are provided by this script:
+# The following functions are provided by this module:
+# fixup_bundle
+# copy_and_fixup_bundle
+# verify_app
# get_bundle_main_executable
# get_dotapp_dir
# get_bundle_and_executable
@@ -13,15 +15,121 @@
# set_bundle_key_values
# get_bundle_keys
# copy_resolved_item_into_bundle
+# copy_resolved_framework_into_bundle
# fixup_bundle_item
-# fixup_bundle
-# copy_and_fixup_bundle
# verify_bundle_prerequisites
# verify_bundle_symlinks
-# verify_app
-#
# Requires CMake 2.6 or greater because it uses function, break and
# PARENT_SCOPE. Also depends on GetPrerequisites.cmake.
+#
+# FIXUP_BUNDLE(<app> <libs> <dirs>)
+# Fix up a bundle in-place and make it standalone, such that it can be
+# drag-n-drop copied to another machine and run on that machine as long as all
+# of the system libraries are compatible.
+#
+# Gather all the keys for all the executables and libraries in a bundle, and
+# then, for each key, copy each prerequisite into the bundle. Then fix each one
+# up according to its own list of prerequisites.
+#
+# Then clear all the keys and call verify_app on the final bundle to ensure
+# that it is truly standalone.
+#
+# COPY_AND_FIXUP_BUNDLE(<src> <dst> <libs> <dirs>)
+# Makes a copy of the bundle <src> at location <dst> and then fixes up the
+# new copied bundle in-place at <dst>...
+#
+# VERIFY_APP(<app>)
+# Verifies that an application <app> appears valid based on running analysis
+# tools on it. Calls "message(FATAL_ERROR" if the application is not verified.
+#
+# GET_BUNDLE_MAIN_EXECUTABLE(<bundle> <result_var>)
+# The result will be the full path name of the bundle's main executable file
+# or an "error:" prefixed string if it could not be determined.
+#
+# GET_DOTAPP_DIR(<exe> <dotapp_dir_var>)
+# Returns the nearest parent dir whose name ends with ".app" given the full
+# path to an executable. If there is no such parent dir, then return a dir at
+# the same level as the executable, named with the executable's base name and
+# ending with ".app"
+#
+# The returned directory may or may not exist.
+#
+# GET_BUNDLE_AND_EXECUTABLE(<app> <bundle_var> <executable_var> <valid_var>)
+# Takes either a ".app" directory name or the name of an executable
+# nested inside a ".app" directory and returns the path to the ".app"
+# directory in <bundle_var> and the path to its main executable in
+# <executable_var>
+#
+# GET_BUNDLE_ALL_EXECUTABLES(<bundle> <exes_var>)
+# Scans the given bundle recursively for all executable files and accumulates
+# them into a variable.
+#
+# GET_ITEM_KEY(<item> <key_var>)
+# Given a file (item) name, generate a key that should be unique considering
+# the set of libraries that need copying or fixing up to make a bundle
+# standalone. This is essentially the file name including extension with "."
+# replaced by "_"
+#
+# This key is used as a prefix for CMake variables so that we can associate a
+# set of variables with a given item based on its key.
+#
+# CLEAR_BUNDLE_KEYS(<keys_var>)
+# Loop over the list of keys, clearing all the variables associated with each
+# key. After the loop, clear the list of keys itself.
+#
+# Caller of get_bundle_keys should call clear_bundle_keys when done with list
+# of keys.
+#
+# SET_BUNDLE_KEY_VALUES(<keys_var> <context> <item> <exepath> <dirs>
+# <copyflag>)
+# Add a key to the list (if necessary) for the given item. If added,
+# also set all the variables associated with that key.
+#
+# GET_BUNDLE_KEYS(<app> <libs> <dirs> <keys_var>)
+# Loop over all the executable and library files within the bundle (and given
+# as extra <libs>) and accumulate a list of keys representing them. Set
+# values associated with each key such that we can loop over all of them and
+# copy prerequisite libs into the bundle and then do appropriate
+# install_name_tool fixups.
+#
+# COPY_RESOLVED_ITEM_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
+# Copy a resolved item into the bundle if necessary. Copy is not necessary if
+# the resolved_item is "the same as" the resolved_embedded_item.
+#
+# COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
+# Copy a resolved framework into the bundle if necessary. Copy is not necessary
+# if the resolved_item is "the same as" the resolved_embedded_item.
+#
+# By default, BU_COPY_FULL_FRAMEWORK_CONTENTS is not set. If you want full
+# frameworks embedded in your bundles, set BU_COPY_FULL_FRAMEWORK_CONTENTS to
+# ON before calling fixup_bundle. By default,
+# COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE copies the framework dylib itself plus
+# the framework Resources directory.
+#
+# FIXUP_BUNDLE_ITEM(<resolved_embedded_item> <exepath> <dirs>)
+# Get the direct/non-system prerequisites of the resolved embedded item. For
+# each prerequisite, change the way it is referenced to the value of the
+# _EMBEDDED_ITEM keyed variable for that prerequisite. (Most likely changing to
+# an "@executable_path" style reference.)
+#
+# Also, change the id of the item being fixed up to its own _EMBEDDED_ITEM
+# value.
+#
+# Accumulate changes in a local variable and make *one* call to
+# install_name_tool at the end of the function with all the changes at once.
+#
+# If the BU_CHMOD_BUNDLE_ITEMS variable is set then bundle items will be
+# marked writable before install_name_tool tries to change them.
+#
+# VERIFY_BUNDLE_PREREQUISITES(<bundle> <result_var> <info_var>)
+# Verifies that the sum of all prerequisites of all files inside the bundle
+# are contained within the bundle or are "system" libraries, presumed to exist
+# everywhere.
+#
+# VERIFY_BUNDLE_SYMLINKS(<bundle> <result_var> <info_var>)
+# Verifies that any symlinks found in the bundle point to other files that are
+# already also in the bundle... Anything that points to an external file causes
+# this function to fail the verification.
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
@@ -33,7 +141,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# The functions defined in this file depend on the get_prerequisites function
@@ -43,11 +151,6 @@ get_filename_component(BundleUtilities_cmake_dir "${CMAKE_CURRENT_LIST_FILE}" PA
include("${BundleUtilities_cmake_dir}/GetPrerequisites.cmake")
-# get_bundle_main_executable
-#
-# The result will be the full path name of the bundle's main executable file
-# or an "error:" prefixed string if it could not be determined.
-#
function(get_bundle_main_executable bundle result_var)
set(result "error: '${bundle}/Contents/Info.plist' file does not exist")
@@ -109,15 +212,6 @@ function(get_bundle_main_executable bundle result_var)
endfunction(get_bundle_main_executable)
-# get_dotapp_dir
-#
-# Returns the nearest parent dir whose name ends with ".app" given the full path
-# to an executable. If there is no such parent dir, then return a dir at the same
-# level as the executable, named with the executable's base name and ending with
-# ".app"
-#
-# The returned directory may or may not exist.
-#
function(get_dotapp_dir exe dotapp_dir_var)
set(s "${exe}")
@@ -155,13 +249,6 @@ function(get_dotapp_dir exe dotapp_dir_var)
endfunction(get_dotapp_dir)
-# get_bundle_and_executable
-#
-# Takes either a ".app" directory name or the name of an executable
-# nested inside a ".app" directory and returns the path to the ".app"
-# directory in ${bundle_var} and the path to its main executable in
-# ${executable_var}
-#
function(get_bundle_and_executable app bundle_var executable_var valid_var)
set(valid 0)
@@ -215,11 +302,6 @@ function(get_bundle_and_executable app bundle_var executable_var valid_var)
endfunction(get_bundle_and_executable)
-# get_bundle_all_executables
-#
-# Scans the given bundle recursively for all executable files and accumulates
-# them into a variable.
-#
function(get_bundle_all_executables bundle exes_var)
set(exes "")
@@ -235,15 +317,6 @@ function(get_bundle_all_executables bundle exes_var)
endfunction(get_bundle_all_executables)
-# get_item_key
-#
-# Given a file (item) name, generate a key that should be unique considering the set of
-# libraries that need copying or fixing up to make a bundle standalone. This is
-# essentially the file name including extension with "." replaced by "_"
-#
-# This key is used as a prefix for CMake variables so that we can associate a set
-# of variables with a given item based on its key.
-#
function(get_item_key item key_var)
get_filename_component(item_name "${item}" NAME)
if(WIN32)
@@ -254,14 +327,6 @@ function(get_item_key item key_var)
endfunction(get_item_key)
-# clear_bundle_keys
-#
-# Loop over the list of keys, clearing all the variables associated with each
-# key. After the loop, clear the list of keys itself.
-#
-# Caller of get_bundle_keys should call clear_bundle_keys when done with list
-# of keys.
-#
function(clear_bundle_keys keys_var)
foreach(key ${${keys_var}})
set(${key}_ITEM PARENT_SCOPE)
@@ -275,11 +340,6 @@ function(clear_bundle_keys keys_var)
endfunction(clear_bundle_keys)
-# set_bundle_key_values
-#
-# Add a key to the list (if necessary) for the given item. If added,
-# also set all the variables associated with that key.
-#
function(set_bundle_key_values keys_var context item exepath dirs copyflag)
get_filename_component(item_name "${item}" NAME)
@@ -335,14 +395,6 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
endfunction(set_bundle_key_values)
-# get_bundle_keys
-#
-# Loop over all the executable and library files within the bundle (and given as
-# extra "${libs}") and accumulate a list of keys representing them. Set values
-# associated with each key such that we can loop over all of them and copy
-# prerequisite libs into the bundle and then do appropriate install_name_tool
-# fixups.
-#
function(get_bundle_keys app libs dirs keys_var)
set(${keys_var} PARENT_SCOPE)
@@ -363,7 +415,7 @@ function(get_bundle_keys app libs dirs keys_var)
# but that do not show up in otool -L output...)
#
foreach(lib ${libs})
- set_bundle_key_values(${keys_var} "${lib}" "${lib}" "${exepath}" "${dirs}" 1)
+ set_bundle_key_values(${keys_var} "${lib}" "${lib}" "${exepath}" "${dirs}" 0)
set(prereqs "")
get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}")
@@ -405,11 +457,6 @@ function(get_bundle_keys app libs dirs keys_var)
endfunction(get_bundle_keys)
-# copy_resolved_item_into_bundle
-#
-# Copy a resolved item into the bundle if necessary. Copy is not necessary if
-# the resolved_item is "the same as" the resolved_embedded_item.
-#
function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
if(WIN32)
# ignore case on Windows
@@ -433,18 +480,48 @@ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
endfunction(copy_resolved_item_into_bundle)
-# fixup_bundle_item
-#
-# Get the direct/non-system prerequisites of the resolved embedded item. For each
-# prerequisite, change the way it is referenced to the value of the _EMBEDDED_ITEM
-# keyed variable for that prerequisite. (Most likely changing to an "@executable_path"
-# style reference.)
-#
-# Also, change the id of the item being fixed up to its own _EMBEDDED_ITEM value.
-#
-# Accumulate changes in a local variable and make *one* call to install_name_tool
-# at the end of the function with all the changes at once.
-#
+function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_item)
+ if(WIN32)
+ # ignore case on Windows
+ string(TOLOWER "${resolved_item}" resolved_item_compare)
+ string(TOLOWER "${resolved_embedded_item}" resolved_embedded_item_compare)
+ else()
+ set(resolved_item_compare "${resolved_item}")
+ set(resolved_embedded_item_compare "${resolved_embedded_item}")
+ endif()
+
+ if("${resolved_item_compare}" STREQUAL "${resolved_embedded_item_compare}")
+ message(STATUS "warning: resolved_item == resolved_embedded_item - not copying...")
+ else()
+ if(BU_COPY_FULL_FRAMEWORK_CONTENTS)
+ # Full Framework (everything):
+ get_filename_component(resolved_dir "${resolved_item}" PATH)
+ get_filename_component(resolved_dir "${resolved_dir}/../.." ABSOLUTE)
+ get_filename_component(resolved_embedded_dir "${resolved_embedded_item}" PATH)
+ get_filename_component(resolved_embedded_dir "${resolved_embedded_dir}/../.." ABSOLUTE)
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_dir}' '${resolved_embedded_dir}'")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_dir}" "${resolved_embedded_dir}")
+ else()
+ # Framework lib itself:
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
+
+ # Plus Resources, if they exist:
+ string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Resources" resolved_resources "${resolved_item}")
+ string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Resources" resolved_embedded_resources "${resolved_embedded_item}")
+ if(EXISTS "${resolved_resources}")
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_resources}' '${resolved_embedded_resources}'")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_resources}" "${resolved_embedded_resources}")
+ endif()
+ endif()
+ endif()
+
+ if(UNIX AND NOT APPLE)
+ file(RPATH_REMOVE FILE "${resolved_embedded_item}")
+ endif(UNIX AND NOT APPLE)
+endfunction(copy_resolved_framework_into_bundle)
+
+
function(fixup_bundle_item resolved_embedded_item exepath dirs)
# This item's key is "ikey":
#
@@ -467,6 +544,10 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
endif(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
endforeach(pr)
+ if(BU_CHMOD_BUNDLE_ITEMS)
+ execute_process(COMMAND chmod u+w "${resolved_embedded_item}")
+ endif()
+
# Change this item's id and all of its references in one call
# to install_name_tool:
#
@@ -476,19 +557,6 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
endfunction(fixup_bundle_item)
-# fixup_bundle
-#
-# Fix up a bundle in-place and make it standalone, such that it can be drag-n-drop
-# copied to another machine and run on that machine as long as all of the system
-# libraries are compatible.
-#
-# Gather all the keys for all the executables and libraries in a bundle, and then,
-# for each key, copy each prerequisite into the bundle. Then fix each one up according
-# to its own list of prerequisites.
-#
-# Then clear all the keys and call verify_app on the final bundle to ensure that
-# it is truly standalone.
-#
function(fixup_bundle app libs dirs)
message(STATUS "fixup_bundle")
message(STATUS " app='${app}'")
@@ -528,8 +596,14 @@ function(fixup_bundle app libs dirs)
endif(show_status)
if(${${key}_COPYFLAG})
- copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
- "${${key}_RESOLVED_EMBEDDED_ITEM}")
+ set(item "${${key}_ITEM}")
+ if(item MATCHES "[^/]+\\.framework/")
+ copy_resolved_framework_into_bundle("${${key}_RESOLVED_ITEM}"
+ "${${key}_RESOLVED_EMBEDDED_ITEM}")
+ else()
+ copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
+ "${${key}_RESOLVED_EMBEDDED_ITEM}")
+ endif()
endif(${${key}_COPYFLAG})
endforeach(key)
@@ -557,23 +631,12 @@ function(fixup_bundle app libs dirs)
endfunction(fixup_bundle)
-# copy_and_fixup_bundle
-#
-# Makes a copy of the bundle "src" at location "dst" and then fixes up the
-# new copied bundle in-place at "dst"...
-#
function(copy_and_fixup_bundle src dst libs dirs)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${src}" "${dst}")
fixup_bundle("${dst}" "${libs}" "${dirs}")
endfunction(copy_and_fixup_bundle)
-# verify_bundle_prerequisites
-#
-# Verifies that the sum of all prerequisites of all files inside the bundle
-# are contained within the bundle or are "system" libraries, presumed to exist
-# everywhere.
-#
function(verify_bundle_prerequisites bundle result_var info_var)
set(result 1)
set(info "")
@@ -635,12 +698,6 @@ function(verify_bundle_prerequisites bundle result_var info_var)
endfunction(verify_bundle_prerequisites)
-# verify_bundle_symlinks
-#
-# Verifies that any symlinks found in the bundle point to other files that are
-# already also in the bundle... Anything that points to an external file causes
-# this function to fail the verification.
-#
function(verify_bundle_symlinks bundle result_var info_var)
set(result 1)
set(info "")
@@ -654,11 +711,6 @@ function(verify_bundle_symlinks bundle result_var info_var)
endfunction(verify_bundle_symlinks)
-# verify_app
-#
-# Verifies that an application appears valid based on running analysis tools on it.
-# Calls message/FATAL_ERROR if the application is not verified.
-#
function(verify_app app)
set(verified 0)
set(info "")
diff --git a/Modules/CMake.cmake b/Modules/CMake.cmake
index cbdaa35..53a0ddf 100644
--- a/Modules/CMake.cmake
+++ b/Modules/CMake.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file is used by cmake.cxx to compute the CMAKE_ROOT location.
diff --git a/Modules/CMakeASM-ATTInformation.cmake b/Modules/CMakeASM-ATTInformation.cmake
index 51c445b..abf560b 100644
--- a/Modules/CMakeASM-ATTInformation.cmake
+++ b/Modules/CMakeASM-ATTInformation.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# support for AT&T syntax assemblers, e.g. GNU as
diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake
index 0fad25d..b94303e 100644
--- a/Modules/CMakeASMInformation.cmake
+++ b/Modules/CMakeASMInformation.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MESSAGE(STATUS "Loaded CMakeASM${ASM_DIALECT}Information - ASM${ASM_DIALECT} support is still experimental, please report issues")
@@ -28,18 +28,25 @@ IF("${CMAKE_BASE_NAME}" STREQUAL "as")
SET(CMAKE_BASE_NAME gas)
ENDIF("${CMAKE_BASE_NAME}" STREQUAL "as")
-INCLUDE(Platform/${CMAKE_BASE_NAME} OPTIONAL)
+# Load compiler-specific information.
+SET(_INCLUDED_FILE "")
+IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+ INCLUDE(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+IF(NOT _INCLUDED_FILE)
+ INCLUDE(Platform/${CMAKE_BASE_NAME} OPTIONAL)
+ENDIF(NOT _INCLUDED_FILE)
IF(CMAKE_SYSTEM_PROCESSOR)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+ INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+ IF(NOT _INCLUDED_FILE)
+ INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+ ENDIF(NOT _INCLUDED_FILE)
ENDIF(CMAKE_SYSTEM_PROCESSOR)
-IF(NOT _INCLUDED_FILE)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-ASM-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
-ENDIF(NOT _INCLUDED_FILE)
-INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
IF(NOT _INCLUDED_FILE)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-ASM OPTIONAL)
+ INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
ENDIF(NOT _INCLUDED_FILE)
# Set default assembler file extensions:
diff --git a/Modules/CMakeASM_MASMInformation.cmake b/Modules/CMakeASM_MASMInformation.cmake
index 2f27d2a..4e1386f 100644
--- a/Modules/CMakeASM_MASMInformation.cmake
+++ b/Modules/CMakeASM_MASMInformation.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# support for the MS assembler, masm and masm64
diff --git a/Modules/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake
index c6537cf..00e5688 100644
--- a/Modules/CMakeBackwardCompatibilityC.cmake
+++ b/Modules/CMakeBackwardCompatibilityC.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Nothing here yet
diff --git a/Modules/CMakeBackwardCompatibilityCXX.cmake b/Modules/CMakeBackwardCompatibilityCXX.cmake
index a4175e8..707bbde 100644
--- a/Modules/CMakeBackwardCompatibilityCXX.cmake
+++ b/Modules/CMakeBackwardCompatibilityCXX.cmake
@@ -16,7 +16,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
diff --git a/Modules/CMakeBorlandFindMake.cmake b/Modules/CMakeBorlandFindMake.cmake
index d908168..1ef28df 100644
--- a/Modules/CMakeBorlandFindMake.cmake
+++ b/Modules/CMakeBorlandFindMake.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
SET (CMAKE_MAKE_PROGRAM "make" CACHE STRING
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index fb4f0e8..86a824a 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file sets the basic flags for the C language in CMake.
@@ -26,6 +26,8 @@ ELSE(UNIX)
SET(CMAKE_C_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
+SET(_INCLUDED_FILE 0)
+
# Load compiler-specific information.
IF(CMAKE_C_COMPILER_ID)
INCLUDE(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL)
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index b264da1..d7ae8d9 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -21,8 +21,8 @@ IF(CMAKE_COMPILER_IS_MINGW)
SET(MINGW 1)
ENDIF(CMAKE_COMPILER_IS_MINGW)
SET(CMAKE_CXX_COMPILER_ID_RUN 1)
-SET(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;H;o;O;obj;OBJ;def;DEF;rc;RC)
-SET(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm)
+SET(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
+SET(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
SET(CMAKE_CXX_LINKER_PREFERENCE 30)
SET(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 0a7e990..680f8fd 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file sets the basic flags for the C++ language in CMake.
@@ -26,6 +26,8 @@ ELSE(UNIX)
SET(CMAKE_CXX_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
+SET(_INCLUDED_FILE 0)
+
# Load compiler-specific information.
IF(CMAKE_CXX_COMPILER_ID)
INCLUDE(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL)
diff --git a/Modules/CMakeCommonLanguageInclude.cmake b/Modules/CMakeCommonLanguageInclude.cmake
index 80d5678..237f8dd 100644
--- a/Modules/CMakeCommonLanguageInclude.cmake
+++ b/Modules/CMakeCommonLanguageInclude.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# this file has flags that are shared across languages and sets
diff --git a/Modules/CMakeDependentOption.cmake b/Modules/CMakeDependentOption.cmake
index 4d978c4..8b8dc07 100644
--- a/Modules/CMakeDependentOption.cmake
+++ b/Modules/CMakeDependentOption.cmake
@@ -22,7 +22,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CMAKE_DEPENDENT_OPTION option doc default depends force)
diff --git a/Modules/CMakeDetermineASM-ATTCompiler.cmake b/Modules/CMakeDetermineASM-ATTCompiler.cmake
index 99c591b..9dd2f11 100644
--- a/Modules/CMakeDetermineASM-ATTCompiler.cmake
+++ b/Modules/CMakeDetermineASM-ATTCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# determine the compiler to use for ASM using AT&T syntax, e.g. GNU as
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index adf1408..06dd6b8 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# determine the compiler to use for ASM programs
@@ -38,9 +38,9 @@ ELSE(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
# we only get here if CMAKE_ASM${ASM_DIALECT}_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
#
- # if a compiler was specified by the user but without path,
+ # if a compiler was specified by the user but without path,
# now try to find it with the full path
- # if it is found, force it into the cache,
+ # if it is found, force it into the cache,
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
GET_FILENAME_COMPONENT(_CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
IF(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
@@ -57,11 +57,30 @@ IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
-# If we have a gas/as cross compiler, they have usually some prefix, like
+
+IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+
+ # Table of per-vendor compiler id flags with expected output.
+ LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU )
+ SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_GNU "--version")
+ SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_GNU "GNU assembler")
+
+ CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
+
+ IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+ MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
+ ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+ MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
+ ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+
+ENDIF()
+
+
+# If we have a gas/as cross compiler, they have usually some prefix, like
# e.g. powerpc-linux-gas, arm-elf-gas or i586-mingw32msvc-gas .
# The other tools of the toolchain usually have the same prefix
# NAME_WE cannot be used since then this test will fail for names lile
-# "arm-unknown-nto-qnx6.3.0-gas.exe", where BASENAME would be
+# "arm-unknown-nto-qnx6.3.0-gas.exe", where BASENAME would be
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME)
@@ -86,7 +105,7 @@ SET(_CMAKE_ASM_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1}")
SET(_CMAKE_ASM_COMPILER_ENV_VAR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR}")
# configure variables set in this file for fast reload later on
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
+CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeASM${ASM_DIALECT}Compiler.cmake IMMEDIATE @ONLY)
SET(_CMAKE_ASM_COMPILER)
diff --git a/Modules/CMakeDetermineASM_MASMCompiler.cmake b/Modules/CMakeDetermineASM_MASMCompiler.cmake
index 8223ea0..e23f7db 100644
--- a/Modules/CMakeDetermineASM_MASMCompiler.cmake
+++ b/Modules/CMakeDetermineASM_MASMCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Find the MS assembler (masm or masm64)
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 17fa05f..639b426 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# determine the compiler to use for C programs
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 1170106..555d20e 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# determine the compiler to use for C++ programs
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index aa4733b..d6df305 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Function to compile a source file to identify the compiler ABI.
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 4a800a8..bf78a5b 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Function to compile a source file to identify the compiler. This is
@@ -63,7 +63,7 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
SET(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
- SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
+ SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID)
@@ -247,7 +247,7 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
# Return the information extracted.
SET(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
- SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
+ SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE)
SET(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
@@ -261,6 +261,17 @@ ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
# We try running the compiler with the flag for each vendor and
# matching its regular expression in the output.
FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
+
+ IF(NOT CMAKE_${lang}_COMPILER_ID_DIR)
+ # We get here when this function is called not from within CMAKE_DETERMINE_COMPILER_ID()
+ # This is done e.g. for detecting the compiler ID for assemblers.
+ # Compute the directory in which to run the test and Create a clean working directory.
+ SET(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
+ FILE(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
+ FILE(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
+ ENDIF(NOT CMAKE_${lang}_COMPILER_ID_DIR)
+
+
FOREACH(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS})
SET(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}})
SET(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}})
@@ -272,6 +283,7 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
OUTPUT_VARIABLE output ERROR_VARIABLE output
RESULT_VARIABLE result
+ TIMEOUT 10
)
IF("${output}" MATCHES "${regex}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
@@ -280,9 +292,15 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
SET(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
BREAK()
ELSE()
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
- "did not match \"${regex}\":\n${output}")
+ IF("${result}" MATCHES "timeout")
+ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
+ "terminated after 10 s due to timeout.")
+ ELSE()
+ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
+ "did not match \"${regex}\":\n${output}")
+ ENDIF()
ENDIF()
ENDFOREACH()
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR)
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 34477a1..03ddd78 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# determine the compiler to use for Fortran programs
diff --git a/Modules/CMakeDetermineJavaCompiler.cmake b/Modules/CMakeDetermineJavaCompiler.cmake
index 483db6b..aefcaba 100644
--- a/Modules/CMakeDetermineJavaCompiler.cmake
+++ b/Modules/CMakeDetermineJavaCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# determine the compiler to use for Java programs
diff --git a/Modules/CMakeDetermineRCCompiler.cmake b/Modules/CMakeDetermineRCCompiler.cmake
index e1b6df2..094b893 100644
--- a/Modules/CMakeDetermineRCCompiler.cmake
+++ b/Modules/CMakeDetermineRCCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# determine the compiler to use for C programs
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index 623caf9..0e65bce 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is used by the Makefile generator to determin the following variables:
@@ -47,17 +47,17 @@ IF(CMAKE_HOST_UNIX)
IF(CMAKE_UNAME)
EXEC_PROGRAM(uname ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_NAME)
EXEC_PROGRAM(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
- IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux")
+ IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*")
EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val)
- ELSE(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux")
+ ELSE(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*")
EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val)
IF("${val}" GREATER 0)
EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val)
ENDIF("${val}" GREATER 0)
- ENDIF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux")
+ ENDIF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*")
# check the return of the last uname -m or -p
IF("${val}" GREATER 0)
SET(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
diff --git a/Modules/CMakeDetermineVSServicePack.cmake b/Modules/CMakeDetermineVSServicePack.cmake
index a5bb528..a877e6e 100644
--- a/Modules/CMakeDetermineVSServicePack.cmake
+++ b/Modules/CMakeDetermineVSServicePack.cmake
@@ -23,8 +23,8 @@
# ===========================
#=============================================================================
-# Copyright 2009 Kitware, Inc.
-# Copyright 2009 Philip Lowman <philip@yhbt.com>
+# Copyright 2009-2010 Kitware, Inc.
+# Copyright 2009-2010 Philip Lowman <philip@yhbt.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -33,7 +33,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# [INTERNAL]
@@ -47,6 +47,8 @@ function(_DetermineVSServicePackFromCompiler _OUT_VAR _cl_version)
set(_version "vc90")
elseif(${_cl_version} VERSION_EQUAL "15.00.30729.01")
set(_version "vc90sp1")
+ elseif(${_cl_version} VERSION_EQUAL "16.00.30319.01")
+ set(_version "vc100")
else()
set(_version "")
endif()
diff --git a/Modules/CMakeExportBuildSettings.cmake b/Modules/CMakeExportBuildSettings.cmake
index f7d7de1..8d316b9 100644
--- a/Modules/CMakeExportBuildSettings.cmake
+++ b/Modules/CMakeExportBuildSettings.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is purposely no longer documented. It does nothing useful.
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index d27c978..64ec403 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -26,7 +26,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# if it's the MS C/CXX compiler, search for link
diff --git a/Modules/CMakeFindCodeBlocks.cmake b/Modules/CMakeFindCodeBlocks.cmake
index 0dbe20f..c72c8f7 100644
--- a/Modules/CMakeFindCodeBlocks.cmake
+++ b/Modules/CMakeFindCodeBlocks.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file is included in CMakeSystemSpecificInformation.cmake if
diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake
index f479285..836e4c9 100644
--- a/Modules/CMakeFindEclipseCDT4.cmake
+++ b/Modules/CMakeFindEclipseCDT4.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file is included in CMakeSystemSpecificInformation.cmake if
@@ -22,8 +22,8 @@ FIND_PROGRAM(CMAKE_ECLIPSE_EXECUTABLE NAMES eclipse DOC "The Eclipse executable"
# so that Eclipse ca find the headers at runtime and parsing etc. works better
# This is done here by actually running gcc with the options so it prints its
# system include directories, which are parsed then and stored in the cache.
-MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _result _resultDefines)
- SET(${_result})
+MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines)
+ SET(${_resultIncludeDirs})
SET(_gccOutput)
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -v -E -x ${_lang} -dD dummy
@@ -32,24 +32,43 @@ MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _result _resultDefines)
OUTPUT_VARIABLE _gccStdout )
FILE(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
+ # First find the system include dirs:
IF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list" )
- SET(${_result} ${CMAKE_MATCH_1})
- STRING(REPLACE "\n" " " ${_result} "${${_result}}")
- SEPARATE_ARGUMENTS(${_result})
+
+ # split the output into lines and then remove leading and trailing spaces from each of them:
+ STRING(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
+ FOREACH(nextLine ${_includeLines})
+ STRING(STRIP "${nextLine}" _includePath)
+ LIST(APPEND ${_resultIncludeDirs} "${_includePath}")
+ ENDFOREACH(nextLine)
+
ENDIF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list" )
-
- IF( "${_gccStdout}" MATCHES "built-in>\"\n(.+)# 1 +\"dummy\"" )
- SET(_builtinDefines ${CMAKE_MATCH_1})
- # Remove the '# 1 "<command-line>"' lines
- STRING(REGEX REPLACE "# 1[^\n]+\n" "" _filteredOutput "${_builtinDefines}")
- # Remove the "#define " parts from the output:
- STRING(REGEX REPLACE "#define " "" _defineRemoved "${_filteredOutput}")
- # Replace the line breaks with spaces, so we can use separate arguments afterwards
- STRING(REGEX REPLACE "\n" " " _defineRemoved "${_defineRemoved}")
- # Remove space at the end, this would produce empty list items
- STRING(REGEX REPLACE " +$" "" ${_resultDefines} "${_defineRemoved}")
- SEPARATE_ARGUMENTS(${_resultDefines})
- ENDIF( "${_gccStdout}" MATCHES "built-in>\"\n(.+)# 1 +\"dummy\"" )
+
+
+ # now find the builtin macros:
+ STRING(REGEX MATCHALL "#define[^\n]+\n" _defineLines "${_gccStdout}")
+# A few example lines which the regexp below has to match properly:
+# #define MAX(a,b) ((a) > (b) ? (a) : (b))
+# #define __fastcall __attribute__((__fastcall__))
+# #define FOO (23)
+# #define __UINTMAX_TYPE__ long long unsigned int
+# #define __UINTMAX_TYPE__ long long unsigned int
+# #define __i386__ 1
+
+ FOREACH(nextLine ${_defineLines})
+ STRING(REGEX MATCH "^#define +([A-Za-z_][A-Za-z0-9_]*)(\\([^\\)]+\\))? +(.+) *$" _dummy "${nextLine}")
+ SET(_name "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
+ STRING(STRIP "${CMAKE_MATCH_3}" _value)
+ #MESSAGE(STATUS "m1: -${CMAKE_MATCH_1}- m2: -${CMAKE_MATCH_2}- m3: -${CMAKE_MATCH_3}-")
+
+ LIST(APPEND ${_resultDefines} "${_name}")
+ IF(_value)
+ LIST(APPEND ${_resultDefines} "${_value}")
+ ELSE()
+ LIST(APPEND ${_resultDefines} " ")
+ ENDIF()
+ ENDFOREACH(nextLine)
+
ENDMACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang)
# Save the current LC_ALL, LC_MESSAGES, and LANG environment variables and set them
diff --git a/Modules/CMakeFindFrameworks.cmake b/Modules/CMakeFindFrameworks.cmake
index 1bc8935..001da20 100644
--- a/Modules/CMakeFindFrameworks.cmake
+++ b/Modules/CMakeFindFrameworks.cmake
@@ -10,7 +10,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
diff --git a/Modules/CMakeFindKDevelop3.cmake b/Modules/CMakeFindKDevelop3.cmake
index 1c77365..331dc6e 100644
--- a/Modules/CMakeFindKDevelop3.cmake
+++ b/Modules/CMakeFindKDevelop3.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file is included in CMakeSystemSpecificInformation.cmake if
diff --git a/Modules/CMakeFindWMake.cmake b/Modules/CMakeFindWMake.cmake
index e4bbb3d..6972c4c 100644
--- a/Modules/CMakeFindWMake.cmake
+++ b/Modules/CMakeFindWMake.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
SET (CMAKE_MAKE_PROGRAM "wmake" CACHE STRING
diff --git a/Modules/CMakeFindXCode.cmake b/Modules/CMakeFindXCode.cmake
index 240f936..53967b5 100644
--- a/Modules/CMakeFindXCode.cmake
+++ b/Modules/CMakeFindXCode.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
diff --git a/Modules/CMakeForceCompiler.cmake b/Modules/CMakeForceCompiler.cmake
index b7a681a..2a839fd 100644
--- a/Modules/CMakeForceCompiler.cmake
+++ b/Modules/CMakeForceCompiler.cmake
@@ -39,7 +39,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CMAKE_FORCE_C_COMPILER compiler id)
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index 97a5e7e..f6a52c6 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -9,13 +9,15 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file sets the basic flags for the Fortran language in CMake.
# It also loads the available platform file for the system-compiler
# if it exists.
+SET(_INCLUDED_FILE 0)
+
# Load compiler-specific information.
IF(CMAKE_Fortran_COMPILER_ID)
INCLUDE(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL)
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index c0f3aa6..b5d3072 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
@@ -52,6 +52,94 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles")
ENDIF(DEFINED CMAKE_RULE_MESSAGES)
ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
+
+# GetDefaultWindowsPrefixBase
+#
+# Compute the base directory for CMAKE_INSTALL_PREFIX based on:
+# - is this 32-bit or 64-bit Windows
+# - is this 32-bit or 64-bit CMake running
+# - what architecture targets will be built
+#
+function(GetDefaultWindowsPrefixBase var)
+
+ # Try to guess what architecture targets will end up being built as,
+ # even if CMAKE_SIZEOF_VOID_P is not computed yet... We need to know
+ # the architecture of the targets being built to choose the right
+ # default value for CMAKE_INSTALL_PREFIX.
+ #
+ if("${CMAKE_GENERATOR}" MATCHES "Win64")
+ set(arch_hint "x64")
+ elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
+ set(arch_hint "x64")
+ elseif("$ENV{LIB}" MATCHES "(amd64|ia64)")
+ set(arch_hint "x64")
+ endif()
+
+ if(NOT arch_hint)
+ set(arch_hint "x86")
+ endif()
+
+ # default env in a 64-bit app on Win64:
+ # ProgramFiles=C:\Program Files
+ # ProgramFiles(x86)=C:\Program Files (x86)
+ # ProgramW6432=C:\Program Files
+ #
+ # default env in a 32-bit app on Win64:
+ # ProgramFiles=C:\Program Files (x86)
+ # ProgramFiles(x86)=C:\Program Files (x86)
+ # ProgramW6432=C:\Program Files
+ #
+ # default env in a 32-bit app on Win32:
+ # ProgramFiles=C:\Program Files
+ # ProgramFiles(x86) NOT DEFINED
+ # ProgramW6432 NOT DEFINED
+
+ # By default, use the ProgramFiles env var as the base value of
+ # CMAKE_INSTALL_PREFIX:
+ #
+ set(_PREFIX_ENV_VAR "ProgramFiles")
+
+ if ("$ENV{ProgramW6432}" STREQUAL "")
+ # running on 32-bit Windows
+ # must be a 32-bit CMake, too...
+ #message("guess: this is a 32-bit CMake running on 32-bit Windows")
+ else()
+ # running on 64-bit Windows
+ if ("$ENV{ProgramW6432}" STREQUAL "$ENV{ProgramFiles}")
+ # 64-bit CMake
+ #message("guess: this is a 64-bit CMake running on 64-bit Windows")
+ if(NOT "${arch_hint}" STREQUAL "x64")
+ # building 32-bit targets
+ set(_PREFIX_ENV_VAR "ProgramFiles(x86)")
+ endif()
+ else()
+ # 32-bit CMake
+ #message("guess: this is a 32-bit CMake running on 64-bit Windows")
+ if("${arch_hint}" STREQUAL "x64")
+ # building 64-bit targets
+ set(_PREFIX_ENV_VAR "ProgramW6432")
+ endif()
+ endif()
+ endif()
+
+ #if("${arch_hint}" STREQUAL "x64")
+ # message("guess: you are building a 64-bit app")
+ #else()
+ # message("guess: you are building a 32-bit app")
+ #endif()
+
+ if(NOT "$ENV{${_PREFIX_ENV_VAR}}" STREQUAL "")
+ file(TO_CMAKE_PATH "$ENV{${_PREFIX_ENV_VAR}}" _base)
+ elseif(NOT "$ENV{SystemDrive}" STREQUAL "")
+ set(_base "$ENV{SystemDrive}/Program Files")
+ else()
+ set(_base "C:/Program Files")
+ endif()
+
+ set(${var} "${_base}" PARENT_SCOPE)
+endfunction()
+
+
# Set a variable to indicate whether the value of CMAKE_INSTALL_PREFIX
# was initialized by the block below. This is useful for user
# projects to change the default prefix while still allowing the
@@ -65,23 +153,11 @@ IF(CMAKE_HOST_UNIX)
SET(CMAKE_INSTALL_PREFIX "/usr/local"
CACHE PATH "Install path prefix, prepended onto install directories.")
ELSE(CMAKE_HOST_UNIX)
- IF("$ENV{ProgramFiles}" MATCHES "^$")
- IF("$ENV{SystemDrive}" MATCHES "^$")
- SET(CMAKE_GENERIC_PROGRAM_FILES "C:/Program Files")
- ELSE("$ENV{SystemDrive}" MATCHES "^$")
- SET(CMAKE_GENERIC_PROGRAM_FILES "$ENV{SystemDrive}/Program Files")
- ENDIF("$ENV{SystemDrive}" MATCHES "^$")
- ELSE("$ENV{ProgramFiles}" MATCHES "^$")
- SET(CMAKE_GENERIC_PROGRAM_FILES "$ENV{ProgramFiles}")
- ENDIF("$ENV{ProgramFiles}" MATCHES "^$")
+ GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
SET(CMAKE_INSTALL_PREFIX
"${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
CACHE PATH "Install path prefix, prepended onto install directories.")
SET(CMAKE_GENERIC_PROGRAM_FILES)
-
- # Make sure the prefix uses forward slashes.
- STRING(REGEX REPLACE "\\\\" "/"
- CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
ENDIF(CMAKE_HOST_UNIX)
MARK_AS_ADVANCED(
diff --git a/Modules/CMakeImportBuildSettings.cmake b/Modules/CMakeImportBuildSettings.cmake
index 968bc79..848d894 100644
--- a/Modules/CMakeImportBuildSettings.cmake
+++ b/Modules/CMakeImportBuildSettings.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is purposely no longer documented. It does nothing useful.
diff --git a/Modules/CMakeJOMFindMake.cmake b/Modules/CMakeJOMFindMake.cmake
index a72420a..617f3bb 100644
--- a/Modules/CMakeJOMFindMake.cmake
+++ b/Modules/CMakeJOMFindMake.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
diff --git a/Modules/CMakeJavaInformation.cmake b/Modules/CMakeJavaInformation.cmake
index f537da5..e9bc9be 100644
--- a/Modules/CMakeJavaInformation.cmake
+++ b/Modules/CMakeJavaInformation.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This should be included before the _INIT variables are
diff --git a/Modules/CMakeMSYSFindMake.cmake b/Modules/CMakeMSYSFindMake.cmake
index e95f74f..95492a0 100644
--- a/Modules/CMakeMSYSFindMake.cmake
+++ b/Modules/CMakeMSYSFindMake.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM make
diff --git a/Modules/CMakeMinGWFindMake.cmake b/Modules/CMakeMinGWFindMake.cmake
index 68e8442..f760d74 100644
--- a/Modules/CMakeMinGWFindMake.cmake
+++ b/Modules/CMakeMinGWFindMake.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM mingw32-make.exe PATHS
diff --git a/Modules/CMakeNMakeFindMake.cmake b/Modules/CMakeNMakeFindMake.cmake
index 84ea56d..f647217 100644
--- a/Modules/CMakeNMakeFindMake.cmake
+++ b/Modules/CMakeNMakeFindMake.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
diff --git a/Modules/CMakeParseArguments.cmake b/Modules/CMakeParseArguments.cmake
new file mode 100644
index 0000000..7ce4c49
--- /dev/null
+++ b/Modules/CMakeParseArguments.cmake
@@ -0,0 +1,138 @@
+# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
+#
+# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for
+# parsing the arguments given to that macro or function.
+# It processes the arguments and defines a set of variables which hold the
+# values of the respective options.
+#
+# The <options> argument contains all options for the respective macro,
+# i.e. keywords which can be used when calling the macro without any value
+# following, like e.g. the OPTIONAL keyword of the install() command.
+#
+# The <one_value_keywords> argument contains all keywords for this macro
+# which are followed by one value, like e.g. DESTINATION keyword of the
+# install() command.
+#
+# The <multi_value_keywords> argument contains all keywords for this macro
+# which can be followed by more than one value, like e.g. the TARGETS or
+# FILES keywords of the install() command.
+#
+# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
+# keywords listed in <options>, <one_value_keywords> and
+# <multi_value_keywords> a variable composed of the given <prefix>
+# followed by "_" and the name of the respective keyword.
+# These variables will then hold the respective value from the argument list.
+# For the <options> keywords this will be TRUE or FALSE.
+#
+# All remaining arguments are collected in a variable
+# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether
+# your macro was called with unrecognized parameters.
+#
+# As an example here a my_install() macro, which takes similar arguments as the
+# real install() command:
+#
+# function(MY_INSTALL)
+# set(options OPTIONAL FAST)
+# set(oneValueArgs DESTINATION RENAME)
+# set(multiValueArgs TARGETS CONFIGURATIONS)
+# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
+# ...
+#
+# Assume my_install() has been called like this:
+# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
+#
+# After the cmake_parse_arguments() call the macro will have set the following
+# variables:
+# MY_INSTALL_OPTIONAL = TRUE
+# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
+# MY_INSTALL_DESTINATION = "bin"
+# MY_INSTALL_RENAME = "" (was not used)
+# MY_INSTALL_TARGETS = "foo;bar"
+# MY_INSTALL_CONFIGURATIONS = "" (was not used)
+# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
+#
+# You can the continue and process these variables.
+#
+# Keywords terminate lists of values, e.g. if directly after a one_value_keyword
+# another recognized keyword follows, this is interpreted as the beginning of
+# the new option.
+# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in
+# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would
+# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
+
+#=============================================================================
+# Copyright 2010 Alexander Neundorf <neundorf@kde.org>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+
+if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
+ return()
+endif()
+set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
+
+
+function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
+ # first set all result variables to empty/FALSE
+ foreach(arg_name ${_singleArgNames} ${_multiArgNames})
+ set(${prefix}_${arg_name})
+ endforeach(arg_name)
+
+ foreach(option ${_optionNames})
+ set(${prefix}_${option} FALSE)
+ endforeach(option)
+
+ set(${prefix}_UNPARSED_ARGUMENTS)
+
+ set(insideValues FALSE)
+ set(currentArgName)
+
+ # now iterate over all arguments and fill the result variables
+ foreach(currentArg ${ARGN})
+ list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword
+ list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword
+ list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword
+
+ if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1)
+ if(insideValues)
+ if("${insideValues}" STREQUAL "SINGLE")
+ set(${prefix}_${currentArgName} ${currentArg})
+ set(insideValues FALSE)
+ elseif("${insideValues}" STREQUAL "MULTI")
+ list(APPEND ${prefix}_${currentArgName} ${currentArg})
+ endif()
+ else(insideValues)
+ list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
+ endif(insideValues)
+ else()
+ if(NOT ${optionIndex} EQUAL -1)
+ set(${prefix}_${currentArg} TRUE)
+ set(insideValues FALSE)
+ elseif(NOT ${singleArgIndex} EQUAL -1)
+ set(currentArgName ${currentArg})
+ set(${prefix}_${currentArgName})
+ set(insideValues "SINGLE")
+ elseif(NOT ${multiArgIndex} EQUAL -1)
+ set(currentArgName ${currentArg})
+ set(${prefix}_${currentArgName})
+ set(insideValues "MULTI")
+ endif()
+ endif()
+
+ endforeach(currentArg)
+
+ # propagate the result variables to the caller:
+ foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
+ set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
+ endforeach(arg_name)
+ set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
+
+endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs)
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index 1761d28..defdb47 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Function parse implicit linker options.
diff --git a/Modules/CMakePrintSystemInformation.cmake b/Modules/CMakePrintSystemInformation.cmake
index 3f33ce8..2c5d0f2 100644
--- a/Modules/CMakePrintSystemInformation.cmake
+++ b/Modules/CMakePrintSystemInformation.cmake
@@ -13,7 +13,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MESSAGE("CMAKE_SYSTEM is ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}")
diff --git a/Modules/CMakeRCInformation.cmake b/Modules/CMakeRCInformation.cmake
index f6509fb..fcd0099 100644
--- a/Modules/CMakeRCInformation.cmake
+++ b/Modules/CMakeRCInformation.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake
index 75d737f..faa9e36 100644
--- a/Modules/CMakeSystemSpecificInformation.cmake
+++ b/Modules/CMakeSystemSpecificInformation.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file is included by cmGlobalGenerator::EnableLanguage.
diff --git a/Modules/CMakeTestASM-ATTCompiler.cmake b/Modules/CMakeTestASM-ATTCompiler.cmake
index 9ba306a..3b7a74f 100644
--- a/Modules/CMakeTestASM-ATTCompiler.cmake
+++ b/Modules/CMakeTestASM-ATTCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file is used by EnableLanguage in cmGlobalGenerator to
diff --git a/Modules/CMakeTestASMCompiler.cmake b/Modules/CMakeTestASMCompiler.cmake
index d62a79a..54def81 100644
--- a/Modules/CMakeTestASMCompiler.cmake
+++ b/Modules/CMakeTestASMCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file is used by EnableLanguage in cmGlobalGenerator to
diff --git a/Modules/CMakeTestASM_MASMCompiler.cmake b/Modules/CMakeTestASM_MASMCompiler.cmake
index 63207e3..84ca98f 100644
--- a/Modules/CMakeTestASM_MASMCompiler.cmake
+++ b/Modules/CMakeTestASM_MASMCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file is used by EnableLanguage in cmGlobalGenerator to
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index bac9932..038c2fd 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CMakeTestCompilerCommon)
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index 06ef301..c1a3b3a 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CMakeTestCompilerCommon)
diff --git a/Modules/CMakeTestCompilerCommon.cmake b/Modules/CMakeTestCompilerCommon.cmake
index 4307627..fd8a105 100644
--- a/Modules/CMakeTestCompilerCommon.cmake
+++ b/Modules/CMakeTestCompilerCommon.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
function(PrintTestCompilerStatus LANG MSG)
diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake
index 61d6336..33f62eb 100644
--- a/Modules/CMakeTestFortranCompiler.cmake
+++ b/Modules/CMakeTestFortranCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CMakeTestCompilerCommon)
diff --git a/Modules/CMakeTestJavaCompiler.cmake b/Modules/CMakeTestJavaCompiler.cmake
index 546d9b9..cfd3e24 100644
--- a/Modules/CMakeTestJavaCompiler.cmake
+++ b/Modules/CMakeTestJavaCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file is used by EnableLanguage in cmGlobalGenerator to
diff --git a/Modules/CMakeTestRCCompiler.cmake b/Modules/CMakeTestRCCompiler.cmake
index 194f860..a5c8d11 100644
--- a/Modules/CMakeTestRCCompiler.cmake
+++ b/Modules/CMakeTestRCCompiler.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file is used by EnableLanguage in cmGlobalGenerator to
diff --git a/Modules/CMakeUnixFindMake.cmake b/Modules/CMakeUnixFindMake.cmake
index 8c9e031..39962c0 100644
--- a/Modules/CMakeUnixFindMake.cmake
+++ b/Modules/CMakeUnixFindMake.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES gmake make smake)
diff --git a/Modules/CMakeVS10FindMake.cmake b/Modules/CMakeVS10FindMake.cmake
index 460de25..af5f3a7 100644
--- a/Modules/CMakeVS10FindMake.cmake
+++ b/Modules/CMakeVS10FindMake.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# We use MSBuild as the build tool for VS 10
diff --git a/Modules/CMakeVS6BackwardCompatibility.cmake b/Modules/CMakeVS6BackwardCompatibility.cmake
index 8370896..438f64f 100644
--- a/Modules/CMakeVS6BackwardCompatibility.cmake
+++ b/Modules/CMakeVS6BackwardCompatibility.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# hard code these for fast backwards compatibility tests
diff --git a/Modules/CMakeVS6FindMake.cmake b/Modules/CMakeVS6FindMake.cmake
index 0dd21a8..dccf8c4 100644
--- a/Modules/CMakeVS6FindMake.cmake
+++ b/Modules/CMakeVS6FindMake.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
@@ -22,3 +22,4 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(MSVC60 1)
+SET(MSVC_VERSION 1200)
diff --git a/Modules/CMakeVS71FindMake.cmake b/Modules/CMakeVS71FindMake.cmake
index 8fd332c..2381adb 100644
--- a/Modules/CMakeVS71FindMake.cmake
+++ b/Modules/CMakeVS71FindMake.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
@@ -23,3 +23,4 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(MSVC71 1)
+SET(MSVC_VERSION 1310)
diff --git a/Modules/CMakeVS7BackwardCompatibility.cmake b/Modules/CMakeVS7BackwardCompatibility.cmake
index 3c78953..df0b3bb 100644
--- a/Modules/CMakeVS7BackwardCompatibility.cmake
+++ b/Modules/CMakeVS7BackwardCompatibility.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# hard code these for fast backwards compatibility tests
diff --git a/Modules/CMakeVS7FindMake.cmake b/Modules/CMakeVS7FindMake.cmake
index 7f65a28..665158c 100644
--- a/Modules/CMakeVS7FindMake.cmake
+++ b/Modules/CMakeVS7FindMake.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
@@ -22,3 +22,4 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(MSVC70 1)
+SET(MSVC_VERSION 1300)
diff --git a/Modules/CMakeVS8FindMake.cmake b/Modules/CMakeVS8FindMake.cmake
index 2f03e60..bb08180 100644
--- a/Modules/CMakeVS8FindMake.cmake
+++ b/Modules/CMakeVS8FindMake.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# VCExpress does not support cross compiling, which is necessary for Win CE
diff --git a/Modules/CMakeVS9FindMake.cmake b/Modules/CMakeVS9FindMake.cmake
index 4704bcc..9e3c39e 100644
--- a/Modules/CMakeVS9FindMake.cmake
+++ b/Modules/CMakeVS9FindMake.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# VCExpress does not support cross compiling, which is necessary for Win CE
diff --git a/Modules/CMakeVerifyManifest.cmake b/Modules/CMakeVerifyManifest.cmake
index dbba464..7578369 100644
--- a/Modules/CMakeVerifyManifest.cmake
+++ b/Modules/CMakeVerifyManifest.cmake
@@ -26,7 +26,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 2991ada..7033e31 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -19,9 +19,41 @@
# described below, for more information about component-specific
# installations.
#
-# Before including the CPack module, there are a variety of variables
-# that can be set to customize the resulting installers. The most
-# commonly-used variables are:
+# The CPACK_GENERATOR variable has different meanings in different
+# contexts. In your CMakeLists.txt file, CPACK_GENERATOR is a
+# *list of generators*: when run with no other arguments, CPack
+# will iterate over that list and produce one package for each
+# generator. In a CPACK_PROJECT_CONFIG_FILE, though, CPACK_GENERATOR
+# is a *string naming a single generator*. If you need per-cpack-
+# generator logic to control *other* cpack settings, then you need
+# a CPACK_PROJECT_CONFIG_FILE.
+#
+# The CMake source tree itself contains a CPACK_PROJECT_CONFIG_FILE.
+# See the top level file CMakeCPackOptions.cmake.in for an example.
+#
+# If set, the CPACK_PROJECT_CONFIG_FILE is included automatically
+# on a per-generator basis. It only need contain overrides.
+#
+# Here's how it works:
+# - cpack runs
+# - it includes CPackConfig.cmake
+# - it iterates over the generators listed in that file's
+# CPACK_GENERATOR list variable (unless told to use just a
+# specific one via -G on the command line...)
+#
+# - foreach generator, it then
+# - sets CPACK_GENERATOR to the one currently being iterated
+# - includes the CPACK_PROJECT_CONFIG_FILE
+# - produces the package for that generator
+#
+# This is the key: For each generator listed in CPACK_GENERATOR
+# in CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR
+# internally to *the one currently being used* and then include
+# the CPACK_PROJECT_CONFIG_FILE.
+#
+# Before including this CPack module in your CMakeLists.txt file,
+# there are a variety of variables that can be set to customize
+# the resulting installers. The most commonly-used variables are:
#
# CPACK_PACKAGE_NAME - The name of the package (or application). If
# not specified, defaults to the project name.
@@ -48,6 +80,11 @@
# CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the
# target system, e.g., "CMake 2.5".
#
+# CPACK_PROJECT_CONFIG_FILE - File included at cpack time, once per
+# generator after setting CPACK_GENERATOR to the actual generator
+# being used. Allows per-generator setting of CPACK_* variables at
+# cpack time.
+#
# CPACK_RESOURCE_FILE_LICENSE - License file for the project, which
# will typically be displayed to the user (often with an explicit
# "Accept" button, for graphical installers) prior to installation.
@@ -459,7 +496,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Pick a configuration file
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index f5ca592..07d6ff9 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -1,15 +1,18 @@
# - The builtin (binary) CPack Deb generator (Unix only)
# CPackDeb may be used to create Deb package using CPack.
# CPackDeb is a CPack generator thus it uses the CPACK_XXX variables
-# used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration
+# used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration.
+# CPackDeb generator should work on any linux host but it will
+# produce better deb package when Debian specific tools 'dpkg-xxx'
+# are usable on the build system.
#
-# However CPackRPM has specific features which are controlled by
-# the specifics CPACK_RPM_XXX variables.You'll find a detailed usage on
-# the wiki:
+# CPackDeb has specific features which are controlled by
+# the specifics CPACK_DEBIAN_XXX variables.You'll find a detailed usage on
+# the wiki:
# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29
# However as a handy reminder here comes the list of specific variables:
#
-# CPACK_DEBIAN_PACKAGE_NAME
+# CPACK_DEBIAN_PACKAGE_NAME
# Mandatory : YES
# Default : CPACK_PACKAGE_NAME (lower case)
# The debian package summary
@@ -19,12 +22,12 @@
# The debian package version
# CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
# Mandatory : YES
-# Default : Output of dpkg --print-architecture or i386
+# Default : Output of dpkg --print-architecture (or i386 if dpkg is not found)
# The debian package architecture
# CPACK_DEBIAN_PACKAGE_DEPENDS
# Mandatory : NO
# Default : -
-# May be used to set deb dependencies.
+# May be used to set deb dependencies.
# CPACK_DEBIAN_PACKAGE_MAINTAINER
# Mandatory : YES
# Default : CPACK_PACKAGE_CONTACT
@@ -41,6 +44,25 @@
# Mandatory : YES
# Default : 'optional'
# The debian package priority
+# CPACK_DEBIAN_PACKAGE_HOMEPAGE
+# Mandatory : NO
+# Default : -
+# The URL of the web site for this package
+# CPACK_DEBIAN_PACKAGE_SHLIBDEPS
+# Mandatory : NO
+# Default : OFF
+# May be set to ON in order to use dpkg-shlibdeps to generate
+# better package dependency list.
+# You may need set CMAKE_INSTALL_RPATH toi appropriate value
+# if you use this feature, because if you don't dpkg-shlibdeps
+# may fail to find your own shared libs.
+# See http://www.cmake.org/Wiki/CMake_RPATH_handling.
+# CPACK_DEBIAN_PACKAGE_DEBUG
+# Mandatory : NO
+# Default : -
+# May be set when invoking cpack in order to trace debug informations
+# during CPackDeb run.
+
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
@@ -53,7 +75,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# CPack script for creating Debian package
@@ -69,6 +91,103 @@ IF(NOT UNIX)
MESSAGE(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
ENDIF(NOT UNIX)
+# CPACK_DEBIAN_PACKAGE_SHLIBDEPS
+# If specify OFF, only user depends are used
+IF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+ SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
+ENDIF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+
+IF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+ # dpkg-shlibdeps is a Debian utility for generating dependency list
+ FIND_PROGRAM(SHLIBDEPS_EXECUTABLE dpkg-shlibdeps)
+
+ # Check version of the dpkg-shlibdeps tool using CPackRPM method
+ IF(SHLIBDEPS_EXECUTABLE)
+ EXECUTE_PROCESS(COMMAND ${SHLIBDEPS_EXECUTABLE} --version
+ OUTPUT_VARIABLE _TMP_VERSION
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ STRING(REGEX MATCH "dpkg-shlibdeps version ([0-9]+\\.[0-9]+\\.[0-9]+)"
+ SHLIBDEPS_EXECUTABLE_VERSION
+ ${_TMP_VERSION})
+ SET(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
+ IF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ MESSAGE( "CPackDeb Debug: dpkg-shlibdeps version is <${SHLIBDEPS_EXECUTABLE_VERSION}>")
+ ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
+
+ # Generating binary list - Get type of all install files
+ EXECUTE_PROCESS(COMMAND find -type f
+ COMMAND xargs file
+ WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
+ OUTPUT_VARIABLE CPACK_DEB_INSTALL_FILES)
+
+ # Convert to CMake list
+ STRING(REGEX REPLACE "\n" ";" CPACK_DEB_INSTALL_FILES ${CPACK_DEB_INSTALL_FILES})
+
+ # Only dynamically linked ELF files are included
+ # Extract only file name infront of ":"
+ FOREACH ( _FILE ${CPACK_DEB_INSTALL_FILES})
+ IF ( ${_FILE} MATCHES "ELF.*dynamically linked")
+ STRING(REGEX MATCH "(^.*):" _FILE_NAME ${_FILE})
+ LIST(APPEND CPACK_DEB_BINARY_FILES ${CMAKE_MATCH_1})
+ ENDIF()
+ ENDFOREACH()
+
+ MESSAGE( "CPackDeb: - Generating dependency list")
+
+ # Create blank control file for running dpkg-shlibdeps
+ # There might be some other way to invoke dpkg-shlibdeps without creating this file
+ # but standard debian package should not have anything that can collide with this file or directory
+ FILE(MAKE_DIRECTORY ${CPACK_TEMPORARY_DIRECTORY}/debian)
+ FILE(WRITE ${CPACK_TEMPORARY_DIRECTORY}/debian/control "")
+
+ # Execute dpkg-shlibdeps
+ # --ignore-missing-info : allow dpkg-shlibdeps to run even if some libs do not belong to a package
+ # -O : print to STDOUT
+ EXECUTE_PROCESS(COMMAND ${SHLIBDEPS_EXECUTABLE} --ignore-missing-info -O ${CPACK_DEB_BINARY_FILES}
+ WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
+ OUTPUT_VARIABLE SHLIBDEPS_OUTPUT
+ RESULT_VARIABLE SHLIBDEPS_RESULT
+ ERROR_VARIABLE SHLIBDEPS_ERROR
+ OUTPUT_STRIP_TRAILING_WHITESPACE )
+ IF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ # dpkg-shlibdeps will throw some warnings if some input files are not binary
+ MESSAGE( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}")
+ ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ IF (NOT SHLIBDEPS_RESULT EQUAL 0)
+ MESSAGE (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}")
+ ENDIF (NOT SHLIBDEPS_RESULT EQUAL 0)
+
+ #Get rid of prefix generated by dpkg-shlibdeps
+ string (REGEX REPLACE "^.*Depends=" "" CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS ${SHLIBDEPS_OUTPUT})
+
+ IF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ MESSAGE( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
+ ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
+
+ # Remove blank control file
+ # Might not be safe if package actual contain file or directory named debian
+ FILE(REMOVE_RECURSE "${CPACK_TEMPORARY_DIRECTORY}/debian")
+
+ # Append user depend if set
+ IF (CPACK_DEBIAN_PACKAGE_DEPENDS)
+ SET (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
+ ELSE (CPACK_DEBIAN_PACKAGE_DEPENDS)
+ SET (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
+ ENDIF (CPACK_DEBIAN_PACKAGE_DEPENDS)
+
+ ELSE (SHLIBDEPS_EXECUTABLE)
+ IF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ MESSAGE( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.")
+ ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ ENDIF(SHLIBDEPS_EXECUTABLE)
+
+ELSE (CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+ IF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ MESSAGE( "CPackDeb Debug: Using only user-provided depends")
+ ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ENDIF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+
# Let's define the control file found in debian package:
# Binary package:
@@ -84,7 +203,7 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_NAME)
# Version: (mandatory)
IF(NOT CPACK_DEBIAN_PACKAGE_VERSION)
IF(NOT CPACK_PACKAGE_VERSION)
- MESSAGE(FATAL_ERROR "Debian package requires a package version")
+ MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a package version")
ENDIF(NOT CPACK_PACKAGE_VERSION)
SET(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
ENDIF(NOT CPACK_DEBIAN_PACKAGE_VERSION)
@@ -95,7 +214,7 @@ IF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
# $ dpkg --print-architecture
FIND_PROGRAM(DPKG_CMD dpkg)
IF(NOT DPKG_CMD)
- MESSAGE(STATUS "Can not find dpkg in your path, default to i386.")
+ MESSAGE(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
ENDIF(NOT DPKG_CMD)
EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture
@@ -116,7 +235,7 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
# Maintainer: (mandatory)
IF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
IF(NOT CPACK_PACKAGE_CONTACT)
- MESSAGE(FATAL_ERROR "Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER")
+ MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER")
ENDIF(NOT CPACK_PACKAGE_CONTACT)
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
ENDIF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
@@ -124,7 +243,7 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
# Description: (mandatory)
IF(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
- MESSAGE(FATAL_ERROR "Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION")
+ MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION")
ENDIF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
ENDIF(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
@@ -147,13 +266,13 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
# CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# This variable allow advanced user to add custom script to the control.tar.gz (inside the .deb archive)
-# Typical examples are:
+# Typical examples are:
# - conffiles
# - postinst
# - postrm
# - prerm"
# Usage:
-# SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
+# SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 3bf8e0e..3ade3aa 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -4,14 +4,14 @@
# used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration
#
# However CPackRPM has specific features which are controlled by
-# the specifics CPACK_RPM_XXX variables. You'll find a detailed usage on
-# the wiki:
+# the specifics CPACK_RPM_XXX variables. You'll find a detailed usage on
+# the wiki:
# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29
# However as a handy reminder here comes the list of specific variables:
#
-# CPACK_RPM_PACKAGE_SUMMARY
+# CPACK_RPM_PACKAGE_SUMMARY
# Mandatory : YES
-# Default : CPACK_PACKAGE_DESCRIPTION
+# Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
# The RPM package summary
# CPACK_RPM_PACKAGE_NAME
# Mandatory : YES
@@ -24,14 +24,14 @@
# CPACK_RPM_PACKAGE_ARCHITECTURE
# Mandatory : NO
# Default : -
-# The RPM package architecture. This may be set to "noarch" if you
+# The RPM package architecture. This may be set to "noarch" if you
# know you are building a noarch package.
# CPACK_RPM_PACKAGE_RELEASE
# Mandatory : YES
# Default : 1
-# The RPM package release. This is the numbering of the RPM package
-# itself, i.e. the version of the packaging and not the version of the
-# content (see CPACK_RPM_PACKAGE_VERSION). One may change the default
+# The RPM package release. This is the numbering of the RPM package
+# itself, i.e. the version of the packaging and not the version of the
+# content (see CPACK_RPM_PACKAGE_VERSION). One may change the default
# value if the previous packaging was buggy and/or you want to put here
# a fancy Linux distro specific numbering.
# CPACK_RPM_PACKAGE_LICENSE
@@ -42,10 +42,14 @@
# Mandatory : YES
# Default : "unknown"
# The RPM package group.
-# CPACK_RPM_PACKAGE_VENDOR
+# CPACK_RPM_PACKAGE_VENDOR
# Mandatory : YES
# Default : CPACK_PACKAGE_VENDOR if set or "unknown"
-# The RPM package group.
+# The RPM package vendor.
+# CPACK_RPM_PACKAGE_URL
+# Mandatory : NO
+# Default : -
+# The projects URL.
# CPACK_RPM_PACKAGE_DESCRIPTION
# Mandatory : YES
# Default : CPACK_PACKAGE_DESCRIPTION_FILE if set or "no package description available"
@@ -61,18 +65,38 @@
# Mandatory : NO
# Default : -
# May be used to set RPM dependencies (requires).
-# Note that you must enclose the complete requires string between quotes,
+# Note that you must enclose the complete requires string between quotes,
# for example:
# set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8")
-# CPACK_RPM_PACKAGES_PROVIDES
+# CPACK_RPM_PACKAGE_SUGGESTS
+# Mandatory : NO
+# Default : -
+# May be used to set weak RPM dependencies (suggests).
+# Note that you must enclose the complete requires string between quotes.
+# CPACK_RPM_PACKAGE_PROVIDES
# Mandatory : NO
# Default : -
# May be used to set RPM dependencies (provides).
+# CPACK_RPM_PACKAGE_OBSOLETES
+# Mandatory : NO
+# Default : -
+# May be used to set RPM packages that are obsoleted by this one.
+# CPACK_RPM_PACKAGE_RELOCATABLE
+# Mandatory : NO
+# Default : CPACK_PACKAGE_RELOCATABLE
+# If this variable is set to TRUE or ON CPackRPM will try
+# to build a relocatable RPM package. A relocatable RPM may
+# be installed using rpm --prefix or --relocate in order to
+# install it at an alternate place see rpm(8).
+# Note that currently this may fail if CPACK_SET_DESTDIR is set to ON.
+# If CPACK_SET_DESTDIR is set then you will get a warning message
+# but if there is file installed with absolute path you'll get
+# unexpected behavior.
# CPACK_RPM_SPEC_INSTALL_POST
# Mandatory : NO
# Default : -
-# May be used to set an RPM post-install command inside the spec file.
-# For example setting it to "/bin/true" may be used to prevent
+# May be used to set an RPM post-install command inside the spec file.
+# For example setting it to "/bin/true" may be used to prevent
# rpmbuild to strip binaries.
# CPACK_RPM_SPEC_MORE_DEFINE
# Mandatory : NO
@@ -81,19 +105,19 @@
# CPACK_RPM_PACKAGE_DEBUG
# Mandatory : NO
# Default : -
-# May be set when invoking cpack in order to trace debug informations
-# during CPack RPM run. For example you may launch CPack like this
+# May be set when invoking cpack in order to trace debug information
+# during CPack RPM run. For example you may launch CPack like this
# cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM
# CPACK_RPM_USER_BINARY_SPECFILE
# Mandatory : NO
-# Default : -
+# Default : -
# May be set by the user in order to specify a USER binary spec file
# to be used by CPackRPM instead of generating the file.
# The specified file will be processed by CONFIGURE_FILE( @ONLY).
# CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE
# Mandatory : NO
# Default : -
-# If set CPack will generate a template for USER specified binary
+# If set CPack will generate a template for USER specified binary
# spec file and stop with an error. For example launch CPack like this
# cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM
# The user may then use this file in order to hand-craft is own
@@ -116,6 +140,12 @@
# put after the %post or %postun section
# One may verify which scriptlet has been included with
# rpm -qp --scripts package.rpm
+# CPACK_RPM_CHANGELOG_FILE
+# Mandatory : NO
+# Default : -
+# May be used to embbed a changelog in the spec file.
+# The refered file will be read and directly put after the %changelog
+# section.
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
@@ -127,7 +157,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Author: Eric Noulard with the help of Alexander Neundorf.
@@ -141,23 +171,23 @@ IF(NOT UNIX)
ENDIF(NOT UNIX)
# rpmbuild is the basic command for building RPM package
-# it may be a simple (symbolic) link to rpmb command.
+# it may be a simple (symbolic) link to rpm command.
FIND_PROGRAM(RPMBUILD_EXECUTABLE rpmbuild)
-# Check version of the rpmbuild tool this would be easier to
+# Check version of the rpmbuild tool this would be easier to
# track bugs with users and CPackRPM debug mode.
-# We may use RPM version in order to check for available version dependent features
+# We may use RPM version in order to check for available version dependent features
IF(RPMBUILD_EXECUTABLE)
execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --version
OUTPUT_VARIABLE _TMP_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
- string(REGEX REPLACE "^.*\ " ""
+ string(REGEX REPLACE "^.*\ " ""
RPMBUILD_EXECUTABLE_VERSION
- ${_TMP_VERSION})
+ ${_TMP_VERSION})
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+ ENDIF(CPACK_RPM_PACKAGE_DEBUG)
ENDIF(RPMBUILD_EXECUTABLE)
IF(NOT RPMBUILD_EXECUTABLE)
@@ -165,14 +195,14 @@ IF(NOT RPMBUILD_EXECUTABLE)
ENDIF(NOT RPMBUILD_EXECUTABLE)
# We may use RPM version in the future in order
-# to shut down warning about space in buildtree
+# to shut down warning about space in buildtree
# some recent RPM version should support space in different places.
# not checked [yet].
IF(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
MESSAGE(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.")
ENDIF(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
-# If rpmbuild is found
+# If rpmbuild is found
# we try to discover alien since we may be on non RPM distro like Debian.
# In this case we may try to to use more advanced features
# like generating RPM directly from DEB using alien.
@@ -182,7 +212,7 @@ IF(ALIEN_EXECUTABLE)
MESSAGE(STATUS "alien found, we may be on a Debian based distro.")
ENDIF(ALIEN_EXECUTABLE)
-#
+#
# Use user-defined RPM specific variables value
# or generate reasonable default value from
# CPACK_xxx generic values.
@@ -197,10 +227,10 @@ IF(NOT CPACK_RPM_PACKAGE_SUMMARY)
IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY)
ELSE(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
- SET(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
+ SET(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
ENDIF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
ENDIF(NOT CPACK_RPM_PACKAGE_SUMMARY)
-
+
# CPACK_RPM_PACKAGE_NAME (mandatory)
IF(NOT CPACK_RPM_PACKAGE_NAME)
STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
@@ -213,6 +243,11 @@ IF(NOT CPACK_RPM_PACKAGE_VERSION)
ENDIF(NOT CPACK_PACKAGE_VERSION)
SET(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
ENDIF(NOT CPACK_RPM_PACKAGE_VERSION)
+# Replace '-' in version with '_'
+# '-' character is an Illegal RPM version character
+# it is illegal because it is used to separate
+# RPM "Version" from RPM "Release"
+STRING(REPLACE "-" "_" CPACK_RPM_PACKAGE_VERSION ${CPACK_RPM_PACKAGE_VERSION})
# CPACK_RPM_PACKAGE_ARCHITECTURE (optional)
IF(CPACK_RPM_PACKAGE_ARCHITECTURE)
@@ -260,7 +295,7 @@ ENDIF(NOT CPACK_RPM_PACKAGE_VENDOR)
# CPACK_RPM_PACKAGE_DESCRIPTION
# The variable content may be either
-# - explicitely given by tthe user or
+# - explicitly given by the user or
# - filled with the content of CPACK_PACKAGE_DESCRIPTION_FILE
# if it is defined
# - set to a default value
@@ -294,25 +329,36 @@ IF (CPACK_RPM_COMPRESSION_TYPE)
ELSE(CPACK_RPM_COMPRESSION_TYPE)
SET(CPACK_RPM_COMPRESSION_TYPE_TMP "")
ENDIF(CPACK_RPM_COMPRESSION_TYPE)
-# CPACK_RPM_PACKAGE_REQUIRES
-# Placeholder used to specify binary RPM dependencies (if any)
-# see http://www.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html
-IF(CPACK_RPM_PACKAGE_REQUIRES)
- IF(CPACK_RPM_PACKAGE_DEBUG)
- MESSAGE("CPackRPM:Debug: User defined Requires:\n ${CPACK_RPM_PACKAGE_REQUIRES}")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
- SET(TMP_RPM_REQUIRES "Requires: ${CPACK_RPM_PACKAGE_REQUIRES}")
-ENDIF(CPACK_RPM_PACKAGE_REQUIRES)
-# CPACK_RPM_PACKAGE_PROVIDES
-# Placeholder used to specify binary RPM dependencies (if any)
-# see http://www.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html
-IF(CPACK_RPM_PACKAGE_PROVIDES)
- IF(CPACK_RPM_PACKAGE_DEBUG)
- MESSAGE("CPackRPM:Debug: User defined Provides:\n ${CPACK_RPM_PACKAGE_PROVIDES}")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
- SET(TMP_RPM_PROVIDES "Provides: ${CPACK_RPM_PACKAGE_PROVIDES}")
-ENDIF(CPACK_RPM_PACKAGE_PROVIDES)
+if(CPACK_PACKAGE_RELOCATABLE)
+ set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
+endif(CPACK_PACKAGE_RELOCATABLE)
+if(CPACK_RPM_PACKAGE_RELOCATABLE)
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: Trying to build a relocatable package")
+ endif(CPACK_RPM_PACKAGE_DEBUG)
+ if(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
+ message("CPackRPM:Warning: CPACK_SET_DESTDIR is set (=${CPACK_SET_DESTDIR}) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.")
+ else(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
+ set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX})
+ endif(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
+endif(CPACK_RPM_PACKAGE_RELOCATABLE)
+
+# check if additional fields for RPM spec header are given
+FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX)
+ IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER})
+ STRING(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH)
+ MATH(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1")
+ STRING(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL)
+ STRING(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL)
+ STRING(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME)
+ SET(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
+ IF(CPACK_RPM_PACKAGE_DEBUG)
+ MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}")
+ ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+ SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}")
+ ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER})
+ENDFOREACH(_RPM_SPEC_HEADER)
# CPACK_RPM_SPEC_INSTALL_POST
# May be used to define a RPM post intallation script
@@ -348,7 +394,7 @@ endif(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE)
# CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
# CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE
-# May be used to embbed a pre (un)installation script in the spec file.
+# May be used to embed a pre (un)installation script in the spec file.
# The refered script file(s) will be read and directly
# put after the %pre or %preun section
if(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE)
@@ -367,6 +413,19 @@ if(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE)
endif(EXISTS ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
endif(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE)
+# CPACK_RPM_CHANGELOG_FILE
+# May be used to embed a changelog in the spec file.
+# The refered file will be read and directly put after the %changelog section
+if(CPACK_RPM_CHANGELOG_FILE)
+ if(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
+ file(READ ${CPACK_RPM_CHANGELOG_FILE} CPACK_RPM_SPEC_CHANGELOG)
+ else(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
+ message(SEND_ERROR "CPackRPM:Warning: CPACK_RPM_CHANGELOG_FILE <${CPACK_RPM_CHANGELOG_FILE}> does not exists - ignoring")
+ endif(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
+else(CPACK_RPM_CHANGELOG_FILE)
+ set(CPACK_RPM_SPEC_CHANGELOG "* Sun Jul 4 2010 Erk <eric.noulard@gmail.com>\n Generated by CPack RPM (no Changelog file were provided)")
+endif(CPACK_RPM_CHANGELOG_FILE)
+
# CPACK_RPM_SPEC_MORE_DEFINE
# This is a generated spec rpm file spaceholder
IF(CPACK_RPM_SPEC_MORE_DEFINE)
@@ -396,18 +455,47 @@ SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
# Use files tree to construct files command (spec file)
# We should not forget to include symlinks (thus -o -type l)
-# We must remove the './' due to the local search (thus the sed)
+# We must remove the './' due to the local search and escape the
+# file name by enclosing it between double quotes (thus the sed)
# Then we must authorize any man pages extension (adding * at the end)
# because rpmbuild may automatically compress those files
EXECUTE_PROCESS(COMMAND find -type f -o -type l
- COMMAND sed {s/\\.//}
- COMMAND sed {s/.*man.*\\/.*/&*/}
+ COMMAND sed {s:.*/man.*/.*:&*:}
+ COMMAND sed {s/\\.\\\(.*\\\)/\"\\1\"/}
WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)
+if (CPACK_ABSOLUTE_DESTINATION_FILES)
+ IF(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES}")
+ ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+ # Remove trailing space
+ string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
+ # Transform endline separated - string into CMake List
+ string(REPLACE "\n" ";" CPACK_RPM_INSTALL_FILES_LIST "${CPACK_RPM_INSTALL_FILES_LIST}")
+ # Remove unecessary quotes
+ string(REPLACE "\"" "" CPACK_RPM_INSTALL_FILES_LIST "${CPACK_RPM_INSTALL_FILES_LIST}")
+ # Remove ABSOLUTE install file from INSTALL FILE LIST
+ list(REMOVE_ITEM CPACK_RPM_INSTALL_FILES_LIST ${CPACK_ABSOLUTE_DESTINATION_FILES})
+ # Rebuild INSTALL_FILES
+ set(CPACK_RPM_INSTALL_FILES "")
+ foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
+ set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
+ endforeach(F)
+ # Build ABSOLUTE_INSTALL_FILES
+ set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
+ foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES)
+ set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "${CPACK_RPM_ABSOLUTE_INSTALL_FILES}%config \"${F}\"\n")
+ endforeach(F)
+ IF(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}")
+ message("CPackRPM:Debug: CPACK_RPM_INSTALL_FILES=${CPACK_RPM_INSTALL_FILES}")
+ ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+endif(CPACK_ABSOLUTE_DESTINATION_FILES)
+
# The name of the final spec file to be used by rpmbuild
SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}.spec")
-
+
# Print out some debug information if we were asked for that
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
@@ -420,7 +508,7 @@ IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
MESSAGE("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
-
+
# USER generated spec file handling.
# We should generate a spec file template:
# - either because the user asked for it : CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE
@@ -429,7 +517,7 @@ ENDIF(CPACK_RPM_PACKAGE_DEBUG)
IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
FILE(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in
"# -*- rpm-spec -*-
-Buildroot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@
+BuildRoot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@
Summary: \@CPACK_RPM_PACKAGE_SUMMARY\@
Name: \@CPACK_RPM_PACKAGE_NAME\@
Version: \@CPACK_RPM_PACKAGE_VERSION\@
@@ -437,11 +525,13 @@ Release: \@CPACK_RPM_PACKAGE_RELEASE\@
License: \@CPACK_RPM_PACKAGE_LICENSE\@
Group: \@CPACK_RPM_PACKAGE_GROUP\@
Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@
+\@TMP_RPM_URL\@
\@TMP_RPM_REQUIRES\@
\@TMP_RPM_PROVIDES\@
+\@TMP_RPM_OBSOLETES\@
\@TMP_RPM_BUILDARCH\@
-
-#p define prefix \@CMAKE_INSTALL_PREFIX\@
+\@TMP_RPM_PREFIX\@
+
%define _rpmdir \@CPACK_RPM_DIRECTORY\@
%define _rpmfilename \@CPACK_RPM_FILE_NAME\@
%define _unpackaged_files_terminate_build 0
@@ -449,7 +539,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@
\@TMP_RPM_SPEC_INSTALL_POST\@
\@CPACK_RPM_SPEC_MORE_DEFINE\@
\@CPACK_RPM_COMPRESSION_TYPE_TMP\@
-
+
%description
\@CPACK_RPM_PACKAGE_DESCRIPTION\@
@@ -461,14 +551,14 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@
mv $RPM_BUILD_ROOT \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot
#p build
-
+
%install
if [ -e $RPM_BUILD_ROOT ];
then
- mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot/* $RPM_BUILD_ROOT
+ mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot/* $RPM_BUILD_ROOT
else
- mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot $RPM_BUILD_ROOT
-fi
+ mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot $RPM_BUILD_ROOT
+fi
%clean
@@ -487,63 +577,42 @@ fi
%files
%defattr(-,root,root,-)
${CPACK_RPM_INSTALL_FILES}
+${CPACK_RPM_ABSOLUTE_INSTALL_FILES}
%changelog
-* Sun Apr 4 2010 Erk <eric.noulard@gmail.com>
- Add support for specifying RPM compression type
-* Sat Nov 28 2009 Erk <eric.noulard@gmail.com>
- Refix backup/restore install tree for OpenSuSE 11.2
-* Sun Nov 22 2009 Erk <eric.noulard@gmail.com>
- Include symlinks in the file list.
-* Sat Nov 14 2009 Erk <eric.noulard@gmail.com>
- Replace prep and build step with backup and restore
- of the previously CPack installed tree. This should
- mimic what is expected in rpmbuild usual steps
-* Wed Nov 11 2009 Erk <eric.noulard@gmail.com>
- Add support for USER defined pre/post[un]install scripts
-* Wed Oct 07 2009 Erk <eric.noulard@gmail.com>
- Add user custom spec file support
-* Sat Oct 03 2009 Kami <cmoidavid@gmail.com>
- Update to handle more precisely the files section
-* Mon Oct 03 2008 Erk <eric.noulard@gmail.com>
- Update generator to handle optional dependencies using Requires
- Update DEBUG output typos.
-* Mon Aug 25 2008 Erk <eric.noulard@gmail.com>
- Update generator to handle optional post-install
-* Tue Aug 16 2007 Erk <eric.noulard@gmail.com>
- Generated by CPack RPM Generator and associated macros
+\@CPACK_RPM_SPEC_CHANGELOG\@
")
# Stop here if we were asked to only generate a template USER spec file
# The generated file may then be used as a template by user who wants
- # to customize their own spec file.
+ # to customize their own spec file.
IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
MESSAGE(FATAL_ERROR "CPackRPM: STOP here Generated USER binary spec file templare is: ${CPACK_RPM_BINARY_SPECFILE}.in")
ENDIF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
ENDIF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
# After that we may either use a user provided spec file
-# or generate one using appropriate variables value.
+# or generate one using appropriate variables value.
IF(CPACK_RPM_USER_BINARY_SPECFILE)
# User may have specified SPECFILE just use it
MESSAGE("CPackRPM: Will use USER specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}")
# The user provided file is processed for @var replacement
CONFIGURE_FILE(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
ELSE(CPACK_RPM_USER_BINARY_SPECFILE)
- # No User specified spec file, will use the generated spec file
- MESSAGE("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}")
- # Note the just created file is processed for @var replacement
+ # No User specified spec file, will use the generated spec file
+ MESSAGE("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}")
+ # Note the just created file is processed for @var replacement
CONFIGURE_FILE(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
ENDIF(CPACK_RPM_USER_BINARY_SPECFILE)
IF(RPMBUILD_EXECUTABLE)
# Now call rpmbuild using the SPECFILE
EXECUTE_PROCESS(
- COMMAND "${RPMBUILD_EXECUTABLE}" -bb
- --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
+ COMMAND "${RPMBUILD_EXECUTABLE}" -bb
+ --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
"${CPACK_RPM_BINARY_SPECFILE}"
WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.err"
- OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.out")
+ OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.out")
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: You may consult rpmbuild logs in: ")
MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.err")
diff --git a/Modules/CPackZIP.cmake b/Modules/CPackZIP.cmake
index b73bdf1..99963cf 100644
--- a/Modules/CPackZIP.cmake
+++ b/Modules/CPackZIP.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(CMAKE_BINARY_DIR)
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index 2d0702e..bb76ddd 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -55,7 +55,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
OPTION(BUILD_TESTING "Build the testing tree." ON)
@@ -163,6 +163,11 @@ IF(BUILD_TESTING)
SET(DART_TESTING_TIMEOUT 1500 CACHE STRING
"Maximum time allowed before CTest will kill the test.")
+ SET(CTEST_SUBMIT_RETRY_DELAY 5 CACHE STRING
+ "How long to wait between timed-out CTest submissions.")
+ SET(CTEST_SUBMIT_RETRY_COUNT 3 CACHE STRING
+ "How many times to retry timed-out CTest submissions.")
+
FIND_PROGRAM(MEMORYCHECK_COMMAND
NAMES purify valgrind boundscheck
PATHS
@@ -223,8 +228,10 @@ IF(BUILD_TESTING)
ENDIF(NOT BUILDNAME)
# the build command
- BUILD_COMMAND(MAKECOMMAND CONFIGURATION "\${CTEST_CONFIGURATION_TYPE}")
- SET(MAKECOMMAND ${MAKECOMMAND} CACHE STRING "Command to build the project")
+ BUILD_COMMAND(MAKECOMMAND_DEFAULT_VALUE
+ CONFIGURATION "\${CTEST_CONFIGURATION_TYPE}")
+ SET(MAKECOMMAND ${MAKECOMMAND_DEFAULT_VALUE}
+ CACHE STRING "Command to build the project")
# the default build configuration the ctest build handler will use
# if there is no -C arg given to ctest:
@@ -262,7 +269,9 @@ IF(BUILD_TESTING)
SCPCOMMAND
SLURM_SBATCH_COMMAND
SLURM_SRUN_COMMAND
- SITE
+ SITE
+ CTEST_SUBMIT_RETRY_DELAY
+ CTEST_SUBMIT_RETRY_COUNT
)
# BUILDNAME
IF(NOT RUN_FROM_DART)
diff --git a/Modules/CTestScriptMode.cmake b/Modules/CTestScriptMode.cmake
index 4a93d23..e459c1d 100644
--- a/Modules/CTestScriptMode.cmake
+++ b/Modules/CTestScriptMode.cmake
@@ -11,7 +11,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Determine the current system, so this information can be used
diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake
index c7f1394..e3ef86c 100644
--- a/Modules/CTestTargets.cmake
+++ b/Modules/CTestTargets.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(NOT RUN_FROM_CTEST_OR_DART)
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index d5d8db9..0068617 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CheckCSourceCompiles)
diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake
index b2768c2..e8bfc0c 100644
--- a/Modules/CheckCSourceCompiles.cmake
+++ b/Modules/CheckCSourceCompiles.cmake
@@ -21,7 +21,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake
index 50cd028..764c756 100644
--- a/Modules/CheckCSourceRuns.cmake
+++ b/Modules/CheckCSourceRuns.cmake
@@ -21,7 +21,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index 5d22ee5..d8e4715 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CheckCXXSourceCompiles)
diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake
index 5f16607..4502c6b 100644
--- a/Modules/CheckCXXSourceCompiles.cmake
+++ b/Modules/CheckCXXSourceCompiles.cmake
@@ -21,7 +21,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index 3a3dafa..ace60d1 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -21,7 +21,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake
index 0e0f217..6e932d0 100644
--- a/Modules/CheckFortranFunctionExists.cmake
+++ b/Modules/CheckFortranFunctionExists.cmake
@@ -19,7 +19,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index e8fd85d..e1a1777 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -22,7 +22,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake
index d1ea76a..eb732d2 100644
--- a/Modules/CheckIncludeFile.cmake
+++ b/Modules/CheckIncludeFile.cmake
@@ -25,7 +25,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake
index b1ac62a..c5d8f9a 100644
--- a/Modules/CheckIncludeFileCXX.cmake
+++ b/Modules/CheckIncludeFileCXX.cmake
@@ -25,7 +25,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index 21e97dc..75b5ca1 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -22,7 +22,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake
index 64f6455..caf4f4c 100644
--- a/Modules/CheckLibraryExists.cmake
+++ b/Modules/CheckLibraryExists.cmake
@@ -23,7 +23,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
diff --git a/Modules/CheckSizeOf.cmake b/Modules/CheckSizeOf.cmake
index 0663ce4..f6d6636 100644
--- a/Modules/CheckSizeOf.cmake
+++ b/Modules/CheckSizeOf.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MESSAGE(SEND_ERROR
diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake
index 32abe73..18e80e3 100644
--- a/Modules/CheckStructHasMember.cmake
+++ b/Modules/CheckStructHasMember.cmake
@@ -25,7 +25,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CheckCSourceCompiles)
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index d48b65f..40910f2 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -23,7 +23,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 6f4b437..5d5c931 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -43,7 +43,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(CheckIncludeFile)
diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake
index 13104e5..9832891 100644
--- a/Modules/CheckVariableExists.cmake
+++ b/Modules/CheckVariableExists.cmake
@@ -23,7 +23,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 63652b6..0bb31f9 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
diff --git a/Modules/Compiler/PGI.cmake b/Modules/Compiler/PGI.cmake
index c6960fc..162e3c9 100644
--- a/Modules/Compiler/PGI.cmake
+++ b/Modules/Compiler/PGI.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
diff --git a/Modules/Compiler/PathScale.cmake b/Modules/Compiler/PathScale.cmake
index a53112b..107f779 100644
--- a/Modules/Compiler/PathScale.cmake
+++ b/Modules/Compiler/PathScale.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
diff --git a/Modules/Dart.cmake b/Modules/Dart.cmake
index f125ceb..8705454 100644
--- a/Modules/Dart.cmake
+++ b/Modules/Dart.cmake
@@ -29,7 +29,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
OPTION(BUILD_TESTING "Build the testing tree." ON)
diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in
index 51f514f..caf0afe 100644
--- a/Modules/DartConfiguration.tcl.in
+++ b/Modules/DartConfiguration.tcl.in
@@ -84,3 +84,7 @@ CurlOptions: @CTEST_CURL_OPTIONS@
# warning, if you add new options here that have to do with submit,
# you have to update cmCTestSubmitCommand.cxx
+# For CTest submissions that timeout, these options
+# specify behavior for retrying the submission
+CTestSubmitRetryDelay: @CTEST_SUBMIT_RETRY_DELAY@
+CTestSubmitRetryCount: @CTEST_SUBMIT_RETRY_COUNT@
diff --git a/Modules/Documentation.cmake b/Modules/Documentation.cmake
index ddb19ca..ffeb371 100644
--- a/Modules/Documentation.cmake
+++ b/Modules/Documentation.cmake
@@ -12,7 +12,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
#
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 8c249dc..d76796f 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -39,10 +39,19 @@
# #--Install step---------------
# [INSTALL_DIR dir] # Installation prefix
# [INSTALL_COMMAND cmd...] # Command to drive install after build
-# #--Test step---------------
+# #--Test step------------------
# [TEST_BEFORE_INSTALL 1] # Add test step executed before install step
# [TEST_AFTER_INSTALL 1] # Add test step executed after install step
# [TEST_COMMAND cmd...] # Command to drive test
+# #--Output logging-------------
+# [LOG_DOWNLOAD 1] # Wrap download in script to log output
+# [LOG_UPDATE 1] # Wrap update in script to log output
+# [LOG_CONFIGURE 1] # Wrap configure in script to log output
+# [LOG_BUILD 1] # Wrap build in script to log output
+# [LOG_TEST 1] # Wrap test in script to log output
+# [LOG_INSTALL 1] # Wrap install in script to log output
+# #--Custom targets-------------
+# [STEP_TARGETS st1 st2 ...] # Generate custom targets for these steps
# )
# The *_DIR options specify directories for the project, with default
# directories computed as follows.
@@ -86,6 +95,7 @@
# [DEPENDS files...] # Files on which this step depends
# [ALWAYS 1] # No stamp file, step always runs
# [WORKING_DIRECTORY dir] # Working directory for command
+# [LOG 1] # Wrap step in script to log output
# )
# The command line, comment, and working directory of every standard
# and custom step is processed to replace tokens
@@ -101,6 +111,35 @@
# It stores property values in variables of the same name.
# Property names correspond to the keyword argument names of
# 'ExternalProject_Add'.
+#
+# The 'ExternalProject_Add_StepTargets' function generates custom targets for
+# the steps listed:
+# ExternalProject_Add_StepTargets(<name> [step1 [step2 [...]]])
+#
+# If STEP_TARGETS is set then ExternalProject_Add_StepTargets is automatically
+# called at the end of matching calls to ExternalProject_Add_Step. Pass
+# STEP_TARGETS explicitly to individual ExternalProject_Add calls, or
+# implicitly to all ExternalProject_Add calls by setting the directory property
+# EP_STEP_TARGETS.
+#
+# If STEP_TARGETS is not set, clients may still manually call
+# ExternalProject_Add_StepTargets after calling ExternalProject_Add or
+# ExternalProject_Add_Step.
+#
+# This functionality is provided to make it easy to drive the steps
+# independently of each other by specifying targets on build command lines.
+# For example, you may be submitting to a sub-project based dashboard, where
+# you want to drive the configure portion of the build, then submit to the
+# dashboard, followed by the build portion, followed by tests. If you invoke
+# a custom target that depends on a step halfway through the step dependency
+# chain, then all the previous steps will also run to ensure everything is
+# up to date.
+#
+# For example, to drive configure, build and test steps independently for each
+# ExternalProject_Add call in your project, write the following line prior to
+# any ExternalProject_Add calls in your CMakeLists file:
+#
+# set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
@@ -112,11 +151,13 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Pre-compute a regex to match documented keywords for each command.
-file(STRINGS "${CMAKE_CURRENT_LIST_FILE}" lines LIMIT_COUNT 103
+math(EXPR _ep_documentation_line_count "${CMAKE_CURRENT_LIST_LINE} - 16")
+file(STRINGS "${CMAKE_CURRENT_LIST_FILE}" lines
+ LIMIT_COUNT ${_ep_documentation_line_count}
REGEX "^# ( \\[[A-Z0-9_]+ [^]]*\\] +#.*$|[A-Za-z0-9_]+\\()")
foreach(line IN LISTS lines)
if("${line}" MATCHES "^# [A-Za-z0-9_]+\\(")
@@ -146,8 +187,8 @@ function(_ep_parse_arguments f name ns args)
# correctly based on target properties.
#
# We loop through ARGN and consider the namespace starting with an
- # upper-case letter followed by at least two more upper-case letters
- # or underscores to be keywords.
+ # upper-case letter followed by at least two more upper-case letters,
+ # numbers or underscores to be keywords.
set(key)
foreach(arg IN LISTS args)
@@ -158,14 +199,6 @@ function(_ep_parse_arguments f name ns args)
NOT arg MATCHES "^(TRUE|FALSE)$")
if(_ep_keywords_${f} AND arg MATCHES "${_ep_keywords_${f}}")
set(is_value 0)
- else()
- if(NOT (key STREQUAL "COMMAND")
- AND NOT (key STREQUAL "CVS_MODULE")
- AND NOT (key STREQUAL "DEPENDS")
- AND NOT (key STREQUAL "DOWNLOAD_COMMAND")
- )
- message(AUTHOR_WARNING "unknown ${f} keyword: ${arg}")
- endif()
endif()
endif()
@@ -208,6 +241,14 @@ define_property(DIRECTORY PROPERTY "EP_PREFIX" INHERITED
"ExternalProject module."
)
+define_property(DIRECTORY PROPERTY "EP_STEP_TARGETS" INHERITED
+ BRIEF_DOCS
+ "List of ExternalProject steps that automatically get corresponding targets"
+ FULL_DOCS
+ "See documentation of the ExternalProject_Add_StepTargets() function in the "
+ "ExternalProject module."
+ )
+
function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag src_name work_dir)
file(WRITE ${script_filename}
@@ -555,8 +596,9 @@ function(_ep_get_build_command name step cmd_var)
if(cfg_cmd_id STREQUAL "cmake")
# CMake project. Select build command based on generator.
get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR)
- if("${cmake_generator}" MATCHES "Make" AND
- "${cmake_generator}" STREQUAL "${CMAKE_GENERATOR}")
+ if("${CMAKE_GENERATOR}" MATCHES "Make" AND
+ ("${cmake_generator}" STREQUAL "${CMAKE_GENERATOR}" OR
+ NOT cmake_generator))
# The project uses the same Makefile generator. Use recursive make.
set(cmd "$(MAKE)")
if(step STREQUAL "INSTALL")
@@ -585,7 +627,8 @@ function(_ep_get_build_command name step cmd_var)
endif()
else() # if(cfg_cmd_id STREQUAL "configure")
# Non-CMake project. Guess "make" and "make install" and "make test".
- set(cmd "make")
+ # But use "$(MAKE)" to get recursive parallel make.
+ set(cmd "$(MAKE)")
if(step STREQUAL "INSTALL")
set(args install)
endif()
@@ -606,6 +649,101 @@ function(_ep_get_build_command name step cmd_var)
set(${cmd_var} "${cmd}" PARENT_SCOPE)
endfunction(_ep_get_build_command)
+function(_ep_write_log_script name step cmd_var)
+ ExternalProject_Get_Property(${name} stamp_dir)
+ set(command "${${cmd_var}}")
+
+ set(make "")
+ set(code_cygpath_make "")
+ if("${command}" MATCHES "^\\$\\(MAKE\\)")
+ # GNU make recognizes the string "$(MAKE)" as recursive make, so
+ # ensure that it appears directly in the makefile.
+ string(REGEX REPLACE "^\\$\\(MAKE\\)" "\${make}" command "${command}")
+ set(make "-Dmake=$(MAKE)")
+
+ if(WIN32 AND NOT CYGWIN)
+ set(code_cygpath_make "
+if(\${make} MATCHES \"^/\")
+ execute_process(
+ COMMAND cygpath -w \${make}
+ OUTPUT_VARIABLE cygpath_make
+ ERROR_VARIABLE cygpath_make
+ RESULT_VARIABLE cygpath_error
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ if(NOT cygpath_error)
+ set(make \${cygpath_make})
+ endif()
+endif()
+")
+ endif()
+ endif()
+
+ set(config "")
+ if("${CMAKE_CFG_INTDIR}" MATCHES "^\\$")
+ string(REPLACE "${CMAKE_CFG_INTDIR}" "\${config}" command "${command}")
+ set(config "-Dconfig=${CMAKE_CFG_INTDIR}")
+ endif()
+
+ # Wrap multiple 'COMMAND' lines up into a second-level wrapper
+ # script so all output can be sent to one log file.
+ if("${command}" MATCHES ";COMMAND;")
+ set(code_execute_process "
+${code_cygpath_make}
+execute_process(COMMAND \${command} RESULT_VARIABLE result)
+if(result)
+ set(msg \"Command failed (\${result}):\\n\")
+ foreach(arg IN LISTS command)
+ set(msg \"\${msg} '\${arg}'\")
+ endforeach(arg)
+ message(FATAL_ERROR \"\${msg}\")
+endif()
+")
+ set(code "")
+ set(cmd "")
+ set(sep "")
+ foreach(arg IN LISTS command)
+ if("x${arg}" STREQUAL "xCOMMAND")
+ set(code "${code}set(command \"${cmd}\")${code_execute_process}")
+ set(cmd "")
+ set(sep "")
+ else()
+ set(cmd "${cmd}${sep}${arg}")
+ set(sep ";")
+ endif()
+ endforeach()
+ set(code "${code}set(command \"${cmd}\")${code_execute_process}")
+ file(WRITE ${stamp_dir}/${name}-${step}-impl.cmake "${code}")
+ set(command ${CMAKE_COMMAND} "-Dmake=\${make}" "-Dconfig=\${config}" -P ${stamp_dir}/${name}-${step}-impl.cmake)
+ endif()
+
+ # Wrap the command in a script to log output to files.
+ set(script ${stamp_dir}/${name}-${step}.cmake)
+ set(logbase ${stamp_dir}/${name}-${step})
+ file(WRITE ${script} "
+${code_cygpath_make}
+set(command \"${command}\")
+execute_process(
+ COMMAND \${command}
+ RESULT_VARIABLE result
+ OUTPUT_FILE \"${logbase}-out.log\"
+ ERROR_FILE \"${logbase}-err.log\"
+ )
+if(result)
+ set(msg \"Command failed: \${result}\\n\")
+ foreach(arg IN LISTS command)
+ set(msg \"\${msg} '\${arg}'\")
+ endforeach(arg)
+ set(msg \"\${msg}\\nSee also\\n ${logbase}-*.log\\n\")
+ message(FATAL_ERROR \"\${msg}\")
+else()
+ set(msg \"${name} ${step} command succeeded. See also ${logbase}-*.log\\n\")
+ message(STATUS \"\${msg}\")
+endif()
+")
+ set(command ${CMAKE_COMMAND} ${make} ${config} -P ${script})
+ set(${cmd_var} "${command}" PARENT_SCOPE)
+endfunction(_ep_write_log_script)
# This module used to use "/${CMAKE_CFG_INTDIR}" directly and produced
# makefiles with "/./" in paths for custom command dependencies. Which
@@ -624,6 +762,19 @@ function(_ep_get_configuration_subdir_suffix suffix_var)
endfunction(_ep_get_configuration_subdir_suffix)
+function(ExternalProject_Add_StepTargets name)
+ set(steps ${ARGN})
+
+ _ep_get_configuration_subdir_suffix(cfgdir)
+ ExternalProject_Get_Property(${name} stamp_dir)
+
+ foreach(step ${steps})
+ add_custom_target(${name}-${step}
+ DEPENDS ${stamp_dir}${cfgdir}/${name}-${step})
+ endforeach()
+endfunction(ExternalProject_Add_StepTargets)
+
+
function(ExternalProject_Add_Step name step)
set(cmf_dir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles)
ExternalProject_Get_Property(${name} stamp_dir)
@@ -695,6 +846,12 @@ function(ExternalProject_Add_Step name step)
set(touch ${CMAKE_COMMAND} -E touch ${stamp_dir}${cfgdir}/${name}-${step})
endif()
+ # Wrap with log script?
+ get_property(log TARGET ${name} PROPERTY _EP_${step}_LOG)
+ if(command AND log)
+ _ep_write_log_script(${name} ${step} command)
+ endif()
+
add_custom_command(
OUTPUT ${stamp_dir}${cfgdir}/${name}-${step}
COMMENT ${comment}
@@ -704,6 +861,18 @@ function(ExternalProject_Add_Step name step)
WORKING_DIRECTORY ${work_dir}
VERBATIM
)
+
+ # Add custom "step target"?
+ get_property(step_targets TARGET ${name} PROPERTY _EP_STEP_TARGETS)
+ if(NOT step_targets)
+ get_property(step_targets DIRECTORY PROPERTY EP_STEP_TARGETS)
+ endif()
+ foreach(st ${step_targets})
+ if("${st}" STREQUAL "${step}")
+ ExternalProject_Add_StepTargets(${name} ${step})
+ break()
+ endif()
+ endforeach()
endfunction(ExternalProject_Add_Step)
@@ -905,12 +1074,20 @@ function(_ep_add_download_command name)
endif()
endif()
+ get_property(log TARGET ${name} PROPERTY _EP_LOG_DOWNLOAD)
+ if(log)
+ set(log LOG 1)
+ else()
+ set(log "")
+ endif()
+
ExternalProject_Add_Step(${name} download
COMMENT ${comment}
COMMAND ${cmd}
WORKING_DIRECTORY ${work_dir}
DEPENDS ${depends}
DEPENDEES mkdir
+ ${log}
)
endfunction(_ep_add_download_command)
@@ -968,12 +1145,20 @@ function(_ep_add_update_command name)
set(always 1)
endif()
+ get_property(log TARGET ${name} PROPERTY _EP_LOG_UPDATE)
+ if(log)
+ set(log LOG 1)
+ else()
+ set(log "")
+ endif()
+
ExternalProject_Add_Step(${name} update
COMMENT ${comment}
COMMAND ${cmd}
ALWAYS ${always}
WORKING_DIRECTORY ${work_dir}
DEPENDEES download
+ ${log}
)
endfunction(_ep_add_update_command)
@@ -1044,11 +1229,19 @@ function(_ep_add_configure_command name)
configure_file(${tmp_dir}/${name}-cfgcmd.txt.in ${tmp_dir}/${name}-cfgcmd.txt)
list(APPEND file_deps ${tmp_dir}/${name}-cfgcmd.txt)
+ get_property(log TARGET ${name} PROPERTY _EP_LOG_CONFIGURE)
+ if(log)
+ set(log LOG 1)
+ else()
+ set(log "")
+ endif()
+
ExternalProject_Add_Step(${name} configure
COMMAND ${cmd}
WORKING_DIRECTORY ${binary_dir}
DEPENDEES update patch
DEPENDS ${file_deps}
+ ${log}
)
endfunction(_ep_add_configure_command)
@@ -1063,10 +1256,18 @@ function(_ep_add_build_command name)
_ep_get_build_command(${name} BUILD cmd)
endif()
+ get_property(log TARGET ${name} PROPERTY _EP_LOG_BUILD)
+ if(log)
+ set(log LOG 1)
+ else()
+ set(log "")
+ endif()
+
ExternalProject_Add_Step(${name} build
COMMAND ${cmd}
WORKING_DIRECTORY ${binary_dir}
DEPENDEES configure
+ ${log}
)
endfunction(_ep_add_build_command)
@@ -1081,10 +1282,18 @@ function(_ep_add_install_command name)
_ep_get_build_command(${name} INSTALL cmd)
endif()
+ get_property(log TARGET ${name} PROPERTY _EP_LOG_INSTALL)
+ if(log)
+ set(log LOG 1)
+ else()
+ set(log "")
+ endif()
+
ExternalProject_Add_Step(${name} install
COMMAND ${cmd}
WORKING_DIRECTORY ${binary_dir}
DEPENDEES build
+ ${log}
)
endfunction(_ep_add_install_command)
@@ -1112,10 +1321,18 @@ function(_ep_add_test_command name)
set(dep_args DEPENDEES install)
endif()
+ get_property(log TARGET ${name} PROPERTY _EP_LOG_TEST)
+ if(log)
+ set(log LOG 1)
+ else()
+ set(log "")
+ endif()
+
ExternalProject_Add_Step(${name} test
COMMAND ${cmd}
WORKING_DIRECTORY ${binary_dir}
${dep_args}
+ ${log}
)
endif()
endfunction(_ep_add_test_command)
diff --git a/Modules/FLTKCompatibility.cmake b/Modules/FLTKCompatibility.cmake
index 77ca47b..6b6f960 100644
--- a/Modules/FLTKCompatibility.cmake
+++ b/Modules/FLTKCompatibility.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CheckIncludeFile)
diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake
index d1d31bc..f7bfe27 100644
--- a/Modules/FeatureSummary.cmake
+++ b/Modules/FeatureSummary.cmake
@@ -1,23 +1,100 @@
# - Macros for generating a summary of enabled/disabled features
#
-# PRINT_ENABLED_FEATURES()
-# Print a summary of all enabled features. By default all successfull
-# FIND_PACKAGE() calls will appear here, except the ones which used the
-# QUIET keyword. Additional features can be added by appending an entry
-# to the global ENABLED_FEATURES property. If SET_FEATURE_INFO() is
-# used for that feature, the output will be much more informative.
+# This module provides the macros feature_summary(), set_package_info() and
+# add_feature_info().
+# For compatiblity it also still provides set_feature_info(),
+# print_enabled_features() and print_disabled_features.
#
-# PRINT_DISABLED_FEATURES()
-# Same as PRINT_ENABLED_FEATURES(), but for disabled features. It can
-# be extended the same way by adding to the global property
-# DISABLED_FEATURES.
+# These macros can be used to generate a summary of enabled and disabled
+# packages and/or feature for a build tree:
#
-# SET_FEATURE_INFO(NAME DESCRIPTION [URL [COMMENT] ] )
-# Use this macro to set up information about the named feature, which will
-# then be displayed by PRINT_ENABLED/DISABLED_FEATURES().
-# Example: SET_FEATURE_INFO(LibXml2 "XML processing library."
-# "http://xmlsoft.org/")
+# -- Enabled features:
+# LibXml2 (required version >= 2.4) , XML processing library. , <http://xmlsoft.org>
+# PNG , A PNG image library. , <http://www.libpng.org/pub/png/>
+# -- Disabled features:
+# Lua51 , The Lua scripting language. , <http://www.lua.org>
+# Foo , Foo provides cool stuff.
#
+#
+# FEATURE_SUMMARY( [FILENAME <file>]
+# [APPEND]
+# [VAR <variable_name>]
+# [DESCRIPTION "Found packages:"]
+# WHAT (ALL | PACKAGES_FOUND | PACKAGES_NOT_FOUND
+# | ENABLED_FEATURES | DISABLED_FEATURES]
+# )
+#
+# The FEATURE_SUMMARY() macro can be used to print information about enabled
+# or disabled features or packages of a project.
+# By default, only the names of the features/packages will be printed and their
+# required version when one was specified. Use SET_FEATURE_INFO() to add more
+# useful information, like e.g. a download URL for the respective package.
+#
+# The WHAT option is the only mandatory option. Here you specify what information
+# will be printed:
+# ENABLED_FEATURES: the list of all features and packages which are enabled,
+# excluding the QUIET packages
+# DISABLED_FEATURES: the list of all features and packages which are disabled,
+# excluding the QUIET packages
+# PACKAGES_FOUND: the list of all packages which have been found
+# PACKAGES_NOT_FOUND: the list of all packages which have not been found
+# ALL: this will give all packages which have or have not been found
+#
+# If a FILENAME is given, the information is printed into this file. If APPEND
+# is used, it is appended to this file, otherwise the file is overwritten if
+# it already existed.
+# If the VAR option is used, the information is "printed" into the specified
+# variable.
+# If FILENAME is not used, the information is printed to the terminal.
+# Using the DESCRIPTION option a description or headline can be set which will
+# be printed above the actual content.
+#
+# Example 1, append everything to a file:
+# feature_summary(WHAT ALL
+# FILENAME ${CMAKE_BINARY_DIR}/all.log APPEND)
+#
+# Example 2, print the enabled features into the variable enabledFeaturesText:
+# feature_summary(WHAT ENABLED_FEATURES
+# DESCRIPTION "Enabled Features:"
+# VAR enabledFeaturesText)
+# message(STATUS "${enabledFeaturesText}")
+#
+#
+# SET_PACKAGE_INFO(<name> <description> [<url> [<comment>] ] )
+# Use this macro to set up information about the named package, which can
+# then be displayed via FEATURE_SUMMARY().
+# This can be done either directly in the Find-module or in the project
+# which uses the module after the FIND_PACKAGE() call.
+# The features for which information can be set are added automatically by the
+# find_package() command.
+#
+# Example for setting the info for a package:
+# find_package(LibXml2)
+# set_package_info(LibXml2 "XML processing library." "http://xmlsoft.org/")
+#
+#
+# ADD_FEATURE_INFO(<name> <enabled> <description>)
+# Use this macro to add information about a feature with the given <name>.
+# <enabled> contains whether this feature is enabled or not, <description>
+# is a text descibing the feature.
+# The information can be displayed using feature_summary() for ENABLED_FEATURES
+# and DISABLED_FEATURES respectively.
+#
+# Example for setting the info for a feature:
+# option(WITH_FOO "Help for foo" ON)
+# add_feature_info(Foo WITH_FOO "The Foo feature provides very cool stuff.")
+#
+#
+# The following macros are provided for compatibility with previous CMake versions:
+#
+# PRINT_ENABLED_FEATURES()
+# Does the same as FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")
+#
+# PRINT_DISABLED_FEATURES()
+# Does the same as FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:")
+#
+# SET_FEATURE_INFO(<name> <description> [<url> [<comment>] ] )
+# Does the same as SET_PACKAGE_INFO(<name> <description> <url> <comment> )
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
@@ -29,50 +106,128 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FUNCTION(SET_FEATURE_INFO _name _desc)
+INCLUDE(CMakeParseArguments)
+
+
+FUNCTION(ADD_FEATURE_INFO _name _enabled _desc)
+ IF (${_enabled})
+ SET_PROPERTY(GLOBAL APPEND PROPERTY ENABLED_FEATURES "${_name}")
+ ELSE ()
+ SET_PROPERTY(GLOBAL APPEND PROPERTY DISABLED_FEATURES "${_name}")
+ ENDIF ()
+
+ SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
+ENDFUNCTION(ADD_FEATURE_INFO)
+
+
+FUNCTION(SET_FEATURE_INFO)
+ SET_PACKAGE_INFO(${ARGN})
+ENDFUNCTION(SET_FEATURE_INFO)
+
+
+FUNCTION(SET_PACKAGE_INFO _name _desc)
SET(_url "${ARGV2}")
SET(_comment "${ARGV3}")
- SET_PROPERTY(GLOBAL PROPERTY ${_name}_DESCRIPTION "${_desc}" )
+ SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
IF(_url MATCHES ".+")
- SET_PROPERTY(GLOBAL PROPERTY ${_name}_URL "${_url}" )
+ SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_url}" )
ENDIF(_url MATCHES ".+")
IF(_comment MATCHES ".+")
- SET_PROPERTY(GLOBAL PROPERTY ${_name}_COMMENT "${_comment}" )
+ SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_COMMENT "${_comment}" )
ENDIF(_comment MATCHES ".+")
-ENDFUNCTION(SET_FEATURE_INFO)
+ENDFUNCTION(SET_PACKAGE_INFO)
-FUNCTION(_PRINT_FEATURES _property _text)
- SET(_currentFeatureText "${_text}")
+FUNCTION(_FS_GET_FEATURE_SUMMARY _property _var)
+ SET(_currentFeatureText "")
GET_PROPERTY(_EnabledFeatures GLOBAL PROPERTY ${_property})
FOREACH(_currentFeature ${_EnabledFeatures})
SET(_currentFeatureText "${_currentFeatureText}\n${_currentFeature}")
- GET_PROPERTY(_info GLOBAL PROPERTY ${_currentFeature}_DESCRIPTION)
+ GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_REQUIRED_VERSION)
+ IF(_info)
+ SET(_currentFeatureText "${_currentFeatureText} (required version ${_info})")
+ ENDIF(_info)
+ GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION)
IF(_info)
SET(_currentFeatureText "${_currentFeatureText} , ${_info}")
ENDIF(_info)
- GET_PROPERTY(_info GLOBAL PROPERTY ${_currentFeature}_URL)
+ GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL)
IF(_info)
SET(_currentFeatureText "${_currentFeatureText} , <${_info}>")
ENDIF(_info)
- GET_PROPERTY(_info GLOBAL PROPERTY ${_currentFeature}_COMMENT)
+ GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_COMMENT)
IF(_info)
SET(_currentFeatureText "${_currentFeatureText} , ${_info}")
ENDIF(_info)
ENDFOREACH(_currentFeature)
- MESSAGE(STATUS "${_currentFeatureText}\n")
-ENDFUNCTION(_PRINT_FEATURES)
+ SET(${_var} "${_currentFeatureText}" PARENT_SCOPE)
+ENDFUNCTION(_FS_GET_FEATURE_SUMMARY)
FUNCTION(PRINT_ENABLED_FEATURES)
- _PRINT_FEATURES( ENABLED_FEATURES "Enabled features:")
+ FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")
ENDFUNCTION(PRINT_ENABLED_FEATURES)
FUNCTION(PRINT_DISABLED_FEATURES)
- _PRINT_FEATURES( DISABLED_FEATURES "Disabled features:")
+ FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:")
ENDFUNCTION(PRINT_DISABLED_FEATURES)
+
+
+FUNCTION(FEATURE_SUMMARY)
+# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
+ SET(options APPEND)
+ SET(oneValueArgs FILENAME VAR DESCRIPTION WHAT)
+ SET(multiValueArgs ) # none
+
+ CMAKE_PARSE_ARGUMENTS(_FS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
+
+ IF(_FS_UNPARSED_ARGUMENTS)
+ MESSAGE(FATAL_ERROR "Unknown keywords given to FEATURE_SUMMARY(): \"${_FS_UNPARSED_ARGUMENTS}\"")
+ ENDIF(_FS_UNPARSED_ARGUMENTS)
+
+ IF(NOT _FS_WHAT)
+ MESSAGE(FATAL_ERROR "The call to FEATURE_SUMMAY() doesn't set the required WHAT argument.")
+ ENDIF(NOT _FS_WHAT)
+
+ IF( "${_FS_WHAT}" STREQUAL "ENABLED_FEATURES"
+ OR "${_FS_WHAT}" STREQUAL "DISABLED_FEATURES"
+ OR "${_FS_WHAT}" STREQUAL "PACKAGES_FOUND"
+ OR "${_FS_WHAT}" STREQUAL "PACKAGES_NOT_FOUND")
+ _FS_GET_FEATURE_SUMMARY( ${_FS_WHAT} _featureSummary)
+ SET(_fullText "${_FS_DESCRIPTION}${_featureSummary}\n")
+ ELSEIF("${_FS_WHAT}" STREQUAL "ALL")
+ _FS_GET_FEATURE_SUMMARY( PACKAGES_FOUND _tmp1)
+ _FS_GET_FEATURE_SUMMARY( PACKAGES_NOT_FOUND _tmp2)
+ SET(_featureSummary "${_tmp1}${_tmp2}")
+ IF(_FS_DESCRIPTION)
+ SET(_fullText "${_FS_DESCRIPTION}${_tmp1}${_tmp2}\n")
+ ELSE(_FS_DESCRIPTION)
+ SET(_fullText "-- Found the following packages:${_tmp1}\n-- Did not find the following packages:${_tmp2}\n")
+ ENDIF(_FS_DESCRIPTION)
+ ELSE()
+ MESSAGE(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() is set to ${_FS_WHAT}, which is not a valid value.")
+ ENDIF()
+
+ IF(_FS_FILENAME)
+ IF(_FS_APPEND)
+ FILE(APPEND "${_FS_FILENAME}" "${_fullText}")
+ ELSE(_FS_APPEND)
+ FILE(WRITE "${_FS_FILENAME}" "${_fullText}")
+ ENDIF(_FS_APPEND)
+
+ ELSE(_FS_FILENAME)
+ IF(NOT _FS_VAR)
+ MESSAGE(STATUS "${_fullText}")
+ ENDIF(NOT _FS_VAR)
+ ENDIF(_FS_FILENAME)
+
+ IF(_FS_VAR)
+ SET(${_FS_VAR} "${_fullText}" PARENT_SCOPE)
+ ENDIF(_FS_VAR)
+
+ENDFUNCTION(FEATURE_SUMMARY)
diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake
index 7deefaf..40bd6f3 100644
--- a/Modules/FindALSA.cmake
+++ b/Modules/FindALSA.cmake
@@ -21,7 +21,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
find_path(ALSA_INCLUDE_DIR NAMES asoundlib.h
diff --git a/Modules/FindASPELL.cmake b/Modules/FindASPELL.cmake
index a211ab0..63ffdf9 100644
--- a/Modules/FindASPELL.cmake
+++ b/Modules/FindASPELL.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(ASPELL_INCLUDE_DIR aspell.h )
diff --git a/Modules/FindAVIFile.cmake b/Modules/FindAVIFile.cmake
index 7272ba6..90885ac 100644
--- a/Modules/FindAVIFile.cmake
+++ b/Modules/FindAVIFile.cmake
@@ -19,7 +19,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF (UNIX)
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index b604d0b..6021b12 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -5,6 +5,9 @@
# BISON_VERSION - version of bison
# BISON_FOUND - true if the program was found
#
+# The minimum required version of bison can be specified using the
+# standard CMake syntax, e.g. find_package(BISON 2.1.3)
+#
# If bison is found, the module defines the macros:
# BISON_TARGET(<Name> <YaccInput> <CodeOutput> [VERBOSE <file>]
# [COMPILE_FLAGS <string>])
@@ -41,7 +44,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(BISON_EXECUTABLE bison DOC "path to the bison executable")
@@ -93,7 +96,7 @@ IF(BISON_EXECUTABLE)
#
MACRO(BISON_TARGET Name BisonInput BisonOutput)
SET(BISON_TARGET_output_header "")
- SET(BISON_TARGET_command_opt "")
+ SET(BISON_TARGET_cmdopt "")
SET(BISON_TARGET_outputs "${BisonOutput}")
IF(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
MESSAGE(SEND_ERROR "Usage")
@@ -149,6 +152,7 @@ IF(BISON_EXECUTABLE)
ENDIF(BISON_EXECUTABLE)
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON DEFAULT_MSG BISON_EXECUTABLE)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE
+ VERSION_VAR BISON_VERSION)
# FindBISON.cmake ends here
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index be41736..94bbed5 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -36,7 +36,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index 2dcc9b4..e671f93 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h )
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index ea9eb25..2377e10 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -17,8 +17,10 @@
#
# == Using actual libraries from within Boost: ==
#
-# set(Boost_USE_STATIC_LIBS ON)
-# set(Boost_USE_MULTITHREADED ON)
+# set(Boost_USE_STATIC_LIBS ON)
+# set(Boost_USE_MULTITHREADED ON)
+# set(Boost_USE_STATIC_RUNTIME OFF)
+# set(Boost_COMPAT_STATIC_RUNTIME OFF)
# find_package( Boost 1.36.0 COMPONENTS date_time filesystem system ... )
#
# if(Boost_FOUND)
@@ -63,7 +65,7 @@
# Currently this module searches for the following version numbers:
# 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1,
# 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39, 1.39.0,
-# 1.40, 1.40.0, 1.41, 1.41.0
+# 1.40, 1.40.0, 1.41, 1.41.0, 1.42, 1.42.0, 1.43, 1.43.0, 1.44, 1.44.0
#
# NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should
# add both 1.x and 1.x.0 as shown above. Official Boost include directories
@@ -84,6 +86,42 @@
# Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static
# boost libraries. Defaults to OFF.
#
+# Boost_NO_SYSTEM_PATHS Set to TRUE to suppress searching in system
+# paths (or other locations outside of BOOST_ROOT
+# or BOOST_INCLUDEDIR). Useful when specifying
+# BOOST_ROOT. Defaults to OFF.
+# [Since CMake 2.8.3]
+#
+# Boost_USE_STATIC_RUNTIME If enabled, searches for boost libraries
+# linked against a static C++ standard library
+# ('s' ABI tag). Defaults to OFF.
+# [Since CMake 2.8.3]
+#
+# Boost_USE_DEBUG_PYTHON If enabled, searches for boost libraries
+# compiled against a special debug build of
+# Python ('y' ABI tag). Defaults to OFF.
+# [Since CMake 2.8.3]
+#
+# Boost_USE_STLPORT If enabled, searches for boost libraries
+# compiled against the STLPort standard
+# library ('p' ABI tag). Defaults to OFF.
+# [Since CMake 2.8.3]
+#
+# Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
+# If enabled, searches for boost libraries
+# compiled against the deprecated STLPort
+# "native iostreams" feature ('n' ABI tag).
+# Defaults to OFF.
+# [Since CMake 2.8.3]
+#
+# Boost_COMPAT_STATIC_RUNTIME Set to OFF to disable backwards compatible
+# searching for libraries with the 's' ABI
+# tag on WIN32 after normal searches. You
+# should set this to OFF and also set
+# Boost_USE_STATIC_RUNTIME appropriately.
+# If not specified, defaults to ON.
+# [Since CMake 2.8.3]
+#
# Other Variables used by this module which you may want to set.
#
# Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching
@@ -106,11 +144,37 @@
# (e.g. "-gcc43") if FindBoost has problems finding
# the proper Boost installation
#
+# Boost_THREADAPI When building boost.thread, sometimes the name of the
+# library contains an additional "pthread" or "win32"
+# string known as the threadapi. This can happen when
+# compiling against pthreads on Windows or win32 threads
+# on Cygwin. You may specify this variable and if set
+# when FindBoost searches for the Boost threading library
+# it will first try to match the threadapi you specify.
+# For Example: libboost_thread_win32-mgw45-mt-1_43.a
+# might be found if you specified "win32" here before
+# falling back on libboost_thread-mgw45-mt-1_43.a.
+# [Since CMake 2.8.3]
+#
+# Boost_REALPATH Resolves symbolic links for discovered boost libraries
+# to assist with packaging. For example, instead of
+# Boost_SYSTEM_LIBRARY_RELEASE being resolved to
+# "/usr/lib/libboost_system.so" it would be
+# "/usr/lib/libboost_system.so.1.42.0" instead.
+# This does not affect linking and should not be
+# enabled unless the user needs this information.
+# [Since CMake 2.8.3]
+#
+
+
+#
# These last three variables are available also as environment variables:
#
# BOOST_ROOT or BOOSTROOT The preferred installation prefix for searching for
# Boost. Set this if the module has problems finding
-# the proper Boost installation.
+# the proper Boost installation. To prevent falling
+# back on the system paths, set Boost_NO_SYSTEM_PATHS
+# to true.
#
# BOOST_INCLUDEDIR Set this to the include directory of Boost, if the
# module has problems finding the proper Boost installation
@@ -165,7 +229,7 @@
# Copyright 2007 Wengo
# Copyright 2007 Mike Jackson
# Copyright 2008 Andreas Pakulat <apaku@gmx.de>
-# Copyright 2008-2009 Philip Lowman <philip@yhbt.com>
+# Copyright 2008-2010 Philip Lowman <philip@yhbt.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -174,7 +238,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
#-------------------------------------------------------------------------------
@@ -276,6 +340,28 @@ function(_Boost_MARK_COMPONENTS_FOUND _yes_or_no)
endfunction()
#
+# Take a list of libraries with "thread" in it
+# and prepend duplicates with "thread_${Boost_THREADAPI}"
+# at the front of the list
+#
+function(_Boost_PREPEND_LIST_WITH_THREADAPI _output)
+ set(_orig_libnames ${ARGN})
+ string(REPLACE "thread" "thread_${Boost_THREADAPI}" _threadapi_libnames ${_orig_libnames})
+ set(${_output} ${_threadapi_libnames} ${_orig_libnames} PARENT_SCOPE)
+endfunction()
+
+#
+# If a library is found, replace its cache entry with its REALPATH
+#
+function(_Boost_SWAP_WITH_REALPATH _library _docstring)
+ if(${_library})
+ get_filename_component(_boost_filepathreal ${${_library}} REALPATH)
+ unset(${_library} CACHE)
+ set(${_library} ${_boost_filepathreal} CACHE FILEPATH "${_docstring}")
+ endif()
+endfunction()
+
+#
# End functions/macros
#
#-------------------------------------------------------------------------------
@@ -286,6 +372,9 @@ endfunction()
IF(NOT DEFINED Boost_USE_MULTITHREADED)
SET(Boost_USE_MULTITHREADED TRUE)
ENDIF()
+if(NOT DEFINED Boost_COMPAT_STATIC_RUNTIME)
+ set(Boost_COMPAT_STATIC_RUNTIME TRUE)
+endif()
if(Boost_FIND_VERSION_EXACT)
# The version may appear in a directory with or without the patch
@@ -297,6 +386,7 @@ else(Boost_FIND_VERSION_EXACT)
# The user has not requested an exact version. Among known
# versions, find those that are acceptable to the user request.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
+ "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42"
"1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37"
"1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
"1.34" "1.33.1" "1.33.0" "1.33")
@@ -365,7 +455,7 @@ IF (_boost_IN_CACHE)
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} "
- "is already in the cache. For debugging messages, please clear the cache.")
+ "is already in the cache. To view debugging messages, please clear the cache.")
endif()
ELSE (_boost_IN_CACHE)
# Need to search for boost
@@ -379,6 +469,12 @@ ELSE (_boost_IN_CACHE)
"Boost_USE_MULTITHREADED = ${Boost_USE_MULTITHREADED}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Boost_USE_STATIC_LIBS = ${Boost_USE_STATIC_LIBS}")
+ message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "Boost_USE_STATIC_RUNTIME = ${Boost_USE_STATIC_RUNTIME}")
+ message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "Boost_ADDITIONAL_VERSIONS = ${Boost_ADDITIONAL_VERSIONS}")
+ message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}")
endif()
IF(WIN32)
@@ -403,7 +499,7 @@ ELSE (_boost_IN_CACHE)
"-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define")
ENDIF(WIN32)
- SET(_boost_INCLUDE_SEARCH_DIRS
+ set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM
C:/boost/include
C:/boost
"$ENV{ProgramFiles}/boost/include"
@@ -411,6 +507,13 @@ ELSE (_boost_IN_CACHE)
/sw/local/include
)
+ # If Boost_ROOT was defined, gently correct the user
+ if(Boost_ROOT)
+ message("WARNING: Boost_ROOT was set which is incorrect and is being ignored. "
+ "You need to use BOOST_ROOT instead. "
+ "Also, we suggest setting Boost_NO_SYSTEM_PATHS.")
+ endif()
+
# If BOOST_ROOT was defined in the environment, use it.
if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
set(BOOST_ROOT $ENV{BOOST_ROOT})
@@ -448,18 +551,25 @@ ELSE (_boost_IN_CACHE)
"_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}")
endif()
- IF( BOOST_ROOT )
- SET(_boost_INCLUDE_SEARCH_DIRS
- ${BOOST_ROOT}/include
+ if( Boost_NO_SYSTEM_PATHS)
+ set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH)
+ else()
+ set(_boost_INCLUDE_SEARCH_DIRS ${_boost_INCLUDE_SEARCH_DIRS_SYSTEM})
+ endif()
+
+ if( BOOST_ROOT )
+ set(_boost_INCLUDE_SEARCH_DIRS
+ ${BOOST_ROOT}/include
${BOOST_ROOT}
${_boost_INCLUDE_SEARCH_DIRS})
- ENDIF( BOOST_ROOT )
+ endif()
- IF( BOOST_INCLUDEDIR )
+ # prepend BOOST_INCLUDEDIR to search path if specified
+ if( BOOST_INCLUDEDIR )
file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR)
- SET(_boost_INCLUDE_SEARCH_DIRS
+ set(_boost_INCLUDE_SEARCH_DIRS
${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS})
- ENDIF( BOOST_INCLUDEDIR )
+ endif( BOOST_INCLUDEDIR )
# ------------------------------------------------------------------------
# Search for Boost include DIR
@@ -485,10 +595,7 @@ ELSE (_boost_IN_CACHE)
ENDIF()
list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}")
- if(WIN32)
- # For BoostPro's underscores (and others?)
- list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}")
- endif()
+ list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}")
ENDFOREACH(_boost_VER)
@@ -506,6 +613,7 @@ ELSE (_boost_IN_CACHE)
NAMES boost/config.hpp
HINTS ${_boost_INCLUDE_SEARCH_DIRS}
PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
+ ${_boost_FIND_OPTIONS}
)
ENDIF( NOT Boost_INCLUDE_DIR )
@@ -555,7 +663,7 @@ ELSE (_boost_IN_CACHE)
# Setting some more suffixes for the library
SET (Boost_LIB_PREFIX "")
- if ( WIN32 AND Boost_USE_STATIC_LIBS )
+ if ( WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN)
SET (Boost_LIB_PREFIX "lib")
endif()
@@ -636,7 +744,7 @@ ELSE (_boost_IN_CACHE)
endif()
endif(Boost_COMPILER)
- SET (_boost_MULTITHREADED "-mt")
+ set (_boost_MULTITHREADED "-mt")
if( NOT Boost_USE_MULTITHREADED )
set (_boost_MULTITHREADED "")
endif()
@@ -645,32 +753,67 @@ ELSE (_boost_IN_CACHE)
"_boost_MULTITHREADED = ${_boost_MULTITHREADED}")
endif()
- SET( _boost_STATIC_TAG "")
- set( _boost_ABI_TAG "")
- IF (WIN32)
- IF(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl"
+ #======================
+ # Systematically build up the Boost ABI tag
+ # http://boost.org/doc/libs/1_41_0/more/getting_started/windows.html#library-naming
+ set( _boost_RELEASE_ABI_TAG "-")
+ set( _boost_DEBUG_ABI_TAG "-")
+ # Key Use this library when:
+ # s linking statically to the C++ standard library and
+ # compiler runtime support libraries.
+ if(Boost_USE_STATIC_RUNTIME)
+ set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}s")
+ set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}s")
+ endif()
+ # g using debug versions of the standard and runtime
+ # support libraries
+ if(WIN32)
+ if(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl"
OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc")
- SET (_boost_ABI_TAG "g")
- ENDIF()
- IF( Boost_USE_STATIC_LIBS )
- SET( _boost_STATIC_TAG "-s")
- ENDIF( Boost_USE_STATIC_LIBS )
- ENDIF(WIN32)
- SET (_boost_ABI_TAG "${_boost_ABI_TAG}d")
+ set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g")
+ endif()
+ endif()
+ # y using special debug build of python
+ if(Boost_USE_DEBUG_PYTHON)
+ set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}y")
+ endif()
+ # d using a debug version of your code
+ set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}d")
+ # p using the STLport standard library rather than the
+ # default one supplied with your compiler
+ if(Boost_USE_STLPORT)
+ set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}p")
+ set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}p")
+ endif()
+ # n using the STLport deprecated "native iostreams" feature
+ if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS)
+ set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}n")
+ set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}n")
+ endif()
+
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
- "_boost_STATIC_TAG = ${_boost_STATIC_TAG}")
+ "_boost_RELEASE_ABI_TAG = ${_boost_RELEASE_ABI_TAG}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
- "_boost_ABI_TAG = ${_boost_ABI_TAG}")
+ "_boost_DEBUG_ABI_TAG = ${_boost_DEBUG_ABI_TAG}")
endif()
# ------------------------------------------------------------------------
# Begin finding boost libraries
# ------------------------------------------------------------------------
- SET(_boost_LIBRARIES_SEARCH_DIRS
+ if(BOOST_ROOT)
+ set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS
+ ${BOOST_ROOT}/lib
+ ${BOOST_ROOT}/stage/lib)
+ endif()
+ set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS
+ ${_boost_LIBRARY_SEARCH_DIRS_ALWAYS}
${Boost_INCLUDE_DIR}/lib
${Boost_INCLUDE_DIR}/../lib
+ ${Boost_INCLUDE_DIR}/stage/lib
+ )
+ set(_boost_LIBRARY_SEARCH_DIRS_SYSTEM
C:/boost/lib
C:/boost
"$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib"
@@ -679,67 +822,146 @@ ELSE (_boost_IN_CACHE)
"$ENV{ProgramFiles}/boost"
/sw/local/lib
)
- IF( BOOST_ROOT )
- SET(_boost_LIBRARIES_SEARCH_DIRS
- ${BOOST_ROOT}/lib
- ${BOOST_ROOT}/stage/lib
- ${_boost_LIBRARIES_SEARCH_DIRS})
- ENDIF( BOOST_ROOT )
+ set(_boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_ALWAYS})
+ if( Boost_NO_SYSTEM_PATHS )
+ set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH)
+ else()
+ list(APPEND _boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_SYSTEM})
+ endif()
- IF( BOOST_LIBRARYDIR )
+ # prepend BOOST_LIBRARYDIR to search path if specified
+ if( BOOST_LIBRARYDIR )
file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR)
- SET(_boost_LIBRARIES_SEARCH_DIRS
- ${BOOST_LIBRARYDIR} ${_boost_LIBRARIES_SEARCH_DIRS})
- ENDIF( BOOST_LIBRARYDIR )
+ set(_boost_LIBRARY_SEARCH_DIRS
+ ${BOOST_LIBRARYDIR} ${_boost_LIBRARY_SEARCH_DIRS})
+ endif()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
- "_boost_LIBRARIES_SEARCH_DIRS = ${_boost_LIBRARIES_SEARCH_DIRS}")
+ "_boost_LIBRARY_SEARCH_DIRS = ${_boost_LIBRARY_SEARCH_DIRS}")
endif()
- FOREACH(COMPONENT ${Boost_FIND_COMPONENTS})
- STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
- SET( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" )
- SET( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" )
- SET( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND")
-
- # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
- IF( Boost_USE_STATIC_LIBS )
- SET( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
- IF(WIN32)
- SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
- ELSE(WIN32)
- SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
- ENDIF(WIN32)
- ENDIF( Boost_USE_STATIC_LIBS )
-
- FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
- NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
- ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
- ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
- ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
- ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}
- ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}
- ${Boost_LIB_PREFIX}boost_${COMPONENT}
- HINTS ${_boost_LIBRARIES_SEARCH_DIRS}
+ # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
+ if( Boost_USE_STATIC_LIBS )
+ set( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ if(WIN32)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ else()
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
+ endif()
+ endif()
+
+ # We want to use the tag inline below without risking double dashes
+ if(_boost_RELEASE_ABI_TAG)
+ if(${_boost_RELEASE_ABI_TAG} STREQUAL "-")
+ set(_boost_RELEASE_ABI_TAG "")
+ endif()
+ endif()
+ if(_boost_DEBUG_ABI_TAG)
+ if(${_boost_DEBUG_ABI_TAG} STREQUAL "-")
+ set(_boost_DEBUG_ABI_TAG "")
+ endif()
+ endif()
+
+ # The previous behavior of FindBoost when Boost_USE_STATIC_LIBS was enabled
+ # on WIN32 was to:
+ # 1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found)
+ # 2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found)
+ # We maintain this behavior since changing it could break people's builds.
+ # To disable the ambiguous behavior, the user can
+ # set Boost_COMPAT_STATIC_RUNTIME to FALSE
+ set(_boost_STATIC_RUNTIME_WORKAROUND false)
+ if(Boost_COMPAT_STATIC_RUNTIME AND WIN32 AND Boost_USE_STATIC_LIBS)
+ if(NOT Boost_USE_STATIC_RUNTIME)
+ set(_boost_STATIC_RUNTIME_WORKAROUND true)
+ endif()
+ endif()
+
+
+ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
+ string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
+ set( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" )
+ set( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" )
+ set( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND")
+
+ set( _boost_docstring_release "Boost ${COMPONENT} library (release)")
+ set( _boost_docstring_debug "Boost ${COMPONENT} library (debug)")
+
+ #
+ # Find RELEASE libraries
+ #
+ set(_boost_RELEASE_NAMES
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT} )
+ if(_boost_STATIC_RUNTIME_WORKAROUND)
+ set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
+ list(APPEND _boost_RELEASE_NAMES
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
+ endif()
+ if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
+ _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES})
+ endif()
+ if(Boost_DEBUG)
+ message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "Searching for ${UPPERCOMPONENT}_LIBRARY_RELEASE: ${_boost_RELEASE_NAMES}")
+ endif()
+ find_library(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
+ NAMES ${_boost_RELEASE_NAMES}
+ HINTS ${_boost_LIBRARY_SEARCH_DIRS}
+ ${_boost_FIND_OPTIONS}
+ DOC "${_boost_docstring_release}"
)
- FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
- NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION}
- ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION}
- ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION}
- ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION}
- ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG}
- ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}
- ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG}
- HINTS ${_boost_LIBRARIES_SEARCH_DIRS}
+ #
+ # Find DEBUG libraries
+ #
+ set(_boost_DEBUG_NAMES
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT} )
+ if(_boost_STATIC_RUNTIME_WORKAROUND)
+ set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}")
+ list(APPEND _boost_DEBUG_NAMES
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
+ endif()
+ if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
+ _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES})
+ endif()
+ if(Boost_DEBUG)
+ message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "Searching for ${UPPERCOMPONENT}_LIBRARY_DEBUG: ${_boost_DEBUG_NAMES}")
+ endif()
+ find_library(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
+ NAMES ${_boost_DEBUG_NAMES}
+ HINTS ${_boost_LIBRARY_SEARCH_DIRS}
+ ${_boost_FIND_OPTIONS}
+ DOC "${_boost_docstring_debug}"
)
+ if(Boost_REALPATH)
+ _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "${_boost_docstring_release}")
+ _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "${_boost_docstring_debug}" )
+ endif()
+
_Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
- IF( Boost_USE_STATIC_LIBS )
- SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
- ENDIF( Boost_USE_STATIC_LIBS )
- ENDFOREACH(COMPONENT)
+
+ endforeach(COMPONENT)
+
+ # Restore the original find library ordering
+ if( Boost_USE_STATIC_LIBS )
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
+ endif()
# ------------------------------------------------------------------------
# End finding boost libraries
# ------------------------------------------------------------------------
diff --git a/Modules/FindBullet.cmake b/Modules/FindBullet.cmake
index fe58f60..d10a388 100644
--- a/Modules/FindBullet.cmake
+++ b/Modules/FindBullet.cmake
@@ -24,7 +24,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
macro(_FIND_BULLET_LIBRARY _var)
diff --git a/Modules/FindCABLE.cmake b/Modules/FindCABLE.cmake
index 938c805..678fb07 100644
--- a/Modules/FindCABLE.cmake
+++ b/Modules/FindCABLE.cmake
@@ -20,7 +20,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(NOT CABLE)
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 7099609..dad5709 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -165,7 +165,7 @@
# and will link in the resulting object file automatically.
#
# This script will also generate a separate cmake script that is used at
-# build time to invoke nvcc. This is for serveral reasons.
+# build time to invoke nvcc. This is for several reasons.
#
# 1. nvcc can return negative numbers as return values which confuses
# Visual Studio into thinking that the command succeeded. The script now
@@ -497,29 +497,6 @@ endif()
# Always set this convenience variable
set(CUDA_VERSION_STRING "${CUDA_VERSION}")
-# Here we need to determine if the version we found is acceptable. We will
-# assume that is unless CUDA_FIND_VERSION_EXACT or CUDA_FIND_VERSION is
-# specified. The presence of either of these options checks the version
-# string and signals if the version is acceptable or not.
-set(_cuda_version_acceptable TRUE)
-#
-if(CUDA_FIND_VERSION_EXACT AND NOT CUDA_VERSION VERSION_EQUAL CUDA_FIND_VERSION)
- set(_cuda_version_acceptable FALSE)
-endif()
-#
-if(CUDA_FIND_VERSION AND CUDA_VERSION VERSION_LESS CUDA_FIND_VERSION)
- set(_cuda_version_acceptable FALSE)
-endif()
-#
-if(NOT _cuda_version_acceptable)
- set(_cuda_error_message "Requested CUDA version ${CUDA_FIND_VERSION}, but found unacceptable version ${CUDA_VERSION}")
- if(CUDA_FIND_REQUIRED)
- message("${_cuda_error_message}")
- elseif(NOT CUDA_FIND_QUIETLY)
- message("${_cuda_error_message}")
- endif()
-endif()
-
# CUDA_TOOLKIT_INCLUDE
find_path(CUDA_TOOLKIT_INCLUDE
device_functions.h # Header included in toolkit
@@ -537,11 +514,19 @@ set (CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE})
macro(FIND_LIBRARY_LOCAL_FIRST _var _names _doc)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(_cuda_64bit_lib_dir "${CUDA_TOOLKIT_ROOT_DIR}/lib64")
+ # CUDA 3.2+ on Windows moved the library directoryies, so we need the new
+ # and old paths.
+ set(_cuda_64bit_lib_dir
+ "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64"
+ "${CUDA_TOOLKIT_ROOT_DIR}/lib64"
+ )
endif()
+ # CUDA 3.2+ on Windows moved the library directories, so we need to new
+ # (lib/Win32) and the old path (lib).
find_library(${_var}
NAMES ${_names}
PATHS ${_cuda_64bit_lib_dir}
+ "${CUDA_TOOLKIT_ROOT_DIR}/lib/Win32"
"${CUDA_TOOLKIT_ROOT_DIR}/lib"
ENV CUDA_LIB_PATH
DOC ${_doc}
@@ -601,9 +586,20 @@ macro(FIND_CUDA_HELPER_LIBS _name)
mark_as_advanced(CUDA_${_name}_LIBRARY)
endmacro(FIND_CUDA_HELPER_LIBS)
+#######################
+# Disable emulation for v3.1 onward
+if(CUDA_VERSION VERSION_GREATER "3.0")
+ if(CUDA_BUILD_EMULATION)
+ message(FATAL_ERROR "CUDA_BUILD_EMULATION is not supported in version 3.1 and onwards. You must disable it to proceed. You have version ${CUDA_VERSION}.")
+ endif()
+endif()
+
# Search for cufft and cublas libraries.
-find_cuda_helper_libs(cufftemu)
-find_cuda_helper_libs(cublasemu)
+if(CUDA_VERSION VERSION_LESS "3.1")
+ # Emulation libraries aren't available in version 3.1 onward.
+ find_cuda_helper_libs(cufftemu)
+ find_cuda_helper_libs(cublasemu)
+endif()
find_cuda_helper_libs(cufft)
find_cuda_helper_libs(cublas)
@@ -687,12 +683,14 @@ set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL
"This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully." FORCE)
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(CUDA DEFAULT_MSG
- CUDA_TOOLKIT_ROOT_DIR
- CUDA_NVCC_EXECUTABLE
- CUDA_INCLUDE_DIRS
- CUDA_CUDART_LIBRARY
- _cuda_version_acceptable
+find_package_handle_standard_args(CUDA
+ REQUIRED_VARS
+ CUDA_TOOLKIT_ROOT_DIR
+ CUDA_NVCC_EXECUTABLE
+ CUDA_INCLUDE_DIRS
+ CUDA_CUDART_LIBRARY
+ VERSION_VAR
+ CUDA_VERSION
)
@@ -811,7 +809,7 @@ endfunction()
##############################################################################
# This helper macro populates the following variables and setups up custom
# commands and targets to invoke the nvcc compiler to generate C or PTX source
-# dependant upon the format parameter. The compiler is invoked once with -M
+# dependent upon the format parameter. The compiler is invoked once with -M
# to generate a dependency file and a second time with -cuda or -ptx to generate
# a .cpp or .ptx file.
# INPUT:
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index f301b24..07835fa 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -15,7 +15,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Look for the header file.
diff --git a/Modules/FindCVS.cmake b/Modules/FindCVS.cmake
index ff97762..2769111 100644
--- a/Modules/FindCVS.cmake
+++ b/Modules/FindCVS.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# CVSNT
diff --git a/Modules/FindCoin3D.cmake b/Modules/FindCoin3D.cmake
index 82d216a..47d0c55 100644
--- a/Modules/FindCoin3D.cmake
+++ b/Modules/FindCoin3D.cmake
@@ -19,7 +19,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF (WIN32)
diff --git a/Modules/FindCups.cmake b/Modules/FindCups.cmake
index 5efc45b..7e3e10a 100644
--- a/Modules/FindCups.cmake
+++ b/Modules/FindCups.cmake
@@ -18,7 +18,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CheckLibraryExists)
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index 791e6a9..4485f43 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -22,7 +22,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_LIBRARY(CURSES_CURSES_LIBRARY NAMES curses )
diff --git a/Modules/FindCxxTest.cmake b/Modules/FindCxxTest.cmake
index 5abf992..6a66d21 100644
--- a/Modules/FindCxxTest.cmake
+++ b/Modules/FindCxxTest.cmake
@@ -5,20 +5,37 @@
#
# INPUT Variables
#
-# CXXTEST_USE_PYTHON
-# If true, the CXXTEST_ADD_TEST macro will use
-# the Python test generator instead of Perl.
+# CXXTEST_USE_PYTHON [deprecated since 1.3]
+# Only used in the case both Python & Perl
+# are detected on the system to control
+# which CxxTest code generator is used.
+#
+# NOTE: In older versions of this Find Module,
+# this variable controlled if the Python test
+# generator was used instead of the Perl one,
+# regardless of which scripting language the
+# user had installed.
+#
+# CXXTEST_TESTGEN_ARGS (since CMake 2.8.3)
+# Specify a list of options to pass to the CxxTest code
+# generator. If not defined, --error-printer is
+# passed.
#
# OUTPUT Variables
#
# CXXTEST_FOUND
# True if the CxxTest framework was found
-# CXXTEST_INCLUDE_DIR
+# CXXTEST_INCLUDE_DIRS
# Where to find the CxxTest include directory
# CXXTEST_PERL_TESTGEN_EXECUTABLE
-# The perl-based test generator.
+# The perl-based test generator
# CXXTEST_PYTHON_TESTGEN_EXECUTABLE
-# The python-based test generator.
+# The python-based test generator
+# CXXTEST_TESTGEN_EXECUTABLE (since CMake 2.8.3)
+# The test generator that is actually used (chosen using user preferences
+# and interpreters found in the system)
+# CXXTEST_TESTGEN_INTERPRETER (since CMake 2.8.3)
+# The full path to the Perl or Python executable on the system
#
# MACROS for optional use by CMake users:
#
@@ -26,9 +43,11 @@
# Creates a CxxTest runner and adds it to the CTest testing suite
# Parameters:
# test_name The name of the test
-# gen_source_file The generated source filename to be generated by CxxTest
+# gen_source_file The generated source filename to be
+# generated by CxxTest
# input_files_to_testgen The list of header files containing the
-# CxxTest::TestSuite's to be included in this runner
+# CxxTest::TestSuite's to be included in
+# this runner
#
# #==============
# Example Usage:
@@ -65,8 +84,8 @@
#
#=============================================================================
-# Copyright 2008-2009 Kitware, Inc.
-# Copyright 2008-2009 Philip Lowman <philip@yhbt.com>
+# Copyright 2008-2010 Kitware, Inc.
+# Copyright 2008-2010 Philip Lowman <philip@yhbt.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -75,9 +94,17 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+# Version 1.3 (8/19/10) (CMake 2.8.3)
+# Included patch by Simone Rossetto to check if either Python or Perl
+# are present in the system. Whichever intepreter that is detected
+# is now used to run the test generator program. If both interpreters
+# are detected, the CXXTEST_USE_PYTHON variable is obeyed.
+#
+# Also added support for CXXTEST_TESTGEN_ARGS, for manually specifying
+# options to the CxxTest code generator.
# Version 1.2 (3/2/08)
# Included patch from Tyler Roscoe to have the perl & python binaries
# detected based on CXXTEST_INCLUDE_DIR
@@ -95,17 +122,12 @@
#=============================================================
macro(CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname)
set(_cxxtest_real_outfname ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_outfname})
- if(CXXTEST_USE_PYTHON)
- set(_cxxtest_executable ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE})
- else()
- set(_cxxtest_executable ${CXXTEST_PERL_TESTGEN_EXECUTABLE})
- endif()
add_custom_command(
OUTPUT ${_cxxtest_real_outfname}
DEPENDS ${ARGN}
- COMMAND ${_cxxtest_executable}
- --error-printer -o ${_cxxtest_real_outfname} ${ARGN}
+ COMMAND ${CXXTEST_TESTGEN_INTERPRETER}
+ ${CXXTEST_TESTGEN_EXECUTABLE} ${CXXTEST_TESTGEN_ARGS} -o ${_cxxtest_real_outfname} ${ARGN}
)
set_source_files_properties(${_cxxtest_real_outfname} PROPERTIES GENERATED true)
@@ -124,14 +146,48 @@ endmacro(CXXTEST_ADD_TEST)
#=============================================================
# main()
#=============================================================
+if(NOT DEFINED CXXTEST_TESTGEN_ARGS)
+ set(CXXTEST_TESTGEN_ARGS --error-printer)
+endif()
+
+find_package(PythonInterp QUIET)
+find_package(Perl QUIET)
find_path(CXXTEST_INCLUDE_DIR cxxtest/TestSuite.h)
-find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl
- PATHS ${CXXTEST_INCLUDE_DIR})
find_program(CXXTEST_PYTHON_TESTGEN_EXECUTABLE cxxtestgen.py
- PATHS ${CXXTEST_INCLUDE_DIR})
+ PATHS ${CXXTEST_INCLUDE_DIR})
+find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl
+ PATHS ${CXXTEST_INCLUDE_DIR})
+
+if(PYTHONINTERP_FOUND OR PERL_FOUND)
+ include(FindPackageHandleStandardArgs)
+
+ if(PYTHONINTERP_FOUND AND (CXXTEST_USE_PYTHON OR NOT PERL_FOUND))
+ set(CXXTEST_TESTGEN_EXECUTABLE ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE})
+ set(CXXTEST_TESTGEN_INTERPRETER ${PYTHON_EXECUTABLE})
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG
+ CXXTEST_INCLUDE_DIR CXXTEST_PYTHON_TESTGEN_EXECUTABLE)
+
+ elseif(PERL_FOUND)
+ set(CXXTEST_TESTGEN_EXECUTABLE ${CXXTEST_PERL_TESTGEN_EXECUTABLE})
+ set(CXXTEST_TESTGEN_INTERPRETER ${PERL_EXECUTABLE})
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG
+ CXXTEST_INCLUDE_DIR CXXTEST_PERL_TESTGEN_EXECUTABLE)
+ endif()
+
+ if(CXXTEST_FOUND)
+ set(CXXTEST_INCLUDE_DIRS ${CXXTEST_INCLUDE_DIR})
+ endif()
+
+else()
-include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG CXXTEST_INCLUDE_DIR)
+ set(CXXTEST_FOUND false)
+ if(NOT CxxTest_FIND_QUIETLY)
+ if(CxxTest_FIND_REQUIRED)
+ message(FATAL_ERROR "Neither Python nor Perl found, cannot use CxxTest, aborting!")
+ else()
+ message(STATUS "Neither Python nor Perl found, CxxTest will not be used.")
+ endif()
+ endif()
-set(CXXTEST_INCLUDE_DIRS ${CXXTEST_INCLUDE_DIR})
+endif()
diff --git a/Modules/FindCygwin.cmake b/Modules/FindCygwin.cmake
index 5b2bc59..28f55ba 100644
--- a/Modules/FindCygwin.cmake
+++ b/Modules/FindCygwin.cmake
@@ -11,13 +11,14 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF (WIN32)
FIND_PATH(CYGWIN_INSTALL_PATH
cygwin.bat
- "C:/Cygwin"
+ "C:/Cygwin"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygwin\\setup;rootdir]"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/;native]"
)
diff --git a/Modules/FindDCMTK.cmake b/Modules/FindDCMTK.cmake
index d35433a..3bed97f 100644
--- a/Modules/FindDCMTK.cmake
+++ b/Modules/FindDCMTK.cmake
@@ -23,7 +23,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
#
diff --git a/Modules/FindDart.cmake b/Modules/FindDart.cmake
index 65da21a..90f71bd 100644
--- a/Modules/FindDart.cmake
+++ b/Modules/FindDart.cmake
@@ -13,7 +13,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(DART_ROOT README.INSTALL
diff --git a/Modules/FindDevIL.cmake b/Modules/FindDevIL.cmake
index ae0f97d..c87e736 100644
--- a/Modules/FindDevIL.cmake
+++ b/Modules/FindDevIL.cmake
@@ -19,7 +19,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# TODO: Add version support.
diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake
index 5e5ed13..aa4973d 100644
--- a/Modules/FindDoxygen.cmake
+++ b/Modules/FindDoxygen.cmake
@@ -28,7 +28,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# For backwards compatibility support
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index 22743b1..3c04b4c 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -15,7 +15,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Look for the header file.
diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake
index 068ee75..d42e514 100644
--- a/Modules/FindFLEX.cmake
+++ b/Modules/FindFLEX.cmake
@@ -6,6 +6,10 @@
# FLEX_VERSION - the version of flex
# FLEX_LIBRARIES - The flex libraries
#
+# The minimum required version of flex can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(FLEX 2.5.13)
+#
+#
# If flex is found on the system, the module provides the macro:
# FLEX_TARGET(Name FlexInput FlexOutput [COMPILE_FLAGS <string>])
# which creates a custom command to generate the <FlexOutput> file from
@@ -55,7 +59,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(FLEX_EXECUTABLE flex DOC "path to the flex executable")
@@ -74,7 +78,11 @@ IF(FLEX_EXECUTABLE)
RESULT_VARIABLE FLEX_version_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
IF(NOT ${FLEX_version_result} EQUAL 0)
- MESSAGE(SEND_ERROR "Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_error}")
+ IF(FLEX_FIND_REQUIRED)
+ MESSAGE(SEND_ERROR "Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}")
+ ELSE()
+ MESSAGE("Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}\nFLEX_VERSION will not be available")
+ ENDIF()
ELSE()
STRING(REGEX REPLACE "^flex (.*)$" "\\1"
FLEX_VERSION "${FLEX_version_output}")
@@ -136,6 +144,7 @@ IF(FLEX_EXECUTABLE)
ENDIF(FLEX_EXECUTABLE)
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLEX DEFAULT_MSG FLEX_EXECUTABLE)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLEX REQUIRED_VARS FLEX_EXECUTABLE
+ VERSION_VAR FLEX_VERSION)
# FindFLEX.cmake ends here
diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake
index 02b2015..03d4b8e 100644
--- a/Modules/FindFLTK.cmake
+++ b/Modules/FindFLTK.cmake
@@ -39,7 +39,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(NOT FLTK_SKIP_OPENGL)
@@ -67,11 +67,6 @@ IF(APPLE)
SET( FLTK_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
ENDIF(APPLE)
-IF(CYGWIN)
- FIND_LIBRARY(FLTK_MATH_LIBRARY m)
- SET( FLTK_PLATFORM_DEPENDENT_LIBS ole32 uuid comctl32 wsock32 supc++ ${FLTK_MATH_LIBRARY} -lgdi32)
-ENDIF(CYGWIN)
-
# If FLTK_INCLUDE_DIR is already defined we assigne its value to FLTK_DIR
IF(FLTK_INCLUDE_DIR)
SET(FLTK_DIR ${FLTK_INCLUDE_DIR})
diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake
index 6411ccb..436e280 100644
--- a/Modules/FindFLTK2.cmake
+++ b/Modules/FindFLTK2.cmake
@@ -20,7 +20,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
SET (FLTK2_DIR $ENV{FLTK2_DIR} )
@@ -45,10 +45,6 @@ IF(APPLE)
SET( FLTK2_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
ENDIF(APPLE)
-IF(CYGWIN)
- SET( FLTK2_PLATFORM_DEPENDENT_LIBS ole32 uuid comctl32 wsock32 supc++ -lm -lgdi32)
-ENDIF(CYGWIN)
-
# If FLTK2_INCLUDE_DIR is already defined we assigne its value to FLTK2_DIR
IF(FLTK2_INCLUDE_DIR)
SET(FLTK2_DIR ${FLTK2_INCLUDE_DIR})
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake
index 0a6f93e..7762684 100644
--- a/Modules/FindFreetype.cmake
+++ b/Modules/FindFreetype.cmake
@@ -21,7 +21,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Created by Eric Wing.
diff --git a/Modules/FindGCCXML.cmake b/Modules/FindGCCXML.cmake
index 52390c3..261a5d1 100644
--- a/Modules/FindGCCXML.cmake
+++ b/Modules/FindGCCXML.cmake
@@ -13,7 +13,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(GCCXML
diff --git a/Modules/FindGDAL.cmake b/Modules/FindGDAL.cmake
index d3b198a..2050c72 100644
--- a/Modules/FindGDAL.cmake
+++ b/Modules/FindGDAL.cmake
@@ -20,7 +20,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
#
diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake
index 36bf1dc..e0d25e1 100644
--- a/Modules/FindGIF.cmake
+++ b/Modules/FindGIF.cmake
@@ -16,7 +16,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Created by Eric Wing.
diff --git a/Modules/FindGLU.cmake b/Modules/FindGLU.cmake
index 81b3364..5198f11 100644
--- a/Modules/FindGLU.cmake
+++ b/Modules/FindGLU.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Use of this file is deprecated, and is here for backwards compatibility with CMake 1.4
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake
index baf539a..45df79e 100644
--- a/Modules/FindGLUT.cmake
+++ b/Modules/FindGLUT.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF (WIN32)
diff --git a/Modules/FindGTK.cmake b/Modules/FindGTK.cmake
index 75890df..e9cc62f 100644
--- a/Modules/FindGTK.cmake
+++ b/Modules/FindGTK.cmake
@@ -14,7 +14,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# don't even bother under WIN32
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index c871417..e437e1c 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -28,6 +28,8 @@
#
# GTK2_DEBUG - Enables verbose debugging of the module
# GTK2_SKIP_MARK_AS_ADVANCED - Disable marking cache variables as advanced
+# GTK2_ADDITIONAL_SUFFIXES - Allows defining additional directories to
+# search for include files
#
#=================
# Example Usage:
@@ -61,9 +63,24 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+# Version 1.2 (8/30/2010) (CMake 2.8.3)
+# * Merge patch for detecting gdk-pixbuf library (split off
+# from core GTK in 2.21). Thanks to Vincent Untz for the patch
+# and Ricardo Cruz for the heads up.
+# Version 1.1 (8/19/2010) (CMake 2.8.3)
+# * Add support for detecting GTK2 under macports (thanks to Gary Kramlich)
+# Version 1.0 (8/12/2010) (CMake 2.8.3)
+# * Add support for detecting new pangommconfig.h header file
+# (Thanks to Sune Vuorela & the Debian Project for the patch)
+# * Add support for detecting fontconfig.h header
+# * Call find_package(Freetype) since it's required
+# * Add support for allowing users to add additional library directories
+# via the GTK2_ADDITIONAL_SUFFIXES variable (kind of a future-kludge in
+# case the GTK developers change versions on any of the directories in the
+# future).
# Version 0.8 (1/4/2010)
# * Get module working under MacOSX fink by adding /sw/include, /sw/lib
# to PATHS and the gobject library
@@ -131,13 +148,15 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
endif()
set(_relatives
- # FIXME
+ # If these ever change, things will break.
+ ${GTK2_ADDITIONAL_SUFFIXES}
glibmm-2.4
glib-2.0
atk-1.0
atkmm-1.6
cairo
cairomm-1.0
+ gdk-pixbuf-2.0
gdkmm-2.4
giomm-2.4
gtk-2.0
@@ -172,6 +191,8 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
/usr/openwin/lib
/sw/include
/sw/lib
+ /opt/local/include
+ /opt/local/lib
$ENV{GTKMM_BASEPATH}/include
$ENV{GTKMM_BASEPATH}/lib
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/include
@@ -390,6 +411,10 @@ endif()
# Find all components
#
+find_package(Freetype)
+list(APPEND GTK2_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS})
+list(APPEND GTK2_LIBRARIES ${FREETYPE_LIBRARIES})
+
foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
if(_GTK2_component STREQUAL "gtk")
_GTK2_FIND_INCLUDE_DIR(GTK2_GLIB_INCLUDE_DIR glib.h)
@@ -399,27 +424,32 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_FIND_INCLUDE_DIR(GTK2_GOBJECT_INCLUDE_DIR gobject/gobject.h)
_GTK2_FIND_LIBRARY (GTK2_GOBJECT_LIBRARY gobject false true)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GDK_PIXBUF_INCLUDE_DIR gdk-pixbuf/gdk-pixbuf.h)
+ _GTK2_FIND_LIBRARY (GTK2_GDK_PIXBUF_LIBRARY gdk_pixbuf false true)
+
_GTK2_FIND_INCLUDE_DIR(GTK2_GDK_INCLUDE_DIR gdk/gdk.h)
_GTK2_FIND_INCLUDE_DIR(GTK2_GDKCONFIG_INCLUDE_DIR gdkconfig.h)
- _GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-x11 false true)
- _GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-win32 false true)
-
_GTK2_FIND_INCLUDE_DIR(GTK2_GTK_INCLUDE_DIR gtk/gtk.h)
- _GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-x11 false true)
- _GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-win32 false true)
+
+ if(UNIX)
+ _GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-x11 false true)
+ _GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-x11 false true)
+ else()
+ _GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-win32 false true)
+ _GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-win32 false true)
+ endif()
_GTK2_FIND_INCLUDE_DIR(GTK2_CAIRO_INCLUDE_DIR cairo.h)
_GTK2_FIND_LIBRARY (GTK2_CAIRO_LIBRARY cairo false false)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h)
+
_GTK2_FIND_INCLUDE_DIR(GTK2_PANGO_INCLUDE_DIR pango/pango.h)
_GTK2_FIND_LIBRARY (GTK2_PANGO_LIBRARY pango false true)
_GTK2_FIND_INCLUDE_DIR(GTK2_ATK_INCLUDE_DIR atk/atk.h)
_GTK2_FIND_LIBRARY (GTK2_ATK_LIBRARY atk false true)
- #elseif(_GTK2_component STREQUAL "gdk_pixbuf")
- #_GTK2_FIND_INCLUDE_DIR(GTK2_GDKPIXBUF_INCLUDE_DIR gdk-pixbuf/gdk-pixbuf.h)
- #_GTK2_FIND_LIBRARY (GTK2_GDKPIXBUF_LIBRARY gdk_pixbuf false true)
elseif(_GTK2_component STREQUAL "gtkmm")
@@ -439,6 +469,7 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_FIND_LIBRARY (GTK2_CAIROMM_LIBRARY cairomm true true)
_GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMM_INCLUDE_DIR pangomm.h)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMMCONFIG_INCLUDE_DIR pangommconfig.h)
_GTK2_FIND_LIBRARY (GTK2_PANGOMM_LIBRARY pangomm true true)
_GTK2_FIND_INCLUDE_DIR(GTK2_SIGC++_INCLUDE_DIR sigc++/sigc++.h)
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index 1bcd469..ef2852a 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -66,7 +66,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
#
# Thanks to Daniel Blezek <blezek@gmail.com> for the GTEST_ADD_TESTS code
diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake
index cdef44f..9398b54 100644
--- a/Modules/FindGettext.cmake
+++ b/Modules/FindGettext.cmake
@@ -22,7 +22,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake
index 2d82142..06df3b0 100644
--- a/Modules/FindGit.cmake
+++ b/Modules/FindGit.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Look for 'git' or 'eg' (easy git)
diff --git a/Modules/FindGnuTLS.cmake b/Modules/FindGnuTLS.cmake
index 72ab511..5c41253 100644
--- a/Modules/FindGnuTLS.cmake
+++ b/Modules/FindGnuTLS.cmake
@@ -20,7 +20,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Note that this doesn't try to find the gnutls-extra package.
diff --git a/Modules/FindGnuplot.cmake b/Modules/FindGnuplot.cmake
index a9b9ee5..364d725 100644
--- a/Modules/FindGnuplot.cmake
+++ b/Modules/FindGnuplot.cmake
@@ -15,7 +15,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(FindCygwin)
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index a84e677..467b09f 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -51,7 +51,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is maintained by Will Dicharry <wdicharry@stellarscience.com>.
diff --git a/Modules/FindHSPELL.cmake b/Modules/FindHSPELL.cmake
index 21bc5fd..3a8943f 100644
--- a/Modules/FindHSPELL.cmake
+++ b/Modules/FindHSPELL.cmake
@@ -21,7 +21,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(HSPELL_INCLUDE_DIR hspell.h)
diff --git a/Modules/FindHTMLHelp.cmake b/Modules/FindHTMLHelp.cmake
index 2deb297..4455b07 100644
--- a/Modules/FindHTMLHelp.cmake
+++ b/Modules/FindHTMLHelp.cmake
@@ -15,7 +15,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(WIN32)
diff --git a/Modules/FindITK.cmake b/Modules/FindITK.cmake
index 40f03fb..244ce54 100644
--- a/Modules/FindITK.cmake
+++ b/Modules/FindITK.cmake
@@ -30,7 +30,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
SET(ITK_DIR_STRING "directory containing ITKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/InsightToolkit for an installation.")
diff --git a/Modules/FindImageMagick.cmake b/Modules/FindImageMagick.cmake
index 33b8aad..3afcb1c 100644
--- a/Modules/FindImageMagick.cmake
+++ b/Modules/FindImageMagick.cmake
@@ -61,7 +61,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
#---------------------------------------------------------------------
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index a61c683..5d70f0b 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -23,30 +23,55 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Expand {libarch} occurences to java_libarch subdirectory(-ies) and set ${_var}
MACRO(java_append_library_directories _var)
# Determine java arch-specific library subdir
- IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
- # Based on openjdk/jdk/make/common/shared/Platform.gmk as of 6b16
- # and kaffe as of 1.1.8 which uses the first part of the
- # GNU config.guess platform triplet.
- IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i[3-9]86$")
- SET(_java_libarch "i386")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
- SET(_java_libarch "amd64" "x86_64")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc")
- SET(_java_libarch "ppc" "powerpc" "ppc64")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
- SET(_java_libarch "sparc" "sparcv9")
- ELSE(CMAKE_SYSTEM_PROCESSOR MATCHES "^i[3-9]86$")
- SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}")
- ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i[3-9]86$")
- ELSE(CMAKE_SYSTEM_NAME MATCHES "Linux")
- SET(_java_libarch "i386" "amd64" "ppc") # previous default
- ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+ # Mostly based on openjdk/jdk/make/common/shared/Platform.gmk as of openjdk
+ # 1.6.0_18 + icedtea patches. However, it would be much better to base the
+ # guess on the first part of the GNU config.guess platform triplet.
+ IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ SET(_java_libarch "amd64")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
+ SET(_java_libarch "i386")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha")
+ SET(_java_libarch "alpha")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
+ # Subdir is "arm" for both big-endian (arm) and little-endian (armel).
+ SET(_java_libarch "arm")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
+ # mips* machines are bi-endian mostly so processor does not tell
+ # endianess of the underlying system.
+ SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
+ SET(_java_libarch "ppc64")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
+ SET(_java_libarch "ppc")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
+ # Both flavours can run on the same processor
+ SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)")
+ SET(_java_libarch "parisc" "parisc64")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390")
+ # s390 binaries can run on s390x machines
+ SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
+ SET(_java_libarch "sh")
+ ELSE(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}")
+ ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+
+ # Append default list architectures if CMAKE_SYSTEM_PROCESSOR was empty or
+ # system is non-Linux (where the code above has not been well tested)
+ IF(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
+ LIST(APPEND _java_libarch "i386" "amd64" "ppc")
+ ENDIF(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
+
+ # Sometimes ${CMAKE_SYSTEM_PROCESSOR} is added to the list to prefer
+ # current value to a hardcoded list. Remove possible duplicates.
+ LIST(REMOVE_DUPLICATES _java_libarch)
FOREACH(_path ${ARGN})
IF(_path MATCHES "{libarch}")
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake
index 299e458..1f37483 100644
--- a/Modules/FindJPEG.cmake
+++ b/Modules/FindJPEG.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h)
diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake
index 4f8ccb7..8aaa373 100644
--- a/Modules/FindJasper.cmake
+++ b/Modules/FindJasper.cmake
@@ -16,7 +16,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PACKAGE(JPEG)
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 4cd4389..1599433 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -13,6 +13,9 @@
# Java_VERSION_TWEAK = The tweak version of the package found (after '_')
# Java_VERSION = This is set to: $major.$minor.$patch(.$tweak)
#
+# The minimum required version of Java can be specified using the
+# standard CMake syntax, e.g. FIND_PACKAGE(Java 1.5)
+#
# NOTE: ${Java_VERSION} and ${Java_VERSION_STRING} are not guaranteed to be
# identical. For example some java version may return:
# Java_VERSION_STRING = 1.5.0_17
@@ -48,7 +51,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# The HINTS option should only be used for values computed from the system.
@@ -83,7 +86,6 @@ FIND_PROGRAM(Java_JAVA_EXECUTABLE
)
IF(Java_JAVA_EXECUTABLE)
- set(_java_version_acceptable TRUE)
EXECUTE_PROCESS(COMMAND ${Java_JAVA_EXECUTABLE} -version
RESULT_VARIABLE res
OUTPUT_VARIABLE var
@@ -114,7 +116,6 @@ IF(Java_JAVA_EXECUTABLE)
ELSE()
IF(NOT Java_FIND_QUIETLY)
message(WARNING "regex not supported: ${var}. Please report")
- set(_java_version_acceptable FALSE)
ENDIF(NOT Java_FIND_QUIETLY)
ENDIF()
STRING( REGEX REPLACE "([0-9]+).*" "\\1" Java_VERSION_MAJOR "${Java_VERSION_STRING}" )
@@ -134,17 +135,6 @@ IF(Java_JAVA_EXECUTABLE)
ENDIF(NOT Java_FIND_QUIETLY)
ENDIF()
- # check version if requested:
- if( Java_FIND_VERSION )
- if("${Java_VERSION}" VERSION_LESS "${Java_FIND_VERSION}")
- set(_java_version_acceptable FALSE)
- endif("${Java_VERSION}" VERSION_LESS "${Java_FIND_VERSION}")
- if( Java_FIND_VERSION_EXACT )
- if("${Java_VERSION}" VERSION_GREATER "${Java_FIND_VERSION}")
- set(_java_version_acceptable FALSE)
- endif("${Java_VERSION}" VERSION_GREATER "${Java_FIND_VERSION}")
- endif( Java_FIND_VERSION_EXACT )
- endif( Java_FIND_VERSION )
ENDIF(Java_JAVA_EXECUTABLE)
@@ -165,17 +155,15 @@ if(Java_FIND_COMPONENTS)
foreach(component ${Java_FIND_COMPONENTS})
# User just want to execute some Java byte-compiled
if(component STREQUAL "Runtime")
- find_package_handle_standard_args(Java DEFAULT_MSG
- Java_JAVA_EXECUTABLE
- _java_version_acceptable
- )
+ find_package_handle_standard_args(Java
+ REQUIRED_VARS Java_JAVA_EXECUTABLE
+ VERSION_VAR Java_VERSION
+ )
elseif(component STREQUAL "Development")
- find_package_handle_standard_args(Java DEFAULT_MSG
- Java_JAVA_EXECUTABLE
- Java_JAR_EXECUTABLE
- Java_JAVAC_EXECUTABLE
- _java_version_acceptable
- )
+ find_package_handle_standard_args(Java
+ REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE
+ VERSION_VAR Java_VERSION
+ )
else()
message(FATAL_ERROR "Comp: ${component} is not handled")
endif()
@@ -183,12 +171,10 @@ if(Java_FIND_COMPONENTS)
endforeach(component)
else()
# Check for everything
- find_package_handle_standard_args(Java DEFAULT_MSG
- Java_JAVA_EXECUTABLE
- Java_JAR_EXECUTABLE
- Java_JAVAC_EXECUTABLE
- _java_version_acceptable
- )
+ find_package_handle_standard_args(Java
+ REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE
+ VERSION_VAR Java_VERSION
+ )
endif()
diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake
index 5c5c5fe..9d10814 100644
--- a/Modules/FindKDE3.cmake
+++ b/Modules/FindKDE3.cmake
@@ -74,7 +74,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(NOT UNIX AND KDE3_FIND_REQUIRED)
diff --git a/Modules/FindKDE4.cmake b/Modules/FindKDE4.cmake
index 42a1530..ed4f270 100644
--- a/Modules/FindKDE4.cmake
+++ b/Modules/FindKDE4.cmake
@@ -20,7 +20,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# If Qt3 has already been found, fail.
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index b89a997..40effb0 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -33,7 +33,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake
index dbd96a7..950daca 100644
--- a/Modules/FindLATEX.cmake
+++ b/Modules/FindLATEX.cmake
@@ -21,7 +21,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF (WIN32)
diff --git a/Modules/FindLibArchive.cmake b/Modules/FindLibArchive.cmake
new file mode 100644
index 0000000..e7c2706
--- /dev/null
+++ b/Modules/FindLibArchive.cmake
@@ -0,0 +1,63 @@
+# - Find libarchive library and headers
+# The module defines the following variables:
+#
+# LibArchive_FOUND - true if libarchive was found
+# LibArchive_INCLUDE_DIRS - include search path
+# LibArchive_LIBRARIES - libraries to link
+# LibArchive_VERSION - libarchive 3-component version number
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+find_path(LibArchive_INCLUDE_DIR
+ NAMES archive.h
+ PATHS
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\LibArchive;InstallPath]/include"
+ )
+
+find_library(LibArchive_LIBRARY
+ NAMES archive libarchive
+ PATHS
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\LibArchive;InstallPath]/lib"
+ )
+
+mark_as_advanced(LibArchive_INCLUDE_DIR LibArchive_LIBRARY)
+
+# Extract the version number from the header.
+if(LibArchive_INCLUDE_DIR AND EXISTS "${LibArchive_INCLUDE_DIR}/archive.h")
+ # The version string appears in one of two known formats in the header:
+ # #define ARCHIVE_LIBRARY_VERSION "libarchive 2.4.12"
+ # #define ARCHIVE_VERSION_STRING "libarchive 2.8.4"
+ # Match either format.
+ set(_LibArchive_VERSION_REGEX "^#define[ \t]+ARCHIVE[_A-Z]+VERSION[_A-Z]*[ \t]+\"libarchive +([0-9]+)\\.([0-9]+)\\.([0-9]+)[^\"]*\".*$")
+ file(STRINGS "${LibArchive_INCLUDE_DIR}/archive.h" _LibArchive_VERSION_STRING LIMIT_COUNT 1 REGEX "${_LibArchive_VERSION_REGEX}")
+ if(_LibArchive_VERSION_STRING)
+ string(REGEX REPLACE "${_LibArchive_VERSION_REGEX}" "\\1.\\2.\\3" LibArchive_VERSION "${_LibArchive_VERSION_STRING}")
+ endif()
+ unset(_LibArchive_VERSION_REGEX)
+ unset(_LibArchive_VERSION_STRING)
+endif()
+
+# Handle the QUIETLY and REQUIRED arguments and set LIBARCHIVE_FOUND
+# to TRUE if all listed variables are TRUE.
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LibArchive DEFAULT_MSG
+ LibArchive_LIBRARY LibArchive_INCLUDE_DIR
+ )
+set(LibArchive_FOUND ${LIBARCHIVE_FOUND})
+unset(LIBARCHIVE_FOUND)
+
+if(LibArchive_FOUND)
+ set(LibArchive_INCLUDE_DIRS ${LibArchive_INCLUDE_DIR})
+ set(LibArchive_LIBRARIES ${LibArchive_LIBRARY})
+endif()
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index 67db321..250c20a 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -18,7 +18,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# use pkg-config to get the directories and then use these values
diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake
index a03aa7c..0fcfbf5 100644
--- a/Modules/FindLibXslt.cmake
+++ b/Modules/FindLibXslt.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# use pkg-config to get the directories and then use these values
diff --git a/Modules/FindLua50.cmake b/Modules/FindLua50.cmake
index 04f8b28..091e596 100644
--- a/Modules/FindLua50.cmake
+++ b/Modules/FindLua50.cmake
@@ -21,7 +21,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(LUA_INCLUDE_DIR lua.h
diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake
index 473138d..e67d545 100644
--- a/Modules/FindLua51.cmake
+++ b/Modules/FindLua51.cmake
@@ -21,7 +21,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(LUA_INCLUDE_DIR lua.h
diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake
index 6a3a4b7..3df2842 100644
--- a/Modules/FindMFC.cmake
+++ b/Modules/FindMFC.cmake
@@ -14,7 +14,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Assume no MFC support
diff --git a/Modules/FindMPEG.cmake b/Modules/FindMPEG.cmake
index 0c06c94..9d44ac4 100644
--- a/Modules/FindMPEG.cmake
+++ b/Modules/FindMPEG.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(MPEG_INCLUDE_DIR mpeg2dec/include/video_out.h
diff --git a/Modules/FindMPEG2.cmake b/Modules/FindMPEG2.cmake
index 7fa7d51..bc1cf2b 100644
--- a/Modules/FindMPEG2.cmake
+++ b/Modules/FindMPEG2.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(MPEG2_INCLUDE_DIR
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 481b0e9..9fef8f9 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -62,7 +62,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is maintained by David Partyka <dave.partyka@kitware.com>.
@@ -188,7 +188,7 @@ if (MPI_INCLUDE_PATH AND MPI_LIBRARY)
# the cache, and we don't want to override those settings.
elseif (MPI_COMPILE_CMDLINE)
# Extract compile flags from the compile command line.
- string(REGEX MATCHALL "-D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}")
+ string(REGEX MATCHALL "(^| )-[Df]([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}")
set(MPI_COMPILE_FLAGS_WORK)
foreach(FLAG ${MPI_ALL_COMPILE_FLAGS})
if (MPI_COMPILE_FLAGS_WORK)
@@ -199,10 +199,10 @@ elseif (MPI_COMPILE_CMDLINE)
endforeach(FLAG)
# Extract include paths from compile command line
- string(REGEX MATCHALL "-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}")
+ string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}")
set(MPI_INCLUDE_PATH_WORK)
foreach(IPATH ${MPI_ALL_INCLUDE_PATHS})
- string(REGEX REPLACE "^-I" "" IPATH ${IPATH})
+ string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH})
string(REGEX REPLACE "//" "/" IPATH ${IPATH})
list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH})
endforeach(IPATH)
@@ -230,10 +230,10 @@ elseif (MPI_COMPILE_CMDLINE)
endif (NOT MPI_INCLUDE_PATH_WORK)
# Extract linker paths from the link command line
- string(REGEX MATCHALL "-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")
+ string(REGEX MATCHALL "(^| |-Wl,)-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")
set(MPI_LINK_PATH)
foreach(LPATH ${MPI_ALL_LINK_PATHS})
- string(REGEX REPLACE "^-L" "" LPATH ${LPATH})
+ string(REGEX REPLACE "^(| |-Wl,)-L" "" LPATH ${LPATH})
string(REGEX REPLACE "//" "/" LPATH ${LPATH})
list(APPEND MPI_LINK_PATH ${LPATH})
endforeach(LPATH)
@@ -251,7 +251,7 @@ elseif (MPI_COMPILE_CMDLINE)
endif (NOT MPI_LINK_PATH)
# Extract linker flags from the link command line
- string(REGEX MATCHALL "-Wl,([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}")
+ string(REGEX MATCHALL "(^| )-Wl,([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}")
set(MPI_LINK_FLAGS_WORK)
foreach(FLAG ${MPI_ALL_LINK_FLAGS})
if (MPI_LINK_FLAGS_WORK)
@@ -263,20 +263,20 @@ elseif (MPI_COMPILE_CMDLINE)
# Extract the set of libraries to link against from the link command
# line
- string(REGEX MATCHALL "-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
+ string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
# Determine full path names for all of the libraries that one needs
# to link against in an MPI program
set(MPI_LIBRARIES)
foreach(LIB ${MPI_LIBNAMES})
- string(REGEX REPLACE "^-l" "" LIB ${LIB})
+ string(REGEX REPLACE "^ ?-l" "" LIB ${LIB})
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
find_library(MPI_LIB ${LIB} HINTS ${MPI_LINK_PATH})
if (MPI_LIB)
list(APPEND MPI_LIBRARIES ${MPI_LIB})
- else (MPI_LIB)
- message(SEND_ERROR "Unable to find MPI library ${LIB}")
- endif (MPI_LIB)
+ elseif (NOT MPI_FIND_QUIETLY)
+ message(WARNING "Unable to find MPI library ${LIB}")
+ endif ()
endforeach(LIB)
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI detection" FORCE)
@@ -332,12 +332,6 @@ else (MPI_COMPILE_CMDLINE)
set(MPI_LINK_FLAGS "" CACHE STRING "MPI linking flags")
endif (MPI_INCLUDE_PATH AND MPI_LIBRARY)
-# on BlueGene/L the MPI lib is named libmpich.rts.a, there also these additional libs are required
-if("${MPI_LIBRARY}" MATCHES "mpich.rts")
- set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY} msglayer.rts devices.rts rts.rts devices.rts)
- set(MPI_LIBRARY ${MPI_LIBRARY} msglayer.rts devices.rts rts.rts devices.rts)
-endif("${MPI_LIBRARY}" MATCHES "mpich.rts")
-
# Set up extra variables to conform to
if (MPI_EXTRA_LIBRARY)
set(MPI_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 13b961a..1cdb071 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -16,7 +16,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
SET(MATLAB_FOUND 0)
diff --git a/Modules/FindMotif.cmake b/Modules/FindMotif.cmake
index c8715fd..f101545 100644
--- a/Modules/FindMotif.cmake
+++ b/Modules/FindMotif.cmake
@@ -14,7 +14,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
SET(MOTIF_FOUND 0)
diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake
index f42a69a..8f79436 100644
--- a/Modules/FindOpenAL.cmake
+++ b/Modules/FindOpenAL.cmake
@@ -20,7 +20,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This makes the presumption that you are include al.h like
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 833d7eb..21aafa9 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -25,7 +25,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF (WIN32)
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index 5ea329d..f149d9f 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -21,7 +21,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(CheckCSourceCompiles)
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 826ae09..d3d7fc2 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -20,7 +20,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# http://www.slproweb.com/products/Win32OpenSSL.html
@@ -40,7 +40,7 @@ MARK_AS_ADVANCED(OPENSSL_ROOT_DIR)
# Re-use the previous path:
FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h
- ${OPENSSL_ROOT_DIR}/include
+ PATHS ${OPENSSL_ROOT_DIR}/include
)
IF(WIN32 AND NOT CYGWIN)
@@ -61,21 +61,21 @@ IF(WIN32 AND NOT CYGWIN)
# libeay32MD.lib is identical to ../libeay32.lib, and
# ssleay32MD.lib is identical to ../ssleay32.lib
FIND_LIBRARY(LIB_EAY_DEBUG NAMES libeay32MDd libeay32
- ${OPENSSL_ROOT_DIR}/lib/VC
+ PATHS ${OPENSSL_ROOT_DIR}/lib/VC
)
FIND_LIBRARY(LIB_EAY_RELEASE NAMES libeay32MD libeay32
- ${OPENSSL_ROOT_DIR}/lib/VC
+ PATHS ${OPENSSL_ROOT_DIR}/lib/VC
)
FIND_LIBRARY(SSL_EAY_DEBUG NAMES ssleay32MDd ssleay32 ssl
- ${OPENSSL_ROOT_DIR}/lib/VC
+ PATHS ${OPENSSL_ROOT_DIR}/lib/VC
)
FIND_LIBRARY(SSL_EAY_RELEASE NAMES ssleay32MD ssleay32 ssl
- ${OPENSSL_ROOT_DIR}/lib/VC
+ PATHS ${OPENSSL_ROOT_DIR}/lib/VC
)
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
set( OPENSSL_LIBRARIES
- optimized ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE}
- debug ${SSL_EAY_DEBUG} ${LIB_EAY_DEBUG}
+ optimized ${SSL_EAY_RELEASE} debug ${SSL_EAY_DEBUG}
+ optimized ${LIB_EAY_RELEASE} debug ${LIB_EAY_DEBUG}
)
else()
set( OPENSSL_LIBRARIES ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE} )
@@ -85,20 +85,20 @@ IF(WIN32 AND NOT CYGWIN)
ELSEIF(MINGW)
# same player, for MingW
FIND_LIBRARY(LIB_EAY NAMES libeay32
- ${OPENSSL_ROOT_DIR}/lib/MinGW
+ PATHS ${OPENSSL_ROOT_DIR}/lib/MinGW
)
FIND_LIBRARY(SSL_EAY NAMES ssleay32
- ${OPENSSL_ROOT_DIR}/lib/MinGW
+ PATHS ${OPENSSL_ROOT_DIR}/lib/MinGW
)
MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
ELSE(MSVC)
# Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
FIND_LIBRARY(LIB_EAY NAMES libeay32
- ${OPENSSL_ROOT_DIR}/lib
+ PATHS ${OPENSSL_ROOT_DIR}/lib
)
FIND_LIBRARY(SSL_EAY NAMES ssleay32
- ${OPENSSL_ROOT_DIR}/lib
+ PATHS ${OPENSSL_ROOT_DIR}/lib
)
MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index 25cf4ee..8e6abdb 100644
--- a/Modules/FindOpenSceneGraph.cmake
+++ b/Modules/FindOpenSceneGraph.cmake
@@ -58,7 +58,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
#
diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake
index be53953..e1fe937 100644
--- a/Modules/FindOpenThreads.cmake
+++ b/Modules/FindOpenThreads.cmake
@@ -27,7 +27,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindPHP4.cmake b/Modules/FindPHP4.cmake
index 4afce99..3b21f89 100644
--- a/Modules/FindPHP4.cmake
+++ b/Modules/FindPHP4.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
SET(PHP4_POSSIBLE_INCLUDE_PATHS
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index bfc5d4a..4fb218b 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -20,7 +20,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if(PNG_FIND_QUIETLY)
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index e17105c..1acb021 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -1,21 +1,73 @@
-# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... )
-# This macro is intended to be used in FindXXX.cmake modules files.
-# It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and
-# it also sets the <UPPERCASED_NAME>_FOUND variable.
-# The package is found if all variables listed are TRUE.
-# Example:
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
#
-# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
+# This function is intended to be used in FindXXX.cmake modules files.
+# It handles the REQUIRED, QUIET and version-related arguments to FIND_PACKAGE().
+# It also sets the <UPPERCASED_NAME>_FOUND variable.
+# The package is considered found if all variables <var1>... listed contain
+# valid results, e.g. valid filepaths.
#
-# LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and
-# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
-# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
-# independent whether QUIET was used or not.
-# If it is found, the location is reported using the VAR1 argument, so
-# here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out.
-# If the second argument is DEFAULT_MSG, the message in the failure case will
-# be "Could NOT find LibXml2", if you don't like this message you can specify
-# your own custom failure message there.
+# There are two modes of this function. The first argument in both modes is
+# the name of the Find-module where it is called (in original casing).
+#
+# The first simple mode looks like this:
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
+# If the variables <var1> to <varN> are all valid, then <UPPERCASED_NAME>_FOUND
+# will be set to TRUE.
+# If DEFAULT_MSG is given as second argument, then the function will generate
+# itself useful success and error messages. You can also supply a custom error message
+# for the failure case. This is not recommended.
+#
+# The second mode is more powerful and also supports version checking:
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>]
+# [VERSION_VAR <versionvar>
+# [CONFIG_MODE]
+# [FAIL_MESSAGE "Custom failure message"] )
+#
+# As above, if <var1> through <varN> are all valid, <UPPERCASED_NAME>_FOUND
+# will be set to TRUE.
+# After REQUIRED_VARS the variables which are required for this package are listed.
+# Following VERSION_VAR the name of the variable can be specified which holds
+# the version of the package which has been found. If this is done, this version
+# will be checked against the (potentially) specified required version used
+# in the find_package() call. The EXACT keyword is also handled. The default
+# messages include information about the required version and the version
+# which has been actually found, both if the version is ok or not.
+# Use the option CONFIG_MODE if your FindXXX.cmake module is a wrapper for
+# a find_package(... NO_MODULE) call, in this case all the information
+# provided by the config-mode of find_package() will be evaluated
+# automatically.
+# Via FAIL_MESSAGE a custom failure message can be specified, if this is not
+# used, the default message will be displayed.
+#
+# Example for mode 1:
+#
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
+#
+# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
+# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
+# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
+# independent whether QUIET was used or not.
+# If it is found, success will be reported, including the content of <var1>.
+# On repeated Cmake runs, the same message won't be printed again.
+#
+# Example for mode 2:
+#
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE
+# VERSION_VAR BISON_VERSION)
+# In this case, BISON is considered to be found if the variable(s) listed
+# after REQUIRED_VAR are all valid, i.e. BISON_EXECUTABLE in this case.
+# Also the version of BISON will be checked by using the version contained
+# in BISON_VERSION.
+# Since no FAIL_MESSAGE is given, the default messages will be printed.
+#
+# Another example for mode 2:
+#
+# FIND_PACKAGE(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(Automoc4 CONFIG_MODE)
+# In this case, FindAutmoc4.cmake wraps a call to FIND_PACKAGE(Automoc4 NO_MODULE)
+# and adds an additional search directory for automoc4.
+# The following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper
+# success/error message.
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
@@ -27,34 +79,108 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(FindPackageMessage)
-FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
+INCLUDE(CMakeParseArguments)
+
+# internal helper macro
+MACRO(_FPHSA_FAILURE_MESSAGE _msg)
+ IF (${_NAME}_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${_msg}")
+ ELSE (${_NAME}_FIND_REQUIRED)
+ IF (NOT ${_NAME}_FIND_QUIETLY)
+ MESSAGE(STATUS "${_msg}")
+ ENDIF (NOT ${_NAME}_FIND_QUIETLY)
+ ENDIF (${_NAME}_FIND_REQUIRED)
+ENDMACRO(_FPHSA_FAILURE_MESSAGE _msg)
+
+
+# internal helper macro to generate the failure message when used in CONFIG_MODE:
+MACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
+ # <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
+ IF(${_NAME}_CONFIG)
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
+ ELSE(${_NAME}_CONFIG)
+ # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
+ # List them all in the error message:
+ IF(${_NAME}_CONSIDERED_CONFIGS)
+ SET(configsText "")
+ LIST(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
+ MATH(EXPR configsCount "${configsCount} - 1")
+ FOREACH(currentConfigIndex RANGE ${configsCount})
+ LIST(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
+ LIST(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
+ SET(configsText "${configsText} ${filename} (version ${version})\n")
+ ENDFOREACH(currentConfigIndex)
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
+
+ ELSE(${_NAME}_CONSIDERED_CONFIGS)
+ # Simple case: No Config-file was found at all:
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
+ ENDIF(${_NAME}_CONSIDERED_CONFIGS)
+ ENDIF(${_NAME}_CONFIG)
+ENDMACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
+
+
+FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
+
+# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
+# new extended or in the "old" mode:
+ SET(options CONFIG_MODE)
+ SET(oneValueArgs FAIL_MESSAGE VERSION_VAR)
+ SET(multiValueArgs REQUIRED_VARS)
+ SET(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
+ LIST(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
+
+ IF(${INDEX} EQUAL -1)
+ SET(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
+ SET(FPHSA_REQUIRED_VARS ${ARGN})
+ SET(FPHSA_VERSION_VAR)
+ ELSE(${INDEX} EQUAL -1)
+
+ CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
+
+ IF(FPHSA_UNPARSED_ARGUMENTS)
+ MESSAGE(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
+ ENDIF(FPHSA_UNPARSED_ARGUMENTS)
- IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
- SET(_FAIL_MESSAGE "Could NOT find ${_NAME}")
- ELSE("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
- SET(_FAIL_MESSAGE "${_FAIL_MSG}")
- ENDIF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
+ IF(NOT FPHSA_FAIL_MESSAGE)
+ SET(FPHSA_FAIL_MESSAGE "DEFAULT_MSG")
+ ENDIF(NOT FPHSA_FAIL_MESSAGE)
+ ENDIF(${INDEX} EQUAL -1)
+
+# now that we collected all arguments, process them
+
+ IF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+ SET(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
+ ENDIF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+
+ # In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
+ # when it successfully found the config-file, including version checking:
+ IF(FPHSA_CONFIG_MODE)
+ LIST(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
+ LIST(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
+ SET(FPHSA_VERSION_VAR ${_NAME}_VERSION)
+ ENDIF(FPHSA_CONFIG_MODE)
+
+ IF(NOT FPHSA_REQUIRED_VARS)
+ MESSAGE(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
+ ENDIF(NOT FPHSA_REQUIRED_VARS)
+
+ LIST(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
STRING(TOUPPER ${_NAME} _NAME_UPPER)
+ STRING(TOLOWER ${_NAME} _NAME_LOWER)
- # collect all variables which were not found, so they can be printed, so the
+ # collect all variables which were not found, so they can be printed, so the
# user knows better what went wrong (#6375)
SET(MISSING_VARS "")
SET(DETAILS "")
SET(${_NAME_UPPER}_FOUND TRUE)
- IF(NOT ${_VAR1})
- SET(${_NAME_UPPER}_FOUND FALSE)
- SET(MISSING_VARS " ${_VAR1}")
- ELSE(NOT ${_VAR1})
- SET(DETAILS "${DETAILS}[${${_VAR1}}]")
- ENDIF(NOT ${_VAR1})
-
# check if all passed variables are valid
- FOREACH(_CURRENT_VAR ${ARGN})
+ FOREACH(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
IF(NOT ${_CURRENT_VAR})
SET(${_NAME_UPPER}_FOUND FALSE)
SET(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
@@ -63,18 +189,72 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
ENDIF(NOT ${_CURRENT_VAR})
ENDFOREACH(_CURRENT_VAR)
+
+ # version handling:
+ SET(VERSION_MSG "")
+ SET(VERSION_OK TRUE)
+ SET(VERSION ${${FPHSA_VERSION_VAR}} )
+ IF (${_NAME}_FIND_VERSION)
+
+ IF(VERSION)
+
+ IF(${_NAME}_FIND_VERSION_EXACT) # exact version required
+ IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+ SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+ SET(VERSION_OK FALSE)
+ ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+ SET(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
+ ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+
+ ELSE(${_NAME}_FIND_VERSION_EXACT) # minimum version specified:
+ IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
+ SET(VERSION_OK FALSE)
+ ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ SET(VERSION_MSG "(found suitable version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
+ ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ ENDIF(${_NAME}_FIND_VERSION_EXACT)
+
+ ELSE(VERSION)
+
+ # if the package was not found, but a version was given, add that to the output:
+ IF(${_NAME}_FIND_VERSION_EXACT)
+ SET(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
+ ELSE(${_NAME}_FIND_VERSION_EXACT)
+ SET(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
+ ENDIF(${_NAME}_FIND_VERSION_EXACT)
+
+ ENDIF(VERSION)
+ ELSE (${_NAME}_FIND_VERSION)
+ IF(VERSION)
+ SET(VERSION_MSG "(found version \"${VERSION}\")")
+ ENDIF(VERSION)
+ ENDIF (${_NAME}_FIND_VERSION)
+
+ IF(VERSION_OK)
+ SET(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
+ ELSE(VERSION_OK)
+ SET(${_NAME_UPPER}_FOUND FALSE)
+ ENDIF(VERSION_OK)
+
+
+ # print the result:
IF (${_NAME_UPPER}_FOUND)
- FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_VAR1}}" "${DETAILS}")
+ FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG}" "${DETAILS}")
ELSE (${_NAME_UPPER}_FOUND)
- IF (${_NAME}_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE} (missing: ${MISSING_VARS})")
- ELSE (${_NAME}_FIND_REQUIRED)
- IF (NOT ${_NAME}_FIND_QUIETLY)
- MESSAGE(STATUS "${_FAIL_MESSAGE} (missing: ${MISSING_VARS})")
- ENDIF (NOT ${_NAME}_FIND_QUIETLY)
- ENDIF (${_NAME}_FIND_REQUIRED)
+
+ IF(FPHSA_CONFIG_MODE)
+ _FPHSA_HANDLE_FAILURE_CONFIG_MODE()
+ ELSE(FPHSA_CONFIG_MODE)
+ IF(NOT VERSION_OK)
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
+ ELSE(NOT VERSION_OK)
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
+ ENDIF(NOT VERSION_OK)
+ ENDIF(FPHSA_CONFIG_MODE)
+
ENDIF (${_NAME_UPPER}_FOUND)
SET(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
-ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
+ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG)
diff --git a/Modules/FindPackageMessage.cmake b/Modules/FindPackageMessage.cmake
index aa1bbd9..eb398b2 100644
--- a/Modules/FindPackageMessage.cmake
+++ b/Modules/FindPackageMessage.cmake
@@ -28,7 +28,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FUNCTION(FIND_PACKAGE_MESSAGE pkg msg details)
diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake
index bf982b2..87d1ff9 100644
--- a/Modules/FindPerl.cmake
+++ b/Modules/FindPerl.cmake
@@ -14,7 +14,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(FindCygwin)
diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index 422282f..d9b0e2b 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/Modules/FindPerlLibs.cmake
@@ -8,6 +8,9 @@
# PERL_LIBRARY = path to libperl
# PERL_EXECUTABLE = full path to the perl binary
#
+# The minimum required version of Perl can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(PerlLibs 6.0)
+#
# The following variables are also available if needed
# (introduced after CMake 2.6.4)
#
@@ -30,7 +33,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# find the perl executable
@@ -227,8 +230,9 @@ endif (PERL_EXECUTABLE)
# handle the QUIETLY and REQUIRED arguments and set PERLLIBS_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(PerlLibs DEFAULT_MSG PERL_LIBRARY PERL_INCLUDE_PATH)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PerlLibs REQUIRED_VARS PERL_LIBRARY PERL_INCLUDE_PATH
+ VERSION_VAR PERL_VERSION)
# Introduced after CMake 2.6.4 to bring module into compliance
set(PERL_INCLUDE_DIR ${PERL_INCLUDE_PATH})
diff --git a/Modules/FindPhysFS.cmake b/Modules/FindPhysFS.cmake
index 98bebe6..c38f4bc 100644
--- a/Modules/FindPhysFS.cmake
+++ b/Modules/FindPhysFS.cmake
@@ -20,7 +20,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(PHYSFS_INCLUDE_DIR physfs.h
diff --git a/Modules/FindPike.cmake b/Modules/FindPike.cmake
index d1b5ea6..125e428 100644
--- a/Modules/FindPike.cmake
+++ b/Modules/FindPike.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FILE(GLOB PIKE_POSSIBLE_INCLUDE_PATHS
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 3cbb7af..c47f583 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -80,7 +80,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
### Common stuff ####
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
new file mode 100644
index 0000000..6455c99
--- /dev/null
+++ b/Modules/FindPostgreSQL.cmake
@@ -0,0 +1,181 @@
+# Find the PostgreSQL installation.
+#
+# ----------------------------------------------------------------------------
+# Usage:
+# In your CMakeLists.txt file do something like this:
+# ...
+# # PostgreSQL
+# FIND_PACKAGE(PostgreSQL)
+# ...
+# if( PostgreSQL_FOUND )
+# include_directories(${PostgreSQL_INCLUDE_DIRS})
+# link_directories(${PostgreSQL_LIBRARY_DIRS})
+# endif( PostgreSQL_FOUND )
+# ...
+# Remember to include ${PostgreSQL_LIBRARIES} in the target_link_libraries() statement.
+#
+#
+# In Windows, we make the assumption that, if the PostgreSQL files are installed, the default directory
+# will be C:\Program Files\PostgreSQL.
+#
+
+#=============================================================================
+# Copyright 2004-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# ----------------------------------------------------------------------------
+# History:
+# This module is derived from the module originally found in the VTK source tree.
+#
+# ----------------------------------------------------------------------------
+# Note:
+# PostgreSQL_ADDITIONAL_VERSIONS is a variable that can be used to set the
+# version mumber of the implementation of PostgreSQL.
+# In Windows the default installation of PostgreSQL uses that as part of the path.
+# E.g C:\Program Files\PostgreSQL\8.4.
+# Currently, the following version numbers are known to this module:
+# "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0"
+#
+# To use this variable just do something like this:
+# set(PostgreSQL_ADDITIONAL_VERSIONS "9.2" "8.4.4")
+# before calling FIND_PACKAGE(PostgreSQL) in your CMakeLists.txt file.
+# This will mean that the versions you set here will be found first in the order
+# specified before the default ones are searched.
+#
+# ----------------------------------------------------------------------------
+# You may need to manually set:
+# PostgreSQL_INCLUDE_DIR - the path to where the PostgreSQL include files are.
+# PostgreSQL_LIBRARY_DIR - The path to where the PostgreSQL library files are.
+# If FindPostgreSQL.cmake cannot find the include files or the library files.
+#
+# ----------------------------------------------------------------------------
+# The following variables are set if PostgreSQL is found:
+# PostgreSQL_FOUND - Set to true when PostgreSQL is found.
+# PostgreSQL_INCLUDE_DIRS - Include directories for PostgreSQL
+# PostgreSQL_LIBRARY_DIRS - Link directories for PostgreSQL libraries
+# PostgreSQL_LIBRARIES - The PostgreSQL libraries.
+#
+# ----------------------------------------------------------------------------
+# If you have installed PostgreSQL in a non-standard location.
+# (Please note that in the following comments, it is assumed that <Your Path>
+# points to the root directory of the include directory of PostgreSQL.)
+# Then you have three options.
+# 1) After CMake runs, set PostgreSQL_INCLUDE_DIR to <Your Path>/include and
+# PostgreSQL_LIBRARY_DIR to wherever the library pq (or libpq in windows) is
+# 2) Use CMAKE_INCLUDE_PATH to set a path to <Your Path>/PostgreSQL<-version>. This will allow find_path()
+# to locate PostgreSQL_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g. In your CMakeLists.txt file
+# SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include")
+# 3) Set an environment variable called ${PostgreSQL_ROOT} that points to the root of where you have
+# installed PostgreSQL, e.g. <Your Path>.
+#
+# ----------------------------------------------------------------------------
+
+set(PostgreSQL_INCLUDE_PATH_DESCRIPTION "top-level directory containing the PostgreSQL include directories. E.g /usr/local/include/PostgreSQL/8.4 or C:/Program Files/PostgreSQL/8.4/include")
+set(PostgreSQL_INCLUDE_DIR_MESSAGE "Set the PostgreSQL_INCLUDE_DIR cmake cache entry to the ${PostgreSQL_INCLUDE_PATH_DESCRIPTION}")
+set(PostgreSQL_LIBRARY_PATH_DESCRIPTION "top-level directory containing the PostgreSQL libraries.")
+set(PostgreSQL_LIBRARY_DIR_MESSAGE "Set the PostgreSQL_LIBRARY_DIR cmake cache entry to the ${PostgreSQL_LIBRARY_PATH_DESCRIPTION}")
+set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to where PostgreSQL is found on the machine E.g C:/Program Files/PostgreSQL/8.4")
+
+
+set(PostgreSQL_ROOT_DIRECTORIES $ENV{PostgreSQL_ROOT})
+if(PostgreSQL_ROOT_DIRECTORIES)
+ file(TO_CMAKE_PATH ${PostgreSQL_ROOT_DIRECTORIES} PostgreSQL_ROOT_DIRECTORIES)
+endif(PostgreSQL_ROOT_DIRECTORIES)
+
+set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
+ "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
+
+# Define additional search paths for root directories.
+if ( WIN32 )
+ foreach (suffix ${PostgreSQL_KNOWN_VERSIONS} )
+ set(PostgreSQL_ADDITIONAL_SEARCH_PATHS ${PostgreSQL_ADDITIONAL_SEARCH_PATHS} "C:/Program Files/PostgreSQL/${suffix}" )
+ endforeach(suffix)
+endif( WIN32 )
+set( PostgreSQL_ROOT_DIRECTORIES
+ ${PostgreSQL_ROOT_DIRECTORIES}
+ ${PostgreSQL_ROOT}
+ ${PostgreSQL_ADDITIONAL_SEARCH_PATHS}
+)
+
+#
+# Look for an installation.
+#
+find_path(PostgreSQL_INCLUDE_DIR
+ NAMES libpq-fe.h
+ PATHS
+ # Look in other places.
+ ${PostgreSQL_ROOT_DIRECTORIES}
+ PATH_SUFFIXES
+ postgresql
+ include
+ # Help the user find it if we cannot.
+ DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
+)
+
+# The PostgreSQL library.
+set (PostgreSQL_LIBRARY_TO_FIND pq)
+# Setting some more prefixes for the library
+set (PostgreSQL_LIB_PREFIX "")
+if ( WIN32 )
+ set (PostgreSQL_LIB_PREFIX ${PostgreSQL_LIB_PREFIX} "lib")
+ set ( PostgreSQL_LIBRARY_TO_FIND ${PostgreSQL_LIB_PREFIX}${PostgreSQL_LIBRARY_TO_FIND})
+endif()
+
+find_library( PostgreSQL_LIBRARY
+ NAMES ${PostgreSQL_LIBRARY_TO_FIND}
+ PATHS
+ ${PostgreSQL_ROOT_DIRECTORIES}
+ PATH_SUFFIXES
+ lib
+)
+get_filename_component(PostgreSQL_LIBRARY_DIR ${PostgreSQL_LIBRARY} PATH)
+
+# Did we find anything?
+set( PostgreSQL_FOUND 0 )
+if ( EXISTS "${PostgreSQL_INCLUDE_DIR}" AND EXISTS "${PostgreSQL_LIBRARY_DIR}" )
+ set( PostgreSQL_FOUND 1 )
+else ( EXISTS "${PostgreSQL_INCLUDE_DIR}" AND EXISTS "${PostgreSQL_LIBRARY_DIR}" )
+ if ( POSTGRES_REQUIRED )
+ message( FATAL_ERROR "PostgreSQL is required. ${PostgreSQL_ROOT_DIR_MESSAGE}" )
+ endif ( POSTGRES_REQUIRED )
+endif (EXISTS "${PostgreSQL_INCLUDE_DIR}" AND EXISTS "${PostgreSQL_LIBRARY_DIR}" )
+
+# Now try to get the include and library path.
+if(PostgreSQL_FOUND)
+
+ if(EXISTS "${PostgreSQL_INCLUDE_DIR}")
+ set(PostgreSQL_INCLUDE_DIRS
+ ${PostgreSQL_INCLUDE_DIR}
+ )
+ endif(EXISTS "${PostgreSQL_INCLUDE_DIR}")
+
+ if(EXISTS "${PostgreSQL_LIBRARY_DIR}")
+ set(PostgreSQL_LIBRARY_DIRS
+ ${PostgreSQL_LIBRARY_DIR}
+ )
+ set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY_TO_FIND})
+ endif(EXISTS "${PostgreSQL_LIBRARY_DIR}")
+
+ #message("Final PostgreSQL include dir: ${PostgreSQL_INCLUDE_DIRS}")
+ #message("Final PostgreSQL library dir: ${PostgreSQL_LIBRARY_DIRS}")
+ #message("Final PostgreSQL libraries: ${PostgreSQL_LIBRARIES}")
+endif(PostgreSQL_FOUND)
+
+if(NOT PostgreSQL_FOUND)
+ if(NOT PostgreSQL_FIND_QUIETLY)
+ message(STATUS "PostgreSQL was not found. ${PostgreSQL_DIR_MESSAGE}")
+ else(NOT PostgreSQL_FIND_QUIETLY)
+ if(PostgreSQL_FIND_REQUIRED)
+ message(FATAL_ERROR "PostgreSQL was not found. ${PostgreSQL_DIR_MESSAGE}")
+ endif(PostgreSQL_FIND_REQUIRED)
+ endif(NOT PostgreSQL_FIND_QUIETLY)
+endif(NOT PostgreSQL_FOUND)
diff --git a/Modules/FindProducer.cmake b/Modules/FindProducer.cmake
index 3525509..d5aefb9 100644
--- a/Modules/FindProducer.cmake
+++ b/Modules/FindProducer.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 1cd59e7..c9823c2 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -48,7 +48,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
function(PROTOBUF_GENERATE_CPP SRCS HDRS)
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 167f533..6c97ba3 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -7,7 +7,7 @@
#
#=============================================================================
-# Copyright 2005-2009 Kitware, Inc.
+# Copyright 2005-2010 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -16,12 +16,13 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(PYTHON_EXECUTABLE
- NAMES python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python
+ NAMES python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python
PATHS
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 1ba21b5..283c914 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -20,7 +20,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CMakeFindFrameworks)
@@ -105,11 +105,9 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs DEFAULT_MSG PYTHON_LIBRARIES PYTHON
# PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is used to build modules for python.
# PYTHON_WRITE_MODULES_HEADER(<filename>) writes a header file you can include
# in your sources to initialize the static python modules
-
-GET_PROPERTY(_TARGET_SUPPORTS_SHARED_LIBS
- GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
-
FUNCTION(PYTHON_ADD_MODULE _NAME )
+ GET_PROPERTY(_TARGET_SUPPORTS_SHARED_LIBS
+ GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
OPTION(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE)
OPTION(PYTHON_MODULE_${_NAME}_BUILD_SHARED
"Add module ${_NAME} shared" ${_TARGET_SUPPORTS_SHARED_LIBS})
@@ -130,6 +128,13 @@ FUNCTION(PYTHON_ADD_MODULE _NAME )
ADD_LIBRARY(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
# TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES})
+ IF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+ SET_TARGET_PROPERTIES(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")
+ IF(WIN32 AND NOT CYGWIN)
+ SET_TARGET_PROPERTIES(${_NAME} PROPERTIES SUFFIX ".pyd")
+ ENDIF(WIN32 AND NOT CYGWIN)
+ ENDIF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+
ENDIF(PYTHON_ENABLE_MODULE_${_NAME})
ENDFUNCTION(PYTHON_ADD_MODULE)
diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake
index 85213e8..2b8dfd7 100644
--- a/Modules/FindQt.cmake
+++ b/Modules/FindQt.cmake
@@ -27,7 +27,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# look for signs of qt3 installations
diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake
index d2f2f90..3606a5f 100644
--- a/Modules/FindQt3.cmake
+++ b/Modules/FindQt3.cmake
@@ -30,7 +30,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# If Qt4 has already been found, fail.
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 654879e..d2d39e6 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -317,7 +317,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Use FIND_PACKAGE( Qt4 COMPONENTS ... ) to enable modules
@@ -358,6 +358,94 @@ SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
SET( QT_DEFINITIONS "")
+# convenience macro for dealing with debug/release library names
+MACRO (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
+
+ STRING(TOUPPER "${_camelCaseBasename}" basename)
+
+ # The name of the imported targets, i.e. the prefix "Qt4::" must not change,
+ # since it is stored in EXPORT-files as name of a required library. If the name would change
+ # here, this would lead to the imported Qt4-library targets not being resolved by cmake anymore.
+ IF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+
+ IF(NOT TARGET Qt4::${_camelCaseBasename})
+ ADD_LIBRARY(Qt4::${_camelCaseBasename} UNKNOWN IMPORTED )
+
+ IF (QT_${basename}_LIBRARY_RELEASE)
+ SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+ SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" )
+ ENDIF (QT_${basename}_LIBRARY_RELEASE)
+
+ IF (QT_${basename}_LIBRARY_DEBUG)
+ SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+ SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" )
+ ENDIF (QT_${basename}_LIBRARY_DEBUG)
+ ENDIF(NOT TARGET Qt4::${_camelCaseBasename})
+
+ # If QT_USE_IMPORTED_TARGETS is enabled, the QT_QTFOO_LIBRARY variables are set to point at these
+ # imported targets. This works better in general, and is also in almost all cases fully
+ # backward compatible. The only issue is when a project A which had this enabled then exports its
+ # libraries via export or EXPORT_LIBRARY_DEPENDENCIES(). In this case the libraries from project
+ # A will depend on the imported Qt targets, and the names of these imported targets will be stored
+ # in the dependency files on disk. This means when a project B then uses project A, these imported
+ # targets must be created again, otherwise e.g. "Qt4__QtCore" will be interpreted as name of a
+ # library file on disk, and not as a target, and linking will fail:
+ IF(QT_USE_IMPORTED_TARGETS)
+ SET(QT_${basename}_LIBRARY Qt4::${_camelCaseBasename} )
+ SET(QT_${basename}_LIBRARIES Qt4::${_camelCaseBasename} )
+ ELSE(QT_USE_IMPORTED_TARGETS)
+
+ # if the release- as well as the debug-version of the library have been found:
+ IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
+ # if the generator supports configuration types then set
+ # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
+ ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ # if there are no configuration types and CMAKE_BUILD_TYPE has no value
+ # then just use the release libraries
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} )
+ ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
+ ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
+
+ # if only the release version was found, set the debug variable also to the release version
+ IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
+ SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE})
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE})
+ SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE})
+ ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
+
+ # if only the debug version was found, set the release variable also to the debug version
+ IF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
+ SET(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG})
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG})
+ SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG})
+ ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
+
+ # put the value in the cache:
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE)
+
+ ENDIF(QT_USE_IMPORTED_TARGETS)
+
+ SET(QT_${basename}_FOUND 1)
+
+ ELSE (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+
+ SET(QT_${basename}_LIBRARY "" CACHE STRING "The Qt ${basename} library" FORCE)
+
+ ENDIF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+
+ IF (QT_${basename}_INCLUDE_DIR)
+ #add the include directory to QT_INCLUDES
+ SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
+ ENDIF (QT_${basename}_INCLUDE_DIR)
+
+ # Make variables changeble to the advanced user
+ MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
+ENDMACRO (_QT4_ADJUST_LIB_VARS)
+
+
SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
@@ -468,53 +556,149 @@ ENDIF (QT_QMAKE_EXECUTABLE)
IF (QT4_QMAKE_FOUND)
- # ask qmake for the library dir
- # Set QT_LIBRARY_DIR
- IF (NOT QT_LIBRARY_DIR OR QT_QMAKE_CHANGED)
+ # ask qmake for the mkspecs directory
+ # we do this first because QT_LIBINFIX might be set
+ IF (NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED)
+ EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
+ ARGS "-query QMAKE_MKSPECS"
+ OUTPUT_VARIABLE qt_mkspecs_dirs )
+ # do not replace : on windows as it might be a drive letter
+ # and windows should already use ; as a separator
+ IF(NOT WIN32)
+ STRING(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}")
+ ENDIF(NOT WIN32)
+ set(qt_cross_paths)
+ foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
+ set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/mkspecs")
+ endforeach(qt_cross_path)
+ SET(QT_MKSPECS_DIR NOTFOUND)
+ FIND_PATH(QT_MKSPECS_DIR NAMES qconfig.pri
+ HINTS ${qt_cross_paths} ${qt_mkspecs_dirs}
+ DOC "The location of the Qt mkspecs containing qconfig.pri")
+ ENDIF()
+
+ IF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
+ FILE(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents)
+ STRING(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG "${_qconfig_FILE_contents}")
+ STRING(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG "${_qconfig_FILE_contents}")
+ STRING(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}")
+ STRING(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}")
+ STRING(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}")
+ ENDIF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
+ IF("${QT_EDITION}" MATCHES "DesktopLight")
+ SET(QT_EDITION_DESKTOPLIGHT 1)
+ ENDIF("${QT_EDITION}" MATCHES "DesktopLight")
+
+ # ask qmake for the library dir as a hint, then search for QtCore library and use that as a reference for finding the
+ # others and for setting QT_LIBRARY_DIR
+ IF (NOT QT_QTCORE_LIBRARY OR QT_QMAKE_CHANGED)
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_LIBS"
OUTPUT_VARIABLE QT_LIBRARY_DIR_TMP )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${QT_LIBRARY_DIR_TMP}" QT_LIBRARY_DIR_TMP)
- IF(EXISTS "${QT_LIBRARY_DIR_TMP}")
- SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE PATH "Qt library dir" FORCE)
- ELSE(EXISTS "${QT_LIBRARY_DIR_TMP}")
- MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as ${QT_LIBRARY_DIR_TMP}")
- MESSAGE("Warning: ${QT_LIBRARY_DIR_TMP} does NOT exist, Qt must NOT be installed correctly.")
- ENDIF(EXISTS "${QT_LIBRARY_DIR_TMP}")
- ENDIF(NOT QT_LIBRARY_DIR OR QT_QMAKE_CHANGED)
-
+ SET(QT_QTCORE_LIBRARY_RELEASE NOTFOUND)
+ SET(QT_QTCORE_LIBRARY_DEBUG NOTFOUND)
+ FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE
+ NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4
+ HINTS ${QT_LIBRARY_DIR_TMP}
+ NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG
+ NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4
+ HINTS ${QT_LIBRARY_DIR_TMP}
+ NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
+ )
+
+ # try dropping a hint if trying to use Visual Studio with Qt built by mingw
+ IF(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
+ IF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
+ MESSAGE( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by mingw. Those compilers do not produce code compatible with each other.")
+ ENDIF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
+ ENDIF(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
+
+ ENDIF (NOT QT_QTCORE_LIBRARY OR QT_QMAKE_CHANGED)
+
+ _QT4_ADJUST_LIB_VARS(QtCore)
+
+ # set QT_LIBRARY_DIR based on location of QtCore found.
+ IF(QT_QTCORE_LIBRARY_RELEASE)
+ GET_FILENAME_COMPONENT(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_RELEASE}" PATH)
+ SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
+ SET(QT_QTCORE_FOUND 1)
+ ELSEIF(QT_QTCORE_LIBRARY_DEBUG)
+ GET_FILENAME_COMPONENT(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_DEBUG}" PATH)
+ SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
+ SET(QT_QTCORE_FOUND 1)
+ ELSE()
+ MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as ${QT_LIBRARY_DIR_TMP}")
+ MESSAGE("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly, or it wasn't found for cross compiling.")
+ IF(Qt4_FIND_REQUIRED)
+ MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
+ ENDIF(Qt4_FIND_REQUIRED)
+ ENDIF()
+
IF (APPLE)
IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
- SET(QT_USE_FRAMEWORKS ON
- CACHE BOOL "Set to ON if Qt build uses frameworks." FORCE)
+ SET(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE)
ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
- SET(QT_USE_FRAMEWORKS OFF
- CACHE BOOL "Set to ON if Qt build uses frameworks." FORCE)
+ SET(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE)
ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
-
MARK_AS_ADVANCED(QT_USE_FRAMEWORKS)
ENDIF (APPLE)
# ask qmake for the binary dir
- IF (QT_LIBRARY_DIR AND NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
+ IF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_BINS"
OUTPUT_VARIABLE qt_bins )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_bins}" qt_bins)
SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE)
- ENDIF (QT_LIBRARY_DIR AND NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
+ ENDIF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
# ask qmake for the include dir
- IF (QT_LIBRARY_DIR AND NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED)
+ IF (QT_LIBRARY_DIR AND (NOT QT_QTCORE_INCLUDE_DIR OR NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED))
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_HEADERS"
OUTPUT_VARIABLE qt_headers )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_headers}" qt_headers)
- SET(QT_HEADERS_DIR ${qt_headers} CACHE INTERNAL "" FORCE)
- ENDIF (QT_LIBRARY_DIR AND NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED)
+ SET(QT_QTCORE_INCLUDE_DIR NOTFOUND)
+ FIND_PATH(QT_QTCORE_INCLUDE_DIR QtCore
+ HINTS ${qt_headers}
+ ${QT_LIBRARY_DIR}/QtCore.framework/Headers
+ PATH_SUFFIXES QtCore
+ )
+
+ # Set QT_HEADERS_DIR based on finding QtCore header
+ IF(QT_QTCORE_INCLUDE_DIR)
+ IF(QT_USE_FRAMEWORKS)
+ SET(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
+ ELSE(QT_USE_FRAMEWORKS)
+ GET_FILENAME_COMPONENT(qt_headers "${QT_QTCORE_INCLUDE_DIR}/../" ABSOLUTE)
+ SET(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
+ ENDIF(QT_USE_FRAMEWORKS)
+ ELSEIF()
+ MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_HEADERS as ${qt_headers}")
+ MESSAGE("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly.")
+ ENDIF()
+ ENDIF()
+
+ # Set QT_INCLUDE_DIR based on QT_HEADERS_DIR
+ IF(QT_HEADERS_DIR)
+ IF(QT_USE_FRAMEWORKS)
+ # Qt/Mac frameworks has two include dirs.
+ # One is the framework include for which CMake will add a -F flag
+ # and the other is an include dir for non-framework Qt modules
+ SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR} ${QT_QTCORE_LIBRARY} )
+ ELSE(QT_USE_FRAMEWORKS)
+ SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
+ ENDIF(QT_USE_FRAMEWORKS)
+ ENDIF(QT_HEADERS_DIR)
+
+ # Set QT_INCLUDES
+ SET( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
# ask qmake for the documentation directory
@@ -527,21 +711,6 @@ IF (QT4_QMAKE_FOUND)
SET(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs" FORCE)
ENDIF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED)
- # ask qmake for the mkspecs directory
- IF (QT_LIBRARY_DIR AND NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED)
- EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
- ARGS "-query QMAKE_MKSPECS"
- OUTPUT_VARIABLE qt_mkspecs_dirs )
- # do not replace : on windows as it might be a drive letter
- # and windows should already use ; as a separator
- IF(UNIX)
- STRING(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}")
- ENDIF(UNIX)
- SET(QT_MKSPECS_DIR NOTFOUND)
- FIND_PATH(QT_MKSPECS_DIR qconfig.pri PATHS ${qt_mkspecs_dirs}
- DOC "The location of the Qt mkspecs containing qconfig.pri"
- NO_DEFAULT_PATH )
- ENDIF (QT_LIBRARY_DIR AND NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED)
# ask qmake for the plugins directory
IF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED)
@@ -550,7 +719,13 @@ IF (QT4_QMAKE_FOUND)
OUTPUT_VARIABLE qt_plugins_dir )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_plugins_dir}" qt_plugins_dir)
- SET(QT_PLUGINS_DIR ${qt_plugins_dir} CACHE PATH "The location of the Qt plugins" FORCE)
+ SET(QT_PLUGINS_DIR NOTFOUND)
+ foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
+ set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/plugins")
+ endforeach(qt_cross_path)
+ FIND_PATH(QT_PLUGINS_DIR NAMES accessible imageformats sqldrivers codecs designer
+ HINTS ${qt_cross_paths} ${qt_plugins_dir}
+ DOC "The location of the Qt plugins")
ENDIF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED)
# ask qmake for the translations directory
@@ -568,6 +743,8 @@ IF (QT4_QMAKE_FOUND)
QT_PLUGINS_DIR QT_TRANSLATIONS_DIR)
+
+
#############################################
#
# Find out what window system we're using
@@ -577,11 +754,7 @@ IF (QT4_QMAKE_FOUND)
SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
SET(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
# Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
- SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_HEADERS_DIR}")
- # On Mac OS X when Qt has framework support, also add the framework path
- IF( QT_USE_FRAMEWORKS )
- SET(CMAKE_REQUIRED_FLAGS "-F${QT_LIBRARY_DIR} ")
- ENDIF( QT_USE_FRAMEWORKS )
+ SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
# Check for Window system symbols (note: only one should end up being set)
CHECK_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
CHECK_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
@@ -615,7 +788,7 @@ IF (QT4_QMAKE_FOUND)
#
########################################
- SET(QT_MODULES QtCore QtGui Qt3Support QtSvg QtScript QtTest QtUiTools
+ SET(QT_MODULES QtGui Qt3Support QtSvg QtScript QtTest QtUiTools
QtHelp QtWebKit QtXmlPatterns phonon QtNetwork QtMultimedia
QtNsPlugin QtOpenGL QtSql QtXml QtDesigner QtDBus QtScriptTools
QtDeclarative)
@@ -648,10 +821,10 @@ IF (QT4_QMAKE_FOUND)
SET(QT_QAXSERVER_INCLUDE_DIR NOTFOUND)
SET(QT_QAXSERVER_LIBRARY_RELEASE NOTFOUND)
SET(QT_QAXSERVER_LIBRARY_DEBUG NOTFOUND)
- IF(WIN32)
+ IF(Q_WS_WIN)
SET(QT_QTMAIN_LIBRARY_DEBUG NOTFOUND)
SET(QT_QTMAIN_LIBRARY_RELEASE NOTFOUND)
- ENDIF(WIN32)
+ ENDIF(Q_WS_WIN)
ENDIF(QT_QMAKE_CHANGED)
FOREACH(QT_MODULE ${QT_MODULES})
@@ -674,20 +847,18 @@ IF (QT4_QMAKE_FOUND)
ENDIF(${QT_MODULE} STREQUAL "phonon")
ENDFOREACH(QT_MODULE)
- IF(WIN32)
+ IF(Q_WS_WIN)
SET(QT_MODULES ${QT_MODULES} QAxContainer QAxServer)
# Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR
FIND_PATH(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
- PATHS
- ${QT_HEADERS_DIR}/ActiveQt
+ PATHS ${QT_HEADERS_DIR}/ActiveQt
NO_DEFAULT_PATH
)
FIND_PATH(QT_QAXSERVER_INCLUDE_DIR ActiveQt
- PATHS
- ${QT_HEADERS_DIR}/ActiveQt
+ PATHS ${QT_HEADERS_DIR}/ActiveQt
NO_DEFAULT_PATH
)
- ENDIF(WIN32)
+ ENDIF(Q_WS_WIN)
# Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR
FIND_PATH(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents
@@ -713,49 +884,6 @@ IF (QT4_QMAKE_FOUND)
NO_DEFAULT_PATH
)
- # Set QT_INCLUDE_DIR by removine "/QtCore" in the string ${QT_QTCORE_INCLUDE_DIR}
- IF( QT_QTCORE_INCLUDE_DIR )
- IF (QT_USE_FRAMEWORKS)
- SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
- ELSE (QT_USE_FRAMEWORKS)
- STRING( REGEX REPLACE "/QtCore$" "" qt4_include_dir ${QT_QTCORE_INCLUDE_DIR})
- SET( QT_INCLUDE_DIR ${qt4_include_dir})
- ENDIF (QT_USE_FRAMEWORKS)
- ENDIF( QT_QTCORE_INCLUDE_DIR )
-
- IF( NOT QT_INCLUDE_DIR)
- IF(Qt4_FIND_REQUIRED)
- MESSAGE( FATAL_ERROR "Could NOT find QtCore header")
- ENDIF(Qt4_FIND_REQUIRED)
- ENDIF( NOT QT_INCLUDE_DIR)
-
- # Make variables changeble to the advanced user
- MARK_AS_ADVANCED( QT_INCLUDE_DIR )
-
- # Set QT_INCLUDES
- SET( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} )
-
-
-
-
-
- #######################################
- #
- # Qt configuration
- #
- #######################################
- IF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
- FILE(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents)
- STRING(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG "${_qconfig_FILE_contents}")
- STRING(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG "${_qconfig_FILE_contents}")
- STRING(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}")
- STRING(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}")
- STRING(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}")
- ENDIF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
- IF("${QT_EDITION}" MATCHES "DesktopLight")
- SET(QT_EDITION_DESKTOPLIGHT 1)
- ENDIF("${QT_EDITION}" MATCHES "DesktopLight")
-
########################################
#
# Setting the LIBRARY-Variables
@@ -780,48 +908,32 @@ IF (QT4_QMAKE_FOUND)
FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
ENDIF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
- IF( NOT QT_QTCORE_LIBRARY_DEBUG AND NOT QT_QTCORE_LIBRARY_RELEASE )
-
- # try dropping a hint if trying to use Visual Studio with Qt built by mingw
- IF(QT_LIBRARY_DIR AND MSVC)
- IF(EXISTS ${QT_LIBRARY_DIR}/libqtmain.a)
- MESSAGE( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by mingw")
- ENDIF(EXISTS ${QT_LIBRARY_DIR}/libqtmain.a)
- ENDIF(QT_LIBRARY_DIR AND MSVC)
-
- IF(Qt4_FIND_REQUIRED)
- MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
- ENDIF(Qt4_FIND_REQUIRED)
- ENDIF( NOT QT_QTCORE_LIBRARY_DEBUG AND NOT QT_QTCORE_LIBRARY_RELEASE )
-
# Set QT_QTDESIGNERCOMPONENTS_LIBRARY
- FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponents${QT_LIBINFIX}_debug QtDesignerComponents${QT_LIBINFIX}d QtDesignerComponents${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTMAIN_LIBRARY
- IF(WIN32)
- FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR}
- NO_DEFAULT_PATH)
- FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR}
- NO_DEFAULT_PATH)
- ENDIF(WIN32)
+ IF(Q_WS_WIN)
+ FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ ENDIF(Q_WS_WIN)
# Set QT_QTASSISTANTCLIENT_LIBRARY
- FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
- FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTASSISTANT_LIBRARY
- FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 QtAssistant${QT_LIBINFIX}_debug QtAssistant${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTHELP_LIBRARY
- FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} QtCLucene${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} QtCLucene${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_DEBUG NAMES QtCLucene${QT_LIBINFIX}_debug QtCLucene${QT_LIBINFIX}d QtCLucene${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
- # QtCLucene not with other frameworks with binary installation (in /usr/lib)
IF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
ENDIF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
+
############################################
#
# Check the existence of the libraries.
@@ -835,137 +947,23 @@ IF (QT4_QMAKE_FOUND)
ENDIF(QT_USE_FRAMEWORKS)
- MACRO (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
-
- STRING(TOUPPER "${_camelCaseBasename}" basename)
-
- # The name of the imported targets, i.e. the prefix "Qt4::" must not change,
- # since it is stored in EXPORT-files as name of a required library. If the name would change
- # here, this would lead to the imported Qt4-library targets not being resolved by cmake anymore.
- IF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
-
- IF(NOT TARGET Qt4::${_camelCaseBasename})
- ADD_LIBRARY(Qt4::${_camelCaseBasename} UNKNOWN IMPORTED )
-
- IF (QT_${basename}_LIBRARY_RELEASE)
- SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
- SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" )
- ENDIF (QT_${basename}_LIBRARY_RELEASE)
-
- IF (QT_${basename}_LIBRARY_DEBUG)
- SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
- SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" )
- ENDIF (QT_${basename}_LIBRARY_DEBUG)
- ENDIF(NOT TARGET Qt4::${_camelCaseBasename})
-
- # If QT_USE_IMPORTED_TARGETS is enabled, the QT_QTFOO_LIBRARY variables are set to point at these
- # imported targets. This works better in general, and is also in almost all cases fully
- # backward compatible. The only issue is when a project A which had this enabled then exports its
- # libraries via export or EXPORT_LIBRARY_DEPENDENCIES(). In this case the libraries from project
- # A will depend on the imported Qt targets, and the names of these imported targets will be stored
- # in the dependency files on disk. This means when a project B then uses project A, these imported
- # targets must be created again, otherwise e.g. "Qt4__QtCore" will be interpreted as name of a
- # library file on disk, and not as a target, and linking will fail:
- IF(QT_USE_IMPORTED_TARGETS)
- SET(QT_${basename}_LIBRARY Qt4::${_camelCaseBasename} )
- SET(QT_${basename}_LIBRARIES Qt4::${_camelCaseBasename} )
- ELSE(QT_USE_IMPORTED_TARGETS)
-
- # if the release- as well as the debug-version of the library have been found:
- IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
- # if the generator supports configuration types then set
- # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
- IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
- SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
- ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
- # if there are no configuration types and CMAKE_BUILD_TYPE has no value
- # then just use the release libraries
- SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} )
- ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
- SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
- ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
-
- # if only the release version was found, set the debug variable also to the release version
- IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
- SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE})
- SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE})
- SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE})
- ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
-
- # if only the debug version was found, set the release variable also to the debug version
- IF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
- SET(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG})
- SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG})
- SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG})
- ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
-
- # put the value in the cache:
- SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE)
-
- ENDIF(QT_USE_IMPORTED_TARGETS)
-
-# message(STATUS "QT_${basename}_LIBRARY: ${QT_${basename}_LIBRARY}")
-
- SET(QT_${basename}_FOUND 1)
-
- ENDIF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
-
- IF (QT_${basename}_INCLUDE_DIR)
- #add the include directory to QT_INCLUDES
- SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
- ENDIF (QT_${basename}_INCLUDE_DIR)
-
- # Make variables changeble to the advanced user
- MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
- ENDMACRO (_QT4_ADJUST_LIB_VARS)
-
-
# Set QT_xyz_LIBRARY variable and add
# library include path to QT_INCLUDES
- _QT4_ADJUST_LIB_VARS(QtCore)
- _QT4_ADJUST_LIB_VARS(QtGui)
- _QT4_ADJUST_LIB_VARS(Qt3Support)
+ FOREACH(QT_MODULE ${QT_MODULES})
+ _QT4_ADJUST_LIB_VARS(${QT_MODULE})
+ ENDFOREACH(QT_MODULE)
+
_QT4_ADJUST_LIB_VARS(QtAssistant)
_QT4_ADJUST_LIB_VARS(QtAssistantClient)
_QT4_ADJUST_LIB_VARS(QtCLucene)
- _QT4_ADJUST_LIB_VARS(QtDBus)
- _QT4_ADJUST_LIB_VARS(QtDeclarative)
- _QT4_ADJUST_LIB_VARS(QtDesigner)
_QT4_ADJUST_LIB_VARS(QtDesignerComponents)
- _QT4_ADJUST_LIB_VARS(QtHelp)
- _QT4_ADJUST_LIB_VARS(QtMultimedia)
- _QT4_ADJUST_LIB_VARS(QtNetwork)
- _QT4_ADJUST_LIB_VARS(QtNsPlugin)
- _QT4_ADJUST_LIB_VARS(QtOpenGL)
- _QT4_ADJUST_LIB_VARS(QtScript)
- _QT4_ADJUST_LIB_VARS(QtScriptTools)
- _QT4_ADJUST_LIB_VARS(QtSql)
- _QT4_ADJUST_LIB_VARS(QtSvg)
- _QT4_ADJUST_LIB_VARS(QtTest)
- _QT4_ADJUST_LIB_VARS(QtUiTools)
- _QT4_ADJUST_LIB_VARS(QtWebKit)
- _QT4_ADJUST_LIB_VARS(QtXml)
- _QT4_ADJUST_LIB_VARS(QtXmlPatterns)
- _QT4_ADJUST_LIB_VARS(phonon)
# platform dependent libraries
- IF(Q_WS_X11)
- _QT4_ADJUST_LIB_VARS(QtMotif)
- ENDIF(Q_WS_X11)
- IF(WIN32)
+ IF(Q_WS_WIN)
_QT4_ADJUST_LIB_VARS(qtmain)
_QT4_ADJUST_LIB_VARS(QAxServer)
_QT4_ADJUST_LIB_VARS(QAxContainer)
- ENDIF(WIN32)
-
- # If Qt is installed as a framework, we need to add QT_QTCORE_LIBRARY here (which
- # is the framework directory in that case), since this will make the cmake include_directories()
- # command recognize that we need the framework flag with the respective directory (-F)
- IF(QT_USE_FRAMEWORKS)
- SET(QT_INCLUDES ${QT_INCLUDES} ${QT_QTCORE_LIBRARY} )
- SET(QT_INCLUDE_DIR ${QT_INCLUDE_DIR} ${QT_QTCORE_LIBRARY} )
- ENDIF(QT_USE_FRAMEWORKS)
-
+ ENDIF(Q_WS_WIN)
#######################################
diff --git a/Modules/FindQuickTime.cmake b/Modules/FindQuickTime.cmake
index f693543..b86a59f 100644
--- a/Modules/FindQuickTime.cmake
+++ b/Modules/FindQuickTime.cmake
@@ -19,7 +19,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# QuickTime on OS X looks different than QuickTime for Windows,
diff --git a/Modules/FindRTI.cmake b/Modules/FindRTI.cmake
index aa4d5f6..b27eaa7 100644
--- a/Modules/FindRTI.cmake
+++ b/Modules/FindRTI.cmake
@@ -26,7 +26,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index 45e2da6..2e78d85 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -1,7 +1,10 @@
# - Find Ruby
# This module finds if Ruby is installed and determines where the include files
-# and libraries are. Ruby 1.8 and 1.9 are supported. The minimum required version
-# specified in the find_package() command is honored.
+# and libraries are. Ruby 1.8 and 1.9 are supported.
+#
+# The minimum required version of Ruby can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(Ruby 1.8)
+#
# It also determines what the name of the library is. This
# code sets the following variables:
#
@@ -24,7 +27,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
@@ -154,22 +157,6 @@ SET(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}")
SET(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}")
SET(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}")
-# Now we know which version we found
-IF(Ruby_FIND_VERSION)
- IF(${RUBY_VERSION} VERSION_LESS ${Ruby_FIND_VERSION})
- # force running ruby the next time again
- SET(RUBY_VERSION_MAJOR "" CACHE PATH "The Ruby major version" FORCE)
- IF(Ruby_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Ruby version ${Ruby_FIND_VERSION} required, but only version ${RUBY_VERSION} found.")
- ELSE(Ruby_FIND_REQUIRED)
- IF(NOT Ruby_FIND_QUIETLY)
- MESSAGE(STATUS "Ruby version ${Ruby_FIND_VERSION} required, but only version ${RUBY_VERSION} found.")
- ENDIF(NOT Ruby_FIND_QUIETLY)
- RETURN()
- ENDIF(Ruby_FIND_REQUIRED)
- ENDIF(${RUBY_VERSION} VERSION_LESS ${Ruby_FIND_VERSION})
-ENDIF(Ruby_FIND_VERSION)
-
FIND_PATH(RUBY_INCLUDE_DIR
NAMES ruby.h
HINTS
@@ -240,7 +227,8 @@ IF(_RUBY_DEBUG_OUTPUT)
MESSAGE(STATUS "--------------------")
ENDIF(_RUBY_DEBUG_OUTPUT)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby DEFAULT_MSG ${_RUBY_REQUIRED_VARS})
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby REQUIRED_VARS ${_RUBY_REQUIRED_VARS}
+ VERSION_VAR RUBY_VERSION )
MARK_AS_ADVANCED(
RUBY_EXECUTABLE
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index cc07116..0dc02f5 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -62,7 +62,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(SDL_INCLUDE_DIR SDL.h
diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake
index c853971..5a5f59b 100644
--- a/Modules/FindSDL_image.cmake
+++ b/Modules/FindSDL_image.cmake
@@ -22,7 +22,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(SDLIMAGE_INCLUDE_DIR SDL_image.h
diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index a5e213f..e2b2294 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -22,7 +22,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(SDLMIXER_INCLUDE_DIR SDL_mixer.h
diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake
index 169c8a5..730b129 100644
--- a/Modules/FindSDL_net.cmake
+++ b/Modules/FindSDL_net.cmake
@@ -22,7 +22,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(SDLNET_INCLUDE_DIR SDL_net.h
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 20d8f4f..959f3eb 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -66,7 +66,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
SET(SDL_SOUND_EXTRAS "" CACHE STRING "SDL_sound extra flags")
diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index 213b835..b36ddd3 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -22,7 +22,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(SDLTTF_INCLUDE_DIR SDL_ttf.h
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake
index 05c09b4..68a913d 100644
--- a/Modules/FindSWIG.cmake
+++ b/Modules/FindSWIG.cmake
@@ -5,7 +5,10 @@
# SWIG_EXECUTABLE - the path to the swig executable
# SWIG_VERSION - the version number of the swig executable
#
-# All informations are collected from the SWIG_EXECUTABLE so the
+# The minimum required version of SWIG can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(SWIG 1.1)
+#
+# All information is collected from the SWIG_EXECUTABLE so the
# version to be found can be changed from the command line by
# means of setting SWIG_EXECUTABLE
#
@@ -20,11 +23,9 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(SWIG_FOUND FALSE)
-
FIND_PROGRAM(SWIG_EXECUTABLE swig)
IF(SWIG_EXECUTABLE)
@@ -45,7 +46,6 @@ IF(SWIG_EXECUTABLE)
SET(SWIG_DIR SWIG_DIR-NOTFOUND)
FIND_PATH(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output})
IF(SWIG_DIR)
- SET(SWIG_FOUND 1)
SET(SWIG_USE_FILE ${CMAKE_ROOT}/Modules/UseSWIG.cmake)
EXECUTE_PROCESS(COMMAND ${SWIG_EXECUTABLE} -version
OUTPUT_VARIABLE SWIG_version_output
@@ -62,12 +62,6 @@ IF(SWIG_EXECUTABLE)
ENDIF(SWIG_swiglib_result)
ENDIF(SWIG_EXECUTABLE)
-IF(NOT SWIG_FOUND)
- IF(NOT SWIG_FIND_QUIETLY)
- IF(SWIG_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "SWIG was not found. Please specify Swig executable location")
- ELSE(SWIG_FIND_REQUIRED)
- MESSAGE(STATUS "SWIG was not found. Please specify Swig executable location")
- ENDIF(SWIG_FIND_REQUIRED)
- ENDIF(NOT SWIG_FIND_QUIETLY)
-ENDIF(NOT SWIG_FOUND)
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SWIG REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR
+ VERSION_VAR SWIG_VERSION )
diff --git a/Modules/FindSelfPackers.cmake b/Modules/FindSelfPackers.cmake
index 9fab6b9..ffca842 100644
--- a/Modules/FindSelfPackers.cmake
+++ b/Modules/FindSelfPackers.cmake
@@ -15,7 +15,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(FindCygwin)
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index 2327186..b0b6b2f 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -4,9 +4,6 @@
#
# ---- Variables and Macros
# SQUISH_FOUND If false, don't try to use Squish
-# SQUISH_VERSION_MAJOR The major version of Squish found
-# SQUISH_VERSION_MINOR The minor version of Squish found
-# SQUISH_VERSION_PATCH The patch version of Squish found
#
# SQUISH_INSTALL_DIR The Squish installation directory (containing bin, lib, etc)
# SQUISH_SERVER_EXECUTABLE The squishserver executable
@@ -36,7 +33,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
SET(SQUISH_INSTALL_DIR_STRING "Directory containing the bin, doc, and lib directories for Squish; this should be the root of the installation directory.")
diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake
index 58a179d..daf3d87 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -3,26 +3,35 @@
# Subversion_SVN_EXECUTABLE - path to svn command line client
# Subversion_VERSION_SVN - version of svn command line client
# Subversion_FOUND - true if the command line client was found
-# If the command line client executable is found the macro
+# SUBVERSION_FOUND - same as Subversion_FOUND, set for compatiblity reasons
+#
+# The minimum required version of Subversion can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(Subversion 1.4)
+#
+# If the command line client executable is found two macros are defined:
# Subversion_WC_INFO(<dir> <var-prefix>)
-# is defined to extract information of a subversion working copy at
-# a given location. The macro defines the following variables:
+# Subversion_WC_LOG(<dir> <var-prefix>)
+# Subversion_WC_INFO extracts information of a subversion working copy at
+# a given location. This macro defines the following variables:
# <var-prefix>_WC_URL - url of the repository (at <dir>)
# <var-prefix>_WC_ROOT - root url of the repository
# <var-prefix>_WC_REVISION - current revision
# <var-prefix>_WC_LAST_CHANGED_AUTHOR - author of last commit
# <var-prefix>_WC_LAST_CHANGED_DATE - date of last commit
# <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
-# <var-prefix>_WC_LAST_CHANGED_LOG - last log of base revision
# <var-prefix>_WC_INFO - output of command `svn info <dir>'
+# Subversion_WC_LOG retrieves the log message of the base revision of a
+# subversion working copy at a given location. This macro defines the
+# variable:
+# <var-prefix>_LAST_CHANGED_LOG - last log of base revision
# Example usage:
# FIND_PACKAGE(Subversion)
-# IF(Subversion_FOUND)
+# IF(SUBVERSION_FOUND)
# Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
# MESSAGE("Current revision is ${Project_WC_REVISION}")
# Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
# MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}")
-# ENDIF(Subversion_FOUND)
+# ENDIF(SUBVERSION_FOUND)
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
@@ -35,19 +44,21 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(Subversion_FOUND FALSE)
-SET(Subversion_SVN_FOUND FALSE)
-
FIND_PROGRAM(Subversion_SVN_EXECUTABLE svn
DOC "subversion command line client")
MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE)
IF(Subversion_SVN_EXECUTABLE)
- SET(Subversion_SVN_FOUND TRUE)
- SET(Subversion_FOUND TRUE)
+
+ EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version
+ OUTPUT_VARIABLE Subversion_VERSION_SVN
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*"
+ "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}")
MACRO(Subversion_WC_INFO dir prefix)
# the subversion commands should be executed with the C locale, otherwise
@@ -55,11 +66,6 @@ IF(Subversion_SVN_EXECUTABLE)
SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
SET(ENV{LC_ALL} C)
- EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version
- WORKING_DIRECTORY ${dir}
- OUTPUT_VARIABLE Subversion_VERSION_SVN
- OUTPUT_STRIP_TRAILING_WHITESPACE)
-
EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} info ${dir}
OUTPUT_VARIABLE ${prefix}_WC_INFO
ERROR_VARIABLE Subversion_svn_info_error
@@ -70,10 +76,10 @@ IF(Subversion_SVN_EXECUTABLE)
MESSAGE(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}")
ELSE(NOT ${Subversion_svn_info_result} EQUAL 0)
- STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*"
- "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}")
STRING(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*"
"\\2" ${prefix}_WC_URL "${${prefix}_WC_INFO}")
+ STRING(REGEX REPLACE "^(.*\n)?Repository Root: ([^\n]+).*"
+ "\\2" ${prefix}_WC_ROOT "${${prefix}_WC_INFO}")
STRING(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
"\\2" ${prefix}_WC_REVISION "${${prefix}_WC_INFO}")
STRING(REGEX REPLACE "^(.*\n)?Last Changed Author: ([^\n]+).*"
@@ -110,4 +116,9 @@ IF(Subversion_SVN_EXECUTABLE)
ENDIF(Subversion_SVN_EXECUTABLE)
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Subversion DEFAULT_MSG Subversion_SVN_EXECUTABLE)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Subversion REQUIRED_VARS Subversion_SVN_EXECUTABLE
+ VERSION_VAR Subversion_VERSION_SVN )
+
+# for compatibility
+SET(Subversion_FOUND ${SUBVERSION_FOUND})
+SET(Subversion_SVN_FOUND ${SUBVERSION_FOUND})
diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake
index 67a3f9a..314d706 100644
--- a/Modules/FindTCL.cmake
+++ b/Modules/FindTCL.cmake
@@ -41,7 +41,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CMakeFindFrameworks)
diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake
index 8711634..6f06ff1 100644
--- a/Modules/FindTIFF.cmake
+++ b/Modules/FindTIFF.cmake
@@ -17,12 +17,12 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(TIFF_INCLUDE_DIR tiff.h)
-SET(TIFF_NAMES ${TIFF_NAMES} tiff libtiff libtiff3)
+SET(TIFF_NAMES ${TIFF_NAMES} tiff libtiff tiff3 libtiff3)
FIND_LIBRARY(TIFF_LIBRARY NAMES ${TIFF_NAMES} )
# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
diff --git a/Modules/FindTclStub.cmake b/Modules/FindTclStub.cmake
index 896d4b1..4db2716 100644
--- a/Modules/FindTclStub.cmake
+++ b/Modules/FindTclStub.cmake
@@ -31,7 +31,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(FindTCL)
diff --git a/Modules/FindTclsh.cmake b/Modules/FindTclsh.cmake
index 9b7529b..322c3a9 100644
--- a/Modules/FindTclsh.cmake
+++ b/Modules/FindTclsh.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(CYGWIN)
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index 2a74304..4cb7451 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -6,7 +6,7 @@
# CMAKE_USE_PTHREADS_INIT - are we using pthreads
# CMAKE_HP_PTHREADS_INIT - are we using hp pthreads
# For systems with multiple thread libraries, caller can set
-# CMAKE_THREAD_PREFER_PTHREADS
+# CMAKE_THREAD_PREFER_PTHREAD
#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
@@ -18,7 +18,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE (CheckIncludeFiles)
diff --git a/Modules/FindUnixCommands.cmake b/Modules/FindUnixCommands.cmake
index c1d2c45..9c0264d 100644
--- a/Modules/FindUnixCommands.cmake
+++ b/Modules/FindUnixCommands.cmake
@@ -12,7 +12,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(FindCygwin)
diff --git a/Modules/FindVTK.cmake b/Modules/FindVTK.cmake
index 69e1874..6b1772f 100644
--- a/Modules/FindVTK.cmake
+++ b/Modules/FindVTK.cmake
@@ -37,7 +37,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Assume not found.
diff --git a/Modules/FindWget.cmake b/Modules/FindWget.cmake
index c898b89..97c4302 100644
--- a/Modules/FindWget.cmake
+++ b/Modules/FindWget.cmake
@@ -14,7 +14,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(FindCygwin)
diff --git a/Modules/FindWish.cmake b/Modules/FindWish.cmake
index c086da5..a4960cd 100644
--- a/Modules/FindWish.cmake
+++ b/Modules/FindWish.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(UNIX)
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index f056413..df44979 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -46,7 +46,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF (UNIX)
diff --git a/Modules/FindXMLRPC.cmake b/Modules/FindXMLRPC.cmake
index 48f87d7..eccfb48 100644
--- a/Modules/FindXMLRPC.cmake
+++ b/Modules/FindXMLRPC.cmake
@@ -22,7 +22,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# First find the config script from which to obtain other values.
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index b437e6b..1ac6c2c 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -1,12 +1,20 @@
# - Find zlib
-# Find the native ZLIB includes and library
+# Find the native ZLIB includes and library.
+# Once done this will define
#
# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
# ZLIB_LIBRARIES - List of libraries when using zlib.
# ZLIB_FOUND - True if zlib found.
#
# ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
-# ZLIB_MAJOR_VERSION - the major version of zlib
+# ZLIB_VERSION_MAJOR - The major version of zlib
+# ZLIB_VERSION_MINOR - The minor version of zlib
+# ZLIB_VERSION_PATCH - The patch version of zlib
+# ZLIB_VERSION_TWEAK - The tweak version of zlib
+#
+# The following variable are provided for backward compatibility
+#
+# ZLIB_MAJOR_VERSION - The major version of zlib
# ZLIB_MINOR_VERSION - The minor version of zlib
# ZLIB_PATCH_VERSION - The patch version of zlib
@@ -20,7 +28,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
@@ -36,18 +44,34 @@ FIND_LIBRARY(ZLIB_LIBRARY
)
MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-IF (ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
- FILE(READ "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H)
- STRING(REGEX REPLACE ".*#define ZLIB_VERSION \"([0-9]+)\\.([0-9]+)\\.([0-9]+)\".*" "\\1.\\2.\\3" ZLIB_VERSION_STRING "${ZLIB_H}")
+IF(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
+ FILE(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
+
+ STRING(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
+ STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}")
+ STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
+ SET(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}")
+
+ # only append a TWEAK version if it exists:
+ SET(ZLIB_VERSION_TWEAK "")
+ IF( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
+ SET(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
+ SET(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
+ ENDIF( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
+
+ SET(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
+ SET(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
+ SET(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
ENDIF()
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_INCLUDE_DIR ZLIB_LIBRARY)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_INCLUDE_DIR ZLIB_LIBRARY
+ VERSION_VAR ZLIB_VERSION_STRING)
-IF (ZLIB_FOUND)
+IF(ZLIB_FOUND)
SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
- SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
+ SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
ENDIF()
diff --git a/Modules/Findosg.cmake b/Modules/Findosg.cmake
index 00e4711..76f202f 100644
--- a/Modules/Findosg.cmake
+++ b/Modules/Findosg.cmake
@@ -39,7 +39,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgAnimation.cmake b/Modules/FindosgAnimation.cmake
index a4bbb44..83e669a 100644
--- a/Modules/FindosgAnimation.cmake
+++ b/Modules/FindosgAnimation.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgDB.cmake b/Modules/FindosgDB.cmake
index d0d75b6..f1cdfa5 100644
--- a/Modules/FindosgDB.cmake
+++ b/Modules/FindosgDB.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgFX.cmake b/Modules/FindosgFX.cmake
index cf1a98b..64cbda8 100644
--- a/Modules/FindosgFX.cmake
+++ b/Modules/FindosgFX.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgGA.cmake b/Modules/FindosgGA.cmake
index ca7e55a..00fc313 100644
--- a/Modules/FindosgGA.cmake
+++ b/Modules/FindosgGA.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgIntrospection.cmake b/Modules/FindosgIntrospection.cmake
index 3045cd5..919523b 100644
--- a/Modules/FindosgIntrospection.cmake
+++ b/Modules/FindosgIntrospection.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgManipulator.cmake b/Modules/FindosgManipulator.cmake
index 6de812e..93d4bac 100644
--- a/Modules/FindosgManipulator.cmake
+++ b/Modules/FindosgManipulator.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgParticle.cmake b/Modules/FindosgParticle.cmake
index d693d04..a0d7516 100644
--- a/Modules/FindosgParticle.cmake
+++ b/Modules/FindosgParticle.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgProducer.cmake b/Modules/FindosgProducer.cmake
index 2810d86..e4e57f3 100644
--- a/Modules/FindosgProducer.cmake
+++ b/Modules/FindosgProducer.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgShadow.cmake b/Modules/FindosgShadow.cmake
index 60f29ff..86a339c 100644
--- a/Modules/FindosgShadow.cmake
+++ b/Modules/FindosgShadow.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgSim.cmake b/Modules/FindosgSim.cmake
index 8f28d55..b66a991 100644
--- a/Modules/FindosgSim.cmake
+++ b/Modules/FindosgSim.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgTerrain.cmake b/Modules/FindosgTerrain.cmake
index 4fcd4bd..04559cf 100644
--- a/Modules/FindosgTerrain.cmake
+++ b/Modules/FindosgTerrain.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgText.cmake b/Modules/FindosgText.cmake
index 0c6c606..6d20336 100644
--- a/Modules/FindosgText.cmake
+++ b/Modules/FindosgText.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgUtil.cmake b/Modules/FindosgUtil.cmake
index f314d23..2faa7d4 100644
--- a/Modules/FindosgUtil.cmake
+++ b/Modules/FindosgUtil.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgViewer.cmake b/Modules/FindosgViewer.cmake
index 35be2f5..30b9926 100644
--- a/Modules/FindosgViewer.cmake
+++ b/Modules/FindosgViewer.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgVolume.cmake b/Modules/FindosgVolume.cmake
index f89bbdd..f916667 100644
--- a/Modules/FindosgVolume.cmake
+++ b/Modules/FindosgVolume.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/FindosgWidget.cmake b/Modules/FindosgWidget.cmake
index 45ad1a6..5f84873 100644
--- a/Modules/FindosgWidget.cmake
+++ b/Modules/FindosgWidget.cmake
@@ -35,7 +35,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
diff --git a/Modules/Findosg_functions.cmake b/Modules/Findosg_functions.cmake
index bc6f2de..ab836ff 100644
--- a/Modules/Findosg_functions.cmake
+++ b/Modules/Findosg_functions.cmake
@@ -14,7 +14,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
#
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index 85c6568..d991cd4 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -4,7 +4,7 @@
# modules that you will use, you need to name them as components to
# the package:
#
-# FIND_PACKAGE(wxWidgets COMPONENTS base core ...)
+# FIND_PACKAGE(wxWidgets COMPONENTS core base ...)
#
# There are two search branches: a windows style and a unix style. For
# windows, the following variables are searched for and set to
@@ -32,7 +32,14 @@
# wxWidgets_USE_UNICODE
# wxWidgets_USE_UNIVERSAL
# wxWidgets_USE_STATIC
-#
+#
+# There is also a wxWidgets_CONFIG_OPTIONS variable for all other
+# options that need to be passed to the wx-config utility. For
+# example, to use the base toolkit found in the /usr/local path, set
+# the variable (before calling the FIND_PACKAGE command) as such:
+#
+# SET(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr)
+#
# The following are set after the configuration is done for both
# windows and unix style:
#
@@ -54,17 +61,18 @@
# wxWidgets_USE_FILE - Convenience include file.
#
# Sample usage:
-# FIND_PACKAGE(wxWidgets COMPONENTS base core gl net)
+# # Note that for MinGW users the order of libs is important!
+# FIND_PACKAGE(wxWidgets COMPONENTS net gl core base)
# IF(wxWidgets_FOUND)
# INCLUDE(${wxWidgets_USE_FILE})
-# # and for each of your dependant executable/library targets:
+# # and for each of your dependent executable/library targets:
# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
# ENDIF(wxWidgets_FOUND)
#
# If wxWidgets is required (i.e., not an optional part):
-# FIND_PACKAGE(wxWidgets REQUIRED base core gl net)
+# FIND_PACKAGE(wxWidgets REQUIRED net gl core base)
# INCLUDE(${wxWidgets_USE_FILE})
-# # and for each of your dependant executable/library targets:
+# # and for each of your dependent executable/library targets:
# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
#=============================================================================
@@ -78,7 +86,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
#
@@ -188,7 +196,7 @@ IF(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
SET(wxWidgets_USE_FILE
"${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
ELSE(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
- SET(wxWidgets_USE_FILE UsewxWidgets.cmake)
+ SET(wxWidgets_USE_FILE UsewxWidgets)
ENDIF(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
#=====================================================================
@@ -213,7 +221,7 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
IF(wxWidgets_USE_MONOLITHIC)
SET(wxWidgets_FIND_COMPONENTS mono)
ELSE(wxWidgets_USE_MONOLITHIC)
- SET(wxWidgets_FIND_COMPONENTS base core) # this is default
+ SET(wxWidgets_FIND_COMPONENTS core base) # this is default
ENDIF(wxWidgets_USE_MONOLITHIC)
ENDIF(NOT wxWidgets_FIND_COMPONENTS)
@@ -252,7 +260,7 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
# FIXME: What if both regex libs are available. regex should be
# found outside the loop and only wx${LIB}${_UCD}${_DBG}.
# Find wxWidgets common libraries.
- FOREACH(LIB ${wxWidgets_COMMON_LIBRARIES})
+ FOREACH(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
FIND_LIBRARY(WX_${LIB}${_DBG}
NAMES
wx${LIB}${_UCD}${_DBG} # for regex
@@ -303,7 +311,8 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
MARK_AS_ADVANCED(WX_mono${_DBG})
# Find wxWidgets multilib libraries.
- FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext)
+ FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext
+ stc ribbon propgrid)
FIND_LIBRARY(WX_${LIB}${_DBG}
NAMES
wxmsw${_UNV}29${_UCD}${_DBG}_${LIB}
@@ -330,7 +339,7 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
# Clear all debug or release library paths (arguments are "d" or "").
MACRO(WX_CLEAR_ALL_LIBS _DBG)
# Clear wxWidgets common libraries.
- FOREACH(LIB ${wxWidgets_COMMON_LIBRARIES})
+ FOREACH(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
WX_CLEAR_LIB(WX_${LIB}${_DBG})
ENDFOREACH(LIB)
@@ -344,7 +353,8 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
WX_CLEAR_LIB(WX_mono${_DBG})
# Clear wxWidgets multilib libraries.
- FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext)
+ FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext
+ stc ribbon propgrid)
WX_CLEAR_LIB(WX_${LIB}${_DBG})
ENDFOREACH(LIB)
ENDMACRO(WX_CLEAR_ALL_LIBS)
@@ -561,23 +571,23 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
# Get configuration parameters from the name.
WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG)
- # Set wxWidgets main include directory.
- IF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
- SET(wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include)
- ELSE(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
- DBG_MSG("wxWidgets_FOUND FALSE because WX_ROOT_DIR=${WX_ROOT_DIR} has no ${WX_ROOT_DIR}/include/wx/wx.h")
- SET(wxWidgets_FOUND FALSE)
- ENDIF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
-
# Set wxWidgets lib setup include directory.
IF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
- LIST(APPEND wxWidgets_INCLUDE_DIRS
+ SET(wxWidgets_INCLUDE_DIRS
${WX_LIB_DIR}/${wxWidgets_CONFIGURATION})
ELSE(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
- DBG_MSG("WXWIDGET_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.")
+ DBG_MSG("wxWidgets_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.")
SET(wxWidgets_FOUND FALSE)
ENDIF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
+ # Set wxWidgets main include directory.
+ IF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+ LIST(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include)
+ ELSE(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+ DBG_MSG("wxWidgets_FOUND FALSE because WX_ROOT_DIR=${WX_ROOT_DIR} has no ${WX_ROOT_DIR}/include/wx/wx.h")
+ SET(wxWidgets_FOUND FALSE)
+ ENDIF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+
# Find wxWidgets libraries.
WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}")
IF(WX_USE_REL_AND_DBG)
@@ -612,7 +622,8 @@ ELSE(wxWidgets_FIND_STYLE STREQUAL "win32")
#
MACRO(WX_CONFIG_SELECT_GET_DEFAULT)
EXECUTE_PROCESS(
- COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --selected-config
+ COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
+ ${wxWidgets_CONFIG_OPTIONS} --selected-config
OUTPUT_VARIABLE _wx_selected_config
RESULT_VARIABLE _wx_result
ERROR_QUIET
@@ -640,13 +651,15 @@ ELSE(wxWidgets_FIND_STYLE STREQUAL "win32")
#
MACRO(WX_CONFIG_SELECT_QUERY_BOOL _OPT_NAME _OPT_HELP)
EXECUTE_PROCESS(
- COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --${_OPT_NAME}=yes
+ COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
+ ${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=yes
RESULT_VARIABLE _wx_result_yes
OUTPUT_QUIET
ERROR_QUIET
)
EXECUTE_PROCESS(
- COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --${_OPT_NAME}=no
+ COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
+ ${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=no
RESULT_VARIABLE _wx_result_no
OUTPUT_QUIET
ERROR_QUIET
@@ -672,7 +685,7 @@ ELSE(wxWidgets_FIND_STYLE STREQUAL "win32")
# among multiple builds.
#
MACRO(WX_CONFIG_SELECT_SET_OPTIONS)
- SET(wxWidgets_SELECT_OPTIONS "")
+ SET(wxWidgets_SELECT_OPTIONS ${wxWidgets_CONFIG_OPTIONS})
FOREACH(_opt_name debug static unicode universal)
STRING(TOUPPER ${_opt_name} _upper_opt_name)
IF(DEFINED wxWidgets_USE_${_upper_opt_name})
diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake
index 4cb4c9e..f55cf00 100644
--- a/Modules/FindwxWindows.cmake
+++ b/Modules/FindwxWindows.cmake
@@ -58,7 +58,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# ------------------------------------------------------------------
diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake
index a7d5571..90ef59b 100644
--- a/Modules/FortranCInterface.cmake
+++ b/Modules/FortranCInterface.cmake
@@ -47,9 +47,9 @@
# MACRO_NAMESPACE "FC_"
# SYMBOL_NAMESPACE "FC_"
# SYMBOLS mysub mymod:my_sub)
-# This creates a "FC.h" header that defines the same FC_*() mangling
-# macros as the previous example plus preprocessor symbols FC_mysub
-# and FC_mymod_my_sub.
+# This creates a "FCMangle.h" header that defines the same FC_*()
+# mangling macros as the previous example plus preprocessor symbols
+# FC_mysub and FC_mymod_my_sub.
#
# Another function is provided to verify that the Fortran and C/C++
# compilers work together:
@@ -91,7 +91,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
#-----------------------------------------------------------------------------
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 24cee55..c83da4f 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -1,14 +1,16 @@
-# GetPrerequisites.cmake
-#
-# This script provides functions to list the .dll, .dylib or .so files that an
-# executable or shared library file depends on. (Its prerequisites.)
+# - Functions to analyze and list executable file prerequisites.
+# This module provides functions to list the .dll, .dylib or .so
+# files that an executable or shared library file depends on. (Its
+# prerequisites.)
#
# It uses various tools to obtain the list of required shared library files:
# dumpbin (Windows)
# ldd (Linux/Unix)
# otool (Mac OSX)
-#
-# The following functions are provided by this script:
+# The following functions are provided by this module:
+# get_prerequisites
+# list_prerequisites
+# list_prerequisites_by_glob
# gp_append_unique
# is_file_executable
# gp_item_default_embedded_path
@@ -18,12 +20,91 @@
# gp_resolved_file_type
# (projects can override with gp_resolved_file_type_override)
# gp_file_type
-# get_prerequisites
-# list_prerequisites
-# list_prerequisites_by_glob
-#
# Requires CMake 2.6 or greater because it uses function, break, return and
# PARENT_SCOPE.
+#
+# GET_PREREQUISITES(<target> <prerequisites_var> <exclude_system> <recurse>
+# <dirs>)
+# Get the list of shared library files required by <target>. The list in
+# the variable named <prerequisites_var> should be empty on first entry to
+# this function. On exit, <prerequisites_var> will contain the list of
+# required shared library files.
+#
+# <target> is the full path to an executable file. <prerequisites_var> is the
+# name of a CMake variable to contain the results. <exclude_system> must be 0
+# or 1 indicating whether to include or exclude "system" prerequisites. If
+# <recurse> is set to 1 all prerequisites will be found recursively, if set to
+# 0 only direct prerequisites are listed. <exepath> is the path to the top
+# level executable used for @executable_path replacment on the Mac. <dirs> is
+# a list of paths where libraries might be found: these paths are searched
+# first when a target without any path info is given. Then standard system
+# locations are also searched: PATH, Framework locations, /usr/lib...
+#
+# LIST_PREREQUISITES(<target> [<recurse> [<exclude_system> [<verbose>]]])
+# Print a message listing the prerequisites of <target>.
+#
+# <target> is the name of a shared library or executable target or the full
+# path to a shared library or executable file. If <recurse> is set to 1 all
+# prerequisites will be found recursively, if set to 0 only direct
+# prerequisites are listed. <exclude_system> must be 0 or 1 indicating whether
+# to include or exclude "system" prerequisites. With <verbose> set to 0 only
+# the full path names of the prerequisites are printed, set to 1 extra
+# informatin will be displayed.
+#
+# LIST_PREREQUISITES_BY_GLOB(<glob_arg> <glob_exp>)
+# Print the prerequisites of shared library and executable files matching a
+# globbing pattern. <glob_arg> is GLOB or GLOB_RECURSE and <glob_exp> is a
+# globbing expression used with "file(GLOB" or "file(GLOB_RECURSE" to retrieve
+# a list of matching files. If a matching file is executable, its prerequisites
+# are listed.
+#
+# Any additional (optional) arguments provided are passed along as the
+# optional arguments to the list_prerequisites calls.
+#
+# GP_APPEND_UNIQUE(<list_var> <value>)
+# Append <value> to the list variable <list_var> only if the value is not
+# already in the list.
+#
+# IS_FILE_EXECUTABLE(<file> <result_var>)
+# Return 1 in <result_var> if <file> is a binary executable, 0 otherwise.
+#
+# GP_ITEM_DEFAULT_EMBEDDED_PATH(<item> <default_embedded_path_var>)
+# Return the path that others should refer to the item by when the item
+# is embedded inside a bundle.
+#
+# Override on a per-project basis by providing a project-specific
+# gp_item_default_embedded_path_override function.
+#
+# GP_RESOLVE_ITEM(<context> <item> <exepath> <dirs> <resolved_item_var>)
+# Resolve an item into an existing full path file.
+#
+# Override on a per-project basis by providing a project-specific
+# gp_resolve_item_override function.
+#
+# GP_RESOLVED_FILE_TYPE(<original_file> <file> <exepath> <dirs> <type_var>)
+# Return the type of <file> with respect to <original_file>. String
+# describing type of prerequisite is returned in variable named <type_var>.
+#
+# Use <exepath> and <dirs> if necessary to resolve non-absolute <file>
+# values -- but only for non-embedded items.
+#
+# Possible types are:
+# system
+# local
+# embedded
+# other
+# Override on a per-project basis by providing a project-specific
+# gp_resolved_file_type_override function.
+#
+# GP_FILE_TYPE(<original_file> <file> <type_var>)
+# Return the type of <file> with respect to <original_file>. String
+# describing type of prerequisite is returned in variable named <type_var>.
+#
+# Possible types are:
+# system
+# local
+# embedded
+# other
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
@@ -35,14 +116,9 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-# gp_append_unique list_var value
-#
-# Append value to the list variable ${list_var} only if the value is not
-# already in the list.
-#
function(gp_append_unique list_var value)
set(contains 0)
@@ -59,12 +135,6 @@ function(gp_append_unique list_var value)
endfunction(gp_append_unique)
-# is_file_executable file result_var
-#
-# Return 1 in ${result_var} if ${file} is a binary executable.
-#
-# Return 0 in ${result_var} otherwise.
-#
function(is_file_executable file result_var)
#
# A file is not executable until proven otherwise:
@@ -132,14 +202,6 @@ function(is_file_executable file result_var)
endfunction(is_file_executable)
-# gp_item_default_embedded_path item default_embedded_path_var
-#
-# Return the path that others should refer to the item by when the item
-# is embedded inside a bundle.
-#
-# Override on a per-project basis by providing a project-specific
-# gp_item_default_embedded_path_override function.
-#
function(gp_item_default_embedded_path item default_embedded_path_var)
# On Windows and Linux, "embed" prerequisites in the same directory
@@ -193,13 +255,6 @@ function(gp_item_default_embedded_path item default_embedded_path_var)
endfunction(gp_item_default_embedded_path)
-# gp_resolve_item context item exepath dirs resolved_item_var
-#
-# Resolve an item into an existing full path file.
-#
-# Override on a per-project basis by providing a project-specific
-# gp_resolve_item_override function.
-#
function(gp_resolve_item context item exepath dirs resolved_item_var)
set(resolved 0)
set(resolved_item "${item}")
@@ -332,23 +387,6 @@ warning: cannot resolve item '${item}'
endfunction(gp_resolve_item)
-# gp_resolved_file_type original_file file exepath dirs type_var
-#
-# Return the type of ${file} with respect to ${original_file}. String
-# describing type of prerequisite is returned in variable named ${type_var}.
-#
-# Use ${exepath} and ${dirs} if necessary to resolve non-absolute ${file}
-# values -- but only for non-embedded items.
-#
-# Possible types are:
-# system
-# local
-# embedded
-# other
-#
-# Override on a per-project basis by providing a project-specific
-# gp_resolved_file_type_override function.
-#
function(gp_resolved_file_type original_file file exepath dirs type_var)
#message(STATUS "**")
@@ -445,17 +483,6 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
endfunction()
-# gp_file_type original_file file type_var
-#
-# Return the type of ${file} with respect to ${original_file}. String
-# describing type of prerequisite is returned in variable named ${type_var}.
-#
-# Possible types are:
-# system
-# local
-# embedded
-# other
-#
function(gp_file_type original_file file type_var)
if(NOT IS_ABSOLUTE "${original_file}")
message(STATUS "warning: gp_file_type expects absolute full path for first arg original_file")
@@ -470,30 +497,6 @@ function(gp_file_type original_file file type_var)
endfunction(gp_file_type)
-# get_prerequisites target prerequisites_var exclude_system recurse dirs
-#
-# Get the list of shared library files required by ${target}. The list in
-# the variable named ${prerequisites_var} should be empty on first entry to
-# this function. On exit, ${prerequisites_var} will contain the list of
-# required shared library files.
-#
-# target is the full path to an executable file
-#
-# prerequisites_var is the name of a CMake variable to contain the results
-#
-# exclude_system is 0 or 1: 0 to include "system" prerequisites , 1 to
-# exclude them
-#
-# recurse is 0 or 1: 0 for direct prerequisites only, 1 for all prerequisites
-# recursively
-#
-# exepath is the path to the top level executable used for @executable_path
-# replacment on the Mac
-#
-# dirs is a list of paths where libraries might be found: these paths are
-# searched first when a target without any path info is given. Then standard
-# system locations are also searched: PATH, Framework locations, /usr/lib...
-#
function(get_prerequisites target prerequisites_var exclude_system recurse exepath dirs)
set(verbose 0)
set(eol_char "E")
@@ -526,6 +529,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if("${gp_tool}" STREQUAL "ldd")
set(gp_cmd_args "")
set(gp_regex "^[\t ]*[^\t ]+ => ([^\t ]+).*${eol_char}$")
+ set(gp_regex_error "not found${eol_char}$")
+ set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
set(gp_regex_cmp_count 1)
set(gp_tool_known 1)
endif("${gp_tool}" STREQUAL "ldd")
@@ -533,6 +538,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if("${gp_tool}" STREQUAL "otool")
set(gp_cmd_args "-L")
set(gp_regex "^\t([^\t]+) \\(compatibility version ([0-9]+.[0-9]+.[0-9]+), current version ([0-9]+.[0-9]+.[0-9]+)\\)${eol_char}$")
+ set(gp_regex_error "")
+ set(gp_regex_fallback "")
set(gp_regex_cmp_count 3)
set(gp_tool_known 1)
endif("${gp_tool}" STREQUAL "otool")
@@ -540,6 +547,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if("${gp_tool}" STREQUAL "dumpbin")
set(gp_cmd_args "/dependents")
set(gp_regex "^ ([^ ].*[Dd][Ll][Ll])${eol_char}$")
+ set(gp_regex_error "")
+ set(gp_regex_fallback "")
set(gp_regex_cmp_count 1)
set(gp_tool_known 1)
set(ENV{VS_UNICODE_OUTPUT} "") # Block extra output from inside VS IDE.
@@ -625,12 +634,34 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
string(REGEX REPLACE ";" "\\\\;" candidates "${gp_cmd_ov}")
string(REGEX REPLACE "\n" "${eol_char};" candidates "${candidates}")
+ # check for install id and remove it from list, since otool -L can include a
+ # reference to itself
+ set(gp_install_id)
+ if("${gp_tool}" STREQUAL "otool")
+ execute_process(
+ COMMAND otool -D ${target}
+ OUTPUT_VARIABLE gp_install_id_ov
+ )
+ # second line is install name
+ string(REGEX REPLACE ".*:\n" "" gp_install_id "${gp_install_id_ov}")
+ if(gp_install_id)
+ # trim
+ string(REGEX MATCH "[^\n ].*[^\n ]" gp_install_id "${gp_install_id}")
+ #message("INSTALL ID is \"${gp_install_id}\"")
+ endif(gp_install_id)
+ endif("${gp_tool}" STREQUAL "otool")
+
# Analyze each line for file names that match the regular expression:
#
foreach(candidate ${candidates})
if("${candidate}" MATCHES "${gp_regex}")
+
# Extract information from each candidate:
- string(REGEX REPLACE "${gp_regex}" "\\1" raw_item "${candidate}")
+ if(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}")
+ string(REGEX REPLACE "${gp_regex_fallback}" "\\1" raw_item "${candidate}")
+ else(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}")
+ string(REGEX REPLACE "${gp_regex}" "\\1" raw_item "${candidate}")
+ endif(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}")
if(gp_regex_cmp_count GREATER 1)
string(REGEX REPLACE "${gp_regex}" "\\2" raw_compat_version "${candidate}")
@@ -656,14 +687,18 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
#
set(add_item 1)
- if(${exclude_system})
+ if("${item}" STREQUAL "${gp_install_id}")
+ set(add_item 0)
+ endif("${item}" STREQUAL "${gp_install_id}")
+
+ if(add_item AND ${exclude_system})
set(type "")
gp_resolved_file_type("${target}" "${item}" "${exepath}" "${dirs}" type)
if("${type}" STREQUAL "system")
set(add_item 0)
endif("${type}" STREQUAL "system")
- endif(${exclude_system})
+ endif(add_item AND ${exclude_system})
if(add_item)
list(LENGTH ${prerequisites_var} list_length_before_append)
@@ -706,19 +741,6 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
endfunction(get_prerequisites)
-# list_prerequisites target all exclude_system verbose
-#
-# ARGV0 (target) is the full path to an executable file
-#
-# optional ARGV1 (all) is 0 or 1: 0 for direct prerequisites only,
-# 1 for all prerequisites recursively
-#
-# optional ARGV2 (exclude_system) is 0 or 1: 0 to include "system"
-# prerequisites , 1 to exclude them
-#
-# optional ARGV3 (verbose) is 0 or 1: 0 to print only full path
-# names of prerequisites, 1 to print extra information
-#
function(list_prerequisites target)
if("${ARGV1}" STREQUAL "")
set(all 1)
@@ -771,17 +793,6 @@ function(list_prerequisites target)
endfunction(list_prerequisites)
-# list_prerequisites_by_glob glob_arg glob_exp
-#
-# glob_arg is GLOB or GLOB_RECURSE
-#
-# glob_exp is a globbing expression used with "file(GLOB" to retrieve a list
-# of matching files. If a matching file is executable, its prerequisites are
-# listed.
-#
-# Any additional (optional) arguments provided are passed along as the
-# optional arguments to the list_prerequisites calls.
-#
function(list_prerequisites_by_glob glob_arg glob_exp)
message(STATUS "=============================================================================")
message(STATUS "List prerequisites of executables matching ${glob_arg} '${glob_exp}'")
diff --git a/Modules/ITKCompatibility.cmake b/Modules/ITKCompatibility.cmake
index 3693abc..efd9c28 100644
--- a/Modules/ITKCompatibility.cmake
+++ b/Modules/ITKCompatibility.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# work around an old bug in ITK prior to verison 3.0
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 97c6ccb..b60fed8 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -22,7 +22,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(MSVC)
diff --git a/Modules/KDE3Macros.cmake b/Modules/KDE3Macros.cmake
index 0f2d479..5b76000 100644
--- a/Modules/KDE3Macros.cmake
+++ b/Modules/KDE3Macros.cmake
@@ -11,7 +11,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# See FindKDE3.cmake for documentation.
diff --git a/Modules/MacroAddFileDependencies.cmake b/Modules/MacroAddFileDependencies.cmake
index e4a82d1..527447b 100644
--- a/Modules/MacroAddFileDependencies.cmake
+++ b/Modules/MacroAddFileDependencies.cmake
@@ -1,6 +1,6 @@
# - MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...)
# Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged. There are usually
-# better ways to specifiy the correct dependencies.
+# better ways to specify the correct dependencies.
#
# MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a convenience
# wrapper around the OBJECT_DEPENDS source file property. You can just
@@ -16,7 +16,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO (MACRO_ADD_FILE_DEPENDENCIES _file)
diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake
index fc3880e..79c06ba 100644
--- a/Modules/Platform/AIX-GNU.cmake
+++ b/Modules/Platform/AIX-GNU.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
diff --git a/Modules/Platform/BlueGeneP-base.cmake b/Modules/Platform/BlueGeneP-base.cmake
new file mode 100644
index 0000000..2ca920f
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-base.cmake
@@ -0,0 +1,118 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+#
+# BlueGeneP base platform file.
+#
+# NOTE: Do not set your platform to "BlueGeneP-base". This file is included
+# by the real platform files. Use one of these two platforms instead:
+#
+# BlueGeneP-dynamic For dynamically linked builds
+# BlueGeneP-static For statically linked builds
+#
+# This platform file tries its best to adhere to the behavior of the MPI
+# compiler wrappers included with the latest BG/P drivers.
+#
+
+
+#
+# For BGP builds, we're cross compiling, but we don't want to re-root things
+# (e.g. with CMAKE_FIND_ROOT_PATH) because users may have libraries anywhere on
+# the shared filesystems, and this may lie outside the root. Instead, we set the
+# system directories so that the various system BGP CNK library locations are
+# searched first. This is not the clearest thing in the world, given IBM's driver
+# layout, but this should cover all the standard ones.
+#
+set(CMAKE_SYSTEM_LIBRARY_PATH
+ /bgsys/drivers/ppcfloor/comm/default/lib # default comm layer (used by mpi compiler wrappers)
+ /bgsys/drivers/ppcfloor/comm/sys/lib # DCMF, other lower-level comm libraries
+ /bgsys/drivers/ppcfloor/runtime/SPI # other low-level stuff
+ /bgsys/drivers/ppcfloor/gnu-linux/lib # CNK python installation directory
+ /bgsys/drivers/ppcfloor/gnu-linux/powerpc-bgp-linux/lib # CNK Linux image -- standard runtime libs, pthread, etc.
+)
+
+#
+# This adds directories that find commands should specifically ignore for cross compiles.
+# Most of these directories are the includeand lib directories for the frontend on BG/P systems.
+# Not ignoring these can cause things like FindX11 to find a frontend PPC version mistakenly.
+# We use this on BG instead of re-rooting because backend libraries are typically strewn about
+# the filesystem, and we can't re-root ALL backend libraries to a single place.
+#
+set(CMAKE_SYSTEM_IGNORE_PATH
+ /lib /lib64 /include
+ /usr/lib /usr/lib64 /usr/include
+ /usr/local/lib /usr/local/lib64 /usr/local/include
+ /usr/X11/lib /usr/X11/lib64 /usr/X11/include
+ /usr/lib/X11 /usr/lib64/X11 /usr/include/X11
+ /usr/X11R6/lib /usr/X11R6/lib64 /usr/X11R6/include
+ /usr/X11R7/lib /usr/X11R7/lib64 /usr/X11R7/include
+)
+
+#
+# Indicate that this is a unix-like system
+#
+set(UNIX 1)
+
+#
+# Library prefixes, suffixes, extra libs.
+#
+set(CMAKE_LINK_LIBRARY_SUFFIX "")
+set(CMAKE_STATIC_LIBRARY_PREFIX "lib") # lib
+set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") # .a
+
+set(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
+set(CMAKE_EXECUTABLE_SUFFIX "") # .exe
+set(CMAKE_DL_LIBS "dl")
+
+#
+# This macro needs to be called for dynamic library support. Unfortunately on BGP,
+# We can't support both static and dynamic links in the same platform file. The
+# dynamic link platform file needs to call this explicitly to set up dynamic linking.
+#
+macro(__BlueGeneP_set_dynamic_flags compiler_id lang)
+ if (${compiler_id} STREQUAL XL)
+ # Flags for XL compilers if we explicitly detected XL
+ set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-qpic") # -pic
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-qmkshrobj -qnostaticlink") # -shared
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-rpath,") # -rpath
+ set(BGP_${lang}_DYNAMIC_EXE_FLAGS "-qnostaticlink -qnostaticlink=libgcc")
+ else()
+ # Assume flags for GNU compilers (if the ID is GNU *or* anything else).
+ set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") # -pic
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") # -shared
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-rpath,") # -rpath
+ set(BGP_${lang}_DYNAMIC_EXE_FLAGS "-dynamic")
+ endif()
+
+ set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "") # +s, flag for exe link to use shared lib
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") # : or empty
+
+ set(BGP_${lang}_DEFAULT_EXE_FLAGS
+ "<FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+ set(CMAKE_${lang}_LINK_EXECUTABLE
+ "<CMAKE_${lang}_COMPILER> -Wl,-relax ${BGP_${lang}_DYNAMIC_EXE_FLAGS} ${BGP_${lang}_DEFAULT_EXE_FLAGS}")
+endmacro()
+
+#
+# This macro needs to be called for static builds. Right now it just adds -Wl,-relax
+# to the link line.
+#
+macro(__BlueGeneP_set_static_flags compiler_id lang)
+ set(BGP_${lang}_DEFAULT_EXE_FLAGS
+ "<FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+ set(CMAKE_${lang}_LINK_EXECUTABLE
+ "<CMAKE_${lang}_COMPILER> -Wl,-relax ${BGP_${lang}_DEFAULT_EXE_FLAGS}")
+endmacro()
diff --git a/Modules/Platform/BlueGeneP-dynamic-GNU-C.cmake b/Modules/Platform/BlueGeneP-dynamic-GNU-C.cmake
new file mode 100644
index 0000000..bd4696b
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-dynamic-GNU-C.cmake
@@ -0,0 +1,16 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+__BlueGeneP_set_dynamic_flags(GNU C)
diff --git a/Modules/Platform/BlueGeneP-dynamic-GNU-CXX.cmake b/Modules/Platform/BlueGeneP-dynamic-GNU-CXX.cmake
new file mode 100644
index 0000000..9c995dc
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-dynamic-GNU-CXX.cmake
@@ -0,0 +1,16 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+__BlueGeneP_set_dynamic_flags(GNU CXX)
diff --git a/Modules/Platform/BlueGeneP-dynamic-GNU-Fortran.cmake b/Modules/Platform/BlueGeneP-dynamic-GNU-Fortran.cmake
new file mode 100644
index 0000000..19d6be8
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-dynamic-GNU-Fortran.cmake
@@ -0,0 +1,16 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+__BlueGeneP_set_dynamic_flags(GNU Fortran)
diff --git a/Modules/Platform/BlueGeneP-dynamic-XL-C.cmake b/Modules/Platform/BlueGeneP-dynamic-XL-C.cmake
new file mode 100644
index 0000000..2dbbbc0
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-dynamic-XL-C.cmake
@@ -0,0 +1,16 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+__BlueGeneP_set_dynamic_flags(XL C)
diff --git a/Modules/Platform/BlueGeneP-dynamic-XL-CXX.cmake b/Modules/Platform/BlueGeneP-dynamic-XL-CXX.cmake
new file mode 100644
index 0000000..2bc5127
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-dynamic-XL-CXX.cmake
@@ -0,0 +1,16 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+__BlueGeneP_set_dynamic_flags(XL CXX)
diff --git a/Modules/Platform/BlueGeneP-dynamic-XL-Fortran.cmake b/Modules/Platform/BlueGeneP-dynamic-XL-Fortran.cmake
new file mode 100644
index 0000000..59da63d
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-dynamic-XL-Fortran.cmake
@@ -0,0 +1,16 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+__BlueGeneP_set_dynamic_flags(XL Fortran)
diff --git a/Modules/Platform/BlueGeneP-dynamic.cmake b/Modules/Platform/BlueGeneP-dynamic.cmake
new file mode 100644
index 0000000..8f96f2f
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-dynamic.cmake
@@ -0,0 +1,19 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+include(Platform/BlueGeneP-base)
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
diff --git a/Modules/Platform/BlueGeneP-static-GNU-C.cmake b/Modules/Platform/BlueGeneP-static-GNU-C.cmake
new file mode 100644
index 0000000..412a7a3
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-static-GNU-C.cmake
@@ -0,0 +1,16 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+__BlueGeneP_set_static_flags(GNU C)
diff --git a/Modules/Platform/BlueGeneP-static-GNU-CXX.cmake b/Modules/Platform/BlueGeneP-static-GNU-CXX.cmake
new file mode 100644
index 0000000..418f0d8
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-static-GNU-CXX.cmake
@@ -0,0 +1,16 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+__BlueGeneP_set_static_flags(GNU CXX)
diff --git a/Modules/Platform/BlueGeneP-static-GNU-Fortran.cmake b/Modules/Platform/BlueGeneP-static-GNU-Fortran.cmake
new file mode 100644
index 0000000..119195b
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-static-GNU-Fortran.cmake
@@ -0,0 +1,16 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+__BlueGeneP_set_static_flags(GNU Fortran)
diff --git a/Modules/Platform/BlueGeneP-static-XL-C.cmake b/Modules/Platform/BlueGeneP-static-XL-C.cmake
new file mode 100644
index 0000000..1f20959
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-static-XL-C.cmake
@@ -0,0 +1,16 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+__BlueGeneP_set_static_flags(XL C)
diff --git a/Modules/Platform/BlueGeneP-static-XL-CXX.cmake b/Modules/Platform/BlueGeneP-static-XL-CXX.cmake
new file mode 100644
index 0000000..f027a53
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-static-XL-CXX.cmake
@@ -0,0 +1,16 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+__BlueGeneP_set_static_flags(XL CXX)
diff --git a/Modules/Platform/BlueGeneP-static-XL-Fortran.cmake b/Modules/Platform/BlueGeneP-static-XL-Fortran.cmake
new file mode 100644
index 0000000..778d4bd
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-static-XL-Fortran.cmake
@@ -0,0 +1,16 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+__BlueGeneP_set_static_flags(XL Fortran)
diff --git a/Modules/Platform/BlueGeneP-static.cmake b/Modules/Platform/BlueGeneP-static.cmake
new file mode 100644
index 0000000..c4f5f21
--- /dev/null
+++ b/Modules/Platform/BlueGeneP-static.cmake
@@ -0,0 +1,19 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+include(Platform/BlueGeneP-base)
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake
index 24bb92a..6f72a75 100644
--- a/Modules/Platform/CYGWIN-GNU.cmake
+++ b/Modules/Platform/CYGWIN-GNU.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
diff --git a/Modules/Platform/Darwin-GNU.cmake b/Modules/Platform/Darwin-GNU.cmake
index 4c2194a..f425eb9 100644
--- a/Modules/Platform/Darwin-GNU.cmake
+++ b/Modules/Platform/Darwin-GNU.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index c8bcad1..db0642e 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -235,4 +235,7 @@ SET(CMAKE_SYSTEM_APPBUNDLE_PATH
/Developer/Applications)
INCLUDE(Platform/UnixPaths)
-LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH /sw)
+LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
+ /sw # Fink
+ /opt/local # MacPorts
+ )
diff --git a/Modules/Platform/GNU.cmake b/Modules/Platform/GNU.cmake
index fe3d47b..e0ed86c 100644
--- a/Modules/Platform/GNU.cmake
+++ b/Modules/Platform/GNU.cmake
@@ -4,5 +4,8 @@ SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+
INCLUDE(Platform/UnixPaths)
diff --git a/Modules/Platform/HP-UX-GNU.cmake b/Modules/Platform/HP-UX-GNU.cmake
index da9fe48..eb909fe 100644
--- a/Modules/Platform/HP-UX-GNU.cmake
+++ b/Modules/Platform/HP-UX-GNU.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake
index f8893d8..9d357c9 100644
--- a/Modules/Platform/HP-UX.cmake
+++ b/Modules/Platform/HP-UX.cmake
@@ -1,3 +1,5 @@
+SET(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib)
+
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".sl") # .so
SET(CMAKE_DL_LIBS "dld")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".sl" ".so" ".a")
diff --git a/Modules/Platform/Linux-GNU.cmake b/Modules/Platform/Linux-GNU.cmake
index d257f34..0e254c6 100644
--- a/Modules/Platform/Linux-GNU.cmake
+++ b/Modules/Platform/Linux-GNU.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
diff --git a/Modules/Platform/Linux-Intel.cmake b/Modules/Platform/Linux-Intel.cmake
index dff90e9..dea8b90 100644
--- a/Modules/Platform/Linux-Intel.cmake
+++ b/Modules/Platform/Linux-Intel.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
diff --git a/Modules/Platform/Linux-PGI.cmake b/Modules/Platform/Linux-PGI.cmake
index 868ee33..ef06acd 100644
--- a/Modules/Platform/Linux-PGI.cmake
+++ b/Modules/Platform/Linux-PGI.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
diff --git a/Modules/Platform/Linux-PathScale.cmake b/Modules/Platform/Linux-PathScale.cmake
index 8537e4c..c131af2 100644
--- a/Modules/Platform/Linux-PathScale.cmake
+++ b/Modules/Platform/Linux-PathScale.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
diff --git a/Modules/Platform/SunOS-GNU.cmake b/Modules/Platform/SunOS-GNU.cmake
index 613ea6b..7169056 100644
--- a/Modules/Platform/SunOS-GNU.cmake
+++ b/Modules/Platform/SunOS-GNU.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index 025ae51..5ee7ddb 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Block multiple inclusion because "CMakeCInformation.cmake" includes
@@ -51,7 +51,7 @@ LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
/usr/X11R6/include /usr/include/X11
# Other
- /opt/local/include /usr/pkg/include
+ /usr/pkg/include
/opt/csw/include /opt/include
/usr/openwin/include
)
@@ -64,7 +64,7 @@ LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
/usr/X11R6/lib /usr/lib/X11
# Other
- /opt/local/lib /usr/pkg/lib
+ /usr/pkg/lib
/opt/csw/lib /opt/lib
/usr/openwin/lib
)
diff --git a/Modules/Platform/Windows-Borland.cmake b/Modules/Platform/Windows-Borland.cmake
index 7b7ae84..5c402bd 100644
--- a/Modules/Platform/Windows-Borland.cmake
+++ b/Modules/Platform/Windows-Borland.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
diff --git a/Modules/Platform/Windows-GNU-Fortran.cmake b/Modules/Platform/Windows-GNU-Fortran.cmake
index 8273a19..c66feed 100644
--- a/Modules/Platform/Windows-GNU-Fortran.cmake
+++ b/Modules/Platform/Windows-GNU-Fortran.cmake
@@ -1,3 +1,2 @@
include(Platform/Windows-GNU)
__windows_compiler_gnu(Fortran)
-set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 0)
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index af03841..ac635a5 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
@@ -49,6 +49,13 @@ set(CMAKE_CREATE_WIN32_EXE "-mwindows")
set(CMAKE_GNULD_IMAGE_VERSION
"-Wl,--major-image-version,<TARGET_VERSION_MAJOR>,--minor-image-version,<TARGET_VERSION_MINOR>")
+# Check if GNU ld is too old to support @FILE syntax.
+set(__WINDOWS_GNU_LD_RESPONSE 1)
+execute_process(COMMAND ld -v OUTPUT_VARIABLE _help ERROR_VARIABLE _help)
+if("${_help}" MATCHES "GNU ld .* 2\\.1[1-6]")
+ set(__WINDOWS_GNU_LD_RESPONSE 0)
+endif()
+
macro(__windows_compiler_gnu lang)
if(MSYS OR MINGW)
@@ -68,8 +75,24 @@ macro(__windows_compiler_gnu lang)
endif()
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on Windows
- set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
- set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@")
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS ${__WINDOWS_GNU_LD_RESPONSE})
+
+ # We prefer "@" for response files but it is not supported by gcc 3.
+ execute_process(COMMAND ${CMAKE_${lang}_COMPILER} --version OUTPUT_VARIABLE _ver ERROR_VARIABLE _ver)
+ if("${_ver}" MATCHES "\\(GCC\\) 3\\.")
+ if("${lang}" STREQUAL "Fortran")
+ # The GNU Fortran compiler reports an error:
+ # no input files; unwilling to write output files
+ # when the response file is passed with "-Wl,@".
+ set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 0)
+ else()
+ # Use "-Wl,@" to pass the response file to the linker.
+ set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@")
+ endif()
+ elseif(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS)
+ # Use "@" to pass the response file to the front-end.
+ set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "@")
+ endif()
# Binary link rules.
set(CMAKE_${lang}_CREATE_SHARED_MODULE
@@ -78,4 +101,21 @@ macro(__windows_compiler_gnu lang)
"<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
set(CMAKE_${lang}_LINK_EXECUTABLE
"<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
+
+ # Support very long lists of object files.
+ if("${CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG}" STREQUAL "@")
+ foreach(rule CREATE_SHARED_MODULE CREATE_SHARED_LIBRARY LINK_EXECUTABLE)
+ # The gcc/collect2/ld toolchain does not use response files
+ # internally so we cannot pass long object lists. Instead pass
+ # the object file list in a response file to the archiver to put
+ # them in a temporary archive. Hand the archive to the linker.
+ string(REPLACE "<OBJECTS>" "-Wl,--whole-archive <OBJECT_DIR>/objects.a -Wl,--no-whole-archive"
+ CMAKE_${lang}_${rule} "${CMAKE_${lang}_${rule}}")
+ set(CMAKE_${lang}_${rule}
+ "<CMAKE_COMMAND> -E remove -f <OBJECT_DIR>/objects.a"
+ "<CMAKE_AR> cr <OBJECT_DIR>/objects.a <OBJECTS>"
+ "${CMAKE_${lang}_${rule}}"
+ )
+ endforeach()
+ endif()
endmacro()
diff --git a/Modules/Platform/Windows-df.cmake b/Modules/Platform/Windows-df.cmake
index 753b198..f5046bf 100644
--- a/Modules/Platform/Windows-df.cmake
+++ b/Modules/Platform/Windows-df.cmake
@@ -10,6 +10,8 @@ ELSE(CMAKE_VERBOSE_MAKEFILE)
SET(CMAKE_CL_NOLOGO "/nologo")
ENDIF(CMAKE_VERBOSE_MAKEFILE)
+SET(CMAKE_Fortran_MODDIR_FLAG "-module:")
+
SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
"link ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
diff --git a/Modules/Platform/Windows-icl.cmake b/Modules/Platform/Windows-icl.cmake
index c717c7c..9088cc7 100644
--- a/Modules/Platform/Windows-icl.cmake
+++ b/Modules/Platform/Windows-icl.cmake
@@ -6,6 +6,10 @@ IF(CMAKE_VERBOSE_MAKEFILE)
ELSE(CMAKE_VERBOSE_MAKEFILE)
SET(CMAKE_CL_NOLOGO "/nologo")
ENDIF(CMAKE_VERBOSE_MAKEFILE)
+
+SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+
# create a shared C++ library
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
"xilink ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake
index 7fc345f..e96ebb5 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -12,17 +12,29 @@ ELSE(CMAKE_VERBOSE_MAKEFILE)
SET(CMAKE_LIB_QUIET "-q")
ENDIF(CMAKE_VERBOSE_MAKEFILE)
+set(CMAKE_CREATE_WIN32_EXE "system nt_win" )
+SET(CMAKE_CREATE_CONSOLE_EXE "system nt" )
+
+SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "debug all" )
+SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "debug all" )
+SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
+SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
+
+set (CMAKE_SHARED_LIBRARY_C_FLAGS "-bd" )
+
+SET(CMAKE_RC_COMPILER "rc" )
+
SET(CMAKE_BUILD_TYPE_INIT Debug)
SET (CMAKE_CXX_FLAGS_INIT "-w=3 -xs")
-SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-br -bm -d2")
+SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-br -bm -d2")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-br -bm -d2 -ot -dNDEBUG")
SET (CMAKE_C_FLAGS_INIT "-w=3 ")
-SET (CMAKE_C_FLAGS_DEBUG_INIT "-br -bm -od")
+SET (CMAKE_C_FLAGS_DEBUG_INIT "-br -bm -d2 -od")
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG")
-SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-br -bm -ot -dNDEBUG")
+SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-br -bm -d2 -ot -dNDEBUG")
SET (CMAKE_C_STANDARD_LIBRARIES_INIT "library clbrdll.lib library plbrdll.lib library kernel32.lib library user32.lib library gdi32.lib library winspool.lib library comdlg32.lib library advapi32.lib library shell32.lib library ole32.lib library oleaut32.lib library uuid.lib library odbc32.lib library odbccp32.lib")
SET (CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
@@ -33,6 +45,7 @@ SET(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})
SET(CMAKE_C_LINK_EXECUTABLE
"wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' <LINK_FLAGS> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
+
SET(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE})
# compile a C++ file into an object file
diff --git a/Modules/Platform/WindowsPaths.cmake b/Modules/Platform/WindowsPaths.cmake
index 8c67175..c7b15b3 100644
--- a/Modules/Platform/WindowsPaths.cmake
+++ b/Modules/Platform/WindowsPaths.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Block multiple inclusion because "CMakeCInformation.cmake" includes
diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake
index 1d77c7a..bfb50de 100644
--- a/Modules/Qt4ConfigDependentSettings.cmake
+++ b/Modules/Qt4ConfigDependentSettings.cmake
@@ -10,7 +10,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
@@ -34,12 +34,12 @@ SET(QT_QTDBUS_LIB_DEPENDENCIES "")
SET(QT_QTHELP_LIB_DEPENDENCIES ${QT_QTCLUCENE_LIBRARY})
-IF(WIN32)
+IF(Q_WS_WIN)
# On Windows, qconfig.pri has "static" for static library builds
IF(QT_CONFIG MATCHES "static")
SET(QT_IS_STATIC 1)
ENDIF(QT_CONFIG MATCHES "static")
-ELSE(WIN32)
+ELSE(Q_WS_WIN)
# On other platforms, check file extension to know if its static
IF(QT_QTCORE_LIBRARY_RELEASE)
GET_FILENAME_COMPONENT(qtcore_lib_ext "${QT_QTCORE_LIBRARY_RELEASE}" EXT)
@@ -53,12 +53,12 @@ ELSE(WIN32)
SET(QT_IS_STATIC 1)
ENDIF(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
ENDIF(QT_QTCORE_LIBRARY_DEBUG)
-ENDIF(WIN32)
+ENDIF(Q_WS_WIN)
# build using shared Qt needs -DQT_DLL on Windows
-IF(WIN32 AND NOT QT_IS_STATIC)
+IF(Q_WS_WIN AND NOT QT_IS_STATIC)
SET(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_DLL)
-ENDIF(WIN32 AND NOT QT_IS_STATIC)
+ENDIF(Q_WS_WIN AND NOT QT_IS_STATIC)
IF(NOT QT_IS_STATIC)
RETURN()
@@ -71,11 +71,8 @@ SET (QT_QTOPENGL_LIB_DEPENDENCIES ${OPENGL_glu_LIBRARY} ${OPENGL_gl_LIBRARY})
## system png
IF(QT_QCONFIG MATCHES "system-png")
- FIND_LIBRARY(QT_PNG_LIBRARY NAMES png)
- MARK_AS_ADVANCED(QT_PNG_LIBRARY)
- IF(QT_PNG_LIBRARY)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_PNG_LIBRARY})
- ENDIF(QT_PNG_LIBRARY)
+ find_package(PNG)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${PNG_LIBRARY})
ENDIF(QT_QCONFIG MATCHES "system-png")
@@ -141,16 +138,6 @@ IF(QT_QCONFIG MATCHES "xfixes")
ENDIF(QT_QCONFIG MATCHES "xfixes")
-## system-freetype
-IF(QT_QCONFIG MATCHES "system-freetype")
- FIND_LIBRARY(QT_FREETYPE_LIBRARY NAMES freetype)
- MARK_AS_ADVANCED(QT_FREETYPE_LIBRARY)
- IF(QT_FREETYPE_LIBRARY)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_FREETYPE_LIBRARY})
- ENDIF(QT_FREETYPE_LIBRARY)
-ENDIF(QT_QCONFIG MATCHES "system-freetype")
-
-
## fontconfig
IF(QT_QCONFIG MATCHES "fontconfig")
FIND_LIBRARY(QT_FONTCONFIG_LIBRARY NAMES fontconfig)
@@ -161,13 +148,19 @@ IF(QT_QCONFIG MATCHES "fontconfig")
ENDIF(QT_QCONFIG MATCHES "fontconfig")
+## system-freetype
+IF(QT_QCONFIG MATCHES "system-freetype")
+ find_package(Freetype)
+ if(FREETYPE_LIBRARIES)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${FREETYPE_LIBRARIES})
+ endif(FREETYPE_LIBRARIES)
+ENDIF(QT_QCONFIG MATCHES "system-freetype")
+
+
## system-zlib
IF(QT_QCONFIG MATCHES "system-zlib")
- FIND_LIBRARY(QT_ZLIB_LIBRARY NAMES z)
- MARK_AS_ADVANCED(QT_ZLIB_LIBRARY)
- IF(QT_ZLIB_LIBRARY)
- SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_ZLIB_LIBRARY})
- ENDIF(QT_ZLIB_LIBRARY)
+ find_package(ZLIB)
+ SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${ZLIB_LIBRARIES})
ENDIF(QT_QCONFIG MATCHES "system-zlib")
@@ -192,29 +185,11 @@ ENDIF(NOT Q_WS_WIN)
## dbus
IF(QT_QCONFIG MATCHES "dbus")
- # if the dbus library isn't found, we'll assume its not required to build
- # shared Qt on Linux doesn't require it
- IF(NOT QT_DBUS_LIBRARY)
- EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L dbus-1
- OUTPUT_VARIABLE _dbus_query_output
- RESULT_VARIABLE _dbus_result
- ERROR_VARIABLE _dbus_query_output )
-
- IF(_dbus_result MATCHES 0)
- STRING(REPLACE "-L" "" _dbus_query_output "${_dbus_query_output}")
- SEPARATE_ARGUMENTS(_dbus_query_output)
- ELSE(_dbus_result MATCHES 0)
- SET(_dbus_query_output)
- ENDIF(_dbus_result MATCHES 0)
-
- FIND_LIBRARY(QT_DBUS_LIBRARY NAMES dbus-1 PATHS ${_dbus_query_output} )
-
- IF(QT_DBUS_LIBRARY)
- SET(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY})
- ENDIF(QT_DBUS_LIBRARY)
-
- MARK_AS_ADVANCED(QT_DBUS_LIBRARY)
- ENDIF(NOT QT_DBUS_LIBRARY)
+ FIND_LIBRARY(QT_DBUS_LIBRARY NAMES dbus-1 )
+ IF(QT_DBUS_LIBRARY)
+ SET(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY})
+ ENDIF(QT_DBUS_LIBRARY)
+ MARK_AS_ADVANCED(QT_DBUS_LIBRARY)
ENDIF(QT_QCONFIG MATCHES "dbus")
@@ -222,29 +197,11 @@ ENDIF(QT_QCONFIG MATCHES "dbus")
## glib
IF(QT_QCONFIG MATCHES "glib")
- # if the glib libraries aren't found, we'll assume its not required to build
- # shared Qt on Linux doesn't require it
-
# Qt 4.2.0+ uses glib-2.0
- IF(NOT QT_GLIB_LIBRARY OR NOT QT_GTHREAD_LIBRARY)
- EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L glib-2.0 gthread-2.0
- OUTPUT_VARIABLE _glib_query_output
- RESULT_VARIABLE _glib_result
- ERROR_VARIABLE _glib_query_output )
-
- IF(_glib_result MATCHES 0)
- STRING(REPLACE "-L" "" _glib_query_output "${_glib_query_output}")
- SEPARATE_ARGUMENTS(_glib_query_output)
- ELSE(_glib_result MATCHES 0)
- SET(_glib_query_output)
- ENDIF(_glib_result MATCHES 0)
-
- FIND_LIBRARY(QT_GLIB_LIBRARY NAMES glib-2.0 PATHS ${_glib_query_output} )
- FIND_LIBRARY(QT_GTHREAD_LIBRARY NAMES gthread-2.0 PATHS ${_glib_query_output} )
-
- MARK_AS_ADVANCED(QT_GLIB_LIBRARY)
- MARK_AS_ADVANCED(QT_GTHREAD_LIBRARY)
- ENDIF(NOT QT_GLIB_LIBRARY OR NOT QT_GTHREAD_LIBRARY)
+ FIND_LIBRARY(QT_GLIB_LIBRARY NAMES glib-2.0 )
+ FIND_LIBRARY(QT_GTHREAD_LIBRARY NAMES gthread-2.0 )
+ MARK_AS_ADVANCED(QT_GLIB_LIBRARY)
+ MARK_AS_ADVANCED(QT_GTHREAD_LIBRARY)
IF(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
@@ -254,23 +211,8 @@ IF(QT_QCONFIG MATCHES "glib")
# Qt 4.5+ also links to gobject-2.0
IF(QT_VERSION_MINOR GREATER 4)
- IF(NOT QT_GOBJECT_LIBRARY)
- EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L gobject-2.0
- OUTPUT_VARIABLE _glib_query_output
- RESULT_VARIABLE _glib_result
- ERROR_VARIABLE _glib_query_output )
-
- IF(_glib_result MATCHES 0)
- STRING(REPLACE "-L" "" _glib_query_output "${_glib_query_output}")
- SEPARATE_ARGUMENTS(_glib_query_output)
- ELSE(_glib_result MATCHES 0)
- SET(_glib_query_output)
- ENDIF(_glib_result MATCHES 0)
-
- FIND_LIBRARY(QT_GOBJECT_LIBRARY NAMES gobject-2.0 PATHS ${_glib_query_output} )
-
- MARK_AS_ADVANCED(QT_GOBJECT_LIBRARY)
- ENDIF(NOT QT_GOBJECT_LIBRARY)
+ FIND_LIBRARY(QT_GOBJECT_LIBRARY NAMES gobject-2.0 PATHS ${_glib_query_output} )
+ MARK_AS_ADVANCED(QT_GOBJECT_LIBRARY)
IF(QT_GOBJECT_LIBRARY)
SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index bd72c8f..700d3a2 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -10,7 +10,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
@@ -129,7 +129,11 @@ MACRO (QT4_GENERATE_MOC infile outfile )
# get include dirs and flags
QT4_GET_MOC_FLAGS(moc_flags)
GET_FILENAME_COMPONENT(abs_infile ${infile} ABSOLUTE)
- QT4_CREATE_MOC_COMMAND(${abs_infile} ${outfile} "${moc_flags}" "")
+ SET(_outfile "${outfile}")
+ IF(NOT IS_ABSOLUTE "${outfile}")
+ SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
+ ENDIF(NOT IS_ABSOLUTE "${outfile}")
+ QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "")
SET_SOURCE_FILES_PROPERTIES(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file
ENDMACRO (QT4_GENERATE_MOC)
@@ -187,10 +191,9 @@ MACRO (QT4_ADD_RESOURCES outfiles )
SET(_RC_DEPENDS)
FOREACH(_RC_FILE ${_RC_FILES})
STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
- STRING(REGEX MATCH "^/|([A-Za-z]:/)" _ABS_PATH_INDICATOR "${_RC_FILE}")
- IF(NOT _ABS_PATH_INDICATOR)
+ IF(NOT IS_ABSOLUTE "${_RC_FILE}")
SET(_RC_FILE "${rc_path}/${_RC_FILE}")
- ENDIF(NOT _ABS_PATH_INDICATOR)
+ ENDIF(NOT IS_ABSOLUTE "${_RC_FILE}")
SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
ENDFOREACH(_RC_FILE)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake
index edba5d9..51b4dda 100644
--- a/Modules/SelectLibraryConfigurations.cmake
+++ b/Modules/SelectLibraryConfigurations.cmake
@@ -26,7 +26,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This macro was adapted from the FindQt4 CMake module and is maintained by Will
diff --git a/Modules/SquishTestScript.cmake b/Modules/SquishTestScript.cmake
index d42a84c..9eac970 100644
--- a/Modules/SquishTestScript.cmake
+++ b/Modules/SquishTestScript.cmake
@@ -19,7 +19,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
diff --git a/Modules/SystemInformation.cmake b/Modules/SystemInformation.cmake
index ef9b427..d973e90f 100644
--- a/Modules/SystemInformation.cmake
+++ b/Modules/SystemInformation.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
PROJECT(DumpInformation)
diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake
index 7514127..9960602 100644
--- a/Modules/TestBigEndian.cmake
+++ b/Modules/TestBigEndian.cmake
@@ -14,7 +14,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(TEST_BIG_ENDIAN VARIABLE)
diff --git a/Modules/TestCXXAcceptsFlag.cmake b/Modules/TestCXXAcceptsFlag.cmake
index 98b2f9b..52d0cf3 100644
--- a/Modules/TestCXXAcceptsFlag.cmake
+++ b/Modules/TestCXXAcceptsFlag.cmake
@@ -17,7 +17,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CHECK_CXX_ACCEPTS_FLAG FLAGS VARIABLE)
diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake
index 6581d07..ae2acef 100644
--- a/Modules/TestForANSIForScope.cmake
+++ b/Modules/TestForANSIForScope.cmake
@@ -13,7 +13,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
diff --git a/Modules/TestForANSIStreamHeaders.cmake b/Modules/TestForANSIStreamHeaders.cmake
index f62f3a4..19c1ab2 100644
--- a/Modules/TestForANSIStreamHeaders.cmake
+++ b/Modules/TestForANSIStreamHeaders.cmake
@@ -13,7 +13,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CheckIncludeFileCXX)
diff --git a/Modules/TestForSSTREAM.cmake b/Modules/TestForSSTREAM.cmake
index 4c8b11b..8dd53e7 100644
--- a/Modules/TestForSSTREAM.cmake
+++ b/Modules/TestForSSTREAM.cmake
@@ -13,7 +13,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")
diff --git a/Modules/TestForSTDNamespace.cmake b/Modules/TestForSTDNamespace.cmake
index f0966d0..932d6e9 100644
--- a/Modules/TestForSTDNamespace.cmake
+++ b/Modules/TestForSTDNamespace.cmake
@@ -13,7 +13,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")
diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake
index 9785cd5..60e1e46 100644
--- a/Modules/UseEcos.cmake
+++ b/Modules/UseEcos.cmake
@@ -26,7 +26,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# first check that ecosconfig is available
diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake
index e8194d5..d101e61 100644
--- a/Modules/UsePkgConfig.cmake
+++ b/Modules/UsePkgConfig.cmake
@@ -20,7 +20,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config )
diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake
index 63a0919..ab028ed 100644
--- a/Modules/UseQt4.cmake
+++ b/Modules/UseQt4.cmake
@@ -13,7 +13,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
ADD_DEFINITIONS(${QT_DEFINITIONS})
@@ -27,9 +27,9 @@ INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
SET(QT_LIBRARIES "")
IF (QT_USE_QTMAIN)
- IF (WIN32)
+ IF (Q_WS_WIN)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
- ENDIF (WIN32)
+ ENDIF (Q_WS_WIN)
ENDIF (QT_USE_QTMAIN)
IF(QT_DONT_USE_QTGUI)
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index c79efac..b547dc7 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -30,7 +30,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
SET(SWIG_CXX_EXTENSION "cxx")
diff --git a/Modules/UseVTK40.cmake b/Modules/UseVTK40.cmake
index 560039f..c1157d6 100644
--- a/Modules/UseVTK40.cmake
+++ b/Modules/UseVTK40.cmake
@@ -10,7 +10,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This is an implementation detail for using VTK 4.0 with the
diff --git a/Modules/UseVTKBuildSettings40.cmake b/Modules/UseVTKBuildSettings40.cmake
index 693743c..4df59b9 100644
--- a/Modules/UseVTKBuildSettings40.cmake
+++ b/Modules/UseVTKBuildSettings40.cmake
@@ -10,7 +10,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Implementation detail for FindVTK.cmake to let it provide a
diff --git a/Modules/UseVTKConfig40.cmake b/Modules/UseVTKConfig40.cmake
index 2100d84..ca5e7aa 100644
--- a/Modules/UseVTKConfig40.cmake
+++ b/Modules/UseVTKConfig40.cmake
@@ -10,7 +10,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This is an implementation detail for using VTK 4.0 with the
diff --git a/Modules/Use_wxWindows.cmake b/Modules/Use_wxWindows.cmake
index 2bae99c..01a1516 100644
--- a/Modules/Use_wxWindows.cmake
+++ b/Modules/Use_wxWindows.cmake
@@ -24,7 +24,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# -----------------------------------------------------
diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake
index b001f6a..9ecfff0 100644
--- a/Modules/UsewxWidgets.cmake
+++ b/Modules/UsewxWidgets.cmake
@@ -1,15 +1,13 @@
-# - Convenience include for using wxWidgets library
-# Finds if wxWidgets is installed
-# and set the appropriate libs, incdirs, flags etc.
-# INCLUDE_DIRECTORIES, LINK_DIRECTORIES and ADD_DEFINITIONS
-# are called.
+# - Convenience include for using wxWidgets library.
+# Determines if wxWidgets was FOUND and sets the appropriate libs, incdirs,
+# flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES are called.
#
# USAGE
-# SET( wxWidgets_USE_LIBS gl xml xrc ) # optionally: more than wx std libs
-# FIND_PACKAGE(wxWidgets REQUIRED)
-# INCLUDE( ${xWidgets_USE_FILE} )
-# ... add your targets here, e.g. ADD_EXECUTABLE/ ADD_LIBRARY ...
-# TARGET_LINK_LIBRARIERS( <yourWxDependantTarget> ${wxWidgets_LIBRARIES})
+# # Note that for MinGW users the order of libs is important!
+# FIND_PACKAGE(wxWidgets REQUIRED net gl core base)
+# INCLUDE(${wxWidgets_USE_FILE})
+# # and for each of your dependant executable/library targets:
+# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
#
# DEPRECATED
# LINK_LIBRARIES is not called in favor of adding dependencies per target.
@@ -28,7 +26,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# debug message and logging.
diff --git a/Modules/VTKCompatibility.cmake b/Modules/VTKCompatibility.cmake
index c0b3d62..802969f 100644
--- a/Modules/VTKCompatibility.cmake
+++ b/Modules/VTKCompatibility.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(APPLE)
diff --git a/Modules/ecos_clean.cmake b/Modules/ecos_clean.cmake
index b76137c..7a563ae 100644
--- a/Modules/ecos_clean.cmake
+++ b/Modules/ecos_clean.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
file(GLOB _files ${ECOS_DIR}/*)
diff --git a/Modules/kde3uic.cmake b/Modules/kde3uic.cmake
index b52dc09..6f904ac 100644
--- a/Modules/kde3uic.cmake
+++ b/Modules/kde3uic.cmake
@@ -10,7 +10,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# used internally by KDE3Macros.cmake
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index dbbb558..71284b2 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -112,6 +112,7 @@ ENDIF(CMAKE_USE_ELF_PARSER)
#
SET(SRCS
cmStandardIncludes.cxx
+ cmArchiveWrite.cxx
cmBootstrapCommands.cxx
cmCacheManager.cxx
cmCacheManager.h
@@ -350,7 +351,7 @@ ENDIF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
# CTestLib
#
INCLUDE_DIRECTORIES(
- "${CMAKE_SOURCE_DIR}/Source/CTest"
+ "${CMake_SOURCE_DIR}/Source/CTest"
${CMAKE_XMLRPC_INCLUDES}
${CMAKE_CURL_INCLUDES}
)
@@ -493,8 +494,8 @@ IF(BUILD_QtDialog)
SUBDIRS(QtDialog)
ENDIF(BUILD_QtDialog)
-INCLUDE (${CMAKE_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
-INCLUDE (${CMAKE_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
+INCLUDE (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
+INCLUDE (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
INSTALL_TARGETS(/bin cmake)
INSTALL_TARGETS(/bin ctest)
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index a52d05e..c86434e 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -22,13 +22,12 @@
#include <errno.h>
#include <cmsys/SystemTools.hxx>
-#include <cmlibarchive/libarchive/archive.h>
-#include <cmlibarchive/libarchive/archive_entry.h>
-
+#include <cmsys/Directory.hxx>
+#include <cm_libarchive.h>
//----------------------------------------------------------------------
-cmCPackArchiveGenerator::cmCPackArchiveGenerator(CompressType t,
- ArchiveType at)
+cmCPackArchiveGenerator::cmCPackArchiveGenerator(cmArchiveWrite::Compress t,
+ cmArchiveWrite::Type at)
{
this->Compress = t;
this->Archive = at;
@@ -39,222 +38,291 @@ cmCPackArchiveGenerator::~cmCPackArchiveGenerator()
{
}
-static const size_t cmCPackTGZ_Data_BlockSize = 16384;
-
-// make this an anonymous namespace so that archive.h does not
-// have to be included in the .h file for this class
-namespace
+//----------------------------------------------------------------------
+int cmCPackArchiveGenerator::InitializeInternal()
{
-bool SetArchiveType(struct archive* a,
- cmCPackArchiveGenerator::CompressType ct,
- cmCPackArchiveGenerator::ArchiveType at)
+ this->SetOptionIfNotSet("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", "1");
+ return this->Superclass::InitializeInternal();
+}
+//----------------------------------------------------------------------
+int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive,
+ cmCPackComponent* component)
{
- int res = 0;
- // pick the archive type
- switch(at)
- {
- case cmCPackArchiveGenerator::TAR:
- // maybe this:
- res = archive_write_set_format_pax_restricted(a);
- break;
- case cmCPackArchiveGenerator::ZIP:
- res = archive_write_set_format_zip(a);
- break;
- }
- if(res != ARCHIVE_OK)
- {
- return false;
- }
-
- // pick a compression type
- switch(ct)
- {
- case cmCPackArchiveGenerator::GZIP:
- res = archive_write_set_compression_gzip(a);
- break;
- case cmCPackArchiveGenerator::BZIP2:
- res = archive_write_set_compression_bzip2(a);
- break;
- case cmCPackArchiveGenerator::COMPRESS:
- res = archive_write_set_compression_compress(a);
- break;
- case cmCPackArchiveGenerator::LZMA:
- res = archive_write_set_compression_lzma(a);
- break;
- case cmCPackArchiveGenerator::NONE:
- default:
- res = archive_write_set_compression_none(a);
- }
- if(res != ARCHIVE_OK)
- {
- return false;
- }
- // do not pad the last block!!
- res = archive_write_set_bytes_in_last_block(a, 1);
- if(res != ARCHIVE_OK)
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, " - packaging component: "
+ << component->Name
+ << std::endl);
+ // Add the files of this component to the archive
+ std::string localToplevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
+ localToplevel += "/"+ component->Name;
+ std::string dir = cmSystemTools::GetCurrentWorkingDirectory();
+ // Change to local toplevel
+ cmSystemTools::ChangeDirectory(localToplevel.c_str());
+ std::vector<std::string>::const_iterator fileIt;
+ for (fileIt = component->Files.begin(); fileIt != component->Files.end();
+ ++fileIt )
{
- return false;
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,"Adding file: "
+ << (*fileIt) << std::endl);
+ archive.Add(*fileIt);
+ if (!archive)
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: "
+ << archive.GetError()
+ << std::endl);
+ return 0;
+ }
}
-
- return true;
+ // Go back to previous dir
+ cmSystemTools::ChangeDirectory(dir.c_str());
+ return 1;
}
-
-struct StreamData
-{
- StreamData(cmGeneratedFileStream* gfs,
- cmCPackArchiveGenerator* ag)
- {
- this->GeneratedFileStream = gfs;
- this->Generator = ag;
- }
- cmGeneratedFileStream* GeneratedFileStream;
- cmCPackArchiveGenerator* Generator;
-};
+/*
+ * The macro will open/create a file 'filename'
+ * an declare and open the associated
+ * cmArchiveWrite 'archive' object.
+ */
+#define DECLARE_AND_OPEN_ARCHIVE(filename,archive) \
+cmGeneratedFileStream gf; \
+gf.Open(filename.c_str(), false, true); \
+if (!GenerateHeader(&gf)) \
+ { \
+ cmCPackLogger(cmCPackLog::LOG_ERROR, \
+ "Problem to generate Header for archive < " \
+ << filename \
+ << ">." << std::endl); \
+ return 0; \
+ } \
+cmArchiveWrite archive(gf,this->Compress, this->Archive); \
+if (!archive) \
+ { \
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to create archive < " \
+ << filename \
+ << ">. ERROR =" \
+ << archive.GetError() \
+ << std::endl); \
+ return 0; \
+ }
-extern "C"
-{
-int OpenArchive(struct archive *, void *client_data)
+//----------------------------------------------------------------------
+int cmCPackArchiveGenerator::PackageComponents(bool ignoreComponentGroup)
{
- struct StreamData *data = (StreamData*)client_data;
- if(data->GeneratedFileStream &&
- *data->GeneratedFileStream)
+ packageFileNames.clear();
+ // The default behavior is to have one package by component group
+ // unless CPACK_COMPONENTS_IGNORE_GROUP is specified.
+ if (!ignoreComponentGroup)
{
- if(data->Generator->
- GenerateHeader(data->GeneratedFileStream))
+ std::map<std::string, cmCPackComponentGroup>::iterator compGIt;
+ for (compGIt=this->ComponentGroups.begin();
+ compGIt!=this->ComponentGroups.end(); ++compGIt)
{
- return ARCHIVE_OK;
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging component group: "
+ << compGIt->first
+ << std::endl);
+ // Begin the archive for this group
+ std::string packageFileName= std::string(toplevel);
+ packageFileName += "/"
+ +std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
+ +"-"+compGIt->first + this->GetOutputExtension();
+ // open a block in order to automatically close archive
+ // at the end of the block
+ {
+ DECLARE_AND_OPEN_ARCHIVE(packageFileName,archive);
+ // now iterate over the component of this group
+ std::vector<cmCPackComponent*>::iterator compIt;
+ for (compIt=(compGIt->second).Components.begin();
+ compIt!=(compGIt->second).Components.end();
+ ++compIt)
+ {
+ // Add the files of this component to the archive
+ addOneComponentToArchive(archive,*compIt);
+ }
+ }
+ // add the generated package to package file names list
+ packageFileNames.push_back(packageFileName);
}
}
- return (ARCHIVE_FATAL);
-}
-
-__LA_SSIZE_T WriteArchive(struct archive *,
- void *client_data,
- const void *buff,
- size_t n)
-{
- struct StreamData *data = (StreamData*)client_data;
- data->GeneratedFileStream->
- write(reinterpret_cast<const char*>(buff),n);
- if(!data->GeneratedFileStream->bad())
+ // CPACK_COMPONENTS_IGNORE_GROUPS is set
+ // We build 1 package per component
+ else
{
- return n;
+ std::map<std::string, cmCPackComponent>::iterator compIt;
+ for (compIt=this->Components.begin();
+ compIt!=this->Components.end(); ++compIt )
+ {
+ std::string localToplevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
+ std::string packageFileName = std::string(toplevel);
+
+ localToplevel += "/"+ compIt->first;
+ packageFileName += "/"
+ +std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
+ +"-"+compIt->first + this->GetOutputExtension();
+ {
+ DECLARE_AND_OPEN_ARCHIVE(packageFileName,archive);
+ // Add the files of this component to the archive
+ addOneComponentToArchive(archive,&(compIt->second));
+ }
+ // add the generated package to package file names list
+ packageFileNames.push_back(packageFileName);
+ }
}
- return 0;
+ return 1;
}
-
-int CloseArchive(struct archive *, void *client_data)
+//----------------------------------------------------------------------
+int cmCPackArchiveGenerator::PackageComponentsAllInOne(bool allComponentInOne)
{
- struct StreamData *data = (StreamData*)client_data;
- if(data->GeneratedFileStream->Close())
+ // reset the package file names
+ packageFileNames.clear();
+ packageFileNames.push_back(std::string(toplevel));
+ packageFileNames[0] += "/"
+ +std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
+ +"-ALL" + this->GetOutputExtension();
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE,
+ "Packaging all groups in one package..."
+ "(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE is set)"
+ << std::endl);
+ DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0],archive);
+
+ // The ALL GROUP in ONE package case
+ if (! allComponentInOne) {
+ // iterate over the component groups
+ std::map<std::string, cmCPackComponentGroup>::iterator compGIt;
+ for (compGIt=this->ComponentGroups.begin();
+ compGIt!=this->ComponentGroups.end(); ++compGIt)
+ {
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging component group: "
+ << compGIt->first
+ << std::endl);
+ // now iterate over the component of this group
+ std::vector<cmCPackComponent*>::iterator compIt;
+ for (compIt=(compGIt->second).Components.begin();
+ compIt!=(compGIt->second).Components.end();
+ ++compIt)
+ {
+ // Add the files of this component to the archive
+ addOneComponentToArchive(archive,*compIt);
+ }
+ }
+ }
+ // The ALL COMPONENT in ONE package case
+ else
{
- delete data->GeneratedFileStream;
- return ARCHIVE_OK;
+ std::map<std::string, cmCPackComponent>::iterator compIt;
+ for (compIt=this->Components.begin();compIt!=this->Components.end();
+ ++compIt )
+ {
+ // Add the files of this component to the archive
+ addOneComponentToArchive(archive,&(compIt->second));
+ }
}
- return ARCHIVE_FATAL;
+ // archive goes out of scope so it will finalized and closed.
+ return 1;
}
-} //extern C
-} // anon name space
-
//----------------------------------------------------------------------
-int cmCPackArchiveGenerator::InitializeInternal()
+int cmCPackArchiveGenerator::PackageFiles()
{
- this->SetOptionIfNotSet("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", "1");
- return this->Superclass::InitializeInternal();
-}
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: "
+ << toplevel << std::endl);
-int cmCPackArchiveGenerator::CompressFiles(const char* outFileName,
- const char* toplevel, const std::vector<std::string>& files)
-{
- int res = ARCHIVE_OK;
-#define CHECK_ARCHIVE_ERROR(res, msg) \
- if(res != ARCHIVE_OK) \
- {\
- cmCPackLogger(cmCPackLog::LOG_ERROR, msg \
- << archive_error_string(a) \
- << cmSystemTools::GetLastSystemError() \
- << " " << res \
- << "\n"); \
+ // The default behavior is to create 1 package by component group
+ // unless the user asked to put all COMPONENTS in a single package
+ bool allGroupInOne = (NULL !=
+ (this->GetOption(
+ "CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE")));
+ bool allComponentInOne = (NULL !=
+ (this->GetOption(
+ "CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE")));
+ bool ignoreComponentGroup = ( NULL !=
+ (this->GetOption(
+ "CPACK_COMPONENTS_IGNORE_GROUPS")));
+
+ std::string groupingType;
+
+ // Second way to specify grouping
+ if (NULL != this->GetOption("CPACK_COMPONENTS_GROUPING")) {
+ groupingType = this->GetOption("CPACK_COMPONENTS_GROUPING");
+ }
+
+ if (groupingType.length()>0)
+ {
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, "["
+ << this->Name << "]"
+ << " requested component grouping = "<< groupingType <<std::endl);
+ if (groupingType == "ALL_GROUP_IN_ONE")
+ {
+ allGroupInOne = true;
+ }
+ else if (groupingType == "ALL_COMPONENT_IN_ONE")
+ {
+ allComponentInOne = true;
+ }
+ else if (groupingType == "IGNORE")
+ {
+ ignoreComponentGroup = true;
+ }
+ else
+ {
+ cmCPackLogger(cmCPackLog::LOG_WARNING, "["
+ << this->Name << "]"
+ << " requested component grouping type <"<< groupingType
+ << "> UNKNOWN not in (ALL_GROUP_IN_ONE,"
+ "ALL_COMPONENT_IN_ONE,IGNORE)" <<std::endl);
+ }
}
- cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: "
- << (toplevel ? toplevel : "(NULL)") << std::endl);
- // create a new archive
- struct archive* a = archive_write_new();
- // Set the compress and archive types for the archive
- SetArchiveType(a, this->Compress, this->Archive);
- // Open binary stream
- cmGeneratedFileStream* gf = new cmGeneratedFileStream;
- gf->Open(outFileName, false, true);
- StreamData data(gf, this);
- // pass callbacks to archive_write_open to handle stream
- res = archive_write_open(a,
- &data,
- OpenArchive,
- WriteArchive,
- CloseArchive);
- CHECK_ARCHIVE_ERROR(res, "archive_write_open:");
- // create a new disk struct
- struct archive* disk = archive_read_disk_new();
-#if !defined(_WIN32) || defined(__CYGWIN__)
- res = archive_read_disk_set_standard_lookup(disk);
-#endif
- CHECK_ARCHIVE_ERROR(res, "archive_read_disk_set_standard_lookup:");
+
+ // Some components were defined but NO group
+ // force ignoreGroups
+ if (this->ComponentGroups.empty() && (!this->Components.empty())
+ && (!ignoreComponentGroup)) {
+ cmCPackLogger(cmCPackLog::LOG_WARNING, "["
+ << this->Name << "]"
+ << " Some Components defined but NO component group:"
+ << " Ignoring component group."
+ << std::endl);
+ ignoreComponentGroup = true;
+ }
+ // CASE 1 : COMPONENT ALL-IN-ONE package
+ // If ALL GROUPS or ALL COMPONENTS in ONE package has been requested
+ // then the package file is unique and should be open here.
+ if (allComponentInOne || (allGroupInOne && (!this->ComponentGroups.empty())))
+ {
+ return PackageComponentsAllInOne(allComponentInOne);
+ }
+ // CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one)
+ // There will be 1 package for each component group
+ // however one may require to ignore component group and
+ // in this case you'll get 1 package for each component.
+ else if ((!this->ComponentGroups.empty()) || (ignoreComponentGroup))
+ {
+ return PackageComponents(ignoreComponentGroup);
+ }
+
+ // CASE 3 : NON COMPONENT package.
+ DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0],archive);
std::vector<std::string>::const_iterator fileIt;
std::string dir = cmSystemTools::GetCurrentWorkingDirectory();
- cmSystemTools::ChangeDirectory(toplevel);
+ cmSystemTools::ChangeDirectory(toplevel.c_str());
for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt )
{
- // create a new entry for each file
- struct archive_entry *entry = archive_entry_new();
// Get the relative path to the file
- std::string rp = cmSystemTools::RelativePath(toplevel, fileIt->c_str());
- // Set the name of the entry to the file name
- archive_entry_set_pathname(entry, rp.c_str());
- res = archive_read_disk_entry_from_file(disk, entry, -1, 0);
- CHECK_ARCHIVE_ERROR(res, "archive_read_disk_entry_from_file:");
- // write entry header
- res = archive_write_header(a, entry);
- CHECK_ARCHIVE_ERROR(res, "archive_write_header:");
- // the entry size can be 0 if it is a symlink
- if(archive_entry_size(entry) > 0)
+ std::string rp = cmSystemTools::RelativePath(toplevel.c_str(),
+ fileIt->c_str());
+ archive.Add(rp);
+ if(!archive)
{
- // now copy contents of file into archive a
- FILE* file = fopen(fileIt->c_str(), "rb");
- if(!file)
- {
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with fopen(): "
- << fileIt->c_str()
- << strerror(errno)
- << std::endl);
- return 0;
- }
- char buff[cmCPackTGZ_Data_BlockSize];
- size_t len = fread(buff, 1, sizeof(buff), file);
- while (len > 0)
- {
- size_t wlen = archive_write_data(a, buff, len);
- if(wlen != len)
- {
- cmCPackLogger(cmCPackLog::LOG_ERROR, "archive_write_data(): "
- << "tried to write " << len << "\n"
- << "write " << wlen << "\n");
- return 0;
- }
- len = fread(buff, 1, sizeof(buff), file);
- }
- // close the file and free the entry
- fclose(file);
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem while adding file< "
+ << *fileIt
+ << "> to archive <"
+ << packageFileNames[0] << "> .ERROR ="
+ << archive.GetError()
+ << std::endl);
+ return 0;
}
- archive_entry_free(entry);
}
cmSystemTools::ChangeDirectory(dir.c_str());
- // close the archive and finish the write
- archive_write_close(a);
- archive_write_finish(a);
- archive_read_finish(disk);
+ // The destructor of cmArchiveWrite will close and finish the write
return 1;
}
@@ -263,3 +331,7 @@ int cmCPackArchiveGenerator::GenerateHeader(std::ostream*)
{
return 1;
}
+
+bool cmCPackArchiveGenerator::SupportsComponentInstallation() const {
+ return true;
+}
diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h
index 486db8e..6e173bd 100644
--- a/Source/CPack/cmCPackArchiveGenerator.h
+++ b/Source/CPack/cmCPackArchiveGenerator.h
@@ -13,35 +13,62 @@
#ifndef cmCPackArchiveGenerator_h
#define cmCPackArchiveGenerator_h
+#include "cmArchiveWrite.h"
#include "cmCPackGenerator.h"
/** \class cmCPackArchiveGenerator
- * \brief A generator base for libarchive generation
+ * \brief A generator base for libarchive generation.
+ * The generator itself uses the libarchive wrapper
+ * \ref cmArchiveWrite.
*
*/
class cmCPackArchiveGenerator : public cmCPackGenerator
-{
+ {
public:
- enum CompressType{ GZIP, BZIP2, COMPRESS, LZMA, NONE};
- enum ArchiveType{ TAR, ZIP};
cmTypeMacro(cmCPackArchiveGenerator, cmCPackGenerator);
/**
* Construct generator
*/
- cmCPackArchiveGenerator(CompressType, ArchiveType);
+ cmCPackArchiveGenerator(cmArchiveWrite::Compress, cmArchiveWrite::Type);
virtual ~cmCPackArchiveGenerator();
// Used to add a header to the archive
virtual int GenerateHeader(std::ostream* os);
-
+ // component support
+ virtual bool SupportsComponentInstallation() const;
protected:
virtual int InitializeInternal();
- int CompressFiles(const char* outFileName, const char* toplevel,
- const std::vector<std::string>& files);
+ /**
+ * Add the files belonging to the specified component
+ * to the provided (already opened) archive.
+ * @param[in,out] archive the archive object
+ * @param[in] component the component whose file will be added to archive
+ */
+ int addOneComponentToArchive(cmArchiveWrite& archive,
+ cmCPackComponent* component);
+
+ /**
+ * The main package file method.
+ * If component install was required this
+ * method will call either PackageComponents or
+ * PackageComponentsAllInOne.
+ */
+ int PackageFiles();
+ /**
+ * The method used to package files when component
+ * install is used. This will create one
+ * archive for each component group.
+ */
+ int PackageComponents(bool ignoreComponentGroup);
+ /**
+ * Special case of component install where all
+ * components will be put in a single installer.
+ */
+ int PackageComponentsAllInOne(bool allComponentInOne);
virtual const char* GetOutputExtension() = 0;
- CompressType Compress;
- ArchiveType Archive;
-};
+ cmArchiveWrite::Compress Compress;
+ cmArchiveWrite::Type Archive;
+ };
#endif
diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx
index 247a043..06a0509 100644
--- a/Source/CPack/cmCPackBundleGenerator.cxx
+++ b/Source/CPack/cmCPackBundleGenerator.cxx
@@ -53,10 +53,8 @@ const char* cmCPackBundleGenerator::GetPackagingInstallPrefix()
}
//----------------------------------------------------------------------
-int cmCPackBundleGenerator::CompressFiles(const char* outFileName,
- const char* toplevel, const std::vector<std::string>& files)
+int cmCPackBundleGenerator::PackageFiles()
{
- (void) files;
// Get required arguments ...
const std::string cpack_bundle_name = this->GetOption("CPACK_BUNDLE_NAME")
@@ -167,5 +165,5 @@ int cmCPackBundleGenerator::CompressFiles(const char* outFileName,
cmSystemTools::SetPermissions(command_target.str().c_str(), 0777);
}
- return this->CreateDMG(toplevel, outFileName);
+ return this->CreateDMG();
}
diff --git a/Source/CPack/cmCPackBundleGenerator.h b/Source/CPack/cmCPackBundleGenerator.h
index ce05541..82814b0 100644
--- a/Source/CPack/cmCPackBundleGenerator.h
+++ b/Source/CPack/cmCPackBundleGenerator.h
@@ -31,8 +31,7 @@ public:
protected:
virtual int InitializeInternal();
virtual const char* GetPackagingInstallPrefix();
- int CompressFiles(const char* outFileName, const char* toplevel,
- const std::vector<std::string>& files);
+ int PackageFiles();
std::string InstallPrefix;
};
diff --git a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx
index 853a1be..6c8fc54 100644
--- a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx
+++ b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx
@@ -41,8 +41,7 @@ int cmCPackCygwinBinaryGenerator::InitializeInternal()
}
//----------------------------------------------------------------------
-int cmCPackCygwinBinaryGenerator::CompressFiles(const char* outFileName,
- const char* toplevel, const std::vector<std::string>& files)
+int cmCPackCygwinBinaryGenerator::PackageFiles()
{
std::string packageName = this->GetOption("CPACK_PACKAGE_NAME");
packageName += "-";
@@ -70,12 +69,10 @@ int cmCPackCygwinBinaryGenerator::CompressFiles(const char* outFileName,
ofs << manifest << "\n";
}
// add the manifest file to the list of all files
- std::vector<std::string> filesWithManifest = files;
- filesWithManifest.push_back(manifestFile);
+ files.push_back(manifestFile);
// create the bzip2 tar file
- return this->Superclass::CompressFiles(outFileName, toplevel,
- filesWithManifest);
+ return this->Superclass::PackageFiles();
}
const char* cmCPackCygwinBinaryGenerator::GetOutputExtension()
diff --git a/Source/CPack/cmCPackCygwinBinaryGenerator.h b/Source/CPack/cmCPackCygwinBinaryGenerator.h
index 19b09f0..38f6df1 100644
--- a/Source/CPack/cmCPackCygwinBinaryGenerator.h
+++ b/Source/CPack/cmCPackCygwinBinaryGenerator.h
@@ -30,8 +30,7 @@ public:
virtual ~cmCPackCygwinBinaryGenerator();
protected:
virtual int InitializeInternal();
- int CompressFiles(const char* outFileName, const char* toplevel,
- const std::vector<std::string>& files);
+ int PackageFiles();
virtual const char* GetOutputExtension();
std::string OutputExtension;
};
diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx
index cca8338..5979729 100644
--- a/Source/CPack/cmCPackCygwinSourceGenerator.cxx
+++ b/Source/CPack/cmCPackCygwinSourceGenerator.cxx
@@ -48,21 +48,19 @@ int cmCPackCygwinSourceGenerator::InitializeInternal()
}
//----------------------------------------------------------------------
-int cmCPackCygwinSourceGenerator::CompressFiles(const char* outFileName,
- const char* toplevel, const std::vector<std::string>& files)
+int cmCPackCygwinSourceGenerator::PackageFiles()
{
// Create a tar file of the sources
std::string packageDirFileName
= this->GetOption("CPACK_TEMPORARY_DIRECTORY");
packageDirFileName += ".tar.bz2";
+ packageFileNames[0] = packageDirFileName;
std::string output;
// skip one parent up to the cmCPackTarBZip2Generator
// to create tar.bz2 file with the list of source
// files
- this->Compress = BZIP2;
- if ( !this->cmCPackTarBZip2Generator::
- CompressFiles(packageDirFileName.c_str(),
- toplevel, files) )
+ this->Compress = cmArchiveWrite::CompressBZip2;
+ if ( !this->cmCPackTarBZip2Generator::PackageFiles() )
{
return 0;
}
@@ -135,21 +133,25 @@ int cmCPackCygwinSourceGenerator::CompressFiles(const char* outFileName,
patchFile += "/";
patchFile += cmSystemTools::GetFilenameName(
this->GetOption("CPACK_CYGWIN_PATCH_FILE"));
- std::vector<std::string> outerFiles;
+
std::string file = cmSystemTools::GetFilenameName(compressOutFile);
std::string sourceTar = cmSystemTools::GetFilenamePath(compressOutFile);
sourceTar += "/";
sourceTar += file;
+ /* reset list of file to be packaged */
+ files.clear();
// a source release in cygwin should have the build script used
// to build the package, the patch file that is different from the
// regular upstream version of the sources, and a bziped tar file
// of the original sources
- outerFiles.push_back(buildScript);
- outerFiles.push_back(patchFile);
- outerFiles.push_back(sourceTar);
- if ( !this->cmCPackTarBZip2Generator::
- CompressFiles(outerTarFile.c_str(),
- tmpDir.c_str(), outerFiles) )
+ files.push_back(buildScript);
+ files.push_back(patchFile);
+ files.push_back(sourceTar);
+ /* update the name of the produced package */
+ packageFileNames[0] = outerTarFile;
+ /* update the toplevel dir */
+ toplevel = tmpDir;
+ if ( !this->cmCPackTarBZip2Generator::PackageFiles() )
{
return 0;
}
diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.h b/Source/CPack/cmCPackCygwinSourceGenerator.h
index 9817cf9..9d98a9b 100644
--- a/Source/CPack/cmCPackCygwinSourceGenerator.h
+++ b/Source/CPack/cmCPackCygwinSourceGenerator.h
@@ -31,8 +31,7 @@ public:
protected:
const char* GetPackagingInstallPrefix();
virtual int InitializeInternal();
- int CompressFiles(const char* outFileName, const char* toplevel,
- const std::vector<std::string>& files);
+ int PackageFiles();
virtual const char* GetOutputExtension();
std::string InstallPrefix;
std::string OutputExtension;
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 9c77cc1..ac2e151 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -43,14 +43,15 @@ cmCPackDebGenerator::~cmCPackDebGenerator()
int cmCPackDebGenerator::InitializeInternal()
{
this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr");
-
+ if (cmSystemTools::IsOff(this->GetOption("CPACK_SET_DESTDIR")))
+ {
+ this->SetOption("CPACK_SET_DESTDIR", "I_ON");
+ }
return this->Superclass::InitializeInternal();
}
//----------------------------------------------------------------------
-int cmCPackDebGenerator::CompressFiles(const char* outFileName,
- const char* toplevel,
- const std::vector<std::string>& files)
+int cmCPackDebGenerator::PackageFiles()
{
this->ReadListFile("CPackDeb.cmake");
const char* cmakeExecutable = this->GetOption("CMAKE_COMMAND");
@@ -87,10 +88,12 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName,
// optional entries
const char* debian_pkg_dep = this->GetOption("CPACK_DEBIAN_PACKAGE_DEPENDS");
- const char* debian_pkg_rec =
+ const char* debian_pkg_rec =
this->GetOption("CPACK_DEBIAN_PACKAGE_RECOMMENDS");
- const char* debian_pkg_sug =
+ const char* debian_pkg_sug =
this->GetOption("CPACK_DEBIAN_PACKAGE_SUGGESTS");
+ const char* debian_pkg_url =
+ this->GetOption("CPACK_DEBIAN_PACKAGE_HOMEPAGE");
{ // the scope is needed for cmGeneratedFileStream
cmGeneratedFileStream out(ctlfilename.c_str());
@@ -111,6 +114,10 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName,
{
out << "Suggests: " << debian_pkg_sug << "\n";
}
+ if(debian_pkg_url)
+ {
+ out << "Homepage: " << debian_pkg_url << "\n";
+ }
unsigned long totalSize = 0;
{
std::string dirName = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
@@ -121,7 +128,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName,
totalSize += cmSystemTools::FileLength(fileIt->c_str());
}
}
- out << "Installed-Size: " << totalSize << "\n";
+ out << "Installed-Size: " << (totalSize + 1023) / 1024 << "\n";
out << "Maintainer: " << maintainer << "\n";
out << "Description: " << desc << "\n";
out << std::endl;
@@ -135,7 +142,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName,
// now add all directories which have to be compressed
// collect all top level install dirs for that
// e.g. /opt/bin/foo, /usr/bin/bar and /usr/bin/baz would give /usr and /opt
- int topLevelLength = strlen(toplevel);
+ size_t topLevelLength = toplevel.length();
std::set<std::string> installDirs;
for (std::vector<std::string>::const_iterator fileIt = files.begin();
fileIt != files.end(); ++ fileIt )
@@ -154,7 +161,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName,
std::string output;
int retVal = -1;
int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output,
- &retVal, toplevel, this->GeneratorVerbose, 0);
+ &retVal, toplevel.c_str(), this->GeneratorVerbose, 0);
if ( !res || retVal )
{
@@ -190,7 +197,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName,
//std::string output;
//int retVal = -1;
res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output,
- &retVal, toplevel, this->GeneratorVerbose, 0);
+ &retVal, toplevel.c_str(), this->GeneratorVerbose, 0);
// debian md5sums entries are like this:
// 014f3604694729f3bf19263bac599765 usr/bin/ccmake
// thus strip the full path (with the trailing slash)
@@ -231,7 +238,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName,
}
}
res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output,
- &retVal, toplevel, this->GeneratorVerbose, 0);
+ &retVal, toplevel.c_str(), this->GeneratorVerbose, 0);
if ( !res || retVal )
{
@@ -257,7 +264,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName,
arFiles.push_back(topLevelString + "debian-binary");
arFiles.push_back(topLevelString + "control.tar.gz");
arFiles.push_back(topLevelString + "data.tar.gz");
- res = ar_append(outFileName, arFiles);
+ res = ar_append(packageFileNames[0].c_str(), arFiles);
if ( res!=0 )
{
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
@@ -371,7 +378,7 @@ static const char * ar_rname(const char *path)
typedef struct ar_hdr HDR;
static char ar_hb[sizeof(HDR) + 1]; /* real header */
-static int ar_already_written;
+static size_t ar_already_written;
/* copy_ar --
* Copy size bytes from one file to another - taking care to handle the
@@ -431,7 +438,7 @@ static int put_arobj(CF *cfp, struct stat *sb)
/* If not truncating names and the name is too long or contains
* a space, use extended format 1. */
- unsigned int lname = strlen(name);
+ size_t lname = strlen(name);
uid_t uid = sb->st_uid;
gid_t gid = sb->st_gid;
if (uid > USHRT_MAX) {
@@ -441,7 +448,7 @@ static int put_arobj(CF *cfp, struct stat *sb)
gid = USHRT_MAX;
}
if (lname > sizeof(hdr->ar_name) || strchr(name, ' '))
- (void)sprintf(ar_hb, HDR1, AR_EFMT1, lname,
+ (void)sprintf(ar_hb, HDR1, AR_EFMT1, (int)lname,
(long int)sb->st_mtime, uid, gid, sb->st_mode,
(long long)sb->st_size + lname, ARFMAG);
else {
diff --git a/Source/CPack/cmCPackDebGenerator.h b/Source/CPack/cmCPackDebGenerator.h
index d229944..4a357d1 100644
--- a/Source/CPack/cmCPackDebGenerator.h
+++ b/Source/CPack/cmCPackDebGenerator.h
@@ -33,8 +33,7 @@ public:
protected:
virtual int InitializeInternal();
- virtual int CompressFiles(const char* outFileName, const char* toplevel,
- const std::vector<std::string>& files);
+ virtual int PackageFiles();
virtual const char* GetOutputExtension() { return ".deb"; }
};
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 95324cf..e9ce76c 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -104,12 +104,10 @@ const char* cmCPackDragNDropGenerator::GetOutputExtension()
}
//----------------------------------------------------------------------
-int cmCPackDragNDropGenerator::CompressFiles(const char* outFileName,
- const char* toplevel, const std::vector<std::string>& files)
+int cmCPackDragNDropGenerator::PackageFiles()
{
- (void) files;
- return this->CreateDMG(toplevel, outFileName);
+ return this->CreateDMG();
}
//----------------------------------------------------------------------
@@ -161,8 +159,7 @@ bool cmCPackDragNDropGenerator::RunCommand(cmOStringStream& command,
}
//----------------------------------------------------------------------
-int cmCPackDragNDropGenerator::CreateDMG(const std::string& toplevel,
- const std::string& outFileName)
+int cmCPackDragNDropGenerator::CreateDMG()
{
// Get optional arguments ...
const std::string cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON")
@@ -475,7 +472,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& toplevel,
final_image_command << cpack_dmg_format;
final_image_command << " -imagekey";
final_image_command << " zlib-level=9";
- final_image_command << " -o \"" << outFileName << "\"";
+ final_image_command << " -o \"" << packageFileNames[0] << "\"";
if(!this->RunCommand(final_image_command))
{
diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h
index 43a9617..dcef7fb 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.h
+++ b/Source/CPack/cmCPackDragNDropGenerator.h
@@ -29,14 +29,12 @@ public:
protected:
virtual int InitializeInternal();
virtual const char* GetOutputExtension();
- int CompressFiles(const char* outFileName, const char* toplevel,
- const std::vector<std::string>& files);
+ int PackageFiles();
bool CopyFile(cmOStringStream& source, cmOStringStream& target);
bool RunCommand(cmOStringStream& command, std::string* output = 0);
- virtual int CreateDMG(const std::string& installdir,
- const std::string& outdmg);
+ int CreateDMG();
std::string InstallPrefix;
};
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 4a4b428..c39aea4 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -100,6 +100,7 @@ int cmCPackGenerator::PrepareNames()
}
std::string destFile = pdir;
+ this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_PREFIX", destFile.c_str());
destFile += "/" + outName;
std::string outFile = topDirectory + "/" + outName;
this->SetOptionIfNotSet("CPACK_TOPLEVEL_DIRECTORY", topDirectory.c_str());
@@ -170,7 +171,9 @@ int cmCPackGenerator::InstallProject()
std::string bareTempInstallDirectory
= this->GetOption("CPACK_TEMPORARY_INSTALL_DIRECTORY");
std::string tempInstallDirectoryStr = bareTempInstallDirectory;
- bool setDestDir = cmSystemTools::IsOn(this->GetOption("CPACK_SET_DESTDIR"));
+ bool setDestDir = cmSystemTools::IsOn(this->GetOption("CPACK_SET_DESTDIR"))
+ | cmSystemTools::IsInternallyOn(
+ this->GetOption("CPACK_SET_DESTDIR"));
if (!setDestDir)
{
tempInstallDirectoryStr += this->GetPackagingInstallPrefix();
@@ -328,15 +331,16 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
it != installDirectoriesVector.end();
++it )
{
+ std::list<std::pair<std::string,std::string> > symlinkedFiles;
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Find files" << std::endl);
cmsys::Glob gl;
- std::string toplevel = it->c_str();
+ std::string top = it->c_str();
it ++;
std::string subdir = it->c_str();
- std::string findExpr = toplevel;
+ std::string findExpr = top;
findExpr += "/*";
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
- "- Install directory: " << toplevel << std::endl);
+ "- Install directory: " << top << std::endl);
gl.RecurseOn();
if ( !gl.FindFiles(findExpr) )
{
@@ -344,7 +348,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
"Cannot find any files in the installed directory" << std::endl);
return 0;
}
- std::vector<std::string>& files = gl.GetFiles();
+ files = gl.GetFiles();
std::vector<std::string>::iterator gfit;
std::vector<cmsys::RegularExpression>::iterator regIt;
for ( gfit = files.begin(); gfit != files.end(); ++ gfit )
@@ -368,10 +372,21 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
}
std::string filePath = tempDir;
filePath += "/" + subdir + "/"
- + cmSystemTools::RelativePath(toplevel.c_str(), gfit->c_str());
+ + cmSystemTools::RelativePath(top.c_str(), gfit->c_str());
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy file: "
<< inFile.c_str() << " -> " << filePath.c_str() << std::endl);
- if ( !cmSystemTools::CopyFileIfDifferent(inFile.c_str(),
+ /* If the file is a symlink we will have to re-create it */
+ if ( cmSystemTools::FileIsSymlink(inFile.c_str()))
+ {
+ std::string targetFile;
+ std::string inFileRelative =
+ cmSystemTools::RelativePath(top.c_str(),inFile.c_str());
+ cmSystemTools::ReadSymlink(inFile.c_str(),targetFile);
+ symlinkedFiles.push_back(std::pair<std::string,
+ std::string>(targetFile,inFileRelative));
+ }
+ /* If it is not a symlink then do a plain copy */
+ else if ( !cmSystemTools::CopyFileIfDifferent(inFile.c_str(),
filePath.c_str()) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying file: "
@@ -379,6 +394,36 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
return 0;
}
}
+ /* rebuild symlinks in the installed tree */
+ if (symlinkedFiles.size()>0)
+ {
+ std::list< std::pair<std::string,std::string> >::iterator symlinkedIt;
+ std::string curDir = cmSystemTools::GetCurrentWorkingDirectory();
+ std::string goToDir = tempDir;
+ goToDir += "/"+subdir;
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ "Change dir to: " << goToDir <<std::endl);
+ cmSystemTools::ChangeDirectory(goToDir.c_str());
+ for (symlinkedIt=symlinkedFiles.begin();
+ symlinkedIt != symlinkedFiles.end();
+ ++symlinkedIt)
+ {
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Will create a symlink: "
+ << symlinkedIt->second << "--> "
+ << symlinkedIt->first << std::endl);
+ if (!cmSystemTools::CreateSymlink((symlinkedIt->first).c_str(),
+ (symlinkedIt->second).c_str()))
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create symlink: "
+ << symlinkedIt->second << "--> "
+ << symlinkedIt->first << std::endl);
+ return 0;
+ }
+ }
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Going back to: "
+ << curDir <<std::endl);
+ cmSystemTools::ChangeDirectory(curDir.c_str());
+ }
}
}
return 1;
@@ -413,7 +458,8 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
// underneath the tempInstallDirectory. The value of the project's
// CMAKE_INSTALL_PREFIX is sent in here as the value of the
// CPACK_INSTALL_PREFIX variable.
- std::string dir;
+
+ std::string dir;
if (this->GetOption("CPACK_INSTALL_PREFIX"))
{
dir += this->GetOption("CPACK_INSTALL_PREFIX");
@@ -458,6 +504,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
= this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS");
const char* cmakeGenerator
= this->GetOption("CPACK_CMAKE_GENERATOR");
+ std::string absoluteDestFiles;
if ( cmakeProjects && *cmakeProjects )
{
if ( !cmakeGenerator )
@@ -642,6 +689,18 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// value of the project's CMAKE_INSTALL_PREFIX is sent in here as
// the value of the CPACK_INSTALL_PREFIX variable.
//
+ // If DESTDIR has been 'internally set ON' this means that
+ // the underlying CPack specific generator did ask for that
+ // In this case we may overrode CPACK_INSTALL_PREFIX with
+ // CPACK_PACKAGING_INSTALL_PREFIX
+ // I know this is tricky and awkward but it's the price for
+ // CPACK_SET_DESTDIR backward compatibility.
+ if (cmSystemTools::IsInternallyOn(
+ this->GetOption("CPACK_SET_DESTDIR")))
+ {
+ this->SetOption("CPACK_INSTALL_PREFIX",
+ this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX"));
+ }
std::string dir;
if (this->GetOption("CPACK_INSTALL_PREFIX"))
{
@@ -722,6 +781,16 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
mf->AddDefinition("CMAKE_INSTALL_DO_STRIP", "1");
}
int res = mf->ReadListFile(0, installFile.c_str());
+ if (NULL !=mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) {
+ if (absoluteDestFiles.length()>0) {
+ absoluteDestFiles +=";";
+ }
+ absoluteDestFiles +=
+ mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES");
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ "Got some ABSOLUTE DESTINATION FILES: "
+ << absoluteDestFiles << std::endl);
+ }
if ( cmSystemTools::GetErrorOccuredFlag() || !res )
{
return 0;
@@ -729,6 +798,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
}
}
}
+ this->SetOption("CPACK_ABSOLUTE_DESTINATION_FILES",
+ absoluteDestFiles.c_str());
return 1;
}
@@ -827,8 +898,8 @@ int cmCPackGenerator::DoPackage()
return 0;
}
- cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Compress package" << std::endl);
- cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Compress files to: "
+ cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Create package" << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Package files to: "
<< (tempPackageFileName ? tempPackageFileName : "(NULL)") << std::endl);
if ( cmSystemTools::FileExists(tempPackageFileName) )
{
@@ -843,7 +914,7 @@ int cmCPackGenerator::DoPackage()
}
// The files to be installed
- std::vector<std::string> files = gl.GetFiles();
+ files = gl.GetFiles();
// For component installations, determine which files go into which
// components.
@@ -852,8 +923,12 @@ int cmCPackGenerator::DoPackage()
std::vector<std::string>::const_iterator it;
for ( it = files.begin(); it != files.end(); ++ it )
{
- std::string fileN = cmSystemTools::RelativePath(tempDirectory,
- it->c_str());
+ // beware we cannot just use tempDirectory as before
+ // because some generator will "CPACK_INCLUDE_TOPLEVEL_DIRECTORY"
+ // we really want "CPACK_TEMPORARY_DIRECTORY"
+ std::string fileN =
+ cmSystemTools::RelativePath(
+ this->GetOption("CPACK_TEMPORARY_DIRECTORY"), it->c_str());
// Determine which component we are in.
std::string componentName = fileN.substr(0, fileN.find('/'));
@@ -863,37 +938,65 @@ int cmCPackGenerator::DoPackage()
// Add this file to the list of files for the component.
this->Components[componentName].Files.push_back(fileN);
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file <"
+ <<fileN<<"> to component <"
+ <<componentName<<">"<<std::endl);
}
}
- if ( !this->CompressFiles(tempPackageFileName,
- tempDirectory, files) || cmSystemTools::GetErrorOccuredFlag())
+
+ packageFileNames.clear();
+ /* Put at least one file name into the list of
+ * wanted packageFileNames. The specific generator
+ * may update this during PackageFiles.
+ * (either putting several names or updating the provided one)
+ */
+ packageFileNames.push_back(tempPackageFileName);
+ toplevel = tempDirectory;
+ if ( !this->PackageFiles() || cmSystemTools::GetErrorOccuredFlag())
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem compressing the directory"
<< std::endl);
return 0;
}
- cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Finalize package" << std::endl);
- cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Copy final package: "
- << (tempPackageFileName ? tempPackageFileName : "(NULL)" )
- << " to "
- << (packageFileName ? packageFileName : "(NULL)")
- << std::endl);
- if ( !cmSystemTools::CopyFileIfDifferent(tempPackageFileName,
- packageFileName) )
+ /*
+ * Copy the generated packages to final destination
+ * - there may be several of them
+ * - the initially provided name may have changed
+ * (because the specific generator did 'normalize' it)
+ */
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Copying final package(s) ["
+ <<packageFileNames.size()
+ <<"]:"<<std::endl);
+ std::vector<std::string>::iterator it;
+ /* now copy package one by one */
+ for (it=packageFileNames.begin();it!=packageFileNames.end();++it)
{
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the package: "
- << (tempPackageFileName ? tempPackageFileName : "(NULL)" )
- << " to "
- << (packageFileName ? packageFileName : "(NULL)")
- << std::endl);
- return 0;
+ std::string tmpPF(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"));
+ tempPackageFileName = it->c_str();
+ tmpPF += "/"+cmSystemTools::GetFilenameName(*it);
+ packageFileName = tmpPF.c_str();
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy final package(s): "
+ << (tempPackageFileName ? tempPackageFileName : "(NULL)" )
+ << " to "
+ << (packageFileName ? packageFileName : "(NULL)")
+ << std::endl);
+ if ( !cmSystemTools::CopyFileIfDifferent(tempPackageFileName,
+ packageFileName) )
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the package: "
+ << (tempPackageFileName ? tempPackageFileName : "(NULL)" )
+ << " to "
+ << (packageFileName ? packageFileName : "(NULL)")
+ << std::endl);
+ return 0;
+ }
+ cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- package: "
+ << packageFileName
+ << " generated." << std::endl);
}
- cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Package "
- << (packageFileName ? packageFileName : "(NULL)")
- << " generated." << std::endl);
return 1;
}
@@ -984,12 +1087,8 @@ int cmCPackGenerator::SetCMakeRoot()
}
//----------------------------------------------------------------------
-int cmCPackGenerator::CompressFiles(const char* outFileName,
- const char* toplevel, const std::vector<std::string>& files)
+int cmCPackGenerator::PackageFiles()
{
- (void)outFileName;
- (void)toplevel;
- (void)files;
return 0;
}
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index 45188fe..74b780d 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -55,13 +55,22 @@ class cmCPackGenerator : public cmObject
public:
cmTypeMacro(cmCPackGenerator, cmObject);
/**
- * If verbose then more informaiton is printed out
+ * If verbose then more information is printed out
*/
void SetVerbose(bool val) { this->GeneratorVerbose = val; }
/**
- * Do the actual processing. Subclass has to override it.
- * Return 0 if error.
+ * Do the actual whole package processing.
+ * Subclass may redefine it but its usually enough
+ * to redefine @ref PackageFiles, because in fact
+ * this method do call:
+ * - PrepareName
+ * - clean-up temp dirs
+ * - InstallProject (with the appropriate method)
+ * - prepare list of files and/or components to be package
+ * - PackageFiles
+ * - Copy produced packages at the expected place
+ * @return 0 if error.
*/
virtual int DoPackage();
@@ -94,13 +103,32 @@ public:
bool ReadListFile(const char* moduleName);
protected:
+ /**
+ * Prepare common used names by inspecting
+ * several CPACK_xxx var values.
+ */
int PrepareNames();
+
+ /**
+ * Install the project using appropriate method.
+ */
int InstallProject();
+
int CleanTemporaryDirectory();
+
virtual const char* GetOutputExtension() { return ".cpack"; }
virtual const char* GetOutputPostfix() { return 0; }
- virtual int CompressFiles(const char* outFileName, const char* toplevel,
- const std::vector<std::string>& files);
+
+ /**
+ * Package the list of files and/or components which
+ * has been prepared by the beginning of DoPackage.
+ * @pre @ref toplevel has been filled-in
+ * @pre the list of file @ref files has been populated
+ * @pre packageFileNames contains at least 1 entry
+ * @post packageFileNames may have been updated and contains
+ * the list of packages generated by the specific generator.
+ */
+ virtual int PackageFiles();
virtual const char* GetInstallPath();
virtual const char* GetPackagingInstallPrefix();
@@ -134,11 +162,42 @@ protected:
std::string InstallPath;
+ /**
+ * The list of package file names.
+ * At beginning of DoPackage the (generic) generator will populate
+ * the list of desired package file names then it will
+ * call the redefined method PackageFiles which is may
+ * either use this set of names (usually on entry there should be
+ * only a single name) or update the vector with the list
+ * of created package file names.
+ */
+ std::vector<std::string> packageFileNames;
+
+ /**
+ * The directory where all the files to be packaged reside.
+ * If the installer support components there will be one
+ * sub-directory for each component. In those directories
+ * one will find the file belonging to the specified component.
+ */
+ std::string toplevel;
+
+ /**
+ * The complete list of files to be packaged.
+ * This list will be populated by DoPackage before
+ * PackageFiles is called.
+ */
+ std::vector<std::string> files;
+
std::string CPackSelf;
std::string CMakeSelf;
std::string CMakeRoot;
std::map<std::string, cmCPackInstallationType> InstallationTypes;
+ /**
+ * The set of components.
+ * If component installation is supported then this map
+ * contains the component specified in CPACK_COMPONENTS_ALL
+ */
std::map<std::string, cmCPackComponent> Components;
std::map<std::string, cmCPackComponentGroup> ComponentGroups;
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index ad77386..d0eda81 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -43,11 +43,10 @@ cmCPackNSISGenerator::~cmCPackNSISGenerator()
}
//----------------------------------------------------------------------
-int cmCPackNSISGenerator::CompressFiles(const char* outFileName,
- const char* toplevel, const std::vector<std::string>& files)
+int cmCPackNSISGenerator::PackageFiles()
{
- (void)outFileName; // TODO: Fix nsis to force out file name
- (void)toplevel;
+ // TODO: Fix nsis to force out file name
+
std::string nsisInFileName = this->FindTemplate("NSIS.template.in");
if ( nsisInFileName.size() == 0 )
{
@@ -74,7 +73,7 @@ int cmCPackNSISGenerator::CompressFiles(const char* outFileName,
std::vector<std::string>::const_iterator it;
for ( it = files.begin(); it != files.end(); ++ it )
{
- std::string fileN = cmSystemTools::RelativePath(toplevel,
+ std::string fileN = cmSystemTools::RelativePath(toplevel.c_str(),
it->c_str());
if (!this->Components.empty())
{
@@ -88,13 +87,14 @@ int cmCPackNSISGenerator::CompressFiles(const char* outFileName,
<< str.str().c_str() << std::endl);
this->SetOptionIfNotSet("CPACK_NSIS_DELETE_FILES", str.str().c_str());
std::vector<std::string> dirs;
- this->GetListOfSubdirectories(toplevel, dirs);
+ this->GetListOfSubdirectories(toplevel.c_str(), dirs);
std::vector<std::string>::const_iterator sit;
cmOStringStream dstr;
for ( sit = dirs.begin(); sit != dirs.end(); ++ sit )
{
std::string componentName;
- std::string fileN = cmSystemTools::RelativePath(toplevel, sit->c_str());
+ std::string fileN = cmSystemTools::RelativePath(toplevel.c_str(),
+ sit->c_str());
if ( fileN.empty() )
{
continue;
@@ -758,7 +758,7 @@ CreateComponentDescription(cmCPackComponent *component,
}
// Create the NSIS code to download this file on-the-fly.
- unsigned totalSizeInKbytes = (totalSize + 512) / 1024;
+ unsigned long totalSizeInKbytes = (totalSize + 512) / 1024;
if (totalSizeInKbytes == 0)
{
totalSizeInKbytes = 1;
diff --git a/Source/CPack/cmCPackNSISGenerator.h b/Source/CPack/cmCPackNSISGenerator.h
index dff5b8f..6ad103f 100644
--- a/Source/CPack/cmCPackNSISGenerator.h
+++ b/Source/CPack/cmCPackNSISGenerator.h
@@ -37,8 +37,7 @@ protected:
virtual int InitializeInternal();
void CreateMenuLinks( cmOStringStream& str,
cmOStringStream& deleteStr);
- int CompressFiles(const char* outFileName, const char* toplevel,
- const std::vector<std::string>& files);
+ int PackageFiles();
virtual const char* GetOutputExtension() { return ".exe"; }
virtual const char* GetOutputPostfix() { return "win32"; }
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index a3b5759..2d4bb97 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -33,12 +33,10 @@ cmCPackOSXX11Generator::~cmCPackOSXX11Generator()
}
//----------------------------------------------------------------------
-int cmCPackOSXX11Generator::CompressFiles(const char* outFileName,
- const char* toplevel,
- const std::vector<std::string>& files)
+int cmCPackOSXX11Generator::PackageFiles()
{
- (void) files; // TODO: Fix api to not need files.
- (void) toplevel; // TODO: Use toplevel
+ // TODO: Use toplevel ?
+ // It is used! Is this an obsolete comment?
const char* cpackPackageExecutables
= this->GetOption("CPACK_PACKAGE_EXECUTABLES");
@@ -144,7 +142,7 @@ int cmCPackOSXX11Generator::CompressFiles(const char* outFileName,
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE")
<< "\" create -ov -format UDZO -srcfolder \""
<< diskImageDirectory.c_str()
- << "\" \"" << outFileName << "\"";
+ << "\" \"" << packageFileNames[0] << "\"";
int retVal = 1;
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Compress disk image using command: "
diff --git a/Source/CPack/cmCPackOSXX11Generator.h b/Source/CPack/cmCPackOSXX11Generator.h
index 7fd60b4..b7bd243 100644
--- a/Source/CPack/cmCPackOSXX11Generator.h
+++ b/Source/CPack/cmCPackOSXX11Generator.h
@@ -33,8 +33,7 @@ public:
protected:
virtual int InitializeInternal();
- int CompressFiles(const char* outFileName, const char* toplevel,
- const std::vector<std::string>& files);
+ int PackageFiles();
virtual const char* GetPackagingInstallPrefix();
virtual const char* GetOutputExtension() { return ".dmg"; }
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index 9333131..ef81da8 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -59,12 +59,10 @@ int cmCPackPackageMakerGenerator::CopyInstallScript(const char* resdir,
}
//----------------------------------------------------------------------
-int cmCPackPackageMakerGenerator::CompressFiles(const char* outFileName,
- const char* toplevel,
- const std::vector<std::string>& files)
+int cmCPackPackageMakerGenerator::PackageFiles()
{
- (void) files; // TODO: Fix api to not need files.
- (void) toplevel; // TODO: Use toplevel
+ // TODO: Use toplevel
+ // It is used! Is this an obsolete comment?
std::string resDir; // Where this package's resources will go.
std::string packageDirFileName
@@ -318,7 +316,7 @@ int cmCPackPackageMakerGenerator::CompressFiles(const char* outFileName,
cmOStringStream dmgCmd;
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE")
<< "\" create -ov -format UDZO -srcfolder \"" << packageDirFileName
- << "\" \"" << outFileName << "\"";
+ << "\" \"" << packageFileNames[0] << "\"";
std::string output;
int retVal = 1;
int numTries = 4;
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h
index 36cd594..2bab947 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.h
+++ b/Source/CPack/cmCPackPackageMakerGenerator.h
@@ -42,8 +42,7 @@ protected:
const char* script,
const char* name);
virtual int InitializeInternal();
- int CompressFiles(const char* outFileName, const char* toplevel,
- const std::vector<std::string>& files);
+ int PackageFiles();
virtual const char* GetOutputExtension() { return ".dmg"; }
virtual const char* GetOutputPostfix() { return "darwin"; }
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index fb85581..0641418 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -11,6 +11,7 @@
============================================================================*/
#include "cmCPackRPMGenerator.h"
#include "cmCPackLog.h"
+#include "cmSystemTools.h"
//----------------------------------------------------------------------
cmCPackRPMGenerator::cmCPackRPMGenerator()
@@ -26,14 +27,15 @@ cmCPackRPMGenerator::~cmCPackRPMGenerator()
int cmCPackRPMGenerator::InitializeInternal()
{
this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr");
-
+ if (cmSystemTools::IsOff(this->GetOption("CPACK_SET_DESTDIR")))
+ {
+ this->SetOption("CPACK_SET_DESTDIR", "I_ON");
+ }
return this->Superclass::InitializeInternal();
}
//----------------------------------------------------------------------
-int cmCPackRPMGenerator::CompressFiles(const char* /*outFileName*/,
- const char* /*toplevel*/,
- const std::vector<std::string>& /*files*/)
+int cmCPackRPMGenerator::PackageFiles()
{
this->ReadListFile("CPackRPM.cmake");
if (!this->IsSet("RPMBUILD_EXECUTABLE"))
diff --git a/Source/CPack/cmCPackRPMGenerator.h b/Source/CPack/cmCPackRPMGenerator.h
index c607f35..570e45f 100644
--- a/Source/CPack/cmCPackRPMGenerator.h
+++ b/Source/CPack/cmCPackRPMGenerator.h
@@ -37,8 +37,7 @@ public:
protected:
virtual int InitializeInternal();
- virtual int CompressFiles(const char* outFileName, const char* toplevel,
- const std::vector<std::string>& files);
+ virtual int PackageFiles();
virtual const char* GetOutputExtension() { return ".rpm"; }
};
diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx
index a687e0d..184c557 100644
--- a/Source/CPack/cmCPackSTGZGenerator.cxx
+++ b/Source/CPack/cmCPackSTGZGenerator.cxx
@@ -52,14 +52,13 @@ int cmCPackSTGZGenerator::InitializeInternal()
}
//----------------------------------------------------------------------
-int cmCPackSTGZGenerator::CompressFiles(const char* outFileName,
- const char* toplevel, const std::vector<std::string>& files)
+int cmCPackSTGZGenerator::PackageFiles()
{
- if ( !this->Superclass::CompressFiles(outFileName, toplevel, files) )
+ if ( !this->Superclass::PackageFiles() )
{
return 0;
}
- return cmSystemTools::SetPermissions(outFileName,
+ return cmSystemTools::SetPermissions(packageFileNames[0].c_str(),
#if defined( _MSC_VER ) || defined( __MINGW32__ )
S_IREAD | S_IWRITE | S_IEXEC
#elif defined( __BORLANDC__ )
diff --git a/Source/CPack/cmCPackSTGZGenerator.h b/Source/CPack/cmCPackSTGZGenerator.h
index fc51e4d..ccceec8 100644
--- a/Source/CPack/cmCPackSTGZGenerator.h
+++ b/Source/CPack/cmCPackSTGZGenerator.h
@@ -32,8 +32,7 @@ public:
virtual ~cmCPackSTGZGenerator();
protected:
- int CompressFiles(const char* outFileName, const char* toplevel,
- const std::vector<std::string>& files);
+ int PackageFiles();
virtual int InitializeInternal();
int GenerateHeader(std::ostream* os);
virtual const char* GetOutputExtension() { return ".sh"; }
diff --git a/Source/CPack/cmCPackTGZGenerator.cxx b/Source/CPack/cmCPackTGZGenerator.cxx
index c6ef8ae..509c7f8 100644
--- a/Source/CPack/cmCPackTGZGenerator.cxx
+++ b/Source/CPack/cmCPackTGZGenerator.cxx
@@ -14,8 +14,8 @@
//----------------------------------------------------------------------
cmCPackTGZGenerator::cmCPackTGZGenerator()
- :cmCPackArchiveGenerator(cmCPackArchiveGenerator::GZIP,
- cmCPackArchiveGenerator::TAR)
+ :cmCPackArchiveGenerator(cmArchiveWrite::CompressGZip,
+ cmArchiveWrite::TypeTAR)
{
}
diff --git a/Source/CPack/cmCPackTarBZip2Generator.cxx b/Source/CPack/cmCPackTarBZip2Generator.cxx
index 52826dc..971d166 100644
--- a/Source/CPack/cmCPackTarBZip2Generator.cxx
+++ b/Source/CPack/cmCPackTarBZip2Generator.cxx
@@ -13,8 +13,8 @@
#include "cmCPackTarBZip2Generator.h"
//----------------------------------------------------------------------
cmCPackTarBZip2Generator::cmCPackTarBZip2Generator()
- :cmCPackArchiveGenerator(cmCPackArchiveGenerator::BZIP2,
- cmCPackArchiveGenerator::TAR)
+ :cmCPackArchiveGenerator(cmArchiveWrite::CompressBZip2,
+ cmArchiveWrite::TypeTAR)
{
}
diff --git a/Source/CPack/cmCPackTarCompressGenerator.cxx b/Source/CPack/cmCPackTarCompressGenerator.cxx
index e9b5e2e..7a8f697 100644
--- a/Source/CPack/cmCPackTarCompressGenerator.cxx
+++ b/Source/CPack/cmCPackTarCompressGenerator.cxx
@@ -14,8 +14,8 @@
//----------------------------------------------------------------------
cmCPackTarCompressGenerator::cmCPackTarCompressGenerator()
- :cmCPackArchiveGenerator(cmCPackArchiveGenerator::COMPRESS,
- cmCPackArchiveGenerator::TAR)
+ :cmCPackArchiveGenerator(cmArchiveWrite::CompressCompress,
+ cmArchiveWrite::TypeTAR)
{
}
diff --git a/Source/CPack/cmCPackZIPGenerator.cxx b/Source/CPack/cmCPackZIPGenerator.cxx
index e195f83..e6e4e77 100644
--- a/Source/CPack/cmCPackZIPGenerator.cxx
+++ b/Source/CPack/cmCPackZIPGenerator.cxx
@@ -14,8 +14,8 @@
//----------------------------------------------------------------------
cmCPackZIPGenerator::cmCPackZIPGenerator()
- :cmCPackArchiveGenerator(cmCPackArchiveGenerator::NONE,
- cmCPackArchiveGenerator::ZIP)
+ :cmCPackArchiveGenerator(cmArchiveWrite::CompressNone,
+ cmArchiveWrite::TypeZIP)
{
}
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 243d9c9..9163af81 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -203,7 +203,7 @@ int main (int argc, char *argv[])
if ( verbose )
{
log.SetVerbose(verbose);
- cmCPack_Log(&log, cmCPackLog::LOG_OUTPUT, "Enable Verbse" << std::endl);
+ cmCPack_Log(&log, cmCPackLog::LOG_OUTPUT, "Enable Verbose" << std::endl);
}
if ( debug )
{
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index bc02fbc..3c5993d 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -65,7 +65,7 @@ static const char* cmCTestErrorMatches[] = {
"^Unresolved:",
"Undefined symbols:",
"^Undefined[ \\t]+first referenced",
- "^CMake Error:",
+ "^CMake Error.*:",
":[ \\t]cannot find",
":[ \\t]can't find",
": \\*\\*\\* No rule to make target \\`.*\\'. Stop",
@@ -129,6 +129,7 @@ static const char* cmCTestWarningMatches[] = {
"\\([0-9]*\\): remark #[0-9]*",
"\".*\", line [0-9]+: remark\\([0-9]*\\):",
"cc-[0-9]* CC: REMARK File = .*, Line = [0-9]*",
+ "^CMake Warning.*:",
0
};
@@ -174,8 +175,8 @@ cmCTestWarningErrorFileLine[] = {
//----------------------------------------------------------------------
cmCTestBuildHandler::cmCTestBuildHandler()
{
- this->MaxPreContext = 6;
- this->MaxPostContext = 6;
+ this->MaxPreContext = 10;
+ this->MaxPostContext = 10;
this->MaxErrors = 50;
this->MaxWarnings = 50;
@@ -214,8 +215,8 @@ void cmCTestBuildHandler::Initialize()
this->ErrorsAndWarnings.clear();
this->LastErrorOrWarning = this->ErrorsAndWarnings.end();
this->PostContextCount = 0;
- this->MaxPreContext = 6;
- this->MaxPostContext = 6;
+ this->MaxPreContext = 10;
+ this->MaxPostContext = 10;
this->PreContext.clear();
this->TotalErrors = 0;
@@ -249,6 +250,20 @@ void cmCTestBuildHandler::PopulateCustomVectors(cmMakefile *mf)
"CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS",
this->MaxWarnings);
+ int n = -1;
+ this->CTest->PopulateCustomInteger(mf, "CTEST_CUSTOM_ERROR_PRE_CONTEXT", n);
+ if (n != -1)
+ {
+ this->MaxPreContext = static_cast<size_t>(n);
+ }
+
+ n = -1;
+ this->CTest->PopulateCustomInteger(mf, "CTEST_CUSTOM_ERROR_POST_CONTEXT", n);
+ if (n != -1)
+ {
+ this->MaxPostContext = static_cast<size_t>(n);
+ }
+
// Record the user-specified custom warning rules.
if(const char* customWarningMatchers =
mf->GetDefinition("CTEST_CUSTOM_WARNING_MATCH"))
@@ -959,7 +974,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
this->ProcessBuffer(0, 0, tick, tick_len, ofs,
&this->BuildProcessingErrorQueue);
cmCTestLog(this->CTest, OUTPUT, " Size of output: "
- << int(this->BuildOutputLogSize / 1024.0) << "K" << std::endl);
+ << ((this->BuildOutputLogSize + 512) / 1024) << "K" << std::endl);
// Properly handle output of the build command
cmsysProcess_WaitForExit(cp, 0);
@@ -1171,7 +1186,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
if ( tick % tick_line_len == 0 && tick > 0 )
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Size: "
- << int((this->BuildOutputLogSize / 1024.0) + 1) << "K" << std::endl
+ << ((this->BuildOutputLogSize + 512) / 1024) << "K" << std::endl
<< " ");
}
}
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 55a5225..6863adc 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -429,7 +429,7 @@ int cmCTestCoverageHandler::ProcessHandler()
//std::string fullBinaryDir = binaryDir + "/";
cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl);
cmCTestLog(this->CTest, HANDLER_OUTPUT,
- " Acumulating results (each . represents one file):" << std::endl);
+ " Accumulating results (each . represents one file):" << std::endl);
cmCTestLog(this->CTest, HANDLER_OUTPUT, " ");
std::vector<std::string> errorsWhileAccumulating;
@@ -508,7 +508,7 @@ int cmCTestCoverageHandler::ProcessHandler()
cmCTestCoverageHandlerContainer::SingleFileCoverageVector::size_type cc;
std::string line;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Actually perfoming coverage for: " << fullFileName << std::endl);
+ "Actually performing coverage for: " << fullFileName << std::endl);
for ( cc= 0; cc < fcov.size(); cc ++ )
{
if ( !cmSystemTools::GetLineFromStream(ifs, line) &&
@@ -593,7 +593,7 @@ int cmCTestCoverageHandler::ProcessHandler()
int untested = 0;
std::string line;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Actually perfoming coverage for: " << i->c_str() << std::endl);
+ "Actually performing coverage for: " << i->c_str() << std::endl);
while (cmSystemTools::GetLineFromStream(ifs, line))
{
covLogFile << "\t\t<Line Number=\"" << untested << "\" Count=\"0\">"
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index a49c852..a6f10ec 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -85,6 +85,75 @@ void cmCTestGIT::NoteNewRevision()
}
//----------------------------------------------------------------------------
+std::string cmCTestGIT::FindGitDir()
+{
+ std::string git_dir;
+
+ // Run "git rev-parse --git-dir" to locate the real .git directory.
+ const char* git = this->CommandLineTool.c_str();
+ char const* git_rev_parse[] = {git, "rev-parse", "--git-dir", 0};
+ std::string git_dir_line;
+ OneLineParser rev_parse_out(this, "rev-parse-out> ", git_dir_line);
+ OutputLogger rev_parse_err(this->Log, "rev-parse-err> ");
+ if(this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err))
+ {
+ git_dir = git_dir_line;
+ }
+ if(git_dir.empty())
+ {
+ git_dir = ".git";
+ }
+
+ // Git reports a relative path only when the .git directory is in
+ // the current directory.
+ if(git_dir[0] == '.')
+ {
+ git_dir = this->SourceDirectory + "/" + git_dir;
+ }
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ else if(git_dir[0] == '/')
+ {
+ // Cygwin Git reports a full path that Cygwin understands, but we
+ // are a Windows application. Run "cygpath" to get Windows path.
+ std::string cygpath_exe = cmSystemTools::GetFilenamePath(git);
+ cygpath_exe += "/cygpath.exe";
+ if(cmSystemTools::FileExists(cygpath_exe.c_str()))
+ {
+ char const* cygpath[] = {cygpath_exe.c_str(), "-w", git_dir.c_str(), 0};
+ OneLineParser cygpath_out(this, "cygpath-out> ", git_dir_line);
+ OutputLogger cygpath_err(this->Log, "cygpath-err> ");
+ if(this->RunChild(cygpath, &cygpath_out, &cygpath_err))
+ {
+ git_dir = git_dir_line;
+ }
+ }
+ }
+#endif
+ return git_dir;
+}
+
+//----------------------------------------------------------------------------
+std::string cmCTestGIT::FindTopDir()
+{
+ std::string top_dir = this->SourceDirectory;
+
+ // Run "git rev-parse --show-cdup" to locate the top of the tree.
+ const char* git = this->CommandLineTool.c_str();
+ char const* git_rev_parse[] = {git, "rev-parse", "--show-cdup", 0};
+ std::string cdup;
+ OneLineParser rev_parse_out(this, "rev-parse-out> ", cdup);
+ OutputLogger rev_parse_err(this->Log, "rev-parse-err> ");
+ if(this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err) &&
+ !cdup.empty())
+ {
+ top_dir += "/";
+ top_dir += cdup;
+ top_dir = cmSystemTools::CollapseFullPath(top_dir.c_str());
+ }
+ return top_dir;
+}
+
+//----------------------------------------------------------------------------
bool cmCTestGIT::UpdateByFetchAndReset()
{
const char* git = this->CommandLineTool.c_str();
@@ -121,11 +190,17 @@ bool cmCTestGIT::UpdateByFetchAndReset()
// Identify the merge head that would be used by "git pull".
std::string sha1;
{
- std::string fetch_head = this->SourceDirectory + "/.git/FETCH_HEAD";
+ std::string fetch_head = this->FindGitDir() + "/FETCH_HEAD";
std::ifstream fin(fetch_head.c_str(), std::ios::in | std::ios::binary);
+ if(!fin)
+ {
+ this->Log << "Unable to open " << fetch_head << "\n";
+ return false;
+ }
std::string line;
while(sha1.empty() && cmSystemTools::GetLineFromStream(fin, line))
{
+ this->Log << "FETCH_HEAD> " << line << "\n";
if(line.find("\tnot-for-merge\t") == line.npos)
{
std::string::size_type pos = line.find('\t');
@@ -135,6 +210,11 @@ bool cmCTestGIT::UpdateByFetchAndReset()
}
}
}
+ if(sha1.empty())
+ {
+ this->Log << "FETCH_HEAD has no upstream branch candidate!\n";
+ return false;
+ }
}
// Reset the local branch to point at that tracked from upstream.
@@ -181,11 +261,13 @@ bool cmCTestGIT::UpdateImpl()
return false;
}
+ std::string top_dir = this->FindTopDir();
const char* git = this->CommandLineTool.c_str();
char const* git_submodule[] = {git, "submodule", "update", 0};
OutputLogger submodule_out(this->Log, "submodule-out> ");
OutputLogger submodule_err(this->Log, "submodule-err> ");
- return this->RunChild(git_submodule, &submodule_out, &submodule_err);
+ return this->RunChild(git_submodule, &submodule_out, &submodule_err,
+ top_dir.c_str());
}
//----------------------------------------------------------------------------
diff --git a/Source/CTest/cmCTestGIT.h b/Source/CTest/cmCTestGIT.h
index d8681fe..1765340 100644
--- a/Source/CTest/cmCTestGIT.h
+++ b/Source/CTest/cmCTestGIT.h
@@ -32,6 +32,9 @@ private:
virtual void NoteNewRevision();
virtual bool UpdateImpl();
+ std::string FindGitDir();
+ std::string FindTopDir();
+
bool UpdateByFetchAndReset();
bool UpdateByCustom(std::string const& custom);
bool UpdateInternal();
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 0d15ddc..13a25cb 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -201,8 +201,7 @@ void cmCTestMemCheckHandler::Initialize()
this->CustomMaximumPassedTestOutputSize = 0;
this->CustomMaximumFailedTestOutputSize = 0;
this->MemoryTester = "";
- this->MemoryTesterOptionsParsed.clear();
- this->MemoryTesterOptions = "";
+ this->MemoryTesterOptions.clear();
this->MemoryTesterStyle = UNKNOWN;
this->MemoryTesterOutputFile = "";
int cc;
@@ -249,12 +248,12 @@ void cmCTestMemCheckHandler::GenerateTestCommand(
std::vector<cmStdString>::size_type pp;
std::string memcheckcommand = "";
memcheckcommand = this->MemoryTester;
- for ( pp = 0; pp < this->MemoryTesterOptionsParsed.size(); pp ++ )
+ for ( pp = 0; pp < this->MemoryTesterOptions.size(); pp ++ )
{
- args.push_back(this->MemoryTesterOptionsParsed[pp]);
- memcheckcommand += " ";
- memcheckcommand += cmSystemTools::EscapeSpaces(
- this->MemoryTesterOptionsParsed[pp].c_str());
+ args.push_back(this->MemoryTesterOptions[pp]);
+ memcheckcommand += " \"";
+ memcheckcommand += this->MemoryTesterOptions[pp];
+ memcheckcommand += "\"";
}
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Memory check command: "
<< memcheckcommand << std::endl);
@@ -440,18 +439,21 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
}
// Setup the options
+ std::string memoryTesterOptions;
if ( this->CTest->GetCTestConfiguration(
"MemoryCheckCommandOptions").size() )
{
- this->MemoryTesterOptions = this->CTest->GetCTestConfiguration(
+ memoryTesterOptions = this->CTest->GetCTestConfiguration(
"MemoryCheckCommandOptions");
}
else if ( this->CTest->GetCTestConfiguration(
"ValgrindCommandOptions").size() )
{
- this->MemoryTesterOptions = this->CTest->GetCTestConfiguration(
+ memoryTesterOptions = this->CTest->GetCTestConfiguration(
"ValgrindCommandOptions");
}
+ this->MemoryTesterOptions
+ = cmSystemTools::ParseArguments(memoryTesterOptions.c_str());
this->MemoryTesterOutputFile
= this->CTest->GetBinaryDir() + "/Testing/Temporary/MemoryChecker.log";
@@ -459,10 +461,14 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
if ( this->MemoryTester.find("valgrind") != std::string::npos )
{
this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
- if ( !this->MemoryTesterOptions.size() )
+ if ( this->MemoryTesterOptions.empty() )
{
- this->MemoryTesterOptions = "-q --tool=memcheck --leak-check=yes "
- "--show-reachable=yes --workaround-gcc296-bugs=yes --num-callers=50";
+ this->MemoryTesterOptions.push_back("-q");
+ this->MemoryTesterOptions.push_back("--tool=memcheck");
+ this->MemoryTesterOptions.push_back("--leak-check=yes");
+ this->MemoryTesterOptions.push_back("--show-reachable=yes");
+ this->MemoryTesterOptions.push_back("--workaround-gcc296-bugs=yes");
+ this->MemoryTesterOptions.push_back("--num-callers=50");
}
if ( this->CTest->GetCTestConfiguration(
"MemoryCheckSuppressionFile").size() )
@@ -476,17 +482,15 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
"MemoryCheckSuppressionFile").c_str() << std::endl);
return false;
}
- this->MemoryTesterOptions += " --suppressions=" +
- cmSystemTools::EscapeSpaces(this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").c_str()) + "";
+ std::string suppressions = "--suppressions="
+ + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
+ this->MemoryTesterOptions.push_back(suppressions);
}
}
else if ( this->MemoryTester.find("purify") != std::string::npos )
{
this->MemoryTesterStyle = cmCTestMemCheckHandler::PURIFY;
- std::string outputFile =
- cmSystemTools::EscapeSpaces(this->MemoryTesterOutputFile.c_str());
-
+ std::string outputFile;
#ifdef _WIN32
if( this->CTest->GetCTestConfiguration(
"MemoryCheckSuppressionFile").size() )
@@ -500,31 +504,29 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
"MemoryCheckSuppressionFile").c_str() << std::endl);
return false;
}
- this->MemoryTesterOptions += " /FilterFiles=" +
- cmSystemTools::EscapeSpaces(this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").c_str());
+ std::string filterFiles = "/FilterFiles="
+ + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
+ this->MemoryTesterOptions.push_back(filterFiles);
}
- this->MemoryTesterOptions += " /SAVETEXTDATA=" + outputFile;
+ outputFile = "/SAVETEXTDATA=";
#else
- this->MemoryTesterOptions += " -log-file=" + outputFile;
+ outputFile = "-log-file=";
#endif
+ outputFile += this->MemoryTesterOutputFile;
+ this->MemoryTesterOptions.push_back(outputFile);
}
else if ( this->MemoryTester.find("BC") != std::string::npos )
{
this->BoundsCheckerXMLFile = this->MemoryTesterOutputFile;
- std::string outputFile =
- cmSystemTools::EscapeSpaces(this->MemoryTesterOutputFile.c_str());
std::string dpbdFile = this->CTest->GetBinaryDir()
+ "/Testing/Temporary/MemoryChecker.DPbd";
- std::string errorFile = this->CTest->GetBinaryDir()
- + "/Testing/Temporary/MemoryChecker.error";
- errorFile = cmSystemTools::EscapeSpaces(errorFile.c_str());
this->BoundsCheckerDPBDFile = dpbdFile;
- dpbdFile = cmSystemTools::EscapeSpaces(dpbdFile.c_str());
this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
- this->MemoryTesterOptions += " /B " + dpbdFile;
- this->MemoryTesterOptions += " /X " + outputFile;
- this->MemoryTesterOptions += " /M ";
+ this->MemoryTesterOptions.push_back("/B");
+ this->MemoryTesterOptions.push_back(dpbdFile);
+ this->MemoryTesterOptions.push_back("/X");
+ this->MemoryTesterOptions.push_back(this->MemoryTesterOutputFile);
+ this->MemoryTesterOptions.push_back("/M");
}
else
{
@@ -534,8 +536,6 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
return false;
}
- this->MemoryTesterOptionsParsed
- = cmSystemTools::ParseArguments(this->MemoryTesterOptions.c_str());
std::vector<cmStdString>::size_type cc;
for ( cc = 0; cmCTestMemCheckResultStrings[cc]; cc ++ )
{
diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h
index db426f0..427d471 100644
--- a/Source/CTest/cmCTestMemCheckHandler.h
+++ b/Source/CTest/cmCTestMemCheckHandler.h
@@ -89,8 +89,7 @@ private:
std::string BoundsCheckerDPBDFile;
std::string BoundsCheckerXMLFile;
std::string MemoryTester;
- std::vector<cmStdString> MemoryTesterOptionsParsed;
- std::string MemoryTesterOptions;
+ std::vector<cmStdString> MemoryTesterOptions;
int MemoryTesterStyle;
std::string MemoryTesterOutputFile;
int MemoryTesterGlobalResults[NO_MEMORY_FAULT];
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 1eb84e8..0d14c2d 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -18,6 +18,23 @@
#include <stack>
#include <float.h>
+class TestComparator
+{
+public:
+ TestComparator(cmCTestMultiProcessHandler* handler) : Handler(handler) {}
+ ~TestComparator() {}
+
+ // Sorts tests in descending order of cost
+ bool operator() (int index1, int index2) const
+ {
+ return Handler->Properties[index1]->Cost >
+ Handler->Properties[index2]->Cost;
+ }
+
+private:
+ cmCTestMultiProcessHandler* Handler;
+};
+
cmCTestMultiProcessHandler::cmCTestMultiProcessHandler()
{
this->ParallelLevel = 1;
@@ -154,15 +171,8 @@ void cmCTestMultiProcessHandler::UnlockResources(int index)
void cmCTestMultiProcessHandler::EraseTest(int test)
{
this->Tests.erase(test);
- for(TestCostMap::iterator i = this->TestCosts.begin();
- i != this->TestCosts.end(); ++i)
- {
- if(i->second.find(test) != i->second.end())
- {
- i->second.erase(test);
- return;
- }
- }
+ this->SortedTests.erase(
+ std::find(this->SortedTests.begin(), this->SortedTests.end(), test));
}
//---------------------------------------------------------
@@ -244,41 +254,36 @@ void cmCTestMultiProcessHandler::StartNextTests()
return;
}
- for(TestCostMap::reverse_iterator i = this->TestCosts.rbegin();
- i != this->TestCosts.rend(); ++i)
+ TestList copy = this->SortedTests;
+ for(TestList::iterator test = copy.begin(); test != copy.end(); ++test)
{
- TestSet tests = i->second; //copy the test set
- for(TestSet::iterator test = tests.begin();
- test != tests.end(); ++test)
+ //in case this test has already been started due to dependency
+ if(this->TestRunningMap[*test] || this->TestFinishMap[*test])
{
- //in case this test has already been started due to dependency
- if(this->TestRunningMap[*test] || this->TestFinishMap[*test])
- {
- continue;
- }
- size_t processors = GetProcessorsUsed(*test);
- if(processors > numToStart)
- {
- return;
- }
- if(this->StartTest(*test))
- {
- if(this->StopTimePassed)
- {
- return;
- }
- numToStart -= processors;
- }
- else
- {
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
- << "Test did not start waiting on depends to finish: "
- << *test << "\n");
- }
- if(numToStart == 0)
+ continue;
+ }
+ size_t processors = GetProcessorsUsed(*test);
+ if(processors > numToStart)
+ {
+ return;
+ }
+ if(this->StartTest(*test))
+ {
+ if(this->StopTimePassed)
{
return;
}
+ numToStart -= processors;
+ }
+ else
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
+ << "Test did not start waiting on depends to finish: "
+ << *test << "\n");
+ }
+ if(numToStart == 0)
+ {
+ return;
}
}
}
@@ -468,26 +473,22 @@ void cmCTestMultiProcessHandler::CreateTestCostList()
for(TestMap::iterator i = this->Tests.begin();
i != this->Tests.end(); ++i)
{
- //We only want to schedule them by cost in a parallel situation
- if(this->ParallelLevel > 1)
- {
- std::string name = this->Properties[i->first]->Name;
- if(std::find(this->LastTestsFailed.begin(), this->LastTestsFailed.end(),
- name) != this->LastTestsFailed.end())
- {
- this->TestCosts[FLT_MAX].insert(i->first);
- }
- else
- {
- this->TestCosts[this->Properties[i->first]->Cost].insert(i->first);
- }
- }
- else //we ignore their cost
+ SortedTests.push_back(i->first);
+
+ //If the test failed last time, it should be run first, so max the cost
+ if(std::find(this->LastTestsFailed.begin(),
+ this->LastTestsFailed.end(),
+ this->Properties[i->first]->Name)
+ != this->LastTestsFailed.end())
{
- this->TestCosts[this->Tests.size()
- - this->Properties[i->first]->Index].insert(i->first);
+ this->Properties[i->first]->Cost = FLT_MAX;
}
}
+ if(this->ParallelLevel > 1)
+ {
+ TestComparator comp(this);
+ std::sort(SortedTests.begin(), SortedTests.end(), comp);
+ }
}
//---------------------------------------------------------
@@ -515,11 +516,13 @@ void cmCTestMultiProcessHandler::PrintTestList()
{
this->TestHandler->SetMaxIndex(this->FindMaxIndex());
int count = 0;
+
for (PropertiesMap::iterator it = this->Properties.begin();
it != this->Properties.end(); ++it)
{
count++;
cmCTestTestHandler::cmCTestTestProperties& p = *it->second;
+
//push working dir
std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(p.Directory.c_str());
@@ -529,6 +532,20 @@ void cmCTestMultiProcessHandler::PrintTestList()
testRun.SetTestProperties(&p);
testRun.ComputeArguments(); //logs the command in verbose mode
+ if(p.Labels.size()) //print the labels
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Labels:");
+ }
+ for(std::vector<std::string>::iterator label = p.Labels.begin();
+ label != p.Labels.end(); ++label)
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " " << *label);
+ }
+ if(p.Labels.size()) //print the labels
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl);
+ }
+
if (this->TestHandler->MemCheck)
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Memory Check");
@@ -547,10 +564,36 @@ void cmCTestMultiProcessHandler::PrintTestList()
//pop working dir
cmSystemTools::ChangeDirectory(current_dir.c_str());
}
+
cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl << "Total Tests: "
<< this->Total << std::endl);
}
+void cmCTestMultiProcessHandler::PrintLabels()
+{
+ std::set<std::string> allLabels;
+ for (PropertiesMap::iterator it = this->Properties.begin();
+ it != this->Properties.end(); ++it)
+ {
+ cmCTestTestHandler::cmCTestTestProperties& p = *it->second;
+ allLabels.insert(p.Labels.begin(), p.Labels.end());
+ }
+
+ if(allLabels.size())
+ {
+ cmCTestLog(this->CTest, HANDLER_OUTPUT, "All Labels:" << std::endl);
+ }
+ else
+ {
+ cmCTestLog(this->CTest, HANDLER_OUTPUT, "No Labels Exist" << std::endl);
+ }
+ for(std::set<std::string>::iterator label = allLabels.begin();
+ label != allLabels.end(); ++label)
+ {
+ cmCTestLog(this->CTest, HANDLER_OUTPUT, " " << *label << std::endl);
+ }
+}
+
//---------------------------------------------------------
void cmCTestMultiProcessHandler::CheckResume()
{
@@ -610,7 +653,7 @@ int cmCTestMultiProcessHandler::FindMaxIndex()
//Returns true if no cycles exist in the dependency graph
bool cmCTestMultiProcessHandler::CheckCycles()
{
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Checking test dependency graph..." << std::endl);
for(TestMap::iterator it = this->Tests.begin();
it != this->Tests.end(); ++it)
@@ -618,34 +661,29 @@ bool cmCTestMultiProcessHandler::CheckCycles()
//DFS from each element to itself
std::stack<int> s;
std::vector<int> visited;
+
s.push(it->first);
- visited.push_back(it->first);
while(!s.empty())
{
int test = s.top();
s.pop();
-
+
for(TestSet::iterator d = this->Tests[test].begin();
d != this->Tests[test].end(); ++d)
{
- s.push(*d);
- for(std::vector<int>::iterator v = visited.begin();
- v != visited.end(); ++v)
+ if(std::find(visited.begin(), visited.end(), *d) != visited.end())
{
- if(*v == *d)
- {
- //cycle exists
- cmCTestLog(this->CTest, ERROR_MESSAGE, "Error: a cycle exists in "
- "the test dependency graph for the test \""
- << this->Properties[*d]->Name << "\"." << std::endl
- << "Please fix the cycle and run ctest again." << std::endl);
- return false;
- }
+ //cycle exists
+ cmCTestLog(this->CTest, ERROR_MESSAGE, "Error: a cycle exists in "
+ "the test dependency graph for the test \""
+ << this->Properties[it->first]->Name << "\"." << std::endl
+ << "Please fix the cycle and run ctest again." << std::endl);
+ return false;
}
- visited.push_back(*d);
+ s.push(*d);
}
- visited.pop_back();
+ visited.push_back(test);
}
}
return true;
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index 4f51b0b..1483440 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -23,10 +23,11 @@
*/
class cmCTestMultiProcessHandler
{
+ friend class TestComparator;
public:
struct TestSet : public std::set<int> {};
struct TestMap : public std::map<int, TestSet> {};
- struct TestCostMap : public std::map<float, TestSet> {};
+ struct TestList : public std::vector<int> {};
struct PropertiesMap : public
std::map<int, cmCTestTestHandler::cmCTestTestProperties*> {};
@@ -38,6 +39,7 @@ public:
void SetParallelLevel(size_t);
virtual void RunTests();
void PrintTestList();
+ void PrintLabels();
void SetPassFailVectors(std::vector<cmStdString>* passed,
std::vector<cmStdString>* failed)
@@ -88,7 +90,7 @@ protected:
void UnlockResources(int index);
// map from test number to set of depend tests
TestMap Tests;
- TestCostMap TestCosts;
+ TestList SortedTests;
//Total number of tests we'll be running
size_t Total;
//Number of tests that are complete
diff --git a/Source/CTest/cmCTestRunScriptCommand.h b/Source/CTest/cmCTestRunScriptCommand.h
index c2cda66..5765150 100644
--- a/Source/CTest/cmCTestRunScriptCommand.h
+++ b/Source/CTest/cmCTestRunScriptCommand.h
@@ -68,7 +68,7 @@ public:
"Runs a script or scripts much like if it was run from ctest -S. "
"If no argument is provided then the current script is run using "
"the current settings of the variables. If NEW_PROCESS is specified "
- "then each script will be run in a seperate process."
+ "then each script will be run in a separate process."
"If RETURN_VALUE is specified the return value of the last script "
"run will be put into var.";
}
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 3719d45..6570d0e 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -83,7 +83,8 @@ void cmCTestRunTest::CompressOutput()
reinterpret_cast<unsigned char*>(
const_cast<char*>(this->ProcessOutput.c_str()));
//zlib makes the guarantee that this is the maximum output size
- int outSize = static_cast<int>(this->ProcessOutput.size() * 1.001 + 13);
+ int outSize = static_cast<int>(
+ static_cast<double>(this->ProcessOutput.size()) * 1.001 + 13.0);
unsigned char* out = new unsigned char[outSize];
strm.zalloc = Z_NULL;
@@ -342,13 +343,14 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
//----------------------------------------------------------------------
void cmCTestRunTest::ComputeWeightedCost()
{
- int prev = this->TestProperties->PreviousRuns;
- float avgcost = this->TestProperties->Cost;
+ double prev = static_cast<double>(this->TestProperties->PreviousRuns);
+ double avgcost = static_cast<double>(this->TestProperties->Cost);
double current = this->TestResult.ExecutionTime;
if(this->TestResult.Status == cmCTestTestHandler::COMPLETED)
{
- this->TestProperties->Cost = ((prev * avgcost) + current) / (prev + 1);
+ this->TestProperties->Cost =
+ static_cast<float>(((prev * avgcost) + current) / (prev + 1.0));
this->TestProperties->PreviousRuns++;
}
}
@@ -469,7 +471,7 @@ void cmCTestRunTest::ComputeArguments()
this->TestProperties->Args[1].c_str());
++j; //skip the executable (it will be actualCommand)
}
- this->TestCommand
+ std::string testCommand
= cmSystemTools::ConvertToOutputPath(this->ActualCommand.c_str());
//Prepends memcheck args to our command string
@@ -477,22 +479,24 @@ void cmCTestRunTest::ComputeArguments()
for(std::vector<std::string>::iterator i = this->Arguments.begin();
i != this->Arguments.end(); ++i)
{
- this->TestCommand += " ";
- this->TestCommand += cmSystemTools::EscapeSpaces(i->c_str());
+ testCommand += " \"";
+ testCommand += *i;
+ testCommand += "\"";
}
for(;j != this->TestProperties->Args.end(); ++j)
{
- this->TestCommand += " ";
- this->TestCommand += cmSystemTools::EscapeSpaces(j->c_str());
+ testCommand += " \"";
+ testCommand += *j;
+ testCommand += "\"";
this->Arguments.push_back(*j);
}
- this->TestResult.FullCommandLine = this->TestCommand;
+ this->TestResult.FullCommandLine = testCommand;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
<< this->Index << ": "
<< (this->TestHandler->MemCheck?"MemCheck":"Test")
- << " command: " << this->TestCommand
+ << " command: " << testCommand
<< std::endl);
}
@@ -569,7 +573,7 @@ double cmCTestRunTest::ResolveTimeout()
{
stop_time += 24*60*60;
}
- int stop_timeout = (stop_time - current_time) % (24*60*60);
+ int stop_timeout = static_cast<int>(stop_time - current_time) % (24*60*60);
this->CTest->LastStopTimeout = stop_timeout;
if(stop_timeout <= 0 || stop_timeout > this->CTest->LastStopTimeout)
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index e0cb888..66e6b7b 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -89,7 +89,6 @@ private:
cmCTestTestHandler::cmCTestTestResult TestResult;
int Index;
std::string StartTime;
- std::string TestCommand;
std::string ActualCommand;
std::vector<std::string> Arguments;
bool StopTimePassed;
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index d1226da..24974e3 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -147,6 +147,13 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
static_cast<cmCTestSubmitHandler*>(handler)->SelectParts(this->Parts);
}
+ static_cast<cmCTestSubmitHandler*>(handler)->SetOption("RetryDelay",
+ this->RetryDelay.c_str());
+ static_cast<cmCTestSubmitHandler*>(handler)->SetOption("RetryCount",
+ this->RetryCount.c_str());
+ static_cast<cmCTestSubmitHandler*>(handler)->SetOption("InternalTest",
+ this->InternalTest ? "ON" : "OFF");
+
return handler;
}
@@ -169,6 +176,24 @@ bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg)
return true;
}
+ if(arg == "RETRY_COUNT")
+ {
+ this->ArgumentDoing = ArgumentDoingRetryCount;
+ return true;
+ }
+
+ if(arg == "RETRY_DELAY")
+ {
+ this->ArgumentDoing = ArgumentDoingRetryDelay;
+ return true;
+ }
+
+ if(arg == "INTERNAL_TEST_CHECKSUM")
+ {
+ this->InternalTest = true;
+ return true;
+ }
+
// Look for other arguments.
return this->Superclass::CheckArgumentKeyword(arg);
}
@@ -213,6 +238,18 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
return true;
}
+ if(this->ArgumentDoing == ArgumentDoingRetryCount)
+ {
+ this->RetryCount = arg;
+ return true;
+ }
+
+ if(this->ArgumentDoing == ArgumentDoingRetryDelay)
+ {
+ this->RetryDelay = arg;
+ return true;
+ }
+
// Look for other arguments.
return this->Superclass::CheckArgumentValue(arg);
}
diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h
index ccaef7e..edc9c65 100644
--- a/Source/CTest/cmCTestSubmitCommand.h
+++ b/Source/CTest/cmCTestSubmitCommand.h
@@ -29,6 +29,9 @@ public:
{
this->PartsMentioned = false;
this->FilesMentioned = false;
+ this->InternalTest = false;
+ this->RetryCount = "";
+ this->RetryDelay = "";
}
/**
@@ -61,7 +64,8 @@ public:
virtual const char* GetFullDocumentation()
{
return
- " ctest_submit([PARTS ...] [FILES ...] [RETURN_VALUE res])\n"
+ " ctest_submit([PARTS ...] [FILES ...] [RETRY_COUNT count] "
+ " [RETRY_DELAY delay][RETURN_VALUE res])\n"
"By default all available parts are submitted if no PARTS or FILES "
"are specified. "
"The PARTS option lists a subset of parts to be submitted. "
@@ -77,7 +81,11 @@ public:
" ExtraFiles = Files listed by CTEST_EXTRA_SUBMIT_FILES\n"
" Submit = nothing\n"
"The FILES option explicitly lists specific files to be submitted. "
- "Each individual file must exist at the time of the call.\n";
+ "Each individual file must exist at the time of the call.\n"
+ "The RETRY_DELAY option specifies how long in seconds to wait after "
+ "a timed-out submission before attempting to re-submit.\n"
+ "The RETRY_COUNT option specifies how many times to retry a timed-out "
+ "submission.\n";
}
cmTypeMacro(cmCTestSubmitCommand, cmCTestHandlerCommand);
@@ -92,13 +100,18 @@ protected:
{
ArgumentDoingParts = Superclass::ArgumentDoingLast1,
ArgumentDoingFiles,
+ ArgumentDoingRetryDelay,
+ ArgumentDoingRetryCount,
ArgumentDoingLast2
};
bool PartsMentioned;
std::set<cmCTest::Part> Parts;
bool FilesMentioned;
+ bool InternalTest;
cmCTest::SetOfStrings Files;
+ std::string RetryCount;
+ std::string RetryDelay;
};
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 7b4f38b..9f9f85a 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -15,6 +15,7 @@
#include "cmVersion.h"
#include "cmGeneratedFileStream.h"
#include "cmCTest.h"
+#include "cmXMLParser.h"
#include <cmsys/Process.h>
#include <cmsys/Base64.h>
@@ -31,6 +32,90 @@
typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
+//----------------------------------------------------------------------------
+class cmCTestSubmitHandler::ResponseParser: public cmXMLParser
+{
+public:
+ ResponseParser() { this->Status = STATUS_OK; }
+ ~ResponseParser() {}
+
+public:
+
+ enum StatusType
+ {
+ STATUS_OK,
+ STATUS_WARNING,
+ STATUS_ERROR
+ };
+
+ StatusType Status;
+ std::string CDashVersion;
+ std::string Filename;
+ std::string MD5;
+ std::string Message;
+
+private:
+
+ std::vector<char> CurrentValue;
+
+ std::string GetCurrentValue()
+ {
+ std::string val;
+ if(this->CurrentValue.size())
+ {
+ val.assign(&this->CurrentValue[0], this->CurrentValue.size());
+ }
+ return val;
+ }
+
+ virtual void StartElement(const char* name, const char** atts)
+ {
+ this->CurrentValue.clear();
+ if(strcmp(name, "cdash") == 0)
+ {
+ this->CDashVersion = this->FindAttribute(atts, "version");
+ }
+ }
+
+ virtual void CharacterDataHandler(const char* data, int length)
+ {
+ this->CurrentValue.insert(this->CurrentValue.end(), data, data+length);
+ }
+
+ virtual void EndElement(const char* name)
+ {
+ if(strcmp(name, "status") == 0)
+ {
+ std::string status = cmSystemTools::UpperCase(this->GetCurrentValue());
+ if(status == "OK" || status == "SUCCESS")
+ {
+ this->Status = STATUS_OK;
+ }
+ else if(status == "WARNING")
+ {
+ this->Status = STATUS_WARNING;
+ }
+ else
+ {
+ this->Status = STATUS_ERROR;
+ }
+ }
+ else if(strcmp(name, "filename") == 0)
+ {
+ this->Filename = this->GetCurrentValue();
+ }
+ else if(strcmp(name, "md5") == 0)
+ {
+ this->MD5 = this->GetCurrentValue();
+ }
+ else if(strcmp(name, "message") == 0)
+ {
+ this->Message = this->GetCurrentValue();
+ }
+ }
+};
+
+
static size_t
cmCTestSubmitHandlerWriteMemoryCallback(void *ptr, size_t size, size_t nmemb,
void *data)
@@ -367,6 +452,20 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
= url + ((url.find("?",0) == cmStdString::npos) ? "?" : "&")
+ "FileName=" + ofile;
+ upload_as += "&MD5=";
+
+ if(cmSystemTools::IsOn(this->GetOption("InternalTest")))
+ {
+ upload_as += "bad_md5sum";
+ }
+ else
+ {
+ char md5[33];
+ cmSystemTools::ComputeFileMD5(local_file.c_str(), md5);
+ md5[32] = 0;
+ upload_as += md5;
+ }
+
struct stat st;
if ( ::stat(local_file.c_str(), &st) )
{
@@ -382,7 +481,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
<< local_file.c_str() << " to "
<< upload_as.c_str() << " Size: " << st.st_size << std::endl);
-
// specify target
::curl_easy_setopt(curl,CURLOPT_URL, upload_as.c_str());
@@ -411,6 +509,19 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
// Now run off and do what you've been told!
res = ::curl_easy_perform(curl);
+ if(cmSystemTools::IsOn(this->GetOption("InternalTest")) &&
+ cmSystemTools::VersionCompare(cmSystemTools::OP_LESS,
+ this->CTest->GetCDashVersion().c_str(), "1.7"))
+ {
+ // mock failure output for internal test case
+ std::string mock_output = "<cdash version=\"1.7.0\">\n"
+ " <status>ERROR</status>\n"
+ " <message>Checksum failed for file.</message>\n"
+ "</cdash>\n";
+ chunk.clear();
+ chunk.assign(mock_output.begin(), mock_output.end());
+ }
+
if ( chunk.size() > 0 )
{
cmCTestLog(this->CTest, DEBUG, "CURL output: ["
@@ -425,6 +536,60 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
<< std::endl);
}
+ // If curl failed for any reason, or checksum fails, wait and retry
+ //
+ if(res != CURLE_OK || this->HasErrors)
+ {
+ std::string retryDelay = this->GetOption("RetryDelay") == NULL ?
+ "" : this->GetOption("RetryDelay");
+ std::string retryCount = this->GetOption("RetryCount") == NULL ?
+ "" : this->GetOption("RetryCount");
+
+ int delay = retryDelay == "" ? atoi(this->CTest->GetCTestConfiguration(
+ "CTestSubmitRetryDelay").c_str()) : atoi(retryDelay.c_str());
+ int count = retryCount == "" ? atoi(this->CTest->GetCTestConfiguration(
+ "CTestSubmitRetryCount").c_str()) : atoi(retryCount.c_str());
+
+ for(int i = 0; i < count; i++)
+ {
+ cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ " Submit failed, waiting " << delay << " seconds...\n");
+
+ double stop = cmSystemTools::GetTime() + delay;
+ while(cmSystemTools::GetTime() < stop)
+ {
+ cmSystemTools::Delay(100);
+ }
+
+ cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ " Retry submission: Attempt " << (i + 1) << " of "
+ << count << std::endl);
+
+ ::fclose(ftpfile);
+ ftpfile = ::fopen(local_file.c_str(), "rb");
+ ::curl_easy_setopt(curl, CURLOPT_INFILE, ftpfile);
+
+ chunk.clear();
+ chunkDebug.clear();
+ this->HasErrors = false;
+
+ res = ::curl_easy_perform(curl);
+
+ if ( chunk.size() > 0 )
+ {
+ cmCTestLog(this->CTest, DEBUG, "CURL output: ["
+ << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
+ << std::endl);
+ this->ParseResponse(chunk);
+ }
+
+ if(res == CURLE_OK && !this->HasErrors)
+ {
+ break;
+ }
+ }
+ }
+
fclose(ftpfile);
if ( res )
{
@@ -467,14 +632,22 @@ void cmCTestSubmitHandler
::ParseResponse(cmCTestSubmitHandlerVectorOfChar chunk)
{
std::string output = "";
+ output.append(chunk.begin(), chunk.end());
- for(cmCTestSubmitHandlerVectorOfChar::iterator i = chunk.begin();
- i != chunk.end(); ++i)
+ if(output.find("<cdash") != output.npos)
{
- output += *i;
+ ResponseParser parser;
+ parser.Parse(output.c_str());
+
+ if(parser.Status != ResponseParser::STATUS_OK)
+ {
+ this->HasErrors = true;
+ cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submission failed: " <<
+ parser.Message << std::endl);
+ return;
+ }
}
output = cmSystemTools::UpperCase(output);
-
if(output.find("WARNING") != std::string::npos)
{
this->HasWarnings = true;
@@ -483,13 +656,12 @@ void cmCTestSubmitHandler
{
this->HasErrors = true;
}
-
+
if(this->HasWarnings || this->HasErrors)
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Server Response:\n" <<
cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "\n");
}
-
}
//----------------------------------------------------------------------------
@@ -589,7 +761,7 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
<< turl.c_str() << std::endl);
cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: "
<< error_buffer << std::endl);
- *this->LogFile << "\tTrigerring failed with error: " << error_buffer
+ *this->LogFile << "\tTriggering failed with error: " << error_buffer
<< std::endl
<< " Error message was: " << error_buffer
<< std::endl;
diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h
index 8b011ea..e7755b1 100644
--- a/Source/CTest/cmCTestSubmitHandler.h
+++ b/Source/CTest/cmCTestSubmitHandler.h
@@ -79,6 +79,7 @@ private:
std::string GetSubmitResultsPrefix();
+ class ResponseParser;
cmStdString HTTPProxy;
int HTTPProxyType;
cmStdString HTTPProxyAuth;
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index d2742ec..6dd348d 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -567,7 +567,7 @@ int cmCTestTestHandler::ProcessHandler()
if (total == 0)
{
- if ( !this->CTest->GetShowOnly() )
+ if ( !this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels() )
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "No tests were found!!!"
<< std::endl);
@@ -1048,7 +1048,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed,
if(randomSchedule)
{
- p.Cost = rand();
+ p.Cost = static_cast<float>(rand());
}
if(p.Timeout == 0 && this->CTest->GetGlobalTimeout() != 0)
@@ -1079,7 +1079,12 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed,
parallel->SetPassFailVectors(&passed, &failed);
this->TestResults.clear();
parallel->SetTestResults(&this->TestResults);
- if(this->CTest->GetShowOnly())
+
+ if(this->CTest->ShouldPrintLabels())
+ {
+ parallel->PrintLabels();
+ }
+ else if(this->CTest->GetShowOnly())
{
parallel->PrintTestList();
}
@@ -1309,7 +1314,8 @@ std::string cmCTestTestHandler::EncodeFile(std::string file)
cmSystemTools::RemoveFile(tarFile.c_str());
unsigned char *encoded_buffer
- = new unsigned char [ static_cast<int>(len * 1.5 + 5) ];
+ = new unsigned char [ static_cast<int>(
+ static_cast<double>(len) * 1.5 + 5.0) ];
unsigned long rlen
= cmsysBase64_Encode(file_buffer, len, encoded_buffer, 1);
@@ -1881,7 +1887,8 @@ std::string cmCTestTestHandler::GenerateRegressionImages(
unsigned char *file_buffer = new unsigned char [ len + 1 ];
ifs.read(reinterpret_cast<char*>(file_buffer), len);
unsigned char *encoded_buffer
- = new unsigned char [ static_cast<int>(len * 1.5 + 5) ];
+ = new unsigned char [ static_cast<int>(
+ static_cast<double>(len) * 1.5 + 5.0) ];
unsigned long rlen
= cmsysBase64_Encode(file_buffer, len, encoded_buffer, 1);
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx
index c66147b..1c48d8c 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.cxx
+++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx
@@ -53,13 +53,13 @@ void cmCursesLongMessageForm::UpdateStatusBar()
getmaxyx(stdscr, y, x);
char bar[cmCursesMainForm::MAX_WIDTH];
- int size = strlen(this->Title.c_str());
+ size_t size = strlen(this->Title.c_str());
if ( size >= cmCursesMainForm::MAX_WIDTH )
{
size = cmCursesMainForm::MAX_WIDTH-1;
}
strncpy(bar, this->Title.c_str(), size);
- for(int i=size-1; i<cmCursesMainForm::MAX_WIDTH; i++) bar[i] = ' ';
+ for(size_t i=size-1; i<cmCursesMainForm::MAX_WIDTH; i++) bar[i] = ' ';
int width;
if (x < cmCursesMainForm::MAX_WIDTH )
@@ -76,8 +76,8 @@ void cmCursesLongMessageForm::UpdateStatusBar()
char version[cmCursesMainForm::MAX_WIDTH];
char vertmp[128];
sprintf(vertmp,"CMake Version %s", cmVersion::GetCMakeVersion());
- int sideSpace = (width-strlen(vertmp));
- for(int i=0; i<sideSpace; i++) { version[i] = ' '; }
+ size_t sideSpace = (width-strlen(vertmp));
+ for(size_t i=0; i<sideSpace; i++) { version[i] = ' '; }
sprintf(version+sideSpace, "%s", vertmp);
version[width] = '\0';
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index cd231ad..7f3e360 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -242,7 +242,7 @@ void cmCursesMainForm::RePost()
// Assign the fields: 3 for each entry: label, new entry marker
// ('*' or ' ') and entry widget
this->Fields = new FIELD*[3*this->NumberOfVisibleEntries+1];
- int cc;
+ size_t cc;
for ( cc = 0; cc < 3 * this->NumberOfVisibleEntries+1; cc ++ )
{
this->Fields[cc] = 0;
@@ -454,7 +454,7 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
if (cw)
{
sprintf(firstLine, "Page %d of %d", cw->GetPage(), this->NumberOfPages);
- curses_move(0,65-strlen(firstLine)-1);
+ curses_move(0,65-static_cast<unsigned int>(strlen(firstLine))-1);
printw(firstLine);
}
// }
@@ -526,10 +526,10 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
// Join the key, help string and pad with spaces
// (or truncate) as necessary
char bar[cmCursesMainForm::MAX_WIDTH];
- int i, curFieldLen = strlen(curField);
- int helpLen = strlen(help);
+ size_t i, curFieldLen = strlen(curField);
+ size_t helpLen = strlen(help);
- int width;
+ size_t width;
if (x < cmCursesMainForm::MAX_WIDTH )
{
width = x;
@@ -592,7 +592,7 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
char version[cmCursesMainForm::MAX_WIDTH];
char vertmp[128];
sprintf(vertmp,"CMake Version %s", cmVersion::GetCMakeVersion());
- int sideSpace = (width-strlen(vertmp));
+ size_t sideSpace = (width-strlen(vertmp));
for(i=0; i<sideSpace; i++) { version[i] = ' '; }
sprintf(version+sideSpace, "%s", vertmp);
version[width] = '\0';
@@ -795,8 +795,8 @@ void cmCursesMainForm::RemoveEntry(const char* value)
// copy from the list box to the cache manager
void cmCursesMainForm::FillCacheManagerFromUI()
{
- int size = this->Entries->size();
- for(int i=0; i < size; i++)
+ size_t size = this->Entries->size();
+ for(size_t i=0; i < size; i++)
{
cmCacheManager::CacheIterator it =
this->CMakeInstance->GetCacheManager()->GetCacheIterator(
@@ -866,7 +866,7 @@ void cmCursesMainForm::HandleInput()
std::string searchstr = "Search: " + this->SearchString;
this->UpdateStatusBar( searchstr.c_str() );
this->PrintKeys(1);
- curses_move(y-5,searchstr.size());
+ curses_move(y-5,static_cast<unsigned int>(searchstr.size()));
//curses_move(1,1);
touchwin(stdscr);
refresh();
@@ -902,7 +902,7 @@ void cmCursesMainForm::HandleInput()
this->SearchMode = false;
if ( this->SearchString.size() > 0 )
{
- this->JumpToCacheEntry(-1, this->SearchString.c_str());
+ this->JumpToCacheEntry(this->SearchString.c_str());
this->OldSearchString = this->SearchString;
}
this->SearchString = "";
@@ -961,7 +961,7 @@ void cmCursesMainForm::HandleInput()
else if ( key == KEY_DOWN || key == ctrl('n') )
{
FIELD* cur = current_field(this->Form);
- int findex = field_index(cur);
+ size_t findex = field_index(cur);
if ( findex == 3*this->NumberOfVisibleEntries-1 )
{
continue;
@@ -1076,7 +1076,7 @@ void cmCursesMainForm::HandleInput()
{
if ( this->OldSearchString.size() > 0 )
{
- this->JumpToCacheEntry(-1, this->OldSearchString.c_str());
+ this->JumpToCacheEntry(this->OldSearchString.c_str());
}
}
// switch advanced on/off
@@ -1108,7 +1108,7 @@ void cmCursesMainForm::HandleInput()
{
this->OkToGenerate = false;
FIELD* cur = current_field(this->Form);
- int findex = field_index(cur);
+ size_t findex = field_index(cur);
// make the next or prev. current field after deletion
// each entry consists of fields: label, isnew, value
@@ -1191,7 +1191,7 @@ int cmCursesMainForm::LoadCache(const char *)
return r;
}
-void cmCursesMainForm::JumpToCacheEntry(int idx, const char* astr)
+void cmCursesMainForm::JumpToCacheEntry(const char* astr)
{
std::string str;
if ( astr )
@@ -1199,18 +1199,14 @@ void cmCursesMainForm::JumpToCacheEntry(int idx, const char* astr)
str = cmSystemTools::LowerCase(astr);
}
- if ( idx > this->NumberOfVisibleEntries )
- {
- return;
- }
- if ( idx < 0 && str.size() == 0)
+ if(str.empty())
{
return;
}
FIELD* cur = current_field(this->Form);
int start_index = field_index(cur);
int findex = start_index;
- while ( (findex / 3) != idx )
+ for(;;)
{
if ( str.size() > 0 )
{
@@ -1232,7 +1228,7 @@ void cmCursesMainForm::JumpToCacheEntry(int idx, const char* astr)
}
}
}
- if ( findex >= 3* this->NumberOfVisibleEntries-1 )
+ if ( size_t(findex) >= 3* this->NumberOfVisibleEntries-1 )
{
set_current_field(this->Form, this->Fields[2]);
}
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index 9751999..3e191b4 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -122,9 +122,8 @@ protected:
// Remove an entry from the interface and the cache.
void RemoveEntry(const char* value);
- // Jump to the cache value with index idx. If string str is
- // specified, it will stop on widget that contain that string.
- void JumpToCacheEntry(int idx, const char* str);
+ // Jump to the cache entry whose name matches the string.
+ void JumpToCacheEntry(const char* str);
// Copies of cache entries stored in the user interface
std::vector<cmCursesCacheEntryComposite*>* Entries;
@@ -147,7 +146,7 @@ protected:
// Where is cmake executable
std::string WhereCMake;
// Number of entries shown (depends on mode -normal or advanced-)
- int NumberOfVisibleEntries;
+ size_t NumberOfVisibleEntries;
bool AdvancedMode;
// Did the iteration converge (no new entries) ?
bool OkToGenerate;
diff --git a/Source/CursesDialog/form/fld_info.c b/Source/CursesDialog/form/fld_info.c
index 7c50b1d..1ba92c8 100644
--- a/Source/CursesDialog/form/fld_info.c
+++ b/Source/CursesDialog/form/fld_info.c
@@ -69,7 +69,7 @@ int field_info(const FIELD *field,
| int *drows, int *dcols,
| int *maxgrow)
|
-| Description : Retrieve informations about a dynamic fields current
+| Description : Retrieve information about a dynamic fields current
| dynamic parameters.
|
| Return Values : E_OK - success
diff --git a/Source/CursesDialog/form/fld_user.c b/Source/CursesDialog/form/fld_user.c
index 7ffca9c..3287b5b 100644
--- a/Source/CursesDialog/form/fld_user.c
+++ b/Source/CursesDialog/form/fld_user.c
@@ -39,7 +39,7 @@ MODULE_ID("$Id$")
| Function : int set_field_userptr(FIELD *field, void *usrptr)
|
| Description : Set the pointer that is reserved in any field to store
-| application relevant informations
+| application relevant information
|
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
@@ -54,7 +54,7 @@ int set_field_userptr(FIELD * field, void *usrptr)
| Function : void *field_userptr(const FIELD *field)
|
| Description : Return the pointer that is reserved in any field to
-| store application relevant informations.
+| store application relevant information.
|
| Return Values : Value of pointer. If no such pointer has been set,
| NULL is returned
diff --git a/Source/CursesDialog/form/frm_user.c b/Source/CursesDialog/form/frm_user.c
index 8f0edbc..f38bbbb 100644
--- a/Source/CursesDialog/form/frm_user.c
+++ b/Source/CursesDialog/form/frm_user.c
@@ -39,7 +39,7 @@ MODULE_ID("$Id$")
| Function : int set_form_userptr(FORM *form, void *usrptr)
|
| Description : Set the pointer that is reserved in any form to store
-| application relevant informations
+| application relevant information
|
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
@@ -54,7 +54,7 @@ int set_form_userptr(FORM * form, void *usrptr)
| Function : void *form_userptr(const FORM *form)
|
| Description : Return the pointer that is reserved in any form to
-| store application relevant informations.
+| store application relevant information.
|
| Return Values : Value of pointer. If no such pointer has been set,
| NULL is returned
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 74a3d35..29fcfc0 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -34,7 +34,7 @@
#include "FirstConfigure.h"
#include "cmVersion.h"
-QCMakeThread::QCMakeThread(QObject* p)
+QCMakeThread::QCMakeThread(QObject* p)
: QThread(p), CMakeInstance(NULL)
{
}
@@ -76,7 +76,7 @@ CMakeSetupDialog::CMakeSetupDialog()
this->ProgressBar->reset();
this->RemoveEntry->setEnabled(false);
this->AddEntry->setEnabled(false);
-
+
QByteArray p = settings.value("SplitterSizes").toByteArray();
this->Splitter->restoreState(p);
@@ -84,50 +84,54 @@ CMakeSetupDialog::CMakeSetupDialog()
this->setGroupedView(groupView);
this->groupedCheck->setCheckState(groupView ? Qt::Checked : Qt::Unchecked);
+ bool advancedView = settings.value("AdvancedView", false).toBool();
+ this->setAdvancedView(advancedView);
+ this->advancedCheck->setCheckState(advancedView?Qt::Checked : Qt::Unchecked);
+
QMenu* FileMenu = this->menuBar()->addMenu(tr("&File"));
this->ReloadCacheAction = FileMenu->addAction(tr("&Reload Cache"));
- QObject::connect(this->ReloadCacheAction, SIGNAL(triggered(bool)),
+ QObject::connect(this->ReloadCacheAction, SIGNAL(triggered(bool)),
this, SLOT(doReloadCache()));
this->DeleteCacheAction = FileMenu->addAction(tr("&Delete Cache"));
- QObject::connect(this->DeleteCacheAction, SIGNAL(triggered(bool)),
+ QObject::connect(this->DeleteCacheAction, SIGNAL(triggered(bool)),
this, SLOT(doDeleteCache()));
this->ExitAction = FileMenu->addAction(tr("E&xit"));
- QObject::connect(this->ExitAction, SIGNAL(triggered(bool)),
+ QObject::connect(this->ExitAction, SIGNAL(triggered(bool)),
this, SLOT(close()));
QMenu* ToolsMenu = this->menuBar()->addMenu(tr("&Tools"));
this->ConfigureAction = ToolsMenu->addAction(tr("&Configure"));
// prevent merging with Preferences menu item on Mac OS X
this->ConfigureAction->setMenuRole(QAction::NoRole);
- QObject::connect(this->ConfigureAction, SIGNAL(triggered(bool)),
+ QObject::connect(this->ConfigureAction, SIGNAL(triggered(bool)),
this, SLOT(doConfigure()));
this->GenerateAction = ToolsMenu->addAction(tr("&Generate"));
- QObject::connect(this->GenerateAction, SIGNAL(triggered(bool)),
+ QObject::connect(this->GenerateAction, SIGNAL(triggered(bool)),
this, SLOT(doGenerate()));
QAction* showChangesAction = ToolsMenu->addAction(tr("&Show My Changes"));
- QObject::connect(showChangesAction, SIGNAL(triggered(bool)),
+ QObject::connect(showChangesAction, SIGNAL(triggered(bool)),
this, SLOT(showUserChanges()));
#if defined(Q_WS_MAC)
- this->InstallForCommandLineAction
+ this->InstallForCommandLineAction
= ToolsMenu->addAction(tr("&Install For Command Line Use"));
- QObject::connect(this->InstallForCommandLineAction, SIGNAL(triggered(bool)),
+ QObject::connect(this->InstallForCommandLineAction, SIGNAL(triggered(bool)),
this, SLOT(doInstallForCommandLine()));
-#endif
+#endif
QMenu* OptionsMenu = this->menuBar()->addMenu(tr("&Options"));
this->SuppressDevWarningsAction = OptionsMenu->addAction(tr("&Suppress dev Warnings (-Wno-dev)"));
this->SuppressDevWarningsAction->setCheckable(true);
QAction* debugAction = OptionsMenu->addAction(tr("&Debug Output"));
debugAction->setCheckable(true);
- QObject::connect(debugAction, SIGNAL(toggled(bool)),
+ QObject::connect(debugAction, SIGNAL(toggled(bool)),
this, SLOT(setDebugOutput(bool)));
-
+
OptionsMenu->addSeparator();
QAction* expandAction = OptionsMenu->addAction(tr("&Expand Grouped Entries"));
- QObject::connect(expandAction, SIGNAL(triggered(bool)),
+ QObject::connect(expandAction, SIGNAL(triggered(bool)),
this->CacheValues, SLOT(expandAll()));
QAction* collapseAction = OptionsMenu->addAction(tr("&Collapse Grouped Entries"));
- QObject::connect(collapseAction, SIGNAL(triggered(bool)),
+ QObject::connect(collapseAction, SIGNAL(triggered(bool)),
this->CacheValues, SLOT(collapseAll()));
QMenu* HelpMenu = this->menuBar()->addMenu(tr("&Help"));
@@ -137,17 +141,17 @@ CMakeSetupDialog::CMakeSetupDialog()
a = HelpMenu->addAction(tr("Help"));
QObject::connect(a, SIGNAL(triggered(bool)),
this, SLOT(doHelp()));
-
+
QShortcut* filterShortcut = new QShortcut(QKeySequence::Find, this);
- QObject::connect(filterShortcut, SIGNAL(activated()),
+ QObject::connect(filterShortcut, SIGNAL(activated()),
this, SLOT(startSearch()));
-
+
this->setAcceptDrops(true);
-
+
// get the saved binary directories
QStringList buildPaths = this->loadBuildPaths();
this->BinaryDirectory->addItems(buildPaths);
-
+
this->BinaryDirectory->setCompleter(new QCMakeFileCompleter(this, true));
this->SourceDirectory->setCompleter(new QCMakeFileCompleter(this, true));
@@ -159,23 +163,23 @@ CMakeSetupDialog::CMakeSetupDialog()
// start the cmake worker thread
this->CMakeThread = new QCMakeThread(this);
QObject::connect(this->CMakeThread, SIGNAL(cmakeInitialized()),
- this, SLOT(initialize()), Qt::QueuedConnection);
+ this, SLOT(initialize()), Qt::QueuedConnection);
this->CMakeThread->start();
-
+
this->enterState(ReadyConfigure);
}
void CMakeSetupDialog::initialize()
{
// now the cmake worker thread is running, lets make our connections to it
- QObject::connect(this->CMakeThread->cmakeInstance(),
+ QObject::connect(this->CMakeThread->cmakeInstance(),
SIGNAL(propertiesChanged(const QCMakePropertyList&)),
this->CacheValues->cacheModel(),
SLOT(setProperties(const QCMakePropertyList&)));
QObject::connect(this->ConfigureButton, SIGNAL(clicked(bool)),
this, SLOT(doConfigure()));
- QObject::connect(this->CMakeThread->cmakeInstance(),
+ QObject::connect(this->CMakeThread->cmakeInstance(),
SIGNAL(configureDone(int)),
this, SLOT(finishConfigure(int)));
QObject::connect(this->CMakeThread->cmakeInstance(),
@@ -184,12 +188,12 @@ void CMakeSetupDialog::initialize()
QObject::connect(this->GenerateButton, SIGNAL(clicked(bool)),
this, SLOT(doGenerate()));
-
+
QObject::connect(this->BrowseSourceDirectoryButton, SIGNAL(clicked(bool)),
this, SLOT(doSourceBrowse()));
QObject::connect(this->BrowseBinaryDirectoryButton, SIGNAL(clicked(bool)),
this, SLOT(doBinaryBrowse()));
-
+
QObject::connect(this->BinaryDirectory, SIGNAL(editTextChanged(QString)),
this, SLOT(onBinaryDirectoryChanged(QString)));
QObject::connect(this->SourceDirectory, SIGNAL(textChanged(QString)),
@@ -201,11 +205,11 @@ void CMakeSetupDialog::initialize()
QObject::connect(this->CMakeThread->cmakeInstance(),
SIGNAL(binaryDirChanged(QString)),
this, SLOT(updateBinaryDirectory(QString)));
-
+
QObject::connect(this->CMakeThread->cmakeInstance(),
SIGNAL(progressChanged(QString, float)),
this, SLOT(showProgress(QString,float)));
-
+
QObject::connect(this->CMakeThread->cmakeInstance(),
SIGNAL(errorMessage(QString)),
this, SLOT(error(QString)));
@@ -218,29 +222,29 @@ void CMakeSetupDialog::initialize()
this, SLOT(setGroupedView(bool)));
QObject::connect(this->advancedCheck, SIGNAL(toggled(bool)),
this, SLOT(setAdvancedView(bool)));
- QObject::connect(this->Search, SIGNAL(textChanged(QString)),
+ QObject::connect(this->Search, SIGNAL(textChanged(QString)),
this, SLOT(setSearchFilter(QString)));
-
+
QObject::connect(this->CMakeThread->cmakeInstance(),
SIGNAL(generatorChanged(QString)),
this, SLOT(updateGeneratorLabel(QString)));
this->updateGeneratorLabel(QString());
-
+
QObject::connect(this->CacheValues->cacheModel(),
- SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+ SIGNAL(dataChanged(QModelIndex,QModelIndex)),
this, SLOT(setCacheModified()));
-
+
QObject::connect(this->CacheValues->selectionModel(),
- SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
+ SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(selectionChanged()));
- QObject::connect(this->RemoveEntry, SIGNAL(clicked(bool)),
+ QObject::connect(this->RemoveEntry, SIGNAL(clicked(bool)),
this, SLOT(removeSelectedCacheEntries()));
- QObject::connect(this->AddEntry, SIGNAL(clicked(bool)),
+ QObject::connect(this->AddEntry, SIGNAL(clicked(bool)),
this, SLOT(addCacheEntry()));
- QObject::connect(this->SuppressDevWarningsAction, SIGNAL(triggered(bool)),
+ QObject::connect(this->SuppressDevWarningsAction, SIGNAL(triggered(bool)),
this->CMakeThread->cmakeInstance(), SLOT(setSuppressDevWarnings(bool)));
-
+
if(!this->SourceDirectory->text().isEmpty() ||
!this->BinaryDirectory->lineEdit()->text().isEmpty())
{
@@ -265,7 +269,7 @@ CMakeSetupDialog::~CMakeSetupDialog()
this->CMakeThread->quit();
this->CMakeThread->wait(2000);
}
-
+
void CMakeSetupDialog::doConfigure()
{
if(this->CurrentState == Configuring)
@@ -287,7 +291,7 @@ void CMakeSetupDialog::doConfigure()
msg += bindir;
QString title = tr("Create Directory");
QMessageBox::StandardButton btn;
- btn = QMessageBox::information(this, title, msg,
+ btn = QMessageBox::information(this, title, msg,
QMessageBox::Yes | QMessageBox::No);
if(btn == QMessageBox::No)
{
@@ -295,8 +299,8 @@ void CMakeSetupDialog::doConfigure()
}
if(!dir.mkpath("."))
{
- QMessageBox::information(this, tr("Create Directory Failed"),
- QString(tr("Failed to create directory %1")).arg(dir.path()),
+ QMessageBox::information(this, tr("Create Directory Failed"),
+ QString(tr("Failed to create directory %1")).arg(dir.path()),
QMessageBox::Ok);
return;
@@ -314,12 +318,12 @@ void CMakeSetupDialog::doConfigure()
// remember path
this->addBinaryPath(dir.absolutePath());
-
+
this->enterState(Configuring);
this->CacheValues->selectionModel()->clear();
QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
- "setProperties", Qt::QueuedConnection,
+ "setProperties", Qt::QueuedConnection,
Q_ARG(QCMakePropertyList,
this->CacheValues->cacheModel()->properties()));
QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
@@ -337,11 +341,11 @@ void CMakeSetupDialog::finishConfigure(int err)
this->enterState(ReadyConfigure);
this->CacheValues->scrollToTop();
}
-
+
if(err != 0)
{
- QMessageBox::critical(this, tr("Error"),
- tr("Error in configuration process, project files may be invalid"),
+ QMessageBox::critical(this, tr("Error"),
+ tr("Error in configuration process, project files may be invalid"),
QMessageBox::Ok);
}
}
@@ -351,7 +355,7 @@ void CMakeSetupDialog::finishGenerate(int err)
this->enterState(ReadyConfigure);
if(err != 0)
{
- QMessageBox::critical(this, tr("Error"),
+ QMessageBox::critical(this, tr("Error"),
tr("Error in generation process, project files may be invalid"),
QMessageBox::Ok);
}
@@ -375,7 +379,7 @@ void CMakeSetupDialog::doGenerate()
QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
"generate", Qt::QueuedConnection);
}
-
+
void CMakeSetupDialog::closeEvent(QCloseEvent* e)
{
// prompt for close if there are unsaved changes, and we're not busy
@@ -466,7 +470,7 @@ void CMakeSetupDialog::doInterrupt()
void CMakeSetupDialog::doSourceBrowse()
{
- QString dir = QFileDialog::getExistingDirectory(this,
+ QString dir = QFileDialog::getExistingDirectory(this,
tr("Enter Path to Source"), this->SourceDirectory->text());
if(!dir.isEmpty())
{
@@ -496,7 +500,7 @@ void CMakeSetupDialog::updateBinaryDirectory(const QString& dir)
void CMakeSetupDialog::doBinaryBrowse()
{
- QString dir = QFileDialog::getExistingDirectory(this,
+ QString dir = QFileDialog::getExistingDirectory(this,
tr("Enter Path to Build"), this->BinaryDirectory->currentText());
if(!dir.isEmpty() && dir != this->BinaryDirectory->currentText())
{
@@ -585,7 +589,7 @@ bool CMakeSetupDialog::setupFirstConfigure()
{
dialog.saveToSettings();
this->CMakeThread->cmakeInstance()->setGenerator(dialog.getGenerator());
-
+
QCMakeCacheModel* m = this->CacheValues->cacheModel();
if(dialog.compilerSetup())
@@ -593,20 +597,20 @@ bool CMakeSetupDialog::setupFirstConfigure()
QString fortranCompiler = dialog.getFortranCompiler();
if(!fortranCompiler.isEmpty())
{
- m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_Fortran_COMPILER",
+ m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_Fortran_COMPILER",
"Fortran compiler.", fortranCompiler, false);
}
QString cxxCompiler = dialog.getCXXCompiler();
if(!cxxCompiler.isEmpty())
{
- m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER",
+ m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER",
"CXX compiler.", cxxCompiler, false);
}
-
+
QString cCompiler = dialog.getCCompiler();
if(!cCompiler.isEmpty())
{
- m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER",
+ m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER",
"C compiler.", cCompiler, false);
}
}
@@ -615,38 +619,38 @@ bool CMakeSetupDialog::setupFirstConfigure()
QString fortranCompiler = dialog.getFortranCompiler();
if(!fortranCompiler.isEmpty())
{
- m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_Fortran_COMPILER",
+ m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_Fortran_COMPILER",
"Fortran compiler.", fortranCompiler, false);
}
QString mode = dialog.getCrossIncludeMode();
- m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE",
+ m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE",
"CMake Find Include Mode", mode, false);
mode = dialog.getCrossLibraryMode();
- m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY",
+ m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY",
"CMake Find Library Mode", mode, false);
mode = dialog.getCrossProgramMode();
- m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM",
+ m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM",
"CMake Find Program Mode", mode, false);
-
+
QString rootPath = dialog.getCrossRoot();
- m->insertProperty(QCMakeProperty::PATH, "CMAKE_FIND_ROOT_PATH",
+ m->insertProperty(QCMakeProperty::PATH, "CMAKE_FIND_ROOT_PATH",
"CMake Find Root Path", rootPath, false);
QString systemName = dialog.getSystemName();
- m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_NAME",
+ m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_NAME",
"CMake System Name", systemName, false);
QString cxxCompiler = dialog.getCXXCompiler();
- m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER",
+ m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER",
"CXX compiler.", cxxCompiler, false);
QString cCompiler = dialog.getCCompiler();
- m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER",
+ m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER",
"C compiler.", cCompiler, false);
}
else if(dialog.crossCompilerToolChainFile())
{
QString toolchainFile = dialog.getCrossCompilerToolChainFile();
- m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE",
+ m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE",
"Cross Compile ToolChain File", toolchainFile, false);
}
return true;
@@ -676,11 +680,11 @@ void CMakeSetupDialog::doReloadCache()
}
void CMakeSetupDialog::doDeleteCache()
-{
+{
QString title = tr("Delete Cache");
QString msg = "Are you sure you want to delete the cache?";
QMessageBox::StandardButton btn;
- btn = QMessageBox::information(this, title, msg,
+ btn = QMessageBox::information(this, title, msg,
QMessageBox::Yes | QMessageBox::No);
if(btn == QMessageBox::No)
{
@@ -721,7 +725,7 @@ void CMakeSetupDialog::setExitAfterGenerate(bool b)
void CMakeSetupDialog::addBinaryPath(const QString& path)
{
QString cleanpath = QDir::cleanPath(path);
-
+
// update UI
this->BinaryDirectory->blockSignals(true);
int idx = this->BinaryDirectory->findText(cleanpath);
@@ -732,7 +736,7 @@ void CMakeSetupDialog::addBinaryPath(const QString& path)
this->BinaryDirectory->insertItem(0, cleanpath);
this->BinaryDirectory->setCurrentIndex(0);
this->BinaryDirectory->blockSignals(false);
-
+
// save to registry
QStringList buildPaths = this->loadBuildPaths();
buildPaths.removeAll(cleanpath);
@@ -742,7 +746,7 @@ void CMakeSetupDialog::addBinaryPath(const QString& path)
void CMakeSetupDialog::dragEnterEvent(QDragEnterEvent* e)
{
- if(!(this->CurrentState == ReadyConfigure ||
+ if(!(this->CurrentState == ReadyConfigure ||
this->CurrentState == ReadyGenerate))
{
e->ignore();
@@ -752,7 +756,7 @@ void CMakeSetupDialog::dragEnterEvent(QDragEnterEvent* e)
const QMimeData* dat = e->mimeData();
QList<QUrl> urls = dat->urls();
QString file = urls.count() ? urls[0].toLocalFile() : QString();
- if(!file.isEmpty() &&
+ if(!file.isEmpty() &&
(file.endsWith("CMakeCache.txt", Qt::CaseInsensitive) ||
file.endsWith("CMakeLists.txt", Qt::CaseInsensitive) ) )
{
@@ -766,7 +770,7 @@ void CMakeSetupDialog::dragEnterEvent(QDragEnterEvent* e)
void CMakeSetupDialog::dropEvent(QDropEvent* e)
{
- if(!(this->CurrentState == ReadyConfigure ||
+ if(!(this->CurrentState == ReadyConfigure ||
this->CurrentState == ReadyGenerate))
{
return;
@@ -801,7 +805,7 @@ QStringList CMakeSetupDialog::loadBuildPaths()
QStringList buildPaths;
for(int i=0; i<10; i++)
- {
+ {
QString p = settings.value(QString("WhereBuild%1").arg(i)).toString();
if(!p.isEmpty())
{
@@ -823,11 +827,11 @@ void CMakeSetupDialog::saveBuildPaths(const QStringList& paths)
}
for(int i=0; i<num; i++)
- {
+ {
settings.setValue(QString("WhereBuild%1").arg(i), paths[i]);
}
}
-
+
void CMakeSetupDialog::setCacheModified()
{
this->CacheModified = true;
@@ -851,8 +855,8 @@ void CMakeSetupDialog::removeSelectedCacheEntries()
void CMakeSetupDialog::selectionChanged()
{
QModelIndexList idxs = this->CacheValues->selectionModel()->selectedRows();
- if(idxs.count() &&
- (this->CurrentState == ReadyConfigure ||
+ if(idxs.count() &&
+ (this->CurrentState == ReadyConfigure ||
this->CurrentState == ReadyGenerate) )
{
this->RemoveEntry->setEnabled(true);
@@ -862,7 +866,7 @@ void CMakeSetupDialog::selectionChanged()
this->RemoveEntry->setEnabled(false);
}
}
-
+
void CMakeSetupDialog::enterState(CMakeSetupDialog::State s)
{
if(s == this->CurrentState)
@@ -953,16 +957,19 @@ void CMakeSetupDialog::setGroupedView(bool v)
{
this->CacheValues->cacheModel()->setViewType(v ? QCMakeCacheModel::GroupView : QCMakeCacheModel::FlatView);
this->CacheValues->setRootIsDecorated(v);
-
+
QSettings settings;
settings.beginGroup("Settings/StartPath");
settings.setValue("GroupView", v);
-
+
}
void CMakeSetupDialog::setAdvancedView(bool v)
{
this->CacheValues->setShowAdvanced(v);
+ QSettings settings;
+ settings.beginGroup("Settings/StartPath");
+ settings.setValue("AdvancedView", v);
}
void CMakeSetupDialog::showUserChanges()
@@ -984,7 +991,7 @@ void CMakeSetupDialog::showUserChanges()
QString command;
QString cache;
-
+
foreach(QCMakeProperty prop, changes)
{
QString type;
@@ -1020,13 +1027,13 @@ void CMakeSetupDialog::showUserChanges()
command += QString("-D%1\"%2\" ").arg(line).arg(value);
cache += QString("%1%2\n").arg(line).arg(value);
}
-
+
textedit->append(tr("Commandline options:"));
textedit->append(command);
textedit->append("\n");
textedit->append(tr("Cache file:"));
textedit->append(cache);
-
+
dialog.exec();
}
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
new file mode 100644
index 0000000..d9e4742
--- /dev/null
+++ b/Source/cmArchiveWrite.cxx
@@ -0,0 +1,299 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2010 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#include "cmArchiveWrite.h"
+
+#include "cmSystemTools.h"
+#include <cmsys/ios/iostream>
+#include <cmsys/Directory.hxx>
+#include <cm_libarchive.h>
+
+//----------------------------------------------------------------------------
+class cmArchiveWrite::Entry
+{
+ struct archive_entry* Object;
+public:
+ Entry(): Object(archive_entry_new()) {}
+ ~Entry() { archive_entry_free(this->Object); }
+ operator struct archive_entry*() { return this->Object; }
+};
+
+//----------------------------------------------------------------------------
+struct cmArchiveWrite::Callback
+{
+ // archive_write_callback
+ static __LA_SSIZE_T Write(struct archive*, void *cd,
+ const void *b, size_t n)
+ {
+ cmArchiveWrite* self = static_cast<cmArchiveWrite*>(cd);
+ if(self->Stream.write(static_cast<const char*>(b),
+ static_cast<cmsys_ios::streamsize>(n)))
+ {
+ return static_cast<__LA_SSIZE_T>(n);
+ }
+ else
+ {
+ return static_cast<__LA_SSIZE_T>(-1);
+ }
+ }
+};
+
+//----------------------------------------------------------------------------
+cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t):
+ Stream(os),
+ Archive(archive_write_new()),
+ Disk(archive_read_disk_new()),
+ Verbose(false)
+{
+ switch (c)
+ {
+ case CompressNone:
+ if(archive_write_set_compression_none(this->Archive) != ARCHIVE_OK)
+ {
+ this->Error = "archive_write_set_compression_none: ";
+ this->Error += archive_error_string(this->Archive);
+ return;
+ }
+ break;
+ case CompressCompress:
+ if(archive_write_set_compression_compress(this->Archive) != ARCHIVE_OK)
+ {
+ this->Error = "archive_write_set_compression_compress: ";
+ this->Error += archive_error_string(this->Archive);
+ return;
+ }
+ break;
+ case CompressGZip:
+ if(archive_write_set_compression_gzip(this->Archive) != ARCHIVE_OK)
+ {
+ this->Error = "archive_write_set_compression_gzip: ";
+ this->Error += archive_error_string(this->Archive);
+ return;
+ }
+ break;
+ case CompressBZip2:
+ if(archive_write_set_compression_bzip2(this->Archive) != ARCHIVE_OK)
+ {
+ this->Error = "archive_write_set_compression_bzip2: ";
+ this->Error += archive_error_string(this->Archive);
+ return;
+ }
+ break;
+ case CompressLZMA:
+ if(archive_write_set_compression_lzma(this->Archive) != ARCHIVE_OK)
+ {
+ this->Error = "archive_write_set_compression_lzma: ";
+ this->Error += archive_error_string(this->Archive);
+ return;
+ }
+ break;
+ case CompressXZ:
+ if(archive_write_set_compression_xz(this->Archive) != ARCHIVE_OK)
+ {
+ this->Error = "archive_write_set_compression_xz: ";
+ this->Error += archive_error_string(this->Archive);
+ return;
+ }
+ break;
+ };
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ if (archive_read_disk_set_standard_lookup(this->Disk) != ARCHIVE_OK)
+ {
+ this->Error = "archive_read_disk_set_standard_lookup: ";
+ this->Error += archive_error_string(this->Archive);
+ return;;
+ }
+#endif
+ switch (t)
+ {
+ case TypeZIP:
+ if(archive_write_set_format_zip(this->Archive) != ARCHIVE_OK)
+ {
+ this->Error = "archive_write_set_format_zip: ";
+ this->Error += archive_error_string(this->Archive);
+ return;
+ }
+ break;
+ case TypeTAR:
+ if(archive_write_set_format_pax_restricted(this->Archive) != ARCHIVE_OK)
+ {
+ this->Error = "archive_write_set_format_pax_restricted: ";
+ this->Error += archive_error_string(this->Archive);
+ return;
+ }
+ break;
+ }
+
+ // do not pad the last block!!
+ if (archive_write_set_bytes_in_last_block(this->Archive, 1))
+ {
+ this->Error = "archive_write_set_bytes_in_last_block: ";
+ this->Error += archive_error_string(this->Archive);
+ return;
+ }
+
+ if(archive_write_open(
+ this->Archive, this, 0,
+ reinterpret_cast<archive_write_callback*>(&Callback::Write),
+ 0) != ARCHIVE_OK)
+ {
+ this->Error = "archive_write_open: ";
+ this->Error += archive_error_string(this->Archive);
+ return;
+ }
+}
+
+//----------------------------------------------------------------------------
+cmArchiveWrite::~cmArchiveWrite()
+{
+ archive_read_finish(this->Disk);
+ archive_write_finish(this->Archive);
+}
+
+//----------------------------------------------------------------------------
+bool cmArchiveWrite::Add(std::string path, size_t skip, const char* prefix)
+{
+ if(this->Okay())
+ {
+ if(!path.empty() && path[path.size()-1] == '/')
+ {
+ path.erase(path.size()-1);
+ }
+ this->AddPath(path.c_str(), skip, prefix);
+ }
+ return this->Okay();
+}
+
+//----------------------------------------------------------------------------
+bool cmArchiveWrite::AddPath(const char* path,
+ size_t skip, const char* prefix)
+{
+ if(!this->AddFile(path, skip, prefix))
+ {
+ return false;
+ }
+ if(!cmSystemTools::FileIsDirectory(path))
+ {
+ return true;
+ }
+ cmsys::Directory d;
+ if(d.Load(path))
+ {
+ std::string next = path;
+ next += "/";
+ std::string::size_type end = next.size();
+ unsigned long n = d.GetNumberOfFiles();
+ for(unsigned long i = 0; i < n; ++i)
+ {
+ const char* file = d.GetFile(i);
+ if(strcmp(file, ".") != 0 && strcmp(file, "..") != 0)
+ {
+ next.erase(end);
+ next += file;
+ if(!this->AddPath(next.c_str(), skip, prefix))
+ {
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmArchiveWrite::AddFile(const char* file,
+ size_t skip, const char* prefix)
+{
+ // Skip the file if we have no name for it. This may happen on a
+ // top-level directory, which does not need to be included anyway.
+ if(skip >= strlen(file))
+ {
+ return true;
+ }
+ const char* out = file + skip;
+
+ // Meta-data.
+ std::string dest = prefix? prefix : "";
+ dest += out;
+ if(this->Verbose)
+ {
+ std::cout << dest << "\n";
+ }
+ Entry e;
+ archive_entry_copy_sourcepath(e, file);
+ archive_entry_set_pathname(e, dest.c_str());
+ if(archive_read_disk_entry_from_file(this->Disk, e, -1, 0) != ARCHIVE_OK)
+ {
+ this->Error = "archive_read_disk_entry_from_file: ";
+ this->Error += archive_error_string(this->Disk);
+ return false;
+ }
+ if(archive_write_header(this->Archive, e) != ARCHIVE_OK)
+ {
+ this->Error = "archive_write_header: ";
+ this->Error += archive_error_string(this->Archive);
+ return false;
+ }
+
+ // Content.
+ if(size_t size = static_cast<size_t>(archive_entry_size(e)))
+ {
+ return this->AddData(file, size);
+ }
+ return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmArchiveWrite::AddData(const char* file, size_t size)
+{
+ std::ifstream fin(file, std::ios::in | cmsys_ios_binary);
+ if(!fin)
+ {
+ this->Error = "Error opening \"";
+ this->Error += file;
+ this->Error += "\": ";
+ this->Error += cmSystemTools::GetLastSystemError();
+ return false;
+ }
+
+ char buffer[16384];
+ size_t nleft = size;
+ while(nleft > 0)
+ {
+ typedef cmsys_ios::streamsize ssize_type;
+ size_t const nnext = nleft > sizeof(buffer)? sizeof(buffer) : nleft;
+ ssize_type const nnext_s = static_cast<ssize_type>(nnext);
+ fin.read(buffer, nnext_s);
+ // Some stream libraries (older HPUX) return failure at end of
+ // file on the last read even if some data were read. Check
+ // gcount instead of trusting the stream error status.
+ if(static_cast<size_t>(fin.gcount()) != nnext)
+ {
+ break;
+ }
+ if(archive_write_data(this->Archive, buffer, nnext) != nnext_s)
+ {
+ this->Error = "archive_write_data: ";
+ this->Error += archive_error_string(this->Archive);
+ return false;
+ }
+ nleft -= nnext;
+ }
+ if(nleft > 0)
+ {
+ this->Error = "Error reading \"";
+ this->Error += file;
+ this->Error += "\": ";
+ this->Error += cmSystemTools::GetLastSystemError();
+ return false;
+ }
+ return true;
+}
diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h
new file mode 100644
index 0000000..3e3b2f0
--- /dev/null
+++ b/Source/cmArchiveWrite.h
@@ -0,0 +1,94 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2010 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cmArchiveWrite_h
+#define cmArchiveWrite_h
+
+#include "cmStandardIncludes.h"
+
+#if !defined(CMAKE_BUILD_WITH_CMAKE)
+# error "cmArchiveWrite not allowed during bootstrap build!"
+#endif
+
+/** \class cmArchiveWrite
+ * \brief Wrapper around libarchive for writing.
+ *
+ */
+class cmArchiveWrite
+{
+ typedef void (cmArchiveWrite::* safe_bool)();
+ void safe_bool_true() {}
+public:
+ /** Compression type. */
+ enum Compress
+ {
+ CompressNone,
+ CompressCompress,
+ CompressGZip,
+ CompressBZip2,
+ CompressLZMA,
+ CompressXZ
+ };
+
+ /** Archive Type */
+ enum Type
+ {
+ TypeTAR,
+ TypeZIP
+ };
+
+ /** Construct with output stream to which to write archive. */
+ cmArchiveWrite(std::ostream& os, Compress c = CompressNone, Type = TypeTAR);
+ ~cmArchiveWrite();
+
+ /**
+ * Add a path (file or directory) to the archive. Directories are
+ * added recursively. The "path" must be readable on disk, either
+ * full path or relative to current working directory. The "skip"
+ * value indicates how many leading bytes from the input path to
+ * skip. The remaining part of the input path is appended to the
+ * "prefix" value to construct the final name in the archive.
+ */
+ bool Add(std::string path, size_t skip = 0, const char* prefix = 0);
+
+ /** Returns true if there has been no error. */
+ operator safe_bool() const
+ { return this->Okay()? &cmArchiveWrite::safe_bool_true : 0; }
+
+ /** Returns true if there has been an error. */
+ bool operator!() const { return !this->Okay(); }
+
+ /** Return the error string; empty if none. */
+ std::string GetError() const { return this->Error; }
+
+ // TODO: More general callback instead of hard-coding calls to
+ // std::cout.
+ void SetVerbose(bool v) { this->Verbose = v; }
+
+private:
+ bool Okay() const { return this->Error.empty(); }
+ bool AddPath(const char* path, size_t skip, const char* prefix);
+ bool AddFile(const char* file, size_t skip, const char* prefix);
+ bool AddData(const char* file, size_t size);
+
+ struct Callback;
+ friend struct Callback;
+
+ class Entry;
+
+ std::ostream& Stream;
+ struct archive* Archive;
+ struct archive* Disk;
+ bool Verbose;
+ std::string Error;
+};
+
+#endif
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index bd69d6c..2e05883 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -304,6 +304,7 @@ cmCTest::cmCTest()
this->ShowOnly = false;
this->RunConfigurationScript = false;
this->UseHTTP10 = false;
+ this->PrintLabels = false;
this->CompressTestOutput = true;
this->ComputedCompressOutput = false;
this->TestModel = cmCTest::EXPERIMENTAL;
@@ -410,10 +411,14 @@ std::string cmCTest::GetCDashVersion()
//First query the server. If that fails, fall back to the local setting
std::string response;
std::string url = "http://";
- url += this->GetCTestConfiguration("DropSite") + "/CDash/api/getversion.php";
-
+ url += this->GetCTestConfiguration("DropSite");
+
+ std::string cdashUri = this->GetCTestConfiguration("DropLocation");
+ cdashUri = cdashUri.substr(0, cdashUri.find("/submit.php"));
+
+ url += cdashUri + "/api/getversion.php";
int res = cmCTest::HTTPRequest(url, cmCTest::HTTP_GET, response, "", "", 3);
-
+
return res ? this->GetCTestConfiguration("CDashVersion") : response;
#else
return this->GetCTestConfiguration("CDashVersion");
@@ -485,10 +490,6 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
return 0;
}
- // call this so that the information is cached up front
- // and not the first time EndTest is called.
- this->ShouldCompressTestOutput();
-
if ( this->ProduceXML )
{
// Verify "Testing" directory exists:
@@ -1169,7 +1170,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
if ( tick % tick_line_len == 0 && tick > 0 )
{
cmCTestLog(this, HANDLER_OUTPUT, " Size: "
- << int((output->size() / 1024.0) + 1) << "K" << std::endl
+ << int((double(output->size()) / 1024.0) + 1) << "K" << std::endl
<< " " << std::flush);
}
}
@@ -1181,7 +1182,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
}
}
cmCTestLog(this, OUTPUT, " Size of output: "
- << int(output->size() / 1024.0) << "K" << std::endl);
+ << int(double(output->size()) / 1024.0) << "K" << std::endl);
cmsysProcess_WaitForExit(cp, 0);
@@ -1873,6 +1874,11 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
this->CompressTestOutput = false;
}
+ if(this->CheckArgument(arg, "--print-labels"))
+ {
+ this->PrintLabels = true;
+ }
+
if(this->CheckArgument(arg, "--http1.0"))
{
this->UseHTTP10 = true;
@@ -2121,7 +2127,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
i++;
std::string targ = args[i];
// AddTestsForDashboard parses the dashborad type and converts it
- // into the seperate stages
+ // into the separate stages
if (!this->AddTestsForDashboardType(targ))
{
performSomeTest = false;
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 3d7d117..e54a205 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -210,6 +210,8 @@ public:
bool ShouldUseHTTP10() { return this->UseHTTP10; }
+ bool ShouldPrintLabels() { return this->PrintLabels; }
+
bool ShouldCompressTestOutput();
std::string GetCDashVersion();
@@ -413,6 +415,7 @@ private:
bool ProduceXML;
bool LabelSummary;
bool UseHTTP10;
+ bool PrintLabels;
bool Failover;
bool BatchJobs;
diff --git a/Source/cmComputeComponentGraph.cxx b/Source/cmComputeComponentGraph.cxx
index 3f2a361..5bec6a1 100644
--- a/Source/cmComputeComponentGraph.cxx
+++ b/Source/cmComputeComponentGraph.cxx
@@ -71,8 +71,8 @@ void cmComputeComponentGraph::TarjanVisit(int i)
this->TarjanStack.push(i);
// Follow outgoing edges.
- NodeList const& nl = this->InputGraph[i];
- for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
+ EdgeList const& nl = this->InputGraph[i];
+ for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
{
int j = *ni;
@@ -142,14 +142,17 @@ void cmComputeComponentGraph::TransferEdges()
for(int i=0; i < n; ++i)
{
int i_component = this->TarjanComponents[i];
- NodeList const& nl = this->InputGraph[i];
- for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
+ EdgeList const& nl = this->InputGraph[i];
+ for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
{
int j = *ni;
int j_component = this->TarjanComponents[j];
if(i_component != j_component)
{
- this->ComponentGraph[i_component].push_back(j_component);
+ // We do not attempt to combine duplicate edges, but instead
+ // store the inter-component edges with suitable multiplicity.
+ this->ComponentGraph[i_component].push_back(
+ cmGraphEdge(j_component, ni->IsStrong()));
}
}
}
diff --git a/Source/cmComputeComponentGraph.h b/Source/cmComputeComponentGraph.h
index 855a141..a2ce946 100644
--- a/Source/cmComputeComponentGraph.h
+++ b/Source/cmComputeComponentGraph.h
@@ -33,6 +33,7 @@ class cmComputeComponentGraph
public:
// Represent the graph with an adjacency list.
typedef cmGraphNodeList NodeList;
+ typedef cmGraphEdgeList EdgeList;
typedef cmGraphAdjacencyList Graph;
cmComputeComponentGraph(Graph const& input);
@@ -41,7 +42,7 @@ public:
/** Get the adjacency list of the component graph. */
Graph const& GetComponentGraph() const
{ return this->ComponentGraph; }
- NodeList const& GetComponentGraphEdges(int c) const
+ EdgeList const& GetComponentGraphEdges(int c) const
{ return this->ComponentGraph[c]; }
/** Get map from component index to original node indices. */
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 24410ec..342c217 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -285,7 +285,7 @@ cmComputeLinkDepends::AllocateLinkEntry(std::string const& item)
lei = this->LinkEntryIndex.insert(index_entry).first;
this->EntryList.push_back(LinkEntry());
this->InferredDependSets.push_back(0);
- this->EntryConstraintGraph.push_back(NodeList());
+ this->EntryConstraintGraph.push_back(EdgeList());
return lei;
}
@@ -669,7 +669,7 @@ void cmComputeLinkDepends::CleanConstraintGraph()
cmsys_stl::sort(i->begin(), i->end());
// Make the edge list unique.
- NodeList::iterator last = cmsys_stl::unique(i->begin(), i->end());
+ EdgeList::iterator last = cmsys_stl::unique(i->begin(), i->end());
i->erase(last, i->end());
}
}
@@ -681,9 +681,9 @@ void cmComputeLinkDepends::DisplayConstraintGraph()
cmOStringStream e;
for(unsigned int i=0; i < this->EntryConstraintGraph.size(); ++i)
{
- NodeList const& nl = this->EntryConstraintGraph[i];
+ EdgeList const& nl = this->EntryConstraintGraph[i];
e << "item " << i << " is [" << this->EntryList[i].Item << "]\n";
- for(NodeList::const_iterator j = nl.begin(); j != nl.end(); ++j)
+ for(EdgeList::const_iterator j = nl.begin(); j != nl.end(); ++j)
{
e << " item " << *j << " must follow it\n";
}
@@ -758,10 +758,11 @@ cmComputeLinkDepends::DisplayComponents()
fprintf(stderr, " item %d [%s]\n", i,
this->EntryList[i].Item.c_str());
}
- NodeList const& ol = this->CCG->GetComponentGraphEdges(c);
- for(NodeList::const_iterator oi = ol.begin(); oi != ol.end(); ++oi)
+ EdgeList const& ol = this->CCG->GetComponentGraphEdges(c);
+ for(EdgeList::const_iterator oi = ol.begin(); oi != ol.end(); ++oi)
{
- fprintf(stderr, " followed by Component (%d)\n", *oi);
+ int i = *oi;
+ fprintf(stderr, " followed by Component (%d)\n", i);
}
fprintf(stderr, " topo order index %d\n",
this->ComponentOrder[c]);
@@ -784,8 +785,8 @@ void cmComputeLinkDepends::VisitComponent(unsigned int c)
// Visit the neighbors of the component first.
// Run in reverse order so the topological order will preserve the
// original order where there are no constraints.
- NodeList const& nl = this->CCG->GetComponentGraphEdges(c);
- for(NodeList::const_reverse_iterator ni = nl.rbegin();
+ EdgeList const& nl = this->CCG->GetComponentGraphEdges(c);
+ for(EdgeList::const_reverse_iterator ni = nl.rbegin();
ni != nl.rend(); ++ni)
{
this->VisitComponent(*ni);
@@ -856,8 +857,8 @@ void cmComputeLinkDepends::VisitEntry(int index)
// are now pending.
if(completed)
{
- NodeList const& ol = this->CCG->GetComponentGraphEdges(component);
- for(NodeList::const_iterator oi = ol.begin(); oi != ol.end(); ++oi)
+ EdgeList const& ol = this->CCG->GetComponentGraphEdges(component);
+ for(EdgeList::const_iterator oi = ol.begin(); oi != ol.end(); ++oi)
{
// This entire component is now pending no matter whether it has
// been partially seen already.
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index a08afb6..e196e00 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -117,6 +117,7 @@ private:
// Ordering constraint graph adjacency list.
typedef cmGraphNodeList NodeList;
+ typedef cmGraphEdgeList EdgeList;
typedef cmGraphAdjacencyList Graph;
Graph EntryConstraintGraph;
void CleanConstraintGraph();
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 94b8527..313c680 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -129,7 +129,10 @@ bool cmComputeTargetDepends::Compute()
}
// Compute the final dependency graph.
- this->ComputeFinalDepends(ccg);
+ if(!this->ComputeFinalDepends(ccg))
+ {
+ return false;
+ }
if(this->DebugMode)
{
this->DisplayGraph(this->FinalGraph, "final");
@@ -150,8 +153,8 @@ cmComputeTargetDepends::GetTargetDirectDepends(cmTarget* t,
int i = tii->second;
// Get its final dependencies.
- NodeList const& nl = this->FinalGraph[i];
- for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
+ EdgeList const& nl = this->FinalGraph[i];
+ for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
{
deps.insert(this->Targets[*ni]);
}
@@ -195,15 +198,13 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
// Get the depender.
cmTarget* depender = this->Targets[depender_index];
- // Keep track of dependencies already listed.
- std::set<cmStdString> emitted;
-
- // A target should not depend on itself.
- emitted.insert(depender->GetName());
-
// Loop over all targets linked directly.
+ {
cmTarget::LinkLibraryVectorType const& tlibs =
depender->GetOriginalLinkLibraries();
+ std::set<cmStdString> emitted;
+ // A target should not depend on itself.
+ emitted.insert(depender->GetName());
for(cmTarget::LinkLibraryVectorType::const_iterator lib = tlibs.begin();
lib != tlibs.end(); ++lib)
{
@@ -213,9 +214,14 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
this->AddTargetDepend(depender_index, lib->first.c_str(), true);
}
}
+ }
// Loop over all utility dependencies.
+ {
std::set<cmStdString> const& tutils = depender->GetUtilities();
+ std::set<cmStdString> emitted;
+ // A target should not depend on itself.
+ emitted.insert(depender->GetName());
for(std::set<cmStdString>::const_iterator util = tutils.begin();
util != tutils.end(); ++util)
{
@@ -225,6 +231,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
this->AddTargetDepend(depender_index, util->c_str(), false);
}
}
+ }
}
//----------------------------------------------------------------------------
@@ -272,7 +279,8 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
int dependee_index = tii->second;
// Add this entry to the dependency graph.
- this->InitialGraph[depender_index].push_back(dependee_index);
+ this->InitialGraph[depender_index].push_back(
+ cmGraphEdge(dependee_index, !linking));
}
//----------------------------------------------------------------------------
@@ -283,16 +291,16 @@ cmComputeTargetDepends::DisplayGraph(Graph const& graph, const char* name)
int n = static_cast<int>(graph.size());
for(int depender_index = 0; depender_index < n; ++depender_index)
{
- NodeList const& nl = graph[depender_index];
+ EdgeList const& nl = graph[depender_index];
cmTarget* depender = this->Targets[depender_index];
fprintf(stderr, "target %d is [%s]\n",
depender_index, depender->GetName());
- for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
+ for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
{
int dependee_index = *ni;
cmTarget* dependee = this->Targets[dependee_index];
- fprintf(stderr, " depends on target %d [%s]\n", dependee_index,
- dependee->GetName());
+ fprintf(stderr, " depends on target %d [%s] (%s)\n", dependee_index,
+ dependee->GetName(), ni->IsStrong()? "strong" : "weak");
}
}
fprintf(stderr, "\n");
@@ -363,7 +371,8 @@ cmComputeTargetDepends
//----------------------------------------------------------------------------
void
cmComputeTargetDepends
-::ComplainAboutBadComponent(cmComputeComponentGraph const& ccg, int c)
+::ComplainAboutBadComponent(cmComputeComponentGraph const& ccg, int c,
+ bool strong)
{
// Construct the error message.
cmOStringStream e;
@@ -383,18 +392,27 @@ cmComputeTargetDepends
<< cmTarget::TargetTypeNames[depender->GetType()] << "\n";
// List its dependencies that are inside the component.
- NodeList const& nl = this->InitialGraph[i];
- for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
+ EdgeList const& nl = this->InitialGraph[i];
+ for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
{
int j = *ni;
if(cmap[j] == c)
{
cmTarget* dependee = this->Targets[j];
- e << " depends on \"" << dependee->GetName() << "\"\n";
+ e << " depends on \"" << dependee->GetName() << "\""
+ << " (" << (ni->IsStrong()? "strong" : "weak") << ")\n";
}
}
}
- if(this->NoCycles)
+ if(strong)
+ {
+ // Custom command executable dependencies cannot occur within a
+ // component of static libraries. The cycle must appear in calls
+ // to add_dependencies.
+ e << "The component contains at least one cycle consisting of strong "
+ << "dependencies (created by add_dependencies) that cannot be broken.";
+ }
+ else if(this->NoCycles)
{
e << "The GLOBAL_DEPENDS_NO_CYCLES global property is enabled, so "
<< "cyclic dependencies are not allowed even among static libraries.";
@@ -408,7 +426,49 @@ cmComputeTargetDepends
}
//----------------------------------------------------------------------------
-void
+bool
+cmComputeTargetDepends
+::IntraComponent(std::vector<int> const& cmap, int c, int i, int* head,
+ std::set<int>& emitted, std::set<int>& visited)
+{
+ if(!visited.insert(i).second)
+ {
+ // Cycle in utility depends!
+ return false;
+ }
+ if(emitted.insert(i).second)
+ {
+ // Honor strong intra-component edges in the final order.
+ EdgeList const& el = this->InitialGraph[i];
+ for(EdgeList::const_iterator ei = el.begin(); ei != el.end(); ++ei)
+ {
+ int j = *ei;
+ if(cmap[j] == c && ei->IsStrong())
+ {
+ this->FinalGraph[i].push_back(j);
+ if(!this->IntraComponent(cmap, c, j, head, emitted, visited))
+ {
+ return false;
+ }
+ }
+ }
+
+ // Prepend to a linear linked-list of intra-component edges.
+ if(*head >= 0)
+ {
+ this->FinalGraph[i].push_back(*head);
+ }
+ else
+ {
+ this->ComponentTail[c] = i;
+ }
+ *head = i;
+ }
+ return true;
+}
+
+//----------------------------------------------------------------------------
+bool
cmComputeTargetDepends
::ComputeFinalDepends(cmComputeComponentGraph const& ccg)
{
@@ -420,34 +480,43 @@ cmComputeTargetDepends
this->FinalGraph.resize(0);
this->FinalGraph.resize(this->InitialGraph.size());
+ // Choose intra-component edges to linearize dependencies.
+ std::vector<int> const& cmap = ccg.GetComponentMap();
+ this->ComponentHead.resize(components.size());
+ this->ComponentTail.resize(components.size());
+ int nc = static_cast<int>(components.size());
+ for(int c=0; c < nc; ++c)
+ {
+ int head = -1;
+ std::set<int> emitted;
+ NodeList const& nl = components[c];
+ for(NodeList::const_reverse_iterator ni = nl.rbegin();
+ ni != nl.rend(); ++ni)
+ {
+ std::set<int> visited;
+ if(!this->IntraComponent(cmap, c, *ni, &head, emitted, visited))
+ {
+ // Cycle in add_dependencies within component!
+ this->ComplainAboutBadComponent(ccg, c, true);
+ return false;
+ }
+ }
+ this->ComponentHead[c] = head;
+ }
+
// Convert inter-component edges to connect component tails to heads.
int n = static_cast<int>(cgraph.size());
for(int depender_component=0; depender_component < n; ++depender_component)
{
- int depender_component_tail = components[depender_component].back();
- NodeList const& nl = cgraph[depender_component];
- for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
+ int depender_component_tail = this->ComponentTail[depender_component];
+ EdgeList const& nl = cgraph[depender_component];
+ for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
{
int dependee_component = *ni;
- int dependee_component_head = components[dependee_component].front();
+ int dependee_component_head = this->ComponentHead[dependee_component];
this->FinalGraph[depender_component_tail]
.push_back(dependee_component_head);
}
}
-
- // Compute intra-component edges.
- int nc = static_cast<int>(components.size());
- for(int c=0; c < nc; ++c)
- {
- // Within the component each target depends on that following it.
- NodeList const& nl = components[c];
- NodeList::const_iterator ni = nl.begin();
- int last_i = *ni;
- for(++ni; ni != nl.end(); ++ni)
- {
- int i = *ni;
- this->FinalGraph[last_i].push_back(i);
- last_i = i;
- }
- }
+ return true;
}
diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h
index 68e3e47..240de76 100644
--- a/Source/cmComputeTargetDepends.h
+++ b/Source/cmComputeTargetDepends.h
@@ -45,7 +45,7 @@ private:
void CollectTargetDepends(int depender_index);
void AddTargetDepend(int depender_index, const char* dependee_name,
bool linking);
- void ComputeFinalDepends(cmComputeComponentGraph const& ccg);
+ bool ComputeFinalDepends(cmComputeComponentGraph const& ccg);
cmGlobalGenerator* GlobalGenerator;
bool DebugMode;
@@ -59,6 +59,7 @@ private:
// top-level index corresponds to a depender whose dependencies are
// listed.
typedef cmGraphNodeList NodeList;
+ typedef cmGraphEdgeList EdgeList;
typedef cmGraphAdjacencyList Graph;
Graph InitialGraph;
Graph FinalGraph;
@@ -67,7 +68,13 @@ private:
// Deal with connected components.
void DisplayComponents(cmComputeComponentGraph const& ccg);
bool CheckComponents(cmComputeComponentGraph const& ccg);
- void ComplainAboutBadComponent(cmComputeComponentGraph const& ccg, int c);
+ void ComplainAboutBadComponent(cmComputeComponentGraph const& ccg, int c,
+ bool strong = false);
+
+ std::vector<int> ComponentHead;
+ std::vector<int> ComponentTail;
+ bool IntraComponent(std::vector<int> const& cmap, int c, int i, int* head,
+ std::set<int>& emitted, std::set<int>& visited);
};
#endif
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index dab0c0d..b8a0c95 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -175,6 +175,23 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
{
fprintf(fout, "SET(CMAKE_MODULE_PATH %s)\n", def);
}
+
+ const char* rulesOverrideBase = "CMAKE_USER_MAKE_RULES_OVERRIDE";
+ std::string rulesOverrideLang =
+ rulesOverrideBase + (lang ? std::string("_") + lang : std::string(""));
+ if(const char* rulesOverridePath =
+ this->Makefile->GetDefinition(rulesOverrideLang.c_str()))
+ {
+ fprintf(fout, "SET(%s \"%s\")\n",
+ rulesOverrideLang.c_str(), rulesOverridePath);
+ }
+ else if(const char* rulesOverridePath2 =
+ this->Makefile->GetDefinition(rulesOverrideBase))
+ {
+ fprintf(fout, "SET(%s \"%s\")\n",
+ rulesOverrideBase, rulesOverridePath2);
+ }
+
if(lang)
{
fprintf(fout, "PROJECT(CMAKE_TRY_COMPILE %s)\n", lang);
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 2ed959f..9617355 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -587,7 +587,39 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"directories for the current system. It is NOT intended "
"to be modified by the project, use CMAKE_PREFIX_PATH for this. See also "
"CMAKE_SYSTEM_INCLUDE_PATH, CMAKE_SYSTEM_LIBRARY_PATH, "
- "CMAKE_SYSTEM_PROGRAM_PATH.", false,
+ "CMAKE_SYSTEM_PROGRAM_PATH, and CMAKE_SYSTEM_IGNORE_PATH.", false,
+ "Variables That Change Behavior");
+
+ cm->DefineProperty
+ ("CMAKE_SYSTEM_IGNORE_PATH", cmProperty::VARIABLE,
+ "Path to be ignored by FIND_XXX() commands.",
+ "Specifies directories to be ignored by searches in FIND_XXX() commands "
+ "This is useful in cross-compiled environments where some system "
+ "directories contain incompatible but possibly linkable libraries. For "
+ "example, on cross-compiled cluster environments, this allows a user to "
+ "ignore directories containing libraries meant for the front-end "
+ "machine that modules like FindX11 (and others) would normally search. "
+ "By default this contains a list of directories containing incompatible "
+ "binaries for the host system. "
+ "See also CMAKE_SYSTEM_PREFIX_PATH, CMAKE_SYSTEM_LIBRARY_PATH, "
+ "CMAKE_SYSTEM_INCLUDE_PATH, and CMAKE_SYSTEM_PROGRAM_PATH.", false,
+ "Variables That Change Behavior");
+
+ cm->DefineProperty
+ ("CMAKE_IGNORE_PATH", cmProperty::VARIABLE,
+ "Path to be ignored by FIND_XXX() commands.",
+ "Specifies directories to be ignored by searches in FIND_XXX() commands "
+ "This is useful in cross-compiled environments where some system "
+ "directories contain incompatible but possibly linkable libraries. For "
+ "example, on cross-compiled cluster environments, this allows a user to "
+ "ignore directories containing libraries meant for the front-end "
+ "machine that modules like FindX11 (and others) would normally search. "
+ "By default this is empty; it is intended to be set by the project. "
+ "Note that CMAKE_IGNORE_PATH takes a list of directory names, NOT a "
+ "list of prefixes. If you want to ignore paths under prefixes (bin, "
+ "include, lib, etc.), you'll need to specify them explicitly. "
+ "See also CMAKE_PREFIX_PATH, CMAKE_LIBRARY_PATH, CMAKE_INCLUDE_PATH, "
+ "CMAKE_PROGRAM_PATH.", false,
"Variables That Change Behavior");
cm->DefineProperty
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 147f6ac..1158fc0 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -576,7 +576,7 @@ unsigned int cmELFInternalImpl<Types>::GetDynamicEntryCount()
return i;
}
}
- return this->DynamicSectionEntries.size();
+ return static_cast<unsigned int>(this->DynamicSectionEntries.size());
}
//----------------------------------------------------------------------------
@@ -687,7 +687,8 @@ cmELFInternalImpl<Types>::GetDynamicSectionString(int tag)
// The value has been read successfully. Report it.
se.Position = static_cast<unsigned long>(strtab.sh_offset + first);
se.Size = last - first;
- se.IndexInSection = static_cast<int>(di - this->DynamicSectionEntries.begin());
+ se.IndexInSection =
+ static_cast<int>(di - this->DynamicSectionEntries.begin());
return &se;
}
}
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 48c5c6e..cb614d4 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -152,11 +152,10 @@ bool cmExportCommand
ebfg.SetCommand(this);
// Compute the set of configurations exported.
- if(const char* types =
- this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
+ std::vector<std::string> configurationTypes;
+ this->Makefile->GetConfigurations(configurationTypes);
+ if(!configurationTypes.empty())
{
- std::vector<std::string> configurationTypes;
- cmSystemTools::ExpandListArgument(types, configurationTypes);
for(std::vector<std::string>::const_iterator
ci = configurationTypes.begin();
ci != configurationTypes.end(); ++ci)
@@ -164,11 +163,6 @@ bool cmExportCommand
ebfg.AddConfiguration(ci->c_str());
}
}
- else if(const char* config =
- this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- ebfg.AddConfiguration(config);
- }
else
{
ebfg.AddConfiguration("");
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 133c1a1..8ebd41f 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2571,8 +2571,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
std::vector<std::string>::const_iterator i = args.begin();
if(args.size() < 3)
{
- this->SetError("FILE(DOWNLOAD url file) must be called with "
- "at least three arguments.");
+ this->SetError("DOWNLOAD must be called with at least three arguments.");
return false;
}
++i; // Get rid of subcommand
@@ -2598,8 +2597,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
}
else
{
- this->SetError("FILE(DOWNLOAD url file TIMEOUT time) missing "
- "time for TIMEOUT.");
+ this->SetError("DOWNLOAD missing time for TIMEOUT.");
return false;
}
}
@@ -2608,8 +2606,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
++i;
if( i == args.end())
{
- this->SetError("FILE(DOWNLOAD url file LOG VAR) missing "
- "VAR for LOG.");
+ this->SetError("DOWNLOAD missing VAR for LOG.");
return false;
}
verboseLog = *i;
@@ -2619,8 +2616,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
++i;
if( i == args.end())
{
- this->SetError("FILE(DOWNLOAD url file STATUS VAR) missing "
- "VAR for STATUS.");
+ this->SetError("DOWNLOAD missing VAR for STATUS.");
return false;
}
statusVar = *i;
@@ -2630,8 +2626,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
++i;
if( i == args.end())
{
- this->SetError("FILE(DOWNLOAD url file EXPECTED_MD5 sum) missing "
- "sum value for EXPECTED_MD5.");
+ this->SetError("DOWNLOAD missing sum value for EXPECTED_MD5.");
return false;
}
expectedMD5sum = cmSystemTools::LowerCase(*i);
@@ -2654,8 +2649,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
if (!cmSystemTools::ComputeFileMD5(file.c_str(), computedMD5))
{
- this->SetError("FILE(DOWNLOAD ) error; cannot compute MD5 sum on "
- "pre-existing file");
+ this->SetError("DOWNLOAD cannot compute MD5 sum on pre-existing file");
return false;
}
@@ -2665,7 +2659,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
if (expectedMD5sum == actualMD5sum)
{
this->Makefile->DisplayStatus(
- "FILE(DOWNLOAD ) returning early: file already exists with "
+ "FILE(DOWNLOAD) returning early: file already exists with "
"expected MD5 sum", -1);
if(statusVar.size())
@@ -2698,8 +2692,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
std::ofstream fout(file.c_str(), std::ios::binary);
if(!fout)
{
- this->SetError("FILE(DOWNLOAD url file TIMEOUT time) can not open "
- "file for write.");
+ this->SetError("DOWNLOAD cannot open file for write.");
return false;
}
@@ -2708,8 +2701,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
curl = ::curl_easy_init();
if(!curl)
{
- this->SetError("FILE(DOWNLOAD ) error "
- "initializing curl.");
+ this->SetError("DOWNLOAD error initializing curl.");
return false;
}
@@ -2718,9 +2710,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set url: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set url: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
@@ -2728,10 +2720,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
cmFileCommandWriteMemoryCallback);
if (res != CURLE_OK)
{
- std::string errstring =
- "FILE(DOWNLOAD ) error; cannot set write function: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set write function: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
@@ -2739,10 +2730,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
cmFileCommandCurlDebugCallback);
if (res != CURLE_OK)
{
- std::string errstring =
- "FILE(DOWNLOAD ) error; cannot set debug function: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set debug function: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
@@ -2752,27 +2742,27 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set write data: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set write data: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
res = ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void *)&chunkDebug);
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set debug data: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set debug data: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
res = ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set follow-redirect option: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set follow-redirect option: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
@@ -2782,9 +2772,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set verbose: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set verbose: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
}
@@ -2795,9 +2785,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set timeout: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set timeout: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
}
@@ -2815,9 +2805,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
CURLOPT_NOPROGRESS, 0);
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set noprogress value: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set noprogress value: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
@@ -2825,9 +2815,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
CURLOPT_PROGRESSFUNCTION, cmFileCommandCurlProgressCallback);
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set progress function: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set progress function: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
@@ -2835,9 +2825,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
CURLOPT_PROGRESSDATA, reinterpret_cast<void*>(&helper));
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set progress data: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set progress data: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
}
@@ -2871,8 +2861,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
if (!cmSystemTools::ComputeFileMD5(file.c_str(), computedMD5))
{
- this->SetError("FILE(DOWNLOAD ) error; cannot compute MD5 sum on "
- "downloaded file");
+ this->SetError("DOWNLOAD cannot compute MD5 sum on downloaded file");
return false;
}
@@ -2882,8 +2871,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
if (expectedMD5sum != actualMD5sum)
{
cmOStringStream oss;
- oss << "FILE(DOWNLOAD ) error; expected and actual MD5 sums differ"
- << std::endl
+ oss << "DOWNLOAD MD5 mismatch" << std::endl
<< " for file: [" << file << "]" << std::endl
<< " expected MD5 sum: [" << expectedMD5sum << "]" << std::endl
<< " actual MD5 sum: [" << actualMD5sum << "]" << std::endl
@@ -2913,8 +2901,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
return true;
#else
- this->SetError("FILE(DOWNLOAD ) "
- "not supported in bootstrap cmake ");
+ this->SetError("DOWNLOAD not supported by bootstrap cmake.");
return false;
#endif
}
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index a54ad7a..e1188d5 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -269,6 +269,11 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
}
this->ExpandPaths();
+ // Filter out ignored paths from the prefix list
+ std::set<std::string> ignored;
+ this->GetIgnoredPaths(ignored);
+ this->FilterPaths(this->SearchPaths, ignored);
+
// Handle search root stuff.
this->RerootPaths(this->SearchPaths);
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index f352172..b7d3e52 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -241,6 +241,63 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
}
//----------------------------------------------------------------------------
+void cmFindCommon::FilterPaths(std::vector<std::string>& paths,
+ const std::set<std::string>& ignore)
+{
+ // Now filter out anything that's in the ignore set.
+ std::vector<std::string> unfiltered;
+ unfiltered.swap(paths);
+
+ for(std::vector<std::string>::iterator pi = unfiltered.begin();
+ pi != unfiltered.end(); ++pi)
+ {
+ if (ignore.count(*pi) == 0)
+ {
+ paths.push_back(*pi);
+ }
+ }
+}
+
+
+//----------------------------------------------------------------------------
+void cmFindCommon::GetIgnoredPaths(std::vector<std::string>& ignore)
+{
+ // null-terminated list of paths.
+ static const char *paths[] =
+ { "CMAKE_SYSTEM_IGNORE_PATH", "CMAKE_IGNORE_PATH", 0 };
+
+ // Construct the list of path roots with no trailing slashes.
+ for(const char **pathName = paths; *pathName; ++pathName)
+ {
+ // Get the list of paths to ignore from the variable.
+ const char* ignorePath = this->Makefile->GetDefinition(*pathName);
+ if((ignorePath == 0) || (strlen(ignorePath) == 0))
+ {
+ continue;
+ }
+
+ cmSystemTools::ExpandListArgument(ignorePath, ignore);
+ }
+
+ for(std::vector<std::string>::iterator i = ignore.begin();
+ i != ignore.end(); ++i)
+ {
+ cmSystemTools::ConvertToUnixSlashes(*i);
+ }
+}
+
+
+//----------------------------------------------------------------------------
+void cmFindCommon::GetIgnoredPaths(std::set<std::string>& ignore)
+{
+ std::vector<std::string> ignoreVec;
+ GetIgnoredPaths(ignoreVec);
+ ignore.insert(ignoreVec.begin(), ignoreVec.end());
+}
+
+
+
+//----------------------------------------------------------------------------
bool cmFindCommon::CheckCommonArgument(std::string const& arg)
{
if(arg == "NO_DEFAULT_PATH")
diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h
index 2ffbd00..a4866ba 100644
--- a/Source/cmFindCommon.h
+++ b/Source/cmFindCommon.h
@@ -39,6 +39,14 @@ protected:
/** Place a set of search paths under the search roots. */
void RerootPaths(std::vector<std::string>& paths);
+ /** Get ignored paths from CMAKE_[SYSTEM_]IGNORE_path variables. */
+ void GetIgnoredPaths(std::vector<std::string>& ignore);
+ void GetIgnoredPaths(std::set<std::string>& ignore);
+
+ /** Remove paths in the ignore set from the supplied vector. */
+ void FilterPaths(std::vector<std::string>& paths,
+ const std::set<std::string>& ignore);
+
/** Add trailing slashes to all search paths. */
void AddTrailingSlashes(std::vector<std::string>& paths);
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index bd58f56..ef0197a 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -156,6 +156,11 @@ cmFindPackageCommand::cmFindPackageCommand()
"The full path to the configuration file is stored in the cmake "
"variable <package>_CONFIG."
"\n"
+ "All configuration files which have been considered by CMake while "
+ "searching for an installation of the package with an appropriate "
+ "version are stored in the cmake variable <package>_CONSIDERED_CONFIGS, "
+ "the associated versions in <package>_CONSIDERED_VERSIONS. "
+ "\n"
"If the package configuration file cannot be found CMake "
"will generate an error describing the problem unless the QUIET "
"argument is specified. If REQUIRED is specified and the package "
@@ -596,6 +601,15 @@ bool cmFindPackageCommand
}
}
+ // get igonored paths from vars and reroot them.
+ std::vector<std::string> ignored;
+ this->GetIgnoredPaths(ignored);
+ this->RerootPaths(ignored);
+
+ // Construct a set of ignored paths
+ this->IgnoredPaths.clear();
+ this->IgnoredPaths.insert(ignored.begin(), ignored.end());
+
// Find and load the package.
bool result = this->HandlePackageMode();
this->AppendSuccessInformation();
@@ -609,7 +623,7 @@ void cmFindPackageCommand::SetModuleVariables(const std::string& components)
// Store the list of components.
std::string components_var = this->Name + "_FIND_COMPONENTS";
this->AddFindDefinition(components_var.c_str(), components.c_str());
-
+
if(this->Quiet)
{
// Tell the module that is about to be read that it should find
@@ -712,6 +726,8 @@ bool cmFindPackageCommand::FindModule(bool& found)
//----------------------------------------------------------------------------
bool cmFindPackageCommand::HandlePackageMode()
{
+ this->ConsideredConfigs.clear();
+
// Support old capitalization behavior.
std::string upperDir = cmSystemTools::UpperCase(this->Name);
std::string upperFound = cmSystemTools::UpperCase(this->Name);
@@ -800,36 +816,58 @@ bool cmFindPackageCommand::HandlePackageMode()
{
// The variable is not set.
cmOStringStream e;
- e << "Could not find ";
- if(!this->NoModule)
- {
- e << "module Find" << this->Name << ".cmake or ";
- }
- e << "a configuration file for package " << this->Name << ".\n";
- if(!this->NoModule)
- {
- e << "Adjust CMAKE_MODULE_PATH to find Find"
- << this->Name << ".cmake or set ";
- }
- else
- {
- e << "Set ";
- }
- e << this->Variable << " to the directory containing a CMake "
- << "configuration file for " << this->Name << ". ";
- if(this->Configs.size() == 1)
- {
- e << "The file will be called " << this->Configs[0];
+ // If there are files in ConsideredConfigs, it means that FooConfig.cmake
+ // have been found, but they didn't have appropriate versions.
+ if (this->ConsideredConfigs.size() > 0)
+ {
+ e << "Could not find a configuration file for package \""
+ << this->Name << "\" that "
+ << (this->VersionExact? "exactly matches" : "is compatible with")
+ << " requested version \"" << this->Version << "\".\n"
+ << "The following configuration files were considered but not "
+ "accepted:\n";
+ for(std::vector<ConfigFileInfo>::size_type i=0;
+ i<this->ConsideredConfigs.size(); i++)
+ {
+ e << " " << this->ConsideredConfigs[i].filename
+ << ", version: " << this->ConsideredConfigs[i].version << "\n";
+ }
}
else
{
- e << "The file will have one of the following names:\n";
- for(std::vector<std::string>::const_iterator ci = this->Configs.begin();
- ci != this->Configs.end(); ++ci)
+ e << "Could not find ";
+ if(!this->NoModule)
+ {
+ e << "module Find" << this->Name << ".cmake or ";
+ }
+ e << "a configuration file for package " << this->Name << ".\n";
+ if(!this->NoModule)
{
- e << " " << *ci << "\n";
+ e << "Adjust CMAKE_MODULE_PATH to find Find"
+ << this->Name << ".cmake or set ";
+ }
+ else
+ {
+ e << "Set ";
+ }
+ e << this->Variable << " to the directory containing a CMake "
+ << "configuration file for " << this->Name << ". ";
+ if(this->Configs.size() == 1)
+ {
+ e << "The file will be called " << this->Configs[0];
+ }
+ else
+ {
+ e << "The file will have one of the following names:\n";
+ for(std::vector<std::string>::const_iterator ci=this->Configs.begin();
+ ci != this->Configs.end(); ++ci)
+ {
+ e << " " << *ci << "\n";
+ }
}
}
+
+
this->Makefile->IssueMessage(
this->Required? cmake::FATAL_ERROR : cmake::WARNING, e.str());
}
@@ -888,6 +926,31 @@ bool cmFindPackageCommand::HandlePackageMode()
}
#endif
+ std::string consideredConfigsVar = this->Name;
+ consideredConfigsVar += "_CONSIDERED_CONFIGS";
+ std::string consideredVersionsVar = this->Name;
+ consideredVersionsVar += "_CONSIDERED_VERSIONS";
+
+ std::string consideredConfigFiles;
+ std::string consideredVersions;
+
+ const char* sep = "";
+ for(std::vector<ConfigFileInfo>::size_type i=0;
+ i<this->ConsideredConfigs.size(); i++)
+ {
+ consideredConfigFiles += sep;
+ consideredVersions += sep;
+ consideredConfigFiles += this->ConsideredConfigs[i].filename;
+ consideredVersions += this->ConsideredConfigs[i].version;
+ sep = ";";
+ }
+
+ this->Makefile->AddDefinition(consideredConfigsVar.c_str(),
+ consideredConfigFiles.c_str());
+
+ this->Makefile->AddDefinition(consideredVersionsVar.c_str(),
+ consideredVersions.c_str());
+
return result;
}
@@ -1074,6 +1137,20 @@ void cmFindPackageCommand::AppendSuccessInformation()
}
}
+ // set a global property to record the required version of this package
+ std::string versionInfoPropName = "_CMAKE_";
+ versionInfoPropName += this->Name;
+ versionInfoPropName += "_REQUIRED_VERSION";
+ std::string versionInfo;
+ if(!this->Version.empty())
+ {
+ versionInfo = this->VersionExact ? "==" : ">=";
+ versionInfo += " ";
+ versionInfo += this->Version;
+ }
+ this->Makefile->GetCMakeInstance()->SetProperty(versionInfoPropName.c_str(),
+ versionInfo.c_str());
+
// Restore original state of "_FIND_" variables we set.
this->RestoreFindDefinitions();
}
@@ -1431,6 +1508,11 @@ bool cmFindPackageCommand::CheckDirectory(std::string const& dir)
bool cmFindPackageCommand::FindConfigFile(std::string const& dir,
std::string& file)
{
+ if (this->IgnoredPaths.count(dir))
+ {
+ return false;
+ }
+
for(std::vector<std::string>::const_iterator ci = this->Configs.begin();
ci != this->Configs.end(); ++ci)
{
@@ -1453,6 +1535,10 @@ bool cmFindPackageCommand::FindConfigFile(std::string const& dir,
//----------------------------------------------------------------------------
bool cmFindPackageCommand::CheckVersion(std::string const& config_file)
{
+ bool result = false; // by default, assume the version is not ok.
+ bool haveResult = false;
+ std::string version = "unknown";
+
// Get the filename without the .cmake extension.
std::string::size_type pos = config_file.rfind('.');
std::string version_file_base = config_file.substr(0, pos);
@@ -1460,31 +1546,42 @@ bool cmFindPackageCommand::CheckVersion(std::string const& config_file)
// Look for foo-config-version.cmake
std::string version_file = version_file_base;
version_file += "-version.cmake";
- if(cmSystemTools::FileExists(version_file.c_str(), true))
+ if ((haveResult == false)
+ && (cmSystemTools::FileExists(version_file.c_str(), true)))
{
- return this->CheckVersionFile(version_file);
+ result = this->CheckVersionFile(version_file, version);
+ haveResult = true;
}
// Look for fooConfigVersion.cmake
version_file = version_file_base;
version_file += "Version.cmake";
- if(cmSystemTools::FileExists(version_file.c_str(), true))
+ if ((haveResult == false)
+ && (cmSystemTools::FileExists(version_file.c_str(), true)))
{
- return this->CheckVersionFile(version_file);
+ result = this->CheckVersionFile(version_file, version);
+ haveResult = true;
}
+
// If no version was requested a versionless package is acceptable.
- if(this->Version.empty())
+ if ((haveResult == false) && (this->Version.empty()))
{
- return true;
+ result = true;
+ haveResult = true;
}
- // No version file found. Assume the version is incompatible.
- return false;
+ ConfigFileInfo configFileInfo;
+ configFileInfo.filename = config_file;
+ configFileInfo.version = version;
+ this->ConsideredConfigs.push_back(configFileInfo);
+
+ return result;
}
//----------------------------------------------------------------------------
-bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file)
+bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file,
+ std::string& result_version)
{
// The version file will be loaded in an isolated scope.
cmMakefile::ScopePushPop varScope(this->Makefile);
@@ -1557,6 +1654,12 @@ bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file)
}
}
+ result_version = this->Makefile->GetSafeDefinition("PACKAGE_VERSION");
+ if (result_version.empty())
+ {
+ result_version = "unknown";
+ }
+
// Succeed if the version is suitable.
return suitable;
}
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h
index 63f4111..57aeab9 100644
--- a/Source/cmFindPackageCommand.h
+++ b/Source/cmFindPackageCommand.h
@@ -98,7 +98,8 @@ private:
bool CheckDirectory(std::string const& dir);
bool FindConfigFile(std::string const& dir, std::string& file);
bool CheckVersion(std::string const& config_file);
- bool CheckVersionFile(std::string const& version_file);
+ bool CheckVersionFile(std::string const& version_file,
+ std::string& result_version);
bool SearchPrefix(std::string const& prefix);
bool SearchFrameworkPrefix(std::string const& prefix_in);
bool SearchAppBundlePrefix(std::string const& prefix_in);
@@ -136,6 +137,10 @@ private:
bool PolicyScope;
std::vector<std::string> Names;
std::vector<std::string> Configs;
+ std::set<std::string> IgnoredPaths;
+
+ struct ConfigFileInfo { std::string filename; std::string version; };
+ std::vector<ConfigFileInfo> ConsideredConfigs;
};
#endif
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index b9deaef..0def336 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -863,19 +863,10 @@ void cmGlobalGenerator::Generate()
}
// Compute the inter-target dependencies.
- {
- cmComputeTargetDepends ctd(this);
- if(!ctd.Compute())
+ if(!this->ComputeTargetDepends())
{
return;
}
- std::vector<cmTarget*> const& targets = ctd.GetTargets();
- for(std::vector<cmTarget*>::const_iterator ti = targets.begin();
- ti != targets.end(); ++ti)
- {
- ctd.GetTargetDirectDepends(*ti, this->TargetDependencies[*ti]);
- }
- }
// Create a map from local generator to the complete set of targets
// it builds by default.
@@ -908,6 +899,23 @@ void cmGlobalGenerator::Generate()
}
//----------------------------------------------------------------------------
+bool cmGlobalGenerator::ComputeTargetDepends()
+{
+ cmComputeTargetDepends ctd(this);
+ if(!ctd.Compute())
+ {
+ return false;
+ }
+ std::vector<cmTarget*> const& targets = ctd.GetTargets();
+ for(std::vector<cmTarget*>::const_iterator ti = targets.begin();
+ ti != targets.end(); ++ti)
+ {
+ ctd.GetTargetDirectDepends(*ti, this->TargetDependencies[*ti]);
+ }
+ return true;
+}
+
+//----------------------------------------------------------------------------
bool cmGlobalGenerator::CheckTargets()
{
// Make sure all targets can find their source files.
@@ -1487,7 +1495,7 @@ void cmGlobalGenerator::FillLocalGeneratorToTargetMap()
// Add dependencies of the included target. An excluded
// target may still be included if it is a dependency of a
// non-excluded target.
- TargetDependSet & tgtdeps = this->GetTargetDirectDepends(target);
+ TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(target);
for(TargetDependSet::const_iterator ti = tgtdeps.begin();
ti != tgtdeps.end(); ++ti)
{
@@ -1920,7 +1928,7 @@ void cmGlobalGenerator::AppendDirectoryForConfig(const char*, const char*,
}
//----------------------------------------------------------------------------
-cmGlobalGenerator::TargetDependSet &
+cmGlobalGenerator::TargetDependSet const&
cmGlobalGenerator::GetTargetDirectDepends(cmTarget & target)
{
return this->TargetDependencies[&target];
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 554ee0f..2aec19f 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -238,7 +238,7 @@ public:
// what targets does the specified target depend on directly
// via a target_link_libraries or add_dependencies
- TargetDependSet & GetTargetDirectDepends(cmTarget & target);
+ TargetDependSet const& GetTargetDirectDepends(cmTarget & target);
const std::map<cmStdString, std::vector<cmLocalGenerator*> >& GetProjectMap()
const {return this->ProjectMap;}
@@ -275,6 +275,8 @@ protected:
void SetLanguageEnabledMaps(const char* l, cmMakefile* mf);
void FillExtensionToLanguageMap(const char* l, cmMakefile* mf);
+ virtual bool ComputeTargetDepends();
+
virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS();
bool CheckTargets();
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index b687fe1..4e8e7e6 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -750,8 +750,9 @@ cmGlobalUnixMakefileGenerator3
cmLocalGenerator::FULL,
cmLocalGenerator::SHELL);
progCmd << " ";
- std::vector<int> &progFiles = this->ProgressMap[&t->second].Marks;
- for (std::vector<int>::iterator i = progFiles.begin();
+ std::vector<unsigned long>& progFiles =
+ this->ProgressMap[&t->second].Marks;
+ for (std::vector<unsigned long>::iterator i = progFiles.begin();
i != progFiles.end(); ++i)
{
progCmd << " " << *i;
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 401888f..f499536 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -177,7 +177,7 @@ protected:
TargetProgress(): NumberOfActions(0) {}
unsigned long NumberOfActions;
std::string VariableFile;
- std::vector<int> Marks;
+ std::vector<unsigned long> Marks;
void WriteProgressVariables(unsigned long total, unsigned long& current);
};
struct ProgressMapCompare { bool operator()(cmTarget*,cmTarget*) const; };
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 691502f..403507f 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -40,7 +40,7 @@ void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout)
cmLocalGenerator *cmGlobalVisualStudio10Generator::CreateLocalGenerator()
{
cmLocalVisualStudio10Generator* lg = new cmLocalVisualStudio10Generator;
- lg->SetPlatformName(this->PlatformName.c_str());
+ lg->SetPlatformName(this->GetPlatformName());
lg->SetGlobalGenerator(this);
return lg;
}
diff --git a/Source/cmGlobalVisualStudio10Win64Generator.cxx b/Source/cmGlobalVisualStudio10Win64Generator.cxx
index 1004fa9..109b60d 100644
--- a/Source/cmGlobalVisualStudio10Win64Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Win64Generator.cxx
@@ -16,7 +16,6 @@
//----------------------------------------------------------------------------
cmGlobalVisualStudio10Win64Generator::cmGlobalVisualStudio10Win64Generator()
{
- this->PlatformName = "x64";
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGlobalVisualStudio10Win64Generator.h b/Source/cmGlobalVisualStudio10Win64Generator.h
index 98ba03c..39c9d08 100644
--- a/Source/cmGlobalVisualStudio10Win64Generator.h
+++ b/Source/cmGlobalVisualStudio10Win64Generator.h
@@ -27,6 +27,8 @@ public:
return cmGlobalVisualStudio10Win64Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 10 Win64";}
+ virtual const char* GetPlatformName() const {return "x64";}
+
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index d053ca2..203ca77 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -13,6 +13,7 @@
#include "cmLocalVisualStudio6Generator.h"
#include "cmMakefile.h"
#include "cmake.h"
+#include "cmGeneratedFileStream.h"
// Utility function to make a valid VS6 *.dsp filename out
// of a CMake target name:
@@ -274,44 +275,33 @@ void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout,
fout << "Package=<5>\n{{{\n}}}\n\n";
fout << "Package=<4>\n";
fout << "{{{\n";
-
- // insert Begin Project Dependency Project_Dep_Name project stuff here
- if (target.GetType() != cmTarget::STATIC_LIBRARY)
+ VSDependSet const& depends = this->VSTargetDepends[&target];
+ for(VSDependSet::const_iterator di = depends.begin();
+ di != depends.end(); ++di)
{
- cmTarget::LinkLibraryVectorType::const_iterator j, jend;
- j = target.GetLinkLibraries().begin();
- jend = target.GetLinkLibraries().end();
- for(;j!= jend; ++j)
- {
- if(j->first != dspname)
- {
- // is the library part of this DSW ? If so add dependency
- if(this->FindTarget(0, j->first.c_str()))
- {
- fout << "Begin Project Dependency\n";
- fout << "Project_Dep_Name "
- << GetVS6TargetName(j->first.c_str()) << "\n";
- fout << "End Project Dependency\n";
- }
- }
- }
+ const char* name = di->c_str();
+ fout << "Begin Project Dependency\n";
+ fout << "Project_Dep_Name " << GetVS6TargetName(name) << "\n";
+ fout << "End Project Dependency\n";
}
+ fout << "}}}\n\n";
- std::set<cmStdString>::const_iterator i, end;
- // write utility dependencies.
- i = target.GetUtilities().begin();
- end = target.GetUtilities().end();
- for(;i!= end; ++i)
+ UtilityDependsMap::iterator ui = this->UtilityDepends.find(&target);
+ if(ui != this->UtilityDepends.end())
{
- if(*i != dspname)
- {
- std::string depName = this->GetUtilityForTarget(target, i->c_str());
- fout << "Begin Project Dependency\n";
- fout << "Project_Dep_Name " << GetVS6TargetName(depName) << "\n";
- fout << "End Project Dependency\n";
- }
+ const char* uname = ui->second.c_str();
+ fout << "Project: \"" << uname << "\"="
+ << dir << "\\" << uname << ".dsp - Package Owner=<4>\n\n";
+ fout <<
+ "Package=<5>\n{{{\n}}}\n\n"
+ "Package=<4>\n"
+ "{{{\n"
+ "Begin Project Dependency\n"
+ "Project_Dep_Name " << dspname << "\n"
+ "End Project Dependency\n"
+ "}}}\n\n";
+ ;
}
- fout << "}}}\n\n";
}
@@ -368,6 +358,49 @@ void cmGlobalVisualStudio6Generator::WriteDSWHeader(std::ostream& fout)
}
//----------------------------------------------------------------------------
+std::string
+cmGlobalVisualStudio6Generator::WriteUtilityDepend(cmTarget* target)
+{
+ std::string pname = target->GetName();
+ pname += "_UTILITY";
+ pname = GetVS6TargetName(pname.c_str());
+ std::string fname = target->GetMakefile()->GetStartOutputDirectory();
+ fname += "/";
+ fname += pname;
+ fname += ".dsp";
+ cmGeneratedFileStream fout(fname.c_str());
+ fout.SetCopyIfDifferent(true);
+ fout <<
+ "# Microsoft Developer Studio Project File - Name=\""
+ << pname << "\" - Package Owner=<4>\n"
+ "# Microsoft Developer Studio Generated Build File, Format Version 6.00\n"
+ "# ** DO NOT EDIT **\n"
+ "\n"
+ "# TARGTYPE \"Win32 (x86) Generic Project\" 0x010a\n"
+ "\n"
+ "CFG=" << pname << " - Win32 Debug\n"
+ "!MESSAGE \"" << pname << " - Win32 Debug\""
+ " (based on \"Win32 (x86) Generic Project\")\n"
+ "!MESSAGE \"" << pname << " - Win32 Release\" "
+ "(based on \"Win32 (x86) Generic Project\")\n"
+ "!MESSAGE \"" << pname << " - Win32 MinSizeRel\" "
+ "(based on \"Win32 (x86) Generic Project\")\n"
+ "!MESSAGE \"" << pname << " - Win32 RelWithDebInfo\" "
+ "(based on \"Win32 (x86) Generic Project\")\n"
+ "\n"
+ "# Begin Project\n"
+ "# Begin Target\n"
+ "# Name \"" << pname << " - Win32 Debug\"\n"
+ "# Name \"" << pname << " - Win32 Release\"\n"
+ "# Name \"" << pname << " - Win32 MinSizeRel\"\n"
+ "# Name \"" << pname << " - Win32 RelWithDebInfo\"\n"
+ "# End Target\n"
+ "# End Project\n"
+ ;
+ return pname;
+}
+
+//----------------------------------------------------------------------------
void cmGlobalVisualStudio6Generator
::GetDocumentation(cmDocumentationEntry& entry) const
{
diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h
index 553c7be..77d5370 100644
--- a/Source/cmGlobalVisualStudio6Generator.h
+++ b/Source/cmGlobalVisualStudio6Generator.h
@@ -96,6 +96,7 @@ private:
const char* name, const char* path,
const std::set<cmStdString>& dependencies);
void WriteDSWFooter(std::ostream& fout);
+ virtual std::string WriteUtilityDepend(cmTarget* target);
};
#endif
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 897c3a2..ba18687 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -179,16 +179,31 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
ext = targetExt;
}
+ std::string guid = this->GetGUID(dspname);
fout << project
<< dspname << "\", \""
<< this->ConvertToSolutionPath(dir)
- << "\\" << dspname << ext << "\", \"{"
- << this->GetGUID(dspname) << "}\"\n";
+ << "\\" << dspname << ext << "\", \"{" << guid << "}\"\n";
fout << "\tProjectSection(ProjectDependencies) = postProject\n";
this->WriteProjectDepends(fout, dspname, dir, t);
fout << "\tEndProjectSection\n";
fout <<"EndProject\n";
+
+ UtilityDependsMap::iterator ui = this->UtilityDepends.find(&t);
+ if(ui != this->UtilityDepends.end())
+ {
+ const char* uname = ui->second.c_str();
+ fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
+ << uname << "\", \""
+ << this->ConvertToSolutionPath(dir)
+ << "\\" << uname << ".vcproj" << "\", \"{"
+ << this->GetGUID(uname) << "}\"\n"
+ << "\tProjectSection(ProjectDependencies) = postProject\n"
+ << "\t\t{" << guid << "} = {" << guid << "}\n"
+ << "\tEndProjectSection\n"
+ << "EndProject\n";
+ }
}
//----------------------------------------------------------------------------
@@ -198,62 +213,24 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
void
cmGlobalVisualStudio71Generator
::WriteProjectDepends(std::ostream& fout,
- const char* dspname,
+ const char*,
const char*, cmTarget& target)
{
-#if 0
- // Create inter-target dependencies in the solution file. For VS
- // 7.1 and below we cannot let static libraries depend directly on
- // targets to which they "link" because the librarian tool will copy
- // the targets into the static library. See
- // cmGlobalVisualStudioGenerator::FixUtilityDependsForTarget for a
- // work-around. VS 8 and above do not have this problem.
- if (!this->VSLinksDependencies() ||
- target.GetType() != cmTarget::STATIC_LIBRARY);
-#else
- if (target.GetType() != cmTarget::STATIC_LIBRARY)
-#endif
- {
- cmTarget::LinkLibraryVectorType::const_iterator j, jend;
- j = target.GetLinkLibraries().begin();
- jend = target.GetLinkLibraries().end();
- for(;j!= jend; ++j)
- {
- if(j->first != dspname)
- {
- // is the library part of this SLN ? If so add dependency
- // find target anywhere because all depend libraries are
- // brought in as well
- if(this->FindTarget(0, j->first.c_str()))
- {
- fout << "\t\t{" << this->GetGUID(j->first.c_str()) << "} = {"
- << this->GetGUID(j->first.c_str()) << "}\n";
- }
- }
- }
- }
-
- std::set<cmStdString>::const_iterator i, end;
- // write utility dependencies.
- i = target.GetUtilities().begin();
- end = target.GetUtilities().end();
- for(;i!= end; ++i)
+ VSDependSet const& depends = this->VSTargetDepends[&target];
+ for(VSDependSet::const_iterator di = depends.begin();
+ di != depends.end(); ++di)
{
- if(*i != dspname)
+ const char* name = di->c_str();
+ std::string guid = this->GetGUID(name);
+ if(guid.size() == 0)
{
- std::string name = this->GetUtilityForTarget(target, i->c_str());
- std::string guid = this->GetGUID(name.c_str());
- if(guid.size() == 0)
- {
- std::string m = "Target: ";
- m += target.GetName();
- m += " depends on unknown target: ";
- m += name;
- cmSystemTools::Error(m.c_str());
- }
-
- fout << "\t\t{" << guid << "} = {" << guid << "}\n";
+ std::string m = "Target: ";
+ m += target.GetName();
+ m += " depends on unknown target: ";
+ m += name;
+ cmSystemTools::Error(m.c_str());
}
+ fout << "\t\t{" << guid << "} = {" << guid << "}\n";
}
}
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index e08b1ef..2b9e5ba 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -515,6 +515,18 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout,
<< this->ConvertToSolutionPath(dir)
<< "\\" << dspname << ext << "\", \"{"
<< this->GetGUID(dspname) << "}\"\nEndProject\n";
+
+ UtilityDependsMap::iterator ui = this->UtilityDepends.find(&target);
+ if(ui != this->UtilityDepends.end())
+ {
+ const char* uname = ui->second.c_str();
+ fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
+ << uname << "\", \""
+ << this->ConvertToSolutionPath(dir)
+ << "\\" << uname << ".vcproj" << "\", \"{"
+ << this->GetGUID(uname) << "}\"\n"
+ << "EndProject\n";
+ }
}
@@ -529,59 +541,30 @@ cmGlobalVisualStudio7Generator
const char*, cmTarget& target)
{
int depcount = 0;
- // insert Begin Project Dependency Project_Dep_Name project stuff here
- if (target.GetType() != cmTarget::STATIC_LIBRARY)
- {
- cmTarget::LinkLibraryVectorType::const_iterator j, jend;
- j = target.GetLinkLibraries().begin();
- jend = target.GetLinkLibraries().end();
- for(;j!= jend; ++j)
+ std::string dspguid = this->GetGUID(dspname);
+ VSDependSet const& depends = this->VSTargetDepends[&target];
+ for(VSDependSet::const_iterator di = depends.begin();
+ di != depends.end(); ++di)
+ {
+ const char* name = di->c_str();
+ std::string guid = this->GetGUID(name);
+ if(guid.size() == 0)
{
- if(j->first != dspname)
- {
- // is the library part of this SLN ? If so add dependency
- if(this->FindTarget(0, j->first.c_str()))
- {
- std::string guid = this->GetGUID(j->first.c_str());
- if(guid.size() == 0)
- {
- std::string m = "Target: ";
- m += dspname;
- m += " depends on unknown target: ";
- m += j->first.c_str();
- cmSystemTools::Error(m.c_str());
- }
- fout << "\t\t{" << this->GetGUID(dspname) << "}."
- << depcount << " = {" << guid << "}\n";
- depcount++;
- }
- }
+ std::string m = "Target: ";
+ m += target.GetName();
+ m += " depends on unknown target: ";
+ m += name;
+ cmSystemTools::Error(m.c_str());
}
+ fout << "\t\t{" << dspguid << "}." << depcount << " = {" << guid << "}\n";
+ depcount++;
}
- std::set<cmStdString>::const_iterator i, end;
- // write utility dependencies.
- i = target.GetUtilities().begin();
- end = target.GetUtilities().end();
- for(;i!= end; ++i)
+ UtilityDependsMap::iterator ui = this->UtilityDepends.find(&target);
+ if(ui != this->UtilityDepends.end())
{
- if(*i != dspname)
- {
- std::string name = this->GetUtilityForTarget(target, i->c_str());
- std::string guid = this->GetGUID(name.c_str());
- if(guid.size() == 0)
- {
- std::string m = "Target: ";
- m += dspname;
- m += " depends on unknown target: ";
- m += name.c_str();
- cmSystemTools::Error(m.c_str());
- }
-
- fout << "\t\t{" << this->GetGUID(dspname) << "}." << depcount << " = {"
- << guid << "}\n";
- depcount++;
- }
+ const char* uname = ui->second.c_str();
+ fout << "\t\t{" << this->GetGUID(uname) << "}.0 = {" << dspguid << "}\n";
}
}
@@ -644,6 +627,61 @@ void cmGlobalVisualStudio7Generator::WriteSLNHeader(std::ostream& fout)
fout << "Microsoft Visual Studio Solution File, Format Version 7.00\n";
}
+//----------------------------------------------------------------------------
+std::string
+cmGlobalVisualStudio7Generator::WriteUtilityDepend(cmTarget* target)
+{
+ std::string pname = target->GetName();
+ pname += "_UTILITY";
+ std::string fname = target->GetMakefile()->GetStartOutputDirectory();
+ fname += "/";
+ fname += pname;
+ fname += ".vcproj";
+ cmGeneratedFileStream fout(fname.c_str());
+ fout.SetCopyIfDifferent(true);
+ this->CreateGUID(pname.c_str());
+ std::string guid = this->GetGUID(pname.c_str());
+
+ fout <<
+ "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n"
+ "<VisualStudioProject\n"
+ "\tProjectType=\"Visual C++\"\n"
+ "\tVersion=\"" << this->GetIDEVersion() << "0\"\n"
+ "\tName=\"" << pname << "\"\n"
+ "\tProjectGUID=\"{" << guid << "}\"\n"
+ "\tKeyword=\"Win32Proj\">\n"
+ "\t<Platforms><Platform Name=\"Win32\"/></Platforms>\n"
+ "\t<Configurations>\n"
+ ;
+ for(std::vector<std::string>::iterator i = this->Configurations.begin();
+ i != this->Configurations.end(); ++i)
+ {
+ fout <<
+ "\t\t<Configuration\n"
+ "\t\t\tName=\"" << *i << "|Win32\"\n"
+ "\t\t\tOutputDirectory=\"" << *i << "\"\n"
+ "\t\t\tIntermediateDirectory=\"" << pname << ".dir\\" << *i << "\"\n"
+ "\t\t\tConfigurationType=\"10\"\n"
+ "\t\t\tUseOfMFC=\"0\"\n"
+ "\t\t\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\"\n"
+ "\t\t\tCharacterSet=\"2\">\n"
+ "\t\t</Configuration>\n"
+ ;
+ }
+ fout <<
+ "\t</Configurations>\n"
+ "\t<Files></Files>\n"
+ "\t<Globals></Globals>\n"
+ "</VisualStudioProject>\n"
+ ;
+
+ if(fout.Close())
+ {
+ this->FileReplacedDuringGenerate(fname);
+ }
+ return pname;
+}
+
std::string cmGlobalVisualStudio7Generator::GetGUID(const char* name)
{
std::string guidStoreName = name;
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index b2c7141..b6c84e8 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -113,6 +113,7 @@ protected:
bool partOfDefaultBuild);
virtual void WriteSLNFooter(std::ostream& fout);
virtual void WriteSLNHeader(std::ostream& fout);
+ virtual std::string WriteUtilityDepend(cmTarget* target);
virtual void AddPlatformDefinitions(cmMakefile* mf);
virtual void WriteTargetsToSolution(
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 7a979f8..7c65c32 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -21,7 +21,7 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator()
{
this->FindMakeProgramFile = "CMakeVS8FindMake.cmake";
this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms";
- this->PlatformName = "Win32";
+ this->ArchitectureId = "X86";
}
//----------------------------------------------------------------------------
@@ -30,6 +30,7 @@ cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator()
{
cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
lg->SetVersion8();
+ lg->SetPlatformName(this->GetPlatformName());
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
lg->SetGlobalGenerator(this);
return lg;
@@ -55,8 +56,8 @@ void cmGlobalVisualStudio8Generator
//----------------------------------------------------------------------------
void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf)
{
- mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86");
- mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86");
+ mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", this->ArchitectureId);
+ mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", this->ArchitectureId);
mf->AddDefinition("MSVC80", "1");
}
@@ -259,8 +260,8 @@ cmGlobalVisualStudio8Generator
for(std::vector<std::string>::iterator i = this->Configurations.begin();
i != this->Configurations.end(); ++i)
{
- fout << "\t\t" << *i << "|" << this->PlatformName << " = " << *i << "|"
- << this->PlatformName << "\n";
+ fout << "\t\t" << *i << "|" << this->GetPlatformName()
+ << " = " << *i << "|" << this->GetPlatformName() << "\n";
}
fout << "\tEndGlobalSection\n";
}
@@ -276,13 +277,13 @@ cmGlobalVisualStudio8Generator
i != this->Configurations.end(); ++i)
{
fout << "\t\t{" << guid << "}." << *i
- << "|" << this->PlatformName << ".ActiveCfg = "
- << *i << "|" << this->PlatformName << "\n";
+ << "|" << this->GetPlatformName() << ".ActiveCfg = "
+ << *i << "|" << this->GetPlatformName() << "\n";
if(partOfDefaultBuild)
{
fout << "\t\t{" << guid << "}." << *i
- << "|" << this->PlatformName << ".Build.0 = "
- << *i << "|" << this->PlatformName << "\n";
+ << "|" << this->GetPlatformName() << ".Build.0 = "
+ << *i << "|" << this->GetPlatformName() << "\n";
}
}
}
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index 9d836bd..e0d5d80 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -32,14 +32,14 @@ public:
return cmGlobalVisualStudio8Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 8 2005";}
+ virtual const char* GetPlatformName() const {return "Win32";}
+
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
///! Create a local generator appropriate to this Global Generator
virtual cmLocalGenerator *CreateLocalGenerator();
- std::string const& GetPlatformName() const { return this->PlatformName; }
-
/**
* Override Configure and Generate to add the build-system check
* target.
@@ -78,6 +78,7 @@ protected:
virtual void WriteProjectConfigurations(std::ostream& fout,
const char* name,
bool partOfDefaultBuild);
- std::string PlatformName; // Win32 or x64
+
+ const char* ArchitectureId;
};
#endif
diff --git a/Source/cmGlobalVisualStudio8Win64Generator.cxx b/Source/cmGlobalVisualStudio8Win64Generator.cxx
index d5558bb..3469b17 100644
--- a/Source/cmGlobalVisualStudio8Win64Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Win64Generator.cxx
@@ -19,7 +19,7 @@
cmGlobalVisualStudio8Win64Generator::cmGlobalVisualStudio8Win64Generator()
{
- this->PlatformName = "x64";
+ this->ArchitectureId = "x64";
}
///! Create a local generator appropriate to this Global Generator
@@ -27,7 +27,7 @@ cmLocalGenerator *cmGlobalVisualStudio8Win64Generator::CreateLocalGenerator()
{
cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
lg->SetVersion8();
- lg->SetPlatformName(this->PlatformName.c_str());
+ lg->SetPlatformName(this->GetPlatformName());
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
lg->SetGlobalGenerator(this);
return lg;
@@ -48,6 +48,4 @@ void cmGlobalVisualStudio8Win64Generator
{
this->cmGlobalVisualStudio8Generator::AddPlatformDefinitions(mf);
mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
- mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "x64");
- mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "x64");
}
diff --git a/Source/cmGlobalVisualStudio8Win64Generator.h b/Source/cmGlobalVisualStudio8Win64Generator.h
index 44c237c..084ba69 100644
--- a/Source/cmGlobalVisualStudio8Win64Generator.h
+++ b/Source/cmGlobalVisualStudio8Win64Generator.h
@@ -33,6 +33,8 @@ public:
return cmGlobalVisualStudio8Win64Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 8 2005 Win64";}
+ virtual const char* GetPlatformName() const {return "x64";}
+
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx
index f6ae705..f8ceea0 100644
--- a/Source/cmGlobalVisualStudio9Generator.cxx
+++ b/Source/cmGlobalVisualStudio9Generator.cxx
@@ -25,8 +25,8 @@ cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator()
//----------------------------------------------------------------------------
void cmGlobalVisualStudio9Generator::AddPlatformDefinitions(cmMakefile* mf)
{
- mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86");
- mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86");
+ mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", this->ArchitectureId);
+ mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", this->ArchitectureId);
mf->AddDefinition("MSVC90", "1");
}
@@ -42,6 +42,7 @@ cmLocalGenerator *cmGlobalVisualStudio9Generator::CreateLocalGenerator()
{
cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
lg->SetVersion9();
+ lg->SetPlatformName(this->GetPlatformName());
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
lg->SetGlobalGenerator(this);
return lg;
diff --git a/Source/cmGlobalVisualStudio9Win64Generator.cxx b/Source/cmGlobalVisualStudio9Win64Generator.cxx
index c5b9bab..ff4fd4f 100644
--- a/Source/cmGlobalVisualStudio9Win64Generator.cxx
+++ b/Source/cmGlobalVisualStudio9Win64Generator.cxx
@@ -16,7 +16,7 @@
cmGlobalVisualStudio9Win64Generator::cmGlobalVisualStudio9Win64Generator()
{
- this->PlatformName = "x64";
+ this->ArchitectureId = "x64";
}
///! Create a local generator appropriate to this Global Generator
@@ -24,7 +24,7 @@ cmLocalGenerator *cmGlobalVisualStudio9Win64Generator::CreateLocalGenerator()
{
cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
lg->SetVersion9();
- lg->SetPlatformName(this->PlatformName.c_str());
+ lg->SetPlatformName(this->GetPlatformName());
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
lg->SetGlobalGenerator(this);
return lg;
@@ -45,6 +45,4 @@ void cmGlobalVisualStudio9Win64Generator
{
cmGlobalVisualStudio9Generator::AddPlatformDefinitions(mf);
mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
- mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "x64");
- mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "x64");
}
diff --git a/Source/cmGlobalVisualStudio9Win64Generator.h b/Source/cmGlobalVisualStudio9Win64Generator.h
index 55abcfc..f6dcc03 100644
--- a/Source/cmGlobalVisualStudio9Win64Generator.h
+++ b/Source/cmGlobalVisualStudio9Win64Generator.h
@@ -33,6 +33,8 @@ public:
return cmGlobalVisualStudio9Win64Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 9 2008 Win64";}
+ virtual const char* GetPlatformName() const {return "x64";}
+
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index e8a00bb..bae18a3 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -89,9 +89,6 @@ void cmGlobalVisualStudioGenerator::Generate()
}
}
- // Fix utility dependencies to avoid linking to libraries.
- this->FixUtilityDepends();
-
// Configure CMake Visual Studio macros, for this user on this version
// of Visual Studio.
this->ConfigureCMakeVisualStudioMacros();
@@ -240,129 +237,59 @@ std::string cmGlobalVisualStudioGenerator::GetUserMacrosRegKeyBase()
}
//----------------------------------------------------------------------------
-void cmGlobalVisualStudioGenerator::FixUtilityDepends()
+bool cmGlobalVisualStudioGenerator::ComputeTargetDepends()
{
- // Skip for VS versions 8 and above.
- if(!this->VSLinksDependencies())
+ if(!this->cmGlobalGenerator::ComputeTargetDepends())
{
- return;
+ return false;
}
-
- // For VS versions before 8:
- //
- // When a target that links contains a project-level dependency on a
- // library target that library is automatically linked. In order to
- // allow utility-style project-level dependencies that do not
- // actually link we need to automatically insert an intermediate
- // custom target.
- //
- // Here we edit the utility dependencies of a target to add the
- // intermediate custom target when necessary.
- for(unsigned i = 0; i < this->LocalGenerators.size(); ++i)
+ std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
+ for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
{
- cmTargets* targets =
- &(this->LocalGenerators[i]->GetMakefile()->GetTargets());
- for(cmTargets::iterator tarIt = targets->begin();
- tarIt != targets->end(); ++tarIt)
+ std::vector<cmLocalGenerator*>& gen = it->second;
+ for(std::vector<cmLocalGenerator*>::iterator i = gen.begin();
+ i != gen.end(); ++i)
{
- this->FixUtilityDependsForTarget(tarIt->second);
+ cmTargets& targets = (*i)->GetMakefile()->GetTargets();
+ for(cmTargets::iterator ti = targets.begin();
+ ti != targets.end(); ++ti)
+ {
+ this->ComputeVSTargetDepends(ti->second);
+ }
}
}
+ return true;
}
//----------------------------------------------------------------------------
-void
-cmGlobalVisualStudioGenerator::FixUtilityDependsForTarget(cmTarget& target)
+void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target)
{
- // Only targets that link need to be fixed.
- if(target.GetType() != cmTarget::STATIC_LIBRARY &&
- target.GetType() != cmTarget::SHARED_LIBRARY &&
- target.GetType() != cmTarget::MODULE_LIBRARY &&
- target.GetType() != cmTarget::EXECUTABLE)
+ if(this->VSTargetDepends.find(&target) != this->VSTargetDepends.end())
{
return;
}
-
-#if 0
- // This feature makes a mess in SLN files for VS 7.1 and below. It
- // creates an extra target for every target that is "linked" by a
- // static library. Without this feature static libraries do not
- // wait until their "link" dependencies are built to build. This is
- // not a problem 99.9% of the time, and projects that do have the
- // problem can enable this work-around by using add_dependencies.
-
- // Static libraries cannot depend directly on the targets to which
- // they link because VS will copy those targets into the library
- // (for VS < 8). To work around the problem we copy the
- // dependencies to be utility dependencies so that the work-around
- // below is used.
- if(target.GetType() == cmTarget::STATIC_LIBRARY)
+ VSDependSet& vsTargetDepend = this->VSTargetDepends[&target];
+ if(target.GetType() != cmTarget::STATIC_LIBRARY)
{
cmTarget::LinkLibraryVectorType const& libs = target.GetLinkLibraries();
- for(cmTarget::LinkLibraryVectorType::const_iterator i = libs.begin();
- i != libs.end(); ++i)
+ for(cmTarget::LinkLibraryVectorType::const_iterator j = libs.begin();
+ j != libs.end(); ++j)
{
- if(cmTarget* depTarget = this->FindTarget(0, i->first.c_str(), false))
+ if(j->first != target.GetName() &&
+ this->FindTarget(0, j->first.c_str()))
{
- target.AddUtility(depTarget->GetName());
- }
- }
- }
-#endif
-
- // Look at each utility dependency.
- for(std::set<cmStdString>::const_iterator ui =
- target.GetUtilities().begin();
- ui != target.GetUtilities().end(); ++ui)
- {
- if(cmTarget* depTarget = this->FindTarget(0, ui->c_str()))
- {
- if(depTarget->GetType() == cmTarget::STATIC_LIBRARY ||
- depTarget->GetType() == cmTarget::SHARED_LIBRARY ||
- depTarget->GetType() == cmTarget::MODULE_LIBRARY)
- {
- // This utility dependency will cause an attempt to link. If
- // the depender does not already link the dependee we need an
- // intermediate target.
- if(!this->CheckTargetLinks(target, ui->c_str()))
- {
- this->CreateUtilityDependTarget(*depTarget);
- }
+ vsTargetDepend.insert(j->first);
}
}
}
-}
-
-//----------------------------------------------------------------------------
-void
-cmGlobalVisualStudioGenerator::CreateUtilityDependTarget(cmTarget& target)
-{
- // This target is a library on which a utility dependency exists.
- // We need to create an intermediate custom target to hook up the
- // dependency without causing a link.
- const char* altName = target.GetProperty("ALTERNATIVE_DEPENDENCY_NAME");
- if(!altName)
+ std::set<cmStdString> const& utils = target.GetUtilities();
+ for(std::set<cmStdString>::const_iterator i = utils.begin();
+ i != utils.end(); ++i)
{
- // Create the intermediate utility target.
- std::string altNameStr = target.GetName();
- altNameStr += "_UTILITY";
- const std::vector<std::string> no_depends;
- cmCustomCommandLines no_commands;
- const char* no_working_dir = 0;
- const char* no_comment = 0;
- target.GetMakefile()->AddUtilityCommand(altNameStr.c_str(), true,
- no_working_dir, no_depends,
- no_commands, false, no_comment);
- target.SetProperty("ALTERNATIVE_DEPENDENCY_NAME", altNameStr.c_str());
-
- // Most targets have a GUID created in ConfigureFinalPass. Since
- // that has already been called, create one for this target now.
- this->CreateGUID(altNameStr.c_str());
-
- // The intermediate target should depend on the original target.
- if(cmTarget* alt = this->FindTarget(0, altNameStr.c_str()))
+ if(*i != target.GetName())
{
- alt->AddUtility(target.GetName());
+ std::string name = this->GetUtilityForTarget(target, i->c_str());
+ vsTargetDepend.insert(name);
}
}
}
@@ -390,10 +317,28 @@ bool cmGlobalVisualStudioGenerator::CheckTargetLinks(cmTarget& target,
}
//----------------------------------------------------------------------------
-const char*
+std::string cmGlobalVisualStudioGenerator::GetUtilityDepend(cmTarget* target)
+{
+ UtilityDependsMap::iterator i = this->UtilityDepends.find(target);
+ if(i == this->UtilityDepends.end())
+ {
+ std::string name = this->WriteUtilityDepend(target);
+ UtilityDependsMap::value_type entry(target, name);
+ i = this->UtilityDepends.insert(entry).first;
+ }
+ return i->second;
+}
+
+//----------------------------------------------------------------------------
+std::string
cmGlobalVisualStudioGenerator::GetUtilityForTarget(cmTarget& target,
const char* name)
{
+ if(!this->VSLinksDependencies())
+ {
+ return name;
+ }
+
// Possibly depend on an intermediate utility target to avoid
// linking.
if(target.GetType() == cmTarget::STATIC_LIBRARY ||
@@ -401,19 +346,19 @@ cmGlobalVisualStudioGenerator::GetUtilityForTarget(cmTarget& target,
target.GetType() == cmTarget::MODULE_LIBRARY ||
target.GetType() == cmTarget::EXECUTABLE)
{
- // The depender is a target that links. Lookup the dependee to
- // see if it provides an alternative dependency name.
+ // The depender is a target that links.
if(cmTarget* depTarget = this->FindTarget(0, name))
{
- // Check for an alternative name created by FixUtilityDepends.
- if(const char* altName =
- depTarget->GetProperty("ALTERNATIVE_DEPENDENCY_NAME"))
+ if(depTarget->GetType() == cmTarget::STATIC_LIBRARY ||
+ depTarget->GetType() == cmTarget::SHARED_LIBRARY ||
+ depTarget->GetType() == cmTarget::MODULE_LIBRARY)
{
- // The alternative name is needed only if the depender does
- // not really link to the dependee.
+ // This utility dependency will cause an attempt to link. If
+ // the depender does not already link the dependee we need an
+ // intermediate target.
if(!this->CheckTargetLinks(target, name))
{
- return altName;
+ return this->GetUtilityDepend(depTarget);
}
}
}
@@ -424,30 +369,6 @@ cmGlobalVisualStudioGenerator::GetUtilityForTarget(cmTarget& target,
}
//----------------------------------------------------------------------------
-void cmGlobalVisualStudioGenerator::GetTargetSets(
- TargetDependSet& projectTargets, TargetDependSet& originalTargets,
- cmLocalGenerator* root, GeneratorVector const& generators
- )
-{
- this->cmGlobalGenerator::GetTargetSets(projectTargets, originalTargets,
- root, generators);
-
- // Add alternative dependency targets created by FixUtilityDepends.
- for(TargetDependSet::iterator ti = projectTargets.begin();
- ti != projectTargets.end(); ++ti)
- {
- cmTarget* tgt = *ti;
- if(const char* altName = tgt->GetProperty("ALTERNATIVE_DEPENDENCY_NAME"))
- {
- if(cmTarget* alt = tgt->GetMakefile()->FindTarget(altName))
- {
- projectTargets.insert(alt);
- }
- }
- }
-}
-
-//----------------------------------------------------------------------------
#include <windows.h>
//----------------------------------------------------------------------------
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index b0be087..daa6b3a 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -61,7 +61,6 @@ public:
// return true if target is fortran only
bool TargetIsFortranOnly(cmTarget& t);
- const char* GetUtilityForTarget(cmTarget& target, const char*);
/** Get the top-level registry key for this VS version. */
std::string GetRegistryBase();
@@ -71,8 +70,6 @@ public:
virtual bool IsMultiConfig() { return true; }
protected:
- void FixUtilityDepends();
-
// Does this VS version link targets to each other if there are
// dependencies in the SLN file? This was done for VS versions
// below 8.
@@ -90,14 +87,18 @@ protected:
OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const&);
};
- virtual void GetTargetSets(TargetDependSet& projectTargets,
- TargetDependSet& originalTargets,
- cmLocalGenerator* root, GeneratorVector const&);
+ virtual bool ComputeTargetDepends();
+ class VSDependSet: public std::set<cmStdString> {};
+ class VSDependMap: public std::map<cmTarget*, VSDependSet> {};
+ VSDependMap VSTargetDepends;
+ void ComputeVSTargetDepends(cmTarget&);
bool CheckTargetLinks(cmTarget& target, const char* name);
-private:
- void FixUtilityDependsForTarget(cmTarget& target);
- void CreateUtilityDependTarget(cmTarget& target);
+ std::string GetUtilityForTarget(cmTarget& target, const char*);
+ virtual std::string WriteUtilityDepend(cmTarget*) = 0;
+ std::string GetUtilityDepend(cmTarget* target);
+ typedef std::map<cmTarget*, cmStdString> UtilityDependsMap;
+ UtilityDependsMap UtilityDepends;
};
#endif
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 537a88f..0976a4d 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -131,8 +131,8 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(std::string const& version)
//----------------------------------------------------------------------------
cmGlobalGenerator* cmGlobalXCodeGenerator::New()
-{
-#if defined(CMAKE_BUILD_WITH_CMAKE)
+{
+#if defined(CMAKE_BUILD_WITH_CMAKE)
cmXcodeVersionParser parser;
parser.ParseFile
("/Developer/Applications/Xcode.app/Contents/version.plist");
@@ -156,7 +156,7 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::New()
void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const&
lang,
cmMakefile * mf, bool optional)
-{
+{
mf->AddDefinition("XCODE","1");
mf->AddDefinition("XCODE_VERSION", this->VersionString.c_str());
if(this->XcodeVersion == 15)
@@ -175,12 +175,12 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const&
mf->AddDefinition("CMAKE_GENERATOR_CC", "gcc");
mf->AddDefinition("CMAKE_GENERATOR_CXX", "g++");
mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
- // initialize Architectures so it can be used by
+ // initialize Architectures so it can be used by
// GetTargetObjectFileDirectories
this->cmGlobalGenerator::EnableLanguage(lang, mf, optional);
- const char* osxArch =
+ const char* osxArch =
mf->GetDefinition("CMAKE_OSX_ARCHITECTURES");
- const char* sysroot =
+ const char* sysroot =
mf->GetDefinition("CMAKE_OSX_SYSROOT");
if(osxArch && sysroot)
{
@@ -193,10 +193,10 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const&
//----------------------------------------------------------------------------
std::string cmGlobalXCodeGenerator
::GenerateBuildCommand(const char* makeProgram,
- const char *projectName,
- const char* additionalOptions,
+ const char *projectName,
+ const char* additionalOptions,
const char *targetName,
- const char* config,
+ const char* config,
bool ignoreErrors,
bool)
{
@@ -210,7 +210,7 @@ std::string cmGlobalXCodeGenerator
"Generator cannot find the appropriate make command.");
return "";
}
- std::string makeCommand =
+ std::string makeCommand =
cmSystemTools::ConvertToOutputPath(makeProgram);
std::string lowerCaseCommand = makeCommand;
cmSystemTools::LowerCase(lowerCaseCommand);
@@ -284,7 +284,7 @@ void cmGlobalXCodeGenerator::Generate()
// make sure extra targets are added before calling
// the parent generate which will call trace depends
for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
- {
+ {
cmLocalGenerator* root = it->second[0];
this->SetGenerationRoot(root);
// add ALL_BUILD, INSTALL, etc
@@ -293,7 +293,7 @@ void cmGlobalXCodeGenerator::Generate()
this->ForceLinkerLanguages();
this->cmGlobalGenerator::Generate();
for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
- {
+ {
cmLocalGenerator* root = it->second[0];
this->SetGenerationRoot(root);
// now create the project
@@ -319,8 +319,8 @@ void cmGlobalXCodeGenerator::SetGenerationRoot(cmLocalGenerator* root)
}
//----------------------------------------------------------------------------
-void
-cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
+void
+cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& gens)
{
cmMakefile* mf = root->GetMakefile();
@@ -339,7 +339,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
listfile += "CMakeLists.txt";
allbuild->AddSource(listfile.c_str());
- // Add XCODE depend helper
+ // Add XCODE depend helper
std::string dir = mf->GetCurrentOutputDirectory();
cmCustomCommandLine makecommand;
makecommand.push_back("make");
@@ -361,7 +361,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
for(std::vector<cmLocalGenerator*>::iterator i = gens.begin();
i != gens.end(); ++i)
{
- cmLocalGenerator* lg = *i;
+ cmLocalGenerator* lg = *i;
if(this->IsExcluded(root, *i))
{
continue;
@@ -370,7 +370,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++)
{
cmTarget& target = l->second;
- // make all exe, shared libs and modules
+ // make all exe, shared libs and modules
// run the depend check makefile as a post build rule
// this will make sure that when the next target is built
// things are up-to-date
@@ -385,7 +385,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
cmTarget::POST_BUILD,
"Depend check for xcode",
dir.c_str());
-
+
}
if(!target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
{
@@ -407,8 +407,8 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(cmLocalGenerator* root)
cmMakefile* mf = root->GetMakefile();
std::vector<std::string> lfiles = mf->GetListFiles();
// sort the array
- std::sort(lfiles.begin(), lfiles.end(), std::less<std::string>());
- std::vector<std::string>::iterator new_end =
+ std::sort(lfiles.begin(), lfiles.end(), std::less<std::string>());
+ std::vector<std::string>::iterator new_end =
std::unique(lfiles.begin(), lfiles.end());
lfiles.erase(new_end, lfiles.end());
std::string dir = mf->GetHomeOutputDirectory();
@@ -428,7 +428,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(cmLocalGenerator* root)
makefileStream << "\\\n" << this->ConvertToRelativeForMake(i->c_str());
}
std::string cmake = mf->GetRequiredDefinition("CMAKE_COMMAND");
- makefileStream << "\n\t" << this->ConvertToRelativeForMake(cmake.c_str())
+ makefileStream << "\n\t" << this->ConvertToRelativeForMake(cmake.c_str())
<< " -H" << this->ConvertToRelativeForMake(
mf->GetHomeDirectory())
<< " -B" << this->ConvertToRelativeForMake(
@@ -451,7 +451,7 @@ void cmGlobalXCodeGenerator::ClearXCodeObjects()
}
//----------------------------------------------------------------------------
-cmXCodeObject*
+cmXCodeObject*
cmGlobalXCodeGenerator::CreateObject(cmXCodeObject::PBXType ptype)
{
cmXCodeObject* obj;
@@ -468,7 +468,7 @@ cmGlobalXCodeGenerator::CreateObject(cmXCodeObject::PBXType ptype)
}
//----------------------------------------------------------------------------
-cmXCodeObject*
+cmXCodeObject*
cmGlobalXCodeGenerator::CreateObject(cmXCodeObject::Type type)
{
cmXCodeObject* obj = new cmXCodeObject(cmXCodeObject::None, type);
@@ -539,7 +539,7 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
buildFile->SetComment(fileRef->GetComment());
buildFile->AddAttribute("fileRef", this->CreateObjectReference(fileRef));
- cmXCodeObject* settings =
+ cmXCodeObject* settings =
this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
settings->AddAttribute("COMPILER_FLAGS", this->CreateString(flags.c_str()));
@@ -608,7 +608,7 @@ cmGlobalXCodeGenerator::CreateXCodeFileReference(cmSourceFile* sf,
}
fileRef->AddAttribute("fileEncoding", this->CreateString("4"));
- const char* lang =
+ const char* lang =
this->CurrentLocalGenerator->GetSourceFileLanguage(*sf);
std::string sourcecode = "sourcecode";
std::string ext = sf->GetExtension();
@@ -675,7 +675,7 @@ cmGlobalXCodeGenerator::CreateXCodeFileReference(cmSourceFile* sf,
// // valid lastKnownFileType value.
// }
- fileRef->AddAttribute("lastKnownFileType",
+ fileRef->AddAttribute("lastKnownFileType",
this->CreateString(sourcecode.c_str()));
// Store the file path relative to the top of the source tree.
@@ -717,31 +717,15 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen)
std::string outdir =
cmSystemTools::CollapseFullPath(this->CurrentMakefile->
GetCurrentOutputDirectory());
- cmSystemTools::SplitPath(outdir.c_str(),
+ cmSystemTools::SplitPath(outdir.c_str(),
this->CurrentOutputDirectoryComponents);
// Select the current set of configuration types.
this->CurrentConfigurationTypes.clear();
- if(this->XcodeVersion > 20)
- {
- if(const char* types =
- this->CurrentMakefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(types,
- this->CurrentConfigurationTypes);
- }
- }
+ this->CurrentMakefile->GetConfigurations(this->CurrentConfigurationTypes);
if(this->CurrentConfigurationTypes.empty())
{
- if(const char* buildType =
- this->CurrentMakefile->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- this->CurrentConfigurationTypes.push_back(buildType);
- }
- else
- {
- this->CurrentConfigurationTypes.push_back("");
- }
+ this->CurrentConfigurationTypes.push_back("");
}
}
@@ -783,7 +767,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
this->CreateXCodeSourceFile(this->CurrentLocalGenerator,
*i, cmtarget);
cmXCodeObject* fr = xsf->GetObject("fileRef");
- cmXCodeObject* filetype =
+ cmXCodeObject* filetype =
fr->GetObject()->GetObject("lastKnownFileType");
cmTarget::SourceFileFlags tsFlags =
@@ -829,7 +813,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
sourceBuildPhase =
this->CreateObject(cmXCodeObject::PBXSourcesBuildPhase);
sourceBuildPhase->SetComment("Sources");
- sourceBuildPhase->AddAttribute("buildActionMask",
+ sourceBuildPhase->AddAttribute("buildActionMask",
this->CreateString("2147483647"));
buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
for(std::vector<cmXCodeObject*>::iterator i = sourceFiles.begin();
@@ -838,7 +822,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
buildFiles->AddObject(*i);
}
sourceBuildPhase->AddAttribute("files", buildFiles);
- sourceBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing",
+ sourceBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing",
this->CreateString("0"));
}
@@ -931,7 +915,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
for ( sfIt = mit->second.begin(); sfIt != mit->second.end(); ++ sfIt )
{
cmXCodeObject* xsf =
- this->CreateXCodeSourceFile(this->CurrentLocalGenerator,
+ this->CreateXCodeSourceFile(this->CurrentLocalGenerator,
*sfIt, cmtarget);
buildFiles->AddObject(xsf);
}
@@ -955,12 +939,12 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
{
buildFiles->AddObject(*i);
}
- frameworkBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing",
+ frameworkBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing",
this->CreateString("0"));
}
// create list of build phases and create the XCode target
- cmXCodeObject* buildPhases =
+ cmXCodeObject* buildPhases =
this->CreateObject(cmXCodeObject::OBJECT_LIST);
this->CreateCustomCommands(buildPhases, sourceBuildPhase,
@@ -1049,15 +1033,15 @@ cmGlobalXCodeGenerator::CreateBuildPhase(const char* name,
{
return 0;
}
- cmXCodeObject* buildPhase =
+ cmXCodeObject* buildPhase =
this->CreateObject(cmXCodeObject::PBXShellScriptBuildPhase);
buildPhase->AddAttribute("buildActionMask",
this->CreateString("2147483647"));
cmXCodeObject* buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
buildPhase->AddAttribute("files", buildFiles);
- buildPhase->AddAttribute("name",
+ buildPhase->AddAttribute("name",
this->CreateString(name));
- buildPhase->AddAttribute("runOnlyForDeploymentPostprocessing",
+ buildPhase->AddAttribute("runOnlyForDeploymentPostprocessing",
this->CreateString("0"));
buildPhase->AddAttribute("shellPath",
this->CreateString("/bin/sh"));
@@ -1080,16 +1064,16 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
frameworkBuildPhase,
cmTarget& cmtarget)
{
- std::vector<cmCustomCommand> const & prebuild
+ std::vector<cmCustomCommand> const & prebuild
= cmtarget.GetPreBuildCommands();
- std::vector<cmCustomCommand> const & prelink
+ std::vector<cmCustomCommand> const & prelink
= cmtarget.GetPreLinkCommands();
- std::vector<cmCustomCommand> const & postbuild
+ std::vector<cmCustomCommand> const & postbuild
= cmtarget.GetPostBuildCommands();
std::vector<cmSourceFile*>const &classes = cmtarget.GetSourceFiles();
// add all the sources
std::vector<cmCustomCommand> commands;
- for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
+ for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
i != classes.end(); ++i)
{
if((*i)->GetCustomCommand())
@@ -1098,7 +1082,7 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
}
}
std::vector<cmCustomCommand> reruncom;
- cmXCodeObject* cmakeReRunPhase =
+ cmXCodeObject* cmakeReRunPhase =
this->CreateBuildPhase("CMake ReRun", "cmakeReRunPhase",
cmtarget, reruncom);
buildPhases->AddObject(cmakeReRunPhase);
@@ -1108,15 +1092,15 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
"cmakeRulesBuildPhase",
cmtarget, commands);
// create prebuild phase
- cmXCodeObject* preBuildPhase =
+ cmXCodeObject* preBuildPhase =
this->CreateBuildPhase("CMake PreBuild Rules", "preBuildCommands",
cmtarget, prebuild);
// create prelink phase
- cmXCodeObject* preLinkPhase =
+ cmXCodeObject* preLinkPhase =
this->CreateBuildPhase("CMake PreLink Rules", "preLinkCommands",
cmtarget, prelink);
// create postbuild phase
- cmXCodeObject* postBuildPhase =
+ cmXCodeObject* postBuildPhase =
this->CreateBuildPhase("CMake PostBuild Rules", "postBuildPhase",
cmtarget, postbuild);
@@ -1183,10 +1167,10 @@ std::string cmGlobalXCodeGenerator::ExtractFlag(const char* flag,
}
//----------------------------------------------------------------------------
-void
+void
cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
cmTarget& target,
- std::vector<cmCustomCommand>
+ std::vector<cmCustomCommand>
const & commands,
const char* name)
{
@@ -1197,7 +1181,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
std::string makecmd = "make -C ";
makecmd += cdir;
makecmd += " -f ";
- makecmd +=
+ makecmd +=
this->ConvertToRelativeForMake(this->CurrentReRunCMakeMakefile.c_str());
cmSystemTools::ReplaceString(makecmd, "\\ ", "\\\\ ");
buildphase->AddAttribute("shellScript",
@@ -1211,7 +1195,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
i != commands.end(); ++i)
{
- cmCustomCommand const& cc = *i;
+ cmCustomCommand const& cc = *i;
if(!cc.GetCommandLines().empty())
{
const std::vector<std::string>& outputs = cc.GetOutputs();
@@ -1229,7 +1213,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
}
}
}
-
+
std::string dir = this->CurrentMakefile->GetCurrentOutputDirectory();
dir += "/CMakeScripts";
cmSystemTools::MakeDirectory(dir.c_str());
@@ -1239,19 +1223,19 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
makefile += "_";
makefile += name;
makefile += ".make";
-
- for (std::vector<std::string>::const_iterator currentConfig=
+
+ for (std::vector<std::string>::const_iterator currentConfig=
this->CurrentConfigurationTypes.begin();
currentConfig!=this->CurrentConfigurationTypes.end();
currentConfig++ )
{
- this->CreateCustomRulesMakefile(makefile.c_str(),
- target,
- commands,
+ this->CreateCustomRulesMakefile(makefile.c_str(),
+ target,
+ commands,
currentConfig->c_str(),
multipleOutputPairs);
}
-
+
std::string cdir = this->CurrentMakefile->GetCurrentOutputDirectory();
cdir = this->ConvertToRelativeForXCode(cdir.c_str());
std::string makecmd = "make -C ";
@@ -1265,18 +1249,18 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
}
makecmd += " all";
cmSystemTools::ReplaceString(makecmd, "\\ ", "\\\\ ");
- buildphase->AddAttribute("shellScript",
+ buildphase->AddAttribute("shellScript",
this->CreateString(makecmd.c_str()));
}
//----------------------------------------------------------------------------
void cmGlobalXCodeGenerator
-::CreateCustomRulesMakefile(const char* makefileBasename,
- cmTarget& target,
- std::vector<cmCustomCommand>
+::CreateCustomRulesMakefile(const char* makefileBasename,
+ cmTarget& target,
+ std::vector<cmCustomCommand>
const & commands,
const char* configName,
- const std::map<cmStdString,
+ const std::map<cmStdString,
cmStdString>& multipleOutputPairs
)
{
@@ -1293,7 +1277,7 @@ void cmGlobalXCodeGenerator
makefileStream.SetCopyIfDifferent(true);
makefileStream << "# Generated by CMake, DO NOT EDIT\n";
makefileStream << "# Custom rules for " << target.GetName() << "\n";
-
+
// have all depend on all outputs
makefileStream << "all: ";
std::map<const cmCustomCommand*, cmStdString> tname;
@@ -1301,7 +1285,7 @@ void cmGlobalXCodeGenerator
for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
i != commands.end(); ++i)
{
- cmCustomCommand const& cc = *i;
+ cmCustomCommand const& cc = *i;
if(!cc.GetCommandLines().empty())
{
const std::vector<std::string>& outputs = cc.GetOutputs();
@@ -1315,10 +1299,10 @@ void cmGlobalXCodeGenerator
}
}
else
- {
+ {
cmOStringStream str;
str << "_buildpart_" << count++ ;
- tname[&cc] = std::string(target.GetName()) + str.str();
+ tname[&cc] = std::string(target.GetName()) + str.str();
makefileStream << "\\\n\t" << tname[&cc];
}
}
@@ -1327,7 +1311,7 @@ void cmGlobalXCodeGenerator
for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
i != commands.end(); ++i)
{
- cmCustomCommand const& cc = *i;
+ cmCustomCommand const& cc = *i;
if(!cc.GetCommandLines().empty())
{
bool escapeOldStyle = cc.GetEscapeOldStyle();
@@ -1346,7 +1330,7 @@ void cmGlobalXCodeGenerator
// There are no outputs. Use the generated force rule name.
makefileStream << tname[&cc] << ": ";
}
- for(std::vector<std::string>::const_iterator d =
+ for(std::vector<std::string>::const_iterator d =
cc.GetDepends().begin();
d != cc.GetDepends().end(); ++d)
{
@@ -1367,7 +1351,7 @@ void cmGlobalXCodeGenerator
}
// Add each command line to the set of commands.
- for(cmCustomCommandLines::const_iterator cl =
+ for(cmCustomCommandLines::const_iterator cl =
cc.GetCommandLines().begin();
cl != cc.GetCommandLines().end(); ++cl)
{
@@ -1375,7 +1359,7 @@ void cmGlobalXCodeGenerator
const cmCustomCommandLine& commandLine = *cl;
std::string cmd2 = this->CurrentLocalGenerator
->GetRealLocation(commandLine[0].c_str(), configName);
-
+
cmSystemTools::ReplaceString(cmd2, "/./", "/");
cmd2 = this->ConvertToRelativeForMake(cmd2.c_str());
std::string cmd;
@@ -1409,7 +1393,7 @@ void cmGlobalXCodeGenerator
// Add rules to deal with multiple outputs of custom commands.
if(!multipleOutputPairs.empty())
{
- makefileStream <<
+ makefileStream <<
"\n# Dependencies of multiple outputs to their primary outputs \n";
for(std::map<cmStdString, cmStdString>::const_iterator o =
@@ -1440,6 +1424,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
std::string defFlags;
bool shared = ((target.GetType() == cmTarget::SHARED_LIBRARY) ||
(target.GetType() == cmTarget::MODULE_LIBRARY));
+ bool binary = ((target.GetType() == cmTarget::STATIC_LIBRARY) ||
+ (target.GetType() == cmTarget::EXECUTABLE) ||
+ shared);
const char* lang = target.GetLinkerLanguage(configName);
std::string cflags;
@@ -1454,10 +1441,17 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
// Add language-specific flags.
this->CurrentLocalGenerator->AddLanguageFlags(flags, lang, configName);
-
+
// Add shared-library flags if needed.
this->CurrentLocalGenerator->AddSharedFlags(flags, lang, shared);
}
+ else if(binary)
+ {
+ cmSystemTools::Error
+ ("CMake can not determine linker language for target:",
+ target.GetName());
+ return;
+ }
// Add define flags
this->CurrentLocalGenerator->
@@ -1492,11 +1486,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
std::string extraLinkOptions;
if(target.GetType() == cmTarget::EXECUTABLE)
{
- extraLinkOptions =
+ extraLinkOptions =
this->CurrentMakefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS");
std::string var = "CMAKE_EXE_LINKER_FLAGS_";
var += cmSystemTools::UpperCase(configName);
- std::string val =
+ std::string val =
this->CurrentMakefile->GetSafeDefinition(var.c_str());
if(val.size())
{
@@ -1595,9 +1589,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
this->CreateString(pndir.c_str()));
pndir = target.GetDirectory(configName);
}
- buildSettings->AddAttribute("EXECUTABLE_PREFIX",
+ buildSettings->AddAttribute("EXECUTABLE_PREFIX",
this->CreateString(pnprefix.c_str()));
- buildSettings->AddAttribute("EXECUTABLE_SUFFIX",
+ buildSettings->AddAttribute("EXECUTABLE_SUFFIX",
this->CreateString(pnsuffix.c_str()));
}
buildSettings->AddAttribute("SYMROOT",
@@ -1608,20 +1602,20 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
{
case cmTarget::STATIC_LIBRARY:
{
- buildSettings->AddAttribute("LIBRARY_STYLE",
+ buildSettings->AddAttribute("LIBRARY_STYLE",
this->CreateString("STATIC"));
break;
}
-
+
case cmTarget::MODULE_LIBRARY:
{
- buildSettings->AddAttribute("LIBRARY_STYLE",
+ buildSettings->AddAttribute("LIBRARY_STYLE",
this->CreateString("BUNDLE"));
if(this->XcodeVersion >= 22)
{
- buildSettings->AddAttribute("MACH_O_TYPE",
+ buildSettings->AddAttribute("MACH_O_TYPE",
this->CreateString("mh_bundle"));
- buildSettings->AddAttribute("GCC_DYNAMIC_NO_PIC",
+ buildSettings->AddAttribute("GCC_DYNAMIC_NO_PIC",
this->CreateString("NO"));
// Add the flags to create an executable.
std::string createFlags =
@@ -1706,7 +1700,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
plist.c_str());
std::string path =
this->ConvertToRelativeForXCode(plist.c_str());
- buildSettings->AddAttribute("INFOPLIST_FILE",
+ buildSettings->AddAttribute("INFOPLIST_FILE",
this->CreateString(path.c_str()));
}
@@ -1717,7 +1711,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
}
if(this->XcodeVersion >= 22)
{
- buildSettings->AddAttribute("PREBINDING",
+ buildSettings->AddAttribute("PREBINDING",
this->CreateString("NO"));
}
@@ -1742,7 +1736,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
}
else
{
- std::string incpath =
+ std::string incpath =
this->XCodeEscapePath(i->c_str());
dirs.Add(incpath.c_str());
}
@@ -1761,12 +1755,12 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
}
if(!fdirs.IsEmpty())
{
- buildSettings->AddAttribute("FRAMEWORK_SEARCH_PATHS",
+ buildSettings->AddAttribute("FRAMEWORK_SEARCH_PATHS",
fdirs.CreateList());
}
if(!dirs.IsEmpty())
{
- buildSettings->AddAttribute("HEADER_SEARCH_PATHS",
+ buildSettings->AddAttribute("HEADER_SEARCH_PATHS",
dirs.CreateList());
}
std::string oflagc = this->ExtractFlag("-O", cflags);
@@ -1808,11 +1802,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
if(gflagc.size() ==0 && gflag.size() == 0)
{
debugStr = "NO";
- }
+ }
buildSettings->AddAttribute("GCC_GENERATE_DEBUGGING_SYMBOLS",
this->CreateString(debugStr));
- buildSettings->AddAttribute("GCC_OPTIMIZATION_LEVEL",
+ buildSettings->AddAttribute("GCC_OPTIMIZATION_LEVEL",
this->CreateString(optLevel));
buildSettings->AddAttribute("GCC_SYMBOLS_PRIVATE_EXTERN",
this->CreateString("NO"));
@@ -1822,11 +1816,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
{
flags += " ";
flags += defFlags;
- buildSettings->AddAttribute("OTHER_CPLUSPLUSFLAGS",
+ buildSettings->AddAttribute("OTHER_CPLUSPLUSFLAGS",
this->CreateString(flags.c_str()));
cflags += " ";
cflags += defFlags;
- buildSettings->AddAttribute("OTHER_CFLAGS",
+ buildSettings->AddAttribute("OTHER_CFLAGS",
this->CreateString(cflags.c_str()));
}
@@ -1834,7 +1828,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
{
flags += " ";
flags += defFlags;
- buildSettings->AddAttribute("OTHER_CFLAGS",
+ buildSettings->AddAttribute("OTHER_CFLAGS",
this->CreateString(flags.c_str()));
}
@@ -1862,9 +1856,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
buildSettings->AddAttribute("INSTALL_PATH",
this->CreateString(install_name_dir.c_str()));
- buildSettings->AddAttribute("OTHER_LDFLAGS",
+ buildSettings->AddAttribute("OTHER_LDFLAGS",
this->CreateString(extraLinkOptions.c_str()));
- buildSettings->AddAttribute("OTHER_REZFLAGS",
+ buildSettings->AddAttribute("OTHER_REZFLAGS",
this->CreateString(""));
buildSettings->AddAttribute("SECTORDER_FLAGS",
this->CreateString(""));
@@ -1934,12 +1928,12 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
}
//----------------------------------------------------------------------------
-cmXCodeObject*
+cmXCodeObject*
cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
{
cmXCodeObject* shellBuildPhase =
this->CreateObject(cmXCodeObject::PBXShellScriptBuildPhase);
- shellBuildPhase->AddAttribute("buildActionMask",
+ shellBuildPhase->AddAttribute("buildActionMask",
this->CreateString("2147483647"));
cmXCodeObject* buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
shellBuildPhase->AddAttribute("files", buildFiles);
@@ -1954,10 +1948,10 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
shellBuildPhase->AddAttribute("shellScript",
this->CreateString(
"# shell script goes here\nexit 0"));
- cmXCodeObject* target =
+ cmXCodeObject* target =
this->CreateObject(cmXCodeObject::PBXAggregateTarget);
target->SetComment(cmtarget.GetName());
- cmXCodeObject* buildPhases =
+ cmXCodeObject* buildPhases =
this->CreateObject(cmXCodeObject::OBJECT_LIST);
std::vector<cmXCodeObject*> emptyContentVector;
this->CreateCustomCommands(buildPhases, 0, 0, 0, emptyContentVector, 0,
@@ -1976,7 +1970,7 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
this->CreateBuildSettings(cmtarget, buildSettings, theConfig);
target->AddAttribute("buildSettings", buildSettings);
}
- cmXCodeObject* dependencies =
+ cmXCodeObject* dependencies =
this->CreateObject(cmXCodeObject::OBJECT_LIST);
target->AddAttribute("dependencies", dependencies);
target->AddAttribute("name", this->CreateString(cmtarget.GetName()));
@@ -2004,13 +1998,13 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
std::string cmGlobalXCodeGenerator::AddConfigurations(cmXCodeObject* target,
cmTarget& cmtarget)
{
- std::string configTypes =
+ std::string configTypes =
this->CurrentMakefile->GetRequiredDefinition("CMAKE_CONFIGURATION_TYPES");
std::vector<std::string> configVectorIn;
std::vector<std::string> configVector;
configVectorIn.push_back(configTypes);
cmSystemTools::ExpandList(configVectorIn, configVector);
- cmXCodeObject* configlist =
+ cmXCodeObject* configlist =
this->CreateObject(cmXCodeObject::XCConfigurationList);
cmXCodeObject* buildConfigurations =
this->CreateObject(cmXCodeObject::OBJECT_LIST);
@@ -2021,11 +2015,11 @@ std::string cmGlobalXCodeGenerator::AddConfigurations(cmXCodeObject* target,
comment += cmtarget.GetName();
comment += "\"";
configlist->SetComment(comment.c_str());
- target->AddAttribute("buildConfigurationList",
+ target->AddAttribute("buildConfigurationList",
this->CreateObjectReference(configlist));
for(unsigned int i = 0; i < configVector.size(); ++i)
{
- cmXCodeObject* config =
+ cmXCodeObject* config =
this->CreateObject(cmXCodeObject::XCBuildConfiguration);
buildConfigurations->AddObject(config);
cmXCodeObject* buildSettings =
@@ -2038,9 +2032,9 @@ std::string cmGlobalXCodeGenerator::AddConfigurations(cmXCodeObject* target,
}
if(configVector.size())
{
- configlist->AddAttribute("defaultConfigurationName",
+ configlist->AddAttribute("defaultConfigurationName",
this->CreateString(configVector[0].c_str()));
- configlist->AddAttribute("defaultConfigurationIsVisible",
+ configlist->AddAttribute("defaultConfigurationIsVisible",
this->CreateString("0"));
return configVector[0];
}
@@ -2095,7 +2089,7 @@ cmXCodeObject*
cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
cmXCodeObject* buildPhases)
{
- cmXCodeObject* target =
+ cmXCodeObject* target =
this->CreateObject(cmXCodeObject::PBXNativeTarget);
target->AddAttribute("buildPhases", buildPhases);
cmXCodeObject* buildRules = this->CreateObject(cmXCodeObject::OBJECT_LIST);
@@ -2113,13 +2107,13 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
this->CreateBuildSettings(cmtarget, buildSettings, defConfig.c_str());
target->AddAttribute("buildSettings", buildSettings);
}
- cmXCodeObject* dependencies =
+ cmXCodeObject* dependencies =
this->CreateObject(cmXCodeObject::OBJECT_LIST);
target->AddAttribute("dependencies", dependencies);
target->AddAttribute("name", this->CreateString(cmtarget.GetName()));
target->AddAttribute("productName",this->CreateString(cmtarget.GetName()));
- cmXCodeObject* fileRef =
+ cmXCodeObject* fileRef =
this->CreateObject(cmXCodeObject::PBXFileReference);
if(const char* fileType = this->GetTargetFileType(cmtarget))
{
@@ -2131,7 +2125,7 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
fileRef->AddAttribute("sourceTree",
this->CreateString("BUILT_PRODUCTS_DIR"));
fileRef->SetComment(cmtarget.GetName());
- target->AddAttribute("productReference",
+ target->AddAttribute("productReference",
this->CreateObjectReference(fileRef));
if(const char* productType = this->GetTargetProductType(cmtarget))
{
@@ -2172,20 +2166,20 @@ void cmGlobalXCodeGenerator::AddDependTarget(cmXCodeObject* target,
// now avoid circular references if dependTarget already
// depends on target then skip it. Circular references crashes
// xcode
- cmXCodeObject* dependTargetDepends =
+ cmXCodeObject* dependTargetDepends =
dependTarget->GetObject("dependencies");
if(dependTargetDepends)
{
if(dependTargetDepends->HasObject(target->GetPBXTargetDependency()))
- {
+ {
return;
}
}
-
+
cmXCodeObject* targetdep = dependTarget->GetPBXTargetDependency();
if(!targetdep)
{
- cmXCodeObject* container =
+ cmXCodeObject* container =
this->CreateObject(cmXCodeObject::PBXContainerItemProxy);
container->SetComment("PBXContainerItemProxy");
container->AddAttribute("containerPortal",
@@ -2193,25 +2187,25 @@ void cmGlobalXCodeGenerator::AddDependTarget(cmXCodeObject* target,
container->AddAttribute("proxyType", this->CreateString("1"));
container->AddAttribute("remoteGlobalIDString",
this->CreateObjectReference(dependTarget));
- container->AddAttribute("remoteInfo",
+ container->AddAttribute("remoteInfo",
this->CreateString(
dependTarget->GetTarget()->GetName()));
- targetdep =
+ targetdep =
this->CreateObject(cmXCodeObject::PBXTargetDependency);
targetdep->SetComment("PBXTargetDependency");
targetdep->AddAttribute("target",
this->CreateObjectReference(dependTarget));
- targetdep->AddAttribute("targetProxy",
+ targetdep->AddAttribute("targetProxy",
this->CreateObjectReference(container));
dependTarget->SetPBXTargetDependency(targetdep);
}
-
+
cmXCodeObject* depends = target->GetObject("dependencies");
if(!depends)
{
cmSystemTools::
Error("target does not have dependencies attribute error..");
-
+
}
else
{
@@ -2259,14 +2253,14 @@ void cmGlobalXCodeGenerator
{
// There are multiple configurations. Add the setting to the
// buildSettings of the configuration name given.
- cmXCodeObject* configurationList =
+ cmXCodeObject* configurationList =
target->GetObject("buildConfigurationList")->GetObject();
- cmXCodeObject* buildConfigs =
+ cmXCodeObject* buildConfigs =
configurationList->GetObject("buildConfigurations");
std::vector<cmXCodeObject*> list = buildConfigs->GetObjectList();
- // each configuration and the target itself has a buildSettings in it
+ // each configuration and the target itself has a buildSettings in it
//list.push_back(target);
- for(std::vector<cmXCodeObject*>::iterator i = list.begin();
+ for(std::vector<cmXCodeObject*>::iterator i = list.begin();
i != list.end(); ++i)
{
if(configName)
@@ -2428,7 +2422,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
std::vector<cmSourceGroup> sourceGroups = mf->GetSourceGroups();
cmTargets &tgts = mf->GetTargets();
for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++)
- {
+ {
cmTarget& cmtarget = l->second;
// Same skipping logic here as in CreateXCodeTargets so that we do not
@@ -2451,21 +2445,21 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
std::vector<cmSourceFile*> classes = cmtarget.GetSourceFiles();
- for(std::vector<cmSourceFile*>::const_iterator s = classes.begin();
+ for(std::vector<cmSourceFile*>::const_iterator s = classes.begin();
s != classes.end(); s++)
{
cmSourceFile* sf = *s;
// Add the file to the list of sources.
std::string const& source = sf->GetFullPath();
- cmSourceGroup& sourceGroup =
+ cmSourceGroup& sourceGroup =
mf->FindSourceGroup(source.c_str(), sourceGroups);
- cmXCodeObject* pbxgroup =
+ cmXCodeObject* pbxgroup =
this->CreateOrGetPBXGroup(cmtarget, &sourceGroup);
cmStdString key = GetGroupMapKey(cmtarget, sf);
this->GroupMap[key] = pbxgroup;
}
}
- }
+ }
}
//----------------------------------------------------------------------------
@@ -2491,7 +2485,7 @@ cmXCodeObject* cmGlobalXCodeGenerator
{
tgroup = this->CreateObject(cmXCodeObject::PBXGroup);
this->TargetGroup[cmtarget.GetName()] = tgroup;
- cmXCodeObject* tgroupChildren =
+ cmXCodeObject* tgroupChildren =
this->CreateObject(cmXCodeObject::OBJECT_LIST);
tgroup->AddAttribute("name", this->CreateString(cmtarget.GetName()));
tgroup->AddAttribute("children", tgroupChildren);
@@ -2514,7 +2508,7 @@ cmXCodeObject* cmGlobalXCodeGenerator
cmXCodeObject* tgroupChildren = tgroup->GetObject("children");
cmXCodeObject* group = this->CreateObject(cmXCodeObject::PBXGroup);
- cmXCodeObject* groupChildren =
+ cmXCodeObject* groupChildren =
this->CreateObject(cmXCodeObject::OBJECT_LIST);
group->AddAttribute("name", this->CreateString(sg->GetName()));
group->AddAttribute("children", groupChildren);
@@ -2534,19 +2528,19 @@ void cmGlobalXCodeGenerator
std::vector<cmLocalGenerator*>&
generators)
{
- this->ClearXCodeObjects();
+ this->ClearXCodeObjects();
this->RootObject = 0;
this->SourcesGroupChildren = 0;
this->ResourcesGroupChildren = 0;
this->MainGroupChildren = 0;
cmXCodeObject* group = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
group->AddAttribute("COPY_PHASE_STRIP", this->CreateString("NO"));
- cmXCodeObject* developBuildStyle =
+ cmXCodeObject* developBuildStyle =
this->CreateObject(cmXCodeObject::PBXBuildStyle);
cmXCodeObject* listObjs = this->CreateObject(cmXCodeObject::OBJECT_LIST);
if(this->XcodeVersion == 15)
{
- developBuildStyle->AddAttribute("name",
+ developBuildStyle->AddAttribute("name",
this->CreateString("Development"));
developBuildStyle->AddAttribute("buildSettings", group);
listObjs->AddObject(developBuildStyle);
@@ -2562,7 +2556,7 @@ void cmGlobalXCodeGenerator
{
for(unsigned int i = 0; i < this->CurrentConfigurationTypes.size(); ++i)
{
- cmXCodeObject* buildStyle =
+ cmXCodeObject* buildStyle =
this->CreateObject(cmXCodeObject::PBXBuildStyle);
const char* name = this->CurrentConfigurationTypes[i].c_str();
buildStyle->AddAttribute("name", this->CreateString(name));
@@ -2576,7 +2570,7 @@ void cmGlobalXCodeGenerator
}
cmXCodeObject* mainGroup = this->CreateObject(cmXCodeObject::PBXGroup);
- this->MainGroupChildren =
+ this->MainGroupChildren =
this->CreateObject(cmXCodeObject::OBJECT_LIST);
mainGroup->AddAttribute("children", this->MainGroupChildren);
if(this->XcodeVersion == 15)
@@ -2586,7 +2580,7 @@ void cmGlobalXCodeGenerator
mainGroup->AddAttribute("sourceTree", this->CreateString("<group>"));
cmXCodeObject* sourcesGroup = this->CreateObject(cmXCodeObject::PBXGroup);
- this->SourcesGroupChildren =
+ this->SourcesGroupChildren =
this->CreateObject(cmXCodeObject::OBJECT_LIST);
sourcesGroup->AddAttribute("name", this->CreateString("Sources"));
sourcesGroup->AddAttribute("children", this->SourcesGroupChildren);
@@ -2609,7 +2603,7 @@ void cmGlobalXCodeGenerator
resourcesGroup->AddAttribute("sourceTree", this->CreateString("<group>"));
this->MainGroupChildren->AddObject(resourcesGroup);
- // now create the cmake groups
+ // now create the cmake groups
this->CreateGroups(root, generators);
cmXCodeObject* productGroup = this->CreateObject(cmXCodeObject::PBXGroup);
@@ -2619,16 +2613,16 @@ void cmGlobalXCodeGenerator
productGroup->AddAttribute("refType", this->CreateString("4"));
}
productGroup->AddAttribute("sourceTree", this->CreateString("<group>"));
- cmXCodeObject* productGroupChildren =
+ cmXCodeObject* productGroupChildren =
this->CreateObject(cmXCodeObject::OBJECT_LIST);
productGroup->AddAttribute("children", productGroupChildren);
this->MainGroupChildren->AddObject(productGroup);
-
-
+
+
this->RootObject = this->CreateObject(cmXCodeObject::PBXProject);
this->RootObject->SetComment("Project object");
group = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
- this->RootObject->AddAttribute("mainGroup",
+ this->RootObject->AddAttribute("mainGroup",
this->CreateObjectReference(mainGroup));
this->RootObject->AddAttribute("buildSettings", group);
this->RootObject->AddAttribute("buildStyles", listObjs);
@@ -2655,18 +2649,18 @@ void cmGlobalXCodeGenerator
this->CreateString(pdir.c_str()));
this->RootObject->AddAttribute("projectRoot", this->CreateString(""));
}
- cmXCodeObject* configlist =
+ cmXCodeObject* configlist =
this->CreateObject(cmXCodeObject::XCConfigurationList);
cmXCodeObject* buildConfigurations =
this->CreateObject(cmXCodeObject::OBJECT_LIST);
std::vector<cmXCodeObject*> configs;
if(this->XcodeVersion == 15)
{
- cmXCodeObject* configDebug =
+ cmXCodeObject* configDebug =
this->CreateObject(cmXCodeObject::XCBuildConfiguration);
configDebug->AddAttribute("name", this->CreateString("Debug"));
configs.push_back(configDebug);
- cmXCodeObject* configRelease =
+ cmXCodeObject* configRelease =
this->CreateObject(cmXCodeObject::XCBuildConfiguration);
configRelease->AddAttribute("name", this->CreateString("Release"));
configs.push_back(configRelease);
@@ -2676,7 +2670,7 @@ void cmGlobalXCodeGenerator
for(unsigned int i = 0; i < this->CurrentConfigurationTypes.size(); ++i)
{
const char* name = this->CurrentConfigurationTypes[i].c_str();
- cmXCodeObject* config =
+ cmXCodeObject* config =
this->CreateObject(cmXCodeObject::XCBuildConfiguration);
config->AddAttribute("name", this->CreateString(name));
configs.push_back(config);
@@ -2694,13 +2688,13 @@ void cmGlobalXCodeGenerator
comment += this->CurrentProject;
comment += "\"";
configlist->SetComment(comment.c_str());
- configlist->AddAttribute("defaultConfigurationIsVisible",
+ configlist->AddAttribute("defaultConfigurationIsVisible",
this->CreateString("0"));
- configlist->AddAttribute("defaultConfigurationName",
+ configlist->AddAttribute("defaultConfigurationName",
this->CreateString("Debug"));
cmXCodeObject* buildSettings =
this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
- const char* osxArch =
+ const char* osxArch =
this->CurrentMakefile->GetDefinition("CMAKE_OSX_ARCHITECTURES");
if(strlen(osxArch) == 0)
{
@@ -2725,11 +2719,11 @@ void cmGlobalXCodeGenerator
this->CreateString("YES"));
}
- const char* sysroot =
+ const char* sysroot =
this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT");
- const char* sysrootDefault =
+ const char* sysrootDefault =
this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT_DEFAULT");
- const char* deploymentTarget =
+ const char* deploymentTarget =
this->CurrentMakefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET");
if(osxArch && sysroot)
{
@@ -2739,22 +2733,24 @@ void cmGlobalXCodeGenerator
cmSystemTools::ExpandListArgument(std::string(osxArch),
this->Architectures);
flagsUsed = true;
- buildSettings->AddAttribute("SDKROOT",
+ buildSettings->AddAttribute("SDKROOT",
this->CreateString(sysroot));
std::string archString;
- for( std::vector<std::string>::iterator i =
+ const char* sep = "";
+ for( std::vector<std::string>::iterator i =
this->Architectures.begin();
i != this->Architectures.end(); ++i)
{
+ archString += sep;
archString += *i;
- archString += " ";
+ sep = " ";
}
- buildSettings->AddAttribute("ARCHS",
+ buildSettings->AddAttribute("ARCHS",
this->CreateString(archString.c_str()));
if(!flagsUsed && sysrootDefault &&
strcmp(sysroot, sysrootDefault) != 0)
{
- buildSettings->AddAttribute("SDKROOT",
+ buildSettings->AddAttribute("SDKROOT",
this->CreateString(sysroot));
}
}
@@ -2790,7 +2786,7 @@ void cmGlobalXCodeGenerator
(*i)->AddAttribute("buildSettings", buildSettings);
}
- this->RootObject->AddAttribute("buildConfigurationList",
+ this->RootObject->AddAttribute("buildConfigurationList",
this->CreateObjectReference(configlist));
std::vector<cmXCodeObject*> targets;
@@ -2815,7 +2811,7 @@ void cmGlobalXCodeGenerator
cmXCodeObject* allTargets = this->CreateObject(cmXCodeObject::OBJECT_LIST);
for(std::vector<cmXCodeObject*>::iterator i = targets.begin();
i != targets.end(); ++i)
- {
+ {
cmXCodeObject* t = *i;
allTargets->AddObject(t);
cmXCodeObject* productRef = t->GetObject("productReference");
@@ -2828,11 +2824,11 @@ void cmGlobalXCodeGenerator
}
//----------------------------------------------------------------------------
-void
+void
cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
std::vector<cmXCodeObject*>& targets)
-{
- cmGeneratedFileStream
+{
+ cmGeneratedFileStream
makefileStream(this->CurrentXCodeHackMakefile.c_str());
if(!makefileStream)
{
@@ -2878,9 +2874,9 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
this->ConvertToRelativeForMake(tfull.c_str());
}
}
- makefileStream << "\n\n";
+ makefileStream << "\n\n";
}
- makefileStream
+ makefileStream
<< "# For each target create a dummy rule "
"so the target does not have to exist\n";
std::set<cmStdString> emitted;
@@ -2890,7 +2886,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
cmXCodeObject* target = *i;
std::map<cmStdString, cmXCodeObject::StringVec> const& deplibs =
target->GetDependLibraries();
- for(std::map<cmStdString, cmXCodeObject::StringVec>::const_iterator ci
+ for(std::map<cmStdString, cmXCodeObject::StringVec>::const_iterator ci
= deplibs.begin(); ci != deplibs.end(); ++ci)
{
for(cmXCodeObject::StringVec::const_iterator d = ci->second.begin();
@@ -2898,7 +2894,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
{
if(emitted.insert(*d).second)
{
- makefileStream <<
+ makefileStream <<
this->ConvertToRelativeForMake(d->c_str()) << ":\n";
}
}
@@ -2907,10 +2903,10 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
makefileStream << "\n\n";
// Write rules to help Xcode relink things at the right time.
- makefileStream <<
+ makefileStream <<
"# Rules to remove targets that are older than anything to which they\n"
"# link. This forces Xcode to relink the targets from scratch. It\n"
- "# does not seem to check these dependencies itself.\n";
+ "# does not seem to check these dependencies itself.\n";
for(std::vector<std::string>::const_iterator
ct = this->CurrentConfigurationTypes.begin();
ct != this->CurrentConfigurationTypes.end(); ++ct)
@@ -2931,7 +2927,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
{
// Create a rule for this target.
std::string tfull = t->GetFullPath(configName);
- makefileStream << this->ConvertToRelativeForMake(tfull.c_str())
+ makefileStream << this->ConvertToRelativeForMake(tfull.c_str())
<< ":";
// List dependencies if any exist.
@@ -2943,7 +2939,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
for(std::vector<cmStdString>::const_iterator d = deplibs.begin();
d != deplibs.end(); ++d)
{
- makefileStream << "\\\n\t" <<
+ makefileStream << "\\\n\t" <<
this->ConvertToRelativeForMake(d->c_str());
}
}
@@ -2965,7 +2961,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
universal += "/";
universal += t->GetName();
universal += ".build/Objects-normal/";
- for( std::vector<std::string>::iterator arch =
+ for( std::vector<std::string>::iterator arch =
this->Architectures.begin();
arch != this->Architectures.end(); ++arch)
{
@@ -2974,7 +2970,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
universalFile += "/";
universalFile += t->GetFullName(configName);
makefileStream << "\t/bin/rm -f "
- <<
+ <<
this->ConvertToRelativeForMake(universalFile.c_str())
<< "\n";
}
@@ -2988,7 +2984,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
//----------------------------------------------------------------------------
void
cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root,
- std::vector<cmLocalGenerator*>&
+ std::vector<cmLocalGenerator*>&
generators)
{
if(generators.size() == 0)
@@ -3028,7 +3024,7 @@ cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root,
}
//----------------------------------------------------------------------------
-void
+void
cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout,
cmLocalGenerator* ,
std::vector<cmLocalGenerator*>& )
@@ -3086,7 +3082,7 @@ std::string cmGlobalXCodeGenerator::ConvertToRelativeForMake(const char* p)
}
else
{
- std::string ret =
+ std::string ret =
this->CurrentLocalGenerator->
ConvertToRelativePath(this->CurrentOutputDirectoryComponents, p);
return cmSystemTools::ConvertToOutputPath(ret.c_str());
@@ -3102,7 +3098,7 @@ std::string cmGlobalXCodeGenerator::ConvertToRelativeForXCode(const char* p)
}
else
{
- std::string ret =
+ std::string ret =
this->CurrentLocalGenerator->
ConvertToRelativePath(this->ProjectOutputDirectoryComponents, p);
return cmSystemTools::ConvertToOutputPath(ret.c_str());
@@ -3142,7 +3138,7 @@ std::string cmGlobalXCodeGenerator::XCodeEscapePath(const char* p)
//----------------------------------------------------------------------------
void cmGlobalXCodeGenerator::
GetTargetObjectFileDirectories(cmTarget* target,
- std::vector<std::string>&
+ std::vector<std::string>&
dirs)
{
std::string dir = this->CurrentMakefile->GetCurrentOutputDirectory();
@@ -3156,7 +3152,7 @@ GetTargetObjectFileDirectories(cmTarget* target,
std::string dirsave = dir;
if(this->Architectures.size())
{
- for(std::vector<std::string>::iterator i = this->Architectures.begin();
+ for(std::vector<std::string>::iterator i = this->Architectures.begin();
i != this->Architectures.end(); ++i)
{
dir += *i;
diff --git a/Source/cmGraphAdjacencyList.h b/Source/cmGraphAdjacencyList.h
index 7794840..0149d33 100644
--- a/Source/cmGraphAdjacencyList.h
+++ b/Source/cmGraphAdjacencyList.h
@@ -14,7 +14,27 @@
#include "cmStandardIncludes.h"
+/**
+ * Graph edge representation. Most use cases just need the
+ * destination vertex, so we support conversion to/from an int. We
+ * also store boolean to indicate whether an edge is "strong".
+ */
+class cmGraphEdge
+{
+public:
+ cmGraphEdge(): Dest(0), Strong(true) {}
+ cmGraphEdge(int n): Dest(n), Strong(true) {}
+ cmGraphEdge(int n, bool s): Dest(n), Strong(s) {}
+ cmGraphEdge(cmGraphEdge const& r): Dest(r.Dest), Strong(r.Strong) {}
+ operator int() const { return this->Dest; }
+
+ bool IsStrong() const { return this->Strong; }
+private:
+ int Dest;
+ bool Strong;
+};
+struct cmGraphEdgeList: public std::vector<cmGraphEdge> {};
struct cmGraphNodeList: public std::vector<int> {};
-struct cmGraphAdjacencyList: public std::vector<cmGraphNodeList> {};
+struct cmGraphAdjacencyList: public std::vector<cmGraphEdgeList> {};
#endif
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index 1c1444b..9e6f4b6 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -63,7 +63,7 @@ bool cmIncludeDirectoryCommand
// " /foo/bar
// /boo/hoo /dingle/berry "
//
-// ideally that should be three seperate arguments but when sucking the
+// ideally that should be three separate arguments but when sucking the
// output from a program and passing it into a command the cleanup doesn't
// always happen
//
diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h
index ea0a1ec..8f62322 100644
--- a/Source/cmInstallCommand.h
+++ b/Source/cmInstallCommand.h
@@ -175,6 +175,7 @@ public:
"The EXPORT option associates the installed target files with an "
"export called <export-name>. "
"It must appear before any RUNTIME, LIBRARY, or ARCHIVE options. "
+ "To actually install the export file itself, call install(EXPORT). "
"See documentation of the install(EXPORT ...) signature below for "
"details."
"\n"
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx
index 47ca769..d7505dc 100644
--- a/Source/cmInstallGenerator.cxx
+++ b/Source/cmInstallGenerator.cxx
@@ -60,6 +60,29 @@ void cmInstallGenerator
}
os << indent;
std::string dest = this->GetInstallDestination();
+ if (cmSystemTools::FileIsFullPath(dest.c_str()))
+ {
+ os << "list(APPEND CPACK_ABSOLUTE_DESTINATION_FILES\n";
+ os << indent << " \"";
+ for(std::vector<std::string>::const_iterator fi = files.begin();
+ fi != files.end(); ++fi)
+ {
+ if (fi!=files.begin())
+ {
+ os << ";";
+ }
+ os << dest << "/";
+ if (rename && *rename)
+ {
+ os << rename;
+ }
+ else
+ {
+ os << cmSystemTools::GetFilenameName(*fi);
+ }
+ }
+ os << "\")\n";
+ }
os << "FILE(INSTALL DESTINATION \"" << dest << "\" TYPE " << stype.c_str();
if(optional)
{
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 13d875f..5bffd52 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -278,16 +278,8 @@ void cmLocalGenerator::GenerateTestFiles()
// Compute the set of configurations.
std::vector<std::string> configurationTypes;
- if(const char* types =
- this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(types, configurationTypes);
- }
- const char* config = 0;
- if(configurationTypes.empty())
- {
- config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
- }
+ const char* config =
+ this->Makefile->GetConfigurations(configurationTypes, false);
std::string file = this->Makefile->GetStartOutputDirectory();
file += "/";
@@ -383,16 +375,8 @@ void cmLocalGenerator::GenerateInstallRules()
// Compute the set of configurations.
std::vector<std::string> configurationTypes;
- if(const char* types =
- this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(types, configurationTypes);
- }
- const char* config = 0;
- if(configurationTypes.empty())
- {
- config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
- }
+ const char* config =
+ this->Makefile->GetConfigurations(configurationTypes, false);
// Choose a default install configuration.
const char* default_config = config;
@@ -546,19 +530,7 @@ void cmLocalGenerator::GenerateTargetManifest()
{
// Collect the set of configuration types.
std::vector<std::string> configNames;
- if(const char* configurationTypes =
- this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(configurationTypes, configNames);
- }
- else if(const char* buildType =
- this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- if(*buildType)
- {
- configNames.push_back(buildType);
- }
- }
+ this->Makefile->GetConfigurations(configNames);
// Add our targets to the manifest for each configuration.
cmTargets& targets = this->Makefile->GetTargets();
@@ -2810,17 +2782,29 @@ cmLocalGenerator
std::string cmLocalGenerator::EscapeForShellOldStyle(const char* str)
{
std::string result;
- bool forceOn = cmSystemTools::GetForceUnixPaths();
- if(forceOn && this->WindowsShell)
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ // if there are spaces
+ std::string temp = str;
+ if (temp.find(" ") != std::string::npos &&
+ temp.find("\"")==std::string::npos)
{
- cmSystemTools::SetForceUnixPaths(false);
+ result = "\"";
+ result += str;
+ result += "\"";
+ return result;
}
- result = cmSystemTools::EscapeSpaces(str);
- if(forceOn && this->WindowsShell)
+ return str;
+#else
+ for(const char* ch = str; *ch != '\0'; ++ch)
{
- cmSystemTools::SetForceUnixPaths(true);
+ if(*ch == ' ')
+ {
+ result += '\\';
+ }
+ result += *ch;
}
return result;
+#endif
}
//----------------------------------------------------------------------------
@@ -3045,7 +3029,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
if(define.find_first_of("#") != define.npos)
{
cmOStringStream e;
- e << "WARNING: Peprocessor definitions containing '#' may not be "
+ e << "WARNING: Preprocessor definitions containing '#' may not be "
<< "passed on the compiler command line because many compilers "
<< "do not support it.\n"
<< "CMake is dropping a preprocessor definition: " << define << "\n"
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 004d19a..f04d0a0 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1062,9 +1062,16 @@ cmLocalUnixMakefileGenerator3
}
}
}
- if (useCall && launcher.empty())
+ if (launcher.empty())
{
- cmd = "call " + cmd;
+ if (useCall)
+ {
+ cmd = "call " + cmd;
+ }
+ else if (this->NMake && cmd[0]=='"')
+ {
+ cmd = "echo >nul && " + cmd;
+ }
}
commands1.push_back(cmd);
}
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index 8df0ffa..57d8653 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -37,7 +37,7 @@ class cmVS10XMLParser : public cmXMLParser
{
return;
}
- if(strcmp("ProjectGUID", name) == 0)
+ if(strcmp("ProjectGUID", name) == 0 || strcmp("ProjectGuid", name) == 0)
{
this->DoGUID = true;
}
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 539816d..eb4e4a4 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1187,7 +1187,8 @@ void cmLocalVisualStudio6Generator
extraLinkOptionsMinSizeRel += targetLinkFlags;
}
- if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS_RELWITHDEBINFO"))
+ if(const char* targetLinkFlags =
+ target.GetProperty("LINK_FLAGS_RELWITHDEBINFO"))
{
extraLinkOptionsRelWithDebInfo += " ";
extraLinkOptionsRelWithDebInfo += targetLinkFlags;
@@ -1304,7 +1305,8 @@ void cmLocalVisualStudio6Generator
optionsRelease);
this->ComputeLinkOptions(target, "MinSizeRel", extraLinkOptionsMinSizeRel,
optionsMinSizeRel);
- this->ComputeLinkOptions(target, "RelWithDebInfo", extraLinkOptionsRelWithDebInfo,
+ this->ComputeLinkOptions(target, "RelWithDebInfo",
+ extraLinkOptionsRelWithDebInfo,
optionsRelWithDebInfo);
}
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index e411d3e..cb34bb6 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -466,6 +466,8 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] =
{"GenerateManifest", "MANIFEST", "enable manifest generation", "TRUE", 0},
{"LinkIncremental", "INCREMENTAL:NO", "link incremental", "1", 0},
{"LinkIncremental", "INCREMENTAL:YES", "link incremental", "2", 0},
+ {"EntryPointSymbol", "ENTRY:", "sets the starting address", "",
+ cmVS7FlagTable::UserValue},
{"IgnoreDefaultLibraryNames", "NODEFAULTLIB:", "default libs to ignore", "",
cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
{"IgnoreAllDefaultLibraries", "NODEFAULTLIB", "ignore all default libs",
@@ -480,6 +482,21 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] =
{"OptimizeReferences", "OPT:REF", "Eliminate unreferenced data", "2", 0},
{"TargetMachine", "MACHINE:I386", "Machine x86", "1", 0},
{"TargetMachine", "MACHINE:X86", "Machine x86", "1", 0},
+ {"TargetMachine", "MACHINE:AM33", "Machine AM33", "2", 0},
+ {"TargetMachine", "MACHINE:ARM", "Machine ARM", "3", 0},
+ {"TargetMachine", "MACHINE:EBC", "Machine EBC", "4", 0},
+ {"TargetMachine", "MACHINE:IA64", "Machine IA64", "5", 0},
+ {"TargetMachine", "MACHINE:M32R", "Machine M32R", "6", 0},
+ {"TargetMachine", "MACHINE:MIPS", "Machine MIPS", "7", 0},
+ {"TargetMachine", "MACHINE:MIPS16", "Machine MIPS16", "8", 0},
+ {"TargetMachine", "MACHINE:MIPSFPU)", "Machine MIPSFPU", "9", 0},
+ {"TargetMachine", "MACHINE:MIPSFPU16", "Machine MIPSFPU16", "10", 0},
+ {"TargetMachine", "MACHINE:MIPSR41XX", "Machine MIPSR41XX", "11", 0},
+ {"TargetMachine", "MACHINE:SH3", "Machine SH3", "12", 0},
+ {"TargetMachine", "MACHINE:SH3DSP", "Machine SH3DSP", "13", 0},
+ {"TargetMachine", "MACHINE:SH4", "Machine SH4", "14", 0},
+ {"TargetMachine", "MACHINE:SH5", "Machine SH5", "15", 0},
+ {"TargetMachine", "MACHINE:THUMB", "Machine THUMB", "16", 0},
{"TargetMachine", "MACHINE:X64", "Machine x64", "17", 0},
{"ModuleDefinitionFile", "DEF:", "add an export def file", "",
cmVS7FlagTable::UserValue},
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8eece6b..ef15113 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -894,6 +894,14 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
// Construct a rule file associated with the first output produced.
std::string outName = outputs[0];
outName += ".rule";
+ const char* dir =
+ this->LocalGenerator->GetGlobalGenerator()->
+ GetCMakeCFGInitDirectory();
+ if(dir && dir[0] == '$')
+ {
+ cmSystemTools::ReplaceString(outName, dir,
+ cmake::GetCMakeFilesDirectory());
+ }
// Check if the rule file already exists.
file = this->GetSource(outName.c_str());
if(file && file->GetCustomCommand() && !replace)
@@ -1436,16 +1444,7 @@ void cmMakefile::InitializeFromParent()
this->SetProperty("COMPILE_DEFINITIONS",
parent->GetProperty("COMPILE_DEFINITIONS"));
std::vector<std::string> configs;
- if(const char* configTypes =
- this->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(configTypes, configs);
- }
- else if(const char* buildType =
- this->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- configs.push_back(buildType);
- }
+ this->GetConfigurations(configs);
for(std::vector<std::string>::const_iterator ci = configs.begin();
ci != configs.end(); ++ci)
{
@@ -2367,6 +2366,31 @@ void cmMakefile::AddDefaultDefinitions()
cmake::GetCMakeFilesDirectory());
}
+//----------------------------------------------------------------------------
+const char*
+cmMakefile::GetConfigurations(std::vector<std::string>& configs,
+ bool single) const
+{
+ if(this->LocalGenerator->GetGlobalGenerator()->IsMultiConfig())
+ {
+ if(const char* configTypes =
+ this->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
+ {
+ cmSystemTools::ExpandListArgument(configTypes, configs);
+ }
+ return 0;
+ }
+ else
+ {
+ const char* buildType = this->GetDefinition("CMAKE_BUILD_TYPE");
+ if(single && buildType && *buildType)
+ {
+ configs.push_back(buildType);
+ }
+ return buildType;
+ }
+}
+
#if defined(CMAKE_BUILD_WITH_CMAKE)
/**
* Find a source group whose regular expression matches the filename
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 4fae7ee..8b8a3f8 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -309,7 +309,11 @@ public:
{
return this->ProjectName.c_str();
}
-
+
+ /** Get the configurations to be generated. */
+ const char* GetConfigurations(std::vector<std::string>& configs,
+ bool single = true) const;
+
/**
* Set the name of the library.
*/
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 93c981a..a5e319d 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -345,6 +345,13 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
vars.CMTarget = this->Target;
vars.Language = linkLanguage;
vars.Objects = buildObjs.c_str();
+ std::string objdir = cmake::GetCMakeFilesDirectoryPostSlash();
+ objdir += this->Target->GetName();
+ objdir += ".dir";
+ objdir = this->Convert(objdir.c_str(),
+ cmLocalGenerator::START_OUTPUT,
+ cmLocalGenerator::SHELL);
+ vars.ObjectDir = objdir.c_str();
vars.Target = targetOutPathReal.c_str();
vars.TargetPDB = targetOutPathPDB.c_str();
diff --git a/Source/cmOptionCommand.h b/Source/cmOptionCommand.h
index 8670fc4..fa5abd8 100644
--- a/Source/cmOptionCommand.h
+++ b/Source/cmOptionCommand.h
@@ -59,7 +59,10 @@ public:
" option(<option_variable> \"help string describing option\"\n"
" [initial value])\n"
"Provide an option for the user to select as ON or OFF. If no "
- "initial value is provided, OFF is used.";
+ "initial value is provided, OFF is used.\n"
+ "If you have options that depend on the values of other "
+ "options, see the module help for CMakeDependentOption."
+ ;
}
/**
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 69d3e51..3fe92de 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -15,8 +15,8 @@ const char* cmPolicies::PolicyStatusNames[] = {
class cmPolicy
{
-public:
- cmPolicy(cmPolicies::PolicyID iD,
+public:
+ cmPolicy(cmPolicies::PolicyID iD,
const char *idString,
const char *shortDescription,
const char *longDescription,
@@ -55,7 +55,7 @@ public:
return v.str();
}
- bool IsPolicyNewerThan(unsigned int majorV,
+ bool IsPolicyNewerThan(unsigned int majorV,
unsigned int minorV,
unsigned int patchV,
unsigned int tweakV)
@@ -86,7 +86,7 @@ public:
}
return (tweakV < this->TweakVersionIntroduced);
}
-
+
cmPolicies::PolicyID ID;
std::string IDString;
std::string ShortDescription;
@@ -285,12 +285,12 @@ cmPolicies::cmPolicies()
"The NEW behavior for this policy is to produce an error if a bundle "
"target is installed without a BUNDLE DESTINATION.",
2,6,0,0, cmPolicies::WARN);
-
+
this->DefinePolicy(
CMP0007, "CMP0007",
"list command no longer ignores empty elements.",
"This policy determines whether the list command will "
- "ignore empty elements in the list. "
+ "ignore empty elements in the list. "
"CMake 2.4 and below list commands ignored all empty elements"
" in the list. For example, a;b;;c would have length 3 and not 4. "
"The OLD behavior for this policy is to ignore empty list elements. "
@@ -426,7 +426,7 @@ cmPolicies::cmPolicies()
this->DefinePolicy(
CMP0015, "CMP0015",
"link_directories() treats paths relative to the source dir.",
- "In CMake 2.6.4 and lower the link_directories() command passed relative "
+ "In CMake 2.8.0 and lower the link_directories() command passed relative "
"paths unchanged to the linker. "
"In CMake 2.8.1 and above the link_directories() command prefers to "
"interpret relative paths with respect to CMAKE_CURRENT_SOURCE_DIR, "
@@ -437,12 +437,21 @@ cmPolicies::cmPolicies()
"absolute paths by appending the relative path to "
"CMAKE_CURRENT_SOURCE_DIR.",
2,8,1,0, cmPolicies::WARN);
+
+ this->DefinePolicy(
+ CMP0016, "CMP0016",
+ "target_link_libraries() reports error if only argument is not a target.",
+ "In CMake 2.8.2 and lower the target_link_libraries() command silently "
+ "ignored if it was called with only one argument, and this argument "
+ "wasn't a valid target. "
+ "In CMake 2.8.3 and above it reports an error in this case.",
+ 2,8,3,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
{
// free the policies
- std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
+ std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
= this->Policies.begin();
for (;i != this->Policies.end(); ++i)
{
@@ -451,7 +460,7 @@ cmPolicies::~cmPolicies()
}
void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD,
- const char *idString,
+ const char *idString,
const char *shortDescription,
const char *longDescription,
unsigned int majorVersionIntroduced,
@@ -467,7 +476,7 @@ void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD,
"ID ", this->GetPolicyIDString(iD).c_str());
return;
}
-
+
this->Policies[iD] = new cmPolicy(iD, idString,
shortDescription,
longDescription,
@@ -480,7 +489,7 @@ void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD,
}
//----------------------------------------------------------------------------
-bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
+bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
const char *version)
{
std::string ver = "2.4.0";
@@ -505,7 +514,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
mf->IssueMessage(cmake::FATAL_ERROR, e.str());
return false;
}
-
+
// it is an error if the policy version is less than 2.4
if (majorVer < 2 || (majorVer == 2 && minorVer < 4))
{
@@ -547,7 +556,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
// now loop over all the policies and set them as appropriate
std::vector<cmPolicies::PolicyID> ancientPolicies;
- std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
+ std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
= this->Policies.begin();
for (;i != this->Policies.end(); ++i)
{
@@ -589,7 +598,7 @@ bool cmPolicies::GetPolicyID(const char *id, cmPolicies::PolicyID &pid)
{
return false;
}
- std::map<std::string,cmPolicies::PolicyID>::iterator pos =
+ std::map<std::string,cmPolicies::PolicyID>::iterator pos =
this->PolicyStringMap.find(id);
if (pos == this->PolicyStringMap.end())
{
@@ -601,7 +610,7 @@ bool cmPolicies::GetPolicyID(const char *id, cmPolicies::PolicyID &pid)
std::string cmPolicies::GetPolicyIDString(cmPolicies::PolicyID pid)
{
- std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
+ std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
this->Policies.find(pid);
if (pos == this->Policies.end())
{
@@ -614,7 +623,7 @@ std::string cmPolicies::GetPolicyIDString(cmPolicies::PolicyID pid)
///! return a warning string for a given policy
std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id)
{
- std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
+ std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
this->Policies.find(id);
if (pos == this->Policies.end())
{
@@ -633,12 +642,12 @@ std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id)
"and suppress this warning.";
return msg.str();
}
-
-
+
+
///! return an error string for when a required policy is unspecified
std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id)
{
- std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
+ std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
this->Policies.find(id);
if (pos == this->Policies.end())
{
@@ -664,25 +673,25 @@ std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id)
}
///! Get the default status for a policy
-cmPolicies::PolicyStatus
+cmPolicies::PolicyStatus
cmPolicies::GetPolicyStatus(cmPolicies::PolicyID id)
{
// if the policy is not know then what?
- std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
+ std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
this->Policies.find(id);
if (pos == this->Policies.end())
{
// TODO is this right?
return cmPolicies::WARN;
}
-
+
return pos->second->Status;
}
void cmPolicies::GetDocumentation(std::vector<cmDocumentationEntry>& v)
{
// now loop over all the policies and set them as appropriate
- std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
+ std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
= this->Policies.begin();
for (;i != this->Policies.end(); ++i)
{
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 23064dc..fce33ac 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -51,6 +51,7 @@ public:
CMP0013, // Duplicate binary directories not allowed
CMP0014, // Input directories must have CMakeLists.txt
CMP0015, // link_directories() treats paths relative to source dir
+ CMP0016, // target_link_libraries() fails if only argument is not a target
// Always the last entry. Useful mostly to avoid adding a comma
// the last policy when adding a new one.
@@ -60,10 +61,10 @@ public:
///! convert a string policy ID into a number
bool GetPolicyID(const char *id, /* out */ cmPolicies::PolicyID &pid);
std::string GetPolicyIDString(cmPolicies::PolicyID pid);
-
+
///! Get the default status for a policy
cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id);
-
+
///! Define a Policy for CMake
void DefinePolicy(cmPolicies::PolicyID id,
const char *stringID,
@@ -80,7 +81,7 @@ public:
///! return a warning string for a given policy
std::string GetPolicyWarning(cmPolicies::PolicyID id);
-
+
///! return an error string for when a required policy is unspecified
std::string GetRequiredPolicyError(cmPolicies::PolicyID id);
diff --git a/Source/cmProjectCommand.h b/Source/cmProjectCommand.h
index fca5f1f..fc2b7a2 100644
--- a/Source/cmProjectCommand.h
+++ b/Source/cmProjectCommand.h
@@ -66,7 +66,7 @@ public:
"Optionally you can specify which languages your project supports. "
"Example languages are CXX (i.e. C++), C, Fortran, etc. "
"By default C and CXX are enabled. E.g. if you do not have a "
- "C++ compiler, you can disable the check for it by explicitely listing "
+ "C++ compiler, you can disable the check for it by explicitly listing "
"the languages you want to support, e.g. C. By using the special "
"language \"NONE\" all checks for any language can be disabled.";
}
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 5fcbdba..d00fc86 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -99,7 +99,7 @@ bool cmSetCommand
}
}
- // collect any values into a single semi-colon seperated value list
+ // collect any values into a single semi-colon separated value list
if(static_cast<unsigned short>(args.size()) >
static_cast<unsigned short>(1 + ignoreLastArgs))
{
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index bc52d7f..b793cd5 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -101,11 +101,11 @@ cmSourceFileLocation const& cmSourceFile::GetLocation() const
}
//----------------------------------------------------------------------------
-std::string const& cmSourceFile::GetFullPath()
+std::string const& cmSourceFile::GetFullPath(std::string* error)
{
if(this->FullPath.empty())
{
- if(this->FindFullPath())
+ if(this->FindFullPath(error))
{
this->CheckExtension();
}
@@ -120,7 +120,7 @@ std::string const& cmSourceFile::GetFullPath() const
}
//----------------------------------------------------------------------------
-bool cmSourceFile::FindFullPath()
+bool cmSourceFile::FindFullPath(std::string* error)
{
// If thie method has already failed once do not try again.
if(this->FindFullPathFailed)
@@ -199,7 +199,14 @@ bool cmSourceFile::FindFullPath()
{
e << " ." << *ext;
}
- this->Location.GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str());
+ if(error)
+ {
+ *error = e.str();
+ }
+ else
+ {
+ this->Location.GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str());
+ }
this->FindFullPathFailed = true;
return false;
}
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index 937e4b7..2dc8488 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -60,7 +60,7 @@ public:
* horrible interface, but is necessary for backwards
* compatibility).
*/
- std::string const& GetFullPath();
+ std::string const& GetFullPath(std::string* error = 0);
std::string const& GetFullPath() const;
/**
@@ -108,7 +108,7 @@ private:
std::string FullPath;
bool FindFullPathFailed;
- bool FindFullPath();
+ bool FindFullPath(std::string* error);
bool TryFullPath(const char* tryPath, const char* ext);
void CheckExtension();
void CheckLanguage(std::string const& ext);
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 3bd47a4..19f5c0f 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -739,7 +739,7 @@ bool cmStringCommand
alphabet = cmStringCommandDefaultAlphabet;
}
- double sizeofAlphabet = alphabet.size();
+ double sizeofAlphabet = static_cast<double>(alphabet.size());
if ( sizeofAlphabet < 1 )
{
this->SetError("sub-command RANDOM invoked with bad alphabet.");
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 5f7cfa3..7bc89a4 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -23,8 +23,8 @@
#include <cmsys/Directory.hxx>
#include <cmsys/System.h>
#if defined(CMAKE_BUILD_WITH_CMAKE)
-#include <cmlibarchive/libarchive/archive.h>
-#include <cmlibarchive/libarchive/archive_entry.h>
+# include "cmArchiveWrite.h"
+# include <cm_libarchive.h>
# include <cmsys/Terminal.h>
#endif
#include <cmsys/stl/algorithm>
@@ -191,49 +191,6 @@ std::string cmSystemTools::EscapeQuotes(const char* str)
return result;
}
-std::string cmSystemTools::EscapeSpaces(const char* str)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
- bool useDoubleQ = true;
-#else
- bool useDoubleQ = false;
-#endif
- if(cmSystemTools::s_ForceUnixPaths)
- {
- useDoubleQ = false;
- }
-
- if(useDoubleQ)
- {
- std::string result;
-
- // if there are spaces
- std::string temp = str;
- if (temp.find(" ") != std::string::npos &&
- temp.find("\"")==std::string::npos)
- {
- result = "\"";
- result += str;
- result += "\"";
- return result;
- }
- return str;
- }
- else
- {
- std::string result = "";
- for(const char* ch = str; *ch != '\0'; ++ch)
- {
- if(*ch == ' ')
- {
- result += '\\';
- }
- result += *ch;
- }
- return result;
- }
-}
-
void cmSystemTools::Error(const char* m1, const char* m2,
const char* m3, const char* m4)
{
@@ -326,7 +283,22 @@ void cmSystemTools::ReportLastSystemError(const char* msg)
cmSystemTools::Error(m.c_str());
}
-
+bool cmSystemTools::IsInternallyOn(const char* val)
+{
+ if (!val)
+ {
+ return false;
+ }
+ std::basic_string<char> v = val;
+
+ for(std::basic_string<char>::iterator c = v.begin();
+ c != v.end(); c++)
+ {
+ *c = static_cast<char>(toupper(*c));
+ }
+ return (v == "I_ON" || v == "i_on");
+}
+
bool cmSystemTools::IsOn(const char* val)
{
if (!val)
@@ -1204,6 +1176,8 @@ bool cmSystemTools::ComputeFileMD5(const char* source, char* md5out)
// Should be efficient enough on most system:
const int bufferSize = 4096;
char buffer[bufferSize];
+ unsigned char const* buffer_uc =
+ reinterpret_cast<unsigned char const*>(buffer);
// This copy loop is very sensitive on certain platforms with
// slightly broken stream libraries (like HPUX). Normally, it is
// incorrect to not check the error condition on the fin.read()
@@ -1212,10 +1186,9 @@ bool cmSystemTools::ComputeFileMD5(const char* source, char* md5out)
while(fin)
{
fin.read(buffer, bufferSize);
- if(fin.gcount())
+ if(int gcount = static_cast<int>(fin.gcount()))
{
- cmsysMD5_Append(md5, reinterpret_cast<unsigned char const*>(buffer),
- fin.gcount());
+ cmsysMD5_Append(md5, buffer_uc, gcount);
}
}
cmsysMD5_FinalizeHex(md5, md5out);
@@ -1719,142 +1692,41 @@ bool cmSystemTools::CreateTar(const char* outFileName,
bool gzip, bool bzip2, bool verbose)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
-
- // Create a macro to handle return from libarchive
- // functions
-#define CHECK_ARCHIVE_ERROR(res, msg)\
- if(res != ARCHIVE_OK)\
- {\
- cmSystemTools::Error(msg, \
- archive_error_string(a));\
- return false;\
- }
-
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
- // recursively expand all directories in files so that we have a list
- // of files
- std::vector<std::string> expandedFiles;
+ std::ofstream fout(outFileName, std::ios::out | cmsys_ios_binary);
+ if(!fout)
+ {
+ std::string e = "Cannot open output file \"";
+ e += outFileName;
+ e += "\": ";
+ e += cmSystemTools::GetLastSystemError();
+ cmSystemTools::Error(e.c_str());
+ return false;
+ }
+ cmArchiveWrite a(fout, (gzip? cmArchiveWrite::CompressGZip :
+ (bzip2? cmArchiveWrite::CompressBZip2 :
+ cmArchiveWrite::CompressNone)),
+ cmArchiveWrite::TypeTAR);
+ a.SetVerbose(verbose);
for(std::vector<cmStdString>::const_iterator i = files.begin();
i != files.end(); ++i)
{
- if(cmSystemTools::FileIsDirectory(i->c_str()))
+ std::string path = *i;
+ if(cmSystemTools::FileIsFullPath(path.c_str()))
{
- cmsys::Glob gl;
- std::string findExpr = *i;
- if ( findExpr[findExpr.size()-1] != '/' )
- {
- findExpr +="/";
- }
- findExpr += "*";
- gl.RecurseOn();
- if ( gl.FindFiles(findExpr) )
- {
- std::vector<std::string> dirfiles = gl.GetFiles();
- std::copy(dirfiles.begin(), dirfiles.end(),
- std::back_inserter(expandedFiles));
- }
+ // Get the relative path to the file.
+ path = cmSystemTools::RelativePath(cwd.c_str(), path.c_str());
}
- else
+ if(!a.Add(path))
{
- if(!cmSystemTools::FileIsFullPath(i->c_str()))
- {
- std::string fullp = cwd + "/" + *i;
- expandedFiles.push_back(fullp);
- }
- else
- {
- expandedFiles.push_back(*i);
- }
+ break;
}
}
- int res;
- // create a new archive
- struct archive* a = archive_write_new();
if(!a)
{
- cmSystemTools::Error("Unable to use create archive");
+ cmSystemTools::Error(a.GetError().c_str());
return false;
}
-
- if(gzip)
- {
- res = archive_write_set_compression_gzip(a);
- CHECK_ARCHIVE_ERROR(res, "Can not set gzip:");
- }
- if(bzip2)
- {
- res = archive_write_set_compression_bzip2(a);
- CHECK_ARCHIVE_ERROR(res, "Can not set bzip2:");
- }
- if(!bzip2 && !gzip)
- {
- res = archive_write_set_compression_none(a);
- CHECK_ARCHIVE_ERROR(res, "Can not set none:");
- }
- res = archive_write_set_format_pax_restricted(a);
- CHECK_ARCHIVE_ERROR(res, "Can not set tar format:");
- res = archive_write_open_file(a, outFileName);
- CHECK_ARCHIVE_ERROR(res, "write open:");
- // create a new disk struct
- struct archive* disk = archive_read_disk_new();
- archive_read_disk_set_standard_lookup(disk);
- std::vector<std::string>::const_iterator fileIt;
- for ( fileIt = expandedFiles.begin();
- fileIt != expandedFiles.end(); ++ fileIt )
- {
- // create a new entry for each file
- struct archive_entry *entry = archive_entry_new();
- // Get the relative path to the file
- std::string rp = cmSystemTools::RelativePath(cwd.c_str(),
- fileIt->c_str());
- if(verbose)
- {
- std::cout << rp << "\n";
- }
- // Set the name of the entry to the file name
- archive_entry_set_pathname(entry, rp.c_str());
- archive_read_disk_entry_from_file(disk, entry, -1, 0);
- CHECK_ARCHIVE_ERROR(res, "read disk entry:");
-
- // write entry header
- res = archive_write_header(a, entry);
- CHECK_ARCHIVE_ERROR(res, "write header: ");
- if(archive_entry_size(entry) > 0)
- {
- // now copy contents of file into archive a
- FILE* file = fopen(fileIt->c_str(), "rb");
- if(!file)
- {
- cmSystemTools::Error("Problem with fopen(): ",
- fileIt->c_str());
- return false;
- }
- char buff[16384];
- size_t len = fread(buff, 1, sizeof(buff), file);
- while (len > 0)
- {
- size_t wlen = archive_write_data(a, buff, len);
- if(wlen != len)
- {
- cmOStringStream error;
- error << "Problem with archive_write_data\n"
- << "Tried to write [" << len << "] bytes.\n"
- << "archive_write_data wrote [" << wlen << "] bytes.\n";
- cmSystemTools::Error(error.str().c_str(),
- archive_error_string(a)
- );
- return false;
- }
- len = fread(buff, 1, sizeof(buff), file);
- }
- // close the file and free the entry
- fclose(file);
- }
- archive_entry_free(entry);
- }
- archive_write_close(a);
- archive_write_finish(a);
- archive_read_finish(disk);
return true;
#else
(void)outFileName;
@@ -1989,9 +1861,9 @@ namespace{
# pragma warn -8066 /* unreachable code */
#endif
-int copy_data(struct archive *ar, struct archive *aw)
+long copy_data(struct archive *ar, struct archive *aw)
{
- int r;
+ long r;
const void *buff;
size_t size;
off_t offset;
@@ -2060,12 +1932,20 @@ bool extract_tar(const char* outFileName, bool verbose,
}
if(extract)
{
+ r = archive_write_disk_set_options(ext, ARCHIVE_EXTRACT_TIME);
+ if (r != ARCHIVE_OK)
+ {
+ cmSystemTools::Error(
+ "Problem with archive_write_disk_set_options(): ",
+ archive_error_string(ext));
+ }
+
r = archive_write_header(ext, entry);
if (r != ARCHIVE_OK)
{
cmSystemTools::Error("Problem with archive_write_header(): ",
- archive_error_string(a));
- cmSystemTools::Error("Curren file:",
+ archive_error_string(ext));
+ cmSystemTools::Error("Current file:",
archive_entry_pathname(entry));
}
else
@@ -2136,7 +2016,7 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
}
else if(*outiter == '\n' || *outiter == '\0')
{
- int length = outiter-out.begin();
+ std::vector<char>::size_type length = outiter-out.begin();
if(length > 1 && *(outiter-1) == '\r')
{
--length;
@@ -2159,7 +2039,7 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
}
else if(*erriter == '\n' || *erriter == '\0')
{
- int length = erriter-err.begin();
+ std::vector<char>::size_type length = erriter-err.begin();
if(length > 1 && *(erriter-1) == '\r')
{
--length;
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index da5da31..6f9147c 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -46,12 +46,6 @@ public:
static void ExpandRegistryValues(std::string& source,
KeyWOW64 view = KeyWOW64_Default);
- /**
- * Platform independent escape spaces, unix uses backslash,
- * windows double quotes the string.
- */
- static std::string EscapeSpaces(const char* str);
-
///! Escape quotes in a string.
static std::string EscapeQuotes(const char* str);
@@ -109,6 +103,12 @@ public:
cmSystemTools::s_ErrorOccured = false;
}
+ /**
+ * Does a string indicates that CMake/CPack/CTest internally
+ * forced this value. This is not the same as On, but this
+ * may be considered as "internally switched on".
+ */
+ static bool IsInternallyOn(const char* val);
/**
* does a string indicate a true or on value ? This is not the same
* as ifdef.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9611912..3ee329f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -393,6 +393,24 @@ void cmTarget::DefineProperties(cmake *cm)
"from which the target is imported.");
cm->DefineProperty
+ ("IMPORTED_NO_SONAME", cmProperty::TARGET,
+ "Specifies that an IMPORTED shared library target has no \"soname\". ",
+ "Set this property to true for an imported shared library file that "
+ "has no \"soname\" field. "
+ "CMake may adjust generated link commands for some platforms to prevent "
+ "the linker from using the path to the library in place of its missing "
+ "soname. "
+ "Ignored for non-imported targets.");
+
+ cm->DefineProperty
+ ("IMPORTED_NO_SONAME_<CONFIG>", cmProperty::TARGET,
+ "Per-configuration version of IMPORTED_NO_SONAME property.",
+ "This property is used when loading settings for the <CONFIG> "
+ "configuration of an imported target. "
+ "Configuration names correspond to those provided by the project "
+ "from which the target is imported.");
+
+ cm->DefineProperty
("EXCLUDE_FROM_ALL", cmProperty::TARGET,
"Exclude the target from the all target.",
"A property on a target that indicates if the target is excluded "
@@ -1040,18 +1058,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
// Collect the set of configuration types.
std::vector<std::string> configNames;
- if(const char* configurationTypes =
- mf->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(configurationTypes, configNames);
- }
- else if(const char* buildType = mf->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- if(*buildType)
- {
- configNames.push_back(buildType);
- }
- }
+ mf->GetConfigurations(configNames);
// Setup per-configuration property default values.
const char* configProps[] = {
@@ -1439,8 +1446,15 @@ bool cmTarget::FindSourceFiles()
si = this->SourceFiles.begin();
si != this->SourceFiles.end(); ++si)
{
- if((*si)->GetFullPath().empty())
+ std::string e;
+ if((*si)->GetFullPath(&e).empty())
{
+ if(!e.empty())
+ {
+ cmake* cm = this->Makefile->GetCMakeInstance();
+ cm->IssueMessage(cmake::FATAL_ERROR, e,
+ this->GetBacktrace());
+ }
return false;
}
}
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index f1f76c8..805959d 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -29,23 +29,64 @@ bool cmTargetLinkLibrariesCommand
return false;
}
- // but we might not have any libs after variable expansion
- if(args.size() < 2)
- {
- return true;
- }
-
// Lookup the target for which libraries are specified.
this->Target =
this->Makefile->GetCMakeInstance()
->GetGlobalGenerator()->FindTarget(0, args[0].c_str());
if(!this->Target)
{
+ cmake::MessageType t = cmake::FATAL_ERROR; // fail by default
cmOStringStream e;
e << "Cannot specify link libraries for target \"" << args[0] << "\" "
<< "which is not built by this project.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
- cmSystemTools::SetFatalErrorOccured();
+ // The bad target is the only argument. Check how policy CMP0016 is set,
+ // and accept, warn or fail respectively:
+ if (args.size() < 2)
+ {
+ switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0016))
+ {
+ case cmPolicies::WARN:
+ t = cmake::AUTHOR_WARNING;
+ // Print the warning.
+ e << "\n"
+ << "CMake does not support this but it used to work accidentally "
+ << "and is being allowed for compatibility."
+ << "\n" << this->Makefile->GetPolicies()->
+ GetPolicyWarning(cmPolicies::CMP0016);
+ break;
+ case cmPolicies::OLD: // OLD behavior does not warn.
+ t = cmake::MESSAGE;
+ break;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ e << "\n" << this->Makefile->GetPolicies()->
+ GetRequiredPolicyError(cmPolicies::CMP0016);
+ break;
+ case cmPolicies::NEW: // NEW behavior prints the error.
+ default:
+ break;
+ }
+ }
+
+ // now actually print the message
+ switch(t)
+ {
+ case cmake::AUTHOR_WARNING:
+ this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ break;
+ case cmake::FATAL_ERROR:
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ cmSystemTools::SetFatalErrorOccured();
+ break;
+ default:
+ break;
+ }
+ return true;
+ }
+
+ // but we might not have any libs after variable expansion
+ if(args.size() < 2)
+ {
return true;
}
@@ -57,7 +98,7 @@ bool cmTargetLinkLibrariesCommand
// specification when the keyword is encountered.
this->DoingInterface = false;
- // add libraries, nothe that there is an optional prefix
+ // add libraries, nothe that there is an optional prefix
// of debug and optimized than can be used
for(unsigned int i=1; i < args.size(); ++i)
{
@@ -118,7 +159,7 @@ bool cmTargetLinkLibrariesCommand
llt = cmTarget::GENERAL;
std::string linkType = args[0];
linkType += "_LINK_TYPE";
- const char* linkTypeString =
+ const char* linkTypeString =
this->Makefile->GetDefinition( linkType.c_str() );
if(linkTypeString)
{
@@ -133,7 +174,7 @@ bool cmTargetLinkLibrariesCommand
}
this->HandleLibrary(args[i].c_str(), llt);
}
- }
+ }
// Make sure the last argument was not a library type specifier.
if(haveLLT)
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index 3010fc9..4d31a14 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -361,7 +361,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
std::string errorMessage = "TRY_RUN() invoked in cross-compiling mode, "
"please set the following cache variables "
- "appropriatly:\n";
+ "appropriately:\n";
errorMessage += " " + this->RunResultVariable + " (advanced)\n";
if (out!=0)
{
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 59e20d5..9c0364b 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -32,6 +32,30 @@ static std::string cmVS10EscapeXML(std::string arg)
return arg;
}
+static std::string cmVS10EscapeComment(std::string comment)
+{
+ // MSBuild takes the CDATA of a <Message></Message> element and just
+ // does "echo $CDATA" with no escapes. We must encode the string.
+ // http://technet.microsoft.com/en-us/library/cc772462%28WS.10%29.aspx
+ std::string echoable;
+ for(std::string::iterator c = comment.begin(); c != comment.end(); ++c)
+ {
+ switch (*c)
+ {
+ case '\r': break;
+ case '\n': echoable += '\t'; break;
+ case '"': /* no break */
+ case '|': /* no break */
+ case '&': /* no break */
+ case '<': /* no break */
+ case '>': /* no break */
+ case '^': echoable += '^'; /* no break */
+ default: echoable += *c; break;
+ }
+ }
+ return echoable;
+}
+
cmVisualStudio10TargetGenerator::
cmVisualStudio10TargetGenerator(cmTarget* target,
cmGlobalVisualStudio10Generator* gg)
@@ -125,7 +149,10 @@ void cmVisualStudio10TargetGenerator::Generate()
".vcxproj");
if(this->Target->GetType() <= cmTarget::MODULE_LIBRARY)
{
- this->ComputeClOptions();
+ if(!this->ComputeClOptions())
+ {
+ return;
+ }
}
cmMakefile* mf = this->Target->GetMakefile();
std::string path = mf->GetStartOutputDirectory();
@@ -155,6 +182,13 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteString("<Keyword>Win32Proj</Keyword>\n", 2);
this->WriteString("<Platform>", 2);
(*this->BuildFileStream) << this->Platform << "</Platform>\n";
+ const char* projLabel = this->Target->GetProperty("PROJECT_LABEL");
+ if(!projLabel)
+ {
+ projLabel = this->Name.c_str();
+ }
+ this->WriteString("<ProjectName>", 2);
+ (*this->BuildFileStream) << projLabel << "</ProjectName>\n";
this->WriteString("</PropertyGroup>\n", 1);
this->WriteString("<Import Project="
"\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n",
@@ -318,6 +352,7 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
}
cmLocalVisualStudio7Generator* lg = this->LocalGenerator;
std::string comment = lg->ConstructComment(command);
+ comment = cmVS10EscapeComment(comment);
std::vector<std::string> *configs =
static_cast<cmGlobalVisualStudio7Generator *>
(this->GlobalGenerator)->GetConfigurations();
@@ -340,7 +375,7 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
command.GetEscapeAllowMakeVars())
);
this->WritePlatformConfigTag("Message",i->c_str(), 3);
- (*this->BuildFileStream ) << comment << "</Message>\n";
+ (*this->BuildFileStream ) << cmVS10EscapeXML(comment) << "</Message>\n";
this->WritePlatformConfigTag("Command", i->c_str(), 3);
(*this->BuildFileStream ) << script << "</Command>\n";
this->WritePlatformConfigTag("AdditionalInputs", i->c_str(), 3);
@@ -760,7 +795,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
hasFlags = true;
this->WriteString("<ObjectFileName>", 3);
(*this->BuildFileStream )
- << "$(Configuration)/" << objectName << "</ObjectFileName>\n";
+ << "$(IntDir)/" << objectName << "</ObjectFileName>\n";
}
std::vector<std::string> *configs =
static_cast<cmGlobalVisualStudio7Generator *>
@@ -807,10 +842,12 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
{
- if(this->Target->GetType() > cmTarget::MODULE_LIBRARY)
+ cmTarget::TargetType ttype = this->Target->GetType();
+ if(ttype > cmTarget::GLOBAL_TARGET)
{
return;
}
+
this->WriteString("<PropertyGroup>\n", 2);
this->WriteString("<_ProjectFileVersion>10.0.20506.1"
"</_ProjectFileVersion>\n", 3);
@@ -820,36 +857,50 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
for(std::vector<std::string>::iterator config = configs->begin();
config != configs->end(); ++config)
{
- std::string targetNameFull =
- this->Target->GetFullName(config->c_str());
- std::string intermediateDir = this->LocalGenerator->
- GetTargetDirectory(*this->Target);
- intermediateDir += "/";
- intermediateDir += *config;
- intermediateDir += "/";
- this->ConvertToWindowsSlash(intermediateDir);
- std::string outDir = this->Target->GetDirectory(config->c_str());
- this->ConvertToWindowsSlash(outDir);
- this->WritePlatformConfigTag("OutDir", config->c_str(), 3);
- *this->BuildFileStream << outDir
- << "\\"
- << "</OutDir>\n";
- this->WritePlatformConfigTag("IntDir", config->c_str(), 3);
- *this->BuildFileStream << intermediateDir
- << "</IntDir>\n";
- this->WritePlatformConfigTag("TargetName", config->c_str(), 3);
- *this->BuildFileStream << cmSystemTools::GetFilenameWithoutExtension(
- targetNameFull.c_str())
- << "</TargetName>\n";
-
- this->WritePlatformConfigTag("TargetExt", config->c_str(), 3);
- *this->BuildFileStream << cmSystemTools::GetFilenameLastExtension(
- targetNameFull.c_str())
- << "</TargetExt>\n";
- this->OutputLinkIncremental(*config);
+ if(ttype >= cmTarget::UTILITY)
+ {
+ this->WritePlatformConfigTag("IntDir", config->c_str(), 3);
+ *this->BuildFileStream
+ << "$(Platform)\\$(Configuration)\\$(ProjectName)\\"
+ << "</IntDir>\n";
+ }
+ else
+ {
+ std::string targetNameFull =
+ this->Target->GetFullName(config->c_str());
+ std::string intermediateDir = this->LocalGenerator->
+ GetTargetDirectory(*this->Target);
+ intermediateDir += "/";
+ intermediateDir += *config;
+ intermediateDir += "/";
+ this->ConvertToWindowsSlash(intermediateDir);
+ std::string outDir = this->Target->GetDirectory(config->c_str());
+ this->ConvertToWindowsSlash(outDir);
+
+ this->WritePlatformConfigTag("OutDir", config->c_str(), 3);
+ *this->BuildFileStream << outDir
+ << "\\"
+ << "</OutDir>\n";
+
+ this->WritePlatformConfigTag("IntDir", config->c_str(), 3);
+ *this->BuildFileStream << intermediateDir
+ << "</IntDir>\n";
+
+ this->WritePlatformConfigTag("TargetName", config->c_str(), 3);
+ *this->BuildFileStream
+ << cmSystemTools::GetFilenameWithoutLastExtension(
+ targetNameFull.c_str())
+ << "</TargetName>\n";
+
+ this->WritePlatformConfigTag("TargetExt", config->c_str(), 3);
+ *this->BuildFileStream
+ << cmSystemTools::GetFilenameLastExtension(targetNameFull.c_str())
+ << "</TargetExt>\n";
+
+ this->OutputLinkIncremental(*config);
+ }
}
this->WriteString("</PropertyGroup>\n", 2);
-
}
@@ -926,19 +977,23 @@ OutputLinkIncremental(std::string const& configName)
}
//----------------------------------------------------------------------------
-void cmVisualStudio10TargetGenerator::ComputeClOptions()
+bool cmVisualStudio10TargetGenerator::ComputeClOptions()
{
std::vector<std::string> const* configs =
this->GlobalGenerator->GetConfigurations();
for(std::vector<std::string>::const_iterator i = configs->begin();
i != configs->end(); ++i)
{
- this->ComputeClOptions(*i);
+ if(!this->ComputeClOptions(*i))
+ {
+ return false;
+ }
}
+ return true;
}
//----------------------------------------------------------------------------
-void cmVisualStudio10TargetGenerator::ComputeClOptions(
+bool cmVisualStudio10TargetGenerator::ComputeClOptions(
std::string const& configName)
{
// much of this was copied from here:
@@ -961,7 +1016,7 @@ void cmVisualStudio10TargetGenerator::ComputeClOptions(
cmSystemTools::Error
("CMake can not determine linker language for target:",
this->Name.c_str());
- return;
+ return false;
}
if(strcmp(linkLanguage, "C") == 0 || strcmp(linkLanguage, "CXX") == 0
|| strcmp(linkLanguage, "Fortran") == 0)
@@ -1021,6 +1076,7 @@ void cmVisualStudio10TargetGenerator::ComputeClOptions(
}
this->ClOptions[configName] = pOptions.release();
+ return true;
}
//----------------------------------------------------------------------------
@@ -1033,6 +1089,15 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
clOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
this->OutputIncludes(includes);
clOptions.OutputFlagMap(*this->BuildFileStream, " ");
+
+ // If not in debug mode, write the DebugInformationFormat field
+ // without value so PDBs don't get generated uselessly.
+ if(!clOptions.IsDebug())
+ {
+ this->WriteString("<DebugInformationFormat>"
+ "</DebugInformationFormat>\n", 3);
+ }
+
clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
"\n");
this->WriteString("<AssemblerListingLocation>", 3);
@@ -1401,8 +1466,9 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
command.GetEscapeAllowMakeVars())
);
}
+ comment = cmVS10EscapeComment(comment);
this->WriteString("<Message>",3);
- (*this->BuildFileStream ) << comment << "</Message>\n";
+ (*this->BuildFileStream ) << cmVS10EscapeXML(comment) << "</Message>\n";
this->WriteString("<Command>", 3);
(*this->BuildFileStream ) << script;
(*this->BuildFileStream ) << "</Command>" << "\n";
@@ -1413,7 +1479,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
void cmVisualStudio10TargetGenerator::WriteProjectReferences()
{
- cmGlobalGenerator::TargetDependSet& depends
+ cmGlobalGenerator::TargetDependSet const& depends
= this->GlobalGenerator->GetTargetDirectDepends(*this->Target);
this->WriteString("<ItemGroup>\n", 1);
for( cmGlobalGenerator::TargetDependSet::const_iterator i = depends.begin();
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 64b2361..c3c27f4 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -50,8 +50,8 @@ private:
void WriteObjSources();
void WritePathAndIncrementalLinkOptions();
void WriteItemDefinitionGroups();
- void ComputeClOptions();
- void ComputeClOptions(std::string const& configName);
+ bool ComputeClOptions();
+ bool ComputeClOptions(std::string const& configName);
void WriteClOptions(std::string const& config,
std::vector<std::string> const & includes);
void WriteRCOptions(std::string const& config,
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 051cc1f..972af95 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -183,7 +183,7 @@ cmVisualStudioGeneratorOptions
{
fout << prefix << "PreprocessorDefinitions=\"";
}
- const char* comma = "";
+ const char* sep = "";
for(std::vector<std::string>::const_iterator di = this->Defines.begin();
di != this->Defines.end(); ++di)
{
@@ -208,15 +208,8 @@ cmVisualStudioGeneratorOptions
define = cmVisualStudioGeneratorOptionsEscapeForXML(define.c_str());
}
// Store the flag in the project file.
- fout << comma << define;
- if(this->Version == 10)
- {
- comma = ";";
- }
- else
- {
- comma = ",";
- }
+ fout << sep << define;
+ sep = ";";
}
if(this->Version == 10)
{
diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx
index 07c7b8c..5920470 100644
--- a/Source/cmXCodeObject.cxx
+++ b/Source/cmXCodeObject.cxx
@@ -236,7 +236,7 @@ void cmXCodeObject::PrintString(std::ostream& os) const
// considered special by the Xcode project file parser.
bool needQuote =
(this->String.empty() ||
- this->String.find_first_of(" <>.+-=@") != this->String.npos);
+ this->String.find_first_of(" <>.+-=@$") != this->String.npos);
const char* quote = needQuote? "\"" : "";
// Print the string, quoted and escaped as necessary.
diff --git a/Source/cm_utf8.c b/Source/cm_utf8.c
index 3d4ca16..c9bf259 100644
--- a/Source/cm_utf8.c
+++ b/Source/cm_utf8.c
@@ -50,7 +50,7 @@ const char* cm_utf8_decode_character(const char* first, const char* last,
unsigned int* pc)
{
/* Count leading ones in the first byte. */
- unsigned char c = *first++;
+ unsigned char c = (unsigned char)*first++;
unsigned char const ones = cm_utf8_ones[c];
switch(ones)
{
@@ -62,10 +62,10 @@ const char* cm_utf8_decode_character(const char* first, const char* last,
/* Extract bits from this multi-byte character. */
{
unsigned int uc = c & cm_utf8_mask[ones];
- unsigned char left;
+ int left;
for(left = ones-1; left && first != last; --left)
{
- c = *first++;
+ c = (unsigned char)*first++;
if(cm_utf8_ones[c] != 1)
{
return 0;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index db26b73..2ebd165 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -954,7 +954,7 @@ void CMakeCommandUsage(const char* program)
<< " echo [string]... - displays arguments as text\n"
<< " echo_append [string]... - displays arguments as text but no new "
"line\n"
- << " environment - display the current enviroment\n"
+ << " environment - display the current environment\n"
<< " make_directory dir - create a directory\n"
<< " md5sum file1 [...] - compute md5sum of files\n"
<< " remove_directory dir - remove a directory and its contents\n"
@@ -1574,6 +1574,24 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
cmSystemTools::Error("Problem extracting tar: ", outFile.c_str());
return 1;
}
+#ifdef WIN32
+ // OK, on windows 7 after we untar some files,
+ // sometimes we can not rename the directory after
+ // the untar is done. This breaks the external project
+ // untar and rename code. So, by default we will wait
+ // 1/10th of a second after the untar. If CMAKE_UNTAR_DELAY
+ // is set in the env, its value will be used instead of 100.
+ int delay = 100;
+ const char* delayVar = cmSystemTools::GetEnv("CMAKE_UNTAR_DELAY");
+ if(delayVar)
+ {
+ delay = atoi(delayVar);
+ }
+ if(delay)
+ {
+ cmSystemTools::Delay(delay);
+ }
+#endif
}
return 0;
}
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 24921c4..3937d8d 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -152,7 +152,7 @@ static const char * cmDocumentationOptions[][3] =
"popups and interactive "
"debugging."},
{"--no-label-summary", "Disable timing summary information for labels.",
- "This option tells ctest to not print summary information for each label "
+ "This option tells ctest not to print summary information for each label "
"associated with the tests run. If there are no labels on the "
"tests, nothing extra is printed."},
{"--build-and-test", "Configure, build and run a test.",
@@ -229,6 +229,9 @@ static const char * cmDocumentationOptions[][3] =
"This flag will turn off automatic compression of test output. Use this "
"to maintain compatibility with an older version of CDash which doesn't "
"support compressed test output."},
+ {"--print-labels", "Print all available test labels.",
+ "This option will not run any tests, it will simply print the list of "
+ "all labels associated with the test set."},
{"--help-command <cmd> [<file>]", "Show help for a single command and exit.",
"Prints the help for the command to stdout or to the specified file." },
{"--help-command-list [<file>]", "List available commands and exit.",
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index f440ff9..bcc7a96 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -141,12 +141,6 @@ IF(COMMAND SET_PROPERTY)
"KWSYS_HEADER(%)=<${KWSYS_NAMESPACE}/%>"
)
ENDIF(COMMAND SET_PROPERTY)
-# add option to disable memory cleanup at exit of putenv memory
-IF(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)
- SET(KWSYS_DO_NOT_CLEAN_PUTENV 1)
-ELSE(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)
- SET(KWSYS_DO_NOT_CLEAN_PUTENV 0)
-ENDIF(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)
# Select library components.
IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
@@ -605,6 +599,23 @@ ELSE(KWSYS_BUILD_SHARED)
ENDIF(KWSYS_BUILD_SHARED)
#-----------------------------------------------------------------------------
+# Configure some implementation details.
+
+KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_PTRDIFF_T
+ "Checking whether C compiler has ptrdiff_t in stddef.h" DIRECT)
+KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_SSIZE_T
+ "Checking whether C compiler has ssize_t in unistd.h" DIRECT)
+SET_SOURCE_FILES_PROPERTIES(ProcessUNIX.c System.c PROPERTIES
+ COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T}"
+ )
+
+IF(KWSYS_DO_NOT_CLEAN_PUTENV)
+ # Disable cleanup of putenv memory for issues with GCOV.
+ SET_SOURCE_FILES_PROPERTIES(SystemTools.cxx PROPERTIES
+ COMPILE_FLAGS -DKWSYS_DO_NOT_CLEAN_PUTENV=1)
+ENDIF(KWSYS_DO_NOT_CLEAN_PUTENV)
+
+#-----------------------------------------------------------------------------
# Choose a directory for the generated headers.
IF(NOT KWSYS_HEADER_ROOT)
SET(KWSYS_HEADER_ROOT "${PROJECT_BINARY_DIR}")
@@ -782,15 +793,6 @@ IF(KWSYS_USE_Process)
ELSE(NOT UNIX)
# Use the UNIX implementation.
SET(KWSYS_C_SRCS ${KWSYS_C_SRCS} ProcessUNIX.c)
-
- # Help ProcessUNIX.c compile properly on all platforms.
- KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_PTRDIFF_T
- "Checking whether C compiler has ptrdiff_t in stddef.h" DIRECT)
- KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_SSIZE_T
- "Checking whether C compiler has ssize_t in unistd.h" DIRECT)
- SET_SOURCE_FILES_PROPERTIES(ProcessUNIX.c PROPERTIES
- COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T}"
- )
ENDIF(NOT UNIX)
ENDIF(KWSYS_USE_Process)
@@ -1095,6 +1097,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
FOREACH(n 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7})
ADD_TEST(kwsys.testProcess-${n} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestProcess ${n})
KWSYS_SET_PROPERTY(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST})
+ SET_TESTS_PROPERTIES(kwsys.testProcess-${n} PROPERTIES TIMEOUT 120)
ENDFOREACH(n)
# Some Apple compilers produce bad optimizations in this source.
@@ -1122,5 +1125,11 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES MEASUREMENT "Some Key=Some Value")
MESSAGE(STATUS "GET_TEST_PROPERTY returned: ${wfv}")
ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE)
+
+ # Suppress known consistent failures on buggy systems.
+ IF(KWSYS_TEST_BOGUS_FAILURES)
+ SET_TESTS_PROPERTIES(${KWSYS_TEST_BOGUS_FAILURES} PROPERTIES WILL_FAIL ON)
+ ENDIF()
+
ENDIF(BUILD_TESTING)
ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
diff --git a/Source/kwsys/Configure.hxx.in b/Source/kwsys/Configure.hxx.in
index 9310d94..716b84f 100644
--- a/Source/kwsys/Configure.hxx.in
+++ b/Source/kwsys/Configure.hxx.in
@@ -15,15 +15,6 @@
/* Include C configuration. */
#include <@KWSYS_NAMESPACE@/Configure.h>
-/* Disable cleanup of putenv memory for issues with GCOV */
-#if @KWSYS_DO_NOT_CLEAN_PUTENV@
-#define KWSYS_DO_NOT_CLEAN_PUTENV
-#else
-#undef KWSYS_DO_NOT_CLEAN_PUTENV
-#endif
-
-
-
/* Whether ANSI C++ stream headers are to be used. */
#define @KWSYS_NAMESPACE@_IOS_USE_ANSI @KWSYS_IOS_USE_ANSI@
diff --git a/Source/kwsys/MD5.c b/Source/kwsys/MD5.c
index 1ea0a66..56776a3 100644
--- a/Source/kwsys/MD5.c
+++ b/Source/kwsys/MD5.c
@@ -29,6 +29,11 @@
it in a single source file instead of a separate header and
implementation file. */
+#if defined(__clang__)
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wcast-align"
+#endif
+
/*
Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved.
@@ -428,6 +433,10 @@ static void md5_finish(md5_state_t *pms, md5_byte_t digest[16])
digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3));
}
+#if defined(__clang__)
+# pragma clang diagnostic pop
+#endif
+
/*--------------------------------------------------------------------------*/
/* Wrap up the MD5 state in our opaque structure. */
struct kwsysMD5_s
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 3153235..8aa99eb 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -1405,6 +1405,10 @@ kwsys_stl::vector<kwsys::String> SystemTools::SplitString(const char* p, char se
{
kwsys_stl::string path = p;
kwsys_stl::vector<kwsys::String> paths;
+ if(path.empty())
+ {
+ return paths;
+ }
if(isPath && path[0] == '/')
{
path.erase(path.begin());
@@ -3059,39 +3063,50 @@ kwsys_stl::string SystemTools::RelativePath(const char* local, const char* remot
static int GetCasePathName(const kwsys_stl::string & pathIn,
kwsys_stl::string & casePath)
{
- kwsys_stl::string::size_type iFound = pathIn.rfind('/');
- if (iFound > 1 && iFound != pathIn.npos)
+ kwsys_stl::vector<kwsys_stl::string> path_components;
+ SystemTools::SplitPath(pathIn.c_str(), path_components);
+ if(path_components[0].empty()) // First component always exists.
{
- // recurse to peel off components
- //
- if (GetCasePathName(pathIn.substr(0, iFound), casePath) > 0)
- {
- casePath += '/';
- if (pathIn[1] != '/')
- {
- WIN32_FIND_DATA findData;
+ // Relative paths cannot be converted.
+ casePath = "";
+ return 0;
+ }
- // append the long component name to the path
- //
- HANDLE hFind = ::FindFirstFile(pathIn.c_str(), &findData);
- if (INVALID_HANDLE_VALUE != hFind)
- {
- casePath += findData.cFileName;
- ::FindClose(hFind);
- }
- else
- {
- // if FindFirstFile fails, return the error code
- //
- casePath = "";
- return 0;
- }
- }
- }
+ // Start with root component.
+ kwsys_stl::vector<kwsys_stl::string>::size_type idx = 0;
+ casePath = path_components[idx++];
+ const char* sep = "";
+
+ // If network path, fill casePath with server/share so FindFirstFile
+ // will work after that. Maybe someday call other APIs to get
+ // actual case of servers and shares.
+ if(path_components.size() > 2 && path_components[0] == "//")
+ {
+ casePath += path_components[idx++];
+ casePath += "/";
+ casePath += path_components[idx++];
+ sep = "/";
}
- else
+
+ for(; idx < path_components.size(); idx++)
{
- casePath = pathIn;
+ casePath += sep;
+ sep = "/";
+ kwsys_stl::string test_str = casePath;
+ test_str += path_components[idx];
+
+ WIN32_FIND_DATA findData;
+ HANDLE hFind = ::FindFirstFile(test_str.c_str(), &findData);
+ if (INVALID_HANDLE_VALUE != hFind)
+ {
+ casePath += findData.cFileName;
+ ::FindClose(hFind);
+ }
+ else
+ {
+ casePath = "";
+ return 0;
+ }
}
return (int)casePath.size();
}
@@ -3104,28 +3119,29 @@ kwsys_stl::string SystemTools::GetActualCaseForPath(const char* p)
#ifndef _WIN32
return p;
#else
+ kwsys_stl::string casePath = p;
+ // make sure drive letter is always upper case
+ if(casePath.size() > 1 && casePath[1] == ':')
+ {
+ casePath[0] = toupper(casePath[0]);
+ }
+
// Check to see if actual case has already been called
// for this path, and the result is stored in the LongPathMap
- SystemToolsTranslationMap::iterator i =
- SystemTools::LongPathMap->find(p);
+ SystemToolsTranslationMap::iterator i =
+ SystemTools::LongPathMap->find(casePath);
if(i != SystemTools::LongPathMap->end())
{
return i->second;
}
- kwsys_stl::string casePath;
int len = GetCasePathName(p, casePath);
if(len == 0 || len > MAX_PATH+1)
{
return p;
}
- // make sure drive letter is always upper case
- if(casePath.size() > 1 && casePath[1] == ':')
- {
- casePath[0] = toupper(casePath[0]);
- }
(*SystemTools::LongPathMap)[p] = casePath;
return casePath;
-#endif
+#endif
}
//----------------------------------------------------------------------------
@@ -3143,9 +3159,9 @@ const char* SystemTools::SplitPathRootComponent(const char* p,
}
c += 2;
}
- else if(c[0] == '/')
+ else if(c[0] == '/' || c[0] == '\\')
{
- // Unix path.
+ // Unix path (or Windows path w/out drive letter).
if(root)
{
*root = "/";
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in
index ec70320..cf47923 100644
--- a/Source/kwsys/SystemTools.hxx.in
+++ b/Source/kwsys/SystemTools.hxx.in
@@ -372,8 +372,8 @@ public:
* "c:/" = Windows full path (can be any drive letter)
* "c:" = Windows drive-letter relative path (can be any drive letter)
* "//" = Network path
- * "~" = Home path for current user
- * "~u" = Home path for user 'u'
+ * "~/" = Home path for current user
+ * "~u/" = Home path for user 'u'
* "" = Relative path
*
* A pointer to the rest of the path after the root component is
@@ -385,7 +385,7 @@ public:
/**
* Split a path name into its basic components. The first component
- * is one of the roots returned by SplitPathRootComponent.
+ * always exists and is the root returned by SplitPathRootComponent.
* The remaining components form the path. If there is a trailing
* slash then the last component is the empty string. The
* components can be recombined as "c[0]c[1]/c[2]/.../c[n]" to
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index 043f0d0..633e12e 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
SET(KWSYS_DATE_STAMP_YEAR 2010)
# KWSys version date month component. Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 06)
+SET(KWSYS_DATE_STAMP_MONTH 10)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 28)
+SET(KWSYS_DATE_STAMP_DAY 05)
diff --git a/Source/kwsys/testProcess.c b/Source/kwsys/testProcess.c
index 0060c4d..877002a 100644
--- a/Source/kwsys/testProcess.c
+++ b/Source/kwsys/testProcess.c
@@ -94,7 +94,11 @@ int test4(int argc, const char* argv[])
fprintf(stderr, "Output before crash on stderr from crash test.\n");
fflush(stdout);
fflush(stderr);
+#if defined(__clang__)
+ *(int*)1 = 0; /* Clang warns about 0-ptr; undefined behavior. */
+#else
*(int*)0 = 0;
+#endif
fprintf(stdout, "Output after crash on stdout from crash test.\n");
fprintf(stderr, "Output after crash on stderr from crash test.\n");
return 0;
diff --git a/Tests/CMakeInstall.cmake b/Tests/CMakeInstall.cmake
index f141b53..dabc852 100644
--- a/Tests/CMakeInstall.cmake
+++ b/Tests/CMakeInstall.cmake
@@ -33,7 +33,7 @@ if(CMake_TEST_INSTALL)
add_test(CMake.Install
${CMake_TEST_INSTALL_CTest}
${CMake_TEST_INSTALL_CONFIG}
- --build-and-test ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}
+ --build-and-test ${CMake_SOURCE_DIR} ${CMake_BINARY_DIR}
--build-generator ${CMAKE_GENERATOR} # Not CMAKE_TEST_GENERATOR
--build-project CMake
--build-makeprogram ${CMAKE_MAKE_PROGRAM} # Not CMAKE_TEST_MAKEPROGRAM
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 2c7056d..c056e86 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -129,6 +129,9 @@ IF(BUILD_TESTING)
ADD_TEST_MACRO(MathTest MathTest)
ADD_TEST_MACRO(Simple Simple)
ADD_TEST_MACRO(PreOrder PreOrder)
+ ADD_TEST_MACRO(MissingSourceFile MissingSourceFile)
+ SET_TESTS_PROPERTIES(MissingSourceFile PROPERTIES
+ PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file \"MissingSourceFile.c\"")
ADD_TEST_MACRO(COnly COnly)
ADD_TEST_MACRO(CxxOnly CxxOnly)
ADD_TEST_MACRO(IPO COnly/COnly)
@@ -150,6 +153,9 @@ IF(BUILD_TESTING)
ADD_TEST_MACRO(ExportImport ExportImport)
ADD_TEST_MACRO(Unset Unset)
ADD_TEST_MACRO(PolicyScope PolicyScope)
+ ADD_TEST_MACRO(EmptyLibrary EmptyLibrary)
+ SET_TESTS_PROPERTIES(EmptyLibrary PROPERTIES
+ PASS_REGULAR_EXPRESSION "CMake Error: CMake can not determine linker language for target:test")
ADD_TEST_MACRO(CrossCompile CrossCompile)
SET_TESTS_PROPERTIES(CrossCompile PROPERTIES
PASS_REGULAR_EXPRESSION "TRY_RUN.. invoked in cross-compiling mode")
@@ -404,7 +410,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
# --test-command t4
#--test-command "${CMAKE_COMMAND}"
#"-DCONFIGURATION=\${CTEST_CONFIGURATION_TYPE}"
- #-P "${CMAKE_BINARY_DIR}/Tests/SimpleExclude/run.cmake"
+ #-P "${CMake_BINARY_DIR}/Tests/SimpleExclude/run.cmake"
#)
# ADD_TEST(SameName ${CMAKE_CTEST_COMMAND}
@@ -1051,7 +1057,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-target install
# --build-target package
--build-options "-DCMAKE_INSTALL_PREFIX:PATH=${BundleTestInstallDir}"
- "-DCMake_SOURCE_DIR:PATH=${CMAKE_SOURCE_DIR}"
+ "-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}"
--test-command
${BundleTestInstallDir}/Applications/SecondBundleExe.app/Contents/MacOS/SecondBundleExe)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest")
@@ -1315,6 +1321,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--output-log "${CMake_BINARY_DIR}/Tests/CTestTestParallel/testOutput.log"
)
+ ADD_TEST(CTestTestPrintLabels ${CMAKE_CTEST_COMMAND} --print-labels)
+ SET_TESTS_PROPERTIES(CTestTestPrintLabels PROPERTIES LABELS "Label1;Label2")
+ SET_TESTS_PROPERTIES(CTestTestPrintLabels PROPERTIES PASS_REGULAR_EXPRESSION
+ "All Labels:.* Label1.* Label2")
+
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestResourceLock/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/test.cmake"
@@ -1373,7 +1384,29 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
)
SET_TESTS_PROPERTIES(CTestTestTimeout PROPERTIES
PASS_REGULAR_EXPRESSION "TestTimeout *\\.+ *\\*\\*\\*Timeout.*CheckChild *\\.+ *Passed")
-
+
+ CONFIGURE_FILE(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestDepends/test.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake"
+ @ONLY ESCAPE_QUOTES)
+ ADD_TEST(CTestTestDepends ${CMAKE_CTEST_COMMAND}
+ -C "\${CTestTest_CONFIG}"
+ -S "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake" -V
+ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestDepends/testOutput.log"
+ )
+
+ CONFIGURE_FILE(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestCycle/test.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestCycle/test.cmake"
+ @ONLY ESCAPE_QUOTES)
+ ADD_TEST(CTestTestCycle ${CMAKE_CTEST_COMMAND}
+ -C "\${CTestTest_CONFIG}"
+ -S "${CMake_BINARY_DIR}/Tests/CTestTestCycle/test.cmake" -V
+ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCycle/testOutput.log"
+ )
+ SET_TESTS_PROPERTIES(CTestTestCycle PROPERTIES
+ PASS_REGULAR_EXPRESSION "a cycle exists in the test dependency graph")
+
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake"
@@ -1410,9 +1443,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
set(regex "${regex}|Error message was: ")
set(regex "${regex}([Cc]ould *n.t resolve host")
set(regex "${regex}|[Cc]ould *n.t connect to host")
+ set(regex "${regex}|Empty reply from server")
set(regex "${regex}|The requested URL returned error")
set(regex "${regex}|libcurl was built with SSL disabled. https: not supported)")
set(regex "${regex}|Submission method .xmlrpc. not compiled into CTest")
+ set(regex "${regex}|Submission problem")
set(regex "${regex}|Submission successful)")
set(ctest_coverage_labels_args "")
@@ -1470,6 +1505,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--output-log "${CMake_BINARY_DIR}/Tests/CTestTest2/testOutput.log"
)
+ CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTestChecksum/test.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/test.cmake" @ONLY
+ ESCAPE_QUOTES)
+ ADD_TEST(CTestTestChecksum ${CMAKE_CTEST_COMMAND}
+ -S "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/test.cmake" -V
+ --output-log
+ "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/testOutput.log"
+ )
+ SET_TESTS_PROPERTIES(CTestTestChecksum PROPERTIES PASS_REGULAR_EXPRESSION
+ "Submission failed: Checksum failed for file")
+
# these tests take a long time, make sure they have it
# if timeouts have not already been set
GET_TEST_PROPERTY(CTestTest TIMEOUT PREVIOUS_TIMEOUT)
@@ -1485,36 +1531,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
ENDIF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER)
- IF(NOT DEFINED CTEST_RUN_CTestSubmitLargeOutput)
- SET(CTEST_RUN_CTestSubmitLargeOutput OFF)
-
- IF (CMAKE_TESTS_CDASH_SERVER AND "${server}" STREQUAL "localhost")
- SET(CTEST_RUN_CTestSubmitLargeOutput ON)
- ENDIF (CMAKE_TESTS_CDASH_SERVER AND "${server}" STREQUAL "localhost")
- ENDIF(NOT DEFINED CTEST_RUN_CTestSubmitLargeOutput)
-
- IF(CTEST_RUN_CTestSubmitLargeOutput)
- CONFIGURE_FILE(
- "${CMake_SOURCE_DIR}/Tests/CTestSubmitLargeOutput/test.cmake.in"
- "${CMake_BINARY_DIR}/Tests/CTestSubmitLargeOutput/test.cmake"
- @ONLY ESCAPE_QUOTES
- )
- ADD_TEST(CTestSubmitLargeOutput ${CMAKE_CTEST_COMMAND}
- -S "${CMake_BINARY_DIR}/Tests/CTestSubmitLargeOutput/test.cmake" -V
- --output-log "${CMake_BINARY_DIR}/Tests/CTestSubmitLargeOutput/testOutput.log"
- )
-
- # This test only passes if it fails to submit properly...
- #
- SET_TESTS_PROPERTIES(CTestSubmitLargeOutput PROPERTIES
- PASS_REGULAR_EXPRESSION "Errors occurred during submission")
-
- # Give this test plenty of time to run on slower machines:
- #
- SET_TESTS_PROPERTIES(CTestSubmitLargeOutput PROPERTIES
- TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
- ENDIF(CTEST_RUN_CTestSubmitLargeOutput)
-
IF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH)
IF(UNIX)
IF(NOT QT4_FOUND)
@@ -1555,10 +1571,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
IF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
SET(CMAKE_SKIP_BOOTSTRAP_TEST 1)
ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
- IF(EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt")
+ IF(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
# If there is CMakeLists.txt in the binary tree, assume in-source build
SET(CMAKE_SKIP_BOOTSTRAP_TEST 1)
- ENDIF(EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt")
+ ENDIF(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
SET(bootstrap "")
IF(CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST)
IF(UNIX)
@@ -1620,7 +1636,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
ENDIF()
IF(NOT CMAKE_TEST_GENERATOR MATCHES "Xcode")
- INCLUDE(FindJava)
+ find_package(Java QUIET)
IF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW)
GET_FILENAME_COMPONENT(JNIPATH ${JAVA_COMPILE} PATH)
FIND_FILE(JNI_H jni.h
@@ -1730,14 +1746,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
# If this is not an in-source build, provide a target to wipe out
# all the test build directories.
- IF(NOT EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt")
+ IF(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in
${CMake_BINARY_DIR}/Tests/test_clean.cmake @ONLY)
ADD_CUSTOM_TARGET(test_clean
COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake
COMMENT "Removing test build directories."
)
- ENDIF(NOT EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt")
+ ENDIF(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
ADD_TEST(CMakeWizardTest ${CMAKE_CMAKE_COMMAND}
-D build_dir:STRING=${CMAKE_CURRENT_BINARY_DIR}/CMakeWizardTest
diff --git a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
index 9150aef..73f8b01 100644
--- a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
+++ b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
@@ -149,26 +149,77 @@ if(is_git_checkout AND NOT GIT_EXECUTABLE)
# from it:
#
if(ctest_ini_file)
- file(STRINGS "${ctest_ini_file}" lines REGEX "^GITCommand: (.*)$")
- string(REGEX REPLACE "^GITCommand: (.*)$" "\\1" exe "${lines}")
+ file(STRINGS "${ctest_ini_file}" line REGEX "^GITCommand: (.*)$")
+ string(REGEX REPLACE "^GITCommand: (.*)$" "\\1" line "${line}")
+ if("${line}" MATCHES "^\"")
+ string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
+ else()
+ string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
+ endif()
+ set(exe "${line}")
if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND")
set(exe "")
endif()
+ if(exe)
+ message("info: GIT_EXECUTABLE set by 'GITCommand:' from '${ctest_ini_file}'")
+ endif()
if(NOT exe)
- file(STRINGS "${ctest_ini_file}" lines REGEX "^UpdateCommand: (.*)$")
- string(REGEX REPLACE "^UpdateCommand: (.*)$" "\\1" exe "${lines}")
+ file(STRINGS "${ctest_ini_file}" line REGEX "^UpdateCommand: (.*)$")
+ string(REGEX REPLACE "^UpdateCommand: (.*)$" "\\1" line "${line}")
+ if("${line}" MATCHES "^\"")
+ string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
+ else()
+ string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
+ endif()
+ set(exe "${line}")
if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND")
set(exe "")
endif()
+ if(exe)
+ message("info: GIT_EXECUTABLE set by 'UpdateCommand:' from '${ctest_ini_file}'")
+ endif()
+ endif()
+ else()
+ message("info: no DartConfiguration.tcl or CTestConfiguration.ini file...")
+ endif()
+
+ # If we have still not grokked the exe, look in the Update.xml file to see
+ # if we can parse it from there...
+ #
+ if(NOT exe)
+ file(GLOB_RECURSE update_xml_file "${CMake_BINARY_DIR}/Testing/Update.xml")
+ if(update_xml_file)
+ file(STRINGS "${update_xml_file}" line
+ REGEX "^.*<UpdateCommand>(.*)</UpdateCommand>$" LIMIT_COUNT 1)
+ string(REPLACE "&quot\;" "\"" line "${line}")
+ string(REGEX REPLACE "^.*<UpdateCommand>(.*)</UpdateCommand>$" "\\1" line "${line}")
+ if("${line}" MATCHES "^\"")
+ string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
+ else()
+ string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
+ endif()
+ if(line)
+ set(exe "${line}")
+ endif()
+ if(exe)
+ message("info: GIT_EXECUTABLE set by '<UpdateCommand>' from '${update_xml_file}'")
+ endif()
+ else()
+ message("info: no Update.xml file...")
endif()
endif()
if(exe)
set(GIT_EXECUTABLE "${exe}")
- message("info: set GIT_EXECUTABLE to '${GIT_EXECUTABLE}' based on '${ctest_ini_file}'")
+ message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
+ message("")
+
+ if(NOT EXISTS "${GIT_EXECUTABLE}")
+ message(FATAL_ERROR "GIT_EXECUTABLE does not exist...")
+ endif()
else()
- message(FATAL_ERROR "could not determine GIT_EXECUTABLE based on '${ctest_ini_file}'...")
+ message(FATAL_ERROR "could not determine GIT_EXECUTABLE...")
endif()
endif()
diff --git a/Tests/CMakeTests/FindBaseTest.cmake.in b/Tests/CMakeTests/FindBaseTest.cmake.in
index 02f7001..47c1692 100644
--- a/Tests/CMakeTests/FindBaseTest.cmake.in
+++ b/Tests/CMakeTests/FindBaseTest.cmake.in
@@ -55,7 +55,7 @@ if(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}")
message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_5} instead !")
endif(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}")
-# by explicitely disabling CMAKE_FIND_ROOT_PATH again it shouldn't be found
+# by explicitly disabling CMAKE_FIND_ROOT_PATH again it shouldn't be found
find_file(FOO_H_6 ${_HEADER} NO_CMAKE_FIND_ROOT_PATH)
if(FOO_H_6)
message(FATAL_ERROR "${_HEADER} found: ${FOO_H_6}, it should not exist !")
diff --git a/Tests/CMakeTests/ModuleNoticesTest.cmake.in b/Tests/CMakeTests/ModuleNoticesTest.cmake.in
index 4d295ef..8ecebd3 100644
--- a/Tests/CMakeTests/ModuleNoticesTest.cmake.in
+++ b/Tests/CMakeTests/ModuleNoticesTest.cmake.in
@@ -3,7 +3,7 @@
# match any additional copyright holder notices.
set(notice_regex "
#=============================================================================
-# Copyright (20[0-9][0-9]-)?20[0-9][0-9] Kitware[^\n]+(
+# Copyright (20[0-9][0-9]-)?20[0-9][0-9] [^\n]+(
# Copyright (20[0-9][0-9]-)?20[0-9][0-9] [^\n]+)*
#
# Distributed under the OSI-approved BSD License \\(the \"License\"\\);
@@ -13,7 +13,7 @@ set(notice_regex "
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\\.
# See the License for more information\\.
#=============================================================================
-# \\(To distributed this file outside of CMake, substitute the full
+# \\(To distribute this file outside of CMake, substitute the full
# License text for the above reference.\\)
")
string(REPLACE "\n" "\r?\n" notice_regex "${notice_regex}")
diff --git a/Tests/CTestSubmitLargeOutput/CMakeLists.txt b/Tests/CTestSubmitLargeOutput/CMakeLists.txt
deleted file mode 100644
index 6c30e7a..0000000
--- a/Tests/CTestSubmitLargeOutput/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-project(SubmitLargeOutput NONE)
-
-include(CTest)
-
-add_test(GenerateRandomOutput ${CMAKE_COMMAND}
- -P ${CMAKE_CURRENT_SOURCE_DIR}/GenerateRandomOutput.cmake
- )
diff --git a/Tests/CTestSubmitLargeOutput/GenerateRandomOutput.cmake b/Tests/CTestSubmitLargeOutput/GenerateRandomOutput.cmake
deleted file mode 100644
index c7f4f29..0000000
--- a/Tests/CTestSubmitLargeOutput/GenerateRandomOutput.cmake
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# This script generates random lines of output.
-#
-# By default, it generates 100M of output (a million lines of 100 bytes each),
-# but you can override that by passing in -D line_count and/or -D line_size...
-#
-
-# Default values:
-#
-if(NOT DEFINED line_count)
- set(line_count 1000000)
-endif()
-
-if(NOT DEFINED line_size)
- set(line_size 100)
-endif()
-
-if(NOT DEFINED random_seed)
- set(random_seed 1987)
-endif()
-
-# Use RANDOM_SEED once before the loop:
-#
-string(RANDOM LENGTH ${line_size} RANDOM_SEED ${random_seed} s)
-
-# Emit line_count lines of random output:
-#
-foreach(i RANGE 1 ${line_count})
- string(RANDOM LENGTH ${line_size} s)
- message(${s})
-endforeach()
diff --git a/Tests/CTestSubmitLargeOutput/test.cmake.in b/Tests/CTestSubmitLargeOutput/test.cmake.in
deleted file mode 100644
index 17a7c7d..0000000
--- a/Tests/CTestSubmitLargeOutput/test.cmake.in
+++ /dev/null
@@ -1,27 +0,0 @@
-SET(CTEST_SITE "@SITE@")
-SET(CTEST_BUILD_NAME "LargeOutput-@BUILDNAME@")
-SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
-
-SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestSubmitLargeOutput")
-SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestSubmitLargeOutput/build")
-SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
-
-CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
-
-CTEST_START(Experimental)
-CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-CTEST_READ_CUSTOM_FILES("${CTEST_BINARY_DIRECTORY}")
-CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-
-SET(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 1000000000)
-SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000000)
-SET(CTEST_TEST_TIMEOUT @CMAKE_LONG_TEST_TIMEOUT@)
-
-CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-
-set(CTEST_DROP_METHOD "@protocol@")
-set(CTEST_DROP_SITE "@server@")
-set(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard")
-
-CTEST_SUBMIT(RETURN_VALUE res)
diff --git a/Tests/CTestTestChecksum/test.cmake.in b/Tests/CTestTestChecksum/test.cmake.in
new file mode 100644
index 0000000..c3c41a5
--- /dev/null
+++ b/Tests/CTestTestChecksum/test.cmake.in
@@ -0,0 +1,28 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+
+# Settings:
+SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
+SET(CTEST_SITE "@SITE@")
+SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Checksum")
+
+SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestParallel")
+SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParallel")
+SET(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@")
+SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
+SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@")
+SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 4)
+
+SET(CTEST_DROP_METHOD "@protocol@")
+SET(CTEST_DROP_SITE "@server@")
+SET(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard")
+
+CTEST_SUBMIT(RETRY_DELAY 3 RETRY_COUNT 2 INTERNAL_TEST_CHECKSUM RETURN_VALUE res)
diff --git a/Tests/CTestTestCycle/CMakeLists.txt b/Tests/CTestTestCycle/CMakeLists.txt
new file mode 100644
index 0000000..6ba6b8c
--- /dev/null
+++ b/Tests/CTestTestCycle/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required (VERSION 2.6)
+project(CTestTestCycle)
+include(CTest)
+
+add_executable (simple simple.cxx)
+add_test (one simple)
+add_test (two simple)
+add_test (three simple)
+
+# Add cyclical test dependency
+set_tests_properties(one PROPERTIES DEPENDS "two")
+set_tests_properties(two PROPERTIES DEPENDS "three")
+set_tests_properties(three PROPERTIES DEPENDS "one")
diff --git a/Tests/CTestSubmitLargeOutput/CTestConfig.cmake b/Tests/CTestTestCycle/CTestConfig.cmake
index ffd6efc..43e9986 100644
--- a/Tests/CTestSubmitLargeOutput/CTestConfig.cmake
+++ b/Tests/CTestTestCycle/CTestConfig.cmake
@@ -1,5 +1,6 @@
-set(CTEST_PROJECT_NAME "SubmitLargeOutput")
-set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
+set (CTEST_PROJECT_NAME "CTestTestCycle")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "www.cdash.org")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
diff --git a/Tests/CTestTestCycle/simple.cxx b/Tests/CTestTestCycle/simple.cxx
new file mode 100644
index 0000000..766b775
--- /dev/null
+++ b/Tests/CTestTestCycle/simple.cxx
@@ -0,0 +1,5 @@
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/CTestTestCycle/test.cmake.in b/Tests/CTestTestCycle/test.cmake.in
new file mode 100644
index 0000000..a17adca
--- /dev/null
+++ b/Tests/CTestTestCycle/test.cmake.in
@@ -0,0 +1,22 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+
+# Settings:
+SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
+SET(CTEST_SITE "@SITE@")
+SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Cycle")
+
+SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCycle")
+SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCycle")
+SET(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@")
+SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
+SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@")
+SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestDepends/CMakeLists.txt b/Tests/CTestTestDepends/CMakeLists.txt
new file mode 100644
index 0000000..26367a6
--- /dev/null
+++ b/Tests/CTestTestDepends/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required (VERSION 2.6)
+project(CTestTestDepends)
+include(CTest)
+
+add_executable (simple simple.cxx)
+add_test (one simple)
+add_test (two simple)
+add_test (three simple)
+
+# Add redundant (but not cyclical) dependencies
+set_tests_properties(two PROPERTIES DEPENDS "one")
+set_tests_properties(three PROPERTIES DEPENDS "one;two")
diff --git a/Tests/CTestTestDepends/CTestConfig.cmake b/Tests/CTestTestDepends/CTestConfig.cmake
new file mode 100644
index 0000000..e3af7dd
--- /dev/null
+++ b/Tests/CTestTestDepends/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestDepends")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestDepends/simple.cxx b/Tests/CTestTestDepends/simple.cxx
new file mode 100644
index 0000000..766b775
--- /dev/null
+++ b/Tests/CTestTestDepends/simple.cxx
@@ -0,0 +1,5 @@
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/CTestTestDepends/test.cmake.in b/Tests/CTestTestDepends/test.cmake.in
new file mode 100644
index 0000000..ed4e182
--- /dev/null
+++ b/Tests/CTestTestDepends/test.cmake.in
@@ -0,0 +1,22 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+
+# Settings:
+SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
+SET(CTEST_SITE "@SITE@")
+SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Depends")
+
+SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestDepends")
+SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestDepends")
+SET(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@")
+SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
+SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@")
+SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in
index f672a52..793b987 100644
--- a/Tests/CTestUpdateGIT.cmake.in
+++ b/Tests/CTestUpdateGIT.cmake.in
@@ -275,6 +275,11 @@ execute_process(
WORKING_DIRECTORY \"${TOP}\"
COMMAND \"${GIT}\" clone \"${REPO}\" dash-source
)
+
+# Test .git file.
+file(RENAME \"${TOP}/dash-source/.git\" \"${TOP}/dash-source/repo.git\")
+file(WRITE \"${TOP}/dash-source/.git\" \"gitdir: repo.git\n\")
+
execute_process(
WORKING_DIRECTORY \"${TOP}/dash-source\"
COMMAND \"${GIT}\" reset --hard ${revision1}
diff --git a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt
index 7206f1d..8095a1c 100644
--- a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt
+++ b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt
@@ -76,7 +76,8 @@ endif()
file(WRITE
"${CMAKE_CURRENT_BINARY_DIR}/main.cxx"
- "int main() { return 0; }"
+ "int main() { return 0; }
+"
)
add_executable(
diff --git a/Tests/CheckFortran.cmake b/Tests/CheckFortran.cmake
index 8adcafc..ebbb426 100644
--- a/Tests/CheckFortran.cmake
+++ b/Tests/CheckFortran.cmake
@@ -9,7 +9,7 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if(NOT DEFINED CMAKE_Fortran_COMPILER)
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index 4fc9fb5..76208d4 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -9,12 +9,16 @@ ADD_SUBDIRECTORY(GeneratedHeader)
#
# Lib and exe path
#
-SET (LIBRARY_OUTPUT_PATH
- ${PROJECT_BINARY_DIR}/bin/ CACHE INTERNAL
+IF(NOT DEFINED bin_dir)
+ SET(bin_dir "bin")
+ENDIF()
+
+SET (LIBRARY_OUTPUT_PATH
+ ${PROJECT_BINARY_DIR}/${bin_dir} CACHE INTERNAL
"Single output directory for building all libraries.")
-SET (EXECUTABLE_OUTPUT_PATH
- ${PROJECT_BINARY_DIR}/bin/ CACHE INTERNAL
+SET (EXECUTABLE_OUTPUT_PATH
+ ${PROJECT_BINARY_DIR}/${bin_dir} CACHE INTERNAL
"Single output directory for building all executables.")
################################################################
@@ -220,7 +224,12 @@ ADD_CUSTOM_COMMAND(OUTPUT gen_redirect.c
##############################################################################
# Test non-trivial command line arguments in custom commands.
SET(EXPECTED_ARGUMENTS)
+SET(CHECK_ARGS)
+IF(NOT MSVC71)
+ SET(CHECK_ARGS -DPATH=c:/posix/path)
+ENDIF()
SET(CHECK_ARGS
+ ${CHECK_ARGS}
c:/posix/path
c:\\windows\\path
'single-quotes'
@@ -359,13 +368,16 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in
@ONLY IMMEDIATE)
ADD_EXECUTABLE(check_command_line
${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c)
+SET(output_name "check_command_line")
+SET_PROPERTY(TARGET check_command_line
+ PROPERTY OUTPUT_NAME ${output_name})
# SET_TARGET_PROPERTIES(check_command_line PROPERTIES
# COMPILE_FLAGS -DCHECK_COMMAND_LINE_VERBOSE)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/command_line_check
COMMAND ${CMAKE_COMMAND} -DMARK_FILE=${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt
-P ${CMAKE_CURRENT_SOURCE_DIR}/check_mark.cmake
- COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check_command_line
+ COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/${output_name}
${CHECK_ARGS} ""
VERBATIM
COMMENT "Checking custom command line escapes (single'quote)"
@@ -375,7 +387,7 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/command_line_check
ADD_CUSTOM_TARGET(do_check_command_line ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/command_line_check
COMMAND ${CMAKE_COMMAND} -E echo "Checking custom target command escapes"
- COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check_command_line
+ COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/${output_name}
${CHECK_ARGS} ""
VERBATIM
COMMENT "Checking custom target command line escapes ($dollar-signs$)"
diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt
index bfc8271..5d27890 100644
--- a/Tests/CxxOnly/CMakeLists.txt
+++ b/Tests/CxxOnly/CMakeLists.txt
@@ -2,7 +2,10 @@
project (CxxOnly CXX)
set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix")
-add_library(testcxx1 STATIC libcxx1.cxx)
+if(WIN32)
+ set(EXTRA_SRCS test.CPP)
+endif()
+add_library(testcxx1.my STATIC libcxx1.cxx ${EXTRA_SRCS})
add_library(testcxx2 SHARED libcxx2.cxx)
add_executable (CxxOnly cxxonly.cxx)
-target_link_libraries(CxxOnly testcxx1 testcxx2)
+target_link_libraries(CxxOnly testcxx1.my testcxx2)
diff --git a/Tests/CxxOnly/cxxonly.cxx b/Tests/CxxOnly/cxxonly.cxx
index 99ccf3b..9cf6f2d 100644
--- a/Tests/CxxOnly/cxxonly.cxx
+++ b/Tests/CxxOnly/cxxonly.cxx
@@ -1,10 +1,16 @@
#include "libcxx1.h"
#include "libcxx2.h"
+#ifdef _MSC_VER
+extern int testCPP;
+#endif
#include <stdio.h>
int main ()
{
+#ifdef _MSC_VER
+ testCPP = 1;
+#endif
if ( LibCxx1Class::Method() != 2.0 )
{
printf("Problem with libcxx1\n");
diff --git a/Tests/CxxOnly/test.CPP b/Tests/CxxOnly/test.CPP
new file mode 100644
index 0000000..8a3cde2
--- /dev/null
+++ b/Tests/CxxOnly/test.CPP
@@ -0,0 +1 @@
+int testCPP;
diff --git a/Tests/Dependency/Four/CMakeLists.txt b/Tests/Dependency/Four/CMakeLists.txt
index ba3711f..df0f162 100644
--- a/Tests/Dependency/Four/CMakeLists.txt
+++ b/Tests/Dependency/Four/CMakeLists.txt
@@ -1,3 +1,6 @@
+INCLUDE_DIRECTORIES(${Dependency_BINARY_DIR}/Two)
ADD_LIBRARY( Four FourSrc.c )
TARGET_LINK_LIBRARIES( Four One Two NoDepA )
+# TwoCustom must build before Four.
+ADD_DEPENDENCIES(Four TwoCustom)
diff --git a/Tests/Dependency/Four/FourSrc.c b/Tests/Dependency/Four/FourSrc.c
index e8fefcd..23a66a4 100644
--- a/Tests/Dependency/Four/FourSrc.c
+++ b/Tests/Dependency/Four/FourSrc.c
@@ -1,3 +1,4 @@
+#include <two-test.h> /* Requires TwoCustom to be built first. */
void NoDepAFunction();
void OneFunction();
void TwoFunction();
diff --git a/Tests/EmptyLibrary/CMakeLists.txt b/Tests/EmptyLibrary/CMakeLists.txt
new file mode 100644
index 0000000..baddbbf
--- /dev/null
+++ b/Tests/EmptyLibrary/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 2.6)
+project(TestEmptyLibrary)
+
+add_subdirectory(subdir)
diff --git a/Tests/EmptyLibrary/subdir/CMakeLists.txt b/Tests/EmptyLibrary/subdir/CMakeLists.txt
new file mode 100644
index 0000000..e273f8d
--- /dev/null
+++ b/Tests/EmptyLibrary/subdir/CMakeLists.txt
@@ -0,0 +1 @@
+add_library(test test.h)
diff --git a/Tests/EmptyLibrary/subdir/test.h b/Tests/EmptyLibrary/subdir/test.h
new file mode 100644
index 0000000..8511f53
--- /dev/null
+++ b/Tests/EmptyLibrary/subdir/test.h
@@ -0,0 +1 @@
+extern int dummy;
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index 45c1149..a878194 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -20,6 +20,7 @@ set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER
set(base "${CMAKE_BINARY_DIR}/CMakeExternals")
set(binary_base "${base}/Build")
set_property(DIRECTORY PROPERTY EP_BASE ${base})
+set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
if(NOT DEFINED can_build_tutorial_step5)
set(can_build_tutorial_step5 1)
@@ -96,6 +97,7 @@ ExternalProject_Add(${proj}
DOWNLOAD_COMMAND ""
INSTALL_COMMAND ""
PATCH_COMMAND ""
+ STEP_TARGETS install update
SVN_REPOSITORY ""
SVN_REVISION ""
TEST_COMMAND ""
@@ -115,6 +117,7 @@ if(can_build_tutorial_step5)
URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
TEST_BEFORE_INSTALL 1
+ LOG_INSTALL 1
)
set_property(TARGET ${proj} PROPERTY FOLDER "Local")
ExternalProject_Get_Property(${proj} install_dir)
@@ -125,6 +128,7 @@ if(can_build_tutorial_step5)
URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
TEST_AFTER_INSTALL 1
+ LOG_TEST 1
)
set_property(TARGET ${proj} PROPERTY FOLDER "Local")
endif()
@@ -142,6 +146,7 @@ ExternalProject_Add(${proj}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DTEST_LIST:STRING=A::B::C
INSTALL_COMMAND ""
+ LOG_CONFIGURE 1
)
set_property(TARGET ${proj} PROPERTY FOLDER "Local/TAR")
@@ -172,6 +177,7 @@ ExternalProject_Add(${proj}
URL_MD5 38c648e817339c356f6be00eeed79bd0
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
INSTALL_COMMAND ""
+ LOG_BUILD 1
)
set_property(TARGET ${proj} PROPERTY FOLDER "Local/TGZ")
@@ -411,6 +417,7 @@ if(do_svn_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalSVNRepository"
+ LOG_DOWNLOAD 1
)
set_property(TARGET ${proj} PROPERTY FOLDER "SVN")
endif()
@@ -490,6 +497,7 @@ if(do_git_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalGITRepository"
+ LOG_UPDATE 1
)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
endif()
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index 74cc115..a472bea 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -54,6 +54,10 @@ SET(CMAKE_FIND_APPBUNDLE FIRST)
# Set the wrong answer for a find to make sure it re-finds.
set(VersionedA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-4.0)
+# Test that CMAKE_IGNORE_PATH can ignore the purposely bad package
+# files in the lib/cmake/zot-3.1 directory.
+set(CMAKE_IGNORE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-3.1)
+
# Look for packages with new-style signatures.
FIND_PACKAGE(foo NO_MODULE)
FIND_PACKAGE(Foo CONFIGS FooConfig.cmake)
diff --git a/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake
new file mode 100644
index 0000000..bee2f0e
--- /dev/null
+++ b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake
@@ -0,0 +1,4 @@
+# Claim to be any version to test that CMAKE_IGNORE_PATH hides us.
+SET(PACKAGE_VERSION 3.1)
+SET(PACKAGE_VERSION_COMPATIBLE 1)
+SET(PACKAGE_VERSION_EXACT 1)
diff --git a/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config.cmake b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config.cmake
new file mode 100644
index 0000000..2fbd525
--- /dev/null
+++ b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config.cmake
@@ -0,0 +1,2 @@
+# Test config file.
+message(WARNING "CMAKE_IGNORE_PATH failed to ignore this file!")
diff --git a/Tests/FunctionTest/CMakeLists.txt b/Tests/FunctionTest/CMakeLists.txt
index ef55173..5d4f42d 100644
--- a/Tests/FunctionTest/CMakeLists.txt
+++ b/Tests/FunctionTest/CMakeLists.txt
@@ -166,3 +166,11 @@ ELSE(DEFINED SUBDIR_DEFINED)
ENDIF(DEFINED SUBDIR_DEFINED)
ADD_EXECUTABLE(FunctionTest functionTest.c)
+
+# Use the PROJECT_LABEL property: in IDEs, the project label should appear
+# in the UI rather than the target name. If this were a good test of the
+# property rather than just a smoke test, it would verify that the label
+# actually appears in the UI of the IDE... Or at least that the text appears
+# somewhere in the generated project files.
+SET_PROPERTY(TARGET miniFunctionTest
+ PROPERTY PROJECT_LABEL "Test de Fonctionnement")
diff --git a/Tests/MissingSourceFile/CMakeLists.txt b/Tests/MissingSourceFile/CMakeLists.txt
new file mode 100644
index 0000000..42b7c51
--- /dev/null
+++ b/Tests/MissingSourceFile/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(MissingSourceFile C)
+add_executable(MissingSourceFile MissingSourceFile.c)
diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt
index 8888aba..5d076e0 100644
--- a/Utilities/Doxygen/CMakeLists.txt
+++ b/Utilities/Doxygen/CMakeLists.txt
@@ -27,15 +27,15 @@ IF (BUILD_DOCUMENTATION)
ENDIF(NOT DOT_PATH)
CONFIGURE_FILE(
- ${CMAKE_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in
- ${CMAKE_BINARY_DIR}/Utilities/Doxygen/doxyfile)
+ ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in
+ ${CMake_BINARY_DIR}/Utilities/Doxygen/doxyfile)
CONFIGURE_FILE(
- ${CMAKE_SOURCE_DIR}/Utilities/Doxygen/doc_makeall.sh.in
- ${CMAKE_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh)
+ ${CMake_SOURCE_DIR}/Utilities/Doxygen/doc_makeall.sh.in
+ ${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh)
ADD_CUSTOM_TARGET(DoxygenDoc
${BASH}
- ${CMAKE_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh)
+ ${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh)
ENDIF (BUILD_DOCUMENTATION)
diff --git a/Utilities/Doxygen/doc_makeall.sh.in b/Utilities/Doxygen/doc_makeall.sh.in
index e5cf240..a1b00e7 100755
--- a/Utilities/Doxygen/doc_makeall.sh.in
+++ b/Utilities/Doxygen/doc_makeall.sh.in
@@ -48,7 +48,7 @@ export PATH_TO_VTK_DOX_SCRIPTS="@VTK_SOURCE_DIR@/Utilities/Doxygen"
# Example:
# SOURCE_DIR=@VTK_SOURCE_DIR@
#
-export SOURCE_DIR="@CMAKE_SOURCE_DIR@"
+export SOURCE_DIR="@CMake_SOURCE_DIR@"
# REL_PATH_TO_TOP:
# Relative path from the top directory of the source files to the directory
@@ -71,7 +71,7 @@ export REL_PATH_TO_TOP=.
# DOXTEMP=DOXTEMP=@VTK_BINARY_DIR@/Utilities/Doxygen
# INTERMEDIATE_DOX_DIR=$DOXTEMP/dox
#
-export DOXTEMP="@CMAKE_BINARY_DIR@/Utilities/Doxygen"
+export DOXTEMP="@CMake_BINARY_DIR@/Utilities/Doxygen"
export INTERMEDIATE_DOX_DIR="$DOXTEMP/dox"
# DOXYFILE:
diff --git a/Utilities/Doxygen/doxyfile.in b/Utilities/Doxygen/doxyfile.in
index ad5e377..c3d3a38 100644
--- a/Utilities/Doxygen/doxyfile.in
+++ b/Utilities/Doxygen/doxyfile.in
@@ -31,19 +31,19 @@ GRAPHICAL_HIERARCHY = YES
ALLEXTERNALS = NO
-IMAGE_PATH = "@CMAKE_BINARY_DIR@/Utilities/Doxygen/contrib"
+IMAGE_PATH = "@CMake_BINARY_DIR@/Utilities/Doxygen/contrib"
-OUTPUT_DIRECTORY = "@CMAKE_BINARY_DIR@/Utilities/Doxygen/doc"
+OUTPUT_DIRECTORY = "@CMake_BINARY_DIR@/Utilities/Doxygen/doc"
INPUT = \
- "@CMAKE_SOURCE_DIR@/Source" \
- "@CMAKE_SOURCE_DIR@/Source/CPack" \
- "@CMAKE_SOURCE_DIR@/Source/CTest" \
- "@CMAKE_SOURCE_DIR@/Source/CursesDialog" \
- "@CMAKE_SOURCE_DIR@/Source/MFCDialog" \
- "@CMAKE_BINARY_DIR@/Source/kwsys" \
- "@CMAKE_BINARY_DIR@/Source/cmsys" \
- "@CMAKE_BINARY_DIR@/Utilities/Doxygen/dox/doc_CMake_contributors.dox" \
+ "@CMake_SOURCE_DIR@/Source" \
+ "@CMake_SOURCE_DIR@/Source/CPack" \
+ "@CMake_SOURCE_DIR@/Source/CTest" \
+ "@CMake_SOURCE_DIR@/Source/CursesDialog" \
+ "@CMake_SOURCE_DIR@/Source/MFCDialog" \
+ "@CMake_BINARY_DIR@/Source/kwsys" \
+ "@CMake_BINARY_DIR@/Source/cmsys" \
+ "@CMake_BINARY_DIR@/Utilities/Doxygen/dox/doc_CMake_contributors.dox" \
EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
diff --git a/Utilities/KWStyle/CMake.kws.xml.in b/Utilities/KWStyle/CMake.kws.xml.in
index 9c5efee..c2b4429 100644
--- a/Utilities/KWStyle/CMake.kws.xml.in
+++ b/Utilities/KWStyle/CMake.kws.xml.in
@@ -2,7 +2,7 @@
<Description>
<LineLength>79</LineLength>
<!--
-<Header>"@CMAKE_SOURCE_DIR@/Utilities/KWStyle/Headers",false,true</Header>
+<Header>"@CMake_SOURCE_DIR@/Utilities/KWStyle/Headers",false,true</Header>
<Functions>
<regex>[A-Z]</regex>
<length>100</length>
diff --git a/Utilities/KWStyle/CMakeFiles.txt.in b/Utilities/KWStyle/CMakeFiles.txt.in
index aa4ee74..a95aac6 100644
--- a/Utilities/KWStyle/CMakeFiles.txt.in
+++ b/Utilities/KWStyle/CMakeFiles.txt.in
@@ -1,15 +1,15 @@
-"@CMAKE_SOURCE_DIR@/Source/*.txx"
-"@CMAKE_SOURCE_DIR@/Source/*.cxx"
-"@CMAKE_SOURCE_DIR@/Source/*.h*"
-"@CMAKE_SOURCE_DIR@/Source/CPack/*.txx"
-"@CMAKE_SOURCE_DIR@/Source/CPack/*.cxx"
-"@CMAKE_SOURCE_DIR@/Source/CPack/*.h*"
-"@CMAKE_SOURCE_DIR@/Source/CTest/*.txx"
-"@CMAKE_SOURCE_DIR@/Source/CTest/*.cxx"
-"@CMAKE_SOURCE_DIR@/Source/CTest/*.h*"
-"@CMAKE_SOURCE_DIR@/Source/CurseDialog/*.h*"
-"@CMAKE_SOURCE_DIR@/Source/CurseDialog/*.cxx"
-"@CMAKE_SOURCE_DIR@/Source/CurseDialog/*.txx"
+"@CMake_SOURCE_DIR@/Source/*.txx"
+"@CMake_SOURCE_DIR@/Source/*.cxx"
+"@CMake_SOURCE_DIR@/Source/*.h*"
+"@CMake_SOURCE_DIR@/Source/CPack/*.txx"
+"@CMake_SOURCE_DIR@/Source/CPack/*.cxx"
+"@CMake_SOURCE_DIR@/Source/CPack/*.h*"
+"@CMake_SOURCE_DIR@/Source/CTest/*.txx"
+"@CMake_SOURCE_DIR@/Source/CTest/*.cxx"
+"@CMake_SOURCE_DIR@/Source/CTest/*.h*"
+"@CMake_SOURCE_DIR@/Source/CurseDialog/*.h*"
+"@CMake_SOURCE_DIR@/Source/CurseDialog/*.cxx"
+"@CMake_SOURCE_DIR@/Source/CurseDialog/*.txx"
-f (Lexer\.h)
-f (Lexer\.cxx)
-f (Parser\.cxx)
diff --git a/Utilities/KWStyle/CMakeLists.txt b/Utilities/KWStyle/CMakeLists.txt
index d8269c6..4803ffa 100644
--- a/Utilities/KWStyle/CMakeLists.txt
+++ b/Utilities/KWStyle/CMakeLists.txt
@@ -36,27 +36,27 @@ IF(CMAKE_USE_KWSTYLE)
SET(KWSTYLE_ARGUMENTS -msvc ${KWSTYLE_ARGUMENTS})
ENDIF(KWSTYLE_USE_MSVC_FORMAT)
- CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMake.kws.xml.in
- ${CMAKE_BINARY_DIR}/CMake.kws.xml)
- CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
- ${CMAKE_BINARY_DIR}/CMakeMoreChecks.kws.xml)
+ CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMake.kws.xml.in
+ ${CMake_BINARY_DIR}/CMake.kws.xml)
+ CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
+ ${CMake_BINARY_DIR}/CMakeMoreChecks.kws.xml)
- CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMakeFiles.txt.in
- ${CMAKE_BINARY_DIR}/CMakeKWSFiles.txt)
+ CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeFiles.txt.in
+ ${CMake_BINARY_DIR}/CMakeKWSFiles.txt)
ADD_CUSTOM_COMMAND(
- OUTPUT ${CMAKE_BINARY_DIR}/KWStyleReport.txt
+ OUTPUT ${CMake_BINARY_DIR}/KWStyleReport.txt
COMMAND ${KWSTYLE_EXECUTABLE}
- ARGS -xml ${CMAKE_BINARY_DIR}/CMake.kws.xml -o ${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMAKE_BINARY_DIR}/CMakeKWSFiles.txt
+ ARGS -xml ${CMake_BINARY_DIR}/CMake.kws.xml -o ${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMake_BINARY_DIR}/CMakeKWSFiles.txt
COMMENT "Coding Style Checker"
)
ADD_CUSTOM_TARGET(MoreStyleChecks
COMMAND ${KWSTYLE_EXECUTABLE}
- -xml ${CMAKE_BINARY_DIR}/CMakeMoreChecks.kws.xml -html ${CMAKE_BINARY_DIR}/html -o ${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMAKE_BINARY_DIR}/CMakeKWSFiles.txt
+ -xml ${CMake_BINARY_DIR}/CMakeMoreChecks.kws.xml -html ${CMake_BINARY_DIR}/html -o ${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMake_BINARY_DIR}/CMakeKWSFiles.txt
COMMENT "Coding Style Checker, more checks enabled"
)
- ADD_CUSTOM_TARGET(StyleCheck DEPENDS ${CMAKE_BINARY_DIR}/KWStyleReport.txt)
+ ADD_CUSTOM_TARGET(StyleCheck DEPENDS ${CMake_BINARY_DIR}/KWStyleReport.txt)
ENDIF(CMAKE_USE_KWSTYLE)
diff --git a/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in b/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
index f47f8e8..b7078e0 100644
--- a/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
+++ b/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
@@ -2,7 +2,7 @@
<Description>
<ErrorThreshold>10</ErrorThreshold>
<LineLength>79</LineLength>
- <Header>"@CMAKE_SOURCE_DIR@/Utilities/KWStyle/Headers",false,true</Header>
+ <Header>"@CMake_SOURCE_DIR@/Utilities/KWStyle/Headers",false,true</Header>
<Functions>
<regex>^(cm)?[A-Z]</regex>
<length>200</length>
diff --git a/Utilities/Release/README b/Utilities/Release/README
index 75cdf48..12eafe1 100644
--- a/Utilities/Release/README
+++ b/Utilities/Release/README
@@ -1,28 +1,21 @@
-To create a cmake release, first test the branch:
+To create a cmake release, make sure the "release" tag is pointing to the
+expected git commit:
-mkdir 2-4
-cd 2-4
-cmake -DCMAKE_CREATE_VERSION=CMake-2-4 -P ../create-cmake-release.cmake
-./create-CMake-2-4.sh
+http://cmake.org/gitweb?p=cmake.git;a=shortlog;h=refs/heads/release
-If that works:
-EDIT CMakeLists.txt and remove the RC setting!
-commit that.
+Then as kitware@hythloth, using an up-to-date CMake:
-Then tag the minor release:
-cvs tag 2-4-7
+ cd ~/CMakeReleases/cmake/Utilities/Release
+ mkdir 283rc1
+ cd 283rc1
+ ~/CMakeReleases/build/bin/cmake -DCMAKE_CREATE_VERSION=release -P ../create-cmake-release.cmake
+ ./create-release.sh
-Then create a release from the tag:
-mkdir 2-4-7
-cd 2-4-7
-cmake -DCMAKE_CREATE_VERSION=CMake-2-4-7 -P ../create-cmake-release.cmake
-./create-CMake-2-4.sh
-
-create-cmake-release.cmake: script to run to create release sh script
-To add or remove machines this file should be edited.
+create-cmake-release.cmake: script to run to create release sh scripts
+Add or remove machines in create-cmake-release.cmake.
Cygwin -> directory that contains cpack cygwin package files used in
- CMakeCPack.cmake)
+ CMakeCPack.cmake
machine_release.cmake : config files for each machine
diff --git a/Utilities/Release/create-cmake-release.cmake b/Utilities/Release/create-cmake-release.cmake
index 66753ce..fd91665 100644
--- a/Utilities/Release/create-cmake-release.cmake
+++ b/Utilities/Release/create-cmake-release.cmake
@@ -5,17 +5,14 @@ endif(NOT DEFINED CMAKE_CREATE_VERSION)
set(RELEASE_SCRIPTS
dashmacmini2_release.cmake # Mac Darwin universal
dashsun1_release.cmake # SunOS
- destiny_release.cmake # HPUX
+# destiny_release.cmake # HPUX -- destiny is dead; long live destiny
magrathea_release.cmake # Linux
dash2win64_release.cmake # Windows
# dash2win64_cygwin.cmake # Cygwin
# blight_cygwin.cmake # Cygwin
v20n250_aix_release.cmake # AIX 5.3
-# vogon_cygwin.cmake # Cygwin
ferrari_sgi64_release.cmake # IRIX 64
ferrari_sgi_release.cmake # IRIX 64
-# r36n11_aix_release.cmake # AIX 5.3
-# r15n65_aix_release.cmake # AIX 5.2
)
file(WRITE create-${CMAKE_CREATE_VERSION}.sh "#!/bin/bash")
@@ -29,5 +26,3 @@ ${CMAKE_COMMAND} -DCMAKE_CREATE_VERSION=${CMAKE_CREATE_VERSION} -P ${CMAKE_ROOT}
endforeach(f)
execute_process(COMMAND chmod a+x create-${CMAKE_CREATE_VERSION}.sh)
message("Run ./create-${CMAKE_CREATE_VERSION}.sh")
-
-
diff --git a/Utilities/Release/dash2win64_cygwin.cmake b/Utilities/Release/dash2win64_cygwin.cmake
index d866896..64099a9 100644
--- a/Utilities/Release/dash2win64_cygwin.cmake
+++ b/Utilities/Release/dash2win64_cygwin.cmake
@@ -6,12 +6,13 @@ set(HOST dash2win64)
set(CPACK_BINARY_GENERATORS "CygwinBinary")
set(CPACK_SOURCE_GENERATORS "CygwinSource")
set(MAKE_PROGRAM "make")
-set(CVS_COMMAND /usr/bin/cvs)
set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release
CMAKE_Fortran_COMPILER_FULLPATH:FILEPATH=FALSE
")
set(CXX g++)
set(CC gcc)
set(SCRIPT_NAME dash2win64cygwin)
+set(GIT_COMMAND git)
+set(GIT_EXTRA "git config core.autocrlf true")
get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/dashmacmini2_release.cmake b/Utilities/Release/dashmacmini2_release.cmake
index 12bfa6a..6deeb41 100644
--- a/Utilities/Release/dashmacmini2_release.cmake
+++ b/Utilities/Release/dashmacmini2_release.cmake
@@ -15,6 +15,6 @@ CPACK_SYSTEM_NAME:STRING=Darwin-universal
BUILD_QtDialog:BOOL:=TRUE
QT_QMAKE_EXECUTABLE:FILEPATH=/Users/kitware/Software/QtBinUniversal/bin/qmake
")
-set(GIT_COMMAND /Users/kitware/.userroot/bin/git)
+set(GIT_COMMAND /opt/local/bin/git)
get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/dashsgi1_release.cmake b/Utilities/Release/dashsgi1_release.cmake
deleted file mode 100644
index 0af5ca7..0000000
--- a/Utilities/Release/dashsgi1_release.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-set(CMAKE_RELEASE_DIRECTORY "/usr/people/kitware/CMakeReleaseDirectory")
-set(PROCESSORS 2)
-set(HOST dashsgi1)
-set(MAKE_PROGRAM "make")
-set(MAKE "${MAKE_PROGRAM} -P")
-set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release
-CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
-CPACK_SYSTEM_NAME:STRING=IRIX64-n32
-")
-get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
-include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/dashsgi1_release64.cmake b/Utilities/Release/dashsgi1_release64.cmake
deleted file mode 100644
index 133f478..0000000
--- a/Utilities/Release/dashsgi1_release64.cmake
+++ /dev/null
@@ -1,15 +0,0 @@
-set(CMAKE_RELEASE_DIRECTORY "/usr/people/kitware/CMakeReleaseDirectory64")
-set(PROCESSORS 2)
-set(CFLAGS "-64")
-set(CXXFLAGS "-64")
-set(LDFLAGS="-64")
-set(HOST dashsgi1)
-set(SCRIPT_NAME dashsgi164)
-set(MAKE_PROGRAM "make")
-set(MAKE "${MAKE_PROGRAM} -P")
-set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release
-CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
-CPACK_SYSTEM_NAME:STRING=IRIX64-64
-")
-get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
-include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/destiny_release.cmake b/Utilities/Release/destiny_release.cmake
deleted file mode 100644
index 886909f..0000000
--- a/Utilities/Release/destiny_release.cmake
+++ /dev/null
@@ -1,12 +0,0 @@
-set(PROCESSORS 1)
-set(RUN_SHELL "/usr/local/bin/zsh -l -c /bin/sh")
-set(CVS_COMMAND "/usr/local/bin/cvs")
-set(HOST destiny)
-set(MAKE_PROGRAM "/usr/local/bin/gmake")
-set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release
-CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
-CMAKE_EXE_LINKER_FLAGS:STRING=-Wl,-a,archive_shared
-CMAKE_C_FLAGS:STRING=+DAportable
-CMAKE_CXX_FLAGS:STRING=-Wl,+vnocompatwarnings +W740,749 +DAportable -D__HPACC_STRICTER_ANSI__")
-get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
-include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/muse_release.cmake b/Utilities/Release/muse_release.cmake
deleted file mode 100644
index 9fd41c4..0000000
--- a/Utilities/Release/muse_release.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
-set(CMAKE_RELEASE_DIRECTORY "/home/collab/itk/CMakeReleaseDirectory" )
-set(PROCESSORS 20)
-set(HOST muse)
-set(MAKE_PROGRAM "gmake")
-set(MAKE "${MAKE_PROGRAM} -j20")
-set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release
-CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
-")
-get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
-include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/muse_release64.cmake b/Utilities/Release/muse_release64.cmake
deleted file mode 100644
index cd87f51..0000000
--- a/Utilities/Release/muse_release64.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-set(CMAKE_RELEASE_DIRECTORY "/home/collab/itk/CMakeReleaseDirectory64" )
-set(PROCESSORS 20)
-set(CFLAGS "-64")
-set(CXXFLAGS "-64")
-set(LDFLAGS="-64")
-set(HOST muse)
-set(SCRIPT_NAME muse64)
-set(MAKE_PROGRAM "gmake")
-set(MAKE "${MAKE_PROGRAM} -j20")
-set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release
-CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
-")
-get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
-include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/r15n65_aix_release.cmake b/Utilities/Release/r15n65_aix_release.cmake
deleted file mode 100644
index 74d6d0b..0000000
--- a/Utilities/Release/r15n65_aix_release.cmake
+++ /dev/null
@@ -1,22 +0,0 @@
-set(CMAKE_RELEASE_DIRECTORY "/bench1/noibm34/CMakeReleaseDirectory" )
-set(FINAL_PATH /u/noibm34/cmake-release)
-set(PROCESSORS 2)
-set(CVS_COMMAND /vol/local/bin/cvs)
-set(HOST "sshserv.centers.ihost.com" )
-set(EXTRA_HOP "rsh r15n65" )
-set(MAKE_PROGRAM "make")
-set(CC "xlc")
-set(CXX "xlC")
-set(FC "xlf")
-set(INITIAL_CACHE "
-CMAKE_BUILD_TYPE:STRING=Release
-CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
-")
-set(EXTRA_COPY "
-rm -rf ~/cmake-release
-mkdir ~/cmake-release
-mv *.sh ~/cmake-release
-mv *.Z ~/cmake-release
-mv *.gz ~/cmake-release")
-get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
-include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/r36n11_aix_release.cmake b/Utilities/Release/r36n11_aix_release.cmake
deleted file mode 100644
index 60c8459..0000000
--- a/Utilities/Release/r36n11_aix_release.cmake
+++ /dev/null
@@ -1,22 +0,0 @@
-set(CMAKE_RELEASE_DIRECTORY "/bench1/noibm34/CMakeReleaseDirectory" )
-set(FINAL_PATH /u/noibm34/cmake-release)
-set(PROCESSORS 2)
-set(CVS_COMMAND /vol/local/bin/cvs)
-set(HOST "sshserv.centers.ihost.com" )
-set(EXTRA_HOP "ssh r36n11" )
-set(MAKE_PROGRAM "make")
-set(CC "xlc")
-set(CXX "xlC")
-set(FC "xlf")
-set(INITIAL_CACHE "
-CMAKE_BUILD_TYPE:STRING=Release
-CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
-")
-set(EXTRA_COPY "
-rm -rf ~/cmake-release
-mkdir ~/cmake-release
-mv *.sh ~/cmake-release
-mv *.Z ~/cmake-release
-mv *.gz ~/cmake-release")
-get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
-include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/release_cmake.cmake b/Utilities/Release/release_cmake.cmake
index 6fd1372..3a35ec3 100644
--- a/Utilities/Release/release_cmake.cmake
+++ b/Utilities/Release/release_cmake.cmake
@@ -34,7 +34,11 @@ if(NOT DEFINED CVS_COMMAND)
set(CVS_COMMAND cvs)
endif(NOT DEFINED CVS_COMMAND)
-set(GIT_BRANCH ${CMAKE_CREATE_VERSION})
+if(${CMAKE_CREATE_VERSION} MATCHES "^(release|maint|next)$")
+ set(GIT_BRANCH origin/${CMAKE_CREATE_VERSION})
+else()
+ set(GIT_BRANCH ${CMAKE_CREATE_VERSION})
+endif()
set( CMAKE_CHECKOUT "${CVS_COMMAND} -q -d ${CVSROOT} co -d ${CMAKE_CREATE_VERSION} ${CMAKE_CREATE_VERSION}")
diff --git a/Utilities/Release/release_cmake.sh.in b/Utilities/Release/release_cmake.sh.in
index 4189728..8455e92 100755
--- a/Utilities/Release/release_cmake.sh.in
+++ b/Utilities/Release/release_cmake.sh.in
@@ -89,7 +89,7 @@ if [ ! -z "@GIT_COMMAND@" ]; then
@GIT_EXTRA@
check_exit_value $? "git extra cmake source" || exit 1
# now checkout a copy on the local branch working
- @GIT_COMMAND@ checkout -b working origin/@GIT_BRANCH@
+ @GIT_COMMAND@ checkout -b working @GIT_BRANCH@
check_exit_value $? "git checkout" || exit 1
cd ..
else
diff --git a/Utilities/Release/v20n17_aix_release.cmake b/Utilities/Release/v20n17_aix_release.cmake
deleted file mode 100644
index b7494bb..0000000
--- a/Utilities/Release/v20n17_aix_release.cmake
+++ /dev/null
@@ -1,22 +0,0 @@
-set(CMAKE_RELEASE_DIRECTORY "/bench1/noibm34/CMakeReleaseDirectory" )
-set(FINAL_PATH /u/noibm34/cmake-release)
-set(PROCESSORS 2)
-set(CVS_COMMAND /vol/local/bin/cvs)
-set(HOST "sshserv.centers.ihost.com" )
-set(EXTRA_HOP "rsh v20n17" )
-set(MAKE_PROGRAM "make")
-set(CC "xlc")
-set(CXX "xlC")
-set(FC "xlf")
-set(INITIAL_CACHE "
-CMAKE_BUILD_TYPE:STRING=Release
-CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
-")
-set(EXTRA_COPY "
-rm -rf ~/cmake-release
-mkdir ~/cmake-release
-mv *.sh ~/cmake-release
-mv *.Z ~/cmake-release
-mv *.gz ~/cmake-release")
-get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
-include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/v60n177_aix_release.cmake b/Utilities/Release/v60n177_aix_release.cmake
deleted file mode 100644
index 9ed42ad..0000000
--- a/Utilities/Release/v60n177_aix_release.cmake
+++ /dev/null
@@ -1,21 +0,0 @@
-set(CMAKE_RELEASE_DIRECTORY "/bench1/noibm34/CMakeReleaseDirectory" )
-set(FINAL_PATH /u/noibm34/cmake-release)
-set(PROCESSORS 2)
-set(CVS_COMMAND /vol/local/bin/cvs)
-set(HOST "sshserv.centers.ihost.com" )
-set(EXTRA_HOP "rsh v60n177" )
-set(MAKE_PROGRAM "make")
-set(CC "xlc")
-set(CXX "xlC")
-set(INITIAL_CACHE "
-CMAKE_BUILD_TYPE:STRING=Release
-CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
-")
-set(EXTRA_COPY "
-rm -rf ~/cmake-release
-mkdir ~/cmake-release
-mv *.sh ~/cmake-release
-mv *.Z ~/cmake-release
-mv *.gz ~/cmake-release")
-get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
-include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/vogon_cygwin.cmake b/Utilities/Release/vogon_cygwin.cmake
deleted file mode 100644
index 0506f2a..0000000
--- a/Utilities/Release/vogon_cygwin.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-set(CMAKE_RELEASE_DIRECTORY "c:/hoffman/CMakeReleaseCygwin")
-set(PROCESSORS 2)
-set(HOST vogon)
-set(CPACK_BINARY_GENERATORS "CygwinBinary")
-set(CPACK_SOURCE_GENERATORS "CygwinSource")
-set(MAKE_PROGRAM "make")
-set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release
-Subversion_SVNADMIN_EXECUTABLE:STRING=FALSE
-")
-get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
-include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/vogon_release.cmake b/Utilities/Release/vogon_release.cmake
deleted file mode 100644
index 41245a5..0000000
--- a/Utilities/Release/vogon_release.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-set(CMAKE_RELEASE_DIRECTORY "c:/hoffman/CMakeReleaseDirectory")
-set(CONFIGURE_WITH_CMAKE TRUE)
-set(CMAKE_CONFIGURE_PATH "c:/Program\\ Files/CMake\\ 2.7/bin/cmake.exe")
-set(PROCESSORS 1)
-set(HOST vogon)
-set(CPACK_BINARY_GENERATORS "NSIS ZIP")
-set(CPACK_SOURCE_GENERATORS "ZIP")
-set(MAKE_PROGRAM "nmake")
-set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release
-CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
-CMAKE_GENERATOR:INTERNAL=NMake Makefiles
-CMAKE_MT_EXECUTABLE:STRING=mt
-BUILD_QtDialog:BOOL:=TRUE
-QT_QMAKE_EXECUTABLE:FILEPATH=C:/QT/qt-win-opensource-src-4.5.0/bin/qmake.exe
-")
-get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
-include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/vogon_release_qt.cmake b/Utilities/Release/vogon_release_qt.cmake
deleted file mode 100644
index 1772006..0000000
--- a/Utilities/Release/vogon_release_qt.cmake
+++ /dev/null
@@ -1,16 +0,0 @@
-set(CMAKE_RELEASE_DIRECTORY "c:/hoffman/CMakeReleaseDirectory")
-set(CONFIGURE_WITH_CMAKE TRUE)
-set(CMAKE_CONFIGURE_PATH "c:/Program\\ Files/CMake\\ 2.6/bin/cmake.exe")
-set(PROCESSORS 1)
-set(HOST vogon)
-set(CPACK_BINARY_GENERATORS "NSIS ZIP")
-set(CPACK_SOURCE_GENERATORS "ZIP")
-set(MAKE_PROGRAM "nmake")
-set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release
-CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
-CMAKE_GENERATOR:INTERNAL=NMake Makefiles
-CMAKE_MT_EXECUTABLE:STRING=mt
-QT_QMAKE_EXECUTABLE:FILEPATH=C:/QT/qt-win-opensource-src-4.5.0/bin/qmake.exe
-")
-get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
-include(${path}/release_cmake.cmake)
diff --git a/Utilities/cmThirdParty.h.in b/Utilities/cmThirdParty.h.in
index 6cdd47c..daf8114 100644
--- a/Utilities/cmThirdParty.h.in
+++ b/Utilities/cmThirdParty.h.in
@@ -16,6 +16,7 @@
#cmakedefine CMAKE_USE_SYSTEM_CURL
#cmakedefine CMAKE_USE_SYSTEM_EXPAT
#cmakedefine CMAKE_USE_SYSTEM_ZLIB
+#cmakedefine CMAKE_USE_SYSTEM_LIBARCHIVE
#cmakedefine CTEST_USE_XMLRPC
#endif
diff --git a/Utilities/cm_libarchive.h b/Utilities/cm_libarchive.h
new file mode 100644
index 0000000..1469bae
--- /dev/null
+++ b/Utilities/cm_libarchive.h
@@ -0,0 +1,25 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2010 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef __cm_libarchive_h
+#define __cm_libarchive_h
+
+/* Use the libarchive configured for CMake. */
+#include "cmThirdParty.h"
+#ifdef CMAKE_USE_SYSTEM_LIBARCHIVE
+# include <archive.h>
+# include <archive_entry.h>
+#else
+# include <cmlibarchive/libarchive/archive.h>
+# include <cmlibarchive/libarchive/archive_entry.h>
+#endif
+
+#endif
diff --git a/Utilities/cmbzip2/bzlib_private.h b/Utilities/cmbzip2/bzlib_private.h
index 147dbb8..02a667f 100644
--- a/Utilities/cmbzip2/bzlib_private.h
+++ b/Utilities/cmbzip2/bzlib_private.h
@@ -47,6 +47,9 @@
/* warning C4127: conditional expression is constant*/
# pragma warning(disable:4127)
#endif
+#if defined(__clang__)
+# pragma clang diagnostic ignored "-Wcast-align"
+#endif
/*-- General stuff. --*/
diff --git a/Utilities/cmcompress/cmcompress.c b/Utilities/cmcompress/cmcompress.c
index 59978f6..ea845ed 100644
--- a/Utilities/cmcompress/cmcompress.c
+++ b/Utilities/cmcompress/cmcompress.c
@@ -454,7 +454,7 @@ int cmcompress_compress(struct cmcompress_stream* cdata, void* buff, size_t n)
{
goto nomatch;
}
- disp = cdata->hsize_reg - i; /* secondary hash (after G. Knott) */
+ disp = (int)(cdata->hsize_reg - i); /* secondary hash (after G. Knott) */
if ( i == 0 )
{
disp = 1;
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 510851a..0f98e5a 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -731,6 +731,7 @@ FOREACH(var
SIZEOF_LONG_LONG
SIZEOF___INT64
SIZEOF_SIZE_T
+ SIZEOF_SSIZE_T
SIZEOF_TIME_T
)
IF(NOT ${var}_CODE)
diff --git a/Utilities/cmcurl/curl/multi.h b/Utilities/cmcurl/curl/multi.h
index d253372..1b66747 100644
--- a/Utilities/cmcurl/curl/multi.h
+++ b/Utilities/cmcurl/curl/multi.h
@@ -181,7 +181,7 @@ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
* curl_multi_cleanup().
*
* The 'CURLMsg' struct is meant to be very simple and only contain
- * very basic informations. If more involved information is wanted,
+ * very basic information. If more involved information is wanted,
* we will provide the particular "transfer handle" in that struct
* and that should/could/would be used in subsequent
* curl_easy_getinfo() calls (or similar). The point being that we
diff --git a/Utilities/cmcurl/setup.h b/Utilities/cmcurl/setup.h
index c49e63d..e302f35 100644
--- a/Utilities/cmcurl/setup.h
+++ b/Utilities/cmcurl/setup.h
@@ -42,6 +42,10 @@
#define WIN32
#endif
+#if defined(__clang__)
+# pragma clang diagnostic ignored "-Wcast-align"
+#endif
+
/*
* Include configuration script results or hand-crafted
* configuration file for platforms which lack config tool.
diff --git a/Utilities/cmcurl/url.c b/Utilities/cmcurl/url.c
index 3f4a4c3..da12231 100644
--- a/Utilities/cmcurl/url.c
+++ b/Utilities/cmcurl/url.c
@@ -3983,7 +3983,7 @@ static CURLcode SetupConnection(struct connectdata *conn,
conn->bits.tcpconnect = FALSE;
/* if the connection was closed by the server while exchanging
- authentication informations, retry with the new set
+ authentication information, retry with the new set
authentication information */
if(conn->bits.proxy_connect_closed) {
/* reset the error buffer */
diff --git a/Utilities/cmlibarchive/libarchive/archive_check_magic.c b/Utilities/cmlibarchive/libarchive/archive_check_magic.c
index a9177d7..e9dbe51 100644
--- a/Utilities/cmlibarchive/libarchive/archive_check_magic.c
+++ b/Utilities/cmlibarchive/libarchive/archive_check_magic.c
@@ -69,7 +69,7 @@ diediedie(void)
/* Cause a breakpoint exception */
DebugBreak();
#endif
- *(char *)0 = 1; /* Deliberately segfault and force a coredump. */
+ *(char *)1 = 1; /* Deliberately segfault and force a coredump. */
_exit(1); /* If that didn't work, just exit with an error. */
}
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c
index c097108..ecd7871 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c
@@ -813,16 +813,6 @@ archive_write_pax_header(struct archive_write *a,
add_pax_attr_w(&(pax->pax_header),
"SCHILY.acl.default", wp);
- /* Include star-compatible metadata info. */
- /* Note: "SCHILY.dev{major,minor}" are NOT the
- * major/minor portions of "SCHILY.dev". */
- add_pax_attr_int(&(pax->pax_header), "SCHILY.dev",
- archive_entry_dev(entry_main));
- add_pax_attr_int(&(pax->pax_header), "SCHILY.ino",
- archive_entry_ino64(entry_main));
- add_pax_attr_int(&(pax->pax_header), "SCHILY.nlink",
- archive_entry_nlink(entry_main));
-
/* Store extended attributes */
archive_write_pax_header_xattrs(pax, entry_original);
}
diff --git a/bootstrap b/bootstrap
index 1687776..0da868d 100755
--- a/bootstrap
+++ b/bootstrap
@@ -650,11 +650,74 @@ if ${cmake_system_haiku}; then
cmake_ld_flags="${LDFLAGS} -lroot -lbe"
fi
+#-----------------------------------------------------------------------------
+# Detect known toolchains on some platforms.
+cmake_toolchains=''
+case "${cmake_system}" in
+ *AIX*) cmake_toolchains='XL GNU' ;;
+ *CYGWIN*) cmake_toolchains='GNU' ;;
+ *Darwin*) cmake_toolchains='GNU Clang' ;;
+ *Linux*) cmake_toolchains='GNU Clang XL PGI PathScale' ;;
+ *MINGW*) cmake_toolchains='GNU' ;;
+esac
+
+# Toolchain compiler name table.
+cmake_toolchain_Clang_CC='clang'
+cmake_toolchain_Clang_CXX='clang++'
+cmake_toolchain_GNU_CC='gcc'
+cmake_toolchain_GNU_CXX='g++'
+cmake_toolchain_PGI_CC='pgcc'
+cmake_toolchain_PGI_CXX='pgCC'
+cmake_toolchain_PathScale_CC='pathcc'
+cmake_toolchain_PathScale_CXX='pathCC'
+cmake_toolchain_XL_CC='xlc'
+cmake_toolchain_XL_CXX='xlC'
+
+cmake_toolchain_try()
+{
+ tc="$1"
+ TMPFILE=`cmake_tmp_file`
+
+ eval "tc_CC=\${cmake_toolchain_${tc}_CC}"
+ echo 'int main() { return 0; }' > "${TMPFILE}.c"
+ cmake_try_run "$tc_CC" "" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1
+ tc_result_CC="$?"
+ rm -f "${TMPFILE}.c"
+ test "${tc_result_CC}" = "0" || return 1
+
+ eval "tc_CXX=\${cmake_toolchain_${tc}_CXX}"
+ echo 'int main() { return 0; }' > "${TMPFILE}.cpp"
+ cmake_try_run "$tc_CXX" "" "${TMPFILE}.cpp" >> cmake_bootstrap.log 2>&1
+ tc_result_CXX="$?"
+ rm -f "${TMPFILE}.cpp"
+ test "${tc_result_CXX}" = "0" || return 1
+
+ cmake_toolchain="$tc"
+}
+
+cmake_toolchain_detect()
+{
+ cmake_toolchain=
+ for tc in ${cmake_toolchains}; do
+ echo "Checking for $tc toolchain" >> cmake_bootstrap.log 2>&1
+ cmake_toolchain_try "$tc" &&
+ echo "Found $tc toolchain" &&
+ break
+ done
+}
+
+if [ -z "${CC}" -a -z "${CXX}" ]; then
+ cmake_toolchain_detect
+fi
+
+#-----------------------------------------------------------------------------
# Test C compiler
cmake_c_compiler=
# If CC is set, use that for compiler, otherwise use list of known compilers
-if [ -n "${CC}" ]; then
+if [ -n "${cmake_toolchain}" ]; then
+ eval cmake_c_compilers="\${cmake_toolchain_${cmake_toolchain}_CC}"
+elif [ -n "${CC}" ]; then
cmake_c_compilers="${CC}"
else
cmake_c_compilers="${CMAKE_KNOWN_C_COMPILERS}"
@@ -697,13 +760,16 @@ See cmake_bootstrap.log for compilers attempted.
fi
echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"
+#-----------------------------------------------------------------------------
# Test CXX compiler
cmake_cxx_compiler=
# On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
# If CC is set, use that for compiler, otherwise use list of known compilers
-if [ -n "${CXX}" ]; then
+if [ -n "${cmake_toolchain}" ]; then
+ eval cmake_cxx_compilers="\${cmake_toolchain_${cmake_toolchain}_CXX}"
+elif [ -n "${CXX}" ]; then
cmake_cxx_compilers="${CXX}"
else
cmake_cxx_compilers="${CMAKE_KNOWN_CXX_COMPILERS}"
@@ -754,6 +820,7 @@ See cmake_bootstrap.log for compilers attempted."
fi
echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
+#-----------------------------------------------------------------------------
# Test Make
cmake_make_processor=
@@ -772,7 +839,7 @@ mkdir "${cmake_bootstrap_dir}/${TMPFILE}"
cd "${cmake_bootstrap_dir}/${TMPFILE}"
echo '
test: test.c
- "'"${cmake_c_compiler}"'" -o test test.c
+ "'"${cmake_c_compiler}"'" '"${cmake_ld_flags} ${cmake_c_flags}"' -o test test.c
'>"Makefile"
echo '
#include <stdio.h>