summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/AddFileDependencies.cmake18
-rw-r--r--Modules/AutomocInfo.cmake.in1
-rw-r--r--Modules/BasicConfigVersion-AnyNewerVersion.cmake.in2
-rw-r--r--Modules/BasicConfigVersion-SameMajorVersion.cmake.in2
-rw-r--r--Modules/BundleUtilities.cmake154
-rw-r--r--Modules/CMakeASM-ATTInformation.cmake10
-rw-r--r--Modules/CMakeASMCompiler.cmake.in20
-rw-r--r--Modules/CMakeASMInformation.cmake152
-rw-r--r--Modules/CMakeASM_MASMInformation.cmake10
-rw-r--r--Modules/CMakeASM_NASMInformation.cmake12
-rw-r--r--Modules/CMakeAddNewLanguage.txt2
-rw-r--r--Modules/CMakeBackwardCompatibilityC.cmake86
-rw-r--r--Modules/CMakeBackwardCompatibilityCXX.cmake60
-rw-r--r--Modules/CMakeBorlandFindMake.cmake4
-rw-r--r--Modules/CMakeCCompiler.cmake.in84
-rw-r--r--Modules/CMakeCCompilerId.c.in36
-rw-r--r--Modules/CMakeCInformation.cmake210
-rw-r--r--Modules/CMakeCXXCompiler.cmake.in86
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in35
-rw-r--r--Modules/CMakeCXXInformation.cmake316
-rw-r--r--Modules/CMakeClDeps.cmake27
-rw-r--r--Modules/CMakeCommonLanguageInclude.cmake50
-rw-r--r--Modules/CMakeDependentOption.cmake48
-rw-r--r--Modules/CMakeDetermineASM-ATTCompiler.cmake8
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake214
-rw-r--r--Modules/CMakeDetermineASM_MASMCompiler.cmake16
-rw-r--r--Modules/CMakeDetermineASM_NASMCompiler.cmake14
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake224
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake236
-rw-r--r--Modules/CMakeDetermineCompiler.cmake72
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake138
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake461
-rw-r--r--Modules/CMakeDetermineFortranCompiler.cmake361
-rw-r--r--Modules/CMakeDetermineJavaCompiler.cmake92
-rw-r--r--Modules/CMakeDetermineRCCompiler.cmake76
-rw-r--r--Modules/CMakeDetermineSystem.cmake216
-rw-r--r--Modules/CMakeDetermineVSServicePack.cmake3
-rw-r--r--Modules/CMakeExpandImportedTargets.cmake28
-rw-r--r--Modules/CMakeExportBuildSettings.cmake20
-rw-r--r--Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake115
-rw-r--r--Modules/CMakeFindBinUtils.cmake56
-rw-r--r--Modules/CMakeFindCodeBlocks.cmake10
-rw-r--r--Modules/CMakeFindEclipseCDT4.cmake78
-rw-r--r--Modules/CMakeFindFrameworks.cmake26
-rw-r--r--Modules/CMakeFindKDevelop3.cmake8
-rw-r--r--Modules/CMakeFindPackageMode.cmake8
-rw-r--r--Modules/CMakeFindWMake.cmake4
-rw-r--r--Modules/CMakeFindXCode.cmake4
-rw-r--r--Modules/CMakeForceCompiler.cmake61
-rw-r--r--Modules/CMakeFortranCompiler.cmake.in92
-rw-r--r--Modules/CMakeFortranInformation.cmake292
-rw-r--r--Modules/CMakeGenericSystem.cmake102
-rw-r--r--Modules/CMakeImportBuildSettings.cmake12
-rw-r--r--Modules/CMakeJOMFindMake.cmake4
-rw-r--r--Modules/CMakeJavaCompiler.cmake.in24
-rw-r--r--Modules/CMakeJavaInformation.cmake54
-rw-r--r--Modules/CMakeMSYSFindMake.cmake6
-rw-r--r--Modules/CMakeMinGWFindMake.cmake16
-rw-r--r--Modules/CMakeNMakeFindMake.cmake4
-rw-r--r--Modules/CMakeNinjaFindMake.cmake4
-rw-r--r--Modules/CMakePackageConfigHelpers.cmake12
-rw-r--r--Modules/CMakeParseArguments.cmake14
-rw-r--r--Modules/CMakePlatformId.h.in10
-rw-r--r--Modules/CMakePrintSystemInformation.cmake46
-rw-r--r--Modules/CMakePushCheckState.cmake38
-rw-r--r--Modules/CMakeRCCompiler.cmake.in12
-rw-r--r--Modules/CMakeRCInformation.cmake30
-rw-r--r--Modules/CMakeSystem.cmake.in20
-rw-r--r--Modules/CMakeSystemSpecificInformation.cmake46
-rw-r--r--Modules/CMakeTestASM-ATTCompiler.cmake6
-rw-r--r--Modules/CMakeTestASMCompiler.cmake20
-rw-r--r--Modules/CMakeTestASM_MASMCompiler.cmake6
-rw-r--r--Modules/CMakeTestASM_NASMCompiler.cmake6
-rw-r--r--Modules/CMakeTestCCompiler.cmake90
-rw-r--r--Modules/CMakeTestCXXCompiler.cmake90
-rw-r--r--Modules/CMakeTestCompilerCommon.cmake10
-rw-r--r--Modules/CMakeTestForFreeVC.cxx3
-rw-r--r--Modules/CMakeTestFortranCompiler.cmake126
-rw-r--r--Modules/CMakeTestJavaCompiler.cmake2
-rw-r--r--Modules/CMakeTestNMakeCLVersion.c2
-rw-r--r--Modules/CMakeTestRCCompiler.cmake2
-rw-r--r--Modules/CMakeUnixFindMake.cmake4
-rw-r--r--Modules/CMakeVS10FindMake.cmake14
-rw-r--r--Modules/CMakeVS11FindMake.cmake23
-rw-r--r--Modules/CMakeVS6BackwardCompatibility.cmake20
-rw-r--r--Modules/CMakeVS6FindMake.cmake8
-rw-r--r--Modules/CMakeVS71FindMake.cmake8
-rw-r--r--Modules/CMakeVS7BackwardCompatibility.cmake20
-rw-r--r--Modules/CMakeVS7FindMake.cmake8
-rw-r--r--Modules/CMakeVS8FindMake.cmake16
-rw-r--r--Modules/CMakeVS9FindMake.cmake16
-rw-r--r--Modules/CMakeVerifyManifest.cmake16
-rw-r--r--Modules/CPack.cmake188
-rw-r--r--Modules/CPackComponent.cmake592
-rw-r--r--Modules/CPackDeb.cmake252
-rw-r--r--Modules/CPackRPM.cmake521
-rw-r--r--Modules/CPackZIP.cmake46
-rw-r--r--Modules/CTest.cmake266
-rw-r--r--Modules/CTestScriptMode.cmake2
-rw-r--r--Modules/CTestTargets.cmake78
-rw-r--r--Modules/CTestUseLaunchers.cmake49
-rw-r--r--Modules/CheckCCompilerFlag.cmake12
-rw-r--r--Modules/CheckCSourceCompiles.cmake88
-rw-r--r--Modules/CheckCSourceRuns.cmake70
-rw-r--r--Modules/CheckCXXCompilerFlag.cmake12
-rw-r--r--Modules/CheckCXXSourceCompiles.cmake88
-rw-r--r--Modules/CheckCXXSourceRuns.cmake70
-rw-r--r--Modules/CheckCXXSymbolExists.cmake6
-rw-r--r--Modules/CheckForPthreads.c2
-rw-r--r--Modules/CheckFortranFunctionExists.cmake16
-rw-r--r--Modules/CheckFunctionExists.cmake54
-rw-r--r--Modules/CheckIncludeFile.cmake68
-rw-r--r--Modules/CheckIncludeFileCXX.cmake68
-rw-r--r--Modules/CheckIncludeFiles.cmake76
-rw-r--r--Modules/CheckLibraryExists.cmake42
-rw-r--r--Modules/CheckPrototypeDefinition.cmake18
-rw-r--r--Modules/CheckSizeOf.cmake2
-rw-r--r--Modules/CheckStructHasMember.cmake16
-rw-r--r--Modules/CheckSymbolExists.cmake70
-rw-r--r--Modules/CheckTypeSize.cmake9
-rw-r--r--Modules/CheckVariableExists.cmake44
-rw-r--r--Modules/Compiler/Absoft-Fortran.cmake16
-rw-r--r--Modules/Compiler/Clang-ASM.cmake5
-rw-r--r--Modules/Compiler/Clang-C.cmake3
-rw-r--r--Modules/Compiler/Clang-CXX.cmake3
-rw-r--r--Modules/Compiler/Clang.cmake26
-rw-r--r--Modules/Compiler/GNU-Fortran.cmake10
-rw-r--r--Modules/Compiler/GNU.cmake6
-rw-r--r--Modules/Compiler/HP-ASM.cmake2
-rw-r--r--Modules/Compiler/HP-C.cmake6
-rw-r--r--Modules/Compiler/HP-CXX.cmake6
-rw-r--r--Modules/Compiler/HP-Fortran.cmake2
-rw-r--r--Modules/Compiler/Intel-ASM.cmake22
-rw-r--r--Modules/Compiler/Intel-C.cmake16
-rw-r--r--Modules/Compiler/Intel-CXX.cmake16
-rw-r--r--Modules/Compiler/Intel-Fortran.cmake14
-rw-r--r--Modules/Compiler/MIPSpro-C.cmake2
-rw-r--r--Modules/Compiler/MIPSpro-CXX.cmake2
-rw-r--r--Modules/Compiler/MIPSpro-Fortran.cmake2
-rw-r--r--Modules/Compiler/PGI-Fortran.cmake10
-rw-r--r--Modules/Compiler/PathScale-Fortran.cmake2
-rw-r--r--Modules/Compiler/SunPro-ASM.cmake30
-rw-r--r--Modules/Compiler/SunPro-C.cmake38
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake40
-rw-r--r--Modules/Compiler/SunPro-Fortran.cmake26
-rw-r--r--Modules/Compiler/TinyCC-C.cmake12
-rw-r--r--Modules/Compiler/XL-ASM.cmake14
-rw-r--r--Modules/Compiler/XL-C.cmake2
-rw-r--r--Modules/Compiler/XL-CXX.cmake4
-rw-r--r--Modules/Compiler/XL-Fortran.cmake10
-rw-r--r--Modules/CompilerId/VS-10.vcxproj.in53
-rw-r--r--Modules/CompilerId/VS-6.dsp.in48
-rw-r--r--Modules/CompilerId/VS-7.vcproj.in60
-rw-r--r--Modules/CompilerId/Xcode-1.pbxproj.in120
-rw-r--r--Modules/CompilerId/Xcode-2.pbxproj.in119
-rw-r--r--Modules/CompilerId/Xcode-3.pbxproj.in107
-rw-r--r--Modules/Dart.cmake88
-rw-r--r--Modules/DartConfiguration.tcl.in1
-rw-r--r--Modules/DeployQt4.cmake8
-rw-r--r--Modules/Documentation.cmake30
-rw-r--r--Modules/ExternalProject.cmake313
-rw-r--r--Modules/FLTKCompatibility.cmake2
-rw-r--r--Modules/FeatureSummary.cmake378
-rw-r--r--Modules/FindALSA.cmake2
-rw-r--r--Modules/FindASPELL.cmake10
-rw-r--r--Modules/FindAVIFile.cmake22
-rw-r--r--Modules/FindArmadillo.cmake13
-rw-r--r--Modules/FindBISON.cmake132
-rw-r--r--Modules/FindBLAS.cmake150
-rw-r--r--Modules/FindBZip2.cmake34
-rw-r--r--Modules/FindBoost.cmake95
-rw-r--r--Modules/FindBullet.cmake4
-rw-r--r--Modules/FindCABLE.cmake44
-rw-r--r--Modules/FindCUDA.cmake154
-rw-r--r--Modules/FindCUDA/make2cmake.cmake2
-rw-r--r--Modules/FindCUDA/parse_cubin.cmake14
-rw-r--r--Modules/FindCUDA/run_nvcc.cmake16
-rw-r--r--Modules/FindCURL.cmake44
-rw-r--r--Modules/FindCVS.cmake14
-rw-r--r--Modules/FindCoin3D.cmake72
-rw-r--r--Modules/FindCups.cmake20
-rw-r--r--Modules/FindCurses.cmake146
-rw-r--r--Modules/FindCxxTest.cmake10
-rw-r--r--Modules/FindCygwin.cmake8
-rw-r--r--Modules/FindDart.cmake26
-rw-r--r--Modules/FindDevIL.cmake22
-rw-r--r--Modules/FindDoxygen.cmake48
-rw-r--r--Modules/FindEXPAT.cmake28
-rw-r--r--Modules/FindFLEX.cmake106
-rw-r--r--Modules/FindFLTK.cmake304
-rw-r--r--Modules/FindFLTK2.cmake256
-rw-r--r--Modules/FindFreetype.cmake77
-rw-r--r--Modules/FindGCCXML.cmake4
-rw-r--r--Modules/FindGDAL.cmake26
-rw-r--r--Modules/FindGIF.cmake38
-rw-r--r--Modules/FindGLEW.cmake30
-rw-r--r--Modules/FindGLU.cmake12
-rw-r--r--Modules/FindGLUT.cmake60
-rw-r--r--Modules/FindGTK.cmake82
-rw-r--r--Modules/FindGTK2.cmake50
-rw-r--r--Modules/FindGTest.cmake2
-rw-r--r--Modules/FindGettext.cmake217
-rw-r--r--Modules/FindGit.cmake2
-rw-r--r--Modules/FindGnuTLS.cmake36
-rw-r--r--Modules/FindGnuplot.cmake26
-rw-r--r--Modules/FindHDF5.cmake62
-rw-r--r--Modules/FindHSPELL.cmake23
-rw-r--r--Modules/FindHTMLHelp.cmake20
-rw-r--r--Modules/FindHg.cmake48
-rw-r--r--Modules/FindITK.cmake42
-rw-r--r--Modules/FindImageMagick.cmake148
-rw-r--r--Modules/FindJNI.cmake204
-rw-r--r--Modules/FindJPEG.cmake26
-rw-r--r--Modules/FindJasper.cmake34
-rw-r--r--Modules/FindJava.cmake86
-rw-r--r--Modules/FindKDE3.cmake232
-rw-r--r--Modules/FindKDE4.cmake90
-rw-r--r--Modules/FindLAPACK.cmake118
-rw-r--r--Modules/FindLATEX.cmake52
-rw-r--r--Modules/FindLibLZMA.cmake37
-rw-r--r--Modules/FindLibXml2.cmake34
-rw-r--r--Modules/FindLibXslt.cmake34
-rw-r--r--Modules/FindLua50.cmake50
-rw-r--r--Modules/FindLua51.cmake44
-rw-r--r--Modules/FindMFC.cmake50
-rw-r--r--Modules/FindMPEG.cmake18
-rw-r--r--Modules/FindMPEG2.cmake26
-rw-r--r--Modules/FindMPI.cmake5
-rw-r--r--Modules/FindMatlab.cmake74
-rw-r--r--Modules/FindMotif.cmake16
-rw-r--r--Modules/FindOpenAL.cmake40
-rw-r--r--Modules/FindOpenGL.cmake130
-rw-r--r--Modules/FindOpenMP.cmake16
-rw-r--r--Modules/FindOpenSSL.cmake151
-rw-r--r--Modules/FindOpenSceneGraph.cmake100
-rw-r--r--Modules/FindOpenThreads.cmake76
-rw-r--r--Modules/FindPHP4.cmake38
-rw-r--r--Modules/FindPNG.cmake22
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake305
-rw-r--r--Modules/FindPackageMessage.cmake26
-rw-r--r--Modules/FindPerl.cmake54
-rw-r--r--Modules/FindPerlLibs.cmake32
-rw-r--r--Modules/FindPhysFS.cmake14
-rw-r--r--Modules/FindPike.cmake8
-rw-r--r--Modules/FindPkgConfig.cmake106
-rw-r--r--Modules/FindPostgreSQL.cmake20
-rw-r--r--Modules/FindProducer.cmake30
-rw-r--r--Modules/FindProtobuf.cmake4
-rw-r--r--Modules/FindPythonInterp.cmake12
-rw-r--r--Modules/FindPythonLibs.cmake238
-rw-r--r--Modules/FindQt.cmake182
-rw-r--r--Modules/FindQt3.cmake334
-rw-r--r--Modules/FindQt4.cmake995
-rw-r--r--Modules/FindQuickTime.cmake36
-rw-r--r--Modules/FindRTI.cmake57
-rw-r--r--Modules/FindRuby.cmake224
-rw-r--r--Modules/FindSDL.cmake167
-rw-r--r--Modules/FindSDL_image.cmake101
-rw-r--r--Modules/FindSDL_mixer.cmake101
-rw-r--r--Modules/FindSDL_net.cmake102
-rw-r--r--Modules/FindSDL_sound.cmake496
-rw-r--r--Modules/FindSDL_ttf.cmake101
-rw-r--r--Modules/FindSWIG.cmake54
-rw-r--r--Modules/FindSelfPackers.cmake36
-rw-r--r--Modules/FindSquish.cmake103
-rw-r--r--Modules/FindSubversion.cmake80
-rw-r--r--Modules/FindTCL.cmake158
-rw-r--r--Modules/FindTIFF.cmake28
-rw-r--r--Modules/FindTclStub.cmake92
-rw-r--r--Modules/FindTclsh.cmake58
-rw-r--r--Modules/FindThreads.cmake192
-rw-r--r--Modules/FindUnixCommands.cmake42
-rw-r--r--Modules/FindVTK.cmake116
-rw-r--r--Modules/FindWget.cmake14
-rw-r--r--Modules/FindWish.cmake58
-rw-r--r--Modules/FindX11.cmake621
-rw-r--r--Modules/FindXMLRPC.cmake142
-rw-r--r--Modules/FindZLIB.cmake68
-rw-r--r--Modules/Findosg.cmake8
-rw-r--r--Modules/FindosgAnimation.cmake8
-rw-r--r--Modules/FindosgDB.cmake8
-rw-r--r--Modules/FindosgFX.cmake8
-rw-r--r--Modules/FindosgGA.cmake8
-rw-r--r--Modules/FindosgIntrospection.cmake8
-rw-r--r--Modules/FindosgManipulator.cmake8
-rw-r--r--Modules/FindosgParticle.cmake8
-rw-r--r--Modules/FindosgProducer.cmake8
-rw-r--r--Modules/FindosgShadow.cmake8
-rw-r--r--Modules/FindosgSim.cmake8
-rw-r--r--Modules/FindosgTerrain.cmake8
-rw-r--r--Modules/FindosgText.cmake8
-rw-r--r--Modules/FindosgUtil.cmake8
-rw-r--r--Modules/FindosgViewer.cmake8
-rw-r--r--Modules/FindosgVolume.cmake8
-rw-r--r--Modules/FindosgWidget.cmake8
-rw-r--r--Modules/Findosg_functions.cmake45
-rw-r--r--Modules/FindwxWidgets.cmake748
-rw-r--r--Modules/FindwxWindows.cmake429
-rw-r--r--Modules/FortranCInterface.cmake8
-rw-r--r--Modules/FortranCInterface/Detect.cmake2
-rw-r--r--Modules/GetPrerequisites.cmake195
-rw-r--r--Modules/ITKCompatibility.cmake2
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake321
-rw-r--r--Modules/KDE3Macros.cmake399
-rw-r--r--Modules/MacroAddFileDependencies.cmake22
-rw-r--r--Modules/NSIS.template.in150
-rw-r--r--Modules/Platform/AIX.cmake20
-rw-r--r--Modules/Platform/BSDOS.cmake2
-rw-r--r--Modules/Platform/BeOS.cmake20
-rw-r--r--Modules/Platform/BlueGeneL.cmake54
-rw-r--r--Modules/Platform/CYGWIN-CXX.cmake7
-rw-r--r--Modules/Platform/CYGWIN-GNU.cmake8
-rw-r--r--Modules/Platform/CYGWIN-windres.cmake2
-rw-r--r--Modules/Platform/CYGWIN.cmake26
-rw-r--r--Modules/Platform/Catamount.cmake42
-rw-r--r--Modules/Platform/Darwin-CXX.cmake7
-rw-r--r--Modules/Platform/Darwin-Clang-C.cmake2
-rw-r--r--Modules/Platform/Darwin-Clang-CXX.cmake2
-rw-r--r--Modules/Platform/Darwin-Clang.cmake26
-rw-r--r--Modules/Platform/Darwin-GNU-C.cmake2
-rw-r--r--Modules/Platform/Darwin-GNU-CXX.cmake2
-rw-r--r--Modules/Platform/Darwin-GNU.cmake11
-rw-r--r--Modules/Platform/Darwin-XL-C.cmake6
-rw-r--r--Modules/Platform/Darwin-XL-CXX.cmake6
-rw-r--r--Modules/Platform/Darwin-icc.cmake156
-rw-r--r--Modules/Platform/Darwin-icpc.cmake6
-rw-r--r--Modules/Platform/Darwin.cmake374
-rw-r--r--Modules/Platform/DragonFly.cmake2
-rw-r--r--Modules/Platform/FreeBSD.cmake38
-rw-r--r--Modules/Platform/GNU.cmake20
-rw-r--r--Modules/Platform/Generic-ADSP-ASM.cmake8
-rw-r--r--Modules/Platform/Generic-ADSP-C.cmake20
-rw-r--r--Modules/Platform/Generic-ADSP-CXX.cmake20
-rw-r--r--Modules/Platform/Generic-ADSP-Common.cmake132
-rw-r--r--Modules/Platform/Generic-SDCC-C.cmake58
-rw-r--r--Modules/Platform/Generic.cmake10
-rw-r--r--Modules/Platform/HP-UX.cmake48
-rw-r--r--Modules/Platform/Haiku.cmake40
-rw-r--r--Modules/Platform/IRIX.cmake54
-rw-r--r--Modules/Platform/IRIX64.cmake100
-rw-r--r--Modules/Platform/Linux-CXX.cmake3
-rw-r--r--Modules/Platform/Linux-Clang-C.cmake2
-rw-r--r--Modules/Platform/Linux-Clang-CXX.cmake2
-rw-r--r--Modules/Platform/Linux-GNU-C.cmake2
-rw-r--r--Modules/Platform/Linux-GNU-CXX.cmake2
-rw-r--r--Modules/Platform/Linux-GNU-Fortran.cmake2
-rw-r--r--Modules/Platform/Linux-Intel-C.cmake2
-rw-r--r--Modules/Platform/Linux-Intel-CXX.cmake2
-rw-r--r--Modules/Platform/Linux-Intel-Fortran.cmake2
-rw-r--r--Modules/Platform/Linux-Intel.cmake2
-rw-r--r--Modules/Platform/Linux-SunPro-CXX.cmake2
-rw-r--r--Modules/Platform/Linux-TinyCC-C.cmake8
-rw-r--r--Modules/Platform/Linux-XL-C.cmake2
-rw-r--r--Modules/Platform/Linux-XL-CXX.cmake2
-rw-r--r--Modules/Platform/Linux-XL-Fortran.cmake2
-rw-r--r--Modules/Platform/Linux-como.cmake10
-rw-r--r--Modules/Platform/Linux.cmake50
-rw-r--r--Modules/Platform/MP-RAS.cmake22
-rw-r--r--Modules/Platform/NetBSD.cmake28
-rw-r--r--Modules/Platform/OSF1.cmake78
-rw-r--r--Modules/Platform/OpenBSD.cmake14
-rw-r--r--Modules/Platform/OpenVMS.cmake8
-rw-r--r--Modules/Platform/QNX.cmake38
-rw-r--r--Modules/Platform/RISCos.cmake10
-rw-r--r--Modules/Platform/SCO_SV.cmake4
-rw-r--r--Modules/Platform/SINIX.cmake8
-rw-r--r--Modules/Platform/SunOS.cmake40
-rw-r--r--Modules/Platform/Tru64.cmake2
-rw-r--r--Modules/Platform/ULTRIX.cmake10
-rw-r--r--Modules/Platform/UNIX_SV.cmake10
-rw-r--r--Modules/Platform/UnixPaths.cmake34
-rw-r--r--Modules/Platform/UnixWare.cmake10
-rw-r--r--Modules/Platform/Windows-CXX.cmake7
-rw-r--r--Modules/Platform/Windows-Embarcadero.cmake40
-rw-r--r--Modules/Platform/Windows-GNU.cmake6
-rw-r--r--Modules/Platform/Windows-Intel-Fortran.cmake10
-rw-r--r--Modules/Platform/Windows-Intel.cmake101
-rw-r--r--Modules/Platform/Windows-MSVC-C.cmake2
-rw-r--r--Modules/Platform/Windows-MSVC-CXX.cmake3
-rw-r--r--Modules/Platform/Windows-MSVC.cmake241
-rw-r--r--Modules/Platform/Windows-cl.cmake253
-rw-r--r--Modules/Platform/Windows-cl.cmake.in14
-rw-r--r--Modules/Platform/Windows-df.cmake97
-rw-r--r--Modules/Platform/Windows-wcl386.cmake159
-rw-r--r--Modules/Platform/Windows-windres.cmake2
-rw-r--r--Modules/Platform/Windows.cmake48
-rw-r--r--Modules/Platform/WindowsCE-MSVC-C.cmake1
-rw-r--r--Modules/Platform/WindowsCE-MSVC-CXX.cmake1
-rw-r--r--Modules/Platform/WindowsCE-MSVC.cmake1
-rw-r--r--Modules/Platform/WindowsCE.cmake1
-rw-r--r--Modules/Platform/WindowsPaths.cmake56
-rw-r--r--Modules/Platform/Xenix.cmake2
-rw-r--r--Modules/Platform/cl.cmake62
-rw-r--r--Modules/Platform/eCos.cmake88
-rw-r--r--Modules/Platform/gas.cmake20
-rw-r--r--Modules/Platform/kFreeBSD.cmake4
-rw-r--r--Modules/Platform/syllable.cmake28
-rw-r--r--Modules/ProcessorCount.cmake7
-rw-r--r--Modules/Qt4ConfigDependentSettings.cmake336
-rw-r--r--Modules/Qt4Macros.cmake565
-rw-r--r--Modules/SelectLibraryConfigurations.cmake48
-rw-r--r--Modules/SquishTestScript.cmake10
-rw-r--r--Modules/SystemInformation.cmake106
-rw-r--r--Modules/TestBigEndian.cmake136
-rw-r--r--Modules/TestCXXAcceptsFlag.cmake28
-rw-r--r--Modules/TestForANSIForScope.cmake26
-rw-r--r--Modules/TestForANSIStreamHeaders.cmake18
-rw-r--r--Modules/TestForAnsiForScope.cxx2
-rw-r--r--Modules/TestForSSTREAM.cmake26
-rw-r--r--Modules/TestForSSTREAM.cxx2
-rw-r--r--Modules/TestForSTDNamespace.cmake26
-rw-r--r--Modules/TestForSTDNamespace.cxx2
-rw-r--r--Modules/UseEcos.cmake190
-rw-r--r--Modules/UseJava.cmake118
-rw-r--r--Modules/UseJavaClassFilelist.cmake16
-rw-r--r--Modules/UseJavaSymlinks.cmake6
-rw-r--r--Modules/UsePkgConfig.cmake52
-rw-r--r--Modules/UseQt4.cmake150
-rw-r--r--Modules/UseSWIG.cmake264
-rw-r--r--Modules/UseVTK40.cmake8
-rw-r--r--Modules/UseVTKBuildSettings40.cmake34
-rw-r--r--Modules/UseVTKConfig40.cmake378
-rw-r--r--Modules/Use_wxWindows.cmake50
-rw-r--r--Modules/UsewxWidgets.cmake80
-rw-r--r--Modules/VTKCompatibility.cmake32
-rw-r--r--Modules/WriteBasicConfigVersionFile.cmake4
-rw-r--r--Modules/ecos_clean.cmake6
-rw-r--r--Modules/kde3uic.cmake10
-rw-r--r--Modules/readme.txt8
429 files changed, 14744 insertions, 13486 deletions
diff --git a/Modules/AddFileDependencies.cmake b/Modules/AddFileDependencies.cmake
index f971e37..e88025c 100644
--- a/Modules/AddFileDependencies.cmake
+++ b/Modules/AddFileDependencies.cmake
@@ -15,15 +15,15 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-MACRO(ADD_FILE_DEPENDENCIES _file)
+macro(ADD_FILE_DEPENDENCIES _file)
- GET_SOURCE_FILE_PROPERTY(_deps ${_file} OBJECT_DEPENDS)
- IF (_deps)
- SET(_deps ${_deps} ${ARGN})
- ELSE (_deps)
- SET(_deps ${ARGN})
- ENDIF (_deps)
+ get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
+ if (_deps)
+ set(_deps ${_deps} ${ARGN})
+ else ()
+ set(_deps ${ARGN})
+ endif ()
- SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
+ set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
-ENDMACRO(ADD_FILE_DEPENDENCIES)
+endmacro()
diff --git a/Modules/AutomocInfo.cmake.in b/Modules/AutomocInfo.cmake.in
index 13f2161..640bf70 100644
--- a/Modules/AutomocInfo.cmake.in
+++ b/Modules/AutomocInfo.cmake.in
@@ -1,7 +1,6 @@
set(AM_SOURCES @_moc_files@ )
set(AM_HEADERS @_moc_headers@ )
set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@)
-set(AM_MOC_DEFINITIONS @_moc_defs@)
set(AM_MOC_INCLUDES @_moc_incs@)
set(AM_MOC_OPTIONS @_moc_options@)
set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@")
diff --git a/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in
index 9f7f03e..b1c4fdf 100644
--- a/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in
+++ b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in
@@ -1,5 +1,5 @@
# This is a basic version file for the Config-mode of find_package().
-# It is used by WriteBasicConfigVersionFile.cmake as input file for configure_file()
+# It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file.
#
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
diff --git a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in
index 7bcea88..4acd9bb 100644
--- a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in
+++ b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in
@@ -1,5 +1,5 @@
# This is a basic version file for the Config-mode of find_package().
-# It is used by WriteBasicConfigVersionFile.cmake as input file for configure_file()
+# It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file.
#
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 0143d59..4557be6 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -184,17 +184,17 @@ function(get_bundle_main_executable bundle result_var)
if(line_is_main_executable)
string(REGEX REPLACE "^.*<string>(.*)</string>.*$" "\\1" bundle_executable "${line}")
break()
- endif(line_is_main_executable)
+ endif()
if(line MATCHES "^.*<key>CFBundleExecutable</key>.*$")
set(line_is_main_executable 1)
- endif(line MATCHES "^.*<key>CFBundleExecutable</key>.*$")
- endforeach(line)
+ endif()
+ endforeach()
if(NOT "${bundle_executable}" STREQUAL "")
if(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}")
set(result "${bundle}/Contents/MacOS/${bundle_executable}")
- else(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}")
+ else()
# Ultimate goal:
# If not in "Contents/MacOS" then scan the bundle for matching files. If
@@ -207,9 +207,9 @@ function(get_bundle_main_executable bundle result_var)
# for the bundle to be in Contents/MacOS, it's an error if it's not:
#
set(result "error: '${bundle}/Contents/MacOS/${bundle_executable}' does not exist")
- endif(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}")
- endif(NOT "${bundle_executable}" STREQUAL "")
- else(EXISTS "${bundle}/Contents/Info.plist")
+ endif()
+ endif()
+ else()
#
# More inclusive technique... (This one would work on Windows and Linux
# too, if a developer followed the typical Mac bundle naming convention...)
@@ -217,10 +217,10 @@ function(get_bundle_main_executable bundle result_var)
# If there is no Info.plist file, try to find an executable with the same
# base name as the .app directory:
#
- endif(EXISTS "${bundle}/Contents/Info.plist")
+ endif()
set(${result_var} "${result}" PARENT_SCOPE)
-endfunction(get_bundle_main_executable)
+endfunction()
function(get_dotapp_dir exe dotapp_dir_var)
@@ -240,9 +240,9 @@ function(get_dotapp_dir exe dotapp_dir_var)
if(sname MATCHES "\\.app$")
set(done 1)
set(dotapp_dir "${sdir}/${sname}")
- endif(sname MATCHES "\\.app$")
- endwhile(NOT ${done})
- else(s MATCHES "^.*/.*\\.app/.*$")
+ endif()
+ endwhile()
+ else()
# Otherwise use a directory containing the exe
# (typical of a non-bundle executable on Mac, Windows or Linux)
#
@@ -250,14 +250,14 @@ function(get_dotapp_dir exe dotapp_dir_var)
if(is_executable)
get_filename_component(sdir "${s}" PATH)
set(dotapp_dir "${sdir}")
- else(is_executable)
+ else()
set(dotapp_dir "${s}")
- endif(is_executable)
- endif(s MATCHES "^.*/.*\\.app/.*$")
+ endif()
+ endif()
set(${dotapp_dir_var} "${dotapp_dir}" PARENT_SCOPE)
-endfunction(get_dotapp_dir)
+endfunction()
function(get_bundle_and_executable app bundle_var executable_var valid_var)
@@ -273,13 +273,13 @@ function(get_bundle_and_executable app bundle_var executable_var valid_var)
set(${executable_var} "${executable}" PARENT_SCOPE)
set(valid 1)
#message(STATUS "info: handled .app directory case...")
- else(EXISTS "${app}" AND EXISTS "${executable}")
+ else()
message(STATUS "warning: *NOT* handled - .app directory case...")
- endif(EXISTS "${app}" AND EXISTS "${executable}")
- else(app MATCHES "\\.app$")
+ endif()
+ else()
message(STATUS "warning: *NOT* handled - directory but not .app case...")
- endif(app MATCHES "\\.app$")
- else(IS_DIRECTORY "${app}")
+ endif()
+ else()
# Is it an executable file?
is_file_executable("${app}" is_executable)
if(is_executable)
@@ -296,21 +296,21 @@ function(get_bundle_and_executable app bundle_var executable_var valid_var)
set(valid 1)
#message(STATUS "info: handled executable file in any dir case...")
endif()
- else(is_executable)
+ else()
message(STATUS "warning: *NOT* handled - not .app dir, not executable file...")
- endif(is_executable)
- endif(IS_DIRECTORY "${app}")
- else(EXISTS "${app}")
+ endif()
+ endif()
+ else()
message(STATUS "warning: *NOT* handled - directory/file does not exist...")
- endif(EXISTS "${app}")
+ endif()
if(NOT valid)
set(${bundle_var} "error: not a bundle" PARENT_SCOPE)
set(${executable_var} "error: not a bundle" PARENT_SCOPE)
- endif(NOT valid)
+ endif()
set(${valid_var} ${valid} PARENT_SCOPE)
-endfunction(get_bundle_and_executable)
+endfunction()
function(get_bundle_all_executables bundle exes_var)
@@ -321,11 +321,11 @@ function(get_bundle_all_executables bundle exes_var)
is_file_executable("${f}" is_executable)
if(is_executable)
set(exes ${exes} "${f}")
- endif(is_executable)
- endforeach(f)
+ endif()
+ endforeach()
set(${exes_var} "${exes}" PARENT_SCOPE)
-endfunction(get_bundle_all_executables)
+endfunction()
function(get_item_key item key_var)
@@ -335,7 +335,7 @@ function(get_item_key item key_var)
endif()
string(REGEX REPLACE "\\." "_" ${key_var} "${item_name}")
set(${key_var} ${${key_var}} PARENT_SCOPE)
-endfunction(get_item_key)
+endfunction()
function(clear_bundle_keys keys_var)
@@ -346,9 +346,9 @@ function(clear_bundle_keys keys_var)
set(${key}_EMBEDDED_ITEM PARENT_SCOPE)
set(${key}_RESOLVED_EMBEDDED_ITEM PARENT_SCOPE)
set(${key}_COPYFLAG PARENT_SCOPE)
- endforeach(key)
+ endforeach()
set(${keys_var} PARENT_SCOPE)
-endfunction(clear_bundle_keys)
+endfunction()
function(set_bundle_key_values keys_var context item exepath dirs copyflag)
@@ -370,12 +370,12 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
# opening "${item_name}.framework/" to the closing "/${item_name}":
#
string(REGEX REPLACE "^.*(${item_name}.framework/.*/${item_name}).*$" "${default_embedded_path}/\\1" embedded_item "${item}")
- else(item MATCHES "[^/]+\\.framework/")
+ else()
# For other items, just use the same name as the original, but in the
# embedded path:
#
set(embedded_item "${default_embedded_path}/${item_name}")
- endif(item MATCHES "[^/]+\\.framework/")
+ endif()
# Replace @executable_path and resolve ".." references:
#
@@ -391,7 +391,7 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
#
if(NOT copyflag)
set(resolved_embedded_item "${resolved_item}")
- endif(NOT copyflag)
+ endif()
set(${keys_var} ${${keys_var}} PARENT_SCOPE)
set(${key}_ITEM "${item}" PARENT_SCOPE)
@@ -400,10 +400,10 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
set(${key}_EMBEDDED_ITEM "${embedded_item}" PARENT_SCOPE)
set(${key}_RESOLVED_EMBEDDED_ITEM "${resolved_embedded_item}" PARENT_SCOPE)
set(${key}_COPYFLAG "${copyflag}" PARENT_SCOPE)
- else(NOT length_before EQUAL length_after)
+ else()
#message("warning: item key '${key}' already in the list, subsequent references assumed identical to first")
- endif(NOT length_before EQUAL length_after)
-endfunction(set_bundle_key_values)
+ endif()
+endfunction()
function(get_bundle_keys app libs dirs keys_var)
@@ -432,8 +432,8 @@ function(get_bundle_keys app libs dirs keys_var)
get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}")
foreach(pr ${prereqs})
set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" "${dirs}" 1)
- endforeach(pr)
- endforeach(lib)
+ endforeach()
+ endforeach()
# For each executable found in the bundle, accumulate keys as we go.
# The list of keys should be complete when all prerequisites of all
@@ -450,8 +450,8 @@ function(get_bundle_keys app libs dirs keys_var)
get_prerequisites("${exe}" prereqs 1 1 "${exepath}" "${dirs}")
foreach(pr ${prereqs})
set_bundle_key_values(${keys_var} "${exe}" "${pr}" "${exepath}" "${dirs}" 1)
- endforeach(pr)
- endforeach(exe)
+ endforeach()
+ endforeach()
# Propagate values to caller's scope:
#
@@ -463,9 +463,9 @@ function(get_bundle_keys app libs dirs keys_var)
set(${key}_EMBEDDED_ITEM "${${key}_EMBEDDED_ITEM}" PARENT_SCOPE)
set(${key}_RESOLVED_EMBEDDED_ITEM "${${key}_RESOLVED_EMBEDDED_ITEM}" PARENT_SCOPE)
set(${key}_COPYFLAG "${${key}_COPYFLAG}" PARENT_SCOPE)
- endforeach(key)
- endif(valid)
-endfunction(get_bundle_keys)
+ endforeach()
+ endif()
+endfunction()
function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
@@ -485,10 +485,10 @@ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
if(UNIX AND NOT APPLE)
file(RPATH_REMOVE FILE "${resolved_embedded_item}")
- endif(UNIX AND NOT APPLE)
+ endif()
endif()
-endfunction(copy_resolved_item_into_bundle)
+endfunction()
function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_item)
@@ -527,10 +527,10 @@ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_ite
endif()
if(UNIX AND NOT APPLE)
file(RPATH_REMOVE FILE "${resolved_embedded_item}")
- endif(UNIX AND NOT APPLE)
+ endif()
endif()
-endfunction(copy_resolved_framework_into_bundle)
+endfunction()
function(fixup_bundle_item resolved_embedded_item exepath dirs)
@@ -580,10 +580,10 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
if(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
set(changes ${changes} "-change" "${pr}" "${${rkey}_EMBEDDED_ITEM}")
- else(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
+ else()
message("warning: unexpected reference to '${pr}'")
- endif(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
- endforeach(pr)
+ endif()
+ endforeach()
if(BU_CHMOD_BUNDLE_ITEMS)
execute_process(COMMAND chmod u+w "${resolved_embedded_item}")
@@ -595,7 +595,7 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
execute_process(COMMAND install_name_tool
${changes} -id "${${ikey}_EMBEDDED_ITEM}" "${resolved_embedded_item}"
)
-endfunction(fixup_bundle_item)
+endfunction()
function(fixup_bundle app libs dirs)
@@ -620,9 +620,9 @@ function(fixup_bundle app libs dirs)
math(EXPR i ${i}+1)
if(${${key}_COPYFLAG})
message(STATUS "${i}/${n}: copying '${${key}_RESOLVED_ITEM}'")
- else(${${key}_COPYFLAG})
+ else()
message(STATUS "${i}/${n}: *NOT* copying '${${key}_RESOLVED_ITEM}'")
- endif(${${key}_COPYFLAG})
+ endif()
set(show_status 0)
if(show_status)
@@ -634,7 +634,7 @@ function(fixup_bundle app libs dirs)
message(STATUS "resolved_embedded_item='${${key}_RESOLVED_EMBEDDED_ITEM}'")
message(STATUS "copyflag='${${key}_COPYFLAG}'")
message(STATUS "")
- endif(show_status)
+ endif()
if(${${key}_COPYFLAG})
set(item "${${key}_ITEM}")
@@ -645,8 +645,8 @@ function(fixup_bundle app libs dirs)
copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
"${${key}_RESOLVED_EMBEDDED_ITEM}")
endif()
- endif(${${key}_COPYFLAG})
- endforeach(key)
+ endif()
+ endforeach()
message(STATUS "fixup_bundle: fixing...")
foreach(key ${keys})
@@ -654,28 +654,28 @@ function(fixup_bundle app libs dirs)
if(APPLE)
message(STATUS "${i}/${n}: fixing up '${${key}_RESOLVED_EMBEDDED_ITEM}'")
fixup_bundle_item("${${key}_RESOLVED_EMBEDDED_ITEM}" "${exepath}" "${dirs}")
- else(APPLE)
+ else()
message(STATUS "${i}/${n}: fix-up not required on this platform '${${key}_RESOLVED_EMBEDDED_ITEM}'")
- endif(APPLE)
- endforeach(key)
+ endif()
+ endforeach()
message(STATUS "fixup_bundle: cleaning up...")
clear_bundle_keys(keys)
message(STATUS "fixup_bundle: verifying...")
verify_app("${app}")
- else(valid)
+ else()
message(SEND_ERROR "error: fixup_bundle: not a valid bundle")
- endif(valid)
+ endif()
message(STATUS "fixup_bundle: done")
-endfunction(fixup_bundle)
+endfunction()
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)
+endfunction()
function(verify_bundle_prerequisites bundle result_var info_var)
@@ -720,23 +720,23 @@ function(verify_bundle_prerequisites bundle result_var info_var)
set(external_prereqs ${external_prereqs} "${p}")
endif()
endif()
- endforeach(p)
+ endforeach()
if(external_prereqs)
# Found non-system/somehow-unacceptable prerequisites:
set(result 0)
set(info ${info} "external prerequisites found:\nf='${f}'\nexternal_prereqs='${external_prereqs}'\n")
- endif(external_prereqs)
- endif(is_executable)
- endforeach(f)
+ endif()
+ endif()
+ endforeach()
if(result)
set(info "Verified ${count} executable files in '${bundle}'")
- endif(result)
+ endif()
set(${result_var} "${result}" PARENT_SCOPE)
set(${info_var} "${info}" PARENT_SCOPE)
-endfunction(verify_bundle_prerequisites)
+endfunction()
function(verify_bundle_symlinks bundle result_var info_var)
@@ -749,7 +749,7 @@ function(verify_bundle_symlinks bundle result_var info_var)
set(${result_var} "${result}" PARENT_SCOPE)
set(${info_var} "${info}" PARENT_SCOPE)
-endfunction(verify_bundle_symlinks)
+endfunction()
function(verify_app app)
@@ -778,9 +778,9 @@ function(verify_app app)
message(STATUS "verified='${verified}'")
message(STATUS "info='${info}'")
message(STATUS "")
- endif(verified)
+ endif()
if(NOT verified)
message(FATAL_ERROR "error: verify_app failed")
- endif(NOT verified)
-endfunction(verify_app)
+ endif()
+endfunction()
diff --git a/Modules/CMakeASM-ATTInformation.cmake b/Modules/CMakeASM-ATTInformation.cmake
index cb1f5d6..675c13b 100644
--- a/Modules/CMakeASM-ATTInformation.cmake
+++ b/Modules/CMakeASM-ATTInformation.cmake
@@ -14,12 +14,12 @@
# support for AT&T syntax assemblers, e.g. GNU as
-SET(ASM_DIALECT "-ATT")
+set(ASM_DIALECT "-ATT")
# *.S files are supposed to be preprocessed, so they should not be passed to
# assembler but should be processed by gcc
-SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;asm)
+set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;asm)
-SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
-INCLUDE(CMakeASMInformation)
-SET(ASM_DIALECT)
+include(CMakeASMInformation)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeASMCompiler.cmake.in b/Modules/CMakeASMCompiler.cmake.in
index 2dc24b0..8e58307 100644
--- a/Modules/CMakeASMCompiler.cmake.in
+++ b/Modules/CMakeASMCompiler.cmake.in
@@ -1,12 +1,12 @@
-SET(CMAKE_ASM@ASM_DIALECT@_COMPILER "@_CMAKE_ASM_COMPILER@")
-SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ARG1 "@_CMAKE_ASM_COMPILER_ARG1@")
-SET(CMAKE_AR "@CMAKE_AR@")
-SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
-SET(CMAKE_LINKER "@CMAKE_LINKER@")
-SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1)
-SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@")
-SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@")
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER "@_CMAKE_ASM_COMPILER@")
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ARG1 "@_CMAKE_ASM_COMPILER_ARG1@")
+set(CMAKE_AR "@CMAKE_AR@")
+set(CMAKE_RANLIB "@CMAKE_RANLIB@")
+set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1)
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@")
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@")
-SET(CMAKE_ASM@ASM_DIALECT@_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
-SET(CMAKE_ASM@ASM_DIALECT@_LINKER_PREFERENCE 0)
+set(CMAKE_ASM@ASM_DIALECT@_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
+set(CMAKE_ASM@ASM_DIALECT@_LINKER_PREFERENCE 0)
diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake
index b5f2420..dce1624 100644
--- a/Modules/CMakeASMInformation.cmake
+++ b/Modules/CMakeASMInformation.cmake
@@ -12,76 +12,76 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF(UNIX)
- SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
-ELSE(UNIX)
- SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
-ENDIF(UNIX)
+if(UNIX)
+ set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
+else()
+ set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
+endif()
-SET(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I
-SET(CMAKE_BASE_NAME)
-GET_FILENAME_COMPONENT(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
+set(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I
+set(CMAKE_BASE_NAME)
+get_filename_component(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
-IF("${CMAKE_BASE_NAME}" STREQUAL "as")
- SET(CMAKE_BASE_NAME gas)
-ENDIF("${CMAKE_BASE_NAME}" STREQUAL "as")
+if("${CMAKE_BASE_NAME}" STREQUAL "as")
+ set(CMAKE_BASE_NAME gas)
+endif()
# 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)
- IF("ASM${ASM_DIALECT}" STREQUAL "ASM")
- MESSAGE(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
- ENDIF("ASM${ASM_DIALECT}" STREQUAL "ASM")
- INCLUDE(Platform/${CMAKE_BASE_NAME} OPTIONAL)
-ENDIF(NOT _INCLUDED_FILE)
-
-IF(CMAKE_SYSTEM_PROCESSOR)
- 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)
-
-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_BASE_NAME} OPTIONAL)
-ENDIF(NOT _INCLUDED_FILE)
+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()
+if(NOT _INCLUDED_FILE)
+ if("ASM${ASM_DIALECT}" STREQUAL "ASM")
+ message(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
+ endif()
+ include(Platform/${CMAKE_BASE_NAME} OPTIONAL)
+endif()
+
+if(CMAKE_SYSTEM_PROCESSOR)
+ 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()
+endif()
+
+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_BASE_NAME} OPTIONAL)
+endif()
# Set default assembler file extensions:
-IF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
- SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
-ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
+if(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
+ set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
+endif()
# Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends:
-SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}")
+set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}")
# avoid just having a space as the initial value for the cache
-IF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
- SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
-ENDIF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
-SET (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
+if(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
+ set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
+endif()
+set (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
"Flags used by the assembler during all build types.")
-IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
# default build type is none
- IF(NOT CMAKE_NO_BUILD_TYPE)
- SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
+ if(NOT CMAKE_NO_BUILD_TYPE)
+ set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
"Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.")
- ENDIF(NOT CMAKE_NO_BUILD_TYPE)
- SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
+ endif()
+ set (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the assembler during debug builds.")
- SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING
+ set (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING
"Flags used by the assembler during release minsize builds.")
- SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE_INIT}" CACHE STRING
+ set (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE_INIT}" CACHE STRING
"Flags used by the assembler during release builds.")
- SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
+ set (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
"Flags used by the assembler during Release with Debug Info builds.")
-ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif()
-MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_FLAGS
+mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_FLAGS
CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG
CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL
CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE
@@ -89,42 +89,42 @@ MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_FLAGS
)
-IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
-ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
+if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+endif()
-IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
- SET(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
+if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
+ set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
"<CMAKE_RANLIB> <TARGET> ")
-ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
+endif()
-IF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
- SET(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
+if(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
+ set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
"<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
-ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
+endif()
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG)
- SET(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG})
-ENDIF()
+if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG)
+ set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG})
+endif()
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP)
- SET(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP})
-ENDIF()
+if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP)
+ set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP})
+endif()
-IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG)
- SET(CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_ASM${ASM_DIALECT}_FLAG})
-ENDIF()
+if(NOT CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG)
+ set(CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_ASM${ASM_DIALECT}_FLAG})
+endif()
# to be done
-IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
- SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
-ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
+if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
+ set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
+endif()
-IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
- SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
-ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
+if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
+ set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
+endif()
-SET(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)
+set(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)
diff --git a/Modules/CMakeASM_MASMInformation.cmake b/Modules/CMakeASM_MASMInformation.cmake
index 4e1386f..eb105ab 100644
--- a/Modules/CMakeASM_MASMInformation.cmake
+++ b/Modules/CMakeASM_MASMInformation.cmake
@@ -14,11 +14,11 @@
# support for the MS assembler, masm and masm64
-SET(ASM_DIALECT "_MASM")
+set(ASM_DIALECT "_MASM")
-SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
+set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
-SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> /c /Fo <OBJECT> <SOURCE>")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> /c /Fo <OBJECT> <SOURCE>")
-INCLUDE(CMakeASMInformation)
-SET(ASM_DIALECT)
+include(CMakeASMInformation)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeASM_NASMInformation.cmake b/Modules/CMakeASM_NASMInformation.cmake
index 9da7d30..7058fc7 100644
--- a/Modules/CMakeASM_NASMInformation.cmake
+++ b/Modules/CMakeASM_NASMInformation.cmake
@@ -19,21 +19,21 @@ set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm)
if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
if(WIN32)
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
- SET(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
else()
- SET(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
endif()
elseif(APPLE)
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
- SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
else()
- SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
endif()
else()
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
- SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
else()
- SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
endif()
endif()
endif()
diff --git a/Modules/CMakeAddNewLanguage.txt b/Modules/CMakeAddNewLanguage.txt
index 203c39d..6a30dd8 100644
--- a/Modules/CMakeAddNewLanguage.txt
+++ b/Modules/CMakeAddNewLanguage.txt
@@ -1,7 +1,7 @@
CMakeDetermine(LANG)Compiler.cmake -> this should find the compiler for LANG and configure CMake(LANG)Compiler.cmake.in
CMake(LANG)Compiler.cmake.in -> used by CMakeDetermine(LANG)Compiler.cmake
- This file is used to store compiler information and is copied down into try
+ This file is used to store compiler information and is copied down into try
compile directories so that try compiles do not need to re-determine and test the LANG
CMakeTest(LANG)Compiler.cmake -> test the compiler and set:
diff --git a/Modules/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake
index 00e5688..e3b6c82 100644
--- a/Modules/CMakeBackwardCompatibilityC.cmake
+++ b/Modules/CMakeBackwardCompatibilityC.cmake
@@ -13,28 +13,28 @@
# License text for the above reference.)
# Nothing here yet
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
- INCLUDE(CMakeVS7BackwardCompatibility)
- SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
- INCLUDE(CMakeVS6BackwardCompatibility)
- SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
-
-IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
+if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
+ include(CMakeVS7BackwardCompatibility)
+ set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
+endif()
+if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
+ include(CMakeVS6BackwardCompatibility)
+ set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
+endif()
+
+if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
# Old CMake versions did not support OS X universal binaries anyway,
# so just get through this with at least some size for the types.
- LIST(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
- IF(${NUM_ARCHS} GREATER 1)
- IF(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
- MESSAGE(WARNING "This module does not work with OS X universal binaries.")
- SET(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1)
- LIST(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
- ENDIF()
- ENDIF()
-
- INCLUDE (CheckTypeSize)
+ list(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
+ if(${NUM_ARCHS} GREATER 1)
+ if(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+ message(WARNING "This module does not work with OS X universal binaries.")
+ set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1)
+ list(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+ endif()
+ endif()
+
+ include (CheckTypeSize)
CHECK_TYPE_SIZE(int CMAKE_SIZEOF_INT)
CHECK_TYPE_SIZE(long CMAKE_SIZEOF_LONG)
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
@@ -43,52 +43,52 @@ IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
CHECK_TYPE_SIZE(float CMAKE_SIZEOF_FLOAT)
CHECK_TYPE_SIZE(double CMAKE_SIZEOF_DOUBLE)
- INCLUDE (CheckIncludeFile)
+ include (CheckIncludeFile)
CHECK_INCLUDE_FILE("limits.h" CMAKE_HAVE_LIMITS_H)
CHECK_INCLUDE_FILE("unistd.h" CMAKE_HAVE_UNISTD_H)
CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H)
- INCLUDE (CheckIncludeFiles)
+ include (CheckIncludeFiles)
CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SYS_PRCTL_H)
- INCLUDE (TestBigEndian)
+ include (TestBigEndian)
TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
- INCLUDE (FindX11)
+ include (FindX11)
- IF("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
- SET (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
- ELSE("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
- SET (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
+ if("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
+ set (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
+ else()
+ set (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
"X11 extra flags.")
- ENDIF("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
- SET (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
+ endif()
+ set (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
"Libraries and options used in X11 programs.")
- SET (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.")
+ set (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.")
- INCLUDE (FindThreads)
+ include (FindThreads)
- SET (CMAKE_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING
+ set (CMAKE_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING
"Thread library used.")
- SET (CMAKE_USE_PTHREADS "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL
+ set (CMAKE_USE_PTHREADS "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL
"Use the pthreads library.")
- SET (CMAKE_USE_WIN32_THREADS "${CMAKE_USE_WIN32_THREADS_INIT}" CACHE BOOL
+ set (CMAKE_USE_WIN32_THREADS "${CMAKE_USE_WIN32_THREADS_INIT}" CACHE BOOL
"Use the win32 thread library.")
- SET (CMAKE_HP_PTHREADS ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
+ set (CMAKE_HP_PTHREADS ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
"Use HP pthreads.")
- SET (CMAKE_USE_SPROC ${CMAKE_USE_SPROC_INIT} CACHE BOOL
+ set (CMAKE_USE_SPROC ${CMAKE_USE_SPROC_INIT} CACHE BOOL
"Use sproc libs.")
- IF(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
- SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
- SET(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
- ENDIF()
-ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
+ if(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+ set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+ set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+ endif()
+endif()
-MARK_AS_ADVANCED(
+mark_as_advanced(
CMAKE_HP_PTHREADS
CMAKE_THREAD_LIBS
CMAKE_USE_PTHREADS
diff --git a/Modules/CMakeBackwardCompatibilityCXX.cmake b/Modules/CMakeBackwardCompatibilityCXX.cmake
index 707bbde..cfc1d91 100644
--- a/Modules/CMakeBackwardCompatibilityCXX.cmake
+++ b/Modules/CMakeBackwardCompatibilityCXX.cmake
@@ -1,10 +1,10 @@
# - define a bunch of backwards compatibility variables
-# CMAKE_ANSI_CXXFLAGS - flag for ansi c++
+# CMAKE_ANSI_CXXFLAGS - flag for ansi c++
# CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
-# INCLUDE(TestForANSIStreamHeaders)
-# INCLUDE(CheckIncludeFileCXX)
-# INCLUDE(TestForSTDNamespace)
-# INCLUDE(TestForANSIForScope)
+# include(TestForANSIStreamHeaders)
+# include(CheckIncludeFileCXX)
+# include(TestForSTDNamespace)
+# include(TestForANSIForScope)
#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
@@ -19,36 +19,36 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
+if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
# check for some ANSI flags in the CXX compiler if it is not gnu
- IF(NOT CMAKE_COMPILER_IS_GNUCXX)
- INCLUDE(TestCXXAcceptsFlag)
- SET(CMAKE_TRY_ANSI_CXX_FLAGS "")
- IF(CMAKE_SYSTEM MATCHES "IRIX.*")
- SET(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std")
- ENDIF(CMAKE_SYSTEM MATCHES "IRIX.*")
- IF(CMAKE_SYSTEM MATCHES "OSF.*")
- SET(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname")
- ENDIF(CMAKE_SYSTEM MATCHES "OSF.*")
+ if(NOT CMAKE_COMPILER_IS_GNUCXX)
+ include(TestCXXAcceptsFlag)
+ set(CMAKE_TRY_ANSI_CXX_FLAGS "")
+ if(CMAKE_SYSTEM MATCHES "IRIX.*")
+ set(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std")
+ endif()
+ if(CMAKE_SYSTEM MATCHES "OSF.*")
+ set(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname")
+ endif()
# if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see
# if the compiler accepts it
- IF( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
+ if( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
CHECK_CXX_ACCEPTS_FLAG(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS)
# if the compiler liked the flag then set CMAKE_ANSI_CXXFLAGS
# to the flag
- IF(CMAKE_CXX_ACCEPTS_FLAGS)
- SET(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL
+ if(CMAKE_CXX_ACCEPTS_FLAGS)
+ set(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL
"What flags are required by the c++ compiler to make it ansi." )
- ENDIF(CMAKE_CXX_ACCEPTS_FLAGS)
- ENDIF( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
- ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
- SET(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
- INCLUDE(TestForANSIStreamHeaders)
- INCLUDE(CheckIncludeFileCXX)
- INCLUDE(TestForSTDNamespace)
- INCLUDE(TestForANSIForScope)
- INCLUDE(TestForSSTREAM)
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}")
-ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
+ endif()
+ endif()
+ endif()
+ set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
+ include(TestForANSIStreamHeaders)
+ include(CheckIncludeFileCXX)
+ include(TestForSTDNamespace)
+ include(TestForANSIForScope)
+ include(TestForSSTREAM)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}")
+endif()
diff --git a/Modules/CMakeBorlandFindMake.cmake b/Modules/CMakeBorlandFindMake.cmake
index 1ef28df..43b31c6 100644
--- a/Modules/CMakeBorlandFindMake.cmake
+++ b/Modules/CMakeBorlandFindMake.cmake
@@ -12,6 +12,6 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET (CMAKE_MAKE_PROGRAM "make" CACHE STRING
+set (CMAKE_MAKE_PROGRAM "make" CACHE STRING
"Program used to build from makefiles.")
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index ded8cf6..d74dcdc 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -1,53 +1,55 @@
-SET(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
-SET(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
-SET(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
-SET(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
-SET(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
+set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
+set(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
+set(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
+set(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
+set(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
@SET_MSVC_C_ARCHITECTURE_ID@
-SET(CMAKE_AR "@CMAKE_AR@")
-SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
-SET(CMAKE_LINKER "@CMAKE_LINKER@")
-SET(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
-SET(CMAKE_C_COMPILER_LOADED 1)
-SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
-SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
-IF(CMAKE_COMPILER_IS_CYGWIN)
- SET(CYGWIN 1)
- SET(UNIX 1)
-ENDIF(CMAKE_COMPILER_IS_CYGWIN)
-
-SET(CMAKE_C_COMPILER_ENV_VAR "CC")
-
-IF(CMAKE_COMPILER_IS_MINGW)
- SET(MINGW 1)
-ENDIF(CMAKE_COMPILER_IS_MINGW)
-SET(CMAKE_C_COMPILER_ID_RUN 1)
-SET(CMAKE_C_SOURCE_FILE_EXTENSIONS c)
-SET(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
-SET(CMAKE_C_LINKER_PREFERENCE 10)
+set(CMAKE_AR "@CMAKE_AR@")
+set(CMAKE_RANLIB "@CMAKE_RANLIB@")
+set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
+set(CMAKE_C_COMPILER_LOADED 1)
+set(CMAKE_C_COMPILER_WORKS @CMAKE_C_COMPILER_WORKS@)
+set(CMAKE_C_ABI_COMPILED @CMAKE_C_ABI_COMPILED@)
+set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
+set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
+if(CMAKE_COMPILER_IS_CYGWIN)
+ set(CYGWIN 1)
+ set(UNIX 1)
+endif()
+
+set(CMAKE_C_COMPILER_ENV_VAR "CC")
+
+if(CMAKE_COMPILER_IS_MINGW)
+ set(MINGW 1)
+endif()
+set(CMAKE_C_COMPILER_ID_RUN 1)
+set(CMAKE_C_SOURCE_FILE_EXTENSIONS c)
+set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
+set(CMAKE_C_LINKER_PREFERENCE 10)
# Save compiler ABI information.
-SET(CMAKE_C_SIZEOF_DATA_PTR "@CMAKE_C_SIZEOF_DATA_PTR@")
-SET(CMAKE_C_COMPILER_ABI "@CMAKE_C_COMPILER_ABI@")
-SET(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
+set(CMAKE_C_SIZEOF_DATA_PTR "@CMAKE_C_SIZEOF_DATA_PTR@")
+set(CMAKE_C_COMPILER_ABI "@CMAKE_C_COMPILER_ABI@")
+set(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
-IF(CMAKE_C_SIZEOF_DATA_PTR)
- SET(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
-ENDIF(CMAKE_C_SIZEOF_DATA_PTR)
+if(CMAKE_C_SIZEOF_DATA_PTR)
+ set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
+endif()
-IF(CMAKE_C_COMPILER_ABI)
- SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
-ENDIF(CMAKE_C_COMPILER_ABI)
+if(CMAKE_C_COMPILER_ABI)
+ set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
+endif()
-IF(CMAKE_C_LIBRARY_ARCHITECTURE)
- SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
-ENDIF()
+if(CMAKE_C_LIBRARY_ARCHITECTURE)
+ set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
+endif()
-SET(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@")
+@CMAKE_C_SYSROOT_FLAG_CODE@
@CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
-SET(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
-SET(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
+set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
+set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
@SET_CMAKE_CMCLDEPS_EXECUTABLE@
@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 06aa9bf..2d76c7a 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -20,6 +20,14 @@
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif
+#elif defined(__PATHCC__)
+# define COMPILER_ID "PathScale"
+# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
+# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
+# if defined(__PATHCC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
+# endif
+
#elif defined(__clang__)
# define COMPILER_ID "Clang"
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
@@ -67,6 +75,10 @@
#elif defined(__DECC)
# define COMPILER_ID "Compaq"
+ /* __DECC_VER = VVRRTPPPP */
+# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
+# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
+# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
#elif defined(__IBMC__)
# if defined(__COMPILER_VER__)
@@ -91,14 +103,17 @@
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
-#elif defined(__PATHSCALE__)
-# define COMPILER_ID "PathScale"
-
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
+# define COMPILER_VERSION_MAJOR DEC(_RELEASE)
+# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI_DSP"
+ /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
+# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
+# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
+# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__TINYC__)
# define COMPILER_ID "TinyCC"
@@ -132,9 +147,16 @@
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif
+/* Analog VisualDSP++ >= 4.5.6 */
+#elif defined(__VISUALDSPVERSION__)
+# define COMPILER_ID "ADSP"
+ /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
+# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
+# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
+# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
+
+/* Analog VisualDSP++ < 4.5.6 */
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
-/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
- SHARC (21000) DSPs */
# define COMPILER_ID "ADSP"
/* IAR Systems compiler for embedded systems.
@@ -147,6 +169,10 @@
http://sdcc.sourceforge.net */
#elif defined(SDCC)
# define COMPILER_ID "SDCC"
+ /* SDCC = VRP */
+# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
+# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(SDCC % 10)
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
# define COMPILER_ID "MIPSpro"
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index afac7a4..ce5ce44 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -20,119 +20,119 @@
# some compilers use different extensions (e.g. sdcc uses .rel)
# so set the extension here first so it can be overridden by the compiler specific file
-IF(UNIX)
- SET(CMAKE_C_OUTPUT_EXTENSION .o)
-ELSE(UNIX)
- SET(CMAKE_C_OUTPUT_EXTENSION .obj)
-ENDIF(UNIX)
+if(UNIX)
+ set(CMAKE_C_OUTPUT_EXTENSION .o)
+else()
+ set(CMAKE_C_OUTPUT_EXTENSION .obj)
+endif()
-SET(_INCLUDED_FILE 0)
+set(_INCLUDED_FILE 0)
# Load compiler-specific information.
-IF(CMAKE_C_COMPILER_ID)
- INCLUDE(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL)
-ENDIF(CMAKE_C_COMPILER_ID)
+if(CMAKE_C_COMPILER_ID)
+ include(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL)
+endif()
-SET(CMAKE_BASE_NAME)
-GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE)
-IF(CMAKE_COMPILER_IS_GNUCC)
- SET(CMAKE_BASE_NAME gcc)
-ENDIF(CMAKE_COMPILER_IS_GNUCC)
+set(CMAKE_BASE_NAME)
+get_filename_component(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE)
+if(CMAKE_COMPILER_IS_GNUCC)
+ set(CMAKE_BASE_NAME gcc)
+endif()
# load a hardware specific file, mostly useful for embedded compilers
-IF(CMAKE_SYSTEM_PROCESSOR)
- IF(CMAKE_C_COMPILER_ID)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
- ENDIF(CMAKE_C_COMPILER_ID)
- 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(CMAKE_SYSTEM_PROCESSOR)
+ if(CMAKE_C_COMPILER_ID)
+ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+ endif()
+ if (NOT _INCLUDED_FILE)
+ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+ endif ()
+endif()
# load the system- and compiler specific files
-IF(CMAKE_C_COMPILER_ID)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
+if(CMAKE_C_COMPILER_ID)
+ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-ENDIF(CMAKE_C_COMPILER_ID)
-IF (NOT _INCLUDED_FILE)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
+endif()
+if (NOT _INCLUDED_FILE)
+ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-ENDIF (NOT _INCLUDED_FILE)
+endif ()
# We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info.
# Remove this when all compiler info is removed from system files.
-IF (NOT _INCLUDED_FILE)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
-ENDIF (NOT _INCLUDED_FILE)
+if (NOT _INCLUDED_FILE)
+ include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
+endif ()
-IF(CMAKE_C_SIZEOF_DATA_PTR)
- FOREACH(f ${CMAKE_C_ABI_FILES})
- INCLUDE(${f})
- ENDFOREACH()
- UNSET(CMAKE_C_ABI_FILES)
-ENDIF()
+if(CMAKE_C_SIZEOF_DATA_PTR)
+ foreach(f ${CMAKE_C_ABI_FILES})
+ include(${f})
+ endforeach()
+ unset(CMAKE_C_ABI_FILES)
+endif()
# This should be included before the _INIT variables are
-# used to initialize the cache. Since the rule variables
+# used to initialize the cache. Since the rule variables
# have if blocks on them, users can still define them here.
# But, it should still be after the platform file so changes can
# be made to those values.
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE)
# Save the full path of the file so try_compile can use it.
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
- SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
-ENDIF()
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
+endif()
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
# Save the full path of the file so try_compile can use it.
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_C} RESULT_VARIABLE _override)
- SET(CMAKE_USER_MAKE_RULES_OVERRIDE_C "${_override}")
-ENDIF()
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE_C} RESULT_VARIABLE _override)
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE_C "${_override}")
+endif()
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
-IF(NOT CMAKE_MODULE_EXISTS)
- SET(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
- SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
-ENDIF(NOT CMAKE_MODULE_EXISTS)
-
-SET(CMAKE_C_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}")
-# avoid just having a space as the initial value for the cache
-IF(CMAKE_C_FLAGS_INIT STREQUAL " ")
- SET(CMAKE_C_FLAGS_INIT)
-ENDIF(CMAKE_C_FLAGS_INIT STREQUAL " ")
-SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
+if(NOT CMAKE_MODULE_EXISTS)
+ set(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
+ set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
+endif()
+
+set(CMAKE_C_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}")
+# avoid just having a space as the initial value for the cache
+if(CMAKE_C_FLAGS_INIT STREQUAL " ")
+ set(CMAKE_C_FLAGS_INIT)
+endif()
+set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
"Flags used by the compiler during all build types.")
-IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
# default build type is none
- IF(NOT CMAKE_NO_BUILD_TYPE)
- SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
+ if(NOT CMAKE_NO_BUILD_TYPE)
+ set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
- ENDIF(NOT CMAKE_NO_BUILD_TYPE)
- SET (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
+ endif()
+ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the compiler during debug builds.")
- SET (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING
+ set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING
"Flags used by the compiler during release minsize builds.")
- SET (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE_INIT}" CACHE STRING
+ set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE_INIT}" CACHE STRING
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
- SET (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
+ set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
"Flags used by the compiler during Release with Debug Info builds.")
-ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif()
-IF(CMAKE_C_STANDARD_LIBRARIES_INIT)
- SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}"
+if(CMAKE_C_STANDARD_LIBRARIES_INIT)
+ set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}"
CACHE STRING "Libraries linked by defalut with all C applications.")
- MARK_AS_ADVANCED(CMAKE_C_STANDARD_LIBRARIES)
-ENDIF(CMAKE_C_STANDARD_LIBRARIES_INIT)
+ mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
+endif()
-INCLUDE(CMakeCommonLanguageInclude)
+include(CMakeCommonLanguageInclude)
# now define the following rule variables
@@ -151,69 +151,69 @@ INCLUDE(CMakeCommonLanguageInclude)
# <LINK_FLAGS>
# C compiler information
-# <CMAKE_C_COMPILER>
+# <CMAKE_C_COMPILER>
# <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS>
# <CMAKE_SHARED_MODULE_CREATE_C_FLAGS>
# <CMAKE_C_LINK_FLAGS>
# Static library tools
-# <CMAKE_AR>
+# <CMAKE_AR>
# <CMAKE_RANLIB>
# create a C shared library
-IF(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
- SET(CMAKE_C_CREATE_SHARED_LIBRARY
+if(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
+ set(CMAKE_C_CREATE_SHARED_LIBRARY
"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-ENDIF(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
+endif()
# create a C shared module just copy the shared library rule
-IF(NOT CMAKE_C_CREATE_SHARED_MODULE)
- SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
-ENDIF(NOT CMAKE_C_CREATE_SHARED_MODULE)
+if(NOT CMAKE_C_CREATE_SHARED_MODULE)
+ set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
+endif()
# Create a static archive incrementally for large object file counts.
# If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these.
-IF(NOT DEFINED CMAKE_C_ARCHIVE_CREATE)
- SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
-ENDIF()
-IF(NOT DEFINED CMAKE_C_ARCHIVE_APPEND)
- SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
-ENDIF()
-IF(NOT DEFINED CMAKE_C_ARCHIVE_FINISH)
- SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
-ENDIF()
+if(NOT DEFINED CMAKE_C_ARCHIVE_CREATE)
+ set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
+endif()
+if(NOT DEFINED CMAKE_C_ARCHIVE_APPEND)
+ set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
+endif()
+if(NOT DEFINED CMAKE_C_ARCHIVE_FINISH)
+ set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
+endif()
# compile a C file into an object file
-IF(NOT CMAKE_C_COMPILE_OBJECT)
- SET(CMAKE_C_COMPILE_OBJECT
+if(NOT CMAKE_C_COMPILE_OBJECT)
+ set(CMAKE_C_COMPILE_OBJECT
"<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
-ENDIF(NOT CMAKE_C_COMPILE_OBJECT)
+endif()
-IF(NOT CMAKE_C_LINK_EXECUTABLE)
- SET(CMAKE_C_LINK_EXECUTABLE
+if(NOT CMAKE_C_LINK_EXECUTABLE)
+ set(CMAKE_C_LINK_EXECUTABLE
"<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
-ENDIF(NOT CMAKE_C_LINK_EXECUTABLE)
+endif()
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
- SET(CMAKE_EXECUTABLE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
-ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
+if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
+ set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
+endif()
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
- SET(CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
-ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
+if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
+ set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
+endif()
-IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
- SET(CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
-ENDIF(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
+if(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
+ set(CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
+endif()
-MARK_AS_ADVANCED(
+mark_as_advanced(
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
)
-SET(CMAKE_C_INFORMATION_LOADED 1)
+set(CMAKE_C_INFORMATION_LOADED 1)
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index 5b6376a..8c5d84e 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -1,54 +1,56 @@
-SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
-SET(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
-SET(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
-SET(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
-SET(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
+set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
+set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
+set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
+set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
+set(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
@SET_MSVC_CXX_ARCHITECTURE_ID@
-SET(CMAKE_AR "@CMAKE_AR@")
-SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
-SET(CMAKE_LINKER "@CMAKE_LINKER@")
-SET(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
-SET(CMAKE_CXX_COMPILER_LOADED 1)
-SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
-SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
-IF(CMAKE_COMPILER_IS_CYGWIN)
- SET(CYGWIN 1)
- SET(UNIX 1)
-ENDIF(CMAKE_COMPILER_IS_CYGWIN)
-
-SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
-
-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;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)
+set(CMAKE_AR "@CMAKE_AR@")
+set(CMAKE_RANLIB "@CMAKE_RANLIB@")
+set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
+set(CMAKE_CXX_COMPILER_LOADED 1)
+set(CMAKE_CXX_COMPILER_WORKS @CMAKE_CXX_COMPILER_WORKS@)
+set(CMAKE_CXX_ABI_COMPILED @CMAKE_CXX_ABI_COMPILED@)
+set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
+set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
+if(CMAKE_COMPILER_IS_CYGWIN)
+ set(CYGWIN 1)
+ set(UNIX 1)
+endif()
+
+set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
+
+if(CMAKE_COMPILER_IS_MINGW)
+ set(MINGW 1)
+endif()
+set(CMAKE_CXX_COMPILER_ID_RUN 1)
+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)
# Save compiler ABI information.
-SET(CMAKE_CXX_SIZEOF_DATA_PTR "@CMAKE_CXX_SIZEOF_DATA_PTR@")
-SET(CMAKE_CXX_COMPILER_ABI "@CMAKE_CXX_COMPILER_ABI@")
-SET(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
+set(CMAKE_CXX_SIZEOF_DATA_PTR "@CMAKE_CXX_SIZEOF_DATA_PTR@")
+set(CMAKE_CXX_COMPILER_ABI "@CMAKE_CXX_COMPILER_ABI@")
+set(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
-IF(CMAKE_CXX_SIZEOF_DATA_PTR)
- SET(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
-ENDIF(CMAKE_CXX_SIZEOF_DATA_PTR)
+if(CMAKE_CXX_SIZEOF_DATA_PTR)
+ set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
+endif()
-IF(CMAKE_CXX_COMPILER_ABI)
- SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
-ENDIF(CMAKE_CXX_COMPILER_ABI)
+if(CMAKE_CXX_COMPILER_ABI)
+ set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
+endif()
-IF(CMAKE_CXX_LIBRARY_ARCHITECTURE)
- SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
-ENDIF()
+if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
+ set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
+endif()
-SET(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@")
+@CMAKE_CXX_SYSROOT_FLAG_CODE@
@CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
-SET(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
-SET(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
+set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
+set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
@SET_CMAKE_CMCLDEPS_EXECUTABLE@
@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 95fc852..5e70a41 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -10,6 +10,9 @@
#if defined(__COMO__)
# define COMPILER_ID "Comeau"
+ /* __COMO_VERSION__ = VRR */
+# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
+# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
#elif defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
@@ -22,6 +25,14 @@
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif
+#elif defined(__PATHCC__)
+# define COMPILER_ID "PathScale"
+# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
+# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
+# if defined(__PATHCC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
+# endif
+
#elif defined(__clang__)
# define COMPILER_ID "Clang"
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
@@ -69,6 +80,10 @@
#elif defined(__DECCXX)
# define COMPILER_ID "Compaq"
+ /* __DECCXX_VER = VVRRTPPPP */
+# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
+# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
+# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
#elif defined(__IBMCPP__)
# if defined(__COMPILER_VER__)
@@ -93,14 +108,17 @@
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
-#elif defined(__PATHSCALE__)
-# define COMPILER_ID "PathScale"
-
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
+# define COMPILER_VERSION_MAJOR DEC(_RELEASE)
+# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI_DSP"
+ /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
+# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
+# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
+# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__SCO_VERSION__)
# define COMPILER_ID "SCO"
@@ -131,9 +149,16 @@
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif
+/* Analog VisualDSP++ >= 4.5.6 */
+#elif defined(__VISUALDSPVERSION__)
+# define COMPILER_ID "ADSP"
+ /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
+# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
+# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
+# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
+
+/* Analog VisualDSP++ < 4.5.6 */
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
-/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
- SHARC (21000) DSPs */
# define COMPILER_ID "ADSP"
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 9dc9cbd..933c15a 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -20,210 +20,210 @@
# some compilers use different extensions (e.g. sdcc uses .rel)
# so set the extension here first so it can be overridden by the compiler specific file
-IF(UNIX)
- SET(CMAKE_CXX_OUTPUT_EXTENSION .o)
-ELSE(UNIX)
- SET(CMAKE_CXX_OUTPUT_EXTENSION .obj)
-ENDIF(UNIX)
+if(UNIX)
+ set(CMAKE_CXX_OUTPUT_EXTENSION .o)
+else()
+ set(CMAKE_CXX_OUTPUT_EXTENSION .obj)
+endif()
-SET(_INCLUDED_FILE 0)
+set(_INCLUDED_FILE 0)
# Load compiler-specific information.
-IF(CMAKE_CXX_COMPILER_ID)
- INCLUDE(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL)
-ENDIF(CMAKE_CXX_COMPILER_ID)
+if(CMAKE_CXX_COMPILER_ID)
+ include(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL)
+endif()
-SET(CMAKE_BASE_NAME)
-GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
+set(CMAKE_BASE_NAME)
+get_filename_component(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
# since the gnu compiler has several names force g++
-IF(CMAKE_COMPILER_IS_GNUCXX)
- SET(CMAKE_BASE_NAME g++)
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+if(CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_BASE_NAME g++)
+endif()
# load a hardware specific file, mostly useful for embedded compilers
-IF(CMAKE_SYSTEM_PROCESSOR)
- IF(CMAKE_CXX_COMPILER_ID)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
- ENDIF(CMAKE_CXX_COMPILER_ID)
- 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(CMAKE_SYSTEM_PROCESSOR)
+ if(CMAKE_CXX_COMPILER_ID)
+ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+ endif()
+ if (NOT _INCLUDED_FILE)
+ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+ endif ()
+endif()
# load the system- and compiler specific files
-IF(CMAKE_CXX_COMPILER_ID)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-ENDIF(CMAKE_CXX_COMPILER_ID)
-IF (NOT _INCLUDED_FILE)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
+if(CMAKE_CXX_COMPILER_ID)
+ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+endif()
+if (NOT _INCLUDED_FILE)
+ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
RESULT_VARIABLE _INCLUDED_FILE)
-ENDIF (NOT _INCLUDED_FILE)
+endif ()
# We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info.
# Remove this when all compiler info is removed from system files.
-IF (NOT _INCLUDED_FILE)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
-ENDIF (NOT _INCLUDED_FILE)
+if (NOT _INCLUDED_FILE)
+ include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
+endif ()
-IF(CMAKE_CXX_SIZEOF_DATA_PTR)
- FOREACH(f ${CMAKE_CXX_ABI_FILES})
- INCLUDE(${f})
- ENDFOREACH()
- UNSET(CMAKE_CXX_ABI_FILES)
-ENDIF()
+if(CMAKE_CXX_SIZEOF_DATA_PTR)
+ foreach(f ${CMAKE_CXX_ABI_FILES})
+ include(${f})
+ endforeach()
+ unset(CMAKE_CXX_ABI_FILES)
+endif()
# This should be included before the _INIT variables are
-# used to initialize the cache. Since the rule variables
+# used to initialize the cache. Since the rule variables
# have if blocks on them, users can still define them here.
# But, it should still be after the platform file so changes can
# be made to those values.
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE)
# Save the full path of the file so try_compile can use it.
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
- SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
-ENDIF()
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
+endif()
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
# Save the full path of the file so try_compile can use it.
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} RESULT_VARIABLE _override)
- SET(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX "${_override}")
-ENDIF()
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} RESULT_VARIABLE _override)
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX "${_override}")
+endif()
# Create a set of shared library variable specific to C++
# For 90% of the systems, these are the same flags as the C versions
# so if these are not set just copy the flags from the c version
-IF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
- SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
+if(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
+ set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
+endif()
-IF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
- SET(CMAKE_CXX_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
-ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
+if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
+ set(CMAKE_CXX_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
+endif()
-IF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
- SET(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
-ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
+if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
+ set(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
+endif()
-IF(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
- SET(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
-ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
+if(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
+ set(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
+endif()
-IF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
- SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
+if(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
+ set(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
+endif()
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
- SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
-ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
+ set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
+endif()
-IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
- SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
+if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
+endif()
-IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
- SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
+if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
+endif()
-IF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
- SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
+if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
+ set(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
+endif()
-IF(NOT DEFINED CMAKE_EXE_EXPORTS_CXX_FLAG)
- SET(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
-ENDIF()
+if(NOT DEFINED CMAKE_EXE_EXPORTS_CXX_FLAG)
+ set(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
+endif()
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG)
- SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG)
+ set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
+endif()
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
- SET(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG})
-ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
+if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
+ set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG})
+endif()
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
- SET(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP})
-ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
+if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
+ set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP})
+endif()
-IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
- SET(CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG})
-ENDIF(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
+if(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
+ set(CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG})
+endif()
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
- SET(CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
-ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
+ set(CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
+endif()
-IF(NOT CMAKE_INCLUDE_FLAG_CXX)
- SET(CMAKE_INCLUDE_FLAG_CXX ${CMAKE_INCLUDE_FLAG_C})
-ENDIF(NOT CMAKE_INCLUDE_FLAG_CXX)
+if(NOT CMAKE_INCLUDE_FLAG_CXX)
+ set(CMAKE_INCLUDE_FLAG_CXX ${CMAKE_INCLUDE_FLAG_C})
+endif()
-IF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
- SET(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
-ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
+if(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
+ set(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
+endif()
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
-IF(NOT CMAKE_MODULE_EXISTS)
- SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
- SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
-ENDIF(NOT CMAKE_MODULE_EXISTS)
+if(NOT CMAKE_MODULE_EXISTS)
+ set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
+ set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
+endif()
# repeat for modules
-IF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
- SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
+if(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
+ set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
+endif()
-IF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
- SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
+if(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
+ set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
+endif()
# Initialize CXX link type selection flags from C versions.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
- IF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
- SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ if(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
+ set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
${CMAKE_${type}_LINK_STATIC_C_FLAGS})
- ENDIF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
- IF(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
- SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS
+ endif()
+ if(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
+ set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS
${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS})
- ENDIF(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
-ENDFOREACH(type)
+ endif()
+endforeach()
# add the flags to the cache based
# on the initial values computed in the platform/*.cmake files
# use _INIT variables so that this only happens the first time
# and you can set these flags in the cmake cache
-SET(CMAKE_CXX_FLAGS_INIT "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}")
-# avoid just having a space as the initial value for the cache
-IF(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
- SET(CMAKE_CXX_FLAGS_INIT)
-ENDIF(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
-SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
+set(CMAKE_CXX_FLAGS_INIT "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}")
+# avoid just having a space as the initial value for the cache
+if(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
+ set(CMAKE_CXX_FLAGS_INIT)
+endif()
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
"Flags used by the compiler during all build types.")
-IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
- SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT}" CACHE STRING
+if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the compiler during debug builds.")
- SET (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" CACHE STRING
+ set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" CACHE STRING
"Flags used by the compiler during release minsize builds.")
- SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE_INIT}" CACHE STRING
+ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE_INIT}" CACHE STRING
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
- SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
+ set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
"Flags used by the compiler during Release with Debug Info builds.")
-ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif()
-IF(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
- SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}"
+if(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
+ set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}"
CACHE STRING "Libraries linked by defalut with all C++ applications.")
- MARK_AS_ADVANCED(CMAKE_CXX_STANDARD_LIBRARIES)
-ENDIF(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
+ mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
+endif()
-INCLUDE(CMakeCommonLanguageInclude)
+include(CMakeCommonLanguageInclude)
# now define the following rules:
# CMAKE_CXX_CREATE_SHARED_LIBRARY
@@ -241,59 +241,59 @@ INCLUDE(CMakeCommonLanguageInclude)
# <LINK_FLAGS>
# CXX compiler information
-# <CMAKE_CXX_COMPILER>
+# <CMAKE_CXX_COMPILER>
# <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS>
# <CMAKE_CXX_SHARED_MODULE_CREATE_FLAGS>
# <CMAKE_CXX_LINK_FLAGS>
# Static library tools
-# <CMAKE_AR>
+# <CMAKE_AR>
# <CMAKE_RANLIB>
# create a shared C++ library
-IF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
- SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+if(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
+ set(CMAKE_CXX_CREATE_SHARED_LIBRARY
"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-ENDIF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
+endif()
# create a c++ shared module copy the shared library rule by default
-IF(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
- SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
-ENDIF(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
+if(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
+ set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
+endif()
# Create a static archive incrementally for large object file counts.
# If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these.
-IF(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE)
- SET(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
-ENDIF()
-IF(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND)
- SET(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
-ENDIF()
-IF(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH)
- SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
-ENDIF()
+if(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE)
+ set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
+endif()
+if(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND)
+ set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
+endif()
+if(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH)
+ set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
+endif()
# compile a C++ file into an object file
-IF(NOT CMAKE_CXX_COMPILE_OBJECT)
- SET(CMAKE_CXX_COMPILE_OBJECT
+if(NOT CMAKE_CXX_COMPILE_OBJECT)
+ set(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
-ENDIF(NOT CMAKE_CXX_COMPILE_OBJECT)
+endif()
-IF(NOT CMAKE_CXX_LINK_EXECUTABLE)
- SET(CMAKE_CXX_LINK_EXECUTABLE
+if(NOT CMAKE_CXX_LINK_EXECUTABLE)
+ set(CMAKE_CXX_LINK_EXECUTABLE
"<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
-ENDIF(NOT CMAKE_CXX_LINK_EXECUTABLE)
+endif()
-MARK_AS_ADVANCED(
+mark_as_advanced(
CMAKE_BUILD_TOOL
-CMAKE_VERBOSE_MAKEFILE
+CMAKE_VERBOSE_MAKEFILE
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_DEBUG)
-SET(CMAKE_CXX_INFORMATION_LOADED 1)
+set(CMAKE_CXX_INFORMATION_LOADED 1)
diff --git a/Modules/CMakeClDeps.cmake b/Modules/CMakeClDeps.cmake
index 6815e2b..0214ead 100644
--- a/Modules/CMakeClDeps.cmake
+++ b/Modules/CMakeClDeps.cmake
@@ -20,18 +20,15 @@
# in front of each include path, so it can remove it.
#
-IF(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND)
- STRING(REPLACE "cmake.exe" "cmcldeps.exe" CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND})
- SET(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
- FILE(WRITE ${showdir}/foo.h "\n")
- FILE(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
- EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
- WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE showOut)
- STRING(REPLACE main.c "" showOut1 ${showOut})
- STRING(REPLACE "/" "\\" header1 ${showdir}/foo.h)
- STRING(TOLOWER ${header1} header2)
- STRING(REPLACE ${header2} "" showOut2 ${showOut1})
- STRING(REPLACE "\n" "" showOut3 ${showOut2})
- SET(SET_CMAKE_CMCLDEPS_EXECUTABLE "SET(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
- SET(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "SET(CMAKE_CL_SHOWINCLUDE_PREFIX \"${showOut3}\")")
-ENDIF()
+if(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND)
+ string(REPLACE "cmake.exe" "cmcldeps.exe" CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND})
+ set(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
+ file(WRITE ${showdir}/foo.h "\n")
+ file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
+ execute_process(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
+ WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE outLine)
+ string(REGEX MATCH "\n([^:]*:[^:]*:[ \t]*)" tmp "${outLine}")
+ set(localizedPrefix "${CMAKE_MATCH_1}")
+ set(SET_CMAKE_CMCLDEPS_EXECUTABLE "set(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
+ set(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "set(CMAKE_CL_SHOWINCLUDE_PREFIX \"${localizedPrefix}\")")
+endif()
diff --git a/Modules/CMakeCommonLanguageInclude.cmake b/Modules/CMakeCommonLanguageInclude.cmake
index a2929f1..bf94f9f 100644
--- a/Modules/CMakeCommonLanguageInclude.cmake
+++ b/Modules/CMakeCommonLanguageInclude.cmake
@@ -16,74 +16,74 @@
# cache values that can be initialized in the platform-compiler.cmake file
# it may be included by more than one language.
-SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
+set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
CACHE STRING "Flags used by the linker.")
-IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
# default build type is none
- IF(NOT CMAKE_NO_BUILD_TYPE)
- SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
+ if(NOT CMAKE_NO_BUILD_TYPE)
+ set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
- ENDIF(NOT CMAKE_NO_BUILD_TYPE)
-
- SET (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
+ endif()
+
+ set (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
"Flags used by the linker during debug builds.")
- SET (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING
+ set (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING
"Flags used by the linker during release minsize builds.")
- SET (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
+ set (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
"Flags used by the linker during release builds.")
- SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
+ set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
"Flags used by the linker during Release with Debug Info builds.")
-
- SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
+
+ set (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
"Flags used by the linker during debug builds.")
- SET (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL ${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT}
+ set (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL ${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT}
CACHE STRING
"Flags used by the linker during release minsize builds.")
- SET (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
+ set (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
"Flags used by the linker during release builds.")
- SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
+ set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
"Flags used by the linker during Release with Debug Info builds.")
- SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG ${CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
+ set (CMAKE_MODULE_LINKER_FLAGS_DEBUG ${CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
"Flags used by the linker during debug builds.")
- SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL ${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT}
+ set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL ${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT}
CACHE STRING
"Flags used by the linker during release minsize builds.")
- SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
+ set (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
"Flags used by the linker during release builds.")
- SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
+ set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
"Flags used by the linker during Release with Debug Info builds.")
-ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif()
# shared linker flags
-SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
+set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
CACHE STRING "Flags used by the linker during the creation of dll's.")
# module linker flags
-SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
+set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
CACHE STRING "Flags used by the linker during the creation of modules.")
-SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
+set(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
"What is the target build tool cmake is generating for.")
-MARK_AS_ADVANCED(
+mark_as_advanced(
CMAKE_BUILD_TOOL
-CMAKE_VERBOSE_MAKEFILE
+CMAKE_VERBOSE_MAKEFILE
CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS_DEBUG
diff --git a/Modules/CMakeDependentOption.cmake b/Modules/CMakeDependentOption.cmake
index 8b8dc07..990728f 100644
--- a/Modules/CMakeDependentOption.cmake
+++ b/Modules/CMakeDependentOption.cmake
@@ -25,27 +25,27 @@
# (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)
- IF(${option}_ISSET MATCHES "^${option}_ISSET$")
- SET(${option}_AVAILABLE 1)
- FOREACH(d ${depends})
- STRING(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
- IF(${CMAKE_DEPENDENT_OPTION_DEP})
- ELSE(${CMAKE_DEPENDENT_OPTION_DEP})
- SET(${option}_AVAILABLE 0)
- ENDIF(${CMAKE_DEPENDENT_OPTION_DEP})
- ENDFOREACH(d)
- IF(${option}_AVAILABLE)
- OPTION(${option} "${doc}" "${default}")
- SET(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
- ELSE(${option}_AVAILABLE)
- IF(${option} MATCHES "^${option}$")
- ELSE(${option} MATCHES "^${option}$")
- SET(${option} "${${option}}" CACHE INTERNAL "${doc}")
- ENDIF(${option} MATCHES "^${option}$")
- SET(${option} ${force})
- ENDIF(${option}_AVAILABLE)
- ELSE(${option}_ISSET MATCHES "^${option}_ISSET$")
- SET(${option} "${${option}_ISSET}")
- ENDIF(${option}_ISSET MATCHES "^${option}_ISSET$")
-ENDMACRO(CMAKE_DEPENDENT_OPTION)
+macro(CMAKE_DEPENDENT_OPTION option doc default depends force)
+ if(${option}_ISSET MATCHES "^${option}_ISSET$")
+ set(${option}_AVAILABLE 1)
+ foreach(d ${depends})
+ string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
+ if(${CMAKE_DEPENDENT_OPTION_DEP})
+ else()
+ set(${option}_AVAILABLE 0)
+ endif()
+ endforeach()
+ if(${option}_AVAILABLE)
+ option(${option} "${doc}" "${default}")
+ set(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
+ else()
+ if(${option} MATCHES "^${option}$")
+ else()
+ set(${option} "${${option}}" CACHE INTERNAL "${doc}")
+ endif()
+ set(${option} ${force})
+ endif()
+ else()
+ set(${option} "${${option}_ISSET}")
+ endif()
+endmacro()
diff --git a/Modules/CMakeDetermineASM-ATTCompiler.cmake b/Modules/CMakeDetermineASM-ATTCompiler.cmake
index 9dd2f11..cec09e9 100644
--- a/Modules/CMakeDetermineASM-ATTCompiler.cmake
+++ b/Modules/CMakeDetermineASM-ATTCompiler.cmake
@@ -14,7 +14,7 @@
# determine the compiler to use for ASM using AT&T syntax, e.g. GNU as
-SET(ASM_DIALECT "-ATT")
-SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ${_CMAKE_TOOLCHAIN_PREFIX}gas ${_CMAKE_TOOLCHAIN_PREFIX}as)
-INCLUDE(CMakeDetermineASMCompiler)
-SET(ASM_DIALECT)
+set(ASM_DIALECT "-ATT")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ${_CMAKE_TOOLCHAIN_PREFIX}gas ${_CMAKE_TOOLCHAIN_PREFIX}as)
+include(CMakeDetermineASMCompiler)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 0a70d0a..9f0b30a 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -14,52 +14,40 @@
# determine the compiler to use for ASM programs
-IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
+
+if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
# prefer the environment variable ASM
- IF($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}")
- ENDIF($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
+ if($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}")
+ endif()
# finally list compilers to try
- IF("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
-
- IF(CMAKE_ASM_COMPILER_INIT)
- SET(CMAKE_ASM_COMPILER_LIST ${CMAKE_ASM_COMPILER_INIT})
- ELSE(CMAKE_ASM_COMPILER_INIT)
-
- IF(CMAKE_C_COMPILER)
- SET(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "The ASM compiler")
- SET(CMAKE_ASM_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
- ELSEIF(CMAKE_CXX_COMPILER)
- SET(CMAKE_ASM_COMPILER "${CMAKE_CXX_COMPILER}" CACHE FILEPATH "The ASM compiler")
- SET(CMAKE_ASM_COMPILER_ID "${CMAKE_CXX_COMPILER_ID}")
- ELSE(CMAKE_CXX_COMPILER)
+ if("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
+ if(NOT CMAKE_ASM_COMPILER_INIT)
+ if(CMAKE_C_COMPILER)
+ set(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "The ASM compiler")
+ set(CMAKE_ASM_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
+ elseif(CMAKE_CXX_COMPILER)
+ set(CMAKE_ASM_COMPILER "${CMAKE_CXX_COMPILER}" CACHE FILEPATH "The ASM compiler")
+ set(CMAKE_ASM_COMPILER_ID "${CMAKE_CXX_COMPILER_ID}")
+ else()
# List all default C and CXX compilers
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gcc ${_CMAKE_TOOLCHAIN_PREFIX}cc cl bcc xlc
- ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ CC aCC cl bcc xlC)
- ENDIF(CMAKE_C_COMPILER)
-
- ENDIF(CMAKE_ASM_COMPILER_INIT)
-
-
- ELSE("ASM${ASM_DIALECT}" STREQUAL "ASM") # some specific assembler "dialect"
-
- IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT})
- ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
- MESSAGE(FATAL_ERROR "CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT must be preset !")
- ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
-
- ENDIF("ASM${ASM_DIALECT}" STREQUAL "ASM")
-
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST
+ ${_CMAKE_TOOLCHAIN_PREFIX}cc ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc
+ CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC)
+ endif()
+ endif()
+ else() # some specific assembler "dialect"
+ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
+ message(FATAL_ERROR "CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT must be preset !")
+ endif()
+ endif()
# Find the compiler.
- IF (_CMAKE_USER_CXX_COMPILER_PATH OR _CMAKE_USER_C_COMPILER_PATH)
- FIND_PROGRAM(CMAKE_ASM${ASM_DIALECT}_COMPILER NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST} PATHS ${_CMAKE_USER_C_COMPILER_PATH} ${_CMAKE_USER_CXX_COMPILER_PATH} DOC "Assembler" NO_DEFAULT_PATH)
- ENDIF (_CMAKE_USER_CXX_COMPILER_PATH OR _CMAKE_USER_C_COMPILER_PATH)
- FIND_PROGRAM(CMAKE_ASM${ASM_DIALECT}_COMPILER NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST} PATHS ${_CMAKE_TOOLCHAIN_LOCATION} DOC "Assembler")
+ _cmake_find_compiler(ASM${ASM_DIALECT})
-ELSE(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
+else()
# 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
@@ -68,63 +56,63 @@ ELSE(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
# now try to find it with the full path
# 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)
- FIND_PROGRAM(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER})
- MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
- IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER ${CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH} CACHE FILEPATH "Assembler" FORCE)
- ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
- ENDIF(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
-ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
-MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_COMPILER)
+ 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)
+ find_program(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER})
+ mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
+ if(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER ${CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH} CACHE FILEPATH "Assembler" FORCE)
+ endif()
+ endif()
+endif()
+mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER)
-IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
- GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
-ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
+if (NOT _CMAKE_TOOLCHAIN_LOCATION)
+ get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
+endif ()
-IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+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)|(GCC)|(Free Software Foundation)")
+ 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)|(GCC)|(Free Software Foundation)")
- LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS HP )
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_HP "-V")
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_HP "HP C")
+ list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS HP )
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_HP "-V")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_HP "HP C")
- LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS Intel )
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Intel "--version")
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Intel "(ICC)")
+ list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS Intel )
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Intel "--version")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Intel "(ICC)")
- LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS SunPro )
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_SunPro "-V")
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_SunPro "Sun C")
+ list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS SunPro )
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_SunPro "-V")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_SunPro "Sun C")
- LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS XL )
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_XL "-qversion")
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_XL "XL C")
+ list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS XL )
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_XL "-qversion")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_XL "XL C")
- LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS MSVC )
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_MSVC "/?")
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_MSVC "Microsoft")
+ list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS MSVC )
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_MSVC "/?")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_MSVC "Microsoft")
- LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI_DSP )
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI_DSP "-h")
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI_DSP "Texas Instruments")
+ list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI_DSP )
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI_DSP "-h")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI_DSP "Texas Instruments")
- INCLUDE(CMakeDetermineCompilerId)
+ include(CMakeDetermineCompilerId)
CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
-ENDIF()
+endif()
-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)
+if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+ message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
+else()
+ message(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
+endif()
@@ -135,48 +123,48 @@ ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
# 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" 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)
- IF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
- SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
- ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
-ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
+if (NOT _CMAKE_TOOLCHAIN_PREFIX)
+ get_filename_component(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME)
+ if (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+ set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+ endif ()
+endif ()
# Now try the C compiler regexp:
-IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
- IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
- SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
- ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
-ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
+if (NOT _CMAKE_TOOLCHAIN_PREFIX)
+ if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+ set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+ endif ()
+endif ()
# Finally try the CXX compiler regexp:
-IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
- IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
- SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
- ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
-ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
+if (NOT _CMAKE_TOOLCHAIN_PREFIX)
+ if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+ set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+ endif ()
+endif ()
-INCLUDE(CMakeFindBinUtils)
+include(CMakeFindBinUtils)
-SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR "ASM${ASM_DIALECT}")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR "ASM${ASM_DIALECT}")
-IF(CMAKE_ASM${ASM_DIALECT}_COMPILER)
- MESSAGE(STATUS "Found assembler: ${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
-ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER)
- MESSAGE(STATUS "Didn't find assembler")
-ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER)
+if(CMAKE_ASM${ASM_DIALECT}_COMPILER)
+ message(STATUS "Found assembler: ${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
+else()
+ message(STATUS "Didn't find assembler")
+endif()
-SET(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
-SET(_CMAKE_ASM_COMPILER_ID "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
-SET(_CMAKE_ASM_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1}")
-SET(_CMAKE_ASM_COMPILER_ENV_VAR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR}")
+set(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
+set(_CMAKE_ASM_COMPILER_ID "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
+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
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeASM${ASM_DIALECT}Compiler.cmake IMMEDIATE @ONLY)
+configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
+ ${CMAKE_PLATFORM_INFO_DIR}/CMakeASM${ASM_DIALECT}Compiler.cmake IMMEDIATE @ONLY)
-SET(_CMAKE_ASM_COMPILER)
-SET(_CMAKE_ASM_COMPILER_ARG1)
-SET(_CMAKE_ASM_COMPILER_ENV_VAR)
+set(_CMAKE_ASM_COMPILER)
+set(_CMAKE_ASM_COMPILER_ARG1)
+set(_CMAKE_ASM_COMPILER_ENV_VAR)
diff --git a/Modules/CMakeDetermineASM_MASMCompiler.cmake b/Modules/CMakeDetermineASM_MASMCompiler.cmake
index e23f7db..665a65c 100644
--- a/Modules/CMakeDetermineASM_MASMCompiler.cmake
+++ b/Modules/CMakeDetermineASM_MASMCompiler.cmake
@@ -14,14 +14,14 @@
# Find the MS assembler (masm or masm64)
-SET(ASM_DIALECT "_MASM")
+set(ASM_DIALECT "_MASM")
# if we are using the 64bit cl compiler, assume we also want the 64bit assembler
-IF(CMAKE_CL_64)
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64)
-ELSE(CMAKE_CL_64)
- SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml)
-ENDIF(CMAKE_CL_64)
+if(CMAKE_CL_64)
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64)
+else()
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml)
+endif()
-INCLUDE(CMakeDetermineASMCompiler)
-SET(ASM_DIALECT)
+include(CMakeDetermineASMCompiler)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeDetermineASM_NASMCompiler.cmake b/Modules/CMakeDetermineASM_NASMCompiler.cmake
index d184c0a..50f71dd 100644
--- a/Modules/CMakeDetermineASM_NASMCompiler.cmake
+++ b/Modules/CMakeDetermineASM_NASMCompiler.cmake
@@ -14,14 +14,14 @@
# Find the nasm assembler. yasm (http://www.tortall.net/projects/yasm/) is nasm compatible
-SET(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm)
+set(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm)
-IF(NOT CMAKE_ASM_NASM_COMPILER)
- FIND_PROGRAM(CMAKE_ASM_NASM_COMPILER nasm
+if(NOT CMAKE_ASM_NASM_COMPILER)
+ find_program(CMAKE_ASM_NASM_COMPILER nasm
"$ENV{ProgramFiles}/NASM")
-ENDIF(NOT CMAKE_ASM_NASM_COMPILER)
+endif()
# Load the generic DetermineASM compiler file with the DIALECT set properly:
-SET(ASM_DIALECT "_NASM")
-INCLUDE(CMakeDetermineASMCompiler)
-SET(ASM_DIALECT)
+set(ASM_DIALECT "_NASM")
+include(CMakeDetermineASMCompiler)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 9028e8e..275fc47 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -31,114 +31,112 @@
# If not already set before, it also sets
# _CMAKE_TOOLCHAIN_PREFIX
-IF(NOT CMAKE_C_COMPILER)
- SET(CMAKE_C_COMPILER_INIT NOTFOUND)
-
- # prefer the environment variable CC
- IF($ENV{CC} MATCHES ".+")
- GET_FILENAME_COMPONENT(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
- IF(CMAKE_C_FLAGS_ENV_INIT)
- SET(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
- ENDIF(CMAKE_C_FLAGS_ENV_INIT)
- IF(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
- MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
- ENDIF(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
- ENDIF($ENV{CC} MATCHES ".+")
-
- # next try prefer the compiler specified by the generator
- IF(CMAKE_GENERATOR_CC)
- IF(NOT CMAKE_C_COMPILER_INIT)
- SET(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC})
- ENDIF(NOT CMAKE_C_COMPILER_INIT)
- ENDIF(CMAKE_GENERATOR_CC)
-
- # finally list compilers to try
- IF(CMAKE_C_COMPILER_INIT)
- SET(CMAKE_C_COMPILER_LIST ${CMAKE_C_COMPILER_INIT})
- ELSE(CMAKE_C_COMPILER_INIT)
- SET(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gcc ${_CMAKE_TOOLCHAIN_PREFIX}cc cl bcc xlc)
- ENDIF(CMAKE_C_COMPILER_INIT)
-
- # Find the compiler.
- IF (_CMAKE_USER_CXX_COMPILER_PATH)
- FIND_PROGRAM(CMAKE_C_COMPILER NAMES ${CMAKE_C_COMPILER_LIST} PATHS ${_CMAKE_USER_CXX_COMPILER_PATH} DOC "C compiler" NO_DEFAULT_PATH)
- ENDIF (_CMAKE_USER_CXX_COMPILER_PATH)
- FIND_PROGRAM(CMAKE_C_COMPILER NAMES ${CMAKE_C_COMPILER_LIST} DOC "C compiler")
-
- IF(CMAKE_C_COMPILER_INIT AND NOT CMAKE_C_COMPILER)
- SET(CMAKE_C_COMPILER "${CMAKE_C_COMPILER_INIT}" CACHE FILEPATH "C compiler" FORCE)
- ENDIF(CMAKE_C_COMPILER_INIT AND NOT CMAKE_C_COMPILER)
-ELSE(NOT CMAKE_C_COMPILER)
-
- # we only get here if CMAKE_C_COMPILER was specified using -D or a pre-made CMakeCache.txt
- # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
- # if CMAKE_C_COMPILER is a list of length 2, use the first item as
- # CMAKE_C_COMPILER and the 2nd one as CMAKE_C_COMPILER_ARG1
-
- LIST(LENGTH CMAKE_C_COMPILER _CMAKE_C_COMPILER_LIST_LENGTH)
- IF("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
- LIST(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1)
- LIST(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER)
- ENDIF("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
-
- # 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 not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
- # if the C compiler already had a path, reuse it for searching the CXX compiler
- GET_FILENAME_COMPONENT(_CMAKE_USER_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH)
- IF(NOT _CMAKE_USER_C_COMPILER_PATH)
- FIND_PROGRAM(CMAKE_C_COMPILER_WITH_PATH NAMES ${CMAKE_C_COMPILER})
- MARK_AS_ADVANCED(CMAKE_C_COMPILER_WITH_PATH)
- IF(CMAKE_C_COMPILER_WITH_PATH)
- SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE)
- ENDIF(CMAKE_C_COMPILER_WITH_PATH)
- ENDIF(NOT _CMAKE_USER_C_COMPILER_PATH)
-ENDIF(NOT CMAKE_C_COMPILER)
-MARK_AS_ADVANCED(CMAKE_C_COMPILER)
-
-IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
- GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
-ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
-
-# Build a small source file to identify the compiler.
-IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
- SET(CMAKE_C_COMPILER_ID_RUN 1)
- SET(CMAKE_C_PLATFORM_ID "Windows")
- SET(CMAKE_C_COMPILER_ID "MSVC")
-ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
-
-IF(NOT CMAKE_C_COMPILER_ID_RUN)
- SET(CMAKE_C_COMPILER_ID_RUN 1)
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
+
+# Load system-specific compiler preferences for this language.
+include(Platform/${CMAKE_SYSTEM_NAME}-C OPTIONAL)
+if(NOT CMAKE_C_COMPILER_NAMES)
+ set(CMAKE_C_COMPILER_NAMES cc)
+endif()
+
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
+ set(CMAKE_C_COMPILER_XCODE_TYPE sourcecode.c.c)
+else()
+ if(NOT CMAKE_C_COMPILER)
+ set(CMAKE_C_COMPILER_INIT NOTFOUND)
+
+ # prefer the environment variable CC
+ if($ENV{CC} MATCHES ".+")
+ get_filename_component(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
+ if(CMAKE_C_FLAGS_ENV_INIT)
+ set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
+ endif()
+ if(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
+ message(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
+ endif()
+ endif()
+
+ # next try prefer the compiler specified by the generator
+ if(CMAKE_GENERATOR_CC)
+ if(NOT CMAKE_C_COMPILER_INIT)
+ set(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC})
+ endif()
+ endif()
+
+ # finally list compilers to try
+ if(NOT CMAKE_C_COMPILER_INIT)
+ set(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}cc ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc clang)
+ endif()
+
+ _cmake_find_compiler(C)
+
+ else()
+
+ # we only get here if CMAKE_C_COMPILER was specified using -D or a pre-made CMakeCache.txt
+ # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
+ # if CMAKE_C_COMPILER is a list of length 2, use the first item as
+ # CMAKE_C_COMPILER and the 2nd one as CMAKE_C_COMPILER_ARG1
+
+ list(LENGTH CMAKE_C_COMPILER _CMAKE_C_COMPILER_LIST_LENGTH)
+ if("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
+ list(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1)
+ list(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER)
+ endif()
+
+ # 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 not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
+ # if the C compiler already had a path, reuse it for searching the CXX compiler
+ get_filename_component(_CMAKE_USER_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH)
+ if(NOT _CMAKE_USER_C_COMPILER_PATH)
+ find_program(CMAKE_C_COMPILER_WITH_PATH NAMES ${CMAKE_C_COMPILER})
+ mark_as_advanced(CMAKE_C_COMPILER_WITH_PATH)
+ if(CMAKE_C_COMPILER_WITH_PATH)
+ set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE)
+ endif()
+ endif()
+ endif()
+ mark_as_advanced(CMAKE_C_COMPILER)
# Each entry in this list is a set of extra flags to try
# adding to the compile line to see if it helps produce
# a valid identification file.
- SET(CMAKE_C_COMPILER_ID_TEST_FLAGS
+ set(CMAKE_C_COMPILER_ID_TEST_FLAGS
# Try compiling to an object file only.
"-c"
# Try enabling ANSI mode on HP.
"-Aa"
)
+endif()
+
+# Build a small source file to identify the compiler.
+if(NOT CMAKE_C_COMPILER_ID_RUN)
+ set(CMAKE_C_COMPILER_ID_RUN 1)
# Try to identify the compiler.
- SET(CMAKE_C_COMPILER_ID)
- FILE(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
+ set(CMAKE_C_COMPILER_ID)
+ file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
CMAKE_C_COMPILER_ID_PLATFORM_CONTENT)
- INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
+ include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
CMAKE_DETERMINE_COMPILER_ID(C CFLAGS CMakeCCompilerId.c)
# Set old compiler and platform id variables.
- IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
- SET(CMAKE_COMPILER_IS_GNUCC 1)
- ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
- IF("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
- SET(CMAKE_COMPILER_IS_MINGW 1)
- ELSEIF("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin")
- SET(CMAKE_COMPILER_IS_CYGWIN 1)
- ENDIF("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
-ENDIF(NOT CMAKE_C_COMPILER_ID_RUN)
+ if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
+ set(CMAKE_COMPILER_IS_GNUCC 1)
+ endif()
+ if("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
+ set(CMAKE_COMPILER_IS_MINGW 1)
+ elseif("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin")
+ set(CMAKE_COMPILER_IS_CYGWIN 1)
+ endif()
+endif()
+
+if (NOT _CMAKE_TOOLCHAIN_LOCATION)
+ get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
+endif ()
# If we have a gcc cross compiler, they have usually some prefix, like
# e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc, optionally
@@ -147,33 +145,31 @@ ENDIF(NOT CMAKE_C_COMPILER_ID_RUN)
# NAME_WE cannot be used since then this test will fail for names lile
# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
-IF (CMAKE_CROSSCOMPILING
+if (CMAKE_CROSSCOMPILING
AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
- GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
- IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
- SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
- ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+ get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
+ if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+ set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+ endif ()
# if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
# but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
- IF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
- SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
- ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
-
-ENDIF (CMAKE_CROSSCOMPILING
- AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
- AND NOT _CMAKE_TOOLCHAIN_PREFIX)
-
-INCLUDE(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
-INCLUDE(CMakeFindBinUtils)
-IF(MSVC_C_ARCHITECTURE_ID)
- SET(SET_MSVC_C_ARCHITECTURE_ID
- "SET(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
-ENDIF(MSVC_C_ARCHITECTURE_ID)
+ if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
+ set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+ endif ()
+
+endif ()
+
+include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
+include(CMakeFindBinUtils)
+if(MSVC_C_ARCHITECTURE_ID)
+ set(SET_MSVC_C_ARCHITECTURE_ID
+ "set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
+endif()
# configure variables set in this file for fast reload later on
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
- "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake"
+configure_file(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
+ ${CMAKE_PLATFORM_INFO_DIR}/CMakeCCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
)
-SET(CMAKE_C_COMPILER_ENV_VAR "CC")
+set(CMAKE_C_COMPILER_ENV_VAR "CC")
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 7f8f3ec..59da3e6 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -30,123 +30,109 @@
# If not already set before, it also sets
# _CMAKE_TOOLCHAIN_PREFIX
-IF(NOT CMAKE_CXX_COMPILER)
- SET(CMAKE_CXX_COMPILER_INIT NOTFOUND)
-
- # prefer the environment variable CXX
- IF($ENV{CXX} MATCHES ".+")
- GET_FILENAME_COMPONENT(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
- IF(CMAKE_CXX_FLAGS_ENV_INIT)
- SET(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
- ENDIF(CMAKE_CXX_FLAGS_ENV_INIT)
- IF(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
- MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}.\n${CMAKE_CXX_COMPILER_INIT}")
- ENDIF(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
- ENDIF($ENV{CXX} MATCHES ".+")
-
- # next prefer the generator specified compiler
- IF(CMAKE_GENERATOR_CXX)
- IF(NOT CMAKE_CXX_COMPILER_INIT)
- SET(CMAKE_CXX_COMPILER_INIT ${CMAKE_GENERATOR_CXX})
- ENDIF(NOT CMAKE_CXX_COMPILER_INIT)
- ENDIF(CMAKE_GENERATOR_CXX)
-
- # finally list compilers to try
- IF(CMAKE_CXX_COMPILER_INIT)
- SET(CMAKE_CXX_COMPILER_LIST ${CMAKE_CXX_COMPILER_INIT})
- ELSE(CMAKE_CXX_COMPILER_INIT)
- SET(CMAKE_CXX_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ CC aCC cl bcc xlC)
- ENDIF(CMAKE_CXX_COMPILER_INIT)
-
- # Find the compiler.
- IF (_CMAKE_USER_C_COMPILER_PATH)
- FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES ${CMAKE_CXX_COMPILER_LIST} PATHS ${_CMAKE_USER_C_COMPILER_PATH} DOC "C++ compiler" NO_DEFAULT_PATH)
- ENDIF (_CMAKE_USER_C_COMPILER_PATH)
- FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES ${CMAKE_CXX_COMPILER_LIST} DOC "C++ compiler")
-
- IF(CMAKE_CXX_COMPILER_INIT AND NOT CMAKE_CXX_COMPILER)
- SET(CMAKE_CXX_COMPILER "${CMAKE_CXX_COMPILER_INIT}" CACHE FILEPATH "C++ compiler" FORCE)
- ENDIF(CMAKE_CXX_COMPILER_INIT AND NOT CMAKE_CXX_COMPILER)
-ELSE(NOT CMAKE_CXX_COMPILER)
-
-# we only get here if CMAKE_CXX_COMPILER was specified using -D or a pre-made CMakeCache.txt
-# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
-#
-# if CMAKE_CXX_COMPILER is a list of length 2, use the first item as
-# CMAKE_CXX_COMPILER and the 2nd one as CMAKE_CXX_COMPILER_ARG1
-
- LIST(LENGTH CMAKE_CXX_COMPILER _CMAKE_CXX_COMPILER_LIST_LENGTH)
- IF("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
- LIST(GET CMAKE_CXX_COMPILER 1 CMAKE_CXX_COMPILER_ARG1)
- LIST(GET CMAKE_CXX_COMPILER 0 CMAKE_CXX_COMPILER)
- ENDIF("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
-
-# 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 not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
-# if the CXX compiler already had a path, reuse it for searching the C compiler
- GET_FILENAME_COMPONENT(_CMAKE_USER_CXX_COMPILER_PATH "${CMAKE_CXX_COMPILER}" PATH)
- IF(NOT _CMAKE_USER_CXX_COMPILER_PATH)
- FIND_PROGRAM(CMAKE_CXX_COMPILER_WITH_PATH NAMES ${CMAKE_CXX_COMPILER})
- MARK_AS_ADVANCED(CMAKE_CXX_COMPILER_WITH_PATH)
- IF(CMAKE_CXX_COMPILER_WITH_PATH)
- SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE)
- ENDIF(CMAKE_CXX_COMPILER_WITH_PATH)
- ENDIF(NOT _CMAKE_USER_CXX_COMPILER_PATH)
-ENDIF(NOT CMAKE_CXX_COMPILER)
-MARK_AS_ADVANCED(CMAKE_CXX_COMPILER)
-
-IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
- GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
-ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
-
-# This block was used before the compiler was identified by building a
-# source file. Unless g++ crashes when building a small C++
-# executable this should no longer be needed.
-#
-# The g++ that comes with BeOS 5 segfaults if you run "g++ -E"
-# ("gcc -E" is fine), which throws up a system dialog box that hangs cmake
-# until the user clicks "OK"...so for now, we just assume it's g++.
-# IF(BEOS)
-# SET(CMAKE_COMPILER_IS_GNUCXX 1)
-# SET(CMAKE_COMPILER_IS_GNUCXX_RUN 1)
-# ENDIF(BEOS)
-
-# Build a small source file to identify the compiler.
-IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
- SET(CMAKE_CXX_COMPILER_ID_RUN 1)
- SET(CMAKE_CXX_PLATFORM_ID "Windows")
- SET(CMAKE_CXX_COMPILER_ID "MSVC")
-ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
-IF(NOT CMAKE_CXX_COMPILER_ID_RUN)
- SET(CMAKE_CXX_COMPILER_ID_RUN 1)
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
+
+# Load system-specific compiler preferences for this language.
+include(Platform/${CMAKE_SYSTEM_NAME}-CXX OPTIONAL)
+if(NOT CMAKE_CXX_COMPILER_NAMES)
+ set(CMAKE_CXX_COMPILER_NAMES CC)
+endif()
+
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
+ set(CMAKE_CXX_COMPILER_XCODE_TYPE sourcecode.cpp.cpp)
+else()
+ if(NOT CMAKE_CXX_COMPILER)
+ set(CMAKE_CXX_COMPILER_INIT NOTFOUND)
+
+ # prefer the environment variable CXX
+ if($ENV{CXX} MATCHES ".+")
+ get_filename_component(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
+ if(CMAKE_CXX_FLAGS_ENV_INIT)
+ set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
+ endif()
+ if(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
+ message(FATAL_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}.\n${CMAKE_CXX_COMPILER_INIT}")
+ endif()
+ endif()
+
+ # next prefer the generator specified compiler
+ if(CMAKE_GENERATOR_CXX)
+ if(NOT CMAKE_CXX_COMPILER_INIT)
+ set(CMAKE_CXX_COMPILER_INIT ${CMAKE_GENERATOR_CXX})
+ endif()
+ endif()
+
+ # finally list compilers to try
+ if(NOT CMAKE_CXX_COMPILER_INIT)
+ set(CMAKE_CXX_COMPILER_LIST CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC clang++)
+ endif()
+
+ _cmake_find_compiler(CXX)
+ else()
+
+ # we only get here if CMAKE_CXX_COMPILER was specified using -D or a pre-made CMakeCache.txt
+ # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
+ #
+ # if CMAKE_CXX_COMPILER is a list of length 2, use the first item as
+ # CMAKE_CXX_COMPILER and the 2nd one as CMAKE_CXX_COMPILER_ARG1
+
+ list(LENGTH CMAKE_CXX_COMPILER _CMAKE_CXX_COMPILER_LIST_LENGTH)
+ if("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
+ list(GET CMAKE_CXX_COMPILER 1 CMAKE_CXX_COMPILER_ARG1)
+ list(GET CMAKE_CXX_COMPILER 0 CMAKE_CXX_COMPILER)
+ endif()
+
+ # 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 not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
+ # if the CXX compiler already had a path, reuse it for searching the C compiler
+ get_filename_component(_CMAKE_USER_CXX_COMPILER_PATH "${CMAKE_CXX_COMPILER}" PATH)
+ if(NOT _CMAKE_USER_CXX_COMPILER_PATH)
+ find_program(CMAKE_CXX_COMPILER_WITH_PATH NAMES ${CMAKE_CXX_COMPILER})
+ mark_as_advanced(CMAKE_CXX_COMPILER_WITH_PATH)
+ if(CMAKE_CXX_COMPILER_WITH_PATH)
+ set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE)
+ endif()
+ endif()
+ endif()
+ mark_as_advanced(CMAKE_CXX_COMPILER)
# Each entry in this list is a set of extra flags to try
# adding to the compile line to see if it helps produce
# a valid identification file.
- SET(CMAKE_CXX_COMPILER_ID_TEST_FLAGS
+ set(CMAKE_CXX_COMPILER_ID_TEST_FLAGS
# Try compiling to an object file only.
"-c"
)
+endif()
+
+# Build a small source file to identify the compiler.
+if(NOT CMAKE_CXX_COMPILER_ID_RUN)
+ set(CMAKE_CXX_COMPILER_ID_RUN 1)
# Try to identify the compiler.
- SET(CMAKE_CXX_COMPILER_ID)
- FILE(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
+ set(CMAKE_CXX_COMPILER_ID)
+ file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT)
- INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
+ include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
CMAKE_DETERMINE_COMPILER_ID(CXX CXXFLAGS CMakeCXXCompilerId.cpp)
# Set old compiler and platform id variables.
- IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
- SET(CMAKE_COMPILER_IS_GNUCXX 1)
- ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
- IF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
- SET(CMAKE_COMPILER_IS_MINGW 1)
- ELSEIF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin")
- SET(CMAKE_COMPILER_IS_CYGWIN 1)
- ENDIF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
-ENDIF(NOT CMAKE_CXX_COMPILER_ID_RUN)
+ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+ set(CMAKE_COMPILER_IS_GNUCXX 1)
+ endif()
+ if("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
+ set(CMAKE_COMPILER_IS_MINGW 1)
+ elseif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin")
+ set(CMAKE_COMPILER_IS_CYGWIN 1)
+ endif()
+endif()
+
+if (NOT _CMAKE_TOOLCHAIN_LOCATION)
+ get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
+endif ()
# if we have a g++ cross compiler, they have usually some prefix, like
# e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++ , optionally
@@ -155,34 +141,32 @@ ENDIF(NOT CMAKE_CXX_COMPILER_ID_RUN)
# NAME_WE cannot be used since then this test will fail for names lile
# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
-IF (CMAKE_CROSSCOMPILING
+if (CMAKE_CROSSCOMPILING
AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
- GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
- IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
- SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
- ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+ get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
+ if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+ set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+ endif ()
# if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
# but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
- IF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
- SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
- ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
-
-ENDIF (CMAKE_CROSSCOMPILING
- AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
- AND NOT _CMAKE_TOOLCHAIN_PREFIX)
-
-INCLUDE(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
-INCLUDE(CMakeFindBinUtils)
-IF(MSVC_CXX_ARCHITECTURE_ID)
- SET(SET_MSVC_CXX_ARCHITECTURE_ID
- "SET(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
-ENDIF(MSVC_CXX_ARCHITECTURE_ID)
+ if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
+ set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+ endif ()
+
+endif ()
+
+include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
+include(CMakeFindBinUtils)
+if(MSVC_CXX_ARCHITECTURE_ID)
+ set(SET_MSVC_CXX_ARCHITECTURE_ID
+ "set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
+endif()
# configure all variables set in this file
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
+configure_file(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
+ ${CMAKE_PLATFORM_INFO_DIR}/CMakeCXXCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
)
-SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
+set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake
new file mode 100644
index 0000000..2d12c07
--- /dev/null
+++ b/Modules/CMakeDetermineCompiler.cmake
@@ -0,0 +1,72 @@
+
+#=============================================================================
+# Copyright 2004-2012 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.)
+
+macro(_cmake_find_compiler lang)
+ # Use already-enabled languages for reference.
+ get_property(_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
+ list(REMOVE_ITEM _languages "${lang}")
+
+ if(CMAKE_${lang}_COMPILER_INIT)
+ # Search only for the specified compiler.
+ set(CMAKE_${lang}_COMPILER_LIST "${CMAKE_${lang}_COMPILER_INIT}")
+ else()
+ # Re-order the compiler list with preferred vendors first.
+ set(_${lang}_COMPILER_LIST "${CMAKE_${lang}_COMPILER_LIST}")
+ set(CMAKE_${lang}_COMPILER_LIST "")
+ # Prefer vendors of compilers from reference languages.
+ foreach(l ${_languages})
+ list(APPEND CMAKE_${lang}_COMPILER_LIST
+ ${_${lang}_COMPILER_NAMES_${CMAKE_${l}_COMPILER_ID}})
+ endforeach()
+ # Prefer vendors based on the platform.
+ list(APPEND CMAKE_${lang}_COMPILER_LIST ${CMAKE_${lang}_COMPILER_NAMES})
+ # Append the rest of the list and remove duplicates.
+ list(APPEND CMAKE_${lang}_COMPILER_LIST ${_${lang}_COMPILER_LIST})
+ unset(_${lang}_COMPILER_LIST)
+ list(REMOVE_DUPLICATES CMAKE_${lang}_COMPILER_LIST)
+ if(CMAKE_${lang}_COMPILER_EXCLUDE)
+ list(REMOVE_ITEM CMAKE_${lang}_COMPILER_LIST
+ ${CMAKE_${lang}_COMPILER_EXCLUDE})
+ endif()
+ endif()
+
+ # Look for directories containing compilers of reference languages.
+ set(_${lang}_COMPILER_HINTS)
+ foreach(l ${_languages})
+ if(CMAKE_${l}_COMPILER AND IS_ABSOLUTE "${CMAKE_${l}_COMPILER}")
+ get_filename_component(_hint "${CMAKE_${l}_COMPILER}" PATH)
+ if(IS_DIRECTORY "${_hint}")
+ list(APPEND _${lang}_COMPILER_HINTS "${_hint}")
+ endif()
+ unset(_hint)
+ endif()
+ endforeach()
+
+ # Find the compiler.
+ if(_${lang}_COMPILER_HINTS)
+ # Prefer directories containing compilers of reference languages.
+ list(REMOVE_DUPLICATES _${lang}_COMPILER_HINTS)
+ find_program(CMAKE_${lang}_COMPILER
+ NAMES ${CMAKE_${lang}_COMPILER_LIST}
+ PATHS ${_${lang}_COMPILER_HINTS}
+ NO_DEFAULT_PATH
+ DOC "${lang} compiler")
+ endif()
+ find_program(CMAKE_${lang}_COMPILER NAMES ${CMAKE_${lang}_COMPILER_LIST} DOC "${lang} compiler")
+ if(CMAKE_${lang}_COMPILER_INIT AND NOT CMAKE_${lang}_COMPILER)
+ set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER_INIT}" CACHE FILEPATH "${lang} compiler" FORCE)
+ endif()
+ unset(_${lang}_COMPILER_HINTS)
+ unset(_languages)
+endmacro()
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 1c9899e..75247d9 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -16,19 +16,19 @@
# This is used internally by CMake and should not be included by user
# code.
-INCLUDE(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
+include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
-FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
- IF(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED)
- MESSAGE(STATUS "Detecting ${lang} compiler ABI info")
+function(CMAKE_DETERMINE_COMPILER_ABI lang src)
+ if(NOT DEFINED CMAKE_${lang}_ABI_COMPILED)
+ message(STATUS "Detecting ${lang} compiler ABI info")
# Compile the ABI identification source.
- SET(BIN "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDetermineCompilerABI_${lang}.bin")
- SET(CMAKE_FLAGS )
- IF(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
- SET(CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
- ENDIF()
- TRY_COMPILE(CMAKE_DETERMINE_${lang}_ABI_COMPILED
+ set(BIN "${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerABI_${lang}.bin")
+ set(CMAKE_FLAGS )
+ if(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
+ set(CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
+ endif()
+ try_compile(CMAKE_${lang}_ABI_COMPILED
${CMAKE_BINARY_DIR} ${src}
CMAKE_FLAGS "${CMAKE_FLAGS}"
"-DCMAKE_${lang}_STANDARD_LIBRARIES="
@@ -39,42 +39,46 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
OUTPUT_VARIABLE OUTPUT
COPY_FILE "${BIN}"
)
+ # Move result from cache to normal variable.
+ set(CMAKE_${lang}_ABI_COMPILED ${CMAKE_${lang}_ABI_COMPILED})
+ unset(CMAKE_${lang}_ABI_COMPILED CACHE)
+ set(CMAKE_${lang}_ABI_COMPILED ${CMAKE_${lang}_ABI_COMPILED} PARENT_SCOPE)
# Load the resulting information strings.
- IF(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
- MESSAGE(STATUS "Detecting ${lang} compiler ABI info - done")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if(CMAKE_${lang}_ABI_COMPILED)
+ message(STATUS "Detecting ${lang} compiler ABI info - done")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n")
- FILE(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[^[]*\\[")
- FOREACH(info ${ABI_STRINGS})
- IF("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
- STRING(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}")
- ENDIF("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
- IF("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
- STRING(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}")
- ENDIF("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
- ENDFOREACH(info)
+ file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[^[]*\\[")
+ foreach(info ${ABI_STRINGS})
+ if("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
+ string(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}")
+ endif()
+ if("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
+ string(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}")
+ endif()
+ endforeach()
- IF(ABI_SIZEOF_DPTR)
- SET(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE)
- ELSEIF(CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT)
- SET(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE)
- ENDIF(ABI_SIZEOF_DPTR)
+ if(ABI_SIZEOF_DPTR)
+ set(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE)
+ elseif(CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT)
+ set(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE)
+ endif()
- IF(ABI_NAME)
- SET(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
- ENDIF(ABI_NAME)
+ if(ABI_NAME)
+ set(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
+ endif()
# Parse implicit linker information for this language, if available.
- SET(implicit_dirs "")
- SET(implicit_libs "")
- SET(MULTI_ARCH FALSE)
- IF(DEFINED CMAKE_OSX_ARCHITECTURES)
- IF( "${CMAKE_OSX_ARCHITECTURES}" MATCHES ";" )
- SET(MULTI_ARCH TRUE)
- ENDIF()
- ENDIF()
- IF(CMAKE_${lang}_VERBOSE_FLAG
+ set(implicit_dirs "")
+ set(implicit_libs "")
+ set(MULTI_ARCH FALSE)
+ if(DEFINED CMAKE_OSX_ARCHITECTURES)
+ if( "${CMAKE_OSX_ARCHITECTURES}" MATCHES ";" )
+ set(MULTI_ARCH TRUE)
+ endif()
+ endif()
+ if(CMAKE_${lang}_VERBOSE_FLAG
# Implicit link information cannot be used explicitly for
# multiple OS X architectures, so we skip it.
AND NOT MULTI_ARCH
@@ -82,50 +86,50 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
AND NOT "${CMAKE_GENERATOR}" MATCHES Xcode)
CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs log
"${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Parsed ${lang} implicit link information from above output:\n${log}\n\n")
- ENDIF()
+ endif()
# for VS IDE Intel Fortran we have to figure out the
# implicit link path for the fortran run time using
# a try-compile
- IF("${lang}" MATCHES "Fortran"
+ if("${lang}" MATCHES "Fortran"
AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
- SET(_desc "Determine Intel Fortran Compiler Implicit Link Path")
- MESSAGE(STATUS "${_desc}")
+ set(_desc "Determine Intel Fortran Compiler Implicit Link Path")
+ message(STATUS "${_desc}")
# Build a sample project which reports symbols.
- TRY_COMPILE(IFORT_LIB_PATH_COMPILED
+ try_compile(IFORT_LIB_PATH_COMPILED
${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath
${CMAKE_ROOT}/Modules/IntelVSImplicitPath
IntelFortranImplicit
CMAKE_FLAGS
"-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}"
OUTPUT_VARIABLE _output)
- FILE(WRITE
+ file(WRITE
"${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.txt"
"${_output}")
- INCLUDE(${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.cmake OPTIONAL)
- SET(_desc "Determine Intel Fortran Compiler Implicit Link Path -- done")
- MESSAGE(STATUS "${_desc}")
- ENDIF()
+ include(${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.cmake OPTIONAL)
+ set(_desc "Determine Intel Fortran Compiler Implicit Link Path -- done")
+ message(STATUS "${_desc}")
+ endif()
- SET(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "${implicit_libs}" PARENT_SCOPE)
- SET(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "${implicit_dirs}" PARENT_SCOPE)
+ set(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "${implicit_libs}" PARENT_SCOPE)
+ set(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "${implicit_dirs}" PARENT_SCOPE)
# Detect library architecture directory name.
- IF(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
- FOREACH(dir ${implicit_dirs})
- IF("${dir}" MATCHES "/lib/${CMAKE_LIBRARY_ARCHITECTURE_REGEX}$")
- GET_FILENAME_COMPONENT(arch "${dir}" NAME)
- SET(CMAKE_${lang}_LIBRARY_ARCHITECTURE "${arch}" PARENT_SCOPE)
- BREAK()
- ENDIF()
- ENDFOREACH()
- ENDIF()
+ if(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
+ foreach(dir ${implicit_dirs})
+ if("${dir}" MATCHES "/lib/${CMAKE_LIBRARY_ARCHITECTURE_REGEX}$")
+ get_filename_component(arch "${dir}" NAME)
+ set(CMAKE_${lang}_LIBRARY_ARCHITECTURE "${arch}" PARENT_SCOPE)
+ break()
+ endif()
+ endforeach()
+ endif()
- ELSE(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
- MESSAGE(STATUS "Detecting ${lang} compiler ABI info - failed")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ else()
+ message(STATUS "Detecting ${lang} compiler ABI info - failed")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n\n")
- ENDIF(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
- ENDIF(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED)
-ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ABI)
+ endif()
+ endif()
+endfunction()
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 67f5a59..906a5e7 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -16,116 +16,231 @@
# used internally by CMake and should not be included by user code.
# If successful, sets CMAKE_<lang>_COMPILER_ID and CMAKE_<lang>_PLATFORM_ID
-FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
+function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
# Make sure the compiler arguments are clean.
- STRING(STRIP "${CMAKE_${lang}_COMPILER_ARG1}" CMAKE_${lang}_COMPILER_ID_ARG1)
- STRING(REGEX REPLACE " +" ";" CMAKE_${lang}_COMPILER_ID_ARG1 "${CMAKE_${lang}_COMPILER_ID_ARG1}")
+ string(STRIP "${CMAKE_${lang}_COMPILER_ARG1}" CMAKE_${lang}_COMPILER_ID_ARG1)
+ string(REGEX REPLACE " +" ";" CMAKE_${lang}_COMPILER_ID_ARG1 "${CMAKE_${lang}_COMPILER_ID_ARG1}")
# Make sure user-specified compiler flags are used.
- IF(CMAKE_${lang}_FLAGS)
- SET(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS})
- ELSE(CMAKE_${lang}_FLAGS)
- SET(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
- ENDIF(CMAKE_${lang}_FLAGS)
- STRING(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
+ if(CMAKE_${lang}_FLAGS)
+ set(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS})
+ else()
+ set(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
+ endif()
+ string(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
# Compute the directory in which to run the test.
- SET(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
+ set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_PLATFORM_INFO_DIR}/CompilerId${lang})
# Try building with no extra flags and then try each set
# of helper flags. Stop when the compiler is identified.
- FOREACH(flags "" ${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS})
- IF(NOT CMAKE_${lang}_COMPILER_ID)
+ foreach(flags "" ${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS})
+ if(NOT CMAKE_${lang}_COMPILER_ID)
CMAKE_DETERMINE_COMPILER_ID_BUILD("${lang}" "${flags}" "${src}")
- FOREACH(file ${COMPILER_${lang}_PRODUCED_FILES})
+ foreach(file ${COMPILER_${lang}_PRODUCED_FILES})
CMAKE_DETERMINE_COMPILER_ID_CHECK("${lang}" "${CMAKE_${lang}_COMPILER_ID_DIR}/${file}" "${src}")
- ENDFOREACH(file)
- ENDIF(NOT CMAKE_${lang}_COMPILER_ID)
- ENDFOREACH(flags)
+ endforeach()
+ endif()
+ endforeach()
# If the compiler is still unknown, try to query its vendor.
- IF(NOT CMAKE_${lang}_COMPILER_ID)
+ if(NOT CMAKE_${lang}_COMPILER_ID)
CMAKE_DETERMINE_COMPILER_ID_VENDOR(${lang})
- ENDIF()
+ endif()
# if the format is unknown after all files have been checked, put "Unknown" in the cache
- IF(NOT CMAKE_EXECUTABLE_FORMAT)
- SET(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
- ENDIF(NOT CMAKE_EXECUTABLE_FORMAT)
+ if(NOT CMAKE_EXECUTABLE_FORMAT)
+ set(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
+ endif()
# Display the final identification result.
- IF(CMAKE_${lang}_COMPILER_ID)
- IF(CMAKE_${lang}_COMPILER_VERSION)
- SET(_version " ${CMAKE_${lang}_COMPILER_VERSION}")
- ELSE()
- SET(_version "")
- ENDIF()
- MESSAGE(STATUS "The ${lang} compiler identification is "
+ if(CMAKE_${lang}_COMPILER_ID)
+ if(CMAKE_${lang}_COMPILER_VERSION)
+ set(_version " ${CMAKE_${lang}_COMPILER_VERSION}")
+ else()
+ set(_version "")
+ endif()
+ message(STATUS "The ${lang} compiler identification is "
"${CMAKE_${lang}_COMPILER_ID}${_version}")
- ELSE(CMAKE_${lang}_COMPILER_ID)
- MESSAGE(STATUS "The ${lang} compiler identification is unknown")
- ENDIF(CMAKE_${lang}_COMPILER_ID)
-
- 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}"
+ else()
+ message(STATUS "The ${lang} compiler identification is unknown")
+ endif()
+
+ # Check if compiler id detection gave us the compiler tool.
+ if(NOT CMAKE_${lang}_COMPILER)
+ if(CMAKE_${lang}_COMPILER_ID_TOOL)
+ set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER_ID_TOOL}" PARENT_SCOPE)
+ else()
+ set(CMAKE_${lang}_COMPILER "CMAKE_${lang}_COMPILER-NOTFOUND" PARENT_SCOPE)
+ endif()
+ endif()
+
+ 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}"
PARENT_SCOPE)
- SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
-ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID)
+ set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
+endfunction()
#-----------------------------------------------------------------------------
# Function to write the compiler id source file.
-FUNCTION(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src)
- FILE(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN)
- STRING(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY)
- FILE(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}")
-ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_WRITE)
+function(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src)
+ file(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN)
+ string(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY)
+ file(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}")
+endfunction()
#-----------------------------------------------------------------------------
# Function to build the compiler id source file and look for output
# files.
-FUNCTION(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
+function(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
# Create a clean working directory.
- FILE(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
- FILE(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
+ file(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
+ file(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
CMAKE_DETERMINE_COMPILER_ID_WRITE("${lang}" "${src}")
# Construct a description of this test case.
- SET(COMPILER_DESCRIPTION
+ set(COMPILER_DESCRIPTION
"Compiler: ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_ARG1}
Build flags: ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
Id flags: ${testflags}
")
# Compile the compiler identification source.
- IF(COMMAND EXECUTE_PROCESS)
- EXECUTE_PROCESS(
- COMMAND ${CMAKE_${lang}_COMPILER}
- ${CMAKE_${lang}_COMPILER_ID_ARG1}
- ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
- ${testflags}
- "${src}"
+ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([0-9]+)( .NET)?( 200[358])? *((Win64|IA64|ARM))?")
+ set(vs_version ${CMAKE_MATCH_1})
+ set(vs_arch ${CMAKE_MATCH_4})
+ set(id_lang "${lang}")
+ set(id_cl cl.exe)
+ if(NOT "${vs_version}" VERSION_LESS 10)
+ set(v 10)
+ set(ext vcxproj)
+ elseif(NOT "${vs_version}" VERSION_LESS 7)
+ set(id_version ${vs_version}.00)
+ set(v 7)
+ set(ext vcproj)
+ else()
+ set(v 6)
+ set(ext dsp)
+ endif()
+ if("${vs_arch}" STREQUAL "Win64")
+ set(id_machine_7 17)
+ set(id_machine_10 MachineX64)
+ set(id_arch x64)
+ elseif("${vs_arch}" STREQUAL "IA64")
+ set(id_machine_7 5)
+ set(id_machine_10 MachineIA64)
+ set(id_arch ia64)
+ else()
+ set(id_machine_6 x86)
+ set(id_machine_7 1)
+ set(id_machine_10 MachineX86)
+ set(id_arch Win32)
+ endif()
+ if(CMAKE_VS_PLATFORM_TOOLSET)
+ set(id_toolset "<PlatformToolset>${CMAKE_VS_PLATFORM_TOOLSET}</PlatformToolset>")
+ else()
+ set(id_toolset "")
+ endif()
+ if("${CMAKE_MAKE_PROGRAM}" MATCHES "[Mm][Ss][Bb][Uu][Ii][Ll][Dd]")
+ set(build /p:Configuration=Debug /p:Platform=@id_arch@ /p:VisualStudioVersion=${vs_version}.0)
+ elseif("${CMAKE_MAKE_PROGRAM}" MATCHES "[Mm][Ss][Dd][Ee][Vv]")
+ set(build /make)
+ else()
+ set(build /build Debug)
+ endif()
+ set(id_dir ${CMAKE_${lang}_COMPILER_ID_DIR})
+ get_filename_component(id_src "${src}" NAME)
+ configure_file(${CMAKE_ROOT}/Modules/CompilerId/VS-${v}.${ext}.in
+ ${id_dir}/CompilerId${lang}.${ext} @ONLY IMMEDIATE)
+ execute_process(
+ COMMAND ${CMAKE_MAKE_PROGRAM} CompilerId${lang}.${ext} ${build}
WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
)
- ELSE(COMMAND EXECUTE_PROCESS)
- EXEC_PROGRAM(
- ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_DIR}
- ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
- ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
- ${testflags}
- \"${src}\"
+ # Match the compiler location line printed out.
+ if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "CMAKE_${lang}_COMPILER=([^%\r\n]+)[\r\n]")
+ set(_comp "${CMAKE_MATCH_1}")
+ if(EXISTS "${_comp}")
+ file(TO_CMAKE_PATH "${_comp}" _comp)
+ set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE)
+ endif()
+ endif()
+ elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
+ set(id_lang "${lang}")
+ set(id_type ${CMAKE_${lang}_COMPILER_XCODE_TYPE})
+ set(id_dir ${CMAKE_${lang}_COMPILER_ID_DIR})
+ get_filename_component(id_src "${src}" NAME)
+ if(NOT ${XCODE_VERSION} VERSION_LESS 3)
+ set(v 3)
+ set(ext xcodeproj)
+ elseif(NOT ${XCODE_VERSION} VERSION_LESS 2)
+ set(v 2)
+ set(ext xcodeproj)
+ else()
+ set(v 1)
+ set(ext xcode)
+ endif()
+ configure_file(${CMAKE_ROOT}/Modules/CompilerId/Xcode-${v}.pbxproj.in
+ ${id_dir}/CompilerId${lang}.${ext}/project.pbxproj @ONLY IMMEDIATE)
+ unset(_ENV_MACOSX_DEPLOYMENT_TARGET)
+ if(DEFINED ENV{MACOSX_DEPLOYMENT_TARGET})
+ set(_ENV_MACOSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}")
+ set(ENV{MACOSX_DEPLOYMENT_TARGET} "")
+ endif()
+ execute_process(COMMAND xcodebuild
+ WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
- RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT
+ ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
+ RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
)
- ENDIF(COMMAND EXECUTE_PROCESS)
+ if(DEFINED _ENV_MACOSX_DEPLOYMENT_TARGET)
+ set(ENV{MACOSX_DEPLOYMENT_TARGET} "${_ENV_MACOSX_DEPLOYMENT_TARGET}")
+ endif()
+
+ # Match the link line from xcodebuild output of the form
+ # Ld ...
+ # ...
+ # /path/to/cc ...CompilerId${lang}/...
+ # to extract the compiler front-end for the language.
+ if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerId${lang}/\\./CompilerId${lang}[ \t\n\\\"]")
+ set(_comp "${CMAKE_MATCH_2}")
+ if(EXISTS "${_comp}")
+ set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE)
+ endif()
+ endif()
+ else()
+ if(COMMAND EXECUTE_PROCESS)
+ execute_process(
+ COMMAND ${CMAKE_${lang}_COMPILER}
+ ${CMAKE_${lang}_COMPILER_ID_ARG1}
+ ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
+ ${testflags}
+ "${src}"
+ WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
+ OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
+ ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
+ RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
+ )
+ else()
+ exec_program(
+ ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_DIR}
+ ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
+ ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
+ ${testflags}
+ \"${src}\"
+ OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
+ RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT
+ )
+ endif()
+ endif()
# Check the result of compilation.
- IF(CMAKE_${lang}_COMPILER_ID_RESULT)
+ if(CMAKE_${lang}_COMPILER_ID_RESULT)
# Compilation failed.
- SET(MSG
+ set(MSG
"Compiling the ${lang} compiler identification source file \"${src}\" failed.
${COMPILER_DESCRIPTION}
The output was:
@@ -133,16 +248,16 @@ ${CMAKE_${lang}_COMPILER_ID_RESULT}
${CMAKE_${lang}_COMPILER_ID_OUTPUT}
")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}")
- #IF(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
- # MESSAGE(FATAL_ERROR "${MSG}")
- #ENDIF(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}")
+ #if(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
+ # message(FATAL_ERROR "${MSG}")
+ #endif()
# No output files should be inspected.
- SET(COMPILER_${lang}_PRODUCED_FILES)
- ELSE(CMAKE_${lang}_COMPILER_ID_RESULT)
+ set(COMPILER_${lang}_PRODUCED_FILES)
+ else()
# Compilation succeeded.
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Compiling the ${lang} compiler identification source file \"${src}\" succeeded.
${COMPILER_DESCRIPTION}
The output was:
@@ -153,120 +268,124 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
# Find the executable produced by the compiler, try all files in the
# binary dir.
- FILE(GLOB COMPILER_${lang}_PRODUCED_FILES
+ file(GLOB files
RELATIVE ${CMAKE_${lang}_COMPILER_ID_DIR}
${CMAKE_${lang}_COMPILER_ID_DIR}/*)
- LIST(REMOVE_ITEM COMPILER_${lang}_PRODUCED_FILES "${src}")
- FOREACH(file ${COMPILER_${lang}_PRODUCED_FILES})
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Compilation of the ${lang} compiler identification source \""
- "${src}\" produced \"${file}\"\n\n")
- ENDFOREACH(file)
-
- IF(NOT COMPILER_${lang}_PRODUCED_FILES)
+ list(REMOVE_ITEM files "${src}")
+ set(COMPILER_${lang}_PRODUCED_FILES "")
+ foreach(file ${files})
+ if(NOT IS_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}/${file})
+ list(APPEND COMPILER_${lang}_PRODUCED_FILES ${file})
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Compilation of the ${lang} compiler identification source \""
+ "${src}\" produced \"${file}\"\n\n")
+ endif()
+ endforeach()
+
+ if(NOT COMPILER_${lang}_PRODUCED_FILES)
# No executable was found.
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Compilation of the ${lang} compiler identification source \""
"${src}\" did not produce an executable in \""
"${CMAKE_${lang}_COMPILER_ID_DIR}\".\n\n")
- ENDIF(NOT COMPILER_${lang}_PRODUCED_FILES)
- ENDIF(CMAKE_${lang}_COMPILER_ID_RESULT)
+ endif()
+ endif()
# Return the files produced by the compilation.
- SET(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE)
-ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
+ set(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE)
+endfunction()
#-----------------------------------------------------------------------------
# Function to extract the compiler id from an executable.
-FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
+function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
# Look for a compiler id if not yet known.
- IF(NOT CMAKE_${lang}_COMPILER_ID)
+ if(NOT CMAKE_${lang}_COMPILER_ID)
# Read the compiler identification string from the executable file.
- SET(COMPILER_ID)
- SET(COMPILER_VERSION)
- SET(PLATFORM_ID)
- FILE(STRINGS ${file}
+ set(COMPILER_ID)
+ set(COMPILER_VERSION)
+ set(PLATFORM_ID)
+ file(STRINGS ${file}
CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 4 REGEX "INFO:")
- SET(HAVE_COMPILER_TWICE 0)
- FOREACH(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
- IF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
- IF(COMPILER_ID)
- SET(COMPILER_ID_TWICE 1)
- ENDIF(COMPILER_ID)
- STRING(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1"
+ set(HAVE_COMPILER_TWICE 0)
+ foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
+ if("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
+ if(COMPILER_ID)
+ set(COMPILER_ID_TWICE 1)
+ endif()
+ string(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1"
COMPILER_ID "${info}")
- ENDIF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
- IF("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
- STRING(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1"
+ endif()
+ if("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
+ string(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1"
PLATFORM_ID "${info}")
- ENDIF("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
- IF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
- STRING(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
+ endif()
+ if("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
+ string(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
ARCHITECTURE_ID "${info}")
- ENDIF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
- IF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
- STRING(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}")
- STRING(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}")
- STRING(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
- ENDIF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
- ENDFOREACH(info)
+ endif()
+ if("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
+ string(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}")
+ string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}")
+ string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
+ endif()
+ endforeach()
# Check if a valid compiler and platform were found.
- IF(COMPILER_ID AND NOT COMPILER_ID_TWICE)
- SET(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}")
- SET(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
- SET(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
- SET(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}")
- ENDIF(COMPILER_ID AND NOT COMPILER_ID_TWICE)
+ if(COMPILER_ID AND NOT COMPILER_ID_TWICE)
+ set(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}")
+ set(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
+ set(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
+ set(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}")
+ endif()
# Check the compiler identification string.
- IF(CMAKE_${lang}_COMPILER_ID)
+ if(CMAKE_${lang}_COMPILER_ID)
# The compiler identification was found.
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"The ${lang} compiler identification is ${CMAKE_${lang}_COMPILER_ID}, found in \""
"${file}\"\n\n")
- ELSE(CMAKE_${lang}_COMPILER_ID)
+ else()
# The compiler identification could not be found.
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"The ${lang} compiler identification could not be found in \""
"${file}\"\n\n")
- ENDIF(CMAKE_${lang}_COMPILER_ID)
- ENDIF(NOT CMAKE_${lang}_COMPILER_ID)
+ endif()
+ endif()
# try to figure out the executable format: ELF, COFF, Mach-O
- IF(NOT CMAKE_EXECUTABLE_FORMAT)
- FILE(READ ${file} CMAKE_EXECUTABLE_MAGIC LIMIT 4 HEX)
+ if(NOT CMAKE_EXECUTABLE_FORMAT)
+ file(READ ${file} CMAKE_EXECUTABLE_MAGIC LIMIT 4 HEX)
# ELF files start with 0x7f"ELF"
- IF("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
- SET(CMAKE_EXECUTABLE_FORMAT "ELF" CACHE INTERNAL "Executable file format")
- ENDIF("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
+ if("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
+ set(CMAKE_EXECUTABLE_FORMAT "ELF" CACHE INTERNAL "Executable file format")
+ endif()
# # COFF (.exe) files start with "MZ"
-# IF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
-# SET(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format")
-# ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
+# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
+# set(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format")
+# endif()
#
# # Mach-O files start with CAFEBABE or FEEDFACE, according to http://radio.weblogs.com/0100490/2003/01/28.html
-# IF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
-# SET(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
-# ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
-# IF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
-# SET(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
-# ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
-
- ENDIF(NOT CMAKE_EXECUTABLE_FORMAT)
- IF(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
- SET(CMAKE_EXECUTABLE_FORMAT)
- ENDIF()
+# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
+# set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
+# endif()
+# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
+# set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
+# endif()
+
+ endif()
+ if(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
+ set(CMAKE_EXECUTABLE_FORMAT)
+ endif()
# 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(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}"
PARENT_SCOPE)
- SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
- SET(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
-ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
+ set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
+ set(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
+endfunction()
#-----------------------------------------------------------------------------
# Function to query the compiler vendor.
@@ -276,22 +395,22 @@ ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
# set(CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor} "Some Vendor Output")
# 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)
+function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
- IF(NOT CMAKE_${lang}_COMPILER_ID_DIR)
+ 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)
+ set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_PLATFORM_INFO_DIR}/CompilerId${lang})
+ file(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
+ file(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
+ endif()
- 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}})
- EXECUTE_PROCESS(
+ 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}})
+ execute_process(
COMMAND ${CMAKE_${lang}_COMPILER}
${CMAKE_${lang}_COMPILER_ID_ARG1}
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
@@ -302,22 +421,22 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
TIMEOUT 10
)
- IF("${output}" MATCHES "${regex}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if("${output}" MATCHES "${regex}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
"matched \"${regex}\":\n${output}")
- SET(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
- BREAK()
- ELSE()
- IF("${result}" MATCHES "timeout")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ set(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
+ break()
+ else()
+ 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
+ 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)
+ endif()
+ endif()
+ endforeach()
+endfunction()
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index ade6d58..f861e39 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -15,214 +15,215 @@
# determine the compiler to use for Fortran programs
# NOTE, a generator may set CMAKE_Fortran_COMPILER before
# loading this file to force a compiler.
-# use environment variable FC first if defined by user, next use
+# use environment variable FC first if defined by user, next use
# the cmake variable CMAKE_GENERATOR_FC which can be defined by a generator
# as a default compiler
-IF(NOT CMAKE_Fortran_COMPILER)
- # prefer the environment variable CC
- IF($ENV{FC} MATCHES ".+")
- GET_FILENAME_COMPONENT(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
- IF(CMAKE_Fortran_FLAGS_ENV_INIT)
- SET(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
- ENDIF(CMAKE_Fortran_FLAGS_ENV_INIT)
- IF(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
- ELSE(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
- MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")
- ENDIF(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
- ENDIF($ENV{FC} MATCHES ".+")
-
- # next try prefer the compiler specified by the generator
- IF(CMAKE_GENERATOR_FC)
- IF(NOT CMAKE_Fortran_COMPILER_INIT)
- SET(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
- ENDIF(NOT CMAKE_Fortran_COMPILER_INIT)
- ENDIF(CMAKE_GENERATOR_FC)
-
- # finally list compilers to try
- IF(CMAKE_Fortran_COMPILER_INIT)
- SET(CMAKE_Fortran_COMPILER_LIST ${CMAKE_Fortran_COMPILER_INIT})
- ELSE(CMAKE_Fortran_COMPILER_INIT)
- # Known compilers:
- # f77/f90/f95: generic compiler names
- # g77: GNU Fortran 77 compiler
- # gfortran: putative GNU Fortran 95+ compiler (in progress)
- # fort77: native F77 compiler under HP-UX (and some older Crays)
- # frt: Fujitsu F77 compiler
- # pathf90/pathf95/pathf2003: PathScale Fortran compiler
- # pgf77/pgf90/pgf95/pgfortran: Portland Group F77/F90/F95 compilers
- # xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers
- # lf95: Lahey-Fujitsu F95 compiler
- # fl32: Microsoft Fortran 77 "PowerStation" compiler
- # af77: Apogee F77 compiler for Intergraph hardware running CLIX
- # epcf90: "Edinburgh Portable Compiler" F90
- # fort: Compaq (now HP) Fortran 90/95 compiler for Tru64 and Linux/Alpha
- # ifc: Intel Fortran 95 compiler for Linux/x86
- # efc: Intel Fortran 95 compiler for IA64
- #
- # The order is 95 or newer compilers first, then 90,
- # then 77 or older compilers, gnu is always last in the group,
- # so if you paid for a compiler it is picked by default.
- SET(CMAKE_Fortran_COMPILER_LIST
- ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95
- fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77
- frt pgf77 xlf fl32 af77 g77 f77
- )
-
- # Vendor-specific compiler names.
- SET(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77)
- SET(_Fortran_COMPILER_NAMES_Intel ifort ifc efc)
- SET(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77)
- SET(_Fortran_COMPILER_NAMES_PGI pgf95 pgfortran pgf90 pgf77)
- SET(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90)
- SET(_Fortran_COMPILER_NAMES_XL xlf)
- SET(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf)
-
- # Prefer vendors matching the C and C++ compilers.
- SET(CMAKE_Fortran_COMPILER_LIST
- ${_Fortran_COMPILER_NAMES_${CMAKE_C_COMPILER_ID}}
- ${_Fortran_COMPILER_NAMES_${CMAKE_CXX_COMPILER_ID}}
- ${CMAKE_Fortran_COMPILER_LIST})
- LIST(REMOVE_DUPLICATES CMAKE_Fortran_COMPILER_LIST)
- ENDIF(CMAKE_Fortran_COMPILER_INIT)
-
- # Look for directories containing the C and C++ compilers.
- SET(_Fortran_COMPILER_HINTS)
- FOREACH(lang C CXX)
- IF(CMAKE_${lang}_COMPILER AND IS_ABSOLUTE "${CMAKE_${lang}_COMPILER}")
- GET_FILENAME_COMPONENT(_hint "${CMAKE_${lang}_COMPILER}" PATH)
- IF(IS_DIRECTORY "${_hint}")
- LIST(APPEND _Fortran_COMPILER_HINTS "${_hint}")
- ENDIF()
- SET(_hint)
- ENDIF()
- ENDFOREACH()
-
- # Find the compiler.
- IF(_Fortran_COMPILER_HINTS)
- # Prefer directories containing C and C++ compilers.
- LIST(REMOVE_DUPLICATES _Fortran_COMPILER_HINTS)
- FIND_PROGRAM(CMAKE_Fortran_COMPILER
- NAMES ${CMAKE_Fortran_COMPILER_LIST}
- PATHS ${_Fortran_COMPILER_HINTS}
- NO_DEFAULT_PATH
- DOC "Fortran compiler")
- ENDIF()
- FIND_PROGRAM(CMAKE_Fortran_COMPILER NAMES ${CMAKE_Fortran_COMPILER_LIST} DOC "Fortran compiler")
- IF(CMAKE_Fortran_COMPILER_INIT AND NOT CMAKE_Fortran_COMPILER)
- SET(CMAKE_Fortran_COMPILER "${CMAKE_Fortran_COMPILER_INIT}" CACHE FILEPATH "Fortran compiler" FORCE)
- ENDIF(CMAKE_Fortran_COMPILER_INIT AND NOT CMAKE_Fortran_COMPILER)
-ELSE(NOT CMAKE_Fortran_COMPILER)
- # we only get here if CMAKE_Fortran_COMPILER was specified using -D or a pre-made CMakeCache.txt
- # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
- # if CMAKE_Fortran_COMPILER is a list of length 2, use the first item as
- # CMAKE_Fortran_COMPILER and the 2nd one as CMAKE_Fortran_COMPILER_ARG1
-
- LIST(LENGTH CMAKE_Fortran_COMPILER _CMAKE_Fortran_COMPILER_LIST_LENGTH)
- IF("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
- LIST(GET CMAKE_Fortran_COMPILER 1 CMAKE_Fortran_COMPILER_ARG1)
- LIST(GET CMAKE_Fortran_COMPILER 0 CMAKE_Fortran_COMPILER)
- ENDIF("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
-
- # 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 not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
- # if the C compiler already had a path, reuse it for searching the CXX compiler
- GET_FILENAME_COMPONENT(_CMAKE_USER_Fortran_COMPILER_PATH "${CMAKE_Fortran_COMPILER}" PATH)
- IF(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
- FIND_PROGRAM(CMAKE_Fortran_COMPILER_WITH_PATH NAMES ${CMAKE_Fortran_COMPILER})
- MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER_WITH_PATH)
- IF(CMAKE_Fortran_COMPILER_WITH_PATH)
- SET(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH}
- CACHE STRING "Fortran compiler" FORCE)
- ENDIF(CMAKE_Fortran_COMPILER_WITH_PATH)
- ENDIF(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
-ENDIF(NOT CMAKE_Fortran_COMPILER)
-
-MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER)
-
-# Build a small source file to identify the compiler.
-IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
- SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
- SET(CMAKE_Fortran_PLATFORM_ID "Windows")
- SET(CMAKE_Fortran_COMPILER_ID "Intel")
-ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
-
-IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
- SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
+include(Platform/${CMAKE_SYSTEM_NAME}-Fortran OPTIONAL)
+if(NOT CMAKE_Fortran_COMPILER_NAMES)
+ set(CMAKE_Fortran_COMPILER_NAMES f95)
+endif()
+
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+ set(CMAKE_Fortran_COMPILER_ID_RUN 1)
+ set(CMAKE_Fortran_PLATFORM_ID "Windows")
+ set(CMAKE_Fortran_COMPILER_ID "Intel")
+ set(CMAKE_Fortran_COMPILER "${CMAKE_GENERATOR_FC}")
+elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
+ set(CMAKE_Fortran_COMPILER_XCODE_TYPE sourcecode.fortran.f90)
+else()
+ if(NOT CMAKE_Fortran_COMPILER)
+ # prefer the environment variable CC
+ if($ENV{FC} MATCHES ".+")
+ get_filename_component(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
+ if(CMAKE_Fortran_FLAGS_ENV_INIT)
+ set(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
+ endif()
+ if(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
+ else()
+ message(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")
+ endif()
+ endif()
+
+ # next try prefer the compiler specified by the generator
+ if(CMAKE_GENERATOR_FC)
+ if(NOT CMAKE_Fortran_COMPILER_INIT)
+ set(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
+ endif()
+ endif()
+
+ # finally list compilers to try
+ if(NOT CMAKE_Fortran_COMPILER_INIT)
+ # Known compilers:
+ # f77/f90/f95: generic compiler names
+ # g77: GNU Fortran 77 compiler
+ # gfortran: putative GNU Fortran 95+ compiler (in progress)
+ # fort77: native F77 compiler under HP-UX (and some older Crays)
+ # frt: Fujitsu F77 compiler
+ # pathf90/pathf95/pathf2003: PathScale Fortran compiler
+ # pgf77/pgf90/pgf95/pgfortran: Portland Group F77/F90/F95 compilers
+ # xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers
+ # lf95: Lahey-Fujitsu F95 compiler
+ # fl32: Microsoft Fortran 77 "PowerStation" compiler
+ # af77: Apogee F77 compiler for Intergraph hardware running CLIX
+ # epcf90: "Edinburgh Portable Compiler" F90
+ # fort: Compaq (now HP) Fortran 90/95 compiler for Tru64 and Linux/Alpha
+ # ifc: Intel Fortran 95 compiler for Linux/x86
+ # efc: Intel Fortran 95 compiler for IA64
+ #
+ # The order is 95 or newer compilers first, then 90,
+ # then 77 or older compilers, gnu is always last in the group,
+ # so if you paid for a compiler it is picked by default.
+ set(CMAKE_Fortran_COMPILER_LIST
+ ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95
+ fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77
+ frt pgf77 xlf fl32 af77 g77 f77
+ )
+
+ # Vendor-specific compiler names.
+ set(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77)
+ set(_Fortran_COMPILER_NAMES_Intel ifort ifc efc)
+ set(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77)
+ set(_Fortran_COMPILER_NAMES_PGI pgf95 pgfortran pgf90 pgf77)
+ set(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90)
+ set(_Fortran_COMPILER_NAMES_XL xlf)
+ set(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf)
+ endif()
+
+ _cmake_find_compiler(Fortran)
+
+ else()
+ # we only get here if CMAKE_Fortran_COMPILER was specified using -D or a pre-made CMakeCache.txt
+ # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
+ # if CMAKE_Fortran_COMPILER is a list of length 2, use the first item as
+ # CMAKE_Fortran_COMPILER and the 2nd one as CMAKE_Fortran_COMPILER_ARG1
+
+ list(LENGTH CMAKE_Fortran_COMPILER _CMAKE_Fortran_COMPILER_LIST_LENGTH)
+ if("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
+ list(GET CMAKE_Fortran_COMPILER 1 CMAKE_Fortran_COMPILER_ARG1)
+ list(GET CMAKE_Fortran_COMPILER 0 CMAKE_Fortran_COMPILER)
+ endif()
+
+ # 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 not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
+ # if the C compiler already had a path, reuse it for searching the CXX compiler
+ get_filename_component(_CMAKE_USER_Fortran_COMPILER_PATH "${CMAKE_Fortran_COMPILER}" PATH)
+ if(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
+ find_program(CMAKE_Fortran_COMPILER_WITH_PATH NAMES ${CMAKE_Fortran_COMPILER})
+ mark_as_advanced(CMAKE_Fortran_COMPILER_WITH_PATH)
+ if(CMAKE_Fortran_COMPILER_WITH_PATH)
+ set(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH}
+ CACHE STRING "Fortran compiler" FORCE)
+ endif()
+ endif()
+ endif()
+ mark_as_advanced(CMAKE_Fortran_COMPILER)
# Each entry in this list is a set of extra flags to try
# adding to the compile line to see if it helps produce
# a valid identification executable.
- SET(CMAKE_Fortran_COMPILER_ID_TEST_FLAGS
+ set(CMAKE_Fortran_COMPILER_ID_TEST_FLAGS
# Try compiling to an object file only.
"-c"
# Intel on windows does not preprocess by default.
"-fpp"
)
+endif()
+
+# Build a small source file to identify the compiler.
+if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
+ set(CMAKE_Fortran_COMPILER_ID_RUN 1)
# Table of per-vendor compiler id flags with expected output.
- LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq)
- SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq "-what")
- SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq "Compaq Visual Fortran")
- LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS NAG) # Numerical Algorithms Group
- SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_NAG "-V")
- SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_NAG "NAG Fortran Compiler")
+ list(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq)
+ set(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq "-what")
+ set(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq "Compaq Visual Fortran")
+ list(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS NAG) # Numerical Algorithms Group
+ set(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_NAG "-V")
+ set(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_NAG "NAG Fortran Compiler")
# Try to identify the compiler.
- SET(CMAKE_Fortran_COMPILER_ID)
- INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
+ set(CMAKE_Fortran_COMPILER_ID)
+ include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
CMAKE_DETERMINE_COMPILER_ID(Fortran FFLAGS CMakeFortranCompilerId.F)
# Fall back to old is-GNU test.
- IF(NOT CMAKE_Fortran_COMPILER_ID)
- EXEC_PROGRAM(${CMAKE_Fortran_COMPILER}
+ if(NOT CMAKE_Fortran_COMPILER_ID)
+ exec_program(${CMAKE_Fortran_COMPILER}
ARGS ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\""
OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
- IF(NOT CMAKE_COMPILER_RETURN)
- IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
- SET(CMAKE_Fortran_COMPILER_ID "GNU")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if(NOT CMAKE_COMPILER_RETURN)
+ if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
+ set(CMAKE_Fortran_COMPILER_ID "GNU")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler is GNU succeeded with "
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
- ELSE("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ else()
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler is GNU failed with "
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
- ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
- IF(NOT CMAKE_Fortran_PLATFORM_ID)
- IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
- SET(CMAKE_Fortran_PLATFORM_ID "MinGW")
- ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
- IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
- SET(CMAKE_Fortran_PLATFORM_ID "Cygwin")
- ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
- ENDIF(NOT CMAKE_Fortran_PLATFORM_ID)
- ENDIF(NOT CMAKE_COMPILER_RETURN)
- ENDIF(NOT CMAKE_Fortran_COMPILER_ID)
+ endif()
+ if(NOT CMAKE_Fortran_PLATFORM_ID)
+ if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
+ set(CMAKE_Fortran_PLATFORM_ID "MinGW")
+ endif()
+ if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
+ set(CMAKE_Fortran_PLATFORM_ID "Cygwin")
+ endif()
+ endif()
+ endif()
+ endif()
# Set old compiler and platform id variables.
- IF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
- SET(CMAKE_COMPILER_IS_GNUG77 1)
- ENDIF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
- IF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
- SET(CMAKE_COMPILER_IS_MINGW 1)
- ELSEIF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin")
- SET(CMAKE_COMPILER_IS_CYGWIN 1)
- ENDIF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
-ENDIF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
-
-INCLUDE(CMakeFindBinUtils)
-
-IF(MSVC_Fortran_ARCHITECTURE_ID)
- SET(SET_MSVC_Fortran_ARCHITECTURE_ID
- "SET(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})")
-ENDIF()
+ if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
+ set(CMAKE_COMPILER_IS_GNUG77 1)
+ endif()
+ if("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
+ set(CMAKE_COMPILER_IS_MINGW 1)
+ elseif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin")
+ set(CMAKE_COMPILER_IS_CYGWIN 1)
+ endif()
+endif()
+
+if (NOT _CMAKE_TOOLCHAIN_LOCATION)
+ get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_Fortran_COMPILER}" PATH)
+endif ()
+
+# if we have a fortran cross compiler, they have usually some prefix, like
+# e.g. powerpc-linux-gfortran, arm-elf-gfortran or i586-mingw32msvc-gfortran , optionally
+# with a 3-component version number at the end (e.g. arm-eabi-gcc-4.5.2).
+# 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-gcc.exe", where BASENAME would be
+# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
+if (CMAKE_CROSSCOMPILING
+ AND "${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU"
+ AND NOT _CMAKE_TOOLCHAIN_PREFIX)
+ get_filename_component(COMPILER_BASENAME "${CMAKE_Fortran_COMPILER}" NAME)
+ if (COMPILER_BASENAME MATCHES "^(.+-)g?fortran(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+ set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+ endif ()
+
+ # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
+ # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
+ if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
+ set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+ endif ()
+endif ()
+
+include(CMakeFindBinUtils)
+
+if(MSVC_Fortran_ARCHITECTURE_ID)
+ set(SET_MSVC_Fortran_ARCHITECTURE_ID
+ "set(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})")
+endif()
# configure variables set in this file for fast reload later on
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake
+configure_file(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
+ ${CMAKE_PLATFORM_INFO_DIR}/CMakeFortranCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
)
-SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
+set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
diff --git a/Modules/CMakeDetermineJavaCompiler.cmake b/Modules/CMakeDetermineJavaCompiler.cmake
index aefcaba..c4217f5 100644
--- a/Modules/CMakeDetermineJavaCompiler.cmake
+++ b/Modules/CMakeDetermineJavaCompiler.cmake
@@ -16,33 +16,33 @@
# NOTE, a generator may set CMAKE_Java_COMPILER before
# loading this file to force a compiler.
-IF(NOT CMAKE_Java_COMPILER)
+if(NOT CMAKE_Java_COMPILER)
# prefer the environment variable CC
- IF($ENV{JAVA_COMPILER} MATCHES ".+")
- GET_FILENAME_COMPONENT(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
- IF(CMAKE_Java_FLAGS_ENV_INIT)
- SET(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
- ENDIF(CMAKE_Java_FLAGS_ENV_INIT)
- IF(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
- MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")
- ENDIF(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
- ENDIF($ENV{JAVA_COMPILER} MATCHES ".+")
+ if($ENV{JAVA_COMPILER} MATCHES ".+")
+ get_filename_component(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
+ if(CMAKE_Java_FLAGS_ENV_INIT)
+ set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
+ endif()
+ if(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
+ message(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")
+ endif()
+ endif()
- IF($ENV{JAVA_RUNTIME} MATCHES ".+")
- GET_FILENAME_COMPONENT(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
- IF(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
- MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
- ENDIF(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
- ENDIF($ENV{JAVA_RUNTIME} MATCHES ".+")
+ if($ENV{JAVA_RUNTIME} MATCHES ".+")
+ get_filename_component(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
+ if(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
+ message(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
+ endif()
+ endif()
- IF($ENV{JAVA_ARCHIVE} MATCHES ".+")
- GET_FILENAME_COMPONENT(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
- IF(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
- MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
- ENDIF(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
- ENDIF($ENV{JAVA_ARCHIVE} MATCHES ".+")
+ if($ENV{JAVA_ARCHIVE} MATCHES ".+")
+ get_filename_component(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
+ if(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
+ message(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
+ endif()
+ endif()
- SET(Java_BIN_PATH
+ set(Java_BIN_PATH
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/bin"
@@ -65,38 +65,38 @@ IF(NOT CMAKE_Java_COMPILER)
/opt/sun-jdk-1.5.0.04/bin
)
# if no compiler has been specified yet, then look for one
- IF(CMAKE_Java_COMPILER_INIT)
- SET(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler")
- ELSE(CMAKE_Java_COMPILER_INIT)
- FIND_PROGRAM(CMAKE_Java_COMPILER
+ if(CMAKE_Java_COMPILER_INIT)
+ set(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler")
+ else()
+ find_program(CMAKE_Java_COMPILER
NAMES javac
PATHS ${Java_BIN_PATH}
- )
- ENDIF(CMAKE_Java_COMPILER_INIT)
+ )
+ endif()
# if no runtime has been specified yet, then look for one
- IF(CMAKE_Java_RUNTIME_INIT)
- SET(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler")
- ELSE(CMAKE_Java_RUNTIME_INIT)
- FIND_PROGRAM(CMAKE_Java_RUNTIME
+ if(CMAKE_Java_RUNTIME_INIT)
+ set(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler")
+ else()
+ find_program(CMAKE_Java_RUNTIME
NAMES java
PATHS ${Java_BIN_PATH}
- )
- ENDIF(CMAKE_Java_RUNTIME_INIT)
+ )
+ endif()
# if no archive has been specified yet, then look for one
- IF(CMAKE_Java_ARCHIVE_INIT)
- SET(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler")
- ELSE(CMAKE_Java_ARCHIVE_INIT)
- FIND_PROGRAM(CMAKE_Java_ARCHIVE
+ if(CMAKE_Java_ARCHIVE_INIT)
+ set(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler")
+ else()
+ find_program(CMAKE_Java_ARCHIVE
NAMES jar
PATHS ${Java_BIN_PATH}
- )
- ENDIF(CMAKE_Java_ARCHIVE_INIT)
-ENDIF(NOT CMAKE_Java_COMPILER)
-MARK_AS_ADVANCED(CMAKE_Java_COMPILER)
+ )
+ endif()
+endif()
+mark_as_advanced(CMAKE_Java_COMPILER)
# configure variables set in this file for fast reload later on
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeJavaCompiler.cmake IMMEDIATE @ONLY)
-SET(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")
+configure_file(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in
+ ${CMAKE_PLATFORM_INFO_DIR}/CMakeJavaCompiler.cmake IMMEDIATE @ONLY)
+set(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")
diff --git a/Modules/CMakeDetermineRCCompiler.cmake b/Modules/CMakeDetermineRCCompiler.cmake
index 8e085af..fa78da0 100644
--- a/Modules/CMakeDetermineRCCompiler.cmake
+++ b/Modules/CMakeDetermineRCCompiler.cmake
@@ -15,53 +15,53 @@
# determine the compiler to use for C programs
# NOTE, a generator may set CMAKE_C_COMPILER before
# loading this file to force a compiler.
-# use environment variable CCC first if defined by user, next use
+# use environment variable CCC first if defined by user, next use
# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
# as a default compiler
-IF(NOT CMAKE_RC_COMPILER)
+if(NOT CMAKE_RC_COMPILER)
# prefer the environment variable CC
- IF($ENV{RC} MATCHES ".+")
- GET_FILENAME_COMPONENT(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT)
- IF(CMAKE_RC_FLAGS_ENV_INIT)
- SET(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler")
- ENDIF(CMAKE_RC_FLAGS_ENV_INIT)
- IF(EXISTS ${CMAKE_RC_COMPILER_INIT})
- ELSE(EXISTS ${CMAKE_RC_COMPILER_INIT})
- MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.")
- ENDIF(EXISTS ${CMAKE_RC_COMPILER_INIT})
- ENDIF($ENV{RC} MATCHES ".+")
-
+ if($ENV{RC} MATCHES ".+")
+ get_filename_component(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT)
+ if(CMAKE_RC_FLAGS_ENV_INIT)
+ set(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler")
+ endif()
+ if(EXISTS ${CMAKE_RC_COMPILER_INIT})
+ else()
+ message(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.")
+ endif()
+ endif()
+
# next try prefer the compiler specified by the generator
- IF(CMAKE_GENERATOR_RC)
- IF(NOT CMAKE_RC_COMPILER_INIT)
- SET(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC})
- ENDIF(NOT CMAKE_RC_COMPILER_INIT)
- ENDIF(CMAKE_GENERATOR_RC)
+ if(CMAKE_GENERATOR_RC)
+ if(NOT CMAKE_RC_COMPILER_INIT)
+ set(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC})
+ endif()
+ endif()
# finally list compilers to try
- IF(CMAKE_RC_COMPILER_INIT)
- SET(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
- ELSE(CMAKE_RC_COMPILER_INIT)
- SET(CMAKE_RC_COMPILER_LIST rc)
- ENDIF(CMAKE_RC_COMPILER_INIT)
+ if(CMAKE_RC_COMPILER_INIT)
+ set(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
+ else()
+ set(CMAKE_RC_COMPILER_LIST rc)
+ endif()
# Find the compiler.
- FIND_PROGRAM(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler")
- IF(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
- SET(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE)
- ENDIF(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
-ENDIF(NOT CMAKE_RC_COMPILER)
+ find_program(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler")
+ if(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
+ set(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE)
+ endif()
+endif()
-MARK_AS_ADVANCED(CMAKE_RC_COMPILER)
+mark_as_advanced(CMAKE_RC_COMPILER)
-GET_FILENAME_COMPONENT(_CMAKE_RC_COMPILER_NAME_WE ${CMAKE_RC_COMPILER} NAME_WE)
-IF(_CMAKE_RC_COMPILER_NAME_WE STREQUAL "windres")
- SET(CMAKE_RC_OUTPUT_EXTENSION .obj)
-ELSE()
- SET(CMAKE_RC_OUTPUT_EXTENSION .res)
-ENDIF()
+get_filename_component(_CMAKE_RC_COMPILER_NAME_WE ${CMAKE_RC_COMPILER} NAME_WE)
+if(_CMAKE_RC_COMPILER_NAME_WE STREQUAL "windres")
+ set(CMAKE_RC_OUTPUT_EXTENSION .obj)
+else()
+ set(CMAKE_RC_OUTPUT_EXTENSION .res)
+endif()
# configure variables set in this file for fast reload later on
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeRCCompiler.cmake IMMEDIATE)
-SET(CMAKE_RC_COMPILER_ENV_VAR "RC")
+configure_file(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in
+ ${CMAKE_PLATFORM_INFO_DIR}/CMakeRCCompiler.cmake IMMEDIATE)
+set(CMAKE_RC_COMPILER_ENV_VAR "RC")
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index 7ae3775..cd33447 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -19,158 +19,158 @@
#
# Expected uname -s output:
#
-# AIX AIX
-# BSD/OS BSD/OS
-# FreeBSD FreeBSD
-# HP-UX HP-UX
-# IRIX IRIX
-# Linux Linux
+# AIX AIX
+# BSD/OS BSD/OS
+# FreeBSD FreeBSD
+# HP-UX HP-UX
+# IRIX IRIX
+# Linux Linux
# GNU/kFreeBSD GNU/kFreeBSD
-# NetBSD NetBSD
-# OpenBSD OpenBSD
-# OFS/1 (Digital Unix) OSF1
-# SCO OpenServer 5 SCO_SV
-# SCO UnixWare 7 UnixWare
-# SCO UnixWare (pre release 7) UNIX_SV
-# SCO XENIX Xenix
-# Solaris SunOS
-# SunOS SunOS
-# Tru64 Tru64
-# Ultrix ULTRIX
+# NetBSD NetBSD
+# OpenBSD OpenBSD
+# OFS/1 (Digital Unix) OSF1
+# SCO OpenServer 5 SCO_SV
+# SCO UnixWare 7 UnixWare
+# SCO UnixWare (pre release 7) UNIX_SV
+# SCO XENIX Xenix
+# Solaris SunOS
+# SunOS SunOS
+# Tru64 Tru64
+# Ultrix ULTRIX
# cygwin CYGWIN_NT-5.1
# MacOSX Darwin
# find out on which system cmake runs
-IF(CMAKE_HOST_UNIX)
- FIND_PROGRAM(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
- 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|CYGWIN.*")
- EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
+if(CMAKE_HOST_UNIX)
+ find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
+ 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|CYGWIN.*")
+ exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val)
- ELSEIF(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
- EXEC_PROGRAM(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
+ elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
+ exec_program(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val)
- ELSE()
- EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
+ else()
+ 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
+ if("${val}" GREATER 0)
+ exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val)
- ENDIF("${val}" GREATER 0)
- ENDIF()
- # check the return of the last uname -m or -p
- IF("${val}" GREATER 0)
- SET(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
- ENDIF("${val}" GREATER 0)
- SET(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
+ endif()
+ endif()
+ # check the return of the last uname -m or -p
+ if("${val}" GREATER 0)
+ set(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
+ endif()
+ set(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
# processor may have double quote in the name, and that needs to be removed
- STRING(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
- STRING(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
- ENDIF(CMAKE_UNAME)
-ELSE(CMAKE_HOST_UNIX)
- IF(CMAKE_HOST_WIN32)
- SET (CMAKE_HOST_SYSTEM_NAME "Windows")
- SET (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
- ENDIF(CMAKE_HOST_WIN32)
-ENDIF(CMAKE_HOST_UNIX)
+ string(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
+ string(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
+ endif()
+else()
+ if(CMAKE_HOST_WIN32)
+ set (CMAKE_HOST_SYSTEM_NAME "Windows")
+ set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
+ endif()
+endif()
# if a toolchain file is used, the user wants to cross compile.
# in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_*
-# variables around so they can be used in CMakeLists.txt.
+# variables around so they can be used in CMakeLists.txt.
# In all other cases, the host and target platform are the same.
-IF(CMAKE_TOOLCHAIN_FILE)
+if(CMAKE_TOOLCHAIN_FILE)
# at first try to load it as path relative to the directory from which cmake has been run
- INCLUDE("${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
- IF(NOT _INCLUDED_TOOLCHAIN_FILE)
+ include("${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
+ if(NOT _INCLUDED_TOOLCHAIN_FILE)
# if the file isn't found there, check the default locations
- INCLUDE("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
- ENDIF(NOT _INCLUDED_TOOLCHAIN_FILE)
+ include("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
+ endif()
- IF(_INCLUDED_TOOLCHAIN_FILE)
- SET(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE)
- ELSE(_INCLUDED_TOOLCHAIN_FILE)
- MESSAGE(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
- SET(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE)
- ENDIF(_INCLUDED_TOOLCHAIN_FILE)
-ENDIF(CMAKE_TOOLCHAIN_FILE)
+ if(_INCLUDED_TOOLCHAIN_FILE)
+ set(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE)
+ else()
+ message(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
+ set(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE)
+ endif()
+endif()
# if CMAKE_SYSTEM_NAME is here already set, either it comes from a toolchain file
# or it was set via -DCMAKE_SYSTEM_NAME=...
# if that's the case, assume we are crosscompiling
-IF(CMAKE_SYSTEM_NAME)
- IF(NOT DEFINED CMAKE_CROSSCOMPILING)
- SET(CMAKE_CROSSCOMPILING TRUE)
- ENDIF(NOT DEFINED CMAKE_CROSSCOMPILING)
- SET(PRESET_CMAKE_SYSTEM_NAME TRUE)
-ELSE(CMAKE_SYSTEM_NAME)
- SET(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
- SET(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
- SET(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
- SET(CMAKE_CROSSCOMPILING FALSE)
- SET(PRESET_CMAKE_SYSTEM_NAME FALSE)
-ENDIF(CMAKE_SYSTEM_NAME)
-
-
-MACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
- IF(NOT ${_PREFIX}_NAME)
- SET(${_PREFIX}_NAME "UnknownOS")
- ENDIF(NOT ${_PREFIX}_NAME)
+if(CMAKE_SYSTEM_NAME)
+ if(NOT DEFINED CMAKE_CROSSCOMPILING)
+ set(CMAKE_CROSSCOMPILING TRUE)
+ endif()
+ set(PRESET_CMAKE_SYSTEM_NAME TRUE)
+else()
+ set(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
+ set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
+ set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
+ set(CMAKE_CROSSCOMPILING FALSE)
+ set(PRESET_CMAKE_SYSTEM_NAME FALSE)
+endif()
+
+
+macro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
+ if(NOT ${_PREFIX}_NAME)
+ set(${_PREFIX}_NAME "UnknownOS")
+ endif()
# fix for BSD/OS , remove the /
- IF(${_PREFIX}_NAME MATCHES BSD.OS)
- SET(${_PREFIX}_NAME BSDOS)
- ENDIF(${_PREFIX}_NAME MATCHES BSD.OS)
+ if(${_PREFIX}_NAME MATCHES BSD.OS)
+ set(${_PREFIX}_NAME BSDOS)
+ endif()
# fix for GNU/kFreeBSD, remove the GNU/
- IF(${_PREFIX}_NAME MATCHES kFreeBSD)
- SET(${_PREFIX}_NAME kFreeBSD)
- ENDIF(${_PREFIX}_NAME MATCHES kFreeBSD)
+ if(${_PREFIX}_NAME MATCHES kFreeBSD)
+ set(${_PREFIX}_NAME kFreeBSD)
+ endif()
- # fix for CYGWIN which has windows version in it
- IF(${_PREFIX}_NAME MATCHES CYGWIN)
- SET(${_PREFIX}_NAME CYGWIN)
- ENDIF(${_PREFIX}_NAME MATCHES CYGWIN)
+ # fix for CYGWIN which has windows version in it
+ if(${_PREFIX}_NAME MATCHES CYGWIN)
+ set(${_PREFIX}_NAME CYGWIN)
+ endif()
# set CMAKE_SYSTEM to the CMAKE_SYSTEM_NAME
- SET(${_PREFIX} ${${_PREFIX}_NAME})
+ set(${_PREFIX} ${${_PREFIX}_NAME})
# if there is a CMAKE_SYSTEM_VERSION then add a -${CMAKE_SYSTEM_VERSION}
- IF(${_PREFIX}_VERSION)
- SET(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION})
- ENDIF(${_PREFIX}_VERSION)
+ if(${_PREFIX}_VERSION)
+ set(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION})
+ endif()
-ENDMACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
+endmacro()
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM)
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM)
-# this file is also executed from cpack, then we don't need to generate these files
+# this file is also executed from cpack, then we don't need to generate these files
# in this case there is no CMAKE_BINARY_DIR
-IF(CMAKE_BINARY_DIR)
+if(CMAKE_BINARY_DIR)
# write entry to the log file
- IF(PRESET_CMAKE_SYSTEM_NAME)
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if(PRESET_CMAKE_SYSTEM_NAME)
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n")
- ELSE(PRESET_CMAKE_SYSTEM_NAME)
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ else()
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
- ENDIF(PRESET_CMAKE_SYSTEM_NAME)
+ endif()
# if a toolchain file is used, it needs to be included in the configured file,
- # so settings done there are also available if they don't go in the cache and in TRY_COMPILE()
- SET(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED)
- IF(DEFINED CMAKE_TOOLCHAIN_FILE)
- SET(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "INCLUDE(\"${CMAKE_TOOLCHAIN_FILE}\")")
- ENDIF(DEFINED CMAKE_TOOLCHAIN_FILE)
+ # so settings done there are also available if they don't go in the cache and in try_compile()
+ set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED)
+ if(DEFINED CMAKE_TOOLCHAIN_FILE)
+ set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "include(\"${CMAKE_TOOLCHAIN_FILE}\")")
+ endif()
# configure variables set in this file for fast reload, the template file is defined at the top of this file
- CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
+ configure_file(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
+ ${CMAKE_PLATFORM_INFO_DIR}/CMakeSystem.cmake
IMMEDIATE @ONLY)
-ENDIF(CMAKE_BINARY_DIR)
+endif()
diff --git a/Modules/CMakeDetermineVSServicePack.cmake b/Modules/CMakeDetermineVSServicePack.cmake
index 33f0141..98e5bb8 100644
--- a/Modules/CMakeDetermineVSServicePack.cmake
+++ b/Modules/CMakeDetermineVSServicePack.cmake
@@ -9,6 +9,7 @@
# vc90sp1
# vc100
# vc100sp1
+# vc110
#
# Usage:
# ===========================
@@ -54,6 +55,8 @@ function(_DetermineVSServicePackFromCompiler _OUT_VAR _cl_version)
set(_version "vc100")
elseif(${_cl_version} VERSION_EQUAL "16.00.40219.01")
set(_version "vc100sp1")
+ elseif(${_cl_version} VERSION_EQUAL "17.00.50727.1")
+ set(_version "vc110")
else()
set(_version "")
endif()
diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake
index fba071a..14551d1 100644
--- a/Modules/CMakeExpandImportedTargets.cmake
+++ b/Modules/CMakeExpandImportedTargets.cmake
@@ -10,7 +10,7 @@
# the first configuration from ${CMAKE_CONFIGURATION_TYPES} if set, otherwise
# ${CMAKE_BUILD_TYPE}.
# This macro is used by all Check*.cmake files which use
-# TRY_COMPILE() or TRY_RUN() and support CMAKE_REQUIRED_LIBRARIES , so that
+# try_compile() or try_run() and support CMAKE_REQUIRED_LIBRARIES , so that
# these checks support imported targets in CMAKE_REQUIRED_LIBRARIES:
# cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
# CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
@@ -76,16 +76,16 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
# guard against infinite loop: abort after 100 iterations ( 100 is arbitrary chosen)
if ("${_CCSR_LOOP_COUNTER}" LESS 100)
set(_CHECK_FOR_IMPORTED_TARGETS TRUE)
-# else ("${_CCSR_LOOP_COUNTER}" LESS 1)
+# else ()
# message(STATUS "********* aborting loop, counter : ${_CCSR_LOOP_COUNTER}")
- endif ("${_CCSR_LOOP_COUNTER}" LESS 100)
+ endif ()
# if one of the imported configurations equals ${CMAKE_TRY_COMPILE_CONFIGURATION},
# use it, otherwise simply use the first one:
list(FIND _importedConfigs "${CEIT_CONFIGURATION}" _configIndexToUse)
if("${_configIndexToUse}" EQUAL -1)
set(_configIndexToUse 0)
- endif("${_configIndexToUse}" EQUAL -1)
+ endif()
list(GET _importedConfigs ${_configIndexToUse} _importedConfigToUse)
get_target_property(_importedLocation "${_CURRENT_LIB}" IMPORTED_LOCATION_${_importedConfigToUse})
@@ -98,18 +98,18 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
# message(STATUS "Appending link interface lib ${_currentLinkInterfaceLib}")
if(_currentLinkInterfaceLib)
list(APPEND _CCSR_NEW_REQ_LIBS "${_currentLinkInterfaceLib}" )
- endif(_currentLinkInterfaceLib)
- endforeach(_currentLinkInterfaceLib "${_linkInterfaceLibs}")
- endif(_linkInterfaceLibs)
- else(_importedConfigs)
+ endif()
+ endforeach()
+ endif()
+ else()
# "Normal" libraries are just used as they are.
list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
# message(STATUS "Appending lib directly: ${_CURRENT_LIB}")
- endif(_importedConfigs)
- endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
+ endif()
+ endforeach()
set(_CCSR_REQ_LIBS ${_CCSR_NEW_REQ_LIBS} )
- endwhile(_CHECK_FOR_IMPORTED_TARGETS)
+ endwhile()
# Finally we iterate once more over all libraries. This loop only removes
# all remaining imported target names (there shouldn't be any left anyway).
@@ -119,10 +119,10 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
if (NOT _importedConfigs)
list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
# message(STATUS "final: appending ${_CURRENT_LIB}")
- else (NOT _importedConfigs)
+ else ()
# message(STATUS "final: skipping ${_CURRENT_LIB}")
- endif (NOT _importedConfigs)
- endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
+ endif ()
+ endforeach()
# message(STATUS "setting -${_RESULT}- to -${_CCSR_NEW_REQ_LIBS}-")
set(${_RESULT} "${_CCSR_NEW_REQ_LIBS}" PARENT_SCOPE)
diff --git a/Modules/CMakeExportBuildSettings.cmake b/Modules/CMakeExportBuildSettings.cmake
index 8d316b9..a18f950 100644
--- a/Modules/CMakeExportBuildSettings.cmake
+++ b/Modules/CMakeExportBuildSettings.cmake
@@ -13,24 +13,24 @@
# License text for the above reference.)
# This module is purposely no longer documented. It does nothing useful.
-IF(NOT "${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS 2.7)
- MESSAGE(FATAL_ERROR
+if(NOT "${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS 2.7)
+ message(FATAL_ERROR
"The functionality of this module has been dropped as of CMake 2.8. "
"It was deemed harmful (confusing users by changing their compiler). "
"Please remove calls to the CMAKE_EXPORT_BUILD_SETTINGS macro and "
"stop including this module. "
"If this project generates any files for use by external projects, "
"remove any use of the CMakeImportBuildSettings module from them.")
-ENDIF()
+endif()
# This macro used to store build settings of a project in a file to be
# loaded by another project using CMAKE_IMPORT_BUILD_SETTINGS. Now it
# creates a file that refuses to load (with comment explaining why).
-MACRO(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE)
- IF(${SETTINGS_FILE} MATCHES ".+")
- CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in
+macro(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE)
+ if(${SETTINGS_FILE} MATCHES ".+")
+ configure_file(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in
${SETTINGS_FILE} @ONLY IMMEDIATE)
- ELSE(${SETTINGS_FILE} MATCHES ".+")
- MESSAGE(SEND_ERROR "CMAKE_EXPORT_BUILD_SETTINGS called with no argument.")
- ENDIF(${SETTINGS_FILE} MATCHES ".+")
-ENDMACRO(CMAKE_EXPORT_BUILD_SETTINGS)
+ else()
+ message(SEND_ERROR "CMAKE_EXPORT_BUILD_SETTINGS called with no argument.")
+ endif()
+endmacro()
diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
index 455f95f..1fa0157 100644
--- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
+++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
@@ -18,39 +18,42 @@
# so that they can 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 _resultIncludeDirs _resultDefines)
- SET(${_resultIncludeDirs})
- SET(_gccOutput)
- FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
-
- IF (${_lang} STREQUAL "c++")
- SET(_compilerExecutable "${CMAKE_CXX_COMPILER}")
- SET(_arg1 "${CMAKE_CXX_COMPILER_ARG1}")
- ELSE ()
- SET(_compilerExecutable "${CMAKE_C_COMPILER}")
- SET(_arg1 "${CMAKE_C_COMPILER_ARG1}")
- ENDIF ()
- EXECUTE_PROCESS(COMMAND ${_compilerExecutable} ${_arg1} -v -E -x ${_lang} -dD dummy
+macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines)
+ set(${_resultIncludeDirs})
+ set(_gccOutput)
+ file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
+
+ if (${_lang} STREQUAL "c++")
+ set(_compilerExecutable "${CMAKE_CXX_COMPILER}")
+ set(_arg1 "${CMAKE_CXX_COMPILER_ARG1}")
+ else ()
+ set(_compilerExecutable "${CMAKE_C_COMPILER}")
+ set(_arg1 "${CMAKE_C_COMPILER_ARG1}")
+ endif ()
+ execute_process(COMMAND ${_compilerExecutable} ${_arg1} -v -E -x ${_lang} -dD dummy
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
ERROR_VARIABLE _gccOutput
OUTPUT_VARIABLE _gccStdout )
- FILE(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
+ 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" )
+ if( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+ *\n) *End of (search) list" )
# 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)
+ string(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
+ foreach(nextLine ${_includeLines})
+ # on OSX, gcc says things like this: "/System/Library/Frameworks (framework directory)", strip the last part
+ string(REGEX REPLACE "\\(framework directory\\)" "" nextLineNoFramework "${nextLine}")
+ # strip spaces at the beginning and the end
+ string(STRIP "${nextLineNoFramework}" _includePath)
+ list(APPEND ${_resultIncludeDirs} "${_includePath}")
+ endforeach()
- ENDIF()
+ endif()
# now find the builtin macros:
- STRING(REGEX MATCHALL "#define[^\n]+\n" _defineLines "${_gccStdout}")
+ 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__))
@@ -59,51 +62,51 @@ MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
# #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}-")
+ 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)
+ list(APPEND ${_resultDefines} "${_name}")
+ if(_value)
+ list(APPEND ${_resultDefines} "${_value}")
+ else()
+ list(APPEND ${_resultDefines} " ")
+ endif()
+ endforeach()
-ENDMACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang)
+endmacro()
# Save the current LC_ALL, LC_MESSAGES, and LANG environment variables and set them
# to "C" that way GCC's "search starts here" text is in English and we can grok it.
-SET(_orig_lc_all $ENV{LC_ALL})
-SET(_orig_lc_messages $ENV{LC_MESSAGES})
-SET(_orig_lang $ENV{LANG})
+set(_orig_lc_all $ENV{LC_ALL})
+set(_orig_lc_messages $ENV{LC_MESSAGES})
+set(_orig_lang $ENV{LANG})
-SET(ENV{LC_ALL} C)
-SET(ENV{LC_MESSAGES} C)
-SET(ENV{LANG} C)
+set(ENV{LC_ALL} C)
+set(ENV{LC_MESSAGES} C)
+set(ENV{LANG} C)
# Now check for C, works for gcc and Intel compiler at least
-IF (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS)
- IF ("${CMAKE_C_COMPILER_ID}" MATCHES GNU OR "${CMAKE_C_COMPILER_ID}" MATCHES Intel)
+if (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS)
+ if ("${CMAKE_C_COMPILER_ID}" MATCHES GNU OR "${CMAKE_C_COMPILER_ID}" MATCHES Intel)
_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c _dirs _defines)
- SET(CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "C compiler system include directories")
- SET(CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "C compiler system defined macros")
- ENDIF ()
-ENDIF ()
+ set(CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "C compiler system include directories")
+ set(CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "C compiler system defined macros")
+ endif ()
+endif ()
# And now the same for C++
-IF (NOT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS)
- IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Intel)
+if (NOT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS)
+ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Intel)
_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs _defines)
- SET(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "CXX compiler system include directories")
- SET(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "CXX compiler system defined macros")
- ENDIF ()
-ENDIF ()
+ set(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "CXX compiler system include directories")
+ set(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "CXX compiler system defined macros")
+ endif ()
+endif ()
# Restore original LC_ALL, LC_MESSAGES, and LANG
-SET(ENV{LC_ALL} ${_orig_lc_all})
-SET(ENV{LC_MESSAGES} ${_orig_lc_messages})
-SET(ENV{LANG} ${_orig_lang})
+set(ENV{LC_ALL} ${_orig_lc_all})
+set(ENV{LC_MESSAGES} ${_orig_lc_messages})
+set(ENV{LANG} ${_orig_lang})
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index 64ec403..e08c1c6 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -1,13 +1,13 @@
# search for additional tools required for C/C++ (and other languages ?)
#
-# If the internal cmake variable _CMAKE_TOOLCHAIN_PREFIX is set, this is used
+# If the internal cmake variable _CMAKE_TOOLCHAIN_PREFIX is set, this is used
# as prefix for the tools (e.g. arm-elf-gcc etc.)
# If the cmake variable _CMAKE_TOOLCHAIN_LOCATION is set, the compiler is
-# searched only there. The other tools are at first searched there, then
+# searched only there. The other tools are at first searched there, then
# also in the default locations.
#
-# Sets the following variables:
+# Sets the following variables:
# CMAKE_AR
# CMAKE_RANLIB
# CMAKE_LINKER
@@ -30,46 +30,42 @@
# License text for the above reference.)
# if it's the MS C/CXX compiler, search for link
-IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
+if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
- FIND_PROGRAM(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+ find_program(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
- MARK_AS_ADVANCED(CMAKE_LINKER)
+ mark_as_advanced(CMAKE_LINKER)
# in all other cases search for ar, ranlib, etc.
-ELSE("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
- OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
- OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+else()
- FIND_PROGRAM(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+ find_program(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
- FIND_PROGRAM(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
- IF(NOT CMAKE_RANLIB)
- SET(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib")
- ENDIF(NOT CMAKE_RANLIB)
+ find_program(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+ if(NOT CMAKE_RANLIB)
+ set(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib")
+ endif()
- FIND_PROGRAM(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
- FIND_PROGRAM(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
- FIND_PROGRAM(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
- FIND_PROGRAM(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
- FIND_PROGRAM(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+ find_program(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+ find_program(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+ find_program(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+ find_program(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+ find_program(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
- MARK_AS_ADVANCED(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY)
+ mark_as_advanced(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY)
-ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
- OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
- OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+endif()
# on Apple there really should be install_name_tool
-IF(APPLE)
- FIND_PROGRAM(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+if(APPLE)
+ find_program(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
- IF(NOT CMAKE_INSTALL_NAME_TOOL)
- MESSAGE(FATAL_ERROR "Could not find install_name_tool, please check your installation.")
- ENDIF(NOT CMAKE_INSTALL_NAME_TOOL)
+ if(NOT CMAKE_INSTALL_NAME_TOOL)
+ message(FATAL_ERROR "Could not find install_name_tool, please check your installation.")
+ endif()
- MARK_AS_ADVANCED(CMAKE_INSTALL_NAME_TOOL)
-ENDIF(APPLE)
+ mark_as_advanced(CMAKE_INSTALL_NAME_TOOL)
+endif()
diff --git a/Modules/CMakeFindCodeBlocks.cmake b/Modules/CMakeFindCodeBlocks.cmake
index 23f2c82..f8d8d59 100644
--- a/Modules/CMakeFindCodeBlocks.cmake
+++ b/Modules/CMakeFindCodeBlocks.cmake
@@ -15,11 +15,11 @@
# This file is included in CMakeSystemSpecificInformation.cmake if
# the CodeBlocks extra generator has been selected.
-FIND_PROGRAM(CMAKE_CODEBLOCKS_EXECUTABLE NAMES codeblocks DOC "The CodeBlocks executable")
+find_program(CMAKE_CODEBLOCKS_EXECUTABLE NAMES codeblocks DOC "The CodeBlocks executable")
-IF(CMAKE_CODEBLOCKS_EXECUTABLE)
- SET(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} <PROJECT_FILE>" )
-ENDIF(CMAKE_CODEBLOCKS_EXECUTABLE)
+if(CMAKE_CODEBLOCKS_EXECUTABLE)
+ set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} <PROJECT_FILE>" )
+endif()
# Determine builtin macros and include dirs:
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake
index a4264e7..37b72fa 100644
--- a/Modules/CMakeFindEclipseCDT4.cmake
+++ b/Modules/CMakeFindEclipseCDT4.cmake
@@ -15,65 +15,71 @@
# This file is included in CMakeSystemSpecificInformation.cmake if
# the Eclipse CDT4 extra generator has been selected.
-FIND_PROGRAM(CMAKE_ECLIPSE_EXECUTABLE NAMES eclipse DOC "The Eclipse executable")
+find_program(CMAKE_ECLIPSE_EXECUTABLE NAMES eclipse DOC "The Eclipse executable")
-FUNCTION(_FIND_ECLIPSE_VERSION)
+function(_FIND_ECLIPSE_VERSION)
# This code is in a function so the variables used here have only local scope
- IF(CMAKE_ECLIPSE_EXECUTABLE)
+ if(CMAKE_ECLIPSE_EXECUTABLE)
# use REALPATH to resolve symlinks (http://public.kitware.com/Bug/view.php?id=13036)
- GET_FILENAME_COMPONENT(_REALPATH_CMAKE_ECLIPSE_EXECUTABLE "${CMAKE_ECLIPSE_EXECUTABLE}" REALPATH)
- GET_FILENAME_COMPONENT(_ECLIPSE_DIR "${_REALPATH_CMAKE_ECLIPSE_EXECUTABLE}" PATH)
- FILE(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*")
- IF("${_ECLIPSE_FEATURE_DIR}" MATCHES ".+org.eclipse.platform_([0-9]+\\.[0-9]+).+")
- SET(_ECLIPSE_VERSION ${CMAKE_MATCH_1})
- ENDIF()
- ENDIF()
+ get_filename_component(_REALPATH_CMAKE_ECLIPSE_EXECUTABLE "${CMAKE_ECLIPSE_EXECUTABLE}" REALPATH)
+ get_filename_component(_ECLIPSE_DIR "${_REALPATH_CMAKE_ECLIPSE_EXECUTABLE}" PATH)
+ file(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*")
+ if(APPLE AND NOT _ECLIPSE_FEATURE_DIR)
+ file(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/../../../features/org.eclipse.platform*")
+ endif()
+ if("${_ECLIPSE_FEATURE_DIR}" MATCHES ".+org.eclipse.platform_([0-9]+\\.[0-9]+).+")
+ set(_ECLIPSE_VERSION ${CMAKE_MATCH_1})
+ endif()
+ endif()
# Set up a map with the names of the Eclipse releases:
- SET(_ECLIPSE_VERSION_NAME_ "Unknown" )
- SET(_ECLIPSE_VERSION_NAME_3.2 "Callisto" )
- SET(_ECLIPSE_VERSION_NAME_3.3 "Europa" )
- SET(_ECLIPSE_VERSION_NAME_3.4 "Ganymede" )
- SET(_ECLIPSE_VERSION_NAME_3.5 "Galileo" )
- SET(_ECLIPSE_VERSION_NAME_3.6 "Helios" )
- SET(_ECLIPSE_VERSION_NAME_3.7 "Indigo" )
+ set(_ECLIPSE_VERSION_NAME_ "Unknown" )
+ set(_ECLIPSE_VERSION_NAME_3.2 "Callisto" )
+ set(_ECLIPSE_VERSION_NAME_3.3 "Europa" )
+ set(_ECLIPSE_VERSION_NAME_3.4 "Ganymede" )
+ set(_ECLIPSE_VERSION_NAME_3.5 "Galileo" )
+ set(_ECLIPSE_VERSION_NAME_3.6 "Helios" )
+ set(_ECLIPSE_VERSION_NAME_3.7 "Indigo" )
+ set(_ECLIPSE_VERSION_NAME_4.2 "Juno" )
- IF(_ECLIPSE_VERSION)
- MESSAGE(STATUS "Found Eclipse version ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})")
- ELSE()
- SET(_ECLIPSE_VERSION "3.6" )
- MESSAGE(STATUS "Could not determine Eclipse version, assuming at least ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}}). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.")
- ENDIF()
+ if(_ECLIPSE_VERSION)
+ message(STATUS "Found Eclipse version ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})")
+ else()
+ set(_ECLIPSE_VERSION "3.6" )
+ message(STATUS "Could not determine Eclipse version, assuming at least ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}}). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.")
+ endif()
- SET(CMAKE_ECLIPSE_VERSION "${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})" CACHE STRING "The version of Eclipse. If Eclipse has not been found, 3.6 (Helios) is assumed.")
- SET_PROPERTY(CACHE CMAKE_ECLIPSE_VERSION PROPERTY STRINGS "3.2 (${_ECLIPSE_VERSION_NAME_3.2})"
+ set(CMAKE_ECLIPSE_VERSION "${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})" CACHE STRING "The version of Eclipse. If Eclipse has not been found, 3.6 (Helios) is assumed.")
+ set_property(CACHE CMAKE_ECLIPSE_VERSION PROPERTY STRINGS "3.2 (${_ECLIPSE_VERSION_NAME_3.2})"
"3.3 (${_ECLIPSE_VERSION_NAME_3.3})"
"3.4 (${_ECLIPSE_VERSION_NAME_3.4})"
"3.5 (${_ECLIPSE_VERSION_NAME_3.5})"
"3.6 (${_ECLIPSE_VERSION_NAME_3.6})"
- "3.7 (${_ECLIPSE_VERSION_NAME_3.7})")
-ENDFUNCTION()
+ "3.7 (${_ECLIPSE_VERSION_NAME_3.7})"
+ "4.2 (${_ECLIPSE_VERSION_NAME_4.2})"
+ )
+endfunction()
_FIND_ECLIPSE_VERSION()
# Try to find out how many CPUs we have and set the -j argument for make accordingly
-SET(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "")
+set(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "")
-INCLUDE(ProcessorCount)
+include(ProcessorCount)
PROCESSORCOUNT(_CMAKE_ECLIPSE_PROCESSOR_COUNT)
# Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name
# (we may also get here in the future e.g. for ninja)
-IF("${_CMAKE_ECLIPSE_PROCESSOR_COUNT}" GREATER 1 AND UNIX AND "${CMAKE_MAKE_PROGRAM}" MATCHES make)
- SET(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "-j${_CMAKE_ECLIPSE_PROCESSOR_COUNT}")
-ENDIF()
+if("${_CMAKE_ECLIPSE_PROCESSOR_COUNT}" GREATER 1 AND UNIX AND "${CMAKE_MAKE_PROGRAM}" MATCHES make)
+ set(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "-j${_CMAKE_ECLIPSE_PROCESSOR_COUNT}")
+endif()
# This variable is used by the Eclipse generator and appended to the make invocation commands.
-SET(CMAKE_ECLIPSE_MAKE_ARGUMENTS "${_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS}" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds")
+set(CMAKE_ECLIPSE_MAKE_ARGUMENTS "${_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS}" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds")
# This variable is used by the Eclipse generator in out-of-source builds only.
-SET(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT FALSE CACHE BOOL "If enabled, CMake will generate a source project for Eclipse in CMAKE_SOURCE_DIR")
-MARK_AS_ADVANCED(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT)
+set(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT FALSE CACHE BOOL "If enabled, CMake will generate a source project for Eclipse in CMAKE_SOURCE_DIR")
+mark_as_advanced(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT)
# Determine builtin macros and include dirs:
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
diff --git a/Modules/CMakeFindFrameworks.cmake b/Modules/CMakeFindFrameworks.cmake
index 001da20..7fdeb84 100644
--- a/Modules/CMakeFindFrameworks.cmake
+++ b/Modules/CMakeFindFrameworks.cmake
@@ -13,20 +13,20 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
- SET(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)
- MACRO(CMAKE_FIND_FRAMEWORKS fwk)
- SET(${fwk}_FRAMEWORKS)
- IF(APPLE)
- FOREACH(dir
+if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
+ set(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)
+ macro(CMAKE_FIND_FRAMEWORKS fwk)
+ set(${fwk}_FRAMEWORKS)
+ if(APPLE)
+ foreach(dir
~/Library/Frameworks/${fwk}.framework
/Library/Frameworks/${fwk}.framework
/System/Library/Frameworks/${fwk}.framework
/Network/Library/Frameworks/${fwk}.framework)
- IF(EXISTS ${dir})
- SET(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
- ENDIF(EXISTS ${dir})
- ENDFOREACH(dir)
- ENDIF(APPLE)
- ENDMACRO(CMAKE_FIND_FRAMEWORKS)
-ENDIF(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
+ if(EXISTS ${dir})
+ set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
+ endif()
+ endforeach()
+ endif()
+ endmacro()
+endif()
diff --git a/Modules/CMakeFindKDevelop3.cmake b/Modules/CMakeFindKDevelop3.cmake
index 331dc6e..2abd523 100644
--- a/Modules/CMakeFindKDevelop3.cmake
+++ b/Modules/CMakeFindKDevelop3.cmake
@@ -15,9 +15,9 @@
# This file is included in CMakeSystemSpecificInformation.cmake if
# the KDevelop3 extra generator has been selected.
-FIND_PROGRAM(CMAKE_KDEVELOP3_EXECUTABLE NAMES kdevelop DOC "The KDevelop3 executable")
+find_program(CMAKE_KDEVELOP3_EXECUTABLE NAMES kdevelop DOC "The KDevelop3 executable")
-IF(CMAKE_KDEVELOP3_EXECUTABLE)
- SET(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" )
-ENDIF(CMAKE_KDEVELOP3_EXECUTABLE)
+if(CMAKE_KDEVELOP3_EXECUTABLE)
+ set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" )
+endif()
diff --git a/Modules/CMakeFindPackageMode.cmake b/Modules/CMakeFindPackageMode.cmake
index 59c7ba5..cea0187 100644
--- a/Modules/CMakeFindPackageMode.cmake
+++ b/Modules/CMakeFindPackageMode.cmake
@@ -47,12 +47,14 @@ macro(ENABLE_LANGUAGE)
# But in --find-package mode, we don't want (and can't) enable any language.
endmacro()
+set(CMAKE_PLATFORM_INFO_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
+
include(CMakeDetermineSystem)
# short-cut some tests on Darwin, see Darwin-GNU.cmake:
if("${CMAKE_SYSTEM_NAME}" MATCHES Darwin AND "${COMPILER_ID}" MATCHES GNU)
- set(${CMAKE_${LANGUAGE}_HAS_ISYSROOT} 0 )
- set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "")
+ set(CMAKE_${LANGUAGE}_SYSROOT_FLAG "")
+ set(CMAKE_${LANGUAGE}_OSX_DEPLOYMENT_TARGET_FLAG "")
endif()
# Also load the system specific file, which sets up e.g. the search paths.
@@ -179,7 +181,7 @@ if(${NAME}_FOUND OR ${UPPERCASE_NAME}_FOUND)
set_compile_flags_var(${NAME})
elseif("${MODE}" STREQUAL "LINK")
set_link_flags_var(${NAME})
- else("${MODE}" STREQUAL "LINK")
+ else()
message(FATAL_ERROR "Invalid mode argument ${MODE} given.")
endif()
diff --git a/Modules/CMakeFindWMake.cmake b/Modules/CMakeFindWMake.cmake
index 6972c4c..60275ae 100644
--- a/Modules/CMakeFindWMake.cmake
+++ b/Modules/CMakeFindWMake.cmake
@@ -12,6 +12,6 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET (CMAKE_MAKE_PROGRAM "wmake" CACHE STRING
+set (CMAKE_MAKE_PROGRAM "wmake" CACHE STRING
"Program used to build from makefiles.")
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeFindXCode.cmake b/Modules/CMakeFindXCode.cmake
index 53967b5..5c4f596 100644
--- a/Modules/CMakeFindXCode.cmake
+++ b/Modules/CMakeFindXCode.cmake
@@ -12,9 +12,9 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
NAMES xcodebuild
PATHS
/usr/bin
)
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeForceCompiler.cmake b/Modules/CMakeForceCompiler.cmake
index 2a839fd..207c8ad 100644
--- a/Modules/CMakeForceCompiler.cmake
+++ b/Modules/CMakeForceCompiler.cmake
@@ -24,8 +24,8 @@
# information tests.
#
# So a simple toolchain file could look like this:
-# INCLUDE (CMakeForceCompiler)
-# SET(CMAKE_SYSTEM_NAME Generic)
+# include (CMakeForceCompiler)
+# set(CMAKE_SYSTEM_NAME Generic)
# CMAKE_FORCE_C_COMPILER (chc12 MetrowerksHicross)
# CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
@@ -42,41 +42,38 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-MACRO(CMAKE_FORCE_C_COMPILER compiler id)
- SET(CMAKE_C_COMPILER "${compiler}")
- SET(CMAKE_C_COMPILER_ID_RUN TRUE)
- SET(CMAKE_C_COMPILER_ID ${id})
- SET(CMAKE_C_COMPILER_WORKS TRUE)
- SET(CMAKE_C_COMPILER_FORCED TRUE)
+macro(CMAKE_FORCE_C_COMPILER compiler id)
+ set(CMAKE_C_COMPILER "${compiler}")
+ set(CMAKE_C_COMPILER_ID_RUN TRUE)
+ set(CMAKE_C_COMPILER_ID ${id})
+ set(CMAKE_C_COMPILER_FORCED TRUE)
# Set old compiler id variables.
- IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
- SET(CMAKE_COMPILER_IS_GNUCC 1)
- ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
-ENDMACRO(CMAKE_FORCE_C_COMPILER)
+ if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
+ set(CMAKE_COMPILER_IS_GNUCC 1)
+ endif()
+endmacro()
-MACRO(CMAKE_FORCE_CXX_COMPILER compiler id)
- SET(CMAKE_CXX_COMPILER "${compiler}")
- SET(CMAKE_CXX_COMPILER_ID_RUN TRUE)
- SET(CMAKE_CXX_COMPILER_ID ${id})
- SET(CMAKE_CXX_COMPILER_WORKS TRUE)
- SET(CMAKE_CXX_COMPILER_FORCED TRUE)
+macro(CMAKE_FORCE_CXX_COMPILER compiler id)
+ set(CMAKE_CXX_COMPILER "${compiler}")
+ set(CMAKE_CXX_COMPILER_ID_RUN TRUE)
+ set(CMAKE_CXX_COMPILER_ID ${id})
+ set(CMAKE_CXX_COMPILER_FORCED TRUE)
# Set old compiler id variables.
- IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
- SET(CMAKE_COMPILER_IS_GNUCXX 1)
- ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
-ENDMACRO(CMAKE_FORCE_CXX_COMPILER)
+ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+ set(CMAKE_COMPILER_IS_GNUCXX 1)
+ endif()
+endmacro()
-MACRO(CMAKE_FORCE_Fortran_COMPILER compiler id)
- SET(CMAKE_Fortran_COMPILER "${compiler}")
- SET(CMAKE_Fortran_COMPILER_ID_RUN TRUE)
- SET(CMAKE_Fortran_COMPILER_ID ${id})
- SET(CMAKE_Fortran_COMPILER_WORKS TRUE)
- SET(CMAKE_Fortran_COMPILER_FORCED TRUE)
+macro(CMAKE_FORCE_Fortran_COMPILER compiler id)
+ set(CMAKE_Fortran_COMPILER "${compiler}")
+ set(CMAKE_Fortran_COMPILER_ID_RUN TRUE)
+ set(CMAKE_Fortran_COMPILER_ID ${id})
+ set(CMAKE_Fortran_COMPILER_FORCED TRUE)
# Set old compiler id variables.
- IF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
- SET(CMAKE_COMPILER_IS_GNUG77 1)
- ENDIF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
-ENDMACRO(CMAKE_FORCE_Fortran_COMPILER)
+ if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
+ set(CMAKE_COMPILER_IS_GNUG77 1)
+ endif()
+endmacro()
diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index 53d9552..55f8277 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -1,52 +1,54 @@
-SET(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@")
-SET(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@")
-SET(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
-SET(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
+set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@")
+set(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@")
+set(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
+set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
@SET_MSVC_Fortran_ARCHITECTURE_ID@
-SET(CMAKE_AR "@CMAKE_AR@")
-SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
-SET(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@)
-SET(CMAKE_Fortran_COMPILER_LOADED 1)
-SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
-SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
-IF(CMAKE_COMPILER_IS_CYGWIN)
- SET(CYGWIN 1)
- SET(UNIX 1)
-ENDIF(CMAKE_COMPILER_IS_CYGWIN)
-
-SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
-
-SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@)
-
-IF(CMAKE_COMPILER_IS_MINGW)
- SET(MINGW 1)
-ENDIF(CMAKE_COMPILER_IS_MINGW)
-SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
-SET(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95)
-SET(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
-SET(CMAKE_Fortran_LINKER_PREFERENCE 20)
-IF(UNIX)
- SET(CMAKE_Fortran_OUTPUT_EXTENSION .o)
-ELSE(UNIX)
- SET(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
-ENDIF(UNIX)
+set(CMAKE_AR "@CMAKE_AR@")
+set(CMAKE_RANLIB "@CMAKE_RANLIB@")
+set(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@)
+set(CMAKE_Fortran_COMPILER_LOADED 1)
+set(CMAKE_Fortran_COMPILER_WORKS @CMAKE_Fortran_COMPILER_WORKS@)
+set(CMAKE_Fortran_ABI_COMPILED @CMAKE_Fortran_ABI_COMPILED@)
+set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
+set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
+if(CMAKE_COMPILER_IS_CYGWIN)
+ set(CYGWIN 1)
+ set(UNIX 1)
+endif()
+
+set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
+
+set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@)
+
+if(CMAKE_COMPILER_IS_MINGW)
+ set(MINGW 1)
+endif()
+set(CMAKE_Fortran_COMPILER_ID_RUN 1)
+set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95)
+set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
+set(CMAKE_Fortran_LINKER_PREFERENCE 20)
+if(UNIX)
+ set(CMAKE_Fortran_OUTPUT_EXTENSION .o)
+else()
+ set(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
+endif()
# Save compiler ABI information.
-SET(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
-SET(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
-SET(CMAKE_Fortran_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
+set(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
+set(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
+set(CMAKE_Fortran_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
-IF(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
- SET(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
-ENDIF()
+if(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
+ set(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
+endif()
-IF(CMAKE_Fortran_COMPILER_ABI)
- SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
-ENDIF(CMAKE_Fortran_COMPILER_ABI)
+if(CMAKE_Fortran_COMPILER_ABI)
+ set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
+endif()
-IF(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
- SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
-ENDIF()
+if(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
+ set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
+endif()
-SET(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@")
-SET(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES@")
+set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@")
+set(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES@")
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index d962f4c..512ec48 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -16,163 +16,163 @@
# It also loads the available platform file for the system-compiler
# if it exists.
-SET(_INCLUDED_FILE 0)
+set(_INCLUDED_FILE 0)
# Load compiler-specific information.
-IF(CMAKE_Fortran_COMPILER_ID)
- INCLUDE(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL)
-ENDIF(CMAKE_Fortran_COMPILER_ID)
+if(CMAKE_Fortran_COMPILER_ID)
+ include(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL)
+endif()
-SET(CMAKE_BASE_NAME)
-GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE)
+set(CMAKE_BASE_NAME)
+get_filename_component(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE)
# since the gnu compiler has several names force g++
-IF(CMAKE_COMPILER_IS_GNUG77)
- SET(CMAKE_BASE_NAME g77)
-ENDIF(CMAKE_COMPILER_IS_GNUG77)
-IF(CMAKE_Fortran_COMPILER_ID)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-ENDIF(CMAKE_Fortran_COMPILER_ID)
-IF (NOT _INCLUDED_FILE)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
+if(CMAKE_COMPILER_IS_GNUG77)
+ set(CMAKE_BASE_NAME g77)
+endif()
+if(CMAKE_Fortran_COMPILER_ID)
+ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+endif()
+if (NOT _INCLUDED_FILE)
+ include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
RESULT_VARIABLE _INCLUDED_FILE)
-ENDIF (NOT _INCLUDED_FILE)
+endif ()
# We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info.
# Remove this when all compiler info is removed from system files.
-IF (NOT _INCLUDED_FILE)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
-ENDIF (NOT _INCLUDED_FILE)
+if (NOT _INCLUDED_FILE)
+ include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
+endif ()
-IF(CMAKE_Fortran_SIZEOF_DATA_PTR)
- FOREACH(f ${CMAKE_Fortran_ABI_FILES})
- INCLUDE(${f})
- ENDFOREACH()
- UNSET(CMAKE_Fortran_ABI_FILES)
-ENDIF()
+if(CMAKE_Fortran_SIZEOF_DATA_PTR)
+ foreach(f ${CMAKE_Fortran_ABI_FILES})
+ include(${f})
+ endforeach()
+ unset(CMAKE_Fortran_ABI_FILES)
+endif()
# This should be included before the _INIT variables are
-# used to initialize the cache. Since the rule variables
+# used to initialize the cache. Since the rule variables
# have if blocks on them, users can still define them here.
# But, it should still be after the platform file so changes can
# be made to those values.
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE)
# Save the full path of the file so try_compile can use it.
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
- SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
-ENDIF()
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
+endif()
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran)
# Save the full path of the file so try_compile can use it.
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran} RESULT_VARIABLE _override)
- SET(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran "${_override}")
-ENDIF()
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran} RESULT_VARIABLE _override)
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran "${_override}")
+endif()
-# Fortran needs cmake to do a requires step during its build process to
+# Fortran needs cmake to do a requires step during its build process to
# catch any modules
-SET(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1)
+set(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1)
-IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
- SET(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
-ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
+if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
+ set(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
+endif()
-IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
- SET(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
-ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
+if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
+ set(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
+endif()
-IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
- SET(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
-ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
+if(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
+ set(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
+endif()
# Create a set of shared library variable specific to Fortran
# For 90% of the systems, these are the same flags as the C versions
# so if these are not set just copy the flags from the c version
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
- SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
+ set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
+endif()
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
- SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
+ set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
+endif()
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
- SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
+ set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
+endif()
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
- SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
+endif()
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
- SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
+endif()
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
- SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
+ set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
+endif()
-IF(NOT DEFINED CMAKE_EXE_EXPORTS_Fortran_FLAG)
- SET(CMAKE_EXE_EXPORTS_Fortran_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
-ENDIF()
+if(NOT DEFINED CMAKE_EXE_EXPORTS_Fortran_FLAG)
+ set(CMAKE_EXE_EXPORTS_Fortran_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
+endif()
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
- SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
+ set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
+endif()
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
-IF(NOT CMAKE_MODULE_EXISTS)
- SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
- SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
-ENDIF(NOT CMAKE_MODULE_EXISTS)
+if(NOT CMAKE_MODULE_EXISTS)
+ set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
+ set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
+endif()
# repeat for modules
-IF(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
- SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
-ENDIF()
-
-IF(NOT DEFINED CMAKE_SHARED_MODULE_Fortran_FLAGS)
- SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
-ENDIF()
-
-IF(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
- SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG})
-ENDIF()
-
-IF(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
- SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP})
-ENDIF()
-
-IF(NOT DEFINED CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
- SET(CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG})
-ENDIF()
-
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
- SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
-ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
-
-IF(NOT CMAKE_INCLUDE_FLAG_Fortran)
- SET(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C})
-ENDIF(NOT CMAKE_INCLUDE_FLAG_Fortran)
-
-IF(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
- SET(CMAKE_INCLUDE_FLAG_SEP_Fortran ${CMAKE_INCLUDE_FLAG_SEP_C})
-ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
-
-SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
-
-SET(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")
-# avoid just having a space as the initial value for the cache
-IF(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
- SET(CMAKE_Fortran_FLAGS_INIT)
-ENDIF(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
-SET (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING
+if(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
+ set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
+endif()
+
+if(NOT DEFINED CMAKE_SHARED_MODULE_Fortran_FLAGS)
+ set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
+endif()
+
+if(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
+ set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG})
+endif()
+
+if(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
+ set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP})
+endif()
+
+if(NOT DEFINED CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
+ set(CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG})
+endif()
+
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
+ set(CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
+endif()
+
+if(NOT CMAKE_INCLUDE_FLAG_Fortran)
+ set(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C})
+endif()
+
+if(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
+ set(CMAKE_INCLUDE_FLAG_SEP_Fortran ${CMAKE_INCLUDE_FLAG_SEP_C})
+endif()
+
+set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
+
+set(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")
+# avoid just having a space as the initial value for the cache
+if(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
+ set(CMAKE_Fortran_FLAGS_INIT)
+endif()
+set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING
"Flags for Fortran compiler.")
-INCLUDE(CMakeCommonLanguageInclude)
+include(CMakeCommonLanguageInclude)
# now define the following rule variables
# CMAKE_Fortran_CREATE_SHARED_LIBRARY
@@ -181,60 +181,60 @@ INCLUDE(CMakeCommonLanguageInclude)
# CMAKE_Fortran_LINK_EXECUTABLE
# create a Fortran shared library
-IF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
- SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
+if(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
+ set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
"<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
+endif()
# create a Fortran shared module just copy the shared library rule
-IF(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
- SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
-ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
+if(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
+ set(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
+endif()
# Create a static archive incrementally for large object file counts.
# If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these.
-IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE)
- SET(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
-ENDIF()
-IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND)
- SET(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
-ENDIF()
-IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH)
- SET(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
-ENDIF()
+if(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE)
+ set(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
+endif()
+if(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND)
+ set(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
+endif()
+if(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH)
+ set(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
+endif()
# compile a Fortran file into an object file
# (put -o after -c to workaround bug in at least one mpif77 wrapper)
-IF(NOT CMAKE_Fortran_COMPILE_OBJECT)
- SET(CMAKE_Fortran_COMPILE_OBJECT
+if(NOT CMAKE_Fortran_COMPILE_OBJECT)
+ set(CMAKE_Fortran_COMPILE_OBJECT
"<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -c <SOURCE> -o <OBJECT>")
-ENDIF(NOT CMAKE_Fortran_COMPILE_OBJECT)
+endif()
# link a fortran program
-IF(NOT CMAKE_Fortran_LINK_EXECUTABLE)
- SET(CMAKE_Fortran_LINK_EXECUTABLE
+if(NOT CMAKE_Fortran_LINK_EXECUTABLE)
+ set(CMAKE_Fortran_LINK_EXECUTABLE
"<CMAKE_Fortran_COMPILER> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
-ENDIF(NOT CMAKE_Fortran_LINK_EXECUTABLE)
+endif()
-IF(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
- SET(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}"
+if(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
+ set(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}"
CACHE STRING "Libraries linked by defalut with all Fortran applications.")
- MARK_AS_ADVANCED(CMAKE_Fortran_STANDARD_LIBRARIES)
-ENDIF(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
+ mark_as_advanced(CMAKE_Fortran_STANDARD_LIBRARIES)
+endif()
-IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
- SET (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING
+if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+ set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the compiler during debug builds.")
- SET (CMAKE_Fortran_FLAGS_MINSIZEREL "${CMAKE_Fortran_FLAGS_MINSIZEREL_INIT}" CACHE STRING
+ set (CMAKE_Fortran_FLAGS_MINSIZEREL "${CMAKE_Fortran_FLAGS_MINSIZEREL_INIT}" CACHE STRING
"Flags used by the compiler during release minsize builds.")
- SET (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE_INIT}" CACHE STRING
+ set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE_INIT}" CACHE STRING
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
- SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
+ set (CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
"Flags used by the compiler during Release with Debug Info builds.")
-ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif()
-MARK_AS_ADVANCED(
+mark_as_advanced(
CMAKE_Fortran_FLAGS
CMAKE_Fortran_FLAGS_DEBUG
CMAKE_Fortran_FLAGS_MINSIZEREL
@@ -242,4 +242,4 @@ CMAKE_Fortran_FLAGS_RELEASE
CMAKE_Fortran_FLAGS_RELWITHDEBINFO)
# set this variable so we can avoid loading this more than once.
-SET(CMAKE_Fortran_INFORMATION_LOADED 1)
+set(CMAKE_Fortran_INFORMATION_LOADED 1)
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index 0ccbfac..8a14aea 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -12,60 +12,60 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") # -rpath
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
-SET(CMAKE_INCLUDE_FLAG_C "-I") # -I
-SET(CMAKE_INCLUDE_FLAG_C_SEP "") # , or empty
-SET(CMAKE_LIBRARY_PATH_FLAG "-L")
-SET(CMAKE_LIBRARY_PATH_TERMINATOR "") # for the Digital Mars D compiler the link paths have to be terminated with a "/"
-SET(CMAKE_LINK_LIBRARY_FLAG "-l")
-
-SET(CMAKE_LINK_LIBRARY_SUFFIX "")
-SET(CMAKE_STATIC_LIBRARY_PREFIX "lib")
-SET(CMAKE_STATIC_LIBRARY_SUFFIX ".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")
-
-SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") # -rpath
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
+set(CMAKE_INCLUDE_FLAG_C "-I") # -I
+set(CMAKE_INCLUDE_FLAG_C_SEP "") # , or empty
+set(CMAKE_LIBRARY_PATH_FLAG "-L")
+set(CMAKE_LIBRARY_PATH_TERMINATOR "") # for the Digital Mars D compiler the link paths have to be terminated with a "/"
+set(CMAKE_LINK_LIBRARY_FLAG "-l")
+
+set(CMAKE_LINK_LIBRARY_SUFFIX "")
+set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
+set(CMAKE_STATIC_LIBRARY_SUFFIX ".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")
+
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
# basically all general purpose OSs support shared libs
-SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
-SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL
+set (CMAKE_SKIP_RPATH "NO" CACHE BOOL
"If set, runtime paths are not added when using shared libraries.")
-SET (CMAKE_SKIP_INSTALL_RPATH "NO" CACHE BOOL
+set (CMAKE_SKIP_INSTALL_RPATH "NO" CACHE BOOL
"If set, runtime paths are not added when installing shared libraries, but are added when building.")
-SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
+set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
-IF(CMAKE_GENERATOR MATCHES "Makefiles")
- SET(CMAKE_COLOR_MAKEFILE ON CACHE BOOL
+if(CMAKE_GENERATOR MATCHES "Makefiles")
+ set(CMAKE_COLOR_MAKEFILE ON CACHE BOOL
"Enable/Disable color output during build."
)
- MARK_AS_ADVANCED(CMAKE_COLOR_MAKEFILE)
- IF(DEFINED CMAKE_RULE_MESSAGES)
- SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
- ENDIF(DEFINED CMAKE_RULE_MESSAGES)
- IF(CMAKE_GENERATOR MATCHES "Unix Makefiles")
- SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
+ mark_as_advanced(CMAKE_COLOR_MAKEFILE)
+ if(DEFINED CMAKE_RULE_MESSAGES)
+ set_property(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
+ endif()
+ if(CMAKE_GENERATOR MATCHES "Unix Makefiles")
+ set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
"Enable/Disable output of compile commands during generation."
)
- MARK_AS_ADVANCED(CMAKE_EXPORT_COMPILE_COMMANDS)
- ENDIF(CMAKE_GENERATOR MATCHES "Unix Makefiles")
-ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
+ mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
+ endif()
+endif()
-IF(CMAKE_GENERATOR MATCHES "Ninja")
- SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
+if(CMAKE_GENERATOR MATCHES "Ninja")
+ set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
"Enable/Disable output of compile commands during generation."
)
- MARK_AS_ADVANCED(CMAKE_EXPORT_COMPILE_COMMANDS)
-ENDIF(CMAKE_GENERATOR MATCHES "Ninja")
+ mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
+endif()
# GetDefaultWindowsPrefixBase
#
@@ -160,27 +160,27 @@ endfunction()
# was initialized by the block below. This is useful for user
# projects to change the default prefix while still allowing the
# command line to override it.
-IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
- SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
-ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
+if(NOT DEFINED CMAKE_INSTALL_PREFIX)
+ set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
+endif()
# Choose a default install prefix for this platform.
-IF(CMAKE_HOST_UNIX)
- SET(CMAKE_INSTALL_PREFIX "/usr/local"
+if(CMAKE_HOST_UNIX)
+ set(CMAKE_INSTALL_PREFIX "/usr/local"
CACHE PATH "Install path prefix, prepended onto install directories.")
-ELSE(CMAKE_HOST_UNIX)
+else()
GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
- SET(CMAKE_INSTALL_PREFIX
+ set(CMAKE_INSTALL_PREFIX
"${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
CACHE PATH "Install path prefix, prepended onto install directories.")
- SET(CMAKE_GENERIC_PROGRAM_FILES)
-ENDIF(CMAKE_HOST_UNIX)
+ set(CMAKE_GENERIC_PROGRAM_FILES)
+endif()
# Set a variable which will be used as component name in install() commands
# where no COMPONENT has been given:
-SET(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "Unspecified")
+set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "Unspecified")
-MARK_AS_ADVANCED(
+mark_as_advanced(
CMAKE_SKIP_RPATH
CMAKE_SKIP_INSTALL_RPATH
CMAKE_VERBOSE_MAKEFILE
diff --git a/Modules/CMakeImportBuildSettings.cmake b/Modules/CMakeImportBuildSettings.cmake
index 848d894..60b887a 100644
--- a/Modules/CMakeImportBuildSettings.cmake
+++ b/Modules/CMakeImportBuildSettings.cmake
@@ -16,9 +16,9 @@
# This macro used to load build settings from another project that
# stored settings using the CMAKE_EXPORT_BUILD_SETTINGS macro.
-MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
- IF(${SETTINGS_FILE} MATCHES ".+")
- ELSE(${SETTINGS_FILE} MATCHES ".+")
- MESSAGE(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.")
- ENDIF(${SETTINGS_FILE} MATCHES ".+")
-ENDMACRO(CMAKE_IMPORT_BUILD_SETTINGS)
+macro(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
+ if(${SETTINGS_FILE} MATCHES ".+")
+ else()
+ message(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.")
+ endif()
+endmacro()
diff --git a/Modules/CMakeJOMFindMake.cmake b/Modules/CMakeJOMFindMake.cmake
index 617f3bb..cb3cf12 100644
--- a/Modules/CMakeJOMFindMake.cmake
+++ b/Modules/CMakeJOMFindMake.cmake
@@ -13,6 +13,6 @@
# License text for the above reference.)
-SET (CMAKE_MAKE_PROGRAM "jom" CACHE STRING
+set (CMAKE_MAKE_PROGRAM "jom" CACHE STRING
"Program used to build from makefiles.")
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeJavaCompiler.cmake.in b/Modules/CMakeJavaCompiler.cmake.in
index 79c9288..cd4158c 100644
--- a/Modules/CMakeJavaCompiler.cmake.in
+++ b/Modules/CMakeJavaCompiler.cmake.in
@@ -1,13 +1,13 @@
-SET(CMAKE_Java_COMPILER "@CMAKE_Java_COMPILER@")
-SET(CMAKE_Java_COMPILER_ARG1 "@CMAKE_Java_COMPILER_ARG1@")
-SET(CMAKE_Java_RUNTIME "@CMAKE_Java_RUNTIME@")
-SET(CMAKE_Java_ARCHIVE "@CMAKE_Java_ARCHIVE@")
-SET(CMAKE_Java_COMPILER_LOADED 1)
+set(CMAKE_Java_COMPILER "@CMAKE_Java_COMPILER@")
+set(CMAKE_Java_COMPILER_ARG1 "@CMAKE_Java_COMPILER_ARG1@")
+set(CMAKE_Java_RUNTIME "@CMAKE_Java_RUNTIME@")
+set(CMAKE_Java_ARCHIVE "@CMAKE_Java_ARCHIVE@")
+set(CMAKE_Java_COMPILER_LOADED 1)
-SET(CMAKE_Java_SOURCE_FILE_EXTENSIONS java)
-SET(CMAKE_Java_LINKER_PREFERENCE 40)
-SET(CMAKE_Java_OUTPUT_EXTENSION .class)
-SET(CMAKE_Java_OUTPUT_EXTENSION_REPLACE 1)
-SET(CMAKE_STATIC_LIBRARY_PREFIX_Java "")
-SET(CMAKE_STATIC_LIBRARY_SUFFIX_Java ".jar")
-SET(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")
+set(CMAKE_Java_SOURCE_FILE_EXTENSIONS java)
+set(CMAKE_Java_LINKER_PREFERENCE 40)
+set(CMAKE_Java_OUTPUT_EXTENSION .class)
+set(CMAKE_Java_OUTPUT_EXTENSION_REPLACE 1)
+set(CMAKE_STATIC_LIBRARY_PREFIX_Java "")
+set(CMAKE_STATIC_LIBRARY_SUFFIX_Java ".jar")
+set(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")
diff --git a/Modules/CMakeJavaInformation.cmake b/Modules/CMakeJavaInformation.cmake
index e192db1..928c6ac 100644
--- a/Modules/CMakeJavaInformation.cmake
+++ b/Modules/CMakeJavaInformation.cmake
@@ -13,47 +13,47 @@
# License text for the above reference.)
# This should be included before the _INIT variables are
-# used to initialize the cache. Since the rule variables
+# used to initialize the cache. Since the rule variables
# have if blocks on them, users can still define them here.
# But, it should still be after the platform file so changes can
# be made to those values.
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE)
# Save the full path of the file so try_compile can use it.
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
- SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
-ENDIF()
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
+endif()
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE_Java)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE_Java)
# Save the full path of the file so try_compile can use it.
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Java} RESULT_VARIABLE _override)
- SET(CMAKE_USER_MAKE_RULES_OVERRIDE_Java "${_override}")
-ENDIF()
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Java} RESULT_VARIABLE _override)
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE_Java "${_override}")
+endif()
# this is a place holder if java needed flags for javac they would go here.
-IF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
-# IF(WIN32)
-# SET(class_files_mask "*.class")
-# ELSE(WIN32)
- SET(class_files_mask ".")
-# ENDIF(WIN32)
-
- SET(CMAKE_Java_CREATE_STATIC_LIBRARY
+if(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
+# if(WIN32)
+# set(class_files_mask "*.class")
+# else()
+ set(class_files_mask ".")
+# endif()
+
+ set(CMAKE_Java_CREATE_STATIC_LIBRARY
"<CMAKE_Java_ARCHIVE> -cf <TARGET> -C <OBJECT_DIR> ${class_files_mask}")
# "${class_files_mask}" should really be "<OBJECTS>" but compling a *.java
# file can create more than one *.class file...
-ENDIF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
+endif()
# compile a Java file into an object file
-IF(NOT CMAKE_Java_COMPILE_OBJECT)
- SET(CMAKE_Java_COMPILE_OBJECT
+if(NOT CMAKE_Java_COMPILE_OBJECT)
+ set(CMAKE_Java_COMPILE_OBJECT
"<CMAKE_Java_COMPILER> <FLAGS> <SOURCE> -d <OBJECT_DIR>")
-ENDIF(NOT CMAKE_Java_COMPILE_OBJECT)
+endif()
# set java include flag option and the separator for multiple include paths
-SET(CMAKE_INCLUDE_FLAG_Java "-classpath ")
-IF(WIN32 AND NOT CYGWIN)
- SET(CMAKE_INCLUDE_FLAG_SEP_Java ";")
-ELSE(WIN32 AND NOT CYGWIN)
- SET(CMAKE_INCLUDE_FLAG_SEP_Java ":")
-ENDIF(WIN32 AND NOT CYGWIN)
+set(CMAKE_INCLUDE_FLAG_Java "-classpath ")
+if(WIN32 AND NOT CYGWIN)
+ set(CMAKE_INCLUDE_FLAG_SEP_Java ";")
+else()
+ set(CMAKE_INCLUDE_FLAG_SEP_Java ":")
+endif()
diff --git a/Modules/CMakeMSYSFindMake.cmake b/Modules/CMakeMSYSFindMake.cmake
index 95492a0..bc0f89f 100644
--- a/Modules/CMakeMSYSFindMake.cmake
+++ b/Modules/CMakeMSYSFindMake.cmake
@@ -12,9 +12,9 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM make
- PATHS
+find_program(CMAKE_MAKE_PROGRAM make
+ PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS-1.0_is1;Inno Setup: App Path]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
c:/msys/1.0/bin /msys/1.0/bin)
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeMinGWFindMake.cmake b/Modules/CMakeMinGWFindMake.cmake
index f760d74..efba20a 100644
--- a/Modules/CMakeMinGWFindMake.cmake
+++ b/Modules/CMakeMinGWFindMake.cmake
@@ -12,13 +12,13 @@
# (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
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
+find_program(CMAKE_MAKE_PROGRAM mingw32-make.exe PATHS
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
c:/MinGW/bin /MinGW/bin)
-FIND_PROGRAM(CMAKE_SH sh.exe )
-IF(CMAKE_SH)
- MESSAGE(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n")
- SET(CMAKE_MAKE_PROGRAM NOTFOUND)
-ENDIF(CMAKE_SH)
+find_program(CMAKE_SH sh.exe )
+if(CMAKE_SH)
+ message(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n")
+ set(CMAKE_MAKE_PROGRAM NOTFOUND)
+endif()
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM CMAKE_SH)
+mark_as_advanced(CMAKE_MAKE_PROGRAM CMAKE_SH)
diff --git a/Modules/CMakeNMakeFindMake.cmake b/Modules/CMakeNMakeFindMake.cmake
index f647217..d807df8 100644
--- a/Modules/CMakeNMakeFindMake.cmake
+++ b/Modules/CMakeNMakeFindMake.cmake
@@ -13,6 +13,6 @@
# License text for the above reference.)
-SET (CMAKE_MAKE_PROGRAM "nmake" CACHE STRING
+set (CMAKE_MAKE_PROGRAM "nmake" CACHE STRING
"Program used to build from makefiles.")
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeNinjaFindMake.cmake b/Modules/CMakeNinjaFindMake.cmake
index f15c3e0..c3ca767 100644
--- a/Modules/CMakeNinjaFindMake.cmake
+++ b/Modules/CMakeNinjaFindMake.cmake
@@ -12,6 +12,6 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM ninja
+find_program(CMAKE_MAKE_PROGRAM ninja
DOC "Program used to build from build.ninja files.")
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake
index 48039e5..96ecb42 100644
--- a/Modules/CMakePackageConfigHelpers.cmake
+++ b/Modules/CMakePackageConfigHelpers.cmake
@@ -6,7 +6,7 @@
# [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
#
# CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain
-# CONFIGURE_FILE() command when creating the <Name>Config.cmake or <Name>-config.cmake
+# configure_file() command when creating the <Name>Config.cmake or <Name>-config.cmake
# file for installing a project or library. It helps making the resulting package
# relocatable by avoiding hardcoded paths in the installed Config.cmake file.
#
@@ -31,12 +31,12 @@
# Usage:
# 1. write a FooConfig.cmake.in file as you are used to
# 2. insert a line containing only the string "@PACKAGE_INIT@"
-# 3. instead of SET(FOO_DIR "@SOME_INSTALL_DIR@"), use SET(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
+# 3. instead of set(FOO_DIR "@SOME_INSTALL_DIR@"), use set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
# (this must be after the @PACKAGE_INIT@ line)
-# 4. instead of using the normal CONFIGURE_FILE(), use CONFIGURE_PACKAGE_CONFIG_FILE()
+# 4. instead of using the normal configure_file(), use CONFIGURE_PACKAGE_CONFIG_FILE()
#
# The <input> and <output> arguments are the input and output file, the same way
-# as in CONFIGURE_FILE().
+# as in configure_file().
#
# The <path> given to INSTALL_DESTINATION must be the destination where the FooConfig.cmake
# file will be installed to. This can either be a relative or absolute path, both work.
@@ -77,7 +77,7 @@
# WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) )
#
# Writes a file for use as <package>ConfigVersion.cmake file to <filename>.
-# See the documentation of FIND_PACKAGE() for details on this.
+# See the documentation of find_package() for details on this.
# filename is the output filename, it should be in the build tree.
# major.minor.patch is the version number of the project to be installed
# The COMPATIBILITY mode AnyNewerVersion means that the installed package version
@@ -214,7 +214,7 @@ macro(check_required_components _NAME)
set(\${_NAME}_FOUND FALSE)
endif()
endif()
- endforeach(comp)
+ endforeach()
endmacro()
")
endif()
diff --git a/Modules/CMakeParseArguments.cmake b/Modules/CMakeParseArguments.cmake
index 7ce4c49..406780e 100644
--- a/Modules/CMakeParseArguments.cmake
+++ b/Modules/CMakeParseArguments.cmake
@@ -84,11 +84,11 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
# first set all result variables to empty/FALSE
foreach(arg_name ${_singleArgNames} ${_multiArgNames})
set(${prefix}_${arg_name})
- endforeach(arg_name)
+ endforeach()
foreach(option ${_optionNames})
set(${prefix}_${option} FALSE)
- endforeach(option)
+ endforeach()
set(${prefix}_UNPARSED_ARGUMENTS)
@@ -109,9 +109,9 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
elseif("${insideValues}" STREQUAL "MULTI")
list(APPEND ${prefix}_${currentArgName} ${currentArg})
endif()
- else(insideValues)
+ else()
list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
- endif(insideValues)
+ endif()
else()
if(NOT ${optionIndex} EQUAL -1)
set(${prefix}_${currentArg} TRUE)
@@ -127,12 +127,12 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
endif()
endif()
- endforeach(currentArg)
+ endforeach()
# 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)
+ endforeach()
set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
-endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs)
+endfunction()
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index 6341dca..c373414 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -37,7 +37,7 @@
#elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
# define PLATFORM_ID "Haiku"
-/* Haiku also defines __BEOS__ so we must
+/* Haiku also defines __BEOS__ so we must
put it prior to the check for __BEOS__
*/
@@ -92,7 +92,7 @@
# define ARCHITECTURE_ID "IA64"
# elif defined(_M_X64) || defined(_M_AMD64)
-# define ARCHITECTURE_ID "x64"
+# define ARCHITECTURE_ID "x64"
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
@@ -100,6 +100,12 @@
# elif defined(_M_ARM)
# define ARCHITECTURE_ID "ARM"
+# elif defined(_M_MIPS)
+# define ARCHITECTURE_ID "MIPS"
+
+# elif defined(_M_SH)
+# define ARCHITECTURE_ID "SHx"
+
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
diff --git a/Modules/CMakePrintSystemInformation.cmake b/Modules/CMakePrintSystemInformation.cmake
index 2c5d0f2..e0c7334 100644
--- a/Modules/CMakePrintSystemInformation.cmake
+++ b/Modules/CMakePrintSystemInformation.cmake
@@ -16,31 +16,31 @@
# (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}")
-MESSAGE("CMAKE_SYSTEM file is ${CMAKE_SYSTEM_INFO_FILE}")
-MESSAGE("CMAKE_C_COMPILER is ${CMAKE_C_COMPILER}")
-MESSAGE("CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
+message("CMAKE_SYSTEM is ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}")
+message("CMAKE_SYSTEM file is ${CMAKE_SYSTEM_INFO_FILE}")
+message("CMAKE_C_COMPILER is ${CMAKE_C_COMPILER}")
+message("CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
-MESSAGE("CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
-MESSAGE("CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
-MESSAGE("CMAKE_DL_LIBS is ${CMAKE_DL_LIBS}")
-MESSAGE("CMAKE_SHARED_LIBRARY_PREFIX is ${CMAKE_SHARED_LIBRARY_PREFIX}")
-MESSAGE("CMAKE_SHARED_LIBRARY_SUFFIX is ${CMAKE_SHARED_LIBRARY_SUFFIX}")
-MESSAGE("CMAKE_COMPILER_IS_GNUCC = ${CMAKE_COMPILER_IS_GNUCC}")
-MESSAGE("CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}")
+message("CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
+message("CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
+message("CMAKE_DL_LIBS is ${CMAKE_DL_LIBS}")
+message("CMAKE_SHARED_LIBRARY_PREFIX is ${CMAKE_SHARED_LIBRARY_PREFIX}")
+message("CMAKE_SHARED_LIBRARY_SUFFIX is ${CMAKE_SHARED_LIBRARY_SUFFIX}")
+message("CMAKE_COMPILER_IS_GNUCC = ${CMAKE_COMPILER_IS_GNUCC}")
+message("CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}")
-MESSAGE("CMAKE_CXX_CREATE_SHARED_LIBRARY is ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
-MESSAGE("CMAKE_CXX_CREATE_SHARED_MODULE is ${CMAKE_CXX_CREATE_SHARED_MODULE}")
-MESSAGE("CMAKE_CXX_CREATE_STATIC_LIBRARY is ${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
-MESSAGE("CMAKE_CXX_COMPILE_OBJECT is ${CMAKE_CXX_COMPILE_OBJECT}")
-MESSAGE("CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_CXX_LINK_EXECUTABLE}")
+message("CMAKE_CXX_CREATE_SHARED_LIBRARY is ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
+message("CMAKE_CXX_CREATE_SHARED_MODULE is ${CMAKE_CXX_CREATE_SHARED_MODULE}")
+message("CMAKE_CXX_CREATE_STATIC_LIBRARY is ${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
+message("CMAKE_CXX_COMPILE_OBJECT is ${CMAKE_CXX_COMPILE_OBJECT}")
+message("CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_CXX_LINK_EXECUTABLE}")
-MESSAGE("CMAKE_C_CREATE_SHARED_LIBRARY is ${CMAKE_C_CREATE_SHARED_LIBRARY}")
-MESSAGE("CMAKE_C_CREATE_SHARED_MODULE is ${CMAKE_C_CREATE_SHARED_MODULE}")
-MESSAGE("CMAKE_C_CREATE_STATIC_LIBRARY is ${CMAKE_C_CREATE_STATIC_LIBRARY}")
-MESSAGE("CMAKE_C_COMPILE_OBJECT is ${CMAKE_C_COMPILE_OBJECT}")
-MESSAGE("CMAKE_C_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE}")
+message("CMAKE_C_CREATE_SHARED_LIBRARY is ${CMAKE_C_CREATE_SHARED_LIBRARY}")
+message("CMAKE_C_CREATE_SHARED_MODULE is ${CMAKE_C_CREATE_SHARED_MODULE}")
+message("CMAKE_C_CREATE_STATIC_LIBRARY is ${CMAKE_C_CREATE_STATIC_LIBRARY}")
+message("CMAKE_C_COMPILE_OBJECT is ${CMAKE_C_COMPILE_OBJECT}")
+message("CMAKE_C_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE}")
-MESSAGE("CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE}")
-MESSAGE("CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE}")
+message("CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE}")
+message("CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE}")
diff --git a/Modules/CMakePushCheckState.cmake b/Modules/CMakePushCheckState.cmake
index 0a42128..08809bf 100644
--- a/Modules/CMakePushCheckState.cmake
+++ b/Modules/CMakePushCheckState.cmake
@@ -31,31 +31,31 @@
# License text for the above reference.)
-MACRO(CMAKE_PUSH_CHECK_STATE)
+macro(CMAKE_PUSH_CHECK_STATE)
- IF(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER)
- SET(_CMAKE_PUSH_CHECK_STATE_COUNTER 0)
- ENDIF()
+ if(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER)
+ set(_CMAKE_PUSH_CHECK_STATE_COUNTER 0)
+ endif()
- MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1")
+ math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1")
- SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES})
- SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
- SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
- SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
-ENDMACRO(CMAKE_PUSH_CHECK_STATE)
+ set(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES})
+ set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
+ set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
+ set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
+endmacro()
-MACRO(CMAKE_POP_CHECK_STATE)
+macro(CMAKE_POP_CHECK_STATE)
# don't pop more than we pushed
- IF("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0")
+ if("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0")
- SET(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
- SET(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
- SET(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
- SET(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+ set(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+ set(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+ set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+ set(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
- MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
- ENDIF()
+ math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
+ endif()
-ENDMACRO(CMAKE_POP_CHECK_STATE)
+endmacro()
diff --git a/Modules/CMakeRCCompiler.cmake.in b/Modules/CMakeRCCompiler.cmake.in
index 83428e2..0fc3142 100644
--- a/Modules/CMakeRCCompiler.cmake.in
+++ b/Modules/CMakeRCCompiler.cmake.in
@@ -1,6 +1,6 @@
-SET(CMAKE_RC_COMPILER "@CMAKE_RC_COMPILER@")
-SET(CMAKE_RC_COMPILER_ARG1 "@CMAKE_RC_COMPILER_ARG1@")
-SET(CMAKE_RC_COMPILER_LOADED 1)
-SET(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc)
-SET(CMAKE_RC_OUTPUT_EXTENSION @CMAKE_RC_OUTPUT_EXTENSION@)
-SET(CMAKE_RC_COMPILER_ENV_VAR "RC")
+set(CMAKE_RC_COMPILER "@CMAKE_RC_COMPILER@")
+set(CMAKE_RC_COMPILER_ARG1 "@CMAKE_RC_COMPILER_ARG1@")
+set(CMAKE_RC_COMPILER_LOADED 1)
+set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc)
+set(CMAKE_RC_OUTPUT_EXTENSION @CMAKE_RC_OUTPUT_EXTENSION@)
+set(CMAKE_RC_COMPILER_ENV_VAR "RC")
diff --git a/Modules/CMakeRCInformation.cmake b/Modules/CMakeRCInformation.cmake
index 859fe11..8ffe50a 100644
--- a/Modules/CMakeRCInformation.cmake
+++ b/Modules/CMakeRCInformation.cmake
@@ -18,36 +18,36 @@
# if it exists.
# make sure we don't use CMAKE_BASE_NAME from somewhere else
-SET(CMAKE_BASE_NAME)
-GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE)
-IF("${CMAKE_BASE_NAME}" MATCHES "windres")
- SET(CMAKE_BASE_NAME "windres")
-ENDIF()
-SET(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
+set(CMAKE_BASE_NAME)
+get_filename_component(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE)
+if("${CMAKE_BASE_NAME}" MATCHES "windres")
+ set(CMAKE_BASE_NAME "windres")
+endif()
+set(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
-INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
+include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
-SET (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING
+set (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING
"Flags for Fortran compiler.")
# These are the only types of flags that should be passed to the rc
# command, if COMPILE_FLAGS is used on a target this will be used
# to filter out any other flags
-SET(CMAKE_RC_FLAG_REGEX "^[-/](D|I)")
+set(CMAKE_RC_FLAG_REGEX "^[-/](D|I)")
# now define the following rule variables
# CMAKE_RC_COMPILE_OBJECT
-SET(CMAKE_INCLUDE_FLAG_RC "-I")
+set(CMAKE_INCLUDE_FLAG_RC "-I")
# compile a Resource file into an object file
-IF(NOT CMAKE_RC_COMPILE_OBJECT)
- SET(CMAKE_RC_COMPILE_OBJECT
+if(NOT CMAKE_RC_COMPILE_OBJECT)
+ set(CMAKE_RC_COMPILE_OBJECT
"<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> /fo<OBJECT> <SOURCE>")
-ENDIF(NOT CMAKE_RC_COMPILE_OBJECT)
+endif()
-MARK_AS_ADVANCED(
+mark_as_advanced(
CMAKE_RC_FLAGS
)
# set this variable so we can avoid loading this more than once.
-SET(CMAKE_RC_INFORMATION_LOADED 1)
+set(CMAKE_RC_INFORMATION_LOADED 1)
diff --git a/Modules/CMakeSystem.cmake.in b/Modules/CMakeSystem.cmake.in
index a9f3a55..7e2a358 100644
--- a/Modules/CMakeSystem.cmake.in
+++ b/Modules/CMakeSystem.cmake.in
@@ -1,15 +1,15 @@
@INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED@
-SET(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
-SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
-SET(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@")
-SET(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
+set(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
+set(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
+set(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@")
+set(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
-SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
-SET(CMAKE_HOST_SYSTEM_NAME "@CMAKE_HOST_SYSTEM_NAME@")
-SET(CMAKE_HOST_SYSTEM_VERSION "@CMAKE_HOST_SYSTEM_VERSION@")
-SET(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
+set(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
+set(CMAKE_HOST_SYSTEM_NAME "@CMAKE_HOST_SYSTEM_NAME@")
+set(CMAKE_HOST_SYSTEM_VERSION "@CMAKE_HOST_SYSTEM_VERSION@")
+set(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
-SET(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
+set(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
-SET(CMAKE_SYSTEM_LOADED 1)
+set(CMAKE_SYSTEM_LOADED 1)
diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake
index faa9e36..b9f8e0a 100644
--- a/Modules/CMakeSystemSpecificInformation.cmake
+++ b/Modules/CMakeSystemSpecificInformation.cmake
@@ -21,49 +21,49 @@
# But they are reset here and set again in the platform files for the target
# platform, so they can be used for testing the target platform instead
# of testing the host platform.
-SET(APPLE )
-SET(UNIX )
-SET(CYGWIN )
-SET(WIN32 )
+set(APPLE )
+set(UNIX )
+set(CYGWIN )
+set(WIN32 )
# include Generic system information
-INCLUDE(CMakeGenericSystem)
+include(CMakeGenericSystem)
# 2. now include SystemName.cmake file to set the system specific information
-SET(CMAKE_SYSTEM_INFO_FILE Platform/${CMAKE_SYSTEM_NAME})
+set(CMAKE_SYSTEM_INFO_FILE Platform/${CMAKE_SYSTEM_NAME})
-INCLUDE(${CMAKE_SYSTEM_INFO_FILE} OPTIONAL RESULT_VARIABLE _INCLUDED_SYSTEM_INFO_FILE)
+include(${CMAKE_SYSTEM_INFO_FILE} OPTIONAL RESULT_VARIABLE _INCLUDED_SYSTEM_INFO_FILE)
-IF(NOT _INCLUDED_SYSTEM_INFO_FILE)
- MESSAGE("System is unknown to cmake, create:\n${CMAKE_SYSTEM_INFO_FILE}"
+if(NOT _INCLUDED_SYSTEM_INFO_FILE)
+ message("System is unknown to cmake, create:\n${CMAKE_SYSTEM_INFO_FILE}"
" to use this system, please send your config file to "
"cmake@www.cmake.org so it can be added to cmake")
- IF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
- CONFIGURE_FILE(${CMAKE_BINARY_DIR}/CMakeCache.txt
+ if(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
+ configure_file(${CMAKE_BINARY_DIR}/CMakeCache.txt
${CMAKE_BINARY_DIR}/CopyOfCMakeCache.txt COPYONLY)
- MESSAGE("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. "
+ message("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. "
"Please send that file to cmake@www.cmake.org.")
- ENDIF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
-ENDIF(NOT _INCLUDED_SYSTEM_INFO_FILE)
+ endif()
+endif()
# optionally include a file which can do extra-generator specific things, e.g.
# CMakeFindEclipseCDT4.cmake asks gcc for the system include dirs for the Eclipse CDT4 generator
-IF(CMAKE_EXTRA_GENERATOR)
- STRING(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} )
- INCLUDE("CMakeFind${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL)
-ENDIF(CMAKE_EXTRA_GENERATOR)
+if(CMAKE_EXTRA_GENERATOR)
+ string(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} )
+ include("CMakeFind${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL)
+endif()
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
# this has to be done after the system information has been loaded
-IF(NOT CMAKE_MODULE_EXISTS)
- SET(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
- SET(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
-ENDIF(NOT CMAKE_MODULE_EXISTS)
+if(NOT CMAKE_MODULE_EXISTS)
+ set(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
+ set(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
+endif()
-SET(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1)
+set(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1)
diff --git a/Modules/CMakeTestASM-ATTCompiler.cmake b/Modules/CMakeTestASM-ATTCompiler.cmake
index 581ad0c..0cc6857 100644
--- a/Modules/CMakeTestASM-ATTCompiler.cmake
+++ b/Modules/CMakeTestASM-ATTCompiler.cmake
@@ -18,6 +18,6 @@
# because otherwise there would have to be a separate assembler source file
# for each assembler on every architecture.
-SET(ASM_DIALECT "-ATT")
-INCLUDE(CMakeTestASMCompiler)
-SET(ASM_DIALECT)
+set(ASM_DIALECT "-ATT")
+include(CMakeTestASMCompiler)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeTestASMCompiler.cmake b/Modules/CMakeTestASMCompiler.cmake
index 294511d..9381619 100644
--- a/Modules/CMakeTestASMCompiler.cmake
+++ b/Modules/CMakeTestASMCompiler.cmake
@@ -19,17 +19,17 @@
# for each assembler on every architecture.
-SET(_ASM_COMPILER_WORKS 0)
+set(_ASM_COMPILER_WORKS 0)
-IF(CMAKE_ASM${ASM_DIALECT}_COMPILER)
- SET(_ASM_COMPILER_WORKS 1)
-ENDIF()
+if(CMAKE_ASM${ASM_DIALECT}_COMPILER)
+ set(_ASM_COMPILER_WORKS 1)
+endif()
# when using generic "ASM" support, we must have detected the compiler ID, fail otherwise:
-IF("ASM${ASM_DIALECT}" STREQUAL "ASM")
- IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
- SET(_ASM_COMPILER_WORKS 0)
- ENDIF()
-ENDIF()
+if("ASM${ASM_DIALECT}" STREQUAL "ASM")
+ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+ set(_ASM_COMPILER_WORKS 0)
+ endif()
+endif()
-SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_WORKS ${_ASM_COMPILER_WORKS} CACHE INTERNAL "")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILER_WORKS ${_ASM_COMPILER_WORKS} CACHE INTERNAL "")
diff --git a/Modules/CMakeTestASM_MASMCompiler.cmake b/Modules/CMakeTestASM_MASMCompiler.cmake
index 8369b94..462b1fc 100644
--- a/Modules/CMakeTestASM_MASMCompiler.cmake
+++ b/Modules/CMakeTestASM_MASMCompiler.cmake
@@ -18,6 +18,6 @@
# because otherwise there would have to be a separate assembler source file
# for each assembler on every architecture.
-SET(ASM_DIALECT "_MASM")
-INCLUDE(CMakeTestASMCompiler)
-SET(ASM_DIALECT)
+set(ASM_DIALECT "_MASM")
+include(CMakeTestASMCompiler)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeTestASM_NASMCompiler.cmake b/Modules/CMakeTestASM_NASMCompiler.cmake
index a5e2bea..414c2f5 100644
--- a/Modules/CMakeTestASM_NASMCompiler.cmake
+++ b/Modules/CMakeTestASM_NASMCompiler.cmake
@@ -18,6 +18,6 @@
# because otherwise there would have to be a separate assembler source file
# for each assembler on every architecture.
-SET(ASM_DIALECT "_NASM")
-INCLUDE(CMakeTestASMCompiler)
-SET(ASM_DIALECT)
+set(ASM_DIALECT "_NASM")
+include(CMakeTestASMCompiler)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 779b2f0..2c75147 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -1,6 +1,6 @@
#=============================================================================
-# Copyright 2003-2009 Kitware, Inc.
+# Copyright 2003-2012 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -12,16 +12,27 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(CMakeTestCompilerCommon)
+if(CMAKE_C_COMPILER_FORCED)
+ # The compiler configuration was forced by the user.
+ # Assume the user has configured all compiler information.
+ set(CMAKE_C_COMPILER_WORKS TRUE)
+ return()
+endif()
+
+include(CMakeTestCompilerCommon)
+
+# Remove any cached result from an older CMake version.
+# We now store this in CMakeCCompiler.cmake.
+unset(CMAKE_C_COMPILER_WORKS CACHE)
# This file is used by EnableLanguage in cmGlobalGenerator to
# determine that that selected C compiler can actually compile
# and link the most basic of programs. If not, a fatal error
# is set and cmake stops processing commands and will not generate
# any makefiles or projects.
-IF(NOT CMAKE_C_COMPILER_WORKS)
+if(NOT CMAKE_C_COMPILER_WORKS)
PrintTestCompilerStatus("C" "")
- FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
+ file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
"#ifdef __cplusplus\n"
"# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
"#endif\n"
@@ -33,55 +44,50 @@ IF(NOT CMAKE_C_COMPILER_WORKS)
"int main(int argc, char* argv[])\n"
"#endif\n"
"{ (void)argv; return argc-1;}\n")
- TRY_COMPILE(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
+ try_compile(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT)
- SET(C_TEST_WAS_RUN 1)
-ENDIF(NOT CMAKE_C_COMPILER_WORKS)
+ # Move result from cache to normal variable.
+ set(CMAKE_C_COMPILER_WORKS ${CMAKE_C_COMPILER_WORKS})
+ unset(CMAKE_C_COMPILER_WORKS CACHE)
+ set(C_TEST_WAS_RUN 1)
+endif()
-IF(NOT CMAKE_C_COMPILER_WORKS)
+if(NOT CMAKE_C_COMPILER_WORKS)
PrintTestCompilerStatus("C" " -- broken")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the C compiler works failed with "
"the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
- # if the compiler is broken make sure to remove the platform file
- # since Windows-cl configures both c/cxx files both need to be removed
- # when c or c++ fails
- FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
- FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
- MESSAGE(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
+ message(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
"is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${__CMAKE_C_COMPILER_OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.")
-ELSE(NOT CMAKE_C_COMPILER_WORKS)
- IF(C_TEST_WAS_RUN)
+else()
+ if(C_TEST_WAS_RUN)
PrintTestCompilerStatus("C" " -- works")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the C compiler works passed with "
"the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
- ENDIF(C_TEST_WAS_RUN)
- SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
+ endif()
+
+ # Try to identify the ABI and configure it into CMakeCCompiler.cmake
+ include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
+ CMAKE_DETERMINE_COMPILER_ABI(C ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c)
+
+ # Re-configure to save learned information.
+ configure_file(
+ ${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
+ ${CMAKE_PLATFORM_INFO_DIR}/CMakeCCompiler.cmake
+ @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
+ )
+ include(${CMAKE_PLATFORM_INFO_DIR}/CMakeCCompiler.cmake)
- IF(CMAKE_C_COMPILER_FORCED)
- # The compiler configuration was forced by the user.
- # Assume the user has configured all compiler information.
- ELSE(CMAKE_C_COMPILER_FORCED)
- # Try to identify the ABI and configure it into CMakeCCompiler.cmake
- INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
- CMAKE_DETERMINE_COMPILER_ABI(C ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c)
- CONFIGURE_FILE(
- ${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake
- @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
- )
- INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake)
- ENDIF(CMAKE_C_COMPILER_FORCED)
- IF(CMAKE_C_SIZEOF_DATA_PTR)
- FOREACH(f ${CMAKE_C_ABI_FILES})
- INCLUDE(${f})
- ENDFOREACH()
- UNSET(CMAKE_C_ABI_FILES)
- ENDIF()
-ENDIF(NOT CMAKE_C_COMPILER_WORKS)
+ if(CMAKE_C_SIZEOF_DATA_PTR)
+ foreach(f ${CMAKE_C_ABI_FILES})
+ include(${f})
+ endforeach()
+ unset(CMAKE_C_ABI_FILES)
+ endif()
+endif()
-UNSET(__CMAKE_C_COMPILER_OUTPUT)
+unset(__CMAKE_C_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index 87022e9..a5cdf56 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -1,6 +1,6 @@
#=============================================================================
-# Copyright 2003-2009 Kitware, Inc.
+# Copyright 2003-2012 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -12,69 +12,75 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(CMakeTestCompilerCommon)
+if(CMAKE_CXX_COMPILER_FORCED)
+ # The compiler configuration was forced by the user.
+ # Assume the user has configured all compiler information.
+ set(CMAKE_CXX_COMPILER_WORKS TRUE)
+ return()
+endif()
+
+include(CMakeTestCompilerCommon)
+
+# Remove any cached result from an older CMake version.
+# We now store this in CMakeCXXCompiler.cmake.
+unset(CMAKE_CXX_COMPILER_WORKS CACHE)
# This file is used by EnableLanguage in cmGlobalGenerator to
# determine that that selected C++ compiler can actually compile
# and link the most basic of programs. If not, a fatal error
# is set and cmake stops processing commands and will not generate
# any makefiles or projects.
-IF(NOT CMAKE_CXX_COMPILER_WORKS)
+if(NOT CMAKE_CXX_COMPILER_WORKS)
PrintTestCompilerStatus("CXX" "")
- FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
+ file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
"#ifndef __cplusplus\n"
"# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n"
"#endif\n"
"int main(){return 0;}\n")
- TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
+ try_compile(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT)
- SET(CXX_TEST_WAS_RUN 1)
-ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
+ # Move result from cache to normal variable.
+ set(CMAKE_CXX_COMPILER_WORKS ${CMAKE_CXX_COMPILER_WORKS})
+ unset(CMAKE_CXX_COMPILER_WORKS CACHE)
+ set(CXX_TEST_WAS_RUN 1)
+endif()
-IF(NOT CMAKE_CXX_COMPILER_WORKS)
+if(NOT CMAKE_CXX_COMPILER_WORKS)
PrintTestCompilerStatus("CXX" " -- broken")
- # if the compiler is broken make sure to remove the platform file
- # since Windows-cl configures both c/cxx files both need to be removed
- # when c or c++ fails
- FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
- FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the CXX compiler works failed with "
"the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
- MESSAGE(FATAL_ERROR "The C++ compiler \"${CMAKE_CXX_COMPILER}\" "
+ message(FATAL_ERROR "The C++ compiler \"${CMAKE_CXX_COMPILER}\" "
"is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${__CMAKE_CXX_COMPILER_OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.")
-ELSE(NOT CMAKE_CXX_COMPILER_WORKS)
- IF(CXX_TEST_WAS_RUN)
+else()
+ if(CXX_TEST_WAS_RUN)
PrintTestCompilerStatus("CXX" " -- works")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the CXX compiler works passed with "
"the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
- ENDIF(CXX_TEST_WAS_RUN)
- SET(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
+ endif()
+
+ # Try to identify the ABI and configure it into CMakeCXXCompiler.cmake
+ include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
+ CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp)
+
+ # Re-configure to save learned information.
+ configure_file(
+ ${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
+ ${CMAKE_PLATFORM_INFO_DIR}/CMakeCXXCompiler.cmake
+ @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
+ )
+ include(${CMAKE_PLATFORM_INFO_DIR}/CMakeCXXCompiler.cmake)
- IF(CMAKE_CXX_COMPILER_FORCED)
- # The compiler configuration was forced by the user.
- # Assume the user has configured all compiler information.
- ELSE(CMAKE_CXX_COMPILER_FORCED)
- # Try to identify the ABI and configure it into CMakeCXXCompiler.cmake
- INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
- CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp)
- CONFIGURE_FILE(
- ${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
- @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
- )
- INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake)
- ENDIF(CMAKE_CXX_COMPILER_FORCED)
- IF(CMAKE_CXX_SIZEOF_DATA_PTR)
- FOREACH(f ${CMAKE_CXX_ABI_FILES})
- INCLUDE(${f})
- ENDFOREACH()
- UNSET(CMAKE_CXX_ABI_FILES)
- ENDIF()
-ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
+ if(CMAKE_CXX_SIZEOF_DATA_PTR)
+ foreach(f ${CMAKE_CXX_ABI_FILES})
+ include(${f})
+ endforeach()
+ unset(CMAKE_CXX_ABI_FILES)
+ endif()
+endif()
-UNSET(__CMAKE_CXX_COMPILER_OUTPUT)
+unset(__CMAKE_CXX_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestCompilerCommon.cmake b/Modules/CMakeTestCompilerCommon.cmake
index fd8a105..d51b503 100644
--- a/Modules/CMakeTestCompilerCommon.cmake
+++ b/Modules/CMakeTestCompilerCommon.cmake
@@ -13,9 +13,9 @@
# License text for the above reference.)
function(PrintTestCompilerStatus LANG MSG)
- IF(CMAKE_GENERATOR MATCHES Make)
- MESSAGE(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
- ELSE()
- MESSAGE(STATUS "Check for working ${LANG} compiler using: ${CMAKE_GENERATOR}${MSG}")
- ENDIF()
+ if(CMAKE_GENERATOR MATCHES Make)
+ message(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
+ else()
+ message(STATUS "Check for working ${LANG} compiler using: ${CMAKE_GENERATOR}${MSG}")
+ endif()
endfunction()
diff --git a/Modules/CMakeTestForFreeVC.cxx b/Modules/CMakeTestForFreeVC.cxx
deleted file mode 100644
index e580c1f..0000000
--- a/Modules/CMakeTestForFreeVC.cxx
+++ /dev/null
@@ -1,3 +0,0 @@
-#include<iostream>
-
-int main(){return 0;}
diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake
index b4dcea6..e263345 100644
--- a/Modules/CMakeTestFortranCompiler.cmake
+++ b/Modules/CMakeTestFortranCompiler.cmake
@@ -1,6 +1,6 @@
#=============================================================================
-# Copyright 2004-2009 Kitware, Inc.
+# Copyright 2004-2012 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -12,90 +12,100 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(CMakeTestCompilerCommon)
+if(CMAKE_Fortran_COMPILER_FORCED)
+ # The compiler configuration was forced by the user.
+ # Assume the user has configured all compiler information.
+ set(CMAKE_Fortran_COMPILER_WORKS TRUE)
+ return()
+endif()
+
+include(CMakeTestCompilerCommon)
+
+# Remove any cached result from an older CMake version.
+# We now store this in CMakeFortranCompiler.cmake.
+unset(CMAKE_Fortran_COMPILER_WORKS CACHE)
# This file is used by EnableLanguage in cmGlobalGenerator to
# determine that that selected Fortran compiler can actually compile
# and link the most basic of programs. If not, a fatal error
# is set and cmake stops processing commands and will not generate
# any makefiles or projects.
-IF(NOT CMAKE_Fortran_COMPILER_WORKS)
+if(NOT CMAKE_Fortran_COMPILER_WORKS)
PrintTestCompilerStatus("Fortran" "")
- FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "
+ file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "
PROGRAM TESTFortran
PRINT *, 'Hello'
END
")
- TRY_COMPILE(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR}
+ try_compile(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
OUTPUT_VARIABLE OUTPUT)
- SET(FORTRAN_TEST_WAS_RUN 1)
-ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS)
+ # Move result from cache to normal variable.
+ set(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_Fortran_COMPILER_WORKS})
+ unset(CMAKE_Fortran_COMPILER_WORKS CACHE)
+ set(FORTRAN_TEST_WAS_RUN 1)
+endif()
-IF(NOT CMAKE_Fortran_COMPILER_WORKS)
+if(NOT CMAKE_Fortran_COMPILER_WORKS)
PrintTestCompilerStatus("Fortran" " -- broken")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Fortran compiler works failed with "
"the following output:\n${OUTPUT}\n\n")
- MESSAGE(FATAL_ERROR "The Fortran compiler \"${CMAKE_Fortran_COMPILER}\" "
+ message(FATAL_ERROR "The Fortran compiler \"${CMAKE_Fortran_COMPILER}\" "
"is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.")
-ELSE(NOT CMAKE_Fortran_COMPILER_WORKS)
- IF(FORTRAN_TEST_WAS_RUN)
+else()
+ if(FORTRAN_TEST_WAS_RUN)
PrintTestCompilerStatus("Fortran" " -- works")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler works passed with "
"the following output:\n${OUTPUT}\n\n")
- ENDIF(FORTRAN_TEST_WAS_RUN)
- SET(CMAKE_Fortran_COMPILER_WORKS 1 CACHE INTERNAL "")
+ endif()
- IF(CMAKE_Fortran_COMPILER_FORCED)
- # The compiler configuration was forced by the user.
- # Assume the user has configured all compiler information.
- ELSE(CMAKE_Fortran_COMPILER_FORCED)
- # Try to identify the ABI and configure it into CMakeFortranCompiler.cmake
- INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
- CMAKE_DETERMINE_COMPILER_ABI(Fortran ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
+ # Try to identify the ABI and configure it into CMakeFortranCompiler.cmake
+ include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
+ CMAKE_DETERMINE_COMPILER_ABI(Fortran ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
- # Test for Fortran 90 support by using an f90-specific construct.
- IF(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
- MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
- FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 "
+ # Test for Fortran 90 support by using an f90-specific construct.
+ if(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
+ message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
+ file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 "
PROGRAM TESTFortran90
stop = 1 ; do while ( stop .eq. 0 ) ; end do
END PROGRAM TESTFortran90
")
- TRY_COMPILE(CMAKE_Fortran_COMPILER_SUPPORTS_F90 ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90
- OUTPUT_VARIABLE OUTPUT)
- IF(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
- MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- yes")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Determining if the Fortran compiler supports Fortran 90 passed with "
- "the following output:\n${OUTPUT}\n\n")
- SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
- ELSE(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
- MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining if the Fortran compiler supports Fortran 90 failed with "
- "the following output:\n${OUTPUT}\n\n")
- SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0)
- ENDIF(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
- UNSET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE)
- ENDIF(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
+ try_compile(CMAKE_Fortran_COMPILER_SUPPORTS_F90 ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90
+ OUTPUT_VARIABLE OUTPUT)
+ if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
+ message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- yes")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Determining if the Fortran compiler supports Fortran 90 passed with "
+ "the following output:\n${OUTPUT}\n\n")
+ set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
+ else()
+ message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if the Fortran compiler supports Fortran 90 failed with "
+ "the following output:\n${OUTPUT}\n\n")
+ set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0)
+ endif()
+ unset(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE)
+ endif()
+
+ # Re-configure to save learned information.
+ configure_file(
+ ${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
+ ${CMAKE_PLATFORM_INFO_DIR}/CMakeFortranCompiler.cmake
+ @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
+ )
+ include(${CMAKE_PLATFORM_INFO_DIR}/CMakeFortranCompiler.cmake)
- CONFIGURE_FILE(
- ${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake
- @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
- )
- INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake)
- ENDIF(CMAKE_Fortran_COMPILER_FORCED)
- IF(CMAKE_Fortran_SIZEOF_DATA_PTR)
- FOREACH(f ${CMAKE_Fortran_ABI_FILES})
- INCLUDE(${f})
- ENDFOREACH()
- UNSET(CMAKE_Fortran_ABI_FILES)
- ENDIF()
-ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS)
+ if(CMAKE_Fortran_SIZEOF_DATA_PTR)
+ foreach(f ${CMAKE_Fortran_ABI_FILES})
+ include(${f})
+ endforeach()
+ unset(CMAKE_Fortran_ABI_FILES)
+ endif()
+endif()
diff --git a/Modules/CMakeTestJavaCompiler.cmake b/Modules/CMakeTestJavaCompiler.cmake
index cfd3e24..d763412 100644
--- a/Modules/CMakeTestJavaCompiler.cmake
+++ b/Modules/CMakeTestJavaCompiler.cmake
@@ -17,4 +17,4 @@
# and link the most basic of programs. If not, a fatal error
# is set and cmake stops processing commands and will not generate
# any makefiles or projects.
-SET(CMAKE_Java_COMPILER_WORKS 1 CACHE INTERNAL "")
+set(CMAKE_Java_COMPILER_WORKS 1 CACHE INTERNAL "")
diff --git a/Modules/CMakeTestNMakeCLVersion.c b/Modules/CMakeTestNMakeCLVersion.c
deleted file mode 100644
index 3cece2a..0000000
--- a/Modules/CMakeTestNMakeCLVersion.c
+++ /dev/null
@@ -1,2 +0,0 @@
-VERSION=_MSC_VER
-
diff --git a/Modules/CMakeTestRCCompiler.cmake b/Modules/CMakeTestRCCompiler.cmake
index a5c8d11..7969da1 100644
--- a/Modules/CMakeTestRCCompiler.cmake
+++ b/Modules/CMakeTestRCCompiler.cmake
@@ -20,4 +20,4 @@
# For now there is no way to do a try compile on just a .rc file
# so just do nothing in here.
-SET(CMAKE_RC_COMPILER_WORKS 1 CACHE INTERNAL "")
+set(CMAKE_RC_COMPILER_WORKS 1 CACHE INTERNAL "")
diff --git a/Modules/CMakeUnixFindMake.cmake b/Modules/CMakeUnixFindMake.cmake
index 39962c0..c75cf7c 100644
--- a/Modules/CMakeUnixFindMake.cmake
+++ b/Modules/CMakeUnixFindMake.cmake
@@ -12,5 +12,5 @@
# (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)
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+find_program(CMAKE_MAKE_PROGRAM NAMES gmake make smake)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeVS10FindMake.cmake b/Modules/CMakeVS10FindMake.cmake
index 695e92f..189b626 100644
--- a/Modules/CMakeVS10FindMake.cmake
+++ b/Modules/CMakeVS10FindMake.cmake
@@ -15,7 +15,7 @@
# Look for devenv as a build program. We need to use this to support
# Intel Fortran integration into VS. MSBuild can not be used for that case
# since Intel Fortran uses the older devenv file format.
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
NAMES devenv
HINTS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory]
@@ -39,16 +39,16 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
# causes the compiler checks and try-compile stuff to fail. MSbuild
# is a better choice for this. However, VCExpress does not support
# cross compiling needed for Win CE.
-IF(NOT CMAKE_CROSSCOMPILING)
- FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+if(NOT CMAKE_CROSSCOMPILING)
+ find_program(CMAKE_MAKE_PROGRAM
NAMES MSBuild
HINTS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir]
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
"c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0;CLR Version]/")
-ENDIF()
+endif()
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
-SET(MSVC10 1)
-SET(MSVC_VERSION 1600)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
+set(MSVC10 1)
+set(MSVC_VERSION 1600)
diff --git a/Modules/CMakeVS11FindMake.cmake b/Modules/CMakeVS11FindMake.cmake
index 302efaa..2df015d 100644
--- a/Modules/CMakeVS11FindMake.cmake
+++ b/Modules/CMakeVS11FindMake.cmake
@@ -15,7 +15,7 @@
# Look for devenv as a build program. We need to use this to support
# Intel Fortran integration into VS. MSBuild can not be used for that case
# since Intel Fortran uses the older devenv file format.
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
NAMES devenv
HINTS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;EnvironmentDirectory]
@@ -34,21 +34,20 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
# if devenv is not found, then use MSBuild.
# it is expected that if devenv is not found, then we are
-# dealing with Visual Studio Express. VCExpress has random
-# failures when being run as a command line build tool which
-# causes the compiler checks and try-compile stuff to fail. MSbuild
-# is a better choice for this. However, VCExpress does not support
-# cross compiling needed for Win CE.
-IF(NOT CMAKE_CROSSCOMPILING)
- FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+# dealing with Visual Studio Express.
+if(NOT CMAKE_CROSSCOMPILING)
+ set(_FDIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkDir32]")
+ set(_FVER "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkVer32]")
+ find_program(CMAKE_MAKE_PROGRAM
NAMES MSBuild
HINTS
+ ${_FDIR}/${_FVER}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir]
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/"
"c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/"
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0;CLR Version]/")
-ENDIF()
+endif()
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
-SET(MSVC11 1)
-SET(MSVC_VERSION 1700)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
+set(MSVC11 1)
+set(MSVC_VERSION 1700)
diff --git a/Modules/CMakeVS6BackwardCompatibility.cmake b/Modules/CMakeVS6BackwardCompatibility.cmake
index 438f64f..ca48b85 100644
--- a/Modules/CMakeVS6BackwardCompatibility.cmake
+++ b/Modules/CMakeVS6BackwardCompatibility.cmake
@@ -13,14 +13,14 @@
# License text for the above reference.)
# hard code these for fast backwards compatibility tests
-SET (CMAKE_SIZEOF_INT 4 CACHE INTERNAL "Size of int data type")
-SET (CMAKE_SIZEOF_LONG 4 CACHE INTERNAL "Size of long data type")
-SET (CMAKE_SIZEOF_VOID_P 4 CACHE INTERNAL "Size of void* data type")
-SET (CMAKE_SIZEOF_CHAR 1 CACHE INTERNAL "Size of char data type")
-SET (CMAKE_SIZEOF_SHORT 2 CACHE INTERNAL "Size of short data type")
-SET (CMAKE_SIZEOF_FLOAT 4 CACHE INTERNAL "Size of float data type")
-SET (CMAKE_SIZEOF_DOUBLE 8 CACHE INTERNAL "Size of double data type")
-SET (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
+set (CMAKE_SIZEOF_INT 4 CACHE INTERNAL "Size of int data type")
+set (CMAKE_SIZEOF_LONG 4 CACHE INTERNAL "Size of long data type")
+set (CMAKE_SIZEOF_VOID_P 4 CACHE INTERNAL "Size of void* data type")
+set (CMAKE_SIZEOF_CHAR 1 CACHE INTERNAL "Size of char data type")
+set (CMAKE_SIZEOF_SHORT 2 CACHE INTERNAL "Size of short data type")
+set (CMAKE_SIZEOF_FLOAT 4 CACHE INTERNAL "Size of float data type")
+set (CMAKE_SIZEOF_DOUBLE 8 CACHE INTERNAL "Size of double data type")
+set (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
"Does the compiler support ansi for scope.")
-SET (CMAKE_USE_WIN32_THREADS TRUE CACHE BOOL "Use the win32 thread library.")
-SET (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
+set (CMAKE_USE_WIN32_THREADS TRUE CACHE BOOL "Use the win32 thread library.")
+set (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
diff --git a/Modules/CMakeVS6FindMake.cmake b/Modules/CMakeVS6FindMake.cmake
index dccf8c4..40bf5b1 100644
--- a/Modules/CMakeVS6FindMake.cmake
+++ b/Modules/CMakeVS6FindMake.cmake
@@ -12,7 +12,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
NAMES msdev
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\6.0\\Setup;VsCommonDir]/MSDev98/Bin
@@ -20,6 +20,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
"c:/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
"/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
)
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
-SET(MSVC60 1)
-SET(MSVC_VERSION 1200)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
+set(MSVC60 1)
+set(MSVC_VERSION 1200)
diff --git a/Modules/CMakeVS71FindMake.cmake b/Modules/CMakeVS71FindMake.cmake
index 2381adb..945c3fa 100644
--- a/Modules/CMakeVS71FindMake.cmake
+++ b/Modules/CMakeVS71FindMake.cmake
@@ -12,7 +12,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
NAMES devenv
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VS;EnvironmentDirectory]
@@ -21,6 +21,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
"c:/Program Files/Microsoft Visual Studio.NET/Common7/IDE"
"/Program Files/Microsoft Visual Studio .NET/Common7/IDE/"
)
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
-SET(MSVC71 1)
-SET(MSVC_VERSION 1310)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
+set(MSVC71 1)
+set(MSVC_VERSION 1310)
diff --git a/Modules/CMakeVS7BackwardCompatibility.cmake b/Modules/CMakeVS7BackwardCompatibility.cmake
index df0b3bb..e9622ee 100644
--- a/Modules/CMakeVS7BackwardCompatibility.cmake
+++ b/Modules/CMakeVS7BackwardCompatibility.cmake
@@ -13,14 +13,14 @@
# License text for the above reference.)
# hard code these for fast backwards compatibility tests
-SET (CMAKE_SIZEOF_INT 4 CACHE INTERNAL "Size of int data type")
-SET (CMAKE_SIZEOF_LONG 4 CACHE INTERNAL "Size of long data type")
-SET (CMAKE_SIZEOF_VOID_P 4 CACHE INTERNAL "Size of void* data type")
-SET (CMAKE_SIZEOF_CHAR 1 CACHE INTERNAL "Size of char data type")
-SET (CMAKE_SIZEOF_SHORT 2 CACHE INTERNAL "Size of short data type")
-SET (CMAKE_SIZEOF_FLOAT 4 CACHE INTERNAL "Size of float data type")
-SET (CMAKE_SIZEOF_DOUBLE 8 CACHE INTERNAL "Size of double data type")
-SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
+set (CMAKE_SIZEOF_INT 4 CACHE INTERNAL "Size of int data type")
+set (CMAKE_SIZEOF_LONG 4 CACHE INTERNAL "Size of long data type")
+set (CMAKE_SIZEOF_VOID_P 4 CACHE INTERNAL "Size of void* data type")
+set (CMAKE_SIZEOF_CHAR 1 CACHE INTERNAL "Size of char data type")
+set (CMAKE_SIZEOF_SHORT 2 CACHE INTERNAL "Size of short data type")
+set (CMAKE_SIZEOF_FLOAT 4 CACHE INTERNAL "Size of float data type")
+set (CMAKE_SIZEOF_DOUBLE 8 CACHE INTERNAL "Size of double data type")
+set (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
"Does the compiler support ansi for scope.")
-SET (CMAKE_USE_WIN32_THREADS TRUE CACHE BOOL "Use the win32 thread library.")
-SET (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
+set (CMAKE_USE_WIN32_THREADS TRUE CACHE BOOL "Use the win32 thread library.")
+set (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
diff --git a/Modules/CMakeVS7FindMake.cmake b/Modules/CMakeVS7FindMake.cmake
index 665158c..218c5f2 100644
--- a/Modules/CMakeVS7FindMake.cmake
+++ b/Modules/CMakeVS7FindMake.cmake
@@ -12,7 +12,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
NAMES devenv
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.0\\Setup\\VS;EnvironmentDirectory]
@@ -20,6 +20,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
"c:/Program Files/Microsoft Visual Studio.NET/Common7/IDE"
"/Program Files/Microsoft Visual Studio .NET/Common7/IDE/"
)
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
-SET(MSVC70 1)
-SET(MSVC_VERSION 1300)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
+set(MSVC70 1)
+set(MSVC_VERSION 1300)
diff --git a/Modules/CMakeVS8FindMake.cmake b/Modules/CMakeVS8FindMake.cmake
index bb08180..31df026 100644
--- a/Modules/CMakeVS8FindMake.cmake
+++ b/Modules/CMakeVS8FindMake.cmake
@@ -13,12 +13,12 @@
# License text for the above reference.)
# VCExpress does not support cross compiling, which is necessary for Win CE
-SET( _CMAKE_MAKE_PROGRAM_NAMES devenv)
-IF(NOT CMAKE_CROSSCOMPILING)
- SET( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
-ENDIF(NOT CMAKE_CROSSCOMPILING)
+set( _CMAKE_MAKE_PROGRAM_NAMES devenv)
+if(NOT CMAKE_CROSSCOMPILING)
+ set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
+endif()
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
HINTS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;EnvironmentDirectory]
@@ -29,6 +29,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
"$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/Common7/IDE"
"/Program Files/Microsoft Visual Studio 8/Common7/IDE/"
)
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
-SET(MSVC80 1)
-SET(MSVC_VERSION 1400)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
+set(MSVC80 1)
+set(MSVC_VERSION 1400)
diff --git a/Modules/CMakeVS9FindMake.cmake b/Modules/CMakeVS9FindMake.cmake
index 9e3c39e..35e9f98 100644
--- a/Modules/CMakeVS9FindMake.cmake
+++ b/Modules/CMakeVS9FindMake.cmake
@@ -13,12 +13,12 @@
# License text for the above reference.)
# VCExpress does not support cross compiling, which is necessary for Win CE
-SET( _CMAKE_MAKE_PROGRAM_NAMES devenv)
-IF(NOT CMAKE_CROSSCOMPILING)
- SET( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
-ENDIF(NOT CMAKE_CROSSCOMPILING)
+set( _CMAKE_MAKE_PROGRAM_NAMES devenv)
+if(NOT CMAKE_CROSSCOMPILING)
+ set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
+endif()
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
HINTS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;EnvironmentDirectory]
@@ -34,6 +34,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
"/Program Files/Microsoft Visual Studio 9.0/Common7/IDE/"
"/Program Files/Microsoft Visual Studio 9/Common7/IDE/"
)
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
-SET(MSVC90 1)
-SET(MSVC_VERSION 1500)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
+set(MSVC90 1)
+set(MSVC_VERSION 1500)
diff --git a/Modules/CMakeVerifyManifest.cmake b/Modules/CMakeVerifyManifest.cmake
index 7578369..aebe77e 100644
--- a/Modules/CMakeVerifyManifest.cmake
+++ b/Modules/CMakeVerifyManifest.cmake
@@ -4,7 +4,7 @@
# side by side manifests for a project match. To run this
# script, cd to a directory and run the script with cmake -P.
# On the command line you can pass in versions that are OK even
-# if not found in the .manifest files. For example,
+# if not found in the .manifest files. For example,
# cmake -Dallow_versions=8.0.50608.0 -PCmakeVerifyManifest.cmake
# could be used to allow an embeded manifest of 8.0.50608.0
# to be used in a project even if that version was not found
@@ -40,14 +40,14 @@ function(crt_version file list_var)
foreach(s ${strings})
set(has_match 1)
string(REGEX
- REPLACE ".*<assembly.*\"Microsoft.VC...CRT\".*version=\"([^\"]*)\".*</assembly>.*$" "\\1"
+ REPLACE ".*<assembly.*\"Microsoft.VC...CRT\".*version=\"([^\"]*)\".*</assembly>.*$" "\\1"
version "${s}")
if(NOT "${version}" STREQUAL "")
list(APPEND version_list ${version})
else()
message(FATAL_ERROR "Parse error could not find version in [${s}]")
endif()
- endforeach(s)
+ endforeach()
if(NOT DEFINED has_match)
message("Information: no embeded manifest in: ${file}")
return()
@@ -57,25 +57,25 @@ function(crt_version file list_var)
if(version_list)
set(${list_var} ${version_list} PARENT_SCOPE)
endif()
-endfunction(crt_version)
+endfunction()
set(fatal_error FALSE)
# check_version:
-#
+#
# test a file against the shipped manifest versions
# for a directory
function(check_version file manifest_versions)
set(manifest_versions ${manifest_versions} ${allow_versions})
# collect versions for a given file
crt_version(${file} file_versions)
- # see if the versions
+ # see if the versions
foreach(ver ${file_versions})
list(FIND manifest_versions "${ver}" found_version)
if("${found_version}" EQUAL -1)
message("ERROR: ${file} uses ${ver} not found in shipped manifests:[${manifest_versions}].")
set(fatal_error TRUE PARENT_SCOPE)
endif()
- endforeach(ver)
+ endforeach()
list(LENGTH file_versions len)
if(${len} GREATER 1)
message("WARNING: found more than one version of MICROSOFT.VC80.CRT referenced in ${file}: [${file_versions}]")
@@ -88,7 +88,7 @@ set(manifest_version_list )
file(GLOB_RECURSE manifest_files "*.manifest")
foreach(f ${manifest_files})
crt_version("${f}" manifest_version_list)
-endforeach(f)
+endforeach()
list(LENGTH manifest_version_list LEN)
if(LEN EQUAL 0)
message(FATAL_ERROR "No .manifest files found, no version check can be done.")
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 6575957..6886ed9 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -187,7 +187,7 @@
# in CMake, so this change is compatible).
##end
#
-# The following CPack variables are specific to source packages, and
+# The following CPack variables are specific to source packages, and
# will not affect binary packages:
#
##variable
@@ -285,48 +285,48 @@
# License text for the above reference.)
# Define this var in order to avoid (or warn) concerning multiple inclusion
-IF(CPack_CMake_INCLUDED)
- MESSAGE(WARNING "CPack.cmake has already been included!!")
-ELSE(CPack_CMake_INCLUDED)
- SET(CPack_CMake_INCLUDED 1)
-ENDIF(CPack_CMake_INCLUDED)
+if(CPack_CMake_INCLUDED)
+ message(WARNING "CPack.cmake has already been included!!")
+else()
+ set(CPack_CMake_INCLUDED 1)
+endif()
# Pick a configuration file
-SET(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
-IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
- SET(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
-ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
-SET(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
-IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
- SET(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
-ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
+set(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
+if(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
+ set(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
+endif()
+set(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
+if(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
+ set(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
+endif()
# Backward compatibility
# Include CPackComponent macros if it has not already been included before.
include(CPackComponent)
# Macro for setting values if a user did not overwrite them
-MACRO(cpack_set_if_not_set name value)
- IF(NOT DEFINED "${name}")
- SET(${name} "${value}")
- ENDIF(NOT DEFINED "${name}")
-ENDMACRO(cpack_set_if_not_set)
+macro(cpack_set_if_not_set name value)
+ if(NOT DEFINED "${name}")
+ set(${name} "${value}")
+ endif()
+endmacro()
# cpack_encode_variables - Macro to encode variables for the configuration file
# find any variable that starts with CPACK and create a variable
# _CPACK_OTHER_VARIABLES_ that contains SET commands for
# each cpack variable. _CPACK_OTHER_VARIABLES_ is then
# used as an @ replacment in configure_file for the CPackConfig.
-MACRO(cpack_encode_variables)
- SET(_CPACK_OTHER_VARIABLES_)
- GET_CMAKE_PROPERTY(res VARIABLES)
- FOREACH(var ${res})
- IF("xxx${var}" MATCHES "xxxCPACK")
- SET(_CPACK_OTHER_VARIABLES_
+macro(cpack_encode_variables)
+ set(_CPACK_OTHER_VARIABLES_)
+ get_cmake_property(res VARIABLES)
+ foreach(var ${res})
+ if("xxx${var}" MATCHES "xxxCPACK")
+ set(_CPACK_OTHER_VARIABLES_
"${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")")
- ENDIF("xxx${var}" MATCHES "xxxCPACK")
- ENDFOREACH(var ${res})
-ENDMACRO(cpack_encode_variables)
+ endif()
+ endforeach()
+endmacro()
# Set the package name
cpack_set_if_not_set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
@@ -350,22 +350,22 @@ cpack_set_if_not_set(CPACK_RESOURCE_FILE_WELCOME
cpack_set_if_not_set(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}")
-IF(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
- SET(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
-ENDIF(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
-
-IF(CPACK_NSIS_MODIFY_PATH)
- SET(CPACK_NSIS_MODIFY_PATH ON)
-ENDIF(CPACK_NSIS_MODIFY_PATH)
-
-SET(__cpack_system_name ${CMAKE_SYSTEM_NAME})
-IF(${__cpack_system_name} MATCHES Windows)
- IF(CMAKE_CL_64)
- SET(__cpack_system_name win64)
- ELSE(CMAKE_CL_64)
- SET(__cpack_system_name win32)
- ENDIF(CMAKE_CL_64)
-ENDIF(${__cpack_system_name} MATCHES Windows)
+if(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
+ set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
+endif()
+
+if(CPACK_NSIS_MODIFY_PATH)
+ set(CPACK_NSIS_MODIFY_PATH ON)
+endif()
+
+set(__cpack_system_name ${CMAKE_SYSTEM_NAME})
+if(${__cpack_system_name} MATCHES Windows)
+ if(CMAKE_CL_64)
+ set(__cpack_system_name win64)
+ else()
+ set(__cpack_system_name win32)
+ endif()
+endif()
cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}")
# Root dir: default value should be the string literal "$PROGRAMFILES"
@@ -386,15 +386,15 @@ cpack_set_if_not_set(CPACK_PACKAGE_RELOCATABLE "true")
# always force to exactly "true" or "false" for CPack.Info.plist.in:
if(CPACK_PACKAGE_RELOCATABLE)
set(CPACK_PACKAGE_RELOCATABLE "true")
-else(CPACK_PACKAGE_RELOCATABLE)
+else()
set(CPACK_PACKAGE_RELOCATABLE "false")
-endif(CPACK_PACKAGE_RELOCATABLE)
+endif()
macro(cpack_check_file_exists file description)
if(NOT EXISTS "${file}")
message(SEND_ERROR "CPack ${description} file: \"${file}\" could not be found.")
- endif(NOT EXISTS "${file}")
-endmacro(cpack_check_file_exists)
+ endif()
+endmacro()
cpack_check_file_exists("${CPACK_PACKAGE_DESCRIPTION_FILE}" "package description")
cpack_check_file_exists("${CPACK_RESOURCE_FILE_LICENSE}" "license resource")
@@ -404,8 +404,8 @@ cpack_check_file_exists("${CPACK_RESOURCE_FILE_WELCOME}" "welcome resource")
macro(cpack_optional_append _list _cond _item)
if(${_cond})
set(${_list} ${${_list}} ${_item})
- endif(${_cond})
-endmacro(cpack_optional_append _list _cond _item)
+ endif()
+endmacro()
##variable
# CPACK_BINARY_<GENNAME> - CPack generated options for binary generators. The
@@ -420,27 +420,27 @@ if(NOT CPACK_GENERATOR)
if(UNIX)
if(CYGWIN)
option(CPACK_BINARY_CYGWIN "Enable to build Cygwin binary packages" ON)
- else(CYGWIN)
+ else()
if(APPLE)
option(CPACK_BINARY_BUNDLE "Enable to build OSX bundles" OFF)
option(CPACK_BINARY_DRAGNDROP "Enable to build OSX Drag And Drop package" OFF)
option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages" ON)
option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages" OFF)
- else(APPLE)
+ else()
option(CPACK_BINARY_TZ "Enable to build TZ packages" ON)
- endif(APPLE)
+ endif()
option(CPACK_BINARY_STGZ "Enable to build STGZ packages" ON)
option(CPACK_BINARY_TGZ "Enable to build TGZ packages" ON)
option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 packages" OFF)
option(CPACK_BINARY_DEB "Enable to build Debian packages" OFF)
option(CPACK_BINARY_RPM "Enable to build RPM packages" OFF)
option(CPACK_BINARY_NSIS "Enable to build NSIS packages" OFF)
- endif(CYGWIN)
- else(UNIX)
+ endif()
+ else()
option(CPACK_BINARY_NSIS "Enable to build NSIS packages" ON)
option(CPACK_BINARY_ZIP "Enable to build ZIP packages" OFF)
- endif(UNIX)
-
+ endif()
+
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_BUNDLE Bundle)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DRAGNDROP DragNDrop)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_PACKAGEMAKER PackageMaker)
@@ -454,37 +454,37 @@ if(NOT CPACK_GENERATOR)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TBZ2 TBZ2)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TZ TZ)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_ZIP ZIP)
-
-endif(NOT CPACK_GENERATOR)
+
+endif()
# Provide options to choose source generators
if(NOT CPACK_SOURCE_GENERATOR)
if(UNIX)
if(CYGWIN)
option(CPACK_SOURCE_CYGWIN "Enable to build Cygwin source packages" ON)
- else(CYGWIN)
+ else()
option(CPACK_SOURCE_TBZ2 "Enable to build TBZ2 source packages" ON)
option(CPACK_SOURCE_TGZ "Enable to build TGZ source packages" ON)
option(CPACK_SOURCE_TZ "Enable to build TZ source packages" ON)
option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" OFF)
- endif(CYGWIN)
- else(UNIX)
+ endif()
+ else()
option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" ON)
- endif(UNIX)
+ endif()
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_CYGWIN CygwinSource)
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TGZ TGZ)
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TBZ2 TBZ2)
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TZ TZ)
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_ZIP ZIP)
-endif(NOT CPACK_SOURCE_GENERATOR)
+endif()
# mark the above options as advanced
mark_as_advanced(CPACK_BINARY_CYGWIN CPACK_BINARY_PACKAGEMAKER CPACK_BINARY_OSXX11
- CPACK_BINARY_STGZ CPACK_BINARY_TGZ CPACK_BINARY_TBZ2
- CPACK_BINARY_DEB CPACK_BINARY_RPM CPACK_BINARY_TZ
+ CPACK_BINARY_STGZ CPACK_BINARY_TGZ CPACK_BINARY_TBZ2
+ CPACK_BINARY_DEB CPACK_BINARY_RPM CPACK_BINARY_TZ
CPACK_BINARY_NSIS CPACK_BINARY_ZIP CPACK_BINARY_BUNDLE
- CPACK_SOURCE_CYGWIN CPACK_SOURCE_TBZ2 CPACK_SOURCE_TGZ
+ CPACK_SOURCE_CYGWIN CPACK_SOURCE_TBZ2 CPACK_SOURCE_TGZ
CPACK_SOURCE_TZ CPACK_SOURCE_ZIP CPACK_BINARY_DRAGNDROP)
# Set some other variables
@@ -494,16 +494,16 @@ cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}")
# if the user has set CPACK_NSIS_DISPLAY_NAME remember it
if(DEFINED CPACK_NSIS_DISPLAY_NAME)
- SET(CPACK_NSIS_DISPLAY_NAME_SET TRUE)
+ set(CPACK_NSIS_DISPLAY_NAME_SET TRUE)
endif()
# if the user has set CPACK_NSIS_DISPLAY
# explicitly, then use that as the default
# value of CPACK_NSIS_PACKAGE_NAME instead
-# of CPACK_PACKAGE_INSTALL_DIRECTORY
+# of CPACK_PACKAGE_INSTALL_DIRECTORY
cpack_set_if_not_set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
if(CPACK_NSIS_DISPLAY_NAME_SET)
- string(REPLACE "\\" "\\\\"
+ string(REPLACE "\\" "\\\\"
_NSIS_DISPLAY_NAME_TMP "${CPACK_NSIS_DISPLAY_NAME}")
cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${_NSIS_DISPLAY_NAME_TMP}")
else()
@@ -522,31 +522,31 @@ cpack_set_if_not_set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
cpack_set_if_not_set(CPACK_NSIS_INSTALLER_ICON_CODE "")
cpack_set_if_not_set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
-IF(DEFINED CPACK_COMPONENTS_ALL)
- IF(CPACK_MONOLITHIC_INSTALL)
- MESSAGE("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")
- SET(CPACK_COMPONENTS_ALL)
- ELSE(CPACK_MONOLITHIC_INSTALL)
+if(DEFINED CPACK_COMPONENTS_ALL)
+ if(CPACK_MONOLITHIC_INSTALL)
+ message("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")
+ set(CPACK_COMPONENTS_ALL)
+ else()
# The user has provided the set of components to be installed as
# part of a component-based installation; trust her.
- SET(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE)
- ENDIF(CPACK_MONOLITHIC_INSTALL)
-ELSE(DEFINED CPACK_COMPONENTS_ALL)
+ set(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE)
+ endif()
+else()
# If the user has not specifically requested a monolithic installer
# but has specified components in various "install" commands, tell
# CPack about those components.
- IF(NOT CPACK_MONOLITHIC_INSTALL)
- GET_CMAKE_PROPERTY(CPACK_COMPONENTS_ALL COMPONENTS)
- LIST(LENGTH CPACK_COMPONENTS_ALL CPACK_COMPONENTS_LEN)
- IF(CPACK_COMPONENTS_LEN EQUAL 1)
+ if(NOT CPACK_MONOLITHIC_INSTALL)
+ get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
+ list(LENGTH CPACK_COMPONENTS_ALL CPACK_COMPONENTS_LEN)
+ if(CPACK_COMPONENTS_LEN EQUAL 1)
# Only one component: this is not a component-based installation
# (at least, it isn't a component-based installation, but may
# become one later if the user uses the cpack_add_* commands).
- SET(CPACK_COMPONENTS_ALL)
- ENDIF(CPACK_COMPONENTS_LEN EQUAL 1)
- SET(CPACK_COMPONENTS_LEN)
- ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
-ENDIF(DEFINED CPACK_COMPONENTS_ALL)
+ set(CPACK_COMPONENTS_ALL)
+ endif()
+ set(CPACK_COMPONENTS_LEN)
+ endif()
+endif()
# CMake always generates a component named "Unspecified", which is
# used to install everything that doesn't have an explicitly-provided
@@ -566,13 +566,13 @@ cpack_set_if_not_set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Source")
cpack_set_if_not_set(CPACK_SOURCE_IGNORE_FILES
"/CVS/;/\\\\\\\\.svn/;/\\\\\\\\.bzr/;/\\\\\\\\.hg/;/\\\\\\\\.git/;\\\\\\\\.swp$;\\\\\\\\.#;/#")
-SET(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}")
-SET(CPACK_INSTALLED_DIRECTORIES "${CPACK_SOURCE_INSTALLED_DIRECTORIES}")
-SET(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}")
-SET(CPACK_TOPLEVEL_TAG "${CPACK_SOURCE_TOPLEVEL_TAG}")
-SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
-SET(CPACK_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}")
-SET(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}")
+set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}")
+set(CPACK_INSTALLED_DIRECTORIES "${CPACK_SOURCE_INSTALLED_DIRECTORIES}")
+set(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}")
+set(CPACK_TOPLEVEL_TAG "${CPACK_SOURCE_TOPLEVEL_TAG}")
+set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
+set(CPACK_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}")
+set(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}")
cpack_encode_variables()
configure_file("${cpack_source_input_file}"
diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake
index 1598703..c85cfb4 100644
--- a/Modules/CPackComponent.cmake
+++ b/Modules/CPackComponent.cmake
@@ -28,31 +28,31 @@
##variable
# CPACK_COMPONENTS_ALL - The list of component to install.
#
-# The default value of this variable is computed by CPack
-# and contains all components defined by the project. The
-# user may set it to only include the specified components.
+#The default value of this variable is computed by CPack
+#and contains all components defined by the project. The
+#user may set it to only include the specified components.
##end
#
##variable
# CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
# CPack generator <GENNAME>.
#
-# Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
-# default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
-# One can change the default behavior by setting this variable to 0/1 or OFF/ON.
+#Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
+#default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
+#One can change the default behavior by setting this variable to 0/1 or OFF/ON.
##end
##variable
# CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
# component-aware CPack generators.
#
-# Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
-# packages files when asked for component packaging. They group the component
-# differently depending on the value of this variable:
-# - ONE_PER_GROUP (default): creates one package file per component group
-# - ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
-# - IGNORE : creates one package per component, i.e. IGNORE component group
-# One can specify different grouping for different CPack generator by using
-# a CPACK_PROJECT_CONFIG_FILE.
+#Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
+#packages files when asked for component packaging. They group the component
+#differently depending on the value of this variable:
+# - ONE_PER_GROUP (default): creates one package file per component group
+# - ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
+# - IGNORE : creates one package per component, i.e. IGNORE component group
+#One can specify different grouping for different CPack generator by using
+#a CPACK_PROJECT_CONFIG_FILE.
##end
##variable
# CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
@@ -71,194 +71,194 @@
# CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
##end
##macro
-# cpack_add_component - Describes a CPack installation component
-# named by the COMPONENT argument to a CMake INSTALL command.
-#
-# cpack_add_component(compname
-# [DISPLAY_NAME name]
-# [DESCRIPTION description]
-# [HIDDEN | REQUIRED | DISABLED ]
-# [GROUP group]
-# [DEPENDS comp1 comp2 ... ]
-# [INSTALL_TYPES type1 type2 ... ]
-# [DOWNLOADED]
-# [ARCHIVE_FILE filename])
-#
-# The cmake_add_component command describes an installation
-# component, which the user can opt to install or remove as part of
-# the graphical installation process. compname is the name of the
-# component, as provided to the COMPONENT argument of one or more
-# CMake INSTALL commands.
-#
-# DISPLAY_NAME is the displayed name of the component, used in
-# graphical installers to display the component name. This value can
-# be any string.
-#
-# DESCRIPTION is an extended description of the component, used in
-# graphical installers to give the user additional information about
-# the component. Descriptions can span multiple lines using "\n" as
-# the line separator. Typically, these descriptions should be no
-# more than a few lines long.
-#
-# HIDDEN indicates that this component will be hidden in the
-# graphical installer, so that the user cannot directly change
-# whether it is installed or not.
-#
-# REQUIRED indicates that this component is required, and therefore
-# will always be installed. It will be visible in the graphical
-# installer, but it cannot be unselected. (Typically, required
-# components are shown greyed out).
-#
-# DISABLED indicates that this component should be disabled
-# (unselected) by default. The user is free to select this component
-# for installation, unless it is also HIDDEN.
-#
-# DEPENDS lists the components on which this component depends. If
-# this component is selected, then each of the components listed
-# must also be selected. The dependency information is encoded
-# within the installer itself, so that users cannot install
-# inconsitent sets of components.
-#
-# GROUP names the component group of which this component is a
-# part. If not provided, the component will be a standalone
-# component, not part of any component group. Component groups are
-# described with the cpack_add_component_group command, detailed
-# below.
-#
-# INSTALL_TYPES lists the installation types of which this component
-# is a part. When one of these installations types is selected, this
-# component will automatically be selected. Installation types are
-# described with the cpack_add_install_type command, detailed below.
-#
-# DOWNLOADED indicates that this component should be downloaded
-# on-the-fly by the installer, rather than packaged in with the
-# installer itself. For more information, see the cpack_configure_downloads
-# command.
-#
-# ARCHIVE_FILE provides a name for the archive file created by CPack
-# to be used for downloaded components. If not supplied, CPack will
-# create a file with some name based on CPACK_PACKAGE_FILE_NAME and
-# the name of the component. See cpack_configure_downloads for more
-# information.
+#cpack_add_component - Describes a CPack installation component
+#named by the COMPONENT argument to a CMake INSTALL command.
+#
+# cpack_add_component(compname
+# [DISPLAY_NAME name]
+# [DESCRIPTION description]
+# [HIDDEN | REQUIRED | DISABLED ]
+# [GROUP group]
+# [DEPENDS comp1 comp2 ... ]
+# [INSTALL_TYPES type1 type2 ... ]
+# [DOWNLOADED]
+# [ARCHIVE_FILE filename])
+#
+#The cmake_add_component command describes an installation
+#component, which the user can opt to install or remove as part of
+#the graphical installation process. compname is the name of the
+#component, as provided to the COMPONENT argument of one or more
+#CMake INSTALL commands.
+#
+#DISPLAY_NAME is the displayed name of the component, used in
+#graphical installers to display the component name. This value can
+#be any string.
+#
+#DESCRIPTION is an extended description of the component, used in
+#graphical installers to give the user additional information about
+#the component. Descriptions can span multiple lines using "\n" as
+#the line separator. Typically, these descriptions should be no
+#more than a few lines long.
+#
+#HIDDEN indicates that this component will be hidden in the
+#graphical installer, so that the user cannot directly change
+#whether it is installed or not.
+#
+#REQUIRED indicates that this component is required, and therefore
+#will always be installed. It will be visible in the graphical
+#installer, but it cannot be unselected. (Typically, required
+#components are shown greyed out).
+#
+#DISABLED indicates that this component should be disabled
+#(unselected) by default. The user is free to select this component
+#for installation, unless it is also HIDDEN.
+#
+#DEPENDS lists the components on which this component depends. If
+#this component is selected, then each of the components listed
+#must also be selected. The dependency information is encoded
+#within the installer itself, so that users cannot install
+#inconsistent sets of components.
+#
+#GROUP names the component group of which this component is a
+#part. If not provided, the component will be a standalone
+#component, not part of any component group. Component groups are
+#described with the cpack_add_component_group command, detailed
+#below.
+#
+#INSTALL_TYPES lists the installation types of which this component
+#is a part. When one of these installations types is selected, this
+#component will automatically be selected. Installation types are
+#described with the cpack_add_install_type command, detailed below.
+#
+#DOWNLOADED indicates that this component should be downloaded
+#on-the-fly by the installer, rather than packaged in with the
+#installer itself. For more information, see the cpack_configure_downloads
+# command.
+#
+#ARCHIVE_FILE provides a name for the archive file created by CPack
+#to be used for downloaded components. If not supplied, CPack will
+#create a file with some name based on CPACK_PACKAGE_FILE_NAME and
+#the name of the component. See cpack_configure_downloads for more
+#information.
##end
#
##macro
-# cpack_add_component_group - Describes a group of related CPack
-# installation components.
-#
-# cpack_add_component_group(groupname
-# [DISPLAY_NAME name]
-# [DESCRIPTION description]
-# [PARENT_GROUP parent]
-# [EXPANDED]
-# [BOLD_TITLE])
-#
-# The cpack_add_component_group describes a group of installation
-# components, which will be placed together within the listing of
-# options. Typically, component groups allow the user to
-# select/deselect all of the components within a single group via a
-# single group-level option. Use component groups to reduce the
-# complexity of installers with many options. groupname is an
-# arbitrary name used to identify the group in the GROUP argument of
-# the cpack_add_component command, which is used to place a
-# component in a group. The name of the group must not conflict with
-# the name of any component.
-#
-# DISPLAY_NAME is the displayed name of the component group, used in
-# graphical installers to display the component group name. This
-# value can be any string.
-#
-# DESCRIPTION is an extended description of the component group,
-# used in graphical installers to give the user additional
-# information about the components within that group. Descriptions
-# can span multiple lines using "\n" as the line
-# separator. Typically, these descriptions should be no more than a
-# few lines long.
-#
-# PARENT_GROUP, if supplied, names the parent group of this group.
-# Parent groups are used to establish a hierarchy of groups,
-# providing an arbitrary hierarchy of groups.
-#
-# EXPANDED indicates that, by default, the group should show up as
-# "expanded", so that the user immediately sees all of the
-# components within the group. Otherwise, the group will initially
-# show up as a single entry.
-#
-# BOLD_TITLE indicates that the group title should appear in bold,
-# to call the user's attention to the group.
+#cpack_add_component_group - Describes a group of related CPack
+#installation components.
+#
+# cpack_add_component_group(groupname
+# [DISPLAY_NAME name]
+# [DESCRIPTION description]
+# [PARENT_GROUP parent]
+# [EXPANDED]
+# [BOLD_TITLE])
+#
+#The cpack_add_component_group describes a group of installation
+#components, which will be placed together within the listing of
+#options. Typically, component groups allow the user to
+#select/deselect all of the components within a single group via a
+#single group-level option. Use component groups to reduce the
+#complexity of installers with many options. groupname is an
+#arbitrary name used to identify the group in the GROUP argument of
+#the cpack_add_component command, which is used to place a
+#component in a group. The name of the group must not conflict with
+#the name of any component.
+#
+#DISPLAY_NAME is the displayed name of the component group, used in
+#graphical installers to display the component group name. This
+#value can be any string.
+#
+#DESCRIPTION is an extended description of the component group,
+#used in graphical installers to give the user additional
+#information about the components within that group. Descriptions
+#can span multiple lines using "\n" as the line
+#separator. Typically, these descriptions should be no more than a
+#few lines long.
+#
+#PARENT_GROUP, if supplied, names the parent group of this group.
+#Parent groups are used to establish a hierarchy of groups,
+#providing an arbitrary hierarchy of groups.
+#
+#EXPANDED indicates that, by default, the group should show up as
+#"expanded", so that the user immediately sees all of the
+#components within the group. Otherwise, the group will initially
+#show up as a single entry.
+#
+#BOLD_TITLE indicates that the group title should appear in bold,
+#to call the user's attention to the group.
##end
#
##macro
-# cpack_add_install_type - Add a new installation type containing a
-# set of predefined component selections to the graphical installer.
-#
-# cpack_add_install_type(typename
-# [DISPLAY_NAME name])
-#
-# The cpack_add_install_type command identifies a set of preselected
-# components that represents a common use case for an
-# application. For example, a "Developer" install type might include
-# an application along with its header and library files, while an
-# "End user" install type might just include the application's
-# executable. Each component identifies itself with one or more
-# install types via the INSTALL_TYPES argument to
-# cpack_add_component.
-#
-# DISPLAY_NAME is the displayed name of the install type, which will
-# typically show up in a drop-down box within a graphical
-# installer. This value can be any string.
+#cpack_add_install_type - Add a new installation type containing a
+#set of predefined component selections to the graphical installer.
+#
+# cpack_add_install_type(typename
+# [DISPLAY_NAME name])
+#
+#The cpack_add_install_type command identifies a set of preselected
+#components that represents a common use case for an
+#application. For example, a "Developer" install type might include
+#an application along with its header and library files, while an
+#"End user" install type might just include the application's
+#executable. Each component identifies itself with one or more
+#install types via the INSTALL_TYPES argument to
+#cpack_add_component.
+#
+#DISPLAY_NAME is the displayed name of the install type, which will
+#typically show up in a drop-down box within a graphical
+#installer. This value can be any string.
##end
#
##macro
-# cpack_configure_downloads - Configure CPack to download selected
-# components on-the-fly as part of the installation process.
-#
-# cpack_configure_downloads(site
-# [UPLOAD_DIRECTORY dirname]
-# [ALL]
-# [ADD_REMOVE|NO_ADD_REMOVE])
-#
-# The cpack_configure_downloads command configures installation-time
-# downloads of selected components. For each downloadable component,
-# CPack will create an archive containing the contents of that
-# component, which should be uploaded to the given site. When the
-# user selects that component for installation, the installer will
-# download and extract the component in place. This feature is
-# useful for creating small installers that only download the
-# requested components, saving bandwidth. Additionally, the
-# installers are small enough that they will be installed as part of
-# the normal installation process, and the "Change" button in
-# Windows Add/Remove Programs control panel will allow one to add or
-# remove parts of the application after the original
-# installation. On Windows, the downloaded-components functionality
-# requires the ZipDLL plug-in for NSIS, available at:
-#
-# http://nsis.sourceforge.net/ZipDLL_plug-in
-#
-# On Mac OS X, installers that download components on-the-fly can
-# only be built and installed on system using Mac OS X 10.5 or
-# later.
-#
-# The site argument is a URL where the archives for downloadable
-# components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
-# All of the archives produced by CPack should be uploaded to that location.
-#
-# UPLOAD_DIRECTORY is the local directory where CPack will create the
-# various archives for each of the components. The contents of this
-# directory should be uploaded to a location accessible by the URL given
-# in the site argument. If omitted, CPack will use the directory
-# CPackUploads inside the CMake binary directory to store the generated
-# archives.
-#
-# The ALL flag indicates that all components be downloaded. Otherwise, only
-# those components explicitly marked as DOWNLOADED or that have a specified
-# ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
-# ADD_REMOVE (unless NO_ADD_REMOVE is specified).
-#
-# ADD_REMOVE indicates that CPack should install a copy of the installer
-# that can be called from Windows' Add/Remove Programs dialog (via the
-# "Modify" button) to change the set of installed components. NO_ADD_REMOVE
-# turns off this behavior. This option is ignored on Mac OS X.
+#cpack_configure_downloads - Configure CPack to download selected
+#components on-the-fly as part of the installation process.
+#
+# cpack_configure_downloads(site
+# [UPLOAD_DIRECTORY dirname]
+# [ALL]
+# [ADD_REMOVE|NO_ADD_REMOVE])
+#
+#The cpack_configure_downloads command configures installation-time
+#downloads of selected components. For each downloadable component,
+#CPack will create an archive containing the contents of that
+#component, which should be uploaded to the given site. When the
+#user selects that component for installation, the installer will
+#download and extract the component in place. This feature is
+#useful for creating small installers that only download the
+#requested components, saving bandwidth. Additionally, the
+#installers are small enough that they will be installed as part of
+#the normal installation process, and the "Change" button in
+#Windows Add/Remove Programs control panel will allow one to add or
+#remove parts of the application after the original
+#installation. On Windows, the downloaded-components functionality
+#requires the ZipDLL plug-in for NSIS, available at:
+#
+# http://nsis.sourceforge.net/ZipDLL_plug-in
+#
+#On Mac OS X, installers that download components on-the-fly can
+#only be built and installed on system using Mac OS X 10.5 or
+#later.
+#
+#The site argument is a URL where the archives for downloadable
+#components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
+#All of the archives produced by CPack should be uploaded to that location.
+#
+#UPLOAD_DIRECTORY is the local directory where CPack will create the
+#various archives for each of the components. The contents of this
+#directory should be uploaded to a location accessible by the URL given
+#in the site argument. If omitted, CPack will use the directory
+#CPackUploads inside the CMake binary directory to store the generated
+#archives.
+#
+#The ALL flag indicates that all components be downloaded. Otherwise, only
+#those components explicitly marked as DOWNLOADED or that have a specified
+#ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
+#ADD_REMOVE (unless NO_ADD_REMOVE is specified).
+#
+#ADD_REMOVE indicates that CPack should install a copy of the installer
+#that can be called from Windows' Add/Remove Programs dialog (via the
+#"Modify" button) to change the set of installed components. NO_ADD_REMOVE
+#turns off this behavior. This option is ignored on Mac OS X.
##endmacro
#=============================================================================
@@ -275,84 +275,84 @@
# License text for the above reference.)
# Define var in order to avoid multiple inclusion
-IF(NOT CPackComponent_CMake_INCLUDED)
-SET(CPackComponent_CMake_INCLUDED 1)
+if(NOT CPackComponent_CMake_INCLUDED)
+set(CPackComponent_CMake_INCLUDED 1)
# Argument-parsing macro from http://www.cmake.org/Wiki/CMakeMacroParseArguments
-MACRO(cpack_parse_arguments prefix arg_names option_names)
- SET(${prefix}_DEFAULT_ARGS)
- FOREACH(arg_name ${arg_names})
- SET(${prefix}_${arg_name})
- ENDFOREACH(arg_name)
- FOREACH(option ${option_names})
- SET(${prefix}_${option} FALSE)
- ENDFOREACH(option)
+macro(cpack_parse_arguments prefix arg_names option_names)
+ set(${prefix}_DEFAULT_ARGS)
+ foreach(arg_name ${arg_names})
+ set(${prefix}_${arg_name})
+ endforeach()
+ foreach(option ${option_names})
+ set(${prefix}_${option} FALSE)
+ endforeach()
- SET(current_arg_name DEFAULT_ARGS)
- SET(current_arg_list)
- FOREACH(arg ${ARGN})
- SET(larg_names ${arg_names})
- LIST(FIND larg_names "${arg}" is_arg_name)
- IF (is_arg_name GREATER -1)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
- SET(current_arg_name ${arg})
- SET(current_arg_list)
- ELSE (is_arg_name GREATER -1)
- SET(loption_names ${option_names})
- LIST(FIND loption_names "${arg}" is_option)
- IF (is_option GREATER -1)
- SET(${prefix}_${arg} TRUE)
- ELSE (is_option GREATER -1)
- SET(current_arg_list ${current_arg_list} ${arg})
- ENDIF (is_option GREATER -1)
- ENDIF (is_arg_name GREATER -1)
- ENDFOREACH(arg)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
-ENDMACRO(cpack_parse_arguments)
+ set(current_arg_name DEFAULT_ARGS)
+ set(current_arg_list)
+ foreach(arg ${ARGN})
+ set(larg_names ${arg_names})
+ list(FIND larg_names "${arg}" is_arg_name)
+ if (is_arg_name GREATER -1)
+ set(${prefix}_${current_arg_name} ${current_arg_list})
+ set(current_arg_name ${arg})
+ set(current_arg_list)
+ else ()
+ set(loption_names ${option_names})
+ list(FIND loption_names "${arg}" is_option)
+ if (is_option GREATER -1)
+ set(${prefix}_${arg} TRUE)
+ else ()
+ set(current_arg_list ${current_arg_list} ${arg})
+ endif ()
+ endif ()
+ endforeach()
+ set(${prefix}_${current_arg_name} ${current_arg_list})
+endmacro()
# Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var"
# has been defined. The string will eventually be appended to a CPack
# configuration file.
-MACRO(cpack_append_variable_set_command var strvar)
- IF (DEFINED ${var})
- SET(${strvar} "${${strvar}}SET(${var}")
- FOREACH(APPENDVAL ${${var}})
- SET(${strvar} "${${strvar}} ${APPENDVAL}")
- ENDFOREACH(APPENDVAL)
- SET(${strvar} "${${strvar}})\n")
- ENDIF (DEFINED ${var})
-ENDMACRO(cpack_append_variable_set_command)
+macro(cpack_append_variable_set_command var strvar)
+ if (DEFINED ${var})
+ set(${strvar} "${${strvar}}set(${var}")
+ foreach(APPENDVAL ${${var}})
+ set(${strvar} "${${strvar}} ${APPENDVAL}")
+ endforeach()
+ set(${strvar} "${${strvar}})\n")
+ endif ()
+endmacro()
# Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var"
# has been defined and is a string. The string will eventually be
# appended to a CPack configuration file.
-MACRO(cpack_append_string_variable_set_command var strvar)
- IF (DEFINED ${var})
- LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
- IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
- SET(${strvar} "${${strvar}}SET(${var} \"${${var}}\")\n")
- ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
- ENDIF (DEFINED ${var})
-ENDMACRO(cpack_append_string_variable_set_command)
+macro(cpack_append_string_variable_set_command var strvar)
+ if (DEFINED ${var})
+ list(LENGTH ${var} CPACK_APP_VALUE_LEN)
+ if(${CPACK_APP_VALUE_LEN} EQUAL 1)
+ set(${strvar} "${${strvar}}set(${var} \"${${var}}\")\n")
+ endif()
+ endif ()
+endmacro()
# Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var"
# has been set to true. The string will eventually be
# appended to a CPack configuration file.
-MACRO(cpack_append_option_set_command var strvar)
- IF (${var})
- LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
- IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
- SET(${strvar} "${${strvar}}SET(${var} TRUE)\n")
- ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
- ENDIF (${var})
-ENDMACRO(cpack_append_option_set_command)
+macro(cpack_append_option_set_command var strvar)
+ if (${var})
+ list(LENGTH ${var} CPACK_APP_VALUE_LEN)
+ if(${CPACK_APP_VALUE_LEN} EQUAL 1)
+ set(${strvar} "${${strvar}}set(${var} TRUE)\n")
+ endif()
+ endif ()
+endmacro()
# Macro that adds a component to the CPack installer
-MACRO(cpack_add_component compname)
- STRING(TOUPPER ${compname} CPACK_ADDCOMP_UNAME)
+macro(cpack_add_component compname)
+ string(TOUPPER ${compname} CPACK_ADDCOMP_UNAME)
cpack_parse_arguments(CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}
"DISPLAY_NAME;DESCRIPTION;GROUP;DEPENDS;INSTALL_TYPES;ARCHIVE_FILE"
"HIDDEN;REQUIRED;DISABLED;DOWNLOADED"
@@ -360,25 +360,25 @@ MACRO(cpack_add_component compname)
)
if (CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED)
- SET(CPACK_ADDCOMP_STR "\n# Configuration for downloaded component \"${compname}\"\n")
+ set(CPACK_ADDCOMP_STR "\n# Configuration for downloaded component \"${compname}\"\n")
else ()
- SET(CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n")
+ set(CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n")
endif ()
- IF(NOT CPACK_MONOLITHIC_INSTALL)
+ if(NOT CPACK_MONOLITHIC_INSTALL)
# If the user didn't set CPACK_COMPONENTS_ALL explicitly, update the
# value of CPACK_COMPONENTS_ALL in the configuration file. This will
# take care of any components that have been added after the CPack
# moduled was included.
- IF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
- GET_CMAKE_PROPERTY(CPACK_ADDCOMP_COMPONENTS COMPONENTS)
- SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
- FOREACH(COMP ${CPACK_ADDCOMP_COMPONENTS})
- SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
- ENDFOREACH(COMP)
- SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
- ENDIF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
- ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
+ if(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
+ get_cmake_property(CPACK_ADDCOMP_COMPONENTS COMPONENTS)
+ set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
+ foreach(COMP ${CPACK_ADDCOMP_COMPONENTS})
+ set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
+ endforeach()
+ set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
+ endif()
+ endif()
cpack_append_string_variable_set_command(
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISPLAY_NAME
@@ -414,21 +414,21 @@ MACRO(cpack_add_component compname)
# Write to config iff the macros is used after CPack.cmake has been
# included, other it's not necessary because the variables
# will be encoded by cpack_encode_variables.
- IF(CPack_CMake_INCLUDED)
- FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
- ENDIF(CPack_CMake_INCLUDED)
-ENDMACRO(cpack_add_component)
+ if(CPack_CMake_INCLUDED)
+ file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
+ endif()
+endmacro()
# Macro that adds a component group to the CPack installer
-MACRO(cpack_add_component_group grpname)
- STRING(TOUPPER ${grpname} CPACK_ADDGRP_UNAME)
+macro(cpack_add_component_group grpname)
+ string(TOUPPER ${grpname} CPACK_ADDGRP_UNAME)
cpack_parse_arguments(CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}
"DISPLAY_NAME;DESCRIPTION"
"EXPANDED;BOLD_TITLE"
${ARGN}
)
- SET(CPACK_ADDGRP_STR "\n# Configuration for component group \"${grpname}\"\n")
+ set(CPACK_ADDGRP_STR "\n# Configuration for component group \"${grpname}\"\n")
cpack_append_string_variable_set_command(
CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DISPLAY_NAME
CPACK_ADDGRP_STR)
@@ -445,24 +445,24 @@ MACRO(cpack_add_component_group grpname)
# Write to config iff the macros is used after CPack.cmake has been
# included, other it's not necessary because the variables
# will be encoded by cpack_encode_variables.
- IF(CPack_CMake_INCLUDED)
- FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
- ENDIF(CPack_CMake_INCLUDED)
-ENDMACRO(cpack_add_component_group)
+ if(CPack_CMake_INCLUDED)
+ file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
+ endif()
+endmacro()
# Macro that adds an installation type to the CPack installer
-MACRO(cpack_add_install_type insttype)
- STRING(TOUPPER ${insttype} CPACK_INSTTYPE_UNAME)
+macro(cpack_add_install_type insttype)
+ string(TOUPPER ${insttype} CPACK_INSTTYPE_UNAME)
cpack_parse_arguments(CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}
"DISPLAY_NAME"
""
${ARGN}
)
- SET(CPACK_INSTTYPE_STR
+ set(CPACK_INSTTYPE_STR
"\n# Configuration for installation type \"${insttype}\"\n")
- SET(CPACK_INSTTYPE_STR
- "${CPACK_INSTTYPE_STR}LIST(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
+ set(CPACK_INSTTYPE_STR
+ "${CPACK_INSTTYPE_STR}list(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
cpack_append_string_variable_set_command(
CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}_DISPLAY_NAME
CPACK_INSTTYPE_STR)
@@ -470,22 +470,22 @@ MACRO(cpack_add_install_type insttype)
# Write to config iff the macros is used after CPack.cmake has been
# included, other it's not necessary because the variables
# will be encoded by cpack_encode_variables.
- IF(CPack_CMake_INCLUDED)
- FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
- ENDIF(CPack_CMake_INCLUDED)
-ENDMACRO(cpack_add_install_type)
+ if(CPack_CMake_INCLUDED)
+ file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
+ endif()
+endmacro()
-MACRO(cpack_configure_downloads site)
+macro(cpack_configure_downloads site)
cpack_parse_arguments(CPACK_DOWNLOAD
"UPLOAD_DIRECTORY"
"ALL;ADD_REMOVE;NO_ADD_REMOVE"
${ARGN}
)
- SET(CPACK_CONFIG_DL_STR
+ set(CPACK_CONFIG_DL_STR
"\n# Downloaded components configuration\n")
- SET(CPACK_UPLOAD_DIRECTORY ${CPACK_DOWNLOAD_UPLOAD_DIRECTORY})
- SET(CPACK_DOWNLOAD_SITE ${site})
+ set(CPACK_UPLOAD_DIRECTORY ${CPACK_DOWNLOAD_UPLOAD_DIRECTORY})
+ set(CPACK_DOWNLOAD_SITE ${site})
cpack_append_string_variable_set_command(
CPACK_DOWNLOAD_SITE
CPACK_CONFIG_DL_STR)
@@ -495,10 +495,10 @@ MACRO(cpack_configure_downloads site)
cpack_append_option_set_command(
CPACK_DOWNLOAD_ALL
CPACK_CONFIG_DL_STR)
- IF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
- SET(CPACK_DOWNLOAD_ADD_REMOVE ON)
- ENDIF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
- SET(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
+ if (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
+ set(CPACK_DOWNLOAD_ADD_REMOVE ON)
+ endif ()
+ set(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
cpack_append_option_set_command(
CPACK_ADD_REMOVE
CPACK_CONFIG_DL_STR)
@@ -506,8 +506,8 @@ MACRO(cpack_configure_downloads site)
# Write to config iff the macros is used after CPack.cmake has been
# included, other it's not necessary because the variables
# will be encoded by cpack_encode_variables.
- IF(CPack_CMake_INCLUDED)
- FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
- ENDIF(CPack_CMake_INCLUDED)
-ENDMACRO(cpack_configure_downloads)
-ENDIF(NOT CPackComponent_CMake_INCLUDED)
+ if(CPack_CMake_INCLUDED)
+ file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
+ endif()
+endmacro()
+endif()
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index bd3b94d..106b44c 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -161,7 +161,7 @@
# Default : -
# This variable allow advanced user to add custom script to the control.tar.gz
# Typical usage is for conffiles, postinst, postrm, prerm.
-# Usage: SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
+# Usage: set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
##end
@@ -185,115 +185,115 @@
#
# http://wiki.debian.org/HowToPackageForDebian
-IF(CMAKE_BINARY_DIR)
- MESSAGE(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.")
-ENDIF(CMAKE_BINARY_DIR)
+if(CMAKE_BINARY_DIR)
+ message(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.")
+endif()
-IF(NOT UNIX)
- MESSAGE(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
-ENDIF(NOT UNIX)
+if(NOT UNIX)
+ message(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
+endif()
# 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(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+ set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
+endif()
-FIND_PROGRAM(FAKEROOT_EXECUTABLE fakeroot)
-IF(FAKEROOT_EXECUTABLE)
- SET(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE})
-ENDIF(FAKEROOT_EXECUTABLE)
+find_program(FAKEROOT_EXECUTABLE fakeroot)
+if(FAKEROOT_EXECUTABLE)
+ set(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE})
+endif()
-IF(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)
+ 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
+ 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]+)"
+ 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)
+ set(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
+ if(CPACK_DEBIAN_PACKAGE_DEBUG)
+ message( "CPackDeb Debug: dpkg-shlibdeps version is <${SHLIBDEPS_EXECUTABLE_VERSION}>")
+ endif()
# Generating binary list - Get type of all install files
- EXECUTE_PROCESS(COMMAND find -type f
+ 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})
+ 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()
+ 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")
+ 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 "")
+ 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}
+ 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)
+ 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)
+ message( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}")
+ endif()
+ if (NOT SHLIBDEPS_RESULT EQUAL 0)
+ message (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}")
+ endif ()
#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)
+ if(CPACK_DEBIAN_PACKAGE_DEBUG)
+ message( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
+ endif()
# Remove blank control file
# Might not be safe if package actual contain file or directory named debian
- FILE(REMOVE_RECURSE "${CPACK_TEMPORARY_DIRECTORY}/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)
+ if (CPACK_DEBIAN_PACKAGE_DEPENDS)
+ set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
+ else ()
+ set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
+ endif ()
+
+ else ()
+ if(CPACK_DEBIAN_PACKAGE_DEBUG)
+ message( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.")
+ endif()
+ endif()
+
+else ()
+ if(CPACK_DEBIAN_PACKAGE_DEBUG)
+ message( "CPackDeb Debug: Using only user-provided depends")
+ endif()
+endif()
# Let's define the control file found in debian package:
@@ -303,67 +303,67 @@ ENDIF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
# DEBIAN/control
# debian policy enforce lower case for package name
# Package: (mandatory)
-IF(NOT CPACK_DEBIAN_PACKAGE_NAME)
- STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
-ENDIF(NOT CPACK_DEBIAN_PACKAGE_NAME)
+if(NOT CPACK_DEBIAN_PACKAGE_NAME)
+ string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
+endif()
# Version: (mandatory)
-IF(NOT CPACK_DEBIAN_PACKAGE_VERSION)
- IF(NOT CPACK_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)
+if(NOT CPACK_DEBIAN_PACKAGE_VERSION)
+ if(NOT CPACK_PACKAGE_VERSION)
+ message(FATAL_ERROR "CPackDeb: Debian package requires a package version")
+ endif()
+ set(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
+endif()
# Architecture: (mandatory)
-IF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
+if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
# There is no such thing as i686 architecture on debian, you should use i386 instead
# $ dpkg --print-architecture
- FIND_PROGRAM(DPKG_CMD dpkg)
- IF(NOT DPKG_CMD)
- 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
+ find_program(DPKG_CMD dpkg)
+ if(NOT DPKG_CMD)
+ message(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.")
+ set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
+ endif()
+ execute_process(COMMAND "${DPKG_CMD}" --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
-ENDIF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
+endif()
-# have a look at GET_PROPERTY(result GLOBAL PROPERTY ENABLED_FEATURES),
-# this returns the successful FIND_PACKAGE() calls, maybe this can help
+# have a look at get_property(result GLOBAL PROPERTY ENABLED_FEATURES),
+# this returns the successful find_package() calls, maybe this can help
# Depends:
# You should set: DEBIAN_PACKAGE_DEPENDS
# TODO: automate 'objdump -p | grep NEEDED'
-IF(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
- MESSAGE(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.")
-ENDIF(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
+if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
+ message(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.")
+endif()
# Maintainer: (mandatory)
-IF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
- IF(NOT CPACK_PACKAGE_CONTACT)
- 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)
+if(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
+ if(NOT CPACK_PACKAGE_CONTACT)
+ message(FATAL_ERROR "CPackDeb: Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER")
+ endif()
+ set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
+endif()
# Description: (mandatory)
-IF(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
- IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
- 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)
+if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
+ if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+ message(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION")
+ endif()
+ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
+endif()
# Section: (recommended)
-IF(NOT CPACK_DEBIAN_PACKAGE_SECTION)
- SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
-ENDIF(NOT CPACK_DEBIAN_PACKAGE_SECTION)
+if(NOT CPACK_DEBIAN_PACKAGE_SECTION)
+ set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
+endif()
# Priority: (recommended)
-IF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY)
- SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
-ENDIF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
+if(NOT CPACK_DEBIAN_PACKAGE_PRIORITY)
+ set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
+endif()
# Recommends:
# You should set: CPACK_DEBIAN_PACKAGE_RECOMMENDS
@@ -379,32 +379,32 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
# - 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")
# Are we packaging components ?
-IF(CPACK_DEB_PACKAGE_COMPONENT)
- SET(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "-${CPACK_DEB_PACKAGE_COMPONENT}")
- SET(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "/${CPACK_DEB_PACKAGE_COMPONENT}")
- SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_DEB_PACKAGE_COMPONENT}")
- STRING(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
-ELSE(CPACK_DEB_PACKAGE_COMPONENT)
- SET(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "")
- SET(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "")
- SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
-ENDIF(CPACK_DEB_PACKAGE_COMPONENT)
+if(CPACK_DEB_PACKAGE_COMPONENT)
+ set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "-${CPACK_DEB_PACKAGE_COMPONENT}")
+ set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "/${CPACK_DEB_PACKAGE_COMPONENT}")
+ set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_DEB_PACKAGE_COMPONENT}")
+ string(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
+else()
+ set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "")
+ set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "")
+ set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
+endif()
# Print out some debug information if we were asked for that
-IF(CPACK_DEBIAN_PACKAGE_DEBUG)
- MESSAGE("CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
- MESSAGE("CPackDeb:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
- MESSAGE("CPackDeb:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}")
- MESSAGE("CPackDeb:Debug: CPACK_OUTPUT_FILE_NAME = ${CPACK_OUTPUT_FILE_NAME}")
- MESSAGE("CPackDeb:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}")
- MESSAGE("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
- MESSAGE("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
- MESSAGE("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
-ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
+if(CPACK_DEBIAN_PACKAGE_DEBUG)
+ message("CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
+ message("CPackDeb:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
+ message("CPackDeb:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}")
+ message("CPackDeb:Debug: CPACK_OUTPUT_FILE_NAME = ${CPACK_OUTPUT_FILE_NAME}")
+ message("CPackDeb:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}")
+ message("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
+ message("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+ message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
+endif()
# For debian source packages:
# debian/control
@@ -414,8 +414,8 @@ ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
# http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-debiansourcecontrolfiles
# Builds-Depends:
-#IF(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
-# SET(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS
+#if(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
+# set(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS
# "debhelper (>> 5.0.0), libncurses5-dev, tcl8.4"
# )
-#ENDIF(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
+#endif()
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index ae93512..0cec897 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -162,7 +162,7 @@
# 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).
+# The specified file will be processed by configure_file( @ONLY).
##end
##variable
# CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE - Spec file template.
@@ -239,42 +239,42 @@
# Author: Eric Noulard with the help of Alexander Neundorf.
-IF(CMAKE_BINARY_DIR)
- MESSAGE(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.")
-ENDIF(CMAKE_BINARY_DIR)
+if(CMAKE_BINARY_DIR)
+ message(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.")
+endif()
-IF(NOT UNIX)
- MESSAGE(FATAL_ERROR "CPackRPM.cmake may only be used under UNIX.")
-ENDIF(NOT UNIX)
+if(NOT UNIX)
+ message(FATAL_ERROR "CPackRPM.cmake may only be used under UNIX.")
+endif()
# rpmbuild is the basic command for building RPM package
# it may be a simple (symbolic) link to rpm command.
-FIND_PROGRAM(RPMBUILD_EXECUTABLE rpmbuild)
+find_program(RPMBUILD_EXECUTABLE rpmbuild)
# 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
-IF(RPMBUILD_EXECUTABLE)
+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})
- IF(CPACK_RPM_PACKAGE_DEBUG)
- MESSAGE("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
-ENDIF(RPMBUILD_EXECUTABLE)
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>")
+ endif()
+endif()
-IF(NOT RPMBUILD_EXECUTABLE)
- MESSAGE(FATAL_ERROR "RPM package requires rpmbuild executable")
-ENDIF(NOT RPMBUILD_EXECUTABLE)
+if(NOT RPMBUILD_EXECUTABLE)
+ message(FATAL_ERROR "RPM package requires rpmbuild executable")
+endif()
# Display lsb_release output if DEBUG mode enable
# This will help to diagnose problem with CPackRPM
# because we will know on which kind of Linux we are
-IF(CPACK_RPM_PACKAGE_DEBUG)
+if(CPACK_RPM_PACKAGE_DEBUG)
find_program(LSB_RELEASE_EXECUTABLE lsb_release)
if(LSB_RELEASE_EXECUTABLE)
execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -a
@@ -284,40 +284,40 @@ IF(CPACK_RPM_PACKAGE_DEBUG)
string(REGEX REPLACE "\n" ", "
LSB_RELEASE_OUTPUT
${_TMP_LSB_RELEASE_OUTPUT})
- else (LSB_RELEASE_EXECUTABLE)
+ else ()
set(LSB_RELEASE_OUTPUT "lsb_release not installed/found!")
- endif(LSB_RELEASE_EXECUTABLE)
- MESSAGE("CPackRPM:Debug: LSB_RELEASE = ${LSB_RELEASE_OUTPUT}")
-ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
+ message("CPackRPM:Debug: LSB_RELEASE = ${LSB_RELEASE_OUTPUT}")
+endif()
# We may use RPM version in the future in order
# 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(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()
# 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.
# FIXME feature not finished (yet)
-FIND_PROGRAM(ALIEN_EXECUTABLE alien)
-IF(ALIEN_EXECUTABLE)
- MESSAGE(STATUS "alien found, we may be on a Debian based distro.")
-ENDIF(ALIEN_EXECUTABLE)
+find_program(ALIEN_EXECUTABLE alien)
+if(ALIEN_EXECUTABLE)
+ message(STATUS "alien found, we may be on a Debian based distro.")
+endif()
# Are we packaging components ?
-IF(CPACK_RPM_PACKAGE_COMPONENT)
- SET(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}")
- SET(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "/${CPACK_RPM_PACKAGE_COMPONENT}")
- SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_RPM_PACKAGE_COMPONENT}")
-ELSE(CPACK_RPM_PACKAGE_COMPONENT)
- SET(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "")
- SET(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "")
- SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
-ENDIF(CPACK_RPM_PACKAGE_COMPONENT)
+if(CPACK_RPM_PACKAGE_COMPONENT)
+ set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}")
+ set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "/${CPACK_RPM_PACKAGE_COMPONENT}")
+ set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_RPM_PACKAGE_COMPONENT}")
+else()
+ set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "")
+ set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "")
+ set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
+endif()
#
# Use user-defined RPM specific variables value
@@ -329,42 +329,42 @@ ENDIF(CPACK_RPM_PACKAGE_COMPONENT)
#
# CPACK_RPM_PACKAGE_SUMMARY (mandatory)
-IF(NOT CPACK_RPM_PACKAGE_SUMMARY)
+if(NOT CPACK_RPM_PACKAGE_SUMMARY)
# if neither var is defined lets use the name as 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})
- ENDIF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
-ENDIF(NOT CPACK_RPM_PACKAGE_SUMMARY)
+ if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+ string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY)
+ else()
+ set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
+ endif()
+endif()
# CPACK_RPM_PACKAGE_NAME (mandatory)
-IF(NOT CPACK_RPM_PACKAGE_NAME)
- STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
-ENDIF(NOT CPACK_RPM_PACKAGE_NAME)
+if(NOT CPACK_RPM_PACKAGE_NAME)
+ string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
+endif()
# CPACK_RPM_PACKAGE_VERSION (mandatory)
-IF(NOT CPACK_RPM_PACKAGE_VERSION)
- IF(NOT CPACK_PACKAGE_VERSION)
- MESSAGE(FATAL_ERROR "RPM package requires a package version")
- ENDIF(NOT CPACK_PACKAGE_VERSION)
- SET(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
-ENDIF(NOT CPACK_RPM_PACKAGE_VERSION)
+if(NOT CPACK_RPM_PACKAGE_VERSION)
+ if(NOT CPACK_PACKAGE_VERSION)
+ message(FATAL_ERROR "RPM package requires a package version")
+ endif()
+ set(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
+endif()
# 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})
+string(REPLACE "-" "_" CPACK_RPM_PACKAGE_VERSION ${CPACK_RPM_PACKAGE_VERSION})
# CPACK_RPM_PACKAGE_ARCHITECTURE (optional)
-IF(CPACK_RPM_PACKAGE_ARCHITECTURE)
- SET(TMP_RPM_BUILDARCH "Buildarch: ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- IF(CPACK_RPM_PACKAGE_DEBUG)
- MESSAGE("CPackRPM:Debug: using user-specified build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
-ELSE(CPACK_RPM_PACKAGE_ARCHITECTURE)
- SET(TMP_RPM_BUILDARCH "")
-ENDIF(CPACK_RPM_PACKAGE_ARCHITECTURE)
+if(CPACK_RPM_PACKAGE_ARCHITECTURE)
+ set(TMP_RPM_BUILDARCH "Buildarch: ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: using user-specified build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
+ endif()
+else()
+ set(TMP_RPM_BUILDARCH "")
+endif()
# CPACK_RPM_PACKAGE_RELEASE
# The RPM release is the numbering of the RPM package ITSELF
@@ -374,28 +374,28 @@ ENDIF(CPACK_RPM_PACKAGE_ARCHITECTURE)
# without changing the version of the packaged software.
# This is the case when the packaging is buggy (not) the software :=)
# If not set, 1 is a good candidate
-IF(NOT CPACK_RPM_PACKAGE_RELEASE)
- SET(CPACK_RPM_PACKAGE_RELEASE 1)
-ENDIF(NOT CPACK_RPM_PACKAGE_RELEASE)
+if(NOT CPACK_RPM_PACKAGE_RELEASE)
+ set(CPACK_RPM_PACKAGE_RELEASE 1)
+endif()
# CPACK_RPM_PACKAGE_LICENSE
-IF(NOT CPACK_RPM_PACKAGE_LICENSE)
- SET(CPACK_RPM_PACKAGE_LICENSE "unknown")
-ENDIF(NOT CPACK_RPM_PACKAGE_LICENSE)
+if(NOT CPACK_RPM_PACKAGE_LICENSE)
+ set(CPACK_RPM_PACKAGE_LICENSE "unknown")
+endif()
# CPACK_RPM_PACKAGE_GROUP
-IF(NOT CPACK_RPM_PACKAGE_GROUP)
- SET(CPACK_RPM_PACKAGE_GROUP "unknown")
-ENDIF(NOT CPACK_RPM_PACKAGE_GROUP)
+if(NOT CPACK_RPM_PACKAGE_GROUP)
+ set(CPACK_RPM_PACKAGE_GROUP "unknown")
+endif()
# CPACK_RPM_PACKAGE_VENDOR
-IF(NOT CPACK_RPM_PACKAGE_VENDOR)
- IF(CPACK_PACKAGE_VENDOR)
- SET(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}")
- ELSE(CPACK_PACKAGE_VENDOR)
- SET(CPACK_RPM_PACKAGE_VENDOR "unknown")
- ENDIF(CPACK_PACKAGE_VENDOR)
-ENDIF(NOT CPACK_RPM_PACKAGE_VENDOR)
+if(NOT CPACK_RPM_PACKAGE_VENDOR)
+ if(CPACK_PACKAGE_VENDOR)
+ set(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}")
+ else()
+ set(CPACK_RPM_PACKAGE_VENDOR "unknown")
+ endif()
+endif()
# CPACK_RPM_PACKAGE_SOURCE
# The name of the source tarball in case we generate a source RPM
@@ -407,103 +407,103 @@ ENDIF(NOT CPACK_RPM_PACKAGE_VENDOR)
# if it is defined
# - set to a default value
#
-IF (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
- IF (CPACK_PACKAGE_DESCRIPTION_FILE)
- FILE(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION)
- ELSE (CPACK_PACKAGE_DESCRIPTION_FILE)
- SET(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available")
- ENDIF (CPACK_PACKAGE_DESCRIPTION_FILE)
-ENDIF (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
+if (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
+ if (CPACK_PACKAGE_DESCRIPTION_FILE)
+ file(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION)
+ else ()
+ set(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available")
+ endif ()
+endif ()
# CPACK_RPM_COMPRESSION_TYPE
#
-IF (CPACK_RPM_COMPRESSION_TYPE)
- IF(CPACK_RPM_PACKAGE_DEBUG)
- MESSAGE("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
- IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
- SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
- ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
- IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
- SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
- ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
- IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
- SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
- ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
- IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
- SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio")
- ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
-ELSE(CPACK_RPM_COMPRESSION_TYPE)
- SET(CPACK_RPM_COMPRESSION_TYPE_TMP "")
-ENDIF(CPACK_RPM_COMPRESSION_TYPE)
+if (CPACK_RPM_COMPRESSION_TYPE)
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}")
+ endif()
+ if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
+ set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
+ endif()
+ if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
+ set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
+ endif()
+ if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
+ set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
+ endif()
+ if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
+ set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio")
+ endif()
+else()
+ set(CPACK_RPM_COMPRESSION_TYPE_TMP "")
+endif()
if(CPACK_PACKAGE_RELOCATABLE)
set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
-endif(CPACK_PACKAGE_RELOCATABLE)
+endif()
if(CPACK_RPM_PACKAGE_RELOCATABLE)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Trying to build a relocatable package")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
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"))
+ else()
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)
+ endif()
+endif()
# Check if additional fields for RPM spec header are given
# There may be some COMPONENT specific variables as well
-FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV)
- IF(CPACK_RPM_PACKAGE_DEBUG)
+foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV)
+ if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER})
- IF(CPACK_RPM_PACKAGE_DEBUG)
+ if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: using CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}})
else()
- IF(CPACK_RPM_PACKAGE_DEBUG)
+ if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER} not defined")
message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
endif()
else()
- IF(CPACK_RPM_PACKAGE_DEBUG)
+ if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
endif()
- IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
- 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}_TMP}")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
- SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
- ELSE(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
+ if(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
+ 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}_TMP}")
+ endif()
+ set(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
+ else()
# Do not forget to unset previously set header (from previous component)
- UNSET(TMP_RPM_${_RPM_SPEC_HEADER})
- ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
-ENDFOREACH(_RPM_SPEC_HEADER)
+ unset(TMP_RPM_${_RPM_SPEC_HEADER})
+ endif()
+endforeach()
# CPACK_RPM_SPEC_INSTALL_POST
# May be used to define a RPM post intallation script
# for example setting it to "/bin/true" may prevent
# rpmbuild from stripping binaries.
-IF(CPACK_RPM_SPEC_INSTALL_POST)
- IF(CPACK_RPM_PACKAGE_DEBUG)
- MESSAGE("CPackRPM:Debug: User defined CPACK_RPM_SPEC_INSTALL_POST = ${CPACK_RPM_SPEC_INSTALL_POST}")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
- SET(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}")
-ENDIF(CPACK_RPM_SPEC_INSTALL_POST)
+if(CPACK_RPM_SPEC_INSTALL_POST)
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: User defined CPACK_RPM_SPEC_INSTALL_POST = ${CPACK_RPM_SPEC_INSTALL_POST}")
+ endif()
+ set(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}")
+endif()
# CPACK_RPM_POST_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE)
# CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE)
@@ -518,39 +518,39 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
endif()
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE)
set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE})
- else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE)
+ else()
set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
- endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE)
-else(CPACK_RPM_PACKAGE_COMPONENT)
+ endif()
+else()
set(CPACK_RPM_POST_INSTALL_READ_FILE ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE})
set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
-endif(CPACK_RPM_PACKAGE_COMPONENT)
+endif()
# Handle post-install file if it has been specified
if(CPACK_RPM_POST_INSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
file(READ ${CPACK_RPM_POST_INSTALL_READ_FILE} CPACK_RPM_SPEC_POSTINSTALL)
- else(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
+ else()
message("CPackRPM:Warning: CPACK_RPM_POST_INSTALL_SCRIPT_FILE <${CPACK_RPM_POST_INSTALL_READ_FILE}> does not exists - ignoring")
- endif(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
-else(CPACK_RPM_POST_INSTALL_READ_FILE)
+ endif()
+else()
# reset SPEC var value if no post install file has been specified
# (either globally or component-wise)
set(CPACK_RPM_SPEC_POSTINSTALL "")
-endif(CPACK_RPM_POST_INSTALL_READ_FILE)
+endif()
# Handle post-uninstall file if it has been specified
if(CPACK_RPM_POST_UNINSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
file(READ ${CPACK_RPM_POST_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_POSTUNINSTALL)
- else(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
+ else()
message("CPackRPM:Warning: CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_POST_UNINSTALL_READ_FILE}> does not exists - ignoring")
- endif(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
-else(CPACK_RPM_POST_UNINSTALL_READ_FILE)
+ endif()
+else()
# reset SPEC var value if no post uninstall file has been specified
# (either globally or component-wise)
set(CPACK_RPM_SPEC_POSTUNINSTALL "")
-endif(CPACK_RPM_POST_UNINSTALL_READ_FILE)
+endif()
# CPACK_RPM_PRE_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE)
# CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE)
@@ -560,44 +560,44 @@ endif(CPACK_RPM_POST_UNINSTALL_READ_FILE)
if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE})
- else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
+ else()
set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
- endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
+ endif()
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE)
set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE})
- else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE)
+ else()
set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
- endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE)
-else(CPACK_RPM_PACKAGE_COMPONENT)
+ endif()
+else()
set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
-endif(CPACK_RPM_PACKAGE_COMPONENT)
+endif()
# Handle pre-install file if it has been specified
if(CPACK_RPM_PRE_INSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
file(READ ${CPACK_RPM_PRE_INSTALL_READ_FILE} CPACK_RPM_SPEC_PREINSTALL)
- else(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
+ else()
message("CPackRPM:Warning: CPACK_RPM_PRE_INSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_INSTALL_READ_FILE}> does not exists - ignoring")
- endif(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
-else(CPACK_RPM_PRE_INSTALL_READ_FILE)
+ endif()
+else()
# reset SPEC var value if no pre-install file has been specified
# (either globally or component-wise)
set(CPACK_RPM_SPEC_PREINSTALL "")
-endif(CPACK_RPM_PRE_INSTALL_READ_FILE)
+endif()
# Handle pre-uninstall file if it has been specified
if(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
file(READ ${CPACK_RPM_PRE_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_PREUNINSTALL)
- else(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
+ else()
message("CPackRPM:Warning: CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_UNINSTALL_READ_FILE}> does not exists - ignoring")
- endif(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
-else(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
+ endif()
+else()
# reset SPEC var value if no pre-uninstall file has been specified
# (either globally or component-wise)
set(CPACK_RPM_SPEC_PREUNINSTALL "")
-endif(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
+endif()
# CPACK_RPM_CHANGELOG_FILE
# May be used to embed a changelog in the spec file.
@@ -605,39 +605,58 @@ endif(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
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})
+ else()
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)
+ endif()
+else()
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)
+endif()
# CPACK_RPM_SPEC_MORE_DEFINE
# This is a generated spec rpm file spaceholder
-IF(CPACK_RPM_SPEC_MORE_DEFINE)
- IF(CPACK_RPM_PACKAGE_DEBUG)
- MESSAGE("CPackRPM:Debug: User defined more define spec line specified:\n ${CPACK_RPM_SPEC_MORE_DEFINE}")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
-ENDIF(CPACK_RPM_SPEC_MORE_DEFINE)
+if(CPACK_RPM_SPEC_MORE_DEFINE)
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: User defined more define spec line specified:\n ${CPACK_RPM_SPEC_MORE_DEFINE}")
+ endif()
+endif()
# Now we may create the RPM build tree structure
-SET(CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}")
-MESSAGE(STATUS "CPackRPM:Debug: Using CPACK_RPM_ROOTDIR=${CPACK_RPM_ROOTDIR}")
+set(CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}")
+message(STATUS "CPackRPM:Debug: Using CPACK_RPM_ROOTDIR=${CPACK_RPM_ROOTDIR}")
# Prepare RPM build tree
-FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR})
-FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/tmp)
-FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/BUILD)
-FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/RPMS)
-FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SOURCES)
-FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SPECS)
-FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SRPMS)
-
-#SET(CPACK_RPM_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}-${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
-SET(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")
+file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR})
+file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/tmp)
+file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/BUILD)
+file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/RPMS)
+file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SOURCES)
+file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SPECS)
+file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SRPMS)
+
+#set(CPACK_RPM_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}-${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
+set(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")
# it seems rpmbuild can't handle spaces in the path
# neither escaping (as below) nor putting quotes around the path seem to help
-#STRING(REGEX REPLACE " " "\\\\ " CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
-SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
+#string(REGEX REPLACE " " "\\\\ " CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
+set(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
+
+# if we are creating a relocatable package, omit parent directories of
+# CPACK_RPM_PACKAGE_PREFIX. This is achieved by building a "filter list"
+# which is passed to the find command that generates the content-list
+if(CPACK_RPM_PACKAGE_RELOCATABLE)
+ # get a list of the elements in CPACK_RPM_PACKAGE_PREFIX and remove
+ # the final element (so the install-prefix dir itself is not omitted
+ # from the RPM's content-list)
+ string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS ".${CPACK_RPM_PACKAGE_PREFIX}")
+ list(REMOVE_AT _CPACK_RPM_PACKAGE_PREFIX_ELEMS -1)
+ # Now generate all of the parent dirs of CPACK_RPM_PACKAGE_PREFIX
+ foreach(_ELEM ${_CPACK_RPM_PACKAGE_PREFIX_ELEMS})
+ list(APPEND _TMP_LIST "${_ELEM}")
+ string(REPLACE ";" "/" _OMIT_DIR "${_TMP_LIST}")
+ set(_OMIT_DIR "-o -path ${_OMIT_DIR}")
+ separate_arguments(_OMIT_DIR)
+ list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR})
+ endforeach()
+endif()
# Use files tree to construct files command (spec file)
# We should not forget to include symlinks (thus -o -type l)
@@ -647,7 +666,7 @@ SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
# 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 -o (-type d -a -not -name ".")
+execute_process(COMMAND find . -type f -o -type l -o (-type d -a -not ( -name "." ${_RPM_DIRS_TO_OMIT} ) )
COMMAND sed s:.*/man.*/.*:&*:
COMMAND sed s/\\.\\\(.*\\\)/\"\\1\"/
WORKING_DIRECTORY "${WDIR}"
@@ -664,7 +683,7 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling Absolute Destination Files: <${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}>")
message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
endif()
else()
if(CPACK_ABSOLUTE_DESTINATION_FILES)
@@ -679,7 +698,7 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>")
message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
- endif(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
else()
set(CPACK_RPM_USER_FILELIST_INTERNAL "")
endif()
@@ -696,9 +715,9 @@ endif()
# or CPACK_RPM_INSTALL_FILES,
# hence it must be done before these auto-generated lists are processed.
if(CPACK_RPM_USER_FILELIST_INTERNAL)
- IF(CPACK_RPM_PACKAGE_DEBUG)
+ if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
# Create CMake list from CPACK_RPM_INSTALL_FILES
string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
@@ -709,18 +728,24 @@ if(CPACK_RPM_USER_FILELIST_INTERNAL)
set(CPACK_RPM_USER_INSTALL_FILES "")
foreach(F IN LISTS CPACK_RPM_USER_FILELIST_INTERNAL)
- string(REGEX REPLACE "%[A-Za-z\(\)]* " "" F_PATH ${F})
- string(REGEX MATCH "%[A-Za-z\(\)]*" F_PREFIX ${F})
+ string(REGEX REPLACE "%[A-Za-z0-9\(\),-]* " "" F_PATH ${F})
+ string(REGEX MATCH "%[A-Za-z0-9\(\),-]*" F_PREFIX ${F})
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: F_PREFIX=<${F_PREFIX}>, F_PATH=<${F_PATH}>")
+ endif()
if(F_PREFIX)
- set(F_PREFIX "${F_PREFIX} ")
+ set(F_PREFIX "${F_PREFIX} ")
endif()
# Rebuild the user list file
set(CPACK_RPM_USER_INSTALL_FILES "${CPACK_RPM_USER_INSTALL_FILES}${F_PREFIX}\"${F_PATH}\"\n")
# Remove from CPACK_RPM_INSTALL_FILES and CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL
list(REMOVE_ITEM CPACK_RPM_INSTALL_FILES_LIST ${F_PATH})
- list(REMOVE_ITEM CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL ${F_PATH})
+ # ABSOLUTE destination files list may not exists at all
+ if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
+ list(REMOVE_ITEM CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL ${F_PATH})
+ endif()
endforeach()
@@ -728,15 +753,15 @@ if(CPACK_RPM_USER_FILELIST_INTERNAL)
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)
+ endforeach()
else()
set(CPACK_RPM_USER_INSTALL_FILES "")
endif()
if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
- IF(CPACK_RPM_PACKAGE_DEBUG)
+ if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+ endif()
# Remove trailing space
string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
# Transform endline separated - string into CMake List
@@ -749,20 +774,20 @@ if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
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)
+ endforeach()
# Build ABSOLUTE_INSTALL_FILES
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "${CPACK_RPM_ABSOLUTE_INSTALL_FILES}%config \"${F}\"\n")
- endforeach(F)
- IF(CPACK_RPM_PACKAGE_DEBUG)
+ endforeach()
+ 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()
else()
# reset vars in order to avoid leakage of value(s) from one component to another
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
-endif(CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
+endif()
# Prepend directories in ${CPACK_RPM_INSTALL_FILES} with %dir
# This is necessary to avoid duplicate files since rpmbuild do
@@ -780,32 +805,32 @@ foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
else()
set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
endif()
-endforeach(F)
+endforeach()
set(CPACK_RPM_INSTALL_FILES_LIST "")
# 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}${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.spec")
+set(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_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}")
- MESSAGE("CPackRPM:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
- MESSAGE("CPackRPM:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}")
- MESSAGE("CPackRPM:Debug: CPACK_OUTPUT_FILE_NAME = ${CPACK_OUTPUT_FILE_NAME}")
- MESSAGE("CPackRPM:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}")
- MESSAGE("CPackRPM:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
- MESSAGE("CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE = ${CPACK_RPM_BINARY_SPECFILE}")
- 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)
+if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
+ message("CPackRPM:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
+ message("CPackRPM:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}")
+ message("CPackRPM:Debug: CPACK_OUTPUT_FILE_NAME = ${CPACK_OUTPUT_FILE_NAME}")
+ message("CPackRPM:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}")
+ message("CPackRPM:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
+ message("CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE = ${CPACK_RPM_BINARY_SPECFILE}")
+ 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()
# 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
# - or the user did not provide one : NOT CPACK_RPM_USER_BINARY_SPECFILE
#
-IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
- FILE(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in
+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\@\@CPACK_RPM_PACKAGE_COMPONENT_PART_PATH\@
Summary: \@CPACK_RPM_PACKAGE_SUMMARY\@
@@ -879,28 +904,28 @@ ${CPACK_RPM_USER_INSTALL_FILES}
# 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.
- 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)
+ 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()
+endif()
# After that we may either use a user provided spec file
# or generate one using appropriate variables value.
-IF(CPACK_RPM_USER_BINARY_SPECFILE)
+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}")
+ 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)
+ configure_file(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
+else()
# No User specified spec file, will use the generated spec file
- MESSAGE("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}")
+ 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)
+ configure_file(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
+endif()
-IF(RPMBUILD_EXECUTABLE)
+if(RPMBUILD_EXECUTABLE)
# Now call rpmbuild using the SPECFILE
- EXECUTE_PROCESS(
+ execute_process(
COMMAND "${RPMBUILD_EXECUTABLE}" -bb
--define "_topdir ${CPACK_RPM_DIRECTORY}"
--buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
@@ -909,17 +934,17 @@ IF(RPMBUILD_EXECUTABLE)
RESULT_VARIABLE CPACK_RPMBUILD_EXEC_RESULT
ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err"
OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
- IF(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
- FILE(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err RPMBUILDERR)
- FILE(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out RPMBUILDOUT)
- MESSAGE("CPackRPM:Debug: You may consult rpmbuild logs in: ")
- MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err")
- MESSAGE("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
- MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
- MESSAGE("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
-ELSE(RPMBUILD_EXECUTABLE)
- IF(ALIEN_EXECUTABLE)
- MESSAGE(FATAL_ERROR "RPM packaging through alien not done (yet)")
- ENDIF(ALIEN_EXECUTABLE)
-ENDIF(RPMBUILD_EXECUTABLE)
+ if(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
+ file(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err RPMBUILDERR)
+ file(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out RPMBUILDOUT)
+ message("CPackRPM:Debug: You may consult rpmbuild logs in: ")
+ message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err")
+ message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
+ message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
+ message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
+ endif()
+else()
+ if(ALIEN_EXECUTABLE)
+ message(FATAL_ERROR "RPM packaging through alien not done (yet)")
+ endif()
+endif()
diff --git a/Modules/CPackZIP.cmake b/Modules/CPackZIP.cmake
index 99963cf..a36589b 100644
--- a/Modules/CPackZIP.cmake
+++ b/Modules/CPackZIP.cmake
@@ -12,30 +12,30 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF(CMAKE_BINARY_DIR)
- MESSAGE(FATAL_ERROR "CPackZIP.cmake may only be used by CPack internally.")
-ENDIF(CMAKE_BINARY_DIR)
+if(CMAKE_BINARY_DIR)
+ message(FATAL_ERROR "CPackZIP.cmake may only be used by CPack internally.")
+endif()
-FIND_PROGRAM(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramFiles}/WinZip")
-IF(ZIP_EXECUTABLE)
- SET(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -P \"<ARCHIVE>\" @<FILELIST>")
- SET(CPACK_ZIP_NEED_QUOTES TRUE)
-ENDIF(ZIP_EXECUTABLE)
+find_program(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramFiles}/WinZip")
+if(ZIP_EXECUTABLE)
+ set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -P \"<ARCHIVE>\" @<FILELIST>")
+ set(CPACK_ZIP_NEED_QUOTES TRUE)
+endif()
-IF(NOT ZIP_EXECUTABLE)
- FIND_PROGRAM(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip")
- IF(ZIP_EXECUTABLE)
- SET(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" a -tzip \"<ARCHIVE>\" @<FILELIST>")
- SET(CPACK_ZIP_NEED_QUOTES TRUE)
- ENDIF(ZIP_EXECUTABLE)
-ENDIF(NOT ZIP_EXECUTABLE)
+if(NOT ZIP_EXECUTABLE)
+ find_program(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip")
+ if(ZIP_EXECUTABLE)
+ set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" a -tzip \"<ARCHIVE>\" @<FILELIST>")
+ set(CPACK_ZIP_NEED_QUOTES TRUE)
+ endif()
+endif()
-IF(NOT ZIP_EXECUTABLE)
- FIND_PACKAGE(Cygwin)
- FIND_PROGRAM(ZIP_EXECUTABLE zip PATHS "${CYGWIN_INSTALL_PATH}/bin")
- IF(ZIP_EXECUTABLE)
- SET(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -r \"<ARCHIVE>\" . -i@<FILELIST>")
- SET(CPACK_ZIP_NEED_QUOTES FALSE)
- ENDIF(ZIP_EXECUTABLE)
-ENDIF(NOT ZIP_EXECUTABLE)
+if(NOT ZIP_EXECUTABLE)
+ find_package(Cygwin)
+ find_program(ZIP_EXECUTABLE zip PATHS "${CYGWIN_INSTALL_PATH}/bin")
+ if(ZIP_EXECUTABLE)
+ set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -r \"<ARCHIVE>\" . -i@<FILELIST>")
+ set(CPACK_ZIP_NEED_QUOTES FALSE)
+ endif()
+endif()
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index ec9dbeb..562e248 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -58,46 +58,48 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-OPTION(BUILD_TESTING "Build the testing tree." ON)
+option(BUILD_TESTING "Build the testing tree." ON)
# function to turn generator name into a version string
-# like vs7 vs71 vs8 vs9
-FUNCTION(GET_VS_VERSION_STRING generator var)
- STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1"
+# like vs7 vs71 vs8 vs9
+function(GET_VS_VERSION_STRING generator var)
+ string(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1"
NUMBER "${generator}")
- IF("${generator}" MATCHES "Visual Studio 7 .NET 2003")
- SET(ver_string "vs71")
- ELSE("${generator}" MATCHES "Visual Studio 7 .NET 2003")
- SET(ver_string "vs${NUMBER}")
- ENDIF("${generator}" MATCHES "Visual Studio 7 .NET 2003")
- SET(${var} ${ver_string} PARENT_SCOPE)
-ENDFUNCTION(GET_VS_VERSION_STRING)
+ if("${generator}" MATCHES "Visual Studio 7 .NET 2003")
+ set(ver_string "vs71")
+ else()
+ set(ver_string "vs${NUMBER}")
+ endif()
+ set(${var} ${ver_string} PARENT_SCOPE)
+endfunction()
-IF(BUILD_TESTING)
+include(CTestUseLaunchers)
+
+if(BUILD_TESTING)
# Setup some auxilary macros
- MACRO(SET_IF_NOT_SET var val)
- IF(NOT DEFINED "${var}")
- SET("${var}" "${val}")
- ENDIF(NOT DEFINED "${var}")
- ENDMACRO(SET_IF_NOT_SET)
+ macro(SET_IF_NOT_SET var val)
+ if(NOT DEFINED "${var}")
+ set("${var}" "${val}")
+ endif()
+ endmacro()
- MACRO(SET_IF_SET var val)
- IF(NOT "${val}" MATCHES "^$")
- SET("${var}" "${val}")
- ENDIF(NOT "${val}" MATCHES "^$")
- ENDMACRO(SET_IF_SET)
+ macro(SET_IF_SET var val)
+ if(NOT "${val}" MATCHES "^$")
+ set("${var}" "${val}")
+ endif()
+ endmacro()
- MACRO(SET_IF_SET_AND_NOT_SET var val)
- IF(NOT "${val}" MATCHES "^$")
+ macro(SET_IF_SET_AND_NOT_SET var val)
+ if(NOT "${val}" MATCHES "^$")
SET_IF_NOT_SET("${var}" "${val}")
- ENDIF(NOT "${val}" MATCHES "^$")
- ENDMACRO(SET_IF_SET_AND_NOT_SET)
+ endif()
+ endmacro()
# Make sure testing is enabled
- ENABLE_TESTING()
+ enable_testing()
- IF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
- INCLUDE("${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
+ if(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
+ include("${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
SET_IF_SET_AND_NOT_SET(NIGHTLY_START_TIME "${CTEST_NIGHTLY_START_TIME}")
SET_IF_SET_AND_NOT_SET(DROP_METHOD "${CTEST_DROP_METHOD}")
SET_IF_SET_AND_NOT_SET(DROP_SITE "${CTEST_DROP_SITE}")
@@ -107,155 +109,143 @@ IF(BUILD_TESTING)
SET_IF_SET_AND_NOT_SET(DROP_LOCATION "${CTEST_DROP_LOCATION}")
SET_IF_SET_AND_NOT_SET(TRIGGER_SITE "${CTEST_TRIGGER_SITE}")
SET_IF_SET_AND_NOT_SET(UPDATE_TYPE "${CTEST_UPDATE_TYPE}")
- ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
+ endif()
# the project can have a DartConfig.cmake file
- IF(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
- INCLUDE("${PROJECT_SOURCE_DIR}/DartConfig.cmake")
- ELSE(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
+ if(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
+ include("${PROJECT_SOURCE_DIR}/DartConfig.cmake")
+ else()
# Dashboard is opened for submissions for a 24 hour period starting at
# the specified NIGHTLY_START_TIME. Time is specified in 24 hour format.
SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT")
SET_IF_NOT_SET(DROP_METHOD "http")
SET_IF_NOT_SET (COMPRESS_SUBMISSION ON)
- ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
+ endif()
SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT")
- FIND_PROGRAM(CVSCOMMAND cvs )
- SET(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING
+ find_program(CVSCOMMAND cvs )
+ set(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING
"Options passed to the cvs update command.")
- FIND_PROGRAM(SVNCOMMAND svn)
- FIND_PROGRAM(BZRCOMMAND bzr)
- FIND_PROGRAM(HGCOMMAND hg)
- FIND_PROGRAM(GITCOMMAND git)
+ find_program(SVNCOMMAND svn)
+ find_program(BZRCOMMAND bzr)
+ find_program(HGCOMMAND hg)
+ find_program(GITCOMMAND git)
- IF(NOT UPDATE_TYPE)
- IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
- SET(UPDATE_TYPE cvs)
- ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
- SET(UPDATE_TYPE svn)
- ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
- SET(UPDATE_TYPE bzr)
- ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg")
- SET(UPDATE_TYPE hg)
- ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
- SET(UPDATE_TYPE git)
- ENDIF()
- ENDIF(NOT UPDATE_TYPE)
+ if(NOT UPDATE_TYPE)
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
+ set(UPDATE_TYPE cvs)
+ elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
+ set(UPDATE_TYPE svn)
+ elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
+ set(UPDATE_TYPE bzr)
+ elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg")
+ set(UPDATE_TYPE hg)
+ elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
+ set(UPDATE_TYPE git)
+ endif()
+ endif()
- STRING(TOLOWER "${UPDATE_TYPE}" _update_type)
- IF("${_update_type}" STREQUAL "cvs")
- SET(UPDATE_COMMAND "${CVSCOMMAND}")
- SET(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}")
- ELSEIF("${_update_type}" STREQUAL "svn")
- SET(UPDATE_COMMAND "${SVNCOMMAND}")
- SET(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}")
- ELSEIF("${_update_type}" STREQUAL "bzr")
- SET(UPDATE_COMMAND "${BZRCOMMAND}")
- SET(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}")
- ELSEIF("${_update_type}" STREQUAL "hg")
- SET(UPDATE_COMMAND "${HGCOMMAND}")
- SET(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}")
- ELSEIF("${_update_type}" STREQUAL "git")
- SET(UPDATE_COMMAND "${GITCOMMAND}")
- SET(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}")
- ENDIF()
+ string(TOLOWER "${UPDATE_TYPE}" _update_type)
+ if("${_update_type}" STREQUAL "cvs")
+ set(UPDATE_COMMAND "${CVSCOMMAND}")
+ set(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}")
+ elseif("${_update_type}" STREQUAL "svn")
+ set(UPDATE_COMMAND "${SVNCOMMAND}")
+ set(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}")
+ elseif("${_update_type}" STREQUAL "bzr")
+ set(UPDATE_COMMAND "${BZRCOMMAND}")
+ set(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}")
+ elseif("${_update_type}" STREQUAL "hg")
+ set(UPDATE_COMMAND "${HGCOMMAND}")
+ set(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}")
+ elseif("${_update_type}" STREQUAL "git")
+ set(UPDATE_COMMAND "${GITCOMMAND}")
+ set(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}")
+ endif()
- SET(DART_TESTING_TIMEOUT 1500 CACHE STRING
+ set(DART_TESTING_TIMEOUT 1500 CACHE STRING
"Maximum time allowed before CTest will kill the test.")
- SET(CTEST_SUBMIT_RETRY_DELAY 5 CACHE STRING
+ 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
+ set(CTEST_SUBMIT_RETRY_COUNT 3 CACHE STRING
"How many times to retry timed-out CTest submissions.")
- FIND_PROGRAM(MEMORYCHECK_COMMAND
+ find_program(MEMORYCHECK_COMMAND
NAMES purify valgrind boundscheck
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder]"
DOC "Path to the memory checking command, used for memory error detection."
)
- FIND_PROGRAM(SLURM_SBATCH_COMMAND sbatch DOC
+ find_program(SLURM_SBATCH_COMMAND sbatch DOC
"Path to the SLURM sbatch executable"
)
- FIND_PROGRAM(SLURM_SRUN_COMMAND srun DOC
+ find_program(SLURM_SRUN_COMMAND srun DOC
"Path to the SLURM srun executable"
)
- SET(MEMORYCHECK_SUPPRESSIONS_FILE "" CACHE FILEPATH
+ set(MEMORYCHECK_SUPPRESSIONS_FILE "" CACHE FILEPATH
"File that contains suppressions for the memory checker")
- FIND_PROGRAM(SCPCOMMAND scp DOC
+ find_program(SCPCOMMAND scp DOC
"Path to scp command, used by CTest for submitting results to a Dart server"
)
- FIND_PROGRAM(COVERAGE_COMMAND gcov DOC
+ find_program(COVERAGE_COMMAND gcov DOC
"Path to the coverage program that CTest uses for performing coverage inspection"
)
- SET(COVERAGE_EXTRA_FLAGS "-l" CACHE STRING
+ set(COVERAGE_EXTRA_FLAGS "-l" CACHE STRING
"Extra command line flags to pass to the coverage tool")
# set the site name
- SITE_NAME(SITE)
+ site_name(SITE)
# set the build name
- IF(NOT BUILDNAME)
- SET(DART_COMPILER "${CMAKE_CXX_COMPILER}")
- IF(NOT DART_COMPILER)
- SET(DART_COMPILER "${CMAKE_C_COMPILER}")
- ENDIF(NOT DART_COMPILER)
- IF(NOT DART_COMPILER)
- SET(DART_COMPILER "unknown")
- ENDIF(NOT DART_COMPILER)
- IF(WIN32)
- SET(DART_NAME_COMPONENT "NAME_WE")
- ELSE(WIN32)
- SET(DART_NAME_COMPONENT "NAME")
- ENDIF(WIN32)
- IF(NOT BUILD_NAME_SYSTEM_NAME)
- SET(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
- ENDIF(NOT BUILD_NAME_SYSTEM_NAME)
- IF(WIN32)
- SET(BUILD_NAME_SYSTEM_NAME "Win32")
- ENDIF(WIN32)
- IF(UNIX OR BORLAND)
- GET_FILENAME_COMPONENT(DART_CXX_NAME
+ if(NOT BUILDNAME)
+ set(DART_COMPILER "${CMAKE_CXX_COMPILER}")
+ if(NOT DART_COMPILER)
+ set(DART_COMPILER "${CMAKE_C_COMPILER}")
+ endif()
+ if(NOT DART_COMPILER)
+ set(DART_COMPILER "unknown")
+ endif()
+ if(WIN32)
+ set(DART_NAME_COMPONENT "NAME_WE")
+ else()
+ set(DART_NAME_COMPONENT "NAME")
+ endif()
+ if(NOT BUILD_NAME_SYSTEM_NAME)
+ set(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
+ endif()
+ if(WIN32)
+ set(BUILD_NAME_SYSTEM_NAME "Win32")
+ endif()
+ if(UNIX OR BORLAND)
+ get_filename_component(DART_CXX_NAME
"${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT})
- ELSE(UNIX OR BORLAND)
- GET_FILENAME_COMPONENT(DART_CXX_NAME
+ else()
+ get_filename_component(DART_CXX_NAME
"${CMAKE_BUILD_TOOL}" ${DART_NAME_COMPONENT})
- ENDIF(UNIX OR BORLAND)
- IF(DART_CXX_NAME MATCHES "msdev")
- SET(DART_CXX_NAME "vs60")
- ENDIF(DART_CXX_NAME MATCHES "msdev")
- IF(DART_CXX_NAME MATCHES "devenv")
+ endif()
+ if(DART_CXX_NAME MATCHES "msdev")
+ set(DART_CXX_NAME "vs60")
+ endif()
+ if(DART_CXX_NAME MATCHES "devenv")
GET_VS_VERSION_STRING("${CMAKE_GENERATOR}" DART_CXX_NAME)
- ENDIF(DART_CXX_NAME MATCHES "devenv")
- SET(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}")
- ENDIF(NOT BUILDNAME)
+ endif()
+ set(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}")
+ endif()
# the build command
- BUILD_COMMAND(MAKECOMMAND_DEFAULT_VALUE
+ build_command(MAKECOMMAND_DEFAULT_VALUE
CONFIGURATION "\${CTEST_CONFIGURATION_TYPE}")
- SET(MAKECOMMAND ${MAKECOMMAND_DEFAULT_VALUE}
+ 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:
- SET(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
- IF(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
- SET(DEFAULT_CTEST_CONFIGURATION_TYPE "Release")
- ENDIF(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
-
- IF(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
- SET(CTEST_USE_LAUNCHERS 0)
- ENDIF(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
- IF(CTEST_USE_LAUNCHERS)
- SET(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --")
- SET(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --")
- SET(CTEST_LAUNCH_CUSTOM "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OUTPUT> --")
- SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}")
- SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}")
- SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}")
- ENDIF(CTEST_USE_LAUNCHERS)
+ set(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
+ if(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
+ set(DEFAULT_CTEST_CONFIGURATION_TYPE "Release")
+ endif()
- MARK_AS_ADVANCED(
+ mark_as_advanced(
BZRCOMMAND
BZR_UPDATE_OPTIONS
COVERAGE_COMMAND
@@ -267,7 +257,7 @@ IF(BUILD_TESTING)
DART_TESTING_TIMEOUT
GITCOMMAND
HGCOMMAND
- MAKECOMMAND
+ MAKECOMMAND
MEMORYCHECK_COMMAND
MEMORYCHECK_SUPPRESSIONS_FILE
PURIFYCOMMAND
@@ -278,9 +268,9 @@ IF(BUILD_TESTING)
SVNCOMMAND
SVN_UPDATE_OPTIONS
)
- IF(NOT RUN_FROM_DART)
- SET(RUN_FROM_CTEST_OR_DART 1)
- INCLUDE(CTestTargets)
- SET(RUN_FROM_CTEST_OR_DART)
- ENDIF(NOT RUN_FROM_DART)
-ENDIF(BUILD_TESTING)
+ if(NOT RUN_FROM_DART)
+ set(RUN_FROM_CTEST_OR_DART 1)
+ include(CTestTargets)
+ set(RUN_FROM_CTEST_OR_DART)
+ endif()
+endif()
diff --git a/Modules/CTestScriptMode.cmake b/Modules/CTestScriptMode.cmake
index e459c1d..42d3764 100644
--- a/Modules/CTestScriptMode.cmake
+++ b/Modules/CTestScriptMode.cmake
@@ -14,7 +14,7 @@
# (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
+# Determine the current system, so this information can be used
# in ctest scripts
include(CMakeDetermineSystem)
diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake
index bc4d964..fd4bd80 100644
--- a/Modules/CTestTargets.cmake
+++ b/Modules/CTestTargets.cmake
@@ -12,29 +12,29 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF(NOT RUN_FROM_CTEST_OR_DART)
- MESSAGE(FATAL_ERROR "Do not incldue CTestTargets.cmake directly")
-ENDIF(NOT RUN_FROM_CTEST_OR_DART)
+if(NOT RUN_FROM_CTEST_OR_DART)
+ message(FATAL_ERROR "Do not incldue CTestTargets.cmake directly")
+endif()
# make directories in the binary tree
-FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary)
-GET_FILENAME_COMPONENT(CMAKE_HOST_PATH ${CMAKE_COMMAND} PATH)
-SET(CMAKE_TARGET_PATH ${EXECUTABLE_OUTPUT_PATH})
-FIND_PROGRAM(CMAKE_CTEST_COMMAND ctest ${CMAKE_HOST_PATH} ${CMAKE_TARGET_PATH})
-MARK_AS_ADVANCED(CMAKE_CTEST_COMMAND)
+file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary)
+get_filename_component(CMAKE_HOST_PATH ${CMAKE_COMMAND} PATH)
+set(CMAKE_TARGET_PATH ${EXECUTABLE_OUTPUT_PATH})
+find_program(CMAKE_CTEST_COMMAND ctest ${CMAKE_HOST_PATH} ${CMAKE_TARGET_PATH})
+mark_as_advanced(CMAKE_CTEST_COMMAND)
# Use CTest
# configure files
-IF(CTEST_NEW_FORMAT)
- CONFIGURE_FILE(
+if(CTEST_NEW_FORMAT)
+ configure_file(
${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
${PROJECT_BINARY_DIR}/CTestConfiguration.ini )
-ELSE(CTEST_NEW_FORMAT)
- CONFIGURE_FILE(
+else()
+ configure_file(
${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
-ENDIF(CTEST_NEW_FORMAT)
+endif()
#
# Section 3:
@@ -43,53 +43,53 @@ ENDIF(CTEST_NEW_FORMAT)
# These should NOT need to be modified from project to project.
#
-SET(__conf_types "")
-IF(CMAKE_CONFIGURATION_TYPES)
+set(__conf_types "")
+if(CMAKE_CONFIGURATION_TYPES)
# We need to pass the configuration type on the test command line.
- SET(__conf_types -C "${CMAKE_CFG_INTDIR}")
-ENDIF(CMAKE_CONFIGURATION_TYPES)
+ set(__conf_types -C "${CMAKE_CFG_INTDIR}")
+endif()
# Add convenience targets. Do this at most once in case of nested
# projects.
-DEFINE_PROPERTY(GLOBAL PROPERTY CTEST_TARGETS_ADDED
+define_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED
BRIEF_DOCS "Internal property used by CTestTargets module."
FULL_DOCS "Set by the CTestTargets module to track addition of testing targets."
)
-GET_PROPERTY(_CTEST_TARGETS_ADDED GLOBAL PROPERTY CTEST_TARGETS_ADDED)
-IF(NOT _CTEST_TARGETS_ADDED)
- SET_PROPERTY(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
+get_property(_CTEST_TARGETS_ADDED GLOBAL PROPERTY CTEST_TARGETS_ADDED)
+if(NOT _CTEST_TARGETS_ADDED)
+ set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
# For all generators add basic testing targets.
- FOREACH(mode Experimental Nightly Continuous NightlyMemoryCheck)
- ADD_CUSTOM_TARGET(${mode}
+ foreach(mode Experimental Nightly Continuous NightlyMemoryCheck)
+ add_custom_target(${mode}
${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}
)
- SET_PROPERTY(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "")
- SET_PROPERTY(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets")
- ENDFOREACH(mode)
+ set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "")
+ set_property(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets")
+ endforeach()
# For Makefile generators add more granular targets.
- IF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
+ if("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
# Make targets for Experimental builds
- FOREACH(mode Nightly Experimental Continuous)
- FOREACH(testtype
+ foreach(mode Nightly Experimental Continuous)
+ foreach(testtype
Start Update Configure Build Test Coverage MemCheck Submit
# missing purify
)
- ADD_CUSTOM_TARGET(${mode}${testtype}
+ add_custom_target(${mode}${testtype}
${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}${testtype}
)
- SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "")
- SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets")
- ENDFOREACH(testtype)
- ENDFOREACH(mode)
- ENDIF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
+ set_property(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "")
+ set_property(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets")
+ endforeach()
+ endforeach()
+ endif()
# If requested, add an alias that is the equivalent of the built-in "test"
# or "RUN_TESTS" target:
- IF(CTEST_TEST_TARGET_ALIAS)
- ADD_CUSTOM_TARGET(${CTEST_TEST_TARGET_ALIAS}
+ if(CTEST_TEST_TARGET_ALIAS)
+ add_custom_target(${CTEST_TEST_TARGET_ALIAS}
${CMAKE_CTEST_COMMAND} ${__conf_types}
)
- ENDIF()
-ENDIF(NOT _CTEST_TARGETS_ADDED)
+ endif()
+endif()
diff --git a/Modules/CTestUseLaunchers.cmake b/Modules/CTestUseLaunchers.cmake
new file mode 100644
index 0000000..6731d37
--- /dev/null
+++ b/Modules/CTestUseLaunchers.cmake
@@ -0,0 +1,49 @@
+# - Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS is on.
+# CTestUseLaunchers is automatically included when you include(CTest).
+# However, it is split out into its own module file so projects
+# can use the CTEST_USE_LAUNCHERS functionality independently.
+#
+# To use launchers, set CTEST_USE_LAUNCHERS to ON in a ctest -S
+# dashboard script, and then also set it in the cache of the configured
+# project. Both cmake and ctest need to know the value of it for the launchers
+# to work properly. CMake needs to know in order to generate proper build
+# rules, and ctest, in order to produce the proper error and warning
+# analysis.
+#
+# For convenience, you may set the ENV variable CTEST_USE_LAUNCHERS_DEFAULT
+# in your ctest -S script, too. Then, as long as your CMakeLists uses
+# include(CTest) or include(CTestUseLaunchers), it will use the value of the
+# ENV variable to initialize a CTEST_USE_LAUNCHERS cache variable. This cache
+# variable initialization only occurs if CTEST_USE_LAUNCHERS is not already
+# defined.
+
+#=============================================================================
+# Copyright 2008-2012 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.)
+
+if(NOT DEFINED CTEST_USE_LAUNCHERS AND DEFINED ENV{CTEST_USE_LAUNCHERS_DEFAULT})
+ set(CTEST_USE_LAUNCHERS "$ENV{CTEST_USE_LAUNCHERS_DEFAULT}"
+ CACHE INTERNAL "CTEST_USE_LAUNCHERS initial value from ENV")
+endif()
+
+if(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
+ set(CTEST_USE_LAUNCHERS 0)
+endif()
+
+if(CTEST_USE_LAUNCHERS)
+ set(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --")
+ set(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --")
+ set(CTEST_LAUNCH_CUSTOM "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OUTPUT> --")
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}")
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}")
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}")
+endif()
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index 90d04ac..08e80f7 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -21,11 +21,11 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(CheckCSourceCompiles)
+include(CheckCSourceCompiles)
-MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
- SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
- SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
+ set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
+ set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT}
# Some compilers do not fail with a bad flag
FAIL_REGEX "command line option .* is valid for .* but not for C" # GNU
@@ -41,5 +41,5 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
FAIL_REGEX "command option .* is not recognized" # XL
FAIL_REGEX "WARNING: unknown flag:" # Open64
)
- SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
-ENDMACRO (CHECK_C_COMPILER_FLAG)
+ set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
+endmacro ()
diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake
index 2669336..b457754 100644
--- a/Modules/CheckCSourceCompiles.cmake
+++ b/Modules/CheckCSourceCompiles.cmake
@@ -24,43 +24,43 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
-MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
- IF("${VAR}" MATCHES "^${VAR}$")
- SET(_FAIL_REGEX)
- SET(_key)
- FOREACH(arg ${ARGN})
- IF("${arg}" MATCHES "^(FAIL_REGEX)$")
- SET(_key "${arg}")
- ELSEIF(_key)
- LIST(APPEND _${_key} "${arg}")
- ELSE()
- MESSAGE(FATAL_ERROR "Unknown argument:\n ${arg}\n")
- ENDIF()
- ENDFOREACH()
- SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
+ if("${VAR}" MATCHES "^${VAR}$")
+ set(_FAIL_REGEX)
+ set(_key)
+ foreach(arg ${ARGN})
+ if("${arg}" MATCHES "^(FAIL_REGEX)$")
+ set(_key "${arg}")
+ elseif(_key)
+ list(APPEND _${_key} "${arg}")
+ else()
+ message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
+ endif()
+ endforeach()
+ set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
- IF(CMAKE_REQUIRED_LIBRARIES)
+ if(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
- SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
+ set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
- ELSE(CMAKE_REQUIRED_LIBRARIES)
- SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
- ENDIF(CMAKE_REQUIRED_LIBRARIES)
- IF(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
+ else()
+ set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
+ endif()
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
- ELSE(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
- ENDIF(CMAKE_REQUIRED_INCLUDES)
- FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
+ else()
+ set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
+ endif()
+ file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
"${SOURCE}\n")
- MESSAGE(STATUS "Performing Test ${VAR}")
- TRY_COMPILE(${VAR}
+ message(STATUS "Performing Test ${VAR}")
+ try_compile(${VAR}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -69,27 +69,27 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
- FOREACH(_regex ${_FAIL_REGEX})
- IF("${OUTPUT}" MATCHES "${_regex}")
- SET(${VAR} 0)
- ENDIF()
- ENDFOREACH()
+ foreach(_regex ${_FAIL_REGEX})
+ if("${OUTPUT}" MATCHES "${_regex}")
+ set(${VAR} 0)
+ endif()
+ endforeach()
- IF(${VAR})
- SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
- MESSAGE(STATUS "Performing Test ${VAR} - Success")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if(${VAR})
+ set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+ message(STATUS "Performing Test ${VAR} - Success")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
- ELSE(${VAR})
- MESSAGE(STATUS "Performing Test ${VAR} - Failed")
- SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ else()
+ message(STATUS "Performing Test ${VAR} - Failed")
+ set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
- ENDIF(${VAR})
- ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_C_SOURCE_COMPILES)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake
index feee93a..bc64acd 100644
--- a/Modules/CheckCSourceRuns.cmake
+++ b/Modules/CheckCSourceRuns.cmake
@@ -24,32 +24,32 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
-MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
- IF("${VAR}" MATCHES "^${VAR}$")
- SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
+ if("${VAR}" MATCHES "^${VAR}$")
+ set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
- IF(CMAKE_REQUIRED_LIBRARIES)
+ if(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
- SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
+ set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
- ELSE(CMAKE_REQUIRED_LIBRARIES)
- SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
- ENDIF(CMAKE_REQUIRED_LIBRARIES)
- IF(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
+ else()
+ set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
+ endif()
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
- ELSE(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
- ENDIF(CMAKE_REQUIRED_INCLUDES)
- FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
+ else()
+ set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
+ endif()
+ file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
"${SOURCE}\n")
- MESSAGE(STATUS "Performing Test ${VAR}")
- TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
+ message(STATUS "Performing Test ${VAR}")
+ try_run(${VAR}_EXITCODE ${VAR}_COMPILED
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -59,33 +59,33 @@ MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
COMPILE_OUTPUT_VARIABLE OUTPUT)
# if it did not compile make the return value fail code of 1
- IF(NOT ${VAR}_COMPILED)
- SET(${VAR}_EXITCODE 1)
- ENDIF(NOT ${VAR}_COMPILED)
+ if(NOT ${VAR}_COMPILED)
+ set(${VAR}_EXITCODE 1)
+ endif()
# if the return value was 0 then it worked
- IF("${${VAR}_EXITCODE}" EQUAL 0)
- SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
- MESSAGE(STATUS "Performing Test ${VAR} - Success")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if("${${VAR}_EXITCODE}" EQUAL 0)
+ set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+ message(STATUS "Performing Test ${VAR} - Success")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n"
"Return value: ${${VAR}}\n"
"Source file was:\n${SOURCE}\n")
- ELSE("${${VAR}_EXITCODE}" EQUAL 0)
- IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
- SET(${VAR} "${${VAR}_EXITCODE}")
- ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
- SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
- ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
+ else()
+ if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
+ set(${VAR} "${${VAR}_EXITCODE}")
+ else()
+ set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+ endif()
- MESSAGE(STATUS "Performing Test ${VAR} - Failed")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ message(STATUS "Performing Test ${VAR} - Failed")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
"Return value: ${${VAR}_EXITCODE}\n"
"Source file was:\n${SOURCE}\n")
- ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
- ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_C_SOURCE_RUNS)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index 19963ea..6626403 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -21,11 +21,11 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(CheckCXXSourceCompiles)
+include(CheckCXXSourceCompiles)
-MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
- SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
- SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
+ set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
+ set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}
# Some compilers do not fail with a bad flag
FAIL_REGEX "command line option .* is valid for .* but not for C\\\\+\\\\+" # GNU
@@ -43,6 +43,6 @@ MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
FAIL_REGEX "File with unknown suffix passed to linker" # PGI
FAIL_REGEX "WARNING: unknown flag:" # Open64
)
- SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
-ENDMACRO (CHECK_CXX_COMPILER_FLAG)
+ set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
+endmacro ()
diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake
index 7f7336e..c0be1f7 100644
--- a/Modules/CheckCXXSourceCompiles.cmake
+++ b/Modules/CheckCXXSourceCompiles.cmake
@@ -24,44 +24,44 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
-MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
- IF("${VAR}" MATCHES "^${VAR}$")
- SET(_FAIL_REGEX)
- SET(_key)
- FOREACH(arg ${ARGN})
- IF("${arg}" MATCHES "^(FAIL_REGEX)$")
- SET(_key "${arg}")
- ELSEIF(_key)
- LIST(APPEND _${_key} "${arg}")
- ELSE()
- MESSAGE(FATAL_ERROR "Unknown argument:\n ${arg}\n")
- ENDIF()
- ENDFOREACH()
+macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
+ if("${VAR}" MATCHES "^${VAR}$")
+ set(_FAIL_REGEX)
+ set(_key)
+ foreach(arg ${ARGN})
+ if("${arg}" MATCHES "^(FAIL_REGEX)$")
+ set(_key "${arg}")
+ elseif(_key)
+ list(APPEND _${_key} "${arg}")
+ else()
+ message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
+ endif()
+ endforeach()
- SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+ set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
- IF(CMAKE_REQUIRED_LIBRARIES)
+ if(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
- SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
+ set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
- ELSE(CMAKE_REQUIRED_LIBRARIES)
- SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
- ENDIF(CMAKE_REQUIRED_LIBRARIES)
- IF(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
+ else()
+ set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
+ endif()
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
- ELSE(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
- ENDIF(CMAKE_REQUIRED_INCLUDES)
- FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
+ else()
+ set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
+ endif()
+ file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
"${SOURCE}\n")
- MESSAGE(STATUS "Performing Test ${VAR}")
- TRY_COMPILE(${VAR}
+ message(STATUS "Performing Test ${VAR}")
+ try_compile(${VAR}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -70,27 +70,27 @@ MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
"${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
- FOREACH(_regex ${_FAIL_REGEX})
- IF("${OUTPUT}" MATCHES "${_regex}")
- SET(${VAR} 0)
- ENDIF()
- ENDFOREACH()
+ foreach(_regex ${_FAIL_REGEX})
+ if("${OUTPUT}" MATCHES "${_regex}")
+ set(${VAR} 0)
+ endif()
+ endforeach()
- IF(${VAR})
- SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
- MESSAGE(STATUS "Performing Test ${VAR} - Success")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if(${VAR})
+ set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+ message(STATUS "Performing Test ${VAR} - Success")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
- ELSE(${VAR})
- MESSAGE(STATUS "Performing Test ${VAR} - Failed")
- SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ else()
+ message(STATUS "Performing Test ${VAR} - Failed")
+ set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
- ENDIF(${VAR})
- ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_CXX_SOURCE_COMPILES)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index cd68d57..47ab161 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -24,32 +24,32 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
-MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
- IF("${VAR}" MATCHES "^${VAR}$")
- SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
+ if("${VAR}" MATCHES "^${VAR}$")
+ set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
- IF(CMAKE_REQUIRED_LIBRARIES)
+ if(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
- SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
+ set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
- ELSE(CMAKE_REQUIRED_LIBRARIES)
- SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
- ENDIF(CMAKE_REQUIRED_LIBRARIES)
- IF(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
+ else()
+ set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
+ endif()
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
- ELSE(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
- ENDIF(CMAKE_REQUIRED_INCLUDES)
- FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
+ else()
+ set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
+ endif()
+ file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
"${SOURCE}\n")
- MESSAGE(STATUS "Performing Test ${VAR}")
- TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
+ message(STATUS "Performing Test ${VAR}")
+ try_run(${VAR}_EXITCODE ${VAR}_COMPILED
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -60,32 +60,32 @@ MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
COMPILE_OUTPUT_VARIABLE OUTPUT)
# if it did not compile make the return value fail code of 1
- IF(NOT ${VAR}_COMPILED)
- SET(${VAR}_EXITCODE 1)
- ENDIF(NOT ${VAR}_COMPILED)
+ if(NOT ${VAR}_COMPILED)
+ set(${VAR}_EXITCODE 1)
+ endif()
# if the return value was 0 then it worked
- IF("${${VAR}_EXITCODE}" EQUAL 0)
- SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
- MESSAGE(STATUS "Performing Test ${VAR} - Success")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if("${${VAR}_EXITCODE}" EQUAL 0)
+ set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+ message(STATUS "Performing Test ${VAR} - Success")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n"
"Return value: ${${VAR}}\n"
"Source file was:\n${SOURCE}\n")
- ELSE("${${VAR}_EXITCODE}" EQUAL 0)
- IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
- SET(${VAR} "${${VAR}_EXITCODE}")
- ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
- SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
- ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
+ else()
+ if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
+ set(${VAR} "${${VAR}_EXITCODE}")
+ else()
+ set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+ endif()
- MESSAGE(STATUS "Performing Test ${VAR} - Failed")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ message(STATUS "Performing Test ${VAR} - Failed")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
"Return value: ${${VAR}_EXITCODE}\n"
"Source file was:\n${SOURCE}\n")
- ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
- ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_CXX_SOURCE_RUNS)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake
index 1b012ae..2100973 100644
--- a/Modules/CheckCXXSymbolExists.cmake
+++ b/Modules/CheckCXXSymbolExists.cmake
@@ -35,8 +35,8 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(CheckSymbolExists)
+include(CheckSymbolExists)
-MACRO(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
+macro(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
_CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
-ENDMACRO(CHECK_CXX_SYMBOL_EXISTS)
+endmacro()
diff --git a/Modules/CheckForPthreads.c b/Modules/CheckForPthreads.c
index d831078..882dc21 100644
--- a/Modules/CheckForPthreads.c
+++ b/Modules/CheckForPthreads.c
@@ -15,7 +15,7 @@ int main(int ac, char*av[]){
pthread_t tid[2];
pthread_create(&tid[0], 0, runner, (void*)1);
pthread_create(&tid[1], 0, runner, (void*)2);
-
+
#if defined(__BEOS__) && !defined(__ZETA__) && !defined(__HAIKU__) // (no usleep on BeOS 5.)
usleep(1); // for strange behavior on single-processor sun
#endif
diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake
index abec9f7..4b9f9b7 100644
--- a/Modules/CheckFortranFunctionExists.cmake
+++ b/Modules/CheckFortranFunctionExists.cmake
@@ -22,7 +22,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
@@ -33,10 +33,10 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
- else(CMAKE_REQUIRED_LIBRARIES)
+ else()
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
- endif(CMAKE_REQUIRED_LIBRARIES)
- FILE(WRITE
+ endif()
+ file(WRITE
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
"
program TESTFortran
@@ -58,12 +58,12 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran ${FUNCTION} exists passed with the following output:\n"
"${OUTPUT}\n\n")
- else(${VARIABLE})
+ else()
message(STATUS "Looking for Fortran ${FUNCTION} - not found")
set(${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Fortran ${FUNCTION} exists failed with the following output:\n"
"${OUTPUT}\n\n")
- endif(${VARIABLE})
- endif(NOT DEFINED ${VARIABLE})
-endmacro(CHECK_FORTRAN_FUNCTION_EXISTS)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index 8c469f0..3f952e0 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -27,29 +27,29 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
-MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
- IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
- SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
+ if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+ set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
- MESSAGE(STATUS "Looking for ${FUNCTION}")
- IF(CMAKE_REQUIRED_LIBRARIES)
+ message(STATUS "Looking for ${FUNCTION}")
+ if(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
- SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
+ set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
- ELSE(CMAKE_REQUIRED_LIBRARIES)
- SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
- ENDIF(CMAKE_REQUIRED_LIBRARIES)
- IF(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_FUNCTION_EXISTS_ADD_INCLUDES
+ else()
+ set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
+ endif()
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
- ELSE(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_FUNCTION_EXISTS_ADD_INCLUDES)
- ENDIF(CMAKE_REQUIRED_INCLUDES)
- TRY_COMPILE(${VARIABLE}
+ else()
+ set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES)
+ endif()
+ try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckFunctionExists.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -57,18 +57,18 @@ MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
"${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
"${CHECK_FUNCTION_EXISTS_ADD_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
- IF(${VARIABLE})
- SET(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")
- MESSAGE(STATUS "Looking for ${FUNCTION} - found")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if(${VARIABLE})
+ set(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")
+ message(STATUS "Looking for ${FUNCTION} - found")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the function ${FUNCTION} exists passed with the following output:\n"
"${OUTPUT}\n\n")
- ELSE(${VARIABLE})
- MESSAGE(STATUS "Looking for ${FUNCTION} - not found")
- SET(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ else()
+ message(STATUS "Looking for ${FUNCTION} - not found")
+ set(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the function ${FUNCTION} exists failed with the following output:\n"
"${OUTPUT}\n\n")
- ENDIF(${VARIABLE})
- ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(CHECK_FUNCTION_EXISTS)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake
index eb732d2..8067e65 100644
--- a/Modules/CheckIncludeFile.cmake
+++ b/Modules/CheckIncludeFile.cmake
@@ -3,8 +3,8 @@
# - macro which checks the include file exists.
# INCLUDE - name of include file
# VARIABLE - variable to return result
-#
-# an optional third argument is the CFlags to add to the compile line
+#
+# an optional third argument is the CFlags to add to the compile line
# or you can use CMAKE_REQUIRED_FLAGS
#
# The following variables may be set before calling this macro to
@@ -28,50 +28,50 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
- IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
- IF(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_INCLUDE_FILE_C_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
- ELSE(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_INCLUDE_FILE_C_INCLUDE_DIRS)
- ENDIF(CMAKE_REQUIRED_INCLUDES)
- SET(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
- SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
- CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
+macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
+ if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_INCLUDE_FILE_C_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
+ else()
+ set(CHECK_INCLUDE_FILE_C_INCLUDE_DIRS)
+ endif()
+ set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ set(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
+ configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c IMMEDIATE)
- MESSAGE(STATUS "Looking for ${INCLUDE}")
- IF(${ARGC} EQUAL 3)
- SET(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS})
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARGV2}")
- ENDIF(${ARGC} EQUAL 3)
+ message(STATUS "Looking for ${INCLUDE}")
+ if(${ARGC} EQUAL 3)
+ set(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS})
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARGV2}")
+ endif()
- TRY_COMPILE(${VARIABLE}
+ try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
- CMAKE_FLAGS
+ CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
"${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}"
- OUTPUT_VARIABLE OUTPUT)
+ OUTPUT_VARIABLE OUTPUT)
- IF(${ARGC} EQUAL 3)
- SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS_SAVE})
- ENDIF(${ARGC} EQUAL 3)
+ if(${ARGC} EQUAL 3)
+ set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS_SAVE})
+ endif()
- IF(${VARIABLE})
- MESSAGE(STATUS "Looking for ${INCLUDE} - found")
- SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if(${VARIABLE})
+ message(STATUS "Looking for ${INCLUDE} - found")
+ set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the include file ${INCLUDE} "
"exists passed with the following output:\n"
"${OUTPUT}\n\n")
- ELSE(${VARIABLE})
- MESSAGE(STATUS "Looking for ${INCLUDE} - not found")
- SET(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ else()
+ message(STATUS "Looking for ${INCLUDE} - not found")
+ set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the include file ${INCLUDE} "
"exists failed with the following output:\n"
"${OUTPUT}\n\n")
- ENDIF(${VARIABLE})
- ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(CHECK_INCLUDE_FILE)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake
index c5d8f9a..22c2d1a 100644
--- a/Modules/CheckIncludeFileCXX.cmake
+++ b/Modules/CheckIncludeFileCXX.cmake
@@ -3,8 +3,8 @@
#
# INCLUDE - name of include file
# VARIABLE - variable to return result
-#
-# An optional third argument is the CFlags to add to the compile line
+#
+# An optional third argument is the CFlags to add to the compile line
# or you can use CMAKE_REQUIRED_FLAGS.
#
# The following variables may be set before calling this macro to
@@ -28,50 +28,50 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
- IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
- IF(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
- ELSE(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS)
- ENDIF(CMAKE_REQUIRED_INCLUDES)
- SET(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
- SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
- CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
+macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
+ if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
+ else()
+ set(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS)
+ endif()
+ set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ set(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
+ configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx IMMEDIATE)
- MESSAGE(STATUS "Looking for C++ include ${INCLUDE}")
- IF(${ARGC} EQUAL 3)
- SET(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}")
- ENDIF(${ARGC} EQUAL 3)
+ message(STATUS "Looking for C++ include ${INCLUDE}")
+ if(${ARGC} EQUAL 3)
+ set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}")
+ endif()
- TRY_COMPILE(${VARIABLE}
+ try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
- CMAKE_FLAGS
+ CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
"${CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS}"
- OUTPUT_VARIABLE OUTPUT)
+ OUTPUT_VARIABLE OUTPUT)
- IF(${ARGC} EQUAL 3)
- SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE})
- ENDIF(${ARGC} EQUAL 3)
+ if(${ARGC} EQUAL 3)
+ set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE})
+ endif()
- IF(${VARIABLE})
- MESSAGE(STATUS "Looking for C++ include ${INCLUDE} - found")
- SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if(${VARIABLE})
+ message(STATUS "Looking for C++ include ${INCLUDE} - found")
+ set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the include file ${INCLUDE} "
"exists passed with the following output:\n"
"${OUTPUT}\n\n")
- ELSE(${VARIABLE})
- MESSAGE(STATUS "Looking for C++ include ${INCLUDE} - not found")
- SET(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ else()
+ message(STATUS "Looking for C++ include ${INCLUDE} - not found")
+ set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the include file ${INCLUDE} "
"exists failed with the following output:\n"
"${OUTPUT}\n\n")
- ENDIF(${VARIABLE})
- ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(CHECK_INCLUDE_FILE_CXX)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index a94644e..daf2dd0 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -25,58 +25,58 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
- IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
- SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
- IF(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_INCLUDE_FILES_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
- ELSE(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_INCLUDE_FILES_INCLUDE_DIRS)
- ENDIF(CMAKE_REQUIRED_INCLUDES)
- SET(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
- SET(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
- FOREACH(FILE ${INCLUDE})
- SET(CMAKE_CONFIGURABLE_FILE_CONTENT
+macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
+ if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+ set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_INCLUDE_FILES_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
+ else()
+ set(CHECK_INCLUDE_FILES_INCLUDE_DIRS)
+ endif()
+ set(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
+ set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ foreach(FILE ${INCLUDE})
+ set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
- ENDFOREACH(FILE)
- SET(CMAKE_CONFIGURABLE_FILE_CONTENT
+ endforeach()
+ set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(){return 0;}\n")
- CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
+ configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c" @ONLY IMMEDIATE)
- SET(_INCLUDE ${INCLUDE}) # remove empty elements
- IF("${_INCLUDE}" MATCHES "^([^;]+);.+;([^;]+)$")
- LIST(LENGTH _INCLUDE _INCLUDE_LEN)
- SET(_description "${_INCLUDE_LEN} include files ${CMAKE_MATCH_1}, ..., ${CMAKE_MATCH_2}")
- ELSEIF("${_INCLUDE}" MATCHES "^([^;]+);([^;]+)$")
- SET(_description "include files ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}")
- ELSE()
- SET(_description "include file ${_INCLUDE}")
- ENDIF()
+ set(_INCLUDE ${INCLUDE}) # remove empty elements
+ if("${_INCLUDE}" MATCHES "^([^;]+);.+;([^;]+)$")
+ list(LENGTH _INCLUDE _INCLUDE_LEN)
+ set(_description "${_INCLUDE_LEN} include files ${CMAKE_MATCH_1}, ..., ${CMAKE_MATCH_2}")
+ elseif("${_INCLUDE}" MATCHES "^([^;]+);([^;]+)$")
+ set(_description "include files ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}")
+ else()
+ set(_description "include file ${_INCLUDE}")
+ endif()
- MESSAGE(STATUS "Looking for ${_description}")
- TRY_COMPILE(${VARIABLE}
+ message(STATUS "Looking for ${_description}")
+ try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
- CMAKE_FLAGS
+ CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS}
"${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"
OUTPUT_VARIABLE OUTPUT)
- IF(${VARIABLE})
- MESSAGE(STATUS "Looking for ${_description} - found")
- SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if(${VARIABLE})
+ message(STATUS "Looking for ${_description} - found")
+ set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if files ${INCLUDE} "
"exist passed with the following output:\n"
"${OUTPUT}\n\n")
- ELSE(${VARIABLE})
- MESSAGE(STATUS "Looking for ${_description} - not found.")
- SET(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ else()
+ message(STATUS "Looking for ${_description} - not found")
+ set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if files ${INCLUDE} "
"exist failed with the following output:\n"
"${OUTPUT}\nSource:\n${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
- ENDIF(${VARIABLE})
- ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(CHECK_INCLUDE_FILES)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake
index 59fca0a..697f8a4 100644
--- a/Modules/CheckLibraryExists.cmake
+++ b/Modules/CheckLibraryExists.cmake
@@ -26,22 +26,22 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
-MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
- IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
- SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION
+macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
+ if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+ set(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION
"-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
- MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
- SET(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
- IF(CMAKE_REQUIRED_LIBRARIES)
+ message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
+ set(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
+ if(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
- SET(CHECK_LIBRARY_EXISTS_LIBRARIES
+ set(CHECK_LIBRARY_EXISTS_LIBRARIES
${CHECK_LIBRARY_EXISTS_LIBRARIES} ${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES})
- ENDIF(CMAKE_REQUIRED_LIBRARIES)
- TRY_COMPILE(${VARIABLE}
+ endif()
+ try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckFunctionExists.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -51,20 +51,20 @@ MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
"-DLINK_LIBRARIES:STRING=${CHECK_LIBRARY_EXISTS_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT)
- IF(${VARIABLE})
- MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found")
- SET(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if(${VARIABLE})
+ message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found")
+ set(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
"passed with the following output:\n"
"${OUTPUT}\n\n")
- ELSE(${VARIABLE})
- MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
- SET(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ else()
+ message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
+ set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
"failed with the following output:\n"
"${OUTPUT}\n\n")
- ENDIF(${VARIABLE})
- ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(CHECK_LIBRARY_EXISTS)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/CheckPrototypeDefinition.cmake b/Modules/CheckPrototypeDefinition.cmake
index 63d4242..74b94b8 100644
--- a/Modules/CheckPrototypeDefinition.cmake
+++ b/Modules/CheckPrototypeDefinition.cmake
@@ -50,20 +50,20 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_PROTOTYPE_DEFINITION_LIBS
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
- else(CMAKE_REQUIRED_LIBRARIES)
+ else()
set(CHECK_PROTOTYPE_DEFINITION_LIBS)
- endif(CMAKE_REQUIRED_LIBRARIES)
+ endif()
if (CMAKE_REQUIRED_INCLUDES)
set(CMAKE_SYMBOL_EXISTS_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
- else(CMAKE_REQUIRED_INCLUDES)
+ else()
set(CMAKE_SYMBOL_EXISTS_INCLUDES)
- endif(CMAKE_REQUIRED_INCLUDES)
+ endif()
foreach(_FILE ${_HEADER})
set(CHECK_PROTOTYPE_DEFINITION_HEADER
"${CHECK_PROTOTYPE_DEFINITION_HEADER}#include <${_FILE}>\n")
- endforeach(_FILE)
+ endforeach()
set(CHECK_PROTOTYPE_DEFINITION_SYMBOL ${_FUNCTION})
set(CHECK_PROTOTYPE_DEFINITION_PROTO ${_PROTOTYPE})
@@ -89,13 +89,13 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n"
"${OUTPUT}\n\n")
- else (${_VARIABLE})
+ else ()
message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False")
set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n"
"${OUTPUT}\n\n${_SOURCE}\n\n")
- endif (${_VARIABLE})
- endif("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
+ endif ()
+ endif()
-endfunction(CHECK_PROTOTYPE_DEFINITION)
+endfunction()
diff --git a/Modules/CheckSizeOf.cmake b/Modules/CheckSizeOf.cmake
index f6d6636..9f587b5 100644
--- a/Modules/CheckSizeOf.cmake
+++ b/Modules/CheckSizeOf.cmake
@@ -12,7 +12,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-MESSAGE(SEND_ERROR
+message(SEND_ERROR
"Modules/CheckSizeOf.cmake has been removed. "
"Use Modules/CheckTypeSize.cmake instead. This "
"compatability check may be removed before the next release!")
diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake
index 18e80e3..ea2891c 100644
--- a/Modules/CheckStructHasMember.cmake
+++ b/Modules/CheckStructHasMember.cmake
@@ -28,15 +28,15 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(CheckCSourceCompiles)
+include(CheckCSourceCompiles)
-MACRO (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
- SET(_INCLUDE_FILES)
- FOREACH (it ${_HEADER})
- SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
- ENDFOREACH (it)
+macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
+ set(_INCLUDE_FILES)
+ foreach (it ${_HEADER})
+ set(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
+ endforeach ()
- SET(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
+ set(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
${_INCLUDE_FILES}
int main()
{
@@ -47,5 +47,5 @@ int main()
")
CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT})
-ENDMACRO (CHECK_STRUCT_HAS_MEMBER)
+endmacro ()
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index e6e677d..5a8597f 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -35,43 +35,43 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
-MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
+macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
_CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
-ENDMACRO(CHECK_SYMBOL_EXISTS)
+endmacro()
-MACRO(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
- IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
- SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
- SET(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
- IF(CMAKE_REQUIRED_LIBRARIES)
+macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
+ if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+ set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
+ set(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ if(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
- SET(CHECK_SYMBOL_EXISTS_LIBS
+ set(CHECK_SYMBOL_EXISTS_LIBS
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
- ELSE(CMAKE_REQUIRED_LIBRARIES)
- SET(CHECK_SYMBOL_EXISTS_LIBS)
- ENDIF(CMAKE_REQUIRED_LIBRARIES)
- IF(CMAKE_REQUIRED_INCLUDES)
- SET(CMAKE_SYMBOL_EXISTS_INCLUDES
+ else()
+ set(CHECK_SYMBOL_EXISTS_LIBS)
+ endif()
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CMAKE_SYMBOL_EXISTS_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
- ELSE(CMAKE_REQUIRED_INCLUDES)
- SET(CMAKE_SYMBOL_EXISTS_INCLUDES)
- ENDIF(CMAKE_REQUIRED_INCLUDES)
- FOREACH(FILE ${FILES})
- SET(CMAKE_CONFIGURABLE_FILE_CONTENT
+ else()
+ set(CMAKE_SYMBOL_EXISTS_INCLUDES)
+ endif()
+ foreach(FILE ${FILES})
+ set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
- ENDFOREACH(FILE)
- SET(CMAKE_CONFIGURABLE_FILE_CONTENT
+ endforeach()
+ set(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\nint main(int argc, char** argv)\n{\n (void)argv;\n#ifndef ${SYMBOL}\n return ((int*)(&${SYMBOL}))[argc];\n#else\n (void)argc;\n return 0;\n#endif\n}\n")
- CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
+ configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${SOURCEFILE}" @ONLY IMMEDIATE)
- MESSAGE(STATUS "Looking for ${SYMBOL}")
- TRY_COMPILE(${VARIABLE}
+ message(STATUS "Looking for ${SYMBOL}")
+ try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
"${SOURCEFILE}"
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -80,22 +80,22 @@ MACRO(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
"${CHECK_SYMBOL_EXISTS_LIBS}"
"${CMAKE_SYMBOL_EXISTS_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
- IF(${VARIABLE})
- MESSAGE(STATUS "Looking for ${SYMBOL} - found")
- SET(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if(${VARIABLE})
+ message(STATUS "Looking for ${SYMBOL} - found")
+ set(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the ${SYMBOL} "
"exist passed with the following output:\n"
"${OUTPUT}\nFile ${SOURCEFILE}:\n"
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
- ELSE(${VARIABLE})
- MESSAGE(STATUS "Looking for ${SYMBOL} - not found.")
- SET(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ else()
+ message(STATUS "Looking for ${SYMBOL} - not found")
+ set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the ${SYMBOL} "
"exist failed with the following output:\n"
"${OUTPUT}\nFile ${SOURCEFILE}:\n"
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
- ENDIF(${VARIABLE})
- ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(_CHECK_SYMBOL_EXISTS)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 1717718..7285b8a 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -24,6 +24,11 @@
# size check automatically includes the available headers, thus
# supporting checks of types defined in the headers.
#
+# Despite the name of the macro you may use it to check the size of
+# more complex expressions, too. To check e.g. for the size of a struct
+# member you can do something like this:
+# check_type_size("((struct something*)0)->member" SIZEOF_MEMBER)
+#
# The following variables may be set before calling this macro to
# modify the way the check is run:
#
@@ -142,7 +147,7 @@ function(__check_type_size_impl type var map builtin)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining size of ${type} passed with the following output:\n${output}\n\n")
set(${var} "${${var}}" CACHE INTERNAL "CHECK_TYPE_SIZE: sizeof(${type})")
- else(HAVE_${var})
+ else()
# The check failed to compile.
message(STATUS "Check size of ${type} - failed")
file(READ ${src} content)
@@ -150,7 +155,7 @@ function(__check_type_size_impl type var map builtin)
"Determining size of ${type} failed with the following output:\n${output}\n${src}:\n${content}\n\n")
set(${var} "" CACHE INTERNAL "CHECK_TYPE_SIZE: ${type} unknown")
file(REMOVE ${map})
- endif(HAVE_${var})
+ endif()
endfunction()
#-----------------------------------------------------------------------------
diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake
index 7d6c794..f9155a0 100644
--- a/Modules/CheckVariableExists.cmake
+++ b/Modules/CheckVariableExists.cmake
@@ -26,41 +26,41 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
-MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
- IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
- SET(MACRO_CHECK_VARIABLE_DEFINITIONS
+macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
+ if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+ set(MACRO_CHECK_VARIABLE_DEFINITIONS
"-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}")
- MESSAGE(STATUS "Looking for ${VAR}")
- IF(CMAKE_REQUIRED_LIBRARIES)
+ message(STATUS "Looking for ${VAR}")
+ if(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
- SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
+ set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
- ELSE(CMAKE_REQUIRED_LIBRARIES)
- SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES)
- ENDIF(CMAKE_REQUIRED_LIBRARIES)
- TRY_COMPILE(${VARIABLE}
+ else()
+ set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES)
+ endif()
+ try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckVariableExists.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_VARIABLE_DEFINITIONS}
"${CHECK_VARIABLE_EXISTS_ADD_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT)
- IF(${VARIABLE})
- SET(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}")
- MESSAGE(STATUS "Looking for ${VAR} - found")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if(${VARIABLE})
+ set(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}")
+ message(STATUS "Looking for ${VAR} - found")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the variable ${VAR} exists passed with the following output:\n"
"${OUTPUT}\n\n")
- ELSE(${VARIABLE})
- SET(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}")
- MESSAGE(STATUS "Looking for ${VAR} - not found")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ else()
+ set(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}")
+ message(STATUS "Looking for ${VAR} - not found")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the variable ${VAR} exists failed with the following output:\n"
"${OUTPUT}\n\n")
- ENDIF(${VARIABLE})
- ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(CHECK_VARIABLE_EXISTS)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/Compiler/Absoft-Fortran.cmake b/Modules/Compiler/Absoft-Fortran.cmake
index 1bb7b1f..2e1666f 100644
--- a/Modules/Compiler/Absoft-Fortran.cmake
+++ b/Modules/Compiler/Absoft-Fortran.cmake
@@ -1,10 +1,10 @@
-SET(CMAKE_Fortran_FLAGS_INIT "")
-SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "")
-SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
-SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
-SET(CMAKE_Fortran_MODDIR_FLAG "-YMOD_OUT_DIR=")
-SET(CMAKE_Fortran_MODPATH_FLAG "-p")
-SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_FLAGS_INIT "")
+set(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "")
+set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
+set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+set(CMAKE_Fortran_MODDIR_FLAG "-YMOD_OUT_DIR=")
+set(CMAKE_Fortran_MODPATH_FLAG "-p")
+set(CMAKE_Fortran_VERBOSE_FLAG "-v")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree")
diff --git a/Modules/Compiler/Clang-ASM.cmake b/Modules/Compiler/Clang-ASM.cmake
new file mode 100644
index 0000000..16c9c15
--- /dev/null
+++ b/Modules/Compiler/Clang-ASM.cmake
@@ -0,0 +1,5 @@
+include(Compiler/Clang)
+
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S;asm)
+
+__compiler_clang(ASM)
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake
index f7baf68..98fcd0b 100644
--- a/Modules/Compiler/Clang-C.cmake
+++ b/Modules/Compiler/Clang-C.cmake
@@ -1 +1,2 @@
-include(Compiler/GNU-C)
+include(Compiler/Clang)
+__compiler_clang(C)
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index d3c403a..486e2af 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -1 +1,2 @@
-include(Compiler/GNU-CXX)
+include(Compiler/Clang)
+__compiler_clang(CXX)
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
new file mode 100644
index 0000000..75a971d
--- /dev/null
+++ b/Modules/Compiler/Clang.cmake
@@ -0,0 +1,26 @@
+
+#=============================================================================
+# Copyright 2002-2012 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.)
+
+# This module is shared by multiple languages; use include blocker.
+if(__COMPILER_CLANG)
+ return()
+endif()
+set(__COMPILER_CLANG 1)
+
+include(Compiler/GNU)
+
+macro(__compiler_clang lang)
+ __compiler_gnu(${lang})
+ set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
+endmacro()
diff --git a/Modules/Compiler/GNU-Fortran.cmake b/Modules/Compiler/GNU-Fortran.cmake
index c710e86..313ccbd 100644
--- a/Modules/Compiler/GNU-Fortran.cmake
+++ b/Modules/Compiler/GNU-Fortran.cmake
@@ -5,13 +5,13 @@ set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form")
# No -DNDEBUG for Fortran.
-SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
-SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
+set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
+set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
# We require updates to CMake C++ code to support preprocessing rules
# for Fortran.
-SET(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
-SET(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE)
+set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
+set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE)
# Fortran-specific feature flags.
-SET(CMAKE_Fortran_MODDIR_FLAG -J)
+set(CMAKE_Fortran_MODDIR_FLAG -J)
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 6aecf90..faad416 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -32,7 +32,7 @@ macro(__compiler_gnu lang)
# header file as a warning if depfiles are enabled, causing check_header_file
# tests to always succeed. Work around this by disabling dependency tracking
# in try_compile mode.
- GET_PROPERTY(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
+ get_property(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
if(NOT _IN_TC OR CMAKE_FORCE_DEPFILES)
# distcc does not transform -o to -MT when invoking the preprocessor
# internally, as it ought to. Work around this bug by setting -MT here
@@ -45,10 +45,10 @@ macro(__compiler_gnu lang)
set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g")
set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
- set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+ set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
if(NOT APPLE)
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
- endif(NOT APPLE)
+ endif()
endmacro()
diff --git a/Modules/Compiler/HP-ASM.cmake b/Modules/Compiler/HP-ASM.cmake
index 8aa7bdb..b60f207 100644
--- a/Modules/Compiler/HP-ASM.cmake
+++ b/Modules/Compiler/HP-ASM.cmake
@@ -1,3 +1,3 @@
-SET(CMAKE_ASM_VERBOSE_FLAG "-v")
+set(CMAKE_ASM_VERBOSE_FLAG "-v")
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
diff --git a/Modules/Compiler/HP-C.cmake b/Modules/Compiler/HP-C.cmake
index dc7fbb2..6dddcba 100644
--- a/Modules/Compiler/HP-C.cmake
+++ b/Modules/Compiler/HP-C.cmake
@@ -1,4 +1,4 @@
-SET(CMAKE_C_VERBOSE_FLAG "-v")
+set(CMAKE_C_VERBOSE_FLAG "-v")
-SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
-SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/HP-CXX.cmake b/Modules/Compiler/HP-CXX.cmake
index 82c1a86..44470ca 100644
--- a/Modules/Compiler/HP-CXX.cmake
+++ b/Modules/Compiler/HP-CXX.cmake
@@ -1,4 +1,4 @@
-SET(CMAKE_CXX_VERBOSE_FLAG "-v")
+set(CMAKE_CXX_VERBOSE_FLAG "-v")
-SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
-SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/HP-Fortran.cmake b/Modules/Compiler/HP-Fortran.cmake
index 04fb96e..cc56b46 100644
--- a/Modules/Compiler/HP-Fortran.cmake
+++ b/Modules/Compiler/HP-Fortran.cmake
@@ -1,3 +1,3 @@
-SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_VERBOSE_FLAG "-v")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "+source=fixed")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "+source=free")
diff --git a/Modules/Compiler/Intel-ASM.cmake b/Modules/Compiler/Intel-ASM.cmake
index 59b50a1..74ceb0a 100644
--- a/Modules/Compiler/Intel-ASM.cmake
+++ b/Modules/Compiler/Intel-ASM.cmake
@@ -1,13 +1,13 @@
-SET(CMAKE_ASM_VERBOSE_FLAG "-v")
+set(CMAKE_ASM_VERBOSE_FLAG "-v")
-SET(CMAKE_ASM_FLAGS_INIT "")
-SET(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
-SET(CMAKE_ASM_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
-SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+set(CMAKE_ASM_FLAGS_INIT "")
+set(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
+set(CMAKE_ASM_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
+set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
-IF(UNIX)
- SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S)
-ELSE(UNIX)
- SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm)
-ENDIF(UNIX)
+if(UNIX)
+ set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S)
+else()
+ set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm)
+endif()
diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake
index 4be91d0..e23317c 100644
--- a/Modules/Compiler/Intel-C.cmake
+++ b/Modules/Compiler/Intel-C.cmake
@@ -1,10 +1,10 @@
-SET(CMAKE_C_VERBOSE_FLAG "-v")
+set(CMAKE_C_VERBOSE_FLAG "-v")
-SET(CMAKE_C_FLAGS_INIT "")
-SET(CMAKE_C_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
-SET(CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
-SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+set(CMAKE_C_FLAGS_INIT "")
+set(CMAKE_C_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
+set(CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")