summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2013-02-13 18:21:12 -0800
committerAnas Nashif <anas.nashif@intel.com>2013-02-13 18:21:12 -0800
commitef8aa19c33e83ff019595fd7f8fdc29c35c336a3 (patch)
tree6501b44707b5c6a88fa5f817adee1a3ffcb0012d /Modules
parent035c7fabc3b82cbc9a346c11abe2e9462b4c0379 (diff)
downloadcmake-ef8aa19c33e83ff019595fd7f8fdc29c35c336a3.tar.gz
cmake-ef8aa19c33e83ff019595fd7f8fdc29c35c336a3.tar.bz2
cmake-ef8aa19c33e83ff019595fd7f8fdc29c35c336a3.zip
Imported Upstream version 2.8.10.2upstream/2.8.10.2
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 f971e37f5..e88025c14 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 13f21617b..640bf70a0 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 9f7f03e27..b1c4fdf81 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 7bcea88a5..4acd9bb5e 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 0143d593d..4557be6e0 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 cb1f5d69c..675c13bb3 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 2dc24b06d..8e58307e9 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 b5f242033..dce162496 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 4e1386fab..eb105ab10 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 9da7d306c..7058fc7ae 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 203c39dfe..6a30dd88b 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 00e568830..e3b6c823e 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 707bbde50..cfc1d91f9 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 1ef28df83..43b31c695 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 ded8cf6ab..d74dcdcee 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 06aa9bf06..2d76c7a34 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 afac7a452..ce5ce4409 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 5b6376a32..8c5d84e6c 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 95fc852d6..5e70a4196 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 9dc9cbd30..933c15a82 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 6815e2b75..0214ead2b 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 a2929f1ea..bf94f9ff6 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 8b8dc07fb..990728f9f 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 9dd2f11de..cec09e985 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 0a70d0a82..9f0b30ab4 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 e23f7db4c..665a65cc5 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 d184c0a81..50f71dd8c 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 9028e8e06..275fc4758 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 7f8f3ec8b..59da3e60d 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 000000000..2d12c0757
--- /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 1c9899e64..75247d955 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 67f5a5906..906a5e7ba 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 ade6d586c..f861e3954 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 aefcaba36..c4217f552 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 8e085af7a..fa78da03c 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 7ae377517..cd3344756 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 33f01415e..98e5bb873 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 fba071a06..14551d1f8 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 8d316b941..a18f95062 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 455f95fe3..1fa0157bd 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 64ec403ad..e08c1c6a5 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 23f2c821d..f8d8d5908 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 a4264e78e..37b72fa38 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 001da20f3..7fdeb84be 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 331dc6ef9..2abd52376 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 59c7ba5ee..cea018706 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 6972c4c40..60275aea4 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 53967b52a..5c4f59639 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 2a839fd93..207c8ad35 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 53d95525f..55f827773 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 d962f4cb5..512ec4864 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 0ccbfac56..8a14aea60 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 848d89445..60b887aed 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 617f3bb90..cb3cf12c8 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 79c9288bc..cd4158c8e 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 e192db100..928c6ac32 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 95492a0b0..bc0f89fff 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 f760d74d4..efba20a31 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 f6472170c..d807df82b 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 f15c3e0d4..c3ca7671c 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 48039e522..96ecb4270 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 7ce4c49ae..406780eb4 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 6341dca9a..c37341411 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 2c5d0f2ae..e0c73346b 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 0a4212818..08809bf25 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 83428e2eb..0fc314220 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 859fe1158..8ffe50aba 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 a9f3a552d..7e2a3584b 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 faa9e3625..b9f8e0aaa 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 581ad0c23..0cc68573e 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 294511d89..9381619c4 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 8369b942c..462b1fc07 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 a5e2bea0a..414c2f550 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 779b2f007..2c751471a 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 87022e9f9..a5cdf5669 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 fd8a105b2..d51b503a1 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 e580c1f6b..000000000
--- 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 b4dcea634..e26334514 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 cfd3e24b6..d763412bf 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 3cece2a63..000000000
--- a/Modules/CMakeTestNMakeCLVersion.c
+++ /dev/null
@@ -1,2 +0,0 @@
-VERSION=_MSC_VER
-
diff --git a/Modules/CMakeTestRCCompiler.cmake b/Modules/CMakeTestRCCompiler.cmake
index a5c8d1149..7969da1de 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 39962c0d3..c75cf7cbc 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 695e92f52..189b62698 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 302efaa59..2df015d40 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 438f64f6c..ca48b8587 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 dccf8c462..40bf5b172 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 2381adb55..945c3faf8 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 df0b3bb97..e9622eecf 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 665158c88..218c5f2df 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 bb0818014..31df0268d 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 9e3c39ef3..35e9f981a 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 75783691f..aebe77ea1 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 657595731..6886ed9fd 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 15987030e..c85cfb454 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 bd3b94d74..106b44c27 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 ae9351273..0cec8973a 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 99963cf91..a36589bd6 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 ec9dbeb79..562e2486c 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 e459c1d59..42d3764cb 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 bc4d9646a..fd4bd8024 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 000000000..6731d3754
--- /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 90d04ac66..08e80f756 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 266933634..b4577544e 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 feee93a71..bc64acd31 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 19963ea4c..662640340 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 7f7336e5b..c0be1f784 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 cd68d5706..47ab1614b 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 1b012aefd..210097378 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 d83107851..882dc21b7 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 abec9f738..4b9f9b70d 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 8c469f012..3f952e0ec 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 eb732d28b..8067e65ce 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 c5d8f9aa2..22c2d1ac7 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 a94644e6a..daf2dd0ea 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 59fca0a32..697f8a4dc 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 63d424237..74b94b86f 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 f6d6636e5..9f587b5c2 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 18e80e3c0..ea2891c8b 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 e6e677d4f..5a8597f23 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 1717718c9..7285b8a6d 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 7d6c7945d..f9155a014 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 1bb7b1f82..2e1666fbf 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 000000000..16c9c159c
--- /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 f7baf686a..98fcd0b3f 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 d3c403a69..486e2af88 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 000000000..75a971dd7
--- /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 c710e8698..313ccbd02 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 6aecf90e8..faad41672 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 8aa7bdb7d..b60f207b4 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 dc7fbb21d..6dddcbae1 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 82c1a861e..44470cae0 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 04fb96ea4..cc56b4611 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 59b50a15c..74ceb0a6a 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 4be91d084..e23317c14 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")
-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>")
+set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake
index ff01a81f6..ae6021a68 100644
--- a/Modules/Compiler/Intel-CXX.cmake
+++ b/Modules/Compiler/Intel-CXX.cmake
@@ -1,10 +1,10 @@
-SET(CMAKE_CXX_VERBOSE_FLAG "-v")
+set(CMAKE_CXX_VERBOSE_FLAG "-v")
-SET(CMAKE_CXX_FLAGS_INIT "")
-SET(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+set(CMAKE_CXX_FLAGS_INIT "")
+set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
+set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
-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>")
+set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/Intel-Fortran.cmake b/Modules/Compiler/Intel-Fortran.cmake
index 467abdcf5..84f6182a7 100644
--- a/Modules/Compiler/Intel-Fortran.cmake
+++ b/Modules/Compiler/Intel-Fortran.cmake
@@ -1,9 +1,9 @@
-SET(CMAKE_Fortran_FLAGS_INIT "")
-SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
-SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
-SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
-SET(CMAKE_Fortran_MODDIR_FLAG "-module ")
-SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_FLAGS_INIT "")
+set(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
+set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
+set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+set(CMAKE_Fortran_MODDIR_FLAG "-module ")
+set(CMAKE_Fortran_VERBOSE_FLAG "-v")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
diff --git a/Modules/Compiler/MIPSpro-C.cmake b/Modules/Compiler/MIPSpro-C.cmake
index abf384ab8..675560c2a 100644
--- a/Modules/Compiler/MIPSpro-C.cmake
+++ b/Modules/Compiler/MIPSpro-C.cmake
@@ -1 +1 @@
-SET(CMAKE_C_VERBOSE_FLAG "-v")
+set(CMAKE_C_VERBOSE_FLAG "-v")
diff --git a/Modules/Compiler/MIPSpro-CXX.cmake b/Modules/Compiler/MIPSpro-CXX.cmake
index f3c6b5f82..9fb191c75 100644
--- a/Modules/Compiler/MIPSpro-CXX.cmake
+++ b/Modules/Compiler/MIPSpro-CXX.cmake
@@ -1 +1 @@
-SET(CMAKE_CXX_VERBOSE_FLAG "-v")
+set(CMAKE_CXX_VERBOSE_FLAG "-v")
diff --git a/Modules/Compiler/MIPSpro-Fortran.cmake b/Modules/Compiler/MIPSpro-Fortran.cmake
index 9220d3bf0..ffceea80d 100644
--- a/Modules/Compiler/MIPSpro-Fortran.cmake
+++ b/Modules/Compiler/MIPSpro-Fortran.cmake
@@ -1,3 +1,3 @@
-SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_VERBOSE_FLAG "-v")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixedform")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-freeform")
diff --git a/Modules/Compiler/PGI-Fortran.cmake b/Modules/Compiler/PGI-Fortran.cmake
index aebc7b1c2..264c23e74 100644
--- a/Modules/Compiler/PGI-Fortran.cmake
+++ b/Modules/Compiler/PGI-Fortran.cmake
@@ -4,12 +4,12 @@ __compiler_pgi(Fortran)
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-Mnofreeform")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-Mfreeform")
-SET(CMAKE_Fortran_FLAGS_INIT "${CMAKE_Fortran_FLAGS_INIT} -Mpreprocess -Kieee")
-SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "${CMAKE_Fortran_FLAGS_DEBUG_INIT} -Mbounds")
+set(CMAKE_Fortran_FLAGS_INIT "${CMAKE_Fortran_FLAGS_INIT} -Mpreprocess -Kieee")
+set(CMAKE_Fortran_FLAGS_DEBUG_INIT "${CMAKE_Fortran_FLAGS_DEBUG_INIT} -Mbounds")
# 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)
-SET(CMAKE_Fortran_MODDIR_FLAG "-module ")
+set(CMAKE_Fortran_MODDIR_FLAG "-module ")
diff --git a/Modules/Compiler/PathScale-Fortran.cmake b/Modules/Compiler/PathScale-Fortran.cmake
index e05bf2afc..d90362104 100644
--- a/Modules/Compiler/PathScale-Fortran.cmake
+++ b/Modules/Compiler/PathScale-Fortran.cmake
@@ -1,6 +1,6 @@
include(Compiler/PathScale)
__compiler_pathscale(Fortran)
-SET(CMAKE_Fortran_MODDIR_FLAG "-module ")
+set(CMAKE_Fortran_MODDIR_FLAG "-module ")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixedform")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-freeform")
diff --git a/Modules/Compiler/SunPro-ASM.cmake b/Modules/Compiler/SunPro-ASM.cmake
index dfc5702ee..2fa8b9950 100644
--- a/Modules/Compiler/SunPro-ASM.cmake
+++ b/Modules/Compiler/SunPro-ASM.cmake
@@ -1,24 +1,24 @@
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
-SET(CMAKE_ASM_VERBOSE_FLAG "-#")
+set(CMAKE_ASM_VERBOSE_FLAG "-#")
-SET(CMAKE_SHARED_LIBRARY_ASM_FLAGS "-KPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS "-G")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG "-R")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_SONAME_ASM_FLAG "-h")
+set(CMAKE_SHARED_LIBRARY_ASM_FLAGS "-KPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS "-G")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG "-R")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_SONAME_ASM_FLAG "-h")
-SET(CMAKE_ASM_FLAGS_INIT "")
-SET(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
-SET(CMAKE_ASM_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
+set(CMAKE_ASM_FLAGS_INIT "")
+set(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
+set(CMAKE_ASM_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
+set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG")
# Initialize ASM link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
- SET(CMAKE_${type}_LINK_STATIC_ASM_FLAGS "-Bstatic")
- SET(CMAKE_${type}_LINK_DYNAMIC_ASM_FLAGS "-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_STATIC_ASM_FLAGS "-Bstatic")
+ set(CMAKE_${type}_LINK_DYNAMIC_ASM_FLAGS "-Bdynamic")
+endforeach()
diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake
index a1a3ae118..c5b5203fd 100644
--- a/Modules/Compiler/SunPro-C.cmake
+++ b/Modules/Compiler/SunPro-C.cmake
@@ -1,27 +1,27 @@
-SET(CMAKE_C_VERBOSE_FLAG "-#")
+set(CMAKE_C_VERBOSE_FLAG "-#")
-SET(CMAKE_C_COMPILE_OPTIONS_PIC -KPIC)
-SET(CMAKE_C_COMPILE_OPTIONS_PIE -KPIE)
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-KPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-R")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-h")
+set(CMAKE_C_COMPILE_OPTIONS_PIC -KPIC)
+set(CMAKE_C_COMPILE_OPTIONS_PIE -KPIE)
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-KPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-R")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-h")
-SET(CMAKE_C_FLAGS_INIT "")
-SET(CMAKE_C_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_C_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
-SET(CMAKE_C_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
+set(CMAKE_C_FLAGS_INIT "")
+set(CMAKE_C_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
+set(CMAKE_C_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG")
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
- SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Bstatic")
- SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Bstatic")
+ set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Bdynamic")
+endforeach()
-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>")
+set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index 702e42458..59687129a 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -1,33 +1,33 @@
-SET(CMAKE_CXX_VERBOSE_FLAG "-v")
+set(CMAKE_CXX_VERBOSE_FLAG "-v")
-SET(CMAKE_CXX_COMPILE_OPTIONS_PIC -KPIC)
-SET(CMAKE_CXX_COMPILE_OPTIONS_PIE -KPIE)
-SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-KPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-R")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-h")
+set(CMAKE_CXX_COMPILE_OPTIONS_PIC -KPIC)
+set(CMAKE_CXX_COMPILE_OPTIONS_PIE -KPIE)
+set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-KPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-R")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-h")
-SET(CMAKE_CXX_FLAGS_INIT "")
-SET(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
+set(CMAKE_CXX_FLAGS_INIT "")
+set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
+set(CMAKE_CXX_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG")
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
- SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Bstatic")
- SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Bstatic")
+ set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Bdynamic")
+endforeach()
-SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
-SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <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> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
# Create archives with "CC -xar" in case user adds "-instances=extern"
# so that template instantiations are available to archive members.
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
+set(CMAKE_CXX_CREATE_STATIC_LIBRARY
"<CMAKE_CXX_COMPILER> -xar -o <TARGET> <OBJECTS> "
"<CMAKE_RANLIB> <TARGET> ")
diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake
index 86d6def34..18e75b9e3 100644
--- a/Modules/Compiler/SunPro-Fortran.cmake
+++ b/Modules/Compiler/SunPro-Fortran.cmake
@@ -1,18 +1,18 @@
-SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_VERBOSE_FLAG "-v")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
-SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-KPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-G")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "-R")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-h")
+set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-KPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-G")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "-R")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-h")
set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG "-R")
-SET(CMAKE_Fortran_FLAGS_INIT "")
-SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
-SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
-SET(CMAKE_Fortran_MODDIR_FLAG "-moddir=")
-SET(CMAKE_Fortran_MODPATH_FLAG "-M")
+set(CMAKE_Fortran_FLAGS_INIT "")
+set(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
+set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
+set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG")
+set(CMAKE_Fortran_MODDIR_FLAG "-moddir=")
+set(CMAKE_Fortran_MODPATH_FLAG "-M")
diff --git a/Modules/Compiler/TinyCC-C.cmake b/Modules/Compiler/TinyCC-C.cmake
index 4a48c0af5..f7937acdf 100644
--- a/Modules/Compiler/TinyCC-C.cmake
+++ b/Modules/Compiler/TinyCC-C.cmake
@@ -1,8 +1,8 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
# no optimization in tcc:
-SET (CMAKE_C_FLAGS_INIT "")
-SET (CMAKE_C_FLAGS_DEBUG_INIT "-g")
-SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-DNDEBUG")
-SET (CMAKE_C_FLAGS_RELEASE_INIT "-DNDEBUG")
-SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g")
+set (CMAKE_C_FLAGS_INIT "")
+set (CMAKE_C_FLAGS_DEBUG_INIT "-g")
+set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-DNDEBUG")
+set (CMAKE_C_FLAGS_RELEASE_INIT "-DNDEBUG")
+set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -DNDEBUG")
diff --git a/Modules/Compiler/XL-ASM.cmake b/Modules/Compiler/XL-ASM.cmake
index e5d4ffa85..07507f9be 100644
--- a/Modules/Compiler/XL-ASM.cmake
+++ b/Modules/Compiler/XL-ASM.cmake
@@ -1,13 +1,13 @@
-SET(CMAKE_ASM_VERBOSE_FLAG "-V")
+set(CMAKE_ASM_VERBOSE_FLAG "-V")
# -qthreaded = Ensures that all optimizations will be thread-safe
# -qalias=noansi = Turns off type-based aliasing completely (safer optimizer)
# -qhalt=e = Halt on error messages (rather than just severe errors)
-SET(CMAKE_ASM_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e -qsourcetype=assembler")
+set(CMAKE_ASM_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e -qsourcetype=assembler")
-SET(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_ASM_FLAGS_RELEASE_INIT "-O -DNDEBUG")
-SET(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
-SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g")
+set(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_ASM_FLAGS_RELEASE_INIT "-O -DNDEBUG")
+set(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
+set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -DNDEBUG")
-SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
diff --git a/Modules/Compiler/XL-C.cmake b/Modules/Compiler/XL-C.cmake
index ae869e37e..09a55291e 100644
--- a/Modules/Compiler/XL-C.cmake
+++ b/Modules/Compiler/XL-C.cmake
@@ -6,4 +6,4 @@ set(CMAKE_C_FLAGS_MINSIZEREL_INIT "${CMAKE_C_FLAGS_MINSIZEREL_INIT} -DNDEBUG")
# -qthreaded = Ensures that all optimizations will be thread-safe
# -qalias=noansi = Turns off type-based aliasing completely (safer optimizer)
# -qhalt=e = Halt on error messages (rather than just severe errors)
-SET(CMAKE_C_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e")
+set(CMAKE_C_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e")
diff --git a/Modules/Compiler/XL-CXX.cmake b/Modules/Compiler/XL-CXX.cmake
index 29c4b5e37..6c842cd77 100644
--- a/Modules/Compiler/XL-CXX.cmake
+++ b/Modules/Compiler/XL-CXX.cmake
@@ -5,7 +5,7 @@ set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT} -DNDEBUG
# -qthreaded = Ensures that all optimizations will be thread-safe
# -qhalt=e = Halt on error messages (rather than just severe errors)
-SET(CMAKE_CXX_FLAGS_INIT "-qthreaded -qhalt=e")
+set(CMAKE_CXX_FLAGS_INIT "-qthreaded -qhalt=e")
-SET(CMAKE_CXX_COMPILE_OBJECT
+set(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> -+ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake
index e7026f11a..f1c9158b2 100644
--- a/Modules/Compiler/XL-Fortran.cmake
+++ b/Modules/Compiler/XL-Fortran.cmake
@@ -4,14 +4,14 @@ __compiler_xl(Fortran)
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-qfixed") # [=<right_margin>]
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-qfree") # [=f90|ibm]
-SET(CMAKE_Fortran_MODDIR_FLAG "-qmoddir=")
+set(CMAKE_Fortran_MODDIR_FLAG "-qmoddir=")
-SET(CMAKE_Fortran_DEFINE_FLAG "-WF,-D")
+set(CMAKE_Fortran_DEFINE_FLAG "-WF,-D")
# -qthreaded = Ensures that all optimizations will be thread-safe
# -qhalt=e = Halt on error messages (rather than just severe errors)
-SET(CMAKE_Fortran_FLAGS_INIT "-qthreaded -qhalt=e")
+set(CMAKE_Fortran_FLAGS_INIT "-qthreaded -qhalt=e")
# 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)
diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in
new file mode 100644
index 000000000..ab4705fa3
--- /dev/null
+++ b/Modules/CompilerId/VS-10.vcxproj.in
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|@id_arch@">
+ <Configuration>Debug</Configuration>
+ <Platform>@id_arch@</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{CAE07175-D007-4FC3-BFE8-47B392814159}</ProjectGuid>
+ <RootNamespace>CompilerId@id_lang@</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_arch@'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ @id_toolset@
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|@id_arch@'">.\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|@id_arch@'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|@id_arch@'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_arch@'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>TurnOffAllWarnings</WarningLevel>
+ <DebugInformationFormat>
+ </DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>@id_machine_10@</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>for %%i in (@id_cl@) do %40echo CMAKE_@id_lang@_COMPILER=%%~$PATH:i</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="@id_src@" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+</Project>
diff --git a/Modules/CompilerId/VS-6.dsp.in b/Modules/CompilerId/VS-6.dsp.in
new file mode 100644
index 000000000..4f7e67613
--- /dev/null
+++ b/Modules/CompilerId/VS-6.dsp.in
@@ -0,0 +1,48 @@
+# Microsoft Developer Studio Project File - Name="CompilerId@id_lang@" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+
+# TARGTYPE "Win32 (@id_machine_6@) Application" 0x0101
+
+CFG=CompilerId@id_lang@ - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "CompilerId@id_lang@.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "CompilerId@id_lang@.mak" CFG="CompilerId@id_lang@ - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "CompilerId@id_lang@ - Win32 Debug" (based on "Win32 (@id_machine_6@) Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+CPP=cl.exe
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "."
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD CPP /nologo /MDd /c
+LINK32=link.exe
+# ADD LINK32 /nologo /version:0.0 /subsystem:console /machine:@id_machine_6@ /out:"CompilerId@id_lang@.exe" /IGNORE:4089
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Cmds=for %%i in (@id_cl@) do @echo CMAKE_@id_lang@_COMPILER=%%~$PATH:i
+# End Special Build Tool
+# Begin Target
+
+# Name "CompilerId@id_lang@ - Win32 Debug"
+# Begin Group "Source Files"
+
+# Begin Source File
+
+SOURCE="@id_src@"
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/Modules/CompilerId/VS-7.vcproj.in b/Modules/CompilerId/VS-7.vcproj.in
new file mode 100644
index 000000000..71bf64de2
--- /dev/null
+++ b/Modules/CompilerId/VS-7.vcproj.in
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="@id_version@"
+ Name="CompilerId@id_lang@"
+ ProjectGUID="{CAE07175-D007-4FC3-BFE8-47B392814159}"
+ RootNamespace="CompilerId@id_lang@"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="@id_arch@"
+ />
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|@id_arch@"
+ OutputDirectory="."
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions=""
+ MinimalRebuild="false"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ DebugInformationFormat="0"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="false"
+ SubSystem="1"
+ TargetMachine="@id_machine_7@"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="for %%i in (@id_cl@) do @echo CMAKE_@id_lang@_COMPILER=%%~$PATH:i"
+ />
+ </Configuration>
+ </Configurations>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="@id_src@"
+ >
+ </File>
+ </Filter>
+ </Files>
+</VisualStudioProject>
diff --git a/Modules/CompilerId/Xcode-1.pbxproj.in b/Modules/CompilerId/Xcode-1.pbxproj.in
new file mode 100644
index 000000000..f06960fec
--- /dev/null
+++ b/Modules/CompilerId/Xcode-1.pbxproj.in
@@ -0,0 +1,120 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 39;
+ objects = {
+ 014CEA460018CE2711CA2923 = {
+ buildSettings = {
+ };
+ isa = PBXBuildStyle;
+ name = Development;
+ };
+ 08FB7793FE84155DC02AAC07 = {
+ buildSettings = {
+ };
+ buildStyles = (
+ 014CEA460018CE2711CA2923,
+ );
+ hasScannedForEncodings = 1;
+ isa = PBXProject;
+ mainGroup = 08FB7794FE84155DC02AAC07;
+ projectDirPath = "";
+ targets = (
+ 8DD76FA90486AB0100D96B5E,
+ );
+ };
+ 08FB7794FE84155DC02AAC07 = {
+ children = (
+ 08FB7795FE84155DC02AAC07,
+ 1AB674ADFE9D54B511CA2CBB,
+ );
+ isa = PBXGroup;
+ name = CompilerId@id_lang@;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 08FB7795FE84155DC02AAC07 = {
+ children = (
+ 2C18F0B415DC1DC700593670,
+ );
+ isa = PBXGroup;
+ name = Source;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 1AB674ADFE9D54B511CA2CBB = {
+ children = (
+ 8DD76F6C0486A84900D96B5E,
+ );
+ isa = PBXGroup;
+ name = Products;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 2C18F0B415DC1DC700593670 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = @id_type@;
+ path = @id_src@;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 2C18F0B615DC1E0300593670 = {
+ fileRef = 2C18F0B415DC1DC700593670;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 2C8FEB8E15DC1A1A00E56A5D = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "echo \"GCC_VERSION=$GCC_VERSION\"";
+ };
+ 8DD76FA90486AB0100D96B5E = {
+ buildPhases = (
+ 2C18F0B515DC1DCE00593670,
+ 2C8FEB8E15DC1A1A00E56A5D,
+ );
+ buildRules = (
+ );
+ buildSettings = {
+ PRODUCT_NAME = CompilerId@id_lang@;
+ SYMROOT = .;
+ };
+ dependencies = (
+ );
+ isa = PBXNativeTarget;
+ name = CompilerId@id_lang@;
+ productName = CompilerId@id_lang@;
+ productReference = 8DD76F6C0486A84900D96B5E;
+ productType = "com.apple.product-type.tool";
+ };
+ 2C18F0B515DC1DCE00593670 = {
+ buildActionMask = 2147483647;
+ files = (
+ 2C18F0B615DC1E0300593670,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 8DD76F6C0486A84900D96B5E = {
+ explicitFileType = "compiled.mach-o.executable";
+ includeInIndex = 0;
+ isa = PBXFileReference;
+ path = CompilerId@id_lang@;
+ refType = 3;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ };
+ rootObject = 08FB7793FE84155DC02AAC07;
+}
diff --git a/Modules/CompilerId/Xcode-2.pbxproj.in b/Modules/CompilerId/Xcode-2.pbxproj.in
new file mode 100644
index 000000000..e3c7aa910
--- /dev/null
+++ b/Modules/CompilerId/Xcode-2.pbxproj.in
@@ -0,0 +1,119 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+ 2C18F0B615DC1E0300593670 = {isa = PBXBuildFile; fileRef = 2C18F0B415DC1DC700593670; };
+ 2C18F0B415DC1DC700593670 = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = @id_type@; path = @id_src@; sourceTree = "<group>"; };
+ 8DD76F6C0486A84900D96B5E = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = CompilerId@id_lang@; sourceTree = BUILT_PRODUCTS_DIR; };
+
+ 08FB7794FE84155DC02AAC07 = {
+ isa = PBXGroup;
+ children = (
+ 08FB7795FE84155DC02AAC07,
+ 1AB674ADFE9D54B511CA2CBB,
+ );
+ name = CompilerId@id_lang@;
+ sourceTree = "<group>";
+ };
+ 08FB7795FE84155DC02AAC07 = {
+ isa = PBXGroup;
+ children = (
+ 2C18F0B415DC1DC700593670,
+ );
+ name = Source;
+ sourceTree = "<group>";
+ };
+ 1AB674ADFE9D54B511CA2CBB = {
+ isa = PBXGroup;
+ children = (
+ 8DD76F6C0486A84900D96B5E,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+
+ 8DD76FA90486AB0100D96B5E = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1DEB928508733DD80010E9CD;
+ buildPhases = (
+ 2C18F0B515DC1DCE00593670,
+ 2C8FEB8E15DC1A1A00E56A5D,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = CompilerId@id_lang@;
+ productName = CompilerId@id_lang@;
+ productReference = 8DD76F6C0486A84900D96B5E;
+ productType = "com.apple.product-type.tool";
+ };
+ 08FB7793FE84155DC02AAC07 = {
+ isa = PBXProject;
+ buildConfigurationList = 1DEB928908733DD80010E9CD;
+ hasScannedForEncodings = 1;
+ mainGroup = 08FB7794FE84155DC02AAC07;
+ projectDirPath = "";
+ targets = (
+ 8DD76FA90486AB0100D96B5E,
+ );
+ };
+ 2C8FEB8E15DC1A1A00E56A5D = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "echo \"GCC_VERSION=$GCC_VERSION\"";
+ };
+ 2C18F0B515DC1DCE00593670 = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 2C18F0B615DC1E0300593670,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 1DEB928608733DD80010E9CD = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = CompilerId@id_lang@;
+ };
+ name = Debug;
+ };
+ 1DEB928A08733DD80010E9CD = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)";
+ SYMROOT = .;
+ };
+ name = Debug;
+ };
+ 1DEB928508733DD80010E9CD = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB928608733DD80010E9CD,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ 1DEB928908733DD80010E9CD = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB928A08733DD80010E9CD,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ };
+ rootObject = 08FB7793FE84155DC02AAC07;
+}
diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in
new file mode 100644
index 000000000..41ca7db72
--- /dev/null
+++ b/Modules/CompilerId/Xcode-3.pbxproj.in
@@ -0,0 +1,107 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 45;
+ objects = {
+
+ 2C18F0B615DC1E0300593670 = {isa = PBXBuildFile; fileRef = 2C18F0B415DC1DC700593670; };
+ 2C18F0B415DC1DC700593670 = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = @id_type@; path = @id_src@; sourceTree = "<group>"; };
+ 08FB7794FE84155DC02AAC07 = {
+ isa = PBXGroup;
+ children = (
+ 2C18F0B415DC1DC700593670,
+ );
+ name = CompilerId@id_lang@;
+ sourceTree = "<group>";
+ };
+ 8DD76FA90486AB0100D96B5E = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1DEB928508733DD80010E9CD;
+ buildPhases = (
+ 2C18F0B515DC1DCE00593670,
+ 2C8FEB8E15DC1A1A00E56A5D,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = CompilerId@id_lang@;
+ productName = CompilerId@id_lang@;
+ productType = "com.apple.product-type.tool";
+ };
+ 08FB7793FE84155DC02AAC07 = {
+ isa = PBXProject;
+ buildConfigurationList = 1DEB928908733DD80010E9CD;
+ compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
+ hasScannedForEncodings = 1;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 08FB7794FE84155DC02AAC07;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8DD76FA90486AB0100D96B5E,
+ );
+ };
+ 2C8FEB8E15DC1A1A00E56A5D = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "echo \"GCC_VERSION=$GCC_VERSION\"";
+ showEnvVarsInLog = 0;
+ };
+ 2C18F0B515DC1DCE00593670 = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 2C18F0B615DC1E0300593670,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 1DEB928608733DD80010E9CD = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = CompilerId@id_lang@;
+ };
+ name = Debug;
+ };
+ 1DEB928A08733DD80010E9CD = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ ONLY_ACTIVE_ARCH = YES;
+ CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)";
+ SYMROOT = .;
+ };
+ name = Debug;
+ };
+ 1DEB928508733DD80010E9CD = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB928608733DD80010E9CD,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ 1DEB928908733DD80010E9CD = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB928A08733DD80010E9CD,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ };
+ rootObject = 08FB7793FE84155DC02AAC07;
+}
diff --git a/Modules/Dart.cmake b/Modules/Dart.cmake
index 870545471..bd744b003 100644
--- a/Modules/Dart.cmake
+++ b/Modules/Dart.cmake
@@ -3,10 +3,10 @@
# It supports using the old Dart 1 Tcl client for driving dashboard
# submissions as well as testing with CTest. This module should be included
# in the CMakeLists.txt file at the top of a project. Typical usage:
-# INCLUDE(Dart)
-# IF(BUILD_TESTING)
+# include(Dart)
+# if(BUILD_TESTING)
# # ... testing related CMake code ...
-# ENDIF(BUILD_TESTING)
+# endif()
# The BUILD_TESTING option is created by the Dart module to determine
# whether testing support should be enabled. The default is ON.
@@ -32,10 +32,10 @@
# (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)
-IF(BUILD_TESTING)
- FIND_PACKAGE(Dart QUIET)
+if(BUILD_TESTING)
+ find_package(Dart QUIET)
#
# Section #1:
@@ -44,58 +44,58 @@ IF(BUILD_TESTING)
# on the client and configure site name and build name.
#
- SET(RUN_FROM_DART 1)
- INCLUDE(CTest)
- SET(RUN_FROM_DART)
+ set(RUN_FROM_DART 1)
+ include(CTest)
+ set(RUN_FROM_DART)
- FIND_PROGRAM(COMPRESSIONCOMMAND NAMES gzip compress zip
+ find_program(COMPRESSIONCOMMAND NAMES gzip compress zip
DOC "Path to program used to compress files for transfer to the dart server")
- FIND_PROGRAM(GUNZIPCOMMAND gunzip DOC "Path to gunzip executable")
- FIND_PROGRAM(JAVACOMMAND java DOC "Path to java command, used by the Dart server to create html.")
- OPTION(DART_VERBOSE_BUILD "Show the actual output of the build, or if off show a . for each 1024 bytes."
+ find_program(GUNZIPCOMMAND gunzip DOC "Path to gunzip executable")
+ find_program(JAVACOMMAND java DOC "Path to java command, used by the Dart server to create html.")
+ option(DART_VERBOSE_BUILD "Show the actual output of the build, or if off show a . for each 1024 bytes."
OFF)
- OPTION(DART_BUILD_ERROR_REPORT_LIMIT "Limit of reported errors, -1 reports all." -1 )
- OPTION(DART_BUILD_WARNING_REPORT_LIMIT "Limit of reported warnings, -1 reports all." -1 )
+ option(DART_BUILD_ERROR_REPORT_LIMIT "Limit of reported errors, -1 reports all." -1 )
+ option(DART_BUILD_WARNING_REPORT_LIMIT "Limit of reported warnings, -1 reports all." -1 )
- SET(VERBOSE_BUILD ${DART_VERBOSE_BUILD})
- SET(BUILD_ERROR_REPORT_LIMIT ${DART_BUILD_ERROR_REPORT_LIMIT})
- SET(BUILD_WARNING_REPORT_LIMIT ${DART_BUILD_WARNING_REPORT_LIMIT})
- SET (DELIVER_CONTINUOUS_EMAIL "Off" CACHE BOOL "Should Dart server send email when build errors are found in Continuous builds?")
+ set(VERBOSE_BUILD ${DART_VERBOSE_BUILD})
+ set(BUILD_ERROR_REPORT_LIMIT ${DART_BUILD_ERROR_REPORT_LIMIT})
+ set(BUILD_WARNING_REPORT_LIMIT ${DART_BUILD_WARNING_REPORT_LIMIT})
+ set (DELIVER_CONTINUOUS_EMAIL "Off" CACHE BOOL "Should Dart server send email when build errors are found in Continuous builds?")
- MARK_AS_ADVANCED(
+ mark_as_advanced(
COMPRESSIONCOMMAND
- DART_BUILD_ERROR_REPORT_LIMIT
- DART_BUILD_WARNING_REPORT_LIMIT
+ DART_BUILD_ERROR_REPORT_LIMIT
+ DART_BUILD_WARNING_REPORT_LIMIT
DART_TESTING_TIMEOUT
DART_VERBOSE_BUILD
DELIVER_CONTINUOUS_EMAIL
GUNZIPCOMMAND
- JAVACOMMAND
+ JAVACOMMAND
)
- SET(HAVE_DART)
- IF(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
- SET(HAVE_DART 1)
- ENDIF(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
+ set(HAVE_DART)
+ if(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
+ set(HAVE_DART 1)
+ endif()
#
# Section #2:
- #
+ #
# Make necessary directories and configure testing scripts
#
# find a tcl shell command
- IF(HAVE_DART)
- FIND_PACKAGE(Tclsh)
- ENDIF(HAVE_DART)
+ if(HAVE_DART)
+ find_package(Tclsh)
+ endif()
- IF (HAVE_DART)
+ if (HAVE_DART)
# make directories in the binary tree
- FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Dashboard"
+ file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Dashboard"
"${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Sites/${SITE}/${BUILDNAME}")
# configure files
- CONFIGURE_FILE(
+ configure_file(
"${DART_ROOT}/Source/Client/Dart.conf.in"
"${PROJECT_BINARY_DIR}/DartConfiguration.tcl" )
@@ -107,16 +107,16 @@ IF(BUILD_TESTING)
#
# add testing targets
- SET(DART_EXPERIMENTAL_NAME Experimental)
- IF(DART_EXPERIMENTAL_USE_PROJECT_NAME)
- SET(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}")
- ENDIF(DART_EXPERIMENTAL_USE_PROJECT_NAME)
- ENDIF (HAVE_DART)
-
- SET(RUN_FROM_CTEST_OR_DART 1)
- INCLUDE(CTestTargets)
- SET(RUN_FROM_CTEST_OR_DART)
-ENDIF(BUILD_TESTING)
+ set(DART_EXPERIMENTAL_NAME Experimental)
+ if(DART_EXPERIMENTAL_USE_PROJECT_NAME)
+ set(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}")
+ endif()
+ endif ()
+
+ set(RUN_FROM_CTEST_OR_DART 1)
+ include(CTestTargets)
+ set(RUN_FROM_CTEST_OR_DART)
+endif()
#
# End of Dart.cmake
diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in
index ad7f80517..9e49ac776 100644
--- a/Modules/DartConfiguration.tcl.in
+++ b/Modules/DartConfiguration.tcl.in
@@ -44,6 +44,7 @@ CVSUpdateOptions: @CVS_UPDATE_OPTIONS@
# Subversion options
SVNCommand: @SVNCOMMAND@
+SVNOptions: @CTEST_SVN_OPTIONS@
SVNUpdateOptions: @SVN_UPDATE_OPTIONS@
# Git options
diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake
index edf4b4e76..309fce310 100644
--- a/Modules/DeployQt4.cmake
+++ b/Modules/DeployQt4.cmake
@@ -101,7 +101,7 @@ function(resolve_qt4_paths paths_var)
if(${executable_path})
list(APPEND paths_resolved "${executable_path}/${path}")
else()
- list(APPEND paths_resolved "\${CMAKE_INSTALL_PREFIX}/${path}")
+ list(APPEND paths_resolved "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${path}")
endif()
endif()
endforeach()
@@ -293,9 +293,9 @@ function(install_qt4_executable executable)
resolve_qt4_paths(libs "")
install(CODE
- "INCLUDE(\"${DeployQt4_cmake_dir}/DeployQt4.cmake\")
- SET(BU_CHMOD_BUNDLE_ITEMS TRUE)
- FIXUP_QT4_EXECUTABLE(\"\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\")"
+ "include(\"${DeployQt4_cmake_dir}/DeployQt4.cmake\")
+ set(BU_CHMOD_BUNDLE_ITEMS TRUE)
+ FIXUP_QT4_EXECUTABLE(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\")"
${component}
)
endfunction()
diff --git a/Modules/Documentation.cmake b/Modules/Documentation.cmake
index ffeb371cc..d1c3afe47 100644
--- a/Modules/Documentation.cmake
+++ b/Modules/Documentation.cmake
@@ -18,35 +18,35 @@
#
# Build the documentation ?
#
-OPTION(BUILD_DOCUMENTATION "Build the documentation (Doxygen)." OFF)
-MARK_AS_ADVANCED(BUILD_DOCUMENTATION)
+option(BUILD_DOCUMENTATION "Build the documentation (Doxygen)." OFF)
+mark_as_advanced(BUILD_DOCUMENTATION)
-IF (BUILD_DOCUMENTATION)
+if (BUILD_DOCUMENTATION)
#
# Check for the tools
#
- FIND_PACKAGE(UnixCommands)
- FIND_PACKAGE(Doxygen)
- FIND_PACKAGE(Gnuplot)
- FIND_PACKAGE(HTMLHelp)
- FIND_PACKAGE(Perl)
- FIND_PACKAGE(Wget)
-
- OPTION(DOCUMENTATION_HTML_HELP
+ find_package(UnixCommands)
+ find_package(Doxygen)
+ find_package(Gnuplot)
+ find_package(HTMLHelp)
+ find_package(Perl)
+ find_package(Wget)
+
+ option(DOCUMENTATION_HTML_HELP
"Build the HTML Help file (CHM)." OFF)
- OPTION(DOCUMENTATION_HTML_TARZ
+ option(DOCUMENTATION_HTML_TARZ
"Build a compressed tar archive of the HTML doc." OFF)
- MARK_AS_ADVANCED(
+ mark_as_advanced(
DOCUMENTATION_HTML_HELP
DOCUMENTATION_HTML_TARZ
)
- #
+ #
# The documentation process is controled by a batch file.
# We will probably need bash to create the custom target
#
-ENDIF (BUILD_DOCUMENTATION)
+endif ()
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index a0a9aead5..8d578607e 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -9,6 +9,7 @@
# [TMP_DIR dir] # Directory to store temporary files
# [STAMP_DIR dir] # Directory to store step timestamps
# #--Download step--------------
+# [DOWNLOAD_NAME fname] # File name to store (if not end of URL)
# [DOWNLOAD_DIR dir] # Directory to store downloaded files
# [DOWNLOAD_COMMAND cmd...] # Command to download source tree
# [CVS_REPOSITORY cvsroot] # CVSROOT of CVS repository
@@ -21,8 +22,13 @@
# [SVN_TRUST_CERT 1 ] # Trust the Subversion server site certificate
# [GIT_REPOSITORY url] # URL of git repo
# [GIT_TAG tag] # Git branch name, commit id or tag
+# [HG_REPOSITORY url] # URL of mercurial repo
+# [HG_TAG tag] # Mercurial branch name, commit id or tag
# [URL /.../src.tgz] # Full path or URL of source
-# [URL_MD5 md5] # MD5 checksum of file at URL
+# [URL_HASH ALGO=value] # Hash of file at URL
+# [URL_MD5 md5] # Equivalent to URL_HASH MD5=md5
+# [TLS_VERIFY bool] # Should certificate for https be checked
+# [TLS_CAINFO file] # Path to a certificate authority file
# [TIMEOUT seconds] # Time allowed for file download operations
# #--Update/Patch step----------
# [UPDATE_COMMAND cmd...] # Source work-tree update command
@@ -182,6 +188,9 @@ if(_ep_func)
set(_ep_keywords_${_ep_func} "${_ep_keywords_${_ep_func}})$")
endif()
+# Save regex matching supported hash algorithm names.
+set(_ep_hash_algos "MD5|SHA1|SHA224|SHA256|SHA384|SHA512")
+set(_ep_hash_regex "^(${_ep_hash_algos})=([0-9A-Fa-f]+)$")
function(_ep_parse_arguments f name ns args)
# Transfer the arguments to this function into target properties for the
@@ -226,7 +235,7 @@ function(_ep_parse_arguments f name ns args)
set(key "${arg}")
endif()
endforeach()
-endfunction(_ep_parse_arguments)
+endfunction()
define_property(DIRECTORY PROPERTY "EP_BASE" INHERITED
@@ -329,10 +338,71 @@ endif()
"
)
-endfunction(_ep_write_gitclone_script)
+endfunction()
+
+function(_ep_write_hgclone_script script_filename source_dir hg_EXECUTABLE hg_repository hg_tag src_name work_dir hgclone_infofile hgclone_stampfile)
+ file(WRITE ${script_filename}
+"if(\"${hg_tag}\" STREQUAL \"\")
+ message(FATAL_ERROR \"Tag for hg checkout should not be empty.\")
+endif()
+
+set(run 0)
+
+if(\"${hgclone_infofile}\" IS_NEWER_THAN \"${hgclone_stampfile}\")
+ set(run 1)
+endif()
+
+if(NOT run)
+ message(STATUS \"Avoiding repeated hg clone, stamp file is up to date: '${hgclone_stampfile}'\")
+ return()
+endif()
+
+execute_process(
+ COMMAND \${CMAKE_COMMAND} -E remove_directory \"${source_dir}\"
+ RESULT_VARIABLE error_code
+ )
+if(error_code)
+ message(FATAL_ERROR \"Failed to remove directory: '${source_dir}'\")
+endif()
+
+execute_process(
+ COMMAND \"${hg_EXECUTABLE}\" clone \"${hg_repository}\" \"${src_name}\"
+ WORKING_DIRECTORY \"${work_dir}\"
+ RESULT_VARIABLE error_code
+ )
+if(error_code)
+ message(FATAL_ERROR \"Failed to clone repository: '${hg_repository}'\")
+endif()
+
+execute_process(
+ COMMAND \"${hg_EXECUTABLE}\" update ${hg_tag}
+ WORKING_DIRECTORY \"${work_dir}/${src_name}\"
+ RESULT_VARIABLE error_code
+ )
+if(error_code)
+ message(FATAL_ERROR \"Failed to checkout tag: '${hg_tag}'\")
+endif()
+
+# Complete success, update the script-last-run stamp file:
+#
+execute_process(
+ COMMAND \${CMAKE_COMMAND} -E copy
+ \"${hgclone_infofile}\"
+ \"${hgclone_stampfile}\"
+ WORKING_DIRECTORY \"${work_dir}/${src_name}\"
+ RESULT_VARIABLE error_code
+ )
+if(error_code)
+ message(FATAL_ERROR \"Failed to copy script-last-run stamp file: '${hgclone_stampfile}'\")
+endif()
+
+"
+)
+
+endfunction()
-function(_ep_write_downloadfile_script script_filename remote local timeout md5)
+function(_ep_write_downloadfile_script script_filename remote local timeout hash tls_verify tls_cainfo)
if(timeout)
set(timeout_args TIMEOUT ${timeout})
set(timeout_msg "${timeout} seconds")
@@ -341,10 +411,31 @@ function(_ep_write_downloadfile_script script_filename remote local timeout md5)
set(timeout_msg "none")
endif()
- if(md5)
- set(md5_args EXPECTED_MD5 ${md5})
+ if("${hash}" MATCHES "${_ep_hash_regex}")
+ set(hash_args EXPECTED_HASH ${CMAKE_MATCH_1}=${CMAKE_MATCH_2})
else()
- set(md5_args "# no EXPECTED_MD5")
+ set(hash_args "# no EXPECTED_HASH")
+ endif()
+ # check for curl globals in the project
+ if(DEFINED CMAKE_TLS_VERIFY)
+ set(tls_verify "set(CMAKE_TLS_VERIFY ${CMAKE_TLS_VERIFY})")
+ endif()
+ if(DEFINED CMAKE_TLS_CAINFO)
+ set(tls_cainfo "set(CMAKE_TLS_CAINFO \"${CMAKE_TLS_CAINFO}\")")
+ endif()
+
+ # now check for curl locals so that the local values
+ # will override the globals
+
+ # check for tls_verify argument
+ string(LENGTH "${tls_verify}" tls_verify_len)
+ if(tls_verify_len GREATER 0)
+ set(tls_verify "set(CMAKE_TLS_VERIFY ${tls_verify})")
+ endif()
+ # check for tls_cainfo argument
+ string(LENGTH "${tls_cainfo}" tls_cainfo_len)
+ if(tls_cainfo_len GREATER 0)
+ set(tls_cainfo "set(CMAKE_TLS_CAINFO \"${tls_cainfo}\")")
endif()
file(WRITE ${script_filename}
@@ -353,11 +444,14 @@ function(_ep_write_downloadfile_script script_filename remote local timeout md5)
dst='${local}'
timeout='${timeout_msg}'\")
+${tls_verify}
+${tls_cainfo}
+
file(DOWNLOAD
\"${remote}\"
\"${local}\"
SHOW_PROGRESS
- ${md5_args}
+ ${hash_args}
${timeout_args}
STATUS status
LOG log)
@@ -377,52 +471,34 @@ message(STATUS \"downloading... done\")
"
)
-endfunction(_ep_write_downloadfile_script)
-
-
-function(_ep_write_verifyfile_script script_filename local md5)
- file(WRITE ${script_filename}
-"message(STATUS \"verifying file...
- file='${local}'\")
-
-set(verified 0)
-
-# If an expected md5 checksum exists, compare against it:
-#
-if(NOT \"${md5}\" STREQUAL \"\")
- execute_process(COMMAND \${CMAKE_COMMAND} -E md5sum \"${local}\"
- OUTPUT_VARIABLE ov
- OUTPUT_STRIP_TRAILING_WHITESPACE
- RESULT_VARIABLE rv)
-
- if(NOT rv EQUAL 0)
- message(FATAL_ERROR \"error: computing md5sum of '${local}' failed\")
- endif()
-
- string(REGEX MATCH \"^([0-9A-Fa-f]+)\" md5_actual \"\${ov}\")
-
- string(TOLOWER \"\${md5_actual}\" md5_actual)
- string(TOLOWER \"${md5}\" md5)
-
- if(NOT \"\${md5}\" STREQUAL \"\${md5_actual}\")
- message(FATAL_ERROR \"error: md5sum of '${local}' does not match expected value
- md5_expected: \${md5}
- md5_actual: \${md5_actual}
-\")
- endif()
+endfunction()
- set(verified 1)
-endif()
-if(verified)
+function(_ep_write_verifyfile_script script_filename local hash)
+ if("${hash}" MATCHES "${_ep_hash_regex}")
+ set(algo "${CMAKE_MATCH_1}")
+ string(TOLOWER "${CMAKE_MATCH_2}" expect_value)
+ set(script_content "set(expect_value \"${expect_value}\")
+file(${algo} \"\${file}\" actual_value)
+if(\"\${actual_value}\" STREQUAL \"\${expect_value}\")
message(STATUS \"verifying file... done\")
else()
- message(STATUS \"verifying file... warning: did not verify file - no URL_MD5 checksum argument? corrupt file?\")
-endif()
-"
-)
-
-endfunction(_ep_write_verifyfile_script)
+ message(FATAL_ERROR \"error: ${algo} hash of
+ \${file}
+does not match expected value
+ expected: \${expect_value}
+ actual: \${actual_value}
+\")
+endif()")
+ else()
+ set(script_content "message(STATUS \"verifying file... warning: did not verify file - no URL_HASH specified?\")")
+ endif()
+ file(WRITE ${script_filename} "set(file \"${local}\")
+message(STATUS \"verifying file...
+ file='\${file}'\")
+${script_content}
+")
+endfunction()
function(_ep_write_extractfile_script script_filename name filename directory)
@@ -502,7 +578,7 @@ message(STATUS \"extracting... done\")
"
)
-endfunction(_ep_write_extractfile_script)
+endfunction()
function(_ep_set_directories name)
@@ -523,7 +599,7 @@ function(_ep_set_directories name)
set(binary_default "${prefix}/src/${name}-build")
set(stamp_default "${prefix}/src/${name}-stamp")
set(install_default "${prefix}")
- else() # assert(base)
+ else()
set(tmp_default "${base}/tmp/${name}")
set(download_default "${base}/Download/${name}")
set(source_default "${base}/Source/${name}")
@@ -573,7 +649,7 @@ function(_ep_set_directories name)
message(FATAL_ERROR "dir '${dir}' does not exist after file(MAKE_DIRECTORY)")
endif()
endforeach()
-endfunction(_ep_set_directories)
+endfunction()
# IMPORTANT: this MUST be a macro and not a function because of the
@@ -633,7 +709,7 @@ function(_ep_write_initial_cache target_name script_filename args)
file(WRITE "${script_filename}.in" "\@script_initial_cache\@\n")
endif()
configure_file("${script_filename}.in" "${script_filename}")
-endfunction(_ep_write_initial_cache)
+endfunction()
function(ExternalProject_Get_Property name)
@@ -645,7 +721,7 @@ function(ExternalProject_Get_Property name)
endif()
set(${var} "${${var}}" PARENT_SCOPE)
endforeach()
-endfunction(ExternalProject_Get_Property)
+endfunction()
function(_ep_get_configure_command_id name cfg_cmd_id_var)
@@ -671,7 +747,7 @@ function(_ep_get_configure_command_id name cfg_cmd_id_var)
endif()
endif()
endif()
-endfunction(_ep_get_configure_command_id)
+endfunction()
function(_ep_get_build_command name step cmd_var)
@@ -710,7 +786,7 @@ function(_ep_get_build_command name step cmd_var)
set(args "")
endif()
endif()
- else() # if(cfg_cmd_id STREQUAL "configure")
+ else()
# Non-CMake project. Guess "make" and "make install" and "make test".
if("${CMAKE_GENERATOR}" MATCHES "Makefiles")
# Try to get the parallel arguments
@@ -736,7 +812,7 @@ function(_ep_get_build_command name step cmd_var)
endif()
set(${cmd_var} "${cmd}" PARENT_SCOPE)
-endfunction(_ep_get_build_command)
+endfunction()
function(_ep_write_log_script name step cmd_var)
ExternalProject_Get_Property(${name} stamp_dir)
@@ -784,7 +860,7 @@ if(result)
set(msg \"Command failed (\${result}):\\n\")
foreach(arg IN LISTS command)
set(msg \"\${msg} '\${arg}'\")
- endforeach(arg)
+ endforeach()
message(FATAL_ERROR \"\${msg}\")
endif()
")
@@ -823,7 +899,7 @@ if(result)
set(msg \"Command failed: \${result}\\n\")
foreach(arg IN LISTS command)
set(msg \"\${msg} '\${arg}'\")
- endforeach(arg)
+ endforeach()
set(msg \"\${msg}\\nSee also\\n ${logbase}-*.log\\n\")
message(FATAL_ERROR \"\${msg}\")
else()
@@ -833,7 +909,7 @@ endif()
")
set(command ${CMAKE_COMMAND} ${make} ${config} -P ${script})
set(${cmd_var} "${command}" PARENT_SCOPE)
-endfunction(_ep_write_log_script)
+endfunction()
# This module used to use "/${CMAKE_CFG_INTDIR}" directly and produced
# makefiles with "/./" in paths for custom command dependencies. Which
@@ -849,7 +925,7 @@ function(_ep_get_configuration_subdir_suffix suffix_var)
set(suffix "/${CMAKE_CFG_INTDIR}")
endif()
set(${suffix_var} "${suffix}" PARENT_SCOPE)
-endfunction(_ep_get_configuration_subdir_suffix)
+endfunction()
function(_ep_get_step_stampfile name step stampfile_var)
@@ -876,7 +952,7 @@ function(ExternalProject_Add_StepTargets name)
add_dependencies(${name}-${step} ${arg})
endforeach()
endforeach()
-endfunction(ExternalProject_Add_StepTargets)
+endfunction()
function(ExternalProject_Add_Step name step)
@@ -974,7 +1050,7 @@ function(ExternalProject_Add_Step name step)
break()
endif()
endforeach()
-endfunction(ExternalProject_Add_Step)
+endfunction()
function(_ep_add_mkdir_command name)
@@ -992,7 +1068,7 @@ function(_ep_add_mkdir_command name)
COMMAND ${CMAKE_COMMAND} -E make_directory ${stamp_dir}${cfgdir}
COMMAND ${CMAKE_COMMAND} -E make_directory ${download_dir}
)
-endfunction(_ep_add_mkdir_command)
+endfunction()
function(_ep_get_git_version git_EXECUTABLE git_version_var)
@@ -1027,7 +1103,9 @@ function(_ep_add_download_command name)
get_property(cvs_repository TARGET ${name} PROPERTY _EP_CVS_REPOSITORY)
get_property(svn_repository TARGET ${name} PROPERTY _EP_SVN_REPOSITORY)
get_property(git_repository TARGET ${name} PROPERTY _EP_GIT_REPOSITORY)
+ get_property(hg_repository TARGET ${name} PROPERTY _EP_HG_REPOSITORY )
get_property(url TARGET ${name} PROPERTY _EP_URL)
+ get_property(fname TARGET ${name} PROPERTY _EP_DOWNLOAD_NAME)
# TODO: Perhaps file:// should be copied to download dir before extraction.
string(REGEX REPLACE "^file://" "" url "${url}")
@@ -1148,12 +1226,64 @@ function(_ep_add_download_command name)
set(comment "Performing download step (git clone) for '${name}'")
set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitclone.cmake)
list(APPEND depends ${stamp_dir}/${name}-gitinfo.txt)
+ elseif(hg_repository)
+ find_package(Hg)
+ if(NOT HG_EXECUTABLE)
+ message(FATAL_ERROR "error: could not find hg for clone of ${name}")
+ endif()
+
+ get_property(hg_tag TARGET ${name} PROPERTY _EP_HG_TAG)
+ if(NOT hg_tag)
+ set(hg_tag "tip")
+ endif()
+
+ # For the download step, and the hg clone operation, only the repository
+ # should be recorded in a configured RepositoryInfo file. If the repo
+ # changes, the clone script should be run again. But if only the tag
+ # changes, avoid running the clone script again. Let the 'always' running
+ # update step checkout the new tag.
+ #
+ set(repository ${hg_repository})
+ set(module)
+ set(tag)
+ configure_file(
+ "${CMAKE_ROOT}/Modules/RepositoryInfo.txt.in"
+ "${stamp_dir}/${name}-hginfo.txt"
+ @ONLY
+ )
+
+ get_filename_component(src_name "${source_dir}" NAME)
+ get_filename_component(work_dir "${source_dir}" PATH)
+
+ # Since hg clone doesn't succeed if the non-empty source_dir exists,
+ # create a cmake script to invoke as download command.
+ # The script will delete the source directory and then call hg clone.
+ #
+ _ep_write_hgclone_script(${tmp_dir}/${name}-hgclone.cmake ${source_dir}
+ ${HG_EXECUTABLE} ${hg_repository} ${hg_tag} ${src_name} ${work_dir}
+ ${stamp_dir}/${name}-hginfo.txt ${stamp_dir}/${name}-hgclone-lastrun.txt
+ )
+ set(comment "Performing download step (hg clone) for '${name}'")
+ set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-hgclone.cmake)
+ list(APPEND depends ${stamp_dir}/${name}-hginfo.txt)
elseif(url)
get_filename_component(work_dir "${source_dir}" PATH)
+ get_property(hash TARGET ${name} PROPERTY _EP_URL_HASH)
+ if(hash AND NOT "${hash}" MATCHES "${_ep_hash_regex}")
+ message(FATAL_ERROR "URL_HASH is set to\n ${hash}\n"
+ "but must be ALGO=value where ALGO is\n ${_ep_hash_algos}\n"
+ "and value is a hex string.")
+ endif()
get_property(md5 TARGET ${name} PROPERTY _EP_URL_MD5)
+ if(md5 AND NOT "MD5=${md5}" MATCHES "${_ep_hash_regex}")
+ message(FATAL_ERROR "URL_MD5 is set to\n ${md5}\nbut must be a hex string.")
+ endif()
+ if(md5 AND NOT hash)
+ set(hash "MD5=${md5}")
+ endif()
set(repository "external project URL")
set(module "${url}")
- set(tag "${md5}")
+ set(tag "${hash}")
configure_file(
"${CMAKE_ROOT}/Modules/RepositoryInfo.txt.in"
"${stamp_dir}/${name}-urlinfo.txt"
@@ -1168,7 +1298,9 @@ function(_ep_add_download_command name)
else()
if("${url}" MATCHES "^[a-z]+://")
# TODO: Should download and extraction be different steps?
- string(REGEX MATCH "[^/\\?]*$" fname "${url}")
+ if("x${fname}" STREQUAL "x")
+ string(REGEX MATCH "[^/\\?]*$" fname "${url}")
+ endif()
if(NOT "${fname}" MATCHES "(\\.|=)(bz2|tar|tgz|tar\\.gz|zip)$")
string(REGEX MATCH "([^/\\?]+(\\.|=)(bz2|tar|tgz|tar\\.gz|zip))/.*$" match_result "${url}")
set(fname "${CMAKE_MATCH_1}")
@@ -1179,7 +1311,10 @@ function(_ep_add_download_command name)
string(REPLACE ";" "-" fname "${fname}")
set(file ${download_dir}/${fname})
get_property(timeout TARGET ${name} PROPERTY _EP_TIMEOUT)
- _ep_write_downloadfile_script("${stamp_dir}/download-${name}.cmake" "${url}" "${file}" "${timeout}" "${md5}")
+ get_property(tls_verify TARGET ${name} PROPERTY _EP_TLS_VERIFY)
+ get_property(tls_cainfo TARGET ${name} PROPERTY _EP_TLS_CAINFO)
+ _ep_write_downloadfile_script("${stamp_dir}/download-${name}.cmake"
+ "${url}" "${file}" "${timeout}" "${hash}" "${tls_verify}" "${tls_cainfo}")
set(cmd ${CMAKE_COMMAND} -P ${stamp_dir}/download-${name}.cmake
COMMAND)
set(comment "Performing download step (download, verify and extract) for '${name}'")
@@ -1187,7 +1322,7 @@ function(_ep_add_download_command name)
set(file "${url}")
set(comment "Performing download step (verify and extract) for '${name}'")
endif()
- _ep_write_verifyfile_script("${stamp_dir}/verify-${name}.cmake" "${file}" "${md5}")
+ _ep_write_verifyfile_script("${stamp_dir}/verify-${name}.cmake" "${file}" "${hash}")
list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/verify-${name}.cmake
COMMAND)
_ep_write_extractfile_script("${stamp_dir}/extract-${name}.cmake" "${name}" "${file}" "${source_dir}")
@@ -1196,7 +1331,7 @@ function(_ep_add_download_command name)
else()
_ep_is_dir_empty("${source_dir}" empty)
if(${empty})
- message(SEND_ERROR "error: no download info for '${name}' -- please specify existing/non-empty SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, GIT_REPOSITORY or DOWNLOAD_COMMAND")
+ message(SEND_ERROR "error: no download info for '${name}' -- please specify existing/non-empty SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, GIT_REPOSITORY, HG_REPOSITORY or DOWNLOAD_COMMAND")
endif()
endif()
@@ -1215,7 +1350,7 @@ function(_ep_add_download_command name)
DEPENDEES mkdir
${log}
)
-endfunction(_ep_add_download_command)
+endfunction()
function(_ep_add_update_command name)
@@ -1226,6 +1361,7 @@ function(_ep_add_update_command name)
get_property(cvs_repository TARGET ${name} PROPERTY _EP_CVS_REPOSITORY)
get_property(svn_repository TARGET ${name} PROPERTY _EP_SVN_REPOSITORY)
get_property(git_repository TARGET ${name} PROPERTY _EP_GIT_REPOSITORY)
+ get_property(hg_repository TARGET ${name} PROPERTY _EP_HG_REPOSITORY )
set(work_dir)
set(comment)
@@ -1280,6 +1416,27 @@ function(_ep_add_update_command name)
COMMAND ${GIT_EXECUTABLE} submodule update --recursive
)
set(always 1)
+ elseif(hg_repository)
+ if(NOT HG_EXECUTABLE)
+ message(FATAL_ERROR "error: could not find hg for pull of ${name}")
+ endif()
+ set(work_dir ${source_dir})
+ set(comment "Performing update step (hg pull) for '${name}'")
+ get_property(hg_tag TARGET ${name} PROPERTY _EP_HG_TAG)
+ if(NOT hg_tag)
+ set(hg_tag "tip")
+ endif()
+ if("${HG_VERSION_STRING}" STREQUAL "2.1")
+ message(WARNING "Mercurial 2.1 does not distinguish an empty pull from a failed pull:
+ http://mercurial.selenic.com/wiki/UpgradeNotes#A2.1.1:_revert_pull_return_code_change.2C_compile_issue_on_OS_X
+ http://thread.gmane.org/gmane.comp.version-control.mercurial.devel/47656
+Update to Mercurial >= 2.1.1.
+")
+ endif()
+ set(cmd ${HG_EXECUTABLE} pull
+ COMMAND ${HG_EXECUTABLE} update ${hg_tag}
+ )
+ set(always 1)
endif()
get_property(log TARGET ${name} PROPERTY _EP_LOG_UPDATE)
@@ -1297,7 +1454,7 @@ function(_ep_add_update_command name)
DEPENDEES download
${log}
)
-endfunction(_ep_add_update_command)
+endfunction()
function(_ep_add_patch_command name)
@@ -1317,7 +1474,7 @@ function(_ep_add_patch_command name)
WORKING_DIRECTORY ${work_dir}
DEPENDEES download
)
-endfunction(_ep_add_patch_command)
+endfunction()
# TODO: Make sure external projects use the proper compiler
@@ -1392,7 +1549,7 @@ function(_ep_add_configure_command name)
DEPENDS ${file_deps}
${log}
)
-endfunction(_ep_add_configure_command)
+endfunction()
function(_ep_add_build_command name)
@@ -1418,7 +1575,7 @@ function(_ep_add_build_command name)
DEPENDEES configure
${log}
)
-endfunction(_ep_add_build_command)
+endfunction()
function(_ep_add_install_command name)
@@ -1444,7 +1601,7 @@ function(_ep_add_install_command name)
DEPENDEES build
${log}
)
-endfunction(_ep_add_install_command)
+endfunction()
function(_ep_add_test_command name)
@@ -1484,7 +1641,7 @@ function(_ep_add_test_command name)
${log}
)
endif()
-endfunction(_ep_add_test_command)
+endfunction()
function(ExternalProject_Add name)
@@ -1550,4 +1707,4 @@ function(ExternalProject_Add name)
# on install.
#
_ep_add_test_command(${name})
-endfunction(ExternalProject_Add)
+endfunction()
diff --git a/Modules/FLTKCompatibility.cmake b/Modules/FLTKCompatibility.cmake
index 6b6f9607b..58c52da34 100644
--- a/Modules/FLTKCompatibility.cmake
+++ b/Modules/FLTKCompatibility.cmake
@@ -12,4 +12,4 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(CheckIncludeFile)
+include(CheckIncludeFile)
diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake
index a5b94d199..41bce1e85 100644
--- a/Modules/FeatureSummary.cmake
+++ b/Modules/FeatureSummary.cmake
@@ -87,7 +87,7 @@
# Use this macro to set up information about the named package, which can
# then be displayed via FEATURE_SUMMARY().
# This can be done either directly in the Find-module or in the project
-# which uses the module after the FIND_PACKAGE() call.
+# which uses the module after the find_package() call.
# The features for which information can be set are added automatically by the
# find_package() command.
#
@@ -151,7 +151,7 @@
# Use this macro to set up information about the named package, which can
# then be displayed via FEATURE_SUMMARY().
# This can be done either directly in the Find-module or in the project
-# which uses the module after the FIND_PACKAGE() call.
+# which uses the module after the find_package() call.
# The features for which information can be set are added automatically by the
# find_package() command.
#
@@ -177,177 +177,177 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(CMakeParseArguments)
+include(CMakeParseArguments)
-FUNCTION(ADD_FEATURE_INFO _name _enabled _desc)
- IF (${_enabled})
- SET_PROPERTY(GLOBAL APPEND PROPERTY ENABLED_FEATURES "${_name}")
- ELSE ()
- SET_PROPERTY(GLOBAL APPEND PROPERTY DISABLED_FEATURES "${_name}")
- ENDIF ()
+function(ADD_FEATURE_INFO _name _enabled _desc)
+ if (${_enabled})
+ set_property(GLOBAL APPEND PROPERTY ENABLED_FEATURES "${_name}")
+ else ()
+ set_property(GLOBAL APPEND PROPERTY DISABLED_FEATURES "${_name}")
+ endif ()
- SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
-ENDFUNCTION(ADD_FEATURE_INFO)
+ set_property(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
+endfunction()
-FUNCTION(SET_PACKAGE_PROPERTIES _name _props)
- IF(NOT "${_props}" STREQUAL "PROPERTIES")
- MESSAGE(FATAL_ERROR "PROPERTIES keyword is missing in SET_PACKAGE_PROPERTIES() call.")
- ENDIF()
+function(SET_PACKAGE_PROPERTIES _name _props)
+ if(NOT "${_props}" STREQUAL "PROPERTIES")
+ message(FATAL_ERROR "PROPERTIES keyword is missing in SET_PACKAGE_PROPERTIES() call.")
+ endif()
- SET(options ) # none
- SET(oneValueArgs DESCRIPTION URL TYPE PURPOSE )
- SET(multiValueArgs ) # none
+ set(options ) # none
+ set(oneValueArgs DESCRIPTION URL TYPE PURPOSE )
+ set(multiValueArgs ) # none
CMAKE_PARSE_ARGUMENTS(_SPP "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
- IF(_SPP_UNPARSED_ARGUMENTS)
- MESSAGE(FATAL_ERROR "Unknown keywords given to SET_PACKAGE_PROPERTIES(): \"${_SPP_UNPARSED_ARGUMENTS}\"")
- ENDIF()
+ if(_SPP_UNPARSED_ARGUMENTS)
+ message(FATAL_ERROR "Unknown keywords given to SET_PACKAGE_PROPERTIES(): \"${_SPP_UNPARSED_ARGUMENTS}\"")
+ endif()
- IF(_SPP_DESCRIPTION)
- GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION)
- IF(_info AND NOT "${_info}" STREQUAL "${_SPP_DESCRIPTION}")
- MESSAGE(STATUS "Warning: Property DESCRIPTION for package ${_name} already set to \"${_info}\", overriding it with \"${_SPP_DESCRIPTION}\"")
- ENDIF()
+ if(_SPP_DESCRIPTION)
+ get_property(_info GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION)
+ if(_info AND NOT "${_info}" STREQUAL "${_SPP_DESCRIPTION}")
+ message(STATUS "Warning: Property DESCRIPTION for package ${_name} already set to \"${_info}\", overriding it with \"${_SPP_DESCRIPTION}\"")
+ endif()
- SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_SPP_DESCRIPTION}" )
- ENDIF()
+ set_property(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_SPP_DESCRIPTION}" )
+ endif()
- IF(_SPP_URL)
- GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_name}_URL)
- IF(_info AND NOT "${_info}" STREQUAL "${_SPP_URL}")
- MESSAGE(STATUS "Warning: Property URL already set to \"${_info}\", overriding it with \"${_SPP_URL}\"")
- ENDIF()
+ if(_SPP_URL)
+ get_property(_info GLOBAL PROPERTY _CMAKE_${_name}_URL)
+ if(_info AND NOT "${_info}" STREQUAL "${_SPP_URL}")
+ message(STATUS "Warning: Property URL already set to \"${_info}\", overriding it with \"${_SPP_URL}\"")
+ endif()
- SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_SPP_URL}" )
- ENDIF()
+ set_property(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_SPP_URL}" )
+ endif()
# handle the PURPOSE: use APPEND, since there can be multiple purposes for one package inside a project
- IF(_SPP_PURPOSE)
- SET_PROPERTY(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_SPP_PURPOSE}" )
- ENDIF()
+ if(_SPP_PURPOSE)
+ set_property(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_SPP_PURPOSE}" )
+ endif()
# handle the TYPE
- IF(NOT _SPP_TYPE)
- SET(_SPP_TYPE OPTIONAL)
- ENDIF()
+ if(NOT _SPP_TYPE)
+ set(_SPP_TYPE OPTIONAL)
+ endif()
# List the supported types, according to their priority
- SET(validTypes "RUNTIME" "OPTIONAL" "RECOMMENDED" "REQUIRED" )
- LIST(FIND validTypes ${_SPP_TYPE} _typeIndexInList)
- IF("${_typeIndexInList}" STREQUAL "-1" )
- MESSAGE(FATAL_ERROR "Bad package property type ${_SPP_TYPE} used in SET_PACKAGE_PROPERTIES(). "
+ set(validTypes "RUNTIME" "OPTIONAL" "RECOMMENDED" "REQUIRED" )
+ list(FIND validTypes ${_SPP_TYPE} _typeIndexInList)
+ if("${_typeIndexInList}" STREQUAL "-1" )
+ message(FATAL_ERROR "Bad package property type ${_SPP_TYPE} used in SET_PACKAGE_PROPERTIES(). "
"Valid types are OPTIONAL, RECOMMENDED, REQUIRED and RUNTIME." )
- ENDIF()
+ endif()
- GET_PROPERTY(_previousType GLOBAL PROPERTY _CMAKE_${_name}_TYPE)
- LIST(FIND validTypes "${_previousType}" _prevTypeIndexInList)
+ get_property(_previousType GLOBAL PROPERTY _CMAKE_${_name}_TYPE)
+ list(FIND validTypes "${_previousType}" _prevTypeIndexInList)
# make sure a previously set TYPE is not overridden with a lower new TYPE:
- IF("${_typeIndexInList}" GREATER "${_prevTypeIndexInList}")
- SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_TYPE "${_SPP_TYPE}" )
- ENDIF()
+ if("${_typeIndexInList}" GREATER "${_prevTypeIndexInList}")
+ set_property(GLOBAL PROPERTY _CMAKE_${_name}_TYPE "${_SPP_TYPE}" )
+ endif()
-ENDFUNCTION(SET_PACKAGE_PROPERTIES)
+endfunction()
-FUNCTION(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet)
+function(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet)
- SET(_type "ANY")
- IF("${_property}" MATCHES "REQUIRED_")
- SET(_type "REQUIRED")
- ELSEIF("${_property}" MATCHES "RECOMMENDED_")
- SET(_type "RECOMMENDED")
- ELSEIF("${_property}" MATCHES "RUNTIME_")
- SET(_type "RUNTIME")
- ELSEIF("${_property}" MATCHES "OPTIONAL_")
- SET(_type "OPTIONAL")
- ENDIF()
+ set(_type "ANY")
+ if("${_property}" MATCHES "REQUIRED_")
+ set(_type "REQUIRED")
+ elseif("${_property}" MATCHES "RECOMMENDED_")
+ set(_type "RECOMMENDED")
+ elseif("${_property}" MATCHES "RUNTIME_")
+ set(_type "RUNTIME")
+ elseif("${_property}" MATCHES "OPTIONAL_")
+ set(_type "OPTIONAL")
+ endif()
- IF("${_property}" MATCHES "PACKAGES_FOUND")
- SET(_property "PACKAGES_FOUND")
- ELSEIF("${_property}" MATCHES "PACKAGES_NOT_FOUND")
- SET(_property "PACKAGES_NOT_FOUND")
- ENDIF()
+ if("${_property}" MATCHES "PACKAGES_FOUND")
+ set(_property "PACKAGES_FOUND")
+ elseif("${_property}" MATCHES "PACKAGES_NOT_FOUND")
+ set(_property "PACKAGES_NOT_FOUND")
+ endif()
- SET(_currentFeatureText "")
- GET_PROPERTY(_EnabledFeatures GLOBAL PROPERTY ${_property})
+ set(_currentFeatureText "")
+ get_property(_EnabledFeatures GLOBAL PROPERTY ${_property})
- FOREACH(_currentFeature ${_EnabledFeatures})
+ foreach(_currentFeature ${_EnabledFeatures})
# does this package belong to the type we currently want to list ?
- GET_PROPERTY(_currentType GLOBAL PROPERTY _CMAKE_${_currentFeature}_TYPE)
- IF(NOT _currentType)
- SET(_currentType OPTIONAL)
- ENDIF()
+ get_property(_currentType GLOBAL PROPERTY _CMAKE_${_currentFeature}_TYPE)
+ if(NOT _currentType)
+ set(_currentType OPTIONAL)
+ endif()
- IF("${_type}" STREQUAL ANY OR "${_type}" STREQUAL "${_currentType}")
+ if("${_type}" STREQUAL ANY OR "${_type}" STREQUAL "${_currentType}")
# check whether the current feature/package should be in the output depending on whether it was QUIET or not
- SET(includeThisOne TRUE)
+ set(includeThisOne TRUE)
# skip QUIET packages, except if they are REQUIRED or INCLUDE_QUIET_PACKAGES has been set
- IF((NOT "${_currentType}" STREQUAL "REQUIRED") AND NOT _includeQuiet)
- GET_PROPERTY(_isQuiet GLOBAL PROPERTY _CMAKE_${_currentFeature}_QUIET)
- IF(_isQuiet)
- SET(includeThisOne FALSE)
- ENDIF()
- ENDIF()
+ if((NOT "${_currentType}" STREQUAL "REQUIRED") AND NOT _includeQuiet)
+ get_property(_isQuiet GLOBAL PROPERTY _CMAKE_${_currentFeature}_QUIET)
+ if(_isQuiet)
+ set(includeThisOne FALSE)
+ endif()
+ endif()
- IF(includeThisOne)
+ if(includeThisOne)
- SET(_currentFeatureText "${_currentFeatureText}\n * ${_currentFeature}")
- GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_REQUIRED_VERSION)
- IF(_info)
- SET(_currentFeatureText "${_currentFeatureText} (required version ${_info})")
- ENDIF(_info)
- GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION)
- IF(_info)
- SET(_currentFeatureText "${_currentFeatureText} , ${_info}")
- ENDIF(_info)
- GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL)
- IF(_info)
- SET(_currentFeatureText "${_currentFeatureText} , <${_info}>")
- ENDIF(_info)
+ set(_currentFeatureText "${_currentFeatureText}\n * ${_currentFeature}")
+ get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_REQUIRED_VERSION)
+ if(_info)
+ set(_currentFeatureText "${_currentFeatureText} (required version ${_info})")
+ endif()
+ get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION)
+ if(_info)
+ set(_currentFeatureText "${_currentFeatureText} , ${_info}")
+ endif()
+ get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL)
+ if(_info)
+ set(_currentFeatureText "${_currentFeatureText} , <${_info}>")
+ endif()
- GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE)
- FOREACH(_purpose ${_info})
- SET(_currentFeatureText "${_currentFeatureText}\n ${_purpose}")
- ENDFOREACH()
+ get_property(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE)
+ foreach(_purpose ${_info})
+ set(_currentFeatureText "${_currentFeatureText}\n ${_purpose}")
+ endforeach()
- ENDIF(includeThisOne)
+ endif()
- ENDIF("${_type}" STREQUAL ANY OR "${_type}" STREQUAL "${_currentType}")
+ endif()
- ENDFOREACH(_currentFeature)
- SET(${_var} "${_currentFeatureText}" PARENT_SCOPE)
-ENDFUNCTION(_FS_GET_FEATURE_SUMMARY)
+ endforeach()
+ set(${_var} "${_currentFeatureText}" PARENT_SCOPE)
+endfunction()
-FUNCTION(FEATURE_SUMMARY)
+function(FEATURE_SUMMARY)
# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
- SET(options APPEND INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
- SET(oneValueArgs FILENAME VAR DESCRIPTION WHAT)
- SET(multiValueArgs ) # none
+ set(options APPEND INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
+ set(oneValueArgs FILENAME VAR DESCRIPTION WHAT)
+ set(multiValueArgs ) # none
CMAKE_PARSE_ARGUMENTS(_FS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
- IF(_FS_UNPARSED_ARGUMENTS)
- MESSAGE(FATAL_ERROR "Unknown keywords given to FEATURE_SUMMARY(): \"${_FS_UNPARSED_ARGUMENTS}\"")
- ENDIF()
+ if(_FS_UNPARSED_ARGUMENTS)
+ message(FATAL_ERROR "Unknown keywords given to FEATURE_SUMMARY(): \"${_FS_UNPARSED_ARGUMENTS}\"")
+ endif()
- IF(NOT _FS_WHAT)
- MESSAGE(FATAL_ERROR "The call to FEATURE_SUMMARY() doesn't set the required WHAT argument.")
- ENDIF()
+ if(NOT _FS_WHAT)
+ message(FATAL_ERROR "The call to FEATURE_SUMMARY() doesn't set the required WHAT argument.")
+ endif()
- SET(validWhatParts "ENABLED_FEATURES"
+ set(validWhatParts "ENABLED_FEATURES"
"DISABLED_FEATURES"
"PACKAGES_FOUND"
"PACKAGES_NOT_FOUND"
@@ -360,17 +360,17 @@ FUNCTION(FEATURE_SUMMARY)
"RUNTIME_PACKAGES_FOUND"
"RUNTIME_PACKAGES_NOT_FOUND")
- LIST(FIND validWhatParts "${_FS_WHAT}" indexInList)
- IF(NOT "${indexInList}" STREQUAL "-1")
+ list(FIND validWhatParts "${_FS_WHAT}" indexInList)
+ if(NOT "${indexInList}" STREQUAL "-1")
_FS_GET_FEATURE_SUMMARY( ${_FS_WHAT} _featureSummary ${_FS_INCLUDE_QUIET_PACKAGES} )
- SET(_fullText "${_FS_DESCRIPTION}${_featureSummary}\n")
- IF (("${_FS_WHAT}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND") AND _featureSummary)
- SET(requiredPackagesNotFound TRUE)
- ENDIF()
+ set(_fullText "${_FS_DESCRIPTION}${_featureSummary}\n")
+ if (("${_FS_WHAT}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND") AND _featureSummary)
+ set(requiredPackagesNotFound TRUE)
+ endif()
- ELSEIF("${_FS_WHAT}" STREQUAL "ALL")
+ elseif("${_FS_WHAT}" STREQUAL "ALL")
- SET(allWhatParts "ENABLED_FEATURES"
+ set(allWhatParts "ENABLED_FEATURES"
"RUNTIME_PACKAGES_FOUND"
"OPTIONAL_PACKAGES_FOUND"
"RECOMMENDED_PACKAGES_FOUND"
@@ -383,84 +383,84 @@ FUNCTION(FEATURE_SUMMARY)
"REQUIRED_PACKAGES_NOT_FOUND"
)
- SET(title_ENABLED_FEATURES "The following features have been enabled:")
- SET(title_DISABLED_FEATURES "The following features have been disabled:")
- SET(title_OPTIONAL_PACKAGES_FOUND "The following OPTIONAL packages have been found:")
- SET(title_OPTIONAL_PACKAGES_NOT_FOUND "The following OPTIONAL packages have not been found:")
- SET(title_RECOMMENDED_PACKAGES_FOUND "The following RECOMMENDED packages have been found:")
- SET(title_RECOMMENDED_PACKAGES_NOT_FOUND "The following RECOMMENDED packages have not been found:")
- SET(title_REQUIRED_PACKAGES_FOUND "The following REQUIRED packages have been found:")
- SET(title_REQUIRED_PACKAGES_NOT_FOUND "The following REQUIRED packages have not been found:")
- SET(title_RUNTIME_PACKAGES_FOUND "The following RUNTIME packages have been found:")
- SET(title_RUNTIME_PACKAGES_NOT_FOUND "The following RUNTIME packages have not been found:")
-
- SET(_fullText "${_FS_DESCRIPTION}")
- FOREACH(part ${allWhatParts})
- SET(_tmp)
+ set(title_ENABLED_FEATURES "The following features have been enabled:")
+ set(title_DISABLED_FEATURES "The following features have been disabled:")
+ set(title_OPTIONAL_PACKAGES_FOUND "The following OPTIONAL packages have been found:")
+ set(title_OPTIONAL_PACKAGES_NOT_FOUND "The following OPTIONAL packages have not been found:")
+ set(title_RECOMMENDED_PACKAGES_FOUND "The following RECOMMENDED packages have been found:")
+ set(title_RECOMMENDED_PACKAGES_NOT_FOUND "The following RECOMMENDED packages have not been found:")
+ set(title_REQUIRED_PACKAGES_FOUND "The following REQUIRED packages have been found:")
+ set(title_REQUIRED_PACKAGES_NOT_FOUND "The following REQUIRED packages have not been found:")
+ set(title_RUNTIME_PACKAGES_FOUND "The following RUNTIME packages have been found:")
+ set(title_RUNTIME_PACKAGES_NOT_FOUND "The following RUNTIME packages have not been found:")
+
+ set(_fullText "${_FS_DESCRIPTION}")
+ foreach(part ${allWhatParts})
+ set(_tmp)
_FS_GET_FEATURE_SUMMARY( ${part} _tmp ${_FS_INCLUDE_QUIET_PACKAGES})
- IF(_tmp)
- SET(_fullText "${_fullText}\n-- ${title_${part}}\n${_tmp}\n")
- IF("${part}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND")
- SET(requiredPackagesNotFound TRUE)
- ENDIF()
- ENDIF()
- ENDFOREACH()
- ELSE()
- MESSAGE(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() is set to ${_FS_WHAT}, which is not a valid value.")
- ENDIF()
-
- IF(_FS_FILENAME)
- IF(_FS_APPEND)
- FILE(APPEND "${_FS_FILENAME}" "${_fullText}")
- ELSE(_FS_APPEND)
- FILE(WRITE "${_FS_FILENAME}" "${_fullText}")
- ENDIF()
-
- ELSE(_FS_FILENAME)
- IF(NOT _FS_VAR)
- MESSAGE(STATUS "${_fullText}")
- ENDIF()
- ENDIF()
-
- IF(_FS_VAR)
- SET(${_FS_VAR} "${_fullText}" PARENT_SCOPE)
- ENDIF()
-
- IF(requiredPackagesNotFound AND _FS_FATAL_ON_MISSING_REQUIRED_PACKAGES)
- MESSAGE(FATAL_ERROR "feature_summary() Error: REQUIRED package(s) are missing, aborting CMake run.")
- ENDIF()
-
-ENDFUNCTION(FEATURE_SUMMARY)
+ if(_tmp)
+ set(_fullText "${_fullText}\n-- ${title_${part}}\n${_tmp}\n")
+ if("${part}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND")
+ set(requiredPackagesNotFound TRUE)
+ endif()
+ endif()
+ endforeach()
+ else()
+ message(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() is set to ${_FS_WHAT}, which is not a valid value.")
+ endif()
+
+ if(_FS_FILENAME)
+ if(_FS_APPEND)
+ file(APPEND "${_FS_FILENAME}" "${_fullText}")
+ else()
+ file(WRITE "${_FS_FILENAME}" "${_fullText}")
+ endif()
+
+ else()
+ if(NOT _FS_VAR)
+ message(STATUS "${_fullText}")
+ endif()
+ endif()
+
+ if(_FS_VAR)
+ set(${_FS_VAR} "${_fullText}" PARENT_SCOPE)
+ endif()
+
+ if(requiredPackagesNotFound AND _FS_FATAL_ON_MISSING_REQUIRED_PACKAGES)
+ message(FATAL_ERROR "feature_summary() Error: REQUIRED package(s) are missing, aborting CMake run.")
+ endif()
+
+endfunction()
# The stuff below is only kept for compatibility
-FUNCTION(SET_PACKAGE_INFO _name _desc)
- SET(_url "${ARGV2}")
- SET(_purpose "${ARGV3}")
- SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
- IF(_url MATCHES ".+")
- SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_url}" )
- ENDIF()
- IF(_purpose MATCHES ".+")
- SET_PROPERTY(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_purpose}" )
- ENDIF()
-ENDFUNCTION(SET_PACKAGE_INFO)
+function(SET_PACKAGE_INFO _name _desc)
+ set(_url "${ARGV2}")
+ set(_purpose "${ARGV3}")
+ set_property(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
+ if(_url MATCHES ".+")
+ set_property(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_url}" )
+ endif()
+ if(_purpose MATCHES ".+")
+ set_property(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_purpose}" )
+ endif()
+endfunction()
-FUNCTION(SET_FEATURE_INFO)
+function(SET_FEATURE_INFO)
SET_PACKAGE_INFO(${ARGN})
-ENDFUNCTION(SET_FEATURE_INFO)
+endfunction()
-FUNCTION(PRINT_ENABLED_FEATURES)
+function(PRINT_ENABLED_FEATURES)
FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")
-ENDFUNCTION(PRINT_ENABLED_FEATURES)
+endfunction()
-FUNCTION(PRINT_DISABLED_FEATURES)
+function(PRINT_DISABLED_FEATURES)
FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:")
-ENDFUNCTION(PRINT_DISABLED_FEATURES)
+endfunction()
diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake
index 4a0b69303..60b0f56e6 100644
--- a/Modules/FindALSA.cmake
+++ b/Modules/FindALSA.cmake
@@ -40,7 +40,7 @@ if(ALSA_INCLUDE_DIR AND EXISTS "${ALSA_INCLUDE_DIR}/alsa/version.h")
unset(alsa_version_str)
endif()
-# handle the QUIETLY and REQUIRED arguments and set ALSA_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set ALSA_FOUND to TRUE if
# all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA
diff --git a/Modules/FindASPELL.cmake b/Modules/FindASPELL.cmake
index 713ab7e19..5b383c4d3 100644
--- a/Modules/FindASPELL.cmake
+++ b/Modules/FindASPELL.cmake
@@ -21,17 +21,17 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(ASPELL_INCLUDE_DIR aspell.h )
+find_path(ASPELL_INCLUDE_DIR aspell.h )
-FIND_PROGRAM(ASPELL_EXECUTABLE
+find_program(ASPELL_EXECUTABLE
NAMES aspell
)
-FIND_LIBRARY(ASPELL_LIBRARIES NAMES aspell aspell-15 libaspell-15 libaspell)
+find_library(ASPELL_LIBRARIES NAMES aspell aspell-15 libaspell-15 libaspell)
# handle the QUIETLY and REQUIRED arguments and set ASPELL_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ASPELL DEFAULT_MSG ASPELL_LIBRARIES ASPELL_INCLUDE_DIR ASPELL_EXECUTABLE)
-MARK_AS_ADVANCED(ASPELL_INCLUDE_DIR ASPELL_LIBRARIES ASPELL_EXECUTABLE)
+mark_as_advanced(ASPELL_INCLUDE_DIR ASPELL_LIBRARIES ASPELL_EXECUTABLE)
diff --git a/Modules/FindAVIFile.cmake b/Modules/FindAVIFile.cmake
index 8b5b05ae3..93fa40004 100644
--- a/Modules/FindAVIFile.cmake
+++ b/Modules/FindAVIFile.cmake
@@ -1,5 +1,5 @@
# - Locate AVIFILE library and include paths
-# AVIFILE (http://avifile.sourceforge.net/)is a set of libraries for
+# AVIFILE (http://avifile.sourceforge.net/)is a set of libraries for
# i386 machines
# to use various AVI codecs. Support is limited beyond Linux. Windows
# provides native AVI support, and so doesn't need this library.
@@ -22,27 +22,27 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF (UNIX)
+if (UNIX)
- FIND_PATH(AVIFILE_INCLUDE_DIR avifile.h
+ find_path(AVIFILE_INCLUDE_DIR avifile.h
/usr/local/avifile/include
/usr/local/include/avifile
)
- FIND_LIBRARY(AVIFILE_AVIPLAY_LIBRARY aviplay
+ find_library(AVIFILE_AVIPLAY_LIBRARY aviplay
/usr/local/avifile/lib
)
-ENDIF (UNIX)
+endif ()
# handle the QUIETLY and REQUIRED arguments and set AVIFILE_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(AVIFile DEFAULT_MSG AVIFILE_INCLUDE_DIR AVIFILE_AVIPLAY_LIBRARY)
-IF (AVIFILE_FOUND)
- SET(AVIFILE_LIBRARIES ${AVIFILE_AVIPLAY_LIBRARY})
- SET(AVIFILE_DEFINITIONS "")
-ENDIF()
+if (AVIFILE_FOUND)
+ set(AVIFILE_LIBRARIES ${AVIFILE_AVIPLAY_LIBRARY})
+ set(AVIFILE_DEFINITIONS "")
+endif()
-MARK_AS_ADVANCED(AVIFILE_INCLUDE_DIR AVIFILE_AVIPLAY_LIBRARY)
+mark_as_advanced(AVIFILE_INCLUDE_DIR AVIFILE_AVIPLAY_LIBRARY)
diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake
index 84ed3cab6..4758534d7 100644
--- a/Modules/FindArmadillo.cmake
+++ b/Modules/FindArmadillo.cmake
@@ -58,24 +58,25 @@ if(ARMADILLO_INCLUDE_DIR)
if(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp")
# Read and parse armdillo version header file for version number
- file(READ "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp" _armadillo_HEADER_CONTENTS)
+ file(STRINGS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp" _armadillo_HEADER_CONTENTS REGEX "#define ARMA_VERSION_[A-Z]+ ")
string(REGEX REPLACE ".*#define ARMA_VERSION_MAJOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MAJOR "${_armadillo_HEADER_CONTENTS}")
string(REGEX REPLACE ".*#define ARMA_VERSION_MINOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MINOR "${_armadillo_HEADER_CONTENTS}")
string(REGEX REPLACE ".*#define ARMA_VERSION_PATCH ([0-9]+).*" "\\1" ARMADILLO_VERSION_PATCH "${_armadillo_HEADER_CONTENTS}")
# WARNING: The number of spaces before the version name is not one.
- string(REGEX REPLACE ".*#define ARMA_VERSION_NAME\ +\"([0-9a-zA-Z\ _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}")
+ string(REGEX REPLACE ".*#define ARMA_VERSION_NAME +\"([0-9a-zA-Z _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}")
- endif(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp")
+ unset(_armadillo_HEADER_CONTENTS)
+ endif()
set(ARMADILLO_VERSION_STRING "${ARMADILLO_VERSION_MAJOR}.${ARMADILLO_VERSION_MINOR}.${ARMADILLO_VERSION_PATCH}")
-endif (ARMADILLO_INCLUDE_DIR)
+endif ()
#======================
# Checks 'REQUIRED', 'QUIET' and versions.
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(Armadillo
REQUIRED_VARS ARMADILLO_LIBRARY ARMADILLO_INCLUDE_DIR
VERSION_VAR ARMADILLO_VERSION_STRING)
@@ -84,7 +85,7 @@ find_package_handle_standard_args(Armadillo
if (ARMADILLO_FOUND)
set(ARMADILLO_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIR})
set(ARMADILLO_LIBRARIES ${ARMADILLO_LIBRARY})
-endif (ARMADILLO_FOUND)
+endif ()
# Hide internal variables
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index 7af336788..a0afd344c 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -47,46 +47,46 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(BISON_EXECUTABLE bison DOC "path to the bison executable")
-MARK_AS_ADVANCED(BISON_EXECUTABLE)
+find_program(BISON_EXECUTABLE bison DOC "path to the bison executable")
+mark_as_advanced(BISON_EXECUTABLE)
-IF(BISON_EXECUTABLE)
+if(BISON_EXECUTABLE)
# the bison commands should be executed with the C locale, otherwise
# the message (which are parsed) may be translated
- SET(_Bison_SAVED_LC_ALL "$ENV{LC_ALL}")
- SET(ENV{LC_ALL} C)
+ set(_Bison_SAVED_LC_ALL "$ENV{LC_ALL}")
+ set(ENV{LC_ALL} C)
- EXECUTE_PROCESS(COMMAND ${BISON_EXECUTABLE} --version
+ execute_process(COMMAND ${BISON_EXECUTABLE} --version
OUTPUT_VARIABLE BISON_version_output
ERROR_VARIABLE BISON_version_error
RESULT_VARIABLE BISON_version_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
- SET(ENV{LC_ALL} ${_Bison_SAVED_LC_ALL})
+ set(ENV{LC_ALL} ${_Bison_SAVED_LC_ALL})
- IF(NOT ${BISON_version_result} EQUAL 0)
- MESSAGE(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
- ELSE()
+ if(NOT ${BISON_version_result} EQUAL 0)
+ message(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
+ else()
# Bison++
- IF("${BISON_version_output}" MATCHES "^bison\\+\\+")
- STRING(REGEX REPLACE "^bison\\+\\+ Version ([^,]+).*" "\\1"
+ if("${BISON_version_output}" MATCHES "^bison\\+\\+")
+ string(REGEX REPLACE "^bison\\+\\+ Version ([^,]+).*" "\\1"
BISON_VERSION "${BISON_version_output}")
# GNU Bison
- ELSEIF("${BISON_version_output}" MATCHES "^bison[^+]")
- STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
+ elseif("${BISON_version_output}" MATCHES "^bison[^+]")
+ string(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
BISON_VERSION "${BISON_version_output}")
- ELSEIF("${BISON_version_output}" MATCHES "^GNU Bison ")
- STRING(REGEX REPLACE "^GNU Bison (version )?([^\n]+).*" "\\2"
+ elseif("${BISON_version_output}" MATCHES "^GNU Bison ")
+ string(REGEX REPLACE "^GNU Bison (version )?([^\n]+).*" "\\2"
BISON_VERSION "${BISON_version_output}")
- ENDIF()
- ENDIF()
+ endif()
+ endif()
# internal macro
- MACRO(BISON_TARGET_option_verbose Name BisonOutput filename)
- LIST(APPEND BISON_TARGET_cmdopt "--verbose")
- GET_FILENAME_COMPONENT(BISON_TARGET_output_path "${BisonOutput}" PATH)
- GET_FILENAME_COMPONENT(BISON_TARGET_output_name "${BisonOutput}" NAME_WE)
- ADD_CUSTOM_COMMAND(OUTPUT ${filename}
+ macro(BISON_TARGET_option_verbose Name BisonOutput filename)
+ list(APPEND BISON_TARGET_cmdopt "--verbose")
+ get_filename_component(BISON_TARGET_output_path "${BisonOutput}" PATH)
+ get_filename_component(BISON_TARGET_output_name "${BisonOutput}" NAME_WE)
+ add_custom_command(OUTPUT ${filename}
COMMAND ${CMAKE_COMMAND}
ARGS -E copy
"${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output"
@@ -95,58 +95,58 @@ IF(BISON_EXECUTABLE)
"${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output"
COMMENT "[BISON][${Name}] Copying bison verbose table to ${filename}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
- SET(BISON_${Name}_VERBOSE_FILE ${filename})
- LIST(APPEND BISON_TARGET_extraoutputs
+ set(BISON_${Name}_VERBOSE_FILE ${filename})
+ list(APPEND BISON_TARGET_extraoutputs
"${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output")
- ENDMACRO(BISON_TARGET_option_verbose)
+ endmacro()
# internal macro
- MACRO(BISON_TARGET_option_extraopts Options)
- SET(BISON_TARGET_extraopts "${Options}")
- SEPARATE_ARGUMENTS(BISON_TARGET_extraopts)
- LIST(APPEND BISON_TARGET_cmdopt ${BISON_TARGET_extraopts})
- ENDMACRO(BISON_TARGET_option_extraopts)
+ macro(BISON_TARGET_option_extraopts Options)
+ set(BISON_TARGET_extraopts "${Options}")
+ separate_arguments(BISON_TARGET_extraopts)
+ list(APPEND BISON_TARGET_cmdopt ${BISON_TARGET_extraopts})
+ endmacro()
#============================================================
# BISON_TARGET (public macro)
#============================================================
#
- MACRO(BISON_TARGET Name BisonInput BisonOutput)
- SET(BISON_TARGET_output_header "")
- SET(BISON_TARGET_cmdopt "")
- SET(BISON_TARGET_outputs "${BisonOutput}")
- IF(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
- MESSAGE(SEND_ERROR "Usage")
- ELSE()
+ macro(BISON_TARGET Name BisonInput BisonOutput)
+ set(BISON_TARGET_output_header "")
+ set(BISON_TARGET_cmdopt "")
+ set(BISON_TARGET_outputs "${BisonOutput}")
+ if(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
+ message(SEND_ERROR "Usage")
+ else()
# Parsing parameters
- IF(${ARGC} GREATER 5 OR ${ARGC} EQUAL 5)
- IF("${ARGV3}" STREQUAL "VERBOSE")
+ if(${ARGC} GREATER 5 OR ${ARGC} EQUAL 5)
+ if("${ARGV3}" STREQUAL "VERBOSE")
BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV4}")
- ENDIF()
- IF("${ARGV3}" STREQUAL "COMPILE_FLAGS")
+ endif()
+ if("${ARGV3}" STREQUAL "COMPILE_FLAGS")
BISON_TARGET_option_extraopts("${ARGV4}")
- ENDIF()
- ENDIF()
+ endif()
+ endif()
- IF(${ARGC} EQUAL 7)
- IF("${ARGV5}" STREQUAL "VERBOSE")
+ if(${ARGC} EQUAL 7)
+ if("${ARGV5}" STREQUAL "VERBOSE")
BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV6}")
- ENDIF()
+ endif()
- IF("${ARGV5}" STREQUAL "COMPILE_FLAGS")
+ if("${ARGV5}" STREQUAL "COMPILE_FLAGS")
BISON_TARGET_option_extraopts("${ARGV6}")
- ENDIF()
- ENDIF()
+ endif()
+ endif()
# Header's name generated by bison (see option -d)
- LIST(APPEND BISON_TARGET_cmdopt "-d")
- STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${ARGV2}")
- STRING(REPLACE "c" "h" _fileext ${_fileext})
- STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}"
+ list(APPEND BISON_TARGET_cmdopt "-d")
+ string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${ARGV2}")
+ string(REPLACE "c" "h" _fileext ${_fileext})
+ string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}"
BISON_${Name}_OUTPUT_HEADER "${ARGV2}")
- LIST(APPEND BISON_TARGET_outputs "${BISON_${Name}_OUTPUT_HEADER}")
+ list(APPEND BISON_TARGET_outputs "${BISON_${Name}_OUTPUT_HEADER}")
- ADD_CUSTOM_COMMAND(OUTPUT ${BISON_TARGET_outputs}
+ add_custom_command(OUTPUT ${BISON_TARGET_outputs}
${BISON_TARGET_extraoutputs}
COMMAND ${BISON_EXECUTABLE}
ARGS ${BISON_TARGET_cmdopt} -o ${ARGV2} ${ARGV1}
@@ -155,20 +155,20 @@ IF(BISON_EXECUTABLE)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
# define target variables
- SET(BISON_${Name}_DEFINED TRUE)
- SET(BISON_${Name}_INPUT ${ARGV1})
- SET(BISON_${Name}_OUTPUTS ${BISON_TARGET_outputs})
- SET(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt})
- SET(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}")
-
- ENDIF(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
- ENDMACRO(BISON_TARGET)
+ set(BISON_${Name}_DEFINED TRUE)
+ set(BISON_${Name}_INPUT ${ARGV1})
+ set(BISON_${Name}_OUTPUTS ${BISON_TARGET_outputs})
+ set(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt})
+ set(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}")
+
+ endif()
+ endmacro()
#
#============================================================
-ENDIF(BISON_EXECUTABLE)
+endif()
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE
VERSION_VAR BISON_VERSION)
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 1cf31c4a6..d9b3c618c 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -54,11 +54,11 @@ elseif( (_LANGUAGES_ MATCHES C) OR (_LANGUAGES_ MATCHES CXX) )
else()
if(BLAS_FIND_REQUIRED)
message(FATAL_ERROR "FindBLAS requires Fortran, C, or C++ to be enabled.")
- else(BLAS_FIND_REQUIRED)
+ else()
message(STATUS "Looking for BLAS... - NOT found (Unsupported languages)")
return()
- endif(BLAS_FIND_REQUIRED)
-endif( )
+ endif()
+endif()
macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
# This macro checks for the existence of the combination of fortran libraries
@@ -81,9 +81,9 @@ if (NOT _libdir)
if (WIN32)
set(_libdir ENV LIB)
elseif (APPLE)
- set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH)
+ set(_libdir ENV DYLD_LIBRARY_PATH)
else ()
- set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH)
+ set(_libdir ENV LD_LIBRARY_PATH)
endif ()
endif ()
@@ -94,18 +94,18 @@ foreach(_library ${_list})
if (BLA_STATIC)
if (WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
- endif ( WIN32 )
+ endif ()
if (APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
- else (APPLE)
+ else ()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
- endif (APPLE)
- else (BLA_STATIC)
+ endif ()
+ else ()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# for ubuntu's libblas3gf and liblapack3gf packages
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
endif ()
- endif (BLA_STATIC)
+ endif ()
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
PATHS ${_libdir}
@@ -113,8 +113,8 @@ foreach(_library ${_list})
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
- endif(_libraries_work)
-endforeach(_library ${_list})
+ endif()
+endforeach()
if(_libraries_work)
# Test this combination of libraries.
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_thread})
@@ -127,23 +127,23 @@ if(_libraries_work)
set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
-endif(_libraries_work)
+endif()
if(NOT _libraries_work)
set(${LIBRARIES} FALSE)
-endif(NOT _libraries_work)
+endif()
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
-endmacro(Check_Fortran_Libraries)
+endmacro()
set(BLAS_LINKER_FLAGS)
set(BLAS_LIBRARIES)
set(BLAS95_LIBRARIES)
if ($ENV{BLA_VENDOR} MATCHES ".+")
set(BLA_VENDOR $ENV{BLA_VENDOR})
-else ($ENV{BLA_VENDOR} MATCHES ".+")
+else ()
if(NOT BLA_VENDOR)
set(BLA_VENDOR "All")
- endif(NOT BLA_VENDOR)
-endif ($ENV{BLA_VENDOR} MATCHES ".+")
+ endif()
+endif ()
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
@@ -156,8 +156,8 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
"goto2"
""
)
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
@@ -170,8 +170,8 @@ if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
"f77blas;atlas"
""
)
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
@@ -184,8 +184,8 @@ if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
"sgemm;dgemm;blas"
""
)
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
# BLAS in Alpha CXML library?
if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
@@ -198,8 +198,8 @@ if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
"cxml"
""
)
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
# BLAS in Alpha DXML library? (now called CXML, see above)
if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
@@ -212,8 +212,8 @@ if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
"dxml"
""
)
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
# BLAS in Sun Performance library?
if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
@@ -228,9 +228,9 @@ if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
)
if(BLAS_LIBRARIES)
set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf")
- endif(BLAS_LIBRARIES)
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
+ endif()
+ endif()
+endif ()
# BLAS in SCSL library? (SGI/Cray Scientific Library)
if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
@@ -243,8 +243,8 @@ if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
"scsl"
""
)
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
# BLAS in SGIMATH library?
if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
@@ -257,8 +257,8 @@ if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
"complib.sgimath"
""
)
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
@@ -271,8 +271,8 @@ if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
"essl;blas"
""
)
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
#BLAS in acml library?
if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
@@ -321,7 +321,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" )
set( _ACML_COMPILER32 "nag32" )
set( _ACML_COMPILER64 "nag64" )
- else() #if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
+ else()
set( _ACML_COMPILER32 "gfortran32" )
set( _ACML_COMPILER64 "gfortran64" )
endif()
@@ -330,7 +330,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
set(_ACML_MP_LIB_DIRS
"${_ACML_ROOT}/${_ACML_COMPILER32}_mp${_ACML_PATH_SUFFIX}/lib"
"${_ACML_ROOT}/${_ACML_COMPILER64}_mp${_ACML_PATH_SUFFIX}/lib" )
- else() #if( _BLAS_VENDOR STREQUAL "ACML" )
+ else()
set(_ACML_LIB_DIRS
"${_ACML_ROOT}/${_ACML_COMPILER32}${_ACML_PATH_SUFFIX}/lib"
"${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" )
@@ -364,7 +364,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
break()
endif()
endforeach()
- else() #if( _BLAS_VENDOR STREQUAL "ACML" )
+ else()
foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} )
check_fortran_libraries (
BLAS_LIBRARIES
@@ -388,7 +388,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
"acml;acml_mv"
""
)
- endif(NOT BLAS_LIBRARIES)
+ endif()
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
@@ -398,7 +398,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
"acml_mp;acml_mv"
""
)
- endif(NOT BLAS_LIBRARIES)
+ endif()
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
@@ -408,7 +408,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
"acml;acml_mv;CALBLAS"
""
)
- endif(NOT BLAS_LIBRARIES)
+ endif()
endif () # ACML
# Apple BLAS library?
@@ -422,8 +422,8 @@ if(NOT BLAS_LIBRARIES)
"Accelerate"
""
)
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
if ( NOT BLAS_LIBRARIES )
@@ -435,8 +435,8 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
"vecLib"
""
)
- endif ( NOT BLAS_LIBRARIES )
-endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
+ endif ()
+endif ()
# Generic BLAS library?
if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
@@ -448,8 +448,8 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
"blas"
""
)
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
#BLAS in intel mkl 10 library? (em64t 64bit)
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
@@ -459,9 +459,9 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
find_package(Threads)
- else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
+ else()
find_package(Threads REQUIRED)
- endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
+ endif()
set(BLAS_SEARCH_LIBS "")
@@ -471,7 +471,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
if (WIN32)
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95 mkl_intel_c mkl_intel_thread mkl_core libguide40")
- else (WIN32)
+ else ()
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95 mkl_intel mkl_intel_thread mkl_core guide")
@@ -490,18 +490,18 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
"mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core iomp5")
endif ()
endif ()
- endif (WIN32)
+ endif ()
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_intel_lp64 mkl_sequential mkl_core")
endif ()
- else (BLA_F95)
+ else ()
set(BLAS_mkl_SEARCH_SYMBOL sgemm)
set(_LIBRARIES BLAS_LIBRARIES)
if (WIN32)
list(APPEND BLAS_SEARCH_LIBS
"mkl_c_dll mkl_intel_thread_dll mkl_core_dll libguide40")
- else (WIN32)
+ else ()
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel mkl_intel_thread mkl_core guide")
@@ -531,12 +531,12 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl_em64t")
endif ()
- endif (WIN32)
+ endif ()
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_sequential mkl_core")
endif ()
- endif (BLA_F95)
+ endif ()
foreach (IT ${BLAS_SEARCH_LIBS})
string(REPLACE " " ";" SEARCH_LIBS ${IT})
@@ -553,54 +553,54 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
endif ()
endforeach ()
- endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
-endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
+ endif ()
+endif ()
if(BLA_F95)
if(BLAS95_LIBRARIES)
set(BLAS95_FOUND TRUE)
- else(BLAS95_LIBRARIES)
+ else()
set(BLAS95_FOUND FALSE)
- endif(BLAS95_LIBRARIES)
+ endif()
if(NOT BLAS_FIND_QUIETLY)
if(BLAS95_FOUND)
message(STATUS "A library with BLAS95 API found.")
- else(BLAS95_FOUND)
+ else()
if(BLAS_FIND_REQUIRED)
message(FATAL_ERROR
"A required library with BLAS95 API not found. Please specify library location.")
- else(BLAS_FIND_REQUIRED)
+ else()
message(STATUS
"A library with BLAS95 API not found. Please specify library location.")
- endif(BLAS_FIND_REQUIRED)
- endif(BLAS95_FOUND)
- endif(NOT BLAS_FIND_QUIETLY)
+ endif()
+ endif()
+ endif()
set(BLAS_FOUND TRUE)
set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
-else(BLA_F95)
+else()
if(BLAS_LIBRARIES)
set(BLAS_FOUND TRUE)
- else(BLAS_LIBRARIES)
+ else()
set(BLAS_FOUND FALSE)
- endif(BLAS_LIBRARIES)
+ endif()
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_FOUND)
message(STATUS "A library with BLAS API found.")
- else(BLAS_FOUND)
+ else()
if(BLAS_FIND_REQUIRED)
message(FATAL_ERROR
"A required library with BLAS API not found. Please specify library location."
)
- else(BLAS_FIND_REQUIRED)
+ else()
message(STATUS
"A library with BLAS API not found. Please specify library location."
)
- endif(BLAS_FIND_REQUIRED)
- endif(BLAS_FOUND)
- endif(NOT BLAS_FIND_QUIETLY)
-endif(BLA_F95)
+ endif()
+ endif()
+ endif()
+endif()
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index ce7f2555d..8b9d235d1 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -22,35 +22,35 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(_BZIP2_PATHS PATHS
+set(_BZIP2_PATHS PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Bzip2;InstallPath]"
)
-FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h ${_BZIP2_PATHS} PATH_SUFFIXES include)
+find_path(BZIP2_INCLUDE_DIR bzlib.h ${_BZIP2_PATHS} PATH_SUFFIXES include)
-IF (NOT BZIP2_LIBRARIES)
- FIND_LIBRARY(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 ${_BZIP2_PATHS} PATH_SUFFIXES lib)
- FIND_LIBRARY(BZIP2_LIBRARY_DEBUG NAMES bzip2d ${_BZIP2_PATHS} PATH_SUFFIXES lib)
+if (NOT BZIP2_LIBRARIES)
+ find_library(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 ${_BZIP2_PATHS} PATH_SUFFIXES lib)
+ find_library(BZIP2_LIBRARY_DEBUG NAMES bzip2d ${_BZIP2_PATHS} PATH_SUFFIXES lib)
- INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+ include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
SELECT_LIBRARY_CONFIGURATIONS(BZIP2)
-ENDIF (NOT BZIP2_LIBRARIES)
+endif ()
-IF (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
- FILE(STRINGS "${BZIP2_INCLUDE_DIR}/bzlib.h" BZLIB_H REGEX "bzip2/libbzip2 version [0-9]+\\.[^ ]+ of [0-9]+ ")
- STRING(REGEX REPLACE ".* bzip2/libbzip2 version ([0-9]+\\.[^ ]+) of [0-9]+ .*" "\\1" BZIP2_VERSION_STRING "${BZLIB_H}")
-ENDIF (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
+if (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
+ file(STRINGS "${BZIP2_INCLUDE_DIR}/bzlib.h" BZLIB_H REGEX "bzip2/libbzip2 version [0-9]+\\.[^ ]+ of [0-9]+ ")
+ string(REGEX REPLACE ".* bzip2/libbzip2 version ([0-9]+\\.[^ ]+) of [0-9]+ .*" "\\1" BZIP2_VERSION_STRING "${BZLIB_H}")
+endif ()
-# handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2
REQUIRED_VARS BZIP2_LIBRARIES BZIP2_INCLUDE_DIR
VERSION_VAR BZIP2_VERSION_STRING)
-IF (BZIP2_FOUND)
- INCLUDE(CheckLibraryExists)
+if (BZIP2_FOUND)
+ include(CheckLibraryExists)
CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
-ENDIF (BZIP2_FOUND)
+endif ()
-MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR)
+mark_as_advanced(BZIP2_INCLUDE_DIR)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index ad6b1598d..17aba1b22 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -48,7 +48,7 @@
# libraries with a few exceptions (Boost.Python is one).
#
# Please see the section below near Boost_LIB_DIAGNOSTIC_DEFINITIONS for
-# more details. Adding a TARGET_LINK_LIBRARIES() as shown in the example
+# more details. Adding a target_link_libraries() as shown in the example
# above appears to cause VS to link dynamically if Boost_USE_STATIC_LIBS
# gets set to OFF. It is suggested you avoid automatic linking since it
# will make your application less portable.
@@ -361,16 +361,16 @@ macro(_Boost_ADJUST_LIB_VARS basename)
set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory")
set(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found")
- endif(Boost_${basename}_LIBRARY)
+ endif()
- endif(Boost_INCLUDE_DIR )
+ endif()
# Make variables changeble to the advanced user
mark_as_advanced(
Boost_${basename}_LIBRARY
Boost_${basename}_LIBRARY_RELEASE
Boost_${basename}_LIBRARY_DEBUG
)
-endmacro(_Boost_ADJUST_LIB_VARS)
+endmacro()
#-------------------------------------------------------------------------------
@@ -479,21 +479,21 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
# In Boost 1.36.0 and newer, the mangled compiler name used
# on Mac OS X/Darwin is "xgcc".
set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
- else(${Boost_MINOR_VERSION} GREATER 35)
+ else()
# In Boost <= 1.35.0, there is no mangled compiler name for
# the Mac OS X/Darwin version of GCC.
set(_boost_COMPILER "")
- endif(${Boost_MINOR_VERSION} GREATER 35)
- else(Boost_MINOR_VERSION)
+ endif()
+ else()
# We don't know the Boost version, so assume it's
# pre-1.36.0.
set(_boost_COMPILER "")
- endif(Boost_MINOR_VERSION)
+ endif()
else()
set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
endif()
endif()
- endif (CMAKE_COMPILER_IS_GNUCXX)
+ endif ()
else()
# TODO at least Boost_DEBUG here?
set(_boost_COMPILER "")
@@ -525,7 +525,7 @@ if(Boost_FIND_VERSION_EXACT)
set(_boost_TEST_VERSIONS
"${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}"
"${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
-else(Boost_FIND_VERSION_EXACT)
+else()
# The user has not requested an exact version. Among known
# versions, find those that are acceptable to the user request.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
@@ -549,12 +549,12 @@ else(Boost_FIND_VERSION_EXACT)
# the patch level dropped.
list(APPEND _boost_TEST_VERSIONS "${version}")
endif()
- endforeach(version)
- else(Boost_FIND_VERSION)
+ endforeach()
+ else()
# Any version is acceptable.
set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}")
- endif(Boost_FIND_VERSION)
-endif(Boost_FIND_VERSION_EXACT)
+ endif()
+endif()
# The reason that we failed to find Boost. This will be set to a
# user-friendly message when we fail to find some necessary piece of
@@ -597,7 +597,7 @@ set(Boost_ERROR_REASON)
# for linking.
set(Boost_LIB_DIAGNOSTIC_DEFINITIONS
"-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define")
- endif(WIN32)
+ endif()
set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM
C:/boost/include
@@ -671,7 +671,7 @@ set(Boost_ERROR_REASON)
file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR)
set(_boost_INCLUDE_SEARCH_DIRS
${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS})
- endif( BOOST_INCLUDEDIR )
+ endif()
# ------------------------------------------------------------------------
# Search for Boost include DIR
@@ -699,7 +699,7 @@ set(Boost_ERROR_REASON)
list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}")
list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}")
- endforeach(_boost_VER)
+ endforeach()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
@@ -717,7 +717,7 @@ set(Boost_ERROR_REASON)
PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
${_boost_FIND_OPTIONS}
)
- endif( NOT Boost_INCLUDE_DIR )
+ endif()
# ------------------------------------------------------------------------
# Extract version information from version.hpp
@@ -729,7 +729,7 @@ set(Boost_ERROR_REASON)
#
set(BOOST_VERSION 0)
set(BOOST_LIB_VERSION "")
- file(READ "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS)
+ file(STRINGS "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS REGEX "#define BOOST_(LIB_)?VERSION ")
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp")
@@ -737,6 +737,7 @@ set(Boost_ERROR_REASON)
string(REGEX REPLACE ".*#define BOOST_VERSION ([0-9]+).*" "\\1" Boost_VERSION "${_boost_VERSION_HPP_CONTENTS}")
string(REGEX REPLACE ".*#define BOOST_LIB_VERSION \"([0-9_]+)\".*" "\\1" Boost_LIB_VERSION "${_boost_VERSION_HPP_CONTENTS}")
+ unset(_boost_VERSION_HPP_CONTENTS)
set(Boost_LIB_VERSION ${Boost_LIB_VERSION} CACHE INTERNAL "The library version string for boost libraries")
set(Boost_VERSION ${Boost_VERSION} CACHE INTERNAL "The version number for boost libraries")
@@ -748,16 +749,16 @@ set(Boost_ERROR_REASON)
set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
- endif(NOT "${Boost_VERSION}" STREQUAL "0")
+ endif()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"version.hpp reveals boost "
"${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
endif()
- else(Boost_INCLUDE_DIR)
+ else()
set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.")
- endif(Boost_INCLUDE_DIR)
+ endif()
# ------------------------------------------------------------------------
# Suffix initialization and compiler suffix detection.
@@ -1007,7 +1008,7 @@ set(Boost_ERROR_REASON)
_Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
- endforeach(COMPONENT)
+ endforeach()
# Restore the original find library ordering
if( Boost_USE_STATIC_LIBS )
@@ -1044,9 +1045,9 @@ set(Boost_ERROR_REASON)
if( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" )
set( Boost_FOUND FALSE )
set(_Boost_VERSION_AGE "old")
- endif( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" )
- endif( Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" )
- endif( Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" )
+ endif()
+ endif()
+ endif()
if (NOT Boost_FOUND)
_Boost_MARK_COMPONENTS_FOUND(OFF)
@@ -1061,7 +1062,7 @@ set(Boost_ERROR_REASON)
# If the user didn't specify a patchlevel, it's 0.
if (NOT Boost_FIND_VERSION_PATCH)
set(Boost_FIND_VERSION_PATCH 0)
- endif (NOT Boost_FIND_VERSION_PATCH)
+ endif ()
# We'll set Boost_FOUND true again if we have an exact version match.
set(Boost_FOUND FALSE)
@@ -1071,10 +1072,10 @@ set(Boost_ERROR_REASON)
if(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" )
set( Boost_FOUND TRUE )
_Boost_MARK_COMPONENTS_FOUND(ON)
- endif(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" )
- endif( Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" )
- endif( Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" )
- endif (Boost_FOUND AND Boost_FIND_VERSION_EXACT)
+ endif()
+ endif()
+ endif()
+ endif ()
if(NOT Boost_FOUND)
# State that we found a version of Boost that is too new or too old.
@@ -1083,12 +1084,12 @@ set(Boost_ERROR_REASON)
if (Boost_FIND_VERSION_PATCH)
set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}")
- endif (Boost_FIND_VERSION_PATCH)
+ endif ()
if (NOT Boost_FIND_VERSION_EXACT)
set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)")
- endif (NOT Boost_FIND_VERSION_EXACT)
+ endif ()
set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.")
- endif (NOT Boost_FOUND)
+ endif ()
# Always check for missing components
set(_boost_CHECKED_COMPONENT FALSE)
@@ -1101,7 +1102,7 @@ set(Boost_ERROR_REASON)
list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT})
set( Boost_FOUND FALSE)
endif()
- endforeach(COMPONENT)
+ endforeach()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}")
@@ -1115,18 +1116,18 @@ set(Boost_ERROR_REASON)
foreach(COMPONENT ${_Boost_MISSING_COMPONENTS})
set(Boost_ERROR_REASON
"${Boost_ERROR_REASON} boost_${COMPONENT}\n")
- endforeach(COMPONENT)
+ endforeach()
list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED)
list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS)
if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
- else (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
+ else ()
set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
- endif (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
- endif (_Boost_MISSING_COMPONENTS)
+ endif ()
+ endif ()
if( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
# Compatibility Code for backwards compatibility with CMake
@@ -1160,11 +1161,11 @@ set(Boost_ERROR_REASON)
set(Boost_LIBRARY_DIRS ${_boost_LIB_DIR} CACHE FILEPATH "Boost library directory")
endif()
- endif( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
+ endif()
- else(Boost_INCLUDE_DIR)
+ else()
set( Boost_FOUND FALSE)
- endif(Boost_INCLUDE_DIR)
+ endif()
# ------------------------------------------------------------------------
# Notification to end user about what was found
@@ -1176,16 +1177,16 @@ set(Boost_ERROR_REASON)
if(Boost_FIND_COMPONENTS)
message(STATUS "Found the following Boost libraries:")
endif()
- endif(NOT Boost_FIND_QUIETLY)
+ endif()
foreach( COMPONENT ${Boost_FIND_COMPONENTS} )
string( TOUPPER ${COMPONENT} UPPERCOMPONENT )
if( Boost_${UPPERCOMPONENT}_FOUND )
if(NOT Boost_FIND_QUIETLY)
message (STATUS " ${COMPONENT}")
- endif(NOT Boost_FIND_QUIETLY)
+ endif()
set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY})
- endif( Boost_${UPPERCOMPONENT}_FOUND )
- endforeach(COMPONENT)
+ endif()
+ endforeach()
else()
if(Boost_FIND_REQUIRED)
message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}")
@@ -1201,7 +1202,7 @@ set(Boost_ERROR_REASON)
message(STATUS "Could NOT find Boost")
endif()
endif()
- endif(Boost_FIND_REQUIRED)
+ endif()
endif()
# show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view
diff --git a/Modules/FindBullet.cmake b/Modules/FindBullet.cmake
index c96755fa4..1c4a9dec4 100644
--- a/Modules/FindBullet.cmake
+++ b/Modules/FindBullet.cmake
@@ -29,7 +29,7 @@
macro(_FIND_BULLET_LIBRARY _var)
find_library(${_var}
- NAMES
+ NAMES
${ARGN}
HINTS
${BULLET_ROOT}
@@ -68,7 +68,7 @@ _FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY BulletSoftBody)
_FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY_DEBUG BulletSoftBody_Debug BulletSoftBody_d)
-# handle the QUIETLY and REQUIRED arguments and set BULLET_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set BULLET_FOUND to TRUE if
# all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Bullet DEFAULT_MSG
diff --git a/Modules/FindCABLE.cmake b/Modules/FindCABLE.cmake
index 678fb07ca..3e2d5d3bb 100644
--- a/Modules/FindCABLE.cmake
+++ b/Modules/FindCABLE.cmake
@@ -23,12 +23,12 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF(NOT CABLE)
- FIND_PATH(CABLE_BUILD_DIR cableVersion.h)
-ENDIF(NOT CABLE)
+if(NOT CABLE)
+ find_path(CABLE_BUILD_DIR cableVersion.h)
+endif()
-IF(CABLE_BUILD_DIR)
- LOAD_CACHE(${CABLE_BUILD_DIR}
+if(CABLE_BUILD_DIR)
+ load_cache(${CABLE_BUILD_DIR}
EXCLUDE
BUILD_SHARED_LIBS
LIBRARY_OUTPUT_PATH
@@ -39,43 +39,43 @@ IF(CABLE_BUILD_DIR)
CABLE_LIBRARY_PATH
CABLE_EXECUTABLE_PATH)
- IF(CABLE_LIBRARY_PATH)
- FIND_LIBRARY(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
+ if(CABLE_LIBRARY_PATH)
+ find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
${CABLE_LIBRARY_PATH}
${CABLE_LIBRARY_PATH}/*)
- ELSE(CABLE_LIBRARY_PATH)
- FIND_LIBRARY(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
+ else()
+ find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
${CABLE_BINARY_DIR}/CableTclFacility
${CABLE_BINARY_DIR}/CableTclFacility/*)
- ENDIF(CABLE_LIBRARY_PATH)
+ endif()
- IF(CABLE_EXECUTABLE_PATH)
- FIND_PROGRAM(CABLE NAMES cable PATHS
+ if(CABLE_EXECUTABLE_PATH)
+ find_program(CABLE NAMES cable PATHS
${CABLE_EXECUTABLE_PATH}
${CABLE_EXECUTABLE_PATH}/*)
- ELSE(CABLE_EXECUTABLE_PATH)
- FIND_PROGRAM(CABLE NAMES cable PATHS
+ else()
+ find_program(CABLE NAMES cable PATHS
${CABLE_BINARY_DIR}/Executables
${CABLE_BINARY_DIR}/Executables/*)
- ENDIF(CABLE_EXECUTABLE_PATH)
+ endif()
- FIND_PATH(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
+ find_path(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
${CABLE_SOURCE_DIR})
-ELSE(CABLE_BUILD_DIR)
+else()
# Find the cable executable in the path.
- FIND_PROGRAM(CABLE NAMES cable)
+ find_program(CABLE NAMES cable)
# Get the path where the executable sits, but without the executable
# name on it.
- GET_FILENAME_COMPONENT(CABLE_ROOT_BIN ${CABLE} PATH)
+ get_filename_component(CABLE_ROOT_BIN ${CABLE} PATH)
# Find the cable include directory in a path relative to the cable
# executable.
- FIND_PATH(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
+ find_path(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
${CABLE_ROOT_BIN}/../include/Cable)
# Find the WrapTclFacility library in a path relative to the cable
# executable.
- FIND_LIBRARY(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
+ find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
${CABLE_ROOT_BIN}/../lib/Cable)
-ENDIF(CABLE_BUILD_DIR)
+endif()
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 56a92c199..5a834b128 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -68,6 +68,13 @@
# CUDA_HOST_COMPILATION_CPP (Default ON)
# -- Set to OFF for C compilation of host code.
#
+# CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER, $(VCInstallDir)/bin for VS)
+# -- Set the host compiler to be used by nvcc. Ignored if -ccbin or
+# --compiler-bindir is already present in the CUDA_NVCC_FLAGS or
+# CUDA_NVCC_FLAGS_<CONFIG> variables. For Visual Studio targets
+# $(VCInstallDir)/bin is a special value that expands out to the path when
+# the command is run from withing VS.
+#
# CUDA_NVCC_FLAGS
# CUDA_NVCC_FLAGS_<CONFIG>
# -- Additional NVCC command line arguments. NOTE: multiple arguments must be
@@ -291,7 +298,7 @@ macro(CUDA_FIND_HELPER_FILE _name _extension)
endif()
# Set this variable as internal, so the user isn't bugged with it.
set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE)
-endmacro(CUDA_FIND_HELPER_FILE)
+endmacro()
#####################################################################
## CUDA_INCLUDE_NVCC_DEPENDENCIES
@@ -339,12 +346,12 @@ macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file)
#message("file ${f} not found")
set(CUDA_NVCC_DEPEND_REGENERATE TRUE)
endif()
- endforeach(f)
- else(CUDA_NVCC_DEPEND)
+ endforeach()
+ else()
#message("CUDA_NVCC_DEPEND false")
# No dependencies, so regenerate the file.
set(CUDA_NVCC_DEPEND_REGENERATE TRUE)
- endif(CUDA_NVCC_DEPEND)
+ endif()
#message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}")
# No incoming dependencies, so we need to generate them. Make the
@@ -354,9 +361,9 @@ macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file)
set(CUDA_NVCC_DEPEND ${dependency_file})
#message("Generating an empty dependency_file: ${dependency_file}")
file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n")
- endif(CUDA_NVCC_DEPEND_REGENERATE)
+ endif()
-endmacro(CUDA_INCLUDE_NVCC_DEPENDENCIES)
+endmacro()
###############################################################################
###############################################################################
@@ -390,6 +397,12 @@ option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON)
# Extra user settable flags
set(CUDA_NVCC_FLAGS "" CACHE STRING "Semi-colon delimit multiple arguments.")
+if(CMAKE_GENERATOR MATCHES "Visual Studio")
+ set(CUDA_HOST_COMPILER "$(VCInstallDir)bin" CACHE FILEPATH "Host side compiler used by NVCC")
+else()
+ set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC")
+endif()
+
# Propagate the host flags to the host compiler via -Xcompiler
option(CUDA_PROPAGATE_HOST_FLAGS "Propage C/CXX_FLAGS and friends to the host compiler via -Xcompile" ON)
@@ -482,15 +495,15 @@ if(NOT CUDA_TOOLKIT_ROOT_DIR)
string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR})
# We need to force this back into the cache.
set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE)
- endif(CUDA_TOOLKIT_ROOT_DIR)
+ endif()
if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR})
if(CUDA_FIND_REQUIRED)
message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR")
elseif(NOT CUDA_FIND_QUIETLY)
message("CUDA_TOOLKIT_ROOT_DIR not found or specified")
endif()
- endif (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR})
-endif (NOT CUDA_TOOLKIT_ROOT_DIR)
+ endif ()
+endif ()
# CUDA_NVCC_EXECUTABLE
find_program(CUDA_NVCC_EXECUTABLE
@@ -595,7 +608,7 @@ find_library_local_first(CUDA_CUDA_LIBRARY cuda "\"cuda\" library (older version
# Add cuda library to the link line only if it is found.
if (CUDA_CUDA_LIBRARY)
set(CUDA_LIBRARIES ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
-endif(CUDA_CUDA_LIBRARY)
+endif()
mark_as_advanced(
CUDA_CUDA_LIBRARY
@@ -607,7 +620,7 @@ mark_as_advanced(
macro(FIND_CUDA_HELPER_LIBS _name)
find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library")
mark_as_advanced(CUDA_${_name}_LIBRARY)
-endmacro(FIND_CUDA_HELPER_LIBS)
+endmacro()
#######################
# Disable emulation for v3.1 onward
@@ -650,9 +663,11 @@ endif()
# Look for the SDK stuff. As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with
# NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory
find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h
+ HINTS
"$ENV{NVSDKCOMPUTE_ROOT}/C"
- "$ENV{NVSDKCUDA_ROOT}"
+ ENV NVSDKCUDA_ROOT
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]"
+ PATHS
"/Developer/GPU\ Computing/C"
)
@@ -691,9 +706,9 @@ set(CUDA_SDK_SEARCH_PATH
# if(CMAKE_SIZEOF_VOID_P EQUAL 8)
# set(cuda_cutil_name cutil64)
-# else(CMAKE_SIZEOF_VOID_P EQUAL 8)
+# else()
# set(cuda_cutil_name cutil32)
-# endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
+# endif()
# find_library(CUDA_CUT_LIBRARY
# NAMES cutil ${cuda_cutil_name}
@@ -743,8 +758,8 @@ find_package_handle_standard_args(CUDA
macro(CUDA_INCLUDE_DIRECTORIES)
foreach(dir ${ARGN})
list(APPEND CUDA_NVCC_INCLUDE_ARGS_USER -I${dir})
- endforeach(dir ${ARGN})
-endmacro(CUDA_INCLUDE_DIRECTORIES)
+ endforeach()
+endmacro()
##############################################################################
@@ -855,7 +870,7 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path)
file(TO_CMAKE_PATH "${path}" bpath)
if (IS_ABSOLUTE "${bpath}")
# Absolute paths are generally unnessary, especially if something like
- # FILE(GLOB_RECURSE) is used to pick up the files.
+ # file(GLOB_RECURSE) is used to pick up the files.
file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}")
endif()
@@ -898,14 +913,6 @@ endfunction()
macro(CUDA_WRAP_SRCS cuda_target format generated_files)
- if( ${format} MATCHES "PTX" )
- set( compile_to_ptx ON )
- elseif( ${format} MATCHES "OBJ")
- set( compile_to_ptx OFF )
- else()
- message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS: '${format}'. Use OBJ or PTX.")
- endif()
-
# Set up all the command line flags here, so that they can be overridden on a per target basis.
set(nvcc_flags "")
@@ -914,20 +921,20 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
if (CUDA_BUILD_EMULATION)
# Emulation.
set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g)
- else(CUDA_BUILD_EMULATION)
+ else()
# Device mode. No flags necessary.
- endif(CUDA_BUILD_EMULATION)
+ endif()
if(CUDA_HOST_COMPILATION_CPP)
set(CUDA_C_OR_CXX CXX)
- else(CUDA_HOST_COMPILATION_CPP)
+ else()
if(CUDA_VERSION VERSION_LESS "3.0")
set(nvcc_flags ${nvcc_flags} --host-compilation C)
else()
message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0. Removing --host-compilation C flag" )
endif()
set(CUDA_C_OR_CXX C)
- endif(CUDA_HOST_COMPILATION_CPP)
+ endif()
set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION})
@@ -938,12 +945,11 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
endif()
# This needs to be passed in at this stage, because VS needs to fill out the
- # value of VCInstallDir from within VS.
+ # value of VCInstallDir from within VS. Note that CCBIN is only used if
+ # -ccbin or --compiler-bindir isn't used and CUDA_HOST_COMPILER matches
+ # $(VCInstallDir)/bin.
if(CMAKE_GENERATOR MATCHES "Visual Studio")
- if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
- # Add nvcc flag for 64b Windows
- set(ccbin_flags -D "\"CCBIN:PATH=$(VCInstallDir)bin\"" )
- endif()
+ set(ccbin_flags -D "\"CCBIN:PATH=$(VCInstallDir)bin\"" )
endif()
# Figure out which configure we will use and pass that in as an argument to
@@ -1002,12 +1008,12 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
# Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We
# always need to set the SHARED_FLAGS, though.
if(CUDA_PROPAGATE_HOST_FLAGS)
- set(CUDA_HOST_FLAGS "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})")
+ set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})")
else()
- set(CUDA_HOST_FLAGS "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})")
+ set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})")
endif()
- set(CUDA_NVCC_FLAGS_CONFIG "# Build specific configuration flags")
+ set(_cuda_nvcc_flags_config "# Build specific configuration flags")
# Loop over all the configuration types to generate appropriate flags for run_nvcc.cmake
foreach(config ${CUDA_configuration_types})
string(TOUPPER ${config} config_upper)
@@ -1016,27 +1022,31 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
if(CUDA_PROPAGATE_HOST_FLAGS)
# nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g
- if(CMAKE_COMPILER_IS_GNUCC AND CUDA_VERSION VERSION_LESS "3.0")
+ set(_cuda_fix_g3 FALSE)
+
+ if(CMAKE_COMPILER_IS_GNUCC)
+ if (CUDA_VERSION VERSION_LESS "3.0" OR
+ CUDA_VERSION VERSION_EQUAL "4.1" OR
+ CUDA_VERSION VERSION_EQUAL "4.2"
+ )
+ set(_cuda_fix_g3 TRUE)
+ endif()
+ endif()
+ if(_cuda_fix_g3)
string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")
else()
set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")
endif()
- set(CUDA_HOST_FLAGS "${CUDA_HOST_FLAGS}\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})")
+ set(_cuda_host_flags "${_cuda_host_flags}\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})")
endif()
# Note that if we ever want CUDA_NVCC_FLAGS_<CONFIG> to be string (instead of a list
# like it is currently), we can remove the quotes around the
# ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_<CONFIG> variable.
- set(CUDA_NVCC_FLAGS_CONFIG "${CUDA_NVCC_FLAGS_CONFIG}\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})")
+ set(_cuda_nvcc_flags_config "${_cuda_nvcc_flags_config}\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})")
endforeach()
- if(compile_to_ptx)
- # Don't use any of the host compilation flags for PTX targets.
- set(CUDA_HOST_FLAGS)
- set(CUDA_NVCC_FLAGS_CONFIG)
- endif()
-
# Get the list of definitions from the directory property
get_directory_property(CUDA_NVCC_DEFINITIONS COMPILE_DEFINITIONS)
if(CUDA_NVCC_DEFINITIONS)
@@ -1059,6 +1069,30 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
get_source_file_property(_is_header ${file} HEADER_FILE_ONLY)
if(${file} MATCHES ".*\\.cu$" AND NOT _is_header)
+ # Allow per source file overrides of the format.
+ get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT)
+ if(NOT _cuda_source_format)
+ set(_cuda_source_format ${format})
+ endif()
+
+ if( ${_cuda_source_format} MATCHES "PTX" )
+ set( compile_to_ptx ON )
+ elseif( ${_cuda_source_format} MATCHES "OBJ")
+ set( compile_to_ptx OFF )
+ else()
+ message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS for file '${file}': '${_cuda_source_format}'. Use OBJ or PTX.")
+ endif()
+
+
+ if(compile_to_ptx)
+ # Don't use any of the host compilation flags for PTX targets.
+ set(CUDA_HOST_FLAGS)
+ set(CUDA_NVCC_FLAGS_CONFIG)
+ else()
+ set(CUDA_HOST_FLAGS ${_cuda_host_flags})
+ set(CUDA_NVCC_FLAGS_CONFIG ${_cuda_nvcc_flags_config})
+ endif()
+
# Determine output directory
cuda_compute_build_path("${file}" cuda_build_path)
set(cuda_compile_intermediate_directory "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${cuda_build_path}")
@@ -1080,11 +1114,11 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
set(generated_file_basename "${cuda_target}_generated_${basename}.ptx")
set(format_flag "-ptx")
file(MAKE_DIRECTORY "${cuda_compile_output_dir}")
- else( compile_to_ptx )
+ else()
set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}")
set(generated_file_basename "${cuda_target}_generated_${basename}${generated_extension}")
set(format_flag "-c")
- endif( compile_to_ptx )
+ endif()
# Set all of our file names. Make sure that whatever filenames that have
# generated_file_path in them get passed in through as a command line
@@ -1118,17 +1152,17 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
# Convience string for output ###########################################
if(CUDA_BUILD_EMULATION)
set(cuda_build_type "Emulation")
- else(CUDA_BUILD_EMULATION)
+ else()
set(cuda_build_type "Device")
- endif(CUDA_BUILD_EMULATION)
+ endif()
# Build the NVCC made dependency file ###################################
set(build_cubin OFF)
if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN )
if ( NOT compile_to_ptx )
set ( build_cubin ON )
- endif( NOT compile_to_ptx )
- endif( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN )
+ endif()
+ endif()
# Configure the build script
configure_file("${CUDA_run_nvcc}" "${custom_target_script}" @ONLY)
@@ -1203,12 +1237,12 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
list(REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES)
set(CUDA_ADDITIONAL_CLEAN_FILES ${CUDA_ADDITIONAL_CLEAN_FILES} CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.")
- endif(${file} MATCHES ".*\\.cu$" AND NOT _is_header)
- endforeach(file)
+ endif()
+ endforeach()
# Set the return parameter
set(${generated_files} ${_cuda_wrap_generated_files})
-endmacro(CUDA_WRAP_SRCS)
+endmacro()
###############################################################################
@@ -1245,7 +1279,7 @@ macro(CUDA_ADD_LIBRARY cuda_target)
LINKER_LANGUAGE ${CUDA_C_OR_CXX}
)
-endmacro(CUDA_ADD_LIBRARY cuda_target)
+endmacro()
###############################################################################
@@ -1279,7 +1313,7 @@ macro(CUDA_ADD_EXECUTABLE cuda_target)
LINKER_LANGUAGE ${CUDA_C_OR_CXX}
)
-endmacro(CUDA_ADD_EXECUTABLE cuda_target)
+endmacro()
###############################################################################
@@ -1297,7 +1331,7 @@ macro(CUDA_COMPILE generated_files)
set( ${generated_files} ${_generated_files})
-endmacro(CUDA_COMPILE)
+endmacro()
###############################################################################
@@ -1315,7 +1349,7 @@ macro(CUDA_COMPILE_PTX generated_files)
set( ${generated_files} ${_generated_files})
-endmacro(CUDA_COMPILE_PTX)
+endmacro()
###############################################################################
###############################################################################
@@ -1364,4 +1398,4 @@ macro(CUDA_BUILD_CLEAN_TARGET)
# This is useful so that the files won't persist in the list after targets
# have been removed.
set(CUDA_ADDITIONAL_CLEAN_FILES "" CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.")
-endmacro(CUDA_BUILD_CLEAN_TARGET)
+endmacro()
diff --git a/Modules/FindCUDA/make2cmake.cmake b/Modules/FindCUDA/make2cmake.cmake
index d41b72dc2..c2405f44f 100644
--- a/Modules/FindCUDA/make2cmake.cmake
+++ b/Modules/FindCUDA/make2cmake.cmake
@@ -76,7 +76,7 @@ if (${depend_text} MATCHES ".+")
list(APPEND dependency_list "${file_absolute}")
endif()
- endforeach(file)
+ endforeach()
else()
# message("FOUND NO DEPENDS")
diff --git a/Modules/FindCUDA/parse_cubin.cmake b/Modules/FindCUDA/parse_cubin.cmake
index 2518c6852..94be7e2cb 100644
--- a/Modules/FindCUDA/parse_cubin.cmake
+++ b/Modules/FindCUDA/parse_cubin.cmake
@@ -65,11 +65,11 @@ if (${file_text} MATCHES ".+")
# Skip the rest of this block.
# message("Skipping ${entry}")
# set(skip TRUE)
- # else (${entry} MATCHES "^_")
+ # else ()
message("Kernel: ${entry}")
- # endif (${entry} MATCHES "^_")
+ # endif ()
- endif(${entry} MATCHES "[^g]name = ([^ ]+)")
+ endif()
# Skip the rest of the block if necessary
if(NOT skip)
@@ -96,14 +96,14 @@ if (${file_text} MATCHES ".+")
message("")
endif()
- endif(NOT skip)
+ endif()
- endforeach(entry)
+ endforeach()
- endif(line MATCHES "^code")
+ endif()
- endforeach(line)
+ endforeach()
else()
# message("FOUND NO DEPENDS")
diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake
index b31011c0e..f0aac8487 100644
--- a/Modules/FindCUDA/run_nvcc.cmake
+++ b/Modules/FindCUDA/run_nvcc.cmake
@@ -62,6 +62,7 @@ set(cmake_dependency_file "@cmake_dependency_file@") # path
set(CUDA_make2cmake "@CUDA_make2cmake@") # path
set(CUDA_parse_cubin "@CUDA_parse_cubin@") # path
set(build_cubin @build_cubin@) # bool
+set(CUDA_HOST_COMPILER "@CUDA_HOST_COMPILER@") # bool
# We won't actually use these variables for now, but we need to set this, in
# order to force this file to be run again if it changes.
set(generated_file_path "@generated_file_path@") # path
@@ -102,8 +103,15 @@ endif()
# Add the build specific configuration flags
list(APPEND CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS_${build_configuration}})
-if(DEFINED CCBIN)
- set(CCBIN -ccbin "${CCBIN}")
+# Any -ccbin existing in CUDA_NVCC_FLAGS gets highest priority
+list( FIND CUDA_NVCC_FLAGS "-ccbin" ccbin_found0 )
+list( FIND CUDA_NVCC_FLAGS "--compiler-bindir" ccbin_found1 )
+if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 )
+ if (CUDA_HOST_COMPILER STREQUAL "$(VCInstallDir)bin" AND DEFINED CCBIN)
+ set(CCBIN -ccbin "${CCBIN}")
+ else()
+ set(CCBIN -ccbin "${CUDA_HOST_COMPILER}")
+ endif()
endif()
# cuda_execute_process - Executes a command with optional command echo and status message.
@@ -139,7 +147,7 @@ macro(cuda_execute_process status command)
endforeach()
# Echo the command
execute_process(COMMAND ${CMAKE_COMMAND} -E echo ${cuda_execute_process_string})
- endif(verbose)
+ endif()
# Run the command
execute_process(COMMAND ${ARGN} RESULT_VARIABLE CUDA_result )
endmacro()
@@ -277,4 +285,4 @@ if( build_cubin )
-P "${CUDA_parse_cubin}"
)
-endif( build_cubin )
+endif()
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index cc00d53f4..0fb8f45d4 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -21,39 +21,41 @@
# License text for the above reference.)
# Look for the header file.
-FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h)
-MARK_AS_ADVANCED(CURL_INCLUDE_DIR)
+find_path(CURL_INCLUDE_DIR NAMES curl/curl.h)
+mark_as_advanced(CURL_INCLUDE_DIR)
-# Look for the library.
-FIND_LIBRARY(CURL_LIBRARY NAMES
+# Look for the library (sorted from most current/relevant entry to least).
+find_library(CURL_LIBRARY NAMES
curl
# Windows MSVC prebuilts:
curllib
libcurl_imp
curllib_static
+ # Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip):
+ libcurl
)
-MARK_AS_ADVANCED(CURL_LIBRARY)
+mark_as_advanced(CURL_LIBRARY)
-IF(CURL_INCLUDE_DIR)
- FOREACH(_curl_version_header curlver.h curl.h)
- IF(EXISTS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}")
- FILE(STRINGS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"")
+if(CURL_INCLUDE_DIR)
+ foreach(_curl_version_header curlver.h curl.h)
+ if(EXISTS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}")
+ file(STRINGS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"")
- STRING(REGEX REPLACE "^#define[\t ]+LIBCURL_VERSION[\t ]+\"([^\"]*)\".*" "\\1" CURL_VERSION_STRING "${curl_version_str}")
- UNSET(curl_version_str)
- BREAK()
- ENDIF()
- ENDFOREACH(_curl_version_header)
-ENDIF()
+ string(REGEX REPLACE "^#define[\t ]+LIBCURL_VERSION[\t ]+\"([^\"]*)\".*" "\\1" CURL_VERSION_STRING "${curl_version_str}")
+ unset(curl_version_str)
+ break()
+ endif()
+ endforeach()
+endif()
-# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL
REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR
VERSION_VAR CURL_VERSION_STRING)
-IF(CURL_FOUND)
- SET(CURL_LIBRARIES ${CURL_LIBRARY})
- SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
-ENDIF(CURL_FOUND)
+if(CURL_FOUND)
+ set(CURL_LIBRARIES ${CURL_LIBRARY})
+ set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
+endif()
diff --git a/Modules/FindCVS.cmake b/Modules/FindCVS.cmake
index 57680bd97..07079bb5a 100644
--- a/Modules/FindCVS.cmake
+++ b/Modules/FindCVS.cmake
@@ -5,7 +5,7 @@
# find_package(CVS)
# if(CVS_FOUND)
# message("CVS found: ${CVS_EXECUTABLE}")
-# endif(CVS_FOUND)
+# endif()
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
@@ -24,31 +24,31 @@
get_filename_component(
CVSNT_TypeLib_Win32
- "[HKEY_CLASSES_ROOT\\TypeLib\\{2BDF7A65-0BFE-4B1A-9205-9AB900C7D0DA}\\1.0\\0\\win32]"
+ "[HKEY_CLASSES_ROOT\\TypeLib\\{2BDF7A65-0BFE-4B1A-9205-9AB900C7D0DA}\\1.0\\0\\win32]"
PATH)
get_filename_component(
CVSNT_Services_EventMessagePath
- "[HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Services\\Eventlog\\Application\\cvsnt;EventMessageFile]"
+ "[HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Services\\Eventlog\\Application\\cvsnt;EventMessageFile]"
PATH)
# WinCVS (in case CVSNT was installed in the same directory)
get_filename_component(
WinCVS_Folder_Command
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Folder\\shell\\wincvs\\command]"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Folder\\shell\\wincvs\\command]"
PATH)
# TortoiseCVS (in case CVSNT was installed in the same directory)
get_filename_component(
TortoiseCVS_Folder_Command
- "[HKEY_CLASSES_ROOT\\CVS\\shell\\open\\command]"
+ "[HKEY_CLASSES_ROOT\\CVS\\shell\\open\\command]"
PATH)
get_filename_component(
TortoiseCVS_DefaultIcon
- "[HKEY_CLASSES_ROOT\\CVS\\DefaultIcon]"
+ "[HKEY_CLASSES_ROOT\\CVS\\DefaultIcon]"
PATH)
find_program(CVS_EXECUTABLE cvs
@@ -62,7 +62,7 @@ find_program(CVS_EXECUTABLE cvs
)
mark_as_advanced(CVS_EXECUTABLE)
-# Handle the QUIETLY and REQUIRED arguments and set CVS_FOUND to TRUE if
+# Handle the QUIETLY and REQUIRED arguments and set CVS_FOUND to TRUE if
# all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
diff --git a/Modules/FindCoin3D.cmake b/Modules/FindCoin3D.cmake
index 8bfe97acc..bbda87b3a 100644
--- a/Modules/FindCoin3D.cmake
+++ b/Modules/FindCoin3D.cmake
@@ -22,63 +22,63 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF (WIN32)
- IF (CYGWIN)
+if (WIN32)
+ if (CYGWIN)
- FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h)
- FIND_LIBRARY(COIN3D_LIBRARIES Coin)
+ find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
+ find_library(COIN3D_LIBRARIES Coin)
- ELSE (CYGWIN)
+ else ()
- FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
+ find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/include"
)
- FIND_LIBRARY(COIN3D_LIBRARY_DEBUG coin2d
+ find_library(COIN3D_LIBRARY_DEBUG coin2d
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
)
- FIND_LIBRARY(COIN3D_LIBRARY_RELEASE coin2
+ find_library(COIN3D_LIBRARY_RELEASE coin2
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
)
- IF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
- SET(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
+ if (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
+ set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
debug ${COIN3D_LIBRARY_DEBUG})
- ELSE (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
- IF (COIN3D_LIBRARY_DEBUG)
- SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG})
- ENDIF (COIN3D_LIBRARY_DEBUG)
- IF (COIN3D_LIBRARY_RELEASE)
- SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE})
- ENDIF (COIN3D_LIBRARY_RELEASE)
- ENDIF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
-
- ENDIF (CYGWIN)
-
-ELSE (WIN32)
- IF(APPLE)
- FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
- /Library/Frameworks/Inventor.framework/Headers
+ else ()
+ if (COIN3D_LIBRARY_DEBUG)
+ set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG})
+ endif ()
+ if (COIN3D_LIBRARY_RELEASE)
+ set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE})
+ endif ()
+ endif ()
+
+ endif ()
+
+else ()
+ if(APPLE)
+ find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
+ /Library/Frameworks/Inventor.framework/Headers
)
- FIND_LIBRARY(COIN3D_LIBRARIES Coin
+ find_library(COIN3D_LIBRARIES Coin
/Library/Frameworks/Inventor.framework/Libraries
- )
- SET(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
- ELSE(APPLE)
+ )
+ set(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
+ else()
- FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h)
- FIND_LIBRARY(COIN3D_LIBRARIES Coin)
+ find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
+ find_library(COIN3D_LIBRARIES Coin)
- ENDIF(APPLE)
+ endif()
-ENDIF (WIN32)
+endif ()
-# handle the QUIETLY and REQUIRED arguments and set COIN3D_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set COIN3D_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Coin3D DEFAULT_MSG COIN3D_LIBRARIES COIN3D_INCLUDE_DIRS)
-MARK_AS_ADVANCED(COIN3D_INCLUDE_DIRS COIN3D_LIBRARIES )
+mark_as_advanced(COIN3D_INCLUDE_DIRS COIN3D_LIBRARIES )
diff --git a/Modules/FindCups.cmake b/Modules/FindCups.cmake
index 3862f7ddf..f74366bb7 100644
--- a/Modules/FindCups.cmake
+++ b/Modules/FindCups.cmake
@@ -5,7 +5,7 @@
# CUPS_INCLUDE_DIR - the Cups include directory
# CUPS_LIBRARIES - Libraries needed to use Cups
# CUPS_VERSION_STRING - version of Cups found (since CMake 2.8.8)
-# Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which
+# Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which
# features this function (i.e. at least 1.1.19)
#=============================================================================
@@ -32,7 +32,7 @@ if (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
# ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint)
CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE)
-endif (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
+endif ()
if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h")
file(STRINGS "${CUPS_INCLUDE_DIR}/cups/cups.h" cups_version_str
@@ -46,13 +46,13 @@ if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h")
CUPS_VERSION_PART "${VLINE}")
if(CUPS_VERSION_STRING)
set(CUPS_VERSION_STRING "${CUPS_VERSION_STRING}.${CUPS_VERSION_PART}")
- else(CUPS_VERSION_STRING)
+ else()
set(CUPS_VERSION_STRING "${CUPS_VERSION_PART}")
- endif(CUPS_VERSION_STRING)
+ endif()
endif()
- endforeach(VLINE)
- endforeach(VPART)
-endif (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h")
+ endforeach()
+ endforeach()
+endif ()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
@@ -60,10 +60,10 @@ if (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cups
REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR CUPS_HAS_IPP_DELETE_ATTRIBUTE
VERSION_VAR CUPS_VERSION_STRING)
-else (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
+else ()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cups
REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR
VERSION_VAR CUPS_VERSION_STRING)
-endif (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
-
+endif ()
+
mark_as_advanced(CUPS_INCLUDE_DIR CUPS_LIBRARIES)
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index d1e13116d..6acf42126 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -9,7 +9,7 @@
# CURSES_HAVE_NCURSES_CURSES_H - true if ncurses/curses.h is available
# CURSES_LIBRARY - set for backwards compatibility with 2.4 CMake
#
-# Set CURSES_NEED_NCURSES to TRUE before the FIND_PACKAGE() command if NCurses
+# Set CURSES_NEED_NCURSES to TRUE before the find_package() command if NCurses
# functionality is required.
#=============================================================================
@@ -25,23 +25,23 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_LIBRARY(CURSES_CURSES_LIBRARY NAMES curses )
+find_library(CURSES_CURSES_LIBRARY NAMES curses )
-FIND_LIBRARY(CURSES_NCURSES_LIBRARY NAMES ncurses )
-SET(CURSES_USE_NCURSES FALSE)
+find_library(CURSES_NCURSES_LIBRARY NAMES ncurses )
+set(CURSES_USE_NCURSES FALSE)
-IF(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY)
- SET(CURSES_USE_NCURSES TRUE)
-ENDIF(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY)
+if(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY)
+ set(CURSES_USE_NCURSES TRUE)
+endif()
# http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html
# cygwin ncurses stopped providing curses.h symlinks see above
# message. Cygwin is an ncurses package, so force ncurses on
# cygwin if the curses.h is missing
-IF(CYGWIN)
- IF(NOT EXISTS /usr/include/curses.h)
- SET(CURSES_USE_NCURSES TRUE)
- ENDIF()
-ENDIF()
+if(CYGWIN)
+ if(NOT EXISTS /usr/include/curses.h)
+ set(CURSES_USE_NCURSES TRUE)
+ endif()
+endif()
# Not sure the logic is correct here.
@@ -53,113 +53,113 @@ ENDIF()
# some web pages also say that even with ncurses there is not always a ncurses.h:
# http://osdir.com/ml/gnome.apps.mc.devel/2002-06/msg00029.html
# So at first try ncurses.h, if not found, try to find curses.h under the same
-# prefix as the library was found, if still not found, try curses.h with the
+# prefix as the library was found, if still not found, try curses.h with the
# default search paths.
-IF(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
- INCLUDE(CheckLibraryExists)
- CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}"
+if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
+ include(CheckLibraryExists)
+ CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}"
wsyncup "" CURSES_CURSES_HAS_WSYNCUP)
- IF(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_HAS_WSYNCUP)
- CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}"
+ if(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_HAS_WSYNCUP)
+ CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}"
wsyncup "" CURSES_NCURSES_HAS_WSYNCUP)
- IF( CURSES_NCURSES_HAS_WSYNCUP)
- SET(CURSES_USE_NCURSES TRUE)
- ENDIF( CURSES_NCURSES_HAS_WSYNCUP)
- ENDIF(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_HAS_WSYNCUP)
+ if( CURSES_NCURSES_HAS_WSYNCUP)
+ set(CURSES_USE_NCURSES TRUE)
+ endif()
+ endif()
-ENDIF(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
+endif()
-IF(NOT CURSES_USE_NCURSES)
- FIND_FILE(CURSES_HAVE_CURSES_H curses.h )
- FIND_PATH(CURSES_CURSES_H_PATH curses.h )
- GET_FILENAME_COMPONENT(_cursesLibDir "${CURSES_CURSES_LIBRARY}" PATH)
- GET_FILENAME_COMPONENT(_cursesParentDir "${_cursesLibDir}" PATH)
+if(NOT CURSES_USE_NCURSES)
+ find_file(CURSES_HAVE_CURSES_H curses.h )
+ find_path(CURSES_CURSES_H_PATH curses.h )
+ get_filename_component(_cursesLibDir "${CURSES_CURSES_LIBRARY}" PATH)
+ get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH)
# for compatibility with older FindCurses.cmake this has to be in the cache
# FORCE must not be used since this would break builds which preload a cache wqith these variables set
- SET(CURSES_INCLUDE_PATH "${CURSES_CURSES_H_PATH}"
+ set(CURSES_INCLUDE_PATH "${CURSES_CURSES_H_PATH}"
CACHE FILEPATH "The curses include path")
- SET(CURSES_LIBRARY "${CURSES_CURSES_LIBRARY}"
+ set(CURSES_LIBRARY "${CURSES_CURSES_LIBRARY}"
CACHE FILEPATH "The curses library")
-ELSE(NOT CURSES_USE_NCURSES)
+else()
# we need to find ncurses
- GET_FILENAME_COMPONENT(_cursesLibDir "${CURSES_NCURSES_LIBRARY}" PATH)
- GET_FILENAME_COMPONENT(_cursesParentDir "${_cursesLibDir}" PATH)
+ get_filename_component(_cursesLibDir "${CURSES_NCURSES_LIBRARY}" PATH)
+ get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH)
- FIND_FILE(CURSES_HAVE_NCURSES_H ncurses.h)
- FIND_FILE(CURSES_HAVE_NCURSES_NCURSES_H ncurses/ncurses.h)
- FIND_FILE(CURSES_HAVE_NCURSES_CURSES_H ncurses/curses.h)
- FIND_FILE(CURSES_HAVE_CURSES_H curses.h
+ find_file(CURSES_HAVE_NCURSES_H ncurses.h)
+ find_file(CURSES_HAVE_NCURSES_NCURSES_H ncurses/ncurses.h)
+ find_file(CURSES_HAVE_NCURSES_CURSES_H ncurses/curses.h)
+ find_file(CURSES_HAVE_CURSES_H curses.h
HINTS "${_cursesParentDir}/include")
- FIND_PATH(CURSES_NCURSES_INCLUDE_PATH ncurses.h ncurses/ncurses.h
+ find_path(CURSES_NCURSES_INCLUDE_PATH ncurses.h ncurses/ncurses.h
ncurses/curses.h)
- FIND_PATH(CURSES_NCURSES_INCLUDE_PATH curses.h
+ find_path(CURSES_NCURSES_INCLUDE_PATH curses.h
HINTS "${_cursesParentDir}/include")
# for compatibility with older FindCurses.cmake this has to be in the cache
# FORCE must not be used since this would break builds which preload
- # however if the value of the variable has NOTFOUND in it, then
+ # however if the value of the variable has NOTFOUND in it, then
# it is OK to force, and we need to force in order to have it work.
# a cache wqith these variables set
- # only put ncurses include and library into
+ # only put ncurses include and library into
# variables if they are found
- IF(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
- GET_FILENAME_COMPONENT(CURSES_NCURSES_INCLUDE_PATH
+ if(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
+ get_filename_component(CURSES_NCURSES_INCLUDE_PATH
"${CURSES_HAVE_NCURSES_NCURSES_H}" PATH)
- ENDIF(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
- IF(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
- SET( FORCE_IT )
- IF(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
- SET(FORCE_IT FORCE)
- ENDIF(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
- SET(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}"
+ endif()
+ if(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
+ set( FORCE_IT )
+ if(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
+ set(FORCE_IT FORCE)
+ endif()
+ set(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}"
CACHE FILEPATH "The curses include path" ${FORCE_IT})
- SET( FORCE_IT)
- IF(CURSES_LIBRARY MATCHES NOTFOUND)
- SET(FORCE_IT FORCE)
- ENDIF(CURSES_LIBRARY MATCHES NOTFOUND)
- SET(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}"
+ set( FORCE_IT)
+ if(CURSES_LIBRARY MATCHES NOTFOUND)
+ set(FORCE_IT FORCE)
+ endif()
+ set(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}"
CACHE FILEPATH "The curses library" ${FORCE_IT})
- ENDIF(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
+ endif()
-ENDIF(NOT CURSES_USE_NCURSES)
+endif()
-FIND_LIBRARY(CURSES_EXTRA_LIBRARY cur_colr HINTS "${_cursesLibDir}")
-FIND_LIBRARY(CURSES_EXTRA_LIBRARY cur_colr )
+find_library(CURSES_EXTRA_LIBRARY cur_colr HINTS "${_cursesLibDir}")
+find_library(CURSES_EXTRA_LIBRARY cur_colr )
-FIND_LIBRARY(CURSES_FORM_LIBRARY form HINTS "${_cursesLibDir}")
-FIND_LIBRARY(CURSES_FORM_LIBRARY form )
+find_library(CURSES_FORM_LIBRARY form HINTS "${_cursesLibDir}")
+find_library(CURSES_FORM_LIBRARY form )
# for compatibility with older FindCurses.cmake this has to be in the cache
# FORCE must not be used since this would break builds which preload a cache
# qith these variables set
-SET(FORM_LIBRARY "${CURSES_FORM_LIBRARY}"
+set(FORM_LIBRARY "${CURSES_FORM_LIBRARY}"
CACHE FILEPATH "The curses form library")
# Need to provide the *_LIBRARIES
-SET(CURSES_LIBRARIES ${CURSES_LIBRARY})
+set(CURSES_LIBRARIES ${CURSES_LIBRARY})
-IF(CURSES_EXTRA_LIBRARY)
- SET(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_EXTRA_LIBRARY})
-ENDIF(CURSES_EXTRA_LIBRARY)
+if(CURSES_EXTRA_LIBRARY)
+ set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_EXTRA_LIBRARY})
+endif()
-IF(CURSES_FORM_LIBRARY)
- SET(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_FORM_LIBRARY})
-ENDIF(CURSES_FORM_LIBRARY)
+if(CURSES_FORM_LIBRARY)
+ set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_FORM_LIBRARY})
+endif()
# Proper name is *_INCLUDE_DIR
-SET(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH})
+set(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH})
-# handle the QUIETLY and REQUIRED arguments and set CURSES_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set CURSES_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Curses DEFAULT_MSG
CURSES_LIBRARY CURSES_INCLUDE_PATH)
-MARK_AS_ADVANCED(
+mark_as_advanced(
CURSES_INCLUDE_PATH
CURSES_LIBRARY
CURSES_CURSES_INCLUDE_PATH
diff --git a/Modules/FindCxxTest.cmake b/Modules/FindCxxTest.cmake
index a4d150493..48de64afd 100644
--- a/Modules/FindCxxTest.cmake
+++ b/Modules/FindCxxTest.cmake
@@ -49,7 +49,7 @@
# input_files_to_testgen The list of header files containing the
# CxxTest::TestSuite's to be included in
# this runner
-#
+#
# #==============
# Example Usage:
#
@@ -67,13 +67,13 @@
# 1. Invoke the testgen executable to autogenerate foo_test.cc in the
# binary tree from "foo_test.h" in the current source directory.
# 2. Create an executable and test called unittest_foo.
-#
+#
# #=============
# Example foo_test.h:
#
# #include <cxxtest/TestSuite.h>
-#
-# class MyTestSuite : public CxxTest::TestSuite
+#
+# class MyTestSuite : public CxxTest::TestSuite
# {
# public:
# void testAddition( void )
@@ -147,7 +147,7 @@ macro(CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname)
add_test(${_cxxtest_testname} ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_testname})
endif()
-endmacro(CXXTEST_ADD_TEST)
+endmacro()
#=============================================================
# main()
diff --git a/Modules/FindCygwin.cmake b/Modules/FindCygwin.cmake
index 28f55ba0c..d7ab7cc80 100644
--- a/Modules/FindCygwin.cmake
+++ b/Modules/FindCygwin.cmake
@@ -14,15 +14,15 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF (WIN32)
- FIND_PATH(CYGWIN_INSTALL_PATH
+if (WIN32)
+ find_path(CYGWIN_INSTALL_PATH
cygwin.bat
"C:/Cygwin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygwin\\setup;rootdir]"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/;native]"
)
- MARK_AS_ADVANCED(
+ mark_as_advanced(
CYGWIN_INSTALL_PATH
)
-ENDIF (WIN32)
+endif ()
diff --git a/Modules/FindDart.cmake b/Modules/FindDart.cmake
index f7c54df43..a2b2926a7 100644
--- a/Modules/FindDart.cmake
+++ b/Modules/FindDart.cmake
@@ -16,21 +16,25 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(DART_ROOT README.INSTALL
- $ENV{DART_ROOT}
- ${PROJECT_SOURCE_DIR}/Dart
- /usr/share/Dart
- C:/Dart
- "$ENV{ProgramFiles}/Dart"
- "C:/Program Files/Dart"
- ${PROJECT_SOURCE_DIR}/../Dart
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Dart\\InstallPath]
+find_path(DART_ROOT README.INSTALL
+ HINTS
+ ENV DART_ROOT
+ PATHS
+ ${PROJECT_SOURCE_DIR}
+ /usr/share
+ C:/
+ "C:/Program Files"
+ ${PROJECT_SOURCE_DIR}/..
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Dart\\InstallPath]
+ ENV ProgramFiles
+ PATH_SUFFIXES
+ Dart
DOC "If you have Dart installed, where is it located?"
)
# handle the QUIETLY and REQUIRED arguments and set DART_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Dart DEFAULT_MSG DART_ROOT)
-MARK_AS_ADVANCED(DART_ROOT)
+mark_as_advanced(DART_ROOT)
diff --git a/Modules/FindDevIL.cmake b/Modules/FindDevIL.cmake
index 4a0fbe064..dacc60422 100644
--- a/Modules/FindDevIL.cmake
+++ b/Modules/FindDevIL.cmake
@@ -36,39 +36,39 @@
# TODO: Add version support.
# Tested under Linux and Windows (MSVC)
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PATH(IL_INCLUDE_DIR il.h
+find_path(IL_INCLUDE_DIR il.h
PATH_SUFFIXES include IL
DOC "The path the the directory that contains il.h"
)
-#MESSAGE("IL_INCLUDE_DIR is ${IL_INCLUDE_DIR}")
+#message("IL_INCLUDE_DIR is ${IL_INCLUDE_DIR}")
-FIND_LIBRARY(IL_LIBRARIES
+find_library(IL_LIBRARIES
NAMES IL DEVIL
PATH_SUFFIXES lib64 lib lib32
DOC "The file that corresponds to the base il library."
)
-#MESSAGE("IL_LIBRARIES is ${IL_LIBRARIES}")
+#message("IL_LIBRARIES is ${IL_LIBRARIES}")
-FIND_LIBRARY(ILUT_LIBRARIES
+find_library(ILUT_LIBRARIES
NAMES ILUT
PATH_SUFFIXES lib64 lib lib32
DOC "The file that corresponds to the il (system?) utility library."
)
-#MESSAGE("ILUT_LIBRARIES is ${ILUT_LIBRARIES}")
+#message("ILUT_LIBRARIES is ${ILUT_LIBRARIES}")
-FIND_LIBRARY(ILU_LIBRARIES
+find_library(ILU_LIBRARIES
NAMES ILU
PATH_SUFFIXES lib64 lib lib32
DOC "The file that corresponds to the il utility library."
)
-#MESSAGE("ILU_LIBRARIES is ${ILU_LIBRARIES}")
+#message("ILU_LIBRARIES is ${ILU_LIBRARIES}")
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(IL DEFAULT_MSG
- IL_LIBRARIES ILU_LIBRARIES
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(IL DEFAULT_MSG
+ IL_LIBRARIES ILU_LIBRARIES
ILUT_LIBRARIES IL_INCLUDE_DIR)
diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake
index 6cc9efb18..d2ede6ab9 100644
--- a/Modules/FindDoxygen.cmake
+++ b/Modules/FindDoxygen.cmake
@@ -33,19 +33,19 @@
# License text for the above reference.)
# For backwards compatibility support
-IF(Doxygen_FIND_QUIETLY)
- SET(DOXYGEN_FIND_QUIETLY TRUE)
-ENDIF(Doxygen_FIND_QUIETLY)
+if(Doxygen_FIND_QUIETLY)
+ set(DOXYGEN_FIND_QUIETLY TRUE)
+endif()
# ===== Rationale for OS X AppBundle mods below =====
# With the OS X GUI version, Doxygen likes to be installed to /Applications and
-# it contains the doxygen executable in the bundle. In the versions I've
-# seen, it is located in Resources, but in general, more often binaries are
+# it contains the doxygen executable in the bundle. In the versions I've
+# seen, it is located in Resources, but in general, more often binaries are
# located in MacOS.
#
-# NOTE: The official Doxygen.app that is distributed for OS X uses non-standard
+# NOTE: The official Doxygen.app that is distributed for OS X uses non-standard
# conventions. Instead of the command-line "doxygen" tool being placed in
-# Doxygen.app/Contents/MacOS, "Doxywizard" is placed there instead and
+# Doxygen.app/Contents/MacOS, "Doxywizard" is placed there instead and
# "doxygen" is placed in Contents/Resources. This is most likely done
# so that something happens when people double-click on the Doxygen.app
# package. Unfortunately, CMake gets confused by this as when it sees the
@@ -54,12 +54,12 @@ ENDIF(Doxygen_FIND_QUIETLY)
# the app-bundle feature, just for this CMake module:
if(APPLE)
# Save the old setting
- SET(TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
+ set(TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
# Disable the App-bundle detection feature
- SET(CMAKE_FIND_APPBUNDLE "NEVER")
+ set(CMAKE_FIND_APPBUNDLE "NEVER")
endif()
# FYI:
-# In the older versions of OS X Doxygen, dot was included with the
+# In the older versions of OS X Doxygen, dot was included with the
# Doxygen bundle. But the new versions require you to download
# Graphviz.app which contains "dot" in it's bundle.
# ============== End OSX stuff ================
@@ -68,7 +68,7 @@ endif()
# Find Doxygen...
#
-FIND_PROGRAM(DOXYGEN_EXECUTABLE
+find_program(DOXYGEN_EXECUTABLE
NAMES doxygen
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\doxygen_is1;Inno Setup: App Path]/bin"
@@ -77,9 +77,9 @@ FIND_PROGRAM(DOXYGEN_EXECUTABLE
DOC "Doxygen documentation generation tool (http://www.doxygen.org)"
)
-IF(DOXYGEN_EXECUTABLE)
- EXECUTE_PROCESS(COMMAND ${DOXYGEN_EXECUTABLE} "--version" OUTPUT_VARIABLE DOXYGEN_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
-ENDIF()
+if(DOXYGEN_EXECUTABLE)
+ execute_process(COMMAND ${DOXYGEN_EXECUTABLE} "--version" OUTPUT_VARIABLE DOXYGEN_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen REQUIRED_VARS DOXYGEN_EXECUTABLE VERSION_VAR DOXYGEN_VERSION)
@@ -88,10 +88,10 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen REQUIRED_VARS DOXYGEN_EXECUTABLE VERSI
# Find Dot...
#
-IF(NOT DOXYGEN_SKIP_DOT)
- FIND_PROGRAM(DOXYGEN_DOT_EXECUTABLE
+if(NOT DOXYGEN_SKIP_DOT)
+ find_program(DOXYGEN_DOT_EXECUTABLE
NAMES dot
- PATHS
+ PATHS
"$ENV{ProgramFiles}/Graphviz 2.21/bin"
"C:/Program Files/Graphviz 2.21/bin"
"$ENV{ProgramFiles}/ATT/Graphviz/bin"
@@ -102,14 +102,14 @@ IF(NOT DOXYGEN_SKIP_DOT)
/Applications/Doxygen.app/Contents/MacOS
DOC "Graphviz Dot tool for using Doxygen"
)
-
+
if(DOXYGEN_DOT_EXECUTABLE)
set(DOXYGEN_DOT_FOUND TRUE)
# The Doxyfile wants the path to Dot, not the entire path and executable
get_filename_component(DOXYGEN_DOT_PATH "${DOXYGEN_DOT_EXECUTABLE}" PATH CACHE)
endif()
-
-endif(NOT DOXYGEN_SKIP_DOT)
+
+endif()
#
# Backwards compatibility...
@@ -117,7 +117,7 @@ endif(NOT DOXYGEN_SKIP_DOT)
if(APPLE)
# Restore the old app-bundle setting setting
- SET(CMAKE_FIND_APPBUNDLE ${TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE})
+ set(CMAKE_FIND_APPBUNDLE ${TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE})
endif()
# Maintain the _FOUND variables as "YES" or "NO" for backwards compatibility
@@ -134,10 +134,10 @@ else()
endif()
# For backwards compatibility support
-SET (DOXYGEN ${DOXYGEN_EXECUTABLE} )
-SET (DOT ${DOXYGEN_DOT_EXECUTABLE} )
+set (DOXYGEN ${DOXYGEN_EXECUTABLE} )
+set (DOT ${DOXYGEN_DOT_EXECUTABLE} )
-MARK_AS_ADVANCED(
+mark_as_advanced(
DOXYGEN_EXECUTABLE
DOXYGEN_DOT_EXECUTABLE
DOXYGEN_DOT_PATH
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index 1bf074357..c681a0dfd 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -19,10 +19,10 @@
# License text for the above reference.)
# Look for the header file.
-FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h)
+find_path(EXPAT_INCLUDE_DIR NAMES expat.h)
# Look for the library.
-FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat)
+find_library(EXPAT_LIBRARY NAMES expat libexpat)
if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
file(STRINGS "${EXPAT_INCLUDE_DIR}/expat.h" expat_version_str
@@ -36,25 +36,25 @@ if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
EXPAT_VERSION_PART "${VLINE}")
if(EXPAT_VERSION_STRING)
set(EXPAT_VERSION_STRING "${EXPAT_VERSION_STRING}.${EXPAT_VERSION_PART}")
- else(EXPAT_VERSION_STRING)
+ else()
set(EXPAT_VERSION_STRING "${EXPAT_VERSION_PART}")
- endif(EXPAT_VERSION_STRING)
+ endif()
endif()
- endforeach(VLINE)
- endforeach(VPART)
-endif (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
+ endforeach()
+ endforeach()
+endif ()
-# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT
REQUIRED_VARS EXPAT_LIBRARY EXPAT_INCLUDE_DIR
VERSION_VAR EXPAT_VERSION_STRING)
# Copy the results to the output variables.
-IF(EXPAT_FOUND)
- SET(EXPAT_LIBRARIES ${EXPAT_LIBRARY})
- SET(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR})
-ENDIF(EXPAT_FOUND)
+if(EXPAT_FOUND)
+ set(EXPAT_LIBRARIES ${EXPAT_LIBRARY})
+ set(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR})
+endif()
-MARK_AS_ADVANCED(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)
+mark_as_advanced(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)
diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake
index 586f77a6e..daae94fad 100644
--- a/Modules/FindFLEX.cmake
+++ b/Modules/FindFLEX.cmake
@@ -8,7 +8,7 @@
# FLEX_INCLUDE_DIRS - The path to the flex headers
#
# The minimum required version of flex can be specified using the
-# standard syntax, e.g. FIND_PACKAGE(FLEX 2.5.13)
+# standard syntax, e.g. find_package(FLEX 2.5.13)
#
#
# If flex is found on the system, the module provides the macro:
@@ -63,73 +63,73 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(FLEX_EXECUTABLE flex DOC "path to the flex executable")
-MARK_AS_ADVANCED(FLEX_EXECUTABLE)
+find_program(FLEX_EXECUTABLE flex DOC "path to the flex executable")
+mark_as_advanced(FLEX_EXECUTABLE)
-FIND_LIBRARY(FL_LIBRARY NAMES fl
+find_library(FL_LIBRARY NAMES fl
DOC "Path to the fl library")
-FIND_PATH(FLEX_INCLUDE_DIR FlexLexer.h
+find_path(FLEX_INCLUDE_DIR FlexLexer.h
DOC "Path to the flex headers")
-MARK_AS_ADVANCED(FL_LIBRARY FLEX_INCLUDE_DIR)
+mark_as_advanced(FL_LIBRARY FLEX_INCLUDE_DIR)
-SET(FLEX_INCLUDE_DIRS ${FLEX_INCLUDE_DIR})
-SET(FLEX_LIBRARIES ${FL_LIBRARY})
+set(FLEX_INCLUDE_DIRS ${FLEX_INCLUDE_DIR})
+set(FLEX_LIBRARIES ${FL_LIBRARY})
-IF(FLEX_EXECUTABLE)
+if(FLEX_EXECUTABLE)
- EXECUTE_PROCESS(COMMAND ${FLEX_EXECUTABLE} --version
+ execute_process(COMMAND ${FLEX_EXECUTABLE} --version
OUTPUT_VARIABLE FLEX_version_output
ERROR_VARIABLE FLEX_version_error
RESULT_VARIABLE FLEX_version_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
- IF(NOT ${FLEX_version_result} EQUAL 0)
- IF(FLEX_FIND_REQUIRED)
- MESSAGE(SEND_ERROR "Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}")
- ELSE()
- MESSAGE("Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}\nFLEX_VERSION will not be available")
- ENDIF()
- ELSE()
+ if(NOT ${FLEX_version_result} EQUAL 0)
+ if(FLEX_FIND_REQUIRED)
+ message(SEND_ERROR "Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}")
+ else()
+ message("Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}\nFLEX_VERSION will not be available")
+ endif()
+ else()
# older versions of flex printed "/full/path/to/executable version X.Y"
# newer versions use "basename(executable) X.Y"
- GET_FILENAME_COMPONENT(FLEX_EXE_NAME "${FLEX_EXECUTABLE}" NAME)
- STRING(REGEX REPLACE "^.*${FLEX_EXE_NAME}\"? (version )?([0-9]+[^ ]*)$" "\\2"
+ get_filename_component(FLEX_EXE_NAME "${FLEX_EXECUTABLE}" NAME)
+ string(REGEX REPLACE "^.*${FLEX_EXE_NAME}\"? (version )?([0-9]+[^ ]*)( .*)?$" "\\2"
FLEX_VERSION "${FLEX_version_output}")
- UNSET(FLEX_EXE_NAME)
- ENDIF()
+ unset(FLEX_EXE_NAME)
+ endif()
#============================================================
# FLEX_TARGET (public macro)
#============================================================
#
- MACRO(FLEX_TARGET Name Input Output)
- SET(FLEX_TARGET_usage "FLEX_TARGET(<Name> <Input> <Output> [COMPILE_FLAGS <string>]")
- IF(${ARGC} GREATER 3)
- IF(${ARGC} EQUAL 5)
- IF("${ARGV3}" STREQUAL "COMPILE_FLAGS")
- SET(FLEX_EXECUTABLE_opts "${ARGV4}")
- SEPARATE_ARGUMENTS(FLEX_EXECUTABLE_opts)
- ELSE()
- MESSAGE(SEND_ERROR ${FLEX_TARGET_usage})
- ENDIF()
- ELSE()
- MESSAGE(SEND_ERROR ${FLEX_TARGET_usage})
- ENDIF()
- ENDIF()
-
- ADD_CUSTOM_COMMAND(OUTPUT ${Output}
+ macro(FLEX_TARGET Name Input Output)
+ set(FLEX_TARGET_usage "FLEX_TARGET(<Name> <Input> <Output> [COMPILE_FLAGS <string>]")
+ if(${ARGC} GREATER 3)
+ if(${ARGC} EQUAL 5)
+ if("${ARGV3}" STREQUAL "COMPILE_FLAGS")
+ set(FLEX_EXECUTABLE_opts "${ARGV4}")
+ separate_arguments(FLEX_EXECUTABLE_opts)
+ else()
+ message(SEND_ERROR ${FLEX_TARGET_usage})
+ endif()
+ else()
+ message(SEND_ERROR ${FLEX_TARGET_usage})
+ endif()
+ endif()
+
+ add_custom_command(OUTPUT ${Output}
COMMAND ${FLEX_EXECUTABLE}
ARGS ${FLEX_EXECUTABLE_opts} -o${Output} ${Input}
DEPENDS ${Input}
COMMENT "[FLEX][${Name}] Building scanner with flex ${FLEX_VERSION}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
- SET(FLEX_${Name}_DEFINED TRUE)
- SET(FLEX_${Name}_OUTPUTS ${Output})
- SET(FLEX_${Name}_INPUT ${Input})
- SET(FLEX_${Name}_COMPILE_FLAGS ${FLEX_EXECUTABLE_opts})
- ENDMACRO(FLEX_TARGET)
+ set(FLEX_${Name}_DEFINED TRUE)
+ set(FLEX_${Name}_OUTPUTS ${Output})
+ set(FLEX_${Name}_INPUT ${Input})
+ set(FLEX_${Name}_COMPILE_FLAGS ${FLEX_EXECUTABLE_opts})
+ endmacro()
#============================================================
@@ -137,24 +137,24 @@ IF(FLEX_EXECUTABLE)
# ADD_FLEX_BISON_DEPENDENCY (public macro)
#============================================================
#
- MACRO(ADD_FLEX_BISON_DEPENDENCY FlexTarget BisonTarget)
+ macro(ADD_FLEX_BISON_DEPENDENCY FlexTarget BisonTarget)
- IF(NOT FLEX_${FlexTarget}_OUTPUTS)
- MESSAGE(SEND_ERROR "Flex target `${FlexTarget}' does not exists.")
- ENDIF()
+ if(NOT FLEX_${FlexTarget}_OUTPUTS)
+ message(SEND_ERROR "Flex target `${FlexTarget}' does not exists.")
+ endif()
- IF(NOT BISON_${BisonTarget}_OUTPUT_HEADER)
- MESSAGE(SEND_ERROR "Bison target `${BisonTarget}' does not exists.")
- ENDIF()
+ if(NOT BISON_${BisonTarget}_OUTPUT_HEADER)
+ message(SEND_ERROR "Bison target `${BisonTarget}' does not exists.")
+ endif()
- SET_SOURCE_FILES_PROPERTIES(${FLEX_${FlexTarget}_OUTPUTS}
+ set_source_files_properties(${FLEX_${FlexTarget}_OUTPUTS}
PROPERTIES OBJECT_DEPENDS ${BISON_${BisonTarget}_OUTPUT_HEADER})
- ENDMACRO(ADD_FLEX_BISON_DEPENDENCY)
+ endmacro()
#============================================================
-ENDIF(FLEX_EXECUTABLE)
+endif()
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLEX REQUIRED_VARS FLEX_EXECUTABLE
VERSION_VAR FLEX_VERSION)
diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake
index bdea95bdc..24cfb87dd 100644
--- a/Modules/FindFLTK.cmake
+++ b/Modules/FindFLTK.cmake
@@ -42,62 +42,64 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF(NOT FLTK_SKIP_OPENGL)
- FIND_PACKAGE(OpenGL)
-ENDIF()
+if(NOT FLTK_SKIP_OPENGL)
+ find_package(OpenGL)
+endif()
# Platform dependent libraries required by FLTK
-IF(WIN32)
- IF(NOT CYGWIN)
- IF(BORLAND)
- SET( FLTK_PLATFORM_DEPENDENT_LIBS import32 )
- ELSE(BORLAND)
- SET( FLTK_PLATFORM_DEPENDENT_LIBS wsock32 comctl32 )
- ENDIF(BORLAND)
- ENDIF(NOT CYGWIN)
-ENDIF(WIN32)
-
-IF(UNIX)
- INCLUDE(FindX11)
- FIND_LIBRARY(FLTK_MATH_LIBRARY m)
- SET( FLTK_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} ${FLTK_MATH_LIBRARY})
-ENDIF(UNIX)
-
-IF(APPLE)
- SET( FLTK_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
-ENDIF(APPLE)
+if(WIN32)
+ if(NOT CYGWIN)
+ if(BORLAND)
+ set( FLTK_PLATFORM_DEPENDENT_LIBS import32 )
+ else()
+ set( FLTK_PLATFORM_DEPENDENT_LIBS wsock32 comctl32 )
+ endif()
+ endif()
+endif()
+
+if(UNIX)
+ include(FindX11)
+ find_library(FLTK_MATH_LIBRARY m)
+ set( FLTK_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} ${FLTK_MATH_LIBRARY})
+endif()
+
+if(APPLE)
+ set( FLTK_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
+endif()
# If FLTK_INCLUDE_DIR is already defined we assigne its value to FLTK_DIR
-IF(FLTK_INCLUDE_DIR)
- SET(FLTK_DIR ${FLTK_INCLUDE_DIR})
-ENDIF(FLTK_INCLUDE_DIR)
+if(FLTK_INCLUDE_DIR)
+ set(FLTK_DIR ${FLTK_INCLUDE_DIR})
+endif()
# If FLTK has been built using CMake we try to find everything directly
-SET(FLTK_DIR_STRING "directory containing FLTKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/fltk for an installation.")
+set(FLTK_DIR_STRING "directory containing FLTKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/fltk for an installation.")
# Search only if the location is not already known.
-IF(NOT FLTK_DIR)
+if(NOT FLTK_DIR)
# Get the system search path as a list.
- FILE(TO_CMAKE_PATH "$ENV{PATH}" FLTK_DIR_SEARCH2)
+ file(TO_CMAKE_PATH "$ENV{PATH}" FLTK_DIR_SEARCH2)
# Construct a set of paths relative to the system search path.
- SET(FLTK_DIR_SEARCH "")
- FOREACH(dir ${FLTK_DIR_SEARCH2})
- SET(FLTK_DIR_SEARCH ${FLTK_DIR_SEARCH} "${dir}/../lib/fltk")
- ENDFOREACH(dir)
- STRING(REPLACE "//" "/" FLTK_DIR_SEARCH "${FLTK_DIR_SEARCH}")
+ set(FLTK_DIR_SEARCH "")
+ foreach(dir ${FLTK_DIR_SEARCH2})
+ set(FLTK_DIR_SEARCH ${FLTK_DIR_SEARCH} "${dir}/../lib/fltk")
+ endforeach()
+ string(REPLACE "//" "/" FLTK_DIR_SEARCH "${FLTK_DIR_SEARCH}")
#
# Look for an installation or build tree.
#
- FIND_PATH(FLTK_DIR FLTKConfig.cmake
+ find_path(FLTK_DIR FLTKConfig.cmake
# Look for an environment variable FLTK_DIR.
- $ENV{FLTK_DIR}
+ HINTS
+ ENV FLTK_DIR
# Look in places relative to the system executable search path.
${FLTK_DIR_SEARCH}
+ PATHS
# Look in standard UNIX install locations.
/usr/local/lib/fltk
/usr/lib/fltk
@@ -122,188 +124,188 @@ IF(NOT FLTK_DIR)
# Help the user find it if we cannot.
DOC "The ${FLTK_DIR_STRING}"
)
-ENDIF(NOT FLTK_DIR)
+endif()
# Check if FLTK was built using CMake
- IF(EXISTS ${FLTK_DIR}/FLTKConfig.cmake)
- SET(FLTK_BUILT_WITH_CMAKE 1)
- ENDIF(EXISTS ${FLTK_DIR}/FLTKConfig.cmake)
+ if(EXISTS ${FLTK_DIR}/FLTKConfig.cmake)
+ set(FLTK_BUILT_WITH_CMAKE 1)
+ endif()
- IF(FLTK_BUILT_WITH_CMAKE)
- SET(FLTK_FOUND 1)
- INCLUDE(${FLTK_DIR}/FLTKConfig.cmake)
+ if(FLTK_BUILT_WITH_CMAKE)
+ set(FLTK_FOUND 1)
+ include(${FLTK_DIR}/FLTKConfig.cmake)
# Fluid
- IF(FLUID_COMMAND)
- SET(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
- ELSE(FLUID_COMMAND)
- FIND_PROGRAM(FLTK_FLUID_EXECUTABLE fluid PATHS
+ if(FLUID_COMMAND)
+ set(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
+ else()
+ find_program(FLTK_FLUID_EXECUTABLE fluid PATHS
${FLTK_EXECUTABLE_DIRS}
${FLTK_EXECUTABLE_DIRS}/RelWithDebInfo
${FLTK_EXECUTABLE_DIRS}/Debug
${FLTK_EXECUTABLE_DIRS}/Release
NO_SYSTEM_PATH)
- ENDIF(FLUID_COMMAND)
- # MARK_AS_ADVANCED(FLTK_FLUID_EXECUTABLE)
+ endif()
+ # mark_as_advanced(FLTK_FLUID_EXECUTABLE)
- SET(FLTK_INCLUDE_DIR ${FLTK_DIR})
- LINK_DIRECTORIES(${FLTK_LIBRARY_DIRS})
+ set(FLTK_INCLUDE_DIR ${FLTK_DIR})
+ link_directories(${FLTK_LIBRARY_DIRS})
- SET(FLTK_BASE_LIBRARY fltk)
- SET(FLTK_GL_LIBRARY fltk_gl)
- SET(FLTK_FORMS_LIBRARY fltk_forms)
- SET(FLTK_IMAGES_LIBRARY fltk_images)
+ set(FLTK_BASE_LIBRARY fltk)
+ set(FLTK_GL_LIBRARY fltk_gl)
+ set(FLTK_FORMS_LIBRARY fltk_forms)
+ set(FLTK_IMAGES_LIBRARY fltk_images)
# Add the extra libraries
- LOAD_CACHE(${FLTK_DIR}
+ load_cache(${FLTK_DIR}
READ_WITH_PREFIX
FL FLTK_USE_SYSTEM_JPEG
FL FLTK_USE_SYSTEM_PNG
FL FLTK_USE_SYSTEM_ZLIB
)
- SET(FLTK_IMAGES_LIBS "")
- IF(FLFLTK_USE_SYSTEM_JPEG)
- SET(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_jpeg)
- ENDIF(FLFLTK_USE_SYSTEM_JPEG)
- IF(FLFLTK_USE_SYSTEM_PNG)
- SET(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_png)
- ENDIF(FLFLTK_USE_SYSTEM_PNG)
- IF(FLFLTK_USE_SYSTEM_ZLIB)
- SET(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_zlib)
- ENDIF(FLFLTK_USE_SYSTEM_ZLIB)
- SET(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL
+ set(FLTK_IMAGES_LIBS "")
+ if(FLFLTK_USE_SYSTEM_JPEG)
+ set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_jpeg)
+ endif()
+ if(FLFLTK_USE_SYSTEM_PNG)
+ set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_png)
+ endif()
+ if(FLFLTK_USE_SYSTEM_ZLIB)
+ set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_zlib)
+ endif()
+ set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL
"Extra libraries for fltk_images library.")
- ELSE(FLTK_BUILT_WITH_CMAKE)
+ else()
# if FLTK was not built using CMake
# Find fluid executable.
- FIND_PROGRAM(FLTK_FLUID_EXECUTABLE fluid ${FLTK_INCLUDE_DIR}/fluid)
+ find_program(FLTK_FLUID_EXECUTABLE fluid ${FLTK_INCLUDE_DIR}/fluid)
# Use location of fluid to help find everything else.
- SET(FLTK_INCLUDE_SEARCH_PATH "")
- SET(FLTK_LIBRARY_SEARCH_PATH "")
- IF(FLTK_FLUID_EXECUTABLE)
- GET_FILENAME_COMPONENT(FLTK_BIN_DIR "${FLTK_FLUID_EXECUTABLE}" PATH)
- SET(FLTK_INCLUDE_SEARCH_PATH ${FLTK_INCLUDE_SEARCH_PATH}
+ set(FLTK_INCLUDE_SEARCH_PATH "")
+ set(FLTK_LIBRARY_SEARCH_PATH "")
+ if(FLTK_FLUID_EXECUTABLE)
+ get_filename_component(FLTK_BIN_DIR "${FLTK_FLUID_EXECUTABLE}" PATH)
+ set(FLTK_INCLUDE_SEARCH_PATH ${FLTK_INCLUDE_SEARCH_PATH}
${FLTK_BIN_DIR}/../include ${FLTK_BIN_DIR}/..)
- SET(FLTK_LIBRARY_SEARCH_PATH ${FLTK_LIBRARY_SEARCH_PATH}
+ set(FLTK_LIBRARY_SEARCH_PATH ${FLTK_LIBRARY_SEARCH_PATH}
${FLTK_BIN_DIR}/../lib)
- SET(FLTK_WRAP_UI 1)
- ENDIF(FLTK_FLUID_EXECUTABLE)
+ set(FLTK_WRAP_UI 1)
+ endif()
#
# Try to find FLTK include dir using fltk-config
#
- IF(UNIX)
+ if(UNIX)
# Use fltk-config to generate a list of possible include directories
- FIND_PROGRAM(FLTK_CONFIG_SCRIPT fltk-config PATHS ${FLTK_BIN_DIR})
- IF(FLTK_CONFIG_SCRIPT)
- IF(NOT FLTK_INCLUDE_DIR)
- EXEC_PROGRAM(${FLTK_CONFIG_SCRIPT} ARGS --cxxflags OUTPUT_VARIABLE FLTK_CXXFLAGS)
- IF(FLTK_CXXFLAGS)
- STRING(REGEX MATCHALL "-I[^ ]*" _fltk_temp_dirs ${FLTK_CXXFLAGS})
- STRING(REPLACE "-I" "" _fltk_temp_dirs "${_fltk_temp_dirs}")
- FOREACH(_dir ${_fltk_temp_dirs})
- STRING(STRIP ${_dir} _output)
- LIST(APPEND _FLTK_POSSIBLE_INCLUDE_DIRS ${_output})
- ENDFOREACH()
- ENDIF(FLTK_CXXFLAGS)
- ENDIF()
- ENDIF()
- ENDIF()
-
- SET(FLTK_INCLUDE_SEARCH_PATH ${FLTK_INCLUDE_SEARCH_PATH}
+ find_program(FLTK_CONFIG_SCRIPT fltk-config PATHS ${FLTK_BIN_DIR})
+ if(FLTK_CONFIG_SCRIPT)
+ if(NOT FLTK_INCLUDE_DIR)
+ exec_program(${FLTK_CONFIG_SCRIPT} ARGS --cxxflags OUTPUT_VARIABLE FLTK_CXXFLAGS)
+ if(FLTK_CXXFLAGS)
+ string(REGEX MATCHALL "-I[^ ]*" _fltk_temp_dirs ${FLTK_CXXFLAGS})
+ string(REPLACE "-I" "" _fltk_temp_dirs "${_fltk_temp_dirs}")
+ foreach(_dir ${_fltk_temp_dirs})
+ string(STRIP ${_dir} _output)
+ list(APPEND _FLTK_POSSIBLE_INCLUDE_DIRS ${_output})
+ endforeach()
+ endif()
+ endif()
+ endif()
+ endif()
+
+ set(FLTK_INCLUDE_SEARCH_PATH ${FLTK_INCLUDE_SEARCH_PATH}
/usr/local/fltk
/usr/X11R6/include
${_FLTK_POSSIBLE_INCLUDE_DIRS}
)
- FIND_PATH(FLTK_INCLUDE_DIR
+ find_path(FLTK_INCLUDE_DIR
NAMES FL/Fl.h FL/Fl.H # fltk 1.1.9 has Fl.H (#8376)
PATHS ${FLTK_INCLUDE_SEARCH_PATH})
-
+
#
# Try to find FLTK library
- IF(UNIX)
- IF(FLTK_CONFIG_SCRIPT)
- EXEC_PROGRAM(${FLTK_CONFIG_SCRIPT} ARGS --libs OUTPUT_VARIABLE _FLTK_POSSIBLE_LIBS)
- IF(_FLTK_POSSIBLE_LIBS)
- GET_FILENAME_COMPONENT(_FLTK_POSSIBLE_LIBRARY_DIR ${_FLTK_POSSIBLE_LIBS} PATH)
- ENDIF()
- ENDIF()
- ENDIF()
-
- SET(FLTK_LIBRARY_SEARCH_PATH ${FLTK_LIBRARY_SEARCH_PATH}
+ if(UNIX)
+ if(FLTK_CONFIG_SCRIPT)
+ exec_program(${FLTK_CONFIG_SCRIPT} ARGS --libs OUTPUT_VARIABLE _FLTK_POSSIBLE_LIBS)
+ if(_FLTK_POSSIBLE_LIBS)
+ get_filename_component(_FLTK_POSSIBLE_LIBRARY_DIR ${_FLTK_POSSIBLE_LIBS} PATH)
+ endif()
+ endif()
+ endif()
+
+ set(FLTK_LIBRARY_SEARCH_PATH ${FLTK_LIBRARY_SEARCH_PATH}
/usr/local/fltk/lib
/usr/X11R6/lib
${FLTK_INCLUDE_DIR}/lib
${_FLTK_POSSIBLE_LIBRARY_DIR}
)
- FIND_LIBRARY(FLTK_BASE_LIBRARY NAMES fltk fltkd
+ find_library(FLTK_BASE_LIBRARY NAMES fltk fltkd
PATHS ${FLTK_LIBRARY_SEARCH_PATH})
- FIND_LIBRARY(FLTK_GL_LIBRARY NAMES fltkgl fltkgld fltk_gl
+ find_library(FLTK_GL_LIBRARY NAMES fltkgl fltkgld fltk_gl
PATHS ${FLTK_LIBRARY_SEARCH_PATH})
- FIND_LIBRARY(FLTK_FORMS_LIBRARY NAMES fltkforms fltkformsd fltk_forms
+ find_library(FLTK_FORMS_LIBRARY NAMES fltkforms fltkformsd fltk_forms
PATHS ${FLTK_LIBRARY_SEARCH_PATH})
- FIND_LIBRARY(FLTK_IMAGES_LIBRARY NAMES fltkimages fltkimagesd fltk_images
+ find_library(FLTK_IMAGES_LIBRARY NAMES fltkimages fltkimagesd fltk_images
PATHS ${FLTK_LIBRARY_SEARCH_PATH})
# Find the extra libraries needed for the fltk_images library.
- IF(UNIX)
- IF(FLTK_CONFIG_SCRIPT)
- EXEC_PROGRAM(${FLTK_CONFIG_SCRIPT} ARGS --use-images --ldflags
+ if(UNIX)
+ if(FLTK_CONFIG_SCRIPT)
+ exec_program(${FLTK_CONFIG_SCRIPT} ARGS --use-images --ldflags
OUTPUT_VARIABLE FLTK_IMAGES_LDFLAGS)
- SET(FLTK_LIBS_EXTRACT_REGEX ".*-lfltk_images (.*) -lfltk.*")
- IF("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}")
- STRING(REGEX REPLACE "${FLTK_LIBS_EXTRACT_REGEX}" "\\1"
+ set(FLTK_LIBS_EXTRACT_REGEX ".*-lfltk_images (.*) -lfltk.*")
+ if("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}")
+ string(REGEX REPLACE "${FLTK_LIBS_EXTRACT_REGEX}" "\\1"
FLTK_IMAGES_LIBS "${FLTK_IMAGES_LDFLAGS}")
- STRING(REGEX REPLACE " +" ";" FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}")
+ string(REGEX REPLACE " +" ";" FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}")
# The EXEC_PROGRAM will not be inherited into subdirectories from
# the file that originally included this module. Save the answer.
- SET(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL
+ set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL
"Extra libraries for fltk_images library.")
- ENDIF("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}")
- ENDIF(FLTK_CONFIG_SCRIPT)
- ENDIF(UNIX)
+ endif()
+ endif()
+ endif()
- ENDIF(FLTK_BUILT_WITH_CMAKE)
+ endif()
# Append all of the required libraries together (by default, everything)
- SET(FLTK_LIBRARIES)
- IF(NOT FLTK_SKIP_IMAGES)
- LIST(APPEND FLTK_LIBRARIES ${FLTK_IMAGES_LIBRARY})
- ENDIF()
- IF(NOT FLTK_SKIP_FORMS)
- LIST(APPEND FLTK_LIBRARIES ${FLTK_FORMS_LIBRARY})
- ENDIF()
- IF(NOT FLTK_SKIP_OPENGL)
- LIST(APPEND FLTK_LIBRARIES ${FLTK_GL_LIBRARY} ${OPENGL_gl_LIBRARY})
- LIST(APPEND FLTK_INCLUDE_DIR ${OPENGL_INCLUDE_DIR})
- LIST(REMOVE_DUPLICATES FLTK_INCLUDE_DIR)
- ENDIF()
- LIST(APPEND FLTK_LIBRARIES ${FLTK_BASE_LIBRARY})
-
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-IF(FLTK_SKIP_FLUID)
+ set(FLTK_LIBRARIES)
+ if(NOT FLTK_SKIP_IMAGES)
+ list(APPEND FLTK_LIBRARIES ${FLTK_IMAGES_LIBRARY})
+ endif()
+ if(NOT FLTK_SKIP_FORMS)
+ list(APPEND FLTK_LIBRARIES ${FLTK_FORMS_LIBRARY})
+ endif()
+ if(NOT FLTK_SKIP_OPENGL)
+ list(APPEND FLTK_LIBRARIES ${FLTK_GL_LIBRARY} ${OPENGL_gl_LIBRARY})
+ list(APPEND FLTK_INCLUDE_DIR ${OPENGL_INCLUDE_DIR})
+ list(REMOVE_DUPLICATES FLTK_INCLUDE_DIR)
+ endif()
+ list(APPEND FLTK_LIBRARIES ${FLTK_BASE_LIBRARY})
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+if(FLTK_SKIP_FLUID)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLTK DEFAULT_MSG FLTK_LIBRARIES FLTK_INCLUDE_DIR)
-ELSE()
+else()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLTK DEFAULT_MSG FLTK_LIBRARIES FLTK_INCLUDE_DIR FLTK_FLUID_EXECUTABLE)
-ENDIF()
+endif()
-IF(FLTK_FOUND)
- IF(APPLE)
- SET(FLTK_LIBRARIES ${FLTK_PLATFORM_DEPENDENT_LIBS} ${FLTK_LIBRARIES})
- ELSE(APPLE)
- SET(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${FLTK_PLATFORM_DEPENDENT_LIBS})
- ENDIF(APPLE)
+if(FLTK_FOUND)
+ if(APPLE)
+ set(FLTK_LIBRARIES ${FLTK_PLATFORM_DEPENDENT_LIBS} ${FLTK_LIBRARIES})
+ else()
+ set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${FLTK_PLATFORM_DEPENDENT_LIBS})
+ endif()
# The following deprecated settings are for compatibility with CMake 1.4
- SET (HAS_FLTK ${FLTK_FOUND})
- SET (FLTK_INCLUDE_PATH ${FLTK_INCLUDE_DIR})
- SET (FLTK_FLUID_EXE ${FLTK_FLUID_EXECUTABLE})
- SET (FLTK_LIBRARY ${FLTK_LIBRARIES})
-ENDIF(FLTK_FOUND)
+ set (HAS_FLTK ${FLTK_FOUND})
+ set (FLTK_INCLUDE_PATH ${FLTK_INCLUDE_DIR})
+ set (FLTK_FLUID_EXE ${FLTK_FLUID_EXECUTABLE})
+ set (FLTK_LIBRARY ${FLTK_LIBRARIES})
+endif()
diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake
index 916474579..071c318ff 100644
--- a/Modules/FindFLTK2.cmake
+++ b/Modules/FindFLTK2.cmake
@@ -23,57 +23,57 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET (FLTK2_DIR $ENV{FLTK2_DIR} )
+set (FLTK2_DIR $ENV{FLTK2_DIR} )
# Platform dependent libraries required by FLTK2
-IF(WIN32)
- IF(NOT CYGWIN)
- IF(BORLAND)
- SET( FLTK2_PLATFORM_DEPENDENT_LIBS import32 )
- ELSE(BORLAND)
- SET( FLTK2_PLATFORM_DEPENDENT_LIBS wsock32 comctl32 )
- ENDIF(BORLAND)
- ENDIF(NOT CYGWIN)
-ENDIF(WIN32)
-
-IF(UNIX)
- INCLUDE(${CMAKE_ROOT}/Modules/FindX11.cmake)
- SET( FLTK2_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} -lm)
-ENDIF(UNIX)
-
-IF(APPLE)
- SET( FLTK2_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
-ENDIF(APPLE)
+if(WIN32)
+ if(NOT CYGWIN)
+ if(BORLAND)
+ set( FLTK2_PLATFORM_DEPENDENT_LIBS import32 )
+ else()
+ set( FLTK2_PLATFORM_DEPENDENT_LIBS wsock32 comctl32 )
+ endif()
+ endif()
+endif()
+
+if(UNIX)
+ include(${CMAKE_ROOT}/Modules/FindX11.cmake)
+ set( FLTK2_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} -lm)
+endif()
+
+if(APPLE)
+ set( FLTK2_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
+endif()
# If FLTK2_INCLUDE_DIR is already defined we assigne its value to FLTK2_DIR
-IF(FLTK2_INCLUDE_DIR)
- SET(FLTK2_DIR ${FLTK2_INCLUDE_DIR})
-ELSE(FLTK2_INCLUDE_DIR)
- SET(FLTK2_INCLUDE_DIR ${FLTK2_DIR})
-ENDIF(FLTK2_INCLUDE_DIR)
+if(FLTK2_INCLUDE_DIR)
+ set(FLTK2_DIR ${FLTK2_INCLUDE_DIR})
+else()
+ set(FLTK2_INCLUDE_DIR ${FLTK2_DIR})
+endif()
# If FLTK2 has been built using CMake we try to find everything directly
-SET(FLTK2_DIR_STRING "directory containing FLTK2Config.cmake. This is either the root of the build tree, or PREFIX/lib/fltk for an installation.")
+set(FLTK2_DIR_STRING "directory containing FLTK2Config.cmake. This is either the root of the build tree, or PREFIX/lib/fltk for an installation.")
# Search only if the location is not already known.
-IF(NOT FLTK2_DIR)
+if(NOT FLTK2_DIR)
# Get the system search path as a list.
- FILE(TO_CMAKE_PATH "$ENV{PATH}" FLTK2_DIR_SEARCH2)
+ file(TO_CMAKE_PATH "$ENV{PATH}" FLTK2_DIR_SEARCH2)
# Construct a set of paths relative to the system search path.
- SET(FLTK2_DIR_SEARCH "")
- FOREACH(dir ${FLTK2_DIR_SEARCH2})
- SET(FLTK2_DIR_SEARCH ${FLTK2_DIR_SEARCH} "${dir}/../lib/fltk")
- ENDFOREACH(dir)
- STRING(REPLACE "//" "/" FLTK2_DIR_SEARCH "${FLTK2_DIR_SEARCH}")
+ set(FLTK2_DIR_SEARCH "")
+ foreach(dir ${FLTK2_DIR_SEARCH2})
+ set(FLTK2_DIR_SEARCH ${FLTK2_DIR_SEARCH} "${dir}/../lib/fltk")
+ endforeach()
+ string(REPLACE "//" "/" FLTK2_DIR_SEARCH "${FLTK2_DIR_SEARCH}")
#
# Look for an installation or build tree.
#
- FIND_PATH(FLTK2_DIR FLTK2Config.cmake
+ find_path(FLTK2_DIR FLTK2Config.cmake
# Look for an environment variable FLTK2_DIR.
- $ENV{FLTK2_DIR}
+ ENV FLTK2_DIR
# Look in places relative to the system executable search path.
${FLTK2_DIR_SEARCH}
@@ -101,167 +101,167 @@ IF(NOT FLTK2_DIR)
DOC "The ${FLTK2_DIR_STRING}"
)
- IF(NOT FLTK2_DIR)
- FIND_PATH(FLTK2_DIR fltk/run.h ${FLTK2_INCLUDE_SEARCH_PATH})
- ENDIF(NOT FLTK2_DIR)
+ if(NOT FLTK2_DIR)
+ find_path(FLTK2_DIR fltk/run.h ${FLTK2_INCLUDE_SEARCH_PATH})
+ endif()
-ENDIF(NOT FLTK2_DIR)
+endif()
# If FLTK2 was found, load the configuration file to get the rest of the
# settings.
-IF(FLTK2_DIR)
+if(FLTK2_DIR)
# Check if FLTK2 was built using CMake
- IF(EXISTS ${FLTK2_DIR}/FLTK2Config.cmake)
- SET(FLTK2_BUILT_WITH_CMAKE 1)
- ENDIF(EXISTS ${FLTK2_DIR}/FLTK2Config.cmake)
+ if(EXISTS ${FLTK2_DIR}/FLTK2Config.cmake)
+ set(FLTK2_BUILT_WITH_CMAKE 1)
+ endif()
- IF(FLTK2_BUILT_WITH_CMAKE)
- SET(FLTK2_FOUND 1)
- INCLUDE(${FLTK2_DIR}/FLTK2Config.cmake)
+ if(FLTK2_BUILT_WITH_CMAKE)
+ set(FLTK2_FOUND 1)
+ include(${FLTK2_DIR}/FLTK2Config.cmake)
# Fluid
- IF(FLUID_COMMAND)
- SET(FLTK2_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
- ELSE(FLUID_COMMAND)
- FIND_PROGRAM(FLTK2_FLUID_EXECUTABLE fluid2 PATHS
+ if(FLUID_COMMAND)
+ set(FLTK2_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
+ else()
+ find_program(FLTK2_FLUID_EXECUTABLE fluid2 PATHS
${FLTK2_EXECUTABLE_DIRS}
${FLTK2_EXECUTABLE_DIRS}/RelWithDebInfo
${FLTK2_EXECUTABLE_DIRS}/Debug
${FLTK2_EXECUTABLE_DIRS}/Release
NO_SYSTEM_PATH)
- ENDIF(FLUID_COMMAND)
+ endif()
- MARK_AS_ADVANCED(FLTK2_FLUID_EXECUTABLE)
- SET( FLTK_FLUID_EXECUTABLE ${FLTK2_FLUID_EXECUTABLE} )
+ mark_as_advanced(FLTK2_FLUID_EXECUTABLE)
+ set( FLTK_FLUID_EXECUTABLE ${FLTK2_FLUID_EXECUTABLE} )
-
- SET(FLTK2_INCLUDE_DIR ${FLTK2_DIR})
- LINK_DIRECTORIES(${FLTK2_LIBRARY_DIRS})
- SET(FLTK2_BASE_LIBRARY fltk2)
- SET(FLTK2_GL_LIBRARY fltk2_gl)
- SET(FLTK2_IMAGES_LIBRARY fltk2_images)
+ set(FLTK2_INCLUDE_DIR ${FLTK2_DIR})
+ link_directories(${FLTK2_LIBRARY_DIRS})
+
+ set(FLTK2_BASE_LIBRARY fltk2)
+ set(FLTK2_GL_LIBRARY fltk2_gl)
+ set(FLTK2_IMAGES_LIBRARY fltk2_images)
# Add the extra libraries
- LOAD_CACHE(${FLTK2_DIR}
+ load_cache(${FLTK2_DIR}
READ_WITH_PREFIX
FL FLTK2_USE_SYSTEM_JPEG
FL FLTK2_USE_SYSTEM_PNG
FL FLTK2_USE_SYSTEM_ZLIB
)
- SET(FLTK2_IMAGES_LIBS "")
- IF(FLFLTK2_USE_SYSTEM_JPEG)
- SET(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_jpeg)
- ENDIF(FLFLTK2_USE_SYSTEM_JPEG)
- IF(FLFLTK2_USE_SYSTEM_PNG)
- SET(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_png)
- ENDIF(FLFLTK2_USE_SYSTEM_PNG)
- IF(FLFLTK2_USE_SYSTEM_ZLIB)
- SET(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_zlib)
- ENDIF(FLFLTK2_USE_SYSTEM_ZLIB)
- SET(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL
+ set(FLTK2_IMAGES_LIBS "")
+ if(FLFLTK2_USE_SYSTEM_JPEG)
+ set(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_jpeg)
+ endif()
+ if(FLFLTK2_USE_SYSTEM_PNG)
+ set(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_png)
+ endif()
+ if(FLFLTK2_USE_SYSTEM_ZLIB)
+ set(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_zlib)
+ endif()
+ set(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL
"Extra libraries for fltk2_images library.")
- ELSE(FLTK2_BUILT_WITH_CMAKE)
+ else()
# if FLTK2 was not built using CMake
# Find fluid executable.
- FIND_PROGRAM(FLTK2_FLUID_EXECUTABLE fluid2 ${FLTK2_INCLUDE_DIR}/fluid)
+ find_program(FLTK2_FLUID_EXECUTABLE fluid2 ${FLTK2_INCLUDE_DIR}/fluid)
# Use location of fluid to help find everything else.
- SET(FLTK2_INCLUDE_SEARCH_PATH "")
- SET(FLTK2_LIBRARY_SEARCH_PATH "")
- IF(FLTK2_FLUID_EXECUTABLE)
- SET( FLTK_FLUID_EXECUTABLE ${FLTK2_FLUID_EXECUTABLE} )
- GET_FILENAME_COMPONENT(FLTK2_BIN_DIR "${FLTK2_FLUID_EXECUTABLE}" PATH)
- SET(FLTK2_INCLUDE_SEARCH_PATH ${FLTK2_INCLUDE_SEARCH_PATH}
+ set(FLTK2_INCLUDE_SEARCH_PATH "")
+ set(FLTK2_LIBRARY_SEARCH_PATH "")
+ if(FLTK2_FLUID_EXECUTABLE)
+ set( FLTK_FLUID_EXECUTABLE ${FLTK2_FLUID_EXECUTABLE} )
+ get_filename_component(FLTK2_BIN_DIR "${FLTK2_FLUID_EXECUTABLE}" PATH)
+ set(FLTK2_INCLUDE_SEARCH_PATH ${FLTK2_INCLUDE_SEARCH_PATH}
${FLTK2_BIN_DIR}/../include ${FLTK2_BIN_DIR}/..)
- SET(FLTK2_LIBRARY_SEARCH_PATH ${FLTK2_LIBRARY_SEARCH_PATH}
+ set(FLTK2_LIBRARY_SEARCH_PATH ${FLTK2_LIBRARY_SEARCH_PATH}
${FLTK2_BIN_DIR}/../lib)
- SET(FLTK2_WRAP_UI 1)
- ENDIF(FLTK2_FLUID_EXECUTABLE)
+ set(FLTK2_WRAP_UI 1)
+ endif()
- SET(FLTK2_INCLUDE_SEARCH_PATH ${FLTK2_INCLUDE_SEARCH_PATH}
+ set(FLTK2_INCLUDE_SEARCH_PATH ${FLTK2_INCLUDE_SEARCH_PATH}
/usr/local/fltk2
/usr/X11R6/include
)
- FIND_PATH(FLTK2_INCLUDE_DIR fltk/run.h ${FLTK2_INCLUDE_SEARCH_PATH})
+ find_path(FLTK2_INCLUDE_DIR fltk/run.h ${FLTK2_INCLUDE_SEARCH_PATH})
- SET(FLTK2_LIBRARY_SEARCH_PATH ${FLTK2_LIBRARY_SEARCH_PATH}
+ set(FLTK2_LIBRARY_SEARCH_PATH ${FLTK2_LIBRARY_SEARCH_PATH}
/usr/local/fltk2/lib
/usr/X11R6/lib
${FLTK2_INCLUDE_DIR}/lib
)
- FIND_LIBRARY(FLTK2_BASE_LIBRARY NAMES fltk2
+ find_library(FLTK2_BASE_LIBRARY NAMES fltk2
PATHS ${FLTK2_LIBRARY_SEARCH_PATH})
- FIND_LIBRARY(FLTK2_GL_LIBRARY NAMES fltk2_gl
+ find_library(FLTK2_GL_LIBRARY NAMES fltk2_gl
PATHS ${FLTK2_LIBRARY_SEARCH_PATH})
- FIND_LIBRARY(FLTK2_IMAGES_LIBRARY NAMES fltk2_images
+ find_library(FLTK2_IMAGES_LIBRARY NAMES fltk2_images
PATHS ${FLTK2_LIBRARY_SEARCH_PATH})
# Find the extra libraries needed for the fltk_images library.
- IF(UNIX)
- FIND_PROGRAM(FLTK2_CONFIG_SCRIPT fltk2-config PATHS ${FLTK2_BIN_DIR})
- IF(FLTK2_CONFIG_SCRIPT)
- EXEC_PROGRAM(${FLTK2_CONFIG_SCRIPT} ARGS --use-images --ldflags
+ if(UNIX)
+ find_program(FLTK2_CONFIG_SCRIPT fltk2-config PATHS ${FLTK2_BIN_DIR})
+ if(FLTK2_CONFIG_SCRIPT)
+ exec_program(${FLTK2_CONFIG_SCRIPT} ARGS --use-images --ldflags
OUTPUT_VARIABLE FLTK2_IMAGES_LDFLAGS)
- SET(FLTK2_LIBS_EXTRACT_REGEX ".*-lfltk2_images (.*) -lfltk2.*")
- IF("${FLTK2_IMAGES_LDFLAGS}" MATCHES "${FLTK2_LIBS_EXTRACT_REGEX}")
- STRING(REGEX REPLACE "${FLTK2_LIBS_EXTRACT_REGEX}" "\\1"
+ set(FLTK2_LIBS_EXTRACT_REGEX ".*-lfltk2_images (.*) -lfltk2.*")
+ if("${FLTK2_IMAGES_LDFLAGS}" MATCHES "${FLTK2_LIBS_EXTRACT_REGEX}")
+ string(REGEX REPLACE "${FLTK2_LIBS_EXTRACT_REGEX}" "\\1"
FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LDFLAGS}")
- STRING(REGEX REPLACE " +" ";" FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}")
+ string(REGEX REPLACE " +" ";" FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}")
# The EXEC_PROGRAM will not be inherited into subdirectories from
# the file that originally included this module. Save the answer.
- SET(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL
+ set(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL
"Extra libraries for fltk_images library.")
- ENDIF("${FLTK2_IMAGES_LDFLAGS}" MATCHES "${FLTK2_LIBS_EXTRACT_REGEX}")
- ENDIF(FLTK2_CONFIG_SCRIPT)
- ENDIF(UNIX)
+ endif()
+ endif()
+ endif()
- ENDIF(FLTK2_BUILT_WITH_CMAKE)
-ENDIF(FLTK2_DIR)
+ endif()
+endif()
-SET(FLTK2_FOUND 1)
-FOREACH(var FLTK2_FLUID_EXECUTABLE FLTK2_INCLUDE_DIR
+set(FLTK2_FOUND 1)
+foreach(var FLTK2_FLUID_EXECUTABLE FLTK2_INCLUDE_DIR
FLTK2_BASE_LIBRARY FLTK2_GL_LIBRARY
FLTK2_IMAGES_LIBRARY)
- IF(NOT ${var})
- MESSAGE( STATUS "${var} not found" )
- SET(FLTK2_FOUND 0)
- ENDIF(NOT ${var})
-ENDFOREACH(var)
+ if(NOT ${var})
+ message( STATUS "${var} not found" )
+ set(FLTK2_FOUND 0)
+ endif()
+endforeach()
-IF(FLTK2_FOUND)
- SET(FLTK2_LIBRARIES ${FLTK2_IMAGES_LIBRARY} ${FLTK2_IMAGES_LIBS} ${FLTK2_BASE_LIBRARY} ${FLTK2_GL_LIBRARY} )
- IF(APPLE)
- SET(FLTK2_LIBRARIES ${FLTK2_PLATFORM_DEPENDENT_LIBS} ${FLTK2_LIBRARIES})
- ELSE(APPLE)
- SET(FLTK2_LIBRARIES ${FLTK2_LIBRARIES} ${FLTK2_PLATFORM_DEPENDENT_LIBS})
- ENDIF(APPLE)
+if(FLTK2_FOUND)
+ set(FLTK2_LIBRARIES ${FLTK2_IMAGES_LIBRARY} ${FLTK2_IMAGES_LIBS} ${FLTK2_BASE_LIBRARY} ${FLTK2_GL_LIBRARY} )
+ if(APPLE)
+ set(FLTK2_LIBRARIES ${FLTK2_PLATFORM_DEPENDENT_LIBS} ${FLTK2_LIBRARIES})
+ else()
+ set(FLTK2_LIBRARIES ${FLTK2_LIBRARIES} ${FLTK2_PLATFORM_DEPENDENT_LIBS})
+ endif()
# The following deprecated settings are for compatibility with CMake 1.4
- SET (HAS_FLTK2 ${FLTK2_FOUND})
- SET (FLTK2_INCLUDE_PATH ${FLTK2_INCLUDE_DIR})
- SET (FLTK2_FLUID_EXE ${FLTK2_FLUID_EXECUTABLE})
- SET (FLTK2_LIBRARY ${FLTK2_LIBRARIES})
-ELSE(FLTK2_FOUND)
+ set (HAS_FLTK2 ${FLTK2_FOUND})
+ set (FLTK2_INCLUDE_PATH ${FLTK2_INCLUDE_DIR})
+ set (FLTK2_FLUID_EXE ${FLTK2_FLUID_EXECUTABLE})
+ set (FLTK2_LIBRARY ${FLTK2_LIBRARIES})
+else()
# make FIND_PACKAGE friendly
- IF(NOT FLTK2_FIND_QUIETLY)
- IF(FLTK2_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR
+ if(NOT FLTK2_FIND_QUIETLY)
+ if(FLTK2_FIND_REQUIRED)
+ message(FATAL_ERROR
"FLTK2 required, please specify its location with FLTK2_DIR.")
- ELSE(FLTK2_FIND_REQUIRED)
- MESSAGE(STATUS "FLTK2 was not found.")
- ENDIF(FLTK2_FIND_REQUIRED)
- ENDIF(NOT FLTK2_FIND_QUIETLY)
-ENDIF(FLTK2_FOUND)
+ else()
+ message(STATUS "FLTK2 was not found.")
+ endif()
+ endif()
+endif()
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake
index e6f670256..cdb46beff 100644
--- a/Modules/FindFreetype.cmake
+++ b/Modules/FindFreetype.cmake
@@ -38,34 +38,35 @@
# Then from there, they need to set a bunch of #define's
# so you can do something like:
# #include FT_FREETYPE_H
-# Unfortunately, using CMake's mechanisms like INCLUDE_DIRECTORIES()
+# Unfortunately, using CMake's mechanisms like include_directories()
# wants explicit full paths and this trickery doesn't work too well.
# I'm going to attempt to cut out the middleman and hope
# everything still works.
-FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
+find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
HINTS
- $ENV{FREETYPE_DIR}
+ ENV FREETYPE_DIR
PATHS
- /usr/local/X11R6/include
- /usr/local/X11/include
- /usr/freeware/include
+ /usr/local/X11R6
+ /usr/local/X11
+ /usr/freeware
+ PATH_SUFFIXES include/freetype2 include
)
-FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
+find_path(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
HINTS
- $ENV{FREETYPE_DIR}/include/freetype2
+ ENV FREETYPE_DIR
PATHS
- /usr/local/X11R6/include
- /usr/local/X11/include
- /usr/freeware/include
- PATH_SUFFIXES freetype2
+ /usr/local/X11R6
+ /usr/local/X11
+ /usr/freeware
+ PATH_SUFFIXES include/freetype2 include
)
-FIND_LIBRARY(FREETYPE_LIBRARY
+find_library(FREETYPE_LIBRARY
NAMES freetype libfreetype freetype219
HINTS
- $ENV{FREETYPE_DIR}
- PATH_SUFFIXES lib64 lib
+ ENV FREETYPE_DIR
+ PATH_SUFFIXES lib
PATHS
/usr/local/X11R6
/usr/local/X11
@@ -73,38 +74,38 @@ FIND_LIBRARY(FREETYPE_LIBRARY
)
# set the user variables
-IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
- SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
-ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
-SET(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
+if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
+ set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
+endif()
+set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
-IF(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
- FILE(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h" freetype_version_str
+if(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
+ file(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h" freetype_version_str
REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
- UNSET(FREETYPE_VERSION_STRING)
- FOREACH(VPART MAJOR MINOR PATCH)
- FOREACH(VLINE ${freetype_version_str})
- IF(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}")
- STRING(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1"
+ unset(FREETYPE_VERSION_STRING)
+ foreach(VPART MAJOR MINOR PATCH)
+ foreach(VLINE ${freetype_version_str})
+ if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}")
+ string(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1"
FREETYPE_VERSION_PART "${VLINE}")
- IF(FREETYPE_VERSION_STRING)
- SET(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
- ELSE(FREETYPE_VERSION_STRING)
- SET(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
- ENDIF(FREETYPE_VERSION_STRING)
- UNSET(FREETYPE_VERSION_PART)
- ENDIF()
- ENDFOREACH(VLINE)
- ENDFOREACH(VPART)
-ENDIF(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
+ if(FREETYPE_VERSION_STRING)
+ set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
+ else()
+ set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
+ endif()
+ unset(FREETYPE_VERSION_PART)
+ endif()
+ endforeach()
+ endforeach()
+endif()
# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype
REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS
VERSION_VAR FREETYPE_VERSION_STRING)
-MARK_AS_ADVANCED(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build)
+mark_as_advanced(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build)
diff --git a/Modules/FindGCCXML.cmake b/Modules/FindGCCXML.cmake
index 261a5d180..05f08a639 100644
--- a/Modules/FindGCCXML.cmake
+++ b/Modules/FindGCCXML.cmake
@@ -16,7 +16,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(GCCXML
+find_program(GCCXML
NAMES gccxml
../GCC_XML/gccxml
PATHS [HKEY_CURRENT_USER\\Software\\Kitware\\GCC_XML;loc]
@@ -24,4 +24,4 @@ FIND_PROGRAM(GCCXML
"C:/Program Files/GCC_XML"
)
-MARK_AS_ADVANCED(GCCXML)
+mark_as_advanced(GCCXML)
diff --git a/Modules/FindGDAL.cmake b/Modules/FindGDAL.cmake
index c31bef5ca..6e898474b 100644
--- a/Modules/FindGDAL.cmake
+++ b/Modules/FindGDAL.cmake
@@ -28,22 +28,22 @@
# correspond to the ./configure --prefix=$GDAL_DIR
# used in building gdal.
#
-# Created by Eric Wing. I'm not a gdal user, but OpenSceneGraph uses it
+# Created by Eric Wing. I'm not a gdal user, but OpenSceneGraph uses it
# for osgTerrain so I whipped this module together for completeness.
# I actually don't know the conventions or where files are typically
# placed in distros.
# Any real gdal users are encouraged to correct this (but please don't
-# break the OS X framework stuff when doing so which is what usually seems
+# break the OS X framework stuff when doing so which is what usually seems
# to happen).
# This makes the presumption that you are include gdal.h like
#
#include "gdal.h"
-FIND_PATH(GDAL_INCLUDE_DIR gdal.h
+find_path(GDAL_INCLUDE_DIR gdal.h
HINTS
- $ENV{GDAL_DIR}
- $ENV{GDAL_ROOT}
+ ENV GDAL_DIR
+ ENV GDAL_ROOT
PATH_SUFFIXES
include/gdal
include/GDAL
@@ -57,15 +57,15 @@ FIND_PATH(GDAL_INCLUDE_DIR gdal.h
/opt
)
-IF(UNIX)
+if(UNIX)
# Use gdal-config to obtain the library version (this should hopefully
# allow us to -lgdal1.x.y where x.y are correct version)
# For some reason, libgdal development packages do not contain
# libgdal.so...
- FIND_PROGRAM(GDAL_CONFIG gdal-config
+ find_program(GDAL_CONFIG gdal-config
HINTS
- $ENV{GDAL_DIR}
- $ENV{GDAL_ROOT}
+ ENV GDAL_DIR
+ ENV GDAL_ROOT
PATH_SUFFIXES bin
PATHS
/sw # Fink
@@ -85,13 +85,13 @@ IF(UNIX)
endif()
endif()
-FIND_LIBRARY(GDAL_LIBRARY
+find_library(GDAL_LIBRARY
NAMES ${_gdal_lib} gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
HINTS
- $ENV{GDAL_DIR}
- $ENV{GDAL_ROOT}
+ ENV GDAL_DIR
+ ENV GDAL_ROOT
${_gdal_libpath}
- PATH_SUFFIXES lib64 lib
+ PATH_SUFFIXES lib
PATHS
/sw
/opt/local
diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake
index 41e909805..6a665ad7e 100644
--- a/Modules/FindGIF.cmake
+++ b/Modules/FindGIF.cmake
@@ -5,7 +5,7 @@
# GIF_VERSION, reports either version 4 or 3 (for everything before version 4)
#
# The minimum required version of giflib can be specified using the
-# standard syntax, e.g. FIND_PACKAGE(GIF 4)
+# standard syntax, e.g. find_package(GIF 4)
#
# $GIF_DIR is an environment variable that would
# correspond to the ./configure --prefix=$GIF_DIR
@@ -26,9 +26,9 @@
# Created by Eric Wing.
# Modifications by Alexander Neundorf
-FIND_PATH(GIF_INCLUDE_DIR gif_lib.h
+find_path(GIF_INCLUDE_DIR gif_lib.h
HINTS
- $ENV{GIF_DIR}
+ ENV GIF_DIR
PATH_SUFFIXES include
PATHS
~/Library/Frameworks
@@ -36,20 +36,20 @@ FIND_PATH(GIF_INCLUDE_DIR gif_lib.h
)
# the gif library can have many names :-/
-SET(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib giflib4)
+set(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib giflib4)
-FIND_LIBRARY(GIF_LIBRARY
+find_library(GIF_LIBRARY
NAMES ${POTENTIAL_GIF_LIBS}
HINTS
- $ENV{GIF_DIR}
- PATH_SUFFIXES lib64 lib
+ ENV GIF_DIR
+ PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/usr/freeware
)
# see readme.txt
-SET(GIF_LIBRARIES ${GIF_LIBRARY})
+set(GIF_LIBRARIES ${GIF_LIBRARY})
# Very basic version detection.
# The GIF_LIB_VERSION string in gif_lib.h seems to be unreliable, since it seems
@@ -57,24 +57,24 @@ SET(GIF_LIBRARIES ${GIF_LIBRARY})
# In version 4 the member UserData was added to GifFileType, so we check for this
# one.
# http://giflib.sourcearchive.com/documentation/4.1.4/files.html
-IF(GIF_INCLUDE_DIR)
- INCLUDE(CMakePushCheckState)
- INCLUDE(CheckStructHasMember)
+if(GIF_INCLUDE_DIR)
+ include(CMakePushCheckState)
+ include(CheckStructHasMember)
CMAKE_PUSH_CHECK_STATE()
- SET(GIF_VERSION 3)
- SET(CMAKE_REQUIRED_INCLUDES "${GIF_INCLUDE_DIR}")
+ set(GIF_VERSION 3)
+ set(CMAKE_REQUIRED_INCLUDES "${GIF_INCLUDE_DIR}")
CHECK_STRUCT_HAS_MEMBER(GifFileType UserData gif_lib.h GIF_GifFileType_UserData )
- IF(GIF_GifFileType_UserData)
- SET(GIF_VERSION 4)
- ENDIF()
+ if(GIF_GifFileType_UserData)
+ set(GIF_VERSION 4)
+ endif()
CMAKE_POP_CHECK_STATE()
-ENDIF()
+endif()
# handle the QUIETLY and REQUIRED arguments and set GIF_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GIF REQUIRED_VARS GIF_LIBRARY GIF_INCLUDE_DIR
VERSION_VAR GIF_VERSION )
-MARK_AS_ADVANCED(GIF_INCLUDE_DIR GIF_LIBRARY)
+mark_as_advanced(GIF_INCLUDE_DIR GIF_LIBRARY)
diff --git a/Modules/FindGLEW.cmake b/Modules/FindGLEW.cmake
new file mode 100644
index 000000000..37dff0324
--- /dev/null
+++ b/Modules/FindGLEW.cmake
@@ -0,0 +1,30 @@
+# - Find the OpenGL Extension Wrangler Library (GLEW)
+# This module defines the following variables:
+# GLEW_INCLUDE_DIRS - include directories for GLEW
+# GLEW_LIBRARIES - libraries to link against GLEW
+# GLEW_FOUND - true if GLEW has been found and can be used
+
+#=============================================================================
+# Copyright 2012 Benjamin Eikel
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+find_path(GLEW_INCLUDE_DIR GL/glew.h)
+find_library(GLEW_LIBRARY NAMES GLEW glew32 glew glew32s PATH_SUFFIXES lib64)
+
+set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
+set(GLEW_LIBRARIES ${GLEW_LIBRARY})
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+find_package_handle_standard_args(GLEW
+ REQUIRED_VARS GLEW_INCLUDE_DIR GLEW_LIBRARY)
+
+mark_as_advanced(GLEW_INCLUDE_DIR GLEW_LIBRARY)
diff --git a/Modules/FindGLU.cmake b/Modules/FindGLU.cmake
index 5198f11e1..d87945ada 100644
--- a/Modules/FindGLU.cmake
+++ b/Modules/FindGLU.cmake
@@ -16,13 +16,13 @@
# GLU library is now found by FindOpenGL.cmake
#
-MESSAGE(STATUS
+message(STATUS
"WARNING: you are using the obsolete 'GLU' package, please use 'OpenGL' instead")
-INCLUDE(FindOpenGL)
+include(FindOpenGL)
-IF (OPENGL_GLU_FOUND)
- SET (GLU_LIBRARY ${OPENGL_LIBRARIES})
- SET (GLU_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
-ENDIF (OPENGL_GLU_FOUND)
+if (OPENGL_GLU_FOUND)
+ set (GLU_LIBRARY ${OPENGL_LIBRARIES})
+ set (GLU_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
+endif ()
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake
index 82057792d..55790ae7c 100644
--- a/Modules/FindGLUT.cmake
+++ b/Modules/FindGLUT.cmake
@@ -20,69 +20,69 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF (WIN32)
- FIND_PATH( GLUT_INCLUDE_DIR NAMES GL/glut.h
+if (WIN32)
+ find_path( GLUT_INCLUDE_DIR NAMES GL/glut.h
PATHS ${GLUT_ROOT_PATH}/include )
- FIND_LIBRARY( GLUT_glut_LIBRARY NAMES glut glut32 freeglut
+ find_library( GLUT_glut_LIBRARY NAMES glut glut32 freeglut
PATHS
${OPENGL_LIBRARY_DIR}
${GLUT_ROOT_PATH}/Release
)
-ELSE (WIN32)
-
- IF (APPLE)
+else ()
+
+ if (APPLE)
# These values for Apple could probably do with improvement.
- FIND_PATH( GLUT_INCLUDE_DIR glut.h
+ find_path( GLUT_INCLUDE_DIR glut.h
/System/Library/Frameworks/GLUT.framework/Versions/A/Headers
${OPENGL_LIBRARY_DIR}
)
- SET(GLUT_glut_LIBRARY "-framework GLUT" CACHE STRING "GLUT library for OSX")
- SET(GLUT_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
- ELSE (APPLE)
-
- FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h
+ set(GLUT_glut_LIBRARY "-framework GLUT" CACHE STRING "GLUT library for OSX")
+ set(GLUT_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
+ else ()
+
+ find_path( GLUT_INCLUDE_DIR GL/glut.h
/usr/include/GL
/usr/openwin/share/include
/usr/openwin/include
/opt/graphics/OpenGL/include
/opt/graphics/OpenGL/contrib/libglut
)
-
- FIND_LIBRARY( GLUT_glut_LIBRARY glut
+
+ find_library( GLUT_glut_LIBRARY glut
/usr/openwin/lib
)
-
- FIND_LIBRARY( GLUT_Xi_LIBRARY Xi
+
+ find_library( GLUT_Xi_LIBRARY Xi
/usr/openwin/lib
)
-
- FIND_LIBRARY( GLUT_Xmu_LIBRARY Xmu
+
+ find_library( GLUT_Xmu_LIBRARY Xmu
/usr/openwin/lib
)
-
- ENDIF (APPLE)
-
-ENDIF (WIN32)
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+ endif ()
+
+endif ()
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLUT REQUIRED_VARS GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
-IF (GLUT_FOUND)
+if (GLUT_FOUND)
# Is -lXi and -lXmu required on all platforms that have it?
# If not, we need some way to figure out what platform we are on.
- SET( GLUT_LIBRARIES
+ set( GLUT_LIBRARIES
${GLUT_glut_LIBRARY}
${GLUT_Xmu_LIBRARY}
${GLUT_Xi_LIBRARY}
${GLUT_cocoa_LIBRARY}
)
-
+
#The following deprecated settings are for backwards compatibility with CMake1.4
- SET (GLUT_LIBRARY ${GLUT_LIBRARIES})
- SET (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR})
-ENDIF(GLUT_FOUND)
+ set (GLUT_LIBRARY ${GLUT_LIBRARIES})
+ set (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR})
+endif()
-MARK_AS_ADVANCED(
+mark_as_advanced(
GLUT_INCLUDE_DIR
GLUT_glut_LIBRARY
GLUT_Xmu_LIBRARY
diff --git a/Modules/FindGTK.cmake b/Modules/FindGTK.cmake
index e9cc62f20..8a44ade41 100644
--- a/Modules/FindGTK.cmake
+++ b/Modules/FindGTK.cmake
@@ -18,9 +18,9 @@
# License text for the above reference.)
# don't even bother under WIN32
-IF(UNIX)
+if(UNIX)
- FIND_PATH( GTK_gtk_INCLUDE_PATH NAMES gtk/gtk.h
+ find_path( GTK_gtk_INCLUDE_PATH NAMES gtk/gtk.h
PATH_SUFFIXES gtk-1.2 gtk12
PATHS
/usr/openwin/share/include
@@ -33,7 +33,7 @@ IF(UNIX)
# for both.
# - Atanas Georgiev <atanas@cs.columbia.edu>
- FIND_PATH( GTK_glibconfig_INCLUDE_PATH NAMES glibconfig.h
+ find_path( GTK_glibconfig_INCLUDE_PATH NAMES glibconfig.h
PATHS
/usr/openwin/share/include
/usr/local/include/glib12
@@ -43,7 +43,7 @@ IF(UNIX)
/opt/gnome/lib/glib/include
)
- FIND_PATH( GTK_glib_INCLUDE_PATH NAMES glib.h
+ find_path( GTK_glib_INCLUDE_PATH NAMES glib.h
PATH_SUFFIXES gtk-1.2 glib-1.2 glib12
PATHS
/usr/openwin/share/include
@@ -51,12 +51,12 @@ IF(UNIX)
/opt/gnome/include
)
- FIND_PATH( GTK_gtkgl_INCLUDE_PATH NAMES gtkgl/gtkglarea.h
+ find_path( GTK_gtkgl_INCLUDE_PATH NAMES gtkgl/gtkglarea.h
PATHS /usr/openwin/share/include
/opt/gnome/include
)
- FIND_LIBRARY( GTK_gtkgl_LIBRARY gtkgl
+ find_library( GTK_gtkgl_LIBRARY gtkgl
/usr/openwin/lib
/opt/gnome/lib
)
@@ -65,43 +65,43 @@ IF(UNIX)
# The 12 suffix is thanks to the FreeBSD ports collection
#
- FIND_LIBRARY( GTK_gtk_LIBRARY
+ find_library( GTK_gtk_LIBRARY
NAMES gtk gtk12
PATHS /usr/openwin/lib
/opt/gnome/lib
)
- FIND_LIBRARY( GTK_gdk_LIBRARY
+ find_library( GTK_gdk_LIBRARY
NAMES gdk gdk12
PATHS /usr/openwin/lib
/opt/gnome/lib
)
- FIND_LIBRARY( GTK_gmodule_LIBRARY
+ find_library( GTK_gmodule_LIBRARY
NAMES gmodule gmodule12
PATHS /usr/openwin/lib
/opt/gnome/lib
)
- FIND_LIBRARY( GTK_glib_LIBRARY
+ find_library( GTK_glib_LIBRARY
NAMES glib glib12
PATHS /usr/openwin/lib
/opt/gnome/lib
)
- FIND_LIBRARY( GTK_Xi_LIBRARY
- NAMES Xi
- PATHS /usr/openwin/lib
- /opt/gnome/lib
- )
+ find_library( GTK_Xi_LIBRARY
+ NAMES Xi
+ PATHS /usr/openwin/lib
+ /opt/gnome/lib
+ )
- FIND_LIBRARY( GTK_gthread_LIBRARY
+ find_library( GTK_gthread_LIBRARY
NAMES gthread gthread12
PATHS /usr/openwin/lib
/opt/gnome/lib
)
- IF(GTK_gtk_INCLUDE_PATH
+ if(GTK_gtk_INCLUDE_PATH
AND GTK_glibconfig_INCLUDE_PATH
AND GTK_glib_INCLUDE_PATH
AND GTK_gtk_LIBRARY
@@ -110,42 +110,38 @@ IF(UNIX)
# Assume that if gtk and glib were found, the other
# supporting libraries have also been found.
- SET( GTK_FOUND "YES" )
- SET( GTK_INCLUDE_DIR ${GTK_gtk_INCLUDE_PATH}
+ set( GTK_FOUND "YES" )
+ set( GTK_INCLUDE_DIR ${GTK_gtk_INCLUDE_PATH}
${GTK_glibconfig_INCLUDE_PATH}
${GTK_glib_INCLUDE_PATH} )
- SET( GTK_LIBRARIES ${GTK_gtk_LIBRARY}
+ set( GTK_LIBRARIES ${GTK_gtk_LIBRARY}
${GTK_gdk_LIBRARY}
${GTK_glib_LIBRARY} )
- IF(GTK_gmodule_LIBRARY)
- SET(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gmodule_LIBRARY})
- ENDIF(GTK_gmodule_LIBRARY)
- IF(GTK_gthread_LIBRARY)
- SET(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gthread_LIBRARY})
- ENDIF(GTK_gthread_LIBRARY)
- IF(GTK_Xi_LIBRARY)
- SET(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_Xi_LIBRARY})
- ENDIF(GTK_Xi_LIBRARY)
-
- IF(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY)
- SET( GTK_GL_FOUND "YES" )
- SET( GTK_INCLUDE_DIR ${GTK_INCLUDE_DIR}
+ if(GTK_gmodule_LIBRARY)
+ set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gmodule_LIBRARY})
+ endif()
+ if(GTK_gthread_LIBRARY)
+ set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gthread_LIBRARY})
+ endif()
+ if(GTK_Xi_LIBRARY)
+ set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_Xi_LIBRARY})
+ endif()
+
+ if(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY)
+ set( GTK_GL_FOUND "YES" )
+ set( GTK_INCLUDE_DIR ${GTK_INCLUDE_DIR}
${GTK_gtkgl_INCLUDE_PATH} )
- SET( GTK_LIBRARIES ${GTK_gtkgl_LIBRARY} ${GTK_LIBRARIES} )
- MARK_AS_ADVANCED(
+ set( GTK_LIBRARIES ${GTK_gtkgl_LIBRARY} ${GTK_LIBRARIES} )
+ mark_as_advanced(
GTK_gtkgl_LIBRARY
GTK_gtkgl_INCLUDE_PATH
)
- ENDIF(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY)
+ endif()
- ENDIF(GTK_gtk_INCLUDE_PATH
- AND GTK_glibconfig_INCLUDE_PATH
- AND GTK_glib_INCLUDE_PATH
- AND GTK_gtk_LIBRARY
- AND GTK_glib_LIBRARY)
+ endif()
- MARK_AS_ADVANCED(
+ mark_as_advanced(
GTK_gdk_LIBRARY
GTK_glib_INCLUDE_PATH
GTK_glib_LIBRARY
@@ -159,7 +155,7 @@ IF(UNIX)
GTK_gtkgl_LIBRARY
)
-ENDIF(UNIX)
+endif()
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index a03c023e4..517a9ac6a 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -54,7 +54,7 @@
#=============================================================================
# Copyright 2009 Kitware, Inc.
-# Copyright 2008-2009 Philip Lowman <philip@yhbt.com>
+# Copyright 2008-2012 Philip Lowman <philip@yhbt.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -66,10 +66,13 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+# Version 1.4 (10/4/2012) (CMake 2.8.10)
+# * 12596: Missing paths for FindGTK2 on NetBSD
+# * 12049: Fixed detection of GTK include files in the lib folder on
+# multiarch systems.
# Version 1.3 (11/9/2010) (CMake 2.8.4)
# * 11429: Add support for detecting GTK2 built with Visual Studio 10.
# Thanks to Vincent Levesque for the patch.
-
# Version 1.2 (8/30/2010) (CMake 2.8.3)
# * Merge patch for detecting gdk-pixbuf library (split off
# from core GTK in 2.21). Thanks to Vincent Untz for the patch
@@ -114,12 +117,12 @@
# _gtkversion_hdr = Header file to parse
#=============================================================
function(_GTK2_GET_VERSION _OUT_major _OUT_minor _OUT_micro _gtkversion_hdr)
- file(READ ${_gtkversion_hdr} _contents)
+ file(STRINGS ${_gtkversion_hdr} _contents REGEX "#define GTK_M[A-Z]+_VERSION[ \t]+")
if(_contents)
string(REGEX REPLACE ".*#define GTK_MAJOR_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_major} "${_contents}")
string(REGEX REPLACE ".*#define GTK_MINOR_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_minor} "${_contents}")
string(REGEX REPLACE ".*#define GTK_MICRO_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_micro} "${_contents}")
-
+
if(NOT ${_OUT_major} MATCHES "[0-9]+")
message(FATAL_ERROR "Version parsing failed for GTK2_MAJOR_VERSION!")
endif()
@@ -151,7 +154,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
"_GTK2_FIND_INCLUDE_DIR( ${_var} ${_hdr} )")
endif()
- set(_relatives
+ set(_gtk_packages
# If these ever change, things will break.
${GTK2_ADDITIONAL_SUFFIXES}
glibmm-2.4
@@ -172,8 +175,15 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
sigc++-2.0
)
+ #
+ # NOTE: The following suffixes cause searching for header files in both of
+ # these directories:
+ # /usr/include/<pkg>
+ # /usr/lib/<pkg>/include
+ #
+
set(_suffixes)
- foreach(_d ${_relatives})
+ foreach(_d ${_gtk_packages})
list(APPEND _suffixes ${_d})
list(APPEND _suffixes ${_d}/include) # for /usr/lib/gtk-2.0/include
endforeach()
@@ -183,8 +193,15 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
"include suffixes = ${_suffixes}")
endif()
+ if(CMAKE_LIBRARY_ARCHITECTURE)
+ set(_gtk2_arch_dir /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE})
+ if(GTK2_DEBUG)
+ message(STATUS "Adding ${_gtk2_arch_dir} to search path for multiarch support")
+ endif()
+ endif()
find_path(${_var} ${_hdr}
PATHS
+ ${_gtk2_arch_dir}
/usr/local/lib64
/usr/local/lib
/usr/lib64
@@ -197,6 +214,8 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
/sw/lib
/opt/local/include
/opt/local/lib
+ /usr/pkg/lib
+ /usr/pkg/include/glib
$ENV{GTKMM_BASEPATH}/include
$ENV{GTKMM_BASEPATH}/lib
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/include
@@ -214,7 +233,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
endif()
endif()
-endfunction(_GTK2_FIND_INCLUDE_DIR)
+endfunction()
#=============================================================
# _GTK2_FIND_LIBRARY
@@ -269,7 +288,7 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version)
set(_lib_list ${_library})
set(_libd_list ${_library_d})
endif()
-
+
if(GTK2_DEBUG)
message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] "
"library list = ${_lib_list} and library debug list = ${_libd_list}")
@@ -301,13 +320,11 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version)
"While searching for ${_var}, our proposed library list is ${_lib_list}")
endif()
- find_library(${_var}
+ find_library(${_var}
NAMES ${_lib_list}
PATHS
/opt/gnome/lib
- /opt/gnome/lib64
/usr/openwin/lib
- /usr/openwin/lib64
/sw/lib
$ENV{GTKMM_BASEPATH}/lib
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/lib
@@ -345,7 +362,7 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version)
set(${_var}_DEBUG ${${_var}})
set(${_var}_DEBUG ${${_var}} PARENT_SCOPE)
endif()
-endfunction(_GTK2_FIND_LIBRARY)
+endfunction()
#=============================================================
@@ -405,8 +422,8 @@ if(GTK2_FIND_VERSION)
else()
message(FATAL_ERROR "GTK2 version check failed. Version ${GTK2_VERSION} was found, at least version ${GTK2_FIND_VERSION} is required")
endif()
- endif()
-
+ endif()
+
# If the version check fails, exit out of the module here
return()
endif()
@@ -425,7 +442,7 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_FIND_INCLUDE_DIR(GTK2_GLIB_INCLUDE_DIR glib.h)
_GTK2_FIND_INCLUDE_DIR(GTK2_GLIBCONFIG_INCLUDE_DIR glibconfig.h)
_GTK2_FIND_LIBRARY (GTK2_GLIB_LIBRARY glib false true)
-
+
_GTK2_FIND_INCLUDE_DIR(GTK2_GOBJECT_INCLUDE_DIR gobject/gobject.h)
_GTK2_FIND_LIBRARY (GTK2_GOBJECT_LIBRARY gobject false true)
@@ -471,6 +488,7 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_FIND_LIBRARY (GTK2_GTKMM_LIBRARY gtkmm true true)
_GTK2_FIND_INCLUDE_DIR(GTK2_CAIROMM_INCLUDE_DIR cairomm/cairomm.h)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_CAIROMMCONFIG_INCLUDE_DIR cairommconfig.h)
_GTK2_FIND_LIBRARY (GTK2_CAIROMM_LIBRARY cairomm true true)
_GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMM_INCLUDE_DIR pangomm.h)
@@ -492,7 +510,7 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_FIND_INCLUDE_DIR(GTK2_GLADE_INCLUDE_DIR glade/glade.h)
_GTK2_FIND_LIBRARY (GTK2_GLADE_LIBRARY glade false true)
-
+
elseif(_GTK2_component STREQUAL "glademm")
_GTK2_FIND_INCLUDE_DIR(GTK2_GLADEMM_INCLUDE_DIR libglademm.h)
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index 6cffb5c59..d531dd12d 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -98,7 +98,7 @@ function(_gtest_find_library _name)
find_library(${_name}
NAMES ${ARGN}
HINTS
- $ENV{GTEST_ROOT}
+ ENV GTEST_ROOT
${GTEST_ROOT}
PATH_SUFFIXES ${_gtest_libpath_suffixes}
)
diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake
index 6dbc02618..1a6bd39dd 100644
--- a/Modules/FindGettext.cmake
+++ b/Modules/FindGettext.cmake
@@ -39,182 +39,173 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
+find_program(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
-FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
+find_program(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
-IF(GETTEXT_MSGMERGE_EXECUTABLE)
- EXECUTE_PROCESS(COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --version
+if(GETTEXT_MSGMERGE_EXECUTABLE)
+ execute_process(COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --version
OUTPUT_VARIABLE gettext_version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
- IF (gettext_version MATCHES "^msgmerge \\(.*\\) [0-9]")
- STRING(REGEX REPLACE "^msgmerge \\([^\\)]*\\) ([0-9\\.]+[^ \n]*).*" "\\1" GETTEXT_VERSION_STRING "${gettext_version}")
- ENDIF()
- UNSET(gettext_version)
-ENDIF(GETTEXT_MSGMERGE_EXECUTABLE)
+ if (gettext_version MATCHES "^msgmerge \\(.*\\) [0-9]")
+ string(REGEX REPLACE "^msgmerge \\([^\\)]*\\) ([0-9\\.]+[^ \n]*).*" "\\1" GETTEXT_VERSION_STRING "${gettext_version}")
+ endif()
+ unset(gettext_version)
+endif()
-INCLUDE(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gettext
REQUIRED_VARS GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE
VERSION_VAR GETTEXT_VERSION_STRING)
-INCLUDE(CMakeParseArguments)
+include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake)
-FUNCTION(_GETTEXT_GET_UNIQUE_TARGET_NAME _name _unique_name)
- SET(propertyName "_GETTEXT_UNIQUE_COUNTER_${_name}")
- GET_PROPERTY(currentCounter GLOBAL PROPERTY "${propertyName}")
- IF(NOT currentCounter)
- SET(currentCounter 1)
- ENDIF()
- SET(${_unique_name} "${_name}_${currentCounter}" PARENT_SCOPE)
- MATH(EXPR currentCounter "${currentCounter} + 1")
- SET_PROPERTY(GLOBAL PROPERTY ${propertyName} ${currentCounter} )
-ENDFUNCTION()
+function(_GETTEXT_GET_UNIQUE_TARGET_NAME _name _unique_name)
+ set(propertyName "_GETTEXT_UNIQUE_COUNTER_${_name}")
+ get_property(currentCounter GLOBAL PROPERTY "${propertyName}")
+ if(NOT currentCounter)
+ set(currentCounter 1)
+ endif()
+ set(${_unique_name} "${_name}_${currentCounter}" PARENT_SCOPE)
+ math(EXPR currentCounter "${currentCounter} + 1")
+ set_property(GLOBAL PROPERTY ${propertyName} ${currentCounter} )
+endfunction()
-MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
+macro(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
# make it a real variable, so we can modify it here
- SET(_firstPoFile "${_firstPoFileArg}")
-
- SET(_gmoFiles)
- GET_FILENAME_COMPONENT(_potName ${_potFile} NAME)
- STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
- GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
-
- SET(_addToAll)
- IF(${_firstPoFile} STREQUAL "ALL")
- SET(_addToAll "ALL")
- SET(_firstPoFile)
- ENDIF(${_firstPoFile} STREQUAL "ALL")
-
- FOREACH (_currentPoFile ${_firstPoFile} ${ARGN})
- GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE)
- GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH)
- GET_FILENAME_COMPONENT(_lang ${_absFile} NAME_WE)
- SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
-
- ADD_CUSTOM_COMMAND(
+ set(_firstPoFile "${_firstPoFileArg}")
+
+ set(_gmoFiles)
+ get_filename_component(_potName ${_potFile} NAME)
+ string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
+ get_filename_component(_absPotFile ${_potFile} ABSOLUTE)
+
+ set(_addToAll)
+ if(${_firstPoFile} STREQUAL "ALL")
+ set(_addToAll "ALL")
+ set(_firstPoFile)
+ endif()
+
+ foreach (_currentPoFile ${_firstPoFile} ${ARGN})
+ get_filename_component(_absFile ${_currentPoFile} ABSOLUTE)
+ get_filename_component(_abs_PATH ${_absFile} PATH)
+ get_filename_component(_lang ${_absFile} NAME_WE)
+ set(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
+
+ add_custom_command(
OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
DEPENDS ${_absPotFile} ${_absFile}
)
- INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
- SET(_gmoFiles ${_gmoFiles} ${_gmoFile})
+ install(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
+ set(_gmoFiles ${_gmoFiles} ${_gmoFile})
- ENDFOREACH (_currentPoFile )
+ endforeach ()
- IF(NOT TARGET translations)
- ADD_CUSTOM_TARGET(translations)
- ENDIF()
+ if(NOT TARGET translations)
+ add_custom_target(translations)
+ endif()
_GETTEXT_GET_UNIQUE_TARGET_NAME(translations uniqueTargetName)
- ADD_CUSTOM_TARGET(${uniqueTargetName} ${_addToAll} DEPENDS ${_gmoFiles})
+ add_custom_target(${uniqueTargetName} ${_addToAll} DEPENDS ${_gmoFiles})
- ADD_DEPENDENCIES(translations ${uniqueTargetName})
+ add_dependencies(translations ${uniqueTargetName})
-ENDMACRO(GETTEXT_CREATE_TRANSLATIONS )
+endmacro()
-FUNCTION(GETTEXT_PROCESS_POT_FILE _potFile)
- SET(_gmoFiles)
- SET(_options ALL)
- SET(_oneValueArgs INSTALL_DESTINATION)
- SET(_multiValueArgs LANGUAGES)
+function(GETTEXT_PROCESS_POT_FILE _potFile)
+ set(_gmoFiles)
+ set(_options ALL)
+ set(_oneValueArgs INSTALL_DESTINATION)
+ set(_multiValueArgs LANGUAGES)
CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
- GET_FILENAME_COMPONENT(_potName ${_potFile} NAME)
- STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
- GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
+ get_filename_component(_potName ${_potFile} NAME)
+ string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
+ get_filename_component(_absPotFile ${_potFile} ABSOLUTE)
- FOREACH (_lang ${_parsedArguments_LANGUAGES})
- SET(_poFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.po")
- SET(_gmoFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo")
+ foreach (_lang ${_parsedArguments_LANGUAGES})
+ set(_poFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.po")
+ set(_gmoFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo")
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT "${_poFile}"
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_poFile} ${_absPotFile}
DEPENDS ${_absPotFile}
)
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT "${_gmoFile}"
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_poFile}
DEPENDS ${_absPotFile} ${_poFile}
)
- IF(_parsedArguments_INSTALL_DESTINATION)
- INSTALL(FILES ${_gmoFile} DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
- ENDIF(_parsedArguments_INSTALL_DESTINATION)
- LIST(APPEND _gmoFiles ${_gmoFile})
- ENDFOREACH (_lang )
+ if(_parsedArguments_INSTALL_DESTINATION)
+ install(FILES ${_gmoFile} DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
+ endif()
+ list(APPEND _gmoFiles ${_gmoFile})
+ endforeach ()
- IF(NOT TARGET potfiles)
- ADD_CUSTOM_TARGET(potfiles)
- ENDIF()
+ if(NOT TARGET potfiles)
+ add_custom_target(potfiles)
+ endif()
_GETTEXT_GET_UNIQUE_TARGET_NAME( potfiles uniqueTargetName)
- IF(_parsedArguments_ALL)
- ADD_CUSTOM_TARGET(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
- ELSE(_parsedArguments_ALL)
- ADD_CUSTOM_TARGET(${uniqueTargetName} DEPENDS ${_gmoFiles})
- ENDIF(_parsedArguments_ALL)
+ if(_parsedArguments_ALL)
+ add_custom_target(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
+ else()
+ add_custom_target(${uniqueTargetName} DEPENDS ${_gmoFiles})
+ endif()
- ADD_DEPENDENCIES(potfiles ${uniqueTargetName})
+ add_dependencies(potfiles ${uniqueTargetName})
-ENDFUNCTION(GETTEXT_PROCESS_POT_FILE)
+endfunction()
-FUNCTION(GETTEXT_PROCESS_PO_FILES _lang)
- SET(_options ALL)
- SET(_oneValueArgs INSTALL_DESTINATION)
- SET(_multiValueArgs PO_FILES)
- SET(_gmoFiles)
+function(GETTEXT_PROCESS_PO_FILES _lang)
+ set(_options ALL)
+ set(_oneValueArgs INSTALL_DESTINATION)
+ set(_multiValueArgs PO_FILES)
+ set(_gmoFiles)
CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
- FOREACH(_current_PO_FILE ${_parsedArguments_PO_FILES})
- GET_FILENAME_COMPONENT(_name ${_current_PO_FILE} NAME)
- STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _basename ${_name})
- SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo)
- ADD_CUSTOM_COMMAND(OUTPUT ${_gmoFile}
+ foreach(_current_PO_FILE ${_parsedArguments_PO_FILES})
+ get_filename_component(_name ${_current_PO_FILE} NAME)
+ string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _basename ${_name})
+ set(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo)
+ add_custom_command(OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
DEPENDS ${_current_PO_FILE}
)
- IF(_parsedArguments_INSTALL_DESTINATION)
- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES/ RENAME ${_basename}.mo)
- ENDIF(_parsedArguments_INSTALL_DESTINATION)
- LIST(APPEND _gmoFiles ${_gmoFile})
- ENDFOREACH(_current_PO_FILE)
+ if(_parsedArguments_INSTALL_DESTINATION)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES/ RENAME ${_basename}.mo)
+ endif()
+ list(APPEND _gmoFiles ${_gmoFile})
+ endforeach()
- IF(NOT TARGET pofiles)
- ADD_CUSTOM_TARGET(pofiles)
- ENDIF()
+ if(NOT TARGET pofiles)
+ add_custom_target(pofiles)
+ endif()
_GETTEXT_GET_UNIQUE_TARGET_NAME( pofiles uniqueTargetName)
- IF(_parsedArguments_ALL)
- ADD_CUSTOM_TARGET(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
- ELSE(_parsedArguments_ALL)
- ADD_CUSTOM_TARGET(${uniqueTargetName} DEPENDS ${_gmoFiles})
- ENDIF(_parsedArguments_ALL)
+ if(_parsedArguments_ALL)
+ add_custom_target(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
+ else()
+ add_custom_target(${uniqueTargetName} DEPENDS ${_gmoFiles})
+ endif()
- ADD_DEPENDENCIES(pofiles ${uniqueTargetName})
+ add_dependencies(pofiles ${uniqueTargetName})
-ENDFUNCTION(GETTEXT_PROCESS_PO_FILES)
-
-IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
- SET(GETTEXT_FOUND TRUE)
-ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
- SET(GETTEXT_FOUND FALSE)
- IF (GetText_REQUIRED)
- MESSAGE(FATAL_ERROR "GetText not found")
- ENDIF (GetText_REQUIRED)
-ENDIF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
+endfunction()
diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake
index f89d1afa3..41d2a7a8c 100644
--- a/Modules/FindGit.cmake
+++ b/Modules/FindGit.cmake
@@ -51,7 +51,7 @@ if(GIT_EXECUTABLE)
string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}")
endif()
unset(git_version)
-endif(GIT_EXECUTABLE)
+endif()
# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
# all listed variables are TRUE
diff --git a/Modules/FindGnuTLS.cmake b/Modules/FindGnuTLS.cmake
index 02f29648a..7315f1dd4 100644
--- a/Modules/FindGnuTLS.cmake
+++ b/Modules/FindGnuTLS.cmake
@@ -26,44 +26,44 @@
# Note that this doesn't try to find the gnutls-extra package.
-IF (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY)
+if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY)
# in cache already
- SET(gnutls_FIND_QUIETLY TRUE)
-ENDIF (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY)
+ set(gnutls_FIND_QUIETLY TRUE)
+endif ()
-IF (NOT WIN32)
+if (NOT WIN32)
# try using pkg-config to get the directories and then use these values
- # in the FIND_PATH() and FIND_LIBRARY() calls
+ # in the find_path() and find_library() calls
# also fills in GNUTLS_DEFINITIONS, although that isn't normally useful
- FIND_PACKAGE(PkgConfig QUIET)
+ find_package(PkgConfig QUIET)
PKG_CHECK_MODULES(PC_GNUTLS QUIET gnutls)
- SET(GNUTLS_DEFINITIONS ${PC_GNUTLS_CFLAGS_OTHER})
- SET(GNUTLS_VERSION_STRING ${PC_GNUTLS_VERSION})
-ENDIF (NOT WIN32)
+ set(GNUTLS_DEFINITIONS ${PC_GNUTLS_CFLAGS_OTHER})
+ set(GNUTLS_VERSION_STRING ${PC_GNUTLS_VERSION})
+endif ()
-FIND_PATH(GNUTLS_INCLUDE_DIR gnutls/gnutls.h
+find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h
HINTS
${PC_GNUTLS_INCLUDEDIR}
${PC_GNUTLS_INCLUDE_DIRS}
)
-FIND_LIBRARY(GNUTLS_LIBRARY NAMES gnutls libgnutls
+find_library(GNUTLS_LIBRARY NAMES gnutls libgnutls
HINTS
${PC_GNUTLS_LIBDIR}
${PC_GNUTLS_LIBRARY_DIRS}
)
-MARK_AS_ADVANCED(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
+mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
-# handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuTLS
REQUIRED_VARS GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR
VERSION_VAR GNUTLS_VERSION_STRING)
-IF(GNUTLS_FOUND)
- SET(GNUTLS_LIBRARIES ${GNUTLS_LIBRARY})
- SET(GNUTLS_INCLUDE_DIRS ${GNUTLS_INCLUDE_DIR})
-ENDIF()
+if(GNUTLS_FOUND)
+ set(GNUTLS_LIBRARIES ${GNUTLS_LIBRARY})
+ set(GNUTLS_INCLUDE_DIRS ${GNUTLS_INCLUDE_DIR})
+endif()
diff --git a/Modules/FindGnuplot.cmake b/Modules/FindGnuplot.cmake
index b8dc3f49a..07af0bf20 100644
--- a/Modules/FindGnuplot.cmake
+++ b/Modules/FindGnuplot.cmake
@@ -21,10 +21,10 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(FindCygwin)
+include(FindCygwin)
-FIND_PROGRAM(GNUPLOT_EXECUTABLE
- NAMES
+find_program(GNUPLOT_EXECUTABLE
+ NAMES
gnuplot
pgnuplot
wgnupl32
@@ -32,26 +32,26 @@ FIND_PROGRAM(GNUPLOT_EXECUTABLE
${CYGWIN_INSTALL_PATH}/bin
)
-IF (GNUPLOT_EXECUTABLE)
- EXECUTE_PROCESS(COMMAND "${GNUPLOT_EXECUTABLE}" --version
+if (GNUPLOT_EXECUTABLE)
+ execute_process(COMMAND "${GNUPLOT_EXECUTABLE}" --version
OUTPUT_VARIABLE GNUPLOT_OUTPUT_VARIABLE
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
- STRING(REGEX REPLACE "^gnuplot ([0-9\\.]+)( patchlevel )?" "\\1." GNUPLOT_VERSION_STRING "${GNUPLOT_OUTPUT_VARIABLE}")
- STRING(REGEX REPLACE "\\.$" "" GNUPLOT_VERSION_STRING "${GNUPLOT_VERSION_STRING}")
- UNSET(GNUPLOT_OUTPUT_VARIABLE)
-ENDIF()
+ string(REGEX REPLACE "^gnuplot ([0-9\\.]+)( patchlevel )?" "\\1." GNUPLOT_VERSION_STRING "${GNUPLOT_OUTPUT_VARIABLE}")
+ string(REGEX REPLACE "\\.$" "" GNUPLOT_VERSION_STRING "${GNUPLOT_VERSION_STRING}")
+ unset(GNUPLOT_OUTPUT_VARIABLE)
+endif()
# for compatibility
-SET(GNUPLOT ${GNUPLOT_EXECUTABLE})
+set(GNUPLOT ${GNUPLOT_EXECUTABLE})
-# handle the QUIETLY and REQUIRED arguments and set GNUPLOT_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set GNUPLOT_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gnuplot
REQUIRED_VARS GNUPLOT_EXECUTABLE
VERSION_VAR GNUPLOT_VERSION_STRING)
-MARK_AS_ADVANCED( GNUPLOT_EXECUTABLE )
+mark_as_advanced( GNUPLOT_EXECUTABLE )
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index bc606389b..33599becf 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -25,7 +25,7 @@
# In addition to finding the includes and libraries required to compile an HDF5
# client application, this module also makes an effort to find tools that come
# with the HDF5 distribution that may be useful for regression testing.
-#
+#
# This module will define the following variables:
# HDF5_INCLUDE_DIRS - Location of the hdf5 includes
# HDF5_INCLUDE_DIR - Location of the hdf5 includes (deprecated)
@@ -64,7 +64,7 @@ include(SelectLibraryConfigurations)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
# List of the valid HDF5 components
-set( HDF5_VALID_COMPONENTS
+set( HDF5_VALID_COMPONENTS
C
CXX
Fortran
@@ -110,10 +110,10 @@ find_program( HDF5_Fortran_COMPILER_EXECUTABLE
DOC "HDF5 Fortran Wrapper compiler. Used only to detect HDF5 compile flags." )
mark_as_advanced( HDF5_Fortran_COMPILER_EXECUTABLE )
-find_program( HDF5_DIFF_EXECUTABLE
+find_program( HDF5_DIFF_EXECUTABLE
NAMES h5diff
HINTS ENV HDF5_ROOT
- PATH_SUFFIXES bin Bin
+ PATH_SUFFIXES bin Bin
DOC "HDF5 file differencing tool." )
mark_as_advanced( HDF5_DIFF_EXECUTABLE )
@@ -121,7 +121,7 @@ mark_as_advanced( HDF5_DIFF_EXECUTABLE )
# return_value argument, the text output is stored to the output variable.
macro( _HDF5_invoke_compiler language output return_value )
if( HDF5_${language}_COMPILER_EXECUTABLE )
- exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE}
+ exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE}
ARGS -show
OUTPUT_VARIABLE ${output}
RETURN_VALUE ${return_value}
@@ -129,14 +129,14 @@ macro( _HDF5_invoke_compiler language output return_value )
if( ${${return_value}} EQUAL 0 )
# do nothing
else()
- message( STATUS
+ message( STATUS
"Unable to determine HDF5 ${language} flags from HDF5 wrapper." )
endif()
endif()
endmacro()
# Parse a compile line for definitions, includes, library paths, and libraries.
-macro( _HDF5_parse_compile_line
+macro( _HDF5_parse_compile_line
compile_line_var
include_paths
definitions
@@ -144,7 +144,7 @@ macro( _HDF5_parse_compile_line
libraries )
# Match the include paths
- string( REGEX MATCHALL "-I([^\" ]+)" include_path_flags
+ string( REGEX MATCHALL "-I([^\" ]+)" include_path_flags
"${${compile_line_var}}"
)
foreach( IPATH ${include_path_flags} )
@@ -163,7 +163,7 @@ macro( _HDF5_parse_compile_line
string( REGEX MATCHALL "-L([^\" ]+|\"[^\"]+\")" library_path_flags
"${${compile_line_var}}"
)
-
+
foreach( LPATH ${library_path_flags} )
string( REGEX REPLACE "^-L" "" LPATH ${LPATH} )
string( REGEX REPLACE "//" "/" LPATH ${LPATH} )
@@ -219,7 +219,7 @@ if( NOT HDF5_FOUND )
${HDF5_C_LIBRARY_NAMES_INIT} )
set( HDF5_Fortran_HL_LIBRARY_NAMES_INIT hdf5hl_fortran
${HDF5_Fortran_LIBRARY_NAMES_INIT} )
-
+
foreach( LANGUAGE ${HDF5_LANGUAGE_BINDINGS} )
if( HDF5_${LANGUAGE}_COMPILE_LINE )
_HDF5_parse_compile_line( HDF5_${LANGUAGE}_COMPILE_LINE
@@ -228,7 +228,7 @@ if( NOT HDF5_FOUND )
HDF5_${LANGUAGE}_LIBRARY_DIRS
HDF5_${LANGUAGE}_LIBRARY_NAMES
)
-
+
# take a guess that the includes may be in the 'include' sibling
# directory of a library directory.
foreach( dir ${HDF5_${LANGUAGE}_LIBRARY_DIRS} )
@@ -238,7 +238,7 @@ if( NOT HDF5_FOUND )
# set the definitions for the language bindings.
list( APPEND HDF5_DEFINITIONS ${HDF5_${LANGUAGE}_DEFINITIONS} )
-
+
# find the HDF5 include directories
if(${LANGUAGE} MATCHES "Fortran.*")
set(HDF5_INCLUDE_FILENAME hdf5.mod)
@@ -251,7 +251,7 @@ if( NOT HDF5_FOUND )
${HDF5_${LANGUAGE}_INCLUDE_FLAGS}
ENV
HDF5_ROOT
- PATHS
+ PATHS
$ENV{HOME}/.local/include
PATH_SUFFIXES
include
@@ -259,11 +259,11 @@ if( NOT HDF5_FOUND )
)
mark_as_advanced( HDF5_${LANGUAGE}_INCLUDE_DIR )
list( APPEND HDF5_INCLUDE_DIRS ${HDF5_${LANGUAGE}_INCLUDE_DIR} )
-
- set( HDF5_${LANGUAGE}_LIBRARY_NAMES
- ${HDF5_${LANGUAGE}_LIBRARY_NAMES_INIT}
+
+ set( HDF5_${LANGUAGE}_LIBRARY_NAMES
+ ${HDF5_${LANGUAGE}_LIBRARY_NAMES_INIT}
${HDF5_${LANGUAGE}_LIBRARY_NAMES} )
-
+
# find the HDF5 libraries
foreach( LIB ${HDF5_${LANGUAGE}_LIBRARY_NAMES} )
if( UNIX AND HDF5_USE_STATIC_LIBRARIES )
@@ -278,15 +278,15 @@ if( NOT HDF5_FOUND )
set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d )
set( THIS_LIBRARY_SEARCH_RELEASE ${LIB} )
endif()
- find_library( HDF5_${LIB}_LIBRARY_DEBUG
- NAMES ${THIS_LIBRARY_SEARCH_DEBUG}
- HINTS ${HDF5_${LANGUAGE}_LIBRARY_DIRS}
- ENV HDF5_ROOT
+ find_library( HDF5_${LIB}_LIBRARY_DEBUG
+ NAMES ${THIS_LIBRARY_SEARCH_DEBUG}
+ HINTS ${HDF5_${LANGUAGE}_LIBRARY_DIRS}
+ ENV HDF5_ROOT
PATH_SUFFIXES lib Lib )
find_library( HDF5_${LIB}_LIBRARY_RELEASE
- NAMES ${THIS_LIBRARY_SEARCH_RELEASE}
- HINTS ${HDF5_${LANGUAGE}_LIBRARY_DIRS}
- ENV HDF5_ROOT
+ NAMES ${THIS_LIBRARY_SEARCH_RELEASE}
+ HINTS ${HDF5_${LANGUAGE}_LIBRARY_DIRS}
+ ENV HDF5_ROOT
PATH_SUFFIXES lib Lib )
select_library_configurations( HDF5_${LIB} )
# even though we adjusted the individual library names in
@@ -297,16 +297,16 @@ if( NOT HDF5_FOUND )
# up by the selection macro above) because it may specify debug and
# optimized variants for a particular library, but a list of
# libraries is allowed to specify debug and optimized only once.
- list( APPEND HDF5_${LANGUAGE}_LIBRARIES_DEBUG
+ list( APPEND HDF5_${LANGUAGE}_LIBRARIES_DEBUG
${HDF5_${LIB}_LIBRARY_DEBUG} )
- list( APPEND HDF5_${LANGUAGE}_LIBRARIES_RELEASE
+ list( APPEND HDF5_${LANGUAGE}_LIBRARIES_RELEASE
${HDF5_${LIB}_LIBRARY_RELEASE} )
endforeach()
list( APPEND HDF5_LIBRARY_DIRS ${HDF5_${LANGUAGE}_LIBRARY_DIRS} )
-
+
# Append the libraries for this language binding to the list of all
# required libraries.
- list( APPEND HDF5_LIBRARIES_DEBUG
+ list( APPEND HDF5_LIBRARIES_DEBUG
${HDF5_${LANGUAGE}_LIBRARIES_DEBUG} )
list( APPEND HDF5_LIBRARIES_RELEASE
${HDF5_${LANGUAGE}_LIBRARIES_RELEASE} )
@@ -358,7 +358,7 @@ if( NOT HDF5_FOUND )
set( HDF5_IS_PARALLEL FALSE )
foreach( _dir IN LISTS HDF5_INCLUDE_DIRS )
if( EXISTS "${_dir}/H5pubconf.h" )
- file( STRINGS "${_dir}/H5pubconf.h"
+ file( STRINGS "${_dir}/H5pubconf.h"
HDF5_HAVE_PARALLEL_DEFINE
REGEX "HAVE_PARALLEL 1" )
if( HDF5_HAVE_PARALLEL_DEFINE )
@@ -378,8 +378,8 @@ if( NOT HDF5_FOUND )
endif()
-find_package_handle_standard_args( HDF5 DEFAULT_MSG
- HDF5_LIBRARIES
+find_package_handle_standard_args( HDF5 DEFAULT_MSG
+ HDF5_LIBRARIES
HDF5_INCLUDE_DIRS
)
diff --git a/Modules/FindHSPELL.cmake b/Modules/FindHSPELL.cmake
index ca5709b62..71e55dad4 100644
--- a/Modules/FindHSPELL.cmake
+++ b/Modules/FindHSPELL.cmake
@@ -24,23 +24,24 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(HSPELL_INCLUDE_DIR hspell.h)
+find_path(HSPELL_INCLUDE_DIR hspell.h)
-FIND_LIBRARY(HSPELL_LIBRARIES NAMES hspell)
+find_library(HSPELL_LIBRARIES NAMES hspell)
-IF (HSPELL_INCLUDE_DIR)
- FILE(READ "${HSPELL_INCLUDE_DIR}/hspell.h" HSPELL_H)
- STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MAJOR ([0-9]+).*" "\\1" HSPELL_VERSION_MAJOR "${HSPELL_H}")
- STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MINOR ([0-9]+).*" "\\1" HSPELL_VERSION_MINOR "${HSPELL_H}")
- SET(HSPELL_VERSION_STRING "${HSPELL_VERSION_MAJOR}.${HSPELL_VERSION_MINOR}")
-ENDIF()
+if (HSPELL_INCLUDE_DIR)
+ file(STRINGS "${HSPELL_INCLUDE_DIR}/hspell.h" HSPELL_H REGEX "#define HSPELL_VERSION_M(AJO|INO)R [0-9]+")
+ string(REGEX REPLACE ".*#define HSPELL_VERSION_MAJOR ([0-9]+).*" "\\1" HSPELL_VERSION_MAJOR "${HSPELL_H}")
+ string(REGEX REPLACE ".*#define HSPELL_VERSION_MINOR ([0-9]+).*" "\\1" HSPELL_VERSION_MINOR "${HSPELL_H}")
+ set(HSPELL_VERSION_STRING "${HSPELL_VERSION_MAJOR}.${HSPELL_VERSION_MINOR}")
+ unset(HSPELL_H)
+endif()
-# handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(HSPELL
REQUIRED_VARS HSPELL_LIBRARIES HSPELL_INCLUDE_DIR
VERSION_VAR HSPELL_VERSION_STRING)
-MARK_AS_ADVANCED(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES)
+mark_as_advanced(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES)
diff --git a/Modules/FindHTMLHelp.cmake b/Modules/FindHTMLHelp.cmake
index 4455b0797..c69e9e948 100644
--- a/Modules/FindHTMLHelp.cmake
+++ b/Modules/FindHTMLHelp.cmake
@@ -18,26 +18,26 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF(WIN32)
+if(WIN32)
- FIND_PROGRAM(HTML_HELP_COMPILER
+ find_program(HTML_HELP_COMPILER
hhc
"[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]"
"$ENV{ProgramFiles}/HTML Help Workshop"
- "C:/Program Files/HTML Help Workshop"
+ "C:/Program Files/HTML Help Workshop"
)
- GET_FILENAME_COMPONENT(HTML_HELP_COMPILER_PATH "${HTML_HELP_COMPILER}" PATH)
+ get_filename_component(HTML_HELP_COMPILER_PATH "${HTML_HELP_COMPILER}" PATH)
- FIND_PATH(HTML_HELP_INCLUDE_PATH
- htmlhelp.h
+ find_path(HTML_HELP_INCLUDE_PATH
+ htmlhelp.h
"${HTML_HELP_COMPILER_PATH}/include"
"[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]/include"
"$ENV{ProgramFiles}/HTML Help Workshop/include"
- "C:/Program Files/HTML Help Workshop/include"
+ "C:/Program Files/HTML Help Workshop/include"
)
- FIND_LIBRARY(HTML_HELP_LIBRARY
+ find_library(HTML_HELP_LIBRARY
htmlhelp
"${HTML_HELP_COMPILER_PATH}/lib"
"[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]/lib"
@@ -45,10 +45,10 @@ IF(WIN32)
"C:/Program Files/HTML Help Workshop/lib"
)
- MARK_AS_ADVANCED(
+ mark_as_advanced(
HTML_HELP_COMPILER
HTML_HELP_INCLUDE_PATH
HTML_HELP_LIBRARY
)
-ENDIF(WIN32)
+endif()
diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake
new file mode 100644
index 000000000..a6a4aef24
--- /dev/null
+++ b/Modules/FindHg.cmake
@@ -0,0 +1,48 @@
+# The module defines the following variables:
+# HG_EXECUTABLE - path to mercurial command line client (hg)
+# HG_FOUND - true if the command line client was found
+# HG_VERSION_STRING - the version of mercurial found
+# Example usage:
+# find_package(Hg)
+# if(HG_FOUND)
+# message("hg found: ${HG_EXECUTABLE}")
+# endif()
+
+#=============================================================================
+# Copyright 2010-2012 Kitware, Inc.
+# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+find_program(HG_EXECUTABLE
+ NAMES hg
+ PATH_SUFFIXES Mercurial
+ DOC "hg command line client"
+ )
+mark_as_advanced(HG_EXECUTABLE)
+
+if(HG_EXECUTABLE)
+ execute_process(COMMAND ${HG_EXECUTABLE} --version
+ OUTPUT_VARIABLE hg_version
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(hg_version MATCHES "^Mercurial Distributed SCM \\(version ([0-9][^)]*)\\)")
+ set(HG_VERSION_STRING "${CMAKE_MATCH_1}")
+ endif()
+ unset(hg_version)
+endif()
+
+# Handle the QUIETLY and REQUIRED arguments and set HG_FOUND to TRUE if
+# all listed variables are TRUE
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+find_package_handle_standard_args(Hg
+ REQUIRED_VARS HG_EXECUTABLE
+ VERSION_VAR HG_VERSION_STRING)
diff --git a/Modules/FindITK.cmake b/Modules/FindITK.cmake
index a3ca99899..b0b3f03f0 100644
--- a/Modules/FindITK.cmake
+++ b/Modules/FindITK.cmake
@@ -7,16 +7,16 @@
# that can be included to set the include directories, library directories,
# and preprocessor macros. In addition to the variables read from
# ITKConfig.cmake, this find module also defines
-# ITK_DIR - The directory containing ITKConfig.cmake.
-# This is either the root of the build tree,
-# or the lib/InsightToolkit directory.
+# ITK_DIR - The directory containing ITKConfig.cmake.
+# This is either the root of the build tree,
+# or the lib/InsightToolkit directory.
# This is the only cache entry.
-#
-# ITK_FOUND - Whether ITK was found. If this is true,
+#
+# ITK_FOUND - Whether ITK was found. If this is true,
# ITK_DIR is okay.
#
-# USE_ITK_FILE - The full path to the UseITK.cmake file.
-# This is provided for backward
+# USE_ITK_FILE - The full path to the UseITK.cmake file.
+# This is provided for backward
# compatability. Use ITK_USE_FILE
# instead.
@@ -36,22 +36,22 @@
# Use the Config mode of the find_package() command to find ITKConfig.
# If this succeeds (possibly because ITK_DIR is already set), the
# command will have already loaded ITKConfig.cmake and set ITK_FOUND.
-IF(NOT ITK_FOUND)
- SET(_ITK_REQUIRED "")
- IF(ITK_FIND_REQUIRED)
- SET(_ITK_REQUIRED REQUIRED)
- ENDIF()
- SET(_ITK_QUIET "")
- IF(ITK_FIND_QUIETLY)
- SET(_ITK_QUIET QUIET)
- ENDIF()
- FIND_PACKAGE(ITK ${_ITK_REQUIRED} ${_ITK_QUIET} NO_MODULE
+if(NOT ITK_FOUND)
+ set(_ITK_REQUIRED "")
+ if(ITK_FIND_REQUIRED)
+ set(_ITK_REQUIRED REQUIRED)
+ endif()
+ set(_ITK_QUIET "")
+ if(ITK_FIND_QUIETLY)
+ set(_ITK_QUIET QUIET)
+ endif()
+ find_package(ITK ${_ITK_REQUIRED} ${_ITK_QUIET} NO_MODULE
NAMES ITK InsightToolkit
CONFIGS ITKConfig.cmake
)
-ENDIF()
+endif()
-IF(ITK_FOUND)
+if(ITK_FOUND)
# Set USE_ITK_FILE for backward-compatability.
- SET(USE_ITK_FILE ${ITK_USE_FILE})
-ENDIF()
+ set(USE_ITK_FILE ${ITK_USE_FILE})
+endif()
diff --git a/Modules/FindImageMagick.cmake b/Modules/FindImageMagick.cmake
index f21b63008..bf0961691 100644
--- a/Modules/FindImageMagick.cmake
+++ b/Modules/FindImageMagick.cmake
@@ -45,11 +45,11 @@
# ImageMagick_<component>_LIBRARIES - Full path to <component> libraries.
#
# Example Usages:
-# FIND_PACKAGE(ImageMagick)
-# FIND_PACKAGE(ImageMagick COMPONENTS convert)
-# FIND_PACKAGE(ImageMagick COMPONENTS convert mogrify display)
-# FIND_PACKAGE(ImageMagick COMPONENTS Magick++)
-# FIND_PACKAGE(ImageMagick COMPONENTS Magick++ convert)
+# find_package(ImageMagick)
+# find_package(ImageMagick COMPONENTS convert)
+# find_package(ImageMagick COMPONENTS convert mogrify display)
+# find_package(ImageMagick COMPONENTS Magick++)
+# find_package(ImageMagick COMPONENTS Magick++ convert)
#
# Note that the standard FIND_PACKAGE features are supported
# (i.e., QUIET, REQUIRED, etc.).
@@ -72,10 +72,10 @@
#---------------------------------------------------------------------
# Helper functions
#---------------------------------------------------------------------
-FUNCTION(FIND_IMAGEMAGICK_API component header)
- SET(ImageMagick_${component}_FOUND FALSE PARENT_SCOPE)
+function(FIND_IMAGEMAGICK_API component header)
+ set(ImageMagick_${component}_FOUND FALSE PARENT_SCOPE)
- FIND_PATH(ImageMagick_${component}_INCLUDE_DIR
+ find_path(ImageMagick_${component}_INCLUDE_DIR
NAMES ${header}
PATHS
${ImageMagick_INCLUDE_DIRS}
@@ -84,150 +84,150 @@ FUNCTION(FIND_IMAGEMAGICK_API component header)
ImageMagick
DOC "Path to the ImageMagick include dir."
)
- FIND_LIBRARY(ImageMagick_${component}_LIBRARY
+ find_library(ImageMagick_${component}_LIBRARY
NAMES ${ARGN}
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/lib"
DOC "Path to the ImageMagick Magick++ library."
)
- IF(ImageMagick_${component}_INCLUDE_DIR AND ImageMagick_${component}_LIBRARY)
- SET(ImageMagick_${component}_FOUND TRUE PARENT_SCOPE)
+ if(ImageMagick_${component}_INCLUDE_DIR AND ImageMagick_${component}_LIBRARY)
+ set(ImageMagick_${component}_FOUND TRUE PARENT_SCOPE)
- LIST(APPEND ImageMagick_INCLUDE_DIRS
+ list(APPEND ImageMagick_INCLUDE_DIRS
${ImageMagick_${component}_INCLUDE_DIR}
)
- LIST(REMOVE_DUPLICATES ImageMagick_INCLUDE_DIRS)
- SET(ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS} PARENT_SCOPE)
+ list(REMOVE_DUPLICATES ImageMagick_INCLUDE_DIRS)
+ set(ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS} PARENT_SCOPE)
- LIST(APPEND ImageMagick_LIBRARIES
+ list(APPEND ImageMagick_LIBRARIES
${ImageMagick_${component}_LIBRARY}
)
- SET(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES} PARENT_SCOPE)
- ENDIF(ImageMagick_${component}_INCLUDE_DIR AND ImageMagick_${component}_LIBRARY)
-ENDFUNCTION(FIND_IMAGEMAGICK_API)
+ set(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES} PARENT_SCOPE)
+ endif()
+endfunction()
-FUNCTION(FIND_IMAGEMAGICK_EXE component)
- SET(_IMAGEMAGICK_EXECUTABLE
+function(FIND_IMAGEMAGICK_EXE component)
+ set(_IMAGEMAGICK_EXECUTABLE
${ImageMagick_EXECUTABLE_DIR}/${component}${CMAKE_EXECUTABLE_SUFFIX})
- IF(EXISTS ${_IMAGEMAGICK_EXECUTABLE})
- SET(ImageMagick_${component}_EXECUTABLE
+ if(EXISTS ${_IMAGEMAGICK_EXECUTABLE})
+ set(ImageMagick_${component}_EXECUTABLE
${_IMAGEMAGICK_EXECUTABLE}
PARENT_SCOPE
)
- SET(ImageMagick_${component}_FOUND TRUE PARENT_SCOPE)
- ELSE(EXISTS ${_IMAGEMAGICK_EXECUTABLE})
- SET(ImageMagick_${component}_FOUND FALSE PARENT_SCOPE)
- ENDIF(EXISTS ${_IMAGEMAGICK_EXECUTABLE})
-ENDFUNCTION(FIND_IMAGEMAGICK_EXE)
+ set(ImageMagick_${component}_FOUND TRUE PARENT_SCOPE)
+ else()
+ set(ImageMagick_${component}_FOUND FALSE PARENT_SCOPE)
+ endif()
+endfunction()
#---------------------------------------------------------------------
# Start Actual Work
#---------------------------------------------------------------------
# Try to find a ImageMagick installation binary path.
-FIND_PATH(ImageMagick_EXECUTABLE_DIR
+find_path(ImageMagick_EXECUTABLE_DIR
NAMES mogrify${CMAKE_EXECUTABLE_SUFFIX}
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]"
DOC "Path to the ImageMagick binary directory."
NO_DEFAULT_PATH
)
-FIND_PATH(ImageMagick_EXECUTABLE_DIR
+find_path(ImageMagick_EXECUTABLE_DIR
NAMES mogrify${CMAKE_EXECUTABLE_SUFFIX}
)
# Find each component. Search for all tools in same dir
# <ImageMagick_EXECUTABLE_DIR>; otherwise they should be found
# independently and not in a cohesive module such as this one.
-UNSET(ImageMagick_REQUIRED_VARS)
-UNSET(ImageMagick_DEFAULT_EXECUTABLES)
-FOREACH(component ${ImageMagick_FIND_COMPONENTS}
+unset(ImageMagick_REQUIRED_VARS)
+unset(ImageMagick_DEFAULT_EXECUTABLES)
+foreach(component ${ImageMagick_FIND_COMPONENTS}
# DEPRECATED: forced components for backward compatibility
convert mogrify import montage composite
)
- IF(component STREQUAL "Magick++")
+ if(component STREQUAL "Magick++")
FIND_IMAGEMAGICK_API(Magick++ Magick++.h
Magick++ CORE_RL_Magick++_
)
- LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_Magick++_LIBRARY)
- ELSEIF(component STREQUAL "MagickWand")
+ list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_Magick++_LIBRARY)
+ elseif(component STREQUAL "MagickWand")
FIND_IMAGEMAGICK_API(MagickWand wand/MagickWand.h
Wand MagickWand CORE_RL_wand_
)
- LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickWand_LIBRARY)
- ELSEIF(component STREQUAL "MagickCore")
+ list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickWand_LIBRARY)
+ elseif(component STREQUAL "MagickCore")
FIND_IMAGEMAGICK_API(MagickCore magick/MagickCore.h
Magick MagickCore CORE_RL_magick_
)
- LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickCore_LIBRARY)
- ELSE(component STREQUAL "Magick++")
- IF(ImageMagick_EXECUTABLE_DIR)
+ list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickCore_LIBRARY)
+ else()
+ if(ImageMagick_EXECUTABLE_DIR)
FIND_IMAGEMAGICK_EXE(${component})
- ENDIF(ImageMagick_EXECUTABLE_DIR)
+ endif()
- IF(ImageMagick_FIND_COMPONENTS)
- LIST(FIND ImageMagick_FIND_COMPONENTS ${component} is_requested)
- IF(is_requested GREATER -1)
- LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_${component}_EXECUTABLE)
- ENDIF(is_requested GREATER -1)
- ELSEIF(ImageMagick_${component}_EXECUTABLE)
+ if(ImageMagick_FIND_COMPONENTS)
+ list(FIND ImageMagick_FIND_COMPONENTS ${component} is_requested)
+ if(is_requested GREATER -1)
+ list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_${component}_EXECUTABLE)
+ endif()
+ elseif(ImageMagick_${component}_EXECUTABLE)
# if no components were requested explicitly put all (default) executables
# in the list
- LIST(APPEND ImageMagick_DEFAULT_EXECUTABLES ImageMagick_${component}_EXECUTABLE)
- ENDIF(ImageMagick_FIND_COMPONENTS)
- ENDIF(component STREQUAL "Magick++")
-ENDFOREACH(component)
+ list(APPEND ImageMagick_DEFAULT_EXECUTABLES ImageMagick_${component}_EXECUTABLE)
+ endif()
+ endif()
+endforeach()
-IF(NOT ImageMagick_FIND_COMPONENTS AND NOT ImageMagick_DEFAULT_EXECUTABLES)
+if(NOT ImageMagick_FIND_COMPONENTS AND NOT ImageMagick_DEFAULT_EXECUTABLES)
# No components were requested, and none of the default components were
# found. Just insert mogrify into the list of the default components to
# find so FPHSA below has something to check
- LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_mogrify_EXECUTABLE)
-ELSEIF(ImageMagick_DEFAULT_EXECUTABLES)
- LIST(APPEND ImageMagick_REQUIRED_VARS ${ImageMagick_DEFAULT_EXECUTABLES})
-ENDIF()
+ list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_mogrify_EXECUTABLE)
+elseif(ImageMagick_DEFAULT_EXECUTABLES)
+ list(APPEND ImageMagick_REQUIRED_VARS ${ImageMagick_DEFAULT_EXECUTABLES})
+endif()
-SET(ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS})
-SET(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES})
+set(ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS})
+set(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES})
-IF(ImageMagick_mogrify_EXECUTABLE)
- EXECUTE_PROCESS(COMMAND ${ImageMagick_mogrify_EXECUTABLE} -version
+if(ImageMagick_mogrify_EXECUTABLE)
+ execute_process(COMMAND ${ImageMagick_mogrify_EXECUTABLE} -version
OUTPUT_VARIABLE imagemagick_version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
- IF(imagemagick_version MATCHES "^Version: ImageMagick [0-9]")
- STRING(REGEX REPLACE "^Version: ImageMagick ([-0-9\\.]+).*" "\\1" ImageMagick_VERSION_STRING "${imagemagick_version}")
- ENDIF()
- UNSET(imagemagick_version)
-ENDIF(ImageMagick_mogrify_EXECUTABLE)
+ if(imagemagick_version MATCHES "^Version: ImageMagick [0-9]")
+ string(REGEX REPLACE "^Version: ImageMagick ([-0-9\\.]+).*" "\\1" ImageMagick_VERSION_STRING "${imagemagick_version}")
+ endif()
+ unset(imagemagick_version)
+endif()
#---------------------------------------------------------------------
# Standard Package Output
#---------------------------------------------------------------------
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ImageMagick
REQUIRED_VARS ${ImageMagick_REQUIRED_VARS}
VERSION_VAR ImageMagick_VERSION_STRING
)
# Maintain consistency with all other variables.
-SET(ImageMagick_FOUND ${IMAGEMAGICK_FOUND})
+set(ImageMagick_FOUND ${IMAGEMAGICK_FOUND})
#---------------------------------------------------------------------
# DEPRECATED: Setting variables for backward compatibility.
#---------------------------------------------------------------------
-SET(IMAGEMAGICK_BINARY_PATH ${ImageMagick_EXECUTABLE_DIR}
+set(IMAGEMAGICK_BINARY_PATH ${ImageMagick_EXECUTABLE_DIR}
CACHE PATH "Path to the ImageMagick binary directory.")
-SET(IMAGEMAGICK_CONVERT_EXECUTABLE ${ImageMagick_convert_EXECUTABLE}
+set(IMAGEMAGICK_CONVERT_EXECUTABLE ${ImageMagick_convert_EXECUTABLE}
CACHE FILEPATH "Path to ImageMagick's convert executable.")
-SET(IMAGEMAGICK_MOGRIFY_EXECUTABLE ${ImageMagick_mogrify_EXECUTABLE}
+set(IMAGEMAGICK_MOGRIFY_EXECUTABLE ${ImageMagick_mogrify_EXECUTABLE}
CACHE FILEPATH "Path to ImageMagick's mogrify executable.")
-SET(IMAGEMAGICK_IMPORT_EXECUTABLE ${ImageMagick_import_EXECUTABLE}
+set(IMAGEMAGICK_IMPORT_EXECUTABLE ${ImageMagick_import_EXECUTABLE}
CACHE FILEPATH "Path to ImageMagick's import executable.")
-SET(IMAGEMAGICK_MONTAGE_EXECUTABLE ${ImageMagick_montage_EXECUTABLE}
+set(IMAGEMAGICK_MONTAGE_EXECUTABLE ${ImageMagick_montage_EXECUTABLE}
CACHE FILEPATH "Path to ImageMagick's montage executable.")
-SET(IMAGEMAGICK_COMPOSITE_EXECUTABLE ${ImageMagick_composite_EXECUTABLE}
+set(IMAGEMAGICK_COMPOSITE_EXECUTABLE ${ImageMagick_composite_EXECUTABLE}
CACHE FILEPATH "Path to ImageMagick's composite executable.")
-MARK_AS_ADVANCED(
+mark_as_advanced(
IMAGEMAGICK_BINARY_PATH
IMAGEMAGICK_CONVERT_EXECUTABLE
IMAGEMAGICK_MOGRIFY_EXECUTABLE
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index d49b44a55..0de3f7985 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -2,7 +2,7 @@
# This module finds if Java is installed and determines where the
# include files and libraries are. It also determines what the name of
# the library is. This code sets the following variables:
-#
+#
# JNI_INCLUDE_DIRS = the include dirs to use
# JNI_LIBRARIES = the libraries to use
# JNI_FOUND = TRUE if JNI headers and libraries were found.
@@ -27,74 +27,74 @@
# License text for the above reference.)
# Expand {libarch} occurences to java_libarch subdirectory(-ies) and set ${_var}
-MACRO(java_append_library_directories _var)
+macro(java_append_library_directories _var)
# Determine java arch-specific library subdir
# Mostly based on openjdk/jdk/make/common/shared/Platform.gmk as of openjdk
# 1.6.0_18 + icedtea patches. However, it would be much better to base the
# guess on the first part of the GNU config.guess platform triplet.
- IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
- SET(_java_libarch "amd64")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
- SET(_java_libarch "i386")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha")
- SET(_java_libarch "alpha")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ set(_java_libarch "amd64")
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
+ set(_java_libarch "i386")
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha")
+ set(_java_libarch "alpha")
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
# Subdir is "arm" for both big-endian (arm) and little-endian (armel).
- SET(_java_libarch "arm")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
+ set(_java_libarch "arm")
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
# mips* machines are bi-endian mostly so processor does not tell
# endianess of the underlying system.
- SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
- SET(_java_libarch "ppc64")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
- SET(_java_libarch "ppc")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
+ set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb")
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
+ set(_java_libarch "ppc64")
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
+ set(_java_libarch "ppc")
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
# Both flavours can run on the same processor
- SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)")
- SET(_java_libarch "parisc" "parisc64")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390")
+ set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)")
+ set(_java_libarch "parisc" "parisc64")
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390")
# s390 binaries can run on s390x machines
- SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
- SET(_java_libarch "sh")
- ELSE(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
- SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}")
- ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x")
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
+ set(_java_libarch "sh")
+ else()
+ set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}")
+ endif()
# Append default list architectures if CMAKE_SYSTEM_PROCESSOR was empty or
# system is non-Linux (where the code above has not been well tested)
- IF(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
- LIST(APPEND _java_libarch "i386" "amd64" "ppc")
- ENDIF(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
+ if(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
+ list(APPEND _java_libarch "i386" "amd64" "ppc")
+ endif()
# Sometimes ${CMAKE_SYSTEM_PROCESSOR} is added to the list to prefer
# current value to a hardcoded list. Remove possible duplicates.
- LIST(REMOVE_DUPLICATES _java_libarch)
+ list(REMOVE_DUPLICATES _java_libarch)
- FOREACH(_path ${ARGN})
- IF(_path MATCHES "{libarch}")
- FOREACH(_libarch ${_java_libarch})
- STRING(REPLACE "{libarch}" "${_libarch}" _newpath "${_path}")
- LIST(APPEND ${_var} "${_newpath}")
- ENDFOREACH(_libarch)
- ELSE(_path MATCHES "{libarch}")
- LIST(APPEND ${_var} "${_path}")
- ENDIF(_path MATCHES "{libarch}")
- ENDFOREACH(_path)
-ENDMACRO(java_append_library_directories)
+ foreach(_path ${ARGN})
+ if(_path MATCHES "{libarch}")
+ foreach(_libarch ${_java_libarch})
+ string(REPLACE "{libarch}" "${_libarch}" _newpath "${_path}")
+ list(APPEND ${_var} "${_newpath}")
+ endforeach()
+ else()
+ list(APPEND ${_var} "${_path}")
+ endif()
+ endforeach()
+endmacro()
-GET_FILENAME_COMPONENT(java_install_version
+get_filename_component(java_install_version
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME)
-SET(JAVA_AWT_LIBRARY_DIRECTORIES
+set(JAVA_AWT_LIBRARY_DIRECTORIES
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib"
)
-FILE(TO_CMAKE_PATH "$ENV{JAVA_HOME}" _JAVA_HOME)
+file(TO_CMAKE_PATH "$ENV{JAVA_HOME}" _JAVA_HOME)
JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
${_JAVA_HOME}/jre/lib/{libarch}
@@ -122,23 +122,23 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
/usr/lib/jvm/default-java/lib
)
-SET(JAVA_JVM_LIBRARY_DIRECTORIES)
-FOREACH(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
- SET(JAVA_JVM_LIBRARY_DIRECTORIES
+set(JAVA_JVM_LIBRARY_DIRECTORIES)
+foreach(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
+ set(JAVA_JVM_LIBRARY_DIRECTORIES
${JAVA_JVM_LIBRARY_DIRECTORIES}
"${dir}"
"${dir}/client"
"${dir}/server"
)
-ENDFOREACH(dir)
+endforeach()
-SET(JAVA_AWT_INCLUDE_DIRECTORIES
+set(JAVA_AWT_INCLUDE_DIRECTORIES
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
${_JAVA_HOME}/include
- /usr/include
+ /usr/include
/usr/local/include
/usr/lib/java/include
/usr/local/lib/java/include
@@ -155,74 +155,74 @@ SET(JAVA_AWT_INCLUDE_DIRECTORIES
/usr/lib/jvm/default-java/include
)
-FOREACH(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}")
- GET_FILENAME_COMPONENT(jpath "${JAVA_PROG}" PATH)
- FOREACH(JAVA_INC_PATH ../include ../java/include ../share/java/include)
- IF(EXISTS ${jpath}/${JAVA_INC_PATH})
- SET(JAVA_AWT_INCLUDE_DIRECTORIES ${JAVA_AWT_INCLUDE_DIRECTORIES} "${jpath}/${JAVA_INC_PATH}")
- ENDIF(EXISTS ${jpath}/${JAVA_INC_PATH})
- ENDFOREACH(JAVA_INC_PATH)
- FOREACH(JAVA_LIB_PATH
- ../lib ../jre/lib ../jre/lib/i386
- ../java/lib ../java/jre/lib ../java/jre/lib/i386
+foreach(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}")
+ get_filename_component(jpath "${JAVA_PROG}" PATH)
+ foreach(JAVA_INC_PATH ../include ../java/include ../share/java/include)
+ if(EXISTS ${jpath}/${JAVA_INC_PATH})
+ set(JAVA_AWT_INCLUDE_DIRECTORIES ${JAVA_AWT_INCLUDE_DIRECTORIES} "${jpath}/${JAVA_INC_PATH}")
+ endif()
+ endforeach()
+ foreach(JAVA_LIB_PATH
+ ../lib ../jre/lib ../jre/lib/i386
+ ../java/lib ../java/jre/lib ../java/jre/lib/i386
../share/java/lib ../share/java/jre/lib ../share/java/jre/lib/i386)
- IF(EXISTS ${jpath}/${JAVA_LIB_PATH})
- SET(JAVA_AWT_LIBRARY_DIRECTORIES ${JAVA_AWT_LIBRARY_DIRECTORIES} "${jpath}/${JAVA_LIB_PATH}")
- ENDIF(EXISTS ${jpath}/${JAVA_LIB_PATH})
- ENDFOREACH(JAVA_LIB_PATH)
-ENDFOREACH(JAVA_PROG)
+ if(EXISTS ${jpath}/${JAVA_LIB_PATH})
+ set(JAVA_AWT_LIBRARY_DIRECTORIES ${JAVA_AWT_LIBRARY_DIRECTORIES} "${jpath}/${JAVA_LIB_PATH}")
+ endif()
+ endforeach()
+endforeach()
-IF(APPLE)
- IF(EXISTS ~/Library/Frameworks/JavaVM.framework)
- SET(JAVA_HAVE_FRAMEWORK 1)
- ENDIF(EXISTS ~/Library/Frameworks/JavaVM.framework)
- IF(EXISTS /Library/Frameworks/JavaVM.framework)
- SET(JAVA_HAVE_FRAMEWORK 1)
- ENDIF(EXISTS /Library/Frameworks/JavaVM.framework)
- IF(EXISTS /System/Library/Frameworks/JavaVM.framework)
- SET(JAVA_HAVE_FRAMEWORK 1)
- ENDIF(EXISTS /System/Library/Frameworks/JavaVM.framework)
+if(APPLE)
+ if(EXISTS ~/Library/Frameworks/JavaVM.framework)
+ set(JAVA_HAVE_FRAMEWORK 1)
+ endif()
+ if(EXISTS /Library/Frameworks/JavaVM.framework)
+ set(JAVA_HAVE_FRAMEWORK 1)
+ endif()
+ if(EXISTS /System/Library/Frameworks/JavaVM.framework)
+ set(JAVA_HAVE_FRAMEWORK 1)
+ endif()
- IF(JAVA_HAVE_FRAMEWORK)
- IF(NOT JAVA_AWT_LIBRARY)
- SET (JAVA_AWT_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE)
- ENDIF(NOT JAVA_AWT_LIBRARY)
+ if(JAVA_HAVE_FRAMEWORK)
+ if(NOT JAVA_AWT_LIBRARY)
+ set (JAVA_AWT_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE)
+ endif()
- IF(NOT JAVA_JVM_LIBRARY)
- SET (JAVA_JVM_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE)
- ENDIF(NOT JAVA_JVM_LIBRARY)
+ if(NOT JAVA_JVM_LIBRARY)
+ set (JAVA_JVM_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE)
+ endif()
- IF(NOT JAVA_AWT_INCLUDE_PATH)
- IF(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h)
- SET (JAVA_AWT_INCLUDE_PATH "/System/Library/Frameworks/JavaVM.framework/Headers" CACHE FILEPATH "jawt.h location" FORCE)
- ENDIF(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h)
- ENDIF(NOT JAVA_AWT_INCLUDE_PATH)
+ if(NOT JAVA_AWT_INCLUDE_PATH)
+ if(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h)
+ set (JAVA_AWT_INCLUDE_PATH "/System/Library/Frameworks/JavaVM.framework/Headers" CACHE FILEPATH "jawt.h location" FORCE)
+ endif()
+ endif()
# If using "-framework JavaVM", prefer its headers *before* the others in
# JAVA_AWT_INCLUDE_DIRECTORIES... (*prepend* to the list here)
#
- SET(JAVA_AWT_INCLUDE_DIRECTORIES
+ set(JAVA_AWT_INCLUDE_DIRECTORIES
~/Library/Frameworks/JavaVM.framework/Headers
/Library/Frameworks/JavaVM.framework/Headers
/System/Library/Frameworks/JavaVM.framework/Headers
${JAVA_AWT_INCLUDE_DIRECTORIES}
)
- ENDIF(JAVA_HAVE_FRAMEWORK)
-ELSE(APPLE)
- FIND_LIBRARY(JAVA_AWT_LIBRARY jawt
+ endif()
+else()
+ find_library(JAVA_AWT_LIBRARY jawt
PATHS ${JAVA_AWT_LIBRARY_DIRECTORIES}
)
- FIND_LIBRARY(JAVA_JVM_LIBRARY NAMES jvm JavaVM
+ find_library(JAVA_JVM_LIBRARY NAMES jvm JavaVM
PATHS ${JAVA_JVM_LIBRARY_DIRECTORIES}
)
-ENDIF(APPLE)
+endif()
-# add in the include path
-FIND_PATH(JAVA_INCLUDE_PATH jni.h
+# add in the include path
+find_path(JAVA_INCLUDE_PATH jni.h
${JAVA_AWT_INCLUDE_DIRECTORIES}
)
-FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h
+find_path(JAVA_INCLUDE_PATH2 jni_md.h
${JAVA_INCLUDE_PATH}
${JAVA_INCLUDE_PATH}/win32
${JAVA_INCLUDE_PATH}/linux
@@ -232,15 +232,15 @@ FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h
${JAVA_INCLUDE_PATH}/alpha
)
-FIND_PATH(JAVA_AWT_INCLUDE_PATH jawt.h
+find_path(JAVA_AWT_INCLUDE_PATH jawt.h
${JAVA_INCLUDE_PATH}
)
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JNI DEFAULT_MSG JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY
JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
-MARK_AS_ADVANCED(
+mark_as_advanced(
JAVA_AWT_LIBRARY
JAVA_JVM_LIBRARY
JAVA_AWT_INCLUDE_PATH
@@ -248,12 +248,12 @@ MARK_AS_ADVANCED(
JAVA_INCLUDE_PATH2
)
-SET(JNI_LIBRARIES
+set(JNI_LIBRARIES
${JAVA_AWT_LIBRARY}
${JAVA_JVM_LIBRARY}
)
-SET(JNI_INCLUDE_DIRS
+set(JNI_INCLUDE_DIRS
${JAVA_INCLUDE_PATH}
${JAVA_INCLUDE_PATH2}
${JAVA_AWT_INCLUDE_PATH}
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake
index 349e7e175..7c1f0fd94 100644
--- a/Modules/FindJPEG.cmake
+++ b/Modules/FindJPEG.cmake
@@ -20,24 +20,24 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h)
+find_path(JPEG_INCLUDE_DIR jpeglib.h)
-SET(JPEG_NAMES ${JPEG_NAMES} jpeg)
-FIND_LIBRARY(JPEG_LIBRARY NAMES ${JPEG_NAMES} )
+set(JPEG_NAMES ${JPEG_NAMES} jpeg)
+find_library(JPEG_LIBRARY NAMES ${JPEG_NAMES} )
-# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR)
-IF(JPEG_FOUND)
- SET(JPEG_LIBRARIES ${JPEG_LIBRARY})
-ENDIF(JPEG_FOUND)
+if(JPEG_FOUND)
+ set(JPEG_LIBRARIES ${JPEG_LIBRARY})
+endif()
# Deprecated declarations.
-SET (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
-IF(JPEG_LIBRARY)
- GET_FILENAME_COMPONENT (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
-ENDIF(JPEG_LIBRARY)
+set (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
+if(JPEG_LIBRARY)
+ get_filename_component (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
+endif()
-MARK_AS_ADVANCED(JPEG_LIBRARY JPEG_INCLUDE_DIR )
+mark_as_advanced(JPEG_LIBRARY JPEG_INCLUDE_DIR )
diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake
index 6dc7e4db7..136056b84 100644
--- a/Modules/FindJasper.cmake
+++ b/Modules/FindJasper.cmake
@@ -21,33 +21,33 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h)
+find_path(JASPER_INCLUDE_DIR jasper/jasper.h)
-IF (NOT JASPER_LIBRARIES)
- FIND_PACKAGE(JPEG)
+if (NOT JASPER_LIBRARIES)
+ find_package(JPEG)
- FIND_LIBRARY(JASPER_LIBRARY_RELEASE NAMES jasper libjasper)
- FIND_LIBRARY(JASPER_LIBRARY_DEBUG NAMES jasperd)
+ find_library(JASPER_LIBRARY_RELEASE NAMES jasper libjasper)
+ find_library(JASPER_LIBRARY_DEBUG NAMES jasperd)
- INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+ include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
SELECT_LIBRARY_CONFIGURATIONS(JASPER)
-ENDIF (NOT JASPER_LIBRARIES)
+endif ()
-IF (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
- FILE(STRINGS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h" jasper_version_str REGEX "^#define[\t ]+JAS_VERSION[\t ]+\".*\".*")
+if (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
+ file(STRINGS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h" jasper_version_str REGEX "^#define[\t ]+JAS_VERSION[\t ]+\".*\".*")
- STRING(REGEX REPLACE "^#define[\t ]+JAS_VERSION[\t ]+\"([^\"]+)\".*" "\\1" JASPER_VERSION_STRING "${jasper_version_str}")
-ENDIF (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
+ string(REGEX REPLACE "^#define[\t ]+JAS_VERSION[\t ]+\"([^\"]+)\".*" "\\1" JASPER_VERSION_STRING "${jasper_version_str}")
+endif ()
-# handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jasper
REQUIRED_VARS JASPER_LIBRARIES JASPER_INCLUDE_DIR JPEG_LIBRARIES
VERSION_VAR JASPER_VERSION_STRING)
-IF (JASPER_FOUND)
- SET(JASPER_LIBRARIES ${JASPER_LIBRARIES} ${JPEG_LIBRARIES} )
-ENDIF (JASPER_FOUND)
+if (JASPER_FOUND)
+ set(JASPER_LIBRARIES ${JASPER_LIBRARIES} ${JPEG_LIBRARIES} )
+endif ()
-MARK_AS_ADVANCED(JASPER_INCLUDE_DIR)
+mark_as_advanced(JASPER_INCLUDE_DIR)
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 345702122..1b4593d9c 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -16,14 +16,14 @@
# Java_VERSION = This is set to: $major.$minor.$patch(.$tweak)
#
# The minimum required version of Java can be specified using the
-# standard CMake syntax, e.g. FIND_PACKAGE(Java 1.5)
+# standard CMake syntax, e.g. find_package(Java 1.5)
#
# NOTE: ${Java_VERSION} and ${Java_VERSION_STRING} are not guaranteed to be
# identical. For example some java version may return:
# Java_VERSION_STRING = 1.5.0_17
# and
# Java_VERSION = 1.5.0.17
-#
+#
# another example is the Java OEM, with:
# Java_VERSION_STRING = 1.6.0-oem
# and
@@ -37,9 +37,9 @@
# Java_<component>_FOUND - TRUE if <component> is found.
#
# Example Usages:
-# FIND_PACKAGE(Java)
-# FIND_PACKAGE(Java COMPONENTS Runtime)
-# FIND_PACKAGE(Java COMPONENTS Development)
+# find_package(Java)
+# find_package(Java COMPONENTS Runtime)
+# find_package(Java COMPONENTS Development)
#
#=============================================================================
@@ -57,7 +57,7 @@
# License text for the above reference.)
# The HINTS option should only be used for values computed from the system.
-SET(_JAVA_HINTS
+set(_JAVA_HINTS
"[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"
@@ -70,7 +70,7 @@ SET(_JAVA_HINTS
)
# Hard-coded guesses should still go in PATHS. This ensures that the user
# environment can always override hard guesses.
-SET(_JAVA_PATHS
+set(_JAVA_PATHS
/usr/lib/java/bin
/usr/share/java/bin
/usr/local/java/bin
@@ -81,79 +81,79 @@ SET(_JAVA_PATHS
/usr/lib/j2sdk1.5-sun/bin
/opt/sun-jdk-1.5.0.04/bin
)
-FIND_PROGRAM(Java_JAVA_EXECUTABLE
+find_program(Java_JAVA_EXECUTABLE
NAMES java
HINTS ${_JAVA_HINTS}
PATHS ${_JAVA_PATHS}
)
-IF(Java_JAVA_EXECUTABLE)
- EXECUTE_PROCESS(COMMAND ${Java_JAVA_EXECUTABLE} -version
+if(Java_JAVA_EXECUTABLE)
+ execute_process(COMMAND ${Java_JAVA_EXECUTABLE} -version
RESULT_VARIABLE res
OUTPUT_VARIABLE var
ERROR_VARIABLE var # sun-java output to stderr
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE)
- IF( res )
- IF(${Java_FIND_REQUIRED})
- MESSAGE( FATAL_ERROR "Error executing java -version" )
- ELSE()
- MESSAGE( STATUS "Warning, could not run java --version")
- ENDIF()
- ELSE()
+ if( res )
+ if(${Java_FIND_REQUIRED})
+ message( FATAL_ERROR "Error executing java -version" )
+ else()
+ message( STATUS "Warning, could not run java --version")
+ endif()
+ else()
# extract major/minor version and patch level from "java -version" output
- # Tested on linux using
+ # Tested on linux using
# 1. Sun / Sun OEM
# 2. OpenJDK 1.6
# 3. GCJ 1.5
# 4. Kaffe 1.4.2
- IF(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+.*\".*")
+ if(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+.*\".*")
# This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer
- STRING( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\".*"
+ string( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\".*"
"\\1" Java_VERSION_STRING "${var}" )
- ELSEIF(var MATCHES "java full version \"kaffe-[0-9]+\\.[0-9]+\\.[0-9_]+\".*")
+ elseif(var MATCHES "java full version \"kaffe-[0-9]+\\.[0-9]+\\.[0-9_]+\".*")
# Kaffe style
- STRING( REGEX REPLACE "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+).*"
+ string( REGEX REPLACE "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+).*"
"\\1" Java_VERSION_STRING "${var}" )
- ELSE()
- IF(NOT Java_FIND_QUIETLY)
+ else()
+ if(NOT Java_FIND_QUIETLY)
message(WARNING "regex not supported: ${var}. Please report")
- ENDIF(NOT Java_FIND_QUIETLY)
- ENDIF()
- STRING( REGEX REPLACE "([0-9]+).*" "\\1" Java_VERSION_MAJOR "${Java_VERSION_STRING}" )
- STRING( REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_MINOR "${Java_VERSION_STRING}" )
- STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_PATCH "${Java_VERSION_STRING}" )
+ endif()
+ endif()
+ string( REGEX REPLACE "([0-9]+).*" "\\1" Java_VERSION_MAJOR "${Java_VERSION_STRING}" )
+ string( REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_MINOR "${Java_VERSION_STRING}" )
+ string( REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_PATCH "${Java_VERSION_STRING}" )
# warning tweak version can be empty:
- STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+[_\\.]?([0-9]*).*$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" )
+ string( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+[_\\.]?([0-9]*).*$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" )
if( Java_VERSION_TWEAK STREQUAL "" ) # check case where tweak is not defined
set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH})
- else( )
+ else()
set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH}.${Java_VERSION_TWEAK})
- endif( )
- ENDIF()
+ endif()
+ endif()
-ENDIF(Java_JAVA_EXECUTABLE)
+endif()
-FIND_PROGRAM(Java_JAR_EXECUTABLE
+find_program(Java_JAR_EXECUTABLE
NAMES jar
HINTS ${_JAVA_HINTS}
PATHS ${_JAVA_PATHS}
)
-FIND_PROGRAM(Java_JAVAC_EXECUTABLE
+find_program(Java_JAVAC_EXECUTABLE
NAMES javac
HINTS ${_JAVA_HINTS}
PATHS ${_JAVA_PATHS}
)
-FIND_PROGRAM(Java_JAVAH_EXECUTABLE
+find_program(Java_JAVAH_EXECUTABLE
NAMES javah
HINTS ${_JAVA_HINTS}
PATHS ${_JAVA_PATHS}
)
-FIND_PROGRAM(Java_JAVADOC_EXECUTABLE
+find_program(Java_JAVADOC_EXECUTABLE
NAMES javadoc
HINTS ${_JAVA_HINTS}
PATHS ${_JAVA_PATHS}
@@ -178,7 +178,7 @@ if(Java_FIND_COMPONENTS)
message(FATAL_ERROR "Comp: ${component} is not handled")
endif()
set(Java_${component}_FOUND TRUE)
- endforeach(component)
+ endforeach()
else()
# Check for everything
find_package_handle_standard_args(Java
@@ -189,7 +189,7 @@ else()
endif()
-MARK_AS_ADVANCED(
+mark_as_advanced(
Java_JAVA_EXECUTABLE
Java_JAR_EXECUTABLE
Java_JAVAC_EXECUTABLE
@@ -198,7 +198,7 @@ MARK_AS_ADVANCED(
)
# LEGACY
-SET(JAVA_RUNTIME ${Java_JAVA_EXECUTABLE})
-SET(JAVA_ARCHIVE ${Java_JAR_EXECUTABLE})
-SET(JAVA_COMPILE ${Java_JAVAC_EXECUTABLE})
+set(JAVA_RUNTIME ${Java_JAVA_EXECUTABLE})
+set(JAVA_ARCHIVE ${Java_JAR_EXECUTABLE})
+set(JAVA_COMPILE ${Java_JAVAC_EXECUTABLE})
diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake
index 9d1081405..a09211684 100644
--- a/Modules/FindKDE3.cmake
+++ b/Modules/FindKDE3.cmake
@@ -3,8 +3,8 @@
# This module defines the following variables:
# KDE3_DEFINITIONS - compiler definitions required for compiling KDE software
# KDE3_INCLUDE_DIR - the KDE include directory
-# KDE3_INCLUDE_DIRS - the KDE and the Qt include directory, for use with INCLUDE_DIRECTORIES()
-# KDE3_LIB_DIR - the directory where the KDE libraries are installed, for use with LINK_DIRECTORIES()
+# KDE3_INCLUDE_DIRS - the KDE and the Qt include directory, for use with include_directories()
+# KDE3_LIB_DIR - the directory where the KDE libraries are installed, for use with link_directories()
# QT_AND_KDECORE_LIBS - this contains both the Qt and the kdecore library
# KDE3_DCOPIDL_EXECUTABLE - the dcopidl executable
# KDE3_DCOPIDL2CPP_EXECUTABLE - the dcopidl2cpp executable
@@ -23,7 +23,7 @@
# Call this if you want to have automatic moc file handling.
# This means if you include "foo.moc" in the source file foo.cpp
# a moc file for the header foo.h will be created automatically.
-# You can set the property SKIP_AUTOMAKE using SET_SOURCE_FILES_PROPERTIES()
+# You can set the property SKIP_AUTOMAKE using set_source_files_properties()
# to exclude some files in the list from being processed.
#
# KDE3_ADD_MOC_FILES(SRCS_VAR file1 ... fileN )
@@ -46,7 +46,7 @@
# This will create and install a simple libtool file for the given target.
#
# KDE3_ADD_EXECUTABLE(name file1 ... fileN )
-# Currently identical to ADD_EXECUTABLE(), may provide some advanced features in the future.
+# Currently identical to add_executable(), may provide some advanced features in the future.
#
# KDE3_ADD_KPART(name [WITH_PREFIX] file1 ... fileN )
# Create a KDE plugin (KPart, kioslave, etc.) from the given source files.
@@ -77,37 +77,37 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF(NOT UNIX AND KDE3_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Compiling KDE3 applications and libraries under Windows is not supported")
-ENDIF(NOT UNIX AND KDE3_FIND_REQUIRED)
+if(NOT UNIX AND KDE3_FIND_REQUIRED)
+ message(FATAL_ERROR "Compiling KDE3 applications and libraries under Windows is not supported")
+endif()
# If Qt4 has already been found, fail.
-IF(QT4_FOUND)
- IF(KDE3_FIND_REQUIRED)
- MESSAGE( FATAL_ERROR "KDE3/Qt3 and Qt4 cannot be used together in one project.")
- ELSE(KDE3_FIND_REQUIRED)
- IF(NOT KDE3_FIND_QUIETLY)
- MESSAGE( STATUS "KDE3/Qt3 and Qt4 cannot be used together in one project.")
- ENDIF(NOT KDE3_FIND_QUIETLY)
- RETURN()
- ENDIF(KDE3_FIND_REQUIRED)
-ENDIF(QT4_FOUND)
+if(QT4_FOUND)
+ if(KDE3_FIND_REQUIRED)
+ message( FATAL_ERROR "KDE3/Qt3 and Qt4 cannot be used together in one project.")
+ else()
+ if(NOT KDE3_FIND_QUIETLY)
+ message( STATUS "KDE3/Qt3 and Qt4 cannot be used together in one project.")
+ endif()
+ return()
+ endif()
+endif()
-SET(QT_MT_REQUIRED TRUE)
-#SET(QT_MIN_VERSION "3.0.0")
+set(QT_MT_REQUIRED TRUE)
+#set(QT_MIN_VERSION "3.0.0")
#this line includes FindQt.cmake, which searches the Qt library and headers
-IF(KDE3_FIND_REQUIRED)
- SET(_REQ_STRING_KDE3 "REQUIRED")
-ENDIF(KDE3_FIND_REQUIRED)
-
-FIND_PACKAGE(Qt3 ${_REQ_STRING_KDE3})
-FIND_PACKAGE(X11 ${_REQ_STRING_KDE3})
+if(KDE3_FIND_REQUIRED)
+ set(_REQ_STRING_KDE3 "REQUIRED")
+endif()
+
+find_package(Qt3 ${_REQ_STRING_KDE3})
+find_package(X11 ${_REQ_STRING_KDE3})
#now try to find some kde stuff
-FIND_PROGRAM(KDECONFIG_EXECUTABLE NAMES kde-config
+find_program(KDECONFIG_EXECUTABLE NAMES kde-config
HINTS
$ENV{KDEDIR}/bin
PATHS
@@ -115,25 +115,25 @@ FIND_PROGRAM(KDECONFIG_EXECUTABLE NAMES kde-config
/opt/kde/bin
)
-SET(KDE3PREFIX)
-IF(KDECONFIG_EXECUTABLE)
- EXECUTE_PROCESS(COMMAND ${KDECONFIG_EXECUTABLE} --version
+set(KDE3PREFIX)
+if(KDECONFIG_EXECUTABLE)
+ execute_process(COMMAND ${KDECONFIG_EXECUTABLE} --version
OUTPUT_VARIABLE kde_config_version )
- STRING(REGEX MATCH "KDE: .\\." kde_version "${kde_config_version}")
- IF ("${kde_version}" MATCHES "KDE: 3\\.")
- EXECUTE_PROCESS(COMMAND ${KDECONFIG_EXECUTABLE} --prefix
+ string(REGEX MATCH "KDE: .\\." kde_version "${kde_config_version}")
+ if ("${kde_version}" MATCHES "KDE: 3\\.")
+ execute_process(COMMAND ${KDECONFIG_EXECUTABLE} --prefix
OUTPUT_VARIABLE kdedir )
- STRING(REGEX REPLACE "\n" "" KDE3PREFIX "${kdedir}")
+ string(REGEX REPLACE "\n" "" KDE3PREFIX "${kdedir}")
- ENDIF ("${kde_version}" MATCHES "KDE: 3\\.")
-ENDIF(KDECONFIG_EXECUTABLE)
+ endif ()
+endif()
-# at first the KDE include direcory
+# at first the KDE include directory
# kpassdlg.h comes from kdeui and doesn't exist in KDE4 anymore
-FIND_PATH(KDE3_INCLUDE_DIR kpassdlg.h
+find_path(KDE3_INCLUDE_DIR kpassdlg.h
HINTS
$ENV{KDEDIR}/include
${KDE3PREFIX}/include
@@ -145,7 +145,7 @@ FIND_PATH(KDE3_INCLUDE_DIR kpassdlg.h
)
#now the KDE library directory
-FIND_LIBRARY(KDE3_KDECORE_LIBRARY NAMES kdecore
+find_library(KDE3_KDECORE_LIBRARY NAMES kdecore
HINTS
$ENV{KDEDIR}/lib
${KDE3PREFIX}/lib
@@ -154,20 +154,20 @@ FIND_LIBRARY(KDE3_KDECORE_LIBRARY NAMES kdecore
/opt/kde/lib
)
-SET(QT_AND_KDECORE_LIBS ${QT_LIBRARIES} ${KDE3_KDECORE_LIBRARY})
+set(QT_AND_KDECORE_LIBS ${QT_LIBRARIES} ${KDE3_KDECORE_LIBRARY})
-GET_FILENAME_COMPONENT(KDE3_LIB_DIR ${KDE3_KDECORE_LIBRARY} PATH )
+get_filename_component(KDE3_LIB_DIR ${KDE3_KDECORE_LIBRARY} PATH )
-IF(NOT KDE3_LIBTOOL_DIR)
- IF(KDE3_KDECORE_LIBRARY MATCHES lib64)
- SET(KDE3_LIBTOOL_DIR /lib64/kde3)
- ELSE(KDE3_KDECORE_LIBRARY MATCHES lib64)
- SET(KDE3_LIBTOOL_DIR /lib/kde3)
- ENDIF(KDE3_KDECORE_LIBRARY MATCHES lib64)
-ENDIF(NOT KDE3_LIBTOOL_DIR)
+if(NOT KDE3_LIBTOOL_DIR)
+ if(KDE3_KDECORE_LIBRARY MATCHES lib64)
+ set(KDE3_LIBTOOL_DIR /lib64/kde3)
+ else()
+ set(KDE3_LIBTOOL_DIR /lib/kde3)
+ endif()
+endif()
#now search for the dcop utilities
-FIND_PROGRAM(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl
+find_program(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl
HINTS
$ENV{KDEDIR}/bin
${KDE3PREFIX}/bin
@@ -176,7 +176,7 @@ FIND_PROGRAM(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl
/opt/kde/bin
)
-FIND_PROGRAM(KDE3_DCOPIDL2CPP_EXECUTABLE NAMES dcopidl2cpp
+find_program(KDE3_DCOPIDL2CPP_EXECUTABLE NAMES dcopidl2cpp
HINTS
$ENV{KDEDIR}/bin
${KDE3PREFIX}/bin
@@ -185,7 +185,7 @@ FIND_PROGRAM(KDE3_DCOPIDL2CPP_EXECUTABLE NAMES dcopidl2cpp
/opt/kde/bin
)
-FIND_PROGRAM(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler
+find_program(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler
HINTS
$ENV{KDEDIR}/bin
${KDE3PREFIX}/bin
@@ -196,104 +196,104 @@ FIND_PROGRAM(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler
#SET KDE3_FOUND
-IF (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE)
- SET(KDE3_FOUND TRUE)
-ELSE (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE)
- SET(KDE3_FOUND FALSE)
-ENDIF (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE)
+if (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE)
+ set(KDE3_FOUND TRUE)
+else ()
+ set(KDE3_FOUND FALSE)
+endif ()
# add some KDE specific stuff
-SET(KDE3_DEFINITIONS -DQT_CLEAN_NAMESPACE -D_GNU_SOURCE)
+set(KDE3_DEFINITIONS -DQT_CLEAN_NAMESPACE -D_GNU_SOURCE)
# set compiler flags only if KDE3 has actually been found
-IF(KDE3_FOUND)
- SET(_KDE3_USE_FLAGS FALSE)
- IF(CMAKE_COMPILER_IS_GNUCXX)
- SET(_KDE3_USE_FLAGS TRUE) # use flags for gnu compiler
- EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version
+if(KDE3_FOUND)
+ set(_KDE3_USE_FLAGS FALSE)
+ if(CMAKE_COMPILER_IS_GNUCXX)
+ set(_KDE3_USE_FLAGS TRUE) # use flags for gnu compiler
+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
OUTPUT_VARIABLE out)
# gnu gcc 2.96 does not work with flags
# I guess 2.95 also doesn't then
- IF("${out}" MATCHES "2.9[56]")
- SET(_KDE3_USE_FLAGS FALSE)
- ENDIF("${out}" MATCHES "2.9[56]")
- ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+ if("${out}" MATCHES "2.9[56]")
+ set(_KDE3_USE_FLAGS FALSE)
+ endif()
+ endif()
#only on linux, but NOT e.g. on FreeBSD:
- IF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS)
- SET (KDE3_DEFINITIONS ${KDE3_DEFINITIONS} -D_XOPEN_SOURCE=500 -D_BSD_SOURCE)
- SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
- SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-exceptions -fno-check-new -fno-common")
- ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS)
+ if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS)
+ set (KDE3_DEFINITIONS ${KDE3_DEFINITIONS} -D_XOPEN_SOURCE=500 -D_BSD_SOURCE)
+ set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
+ set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-exceptions -fno-check-new -fno-common")
+ endif()
# works on FreeBSD, NOT tested on NetBSD and OpenBSD
- IF (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS)
- SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
- SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common")
- ENDIF (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS)
+ if (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS)
+ set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
+ set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common")
+ endif ()
# if no special buildtype is selected, add -O2 as default optimization
- IF (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS)
- SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
- SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
- ENDIF (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS)
+ if (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS)
+ set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
+ set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
+ endif ()
-#SET(CMAKE_SHARED_LINKER_FLAGS "-avoid-version -module -Wl,--no-undefined -Wl,--allow-shlib-undefined")
-#SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
-#SET(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
-ENDIF(KDE3_FOUND)
+#set(CMAKE_SHARED_LINKER_FLAGS "-avoid-version -module -Wl,--no-undefined -Wl,--allow-shlib-undefined")
+#set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
+#set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
+endif()
# KDE3Macros.cmake contains all the KDE specific macros
-INCLUDE(KDE3Macros)
+include(KDE3Macros)
-MACRO (KDE3_PRINT_RESULTS)
- IF(KDE3_INCLUDE_DIR)
- MESSAGE(STATUS "Found KDE3 include dir: ${KDE3_INCLUDE_DIR}")
- ELSE(KDE3_INCLUDE_DIR)
- MESSAGE(STATUS "Didn't find KDE3 headers")
- ENDIF(KDE3_INCLUDE_DIR)
+macro (KDE3_PRINT_RESULTS)
+ if(KDE3_INCLUDE_DIR)
+ message(STATUS "Found KDE3 include dir: ${KDE3_INCLUDE_DIR}")
+ else()
+ message(STATUS "Didn't find KDE3 headers")
+ endif()
- IF(KDE3_LIB_DIR)
- MESSAGE(STATUS "Found KDE3 library dir: ${KDE3_LIB_DIR}")
- ELSE(KDE3_LIB_DIR)
- MESSAGE(STATUS "Didn't find KDE3 core library")
- ENDIF(KDE3_LIB_DIR)
+ if(KDE3_LIB_DIR)
+ message(STATUS "Found KDE3 library dir: ${KDE3_LIB_DIR}")
+ else()
+ message(STATUS "Didn't find KDE3 core library")
+ endif()
- IF(KDE3_DCOPIDL_EXECUTABLE)
- MESSAGE(STATUS "Found KDE3 dcopidl preprocessor: ${KDE3_DCOPIDL_EXECUTABLE}")
- ELSE(KDE3_DCOPIDL_EXECUTABLE)
- MESSAGE(STATUS "Didn't find the KDE3 dcopidl preprocessor")
- ENDIF(KDE3_DCOPIDL_EXECUTABLE)
+ if(KDE3_DCOPIDL_EXECUTABLE)
+ message(STATUS "Found KDE3 dcopidl preprocessor: ${KDE3_DCOPIDL_EXECUTABLE}")
+ else()
+ message(STATUS "Didn't find the KDE3 dcopidl preprocessor")
+ endif()
- IF(KDE3_DCOPIDL2CPP_EXECUTABLE)
- MESSAGE(STATUS "Found KDE3 dcopidl2cpp preprocessor: ${KDE3_DCOPIDL2CPP_EXECUTABLE}")
- ELSE(KDE3_DCOPIDL2CPP_EXECUTABLE)
- MESSAGE(STATUS "Didn't find the KDE3 dcopidl2cpp preprocessor")
- ENDIF(KDE3_DCOPIDL2CPP_EXECUTABLE)
+ if(KDE3_DCOPIDL2CPP_EXECUTABLE)
+ message(STATUS "Found KDE3 dcopidl2cpp preprocessor: ${KDE3_DCOPIDL2CPP_EXECUTABLE}")
+ else()
+ message(STATUS "Didn't find the KDE3 dcopidl2cpp preprocessor")
+ endif()
- IF(KDE3_KCFGC_EXECUTABLE)
- MESSAGE(STATUS "Found KDE3 kconfig_compiler preprocessor: ${KDE3_KCFGC_EXECUTABLE}")
- ELSE(KDE3_KCFGC_EXECUTABLE)
- MESSAGE(STATUS "Didn't find the KDE3 kconfig_compiler preprocessor")
- ENDIF(KDE3_KCFGC_EXECUTABLE)
+ if(KDE3_KCFGC_EXECUTABLE)
+ message(STATUS "Found KDE3 kconfig_compiler preprocessor: ${KDE3_KCFGC_EXECUTABLE}")
+ else()
+ message(STATUS "Didn't find the KDE3 kconfig_compiler preprocessor")
+ endif()
-ENDMACRO (KDE3_PRINT_RESULTS)
+endmacro ()
-IF (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND)
+if (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND)
#bail out if something wasn't found
KDE3_PRINT_RESULTS()
- MESSAGE(FATAL_ERROR "Could NOT find everything required for compiling KDE 3 programs")
+ message(FATAL_ERROR "Could NOT find everything required for compiling KDE 3 programs")
-ENDIF (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND)
+endif ()
-IF (NOT KDE3_FIND_QUIETLY)
+if (NOT KDE3_FIND_QUIETLY)
KDE3_PRINT_RESULTS()
-ENDIF (NOT KDE3_FIND_QUIETLY)
+endif ()
#add the found Qt and KDE include directories to the current include path
-SET(KDE3_INCLUDE_DIRS ${QT_INCLUDE_DIR} ${KDE3_INCLUDE_DIR})
+set(KDE3_INCLUDE_DIRS ${QT_INCLUDE_DIR} ${KDE3_INCLUDE_DIR})
diff --git a/Modules/FindKDE4.cmake b/Modules/FindKDE4.cmake
index ed4f270b0..c653a04cd 100644
--- a/Modules/FindKDE4.cmake
+++ b/Modules/FindKDE4.cmake
@@ -24,28 +24,28 @@
# License text for the above reference.)
# If Qt3 has already been found, fail.
-IF(QT_QT_LIBRARY)
- IF(KDE4_FIND_REQUIRED)
- MESSAGE( FATAL_ERROR "KDE4/Qt4 and Qt3 cannot be used together in one project.")
- ELSE(KDE4_FIND_REQUIRED)
- IF(NOT KDE4_FIND_QUIETLY)
- MESSAGE( STATUS "KDE4/Qt4 and Qt3 cannot be used together in one project.")
- ENDIF(NOT KDE4_FIND_QUIETLY)
- RETURN()
- ENDIF(KDE4_FIND_REQUIRED)
-ENDIF(QT_QT_LIBRARY)
+if(QT_QT_LIBRARY)
+ if(KDE4_FIND_REQUIRED)
+ message( FATAL_ERROR "KDE4/Qt4 and Qt3 cannot be used together in one project.")
+ else()
+ if(NOT KDE4_FIND_QUIETLY)
+ message( STATUS "KDE4/Qt4 and Qt3 cannot be used together in one project.")
+ endif()
+ return()
+ endif()
+endif()
-FILE(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS)
+file(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS)
# when cross compiling, searching kde4-config in order to run it later on
-# doesn't make a lot of sense. We'll have to do something about this.
+# doesn't make a lot of sense. We'll have to do something about this.
# Searching always in the target environment ? Then we get at least the correct one,
# still it can't be used to run it. Alex
# For KDE4 kde-config has been renamed to kde4-config
-FIND_PROGRAM(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config
+find_program(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config
# the suffix must be used since KDEDIRS can be a list of directories which don't have bin/ appended
- PATH_SUFFIXES bin
+ PATH_SUFFIXES bin
HINTS
${CMAKE_INSTALL_PREFIX}
${_KDEDIRS}
@@ -53,48 +53,48 @@ FIND_PROGRAM(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config
ONLY_CMAKE_FIND_ROOT_PATH
)
-IF (NOT KDE4_KDECONFIG_EXECUTABLE)
- IF (KDE4_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "ERROR: Could not find KDE4 kde4-config")
- ENDIF (KDE4_FIND_REQUIRED)
-ENDIF (NOT KDE4_KDECONFIG_EXECUTABLE)
+if (NOT KDE4_KDECONFIG_EXECUTABLE)
+ if (KDE4_FIND_REQUIRED)
+ message(FATAL_ERROR "ERROR: Could not find KDE4 kde4-config")
+ endif ()
+endif ()
# when cross compiling, KDE4_DATA_DIR may be already preset
-IF(NOT KDE4_DATA_DIR)
- IF(CMAKE_CROSSCOMPILING)
+if(NOT KDE4_DATA_DIR)
+ if(CMAKE_CROSSCOMPILING)
# when cross compiling, don't run kde4-config but use its location as install dir
- GET_FILENAME_COMPONENT(KDE4_DATA_DIR "${KDE4_KDECONFIG_EXECUTABLE}" PATH)
- GET_FILENAME_COMPONENT(KDE4_DATA_DIR "${KDE4_DATA_DIR}" PATH)
- ELSE(CMAKE_CROSSCOMPILING)
+ get_filename_component(KDE4_DATA_DIR "${KDE4_KDECONFIG_EXECUTABLE}" PATH)
+ get_filename_component(KDE4_DATA_DIR "${KDE4_DATA_DIR}" PATH)
+ else()
# then ask kde4-config for the kde data dirs
- IF(KDE4_KDECONFIG_EXECUTABLE)
- EXECUTE_PROCESS(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path data OUTPUT_VARIABLE _data_DIR ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
- FILE(TO_CMAKE_PATH "${_data_DIR}" _data_DIR)
+ if(KDE4_KDECONFIG_EXECUTABLE)
+ execute_process(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path data OUTPUT_VARIABLE _data_DIR ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+ file(TO_CMAKE_PATH "${_data_DIR}" _data_DIR)
# then check the data dirs for FindKDE4Internal.cmake
- FIND_PATH(KDE4_DATA_DIR cmake/modules/FindKDE4Internal.cmake HINTS ${_data_DIR})
- ENDIF(KDE4_KDECONFIG_EXECUTABLE)
- ENDIF(CMAKE_CROSSCOMPILING)
-ENDIF(NOT KDE4_DATA_DIR)
+ find_path(KDE4_DATA_DIR cmake/modules/FindKDE4Internal.cmake HINTS ${_data_DIR})
+ endif()
+ endif()
+endif()
# if it has been found...
-IF (KDE4_DATA_DIR)
+if (KDE4_DATA_DIR)
- SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${KDE4_DATA_DIR}/cmake/modules)
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${KDE4_DATA_DIR}/cmake/modules)
- IF (KDE4_FIND_QUIETLY)
- SET(_quiet QUIET)
- ENDIF (KDE4_FIND_QUIETLY)
+ if (KDE4_FIND_QUIETLY)
+ set(_quiet QUIET)
+ endif ()
- IF (KDE4_FIND_REQUIRED)
- SET(_req REQUIRED)
- ENDIF (KDE4_FIND_REQUIRED)
+ if (KDE4_FIND_REQUIRED)
+ set(_req REQUIRED)
+ endif ()
# use FindKDE4Internal.cmake to do the rest
- FIND_PACKAGE(KDE4Internal ${_req} ${_quiet})
-ELSE (KDE4_DATA_DIR)
- IF (KDE4_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "ERROR: cmake/modules/FindKDE4Internal.cmake not found in ${_data_DIR}")
- ENDIF (KDE4_FIND_REQUIRED)
-ENDIF (KDE4_DATA_DIR)
+ find_package(KDE4Internal ${_req} ${_quiet})
+else ()
+ if (KDE4_FIND_REQUIRED)
+ message(FATAL_ERROR "ERROR: cmake/modules/FindKDE4Internal.cmake not found in ${_data_DIR}")
+ endif ()
+endif ()
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 0ae98dfa7..430e45f2c 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -41,9 +41,9 @@ set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
if (NOT _LANGUAGES_ MATCHES Fortran)
include(CheckFunctionExists)
-else (NOT _LANGUAGES_ MATCHES Fortran)
+else ()
include(CheckFortranFunctionExists)
-endif (NOT _LANGUAGES_ MATCHES Fortran)
+endif ()
set(LAPACK_FOUND FALSE)
set(LAPACK95_FOUND FALSE)
@@ -69,9 +69,9 @@ if (NOT _libdir)
if (WIN32)
set(_libdir ENV LIB)
elseif (APPLE)
- set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH)
+ set(_libdir ENV DYLD_LIBRARY_PATH)
else ()
- set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH)
+ set(_libdir ENV LD_LIBRARY_PATH)
endif ()
endif ()
foreach(_library ${_list})
@@ -81,18 +81,18 @@ foreach(_library ${_list})
if (BLA_STATIC)
if (WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
- endif ( WIN32 )
+ endif ()
if (APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
- else (APPLE)
+ else ()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
- endif (APPLE)
- else (BLA_STATIC)
+ endif ()
+ else ()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# for ubuntu's libblas3gf and liblapack3gf packages
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
endif ()
- endif (BLA_STATIC)
+ endif ()
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
PATHS ${_libdir}
@@ -100,35 +100,35 @@ foreach(_library ${_list})
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
- endif(_libraries_work)
-endforeach(_library ${_list})
+ endif()
+endforeach()
if(_libraries_work)
# Test this combination of libraries.
if(UNIX AND BLA_STATIC)
set(CMAKE_REQUIRED_LIBRARIES ${_flags} "-Wl,--start-group" ${${LIBRARIES}} ${_blas} "-Wl,--end-group" ${_threads})
- else(UNIX AND BLA_STATIC)
+ else()
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads})
- endif(UNIX AND BLA_STATIC)
+ endif()
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
if (NOT _LANGUAGES_ MATCHES Fortran)
check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
- else (NOT _LANGUAGES_ MATCHES Fortran)
+ else ()
check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
- endif (NOT _LANGUAGES_ MATCHES Fortran)
+ endif ()
set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
-endif(_libraries_work)
+endif()
if(_libraries_work)
set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threads})
- else(_libraries_work)
+ else()
set(${LIBRARIES} FALSE)
- endif(_libraries_work)
+ endif()
-endmacro(Check_Lapack_Libraries)
+endmacro()
set(LAPACK_LINKER_FLAGS)
@@ -138,20 +138,20 @@ set(LAPACK95_LIBRARIES)
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_package(BLAS)
-else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
+else()
find_package(BLAS REQUIRED)
-endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
+endif()
if(BLAS_FOUND)
set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
if ($ENV{BLA_VENDOR} MATCHES ".+")
set(BLA_VENDOR $ENV{BLA_VENDOR})
- else ($ENV{BLA_VENDOR} MATCHES ".+")
+ else ()
if(NOT BLA_VENDOR)
set(BLA_VENDOR "All")
- endif(NOT BLA_VENDOR)
- endif ($ENV{BLA_VENDOR} MATCHES ".+")
+ endif()
+ endif ()
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES)
@@ -164,8 +164,8 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
"${BLAS_LIBRARIES}"
""
)
- endif(NOT LAPACK_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
#acml lapack
@@ -187,8 +187,8 @@ if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
"${BLAS_LIBRARIES}"
""
)
- endif(NOT LAPACK_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
if ( NOT LAPACK_LIBRARIES )
check_lapack_libraries(
@@ -200,8 +200,8 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
"${BLAS_LIBRARIES}"
""
)
- endif ( NOT LAPACK_LIBRARIES )
-endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
+ endif ()
+endif ()
# Generic LAPACK library?
if (BLA_VENDOR STREQUAL "Generic" OR
BLA_VENDOR STREQUAL "ATLAS" OR
@@ -216,7 +216,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR
"${BLAS_LIBRARIES}"
""
)
- endif ( NOT LAPACK_LIBRARIES )
+ endif ()
endif ()
#intel lapack
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
@@ -226,9 +226,9 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_PACKAGE(Threads)
- else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
+ else()
find_package(Threads REQUIRED)
- endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
+ endif()
if (BLA_F95)
if(NOT LAPACK95_LIBRARIES)
# old
@@ -241,7 +241,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
"${BLAS95_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
- endif(NOT LAPACK95_LIBRARIES)
+ endif()
if(NOT LAPACK95_LIBRARIES)
# new >= 10.3
check_lapack_libraries(
@@ -253,8 +253,8 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
"${BLAS95_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
- endif(NOT LAPACK95_LIBRARIES)
- else(BLA_F95)
+ endif()
+ else()
if(NOT LAPACK_LIBRARIES)
# old
check_lapack_libraries(
@@ -266,7 +266,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
"${BLAS_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
- endif(NOT LAPACK_LIBRARIES)
+ endif()
if(NOT LAPACK_LIBRARIES)
# new >= 10.3
check_lapack_libraries(
@@ -278,59 +278,59 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
"${BLAS_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
- endif(NOT LAPACK_LIBRARIES)
- endif(BLA_F95)
- endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
-endif(BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
-else(BLAS_FOUND)
+ endif()
+ endif()
+ endif ()
+endif()
+else()
message(STATUS "LAPACK requires BLAS")
-endif(BLAS_FOUND)
+endif()
if(BLA_F95)
if(LAPACK95_LIBRARIES)
set(LAPACK95_FOUND TRUE)
- else(LAPACK95_LIBRARIES)
+ else()
set(LAPACK95_FOUND FALSE)
- endif(LAPACK95_LIBRARIES)
+ endif()
if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK95_FOUND)
message(STATUS "A library with LAPACK95 API found.")
- else(LAPACK95_FOUND)
+ else()
if(LAPACK_FIND_REQUIRED)
message(FATAL_ERROR
"A required library with LAPACK95 API not found. Please specify library location."
)
- else(LAPACK_FIND_REQUIRED)
+ else()
message(STATUS
"A library with LAPACK95 API not found. Please specify library location."
)
- endif(LAPACK_FIND_REQUIRED)
- endif(LAPACK95_FOUND)
- endif(NOT LAPACK_FIND_QUIETLY)
+ endif()
+ endif()
+ endif()
set(LAPACK_FOUND "${LAPACK95_FOUND}")
set(LAPACK_LIBRARIES "${LAPACK95_LIBRARIES}")
-else(BLA_F95)
+else()
if(LAPACK_LIBRARIES)
set(LAPACK_FOUND TRUE)
- else(LAPACK_LIBRARIES)
+ else()
set(LAPACK_FOUND FALSE)
- endif(LAPACK_LIBRARIES)
+ endif()
if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_FOUND)
message(STATUS "A library with LAPACK API found.")
- else(LAPACK_FOUND)
+ else()
if(LAPACK_FIND_REQUIRED)
message(FATAL_ERROR
"A required library with LAPACK API not found. Please specify library location."
)
- else(LAPACK_FIND_REQUIRED)
+ else()
message(STATUS
"A library with LAPACK API not found. Please specify library location."
)
- endif(LAPACK_FIND_REQUIRED)
- endif(LAPACK_FOUND)
- endif(NOT LAPACK_FIND_QUIETLY)
-endif(BLA_F95)
+ endif()
+ endif()
+ endif()
+endif()
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake
index 950daca5a..bc752a95a 100644
--- a/Modules/FindLATEX.cmake
+++ b/Modules/FindLATEX.cmake
@@ -1,14 +1,14 @@
# - Find Latex
# This module finds if Latex is installed and determines where the
# executables are. This code sets the following variables:
-#
+#
# LATEX_COMPILER: path to the LaTeX compiler
# PDFLATEX_COMPILER: path to the PdfLaTeX compiler
# BIBTEX_COMPILER: path to the BibTeX compiler
# MAKEINDEX_COMPILER: path to the MakeIndex compiler
# DVIPS_CONVERTER: path to the DVIPS converter
# PS2PDF_CONVERTER: path to the PS2PDF converter
-# LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
+# LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
#
#=============================================================================
@@ -24,97 +24,97 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF (WIN32)
+if (WIN32)
# Try to find the MikTex binary path (look for its package manager).
- FIND_PATH(MIKTEX_BINARY_PATH mpm.exe
+ find_path(MIKTEX_BINARY_PATH mpm.exe
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MiK\\MiKTeX\\CurrentVersion\\MiKTeX;Install Root]/miktex/bin"
- DOC
+ DOC
"Path to the MikTex binary directory."
)
- MARK_AS_ADVANCED(MIKTEX_BINARY_PATH)
+ mark_as_advanced(MIKTEX_BINARY_PATH)
# Try to find the GhostScript binary path (look for gswin32).
- GET_FILENAME_COMPONENT(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_8_00
+ get_filename_component(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_8_00
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\AFPL Ghostscript\\8.00;GS_DLL]" PATH
)
- GET_FILENAME_COMPONENT(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_7_04
+ get_filename_component(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_7_04
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\AFPL Ghostscript\\7.04;GS_DLL]" PATH
)
- FIND_PATH(GHOSTSCRIPT_BINARY_PATH gswin32.exe
+ find_path(GHOSTSCRIPT_BINARY_PATH gswin32.exe
${GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_8_00}
${GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_7_04}
DOC "Path to the GhostScript binary directory."
)
- MARK_AS_ADVANCED(GHOSTSCRIPT_BINARY_PATH)
+ mark_as_advanced(GHOSTSCRIPT_BINARY_PATH)
- FIND_PATH(GHOSTSCRIPT_LIBRARY_PATH ps2pdf13.bat
+ find_path(GHOSTSCRIPT_LIBRARY_PATH ps2pdf13.bat
"${GHOSTSCRIPT_BINARY_PATH}/../lib"
DOC "Path to the GhostScript library directory."
)
- MARK_AS_ADVANCED(GHOSTSCRIPT_LIBRARY_PATH)
+ mark_as_advanced(GHOSTSCRIPT_LIBRARY_PATH)
-ENDIF (WIN32)
+endif ()
-FIND_PROGRAM(LATEX_COMPILER
+find_program(LATEX_COMPILER
NAMES latex
PATHS ${MIKTEX_BINARY_PATH}
/usr/bin
)
-FIND_PROGRAM(PDFLATEX_COMPILER
+find_program(PDFLATEX_COMPILER
NAMES pdflatex
PATHS ${MIKTEX_BINARY_PATH}
/usr/bin
)
-FIND_PROGRAM(BIBTEX_COMPILER
+find_program(BIBTEX_COMPILER
NAMES bibtex
PATHS ${MIKTEX_BINARY_PATH}
/usr/bin
)
-FIND_PROGRAM(MAKEINDEX_COMPILER
+find_program(MAKEINDEX_COMPILER
NAMES makeindex
PATHS ${MIKTEX_BINARY_PATH}
/usr/bin
)
-FIND_PROGRAM(DVIPS_CONVERTER
+find_program(DVIPS_CONVERTER
NAMES dvips
PATHS ${MIKTEX_BINARY_PATH}
/usr/bin
)
-FIND_PROGRAM(DVIPDF_CONVERTER
+find_program(DVIPDF_CONVERTER
NAMES dvipdfm dvipdft dvipdf
PATHS ${MIKTEX_BINARY_PATH}
/usr/bin
)
-IF (WIN32)
- FIND_PROGRAM(PS2PDF_CONVERTER
+if (WIN32)
+ find_program(PS2PDF_CONVERTER
NAMES ps2pdf14.bat
PATHS ${GHOSTSCRIPT_LIBRARY_PATH}
)
-ELSE (WIN32)
- FIND_PROGRAM(PS2PDF_CONVERTER
+else ()
+ find_program(PS2PDF_CONVERTER
NAMES ps2pdf14 ps2pdf
)
-ENDIF (WIN32)
+endif ()
-FIND_PROGRAM(LATEX2HTML_CONVERTER
+find_program(LATEX2HTML_CONVERTER
NAMES latex2html
PATHS ${MIKTEX_BINARY_PATH}
/usr/bin
)
-MARK_AS_ADVANCED(
+mark_as_advanced(
LATEX_COMPILER
PDFLATEX_COMPILER
BIBTEX_COMPILER
diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake
index 729f5ce73..837e63324 100644
--- a/Modules/FindLibLZMA.cmake
+++ b/Modules/FindLibLZMA.cmake
@@ -29,30 +29,31 @@
# License text for the above reference.)
-FIND_PATH(LIBLZMA_INCLUDE_DIR lzma.h )
-FIND_LIBRARY(LIBLZMA_LIBRARY lzma)
+find_path(LIBLZMA_INCLUDE_DIR lzma.h )
+find_library(LIBLZMA_LIBRARY lzma)
-IF(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
- FILE(READ "${LIBLZMA_INCLUDE_DIR}/lzma/version.h" LIBLZMA_HEADER_CONTENTS)
+if(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
+ file(STRINGS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h" LIBLZMA_HEADER_CONTENTS REGEX "#define LZMA_VERSION_[A-Z]+ [0-9]+")
- STRING(REGEX REPLACE ".*#define LZMA_VERSION_MAJOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MAJOR "${LIBLZMA_HEADER_CONTENTS}")
- STRING(REGEX REPLACE ".*#define LZMA_VERSION_MINOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MINOR "${LIBLZMA_HEADER_CONTENTS}")
- STRING(REGEX REPLACE ".*#define LZMA_VERSION_PATCH ([0-9]+).*" "\\1" LIBLZMA_VERSION_PATCH "${LIBLZMA_HEADER_CONTENTS}")
+ string(REGEX REPLACE ".*#define LZMA_VERSION_MAJOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MAJOR "${LIBLZMA_HEADER_CONTENTS}")
+ string(REGEX REPLACE ".*#define LZMA_VERSION_MINOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MINOR "${LIBLZMA_HEADER_CONTENTS}")
+ string(REGEX REPLACE ".*#define LZMA_VERSION_PATCH ([0-9]+).*" "\\1" LIBLZMA_VERSION_PATCH "${LIBLZMA_HEADER_CONTENTS}")
- SET(LIBLZMA_VERSION_STRING "${LIBLZMA_VERSION_MAJOR}.${LIBLZMA_VERSION_MINOR}.${LIBLZMA_VERSION_PATCH}")
-ENDIF(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
+ set(LIBLZMA_VERSION_STRING "${LIBLZMA_VERSION_MAJOR}.${LIBLZMA_VERSION_MINOR}.${LIBLZMA_VERSION_PATCH}")
+ unset(LIBLZMA_HEADER_CONTENTS)
+endif()
# We're using new code known now as XZ, even library still been called LZMA
# it can be found in http://tukaani.org/xz/
# Avoid using old codebase
-IF (LIBLZMA_LIBRARY)
- INCLUDE(CheckLibraryExists)
+if (LIBLZMA_LIBRARY)
+ include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER)
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER)
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET)
-ENDIF (LIBLZMA_LIBRARY)
+endif ()
-INCLUDE(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA REQUIRED_VARS LIBLZMA_INCLUDE_DIR
LIBLZMA_LIBRARY
LIBLZMA_HAS_AUTO_DECODER
@@ -61,9 +62,9 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA REQUIRED_VARS LIBLZMA_INCLUDE_DIR
VERSION_VAR LIBLZMA_VERSION_STRING
)
-IF (LIBLZMA_FOUND)
- SET(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
- SET(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})
-ENDIF (LIBLZMA_FOUND)
+if (LIBLZMA_FOUND)
+ set(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
+ set(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})
+endif ()
-MARK_AS_ADVANCED( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
+mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index 48a549806..858496e09 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -23,44 +23,44 @@
# License text for the above reference.)
# use pkg-config to get the directories and then use these values
-# in the FIND_PATH() and FIND_LIBRARY() calls
-FIND_PACKAGE(PkgConfig QUIET)
+# in the find_path() and find_library() calls
+find_package(PkgConfig QUIET)
PKG_CHECK_MODULES(PC_LIBXML QUIET libxml-2.0)
-SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER})
+set(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER})
-FIND_PATH(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
+find_path(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
HINTS
${PC_LIBXML_INCLUDEDIR}
${PC_LIBXML_INCLUDE_DIRS}
PATH_SUFFIXES libxml2
)
-FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2
+find_library(LIBXML2_LIBRARIES NAMES xml2 libxml2
HINTS
${PC_LIBXML_LIBDIR}
${PC_LIBXML_LIBRARY_DIRS}
)
-FIND_PROGRAM(LIBXML2_XMLLINT_EXECUTABLE xmllint)
+find_program(LIBXML2_XMLLINT_EXECUTABLE xmllint)
# for backwards compat. with KDE 4.0.x:
-SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
+set(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
-IF(PC_LIBXML_VERSION)
- SET(LIBXML2_VERSION_STRING ${PC_LIBXML_VERSION})
-ELSEIF(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h")
- FILE(STRINGS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h" libxml2_version_str
+if(PC_LIBXML_VERSION)
+ set(LIBXML2_VERSION_STRING ${PC_LIBXML_VERSION})
+elseif(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h")
+ file(STRINGS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h" libxml2_version_str
REGEX "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\".*\"")
- STRING(REGEX REPLACE "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
+ string(REGEX REPLACE "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
LIBXML2_VERSION_STRING "${libxml2_version_str}")
- UNSET(libxml2_version_str)
-ENDIF()
+ unset(libxml2_version_str)
+endif()
-# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2
REQUIRED_VARS LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR
VERSION_VAR LIBXML2_VERSION_STRING)
-MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)
+mark_as_advanced(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)
diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake
index dd5aac461..7d142f430 100644
--- a/Modules/FindLibXslt.cmake
+++ b/Modules/FindLibXslt.cmake
@@ -25,50 +25,50 @@
# License text for the above reference.)
# use pkg-config to get the directories and then use these values
-# in the FIND_PATH() and FIND_LIBRARY() calls
-FIND_PACKAGE(PkgConfig QUIET)
+# in the find_path() and find_library() calls
+find_package(PkgConfig QUIET)
PKG_CHECK_MODULES(PC_LIBXSLT QUIET libxslt)
-SET(LIBXSLT_DEFINITIONS ${PC_LIBXSLT_CFLAGS_OTHER})
+set(LIBXSLT_DEFINITIONS ${PC_LIBXSLT_CFLAGS_OTHER})
-FIND_PATH(LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h
+find_path(LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h
HINTS
${PC_LIBXSLT_INCLUDEDIR}
${PC_LIBXSLT_INCLUDE_DIRS}
)
-FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt
+find_library(LIBXSLT_LIBRARIES NAMES xslt libxslt
HINTS
${PC_LIBXSLT_LIBDIR}
${PC_LIBXSLT_LIBRARY_DIRS}
)
-FIND_LIBRARY(LIBXSLT_EXSLT_LIBRARY NAMES exslt libexslt
+find_library(LIBXSLT_EXSLT_LIBRARY NAMES exslt libexslt
HINTS
${PC_LIBXSLT_LIBDIR}
${PC_LIBXSLT_LIBRARY_DIRS}
)
-SET(LIBXSLT_EXSLT_LIBRARIES ${LIBXSLT_EXSLT_LIBRARY} )
+set(LIBXSLT_EXSLT_LIBRARIES ${LIBXSLT_EXSLT_LIBRARY} )
-FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc)
+find_program(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc)
-IF(PC_LIBXSLT_VERSION)
- SET(LIBXSLT_VERSION_STRING ${PC_LIBXSLT_VERSION})
-ELSEIF(LIBXSLT_INCLUDE_DIR AND EXISTS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h")
- FILE(STRINGS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h" libxslt_version_str
+if(PC_LIBXSLT_VERSION)
+ set(LIBXSLT_VERSION_STRING ${PC_LIBXSLT_VERSION})
+elseif(LIBXSLT_INCLUDE_DIR AND EXISTS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h")
+ file(STRINGS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h" libxslt_version_str
REGEX "^#define[\t ]+LIBXSLT_DOTTED_VERSION[\t ]+\".*\"")
- STRING(REGEX REPLACE "^#define[\t ]+LIBXSLT_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
+ string(REGEX REPLACE "^#define[\t ]+LIBXSLT_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
LIBXSLT_VERSION_STRING "${libxslt_version_str}")
- UNSET(libxslt_version_str)
-ENDIF()
+ unset(libxslt_version_str)
+endif()
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt
REQUIRED_VARS LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR
VERSION_VAR LIBXSLT_VERSION_STRING)
-MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR
+mark_as_advanced(LIBXSLT_INCLUDE_DIR
LIBXSLT_LIBRARIES
LIBXSLT_EXSLT_LIBRARY
LIBXSLT_XSLTPROC_EXECUTABLE)
diff --git a/Modules/FindLua50.cmake b/Modules/FindLua50.cmake
index 9a5cc1703..0276a98f4 100644
--- a/Modules/FindLua50.cmake
+++ b/Modules/FindLua50.cmake
@@ -1,6 +1,6 @@
# Locate Lua library
# This module defines
-# LUA50_FOUND, if false, do not try to link to Lua
+# LUA50_FOUND, if false, do not try to link to Lua
# LUA_LIBRARIES, both lua and lualib
# LUA_INCLUDE_DIR, where to find lua.h and lualib.h (and probably lauxlib.h)
#
@@ -24,9 +24,9 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(LUA_INCLUDE_DIR lua.h
+find_path(LUA_INCLUDE_DIR lua.h
HINTS
- $ENV{LUA_DIR}
+ ENV LUA_DIR
PATH_SUFFIXES include/lua50 include/lua5.0 include/lua5 include/lua include
PATHS
~/Library/Frameworks
@@ -37,11 +37,11 @@ FIND_PATH(LUA_INCLUDE_DIR lua.h
/opt
)
-FIND_LIBRARY(LUA_LIBRARY_lua
+find_library(LUA_LIBRARY_lua
NAMES lua50 lua5.0 lua-5.0 lua5 lua
HINTS
- $ENV{LUA_DIR}
- PATH_SUFFIXES lib64 lib
+ ENV LUA_DIR
+ PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
@@ -53,38 +53,38 @@ FIND_LIBRARY(LUA_LIBRARY_lua
# In an OS X framework, lualib is usually included as part of the framework
# (like GLU in OpenGL.framework)
-IF(${LUA_LIBRARY_lua} MATCHES "framework")
- SET( LUA_LIBRARIES "${LUA_LIBRARY_lua}" CACHE STRING "Lua framework")
-ELSE(${LUA_LIBRARY_lua} MATCHES "framework")
- FIND_LIBRARY(LUA_LIBRARY_lualib
+if(${LUA_LIBRARY_lua} MATCHES "framework")
+ set( LUA_LIBRARIES "${LUA_LIBRARY_lua}" CACHE STRING "Lua framework")
+else()
+ find_library(LUA_LIBRARY_lualib
NAMES lualib50 lualib5.0 lualib5 lualib
HINTS
- $ENV{LUALIB_DIR}
- $ENV{LUA_DIR}
- PATH_SUFFIXES lib64 lib
+ ENV LUALIB_DIR
+ ENV LUA_DIR
+ PATH_SUFFIXES lib
PATHS
/sw
/opt/local
/opt/csw
/opt
)
- IF(LUA_LIBRARY_lualib AND LUA_LIBRARY_lua)
+ if(LUA_LIBRARY_lualib AND LUA_LIBRARY_lua)
# include the math library for Unix
- IF(UNIX AND NOT APPLE)
- FIND_LIBRARY(MATH_LIBRARY_FOR_LUA m)
- SET( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua};${MATH_LIBRARY_FOR_LUA}" CACHE STRING "This is the concatentation of lua and lualib libraries")
+ if(UNIX AND NOT APPLE)
+ find_library(MATH_LIBRARY_FOR_LUA m)
+ set( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua};${MATH_LIBRARY_FOR_LUA}" CACHE STRING "This is the concatentation of lua and lualib libraries")
# For Windows and Mac, don't need to explicitly include the math library
- ELSE(UNIX AND NOT APPLE)
- SET( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua}" CACHE STRING "This is the concatentation of lua and lualib libraries")
- ENDIF(UNIX AND NOT APPLE)
- ENDIF(LUA_LIBRARY_lualib AND LUA_LIBRARY_lua)
-ENDIF(${LUA_LIBRARY_lua} MATCHES "framework")
+ else()
+ set( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua}" CACHE STRING "This is the concatentation of lua and lualib libraries")
+ endif()
+ endif()
+endif()
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua50 DEFAULT_MSG LUA_LIBRARIES LUA_INCLUDE_DIR)
-MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES)
+mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES)
diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake
index e111d3624..eac25f526 100644
--- a/Modules/FindLua51.cmake
+++ b/Modules/FindLua51.cmake
@@ -1,6 +1,6 @@
# Locate Lua library
# This module defines
-# LUA51_FOUND, if false, do not try to link to Lua
+# LUA51_FOUND, if false, do not try to link to Lua
# LUA_LIBRARIES
# LUA_INCLUDE_DIR, where to find lua.h
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
@@ -25,9 +25,9 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(LUA_INCLUDE_DIR lua.h
+find_path(LUA_INCLUDE_DIR lua.h
HINTS
- $ENV{LUA_DIR}
+ ENV LUA_DIR
PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include
PATHS
~/Library/Frameworks
@@ -38,11 +38,11 @@ FIND_PATH(LUA_INCLUDE_DIR lua.h
/opt
)
-FIND_LIBRARY(LUA_LIBRARY
+find_library(LUA_LIBRARY
NAMES lua51 lua5.1 lua-5.1 lua
HINTS
- $ENV{LUA_DIR}
- PATH_SUFFIXES lib64 lib
+ ENV LUA_DIR
+ PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
@@ -52,30 +52,30 @@ FIND_LIBRARY(LUA_LIBRARY
/opt
)
-IF(LUA_LIBRARY)
+if(LUA_LIBRARY)
# include the math library for Unix
- IF(UNIX AND NOT APPLE)
- FIND_LIBRARY(LUA_MATH_LIBRARY m)
- SET( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
+ if(UNIX AND NOT APPLE)
+ find_library(LUA_MATH_LIBRARY m)
+ set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
# For Windows and Mac, don't need to explicitly include the math library
- ELSE(UNIX AND NOT APPLE)
- SET( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
- ENDIF(UNIX AND NOT APPLE)
-ENDIF(LUA_LIBRARY)
+ else()
+ set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
+ endif()
+endif()
-IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
- FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
+if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
+ file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
- STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
- UNSET(lua_version_str)
-ENDIF()
+ string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
+ unset(lua_version_str)
+endif()
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
VERSION_VAR LUA_VERSION_STRING)
-MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
+mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake
index 3df284241..4ff7586dc 100644
--- a/Modules/FindMFC.cmake
+++ b/Modules/FindMFC.cmake
@@ -18,43 +18,43 @@
# License text for the above reference.)
# Assume no MFC support
-SET(MFC_FOUND "NO")
+set(MFC_FOUND "NO")
# Only attempt the try_compile call if it has a chance to succeed:
-SET(MFC_ATTEMPT_TRY_COMPILE 0)
-IF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW)
- SET(MFC_ATTEMPT_TRY_COMPILE 1)
-ENDIF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW)
+set(MFC_ATTEMPT_TRY_COMPILE 0)
+if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW)
+ set(MFC_ATTEMPT_TRY_COMPILE 1)
+endif()
-IF(MFC_ATTEMPT_TRY_COMPILE)
- IF("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$")
- SET(CHECK_INCLUDE_FILE_VAR "afxwin.h")
- CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
+if(MFC_ATTEMPT_TRY_COMPILE)
+ if("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$")
+ set(CHECK_INCLUDE_FILE_VAR "afxwin.h")
+ configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
- MESSAGE(STATUS "Looking for MFC")
- TRY_COMPILE(MFC_HAVE_MFC
+ message(STATUS "Looking for MFC")
+ try_compile(MFC_HAVE_MFC
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
CMAKE_FLAGS
-DCMAKE_MFC_FLAG:STRING=2
-DCOMPILE_DEFINITIONS:STRING=-D_AFXDLL
OUTPUT_VARIABLE OUTPUT)
- IF(MFC_HAVE_MFC)
- MESSAGE(STATUS "Looking for MFC - found")
- SET(MFC_HAVE_MFC 1 CACHE INTERNAL "Have MFC?")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ if(MFC_HAVE_MFC)
+ message(STATUS "Looking for MFC - found")
+ set(MFC_HAVE_MFC 1 CACHE INTERNAL "Have MFC?")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if MFC exists passed with the following output:\n"
"${OUTPUT}\n\n")
- ELSE(MFC_HAVE_MFC)
- MESSAGE(STATUS "Looking for MFC - not found")
- SET(MFC_HAVE_MFC 0 CACHE INTERNAL "Have MFC?")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ else()
+ message(STATUS "Looking for MFC - not found")
+ set(MFC_HAVE_MFC 0 CACHE INTERNAL "Have MFC?")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if MFC exists failed with the following output:\n"
"${OUTPUT}\n\n")
- ENDIF(MFC_HAVE_MFC)
- ENDIF("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$")
+ endif()
+ endif()
- IF(MFC_HAVE_MFC)
- SET(MFC_FOUND "YES")
- ENDIF(MFC_HAVE_MFC)
-ENDIF(MFC_ATTEMPT_TRY_COMPILE)
+ if(MFC_HAVE_MFC)
+ set(MFC_FOUND "YES")
+ endif()
+endif()
diff --git a/Modules/FindMPEG.cmake b/Modules/FindMPEG.cmake
index cf4ef58f8..f99f87b87 100644
--- a/Modules/FindMPEG.cmake
+++ b/Modules/FindMPEG.cmake
@@ -20,25 +20,25 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(MPEG_INCLUDE_DIR mpeg2dec/include/video_out.h
+find_path(MPEG_INCLUDE_DIR mpeg2dec/include/video_out.h
/usr/local/livid
)
-FIND_LIBRARY(MPEG_mpeg2_LIBRARY mpeg2
+find_library(MPEG_mpeg2_LIBRARY mpeg2
/usr/local/livid/mpeg2dec/libmpeg2/.libs
)
-FIND_LIBRARY( MPEG_vo_LIBRARY vo
+find_library( MPEG_vo_LIBRARY vo
/usr/local/livid/mpeg2dec/libvo/.libs
)
-# handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG DEFAULT_MSG MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY MPEG_vo_LIBRARY)
-IF(MPEG_FOUND)
- SET( MPEG_LIBRARIES ${MPEG_mpeg2_LIBRARY} ${MPEG_vo_LIBRARY} )
-ENDIF(MPEG_FOUND)
+if(MPEG_FOUND)
+ set( MPEG_LIBRARIES ${MPEG_mpeg2_LIBRARY} ${MPEG_vo_LIBRARY} )
+endif()
-MARK_AS_ADVANCED(MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY MPEG_vo_LIBRARY)
+mark_as_advanced(MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY MPEG_vo_LIBRARY)
diff --git a/Modules/FindMPEG2.cmake b/Modules/FindMPEG2.cmake
index fab37cf54..0290ecaf2 100644
--- a/Modules/FindMPEG2.cmake
+++ b/Modules/FindMPEG2.cmake
@@ -20,35 +20,35 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(MPEG2_INCLUDE_DIR
+find_path(MPEG2_INCLUDE_DIR
NAMES mpeg2.h mpeg2dec/mpeg2.h
PATHS /usr/local/livid
)
-FIND_LIBRARY(MPEG2_mpeg2_LIBRARY mpeg2
+find_library(MPEG2_mpeg2_LIBRARY mpeg2
/usr/local/livid/mpeg2dec/libmpeg2/.libs
)
-FIND_LIBRARY( MPEG2_vo_LIBRARY vo
+find_library( MPEG2_vo_LIBRARY vo
/usr/local/livid/mpeg2dec/libvo/.libs
)
-# handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG2 DEFAULT_MSG MPEG2_mpeg2_LIBRARY MPEG2_INCLUDE_DIR)
-IF(MPEG2_FOUND)
- SET( MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY}
+if(MPEG2_FOUND)
+ set( MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY}
${MPEG2_vo_LIBRARY})
#some native mpeg2 installations will depend
#on libSDL, if found, add it in.
- INCLUDE( FindSDL )
- IF(SDL_FOUND)
- SET( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
- ENDIF(SDL_FOUND)
-ENDIF(MPEG2_FOUND)
+ include( FindSDL )
+ if(SDL_FOUND)
+ set( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
+ endif()
+endif()
-MARK_AS_ADVANCED(MPEG2_INCLUDE_DIR MPEG2_mpeg2_LIBRARY MPEG2_vo_LIBRARY)
+mark_as_advanced(MPEG2_INCLUDE_DIR MPEG2_mpeg2_LIBRARY MPEG2_vo_LIBRARY)
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index ae50ca7b9..4ce4de9f5 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -576,6 +576,11 @@ foreach (lang C CXX Fortran)
try_regular_compiler(${lang} regular_compiler_worked)
endif()
+ set(MPI_${lang}_FIND_QUIETLY ${MPI_FIND_QUIETLY})
+ set(MPI_${lang}_FIND_REQUIRED ${MPI_FIND_REQUIRED})
+ set(MPI_${lang}_FIND_VERSION ${MPI_FIND_VERSION})
+ set(MPI_${lang}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT})
+
if (regular_compiler_worked)
find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_COMPILER)
else()
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 1cdb07174..803848806 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -19,75 +19,75 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(MATLAB_FOUND 0)
-IF(WIN32)
- IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
- SET(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc60")
- ELSE(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
- IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
+set(MATLAB_FOUND 0)
+if(WIN32)
+ if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
+ set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc60")
+ else()
+ if(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
# Assume people are generally using 7.1,
# if using 7.0 need to link to: ../extern/lib/win32/microsoft/msvc70
- SET(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc71")
- ELSE(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
- IF(${CMAKE_GENERATOR} MATCHES "Borland")
+ set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc71")
+ else()
+ if(${CMAKE_GENERATOR} MATCHES "Borland")
# Same here, there are also: bcc50 and bcc51 directories
- SET(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/bcc54")
- ELSE(${CMAKE_GENERATOR} MATCHES "Borland")
- IF(MATLAB_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Generator not compatible: ${CMAKE_GENERATOR}")
- ENDIF(MATLAB_FIND_REQUIRED)
- ENDIF(${CMAKE_GENERATOR} MATCHES "Borland")
- ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
- ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
- FIND_LIBRARY(MATLAB_MEX_LIBRARY
+ set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/bcc54")
+ else()
+ if(MATLAB_FIND_REQUIRED)
+ message(FATAL_ERROR "Generator not compatible: ${CMAKE_GENERATOR}")
+ endif()
+ endif()
+ endif()
+ endif()
+ find_library(MATLAB_MEX_LIBRARY
libmex
${MATLAB_ROOT}
)
- FIND_LIBRARY(MATLAB_MX_LIBRARY
+ find_library(MATLAB_MX_LIBRARY
libmx
${MATLAB_ROOT}
)
- FIND_LIBRARY(MATLAB_ENG_LIBRARY
+ find_library(MATLAB_ENG_LIBRARY
libeng
${MATLAB_ROOT}
)
- FIND_PATH(MATLAB_INCLUDE_DIR
+ find_path(MATLAB_INCLUDE_DIR
"mex.h"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/include"
)
-ELSE( WIN32 )
- IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
+else()
+ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
# Regular x86
- SET(MATLAB_ROOT
+ set(MATLAB_ROOT
/usr/local/matlab-7sp1/bin/glnx86/
/opt/matlab-7sp1/bin/glnx86/
$ENV{HOME}/matlab-7sp1/bin/glnx86/
$ENV{HOME}/redhat-matlab/bin/glnx86/
)
- ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ else()
# AMD64:
- SET(MATLAB_ROOT
+ set(MATLAB_ROOT
/usr/local/matlab-7sp1/bin/glnxa64/
/opt/matlab-7sp1/bin/glnxa64/
$ENV{HOME}/matlab7_64/bin/glnxa64/
$ENV{HOME}/matlab-7sp1/bin/glnxa64/
$ENV{HOME}/redhat-matlab/bin/glnxa64/
)
- ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4)
- FIND_LIBRARY(MATLAB_MEX_LIBRARY
+ endif()
+ find_library(MATLAB_MEX_LIBRARY
mex
${MATLAB_ROOT}
)
- FIND_LIBRARY(MATLAB_MX_LIBRARY
+ find_library(MATLAB_MX_LIBRARY
mx
${MATLAB_ROOT}
)
- FIND_LIBRARY(MATLAB_ENG_LIBRARY
+ find_library(MATLAB_ENG_LIBRARY
eng
${MATLAB_ROOT}
)
- FIND_PATH(MATLAB_INCLUDE_DIR
+ find_path(MATLAB_INCLUDE_DIR
"mex.h"
"/usr/local/matlab-7sp1/extern/include/"
"/opt/matlab-7sp1/extern/include/"
@@ -95,20 +95,20 @@ ELSE( WIN32 )
"$ENV{HOME}/redhat-matlab/extern/include/"
)
-ENDIF(WIN32)
+endif()
# This is common to UNIX and Win32:
-SET(MATLAB_LIBRARIES
+set(MATLAB_LIBRARIES
${MATLAB_MEX_LIBRARY}
${MATLAB_MX_LIBRARY}
${MATLAB_ENG_LIBRARY}
)
-IF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
- SET(MATLAB_FOUND 1)
-ENDIF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
+if(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
+ set(MATLAB_FOUND 1)
+endif()
-MARK_AS_ADVANCED(
+mark_as_advanced(
MATLAB_LIBRARIES
MATLAB_MEX_LIBRARY
MATLAB_MX_LIBRARY
diff --git a/Modules/FindMotif.cmake b/Modules/FindMotif.cmake
index e35411272..5065e3a2d 100644
--- a/Modules/FindMotif.cmake
+++ b/Modules/FindMotif.cmake
@@ -17,28 +17,28 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(MOTIF_FOUND 0)
+set(MOTIF_FOUND 0)
-IF(UNIX)
- FIND_PATH(MOTIF_INCLUDE_DIR
+if(UNIX)
+ find_path(MOTIF_INCLUDE_DIR
Xm/Xm.h
/usr/openwin/include
)
- FIND_LIBRARY(MOTIF_LIBRARIES
+ find_library(MOTIF_LIBRARIES
Xm
/usr/openwin/lib
)
-ENDIF(UNIX)
+endif()
-# handle the QUIETLY and REQUIRED arguments and set MOTIF_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set MOTIF_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Motif DEFAULT_MSG MOTIF_LIBRARIES MOTIF_INCLUDE_DIR)
-MARK_AS_ADVANCED(
+mark_as_advanced(
MOTIF_INCLUDE_DIR
MOTIF_LIBRARIES
)
diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake
index cb3ce4813..78fd632a5 100644
--- a/Modules/FindOpenAL.cmake
+++ b/Modules/FindOpenAL.cmake
@@ -1,7 +1,7 @@
# Locate OpenAL
# This module defines
# OPENAL_LIBRARY
-# OPENAL_FOUND, if false, do not try to link to OpenAL
+# OPENAL_FOUND, if false, do not try to link to OpenAL
# OPENAL_INCLUDE_DIR, where to find the headers
#
# $OPENALDIR is an environment variable that would
@@ -25,31 +25,31 @@
# This makes the presumption that you are include al.h like
# #include "al.h"
-# and not
+# and not
# #include <AL/al.h>
# The reason for this is that the latter is not entirely portable.
-# Windows/Creative Labs does not by default put their headers in AL/ and
+# Windows/Creative Labs does not by default put their headers in AL/ and
# OS X uses the convention <OpenAL/al.h>.
-#
-# For Windows, Creative Labs seems to have added a registry key for their
+#
+# For Windows, Creative Labs seems to have added a registry key for their
# OpenAL 1.1 installer. I have added that key to the list of search paths,
-# however, the key looks like it could be a little fragile depending on
+# however, the key looks like it could be a little fragile depending on
# if they decide to change the 1.00.0000 number for bug fix releases.
# Also, they seem to have laid down groundwork for multiple library platforms
# which puts the library in an extra subdirectory. Currently there is only
-# Win32 and I have hardcoded that here. This may need to be adjusted as
+# Win32 and I have hardcoded that here. This may need to be adjusted as
# platforms are introduced.
# The OpenAL 1.0 installer doesn't seem to have a useful key I can use.
# I do not know if the Nvidia OpenAL SDK has a registry key.
-#
-# For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger).
-# To support the framework, I originally wrote special framework detection
+#
+# For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger).
+# To support the framework, I originally wrote special framework detection
# code in this module which I have now removed with CMake's introduction
# of native support for frameworks.
-# In addition, OpenAL is open source, and it is possible to compile on Panther.
-# Furthermore, due to bugs in the initial OpenAL release, and the
+# In addition, OpenAL is open source, and it is possible to compile on Panther.
+# Furthermore, due to bugs in the initial OpenAL release, and the
# transition to OpenAL 1.1, it is common to need to override the built-in
-# framework.
+# framework.
# Per my request, CMake should search for frameworks first in
# the following order:
# ~/Library/Frameworks/OpenAL.framework/Headers
@@ -57,13 +57,13 @@
# /System/Library/Frameworks/OpenAL.framework/Headers
#
# On OS X, this will prefer the Framework version (if found) over others.
-# People will have to manually change the cache values of
+# People will have to manually change the cache values of
# OPENAL_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
-FIND_PATH(OPENAL_INCLUDE_DIR al.h
+find_path(OPENAL_INCLUDE_DIR al.h
HINTS
- $ENV{OPENALDIR}
+ ENV OPENALDIR
PATH_SUFFIXES include/AL include/OpenAL include
PATHS
~/Library/Frameworks
@@ -75,10 +75,10 @@ FIND_PATH(OPENAL_INCLUDE_DIR al.h
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
)
-FIND_LIBRARY(OPENAL_LIBRARY
+find_library(OPENAL_LIBRARY
NAMES OpenAL al openal OpenAL32
HINTS
- $ENV{OPENALDIR}
+ ENV OPENALDIR
PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
PATHS
~/Library/Frameworks
@@ -93,7 +93,7 @@ FIND_LIBRARY(OPENAL_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenAL DEFAULT_MSG OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
-MARK_AS_ADVANCED(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
+mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 98d8808c0..a6f450385 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -1,18 +1,18 @@
# - Try to find OpenGL
# Once done this will define
-#
+#
# OPENGL_FOUND - system has OpenGL
# OPENGL_XMESA_FOUND - system has XMESA
# OPENGL_GLU_FOUND - system has GLU
# OPENGL_INCLUDE_DIR - the GL include directory
# OPENGL_LIBRARIES - Link these to use OpenGL and GLU
-#
+#
# If you want to use just GL you can use these values
# OPENGL_gl_LIBRARY - Path to OpenGL Library
# OPENGL_glu_LIBRARY - Path to GLU Library
-#
+#
# On OSX default to using the framework version of opengl
-# People will have to change the cache values of OPENGL_glu_LIBRARY
+# People will have to change the cache values of OPENGL_glu_LIBRARY
# and OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX
#=============================================================================
@@ -28,45 +28,45 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF (WIN32)
- IF (CYGWIN)
+if (WIN32)
+ if (CYGWIN)
- FIND_PATH(OPENGL_INCLUDE_DIR GL/gl.h )
+ find_path(OPENGL_INCLUDE_DIR GL/gl.h )
- FIND_LIBRARY(OPENGL_gl_LIBRARY opengl32 )
+ find_library(OPENGL_gl_LIBRARY opengl32 )
- FIND_LIBRARY(OPENGL_glu_LIBRARY glu32 )
+ find_library(OPENGL_glu_LIBRARY glu32 )
- ELSE (CYGWIN)
+ else ()
- IF(BORLAND)
- SET (OPENGL_gl_LIBRARY import32 CACHE STRING "OpenGL library for win32")
- SET (OPENGL_glu_LIBRARY import32 CACHE STRING "GLU library for win32")
- ELSE(BORLAND)
- SET (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32")
- SET (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32")
- ENDIF(BORLAND)
+ if(BORLAND)
+ set (OPENGL_gl_LIBRARY import32 CACHE STRING "OpenGL library for win32")
+ set (OPENGL_glu_LIBRARY import32 CACHE STRING "GLU library for win32")
+ else()
+ set (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32")
+ set (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32")
+ endif()
- ENDIF (CYGWIN)
+ endif ()
-ELSE (WIN32)
+else ()
- IF (APPLE)
+ if (APPLE)
- FIND_LIBRARY(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL lib for OSX")
- FIND_LIBRARY(OPENGL_glu_LIBRARY AGL DOC "AGL lib for OSX")
- FIND_PATH(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OSX")
+ find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL lib for OSX")
+ find_library(OPENGL_glu_LIBRARY AGL DOC "AGL lib for OSX")
+ find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OSX")
- ELSE(APPLE)
+ else()
# Handle HP-UX cases where we only want to find OpenGL in either hpux64
# or hpux32 depending on if we're doing a 64 bit build.
- IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
- SET(HPUX_IA_OPENGL_LIB_PATH /opt/graphics/OpenGL/lib/hpux32/)
- ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
- SET(HPUX_IA_OPENGL_LIB_PATH
+ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set(HPUX_IA_OPENGL_LIB_PATH /opt/graphics/OpenGL/lib/hpux32/)
+ else()
+ set(HPUX_IA_OPENGL_LIB_PATH
/opt/graphics/OpenGL/lib/hpux64/
/opt/graphics/OpenGL/lib/pa20_64)
- ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ endif()
# The first line below is to make sure that the proper headers
# are used on a Linux machine with the NVidia drivers installed.
@@ -76,19 +76,19 @@ ELSE (WIN32)
# Make sure the NVIDIA directory comes BEFORE the others.
# - Atanas Georgiev <atanas@cs.columbia.edu>
- FIND_PATH(OPENGL_INCLUDE_DIR GL/gl.h
+ find_path(OPENGL_INCLUDE_DIR GL/gl.h
/usr/share/doc/NVIDIA_GLX-1.0/include
/usr/openwin/share/include
/opt/graphics/OpenGL/include /usr/X11R6/include
)
- FIND_PATH(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h
+ find_path(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h
/usr/share/doc/NVIDIA_GLX-1.0/include
/usr/openwin/share/include
/opt/graphics/OpenGL/include /usr/X11R6/include
)
- FIND_LIBRARY(OPENGL_gl_LIBRARY
+ find_library(OPENGL_gl_LIBRARY
NAMES GL MesaGL
PATHS /opt/graphics/OpenGL/lib
/usr/openwin/lib
@@ -97,22 +97,22 @@ ELSE (WIN32)
)
# On Unix OpenGL most certainly always requires X11.
- # Feel free to tighten up these conditions if you don't
+ # Feel free to tighten up these conditions if you don't
# think this is always true.
# It's not true on OSX.
- IF (OPENGL_gl_LIBRARY)
- IF(NOT X11_FOUND)
- INCLUDE(FindX11)
- ENDIF(NOT X11_FOUND)
- IF (X11_FOUND)
- IF (NOT APPLE)
- SET (OPENGL_LIBRARIES ${X11_LIBRARIES})
- ENDIF (NOT APPLE)
- ENDIF (X11_FOUND)
- ENDIF (OPENGL_gl_LIBRARY)
-
- FIND_LIBRARY(OPENGL_glu_LIBRARY
+ if (OPENGL_gl_LIBRARY)
+ if(NOT X11_FOUND)
+ include(FindX11)
+ endif()
+ if (X11_FOUND)
+ if (NOT APPLE)
+ set (OPENGL_LIBRARIES ${X11_LIBRARIES})
+ endif ()
+ endif ()
+ endif ()
+
+ find_library(OPENGL_glu_LIBRARY
NAMES GLU MesaGLU
PATHS ${OPENGL_gl_LIBRARY}
/opt/graphics/OpenGL/lib
@@ -120,39 +120,39 @@ ELSE (WIN32)
/usr/shlib /usr/X11R6/lib
)
- ENDIF(APPLE)
-ENDIF (WIN32)
+ endif()
+endif ()
-IF(OPENGL_gl_LIBRARY)
+if(OPENGL_gl_LIBRARY)
- IF(OPENGL_xmesa_INCLUDE_DIR)
- SET( OPENGL_XMESA_FOUND "YES" )
- ELSE(OPENGL_xmesa_INCLUDE_DIR)
- SET( OPENGL_XMESA_FOUND "NO" )
- ENDIF(OPENGL_xmesa_INCLUDE_DIR)
+ if(OPENGL_xmesa_INCLUDE_DIR)
+ set( OPENGL_XMESA_FOUND "YES" )
+ else()
+ set( OPENGL_XMESA_FOUND "NO" )
+ endif()
- SET( OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_LIBRARIES})
- IF(OPENGL_glu_LIBRARY)
- SET( OPENGL_GLU_FOUND "YES" )
- SET( OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARIES} )
- ELSE(OPENGL_glu_LIBRARY)
- SET( OPENGL_GLU_FOUND "NO" )
- ENDIF(OPENGL_glu_LIBRARY)
+ set( OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_LIBRARIES})
+ if(OPENGL_glu_LIBRARY)
+ set( OPENGL_GLU_FOUND "YES" )
+ set( OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARIES} )
+ else()
+ set( OPENGL_GLU_FOUND "NO" )
+ endif()
# This deprecated setting is for backward compatibility with CMake1.4
- SET (OPENGL_LIBRARY ${OPENGL_LIBRARIES})
+ set (OPENGL_LIBRARY ${OPENGL_LIBRARIES})
-ENDIF(OPENGL_gl_LIBRARY)
+endif()
# This deprecated setting is for backward compatibility with CMake1.4
-SET(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
+set(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
# handle the QUIETLY and REQUIRED arguments and set OPENGL_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL DEFAULT_MSG OPENGL_gl_LIBRARY)
-MARK_AS_ADVANCED(
+mark_as_advanced(
OPENGL_INCLUDE_DIR
OPENGL_xmesa_INCLUDE_DIR
OPENGL_glu_LIBRARY
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index b96a2ecfb..ad15d8ccc 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -72,15 +72,15 @@ function(_OPENMP_FLAG_CANDIDATES LANG)
endif()
set(OpenMP_${LANG}_FLAG_CANDIDATES "${OpenMP_FLAG_CANDIDATES}" PARENT_SCOPE)
-endfunction(_OPENMP_FLAG_CANDIDATES)
+endfunction()
# sample openmp source code to test
-set(OpenMP_C_TEST_SOURCE
+set(OpenMP_C_TEST_SOURCE
"
#include <omp.h>
-int main() {
+int main() {
#ifdef _OPENMP
- return 0;
+ return 0;
#else
breaks_on_purpose
#endif
@@ -108,8 +108,8 @@ if(CMAKE_C_COMPILER_LOADED)
if(OpenMP_FLAG_DETECTED)
set(OpenMP_C_FLAGS_INTERNAL "${FLAG}")
break()
- endif(OpenMP_FLAG_DETECTED)
- endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
+ endif()
+ endforeach()
set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}"
CACHE STRING "C compiler flags for OpenMP parallization")
@@ -142,8 +142,8 @@ if(CMAKE_CXX_COMPILER_LOADED)
if(OpenMP_FLAG_DETECTED)
set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}")
break()
- endif(OpenMP_FLAG_DETECTED)
- endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
+ endif()
+ endforeach()
set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}"
CACHE STRING "C++ compiler flags for OpenMP parallization")
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index d1fc2d259..224c88e0e 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -27,29 +27,38 @@
if (UNIX)
find_package(PkgConfig QUIET)
pkg_check_modules(_OPENSSL QUIET openssl)
-endif (UNIX)
-
-# http://www.slproweb.com/products/Win32OpenSSL.html
-SET(_OPENSSL_ROOT_HINTS
- $ENV{OPENSSL_ROOT_DIR}
- ${OPENSSL_ROOT_DIR}
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
- )
-SET(_OPENSSL_ROOT_PATHS
- "$ENV{PROGRAMFILES}/OpenSSL"
- "$ENV{PROGRAMFILES}/OpenSSL-Win32"
- "$ENV{PROGRAMFILES}/OpenSSL-Win64"
- "C:/OpenSSL/"
- "C:/OpenSSL-Win32/"
- "C:/OpenSSL-Win64/"
- )
-SET(_OPENSSL_ROOT_HINTS_AND_PATHS
- HINTS ${_OPENSSL_ROOT_HINTS}
- PATHS ${_OPENSSL_ROOT_PATHS}
- )
+endif ()
+
+if (WIN32)
+ # http://www.slproweb.com/products/Win32OpenSSL.html
+ set(_OPENSSL_ROOT_HINTS
+ ${OPENSSL_ROOT_DIR}
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
+ ENV OPENSSL_ROOT_DIR
+ )
+ file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
+ set(_OPENSSL_ROOT_PATHS
+ "${_programfiles}/OpenSSL"
+ "${_programfiles}/OpenSSL-Win32"
+ "${_programfiles}/OpenSSL-Win64"
+ "C:/OpenSSL/"
+ "C:/OpenSSL-Win32/"
+ "C:/OpenSSL-Win64/"
+ )
+ unset(_programfiles)
+ set(_OPENSSL_ROOT_HINTS_AND_PATHS
+ HINTS ${_OPENSSL_ROOT_HINTS}
+ PATHS ${_OPENSSL_ROOT_PATHS}
+ )
+else ()
+ set(_OPENSSL_ROOT_HINTS
+ ${OPENSSL_ROOT_DIR}
+ ENV OPENSSL_ROOT_DIR
+ )
+endif ()
-FIND_PATH(OPENSSL_INCLUDE_DIR
+find_path(OPENSSL_INCLUDE_DIR
NAMES
openssl/ssl.h
HINTS
@@ -59,9 +68,8 @@ FIND_PATH(OPENSSL_INCLUDE_DIR
include
)
-IF(WIN32 AND NOT CYGWIN)
- # MINGW should go here too
- IF(MSVC)
+if(WIN32 AND NOT CYGWIN)
+ if(MSVC)
# /MD and /MDd are the standard values - if someone wants to use
# others, the libnames have to change here too
# use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
@@ -76,10 +84,10 @@ IF(WIN32 AND NOT CYGWIN)
# We are using the libraries located in the VC subdir instead of the parent directory eventhough :
# libeay32MD.lib is identical to ../libeay32.lib, and
# ssleay32MD.lib is identical to ../ssleay32.lib
- FIND_LIBRARY(LIB_EAY_DEBUG
+ find_library(LIB_EAY_DEBUG
NAMES
libeay32MDd
- libeay32
+ libeay32d
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
@@ -87,7 +95,7 @@ IF(WIN32 AND NOT CYGWIN)
"lib/VC"
)
- FIND_LIBRARY(LIB_EAY_RELEASE
+ find_library(LIB_EAY_RELEASE
NAMES
libeay32MD
libeay32
@@ -98,11 +106,10 @@ IF(WIN32 AND NOT CYGWIN)
"lib/VC"
)
- FIND_LIBRARY(SSL_EAY_DEBUG
+ find_library(SSL_EAY_DEBUG
NAMES
ssleay32MDd
- ssleay32
- ssl
+ ssleay32d
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
@@ -110,7 +117,7 @@ IF(WIN32 AND NOT CYGWIN)
"lib/VC"
)
- FIND_LIBRARY(SSL_EAY_RELEASE
+ find_library(SSL_EAY_RELEASE
NAMES
ssleay32MD
ssleay32
@@ -122,41 +129,49 @@ IF(WIN32 AND NOT CYGWIN)
"lib/VC"
)
- if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
- set( OPENSSL_LIBRARIES
- optimized ${SSL_EAY_RELEASE} debug ${SSL_EAY_DEBUG}
- optimized ${LIB_EAY_RELEASE} debug ${LIB_EAY_DEBUG}
- )
- else()
- set( OPENSSL_LIBRARIES ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE} )
- endif()
- MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE)
- MARK_AS_ADVANCED(LIB_EAY_DEBUG LIB_EAY_RELEASE)
- ELSEIF(MINGW)
+ set(LIB_EAY_LIBRARY_DEBUG "${LIB_EAY_DEBUG}")
+ set(LIB_EAY_LIBRARY_RELEASE "${LIB_EAY_RELEASE}")
+ set(SSL_EAY_LIBRARY_DEBUG "${SSL_EAY_DEBUG}")
+ set(SSL_EAY_LIBRARY_RELEASE "${SSL_EAY_RELEASE}")
+
+ include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+ select_library_configurations(LIB_EAY)
+ select_library_configurations(SSL_EAY)
+
+ set( OPENSSL_LIBRARIES ${SSL_EAY_LIBRARY} ${LIB_EAY_LIBRARY} )
+ elseif(MINGW)
# same player, for MingW
- FIND_LIBRARY(LIB_EAY
+ set(LIB_EAY_NAMES libeay32)
+ set(SSL_EAY_NAMES ssleay32)
+ if(CMAKE_CROSS_COMPILING)
+ list(APPEND LIB_EAY_NAMES crypto)
+ list(APPEND SSL_EAY_NAMES ssl)
+ endif()
+ find_library(LIB_EAY
NAMES
- libeay32
+ ${LIB_EAY_NAMES}
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
"lib/MinGW"
)
- FIND_LIBRARY(SSL_EAY
+ find_library(SSL_EAY
NAMES
- ssleay32
+ ${SSL_EAY_NAMES}
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
"lib/MinGW"
)
- MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
+ mark_as_advanced(SSL_EAY LIB_EAY)
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
- ELSE(MSVC)
+ unset(LIB_EAY_NAMES)
+ unset(SSL_EAY_NAMES)
+ else()
# Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
- FIND_LIBRARY(LIB_EAY
+ find_library(LIB_EAY
NAMES
libeay32
HINTS
@@ -166,7 +181,7 @@ IF(WIN32 AND NOT CYGWIN)
lib
)
- FIND_LIBRARY(SSL_EAY
+ find_library(SSL_EAY
NAMES
ssleay32
HINTS
@@ -176,12 +191,12 @@ IF(WIN32 AND NOT CYGWIN)
lib
)
- MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
+ mark_as_advanced(SSL_EAY LIB_EAY)
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
- ENDIF(MSVC)
-ELSE(WIN32 AND NOT CYGWIN)
+ endif()
+else()
- FIND_LIBRARY(OPENSSL_SSL_LIBRARY
+ find_library(OPENSSL_SSL_LIBRARY
NAMES
ssl
ssleay32
@@ -193,7 +208,7 @@ ELSE(WIN32 AND NOT CYGWIN)
lib
)
- FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY
+ find_library(OPENSSL_CRYPTO_LIBRARY
NAMES
crypto
HINTS
@@ -203,15 +218,15 @@ ELSE(WIN32 AND NOT CYGWIN)
lib
)
- MARK_AS_ADVANCED(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY)
+ mark_as_advanced(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY)
# compat defines
- SET(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
- SET(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
+ set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
+ set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
- SET(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
+ set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
-ENDIF(WIN32 AND NOT CYGWIN)
+endif()
function(from_hex HEX DEC)
string(TOUPPER "${HEX}" HEX)
@@ -242,7 +257,7 @@ function(from_hex HEX DEC)
endwhile()
set(${DEC} ${_res} PARENT_SCOPE)
-endfunction(from_hex)
+endfunction()
if (OPENSSL_INCLUDE_DIR)
if (_OPENSSL_VERSION)
@@ -276,11 +291,11 @@ if (OPENSSL_INCLUDE_DIR)
# this should be updated to handle that, too. This has not happened yet
# so it is simply ignored here for now.
string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
- endif (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
+ endif ()
set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
- endif (_OPENSSL_VERSION)
-endif (OPENSSL_INCLUDE_DIR)
+ endif ()
+endif ()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
@@ -294,11 +309,11 @@ if (OPENSSL_VERSION)
FAIL_MESSAGE
"Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
)
-else (OPENSSL_VERSION)
+else ()
find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR
)
-endif (OPENSSL_VERSION)
+endif ()
-MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
+mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index 52f931689..4a5aaba41 100644
--- a/Modules/FindOpenSceneGraph.cmake
+++ b/Modules/FindOpenSceneGraph.cmake
@@ -14,7 +14,7 @@
#
# OpenSceneGraph_DEBUG - Enable debugging output
#
-# OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced
+# OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced
# automatically
#
# The following environment variables are also respected for finding the OSG
@@ -26,6 +26,10 @@
# OSGDIR
# OSG_ROOT
#
+# [CMake 2.8.10]:
+# The CMake variable OSG_DIR can now be used as well to influence detection, instead of needing
+# to specify an environment variable.
+#
# This module defines the following output variables:
#
# OPENSCENEGRAPH_FOUND - Was the OSG and all of the specified components found?
@@ -49,7 +53,7 @@
#=============================================================================
# Copyright 2009 Kitware, Inc.
-# Copyright 2009 Philip Lowman <philip@yhbt.com>
+# Copyright 2009-2012 Philip Lowman <philip@yhbt.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -96,14 +100,15 @@ if(OSG_INCLUDE_DIR)
message(STATUS "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
"Detected OSG_INCLUDE_DIR = ${OSG_INCLUDE_DIR}")
endif()
-
+
set(_osg_Version_file "${OSG_INCLUDE_DIR}/osg/Version")
if("${OSG_INCLUDE_DIR}" MATCHES "\\.framework$" AND NOT EXISTS "${_osg_Version_file}")
set(_osg_Version_file "${OSG_INCLUDE_DIR}/Headers/Version")
endif()
-
+
if(EXISTS "${_osg_Version_file}")
- file(READ "${_osg_Version_file}" _osg_Version_contents)
+ file(STRINGS "${_osg_Version_file}" _osg_Version_contents
+ REGEX "#define (OSG_VERSION_[A-Z]+|OPENSCENEGRAPH_[A-Z]+_VERSION)[ \t]+[0-9]+")
else()
set(_osg_Version_contents "unknown")
endif()
@@ -130,6 +135,7 @@ if(OSG_INCLUDE_DIR)
message(WARNING "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
"Failed to parse version number, please report this as a bug")
endif()
+ unset(_osg_Version_contents)
set(OPENSCENEGRAPH_VERSION "${_osg_VERSION_MAJOR}.${_osg_VERSION_MINOR}.${_osg_VERSION_PATCH}"
CACHE INTERNAL "The version of OSG which was detected")
@@ -139,29 +145,12 @@ if(OSG_INCLUDE_DIR)
endif()
endif()
-#
-# Version checking
-#
-if(OpenSceneGraph_FIND_VERSION AND OPENSCENEGRAPH_VERSION)
- if(OpenSceneGraph_FIND_VERSION_EXACT)
- if(NOT OPENSCENEGRAPH_VERSION VERSION_EQUAL ${OpenSceneGraph_FIND_VERSION})
- set(_osg_version_not_exact TRUE)
- endif()
- else()
- # version is too low
- if(NOT OPENSCENEGRAPH_VERSION VERSION_EQUAL ${OpenSceneGraph_FIND_VERSION} AND
- NOT OPENSCENEGRAPH_VERSION VERSION_GREATER ${OpenSceneGraph_FIND_VERSION})
- set(_osg_version_not_high_enough TRUE)
- endif()
- endif()
-endif()
-
set(_osg_quiet)
if(OpenSceneGraph_FIND_QUIETLY)
set(_osg_quiet "QUIET")
endif()
#
-# Here we call FIND_PACKAGE() on all of the components
+# Here we call find_package() on all of the components
#
foreach(_osg_module ${_osg_modules_to_process})
if(OpenSceneGraph_DEBUG)
@@ -182,65 +171,24 @@ endforeach()
if(OPENSCENEGRAPH_INCLUDE_DIR)
list(REMOVE_DUPLICATES OPENSCENEGRAPH_INCLUDE_DIR)
endif()
-
+
#
-# Inform the users with an error message based on
-# what version they have vs. what version was
-# required.
+# Check each module to see if it's found
#
+set(_osg_component_founds)
if(OpenSceneGraph_FIND_REQUIRED)
- set(_osg_version_output_type FATAL_ERROR)
-else()
- set(_osg_version_output_type STATUS)
+ foreach(_osg_module ${_osg_modules_to_process})
+ string(TOUPPER ${_osg_module} _osg_module_UC)
+ list(APPEND _osg_component_founds ${_osg_module_UC}_FOUND)
+ endforeach()
endif()
-if(_osg_version_not_high_enough)
- set(_osg_EPIC_FAIL TRUE)
- if(NOT OpenSceneGraph_FIND_QUIETLY)
- message(${_osg_version_output_type}
- "ERROR: Version ${OpenSceneGraph_FIND_VERSION} or higher of the OSG "
- "is required. Version ${OPENSCENEGRAPH_VERSION} was found.")
- endif()
-elseif(_osg_version_not_exact)
- set(_osg_EPIC_FAIL TRUE)
- if(NOT OpenSceneGraph_FIND_QUIETLY)
- message(${_osg_version_output_type}
- "ERROR: Version ${OpenSceneGraph_FIND_VERSION} of the OSG is required "
- "(exactly), version ${OPENSCENEGRAPH_VERSION} was found.")
- endif()
-else()
-
- #
- # Check each module to see if it's found
- #
- if(OpenSceneGraph_FIND_REQUIRED)
- set(_osg_missing_message)
- foreach(_osg_module ${_osg_modules_to_process})
- string(TOUPPER ${_osg_module} _osg_module_UC)
- if(NOT ${_osg_module_UC}_FOUND)
- set(_osg_missing_nodekit_fail true)
- set(_osg_missing_message "${_osg_missing_message} ${_osg_module}")
- endif()
- endforeach()
-
- if(_osg_missing_nodekit_fail)
- message(FATAL_ERROR "ERROR: Missing the following osg "
- "libraries: ${_osg_missing_message}.\n"
- "Consider using CMAKE_PREFIX_PATH or the OSG_DIR "
- "environment variable. See the "
- "${CMAKE_CURRENT_LIST_FILE} for more details.")
- endif()
- endif()
- include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
- FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenSceneGraph DEFAULT_MSG OPENSCENEGRAPH_LIBRARIES OPENSCENEGRAPH_INCLUDE_DIR)
-endif()
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenSceneGraph
+ REQUIRED_VARS OPENSCENEGRAPH_LIBRARIES OPENSCENEGRAPH_INCLUDE_DIR ${_osg_component_founds}
+ VERSION_VAR OPENSCENEGRAPH_VERSION)
-if(_osg_EPIC_FAIL)
- # Zero out everything, we didn't meet version requirements
- set(OPENSCENEGRAPH_FOUND FALSE)
- set(OPENSCENEGRAPH_LIBRARIES)
- set(OPENSCENEGRAPH_INCLUDE_DIR)
-endif()
+unset(_osg_component_founds)
set(OPENSCENEGRAPH_INCLUDE_DIRS ${OPENSCENEGRAPH_INCLUDE_DIR})
diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake
index 6b81fbe3a..e0599604a 100644
--- a/Modules/FindOpenThreads.cmake
+++ b/Modules/FindOpenThreads.cmake
@@ -1,10 +1,10 @@
-# OpenThreads is a C++ based threading library. Its largest userbase
+# OpenThreads is a C++ based threading library. Its largest userbase
# seems to OpenSceneGraph so you might notice I accept OSGDIR as an
# environment path.
-# I consider this part of the Findosg* suite used to find OpenSceneGraph
+# I consider this part of the Findosg* suite used to find OpenSceneGraph
# components.
# Each component is separate and you must opt in to each module.
-#
+#
# Locate OpenThreads
# This module defines
# OPENTHREADS_LIBRARY
@@ -15,10 +15,15 @@
# correspond to the ./configure --prefix=$OPENTHREADS_DIR
# used in building osg.
#
+# [CMake 2.8.10]:
+# The CMake variables OPENTHREADS_DIR or OSG_DIR can now be used as well to influence
+# detection, instead of needing to specify an environment variable.
+#
# Created by Eric Wing.
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
+# Copyright 2012 Philip Lowman <philip@yhbt.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -34,8 +39,8 @@
# #include <OpenThreads/Thread>
# To make it easier for one-step automated configuration/builds,
-# we leverage environmental paths. This is preferable
-# to the -DVAR=value switches because it insulates the
+# we leverage environmental paths. This is preferable
+# to the -DVAR=value switches because it insulates the
# users from changes we may make in this script.
# It also offers a little more flexibility than setting
# the CMAKE_*_PATH since we can target specific components.
@@ -53,14 +58,15 @@
find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
HINTS
- # enough environment variables?
- $ENV{OPENTHREADS_INCLUDE_DIR}
- $ENV{OPENTHREADS_DIR}
- $ENV{OSG_INCLUDE_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- $ENV{OpenThreads_ROOT}
- $ENV{OSG_ROOT}
+ ENV OPENTHREADS_INCLUDE_DIR
+ ENV OPENTHREADS_DIR
+ ENV OSG_INCLUDE_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
+ ENV OpenThreads_ROOT
+ ENV OSG_ROOT
+ ${OPENTHREADS_DIR}
+ ${OSG_DIR}
PATHS
/sw # Fink
/opt/local # DarwinPorts
@@ -71,43 +77,47 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
)
-find_library(OPENTHREADS_LIBRARY
- NAMES OpenThreads OpenThreadsWin32
+find_library(OPENTHREADS_LIBRARY
+ NAMES OpenThreads OpenThreadsWin32
HINTS
- $ENV{OPENTHREADS_LIBRARY_DIR}
- $ENV{OPENTHREADS_DIR}
- $ENV{OSG_LIBRARY_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- $ENV{OpenThreads_ROOT}
- $ENV{OSG_ROOT}
+ ENV OPENTHREADS_LIBRARY_DIR
+ ENV OPENTHREADS_DIR
+ ENV OSG_LIBRARY_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
+ ENV OpenThreads_ROOT
+ ENV OSG_ROOT
+ ${OPENTHREADS_DIR}
+ ${OSG_DIR}
PATHS
/sw
/opt/local
/opt/csw
/opt
/usr/freeware
- PATH_SUFFIXES lib64 lib
+ PATH_SUFFIXES lib
)
-find_library(OPENTHREADS_LIBRARY_DEBUG
+find_library(OPENTHREADS_LIBRARY_DEBUG
NAMES OpenThreadsd OpenThreadsWin32d
HINTS
- $ENV{OPENTHREADS_DEBUG_LIBRARY_DIR}
- $ENV{OPENTHREADS_LIBRARY_DIR}
- $ENV{OPENTHREADS_DIR}
- $ENV{OSG_LIBRARY_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- $ENV{OpenThreads_ROOT}
- $ENV{OSG_ROOT}
+ ENV OPENTHREADS_DEBUG_LIBRARY_DIR
+ ENV OPENTHREADS_LIBRARY_DIR
+ ENV OPENTHREADS_DIR
+ ENV OSG_LIBRARY_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
+ ENV OpenThreads_ROOT
+ ENV OSG_ROOT
+ ${OPENTHREADS_DIR}
+ ${OSG_DIR}
PATHS
/sw
/opt/local
/opt/csw
/opt
/usr/freeware
- PATH_SUFFIXES lib64 lib
+ PATH_SUFFIXES lib
)
if(OPENTHREADS_LIBRARY_DEBUG)
diff --git a/Modules/FindPHP4.cmake b/Modules/FindPHP4.cmake
index 6c2965a7a..4267ac155 100644
--- a/Modules/FindPHP4.cmake
+++ b/Modules/FindPHP4.cmake
@@ -20,7 +20,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(PHP4_POSSIBLE_INCLUDE_PATHS
+set(PHP4_POSSIBLE_INCLUDE_PATHS
/usr/include/php4
/usr/local/include/php4
/usr/include/php
@@ -28,33 +28,33 @@ SET(PHP4_POSSIBLE_INCLUDE_PATHS
/usr/local/apache/php
)
-SET(PHP4_POSSIBLE_LIB_PATHS
+set(PHP4_POSSIBLE_LIB_PATHS
/usr/lib
)
-FIND_PATH(PHP4_FOUND_INCLUDE_PATH main/php.h
+find_path(PHP4_FOUND_INCLUDE_PATH main/php.h
${PHP4_POSSIBLE_INCLUDE_PATHS})
-IF(PHP4_FOUND_INCLUDE_PATH)
- SET(php4_paths "${PHP4_POSSIBLE_INCLUDE_PATHS}")
- FOREACH(php4_path Zend main TSRM)
- SET(php4_paths ${php4_paths} "${PHP4_FOUND_INCLUDE_PATH}/${php4_path}")
- ENDFOREACH(php4_path Zend main TSRM)
- SET(PHP4_INCLUDE_PATH "${php4_paths}" INTERNAL "PHP4 include paths")
-ENDIF(PHP4_FOUND_INCLUDE_PATH)
+if(PHP4_FOUND_INCLUDE_PATH)
+ set(php4_paths "${PHP4_POSSIBLE_INCLUDE_PATHS}")
+ foreach(php4_path Zend main TSRM)
+ set(php4_paths ${php4_paths} "${PHP4_FOUND_INCLUDE_PATH}/${php4_path}")
+ endforeach()
+ set(PHP4_INCLUDE_PATH "${php4_paths}" INTERNAL "PHP4 include paths")
+endif()
-FIND_PROGRAM(PHP4_EXECUTABLE NAMES php4 php )
+find_program(PHP4_EXECUTABLE NAMES php4 php )
-MARK_AS_ADVANCED(
+mark_as_advanced(
PHP4_EXECUTABLE
PHP4_FOUND_INCLUDE_PATH
)
-IF(APPLE)
+if(APPLE)
# this is a hack for now
- SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+ set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
"${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -Wl,-flat_namespace")
- FOREACH(symbol
+ foreach(symbol
__efree
__emalloc
__estrdup
@@ -76,10 +76,10 @@ IF(APPLE)
_zend_wrong_param_count
_zval_used_for_init
)
- SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+ set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
"${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}")
- ENDFOREACH(symbol)
-ENDIF(APPLE)
+ endforeach()
+endif()
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PHP4 DEFAULT_MSG PHP4_EXECUTABLE PHP4_INCLUDE_PATH)
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index a6c181cb1..d96d2ccf9 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -30,7 +30,7 @@
if(PNG_FIND_QUIETLY)
set(_FIND_ZLIB_ARG QUIET)
-endif(PNG_FIND_QUIETLY)
+endif()
find_package(ZLIB ${_FIND_ZLIB_ARG})
if(ZLIB_FOUND)
@@ -43,27 +43,27 @@ if(ZLIB_FOUND)
if (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
# png.h includes zlib.h. Sigh.
- SET(PNG_INCLUDE_DIRS ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
- SET(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIRS} ) # for backward compatiblity
- SET(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY})
+ set(PNG_INCLUDE_DIRS ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
+ set(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIRS} ) # for backward compatiblity
+ set(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY})
if (CYGWIN)
if(BUILD_SHARED_LIBS)
# No need to define PNG_USE_DLL here, because it's default for Cygwin.
- else(BUILD_SHARED_LIBS)
- SET (PNG_DEFINITIONS -DPNG_STATIC)
- endif(BUILD_SHARED_LIBS)
- endif (CYGWIN)
+ else()
+ set (PNG_DEFINITIONS -DPNG_STATIC)
+ endif()
+ endif ()
- endif (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
+ endif ()
if (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")
file(STRINGS "${PNG_PNG_INCLUDE_DIR}/png.h" png_version_str REGEX "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\".+\"")
string(REGEX REPLACE "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\"([^\"]+)\".*" "\\1" PNG_VERSION_STRING "${png_version_str}")
unset(png_version_str)
- endif (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")
-endif(ZLIB_FOUND)
+ endif ()
+endif()
# handle the QUIETLY and REQUIRED arguments and set PNG_FOUND to TRUE if
# all listed variables are TRUE
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index cdcf9ca7c..25d8df39f 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -1,7 +1,7 @@
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
#
# This function is intended to be used in FindXXX.cmake modules files.
-# It handles the REQUIRED, QUIET and version-related arguments to FIND_PACKAGE().
+# It handles the REQUIRED, QUIET and version-related arguments to find_package().
# It also sets the <UPPERCASED_NAME>_FOUND variable.
# The package is considered found if all variables <var1>... listed contain
# valid results, e.g. valid filepaths.
@@ -68,9 +68,9 @@
#
# Another example for mode 2:
#
-# FIND_PACKAGE(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
+# find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(Automoc4 CONFIG_MODE)
-# In this case, FindAutmoc4.cmake wraps a call to FIND_PACKAGE(Automoc4 NO_MODULE)
+# In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4 NO_MODULE)
# and adds an additional search directory for automoc4.
# The following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper
# success/error message.
@@ -88,209 +88,212 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(FindPackageMessage)
-INCLUDE(CMakeParseArguments)
+include(FindPackageMessage)
+include(CMakeParseArguments)
# internal helper macro
-MACRO(_FPHSA_FAILURE_MESSAGE _msg)
- IF (${_NAME}_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "${_msg}")
- ELSE (${_NAME}_FIND_REQUIRED)
- IF (NOT ${_NAME}_FIND_QUIETLY)
- MESSAGE(STATUS "${_msg}")
- ENDIF (NOT ${_NAME}_FIND_QUIETLY)
- ENDIF (${_NAME}_FIND_REQUIRED)
-ENDMACRO(_FPHSA_FAILURE_MESSAGE _msg)
+macro(_FPHSA_FAILURE_MESSAGE _msg)
+ if (${_NAME}_FIND_REQUIRED)
+ message(FATAL_ERROR "${_msg}")
+ else ()
+ if (NOT ${_NAME}_FIND_QUIETLY)
+ message(STATUS "${_msg}")
+ endif ()
+ endif ()
+endmacro()
# internal helper macro to generate the failure message when used in CONFIG_MODE:
-MACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
+macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
# <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
- IF(${_NAME}_CONFIG)
+ if(${_NAME}_CONFIG)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
- ELSE(${_NAME}_CONFIG)
+ else()
# If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
# List them all in the error message:
- IF(${_NAME}_CONSIDERED_CONFIGS)
- SET(configsText "")
- LIST(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
- MATH(EXPR configsCount "${configsCount} - 1")
- FOREACH(currentConfigIndex RANGE ${configsCount})
- LIST(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
- LIST(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
- SET(configsText "${configsText} ${filename} (version ${version})\n")
- ENDFOREACH(currentConfigIndex)
+ if(${_NAME}_CONSIDERED_CONFIGS)
+ set(configsText "")
+ list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
+ math(EXPR configsCount "${configsCount} - 1")
+ foreach(currentConfigIndex RANGE ${configsCount})
+ list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
+ list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
+ set(configsText "${configsText} ${filename} (version ${version})\n")
+ endforeach()
+ if (${_NAME}_NOT_FOUND_MESSAGE)
+ set(configsText "${configsText} Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n")
+ endif()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
- ELSE(${_NAME}_CONSIDERED_CONFIGS)
+ else()
# Simple case: No Config-file was found at all:
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
- ENDIF(${_NAME}_CONSIDERED_CONFIGS)
- ENDIF(${_NAME}_CONFIG)
-ENDMACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
+ endif()
+ endif()
+endmacro()
-FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
+function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
# new extended or in the "old" mode:
- SET(options CONFIG_MODE HANDLE_COMPONENTS)
- SET(oneValueArgs FAIL_MESSAGE VERSION_VAR)
- SET(multiValueArgs REQUIRED_VARS)
- SET(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
- LIST(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
-
- IF(${INDEX} EQUAL -1)
- SET(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
- SET(FPHSA_REQUIRED_VARS ${ARGN})
- SET(FPHSA_VERSION_VAR)
- ELSE(${INDEX} EQUAL -1)
+ set(options CONFIG_MODE HANDLE_COMPONENTS)
+ set(oneValueArgs FAIL_MESSAGE VERSION_VAR)
+ set(multiValueArgs REQUIRED_VARS)
+ set(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
+ list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
+
+ if(${INDEX} EQUAL -1)
+ set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
+ set(FPHSA_REQUIRED_VARS ${ARGN})
+ set(FPHSA_VERSION_VAR)
+ else()
CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
- IF(FPHSA_UNPARSED_ARGUMENTS)
- MESSAGE(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
- ENDIF(FPHSA_UNPARSED_ARGUMENTS)
+ if(FPHSA_UNPARSED_ARGUMENTS)
+ message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
+ endif()
- IF(NOT FPHSA_FAIL_MESSAGE)
- SET(FPHSA_FAIL_MESSAGE "DEFAULT_MSG")
- ENDIF(NOT FPHSA_FAIL_MESSAGE)
- ENDIF(${INDEX} EQUAL -1)
+ if(NOT FPHSA_FAIL_MESSAGE)
+ set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG")
+ endif()
+ endif()
# now that we collected all arguments, process them
- IF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
- SET(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
- ENDIF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+ if("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+ set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
+ endif()
# In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
# when it successfully found the config-file, including version checking:
- IF(FPHSA_CONFIG_MODE)
- LIST(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
- LIST(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
- SET(FPHSA_VERSION_VAR ${_NAME}_VERSION)
- ENDIF(FPHSA_CONFIG_MODE)
+ if(FPHSA_CONFIG_MODE)
+ list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
+ list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
+ set(FPHSA_VERSION_VAR ${_NAME}_VERSION)
+ endif()
- IF(NOT FPHSA_REQUIRED_VARS)
- MESSAGE(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
- ENDIF(NOT FPHSA_REQUIRED_VARS)
+ if(NOT FPHSA_REQUIRED_VARS)
+ message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
+ endif()
- LIST(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
+ list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
- STRING(TOUPPER ${_NAME} _NAME_UPPER)
- STRING(TOLOWER ${_NAME} _NAME_LOWER)
+ string(TOUPPER ${_NAME} _NAME_UPPER)
+ string(TOLOWER ${_NAME} _NAME_LOWER)
# collect all variables which were not found, so they can be printed, so the
# user knows better what went wrong (#6375)
- SET(MISSING_VARS "")
- SET(DETAILS "")
- SET(${_NAME_UPPER}_FOUND TRUE)
+ set(MISSING_VARS "")
+ set(DETAILS "")
+ set(${_NAME_UPPER}_FOUND TRUE)
# check if all passed variables are valid
- FOREACH(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
- IF(NOT ${_CURRENT_VAR})
- SET(${_NAME_UPPER}_FOUND FALSE)
- SET(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
- ELSE(NOT ${_CURRENT_VAR})
- SET(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
- ENDIF(NOT ${_CURRENT_VAR})
- ENDFOREACH(_CURRENT_VAR)
+ foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
+ if(NOT ${_CURRENT_VAR})
+ set(${_NAME_UPPER}_FOUND FALSE)
+ set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
+ else()
+ set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
+ endif()
+ endforeach()
# component handling
- UNSET(FOUND_COMPONENTS_MSG)
- UNSET(MISSING_COMPONENTS_MSG)
+ unset(FOUND_COMPONENTS_MSG)
+ unset(MISSING_COMPONENTS_MSG)
- IF(FPHSA_HANDLE_COMPONENTS)
- FOREACH(comp ${${_NAME}_FIND_COMPONENTS})
- IF(${_NAME}_${comp}_FOUND)
+ if(FPHSA_HANDLE_COMPONENTS)
+ foreach(comp ${${_NAME}_FIND_COMPONENTS})
+ if(${_NAME}_${comp}_FOUND)
- IF(NOT DEFINED FOUND_COMPONENTS_MSG)
- SET(FOUND_COMPONENTS_MSG "found components: ")
- ENDIF()
- SET(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}")
+ if(NOT DEFINED FOUND_COMPONENTS_MSG)
+ set(FOUND_COMPONENTS_MSG "found components: ")
+ endif()
+ set(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}")
- ELSE()
+ else()
- IF(NOT DEFINED MISSING_COMPONENTS_MSG)
- SET(MISSING_COMPONENTS_MSG "missing components: ")
- ENDIF()
- SET(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}")
+ if(NOT DEFINED MISSING_COMPONENTS_MSG)
+ set(MISSING_COMPONENTS_MSG "missing components: ")
+ endif()
+ set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}")
- IF(${_NAME}_FIND_REQUIRED_${comp})
- SET(${_NAME_UPPER}_FOUND FALSE)
- SET(MISSING_VARS "${MISSING_VARS} ${comp}")
- ENDIF()
+ if(${_NAME}_FIND_REQUIRED_${comp})
+ set(${_NAME_UPPER}_FOUND FALSE)
+ set(MISSING_VARS "${MISSING_VARS} ${comp}")
+ endif()
- ENDIF()
- ENDFOREACH(comp)
- SET(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
- SET(DETAILS "${DETAILS}[c${COMPONENT_MSG}]")
- ENDIF(FPHSA_HANDLE_COMPONENTS)
+ endif()
+ endforeach()
+ set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
+ set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]")
+ endif()
# version handling:
- SET(VERSION_MSG "")
- SET(VERSION_OK TRUE)
- SET(VERSION ${${FPHSA_VERSION_VAR}} )
- IF (${_NAME}_FIND_VERSION)
-
- IF(VERSION)
-
- IF(${_NAME}_FIND_VERSION_EXACT) # exact version required
- IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
- SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
- SET(VERSION_OK FALSE)
- ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
- SET(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
- ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
-
- ELSE(${_NAME}_FIND_VERSION_EXACT) # minimum version specified:
- IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
- SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
- SET(VERSION_OK FALSE)
- ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
- SET(VERSION_MSG "(found suitable version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
- ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
- ENDIF(${_NAME}_FIND_VERSION_EXACT)
-
- ELSE(VERSION)
+ set(VERSION_MSG "")
+ set(VERSION_OK TRUE)
+ set(VERSION ${${FPHSA_VERSION_VAR}} )
+ if (${_NAME}_FIND_VERSION)
+
+ if(VERSION)
+
+ if(${_NAME}_FIND_VERSION_EXACT) # exact version required
+ if (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+ set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+ set(VERSION_OK FALSE)
+ else ()
+ set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
+ endif ()
+
+ else() # minimum version specified:
+ if ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
+ set(VERSION_OK FALSE)
+ else ()
+ set(VERSION_MSG "(found suitable version \"${VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")")
+ endif ()
+ endif()
+
+ else()
# if the package was not found, but a version was given, add that to the output:
- IF(${_NAME}_FIND_VERSION_EXACT)
- SET(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
- ELSE(${_NAME}_FIND_VERSION_EXACT)
- SET(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
- ENDIF(${_NAME}_FIND_VERSION_EXACT)
-
- ENDIF(VERSION)
- ELSE (${_NAME}_FIND_VERSION)
- IF(VERSION)
- SET(VERSION_MSG "(found version \"${VERSION}\")")
- ENDIF(VERSION)
- ENDIF (${_NAME}_FIND_VERSION)
-
- IF(VERSION_OK)
- SET(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
- ELSE(VERSION_OK)
- SET(${_NAME_UPPER}_FOUND FALSE)
- ENDIF(VERSION_OK)
+ if(${_NAME}_FIND_VERSION_EXACT)
+ set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
+ else()
+ set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
+ endif()
+
+ endif()
+ else ()
+ if(VERSION)
+ set(VERSION_MSG "(found version \"${VERSION}\")")
+ endif()
+ endif ()
+
+ if(VERSION_OK)
+ set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
+ else()
+ set(${_NAME_UPPER}_FOUND FALSE)
+ endif()
# print the result:
- IF (${_NAME_UPPER}_FOUND)
+ if (${_NAME_UPPER}_FOUND)
FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
- ELSE (${_NAME_UPPER}_FOUND)
+ else ()
- IF(FPHSA_CONFIG_MODE)
+ if(FPHSA_CONFIG_MODE)
_FPHSA_HANDLE_FAILURE_CONFIG_MODE()
- ELSE(FPHSA_CONFIG_MODE)
- IF(NOT VERSION_OK)
+ else()
+ if(NOT VERSION_OK)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
- ELSE(NOT VERSION_OK)
+ else()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
- ENDIF(NOT VERSION_OK)
- ENDIF(FPHSA_CONFIG_MODE)
+ endif()
+ endif()
- ENDIF (${_NAME_UPPER}_FOUND)
+ endif ()
- SET(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
+ set(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
-ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG)
+endfunction()
diff --git a/Modules/FindPackageMessage.cmake b/Modules/FindPackageMessage.cmake
index 48d3472b5..5cea43e35 100644
--- a/Modules/FindPackageMessage.cmake
+++ b/Modules/FindPackageMessage.cmake
@@ -11,12 +11,12 @@
#
# Example:
#
-# IF(X11_FOUND)
+# if(X11_FOUND)
# FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
# "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
-# ELSE(X11_FOUND)
+# else()
# ...
-# ENDIF(X11_FOUND)
+# endif()
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
@@ -31,19 +31,19 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FUNCTION(FIND_PACKAGE_MESSAGE pkg msg details)
+function(FIND_PACKAGE_MESSAGE pkg msg details)
# Avoid printing a message repeatedly for the same find result.
- IF(NOT ${pkg}_FIND_QUIETLY)
- STRING(REGEX REPLACE "[\n]" "" details "${details}")
- SET(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
- IF(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
+ if(NOT ${pkg}_FIND_QUIETLY)
+ string(REGEX REPLACE "[\n]" "" details "${details}")
+ set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
+ if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
# The message has not yet been printed.
- MESSAGE(STATUS "${msg}")
+ message(STATUS "${msg}")
# Save the find details in the cache to avoid printing the same
# message again.
- SET("${DETAILS_VAR}" "${details}"
+ set("${DETAILS_VAR}" "${details}"
CACHE INTERNAL "Details about finding ${pkg}")
- ENDIF(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
- ENDIF(NOT ${pkg}_FIND_QUIETLY)
-ENDFUNCTION(FIND_PACKAGE_MESSAGE)
+ endif()
+ endif()
+endfunction()
diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake
index ae686df75..e908a6556 100644
--- a/Modules/FindPerl.cmake
+++ b/Modules/FindPerl.cmake
@@ -18,31 +18,31 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(FindCygwin)
+include(FindCygwin)
-SET(PERL_POSSIBLE_BIN_PATHS
+set(PERL_POSSIBLE_BIN_PATHS
${CYGWIN_INSTALL_PATH}/bin
)
-IF(WIN32)
- GET_FILENAME_COMPONENT(
- ActivePerl_CurrentVersion
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl;CurrentVersion]"
+if(WIN32)
+ get_filename_component(
+ ActivePerl_CurrentVersion
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl;CurrentVersion]"
NAME)
- SET(PERL_POSSIBLE_BIN_PATHS ${PERL_POSSIBLE_BIN_PATHS}
- "C:/Perl/bin"
+ set(PERL_POSSIBLE_BIN_PATHS ${PERL_POSSIBLE_BIN_PATHS}
+ "C:/Perl/bin"
[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl\\${ActivePerl_CurrentVersion}]/bin
)
-ENDIF(WIN32)
+endif()
-FIND_PROGRAM(PERL_EXECUTABLE
+find_program(PERL_EXECUTABLE
NAMES perl
PATHS ${PERL_POSSIBLE_BIN_PATHS}
)
-IF(PERL_EXECUTABLE)
+if(PERL_EXECUTABLE)
### PERL_VERSION
- EXECUTE_PROCESS(
+ execute_process(
COMMAND
${PERL_EXECUTABLE} -V:version
OUTPUT_VARIABLE
@@ -52,32 +52,32 @@ IF(PERL_EXECUTABLE)
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
- IF(NOT PERL_VERSION_RESULT_VARIABLE AND NOT PERL_VERSION_OUTPUT_VARIABLE MATCHES "^version='UNKNOWN'")
- STRING(REGEX REPLACE "version='([^']+)'.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
- ELSE()
- EXECUTE_PROCESS(
+ if(NOT PERL_VERSION_RESULT_VARIABLE AND NOT PERL_VERSION_OUTPUT_VARIABLE MATCHES "^version='UNKNOWN'")
+ string(REGEX REPLACE "version='([^']+)'.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
+ else()
+ execute_process(
COMMAND ${PERL_EXECUTABLE} -v
OUTPUT_VARIABLE PERL_VERSION_OUTPUT_VARIABLE
RESULT_VARIABLE PERL_VERSION_RESULT_VARIABLE
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
- IF(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl.*[ \\(]v([0-9\\._]+)[ \\)]")
- STRING(REGEX REPLACE ".*This is perl.*[ \\(]v([0-9\\._]+)[ \\)].*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
- ELSEIF(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl, version ([0-9\\._]+) +")
- STRING(REGEX REPLACE ".*This is perl, version ([0-9\\._]+) +.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
- ENDIF()
- ENDIF()
-ENDIF(PERL_EXECUTABLE)
+ if(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl.*[ \\(]v([0-9\\._]+)[ \\)]")
+ string(REGEX REPLACE ".*This is perl.*[ \\(]v([0-9\\._]+)[ \\)].*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
+ elseif(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl, version ([0-9\\._]+) +")
+ string(REGEX REPLACE ".*This is perl, version ([0-9\\._]+) +.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
+ endif()
+ endif()
+endif()
# Deprecated settings for compatibility with CMake1.4
-SET(PERL ${PERL_EXECUTABLE})
+set(PERL ${PERL_EXECUTABLE})
-# handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl
REQUIRED_VARS PERL_EXECUTABLE
VERSION_VAR PERL_VERSION_STRING)
-MARK_AS_ADVANCED(PERL_EXECUTABLE)
+mark_as_advanced(PERL_EXECUTABLE)
diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index b2ffd3cf6..e9313adc9 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/Modules/FindPerlLibs.cmake
@@ -9,7 +9,7 @@
# PERL_EXECUTABLE = full path to the perl binary
#
# The minimum required version of Perl can be specified using the
-# standard syntax, e.g. FIND_PACKAGE(PerlLibs 6.0)
+# standard syntax, e.g. find_package(PerlLibs 6.0)
#
# The following variables are also available if needed
# (introduced after CMake 2.6.4)
@@ -53,7 +53,7 @@ if (PERL_EXECUTABLE)
if (NOT PERL_PREFIX_RESULT_VARIABLE)
string(REGEX REPLACE "prefix='([^']+)'.*" "\\1" PERL_PREFIX ${PERL_PREFIX_OUTPUT_VARIABLE})
- endif (NOT PERL_PREFIX_RESULT_VARIABLE)
+ endif ()
### PERL_ARCHNAME
execute_process(
@@ -66,7 +66,7 @@ if (PERL_EXECUTABLE)
)
if (NOT PERL_ARCHNAME_RESULT_VARIABLE)
string(REGEX REPLACE "archname='([^']+)'.*" "\\1" PERL_ARCHNAME ${PERL_ARCHNAME_OUTPUT_VARIABLE})
- endif (NOT PERL_ARCHNAME_RESULT_VARIABLE)
+ endif ()
@@ -81,7 +81,7 @@ if (PERL_EXECUTABLE)
)
if (NOT PERL_CPPFLAGS_RESULT_VARIABLE)
string(REGEX REPLACE "cppflags='([^']+)'.*" "\\1" PERL_EXTRA_C_FLAGS ${PERL_CPPFLAGS_OUTPUT_VARIABLE})
- endif (NOT PERL_CPPFLAGS_RESULT_VARIABLE)
+ endif ()
### PERL_SITESEARCH
execute_process(
@@ -95,7 +95,7 @@ if (PERL_EXECUTABLE)
if (NOT PERL_SITESEARCH_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITESEARCH ${PERL_SITESEARCH_OUTPUT_VARIABLE})
file(TO_CMAKE_PATH "${PERL_SITESEARCH}" PERL_SITESEARCH)
- endif (NOT PERL_SITESEARCH_RESULT_VARIABLE)
+ endif ()
### PERL_SITELIB
execute_process(
@@ -109,7 +109,7 @@ if (PERL_EXECUTABLE)
if (NOT PERL_SITELIB_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITELIB ${PERL_SITELIB_OUTPUT_VARIABLE})
file(TO_CMAKE_PATH "${PERL_SITELIB}" PERL_SITELIB)
- endif (NOT PERL_SITELIB_RESULT_VARIABLE)
+ endif ()
### PERL_VENDORARCH
execute_process(
@@ -123,7 +123,7 @@ if (PERL_EXECUTABLE)
if (NOT PERL_VENDORARCH_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORARCH ${PERL_VENDORARCH_OUTPUT_VARIABLE})
file(TO_CMAKE_PATH "${PERL_VENDORARCH}" PERL_VENDORARCH)
- endif (NOT PERL_VENDORARCH_RESULT_VARIABLE)
+ endif ()
### PERL_VENDORLIB
execute_process(
@@ -137,7 +137,7 @@ if (PERL_EXECUTABLE)
if (NOT PERL_VENDORLIB_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORLIB ${PERL_VENDORLIB_OUTPUT_VARIABLE})
file(TO_CMAKE_PATH "${PERL_VENDORLIB}" PERL_VENDORLIB)
- endif (NOT PERL_VENDORLIB_RESULT_VARIABLE)
+ endif ()
macro(perl_adjust_darwin_lib_variable varname)
string( TOUPPER PERL_${varname} FINDPERL_VARNAME )
@@ -160,9 +160,9 @@ if (PERL_EXECUTABLE)
if (PERL_NEEDS_ADJUSTMENT)
string(REGEX REPLACE "(.*)/Updates/" "/System/\\1/" ${FINDPERL_VARNAME} ${${FINDPERL_VARNAME}})
- endif (PERL_NEEDS_ADJUSTMENT)
+ endif ()
- endif (NOT PERL_MINUSV_RESULT_VARIABLE)
+ endif ()
endmacro()
### PERL_ARCHLIB
@@ -178,7 +178,7 @@ if (PERL_EXECUTABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE})
perl_adjust_darwin_lib_variable( ARCHLIB )
file(TO_CMAKE_PATH "${PERL_ARCHLIB}" PERL_ARCHLIB)
- endif (NOT PERL_ARCHLIB_RESULT_VARIABLE)
+ endif ()
### PERL_PRIVLIB
execute_process(
@@ -193,7 +193,7 @@ if (PERL_EXECUTABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_PRIVLIB ${PERL_PRIVLIB_OUTPUT_VARIABLE})
perl_adjust_darwin_lib_variable( PRIVLIB )
file(TO_CMAKE_PATH "${PERL_PRIVLIB}" PERL_PRIVLIB)
- endif (NOT PERL_PRIVLIB_RESULT_VARIABLE)
+ endif ()
### PERL_POSSIBLE_LIBRARY_NAMES
execute_process(
@@ -206,9 +206,9 @@ if (PERL_EXECUTABLE)
)
if (NOT PERL_LIBRARY_RESULT_VARIABLE)
string(REGEX REPLACE "libperl='([^']+)'.*" "\\1" PERL_POSSIBLE_LIBRARY_NAMES ${PERL_LIBRARY_OUTPUT_VARIABLE})
- else (NOT PERL_LIBRARY_RESULT_VARIABLE)
+ else ()
set(PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING} perl)
- endif (NOT PERL_LIBRARY_RESULT_VARIABLE)
+ endif ()
### PERL_INCLUDE_PATH
find_path(PERL_INCLUDE_PATH
@@ -234,9 +234,9 @@ if (PERL_EXECUTABLE)
/usr/lib/perl/${PERL_VERSION_STRING}/CORE
)
-endif (PERL_EXECUTABLE)
+endif ()
-# handle the QUIETLY and REQUIRED arguments and set PERLLIBS_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set PERLLIBS_FOUND to TRUE if
# all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(PerlLibs REQUIRED_VARS PERL_LIBRARY PERL_INCLUDE_PATH
diff --git a/Modules/FindPhysFS.cmake b/Modules/FindPhysFS.cmake
index 2e3ac1400..a2d6abf9b 100644
--- a/Modules/FindPhysFS.cmake
+++ b/Modules/FindPhysFS.cmake
@@ -8,7 +8,7 @@
# correspond to the ./configure --prefix=$PHYSFSDIR
# used in building PHYSFS.
#
-# Created by Eric Wing.
+# Created by Eric Wing.
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
@@ -23,9 +23,9 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(PHYSFS_INCLUDE_DIR physfs.h
+find_path(PHYSFS_INCLUDE_DIR physfs.h
HINTS
- $ENV{PHYSFSDIR}
+ ENV PHYSFSDIR
PATH_SUFFIXES include/physfs include
PATHS
~/Library/Frameworks
@@ -36,11 +36,11 @@ FIND_PATH(PHYSFS_INCLUDE_DIR physfs.h
/opt
)
-FIND_LIBRARY(PHYSFS_LIBRARY
+find_library(PHYSFS_LIBRARY
NAMES physfs
HINTS
- $ENV{PHYSFSDIR}
- PATH_SUFFIXES lib64 lib
+ ENV PHYSFSDIR
+ PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
@@ -52,6 +52,6 @@ FIND_LIBRARY(PHYSFS_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set PHYSFS_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PhysFS DEFAULT_MSG PHYSFS_LIBRARY PHYSFS_INCLUDE_DIR)
diff --git a/Modules/FindPike.cmake b/Modules/FindPike.cmake
index 125e42832..5b48ab4e7 100644
--- a/Modules/FindPike.cmake
+++ b/Modules/FindPike.cmake
@@ -20,18 +20,18 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FILE(GLOB PIKE_POSSIBLE_INCLUDE_PATHS
+file(GLOB PIKE_POSSIBLE_INCLUDE_PATHS
/usr/include/pike/*
/usr/local/include/pike/*)
-FIND_PATH(PIKE_INCLUDE_PATH program.h
+find_path(PIKE_INCLUDE_PATH program.h
${PIKE_POSSIBLE_INCLUDE_PATHS})
-FIND_PROGRAM(PIKE_EXECUTABLE
+find_program(PIKE_EXECUTABLE
NAMES pike7.4
)
-MARK_AS_ADVANCED(
+mark_as_advanced(
PIKE_EXECUTABLE
PIKE_INCLUDE_PATH
)
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 39d3a76ab..2766f9780 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -96,7 +96,7 @@ if (PKG_CONFIG_EXECUTABLE)
OUTPUT_VARIABLE PKG_CONFIG_VERSION_STRING
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
-endif (PKG_CONFIG_EXECUTABLE)
+endif ()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(PkgConfig
@@ -111,11 +111,11 @@ set(PKG_CONFIG_FOUND "${PKGCONFIG_FOUND}")
# Unsets the given variables
macro(_pkgconfig_unset var)
set(${var} "" CACHE INTERNAL "")
-endmacro(_pkgconfig_unset)
+endmacro()
macro(_pkgconfig_set var value)
set(${var} ${value} CACHE INTERNAL "")
-endmacro(_pkgconfig_set)
+endmacro()
# Invokes pkgconfig, cleans up the result and sets variables
macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp)
@@ -129,47 +129,47 @@ macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp)
if (_pkgconfig_failed)
set(_pkgconfig_${_varname} "")
_pkgconfig_unset(${_prefix}_${_varname})
- else(_pkgconfig_failed)
+ else()
string(REGEX REPLACE "[\r\n]" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
string(REGEX REPLACE " +$" "" _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
if (NOT ${_regexp} STREQUAL "")
string(REGEX REPLACE "${_regexp}" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
- endif(NOT ${_regexp} STREQUAL "")
+ endif()
separate_arguments(_pkgconfig_invoke_result)
#message(STATUS " ${_varname} ... ${_pkgconfig_invoke_result}")
set(_pkgconfig_${_varname} ${_pkgconfig_invoke_result})
_pkgconfig_set(${_prefix}_${_varname} "${_pkgconfig_invoke_result}")
- endif(_pkgconfig_failed)
-endmacro(_pkgconfig_invoke)
+ endif()
+endmacro()
# Invokes pkgconfig two times; once without '--static' and once with
# '--static'
macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp)
_pkgconfig_invoke("${_pkglist}" ${_prefix} ${_varname} "${cleanup_regexp}" ${ARGN})
_pkgconfig_invoke("${_pkglist}" ${_prefix} STATIC_${_varname} "${cleanup_regexp}" --static ${ARGN})
-endmacro(_pkgconfig_invoke_dyn)
+endmacro()
# Splits given arguments into options and a package list
macro(_pkgconfig_parse_options _result _is_req _is_silent)
set(${_is_req} 0)
set(${_is_silent} 0)
-
+
foreach(_pkg ${ARGN})
if (_pkg STREQUAL "REQUIRED")
set(${_is_req} 1)
- endif (_pkg STREQUAL "REQUIRED")
+ endif ()
if (_pkg STREQUAL "QUIET")
set(${_is_silent} 1)
- endif (_pkg STREQUAL "QUIET")
- endforeach(_pkg ${ARGN})
+ endif ()
+ endforeach()
set(${_result} ${ARGN})
list(REMOVE_ITEM ${_result} "REQUIRED")
list(REMOVE_ITEM ${_result} "QUIET")
-endmacro(_pkgconfig_parse_options)
+endmacro()
###
macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
@@ -203,11 +203,11 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
if (NOT ${_is_silent})
if (_pkg_check_modules_cnt EQUAL 1)
message(STATUS "checking for module '${_pkg_check_modules_list}'")
- else(_pkg_check_modules_cnt EQUAL 1)
+ else()
message(STATUS "checking for modules '${_pkg_check_modules_list}'")
- endif(_pkg_check_modules_cnt EQUAL 1)
- endif(NOT ${_is_silent})
-
+ endif()
+ endif()
+
set(_pkg_check_modules_packages)
set(_pkg_check_modules_failed)
@@ -220,35 +220,35 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\1" _pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}")
string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\2" _pkg_check_modules_pkg_op "${_pkg_check_modules_pkg}")
string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\3" _pkg_check_modules_pkg_ver "${_pkg_check_modules_pkg}")
- else(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
+ else()
set(_pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}")
set(_pkg_check_modules_pkg_op)
set(_pkg_check_modules_pkg_ver)
- endif(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
+ endif()
# handle the operands
if (_pkg_check_modules_pkg_op STREQUAL ">=")
list(APPEND _pkg_check_modules_exist_query --atleast-version)
- endif(_pkg_check_modules_pkg_op STREQUAL ">=")
+ endif()
if (_pkg_check_modules_pkg_op STREQUAL "=")
list(APPEND _pkg_check_modules_exist_query --exact-version)
- endif(_pkg_check_modules_pkg_op STREQUAL "=")
-
+ endif()
+
if (_pkg_check_modules_pkg_op STREQUAL "<=")
list(APPEND _pkg_check_modules_exist_query --max-version)
- endif(_pkg_check_modules_pkg_op STREQUAL "<=")
+ endif()
# create the final query which is of the format:
# * --atleast-version <version> <pkg-name>
- # * --exact-version <version> <pkg-name>
+ # * --exact-version <version> <pkg-name>
# * --max-version <version> <pkg-name>
# * --exists <pkg-name>
if (_pkg_check_modules_pkg_op)
list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_ver}")
- else(_pkg_check_modules_pkg_op)
+ else()
list(APPEND _pkg_check_modules_exist_query --exists)
- endif(_pkg_check_modules_pkg_op)
+ endif()
_pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION)
_pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX)
@@ -267,21 +267,21 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
if (_pkgconfig_retval)
if(NOT ${_is_silent})
message(STATUS " package '${_pkg_check_modules_pkg}' not found")
- endif(NOT ${_is_silent})
+ endif()
set(_pkg_check_modules_failed 1)
- endif(_pkgconfig_retval)
- endforeach(_pkg_check_modules_pkg)
+ endif()
+ endforeach()
if(_pkg_check_modules_failed)
# fail when requested
if (${_is_required})
message(SEND_ERROR "A required package was not found")
- endif (${_is_required})
- else(_pkg_check_modules_failed)
+ endif ()
+ else()
# when we are here, we checked whether requested modules
# exist. Now, go through them and set variables
-
+
_pkgconfig_set(${_prefix}_FOUND 1)
list(LENGTH _pkg_check_modules_packages pkg_count)
@@ -290,10 +290,10 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
# handle case when there is only one package required
if (pkg_count EQUAL 1)
set(_pkg_check_prefix "${_prefix}")
- else(pkg_count EQUAL 1)
+ else()
set(_pkg_check_prefix "${_prefix}_${_pkg_check_modules_pkg}")
- endif(pkg_count EQUAL 1)
-
+ endif()
+
_pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION "" --modversion )
_pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX "" --variable=prefix )
_pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" INCLUDEDIR "" --variable=includedir )
@@ -301,8 +301,8 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
if (NOT ${_is_silent})
message(STATUS " found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}")
- endif (NOT ${_is_silent})
- endforeach(_pkg_check_modules_pkg)
+ endif ()
+ endforeach()
# set variables which are combined for multiple modules
_pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARIES "(^| )-l" --libs-only-l )
@@ -313,13 +313,13 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
_pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS "(^| )-I" --cflags-only-I )
_pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS "" --cflags )
_pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER "" --cflags-only-other )
- endif(_pkg_check_modules_failed)
- else(PKG_CONFIG_EXECUTABLE)
+ endif()
+ else()
if (${_is_required})
message(SEND_ERROR "pkg-config tool not found")
- endif (${_is_required})
- endif(PKG_CONFIG_EXECUTABLE)
-endmacro(_pkg_check_modules_internal)
+ endif ()
+ endif()
+endmacro()
###
### User visible macros start here
@@ -333,8 +333,8 @@ macro(pkg_check_modules _prefix _module0)
_pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" "${_prefix}" ${_pkg_modules})
_pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
- endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
-endmacro(pkg_check_modules)
+ endif()
+endmacro()
###
macro(pkg_search_module _prefix _module0)
@@ -345,28 +345,28 @@ macro(pkg_search_module _prefix _module0)
if (NOT ${_pkg_is_silent})
message(STATUS "checking for one of the modules '${_pkg_modules_alt}'")
- endif (NOT ${_pkg_is_silent})
+ endif ()
# iterate through all modules and stop at the first working one.
foreach(_pkg_alt ${_pkg_modules_alt})
if(NOT _pkg_modules_found)
_pkg_check_modules_internal(0 1 "${_prefix}" "${_pkg_alt}")
- endif(NOT _pkg_modules_found)
+ endif()
if (${_prefix}_FOUND)
set(_pkg_modules_found 1)
- endif(${_prefix}_FOUND)
- endforeach(_pkg_alt)
+ endif()
+ endforeach()
if (NOT ${_prefix}_FOUND)
if(${_pkg_is_required})
message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found")
- endif(${_pkg_is_required})
- endif(NOT ${_prefix}_FOUND)
-
+ endif()
+ endif()
+
_pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
- endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
-endmacro(pkg_search_module)
+ endif()
+endmacro()
### Local Variables:
### mode: cmake
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index 94e5676fe..e3c898b98 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -35,7 +35,7 @@
#
# To use this variable just do something like this:
# set(PostgreSQL_ADDITIONAL_VERSIONS "9.2" "8.4.4")
-# before calling FIND_PACKAGE(PostgreSQL) in your CMakeLists.txt file.
+# before calling find_package(PostgreSQL) in your CMakeLists.txt file.
# This will mean that the versions you set here will be found first in the order
# specified before the default ones are searched.
#
@@ -61,7 +61,7 @@
# PostgreSQL_LIBRARY_DIR to wherever the library pq (or libpq in windows) is
# 2) Use CMAKE_INCLUDE_PATH to set a path to <Your Path>/PostgreSQL<-version>. This will allow find_path()
# to locate PostgreSQL_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g. In your CMakeLists.txt file
-# SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include")
+# set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include")
# 3) Set an environment variable called ${PostgreSQL_ROOT} that points to the root of where you have
# installed PostgreSQL, e.g. <Your Path>.
#
@@ -74,11 +74,6 @@ set(PostgreSQL_LIBRARY_DIR_MESSAGE "Set the PostgreSQL_LIBRARY_DIR cmake cache e
set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to where PostgreSQL is found on the machine E.g C:/Program Files/PostgreSQL/8.4")
-set(PostgreSQL_ROOT_DIRECTORIES $ENV{PostgreSQL_ROOT})
-if(PostgreSQL_ROOT_DIRECTORIES)
- file(TO_CMAKE_PATH ${PostgreSQL_ROOT_DIRECTORIES} PostgreSQL_ROOT_DIRECTORIES)
-endif(PostgreSQL_ROOT_DIRECTORIES)
-
set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
"9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
@@ -86,10 +81,10 @@ set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
if ( WIN32 )
foreach (suffix ${PostgreSQL_KNOWN_VERSIONS} )
set(PostgreSQL_ADDITIONAL_SEARCH_PATHS ${PostgreSQL_ADDITIONAL_SEARCH_PATHS} "C:/Program Files/PostgreSQL/${suffix}" )
- endforeach(suffix)
-endif( WIN32 )
+ endforeach()
+endif()
set( PostgreSQL_ROOT_DIRECTORIES
- ${PostgreSQL_ROOT_DIRECTORIES}
+ ENV PostgreSQL_ROOT
${PostgreSQL_ROOT}
${PostgreSQL_ADDITIONAL_SEARCH_PATHS}
)
@@ -116,6 +111,7 @@ find_path(PostgreSQL_TYPE_INCLUDE_DIR
# Look in other places.
${PostgreSQL_ROOT_DIRECTORIES}
PATH_SUFFIXES
+ postgresql
pgsql/server
postgresql/server
include/server
@@ -151,7 +147,7 @@ if (PostgreSQL_INCLUDE_DIR AND EXISTS "${PostgreSQL_INCLUDE_DIR}/pg_config.h")
endif()
# Did we find anything?
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(PostgreSQL
REQUIRED_VARS PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR
VERSION_VAR PostgreSQL_VERSION_STRING)
@@ -167,6 +163,6 @@ if(PostgreSQL_FOUND)
#message("Final PostgreSQL include dir: ${PostgreSQL_INCLUDE_DIRS}")
#message("Final PostgreSQL library dir: ${PostgreSQL_LIBRARY_DIRS}")
#message("Final PostgreSQL libraries: ${PostgreSQL_LIBRARIES}")
-endif(PostgreSQL_FOUND)
+endif()
mark_as_advanced(PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR PostgreSQL_LIBRARY )
diff --git a/Modules/FindProducer.cmake b/Modules/FindProducer.cmake
index 26c804ac1..30990629b 100644
--- a/Modules/FindProducer.cmake
+++ b/Modules/FindProducer.cmake
@@ -1,18 +1,18 @@
# Though Producer isn't directly part of OpenSceneGraph, its primary user
-# is OSG so I consider this part of the Findosg* suite used to find
+# is OSG so I consider this part of the Findosg* suite used to find
# OpenSceneGraph components. You'll notice that I accept OSGDIR as an
# environment path.
-#
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL (and OpenThreads?) as these
-# modules won't do it for you. This is to allow you control over your own
+#
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL (and OpenThreads?) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate Producer
# This module defines
# PRODUCER_LIBRARY
@@ -42,11 +42,11 @@
# #include <Producer/CameraGroup>
# Try the user's environment request before anything else.
-FIND_PATH(PRODUCER_INCLUDE_DIR Producer/CameraGroup
+find_path(PRODUCER_INCLUDE_DIR Producer/CameraGroup
HINTS
- $ENV{PRODUCER_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
+ ENV PRODUCER_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
PATH_SUFFIXES include
PATHS
~/Library/Frameworks
@@ -59,13 +59,13 @@ FIND_PATH(PRODUCER_INCLUDE_DIR Producer/CameraGroup
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
)
-FIND_LIBRARY(PRODUCER_LIBRARY
+find_library(PRODUCER_LIBRARY
NAMES Producer
HINTS
- $ENV{PRODUCER_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- PATH_SUFFIXES lib64 lib
+ ENV PRODUCER_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
+ PATH_SUFFIXES lib
PATHS
/sw
/opt/local
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 1e1e49301..af0c2ddf0 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -78,7 +78,7 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
if(NOT ARGN)
message(SEND_ERROR "Error: PROTOBUF_GENERATE_CPP() called without any proto files")
return()
- endif(NOT ARGN)
+ endif()
if(PROTOBUF_GENERATE_CPP_APPEND_PATH)
# Create an include path for each file specified
@@ -109,7 +109,7 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)
-
+
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index a131c5fde..7fb65b869 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -47,16 +47,16 @@ if(PythonInterp_FIND_VERSION)
list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
endif()
endforeach()
- endif(NOT PythonInterp_FIND_VERSION_EXACT)
+ endif()
unset(_PYTHON_FIND_MAJ_MIN)
unset(_PYTHON_FIND_MAJ)
- else(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+ else()
list(APPEND _Python_NAMES python${PythonInterp_FIND_VERSION})
set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonInterp_FIND_VERSION}_VERSIONS})
- endif(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
-else(PythonInterp_FIND_VERSION)
+ endif()
+else()
set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
-endif(PythonInterp_FIND_VERSION)
+endif()
list(APPEND _Python_NAMES python)
@@ -131,7 +131,7 @@ if(PYTHON_EXECUTABLE)
endif()
unset(_PYTHON_VERSION_RESULT)
unset(_VERSION)
-endif(PYTHON_EXECUTABLE)
+endif()
# handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
# all listed variables are TRUE
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 11ff19623..0a9a99080 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -32,57 +32,57 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(CMakeFindFrameworks)
+include(CMakeFindFrameworks)
# Search for the python framework on Apple.
CMAKE_FIND_FRAMEWORKS(Python)
-SET(_PYTHON1_VERSIONS 1.6 1.5)
-SET(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
-SET(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0)
-
-IF(PythonLibs_FIND_VERSION)
- IF(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
- STRING(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION}")
- STRING(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}")
- UNSET(_PYTHON_FIND_OTHER_VERSIONS)
- IF(PythonLibs_FIND_VERSION_EXACT)
- IF(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
- SET(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}")
- ELSE(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
- SET(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}")
- ENDIF(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
- ELSE(PythonLibs_FIND_VERSION_EXACT)
- FOREACH(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS})
- IF(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
- LIST(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
- ENDIF()
- ENDFOREACH()
- ENDIF(PythonLibs_FIND_VERSION_EXACT)
- UNSET(_PYTHON_FIND_MAJ_MIN)
- UNSET(_PYTHON_FIND_MAJ)
- ELSE(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
- SET(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION}_VERSIONS})
- ENDIF(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
-ELSE(PythonLibs_FIND_VERSION)
- SET(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
-ENDIF(PythonLibs_FIND_VERSION)
+set(_PYTHON1_VERSIONS 1.6 1.5)
+set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
+set(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0)
+
+if(PythonLibs_FIND_VERSION)
+ if(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+ string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION}")
+ string(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}")
+ unset(_PYTHON_FIND_OTHER_VERSIONS)
+ if(PythonLibs_FIND_VERSION_EXACT)
+ if(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
+ set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}")
+ else()
+ set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}")
+ endif()
+ else()
+ foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS})
+ if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
+ list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
+ endif()
+ endforeach()
+ endif()
+ unset(_PYTHON_FIND_MAJ_MIN)
+ unset(_PYTHON_FIND_MAJ)
+ else()
+ set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION}_VERSIONS})
+ endif()
+else()
+ set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
+endif()
# Set up the versions we know about, in the order we will search. Always add
# the user supplied additional versions to the front.
-SET(_Python_VERSIONS
+set(_Python_VERSIONS
${Python_ADDITIONAL_VERSIONS}
${_PYTHON_FIND_OTHER_VERSIONS}
)
-UNSET(_PYTHON_FIND_OTHER_VERSIONS)
-UNSET(_PYTHON1_VERSIONS)
-UNSET(_PYTHON2_VERSIONS)
-UNSET(_PYTHON3_VERSIONS)
+unset(_PYTHON_FIND_OTHER_VERSIONS)
+unset(_PYTHON1_VERSIONS)
+unset(_PYTHON2_VERSIONS)
+unset(_PYTHON3_VERSIONS)
-FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
- STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
- IF(WIN32)
- FIND_LIBRARY(PYTHON_DEBUG_LIBRARY
+foreach(_CURRENT_VERSION ${_Python_VERSIONS})
+ string(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
+ if(WIN32)
+ find_library(PYTHON_DEBUG_LIBRARY
NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
@@ -90,9 +90,9 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
)
- ENDIF(WIN32)
+ endif()
- FIND_LIBRARY(PYTHON_LIBRARY
+ find_library(PYTHON_LIBRARY
NAMES
python${_CURRENT_VERSION_NO_DOTS}
python${_CURRENT_VERSION}mu
@@ -106,7 +106,7 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
NO_SYSTEM_ENVIRONMENT_PATH
)
# Look for the static library in the Python config directory
- FIND_LIBRARY(PYTHON_LIBRARY
+ find_library(PYTHON_LIBRARY
NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
# Avoid finding the .dll in the PATH. We want the .lib.
NO_SYSTEM_ENVIRONMENT_PATH
@@ -116,20 +116,20 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
# For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if
# PYTHON_INCLUDE_DIR is not set.
- IF(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
- SET(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH
+ if(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
+ set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH
"Path to where Python.h is found" FORCE)
- ENDIF(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
+ endif()
- SET(PYTHON_FRAMEWORK_INCLUDES)
- IF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
- FOREACH(dir ${Python_FRAMEWORKS})
- SET(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
+ set(PYTHON_FRAMEWORK_INCLUDES)
+ if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
+ foreach(dir ${Python_FRAMEWORKS})
+ set(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION})
- ENDFOREACH(dir)
- ENDIF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
+ endforeach()
+ endif()
- FIND_PATH(PYTHON_INCLUDE_DIR
+ find_path(PYTHON_INCLUDE_DIR
NAMES Python.h
PATHS
${PYTHON_FRAMEWORK_INCLUDES}
@@ -143,22 +143,22 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
)
# For backward compatibility, set PYTHON_INCLUDE_PATH.
- SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
+ set(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
- IF(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
- FILE(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" python_version_str
+ if(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
+ file(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" python_version_str
REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"")
- STRING(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
+ string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
PYTHONLIBS_VERSION_STRING "${python_version_str}")
- UNSET(python_version_str)
- ENDIF(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
+ unset(python_version_str)
+ endif()
- IF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
- BREAK()
- ENDIF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
-ENDFOREACH(_CURRENT_VERSION)
+ if(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
+ break()
+ endif()
+endforeach()
-MARK_AS_ADVANCED(
+mark_as_advanced(
PYTHON_DEBUG_LIBRARY
PYTHON_LIBRARY
PYTHON_INCLUDE_DIR
@@ -168,21 +168,21 @@ MARK_AS_ADVANCED(
# cache entries because they are meant to specify the location of a single
# library. We now set the variables listed by the documentation for this
# module.
-SET(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
-SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
+set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
+set(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
# These variables have been historically named in this module different from
# what SELECT_LIBRARY_CONFIGURATIONS() expects.
-SET(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}")
-SET(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}")
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+set(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}")
+set(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}")
+include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
SELECT_LIBRARY_CONFIGURATIONS(PYTHON)
# SELECT_LIBRARY_CONFIGURATIONS() sets ${PREFIX}_FOUND if it has a library.
# Unset this, this prefix doesn't match the module prefix, they are different
# for historical reasons.
-UNSET(PYTHON_FOUND)
+unset(PYTHON_FOUND)
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs
REQUIRED_VARS PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS
VERSION_VAR PYTHONLIBS_VERSION_STRING)
@@ -190,51 +190,51 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs
# PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is used to build modules for python.
# PYTHON_WRITE_MODULES_HEADER(<filename>) writes a header file you can include
# in your sources to initialize the static python modules
-FUNCTION(PYTHON_ADD_MODULE _NAME )
- GET_PROPERTY(_TARGET_SUPPORTS_SHARED_LIBS
+function(PYTHON_ADD_MODULE _NAME )
+ get_property(_TARGET_SUPPORTS_SHARED_LIBS
GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
- OPTION(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE)
- OPTION(PYTHON_MODULE_${_NAME}_BUILD_SHARED
+ option(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE)
+ option(PYTHON_MODULE_${_NAME}_BUILD_SHARED
"Add module ${_NAME} shared" ${_TARGET_SUPPORTS_SHARED_LIBS})
# Mark these options as advanced
- MARK_AS_ADVANCED(PYTHON_ENABLE_MODULE_${_NAME}
+ mark_as_advanced(PYTHON_ENABLE_MODULE_${_NAME}
PYTHON_MODULE_${_NAME}_BUILD_SHARED)
- IF(PYTHON_ENABLE_MODULE_${_NAME})
- IF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
- SET(PY_MODULE_TYPE MODULE)
- ELSE(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
- SET(PY_MODULE_TYPE STATIC)
- SET_PROPERTY(GLOBAL APPEND PROPERTY PY_STATIC_MODULES_LIST ${_NAME})
- ENDIF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+ if(PYTHON_ENABLE_MODULE_${_NAME})
+ if(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+ set(PY_MODULE_TYPE MODULE)
+ else()
+ set(PY_MODULE_TYPE STATIC)
+ set_property(GLOBAL APPEND PROPERTY PY_STATIC_MODULES_LIST ${_NAME})
+ endif()
- SET_PROPERTY(GLOBAL APPEND PROPERTY PY_MODULES_LIST ${_NAME})
- ADD_LIBRARY(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
-# TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES})
+ set_property(GLOBAL APPEND PROPERTY PY_MODULES_LIST ${_NAME})
+ add_library(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
+# target_link_libraries(${_NAME} ${PYTHON_LIBRARIES})
- IF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
- SET_TARGET_PROPERTIES(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")
- IF(WIN32 AND NOT CYGWIN)
- SET_TARGET_PROPERTIES(${_NAME} PROPERTIES SUFFIX ".pyd")
- ENDIF(WIN32 AND NOT CYGWIN)
- ENDIF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+ if(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+ set_target_properties(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")
+ if(WIN32 AND NOT CYGWIN)
+ set_target_properties(${_NAME} PROPERTIES SUFFIX ".pyd")
+ endif()
+ endif()
- ENDIF(PYTHON_ENABLE_MODULE_${_NAME})
-ENDFUNCTION(PYTHON_ADD_MODULE)
+ endif()
+endfunction()
-FUNCTION(PYTHON_WRITE_MODULES_HEADER _filename)
+function(PYTHON_WRITE_MODULES_HEADER _filename)
- GET_PROPERTY(PY_STATIC_MODULES_LIST GLOBAL PROPERTY PY_STATIC_MODULES_LIST)
+ get_property(PY_STATIC_MODULES_LIST GLOBAL PROPERTY PY_STATIC_MODULES_LIST)
- GET_FILENAME_COMPONENT(_name "${_filename}" NAME)
- STRING(REPLACE "." "_" _name "${_name}")
- STRING(TOUPPER ${_name} _nameUpper)
- SET(_filename ${CMAKE_CURRENT_BINARY_DIR}/${_filename})
+ get_filename_component(_name "${_filename}" NAME)
+ string(REPLACE "." "_" _name "${_name}")
+ string(TOUPPER ${_name} _nameUpper)
+ set(_filename ${CMAKE_CURRENT_BINARY_DIR}/${_filename})
- SET(_filenameTmp "${_filename}.in")
- FILE(WRITE ${_filenameTmp} "/*Created by cmake, do not edit, changes will be lost*/\n")
- FILE(APPEND ${_filenameTmp}
+ set(_filenameTmp "${_filename}.in")
+ file(WRITE ${_filenameTmp} "/*Created by cmake, do not edit, changes will be lost*/\n")
+ file(APPEND ${_filenameTmp}
"#ifndef ${_nameUpper}
#define ${_nameUpper}
@@ -246,11 +246,11 @@ extern \"C\" {
")
- FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
- FILE(APPEND ${_filenameTmp} "extern void init${PYTHON_MODULE_PREFIX}${_currentModule}(void);\n\n")
- ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+ foreach(_currentModule ${PY_STATIC_MODULES_LIST})
+ file(APPEND ${_filenameTmp} "extern void init${PYTHON_MODULE_PREFIX}${_currentModule}(void);\n\n")
+ endforeach()
- FILE(APPEND ${_filenameTmp}
+ file(APPEND ${_filenameTmp}
"#ifdef __cplusplus
}
#endif /* __cplusplus */
@@ -258,18 +258,18 @@ extern \"C\" {
")
- FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
- FILE(APPEND ${_filenameTmp} "int ${_name}_${_currentModule}(void) \n{\n static char name[]=\"${PYTHON_MODULE_PREFIX}${_currentModule}\"; return PyImport_AppendInittab(name, init${PYTHON_MODULE_PREFIX}${_currentModule});\n}\n\n")
- ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+ foreach(_currentModule ${PY_STATIC_MODULES_LIST})
+ file(APPEND ${_filenameTmp} "int ${_name}_${_currentModule}(void) \n{\n static char name[]=\"${PYTHON_MODULE_PREFIX}${_currentModule}\"; return PyImport_AppendInittab(name, init${PYTHON_MODULE_PREFIX}${_currentModule});\n}\n\n")
+ endforeach()
- FILE(APPEND ${_filenameTmp} "void ${_name}_LoadAllPythonModules(void)\n{\n")
- FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
- FILE(APPEND ${_filenameTmp} " ${_name}_${_currentModule}();\n")
- ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
- FILE(APPEND ${_filenameTmp} "}\n\n")
- FILE(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n ${_name}_LoadAllPythonModules();\n}\n#endif\n\n#endif\n")
+ file(APPEND ${_filenameTmp} "void ${_name}_LoadAllPythonModules(void)\n{\n")
+ foreach(_currentModule ${PY_STATIC_MODULES_LIST})
+ file(APPEND ${_filenameTmp} " ${_name}_${_currentModule}();\n")
+ endforeach()
+ file(APPEND ${_filenameTmp} "}\n\n")
+ file(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n ${_name}_LoadAllPythonModules();\n}\n#endif\n\n#endif\n")
-# with CONFIGURE_FILE() cmake complains that you may not use a file created using FILE(WRITE) as input file for CONFIGURE_FILE()
- EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)
+# with configure_file() cmake complains that you may not use a file created using file(WRITE) as input file for configure_file()
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)
-ENDFUNCTION(PYTHON_WRITE_MODULES_HEADER)
+endfunction()
diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake
index 2b8dfd7fb..13f18fe7a 100644
--- a/Modules/FindQt.cmake
+++ b/Modules/FindQt.cmake
@@ -1,16 +1,16 @@
-# - Searches for all installed versions of QT.
+# - Searches for all installed versions of Qt.
# This should only be used if your project can work with multiple
-# versions of QT. If not, you should just directly use FindQt4 or FindQt3.
-# If multiple versions of QT are found on the machine, then
+# versions of Qt. If not, you should just directly use FindQt4 or FindQt3.
+# If multiple versions of Qt are found on the machine, then
# The user must set the option DESIRED_QT_VERSION to the version
# they want to use. If only one version of qt is found on the machine,
-# then the DESIRED_QT_VERSION is set to that version and the
+# then the DESIRED_QT_VERSION is set to that version and the
# matching FindQt3 or FindQt4 module is included.
# Once the user sets DESIRED_QT_VERSION, then the FindQt3 or FindQt4 module
# is included.
#
-# QT_REQUIRED if this is set to TRUE then if CMake can
-# not find QT4 or QT3 an error is raised
+# QT_REQUIRED if this is set to TRUE then if CMake can
+# not find Qt4 or Qt3 an error is raised
# and a message is sent to the user.
#
# DESIRED_QT_VERSION OPTION is created
@@ -31,52 +31,52 @@
# License text for the above reference.)
# look for signs of qt3 installations
-FILE(GLOB GLOB_TEMP_VAR /usr/lib/qt-3*/bin/qmake)
-IF(GLOB_TEMP_VAR)
- SET(QT3_INSTALLED TRUE)
-ENDIF(GLOB_TEMP_VAR)
-SET(GLOB_TEMP_VAR)
+file(GLOB GLOB_TEMP_VAR /usr/lib/qt-3*/bin/qmake)
+if(GLOB_TEMP_VAR)
+ set(QT3_INSTALLED TRUE)
+endif()
+set(GLOB_TEMP_VAR)
-FILE(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-3*/bin/qmake)
-IF(GLOB_TEMP_VAR)
- SET(QT3_INSTALLED TRUE)
-ENDIF(GLOB_TEMP_VAR)
-SET(GLOB_TEMP_VAR)
+file(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-3*/bin/qmake)
+if(GLOB_TEMP_VAR)
+ set(QT3_INSTALLED TRUE)
+endif()
+set(GLOB_TEMP_VAR)
# look for qt4 installations
-FILE(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-4*/bin/qmake)
-IF(GLOB_TEMP_VAR)
- SET(QT4_INSTALLED TRUE)
-ENDIF(GLOB_TEMP_VAR)
-SET(GLOB_TEMP_VAR)
+file(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-4*/bin/qmake)
+if(GLOB_TEMP_VAR)
+ set(QT4_INSTALLED TRUE)
+endif()
+set(GLOB_TEMP_VAR)
-FILE(GLOB GLOB_TEMP_VAR /usr/local/Trolltech/Qt-4*/bin/qmake)
-IF(GLOB_TEMP_VAR)
- SET(QT4_INSTALLED TRUE)
-ENDIF(GLOB_TEMP_VAR)
-SET(GLOB_TEMP_VAR)
+file(GLOB GLOB_TEMP_VAR /usr/local/Trolltech/Qt-4*/bin/qmake)
+if(GLOB_TEMP_VAR)
+ set(QT4_INSTALLED TRUE)
+endif()
+set(GLOB_TEMP_VAR)
# now find qmake
-FIND_PROGRAM(QT_QMAKE_EXECUTABLE_FINDQT NAMES qmake PATHS "${QT_SEARCH_PATH}/bin" "$ENV{QTDIR}/bin")
-IF(QT_QMAKE_EXECUTABLE_FINDQT)
- EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE_FINDQT} ARGS "-query QT_VERSION"
+find_program(QT_QMAKE_EXECUTABLE_FINDQT NAMES qmake PATHS "${QT_SEARCH_PATH}/bin" "$ENV{QTDIR}/bin")
+if(QT_QMAKE_EXECUTABLE_FINDQT)
+ exec_program(${QT_QMAKE_EXECUTABLE_FINDQT} ARGS "-query QT_VERSION"
OUTPUT_VARIABLE QTVERSION)
- IF(QTVERSION MATCHES "4.*")
- SET(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE_FINDQT} CACHE PATH "QT4 qmake program.")
- SET(QT4_INSTALLED TRUE)
- ENDIF(QTVERSION MATCHES "4.*")
- IF(QTVERSION MATCHES "Unknown")
- SET(QT3_INSTALLED TRUE)
- ENDIF(QTVERSION MATCHES "Unknown")
-ENDIF(QT_QMAKE_EXECUTABLE_FINDQT)
+ if(QTVERSION MATCHES "4.*")
+ set(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE_FINDQT} CACHE PATH "Qt4 qmake program.")
+ set(QT4_INSTALLED TRUE)
+ endif()
+ if(QTVERSION MATCHES "Unknown")
+ set(QT3_INSTALLED TRUE)
+ endif()
+endif()
-IF(QT_QMAKE_EXECUTABLE_FINDQT)
- EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE_FINDQT}
- ARGS "-query QT_INSTALL_HEADERS"
+if(QT_QMAKE_EXECUTABLE_FINDQT)
+ exec_program( ${QT_QMAKE_EXECUTABLE_FINDQT}
+ ARGS "-query QT_INSTALL_HEADERS"
OUTPUT_VARIABLE qt_headers )
-ENDIF(QT_QMAKE_EXECUTABLE_FINDQT)
+endif()
-FIND_FILE( QT4_QGLOBAL_H_FILE qglobal.h
+find_file( QT4_QGLOBAL_H_FILE qglobal.h
"${QT_SEARCH_PATH}/Qt/include"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/include/Qt"
@@ -89,12 +89,12 @@ FIND_FILE( QT4_QGLOBAL_H_FILE qglobal.h
/usr/share/qt4/include/Qt
C:/Progra~1/qt/include/Qt )
-IF(QT4_QGLOBAL_H_FILE)
- SET(QT4_INSTALLED TRUE)
-ENDIF(QT4_QGLOBAL_H_FILE)
+if(QT4_QGLOBAL_H_FILE)
+ set(QT4_INSTALLED TRUE)
+endif()
-FIND_FILE( QT3_QGLOBAL_H_FILE qglobal.h
- "${QT_SEARCH_PATH}/Qt/include"
+find_file( QT3_QGLOBAL_H_FILE qglobal.h
+ "${QT_SEARCH_PATH}/Qt/include"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt"
@@ -109,52 +109,52 @@ FIND_FILE( QT3_QGLOBAL_H_FILE qglobal.h
C:/Progra~1/qt/include
/usr/include/qt3 )
-IF(QT3_QGLOBAL_H_FILE)
- SET(QT3_INSTALLED TRUE)
-ENDIF(QT3_QGLOBAL_H_FILE)
+if(QT3_QGLOBAL_H_FILE)
+ set(QT3_INSTALLED TRUE)
+endif()
-IF(QT3_INSTALLED AND QT4_INSTALLED )
+if(QT3_INSTALLED AND QT4_INSTALLED )
# force user to pick if we have both
- SET(DESIRED_QT_VERSION 0 CACHE STRING "Pick a version of QT to use: 3 or 4")
-ELSE(QT3_INSTALLED AND QT4_INSTALLED )
+ set(DESIRED_QT_VERSION 0 CACHE STRING "Pick a version of Qt to use: 3 or 4")
+else()
# if only one found then pick that one
- IF(QT3_INSTALLED)
- SET(DESIRED_QT_VERSION 3 CACHE STRING "Pick a version of QT to use: 3 or 4")
- ENDIF(QT3_INSTALLED)
- IF(QT4_INSTALLED)
- SET(DESIRED_QT_VERSION 4 CACHE STRING "Pick a version of QT to use: 3 or 4")
- ENDIF(QT4_INSTALLED)
-ENDIF(QT3_INSTALLED AND QT4_INSTALLED )
+ if(QT3_INSTALLED)
+ set(DESIRED_QT_VERSION 3 CACHE STRING "Pick a version of Qt to use: 3 or 4")
+ endif()
+ if(QT4_INSTALLED)
+ set(DESIRED_QT_VERSION 4 CACHE STRING "Pick a version of Qt to use: 3 or 4")
+ endif()
+endif()
-IF(DESIRED_QT_VERSION MATCHES 3)
- SET(Qt3_FIND_REQUIRED ${Qt_FIND_REQUIRED})
- SET(Qt3_FIND_QUIETLY ${Qt_FIND_QUIETLY})
- INCLUDE(FindQt3)
-ENDIF(DESIRED_QT_VERSION MATCHES 3)
-IF(DESIRED_QT_VERSION MATCHES 4)
- SET(Qt4_FIND_REQUIRED ${Qt_FIND_REQUIRED})
- SET(Qt4_FIND_QUIETLY ${Qt_FIND_QUIETLY})
- INCLUDE(FindQt4)
-ENDIF(DESIRED_QT_VERSION MATCHES 4)
+if(DESIRED_QT_VERSION MATCHES 3)
+ set(Qt3_FIND_REQUIRED ${Qt_FIND_REQUIRED})
+ set(Qt3_FIND_QUIETLY ${Qt_FIND_QUIETLY})
+ include(FindQt3)
+endif()
+if(DESIRED_QT_VERSION MATCHES 4)
+ set(Qt4_FIND_REQUIRED ${Qt_FIND_REQUIRED})
+ set(Qt4_FIND_QUIETLY ${Qt_FIND_QUIETLY})
+ include(FindQt4)
+endif()
-IF(NOT QT3_INSTALLED AND NOT QT4_INSTALLED)
- IF(QT_REQUIRED)
- MESSAGE(SEND_ERROR "CMake was unable to find any QT versions, put qmake in your path, or set QT_QMAKE_EXECUTABLE.")
- ENDIF(QT_REQUIRED)
-ELSE(NOT QT3_INSTALLED AND NOT QT4_INSTALLED)
- IF(NOT QT_FOUND AND NOT DESIRED_QT_VERSION)
- IF(QT_REQUIRED)
- MESSAGE(SEND_ERROR "Multiple versions of QT found please set DESIRED_QT_VERSION")
- ELSE(QT_REQUIRED)
- MESSAGE("Multiple versions of QT found please set DESIRED_QT_VERSION")
- ENDIF(QT_REQUIRED)
- ENDIF(NOT QT_FOUND AND NOT DESIRED_QT_VERSION)
- IF(NOT QT_FOUND AND DESIRED_QT_VERSION)
- IF(QT_REQUIRED)
- MESSAGE(FATAL_ERROR "CMake was unable to find QT version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE, if those are set then QT_QT_LIBRARY or QT_LIBRARY_DIR.")
- ELSE(QT_REQUIRED)
- MESSAGE( "CMake was unable to find desired QT version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE.")
- ENDIF(QT_REQUIRED)
- ENDIF(NOT QT_FOUND AND DESIRED_QT_VERSION)
-ENDIF(NOT QT3_INSTALLED AND NOT QT4_INSTALLED)
-MARK_AS_ADVANCED(QT3_QGLOBAL_H_FILE QT4_QGLOBAL_H_FILE QT_QMAKE_EXECUTABLE_FINDQT)
+if(NOT QT3_INSTALLED AND NOT QT4_INSTALLED)
+ if(QT_REQUIRED)
+ message(SEND_ERROR "CMake was unable to find any Qt versions, put qmake in your path, or set QT_QMAKE_EXECUTABLE.")
+ endif()
+else()
+ if(NOT QT_FOUND AND NOT DESIRED_QT_VERSION)
+ if(QT_REQUIRED)
+ message(SEND_ERROR "Multiple versions of Qt found please set DESIRED_QT_VERSION")
+ else()
+ message("Multiple versions of Qt found please set DESIRED_QT_VERSION")
+ endif()
+ endif()
+ if(NOT QT_FOUND AND DESIRED_QT_VERSION)
+ if(QT_REQUIRED)
+ message(FATAL_ERROR "CMake was unable to find Qt version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE, if those are set then QT_QT_LIBRARY or QT_LIBRARY_DIR.")
+ else()
+ message( "CMake was unable to find desired Qt version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE.")
+ endif()
+ endif()
+endif()
+mark_as_advanced(QT3_QGLOBAL_H_FILE QT4_QGLOBAL_H_FILE QT_QMAKE_EXECUTABLE_FINDQT)
diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake
index 2d8dbde22..07b6fef34 100644
--- a/Modules/FindQt3.cmake
+++ b/Modules/FindQt3.cmake
@@ -35,23 +35,23 @@
# License text for the above reference.)
# If Qt4 has already been found, fail.
-IF(QT4_FOUND)
- IF(Qt3_FIND_REQUIRED)
- MESSAGE( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.")
- ELSE(Qt3_FIND_REQUIRED)
- IF(NOT Qt3_FIND_QUIETLY)
- MESSAGE( STATUS "Qt3 and Qt4 cannot be used together in one project.")
- ENDIF(NOT Qt3_FIND_QUIETLY)
- RETURN()
- ENDIF(Qt3_FIND_REQUIRED)
-ENDIF(QT4_FOUND)
+if(QT4_FOUND)
+ if(Qt3_FIND_REQUIRED)
+ message( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.")
+ else()
+ if(NOT Qt3_FIND_QUIETLY)
+ message( STATUS "Qt3 and Qt4 cannot be used together in one project.")
+ endif()
+ return()
+ endif()
+endif()
-FILE(GLOB GLOB_PATHS /usr/lib/qt-3*)
-FOREACH(GLOB_PATH ${GLOB_PATHS})
- LIST(APPEND GLOB_PATHS_BIN "${GLOB_PATH}/bin")
-ENDFOREACH(GLOB_PATH)
-FIND_PATH(QT_INCLUDE_DIR qt.h
+file(GLOB GLOB_PATHS /usr/lib/qt-3*)
+foreach(GLOB_PATH ${GLOB_PATHS})
+ list(APPEND GLOB_PATHS_BIN "${GLOB_PATH}/bin")
+endforeach()
+find_path(QT_INCLUDE_DIR qt.h
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt"
@@ -68,229 +68,237 @@ FIND_PATH(QT_INCLUDE_DIR qt.h
# if qglobal.h is not in the qt_include_dir then set
# QT_INCLUDE_DIR to NOTFOUND
-IF(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h)
- SET(QT_INCLUDE_DIR QT_INCLUDE_DIR-NOTFOUND CACHE PATH "path to Qt3 include directory" FORCE)
-ENDIF(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h)
+if(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h)
+ set(QT_INCLUDE_DIR QT_INCLUDE_DIR-NOTFOUND CACHE PATH "path to Qt3 include directory" FORCE)
+endif()
-IF(QT_INCLUDE_DIR)
+if(QT_INCLUDE_DIR)
#extract the version string from qglobal.h
- FILE(READ ${QT_INCLUDE_DIR}/qglobal.h QGLOBAL_H)
- STRING(REGEX MATCH "#define[\t ]+QT_VERSION_STR[\t ]+\"[0-9]+.[0-9]+.[0-9]+[a-z]*\"" QGLOBAL_H "${QGLOBAL_H}")
- STRING(REGEX REPLACE ".*\"([0-9]+.[0-9]+.[0-9]+[a-z]*)\".*" "\\1" qt_version_str "${QGLOBAL_H}")
+ file(STRINGS ${QT_INCLUDE_DIR}/qglobal.h QGLOBAL_H REGEX "#define[\t ]+QT_VERSION_STR[\t ]+\"[0-9]+.[0-9]+.[0-9]+[a-z]*\"")
+ string(REGEX REPLACE ".*\"([0-9]+.[0-9]+.[0-9]+[a-z]*)\".*" "\\1" qt_version_str "${QGLOBAL_H}")
+ unset(QGLOBAL_H)
# Under windows the qt library (MSVC) has the format qt-mtXYZ where XYZ is the
# version X.Y.Z, so we need to remove the dots from version
- STRING(REGEX REPLACE "\\." "" qt_version_str_lib "${qt_version_str}")
- SET(QT_VERSION_STRING "${qt_version_str}")
-ENDIF(QT_INCLUDE_DIR)
+ string(REGEX REPLACE "\\." "" qt_version_str_lib "${qt_version_str}")
+ set(QT_VERSION_STRING "${qt_version_str}")
+endif()
-FILE(GLOB GLOB_PATHS_LIB /usr/lib/qt-3*/lib/)
-IF (QT_MT_REQUIRED)
- FIND_LIBRARY(QT_QT_LIBRARY
+file(GLOB GLOB_PATHS_LIB /usr/lib/qt-3*/lib/)
+if (QT_MT_REQUIRED)
+ find_library(QT_QT_LIBRARY
NAMES
qt-mt qt-mt${qt_version_str_lib} qt-mtnc${qt_version_str_lib}
qt-mtedu${qt_version_str_lib} qt-mt230nc qt-mtnc321 qt-mt3
PATHS
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib"
- $ENV{QTDIR}/lib
- ${GLOB_PATHS_LIB}
- /usr/local/qt/lib
- /usr/lib/qt/lib
- /usr/lib/qt3/lib
- /usr/lib/qt3/lib64
- /usr/share/qt3/lib
- C:/Progra~1/qt/lib
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]"
+ ENV QTDIR
+ ${GLOB_PATHS_LIB}
+ /usr/local/qt
+ /usr/lib/qt
+ /usr/lib/qt3
+ /usr/share/qt3
+ C:/Progra~1/qt
+ PATH_SUFFIXES
+ lib
)
-ELSE (QT_MT_REQUIRED)
- FIND_LIBRARY(QT_QT_LIBRARY
+else ()
+ find_library(QT_QT_LIBRARY
NAMES
qt qt-${qt_version_str_lib} qt-edu${qt_version_str_lib}
qt-mt qt-mt${qt_version_str_lib} qt-mtnc${qt_version_str_lib}
qt-mtedu${qt_version_str_lib} qt-mt230nc qt-mtnc321 qt-mt3
PATHS
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib"
- $ENV{QTDIR}/lib
- ${GLOB_PATHS_LIB}
- /usr/local/qt/lib
- /usr/lib/qt/lib
- /usr/lib/qt3/lib
- /usr/lib/qt3/lib64
- /usr/share/qt3/lib
- C:/Progra~1/qt/lib
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]"
+ ENV QTDIR
+ ${GLOB_PATHS_LIB}
+ /usr/local/qt
+ /usr/lib/qt
+ /usr/lib/qt3
+ /usr/share/qt3
+ C:/Progra~1/qt/lib
+ PATH_SUFFIXES
+ lib
)
-ENDIF (QT_MT_REQUIRED)
+endif ()
-FIND_LIBRARY(QT_QASSISTANTCLIENT_LIBRARY
+find_library(QT_QASSISTANTCLIENT_LIBRARY
NAMES qassistantclient
PATHS
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib"
- $ENV{QTDIR}/lib
- ${GLOB_PATHS_LIB}
- /usr/local/qt/lib
- /usr/lib/qt3/lib
- /usr/lib/qt3/lib64
- /usr/share/qt3/lib
- C:/Progra~1/qt/lib
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]"
+ ENV QTDIR
+ ${GLOB_PATHS_LIB}
+ /usr/local/qt
+ /usr/lib/qt3
+ /usr/share/qt3
+ C:/Progra~1/qt
+ PATH_SUFFIXES
+ lib
)
-# qt 3 should prefer QTDIR over the PATH
-FIND_PROGRAM(QT_MOC_EXECUTABLE
+# Qt 3 should prefer QTDIR over the PATH
+find_program(QT_MOC_EXECUTABLE
NAMES moc-qt3 moc
HINTS
- $ENV{QTDIR}/bin
+ ENV QTDIR
PATHS
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt"
- $ENV{QTDIR}/bin
${GLOB_PATHS_BIN}
- /usr/local/qt/bin
- /usr/lib/qt/bin
- /usr/lib/qt3/bin
- /usr/share/qt3/bin
- C:/Progra~1/qt/bin
- /usr/X11R6/bin
+ /usr/local/qt
+ /usr/lib/qt
+ /usr/lib/qt3
+ /usr/share/qt3
+ C:/Progra~1/qt
+ /usr/X11R6
+ PATH_SUFFIXES
+ bin
)
-IF(QT_MOC_EXECUTABLE)
- SET ( QT_WRAP_CPP "YES")
-ENDIF(QT_MOC_EXECUTABLE)
+if(QT_MOC_EXECUTABLE)
+ set ( QT_WRAP_CPP "YES")
+endif()
-# qt 3 should prefer QTDIR over the PATH
-FIND_PROGRAM(QT_UIC_EXECUTABLE
+# Qt 3 should prefer QTDIR over the PATH
+find_program(QT_UIC_EXECUTABLE
NAMES uic-qt3 uic
HINTS
- $ENV{QTDIR}/bin
+ ENV QTDIR
PATHS
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt"
${GLOB_PATHS_BIN}
- /usr/local/qt/bin
- /usr/lib/qt/bin
- /usr/lib/qt3/bin
- /usr/share/qt3/bin
- C:/Progra~1/qt/bin
- /usr/X11R6/bin
+ /usr/local/qt
+ /usr/lib/qt
+ /usr/lib/qt3
+ /usr/share/qt3
+ C:/Progra~1/qt
+ /usr/X11R6
+ PATH_SUFFIXES
+ bin
)
-IF(QT_UIC_EXECUTABLE)
- SET ( QT_WRAP_UI "YES")
-ENDIF(QT_UIC_EXECUTABLE)
+if(QT_UIC_EXECUTABLE)
+ set ( QT_WRAP_UI "YES")
+endif()
-IF (WIN32)
- FIND_LIBRARY(QT_QTMAIN_LIBRARY qtmain
+if (WIN32)
+ find_library(QT_QTMAIN_LIBRARY qtmain
HINTS
- $ENV{QTDIR}/lib
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib"
+ ENV QTDIR
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]"
PATHS
- "$ENV{ProgramFiles}/qt/lib"
- "C:/Program Files/qt/lib"
+ "$ENV{ProgramFiles}/qt"
+ "C:/Program Files/qt"
+ PATH_SUFFIXES
+ lib
DOC "This Library is only needed by and included with Qt3 on MSWindows. It should be NOTFOUND, undefined or IGNORE otherwise."
)
-ENDIF (WIN32)
+endif ()
#support old QT_MIN_VERSION if set, but not if version is supplied by find_package()
-IF(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION)
- SET(Qt3_FIND_VERSION ${QT_MIN_VERSION})
-ENDIF(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION)
+if(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION)
+ set(Qt3_FIND_VERSION ${QT_MIN_VERSION})
+endif()
# if the include a library are found then we have it
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt3
REQUIRED_VARS QT_QT_LIBRARY QT_INCLUDE_DIR QT_MOC_EXECUTABLE
VERSION_VAR QT_VERSION_STRING)
-SET(QT_FOUND ${QT3_FOUND} )
+set(QT_FOUND ${QT3_FOUND} )
-IF(QT_FOUND)
- SET( QT_LIBRARIES ${QT_LIBRARIES} ${QT_QT_LIBRARY} )
- SET( QT_DEFINITIONS "")
+if(QT_FOUND)
+ set( QT_LIBRARIES ${QT_LIBRARIES} ${QT_QT_LIBRARY} )
+ set( QT_DEFINITIONS "")
- IF (WIN32 AND NOT CYGWIN)
- IF (QT_QTMAIN_LIBRARY)
+ if (WIN32 AND NOT CYGWIN)
+ if (QT_QTMAIN_LIBRARY)
# for version 3
- SET (QT_DEFINITIONS -DQT_DLL -DQT_THREAD_SUPPORT -DNO_DEBUG)
- SET (QT_LIBRARIES imm32.lib ${QT_QT_LIBRARY} ${QT_QTMAIN_LIBRARY} )
- SET (QT_LIBRARIES ${QT_LIBRARIES} winmm wsock32)
- ELSE (QT_QTMAIN_LIBRARY)
+ set (QT_DEFINITIONS -DQT_DLL -DQT_THREAD_SUPPORT -DNO_DEBUG)
+ set (QT_LIBRARIES imm32.lib ${QT_QT_LIBRARY} ${QT_QTMAIN_LIBRARY} )
+ set (QT_LIBRARIES ${QT_LIBRARIES} winmm wsock32)
+ else ()
# for version 2
- SET (QT_LIBRARIES imm32.lib ws2_32.lib ${QT_QT_LIBRARY} )
- ENDIF (QT_QTMAIN_LIBRARY)
- ELSE (WIN32 AND NOT CYGWIN)
- SET (QT_LIBRARIES ${QT_QT_LIBRARY} )
+ set (QT_LIBRARIES imm32.lib ws2_32.lib ${QT_QT_LIBRARY} )
+ endif ()
+ else ()
+ set (QT_LIBRARIES ${QT_QT_LIBRARY} )
- SET (QT_DEFINITIONS -DQT_SHARED -DQT_NO_DEBUG)
- IF(QT_QT_LIBRARY MATCHES "qt-mt")
- SET (QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_THREAD_SUPPORT -D_REENTRANT)
- ENDIF(QT_QT_LIBRARY MATCHES "qt-mt")
+ set (QT_DEFINITIONS -DQT_SHARED -DQT_NO_DEBUG)
+ if(QT_QT_LIBRARY MATCHES "qt-mt")
+ set (QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_THREAD_SUPPORT -D_REENTRANT)
+ endif()
- ENDIF (WIN32 AND NOT CYGWIN)
+ endif ()
- IF (QT_QASSISTANTCLIENT_LIBRARY)
- SET (QT_LIBRARIES ${QT_QASSISTANTCLIENT_LIBRARY} ${QT_LIBRARIES})
- ENDIF (QT_QASSISTANTCLIENT_LIBRARY)
+ if (QT_QASSISTANTCLIENT_LIBRARY)
+ set (QT_LIBRARIES ${QT_QASSISTANTCLIENT_LIBRARY} ${QT_LIBRARIES})
+ endif ()
# Backwards compatibility for CMake1.4 and 1.2
- SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
- SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
+ set (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
+ set (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
# for unix add X11 stuff
- IF(UNIX)
- FIND_PACKAGE(X11)
- IF (X11_FOUND)
- SET (QT_LIBRARIES ${QT_LIBRARIES} ${X11_LIBRARIES})
- ENDIF (X11_FOUND)
- IF (CMAKE_DL_LIBS)
- SET (QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_DL_LIBS})
- ENDIF (CMAKE_DL_LIBS)
- ENDIF(UNIX)
- IF(QT_QT_LIBRARY MATCHES "qt-mt")
- FIND_PACKAGE(Threads)
- SET(QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
- ENDIF(QT_QT_LIBRARY MATCHES "qt-mt")
-ENDIF(QT_FOUND)
+ if(UNIX)
+ find_package(X11)
+ if (X11_FOUND)
+ set (QT_LIBRARIES ${QT_LIBRARIES} ${X11_LIBRARIES})
+ endif ()
+ if (CMAKE_DL_LIBS)
+ set (QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_DL_LIBS})
+ endif ()
+ endif()
+ if(QT_QT_LIBRARY MATCHES "qt-mt")
+ find_package(Threads)
+ set(QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+ endif()
+endif()
-IF(QT_MOC_EXECUTABLE)
- EXECUTE_PROCESS(COMMAND ${QT_MOC_EXECUTABLE} "-v"
+if(QT_MOC_EXECUTABLE)
+ execute_process(COMMAND ${QT_MOC_EXECUTABLE} "-v"
OUTPUT_VARIABLE QTVERSION_MOC
ERROR_QUIET)
-ENDIF(QT_MOC_EXECUTABLE)
-IF(QT_UIC_EXECUTABLE)
- EXECUTE_PROCESS(COMMAND ${QT_UIC_EXECUTABLE} "-version"
+endif()
+if(QT_UIC_EXECUTABLE)
+ execute_process(COMMAND ${QT_UIC_EXECUTABLE} "-version"
OUTPUT_VARIABLE QTVERSION_UIC
ERROR_QUIET)
-ENDIF(QT_UIC_EXECUTABLE)
+endif()
-SET(_QT_UIC_VERSION_3 FALSE)
-IF("${QTVERSION_UIC}" MATCHES ".* 3..*")
- SET(_QT_UIC_VERSION_3 TRUE)
-ENDIF("${QTVERSION_UIC}" MATCHES ".* 3..*")
+set(_QT_UIC_VERSION_3 FALSE)
+if("${QTVERSION_UIC}" MATCHES ".* 3..*")
+ set(_QT_UIC_VERSION_3 TRUE)
+endif()
-SET(_QT_MOC_VERSION_3 FALSE)
-IF("${QTVERSION_MOC}" MATCHES ".* 3..*")
- SET(_QT_MOC_VERSION_3 TRUE)
-ENDIF("${QTVERSION_MOC}" MATCHES ".* 3..*")
+set(_QT_MOC_VERSION_3 FALSE)
+if("${QTVERSION_MOC}" MATCHES ".* 3..*")
+ set(_QT_MOC_VERSION_3 TRUE)
+endif()
-SET(QT_WRAP_CPP FALSE)
-IF (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3)
- SET ( QT_WRAP_CPP TRUE)
-ENDIF (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3)
+set(QT_WRAP_CPP FALSE)
+if (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3)
+ set ( QT_WRAP_CPP TRUE)
+endif ()
-SET(QT_WRAP_UI FALSE)
-IF (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3)
- SET ( QT_WRAP_UI TRUE)
-ENDIF (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3)
+set(QT_WRAP_UI FALSE)
+if (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3)
+ set ( QT_WRAP_UI TRUE)
+endif ()
-MARK_AS_ADVANCED(
+mark_as_advanced(
QT_INCLUDE_DIR
QT_QT_LIBRARY
QT_QTMAIN_LIBRARY
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 2f1708d70..a84074b53 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -1,9 +1,9 @@
-# - Find QT 4
+# - Find Qt 4
# This module can be used to find Qt4.
# The most important issue is that the Qt4 qmake is available via the system path.
# This qmake is then used to detect basically everything else.
-# This module defines a number of key variables and macros.
-# The variable QT_USE_FILE is set which is the path to a CMake file that can be included
+# This module defines a number of key variables and macros.
+# The variable QT_USE_FILE is set which is the path to a CMake file that can be included
# to compile Qt 4 applications and libraries. It sets up the compilation
# environment for include directories, preprocessor defines and populates a
# QT_LIBRARIES variable.
@@ -15,10 +15,10 @@
# target_link_libraries(myexe ${QT_LIBRARIES})
#
# The minimum required version can be specified using the standard find_package()-syntax
-# (see example above).
+# (see example above).
# For compatibility with older versions of FindQt4.cmake it is also possible to
-# set the variable QT_MIN_VERSION to the minimum required version of Qt4 before the
-# find_package(Qt4) command.
+# set the variable QT_MIN_VERSION to the minimum required version of Qt4 before the
+# find_package(Qt4) command.
# If both are used, the version used in the find_package() command overrides the
# one from QT_MIN_VERSION.
#
@@ -53,26 +53,26 @@
# QT_USE_QTSCRIPTTOOLS
# QT_USE_QTDECLARATIVE
#
-# QT_USE_IMPORTED_TARGETS
+# QT_USE_IMPORTED_TARGETS
# If this variable is set to TRUE, FindQt4.cmake will create imported
-# library targets for the various Qt libraries and set the
+# library targets for the various Qt libraries and set the
# library variables like QT_QTCORE_LIBRARY to point at these imported
-# targets instead of the library file on disk. This provides much better
-# handling of the release and debug versions of the Qt libraries and is
+# targets instead of the library file on disk. This provides much better
+# handling of the release and debug versions of the Qt libraries and is
# also always backwards compatible, except for the case that dependencies
-# of libraries are exported, these will then also list the names of the
+# of libraries are exported, these will then also list the names of the
# imported targets as dependency and not the file location on disk. This
# is much more flexible, but requires that FindQt4.cmake is executed before
# such an exported dependency file is processed.
#
# There are also some files that need processing by some Qt tools such as moc
# and uic. Listed below are macros that may be used to process those files.
-#
+#
# macro QT4_WRAP_CPP(outfiles inputfile ... OPTIONS ...)
# create moc code from a list of files containing Qt class with
-# the Q_OBJECT declaration. Per-direcotry preprocessor definitions
+# the Q_OBJECT declaration. Per-directory preprocessor definitions
# are also added. Options may be given to moc, such as those found
-# when executing "moc -help".
+# when executing "moc -help".
#
# macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
# create code from a list of Qt designer ui files.
@@ -92,13 +92,13 @@
# macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... )
# This macro is still experimental.
# It can be used to have moc automatically handled.
-# So if you have the files foo.h and foo.cpp, and in foo.h a
+# So if you have the files foo.h and foo.cpp, and in foo.h a
# a class uses the Q_OBJECT macro, moc has to run on it. If you don't
# want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert
# #include "foo.moc"
# in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will the
# scan all listed files at cmake-time for such included moc files and if it finds
-# them cause a rule to be generated to run moc at build time on the
+# them cause a rule to be generated to run moc at build time on the
# accompanying header file foo.h.
# If a source file has the SKIP_AUTOMOC property set it will be ignored by this macro.
#
@@ -106,7 +106,7 @@
#
# macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
# Create a the interface header and implementation files with the
-# given basename from the given interface xml file and add it to
+# given basename from the given interface xml file and add it to
# the list of sources.
#
# You can pass additional parameters to the qdbusxml2cpp call by setting
@@ -136,19 +136,19 @@
#
# macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] OPTIONS ...)
# generate the xml interface file from the given header.
-# If the optional argument interfacename is omitted, the name of the
+# If the optional argument interfacename is omitted, the name of the
# interface file is constructed from the basename of the header with
# the suffix .xml appended.
# Options may be given to qdbuscpp2xml, such as those found when executing "qdbuscpp2xml --help"
#
-# macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ...
+# macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ...
# ts_files ... OPTIONS ...)
# out: qm_files
# in: directories sources ts_files
# options: flags to pass to lupdate, such as -extensions to specify
# extensions for a directory scan.
# generates commands to create .ts (vie lupdate) and .qm
-# (via lrelease) - files from directories and/or sources. The ts files are
+# (via lrelease) - files from directories and/or sources. The ts files are
# created and/or updated in the source tree (unless given with full paths).
# The qm files are generated in the build tree.
# Updating the translations can be done by adding the qm_files
@@ -163,6 +163,17 @@
# filenames can be found in qm_files. The ts_files
# must exists and are not updated in any way.
#
+# function QT4_USE_MODULES( target [link_type] modules...)
+# Make <target> use the <modules> from Qt. Using a Qt module means
+# to link to the library, add the relevant include directories for the module,
+# and add the relevant compiler defines for using the module.
+# Modules are roughly equivalent to components of Qt4, so usage would be
+# something like:
+# qt4_use_modules(myexe Core Gui Declarative)
+# to use QtCore, QtGui and QtDeclarative. The optional <link_type> argument can
+# be specified as either LINK_PUBLIC or LINK_PRIVATE to specify the same argument
+# to the target_link_libraries call.
+#
#
# Below is a detailed list of variables that FindQt4.cmake sets.
# QT_FOUND If false, don't try to use Qt.
@@ -211,41 +222,41 @@
# The QT_USE_FILE will also define QT_DEBUG and QT_NO_DEBUG
# to fit your current build type. Those are not contained
# in QT_DEFINITIONS.
-#
-# QT_INCLUDES List of paths to all include directories of
+#
+# QT_INCLUDES List of paths to all include directories of
# Qt4 QT_INCLUDE_DIR and QT_QTCORE_INCLUDE_DIR are
# always in this variable even if NOTFOUND,
# all other INCLUDE_DIRS are
# only added if they are found.
# You do not need to use this if you include QT_USE_FILE.
-#
+#
#
# Include directories for the Qt modules are listed here.
# You do not need to use these variables if you include QT_USE_FILE.
#
# QT_INCLUDE_DIR Path to "include" of Qt4
-# QT_QT3SUPPORT_INCLUDE_DIR Path to "include/Qt3Support"
-# QT_QTASSISTANT_INCLUDE_DIR Path to "include/QtAssistant"
+# QT_QT3SUPPORT_INCLUDE_DIR Path to "include/Qt3Support"
+# QT_QTASSISTANT_INCLUDE_DIR Path to "include/QtAssistant"
# QT_QTASSISTANTCLIENT_INCLUDE_DIR Path to "include/QtAssistant"
# QT_QAXCONTAINER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only)
# QT_QAXSERVER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only)
-# QT_QTCORE_INCLUDE_DIR Path to "include/QtCore"
+# QT_QTCORE_INCLUDE_DIR Path to "include/QtCore"
# QT_QTDBUS_INCLUDE_DIR Path to "include/QtDBus"
-# QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner"
+# QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner"
# QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR Path to "include/QtDesigner"
-# QT_QTGUI_INCLUDE_DIR Path to "include/QtGui"
+# QT_QTGUI_INCLUDE_DIR Path to "include/QtGui"
# QT_QTHELP_INCLUDE_DIR Path to "include/QtHelp"
-# QT_QTMOTIF_INCLUDE_DIR Path to "include/QtMotif"
-# QT_QTMULTIMEDIA_INCLUDE_DIR Path to "include/QtMultimedia"
-# QT_QTNETWORK_INCLUDE_DIR Path to "include/QtNetwork"
-# QT_QTNSPLUGIN_INCLUDE_DIR Path to "include/QtNsPlugin"
-# QT_QTOPENGL_INCLUDE_DIR Path to "include/QtOpenGL"
+# QT_QTMOTIF_INCLUDE_DIR Path to "include/QtMotif"
+# QT_QTMULTIMEDIA_INCLUDE_DIR Path to "include/QtMultimedia"
+# QT_QTNETWORK_INCLUDE_DIR Path to "include/QtNetwork"
+# QT_QTNSPLUGIN_INCLUDE_DIR Path to "include/QtNsPlugin"
+# QT_QTOPENGL_INCLUDE_DIR Path to "include/QtOpenGL"
# QT_QTSCRIPT_INCLUDE_DIR Path to "include/QtScript"
-# QT_QTSQL_INCLUDE_DIR Path to "include/QtSql"
+# QT_QTSQL_INCLUDE_DIR Path to "include/QtSql"
# QT_QTSVG_INCLUDE_DIR Path to "include/QtSvg"
# QT_QTTEST_INCLUDE_DIR Path to "include/QtTest"
# QT_QTWEBKIT_INCLUDE_DIR Path to "include/QtWebKit"
-# QT_QTXML_INCLUDE_DIR Path to "include/QtXml"
+# QT_QTXML_INCLUDE_DIR Path to "include/QtXml"
# QT_QTXMLPATTERNS_INCLUDE_DIR Path to "include/QtXmlPatterns"
# QT_PHONON_INCLUDE_DIR Path to "include/phonon"
# QT_QTSCRIPTTOOLS_INCLUDE_DIR Path to "include/QtScriptTools"
@@ -292,7 +303,7 @@
# QT_QTMAIN_LIBRARY The qtmain library for Windows
# QT_PHONON_LIBRARY The phonon library
# QT_QTSCRIPTTOOLS_LIBRARY The QtScriptTools library
-#
+#
# The QtDeclarative library: QT_QTDECLARATIVE_LIBRARY
#
# also defined, but NOT for general use are
@@ -307,17 +318,17 @@
# QT_QCOLLECTIONGENERATOR_EXECUTABLE Where to find the qcollectiongenerator tool.
# QT_DESIGNER_EXECUTABLE Where to find the Qt designer tool.
# QT_LINGUIST_EXECUTABLE Where to find the Qt linguist tool.
-#
#
-# These are around for backwards compatibility
+#
+# These are around for backwards compatibility
# they will be set
# QT_WRAP_CPP Set true if QT_MOC_EXECUTABLE is found
# QT_WRAP_UI Set true if QT_UIC_EXECUTABLE is found
-#
+#
# These variables do _NOT_ have any effect anymore (compared to FindQt.cmake)
# QT_MT_REQUIRED Qt4 is now always multithreaded
-#
-# These variables are set to "" Because Qt structure changed
+#
+# These variables are set to "" Because Qt structure changed
# (They make no sense in Qt4)
# QT_QT_LIBRARY Qt-Library is now split
@@ -334,385 +345,385 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-# Use FIND_PACKAGE( Qt4 COMPONENTS ... ) to enable modules
-IF( Qt4_FIND_COMPONENTS )
- FOREACH( component ${Qt4_FIND_COMPONENTS} )
- STRING( TOUPPER ${component} _COMPONENT )
- SET( QT_USE_${_COMPONENT} 1 )
- ENDFOREACH( component )
-
+# Use find_package( Qt4 COMPONENTS ... ) to enable modules
+if( Qt4_FIND_COMPONENTS )
+ foreach( component ${Qt4_FIND_COMPONENTS} )
+ string( TOUPPER ${component} _COMPONENT )
+ set( QT_USE_${_COMPONENT} 1 )
+ endforeach()
+
# To make sure we don't use QtCore or QtGui when not in COMPONENTS
- IF(NOT QT_USE_QTCORE)
- SET( QT_DONT_USE_QTCORE 1 )
- ENDIF(NOT QT_USE_QTCORE)
-
- IF(NOT QT_USE_QTGUI)
- SET( QT_DONT_USE_QTGUI 1 )
- ENDIF(NOT QT_USE_QTGUI)
+ if(NOT QT_USE_QTCORE)
+ set( QT_DONT_USE_QTCORE 1 )
+ endif()
-ENDIF( Qt4_FIND_COMPONENTS )
+ if(NOT QT_USE_QTGUI)
+ set( QT_DONT_USE_QTGUI 1 )
+ endif()
+
+endif()
# If Qt3 has already been found, fail.
-IF(QT_QT_LIBRARY)
- IF(Qt4_FIND_REQUIRED)
- MESSAGE( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project. If switching to Qt4, the CMakeCache.txt needs to be cleaned.")
- ELSE(Qt4_FIND_REQUIRED)
- IF(NOT Qt4_FIND_QUIETLY)
- MESSAGE( STATUS "Qt3 and Qt4 cannot be used together in one project. If switching to Qt4, the CMakeCache.txt needs to be cleaned.")
- ENDIF(NOT Qt4_FIND_QUIETLY)
- RETURN()
- ENDIF(Qt4_FIND_REQUIRED)
-ENDIF(QT_QT_LIBRARY)
+if(QT_QT_LIBRARY)
+ if(Qt4_FIND_REQUIRED)
+ message( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project. If switching to Qt4, the CMakeCache.txt needs to be cleaned.")
+ else()
+ if(NOT Qt4_FIND_QUIETLY)
+ message( STATUS "Qt3 and Qt4 cannot be used together in one project. If switching to Qt4, the CMakeCache.txt needs to be cleaned.")
+ endif()
+ return()
+ endif()
+endif()
-INCLUDE(CheckCXXSymbolExists)
-INCLUDE(MacroAddFileDependencies)
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(CheckCXXSymbolExists)
+include(MacroAddFileDependencies)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
+set(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
-SET( QT_DEFINITIONS "")
+set( QT_DEFINITIONS "")
# convenience macro for dealing with debug/release library names
-MACRO (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
+macro (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
- STRING(TOUPPER "${_camelCaseBasename}" basename)
+ string(TOUPPER "${_camelCaseBasename}" basename)
# The name of the imported targets, i.e. the prefix "Qt4::" must not change,
# since it is stored in EXPORT-files as name of a required library. If the name would change
# here, this would lead to the imported Qt4-library targets not being resolved by cmake anymore.
- IF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+ if (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
- IF(NOT TARGET Qt4::${_camelCaseBasename})
- ADD_LIBRARY(Qt4::${_camelCaseBasename} UNKNOWN IMPORTED )
+ if(NOT TARGET Qt4::${_camelCaseBasename})
+ add_library(Qt4::${_camelCaseBasename} UNKNOWN IMPORTED )
- IF (QT_${basename}_LIBRARY_RELEASE)
- SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+ if (QT_${basename}_LIBRARY_RELEASE)
+ set_property(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
if(QT_USE_FRAMEWORKS)
- SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}/${_camelCaseBasename}" )
+ set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}/${_camelCaseBasename}" )
else()
- SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" )
+ set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" )
endif()
- ENDIF (QT_${basename}_LIBRARY_RELEASE)
+ endif ()
- IF (QT_${basename}_LIBRARY_DEBUG)
- SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+ if (QT_${basename}_LIBRARY_DEBUG)
+ set_property(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
if(QT_USE_FRAMEWORKS)
- SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}/${_camelCaseBasename}" )
+ set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}/${_camelCaseBasename}" )
else()
- SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" )
+ set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" )
endif()
- ENDIF (QT_${basename}_LIBRARY_DEBUG)
- ENDIF(NOT TARGET Qt4::${_camelCaseBasename})
+ endif ()
+ endif()
# If QT_USE_IMPORTED_TARGETS is enabled, the QT_QTFOO_LIBRARY variables are set to point at these
# imported targets. This works better in general, and is also in almost all cases fully
# backward compatible. The only issue is when a project A which had this enabled then exports its
- # libraries via export or EXPORT_LIBRARY_DEPENDENCIES(). In this case the libraries from project
+ # libraries via export or export_library_dependencies(). In this case the libraries from project
# A will depend on the imported Qt targets, and the names of these imported targets will be stored
# in the dependency files on disk. This means when a project B then uses project A, these imported
# targets must be created again, otherwise e.g. "Qt4__QtCore" will be interpreted as name of a
# library file on disk, and not as a target, and linking will fail:
- IF(QT_USE_IMPORTED_TARGETS)
- SET(QT_${basename}_LIBRARY Qt4::${_camelCaseBasename} )
- SET(QT_${basename}_LIBRARIES Qt4::${_camelCaseBasename} )
- ELSE(QT_USE_IMPORTED_TARGETS)
+ if(QT_USE_IMPORTED_TARGETS)
+ set(QT_${basename}_LIBRARY Qt4::${_camelCaseBasename} )
+ set(QT_${basename}_LIBRARIES Qt4::${_camelCaseBasename} )
+ else()
# if the release- as well as the debug-version of the library have been found:
- IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
+ if (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
# if the generator supports configuration types then set
# optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
- IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
- SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
- ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ set(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
+ else()
# if there are no configuration types and CMAKE_BUILD_TYPE has no value
# then just use the release libraries
- SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} )
- ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
- SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
- ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
+ set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} )
+ endif()
+ set(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
+ endif ()
# if only the release version was found, set the debug variable also to the release version
- IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
- SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE})
- SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE})
- SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE})
- ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
+ if (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
+ set(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE})
+ set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE})
+ set(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE})
+ endif ()
# if only the debug version was found, set the release variable also to the debug version
- IF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
- SET(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG})
- SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG})
- SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG})
- ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
+ if (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
+ set(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG})
+ set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG})
+ set(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG})
+ endif ()
# put the value in the cache:
- SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE)
+ set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE)
- ENDIF(QT_USE_IMPORTED_TARGETS)
+ endif()
- SET(QT_${basename}_FOUND 1)
+ set(QT_${basename}_FOUND 1)
- ELSE (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+ else ()
- SET(QT_${basename}_LIBRARY "" CACHE STRING "The Qt ${basename} library" FORCE)
+ set(QT_${basename}_LIBRARY "" CACHE STRING "The Qt ${basename} library" FORCE)
- ENDIF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+ endif ()
- IF (QT_${basename}_INCLUDE_DIR)
+ if (QT_${basename}_INCLUDE_DIR)
#add the include directory to QT_INCLUDES
- SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
- ENDIF (QT_${basename}_INCLUDE_DIR)
+ set(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
+ endif ()
# Make variables changeble to the advanced user
- MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
-ENDMACRO (_QT4_ADJUST_LIB_VARS)
+ mark_as_advanced(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
+endmacro ()
function(_QT4_QUERY_QMAKE VAR RESULT)
execute_process(COMMAND "${QT_QMAKE_EXECUTABLE}" -query ${VAR}
RESULT_VARIABLE return_code
- OUTPUT_VARIABLE output ERROR_VARIABLE output
+ OUTPUT_VARIABLE output
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE)
if(NOT return_code)
file(TO_CMAKE_PATH "${output}" output)
set(${RESULT} ${output} PARENT_SCOPE)
- endif(NOT return_code)
-endfunction(_QT4_QUERY_QMAKE)
+ endif()
+endfunction()
-SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
+set(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
-GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
+get_filename_component(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
# check for qmake
# Debian uses qmake-qt4
# macports' Qt uses qmake-mac
-FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin"
- $ENV{QTDIR}/bin
+find_program(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac
+ PATHS
+ ENV QTDIR
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]"
+ PATH_SUFFIXES bin
DOC "The qmake executable for the Qt installation to use"
)
# double check that it was a Qt4 qmake, if not, re-find with different names
-IF (QT_QMAKE_EXECUTABLE)
+if (QT_QMAKE_EXECUTABLE)
- IF(QT_QMAKE_EXECUTABLE_LAST)
- STRING(COMPARE NOTEQUAL "${QT_QMAKE_EXECUTABLE_LAST}" "${QT_QMAKE_EXECUTABLE}" QT_QMAKE_CHANGED)
- ENDIF(QT_QMAKE_EXECUTABLE_LAST)
+ if(QT_QMAKE_EXECUTABLE_LAST)
+ string(COMPARE NOTEQUAL "${QT_QMAKE_EXECUTABLE_LAST}" "${QT_QMAKE_EXECUTABLE}" QT_QMAKE_CHANGED)
+ endif()
- SET(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL "" FORCE)
+ set(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL "" FORCE)
_qt4_query_qmake(QT_VERSION QTVERSION)
# check for qt3 qmake and then try and find qmake4 or qmake-qt4 in the path
- IF(NOT QTVERSION)
- SET(QT_QMAKE_EXECUTABLE NOTFOUND CACHE FILEPATH "" FORCE)
- FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 PATHS
+ if(NOT QTVERSION)
+ set(QT_QMAKE_EXECUTABLE NOTFOUND CACHE FILEPATH "" FORCE)
+ find_program(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 PATHS
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
$ENV{QTDIR}/bin
DOC "The qmake executable for the Qt installation to use"
)
- IF(QT_QMAKE_EXECUTABLE)
+ if(QT_QMAKE_EXECUTABLE)
_qt4_query_qmake(QT_VERSION QTVERSION)
- ENDIF(QT_QMAKE_EXECUTABLE)
- ENDIF(NOT QTVERSION)
+ endif()
+ endif()
-ENDIF (QT_QMAKE_EXECUTABLE)
+endif ()
-IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
+if (QT_QMAKE_EXECUTABLE AND QTVERSION)
# ask qmake for the mkspecs directory
# we do this first because QT_LIBINFIX might be set
- IF (NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED)
+ if (NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED)
_qt4_query_qmake(QMAKE_MKSPECS qt_mkspecs_dirs)
# do not replace : on windows as it might be a drive letter
# and windows should already use ; as a separator
- IF(NOT WIN32)
- STRING(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}")
- ENDIF(NOT WIN32)
+ if(NOT WIN32)
+ string(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}")
+ endif()
set(qt_cross_paths)
foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/mkspecs")
- endforeach(qt_cross_path)
- SET(QT_MKSPECS_DIR NOTFOUND)
- FIND_PATH(QT_MKSPECS_DIR NAMES qconfig.pri
+ endforeach()
+ set(QT_MKSPECS_DIR NOTFOUND)
+ find_path(QT_MKSPECS_DIR NAMES qconfig.pri
HINTS ${qt_cross_paths} ${qt_mkspecs_dirs}
DOC "The location of the Qt mkspecs containing qconfig.pri")
- ENDIF()
-
- IF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
- FILE(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents)
- STRING(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG "${_qconfig_FILE_contents}")
- STRING(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG "${_qconfig_FILE_contents}")
- STRING(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}")
- STRING(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}")
- STRING(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}")
- ENDIF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
- IF("${QT_EDITION}" MATCHES "DesktopLight")
- SET(QT_EDITION_DESKTOPLIGHT 1)
- ENDIF("${QT_EDITION}" MATCHES "DesktopLight")
+ endif()
+
+ if(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
+ file(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents)
+ string(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG "${_qconfig_FILE_contents}")
+ string(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG "${_qconfig_FILE_contents}")
+ string(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}")
+ string(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}")
+ string(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}")
+ endif()
+ if("${QT_EDITION}" MATCHES "DesktopLight")
+ set(QT_EDITION_DESKTOPLIGHT 1)
+ endif()
# ask qmake for the library dir as a hint, then search for QtCore library and use that as a reference for finding the
# others and for setting QT_LIBRARY_DIR
- IF (NOT (QT_QTCORE_LIBRARY_RELEASE OR QT_QTCORE_LIBRARY_DEBUG) OR QT_QMAKE_CHANGED)
+ if (NOT (QT_QTCORE_LIBRARY_RELEASE OR QT_QTCORE_LIBRARY_DEBUG) OR QT_QMAKE_CHANGED)
_qt4_query_qmake(QT_INSTALL_LIBS QT_LIBRARY_DIR_TMP)
- SET(QT_QTCORE_LIBRARY_RELEASE NOTFOUND)
- SET(QT_QTCORE_LIBRARY_DEBUG NOTFOUND)
- FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE
+ set(QT_QTCORE_LIBRARY_RELEASE NOTFOUND)
+ set(QT_QTCORE_LIBRARY_DEBUG NOTFOUND)
+ find_library(QT_QTCORE_LIBRARY_RELEASE
NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4
HINTS ${QT_LIBRARY_DIR_TMP}
NO_DEFAULT_PATH
)
- FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG
+ find_library(QT_QTCORE_LIBRARY_DEBUG
NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4
HINTS ${QT_LIBRARY_DIR_TMP}
NO_DEFAULT_PATH
)
- IF(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG)
- FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE
+ if(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG)
+ find_library(QT_QTCORE_LIBRARY_RELEASE
NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4
HINTS ${QT_LIBRARY_DIR_TMP}
)
- FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG
+ find_library(QT_QTCORE_LIBRARY_DEBUG
NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4
HINTS ${QT_LIBRARY_DIR_TMP}
)
- ENDIF(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG)
+ endif()
# try dropping a hint if trying to use Visual Studio with Qt built by mingw
- IF(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
- IF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
- MESSAGE( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by mingw. Those compilers do not produce code compatible with each other.")
- ENDIF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
- ENDIF(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
+ if(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
+ if(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
+ message( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by mingw. Those compilers do not produce code compatible with each other.")
+ endif()
+ endif()
- ENDIF ()
+ endif ()
# set QT_LIBRARY_DIR based on location of QtCore found.
- IF(QT_QTCORE_LIBRARY_RELEASE)
- GET_FILENAME_COMPONENT(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_RELEASE}" PATH)
- SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
- SET(QT_QTCORE_FOUND 1)
- ELSEIF(QT_QTCORE_LIBRARY_DEBUG)
- GET_FILENAME_COMPONENT(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_DEBUG}" PATH)
- SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
- SET(QT_QTCORE_FOUND 1)
- ELSE()
- MESSAGE(WARNING "${QT_QMAKE_EXECUTABLE} reported QT_INSTALL_LIBS as \"${QT_LIBRARY_DIR_TMP}\" "
+ if(QT_QTCORE_LIBRARY_RELEASE)
+ get_filename_component(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_RELEASE}" PATH)
+ set(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
+ set(QT_QTCORE_FOUND 1)
+ elseif(QT_QTCORE_LIBRARY_DEBUG)
+ get_filename_component(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_DEBUG}" PATH)
+ set(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
+ set(QT_QTCORE_FOUND 1)
+ else()
+ message(WARNING "${QT_QMAKE_EXECUTABLE} reported QT_INSTALL_LIBS as \"${QT_LIBRARY_DIR_TMP}\" "
"but QtCore could not be found there. "
"Qt is NOT installed correctly for the target build environment.")
- IF(Qt4_FIND_REQUIRED)
- MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
- ENDIF(Qt4_FIND_REQUIRED)
- ENDIF()
+ if(Qt4_FIND_REQUIRED)
+ message( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
+ endif()
+ endif()
# ask qmake for the binary dir
- IF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
+ if (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
_qt4_query_qmake(QT_INSTALL_BINS qt_bins)
- SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE)
- ENDIF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
-
- IF (APPLE)
- SET(CMAKE_FIND_FRAMEWORK_OLD ${CMAKE_FIND_FRAMEWORK})
- IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
- SET(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE)
- SET(CMAKE_FIND_FRAMEWORK FIRST)
- ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
- SET(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE)
- SET(CMAKE_FIND_FRAMEWORK LAST)
- ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
- ENDIF (APPLE)
+ set(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE)
+ endif ()
+
+ if (APPLE)
+ set(CMAKE_FIND_FRAMEWORK_OLD ${CMAKE_FIND_FRAMEWORK})
+ if (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
+ set(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE)
+ set(CMAKE_FIND_FRAMEWORK FIRST)
+ else ()
+ set(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE)
+ set(CMAKE_FIND_FRAMEWORK LAST)
+ endif ()
+ endif ()
# ask qmake for the include dir
- IF (QT_LIBRARY_DIR AND (NOT QT_QTCORE_INCLUDE_DIR OR NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED))
+ if (QT_LIBRARY_DIR AND (NOT QT_QTCORE_INCLUDE_DIR OR NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED))
_qt4_query_qmake(QT_INSTALL_HEADERS qt_headers)
- SET(QT_QTCORE_INCLUDE_DIR NOTFOUND)
- FIND_PATH(QT_QTCORE_INCLUDE_DIR QtCore
+ set(QT_QTCORE_INCLUDE_DIR NOTFOUND)
+ find_path(QT_QTCORE_INCLUDE_DIR QtCore
HINTS ${qt_headers} ${QT_LIBRARY_DIR}
PATH_SUFFIXES QtCore qt4/QtCore
)
# Set QT_HEADERS_DIR based on finding QtCore header
- IF(QT_QTCORE_INCLUDE_DIR)
- IF(QT_USE_FRAMEWORKS)
- SET(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
- ELSE(QT_USE_FRAMEWORKS)
- GET_FILENAME_COMPONENT(qt_headers "${QT_QTCORE_INCLUDE_DIR}/../" ABSOLUTE)
- SET(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
- ENDIF(QT_USE_FRAMEWORKS)
- ELSEIF()
- MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_HEADERS as ${qt_headers}")
- MESSAGE("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly.")
- ENDIF()
- ENDIF()
-
- IF(APPLE)
- SET(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_OLD})
- ENDIF(APPLE)
+ if(QT_QTCORE_INCLUDE_DIR)
+ if(QT_USE_FRAMEWORKS)
+ set(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
+ else()
+ get_filename_component(qt_headers "${QT_QTCORE_INCLUDE_DIR}/../" ABSOLUTE)
+ set(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
+ endif()
+ elseif()
+ message("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_HEADERS as ${qt_headers}")
+ message("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly.")
+ endif()
+ endif()
+
+ if(APPLE)
+ set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_OLD})
+ endif()
# Set QT_INCLUDE_DIR based on QT_HEADERS_DIR
- IF(QT_HEADERS_DIR)
- IF(QT_USE_FRAMEWORKS)
+ if(QT_HEADERS_DIR)
+ if(QT_USE_FRAMEWORKS)
# Qt/Mac frameworks has two include dirs.
# One is the framework include for which CMake will add a -F flag
# and the other is an include dir for non-framework Qt modules
- SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR} ${QT_QTCORE_LIBRARY_RELEASE} )
- ELSE(QT_USE_FRAMEWORKS)
- SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
- ENDIF(QT_USE_FRAMEWORKS)
- ENDIF(QT_HEADERS_DIR)
+ set(QT_INCLUDE_DIR ${QT_HEADERS_DIR} ${QT_QTCORE_LIBRARY_RELEASE} )
+ else()
+ set(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
+ endif()
+ endif()
# Set QT_INCLUDES
- SET( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
+ set( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
# ask qmake for the documentation directory
- IF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED)
+ if (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED)
_qt4_query_qmake(QT_INSTALL_DOCS qt_doc_dir)
- SET(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs" FORCE)
- ENDIF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED)
+ set(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs" FORCE)
+ endif ()
# ask qmake for the plugins directory
- IF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED)
+ if (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED)
_qt4_query_qmake(QT_INSTALL_PLUGINS qt_plugins_dir)
- SET(QT_PLUGINS_DIR NOTFOUND)
+ set(QT_PLUGINS_DIR NOTFOUND)
foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/plugins")
- endforeach(qt_cross_path)
- FIND_PATH(QT_PLUGINS_DIR NAMES accessible imageformats sqldrivers codecs designer
+ endforeach()
+ find_path(QT_PLUGINS_DIR NAMES accessible imageformats sqldrivers codecs designer
HINTS ${qt_cross_paths} ${qt_plugins_dir}
DOC "The location of the Qt plugins")
- ENDIF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED)
+ endif ()
# ask qmake for the translations directory
- IF (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED)
+ if (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED)
_qt4_query_qmake(QT_INSTALL_TRANSLATIONS qt_translations_dir)
- SET(QT_TRANSLATIONS_DIR ${qt_translations_dir} CACHE PATH "The location of the Qt translations" FORCE)
- ENDIF (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED)
+ set(QT_TRANSLATIONS_DIR ${qt_translations_dir} CACHE PATH "The location of the Qt translations" FORCE)
+ endif ()
# ask qmake for the imports directory
- IF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED)
+ if (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED)
_qt4_query_qmake(QT_INSTALL_IMPORTS qt_imports_dir)
if(qt_imports_dir)
- SET(QT_IMPORTS_DIR NOTFOUND)
+ set(QT_IMPORTS_DIR NOTFOUND)
foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/imports")
- endforeach(qt_cross_path)
- FIND_PATH(QT_IMPORTS_DIR NAMES Qt
+ endforeach()
+ find_path(QT_IMPORTS_DIR NAMES Qt
HINTS ${qt_cross_paths} ${qt_imports_dir}
DOC "The location of the Qt imports"
NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH)
mark_as_advanced(QT_IMPORTS_DIR)
- endif(qt_imports_dir)
- ENDIF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED)
+ endif()
+ endif ()
# Make variables changeble to the advanced user
- MARK_AS_ADVANCED( QT_LIBRARY_DIR QT_DOC_DIR QT_MKSPECS_DIR
+ mark_as_advanced( QT_LIBRARY_DIR QT_DOC_DIR QT_MKSPECS_DIR
QT_PLUGINS_DIR QT_TRANSLATIONS_DIR)
@@ -724,32 +735,32 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
#
#############################################
# Save required variable
- SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
- SET(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
+ set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
+ set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
# Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
- SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
+ set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
# Check for Window system symbols (note: only one should end up being set)
CHECK_CXX_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
CHECK_CXX_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
CHECK_CXX_SYMBOL_EXISTS(Q_WS_QWS "QtCore/qglobal.h" Q_WS_QWS)
CHECK_CXX_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC)
- IF(Q_WS_MAC)
- IF(QT_QMAKE_CHANGED)
- UNSET(QT_MAC_USE_COCOA CACHE)
- ENDIF(QT_QMAKE_CHANGED)
+ if(Q_WS_MAC)
+ if(QT_QMAKE_CHANGED)
+ unset(QT_MAC_USE_COCOA CACHE)
+ endif()
CHECK_CXX_SYMBOL_EXISTS(QT_MAC_USE_COCOA "QtCore/qconfig.h" QT_MAC_USE_COCOA)
- ENDIF(Q_WS_MAC)
+ endif()
- IF (QT_QTCOPY_REQUIRED)
+ if (QT_QTCOPY_REQUIRED)
CHECK_CXX_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY)
- IF (NOT QT_IS_QTCOPY)
- MESSAGE(FATAL_ERROR "qt-copy is required, but hasn't been found")
- ENDIF (NOT QT_IS_QTCOPY)
- ENDIF (QT_QTCOPY_REQUIRED)
+ if (NOT QT_IS_QTCOPY)
+ message(FATAL_ERROR "qt-copy is required, but hasn't been found")
+ endif ()
+ endif ()
# Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables
- SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
- SET(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
+ set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
+ set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
#
#############################################
@@ -761,48 +772,48 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
#
########################################
- SET(QT_MODULES QtGui Qt3Support QtSvg QtScript QtTest QtUiTools
+ set(QT_MODULES QtGui Qt3Support QtSvg QtScript QtTest QtUiTools
QtHelp QtWebKit QtXmlPatterns phonon QtNetwork QtMultimedia
QtNsPlugin QtOpenGL QtSql QtXml QtDesigner QtDBus QtScriptTools
QtDeclarative)
-
- IF(Q_WS_X11)
- SET(QT_MODULES ${QT_MODULES} QtMotif)
- ENDIF(Q_WS_X11)
-
- IF(QT_QMAKE_CHANGED)
- FOREACH(QT_MODULE ${QT_MODULES})
- STRING(TOUPPER ${QT_MODULE} _upper_qt_module)
- SET(QT_${_upper_qt_module}_INCLUDE_DIR NOTFOUND)
- SET(QT_${_upper_qt_module}_LIBRARY_RELEASE NOTFOUND)
- SET(QT_${_upper_qt_module}_LIBRARY_DEBUG NOTFOUND)
- ENDFOREACH(QT_MODULE)
- SET(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR NOTFOUND)
- SET(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NOTFOUND)
- SET(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NOTFOUND)
- SET(QT_QTASSISTANTCLIENT_INCLUDE_DIR NOTFOUND)
- SET(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NOTFOUND)
- SET(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NOTFOUND)
- SET(QT_QTASSISTANT_INCLUDE_DIR NOTFOUND)
- SET(QT_QTASSISTANT_LIBRARY_RELEASE NOTFOUND)
- SET(QT_QTASSISTANT_LIBRARY_DEBUG NOTFOUND)
- SET(QT_QTCLUCENE_LIBRARY_RELEASE NOTFOUND)
- SET(QT_QTCLUCENE_LIBRARY_DEBUG NOTFOUND)
- SET(QT_QAXCONTAINER_INCLUDE_DIR NOTFOUND)
- SET(QT_QAXCONTAINER_LIBRARY_RELEASE NOTFOUND)
- SET(QT_QAXCONTAINER_LIBRARY_DEBUG NOTFOUND)
- SET(QT_QAXSERVER_INCLUDE_DIR NOTFOUND)
- SET(QT_QAXSERVER_LIBRARY_RELEASE NOTFOUND)
- SET(QT_QAXSERVER_LIBRARY_DEBUG NOTFOUND)
- IF(Q_WS_WIN)
- SET(QT_QTMAIN_LIBRARY_DEBUG NOTFOUND)
- SET(QT_QTMAIN_LIBRARY_RELEASE NOTFOUND)
- ENDIF(Q_WS_WIN)
- ENDIF(QT_QMAKE_CHANGED)
-
- FOREACH(QT_MODULE ${QT_MODULES})
- STRING(TOUPPER ${QT_MODULE} _upper_qt_module)
- FIND_PATH(QT_${_upper_qt_module}_INCLUDE_DIR ${QT_MODULE}
+
+ if(Q_WS_X11)
+ set(QT_MODULES ${QT_MODULES} QtMotif)
+ endif()
+
+ if(QT_QMAKE_CHANGED)
+ foreach(QT_MODULE ${QT_MODULES})
+ string(TOUPPER ${QT_MODULE} _upper_qt_module)
+ set(QT_${_upper_qt_module}_INCLUDE_DIR NOTFOUND)
+ set(QT_${_upper_qt_module}_LIBRARY_RELEASE NOTFOUND)
+ set(QT_${_upper_qt_module}_LIBRARY_DEBUG NOTFOUND)
+ endforeach()
+ set(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR NOTFOUND)
+ set(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NOTFOUND)
+ set(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NOTFOUND)
+ set(QT_QTASSISTANTCLIENT_INCLUDE_DIR NOTFOUND)
+ set(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NOTFOUND)
+ set(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NOTFOUND)
+ set(QT_QTASSISTANT_INCLUDE_DIR NOTFOUND)
+ set(QT_QTASSISTANT_LIBRARY_RELEASE NOTFOUND)
+ set(QT_QTASSISTANT_LIBRARY_DEBUG NOTFOUND)
+ set(QT_QTCLUCENE_LIBRARY_RELEASE NOTFOUND)
+ set(QT_QTCLUCENE_LIBRARY_DEBUG NOTFOUND)
+ set(QT_QAXCONTAINER_INCLUDE_DIR NOTFOUND)
+ set(QT_QAXCONTAINER_LIBRARY_RELEASE NOTFOUND)
+ set(QT_QAXCONTAINER_LIBRARY_DEBUG NOTFOUND)
+ set(QT_QAXSERVER_INCLUDE_DIR NOTFOUND)
+ set(QT_QAXSERVER_LIBRARY_RELEASE NOTFOUND)
+ set(QT_QAXSERVER_LIBRARY_DEBUG NOTFOUND)
+ if(Q_WS_WIN)
+ set(QT_QTMAIN_LIBRARY_DEBUG NOTFOUND)
+ set(QT_QTMAIN_LIBRARY_RELEASE NOTFOUND)
+ endif()
+ endif()
+
+ foreach(QT_MODULE ${QT_MODULES})
+ string(TOUPPER ${QT_MODULE} _upper_qt_module)
+ find_path(QT_${_upper_qt_module}_INCLUDE_DIR ${QT_MODULE}
PATHS
${QT_HEADERS_DIR}/${QT_MODULE}
${QT_LIBRARY_DIR}/${QT_MODULE}.framework/Headers
@@ -810,47 +821,47 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
)
# phonon doesn't seem consistent, let's try phonondefs.h for some
# installations
- IF(${QT_MODULE} STREQUAL "phonon")
- FIND_PATH(QT_${_upper_qt_module}_INCLUDE_DIR phonondefs.h
+ if(${QT_MODULE} STREQUAL "phonon")
+ find_path(QT_${_upper_qt_module}_INCLUDE_DIR phonondefs.h
PATHS
${QT_HEADERS_DIR}/${QT_MODULE}
${QT_LIBRARY_DIR}/${QT_MODULE}.framework/Headers
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- ENDIF(${QT_MODULE} STREQUAL "phonon")
- ENDFOREACH(QT_MODULE)
+ endif()
+ endforeach()
- IF(Q_WS_WIN)
- SET(QT_MODULES ${QT_MODULES} QAxContainer QAxServer)
+ if(Q_WS_WIN)
+ set(QT_MODULES ${QT_MODULES} QAxContainer QAxServer)
# Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR
- FIND_PATH(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
+ find_path(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
PATHS ${QT_HEADERS_DIR}/ActiveQt
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- FIND_PATH(QT_QAXSERVER_INCLUDE_DIR ActiveQt
+ find_path(QT_QAXSERVER_INCLUDE_DIR ActiveQt
PATHS ${QT_HEADERS_DIR}/ActiveQt
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- ENDIF(Q_WS_WIN)
+ endif()
# Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR
- FIND_PATH(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents
+ find_path(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents
PATHS
${QT_HEADERS_DIR}/QtDesigner
${QT_LIBRARY_DIR}/QtDesigner.framework/Headers
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
-
+
# Set QT_QTASSISTANT_INCLUDE_DIR
- FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QtAssistant
+ find_path(QT_QTASSISTANT_INCLUDE_DIR QtAssistant
PATHS
${QT_HEADERS_DIR}/QtAssistant
${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
-
+
# Set QT_QTASSISTANTCLIENT_INCLUDE_DIR
- FIND_PATH(QT_QTASSISTANTCLIENT_INCLUDE_DIR QAssistantClient
+ find_path(QT_QTASSISTANTCLIENT_INCLUDE_DIR QAssistantClient
PATHS
${QT_HEADERS_DIR}/QtAssistant
${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
@@ -864,48 +875,60 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
########################################
# find the libraries
- FOREACH(QT_MODULE ${QT_MODULES})
- STRING(TOUPPER ${QT_MODULE} _upper_qt_module)
- FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_RELEASE
+ foreach(QT_MODULE ${QT_MODULES})
+ string(TOUPPER ${QT_MODULE} _upper_qt_module)
+ find_library(QT_${_upper_qt_module}_LIBRARY_RELEASE
NAMES ${QT_MODULE}${QT_LIBINFIX} ${QT_MODULE}${QT_LIBINFIX}4
PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_DEBUG
+ find_library(QT_${_upper_qt_module}_LIBRARY_DEBUG
NAMES ${QT_MODULE}${QT_LIBINFIX}_debug ${QT_MODULE}${QT_LIBINFIX}d ${QT_MODULE}${QT_LIBINFIX}d4
PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- ENDFOREACH(QT_MODULE)
+ if(QT_${_upper_qt_module}_LIBRARY_RELEASE MATCHES "/${QT_MODULE}\\.framework$")
+ if(NOT EXISTS "${QT_${_upper_qt_module}_LIBRARY_RELEASE}/${QT_MODULE}")
+ # Release framework library file does not exist... Force to NOTFOUND:
+ set(QT_${_upper_qt_module}_LIBRARY_RELEASE "QT_${_upper_qt_module}_LIBRARY_RELEASE-NOTFOUND" CACHE FILEPATH "Path to a library." FORCE)
+ endif()
+ endif()
+ if(QT_${_upper_qt_module}_LIBRARY_DEBUG MATCHES "/${QT_MODULE}\\.framework$")
+ if(NOT EXISTS "${QT_${_upper_qt_module}_LIBRARY_DEBUG}/${QT_MODULE}")
+ # Debug framework library file does not exist... Force to NOTFOUND:
+ set(QT_${_upper_qt_module}_LIBRARY_DEBUG "QT_${_upper_qt_module}_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "Path to a library." FORCE)
+ endif()
+ endif()
+ endforeach()
# QtUiTools is sometimes not in the same directory as the other found libraries
# e.g. on Mac, its never a framework like the others are
- IF(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
- FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
- ENDIF(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
+ if(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
+ find_library(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
+ endif()
# Set QT_QTDESIGNERCOMPONENTS_LIBRARY
- FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
- FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponents${QT_LIBINFIX}_debug QtDesignerComponents${QT_LIBINFIX}d QtDesignerComponents${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ find_library(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ find_library(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponents${QT_LIBINFIX}_debug QtDesignerComponents${QT_LIBINFIX}d QtDesignerComponents${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
# Set QT_QTMAIN_LIBRARY
- IF(Q_WS_WIN)
- FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
- FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
- ENDIF(Q_WS_WIN)
-
+ if(Q_WS_WIN)
+ find_library(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ find_library(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ endif()
+
# Set QT_QTASSISTANTCLIENT_LIBRARY
- FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
- FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-
+ find_library(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ find_library(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+
# Set QT_QTASSISTANT_LIBRARY
- FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
- FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 QtAssistant${QT_LIBINFIX}_debug QtAssistant${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ find_library(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ find_library(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 QtAssistant${QT_LIBINFIX}_debug QtAssistant${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
# Set QT_QTHELP_LIBRARY
- FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} QtCLucene${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
- FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_DEBUG NAMES QtCLucene${QT_LIBINFIX}_debug QtCLucene${QT_LIBINFIX}d QtCLucene${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
- IF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
- FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
- ENDIF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
+ find_library(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} QtCLucene${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ find_library(QT_QTCLUCENE_LIBRARY_DEBUG NAMES QtCLucene${QT_LIBINFIX}_debug QtCLucene${QT_LIBINFIX}d QtCLucene${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ if(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
+ find_library(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
+ endif()
############################################
@@ -915,13 +938,13 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
############################################
- # Set QT_xyz_LIBRARY variable and add
+ # Set QT_xyz_LIBRARY variable and add
# library include path to QT_INCLUDES
_QT4_ADJUST_LIB_VARS(QtCore)
- FOREACH(QT_MODULE ${QT_MODULES})
+ foreach(QT_MODULE ${QT_MODULES})
_QT4_ADJUST_LIB_VARS(${QT_MODULE})
- ENDFOREACH(QT_MODULE)
+ endforeach()
_QT4_ADJUST_LIB_VARS(QtAssistant)
_QT4_ADJUST_LIB_VARS(QtAssistantClient)
@@ -929,128 +952,128 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
_QT4_ADJUST_LIB_VARS(QtDesignerComponents)
# platform dependent libraries
- IF(Q_WS_WIN)
+ if(Q_WS_WIN)
_QT4_ADJUST_LIB_VARS(qtmain)
_QT4_ADJUST_LIB_VARS(QAxServer)
_QT4_ADJUST_LIB_VARS(QAxContainer)
- ENDIF(Q_WS_WIN)
+ endif()
#######################################
#
- # Check the executables of Qt
+ # Check the executables of Qt
# ( moc, uic, rcc )
#
#######################################
- IF(QT_QMAKE_CHANGED)
- SET(QT_UIC_EXECUTABLE NOTFOUND)
- SET(QT_MOC_EXECUTABLE NOTFOUND)
- SET(QT_UIC3_EXECUTABLE NOTFOUND)
- SET(QT_RCC_EXECUTABLE NOTFOUND)
- SET(QT_DBUSCPP2XML_EXECUTABLE NOTFOUND)
- SET(QT_DBUSXML2CPP_EXECUTABLE NOTFOUND)
- SET(QT_LUPDATE_EXECUTABLE NOTFOUND)
- SET(QT_LRELEASE_EXECUTABLE NOTFOUND)
- SET(QT_QCOLLECTIONGENERATOR_EXECUTABLE NOTFOUND)
- SET(QT_DESIGNER_EXECUTABLE NOTFOUND)
- SET(QT_LINGUIST_EXECUTABLE NOTFOUND)
- ENDIF(QT_QMAKE_CHANGED)
-
- FIND_PROGRAM(QT_MOC_EXECUTABLE
+ if(QT_QMAKE_CHANGED)
+ set(QT_UIC_EXECUTABLE NOTFOUND)
+ set(QT_MOC_EXECUTABLE NOTFOUND)
+ set(QT_UIC3_EXECUTABLE NOTFOUND)
+ set(QT_RCC_EXECUTABLE NOTFOUND)
+ set(QT_DBUSCPP2XML_EXECUTABLE NOTFOUND)
+ set(QT_DBUSXML2CPP_EXECUTABLE NOTFOUND)
+ set(QT_LUPDATE_EXECUTABLE NOTFOUND)
+ set(QT_LRELEASE_EXECUTABLE NOTFOUND)
+ set(QT_QCOLLECTIONGENERATOR_EXECUTABLE NOTFOUND)
+ set(QT_DESIGNER_EXECUTABLE NOTFOUND)
+ set(QT_LINGUIST_EXECUTABLE NOTFOUND)
+ endif()
+
+ find_program(QT_MOC_EXECUTABLE
NAMES moc-qt4 moc
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- FIND_PROGRAM(QT_UIC_EXECUTABLE
+ find_program(QT_UIC_EXECUTABLE
NAMES uic-qt4 uic
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- FIND_PROGRAM(QT_UIC3_EXECUTABLE
+ find_program(QT_UIC3_EXECUTABLE
NAMES uic3
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- FIND_PROGRAM(QT_RCC_EXECUTABLE
+ find_program(QT_RCC_EXECUTABLE
NAMES rcc
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- FIND_PROGRAM(QT_DBUSCPP2XML_EXECUTABLE
+ find_program(QT_DBUSCPP2XML_EXECUTABLE
NAMES qdbuscpp2xml
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- FIND_PROGRAM(QT_DBUSXML2CPP_EXECUTABLE
+ find_program(QT_DBUSXML2CPP_EXECUTABLE
NAMES qdbusxml2cpp
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- FIND_PROGRAM(QT_LUPDATE_EXECUTABLE
+ find_program(QT_LUPDATE_EXECUTABLE
NAMES lupdate-qt4 lupdate
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
+ find_program(QT_LRELEASE_EXECUTABLE
NAMES lrelease-qt4 lrelease
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- FIND_PROGRAM(QT_QCOLLECTIONGENERATOR_EXECUTABLE
+ find_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE
NAMES qcollectiongenerator-qt4 qcollectiongenerator
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- FIND_PROGRAM(QT_DESIGNER_EXECUTABLE
+ find_program(QT_DESIGNER_EXECUTABLE
NAMES designer-qt4 designer
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- FIND_PROGRAM(QT_LINGUIST_EXECUTABLE
+ find_program(QT_LINGUIST_EXECUTABLE
NAMES linguist-qt4 linguist
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- IF (QT_MOC_EXECUTABLE)
- SET(QT_WRAP_CPP "YES")
- ENDIF (QT_MOC_EXECUTABLE)
+ if (QT_MOC_EXECUTABLE)
+ set(QT_WRAP_CPP "YES")
+ endif ()
- IF (QT_UIC_EXECUTABLE)
- SET(QT_WRAP_UI "YES")
- ENDIF (QT_UIC_EXECUTABLE)
+ if (QT_UIC_EXECUTABLE)
+ set(QT_WRAP_UI "YES")
+ endif ()
- MARK_AS_ADVANCED( QT_UIC_EXECUTABLE QT_UIC3_EXECUTABLE QT_MOC_EXECUTABLE
+ mark_as_advanced( QT_UIC_EXECUTABLE QT_UIC3_EXECUTABLE QT_MOC_EXECUTABLE
QT_RCC_EXECUTABLE QT_DBUSXML2CPP_EXECUTABLE QT_DBUSCPP2XML_EXECUTABLE
QT_LUPDATE_EXECUTABLE QT_LRELEASE_EXECUTABLE QT_QCOLLECTIONGENERATOR_EXECUTABLE
QT_DESIGNER_EXECUTABLE QT_LINGUIST_EXECUTABLE)
# get the directory of the current file, used later on in the file
- GET_FILENAME_COMPONENT( _qt4_current_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
+ get_filename_component( _qt4_current_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
+
-
###############################################
#
- # configuration/system dependent settings
+ # configuration/system dependent settings
#
###############################################
- INCLUDE("${_qt4_current_dir}/Qt4ConfigDependentSettings.cmake")
+ include("${_qt4_current_dir}/Qt4ConfigDependentSettings.cmake")
#######################################
@@ -1059,84 +1082,84 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
#
#######################################
- SET( QT_PLUGIN_TYPES accessible bearer codecs decorations designer gfxdrivers graphicssystems iconengines imageformats inputmethods mousedrivers phonon_backend script sqldrivers )
-
- SET( QT_ACCESSIBLE_PLUGINS qtaccessiblecompatwidgets qtaccessiblewidgets )
- SET( QT_BEARER_PLUGINS qcorewlanbearer qgenericbearer )
- SET( QT_CODECS_PLUGINS qcncodecs qjpcodecs qkrcodecs qtwcodecs )
- SET( QT_DECORATIONS_PLUGINS qdecorationdefault qdecorationwindows )
- SET( QT_DESIGNER_PLUGINS arthurplugin containerextension customwidgetplugin phononwidgets qdeclarativeview qt3supportwidgets qwebview taskmenuextension worldtimeclockplugin )
- SET( QT_GRAPHICSDRIVERS_PLUGINS qgfxtransformed qgfxvnc qscreenvfb )
- SET( QT_GRAPHICSSYSTEMS_PLUGINS qglgraphicssystem qtracegraphicssystem )
- SET( QT_ICONENGINES_PLUGINS qsvgicon )
- SET( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff )
- SET( QT_INPUTMETHODS_PLUGINS qimsw_multi )
- SET( QT_MOUSEDRIVERS_PLUGINS qwstslibmousehandler )
- IF(APPLE)
- SET( QT_PHONON_BACKEND_PLUGINS phonon_qt7 )
- ELSEIF(WIN32)
- SET( QT_PHONON_BACKEND_PLUGINS phonon_ds9 )
- ENDIF()
- SET( QT_SCRIPT_PLUGINS qtscriptdbus )
- SET( QT_SQLDRIVERS_PLUGINS qsqldb2 qsqlibase qsqlite qsqlite2 qsqlmysql qsqloci qsqlodbc qsqlpsql qsqltds )
-
- SET( QT_PHONON_PLUGINS ${QT_PHONON_BACKEND_PLUGINS} )
- SET( QT_QT3SUPPORT_PLUGINS qtaccessiblecompatwidgets )
- SET( QT_QTCORE_PLUGINS ${QT_BEARER_PLUGINS} ${QT_CODECS_PLUGINS} )
- SET( QT_QTGUI_PLUGINS qtaccessiblewidgets qgif qjpeg qmng qico qtiff ${QT_DECORATIONS_PLUGINS} ${QT_GRAPHICSDRIVERS_PLUGINS} ${QT_GRAPHICSSYSTEMS_PLUGINS} ${QT_INPUTMETHODS_PLUGINS} ${QT_MOUSEDRIVERS_PLUGINS} )
- SET( QT_QTSCRIPT_PLUGINS ${QT_SCRIPT_PLUGINS} )
- SET( QT_QTSQL_PLUGINS ${QT_SQLDRIVERS_PLUGINS} )
- SET( QT_QTSVG_PLUGINS qsvg qsvgicon )
-
- IF(QT_QMAKE_CHANGED)
- FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES})
- STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type)
- SET(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE})
- FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS})
- STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin)
- UNSET(QT_${_upper_qt_plugin}_LIBRARY_RELEASE CACHE)
- UNSET(QT_${_upper_qt_plugin}_LIBRARY_DEBUG CACHE)
- UNSET(QT_${_upper_qt_plugin}_LIBRARY CACHE)
- UNSET(QT_${_upper_qt_plugin}_PLUGIN_RELEASE CACHE)
- UNSET(QT_${_upper_qt_plugin}_PLUGIN_DEBUG CACHE)
- UNSET(QT_${_upper_qt_plugin}_PLUGIN CACHE)
- ENDFOREACH(QT_PLUGIN)
- ENDFOREACH(QT_PLUGIN_TYPE)
- ENDIF(QT_QMAKE_CHANGED)
+ set( QT_PLUGIN_TYPES accessible bearer codecs decorations designer gfxdrivers graphicssystems iconengines imageformats inputmethods mousedrivers phonon_backend script sqldrivers )
+
+ set( QT_ACCESSIBLE_PLUGINS qtaccessiblecompatwidgets qtaccessiblewidgets )
+ set( QT_BEARER_PLUGINS qcorewlanbearer qgenericbearer )
+ set( QT_CODECS_PLUGINS qcncodecs qjpcodecs qkrcodecs qtwcodecs )
+ set( QT_DECORATIONS_PLUGINS qdecorationdefault qdecorationwindows )
+ set( QT_DESIGNER_PLUGINS arthurplugin containerextension customwidgetplugin phononwidgets qdeclarativeview qt3supportwidgets qwebview taskmenuextension worldtimeclockplugin )
+ set( QT_GRAPHICSDRIVERS_PLUGINS qgfxtransformed qgfxvnc qscreenvfb )
+ set( QT_GRAPHICSSYSTEMS_PLUGINS qglgraphicssystem qtracegraphicssystem )
+ set( QT_ICONENGINES_PLUGINS qsvgicon )
+ set( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff )
+ set( QT_INPUTMETHODS_PLUGINS qimsw_multi )
+ set( QT_MOUSEDRIVERS_PLUGINS qwstslibmousehandler )
+ if(APPLE)
+ set( QT_PHONON_BACKEND_PLUGINS phonon_qt7 )
+ elseif(WIN32)
+ set( QT_PHONON_BACKEND_PLUGINS phonon_ds9 )
+ endif()
+ set( QT_SCRIPT_PLUGINS qtscriptdbus )
+ set( QT_SQLDRIVERS_PLUGINS qsqldb2 qsqlibase qsqlite qsqlite2 qsqlmysql qsqloci qsqlodbc qsqlpsql qsqltds )
+
+ set( QT_PHONON_PLUGINS ${QT_PHONON_BACKEND_PLUGINS} )
+ set( QT_QT3SUPPORT_PLUGINS qtaccessiblecompatwidgets )
+ set( QT_QTCORE_PLUGINS ${QT_BEARER_PLUGINS} ${QT_CODECS_PLUGINS} )
+ set( QT_QTGUI_PLUGINS qtaccessiblewidgets qgif qjpeg qmng qico qtiff ${QT_DECORATIONS_PLUGINS} ${QT_GRAPHICSDRIVERS_PLUGINS} ${QT_GRAPHICSSYSTEMS_PLUGINS} ${QT_INPUTMETHODS_PLUGINS} ${QT_MOUSEDRIVERS_PLUGINS} )
+ set( QT_QTSCRIPT_PLUGINS ${QT_SCRIPT_PLUGINS} )
+ set( QT_QTSQL_PLUGINS ${QT_SQLDRIVERS_PLUGINS} )
+ set( QT_QTSVG_PLUGINS qsvg qsvgicon )
+
+ if(QT_QMAKE_CHANGED)
+ foreach(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES})
+ string(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type)
+ set(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE})
+ foreach(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS})
+ string(TOUPPER ${QT_PLUGIN} _upper_qt_plugin)
+ unset(QT_${_upper_qt_plugin}_LIBRARY_RELEASE CACHE)
+ unset(QT_${_upper_qt_plugin}_LIBRARY_DEBUG CACHE)
+ unset(QT_${_upper_qt_plugin}_LIBRARY CACHE)
+ unset(QT_${_upper_qt_plugin}_PLUGIN_RELEASE CACHE)
+ unset(QT_${_upper_qt_plugin}_PLUGIN_DEBUG CACHE)
+ unset(QT_${_upper_qt_plugin}_PLUGIN CACHE)
+ endforeach()
+ endforeach()
+ endif()
# find_library works better than find_file but we need to set prefixes to only match plugins
- FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES})
- STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type)
- SET(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE})
- FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS})
- STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin)
- IF(QT_IS_STATIC)
- FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_RELEASE
+ foreach(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES})
+ string(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type)
+ set(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE})
+ foreach(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS})
+ string(TOUPPER ${QT_PLUGIN} _upper_qt_plugin)
+ if(QT_IS_STATIC)
+ find_library(QT_${_upper_qt_plugin}_LIBRARY_RELEASE
NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4
PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_DEBUG
+ find_library(QT_${_upper_qt_plugin}_LIBRARY_DEBUG
NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4
PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
_QT4_ADJUST_LIB_VARS(${QT_PLUGIN})
- ELSE(QT_IS_STATIC)
+ else()
# find_library works easier/better than find_file but we need to set suffixes to only match plugins
- SET(CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT ${CMAKE_FIND_LIBRARY_SUFFIXES})
- SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_MODULE_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX})
- FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_RELEASE
+ set(CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_MODULE_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX})
+ find_library(QT_${_upper_qt_plugin}_PLUGIN_RELEASE
NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4
PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_DEBUG
+ find_library(QT_${_upper_qt_plugin}_PLUGIN_DEBUG
NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4
PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
- MARK_AS_ADVANCED(QT_${_upper_qt_plugin}_PLUGIN_RELEASE QT_${_upper_qt_plugin}_PLUGIN_DEBUG)
- SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT})
- ENDIF(QT_IS_STATIC)
- ENDFOREACH(QT_PLUGIN)
- ENDFOREACH(QT_PLUGIN_TYPE)
+ mark_as_advanced(QT_${_upper_qt_plugin}_PLUGIN_RELEASE QT_${_upper_qt_plugin}_PLUGIN_DEBUG)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT})
+ endif()
+ endforeach()
+ endforeach()
######################################
@@ -1145,57 +1168,57 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
#
######################################
- INCLUDE("${_qt4_current_dir}/Qt4Macros.cmake")
+ include("${_qt4_current_dir}/Qt4Macros.cmake")
# set version variables
- STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}")
- STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}")
- STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}")
+ string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}")
+ string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}")
+ string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}")
-ENDIF(QT_QMAKE_EXECUTABLE AND QTVERSION)
+endif()
#support old QT_MIN_VERSION if set, but not if version is supplied by find_package()
-IF(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION)
- SET(Qt4_FIND_VERSION ${QT_MIN_VERSION})
-ENDIF(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION)
+if(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION)
+ set(Qt4_FIND_VERSION ${QT_MIN_VERSION})
+endif()
-IF( Qt4_FIND_COMPONENTS )
+if( Qt4_FIND_COMPONENTS )
# if components specified in find_package(), make sure each of those pieces were found
- SET(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR)
- FOREACH( component ${Qt4_FIND_COMPONENTS} )
- STRING( TOUPPER ${component} _COMPONENT )
+ set(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR)
+ foreach( component ${Qt4_FIND_COMPONENTS} )
+ string( TOUPPER ${component} _COMPONENT )
if(${_COMPONENT} STREQUAL "QTMAIN")
- IF(Q_WS_WIN)
- SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_LIBRARY)
- ENDIF(Q_WS_WIN)
- else(${_COMPONENT} STREQUAL "QTMAIN")
- SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY)
- endif(${_COMPONENT} STREQUAL "QTMAIN")
- ENDFOREACH( component )
+ if(Q_WS_WIN)
+ set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_LIBRARY)
+ endif()
+ else()
+ set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY)
+ endif()
+ endforeach()
if(Qt4_FIND_COMPONENTS MATCHES QtGui)
- SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_UIC_EXECUTABLE)
- endif(Qt4_FIND_COMPONENTS MATCHES QtGui)
+ set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_UIC_EXECUTABLE)
+ endif()
-ELSE( Qt4_FIND_COMPONENTS )
+else()
# if no components specified, we'll make a default set of required variables to say Qt is found
- SET(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR
+ set(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR
QT_LIBRARY_DIR QT_QTCORE_LIBRARY)
-ENDIF( Qt4_FIND_COMPONENTS )
+endif()
if (QT_VERSION_MAJOR GREATER 4)
- SET(VERSION_MSG "Found unsuitable Qt version \"${QTVERSION}\" from ${QT_QMAKE_EXECUTABLE}")
- SET(QT4_FOUND FALSE)
- IF(Qt4_FIND_REQUIRED)
- MESSAGE( FATAL_ERROR "${VERSION_MSG}, this code requires Qt 4.x")
- ELSE(Qt4_FIND_REQUIRED)
- IF(NOT Qt4_FIND_QUIETLY)
- MESSAGE( STATUS "${VERSION_MSG}")
- ENDIF(NOT Qt4_FIND_QUIETLY)
- ENDIF(Qt4_FIND_REQUIRED)
+ set(VERSION_MSG "Found unsuitable Qt version \"${QTVERSION}\" from ${QT_QMAKE_EXECUTABLE}")
+ set(QT4_FOUND FALSE)
+ if(Qt4_FIND_REQUIRED)
+ message( FATAL_ERROR "${VERSION_MSG}, this code requires Qt 4.x")
+ else()
+ if(NOT Qt4_FIND_QUIETLY)
+ message( STATUS "${VERSION_MSG}")
+ endif()
+ endif()
else()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4
REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS}
@@ -1209,8 +1232,8 @@ endif()
#
#######################################
# Backwards compatibility for CMake1.4 and 1.2
-SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
-SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
-SET( QT_QT_LIBRARY "")
-SET(QT_FOUND ${QT4_FOUND})
+set (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
+set (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
+set( QT_QT_LIBRARY "")
+set(QT_FOUND ${QT4_FOUND})
diff --git a/Modules/FindQuickTime.cmake b/Modules/FindQuickTime.cmake
index 038c2dd65..42a0dce77 100644
--- a/Modules/FindQuickTime.cmake
+++ b/Modules/FindQuickTime.cmake
@@ -1,13 +1,13 @@
# Locate QuickTime
# This module defines
# QUICKTIME_LIBRARY
-# QUICKTIME_FOUND, if false, do not try to link to gdal
+# QUICKTIME_FOUND, if false, do not try to link to gdal
# QUICKTIME_INCLUDE_DIR, where to find the headers
#
# $QUICKTIME_DIR is an environment variable that would
# correspond to the ./configure --prefix=$QUICKTIME_DIR
#
-# Created by Eric Wing.
+# Created by Eric Wing.
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
@@ -22,26 +22,20 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-# QuickTime on OS X looks different than QuickTime for Windows,
-# so I am going to case the two.
-
-IF(APPLE)
- FIND_PATH(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h)
- FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime)
-ELSE(APPLE)
- FIND_PATH(QUICKTIME_INCLUDE_DIR QuickTime.h
- HINTS
- $ENV{QUICKTIME_DIR}/include
- $ENV{QUICKTIME_DIR}
- )
- FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime
- HINTS
- $ENV{QUICKTIME_DIR}/lib
- $ENV{QUICKTIME_DIR}
- )
-ENDIF(APPLE)
+find_path(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h QuickTime.h
+ HINTS
+ ENV QUICKTIME_DIR
+ PATH_SUFFIXES
+ include
+)
+find_library(QUICKTIME_LIBRARY QuickTime
+ HINTS
+ ENV QUICKTIME_DIR
+ PATH_SUFFIXES
+ lib
+)
# handle the QUIETLY and REQUIRED arguments and set QUICKTIME_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(QuickTime DEFAULT_MSG QUICKTIME_LIBRARY QUICKTIME_INCLUDE_DIR)
diff --git a/Modules/FindRTI.cmake b/Modules/FindRTI.cmake
index 031c13854..60990b767 100644
--- a/Modules/FindRTI.cmake
+++ b/Modules/FindRTI.cmake
@@ -29,73 +29,68 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-MACRO(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
- IF(NOT ${QUIET})
- MESSAGE(${TYPE} "${MSG}")
- ENDIF(NOT ${QUIET})
-ENDMACRO(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
+macro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
+ if(NOT ${QUIET})
+ message(${TYPE} "${MSG}")
+ endif()
+endmacro()
-# Detect the CERTI installation, http://www.cert.fr/CERTI
-IF ("$ENV{CERTI_HOME}" STRGREATER "")
- FILE(TO_CMAKE_PATH "$ENV{CERTI_HOME}" CERTI_HOME)
- RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "Using environment defined CERTI_HOME: ${CERTI_HOME}")
-ENDIF ("$ENV{CERTI_HOME}" STRGREATER "")
-
-SET(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM")
+set(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM")
+# Detect the CERTI installation, http://www.cert.fr/CERTI
# Detect the MAK Technologies RTI installation, http://www.mak.com/products/rti.php
# note: the following list is ordered to find the most recent version first
-SET(RTI_POSSIBLE_DIRS
- ${CERTI_HOME}
+set(RTI_POSSIBLE_DIRS
+ ENV CERTI_HOME
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MAK Technologies\\MAK RTI 3.2 MSVC++ 8.0;Location]"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MAK RTI 3.2-win32-msvc++8.0;InstallLocation]"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MAK Technologies\\MAK RTI 2.2;Location]"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MAK RTI 2.2;InstallLocation]")
-SET(RTI_OLD_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
+set(RTI_OLD_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
# The MAK RTI has the "lib" prefix even on Windows.
-SET(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
-FIND_LIBRARY(RTI_LIBRARY
+find_library(RTI_LIBRARY
NAMES RTI RTI-NG
PATHS ${RTI_POSSIBLE_DIRS}
PATH_SUFFIXES lib
DOC "The RTI Library")
-IF (RTI_LIBRARY)
- SET(RTI_LIBRARIES ${RTI_LIBRARY})
+if (RTI_LIBRARY)
+ set(RTI_LIBRARIES ${RTI_LIBRARY})
RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library found: ${RTI_LIBRARY}")
-ELSE (RTI_LIBRARY)
+else ()
RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library NOT found")
-ENDIF (RTI_LIBRARY)
+endif ()
-FIND_LIBRARY(RTI_FEDTIME_LIBRARY
+find_library(RTI_FEDTIME_LIBRARY
NAMES FedTime
PATHS ${RTI_POSSIBLE_DIRS}
PATH_SUFFIXES lib
DOC "The FedTime Library")
-IF (RTI_FEDTIME_LIBRARY)
- SET(RTI_LIBRARIES ${RTI_LIBRARIES} ${RTI_FEDTIME_LIBRARY})
+if (RTI_FEDTIME_LIBRARY)
+ set(RTI_LIBRARIES ${RTI_LIBRARIES} ${RTI_FEDTIME_LIBRARY})
RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI FedTime found: ${RTI_FEDTIME_LIBRARY}")
-ENDIF (RTI_FEDTIME_LIBRARY)
+endif ()
-FIND_PATH(RTI_INCLUDE_DIR
+find_path(RTI_INCLUDE_DIR
NAMES RTI.hh
PATHS ${RTI_POSSIBLE_DIRS}
PATH_SUFFIXES include
DOC "The RTI Include Files")
-IF (RTI_INCLUDE_DIR)
+if (RTI_INCLUDE_DIR)
RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers found: ${RTI_INCLUDE_DIR}")
-ELSE (RTI_INCLUDE_DIR)
+else ()
RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers NOT found")
-ENDIF (RTI_INCLUDE_DIR)
+endif ()
# Set the modified system variables back to the original value.
-SET(CMAKE_FIND_LIBRARY_PREFIXES "${RTI_OLD_FIND_LIBRARY_PREFIXES}")
+set(CMAKE_FIND_LIBRARY_PREFIXES "${RTI_OLD_FIND_LIBRARY_PREFIXES}")
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(RTI DEFAULT_MSG
RTI_LIBRARY RTI_INCLUDE_DIR)
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index 5e973e485..119cb63dd 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -3,7 +3,7 @@
# and libraries are. Ruby 1.8 and 1.9 are supported.
#
# The minimum required version of Ruby can be specified using the
-# standard syntax, e.g. FIND_PACKAGE(Ruby 1.8)
+# standard syntax, e.g. find_package(Ruby 1.8)
#
# It also determines what the name of the library is. This
# code sets the following variables:
@@ -37,43 +37,43 @@
# RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
# uncomment the following line to get debug output for this file
-# SET(_RUBY_DEBUG_OUTPUT TRUE)
+# set(_RUBY_DEBUG_OUTPUT TRUE)
# Determine the list of possible names of the ruby executable depending
# on which version of ruby is required
-SET(_RUBY_POSSIBLE_EXECUTABLE_NAMES ruby)
+set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ruby)
# if 1.9 is required, don't look for ruby18 and ruby1.8, default to version 1.8
-IF(Ruby_FIND_VERSION_MAJOR AND Ruby_FIND_VERSION_MINOR)
- SET(Ruby_FIND_VERSION_SHORT_NODOT "${Ruby_FIND_VERSION_MAJOR}${RUBY_FIND_VERSION_MINOR}")
-ELSE(Ruby_FIND_VERSION_MAJOR AND Ruby_FIND_VERSION_MINOR)
- SET(Ruby_FIND_VERSION_SHORT_NODOT "18")
-ENDIF(Ruby_FIND_VERSION_MAJOR AND Ruby_FIND_VERSION_MINOR)
+if(Ruby_FIND_VERSION_MAJOR AND Ruby_FIND_VERSION_MINOR)
+ set(Ruby_FIND_VERSION_SHORT_NODOT "${Ruby_FIND_VERSION_MAJOR}${RUBY_FIND_VERSION_MINOR}")
+else()
+ set(Ruby_FIND_VERSION_SHORT_NODOT "18")
+endif()
-SET(_RUBY_POSSIBLE_EXECUTABLE_NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES} ruby1.9 ruby19)
+set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES} ruby1.9 ruby19)
# if we want a version below 1.9, also look for ruby 1.8
-IF("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19")
- SET(_RUBY_POSSIBLE_EXECUTABLE_NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES} ruby1.8 ruby18)
-ENDIF("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19")
+if("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19")
+ set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES} ruby1.8 ruby18)
+endif()
-FIND_PROGRAM(RUBY_EXECUTABLE NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES})
+find_program(RUBY_EXECUTABLE NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES})
-IF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
- FUNCTION(_RUBY_CONFIG_VAR RBVAR OUTVAR)
- EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['${RBVAR}']"
+if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
+ function(_RUBY_CONFIG_VAR RBVAR OUTVAR)
+ execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['${RBVAR}']"
RESULT_VARIABLE _RUBY_SUCCESS
OUTPUT_VARIABLE _RUBY_OUTPUT
ERROR_QUIET)
- IF(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT)
- EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['${RBVAR}']"
+ if(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT)
+ execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['${RBVAR}']"
RESULT_VARIABLE _RUBY_SUCCESS
OUTPUT_VARIABLE _RUBY_OUTPUT
ERROR_QUIET)
- ENDIF(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT)
- SET(${OUTVAR} "${_RUBY_OUTPUT}" PARENT_SCOPE)
- ENDFUNCTION(_RUBY_CONFIG_VAR)
+ endif()
+ set(${OUTVAR} "${_RUBY_OUTPUT}" PARENT_SCOPE)
+ endfunction()
# query the ruby version
@@ -93,29 +93,29 @@ IF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
_RUBY_CONFIG_VAR("sitelibdir" RUBY_SITELIB_DIR)
# vendor_ruby available ?
- EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r vendor-specific -e "print 'true'"
+ execute_process(COMMAND ${RUBY_EXECUTABLE} -r vendor-specific -e "print 'true'"
OUTPUT_VARIABLE RUBY_HAS_VENDOR_RUBY ERROR_QUIET)
- IF(RUBY_HAS_VENDOR_RUBY)
+ if(RUBY_HAS_VENDOR_RUBY)
_RUBY_CONFIG_VAR("vendorlibdir" RUBY_VENDORLIB_DIR)
_RUBY_CONFIG_VAR("vendorarchdir" RUBY_VENDORARCH_DIR)
- ENDIF(RUBY_HAS_VENDOR_RUBY)
+ endif()
# save the results in the cache so we don't have to run ruby the next time again
- SET(RUBY_VERSION_MAJOR ${RUBY_VERSION_MAJOR} CACHE PATH "The Ruby major version" FORCE)
- SET(RUBY_VERSION_MINOR ${RUBY_VERSION_MINOR} CACHE PATH "The Ruby minor version" FORCE)
- SET(RUBY_VERSION_PATCH ${RUBY_VERSION_PATCH} CACHE PATH "The Ruby patch version" FORCE)
- SET(RUBY_ARCH_DIR ${RUBY_ARCH_DIR} CACHE PATH "The Ruby arch dir" FORCE)
- SET(RUBY_HDR_DIR ${RUBY_HDR_DIR} CACHE PATH "The Ruby header dir (1.9)" FORCE)
- SET(RUBY_POSSIBLE_LIB_DIR ${RUBY_POSSIBLE_LIB_DIR} CACHE PATH "The Ruby lib dir" FORCE)
- SET(RUBY_RUBY_LIB_DIR ${RUBY_RUBY_LIB_DIR} CACHE PATH "The Ruby ruby-lib dir" FORCE)
- SET(RUBY_SITEARCH_DIR ${RUBY_SITEARCH_DIR} CACHE PATH "The Ruby site arch dir" FORCE)
- SET(RUBY_SITELIB_DIR ${RUBY_SITELIB_DIR} CACHE PATH "The Ruby site lib dir" FORCE)
- SET(RUBY_HAS_VENDOR_RUBY ${RUBY_HAS_VENDOR_RUBY} CACHE BOOL "Vendor Ruby is available" FORCE)
- SET(RUBY_VENDORARCH_DIR ${RUBY_VENDORARCH_DIR} CACHE PATH "The Ruby vendor arch dir" FORCE)
- SET(RUBY_VENDORLIB_DIR ${RUBY_VENDORLIB_DIR} CACHE PATH "The Ruby vendor lib dir" FORCE)
-
- MARK_AS_ADVANCED(
+ set(RUBY_VERSION_MAJOR ${RUBY_VERSION_MAJOR} CACHE PATH "The Ruby major version" FORCE)
+ set(RUBY_VERSION_MINOR ${RUBY_VERSION_MINOR} CACHE PATH "The Ruby minor version" FORCE)
+ set(RUBY_VERSION_PATCH ${RUBY_VERSION_PATCH} CACHE PATH "The Ruby patch version" FORCE)
+ set(RUBY_ARCH_DIR ${RUBY_ARCH_DIR} CACHE PATH "The Ruby arch dir" FORCE)
+ set(RUBY_HDR_DIR ${RUBY_HDR_DIR} CACHE PATH "The Ruby header dir (1.9)" FORCE)
+ set(RUBY_POSSIBLE_LIB_DIR ${RUBY_POSSIBLE_LIB_DIR} CACHE PATH "The Ruby lib dir" FORCE)
+ set(RUBY_RUBY_LIB_DIR ${RUBY_RUBY_LIB_DIR} CACHE PATH "The Ruby ruby-lib dir" FORCE)
+ set(RUBY_SITEARCH_DIR ${RUBY_SITEARCH_DIR} CACHE PATH "The Ruby site arch dir" FORCE)
+ set(RUBY_SITELIB_DIR ${RUBY_SITELIB_DIR} CACHE PATH "The Ruby site lib dir" FORCE)
+ set(RUBY_HAS_VENDOR_RUBY ${RUBY_HAS_VENDOR_RUBY} CACHE BOOL "Vendor Ruby is available" FORCE)
+ set(RUBY_VENDORARCH_DIR ${RUBY_VENDORARCH_DIR} CACHE PATH "The Ruby vendor arch dir" FORCE)
+ set(RUBY_VENDORLIB_DIR ${RUBY_VENDORLIB_DIR} CACHE PATH "The Ruby vendor lib dir" FORCE)
+
+ mark_as_advanced(
RUBY_ARCH_DIR
RUBY_ARCH
RUBY_HDR_DIR
@@ -130,107 +130,107 @@ IF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
RUBY_VERSION_MINOR
RUBY_VERSION_PATCH
)
-ENDIF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
+endif()
# In case RUBY_EXECUTABLE could not be executed (e.g. cross compiling)
# try to detect which version we found. This is not too good.
-IF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
+if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
# by default assume 1.8.0
- SET(RUBY_VERSION_MAJOR 1)
- SET(RUBY_VERSION_MINOR 8)
- SET(RUBY_VERSION_PATCH 0)
+ set(RUBY_VERSION_MAJOR 1)
+ set(RUBY_VERSION_MINOR 8)
+ set(RUBY_VERSION_PATCH 0)
# check whether we found 1.9.x
- IF(${RUBY_EXECUTABLE} MATCHES "ruby1.?9" OR RUBY_HDR_DIR)
- SET(RUBY_VERSION_MAJOR 1)
- SET(RUBY_VERSION_MINOR 9)
- ENDIF(${RUBY_EXECUTABLE} MATCHES "ruby1.?9" OR RUBY_HDR_DIR)
-ENDIF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
-
-IF(RUBY_VERSION_MAJOR)
- SET(RUBY_VERSION "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}.${RUBY_VERSION_PATCH}")
- SET(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}")
- SET(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}")
- SET(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}")
-ENDIF(RUBY_VERSION_MAJOR)
-
-FIND_PATH(RUBY_INCLUDE_DIR
+ if(${RUBY_EXECUTABLE} MATCHES "ruby1.?9" OR RUBY_HDR_DIR)
+ set(RUBY_VERSION_MAJOR 1)
+ set(RUBY_VERSION_MINOR 9)
+ endif()
+endif()
+
+if(RUBY_VERSION_MAJOR)
+ set(RUBY_VERSION "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}.${RUBY_VERSION_PATCH}")
+ set(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}")
+ set(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}")
+ set(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}")
+endif()
+
+find_path(RUBY_INCLUDE_DIR
NAMES ruby.h
HINTS
${RUBY_HDR_DIR}
${RUBY_ARCH_DIR}
/usr/lib/ruby/${_RUBY_VERSION_SHORT}/i586-linux-gnu/ )
-SET(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIR} )
+set(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIR} )
# if ruby > 1.8 is required or if ruby > 1.8 was found, search for the config.h dir
-IF( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18 OR "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18 OR RUBY_HDR_DIR)
- FIND_PATH(RUBY_CONFIG_INCLUDE_DIR
+if( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18 OR "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18 OR RUBY_HDR_DIR)
+ find_path(RUBY_CONFIG_INCLUDE_DIR
NAMES ruby/config.h config.h
HINTS
${RUBY_HDR_DIR}/${RUBY_ARCH}
${RUBY_ARCH_DIR}
)
- SET(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIRS} ${RUBY_CONFIG_INCLUDE_DIR} )
-ENDIF( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18 OR "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18 OR RUBY_HDR_DIR)
+ set(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIRS} ${RUBY_CONFIG_INCLUDE_DIR} )
+endif()
# Determine the list of possible names for the ruby library
-SET(_RUBY_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_RUBY_VERSION_SHORT} ruby${_RUBY_VERSION_SHORT_NODOT} ruby-${_RUBY_VERSION_SHORT} ruby-${RUBY_VERSION})
-
-IF(WIN32)
- SET( _RUBY_MSVC_RUNTIME "" )
- IF( MSVC60 )
- SET( _RUBY_MSVC_RUNTIME "60" )
- ENDIF( MSVC60 )
- IF( MSVC70 )
- SET( _RUBY_MSVC_RUNTIME "70" )
- ENDIF( MSVC70 )
- IF( MSVC71 )
- SET( _RUBY_MSVC_RUNTIME "71" )
- ENDIF( MSVC71 )
- IF( MSVC80 )
- SET( _RUBY_MSVC_RUNTIME "80" )
- ENDIF( MSVC80 )
- IF( MSVC90 )
- SET( _RUBY_MSVC_RUNTIME "90" )
- ENDIF( MSVC90 )
-
- LIST(APPEND _RUBY_POSSIBLE_LIB_NAMES
+set(_RUBY_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_RUBY_VERSION_SHORT} ruby${_RUBY_VERSION_SHORT_NODOT} ruby-${_RUBY_VERSION_SHORT} ruby-${RUBY_VERSION})
+
+if(WIN32)
+ set( _RUBY_MSVC_RUNTIME "" )
+ if( MSVC60 )
+ set( _RUBY_MSVC_RUNTIME "60" )
+ endif()
+ if( MSVC70 )
+ set( _RUBY_MSVC_RUNTIME "70" )
+ endif()
+ if( MSVC71 )
+ set( _RUBY_MSVC_RUNTIME "71" )
+ endif()
+ if( MSVC80 )
+ set( _RUBY_MSVC_RUNTIME "80" )
+ endif()
+ if( MSVC90 )
+ set( _RUBY_MSVC_RUNTIME "90" )
+ endif()
+
+ list(APPEND _RUBY_POSSIBLE_LIB_NAMES
"msvcr${_RUBY_MSVC_RUNTIME}-ruby${_RUBY_NODOT_VERSION}"
"msvcr${_RUBY_MSVC_RUNTIME}-ruby${_RUBY_NODOT_VERSION}-static"
"msvcrt-ruby${_RUBY_NODOT_VERSION}"
"msvcrt-ruby${_RUBY_NODOT_VERSION}-static" )
-ENDIF(WIN32)
-
-FIND_LIBRARY(RUBY_LIBRARY NAMES ${_RUBY_POSSIBLE_LIB_NAMES} HINTS ${RUBY_POSSIBLE_LIB_DIR} )
-
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-SET(_RUBY_REQUIRED_VARS RUBY_EXECUTABLE RUBY_INCLUDE_DIR RUBY_LIBRARY)
-IF(_RUBY_VERSION_SHORT_NODOT GREATER 18)
- LIST(APPEND _RUBY_REQUIRED_VARS RUBY_CONFIG_INCLUDE_DIR)
-ENDIF(_RUBY_VERSION_SHORT_NODOT GREATER 18)
-
-IF(_RUBY_DEBUG_OUTPUT)
- MESSAGE(STATUS "--------FindRuby.cmake debug------------")
- MESSAGE(STATUS "_RUBY_POSSIBLE_EXECUTABLE_NAMES: ${_RUBY_POSSIBLE_EXECUTABLE_NAMES}")
- MESSAGE(STATUS "_RUBY_POSSIBLE_LIB_NAMES: ${_RUBY_POSSIBLE_LIB_NAMES}")
- MESSAGE(STATUS "RUBY_ARCH_DIR: ${RUBY_ARCH_DIR}")
- MESSAGE(STATUS "RUBY_HDR_DIR: ${RUBY_HDR_DIR}")
- MESSAGE(STATUS "RUBY_POSSIBLE_LIB_DIR: ${RUBY_POSSIBLE_LIB_DIR}")
- MESSAGE(STATUS "Found RUBY_VERSION: \"${RUBY_VERSION}\" , short: \"${_RUBY_VERSION_SHORT}\", nodot: \"${_RUBY_VERSION_SHORT_NODOT}\"")
- MESSAGE(STATUS "_RUBY_REQUIRED_VARS: ${_RUBY_REQUIRED_VARS}")
- MESSAGE(STATUS "RUBY_EXECUTABLE: ${RUBY_EXECUTABLE}")
- MESSAGE(STATUS "RUBY_LIBRARY: ${RUBY_LIBRARY}")
- MESSAGE(STATUS "RUBY_INCLUDE_DIR: ${RUBY_INCLUDE_DIR}")
- MESSAGE(STATUS "RUBY_CONFIG_INCLUDE_DIR: ${RUBY_CONFIG_INCLUDE_DIR}")
- MESSAGE(STATUS "--------------------")
-ENDIF(_RUBY_DEBUG_OUTPUT)
+endif()
+
+find_library(RUBY_LIBRARY NAMES ${_RUBY_POSSIBLE_LIB_NAMES} HINTS ${RUBY_POSSIBLE_LIB_DIR} )
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+set(_RUBY_REQUIRED_VARS RUBY_EXECUTABLE RUBY_INCLUDE_DIR RUBY_LIBRARY)
+if(_RUBY_VERSION_SHORT_NODOT GREATER 18)
+ list(APPEND _RUBY_REQUIRED_VARS RUBY_CONFIG_INCLUDE_DIR)
+endif()
+
+if(_RUBY_DEBUG_OUTPUT)
+ message(STATUS "--------FindRuby.cmake debug------------")
+ message(STATUS "_RUBY_POSSIBLE_EXECUTABLE_NAMES: ${_RUBY_POSSIBLE_EXECUTABLE_NAMES}")
+ message(STATUS "_RUBY_POSSIBLE_LIB_NAMES: ${_RUBY_POSSIBLE_LIB_NAMES}")
+ message(STATUS "RUBY_ARCH_DIR: ${RUBY_ARCH_DIR}")
+ message(STATUS "RUBY_HDR_DIR: ${RUBY_HDR_DIR}")
+ message(STATUS "RUBY_POSSIBLE_LIB_DIR: ${RUBY_POSSIBLE_LIB_DIR}")
+ message(STATUS "Found RUBY_VERSION: \"${RUBY_VERSION}\" , short: \"${_RUBY_VERSION_SHORT}\", nodot: \"${_RUBY_VERSION_SHORT_NODOT}\"")
+ message(STATUS "_RUBY_REQUIRED_VARS: ${_RUBY_REQUIRED_VARS}")
+ message(STATUS "RUBY_EXECUTABLE: ${RUBY_EXECUTABLE}")
+ message(STATUS "RUBY_LIBRARY: ${RUBY_LIBRARY}")
+ message(STATUS "RUBY_INCLUDE_DIR: ${RUBY_INCLUDE_DIR}")
+ message(STATUS "RUBY_CONFIG_INCLUDE_DIR: ${RUBY_CONFIG_INCLUDE_DIR}")
+ message(STATUS "--------------------")
+endif()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby REQUIRED_VARS ${_RUBY_REQUIRED_VARS}
VERSION_VAR RUBY_VERSION )
-MARK_AS_ADVANCED(
+mark_as_advanced(
RUBY_EXECUTABLE
RUBY_LIBRARY
RUBY_INCLUDE_DIR
@@ -238,6 +238,6 @@ MARK_AS_ADVANCED(
)
# Set some variables for compatibility with previous version of this file
-SET(RUBY_POSSIBLE_LIB_PATH ${RUBY_POSSIBLE_LIB_DIR})
-SET(RUBY_RUBY_LIB_PATH ${RUBY_RUBY_LIB_DIR})
-SET(RUBY_INCLUDE_PATH ${RUBY_INCLUDE_DIRS})
+set(RUBY_POSSIBLE_LIB_PATH ${RUBY_POSSIBLE_LIB_DIR})
+set(RUBY_RUBY_LIB_PATH ${RUBY_RUBY_LIB_DIR})
+set(RUBY_INCLUDE_PATH ${RUBY_INCLUDE_DIRS})
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 1c04726ea..f2e9f25f5 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -1,27 +1,28 @@
-# Locate SDL library
+# - Locate SDL library
# This module defines
-# SDL_LIBRARY, the name of the library to link against
-# SDL_FOUND, if false, do not try to link to SDL
-# SDL_INCLUDE_DIR, where to find SDL.h
+# SDL_LIBRARY, the name of the library to link against
+# SDL_FOUND, if false, do not try to link to SDL
+# SDL_INCLUDE_DIR, where to find SDL.h
+# SDL_VERSION_STRING, human-readable string containing the version of SDL
#
# This module responds to the the flag:
-# SDL_BUILDING_LIBRARY
-# If this is defined, then no SDL_main will be linked in because
-# only applications need main().
-# Otherwise, it is assumed you are building an application and this
-# module will attempt to locate and set the the proper link flags
-# as part of the returned SDL_LIBRARY variable.
+# SDL_BUILDING_LIBRARY
+# If this is defined, then no SDL_main will be linked in because
+# only applications need main().
+# Otherwise, it is assumed you are building an application and this
+# module will attempt to locate and set the the proper link flags
+# as part of the returned SDL_LIBRARY variable.
#
-# Don't forget to include SDLmain.h and SDLmain.m your project for the
+# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDLmain which
-# this module will try to find on your behalf.) Also for OS X, this
+# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
#
#
# Additional Note: If you see an empty SDL_LIBRARY_TEMP in your configuration
-# and no SDL_LIBRARY, it means CMake did not find your SDL library
-# (SDL.dll, libsdl.so, SDL.framework, etc).
-# Set SDL_LIBRARY_TEMP to point to your SDL library, and configure again.
+# and no SDL_LIBRARY, it means CMake did not find your SDL library
+# (SDL.dll, libsdl.so, SDL.framework, etc).
+# Set SDL_LIBRARY_TEMP to point to your SDL library, and configure again.
# Similarly, if you see an empty SDLMAIN_LIBRARY, you should set this value
# as appropriate. These values are used to generate the final SDL_LIBRARY
# variable, but when these values are unset, SDL_LIBRARY does not get created.
@@ -32,18 +33,18 @@
# used in building SDL.
# l.e.galup 9-20-02
#
-# Modified by Eric Wing.
+# Modified by Eric Wing.
# Added code to assist with automated building by using environmental variables
# and providing a more controlled/consistent search behavior.
-# Added new modifications to recognize OS X frameworks and
-# additional Unix paths (FreeBSD, etc).
+# Added new modifications to recognize OS X frameworks and
+# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL guidelines.
# Added a search for SDLmain which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
-# People will have to manually change the cache values of
+# People will have to manually change the cache values of
# SDL_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
@@ -54,6 +55,7 @@
#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -65,109 +67,112 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(SDL_INCLUDE_DIR SDL.h
+find_path(SDL_INCLUDE_DIR SDL.h
HINTS
- $ENV{SDLDIR}
- PATH_SUFFIXES include/SDL include
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local/include/SDL12
- /usr/local/include/SDL11 # FreeBSD ports
- /usr/include/SDL12
- /usr/include/SDL11
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
- /opt
+ ENV SDLDIR
+ PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include
)
# SDL-1.1 is the name used by FreeBSD ports...
# don't confuse it for the version number.
-FIND_LIBRARY(SDL_LIBRARY_TEMP
+find_library(SDL_LIBRARY_TEMP
NAMES SDL SDL-1.1
HINTS
- $ENV{SDLDIR}
- PATH_SUFFIXES lib64 lib
- PATHS
- /sw
- /opt/local
- /opt/csw
- /opt
+ ENV SDLDIR
+ PATH_SUFFIXES lib
)
-IF(NOT SDL_BUILDING_LIBRARY)
- IF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework")
- # Non-OS X framework versions expect you to also dynamically link to
- # SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms
+if(NOT SDL_BUILDING_LIBRARY)
+ if(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework")
+ # Non-OS X framework versions expect you to also dynamically link to
+ # SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms
# seem to provide SDLmain for compatibility even though they don't
# necessarily need it.
- FIND_LIBRARY(SDLMAIN_LIBRARY
+ find_library(SDLMAIN_LIBRARY
NAMES SDLmain SDLmain-1.1
HINTS
- $ENV{SDLDIR}
- PATH_SUFFIXES lib64 lib
+ ENV SDLDIR
+ PATH_SUFFIXES lib
PATHS
/sw
/opt/local
/opt/csw
/opt
)
- ENDIF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework")
-ENDIF(NOT SDL_BUILDING_LIBRARY)
+ endif()
+endif()
# SDL may require threads on your system.
-# The Apple build may not need an explicit flag because one of the
-# frameworks may already provide it.
+# The Apple build may not need an explicit flag because one of the
+# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
-IF(NOT APPLE)
- FIND_PACKAGE(Threads)
-ENDIF(NOT APPLE)
+if(NOT APPLE)
+ find_package(Threads)
+endif()
# MinGW needs an additional library, mwindows
# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows
# (Actually on second look, I think it only needs one of the m* libraries.)
-IF(MINGW)
- SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
-ENDIF(MINGW)
+if(MINGW)
+ set(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
+endif()
-IF(SDL_LIBRARY_TEMP)
+if(SDL_LIBRARY_TEMP)
# For SDLmain
- IF(NOT SDL_BUILDING_LIBRARY)
- IF(SDLMAIN_LIBRARY)
- SET(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP})
- ENDIF(SDLMAIN_LIBRARY)
- ENDIF(NOT SDL_BUILDING_LIBRARY)
+ if(SDLMAIN_LIBRARY AND NOT SDL_BUILDING_LIBRARY)
+ list(FIND SDL_LIBRARY_TEMP "${SDLMAIN_LIBRARY}" _SDL_MAIN_INDEX)
+ if(_SDL_MAIN_INDEX EQUAL -1)
+ list(APPEND SDL_LIBRARY_TEMP "${SDLMAIN_LIBRARY}")
+ endif()
+ unset(_SDL_MAIN_INDEX)
+ endif()
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
- # CMake doesn't display the -framework Cocoa string in the UI even
+ # CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there if I modify a pre-used variable.
# I think it has something to do with the CACHE STRING.
- # So I use a temporary variable until the end so I can set the
+ # So I use a temporary variable until the end so I can set the
# "real" variable in one-shot.
- IF(APPLE)
- SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa")
- ENDIF(APPLE)
-
+ if(APPLE)
+ set(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa")
+ endif()
+
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if I used the Threads package
# and try using this line, so I'm just skipping it entirely for OS X.
- IF(NOT APPLE)
- SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
- ENDIF(NOT APPLE)
+ if(NOT APPLE)
+ set(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
+ endif()
# For MinGW library
- IF(MINGW)
- SET(SDL_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL_LIBRARY_TEMP})
- ENDIF(MINGW)
+ if(MINGW)
+ set(SDL_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL_LIBRARY_TEMP})
+ endif()
# Set the final string here so the GUI reflects the final state.
- SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
+ set(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
- SET(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "")
-ENDIF(SDL_LIBRARY_TEMP)
+ set(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "")
+endif()
+
+if(SDL_INCLUDE_DIR AND EXISTS "${SDL_INCLUDE_DIR}/SDL_version.h")
+ file(STRINGS "${SDL_INCLUDE_DIR}/SDL_version.h" SDL_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_INCLUDE_DIR}/SDL_version.h" SDL_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MINOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_INCLUDE_DIR}/SDL_version.h" SDL_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_PATCHLEVEL[ \t]+[0-9]+$")
+ string(REGEX REPLACE "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MAJOR "${SDL_VERSION_MAJOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MINOR "${SDL_VERSION_MINOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_VERSION_PATCH "${SDL_VERSION_PATCH_LINE}")
+ set(SDL_VERSION_STRING ${SDL_VERSION_MAJOR}.${SDL_VERSION_MINOR}.${SDL_VERSION_PATCH})
+ unset(SDL_VERSION_MAJOR_LINE)
+ unset(SDL_VERSION_MINOR_LINE)
+ unset(SDL_VERSION_PATCH_LINE)
+ unset(SDL_VERSION_MAJOR)
+ unset(SDL_VERSION_MINOR)
+ unset(SDL_VERSION_PATCH)
+endif()
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL
- REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR)
+ REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR
+ VERSION_VAR SDL_VERSION_STRING)
diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake
index f215bda47..4cae03274 100644
--- a/Modules/FindSDL_image.cmake
+++ b/Modules/FindSDL_image.cmake
@@ -1,19 +1,26 @@
-# Locate SDL_image library
-# This module defines
-# SDLIMAGE_LIBRARY, the name of the library to link against
-# SDLIMAGE_FOUND, if false, do not try to link to SDL
-# SDLIMAGE_INCLUDE_DIR, where to find SDL/SDL.h
+# - Locate SDL_image library
+# This module defines:
+# SDL_IMAGE_LIBRARIES, the name of the library to link against
+# SDL_IMAGE_INCLUDE_DIRS, where to find the headers
+# SDL_IMAGE_FOUND, if false, do not try to link against
+# SDL_IMAGE_VERSION_STRING - human-readable string containing the version of SDL_image
+#
+# For backward compatiblity the following variables are also set:
+# SDLIMAGE_LIBRARY (same value as SDL_IMAGE_LIBRARIES)
+# SDLIMAGE_INCLUDE_DIR (same value as SDL_IMAGE_INCLUDE_DIRS)
+# SDLIMAGE_FOUND (same value as SDL_IMAGE_FOUND)
#
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
# used in building SDL.
#
-# Created by Eric Wing. This was influenced by the FindSDL.cmake
-# module, but with modifications to recognize OS X frameworks and
+# Created by Eric Wing. This was influenced by the FindSDL.cmake
+# module, but with modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -25,46 +32,56 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(SDLIMAGE_INCLUDE_DIR SDL_image.h
+if(NOT SDL_IMAGE_INCLUDE_DIR AND SDLIMAGE_INCLUDE_DIR)
+ set(SDL_IMAGE_INCLUDE_DIR ${SDLIMAGE_INCLUDE_DIR} CACHE PATH "directory cache
+entry initialized from old variable name")
+endif()
+find_path(SDL_IMAGE_INCLUDE_DIR SDL_image.h
HINTS
- $ENV{SDLIMAGEDIR}
- $ENV{SDLDIR}
- PATH_SUFFIXES include
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local/include/SDL
- /usr/include/SDL
- /usr/local/include/SDL12
- /usr/local/include/SDL11 # FreeBSD ports
- /usr/include/SDL12
- /usr/include/SDL11
- /sw/include/SDL # Fink
- /sw/include
- /opt/local/include/SDL # DarwinPorts
- /opt/local/include
- /opt/csw/include/SDL # Blastwave
- /opt/csw/include
- /opt/include/SDL
- /opt/include
+ ENV SDLIMAGEDIR
+ ENV SDLDIR
+ PATH_SUFFIXES SDL SDL12 SDL11
)
-FIND_LIBRARY(SDLIMAGE_LIBRARY
+if(NOT SDL_IMAGE_LIBRARY AND SDLIMAGE_LIBRARY)
+ set(SDL_IMAGE_LIBRARY ${SDLIMAGE_LIBRARY} CACHE FILEPATH "file cache entry
+initialized from old variable name")
+endif()
+find_library(SDL_IMAGE_LIBRARY
NAMES SDL_image
HINTS
- $ENV{SDLIMAGEDIR}
- $ENV{SDLDIR}
- PATH_SUFFIXES lib64 lib
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /sw
- /opt/local
- /opt/csw
- /opt
+ ENV SDLIMAGEDIR
+ ENV SDLDIR
)
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+if(SDL_IMAGE_INCLUDE_DIR AND EXISTS "${SDL_IMAGE_INCLUDE_DIR}/SDL_image.h")
+ file(STRINGS "${SDL_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL_IMAGE_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL_IMAGE_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL_IMAGE_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+[0-9]+$")
+ string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_IMAGE_VERSION_MAJOR "${SDL_IMAGE_VERSION_MAJOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_IMAGE_VERSION_MINOR "${SDL_IMAGE_VERSION_MINOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_IMAGE_VERSION_PATCH "${SDL_IMAGE_VERSION_PATCH_LINE}")
+ set(SDL_IMAGE_VERSION_STRING ${SDL_IMAGE_VERSION_MAJOR}.${SDL_IMAGE_VERSION_MINOR}.${SDL_IMAGE_VERSION_PATCH})
+ unset(SDL_IMAGE_VERSION_MAJOR_LINE)
+ unset(SDL_IMAGE_VERSION_MINOR_LINE)
+ unset(SDL_IMAGE_VERSION_PATCH_LINE)
+ unset(SDL_IMAGE_VERSION_MAJOR)
+ unset(SDL_IMAGE_VERSION_MINOR)
+ unset(SDL_IMAGE_VERSION_PATCH)
+endif()
+
+set(SDL_IMAGE_LIBRARIES ${SDL_IMAGE_LIBRARY})
+set(SDL_IMAGE_INCLUDE_DIRS ${SDL_IMAGE_INCLUDE_DIR})
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_image
+ REQUIRED_VARS SDL_IMAGE_LIBRARIES SDL_IMAGE_INCLUDE_DIRS
+ VERSION_VAR SDL_IMAGE_VERSION_STRING)
+
+# for backward compatiblity
+set(SDLIMAGE_LIBRARY ${SDL_IMAGE_LIBRARIES})
+set(SDLIMAGE_INCLUDE_DIR ${SDL_IMAGE_INCLUDE_DIRS})
+set(SDLIMAGE_FOUND ${SDL_IMAGE_FOUND})
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLIMAGE
- REQUIRED_VARS SDLIMAGE_LIBRARY SDLIMAGE_INCLUDE_DIR)
+mark_as_advanced(SDL_IMAGE_LIBRARY SDL_IMAGE_INCLUDE_DIR)
diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index 7cc1a6b09..666fc6e0f 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -1,19 +1,26 @@
-# Locate SDL_mixer library
-# This module defines
-# SDLMIXER_LIBRARY, the name of the library to link against
-# SDLMIXER_FOUND, if false, do not try to link to SDL
-# SDLMIXER_INCLUDE_DIR, where to find SDL/SDL.h
+# - Locate SDL_mixer library
+# This module defines:
+# SDL_MIXER_LIBRARIES, the name of the library to link against
+# SDL_MIXER_INCLUDE_DIRS, where to find the headers
+# SDL_MIXER_FOUND, if false, do not try to link against
+# SDL_MIXER_VERSION_STRING - human-readable string containing the version of SDL_mixer
+#
+# For backward compatiblity the following variables are also set:
+# SDLMIXER_LIBRARY (same value as SDL_MIXER_LIBRARIES)
+# SDLMIXER_INCLUDE_DIR (same value as SDL_MIXER_INCLUDE_DIRS)
+# SDLMIXER_FOUND (same value as SDL_MIXER_FOUND)
#
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
# used in building SDL.
#
-# Created by Eric Wing. This was influenced by the FindSDL.cmake
-# module, but with modifications to recognize OS X frameworks and
+# Created by Eric Wing. This was influenced by the FindSDL.cmake
+# module, but with modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -25,46 +32,56 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(SDLMIXER_INCLUDE_DIR SDL_mixer.h
+if(NOT SDL_MIXER_INCLUDE_DIR AND SDLMIXER_INCLUDE_DIR)
+ set(SDL_MIXER_INCLUDE_DIR ${SDLMIXER_INCLUDE_DIR} CACHE PATH "directory cache
+entry initialized from old variable name")
+endif()
+find_path(SDL_MIXER_INCLUDE_DIR SDL_mixer.h
HINTS
- $ENV{SDLMIXERDIR}
- $ENV{SDLDIR}
- PATH_SUFFIXES include
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local/include/SDL
- /usr/include/SDL
- /usr/local/include/SDL12
- /usr/local/include/SDL11 # FreeBSD ports
- /usr/include/SDL12
- /usr/include/SDL11
- /sw/include/SDL # Fink
- /sw/include
- /opt/local/include/SDL # DarwinPorts
- /opt/local/include
- /opt/csw/include/SDL # Blastwave
- /opt/csw/include
- /opt/include/SDL
- /opt/include
+ ENV SDLMIXERDIR
+ ENV SDLDIR
+ PATH_SUFFIXES SDL SDL12 SDL11
)
-FIND_LIBRARY(SDLMIXER_LIBRARY
+if(NOT SDL_MIXER_LIBRARY AND SDLMIXER_LIBRARY)
+ set(SDL_MIXER_LIBRARY ${SDLMIXER_LIBRARY} CACHE FILEPATH "file cache entry
+initialized from old variable name")
+endif()
+find_library(SDL_MIXER_LIBRARY
NAMES SDL_mixer
HINTS
- $ENV{SDLMIXERDIR}
- $ENV{SDLDIR}
- PATH_SUFFIXES lib64 lib
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /sw
- /opt/local
- /opt/csw
- /opt
+ ENV SDLMIXERDIR
+ ENV SDLDIR
)
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+if(SDL_MIXER_INCLUDE_DIR AND EXISTS "${SDL_MIXER_INCLUDE_DIR}/SDL_mixer.h")
+ file(STRINGS "${SDL_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL_MIXER_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MIXER_MAJOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL_MIXER_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MIXER_MINOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL_MIXER_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_MIXER_PATCHLEVEL[ \t]+[0-9]+$")
+ string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_MIXER_VERSION_MAJOR "${SDL_MIXER_VERSION_MAJOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_MIXER_VERSION_MINOR "${SDL_MIXER_VERSION_MINOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_MIXER_VERSION_PATCH "${SDL_MIXER_VERSION_PATCH_LINE}")
+ set(SDL_MIXER_VERSION_STRING ${SDL_MIXER_VERSION_MAJOR}.${SDL_MIXER_VERSION_MINOR}.${SDL_MIXER_VERSION_PATCH})
+ unset(SDL_MIXER_VERSION_MAJOR_LINE)
+ unset(SDL_MIXER_VERSION_MINOR_LINE)
+ unset(SDL_MIXER_VERSION_PATCH_LINE)
+ unset(SDL_MIXER_VERSION_MAJOR)
+ unset(SDL_MIXER_VERSION_MINOR)
+ unset(SDL_MIXER_VERSION_PATCH)
+endif()
+
+set(SDL_MIXER_LIBRARIES ${SDL_MIXER_LIBRARY})
+set(SDL_MIXER_INCLUDE_DIRS ${SDL_MIXER_INCLUDE_DIR})
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_mixer
+ REQUIRED_VARS SDL_MIXER_LIBRARIES SDL_MIXER_INCLUDE_DIRS
+ VERSION_VAR SDL_MIXER_VERSION_STRING)
+
+# for backward compatiblity
+set(SDLMIXER_LIBRARY ${SDL_MIXER_LIBRARIES})
+set(SDLMIXER_INCLUDE_DIR ${SDL_MIXER_INCLUDE_DIRS})
+set(SDLMIXER_FOUND ${SDL_MIXER_FOUND})
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLMIXER
- REQUIRED_VARS SDLMIXER_LIBRARY SDLMIXER_INCLUDE_DIR)
+mark_as_advanced(SDL_MIXER_LIBRARY SDL_MIXER_INCLUDE_DIR)
diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake
index ca1de7977..d8f479f5b 100644
--- a/Modules/FindSDL_net.cmake
+++ b/Modules/FindSDL_net.cmake
@@ -1,19 +1,26 @@
-# Locate SDL_net library
-# This module defines
-# SDLNET_LIBRARY, the name of the library to link against
-# SDLNET_FOUND, if false, do not try to link against
-# SDLNET_INCLUDE_DIR, where to find the headers
+# - Locate SDL_net library
+# This module defines:
+# SDL_NET_LIBRARIES, the name of the library to link against
+# SDL_NET_INCLUDE_DIRS, where to find the headers
+# SDL_NET_FOUND, if false, do not try to link against
+# SDL_NET_VERSION_STRING - human-readable string containing the version of SDL_net
+#
+# For backward compatiblity the following variables are also set:
+# SDLNET_LIBRARY (same value as SDL_NET_LIBRARIES)
+# SDLNET_INCLUDE_DIR (same value as SDL_NET_INCLUDE_DIRS)
+# SDLNET_FOUND (same value as SDL_NET_FOUND)
#
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
# used in building SDL.
#
-# Created by Eric Wing. This was influenced by the FindSDL.cmake
-# module, but with modifications to recognize OS X frameworks and
+# Created by Eric Wing. This was influenced by the FindSDL.cmake
+# module, but with modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -25,45 +32,56 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(SDLNET_INCLUDE_DIR SDL_net.h
+if(NOT SDL_NET_INCLUDE_DIR AND SDLNET_INCLUDE_DIR)
+ set(SDL_NET_INCLUDE_DIR ${SDLNET_INCLUDE_DIR} CACHE PATH "directory cache
+entry initialized from old variable name")
+endif()
+find_path(SDL_NET_INCLUDE_DIR SDL_net.h
HINTS
- $ENV{SDLNETDIR}
- $ENV{SDLDIR}
- PATH_SUFFIXES include
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local/include/SDL
- /usr/include/SDL
- /usr/local/include/SDL12
- /usr/local/include/SDL11 # FreeBSD ports
- /usr/include/SDL12
- /usr/include/SDL11
- /sw/include/SDL # Fink
- /sw/include
- /opt/local/include/SDL # DarwinPorts
- /opt/local/include
- /opt/csw/include/SDL # Blastwave
- /opt/csw/include
- /opt/include/SDL
- /opt/include
+ ENV SDLNETDIR
+ ENV SDLDIR
+ PATH_SUFFIXES SDL SDL12 SDL11
)
-FIND_LIBRARY(SDLNET_LIBRARY
+
+if(NOT SDL_NET_LIBRARY AND SDLNET_LIBRARY)
+ set(SDL_NET_LIBRARY ${SDLNET_LIBRARY} CACHE FILEPATH "file cache entry
+initialized from old variable name")
+endif()
+find_library(SDL_NET_LIBRARY
NAMES SDL_net
HINTS
- $ENV{SDLNETDIR}
- $ENV{SDLDIR}
- PATH_SUFFIXES lib64 lib
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /sw
- /opt/local
- /opt/csw
- /opt
+ ENV SDLNETDIR
+ ENV SDLDIR
)
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+if(SDL_NET_INCLUDE_DIR AND EXISTS "${SDL_NET_INCLUDE_DIR}/SDL_net.h")
+ file(STRINGS "${SDL_NET_INCLUDE_DIR}/SDL_net.h" SDL_NET_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_NET_MAJOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_NET_INCLUDE_DIR}/SDL_net.h" SDL_NET_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_NET_MINOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_NET_INCLUDE_DIR}/SDL_net.h" SDL_NET_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_NET_PATCHLEVEL[ \t]+[0-9]+$")
+ string(REGEX REPLACE "^#define[ \t]+SDL_NET_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_NET_VERSION_MAJOR "${SDL_NET_VERSION_MAJOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_NET_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_NET_VERSION_MINOR "${SDL_NET_VERSION_MINOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_NET_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_NET_VERSION_PATCH "${SDL_NET_VERSION_PATCH_LINE}")
+ set(SDL_NET_VERSION_STRING ${SDL_NET_VERSION_MAJOR}.${SDL_NET_VERSION_MINOR}.${SDL_NET_VERSION_PATCH})
+ unset(SDL_NET_VERSION_MAJOR_LINE)
+ unset(SDL_NET_VERSION_MINOR_LINE)
+ unset(SDL_NET_VERSION_PATCH_LINE)
+ unset(SDL_NET_VERSION_MAJOR)
+ unset(SDL_NET_VERSION_MINOR)
+ unset(SDL_NET_VERSION_PATCH)
+endif()
+
+set(SDL_NET_LIBRARIES ${SDL_NET_LIBRARY})
+set(SDL_NET_INCLUDE_DIRS ${SDL_NET_INCLUDE_DIR})
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_net
+ REQUIRED_VARS SDL_NET_LIBRARIES SDL_NET_INCLUDE_DIRS
+ VERSION_VAR SDL_NET_VERSION_STRING)
+
+# for backward compatiblity
+set(SDLNET_LIBRARY ${SDL_NET_LIBRARIES})
+set(SDLNET_INCLUDE_DIR ${SDL_NET_INCLUDE_DIRS})
+set(SDLNET_FOUND ${SDL_NET_FOUND})
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLNET
- REQUIRED_VARS SDLNET_LIBRARY SDLNET_INCLUDE_DIR)
+mark_as_advanced(SDL_NET_LIBRARY SDL_NET_INCLUDE_DIR)
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 35294a5e4..5ff50be64 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -1,63 +1,63 @@
-# Locates the SDL_sound library
-
-# This module depends on SDL being found and
+# - Locates the SDL_sound library
+#
+# This module depends on SDL being found and
# must be called AFTER FindSDL.cmake is called.
-
+#
# This module defines
-# SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
-# SDL_SOUND_FOUND, if false, do not try to link to SDL
-# SDL_SOUND_LIBRARIES, this contains the list of libraries that you need
-# to link against. This is a read-only variable and is marked INTERNAL.
-# SDL_SOUND_EXTRAS, this is an optional variable for you to add your own
-# flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
-# This is available mostly for cases this module failed to anticipate for
-# and you must add additional flags. This is marked as ADVANCED.
-
+# SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
+# SDL_SOUND_FOUND, if false, do not try to link to SDL_sound
+# SDL_SOUND_LIBRARIES, this contains the list of libraries that you need
+# to link against. This is a read-only variable and is marked INTERNAL.
+# SDL_SOUND_EXTRAS, this is an optional variable for you to add your own
+# flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
+# This is available mostly for cases this module failed to anticipate for
+# and you must add additional flags. This is marked as ADVANCED.
+# SDL_SOUND_VERSION_STRING, human-readable string containing the version of SDL_sound
#
# This module also defines (but you shouldn't need to use directly)
-# SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
-# against. Use SDL_SOUND_LIBRARIES for you link instructions and not this one.
+# SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
+# against. Use SDL_SOUND_LIBRARIES for you link instructions and not this one.
# And might define the following as needed
-# MIKMOD_LIBRARY
-# MODPLUG_LIBRARY
-# OGG_LIBRARY
-# VORBIS_LIBRARY
-# SMPEG_LIBRARY
-# FLAC_LIBRARY
-# SPEEX_LIBRARY
+# MIKMOD_LIBRARY
+# MODPLUG_LIBRARY
+# OGG_LIBRARY
+# VORBIS_LIBRARY
+# SMPEG_LIBRARY
+# FLAC_LIBRARY
+# SPEEX_LIBRARY
#
-# Typically, you should not use these variables directly, and you should use
-# SDL_SOUND_LIBRARIES which contains SDL_SOUND_LIBRARY and the other audio libraries
-# (if needed) to successfully compile on your system .
+# Typically, you should not use these variables directly, and you should use
+# SDL_SOUND_LIBRARIES which contains SDL_SOUND_LIBRARY and the other audio libraries
+# (if needed) to successfully compile on your system.
#
-# Created by Eric Wing.
+# Created by Eric Wing.
# This module is a bit more complicated than the other FindSDL* family modules.
# The reason is that SDL_sound can be compiled in a large variety of different ways
# which are independent of platform. SDL_sound may dynamically link against other 3rd
# party libraries to get additional codec support, such as Ogg Vorbis, SMPEG, ModPlug,
-# MikMod, FLAC, Speex, and potentially others.
-# Under some circumstances which I don't fully understand,
+# MikMod, FLAC, Speex, and potentially others.
+# Under some circumstances which I don't fully understand,
# there seems to be a requirement
-# that dependent libraries of libraries you use must also be explicitly
-# linked against in order to successfully compile. SDL_sound does not currently
+# that dependent libraries of libraries you use must also be explicitly
+# linked against in order to successfully compile. SDL_sound does not currently
# have any system in place to know how it was compiled.
-# So this CMake module does the hard work in trying to discover which 3rd party
+# So this CMake module does the hard work in trying to discover which 3rd party
# libraries are required for building (if any).
# This module uses a brute force approach to create a test program that uses SDL_sound,
-# and then tries to build it. If the build fails, it parses the error output for
+# and then tries to build it. If the build fails, it parses the error output for
# known symbol names to figure out which libraries are needed.
#
# Responds to the $SDLDIR and $SDLSOUNDDIR environmental variable that would
# correspond to the ./configure --prefix=$SDLDIR used in building SDL.
#
# On OSX, this will prefer the Framework version (if found) over others.
-# People will have to manually change the cache values of
+# People will have to manually change the cache values of
# SDL_LIBRARY to override this selectionor set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
-#
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -69,68 +69,45 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(SDL_SOUND_EXTRAS "" CACHE STRING "SDL_sound extra flags")
-MARK_AS_ADVANCED(SDL_SOUND_EXTRAS)
+set(SDL_SOUND_EXTRAS "" CACHE STRING "SDL_sound extra flags")
+mark_as_advanced(SDL_SOUND_EXTRAS)
# Find SDL_sound.h
-FIND_PATH(SDL_SOUND_INCLUDE_DIR SDL_sound.h
+find_path(SDL_SOUND_INCLUDE_DIR SDL_sound.h
HINTS
- $ENV{SDLSOUNDDIR}/include
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/include
- $ENV{SDLDIR}
- PATHS
- /usr/local/include/SDL
- /usr/include/SDL
- /usr/local/include/SDL12
- /usr/local/include/SDL11 # FreeBSD ports
- /usr/include/SDL12
- /usr/include/SDL11
- /sw/include/SDL # Fink
- /sw/include
- /opt/local/include/SDL # DarwinPorts
- /opt/local/include
- /opt/csw/include/SDL # Blastwave
- /opt/csw/include
- /opt/include/SDL
- /opt/include
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ PATH_SUFFIXES SDL SDL12 SDL11
)
-FIND_LIBRARY(SDL_SOUND_LIBRARY
+find_library(SDL_SOUND_LIBRARY
NAMES SDL_sound
HINTS
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- PATHS
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
)
-IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
+if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
# CMake is giving me problems using TRY_COMPILE with the CMAKE_FLAGS
# for the :STRING syntax if I have multiple values contained in a
# single variable. This is a problem for the SDL_LIBRARY variable
# because it does just that. When I feed this variable to the command,
- # only the first value gets the appropriate modifier (e.g. -I) and
+ # only the first value gets the appropriate modifier (e.g. -I) and
# the rest get dropped.
# To get multiple single variables to work, I must separate them with a "\;"
# I could go back and modify the FindSDL.cmake module, but that's kind of painful.
# The solution would be to try something like:
- # SET(SDL_TRY_COMPILE_LIBRARY_LIST "${SDL_TRY_COMPILE_LIBRARY_LIST}\;${CMAKE_THREAD_LIBS_INIT}")
+ # set(SDL_TRY_COMPILE_LIBRARY_LIST "${SDL_TRY_COMPILE_LIBRARY_LIST}\;${CMAKE_THREAD_LIBS_INIT}")
# Instead, it was suggested on the mailing list to write a temporary CMakeLists.txt
# with a temporary test project and invoke that with TRY_COMPILE.
# See message thread "Figuring out dependencies for a library in order to build"
- # 2005-07-16
- # TRY_COMPILE(
+ # 2005-07-16
+ # try_compile(
# MY_RESULT
# ${CMAKE_BINARY_DIR}
# ${PROJECT_SOURCE_DIR}/DetermineSoundLibs.c
- # CMAKE_FLAGS
+ # CMAKE_FLAGS
# -DINCLUDE_DIRECTORIES:STRING=${SDL_INCLUDE_DIR}\;${SDL_SOUND_INCLUDE_DIR}
# -DLINK_LIBRARIES:STRING=${SDL_SOUND_LIBRARY}\;${SDL_LIBRARY}
# OUTPUT_VARIABLE MY_OUTPUT
@@ -139,7 +116,7 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
# To minimize external dependencies, create a sdlsound test program
# which will be used to figure out if additional link dependencies are
# required for the link phase.
- FILE(WRITE ${PROJECT_BINARY_DIR}/CMakeTmp/DetermineSoundLibs.c
+ file(WRITE ${PROJECT_BINARY_DIR}/CMakeTmp/DetermineSoundLibs.c
"#include \"SDL_sound.h\"
#include \"SDL.h\"
int main(int argc, char* argv[])
@@ -149,253 +126,258 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
SDL_Init(0);
Sound_Init();
-
+
/* This doesn't actually have to work, but Init() is a no-op
* for some of the decoders, so this should force more symbols
* to be pulled in.
*/
sample = Sound_NewSampleFromFile(argv[1], &desired, 4096);
-
+
Sound_Quit();
SDL_Quit();
return 0;
}"
)
- # Calling
- # TARGET_LINK_LIBRARIES(DetermineSoundLibs "${SDL_SOUND_LIBRARY} ${SDL_LIBRARY})
+ # Calling
+ # target_link_libraries(DetermineSoundLibs "${SDL_SOUND_LIBRARY} ${SDL_LIBRARY})
# causes problems when SDL_LIBRARY looks like
# /Library/Frameworks/SDL.framework;-framework Cocoa
# The ;-framework Cocoa seems to be confusing CMake once the OS X
- # framework support was added. I was told that breaking up the list
+ # framework support was added. I was told that breaking up the list
# would fix the problem.
- SET(TMP_TRY_LIBS)
- FOREACH(lib ${SDL_SOUND_LIBRARY} ${SDL_LIBRARY})
- SET(TMP_TRY_LIBS "${TMP_TRY_LIBS} \"${lib}\"")
- ENDFOREACH(lib)
+ set(TMP_TRY_LIBS)
+ foreach(lib ${SDL_SOUND_LIBRARY} ${SDL_LIBRARY})
+ set(TMP_TRY_LIBS "${TMP_TRY_LIBS} \"${lib}\"")
+ endforeach()
+
+ # message("TMP_TRY_LIBS ${TMP_TRY_LIBS}")
- # MESSAGE("TMP_TRY_LIBS ${TMP_TRY_LIBS}")
-
# Write the CMakeLists.txt and test project
# Weird, this is still sketchy. If I don't quote the variables
- # in the TARGET_LINK_LIBRARIES, I seem to loose everything
+ # in the TARGET_LINK_LIBRARIES, I seem to loose everything
# in the SDL_LIBRARY string after the "-framework".
# But if I quote the stuff in INCLUDE_DIRECTORIES, it doesn't work.
- FILE(WRITE ${PROJECT_BINARY_DIR}/CMakeTmp/CMakeLists.txt
- "PROJECT(DetermineSoundLibs)
- INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR})
- ADD_EXECUTABLE(DetermineSoundLibs DetermineSoundLibs.c)
- TARGET_LINK_LIBRARIES(DetermineSoundLibs ${TMP_TRY_LIBS})"
+ file(WRITE ${PROJECT_BINARY_DIR}/CMakeTmp/CMakeLists.txt
+ "cmake_minimum_required(VERSION 2.8)
+ project(DetermineSoundLibs)
+ include_directories(${SDL_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR})
+ add_executable(DetermineSoundLibs DetermineSoundLibs.c)
+ target_link_libraries(DetermineSoundLibs ${TMP_TRY_LIBS})"
)
- TRY_COMPILE(
+ try_compile(
MY_RESULT
${PROJECT_BINARY_DIR}/CMakeTmp
${PROJECT_BINARY_DIR}/CMakeTmp
DetermineSoundLibs
OUTPUT_VARIABLE MY_OUTPUT
)
-
- # MESSAGE("${MY_RESULT}")
- # MESSAGE(${MY_OUTPUT})
-
- IF(NOT MY_RESULT)
-
+
+ # message("${MY_RESULT}")
+ # message(${MY_OUTPUT})
+
+ if(NOT MY_RESULT)
+
# I expect that MPGLIB, VOC, WAV, AIFF, and SHN are compiled in statically.
# I think Timidity is also compiled in statically.
# I've never had to explcitly link against Quicktime, so I'll skip that for now.
-
- SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARY})
-
+
+ set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARY})
+
# Find MikMod
- IF("${MY_OUTPUT}" MATCHES "MikMod_")
- FIND_LIBRARY(MIKMOD_LIBRARY
+ if("${MY_OUTPUT}" MATCHES "MikMod_")
+ find_library(MIKMOD_LIBRARY
NAMES libmikmod-coreaudio mikmod
PATHS
- $ENV{MIKMODDIR}/lib
- $ENV{MIKMODDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
- )
- IF(MIKMOD_LIBRARY)
- SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MIKMOD_LIBRARY})
- ENDIF(MIKMOD_LIBRARY)
- ENDIF("${MY_OUTPUT}" MATCHES "MikMod_")
-
+ ENV MIKMODDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES
+ lib
+ )
+ if(MIKMOD_LIBRARY)
+ set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MIKMOD_LIBRARY})
+ endif(MIKMOD_LIBRARY)
+ endif("${MY_OUTPUT}" MATCHES "MikMod_")
+
# Find ModPlug
- IF("${MY_OUTPUT}" MATCHES "MODPLUG_")
- FIND_LIBRARY(MODPLUG_LIBRARY
+ if("${MY_OUTPUT}" MATCHES "MODPLUG_")
+ find_library(MODPLUG_LIBRARY
NAMES modplug
PATHS
- $ENV{MODPLUGDIR}/lib
- $ENV{MODPLUGDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV MODPLUGDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES
+ lib
)
- IF(MODPLUG_LIBRARY)
- SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MODPLUG_LIBRARY})
- ENDIF(MODPLUG_LIBRARY)
- ENDIF("${MY_OUTPUT}" MATCHES "MODPLUG_")
+ if(MODPLUG_LIBRARY)
+ set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MODPLUG_LIBRARY})
+ endif()
+ endif()
+
-
# Find Ogg and Vorbis
- IF("${MY_OUTPUT}" MATCHES "ov_")
- FIND_LIBRARY(VORBIS_LIBRARY
+ if("${MY_OUTPUT}" MATCHES "ov_")
+ find_library(VORBIS_LIBRARY
NAMES vorbis Vorbis VORBIS
PATHS
- $ENV{VORBISDIR}/lib
- $ENV{VORBISDIR}
- $ENV{OGGDIR}/lib
- $ENV{OGGDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV VORBISDIR
+ ENV OGGDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES
+ lib
)
- IF(VORBIS_LIBRARY)
- SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${VORBIS_LIBRARY})
- ENDIF(VORBIS_LIBRARY)
-
- FIND_LIBRARY(OGG_LIBRARY
+ if(VORBIS_LIBRARY)
+ set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${VORBIS_LIBRARY})
+ endif()
+
+ find_library(OGG_LIBRARY
NAMES ogg Ogg OGG
PATHS
- $ENV{OGGDIR}/lib
- $ENV{OGGDIR}
- $ENV{VORBISDIR}/lib
- $ENV{VORBISDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV OGGDIR
+ ENV VORBISDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES
+ lib
)
- IF(OGG_LIBRARY)
- SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY})
- ENDIF(OGG_LIBRARY)
- ENDIF("${MY_OUTPUT}" MATCHES "ov_")
-
-
+ if(OGG_LIBRARY)
+ set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY})
+ endif()
+ endif()
+
+
# Find SMPEG
- IF("${MY_OUTPUT}" MATCHES "SMPEG_")
- FIND_LIBRARY(SMPEG_LIBRARY
+ if("${MY_OUTPUT}" MATCHES "SMPEG_")
+ find_library(SMPEG_LIBRARY
NAMES smpeg SMPEG Smpeg SMpeg
PATHS
- $ENV{SMPEGDIR}/lib
- $ENV{SMPEGDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV SMPEGDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES
+ lib
)
- IF(SMPEG_LIBRARY)
- SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SMPEG_LIBRARY})
- ENDIF(SMPEG_LIBRARY)
- ENDIF("${MY_OUTPUT}" MATCHES "SMPEG_")
-
-
+ if(SMPEG_LIBRARY)
+ set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SMPEG_LIBRARY})
+ endif()
+ endif()
+
+
# Find FLAC
- IF("${MY_OUTPUT}" MATCHES "FLAC_")
- FIND_LIBRARY(FLAC_LIBRARY
+ if("${MY_OUTPUT}" MATCHES "FLAC_")
+ find_library(FLAC_LIBRARY
NAMES flac FLAC
PATHS
- $ENV{FLACDIR}/lib
- $ENV{FLACDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV FLACDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES
+ lib
)
- IF(FLAC_LIBRARY)
- SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${FLAC_LIBRARY})
- ENDIF(FLAC_LIBRARY)
- ENDIF("${MY_OUTPUT}" MATCHES "FLAC_")
-
-
+ if(FLAC_LIBRARY)
+ set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${FLAC_LIBRARY})
+ endif()
+ endif()
+
+
# Hmmm...Speex seems to depend on Ogg. This might be a problem if
# the TRY_COMPILE attempt gets blocked at SPEEX before it can pull
# in the Ogg symbols. I'm not sure if I should duplicate the ogg stuff
# above for here or if two ogg entries will screw up things.
- IF("${MY_OUTPUT}" MATCHES "speex_")
- FIND_LIBRARY(SPEEX_LIBRARY
+ if("${MY_OUTPUT}" MATCHES "speex_")
+ find_library(SPEEX_LIBRARY
NAMES speex SPEEX
PATHS
- $ENV{SPEEXDIR}/lib
- $ENV{SPEEXDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV SPEEXDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES
+ lib
)
- IF(SPEEX_LIBRARY)
- SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SPEEX_LIBRARY})
- ENDIF(SPEEX_LIBRARY)
-
+ if(SPEEX_LIBRARY)
+ set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SPEEX_LIBRARY})
+ endif()
+
# Find OGG (needed for Speex)
# We might have already found Ogg for Vorbis, so skip it if so.
- IF(NOT OGG_LIBRARY)
- FIND_LIBRARY(OGG_LIBRARY
+ if(NOT OGG_LIBRARY)
+ find_library(OGG_LIBRARY
NAMES ogg Ogg OGG
PATHS
- $ENV{OGGDIR}/lib
- $ENV{OGGDIR}
- $ENV{VORBISDIR}/lib
- $ENV{VORBISDIR}
- $ENV{SPEEXDIR}/lib
- $ENV{SPEEXDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV OGGDIR
+ ENV VORBISDIR
+ ENV SPEEXDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES lib
)
- IF(OGG_LIBRARY)
- SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY})
- ENDIF(OGG_LIBRARY)
- ENDIF(NOT OGG_LIBRARY)
- ENDIF("${MY_OUTPUT}" MATCHES "speex_")
-
- ELSE(NOT MY_RESULT)
- SET(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARY}" CACHE INTERNAL "SDL_sound and dependent libraries")
- ENDIF(NOT MY_RESULT)
-
- SET(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries")
- ENDIF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
-
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_SOUND
- REQUIRED_VARS SDL_SOUND_LIBRARIES SDL_SOUND_INCLUDE_DIR)
+ if(OGG_LIBRARY)
+ set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY})
+ endif()
+ endif()
+ endif()
+
+ else()
+ set(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARY}" CACHE INTERNAL "SDL_sound and dependent libraries")
+ endif()
+
+ set(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries")
+ endif()
+
+if(SDL_SOUND_INCLUDE_DIR AND EXISTS "${SDL_SOUND_INCLUDE_DIR}/SDL_sound.h")
+ file(STRINGS "${SDL_SOUND_INCLUDE_DIR}/SDL_sound.h" SDL_SOUND_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SOUND_VER_MAJOR[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_SOUND_INCLUDE_DIR}/SDL_sound.h" SDL_SOUND_VERSION_MINOR_LINE REGEX "^#define[ \t]+SOUND_VER_MINOR[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_SOUND_INCLUDE_DIR}/SDL_sound.h" SDL_SOUND_VERSION_PATCH_LINE REGEX "^#define[ \t]+SOUND_VER_PATCH[ \t]+[0-9]+$")
+ string(REGEX REPLACE "^#define[ \t]+SOUND_VER_MAJOR[ \t]+([0-9]+)$" "\\1" SDL_SOUND_VERSION_MAJOR "${SDL_SOUND_VERSION_MAJOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SOUND_VER_MINOR[ \t]+([0-9]+)$" "\\1" SDL_SOUND_VERSION_MINOR "${SDL_SOUND_VERSION_MINOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SOUND_VER_PATCH[ \t]+([0-9]+)$" "\\1" SDL_SOUND_VERSION_PATCH "${SDL_SOUND_VERSION_PATCH_LINE}")
+ set(SDL_SOUND_VERSION_STRING ${SDL_SOUND_VERSION_MAJOR}.${SDL_SOUND_VERSION_MINOR}.${SDL_SOUND_VERSION_PATCH})
+ unset(SDL_SOUND_VERSION_MAJOR_LINE)
+ unset(SDL_SOUND_VERSION_MINOR_LINE)
+ unset(SDL_SOUND_VERSION_PATCH_LINE)
+ unset(SDL_SOUND_VERSION_MAJOR)
+ unset(SDL_SOUND_VERSION_MINOR)
+ unset(SDL_SOUND_VERSION_PATCH)
+endif()
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_sound
+ REQUIRED_VARS SDL_SOUND_LIBRARY SDL_SOUND_INCLUDE_DIR
+ VERSION_VAR SDL_SOUND_VERSION_STRING)
diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index 184b6c3f5..2cc5ee232 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -1,19 +1,26 @@
-# Locate SDL_ttf library
-# This module defines
-# SDLTTF_LIBRARY, the name of the library to link against
-# SDLTTF_FOUND, if false, do not try to link to SDL
-# SDLTTF_INCLUDE_DIR, where to find SDL/SDL.h
+# - Locate SDL_ttf library
+# This module defines:
+# SDL_TTF_LIBRARIES, the name of the library to link against
+# SDL_TTF_INCLUDE_DIRS, where to find the headers
+# SDL_TTF_FOUND, if false, do not try to link against
+# SDL_TTF_VERSION_STRING - human-readable string containing the version of SDL_ttf
+#
+# For backward compatiblity the following variables are also set:
+# SDLTTF_LIBRARY (same value as SDL_TTF_LIBRARIES)
+# SDLTTF_INCLUDE_DIR (same value as SDL_TTF_INCLUDE_DIRS)
+# SDLTTF_FOUND (same value as SDL_TTF_FOUND)
#
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
# used in building SDL.
#
-# Created by Eric Wing. This was influenced by the FindSDL.cmake
-# module, but with modifications to recognize OS X frameworks and
+# Created by Eric Wing. This was influenced by the FindSDL.cmake
+# module, but with modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -25,46 +32,56 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(SDLTTF_INCLUDE_DIR SDL_ttf.h
+if(NOT SDL_TTF_INCLUDE_DIR AND SDLTTF_INCLUDE_DIR)
+ set(SDL_TTF_INCLUDE_DIR ${SDLTTF_INCLUDE_DIR} CACHE PATH "directory cache
+entry initialized from old variable name")
+endif()
+find_path(SDL_TTF_INCLUDE_DIR SDL_ttf.h
HINTS
- $ENV{SDLTTFDIR}
- $ENV{SDLDIR}
- PATH_SUFFIXES include
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local/include/SDL
- /usr/include/SDL
- /usr/local/include/SDL12
- /usr/local/include/SDL11 # FreeBSD ports
- /usr/include/SDL12
- /usr/include/SDL11
- /sw/include/SDL # Fink
- /sw/include
- /opt/local/include/SDL # DarwinPorts
- /opt/local/include
- /opt/csw/include/SDL # Blastwave
- /opt/csw/include
- /opt/include/SDL
- /opt/include
+ ENV SDLTTFDIR
+ ENV SDLDIR
+ PATH_SUFFIXES SDL SDL12 SDL11
)
-FIND_LIBRARY(SDLTTF_LIBRARY
+if(NOT SDL_TTF_LIBRARY AND SDLTTF_LIBRARY)
+ set(SDL_TTF_LIBRARY ${SDLTTF_LIBRARY} CACHE FILEPATH "file cache entry
+initialized from old variable name")
+endif()
+find_library(SDL_TTF_LIBRARY
NAMES SDL_ttf
HINTS
- $ENV{SDLTTFDIR}
- $ENV{SDLDIR}
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /sw
- /opt/local
- /opt/csw
- /opt
- PATH_SUFFIXES lib64 lib
+ ENV SDLTTFDIR
+ ENV SDLDIR
)
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+if(SDL_TTF_INCLUDE_DIR AND EXISTS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h")
+ file(STRINGS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+[0-9]+$")
+ string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_MAJOR "${SDL_TTF_VERSION_MAJOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_MINOR "${SDL_TTF_VERSION_MINOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_PATCH "${SDL_TTF_VERSION_PATCH_LINE}")
+ set(SDL_TTF_VERSION_STRING ${SDL_TTF_VERSION_MAJOR}.${SDL_TTF_VERSION_MINOR}.${SDL_TTF_VERSION_PATCH})
+ unset(SDL_TTF_VERSION_MAJOR_LINE)
+ unset(SDL_TTF_VERSION_MINOR_LINE)
+ unset(SDL_TTF_VERSION_PATCH_LINE)
+ unset(SDL_TTF_VERSION_MAJOR)
+ unset(SDL_TTF_VERSION_MINOR)
+ unset(SDL_TTF_VERSION_PATCH)
+endif()
+
+set(SDL_TTF_LIBRARIES ${SDL_TTF_LIBRARY})
+set(SDL_TTF_INCLUDE_DIRS ${SDL_TTF_INCLUDE_DIR})
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_ttf
+ REQUIRED_VARS SDL_TTF_LIBRARIES SDL_TTF_INCLUDE_DIRS
+ VERSION_VAR SDL_TTF_VERSION_STRING)
+
+# for backward compatiblity
+set(SDLTTF_LIBRARY ${SDL_TTF_LIBRARIES})
+set(SDLTTF_INCLUDE_DIR ${SDL_TTF_INCLUDE_DIRS})
+set(SDLTTF_FOUND ${SDL_TTF_FOUND})
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLTTF
- REQUIRED_VARS SDLTTF_LIBRARY SDLTTF_INCLUDE_DIR)
+mark_as_advanced(SDL_TTF_LIBRARY SDL_TTF_INCLUDE_DIR)
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake
index 2e34eb1b4..db60b888c 100644
--- a/Modules/FindSWIG.cmake
+++ b/Modules/FindSWIG.cmake
@@ -6,7 +6,7 @@
# SWIG_VERSION - the version number of the swig executable
#
# The minimum required version of SWIG can be specified using the
-# standard syntax, e.g. FIND_PACKAGE(SWIG 1.1)
+# standard syntax, e.g. find_package(SWIG 1.1)
#
# All information is collected from the SWIG_EXECUTABLE so the
# version to be found can be changed from the command line by
@@ -27,42 +27,42 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(SWIG_EXECUTABLE NAMES swig2.0 swig)
+find_program(SWIG_EXECUTABLE NAMES swig2.0 swig)
-IF(SWIG_EXECUTABLE)
- EXECUTE_PROCESS(COMMAND ${SWIG_EXECUTABLE} -swiglib
+if(SWIG_EXECUTABLE)
+ execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib
OUTPUT_VARIABLE SWIG_swiglib_output
ERROR_VARIABLE SWIG_swiglib_error
RESULT_VARIABLE SWIG_swiglib_result)
- IF(SWIG_swiglib_result)
- IF(SWIG_FIND_REQUIRED)
- MESSAGE(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
- ELSE(SWIG_FIND_REQUIRED)
- MESSAGE(STATUS "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
- ENDIF(SWIG_FIND_REQUIRED)
- ELSE(SWIG_swiglib_result)
- STRING(REGEX REPLACE "[\n\r]+" ";" SWIG_swiglib_output ${SWIG_swiglib_output})
+ if(SWIG_swiglib_result)
+ if(SWIG_FIND_REQUIRED)
+ message(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
+ else()
+ message(STATUS "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
+ endif()
+ else()
+ string(REGEX REPLACE "[\n\r]+" ";" SWIG_swiglib_output ${SWIG_swiglib_output})
# force the path to be computed each time in case SWIG_EXECUTABLE has changed.
- SET(SWIG_DIR SWIG_DIR-NOTFOUND)
- FIND_PATH(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output})
- IF(SWIG_DIR)
- SET(SWIG_USE_FILE ${CMAKE_ROOT}/Modules/UseSWIG.cmake)
- EXECUTE_PROCESS(COMMAND ${SWIG_EXECUTABLE} -version
+ set(SWIG_DIR SWIG_DIR-NOTFOUND)
+ find_path(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output})
+ if(SWIG_DIR)
+ set(SWIG_USE_FILE ${CMAKE_ROOT}/Modules/UseSWIG.cmake)
+ execute_process(COMMAND ${SWIG_EXECUTABLE} -version
OUTPUT_VARIABLE SWIG_version_output
ERROR_VARIABLE SWIG_version_output
RESULT_VARIABLE SWIG_version_result)
- IF(SWIG_version_result)
- MESSAGE(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -version\" failed with output:\n${SWIG_version_output}")
- ELSE(SWIG_version_result)
- STRING(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1"
+ if(SWIG_version_result)
+ message(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -version\" failed with output:\n${SWIG_version_output}")
+ else()
+ string(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1"
SWIG_version_output "${SWIG_version_output}")
- SET(SWIG_VERSION ${SWIG_version_output} CACHE STRING "Swig version" FORCE)
- ENDIF(SWIG_version_result)
- ENDIF(SWIG_DIR)
- ENDIF(SWIG_swiglib_result)
-ENDIF(SWIG_EXECUTABLE)
+ set(SWIG_VERSION ${SWIG_version_output} CACHE STRING "Swig version" FORCE)
+ endif()
+ endif()
+ endif()
+endif()
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SWIG REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR
VERSION_VAR SWIG_VERSION )
diff --git a/Modules/FindSelfPackers.cmake b/Modules/FindSelfPackers.cmake
index ffca84200..7726dce41 100644
--- a/Modules/FindSelfPackers.cmake
+++ b/Modules/FindSelfPackers.cmake
@@ -1,5 +1,5 @@
# - Find upx
-# This module looks for some executable packers (i.e. softwares that
+# This module looks for some executable packers (i.e. software that
# compress executables or shared libs into on-the-fly self-extracting
# executables or shared libs.
# Examples:
@@ -18,27 +18,27 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(FindCygwin)
+include(FindCygwin)
-FIND_PROGRAM(SELF_PACKER_FOR_EXECUTABLE
+find_program(SELF_PACKER_FOR_EXECUTABLE
upx
${CYGWIN_INSTALL_PATH}/bin
/bin
- /usr/bin
+ /usr/bin
/usr/local/bin
/sbin
)
-FIND_PROGRAM(SELF_PACKER_FOR_SHARED_LIB
+find_program(SELF_PACKER_FOR_SHARED_LIB
upx
${CYGWIN_INSTALL_PATH}/bin
/bin
- /usr/bin
+ /usr/bin
/usr/local/bin
/sbin
)
-MARK_AS_ADVANCED(
+mark_as_advanced(
SELF_PACKER_FOR_EXECUTABLE
SELF_PACKER_FOR_SHARED_LIB
)
@@ -46,23 +46,23 @@ MARK_AS_ADVANCED(
#
# Set flags
#
-IF (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
- SET (SELF_PACKER_FOR_EXECUTABLE_FLAGS "-q" CACHE STRING
+if (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
+ set (SELF_PACKER_FOR_EXECUTABLE_FLAGS "-q" CACHE STRING
"Flags for the executable self-packer.")
-ELSE (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
- SET (SELF_PACKER_FOR_EXECUTABLE_FLAGS "" CACHE STRING
+else ()
+ set (SELF_PACKER_FOR_EXECUTABLE_FLAGS "" CACHE STRING
"Flags for the executable self-packer.")
-ENDIF (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
+endif ()
-IF (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
- SET (SELF_PACKER_FOR_SHARED_LIB_FLAGS "-q" CACHE STRING
+if (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
+ set (SELF_PACKER_FOR_SHARED_LIB_FLAGS "-q" CACHE STRING
"Flags for the shared lib self-packer.")
-ELSE (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
- SET (SELF_PACKER_FOR_SHARED_LIB_FLAGS "" CACHE STRING
+else ()
+ set (SELF_PACKER_FOR_SHARED_LIB_FLAGS "" CACHE STRING
"Flags for the shared lib self-packer.")
-ENDIF (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
+endif ()
-MARK_AS_ADVANCED(
+mark_as_advanced(
SELF_PACKER_FOR_EXECUTABLE_FLAGS
SELF_PACKER_FOR_SHARED_LIB_FLAGS
)
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index 48d195a1e..a032496d0 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -16,11 +16,11 @@
# macro SQUISH_ADD_TEST(testName applicationUnderTest testSuite testCase)
#
# ---- Typical Use
-# ENABLE_TESTING()
-# FIND_PACKAGE(Squish)
-# IF (SQUISH_FOUND)
+# enable_testing()
+# find_package(Squish)
+# if (SQUISH_FOUND)
# SQUISH_ADD_TEST(myTestName myApplication testSuiteName testCaseName)
-# ENDIF (SQUISH_FOUND)
+# endif ()
#
#=============================================================================
@@ -36,26 +36,27 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(SQUISH_INSTALL_DIR_STRING "Directory containing the bin, doc, and lib directories for Squish; this should be the root of the installation directory.")
-SET(SQUISH_SERVER_EXECUTABLE_STRING "The squishserver executable program.")
-SET(SQUISH_CLIENT_EXECUTABLE_STRING "The squishclient executable program.")
+set(SQUISH_INSTALL_DIR_STRING "Directory containing the bin, doc, and lib directories for Squish; this should be the root of the installation directory.")
+set(SQUISH_SERVER_EXECUTABLE_STRING "The squishserver executable program.")
+set(SQUISH_CLIENT_EXECUTABLE_STRING "The squishclient executable program.")
# Search only if the location is not already known.
-IF(NOT SQUISH_INSTALL_DIR)
+if(NOT SQUISH_INSTALL_DIR)
# Get the system search path as a list.
- FILE(TO_CMAKE_PATH "$ENV{PATH}" SQUISH_INSTALL_DIR_SEARCH2)
+ file(TO_CMAKE_PATH "$ENV{PATH}" SQUISH_INSTALL_DIR_SEARCH2)
# Construct a set of paths relative to the system search path.
- SET(SQUISH_INSTALL_DIR_SEARCH "")
- FOREACH(dir ${SQUISH_INSTALL_DIR_SEARCH2})
- SET(SQUISH_INSTALL_DIR_SEARCH ${SQUISH_INSTALL_DIR_SEARCH} "${dir}/../lib/fltk")
- ENDFOREACH(dir)
- STRING(REPLACE "//" "/" SQUISH_INSTALL_DIR_SEARCH "${SQUISH_INSTALL_DIR_SEARCH}")
+ set(SQUISH_INSTALL_DIR_SEARCH "")
+ foreach(dir ${SQUISH_INSTALL_DIR_SEARCH2})
+ set(SQUISH_INSTALL_DIR_SEARCH ${SQUISH_INSTALL_DIR_SEARCH} "${dir}/../lib/fltk")
+ endforeach()
+ string(REPLACE "//" "/" SQUISH_INSTALL_DIR_SEARCH "${SQUISH_INSTALL_DIR_SEARCH}")
# Look for an installation
- FIND_PATH(SQUISH_INSTALL_DIR bin/squishrunner
+ find_path(SQUISH_INSTALL_DIR bin/squishrunner
+ HINTS
# Look for an environment variable SQUISH_INSTALL_DIR.
- $ENV{SQUISH_INSTALL_DIR}
+ ENV SQUISH_INSTALL_DIR
# Look in places relative to the system executable search path.
${SQUISH_INSTALL_DIR_SEARCH}
@@ -65,49 +66,49 @@ IF(NOT SQUISH_INSTALL_DIR)
DOC "The ${SQUISH_INSTALL_DIR_STRING}"
)
-ENDIF(NOT SQUISH_INSTALL_DIR)
+endif()
# search for the executables
-IF(SQUISH_INSTALL_DIR)
- SET(SQUISH_INSTALL_DIR_FOUND 1)
+if(SQUISH_INSTALL_DIR)
+ set(SQUISH_INSTALL_DIR_FOUND 1)
# find the client program
- IF(NOT SQUISH_CLIENT_EXECUTABLE)
- FIND_PROGRAM(SQUISH_CLIENT_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishrunner DOC "The ${SQUISH_CLIENT_EXECUTABLE_STRING}")
- ENDIF(NOT SQUISH_CLIENT_EXECUTABLE)
+ if(NOT SQUISH_CLIENT_EXECUTABLE)
+ find_program(SQUISH_CLIENT_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishrunner DOC "The ${SQUISH_CLIENT_EXECUTABLE_STRING}")
+ endif()
# find the server program
- IF(NOT SQUISH_SERVER_EXECUTABLE)
- FIND_PROGRAM(SQUISH_SERVER_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishserver DOC "The ${SQUISH_SERVER_EXECUTABLE_STRING}")
- ENDIF(NOT SQUISH_SERVER_EXECUTABLE)
+ if(NOT SQUISH_SERVER_EXECUTABLE)
+ find_program(SQUISH_SERVER_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishserver DOC "The ${SQUISH_SERVER_EXECUTABLE_STRING}")
+ endif()
-ELSE(SQUISH_INSTALL_DIR)
- SET(SQUISH_INSTALL_DIR_FOUND 0)
-ENDIF(SQUISH_INSTALL_DIR)
+else()
+ set(SQUISH_INSTALL_DIR_FOUND 0)
+endif()
# record if executables are set
-IF(SQUISH_CLIENT_EXECUTABLE)
- SET(SQUISH_CLIENT_EXECUTABLE_FOUND 1)
-ELSE(SQUISH_CLIENT_EXECUTABLE)
- SET(SQUISH_CLIENT_EXECUTABLE_FOUND 0)
-ENDIF(SQUISH_CLIENT_EXECUTABLE)
-
-IF(SQUISH_SERVER_EXECUTABLE)
- SET(SQUISH_SERVER_EXECUTABLE_FOUND 1)
-ELSE(SQUISH_SERVER_EXECUTABLE)
- SET(SQUISH_SERVER_EXECUTABLE_FOUND 0)
-ENDIF(SQUISH_SERVER_EXECUTABLE)
+if(SQUISH_CLIENT_EXECUTABLE)
+ set(SQUISH_CLIENT_EXECUTABLE_FOUND 1)
+else()
+ set(SQUISH_CLIENT_EXECUTABLE_FOUND 0)
+endif()
+
+if(SQUISH_SERVER_EXECUTABLE)
+ set(SQUISH_SERVER_EXECUTABLE_FOUND 1)
+else()
+ set(SQUISH_SERVER_EXECUTABLE_FOUND 0)
+endif()
# record if Squish was found
-SET(SQUISH_FOUND 1)
-FOREACH(var SQUISH_INSTALL_DIR_FOUND SQUISH_CLIENT_EXECUTABLE_FOUND SQUISH_SERVER_EXECUTABLE_FOUND)
- IF(NOT ${var})
- SET(SQUISH_FOUND 0)
- ENDIF(NOT ${var})
-ENDFOREACH(var)
-
-MACRO(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper)
- ADD_TEST(${testName}
+set(SQUISH_FOUND 1)
+foreach(var SQUISH_INSTALL_DIR_FOUND SQUISH_CLIENT_EXECUTABLE_FOUND SQUISH_SERVER_EXECUTABLE_FOUND)
+ if(NOT ${var})
+ set(SQUISH_FOUND 0)
+ endif()
+endforeach()
+
+macro(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper)
+ add_test(${testName}
${CMAKE_COMMAND} -V -VV
"-Dsquish_aut:STRING=${testAUT}"
"-Dsquish_server_executable:STRING=${SQUISH_SERVER_EXECUTABLE}"
@@ -118,8 +119,8 @@ MACRO(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper)
"-Dsquish_wrapper:STRING=${testWraper}"
-P "${CMAKE_ROOT}/Modules/SquishTestScript.cmake"
)
- SET_TESTS_PROPERTIES(${testName}
+ set_tests_properties(${testName}
PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED;ERROR;FATAL"
)
-ENDMACRO(SQUISH_ADD_TEST)
-
+endmacro()
+
diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake
index 4166d99ab..f1bfc75bc 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -6,7 +6,7 @@
# SUBVERSION_FOUND - same as Subversion_FOUND, set for compatiblity reasons
#
# The minimum required version of Subversion can be specified using the
-# standard syntax, e.g. FIND_PACKAGE(Subversion 1.4)
+# standard syntax, e.g. find_package(Subversion 1.4)
#
# If the command line client executable is found two macros are defined:
# Subversion_WC_INFO(<dir> <var-prefix>)
@@ -25,13 +25,13 @@
# variable:
# <var-prefix>_LAST_CHANGED_LOG - last log of base revision
# Example usage:
-# FIND_PACKAGE(Subversion)
-# IF(SUBVERSION_FOUND)
+# find_package(Subversion)
+# if(SUBVERSION_FOUND)
# Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
-# MESSAGE("Current revision is ${Project_WC_REVISION}")
+# message("Current revision is ${Project_WC_REVISION}")
# Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
-# MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}")
-# ENDIF(SUBVERSION_FOUND)
+# message("Last changed log is ${Project_LAST_CHANGED_LOG}")
+# endif()
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
@@ -47,85 +47,85 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(Subversion_SVN_EXECUTABLE svn
+find_program(Subversion_SVN_EXECUTABLE svn
DOC "subversion command line client")
-MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE)
+mark_as_advanced(Subversion_SVN_EXECUTABLE)
-IF(Subversion_SVN_EXECUTABLE)
+if(Subversion_SVN_EXECUTABLE)
# the subversion commands should be executed with the C locale, otherwise
# the message (which are parsed) may be translated, Alex
- SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
- SET(ENV{LC_ALL} C)
+ set(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
+ set(ENV{LC_ALL} C)
- EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version
+ execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} --version
OUTPUT_VARIABLE Subversion_VERSION_SVN
OUTPUT_STRIP_TRAILING_WHITESPACE)
# restore the previous LC_ALL
- SET(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
+ set(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
- STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*"
+ string(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*"
"\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}")
- MACRO(Subversion_WC_INFO dir prefix)
+ macro(Subversion_WC_INFO dir prefix)
# the subversion commands should be executed with the C locale, otherwise
# the message (which are parsed) may be translated, Alex
- SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
- SET(ENV{LC_ALL} C)
+ set(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
+ set(ENV{LC_ALL} C)
- EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} info ${dir}
+ execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} info ${dir}
OUTPUT_VARIABLE ${prefix}_WC_INFO
ERROR_VARIABLE Subversion_svn_info_error
RESULT_VARIABLE Subversion_svn_info_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
- IF(NOT ${Subversion_svn_info_result} EQUAL 0)
- MESSAGE(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}")
- ELSE(NOT ${Subversion_svn_info_result} EQUAL 0)
+ if(NOT ${Subversion_svn_info_result} EQUAL 0)
+ message(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}")
+ else()
- STRING(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*"
+ string(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*"
"\\2" ${prefix}_WC_URL "${${prefix}_WC_INFO}")
- STRING(REGEX REPLACE "^(.*\n)?Repository Root: ([^\n]+).*"
+ string(REGEX REPLACE "^(.*\n)?Repository Root: ([^\n]+).*"
"\\2" ${prefix}_WC_ROOT "${${prefix}_WC_INFO}")
- STRING(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
+ string(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
"\\2" ${prefix}_WC_REVISION "${${prefix}_WC_INFO}")
- STRING(REGEX REPLACE "^(.*\n)?Last Changed Author: ([^\n]+).*"
+ string(REGEX REPLACE "^(.*\n)?Last Changed Author: ([^\n]+).*"
"\\2" ${prefix}_WC_LAST_CHANGED_AUTHOR "${${prefix}_WC_INFO}")
- STRING(REGEX REPLACE "^(.*\n)?Last Changed Rev: ([^\n]+).*"
+ string(REGEX REPLACE "^(.*\n)?Last Changed Rev: ([^\n]+).*"
"\\2" ${prefix}_WC_LAST_CHANGED_REV "${${prefix}_WC_INFO}")
- STRING(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*"
+ string(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*"
"\\2" ${prefix}_WC_LAST_CHANGED_DATE "${${prefix}_WC_INFO}")
- ENDIF(NOT ${Subversion_svn_info_result} EQUAL 0)
+ endif()
# restore the previous LC_ALL
- SET(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
+ set(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
- ENDMACRO(Subversion_WC_INFO)
+ endmacro()
- MACRO(Subversion_WC_LOG dir prefix)
+ macro(Subversion_WC_LOG dir prefix)
# This macro can block if the certificate is not signed:
# svn ask you to accept the certificate and wait for your answer
# This macro requires a svn server network access (Internet most of the time)
# and can also be slow since it access the svn server
- EXECUTE_PROCESS(COMMAND
+ execute_process(COMMAND
${Subversion_SVN_EXECUTABLE} --non-interactive log -r BASE ${dir}
OUTPUT_VARIABLE ${prefix}_LAST_CHANGED_LOG
ERROR_VARIABLE Subversion_svn_log_error
RESULT_VARIABLE Subversion_svn_log_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
- IF(NOT ${Subversion_svn_log_result} EQUAL 0)
- MESSAGE(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} log -r BASE ${dir}\" failed with output:\n${Subversion_svn_log_error}")
- ENDIF(NOT ${Subversion_svn_log_result} EQUAL 0)
- ENDMACRO(Subversion_WC_LOG)
+ if(NOT ${Subversion_svn_log_result} EQUAL 0)
+ message(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} log -r BASE ${dir}\" failed with output:\n${Subversion_svn_log_error}")
+ endif()
+ endmacro()
-ENDIF(Subversion_SVN_EXECUTABLE)
+endif()
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Subversion REQUIRED_VARS Subversion_SVN_EXECUTABLE
VERSION_VAR Subversion_VERSION_SVN )
# for compatibility
-SET(Subversion_FOUND ${SUBVERSION_FOUND})
-SET(Subversion_SVN_FOUND ${SUBVERSION_FOUND})
+set(Subversion_FOUND ${SUBVERSION_FOUND})
+set(Subversion_SVN_FOUND ${SUBVERSION_FOUND})
diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake
index 7f6d3a7ee..0d20da59a 100644
--- a/Modules/FindTCL.cmake
+++ b/Modules/FindTCL.cmake
@@ -18,11 +18,11 @@
# - The stub libraries are now found in FindTclStub.cmake
# => they were only useful for people writing Tcl/Tk extensions.
# - TCL_LIBRARY_DEBUG and TK_LIBRARY_DEBUG were removed.
-# => these libs are not packaged by default with Tcl/Tk distributions.
+# => these libs are not packaged by default with Tcl/Tk distributions.
# Even when Tcl/Tk is built from source, several flavors of debug libs
# are created and there is no real reason to pick a single one
-# specifically (say, amongst tcl84g, tcl84gs, or tcl84sgx).
-# Let's leave that choice to the user by allowing him to assign
+# specifically (say, amongst tcl84g, tcl84gs, or tcl84sgx).
+# Let's leave that choice to the user by allowing him to assign
# TCL_LIBRARY to any Tcl library, debug or not.
# - TK_INTERNAL_PATH was removed.
# => this ended up being only a Win32 variable, and there is a lot of
@@ -44,38 +44,38 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(CMakeFindFrameworks)
-INCLUDE(FindTclsh)
-INCLUDE(FindWish)
+include(CMakeFindFrameworks)
+include(FindTclsh)
+include(FindWish)
-IF(TCLSH_VERSION_STRING)
- SET(TCL_TCLSH_VERSION "${TCLSH_VERSION_STRING}")
-ELSE(TCLSH_VERSION_STRING)
- GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
- GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
- STRING(REGEX REPLACE
+if(TCLSH_VERSION_STRING)
+ set(TCL_TCLSH_VERSION "${TCLSH_VERSION_STRING}")
+else()
+ get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
+ get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
+ string(REGEX REPLACE
"^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
-ENDIF(TCLSH_VERSION_STRING)
+endif()
-GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
-GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TK_WISH_PATH "${TK_WISH}" PATH)
+get_filename_component(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
+string(REGEX REPLACE
"^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")
-GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
-GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
+get_filename_component(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
+get_filename_component(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
+get_filename_component(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
"^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
+get_filename_component(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
"^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
-SET(TCLTK_POSSIBLE_LIB_PATHS
+set(TCLTK_POSSIBLE_LIB_PATHS
"${TCL_INCLUDE_PATH_PARENT}/lib"
"${TK_INCLUDE_PATH_PARENT}/lib"
"${TCL_LIBRARY_PATH}"
@@ -84,12 +84,12 @@ SET(TCLTK_POSSIBLE_LIB_PATHS
"${TK_WISH_PATH_PARENT}/lib"
)
-IF(WIN32)
- GET_FILENAME_COMPONENT(
- ActiveTcl_CurrentVersion
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
+if(WIN32)
+ get_filename_component(
+ ActiveTcl_CurrentVersion
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
NAME)
- SET(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+ set(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
@@ -98,33 +98,33 @@ IF(WIN32)
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib"
"$ENV{ProgramFiles}/Tcl/Lib"
- "C:/Program Files/Tcl/lib"
- "C:/Tcl/lib"
+ "C:/Program Files/Tcl/lib"
+ "C:/Tcl/lib"
)
-ENDIF(WIN32)
+endif()
-FIND_LIBRARY(TCL_LIBRARY
- NAMES
- tcl
+find_library(TCL_LIBRARY
+ NAMES
+ tcl
tcl${TCL_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION}
- tcl86 tcl8.6
- tcl85 tcl8.5
- tcl84 tcl8.4
- tcl83 tcl8.3
- tcl82 tcl8.2
+ tcl86 tcl8.6
+ tcl85 tcl8.5
+ tcl84 tcl8.4
+ tcl83 tcl8.3
+ tcl82 tcl8.2
tcl80 tcl8.0
PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
)
-FIND_LIBRARY(TK_LIBRARY
- NAMES
+find_library(TK_LIBRARY
+ NAMES
tk
tk${TK_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION}
tk86 tk8.6
- tk85 tk8.5
- tk84 tk8.4
- tk83 tk8.3
- tk82 tk8.2
+ tk85 tk8.5
+ tk84 tk8.4
+ tk83 tk8.3
+ tk82 tk8.2
tk80 tk8.0
PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
)
@@ -132,32 +132,32 @@ FIND_LIBRARY(TK_LIBRARY
CMAKE_FIND_FRAMEWORKS(Tcl)
CMAKE_FIND_FRAMEWORKS(Tk)
-SET(TCL_FRAMEWORK_INCLUDES)
-IF(Tcl_FRAMEWORKS)
- IF(NOT TCL_INCLUDE_PATH)
- FOREACH(dir ${Tcl_FRAMEWORKS})
- SET(TCL_FRAMEWORK_INCLUDES ${TCL_FRAMEWORK_INCLUDES} ${dir}/Headers)
- ENDFOREACH(dir)
- ENDIF(NOT TCL_INCLUDE_PATH)
-ENDIF(Tcl_FRAMEWORKS)
-
-SET(TK_FRAMEWORK_INCLUDES)
-IF(Tk_FRAMEWORKS)
- IF(NOT TK_INCLUDE_PATH)
- FOREACH(dir ${Tk_FRAMEWORKS})
- SET(TK_FRAMEWORK_INCLUDES ${TK_FRAMEWORK_INCLUDES}
+set(TCL_FRAMEWORK_INCLUDES)
+if(Tcl_FRAMEWORKS)
+ if(NOT TCL_INCLUDE_PATH)
+ foreach(dir ${Tcl_FRAMEWORKS})
+ set(TCL_FRAMEWORK_INCLUDES ${TCL_FRAMEWORK_INCLUDES} ${dir}/Headers)
+ endforeach()
+ endif()
+endif()
+
+set(TK_FRAMEWORK_INCLUDES)
+if(Tk_FRAMEWORKS)
+ if(NOT TK_INCLUDE_PATH)
+ foreach(dir ${Tk_FRAMEWORKS})
+ set(TK_FRAMEWORK_INCLUDES ${TK_FRAMEWORK_INCLUDES}
${dir}/Headers ${dir}/PrivateHeaders)
- ENDFOREACH(dir)
- ENDIF(NOT TK_INCLUDE_PATH)
-ENDIF(Tk_FRAMEWORKS)
+ endforeach()
+ endif()
+endif()
-SET(TCLTK_POSSIBLE_INCLUDE_PATHS
+set(TCLTK_POSSIBLE_INCLUDE_PATHS
"${TCL_LIBRARY_PATH_PARENT}/include"
"${TK_LIBRARY_PATH_PARENT}/include"
"${TCL_INCLUDE_PATH}"
"${TK_INCLUDE_PATH}"
- ${TCL_FRAMEWORK_INCLUDES}
- ${TK_FRAMEWORK_INCLUDES}
+ ${TCL_FRAMEWORK_INCLUDES}
+ ${TK_FRAMEWORK_INCLUDES}
"${TCL_TCLSH_PATH_PARENT}/include"
"${TK_WISH_PATH_PARENT}/include"
/usr/include/tcl${TK_LIBRARY_VERSION}
@@ -170,8 +170,8 @@ SET(TCLTK_POSSIBLE_INCLUDE_PATHS
/usr/include/tcl8.0
)
-IF(WIN32)
- SET(TCLTK_POSSIBLE_INCLUDE_PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+if(WIN32)
+ set(TCLTK_POSSIBLE_INCLUDE_PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include"
@@ -183,31 +183,31 @@ IF(WIN32)
"C:/Program Files/Tcl/include"
"C:/Tcl/include"
)
-ENDIF(WIN32)
+endif()
-FIND_PATH(TCL_INCLUDE_PATH
+find_path(TCL_INCLUDE_PATH
NAMES tcl.h
HINTS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
)
-FIND_PATH(TK_INCLUDE_PATH
+find_path(TK_INCLUDE_PATH
NAMES tk.h
HINTS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
)
-# handle the QUIETLY and REQUIRED arguments and set TCL_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set TCL_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL DEFAULT_MSG TCL_LIBRARY TCL_INCLUDE_PATH)
-SET(TCLTK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
-SET(TCLTK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
+set(TCLTK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
+set(TCLTK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCLTK DEFAULT_MSG TCL_LIBRARY TCL_INCLUDE_PATH TK_LIBRARY TK_INCLUDE_PATH)
-SET(TK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
-SET(TK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
+set(TK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
+set(TK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TK DEFAULT_MSG TK_LIBRARY TK_INCLUDE_PATH)
-MARK_AS_ADVANCED(
+mark_as_advanced(
TCL_INCLUDE_PATH
TK_INCLUDE_PATH
TCL_LIBRARY
diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake
index 16f9e238a..b48fb0e1d 100644
--- a/Modules/FindTIFF.cmake
+++ b/Modules/FindTIFF.cmake
@@ -20,29 +20,29 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PATH(TIFF_INCLUDE_DIR tiff.h)
+find_path(TIFF_INCLUDE_DIR tiff.h)
-SET(TIFF_NAMES ${TIFF_NAMES} tiff libtiff tiff3 libtiff3)
-FIND_LIBRARY(TIFF_LIBRARY NAMES ${TIFF_NAMES} )
+set(TIFF_NAMES ${TIFF_NAMES} tiff libtiff tiff3 libtiff3)
+find_library(TIFF_LIBRARY NAMES ${TIFF_NAMES} )
-IF(TIFF_INCLUDE_DIR AND EXISTS "${TIFF_INCLUDE_DIR}/tiffvers.h")
- FILE(STRINGS "${TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str
+if(TIFF_INCLUDE_DIR AND EXISTS "${TIFF_INCLUDE_DIR}/tiffvers.h")
+ file(STRINGS "${TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str
REGEX "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version .*")
- STRING(REGEX REPLACE "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version +([^ \\n]*).*"
+ string(REGEX REPLACE "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version +([^ \\n]*).*"
"\\1" TIFF_VERSION_STRING "${tiff_version_str}")
- UNSET(tiff_version_str)
-ENDIF()
+ unset(tiff_version_str)
+endif()
-# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIFF
REQUIRED_VARS TIFF_LIBRARY TIFF_INCLUDE_DIR
VERSION_VAR TIFF_VERSION_STRING)
-IF(TIFF_FOUND)
- SET( TIFF_LIBRARIES ${TIFF_LIBRARY} )
-ENDIF(TIFF_FOUND)
+if(TIFF_FOUND)
+ set( TIFF_LIBRARIES ${TIFF_LIBRARY} )
+endif()
-MARK_AS_ADVANCED(TIFF_INCLUDE_DIR TIFF_LIBRARY)
+mark_as_advanced(TIFF_INCLUDE_DIR TIFF_LIBRARY)
diff --git a/Modules/FindTclStub.cmake b/Modules/FindTclStub.cmake
index 79d14aeb4..e66f7bc21 100644
--- a/Modules/FindTclStub.cmake
+++ b/Modules/FindTclStub.cmake
@@ -14,11 +14,11 @@
# who are not necessarily Tcl/Tk gurus/developpers, some variables were
# moved or removed. Changes compared to CMake 2.4 are:
# - TCL_STUB_LIBRARY_DEBUG and TK_STUB_LIBRARY_DEBUG were removed.
-# => these libs are not packaged by default with Tcl/Tk distributions.
+# => these libs are not packaged by default with Tcl/Tk distributions.
# Even when Tcl/Tk is built from source, several flavors of debug libs
# are created and there is no real reason to pick a single one
-# specifically (say, amongst tclstub84g, tclstub84gs, or tclstub84sgx).
-# Let's leave that choice to the user by allowing him to assign
+# specifically (say, amongst tclstub84g, tclstub84gs, or tclstub84sgx).
+# Let's leave that choice to the user by allowing him to assign
# TCL_STUB_LIBRARY to any Tcl library, debug or not.
#=============================================================================
@@ -34,32 +34,32 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(FindTCL)
+include(FindTCL)
-GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
-GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
+get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
+string(REGEX REPLACE
"^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
-GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
-GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TK_WISH_PATH "${TK_WISH}" PATH)
+get_filename_component(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
+string(REGEX REPLACE
"^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")
-GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
-GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
+get_filename_component(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
+get_filename_component(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
+get_filename_component(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
"^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
+get_filename_component(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
"^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
-SET(TCLTK_POSSIBLE_LIB_PATHS
+set(TCLTK_POSSIBLE_LIB_PATHS
"${TCL_INCLUDE_PATH_PARENT}/lib"
"${TK_INCLUDE_PATH_PARENT}/lib"
"${TCL_LIBRARY_PATH}"
@@ -68,12 +68,12 @@ SET(TCLTK_POSSIBLE_LIB_PATHS
"${TK_WISH_PATH_PARENT}/lib"
)
-IF(WIN32)
- GET_FILENAME_COMPONENT(
- ActiveTcl_CurrentVersion
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
+if(WIN32)
+ get_filename_component(
+ ActiveTcl_CurrentVersion
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
NAME)
- SET(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+ set(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
@@ -82,49 +82,49 @@ IF(WIN32)
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib"
"$ENV{ProgramFiles}/Tcl/Lib"
- "C:/Program Files/Tcl/lib"
- "C:/Tcl/lib"
+ "C:/Program Files/Tcl/lib"
+ "C:/Tcl/lib"
)
-ENDIF(WIN32)
+endif()
-FIND_LIBRARY(TCL_STUB_LIBRARY
- NAMES
- tclstub
+find_library(TCL_STUB_LIBRARY
+ NAMES
+ tclstub
tclstub${TK_LIBRARY_VERSION} tclstub${TCL_TCLSH_VERSION} tclstub${TK_WISH_VERSION}
tclstub86 tclstub8.6
- tclstub85 tclstub8.5
- tclstub84 tclstub8.4
- tclstub83 tclstub8.3
- tclstub82 tclstub8.2
+ tclstub85 tclstub8.5
+ tclstub84 tclstub8.4
+ tclstub83 tclstub8.3
+ tclstub82 tclstub8.2
tclstub80 tclstub8.0
PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
)
-FIND_LIBRARY(TK_STUB_LIBRARY
- NAMES
- tkstub
+find_library(TK_STUB_LIBRARY
+ NAMES
+ tkstub
tkstub${TCL_LIBRARY_VERSION} tkstub${TCL_TCLSH_VERSION} tkstub${TK_WISH_VERSION}
tkstub86 tkstub8.6
- tkstub85 tkstub8.5
- tkstub84 tkstub8.4
- tkstub83 tkstub8.3
- tkstub82 tkstub8.2
+ tkstub85 tkstub8.5
+ tkstub84 tkstub8.4
+ tkstub83 tkstub8.3
+ tkstub82 tkstub8.2
tkstub80 tkstub8.0
PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
)
-FIND_LIBRARY(TTK_STUB_LIBRARY
- NAMES
- ttkstub
+find_library(TTK_STUB_LIBRARY
+ NAMES
+ ttkstub
ttkstub${TCL_LIBRARY_VERSION} ttkstub${TCL_TCLSH_VERSION} ttkstub${TK_WISH_VERSION}
ttkstub88 ttkstub8.8
ttkstub87 ttkstub8.7
ttkstub86 ttkstub8.6
- ttkstub85 ttkstub8.5
+ ttkstub85 ttkstub8.5
PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
)
-MARK_AS_ADVANCED(
+mark_as_advanced(
TCL_STUB_LIBRARY
TK_STUB_LIBRARY
)
diff --git a/Modules/FindTclsh.cmake b/Modules/FindTclsh.cmake
index a45f28528..0f091e60d 100644
--- a/Modules/FindTclsh.cmake
+++ b/Modules/FindTclsh.cmake
@@ -20,29 +20,29 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF(CYGWIN)
- FIND_PROGRAM(TCL_TCLSH NAMES cygtclsh83 cygtclsh80)
-ENDIF(CYGWIN)
+if(CYGWIN)
+ find_program(TCL_TCLSH NAMES cygtclsh83 cygtclsh80)
+endif()
-GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
-GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TK_WISH_PATH "${TK_WISH}" PATH)
+get_filename_component(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
+string(REGEX REPLACE
"^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")
-GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
-GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
+get_filename_component(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
+get_filename_component(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
+get_filename_component(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
"^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
+get_filename_component(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
"^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
-SET(TCLTK_POSSIBLE_BIN_PATHS
+set(TCLTK_POSSIBLE_BIN_PATHS
"${TCL_INCLUDE_PATH_PARENT}/bin"
"${TK_INCLUDE_PATH_PARENT}/bin"
"${TCL_LIBRARY_PATH_PARENT}/bin"
@@ -50,12 +50,12 @@ SET(TCLTK_POSSIBLE_BIN_PATHS
"${TK_WISH_PATH_PARENT}/bin"
)
-IF(WIN32)
- GET_FILENAME_COMPONENT(
- ActiveTcl_CurrentVersion
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
+if(WIN32)
+ get_filename_component(
+ ActiveTcl_CurrentVersion
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
NAME)
- SET(TCLTK_POSSIBLE_BIN_PATHS ${TCLTK_POSSIBLE_BIN_PATHS}
+ set(TCLTK_POSSIBLE_BIN_PATHS ${TCLTK_POSSIBLE_BIN_PATHS}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/bin"
@@ -64,9 +64,9 @@ IF(WIN32)
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin"
)
-ENDIF(WIN32)
+endif()
-SET(TCL_TCLSH_NAMES
+set(TCL_TCLSH_NAMES
tclsh
tclsh${TCL_LIBRARY_VERSION} tclsh${TK_LIBRARY_VERSION} tclsh${TK_WISH_VERSION}
tclsh86 tclsh8.6
@@ -77,24 +77,24 @@ SET(TCL_TCLSH_NAMES
tclsh80 tclsh8.0
)
-FIND_PROGRAM(TCL_TCLSH
+find_program(TCL_TCLSH
NAMES ${TCL_TCLSH_NAMES}
HINTS ${TCLTK_POSSIBLE_BIN_PATHS}
)
-IF(TCL_TCLSH)
- EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -E echo puts "\$tcl_version"
+if(TCL_TCLSH)
+ execute_process(COMMAND "${CMAKE_COMMAND}" -E echo puts "\$tcl_version"
COMMAND "${TCL_TCLSH}"
OUTPUT_VARIABLE TCLSH_VERSION_STRING
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
-ENDIF(TCL_TCLSH)
+endif()
-# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Tclsh
REQUIRED_VARS TCL_TCLSH
VERSION_VAR TCLSH_VERSION_STRING)
-MARK_AS_ADVANCED(TCL_TCLSH)
+mark_as_advanced(TCL_TCLSH)
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index 21614fb66..5d7677791 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -21,117 +21,117 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE (CheckIncludeFiles)
-INCLUDE (CheckLibraryExists)
-INCLUDE (CheckSymbolExists)
-SET(Threads_FOUND FALSE)
+include (CheckIncludeFiles)
+include (CheckLibraryExists)
+include (CheckSymbolExists)
+set(Threads_FOUND FALSE)
# Do we have sproc?
-IF(CMAKE_SYSTEM MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD)
+if(CMAKE_SYSTEM MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD)
CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SPROC_H)
-ENDIF()
+endif()
-IF(CMAKE_HAVE_SPROC_H AND NOT CMAKE_THREAD_PREFER_PTHREAD)
+if(CMAKE_HAVE_SPROC_H AND NOT CMAKE_THREAD_PREFER_PTHREAD)
# We have sproc
- SET(CMAKE_USE_SPROC_INIT 1)
-ELSE()
+ set(CMAKE_USE_SPROC_INIT 1)
+else()
# Do we have pthreads?
CHECK_INCLUDE_FILES("pthread.h" CMAKE_HAVE_PTHREAD_H)
- IF(CMAKE_HAVE_PTHREAD_H)
+ if(CMAKE_HAVE_PTHREAD_H)
#
# We have pthread.h
# Let's check for the library now.
#
- SET(CMAKE_HAVE_THREADS_LIBRARY)
- IF(NOT THREADS_HAVE_PTHREAD_ARG)
+ set(CMAKE_HAVE_THREADS_LIBRARY)
+ if(NOT THREADS_HAVE_PTHREAD_ARG)
# Check if pthread functions are in normal C library
CHECK_SYMBOL_EXISTS(pthread_create pthread.h CMAKE_HAVE_LIBC_CREATE)
- IF(CMAKE_HAVE_LIBC_CREATE)
- SET(CMAKE_THREAD_LIBS_INIT "")
- SET(CMAKE_HAVE_THREADS_LIBRARY 1)
- SET(Threads_FOUND TRUE)
- ENDIF()
+ if(CMAKE_HAVE_LIBC_CREATE)
+ set(CMAKE_THREAD_LIBS_INIT "")
+ set(CMAKE_HAVE_THREADS_LIBRARY 1)
+ set(Threads_FOUND TRUE)
+ endif()
- IF(NOT CMAKE_HAVE_THREADS_LIBRARY)
+ if(NOT CMAKE_HAVE_THREADS_LIBRARY)
# Do we have -lpthreads
CHECK_LIBRARY_EXISTS(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE)
- IF(CMAKE_HAVE_PTHREADS_CREATE)
- SET(CMAKE_THREAD_LIBS_INIT "-lpthreads")
- SET(CMAKE_HAVE_THREADS_LIBRARY 1)
- SET(Threads_FOUND TRUE)
- ENDIF()
+ if(CMAKE_HAVE_PTHREADS_CREATE)
+ set(CMAKE_THREAD_LIBS_INIT "-lpthreads")
+ set(CMAKE_HAVE_THREADS_LIBRARY 1)
+ set(Threads_FOUND TRUE)
+ endif()
# Ok, how about -lpthread
CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE)
- IF(CMAKE_HAVE_PTHREAD_CREATE)
- SET(CMAKE_THREAD_LIBS_INIT "-lpthread")
- SET(CMAKE_HAVE_THREADS_LIBRARY 1)
- SET(Threads_FOUND TRUE)
- ENDIF()
+ if(CMAKE_HAVE_PTHREAD_CREATE)
+ set(CMAKE_THREAD_LIBS_INIT "-lpthread")
+ set(CMAKE_HAVE_THREADS_LIBRARY 1)
+ set(Threads_FOUND TRUE)
+ endif()
- IF(CMAKE_SYSTEM MATCHES "SunOS.*")
+ if(CMAKE_SYSTEM MATCHES "SunOS.*")
# On sun also check for -lthread
CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE)
- IF(CMAKE_HAVE_THR_CREATE)
- SET(CMAKE_THREAD_LIBS_INIT "-lthread")
- SET(CMAKE_HAVE_THREADS_LIBRARY 1)
- SET(Threads_FOUND TRUE)
- ENDIF()
- ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*")
- ENDIF(NOT CMAKE_HAVE_THREADS_LIBRARY)
- ENDIF(NOT THREADS_HAVE_PTHREAD_ARG)
-
- IF(NOT CMAKE_HAVE_THREADS_LIBRARY)
+ if(CMAKE_HAVE_THR_CREATE)
+ set(CMAKE_THREAD_LIBS_INIT "-lthread")
+ set(CMAKE_HAVE_THREADS_LIBRARY 1)
+ set(Threads_FOUND TRUE)
+ endif()
+ endif()
+ endif()
+ endif()
+
+ if(NOT CMAKE_HAVE_THREADS_LIBRARY)
# If we did not found -lpthread, -lpthread, or -lthread, look for -pthread
- IF("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG")
- MESSAGE(STATUS "Check if compiler accepts -pthread")
- TRY_RUN(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG
+ if("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG")
+ message(STATUS "Check if compiler accepts -pthread")
+ try_run(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG
${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckForPthreads.c
CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread
COMPILE_OUTPUT_VARIABLE OUTPUT)
- IF(THREADS_HAVE_PTHREAD_ARG)
- IF(THREADS_PTHREAD_ARG MATCHES "^2$")
- SET(Threads_FOUND TRUE)
- MESSAGE(STATUS "Check if compiler accepts -pthread - yes")
- ELSE()
- MESSAGE(STATUS "Check if compiler accepts -pthread - no")
- FILE(APPEND
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ if(THREADS_HAVE_PTHREAD_ARG)
+ if(THREADS_PTHREAD_ARG MATCHES "^2$")
+ set(Threads_FOUND TRUE)
+ message(STATUS "Check if compiler accepts -pthread - yes")
+ else()
+ message(STATUS "Check if compiler accepts -pthread - no")
+ file(APPEND
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if compiler accepts -pthread returned ${THREADS_PTHREAD_ARG} instead of 2. The compiler had the following output:\n${OUTPUT}\n\n")
- ENDIF()
- ELSE()
- MESSAGE(STATUS "Check if compiler accepts -pthread - no")
- FILE(APPEND
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ endif()
+ else()
+ message(STATUS "Check if compiler accepts -pthread - no")
+ file(APPEND
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n")
- ENDIF()
+ endif()
- ENDIF("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG")
+ endif()
- IF(THREADS_HAVE_PTHREAD_ARG)
- SET(Threads_FOUND TRUE)
- SET(CMAKE_THREAD_LIBS_INIT "-pthread")
- ENDIF()
+ if(THREADS_HAVE_PTHREAD_ARG)
+ set(Threads_FOUND TRUE)
+ set(CMAKE_THREAD_LIBS_INIT "-pthread")
+ endif()
- ENDIF(NOT CMAKE_HAVE_THREADS_LIBRARY)
- ENDIF(CMAKE_HAVE_PTHREAD_H)
-ENDIF()
+ endif()
+ endif()
+endif()
-IF(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE)
- SET(CMAKE_USE_PTHREADS_INIT 1)
- SET(Threads_FOUND TRUE)
-ENDIF()
+if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE)
+ set(CMAKE_USE_PTHREADS_INIT 1)
+ set(Threads_FOUND TRUE)
+endif()
-IF(CMAKE_SYSTEM MATCHES "Windows")
- SET(CMAKE_USE_WIN32_THREADS_INIT 1)
- SET(Threads_FOUND TRUE)
-ENDIF()
+if(CMAKE_SYSTEM MATCHES "Windows")
+ set(CMAKE_USE_WIN32_THREADS_INIT 1)
+ set(Threads_FOUND TRUE)
+endif()
-IF(CMAKE_USE_PTHREADS_INIT)
- IF(CMAKE_SYSTEM MATCHES "HP-UX-*")
+if(CMAKE_USE_PTHREADS_INIT)
+ if(CMAKE_SYSTEM MATCHES "HP-UX-*")
# Use libcma if it exists and can be used. It provides more
# symbols than the plain pthread library. CMA threads
# have actually been deprecated:
@@ -141,26 +141,26 @@ IF(CMAKE_USE_PTHREADS_INIT)
# The CMAKE_HP_PTHREADS setting actually indicates whether CMA threads
# are available.
CHECK_LIBRARY_EXISTS(cma pthread_attr_create "" CMAKE_HAVE_HP_CMA)
- IF(CMAKE_HAVE_HP_CMA)
- SET(CMAKE_THREAD_LIBS_INIT "-lcma")
- SET(CMAKE_HP_PTHREADS_INIT 1)
- SET(Threads_FOUND TRUE)
- ENDIF(CMAKE_HAVE_HP_CMA)
- SET(CMAKE_USE_PTHREADS_INIT 1)
- ENDIF()
-
- IF(CMAKE_SYSTEM MATCHES "OSF1-V*")
- SET(CMAKE_USE_PTHREADS_INIT 0)
- SET(CMAKE_THREAD_LIBS_INIT )
- ENDIF()
-
- IF(CMAKE_SYSTEM MATCHES "CYGWIN_NT*")
- SET(CMAKE_USE_PTHREADS_INIT 1)
- SET(Threads_FOUND TRUE)
- SET(CMAKE_THREAD_LIBS_INIT )
- SET(CMAKE_USE_WIN32_THREADS_INIT 0)
- ENDIF()
-ENDIF(CMAKE_USE_PTHREADS_INIT)
-
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+ if(CMAKE_HAVE_HP_CMA)
+ set(CMAKE_THREAD_LIBS_INIT "-lcma")
+ set(CMAKE_HP_PTHREADS_INIT 1)
+ set(Threads_FOUND TRUE)
+ endif()
+ set(CMAKE_USE_PTHREADS_INIT 1)
+ endif()
+
+ if(CMAKE_SYSTEM MATCHES "OSF1-V*")
+ set(CMAKE_USE_PTHREADS_INIT 0)
+ set(CMAKE_THREAD_LIBS_INIT )
+ endif()
+
+ if(CMAKE_SYSTEM MATCHES "CYGWIN_NT*")
+ set(CMAKE_USE_PTHREADS_INIT 1)
+ set(Threads_FOUND TRUE)
+ set(CMAKE_THREAD_LIBS_INIT )
+ set(CMAKE_USE_WIN32_THREADS_INIT 0)
+ endif()
+endif()
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG Threads_FOUND)
diff --git a/Modules/FindUnixCommands.cmake b/Modules/FindUnixCommands.cmake
index 9c0264d22..a69e3f10c 100644
--- a/Modules/FindUnixCommands.cmake
+++ b/Modules/FindUnixCommands.cmake
@@ -15,79 +15,79 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(FindCygwin)
+include(FindCygwin)
-FIND_PROGRAM(BASH
+find_program(BASH
bash
${CYGWIN_INSTALL_PATH}/bin
/bin
- /usr/bin
+ /usr/bin
/usr/local/bin
/sbin
)
-MARK_AS_ADVANCED(
+mark_as_advanced(
BASH
)
-FIND_PROGRAM(CP
+find_program(CP
cp
${CYGWIN_INSTALL_PATH}/bin
/bin
- /usr/bin
+ /usr/bin
/usr/local/bin
/sbin
)
-MARK_AS_ADVANCED(
+mark_as_advanced(
CP
)
-FIND_PROGRAM(GZIP
+find_program(GZIP
gzip
${CYGWIN_INSTALL_PATH}/bin
/bin
- /usr/bin
+ /usr/bin
/usr/local/bin
/sbin
)
-MARK_AS_ADVANCED(
+mark_as_advanced(
GZIP
)
-FIND_PROGRAM(MV
+find_program(MV
mv
${CYGWIN_INSTALL_PATH}/bin
/bin
- /usr/bin
+ /usr/bin
/usr/local/bin
/sbin
)
-MARK_AS_ADVANCED(
+mark_as_advanced(
MV
)
-FIND_PROGRAM(RM
+find_program(RM
rm
${CYGWIN_INSTALL_PATH}/bin
/bin
- /usr/bin
+ /usr/bin
/usr/local/bin
/sbin
)
-MARK_AS_ADVANCED(
+mark_as_advanced(
RM
)
-FIND_PROGRAM(TAR
- NAMES
- tar
+find_program(TAR
+ NAMES
+ tar
gtar
PATH
${CYGWIN_INSTALL_PATH}/bin
/bin
- /usr/bin
+ /usr/bin
/usr/local/bin
/sbin
)
-MARK_AS_ADVANCED(
+mark_as_advanced(
TAR
)
diff --git a/Modules/FindVTK.cmake b/Modules/FindVTK.cmake
index 6b1772fa4..fa090ff60 100644
--- a/Modules/FindVTK.cmake
+++ b/Modules/FindVTK.cmake
@@ -4,26 +4,26 @@
# VTK_FOUND - Set to true when VTK is found.
# VTK_USE_FILE - CMake file to use VTK.
# VTK_MAJOR_VERSION - The VTK major version number.
-# VTK_MINOR_VERSION - The VTK minor version number
+# VTK_MINOR_VERSION - The VTK minor version number
# (odd non-release).
-# VTK_BUILD_VERSION - The VTK patch level
+# VTK_BUILD_VERSION - The VTK patch level
# (meaningless for odd minor).
# VTK_INCLUDE_DIRS - Include directories for VTK
# VTK_LIBRARY_DIRS - Link directories for VTK libraries
-# VTK_KITS - List of VTK kits, in CAPS
+# VTK_KITS - List of VTK kits, in CAPS
# (COMMON,IO,) etc.
# VTK_LANGUAGES - List of wrapped languages, in CAPS
# (TCL, PYHTON,) etc.
# The following cache entries must be set by the user to locate VTK:
-# VTK_DIR - The directory containing VTKConfig.cmake.
+# VTK_DIR - The directory containing VTKConfig.cmake.
# This is either the root of the build tree,
-# or the lib/vtk directory. This is the
+# or the lib/vtk directory. This is the
# only cache entry.
# The following variables are set for backward compatibility and
# should not be used in new code:
# USE_VTK_FILE - The full path to the UseVTK.cmake file.
-# This is provided for backward
-# compatibility. Use VTK_USE_FILE
+# This is provided for backward
+# compatibility. Use VTK_USE_FILE
# instead.
#
@@ -41,56 +41,56 @@
# License text for the above reference.)
# Assume not found.
-SET(VTK_FOUND 0)
+set(VTK_FOUND 0)
# VTK 4.0 did not provide VTKConfig.cmake.
-IF("${VTK_FIND_VERSION}" VERSION_LESS 4.1)
- SET(_VTK_40_ALLOW 1)
- IF(VTK_FIND_VERSION)
- SET(_VTK_40_ONLY 1)
- ENDIF()
-ENDIF()
+if("${VTK_FIND_VERSION}" VERSION_LESS 4.1)
+ set(_VTK_40_ALLOW 1)
+ if(VTK_FIND_VERSION)
+ set(_VTK_40_ONLY 1)
+ endif()
+endif()
# Construct consitent error messages for use below.
-SET(VTK_DIR_DESCRIPTION "directory containing VTKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/vtk for an installation.")
-IF(_VTK_40_ALLOW)
- SET(VTK_DIR_DESCRIPTION "${VTK_DIR_DESCRIPTION} For VTK 4.0, this is the location of UseVTK.cmake. This is either the root of the build tree or PREFIX/include/vtk for an installation.")
-ENDIF()
-SET(VTK_DIR_MESSAGE "VTK not found. Set the VTK_DIR cmake cache entry to the ${VTK_DIR_DESCRIPTION}")
+set(VTK_DIR_DESCRIPTION "directory containing VTKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/vtk for an installation.")
+if(_VTK_40_ALLOW)
+ set(VTK_DIR_DESCRIPTION "${VTK_DIR_DESCRIPTION} For VTK 4.0, this is the location of UseVTK.cmake. This is either the root of the build tree or PREFIX/include/vtk for an installation.")
+endif()
+set(VTK_DIR_MESSAGE "VTK not found. Set the VTK_DIR cmake cache entry to the ${VTK_DIR_DESCRIPTION}")
# Check whether VTK 4.0 has already been found.
-IF(_VTK_40_ALLOW AND VTK_DIR)
- IF(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake)
- SET(VTK_FOUND 1)
- INCLUDE(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings.
- ENDIF()
-ENDIF()
+if(_VTK_40_ALLOW AND VTK_DIR)
+ if(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake)
+ set(VTK_FOUND 1)
+ include(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings.
+ endif()
+endif()
# Use the Config mode of the find_package() command to find VTKConfig.
# If this succeeds (possibly because VTK_DIR is already set), the
# command will have already loaded VTKConfig.cmake and set VTK_FOUND.
-IF(NOT _VTK_40_ONLY AND NOT VTK_FOUND)
- FIND_PACKAGE(VTK QUIET NO_MODULE)
-ENDIF()
+if(NOT _VTK_40_ONLY AND NOT VTK_FOUND)
+ find_package(VTK QUIET NO_MODULE)
+endif()
# Special search for VTK 4.0.
-IF(_VTK_40_ALLOW AND NOT VTK_DIR)
+if(_VTK_40_ALLOW AND NOT VTK_DIR)
# Old scripts may set these directories in the CMakeCache.txt file.
# They can tell us where to find VTKConfig.cmake.
- SET(VTK_DIR_SEARCH_LEGACY "")
- IF(VTK_BINARY_PATH AND USE_BUILT_VTK)
- SET(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} ${VTK_BINARY_PATH})
- ENDIF(VTK_BINARY_PATH AND USE_BUILT_VTK)
- IF(VTK_INSTALL_PATH AND USE_INSTALLED_VTK)
- SET(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY}
+ set(VTK_DIR_SEARCH_LEGACY "")
+ if(VTK_BINARY_PATH AND USE_BUILT_VTK)
+ set(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} ${VTK_BINARY_PATH})
+ endif()
+ if(VTK_INSTALL_PATH AND USE_INSTALLED_VTK)
+ set(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY}
${VTK_INSTALL_PATH}/lib/vtk)
- ENDIF(VTK_INSTALL_PATH AND USE_INSTALLED_VTK)
+ endif()
# Look for UseVTK.cmake in build trees or under <prefix>/include/vtk.
- FIND_PATH(VTK_DIR
+ find_path(VTK_DIR
NAMES UseVTK.cmake
PATH_SUFFIXES vtk-4.0 vtk
- HINTS $ENV{VTK_DIR}
+ HINTS ENV VTK_DIR
PATHS
@@ -114,28 +114,28 @@ IF(_VTK_40_ALLOW AND NOT VTK_DIR)
DOC "The ${VTK_DIR_DESCRIPTION}"
)
- IF(VTK_DIR)
- IF(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake)
- SET(VTK_FOUND 1)
- INCLUDE(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings.
- ELSE()
+ if(VTK_DIR)
+ if(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake)
+ set(VTK_FOUND 1)
+ include(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings.
+ else()
# We found the wrong version. Pretend we did not find it.
- SET(VTK_DIR "VTK_DIR-NOTFOUND" CACHE PATH "The ${VTK_DIR_DESCRIPTION}" FORCE)
- ENDIF()
- ENDIF()
-ENDIF()
+ set(VTK_DIR "VTK_DIR-NOTFOUND" CACHE PATH "The ${VTK_DIR_DESCRIPTION}" FORCE)
+ endif()
+ endif()
+endif()
#-----------------------------------------------------------------------------
-IF(VTK_FOUND)
+if(VTK_FOUND)
# Set USE_VTK_FILE for backward-compatability.
- SET(USE_VTK_FILE ${VTK_USE_FILE})
-ELSE(VTK_FOUND)
+ set(USE_VTK_FILE ${VTK_USE_FILE})
+else()
# VTK not found, explain to the user how to specify its location.
- IF(VTK_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR ${VTK_DIR_MESSAGE})
- ELSE(VTK_FIND_REQUIRED)
- IF(NOT VTK_FIND_QUIETLY)
- MESSAGE(STATUS ${VTK_DIR_MESSAGE})
- ENDIF(NOT VTK_FIND_QUIETLY)
- ENDIF(VTK_FIND_REQUIRED)
-ENDIF(VTK_FOUND)
+ if(VTK_FIND_REQUIRED)
+ message(FATAL_ERROR ${VTK_DIR_MESSAGE})
+ else()
+ if(NOT VTK_FIND_QUIETLY)
+ message(STATUS ${VTK_DIR_MESSAGE})
+ endif()
+ endif()
+endif()
diff --git a/Modules/FindWget.cmake b/Modules/FindWget.cmake
index c94132c27..a1dd47f77 100644
--- a/Modules/FindWget.cmake
+++ b/Modules/FindWget.cmake
@@ -1,5 +1,5 @@
# - Find wget
-# This module looks for wget. This module defines the
+# This module looks for wget. This module defines the
# following values:
# WGET_EXECUTABLE: the full path to the wget tool.
# WGET_FOUND: True if wget has been found.
@@ -17,20 +17,20 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(FindCygwin)
+include(FindCygwin)
-FIND_PROGRAM(WGET_EXECUTABLE
+find_program(WGET_EXECUTABLE
wget
${CYGWIN_INSTALL_PATH}/bin
)
-# handle the QUIETLY and REQUIRED arguments and set WGET_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set WGET_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Wget DEFAULT_MSG WGET_EXECUTABLE)
-MARK_AS_ADVANCED( WGET_EXECUTABLE )
+mark_as_advanced( WGET_EXECUTABLE )
# WGET option is deprecated.
# use WGET_EXECUTABLE instead.
-SET (WGET ${WGET_EXECUTABLE} )
+set (WGET ${WGET_EXECUTABLE} )
diff --git a/Modules/FindWish.cmake b/Modules/FindWish.cmake
index a4960cd17..11b29f249 100644
--- a/Modules/FindWish.cmake
+++ b/Modules/FindWish.cmake
@@ -20,29 +20,29 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF(UNIX)
- FIND_PROGRAM(TK_WISH cygwish80 )
-ENDIF(UNIX)
+if(UNIX)
+ find_program(TK_WISH cygwish80 )
+endif()
-GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
-GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
+get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
+string(REGEX REPLACE
"^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
-GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
-GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
+get_filename_component(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
+get_filename_component(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
+get_filename_component(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
"^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
+get_filename_component(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
"^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
-SET(TCLTK_POSSIBLE_BIN_PATHS
+set(TCLTK_POSSIBLE_BIN_PATHS
"${TCL_INCLUDE_PATH_PARENT}/bin"
"${TK_INCLUDE_PATH_PARENT}/bin"
"${TCL_LIBRARY_PATH_PARENT}/bin"
@@ -50,12 +50,12 @@ SET(TCLTK_POSSIBLE_BIN_PATHS
"${TCL_TCLSH_PATH_PARENT}/bin"
)
-IF(WIN32)
- GET_FILENAME_COMPONENT(
- ActiveTcl_CurrentVersion
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
+if(WIN32)
+ get_filename_component(
+ ActiveTcl_CurrentVersion
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
NAME)
- SET(TCLTK_POSSIBLE_BIN_PATHS ${TCLTK_POSSIBLE_BIN_PATHS}
+ set(TCLTK_POSSIBLE_BIN_PATHS ${TCLTK_POSSIBLE_BIN_PATHS}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/bin"
@@ -64,22 +64,22 @@ IF(WIN32)
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin"
)
-ENDIF(WIN32)
+endif()
-SET(TK_WISH_NAMES
- wish
+set(TK_WISH_NAMES
+ wish
wish${TCL_LIBRARY_VERSION} wish${TK_LIBRARY_VERSION} wish${TCL_TCLSH_VERSION}
wish86 wish8.6
- wish85 wish8.5
- wish84 wish8.4
- wish83 wish8.3
- wish82 wish8.2
+ wish85 wish8.5
+ wish84 wish8.4
+ wish83 wish8.3
+ wish82 wish8.2
wish80 wish8.0
)
-FIND_PROGRAM(TK_WISH
+find_program(TK_WISH
NAMES ${TK_WISH_NAMES}
HINTS ${TCLTK_POSSIBLE_BIN_PATHS}
)
-MARK_AS_ADVANCED(TK_WISH)
+mark_as_advanced(TK_WISH)
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index 76fb3c911..e12dc0a29 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -54,13 +54,13 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF (UNIX)
- SET(X11_FOUND 0)
+if (UNIX)
+ set(X11_FOUND 0)
# X11 is never a framework and some header files may be
# found in tcl on the mac
- SET(CMAKE_FIND_FRAMEWORK_SAVE ${CMAKE_FIND_FRAMEWORK})
- SET(CMAKE_FIND_FRAMEWORK NEVER)
- SET(X11_INC_SEARCH_PATH
+ set(CMAKE_FIND_FRAMEWORK_SAVE ${CMAKE_FIND_FRAMEWORK})
+ set(CMAKE_FIND_FRAMEWORK NEVER)
+ set(X11_INC_SEARCH_PATH
/usr/pkg/xorg/include
/usr/X11R6/include
/usr/X11R7/include
@@ -70,358 +70,363 @@ IF (UNIX)
/opt/graphics/OpenGL/include
)
- SET(X11_LIB_SEARCH_PATH
+ set(X11_LIB_SEARCH_PATH
/usr/pkg/xorg/lib
/usr/X11R6/lib
/usr/X11R7/lib
/usr/openwin/lib
)
- FIND_PATH(X11_X11_INCLUDE_PATH X11/X.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xlib_INCLUDE_PATH X11/Xlib.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_X11_INCLUDE_PATH X11/X.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xlib_INCLUDE_PATH X11/Xlib.h ${X11_INC_SEARCH_PATH})
# Look for includes; keep the list sorted by name of the cmake *_INCLUDE_PATH
# variable (which doesn't need to match the include file name).
# Solaris lacks XKBrules.h, so we should skip kxkbd there.
- FIND_PATH(X11_ICE_INCLUDE_PATH X11/ICE/ICE.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_SM_INCLUDE_PATH X11/SM/SM.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xau_INCLUDE_PATH X11/Xauth.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xcomposite_INCLUDE_PATH X11/extensions/Xcomposite.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xcursor_INCLUDE_PATH X11/Xcursor/Xcursor.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xdamage_INCLUDE_PATH X11/extensions/Xdamage.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xdmcp_INCLUDE_PATH X11/Xdmcp.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_dpms_INCLUDE_PATH X11/extensions/dpms.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_xf86misc_INCLUDE_PATH X11/extensions/xf86misc.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_xf86vmode_INCLUDE_PATH X11/extensions/xf86vmode.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xfixes_INCLUDE_PATH X11/extensions/Xfixes.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xft_INCLUDE_PATH X11/Xft/Xft.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xi_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xinerama_INCLUDE_PATH X11/extensions/Xinerama.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xinput_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xpm_INCLUDE_PATH X11/xpm.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xrandr_INCLUDE_PATH X11/extensions/Xrandr.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xrender_INCLUDE_PATH X11/extensions/Xrender.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_XRes_INCLUDE_PATH X11/extensions/XRes.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xscreensaver_INCLUDE_PATH X11/extensions/scrnsaver.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xshape_INCLUDE_PATH X11/extensions/shape.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xutil_INCLUDE_PATH X11/Xutil.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xt_INCLUDE_PATH X11/Intrinsic.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h ${X11_INC_SEARCH_PATH})
- FIND_PATH(X11_XSync_INCLUDE_PATH X11/extensions/sync.h ${X11_INC_SEARCH_PATH})
-
-
- FIND_LIBRARY(X11_X11_LIB X11 ${X11_LIB_SEARCH_PATH})
+ find_path(X11_ICE_INCLUDE_PATH X11/ICE/ICE.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_SM_INCLUDE_PATH X11/SM/SM.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xau_INCLUDE_PATH X11/Xauth.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xcomposite_INCLUDE_PATH X11/extensions/Xcomposite.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xcursor_INCLUDE_PATH X11/Xcursor/Xcursor.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xdamage_INCLUDE_PATH X11/extensions/Xdamage.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xdmcp_INCLUDE_PATH X11/Xdmcp.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_dpms_INCLUDE_PATH X11/extensions/dpms.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_xf86misc_INCLUDE_PATH X11/extensions/xf86misc.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_xf86vmode_INCLUDE_PATH X11/extensions/xf86vmode.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xfixes_INCLUDE_PATH X11/extensions/Xfixes.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xft_INCLUDE_PATH X11/Xft/Xft.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xi_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xinerama_INCLUDE_PATH X11/extensions/Xinerama.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xinput_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xpm_INCLUDE_PATH X11/xpm.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xrandr_INCLUDE_PATH X11/extensions/Xrandr.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xrender_INCLUDE_PATH X11/extensions/Xrender.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_XRes_INCLUDE_PATH X11/extensions/XRes.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xscreensaver_INCLUDE_PATH X11/extensions/scrnsaver.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xshape_INCLUDE_PATH X11/extensions/shape.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xutil_INCLUDE_PATH X11/Xutil.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xt_INCLUDE_PATH X11/Intrinsic.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_XSync_INCLUDE_PATH X11/extensions/sync.h ${X11_INC_SEARCH_PATH})
+
+
+ find_library(X11_X11_LIB X11 ${X11_LIB_SEARCH_PATH})
# Find additional X libraries. Keep list sorted by library name.
- FIND_LIBRARY(X11_ICE_LIB ICE ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_SM_LIB SM ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xau_LIB Xau ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xcomposite_LIB Xcomposite ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xcursor_LIB Xcursor ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xdamage_LIB Xdamage ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xdmcp_LIB Xdmcp ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xext_LIB Xext ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xfixes_LIB Xfixes ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xft_LIB Xft ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xi_LIB Xi ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xinput_LIB Xi ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xmu_LIB Xmu ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xrandr_LIB Xrandr ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_XRes_LIB XRes ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xscreensaver_LIB Xss ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xt_LIB Xt ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xv_LIB Xv ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xxf86misc_LIB Xxf86misc ${X11_LIB_SEARCH_PATH})
- FIND_LIBRARY(X11_Xxf86vm_LIB Xxf86vm ${X11_LIB_SEARCH_PATH})
-
- SET(X11_LIBRARY_DIR "")
- IF(X11_X11_LIB)
- GET_FILENAME_COMPONENT(X11_LIBRARY_DIR ${X11_X11_LIB} PATH)
- ENDIF(X11_X11_LIB)
-
- SET(X11_INCLUDE_DIR) # start with empty list
- IF(X11_X11_INCLUDE_PATH)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH})
- ENDIF(X11_X11_INCLUDE_PATH)
-
- IF(X11_Xlib_INCLUDE_PATH)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xlib_INCLUDE_PATH})
- ENDIF(X11_Xlib_INCLUDE_PATH)
-
- IF(X11_Xutil_INCLUDE_PATH)
- SET(X11_Xutil_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xutil_INCLUDE_PATH})
- ENDIF(X11_Xutil_INCLUDE_PATH)
-
- IF(X11_Xshape_INCLUDE_PATH)
- SET(X11_Xshape_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xshape_INCLUDE_PATH})
- ENDIF(X11_Xshape_INCLUDE_PATH)
-
- SET(X11_LIBRARIES) # start with empty list
- IF(X11_X11_LIB)
- SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_X11_LIB})
- ENDIF(X11_X11_LIB)
-
- IF(X11_Xext_LIB)
- SET(X11_Xext_FOUND TRUE)
- SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIB})
- ENDIF(X11_Xext_LIB)
-
- IF(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH)
- SET(X11_Xt_FOUND TRUE)
- ENDIF(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH)
-
- IF(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
- SET(X11_Xft_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xft_INCLUDE_PATH})
- ENDIF(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
-
- IF(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH)
- SET(X11_Xv_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xv_INCLUDE_PATH})
- ENDIF(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH)
-
- IF (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH)
- SET(X11_Xau_FOUND TRUE)
- ENDIF (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH)
-
- IF (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
- SET(X11_Xdmcp_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdmcp_INCLUDE_PATH})
- ENDIF (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
-
- IF (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH)
- SET(X11_Xaccess_FOUND TRUE)
- SET(X11_Xaccess_INCLUDE_PATH ${X11_Xaccessstr_INCLUDE_PATH})
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xaccess_INCLUDE_PATH})
- ENDIF (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH)
-
- IF (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB)
- SET(X11_Xpm_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xpm_INCLUDE_PATH})
- ENDIF (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB)
-
- IF (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB)
- SET(X11_Xcomposite_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcomposite_INCLUDE_PATH})
- ENDIF (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB)
-
- IF (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB)
- SET(X11_Xdamage_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdamage_INCLUDE_PATH})
- ENDIF (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB)
-
- IF (X11_XShm_INCLUDE_PATH)
- SET(X11_XShm_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XShm_INCLUDE_PATH})
- ENDIF (X11_XShm_INCLUDE_PATH)
-
- IF (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
- SET(X11_XTest_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XTest_INCLUDE_PATH})
- ENDIF (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
-
- IF (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB)
- SET(X11_Xi_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xi_INCLUDE_PATH})
- ENDIF (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB)
-
- IF (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB)
- SET(X11_Xinerama_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinerama_INCLUDE_PATH})
- ENDIF (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB)
-
- IF (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB)
- SET(X11_Xfixes_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xfixes_INCLUDE_PATH})
- ENDIF (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB)
-
- IF (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
- SET(X11_Xrender_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrender_INCLUDE_PATH})
- ENDIF (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
-
- IF (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB)
- SET(X11_XRes_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XRes_INCLUDE_PATH})
- ENDIF (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB)
-
- IF (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
- SET(X11_Xrandr_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH})
- ENDIF (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
-
- IF (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB)
- SET(X11_xf86misc_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH})
- ENDIF (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB)
-
- IF (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB)
- SET(X11_xf86vmode_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH})
- ENDIF (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB)
-
- IF (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
- SET(X11_Xcursor_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcursor_INCLUDE_PATH})
- ENDIF (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
-
- IF (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB)
- SET(X11_Xscreensaver_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xscreensaver_INCLUDE_PATH})
- ENDIF (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB)
-
- IF (X11_dpms_INCLUDE_PATH)
- SET(X11_dpms_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_dpms_INCLUDE_PATH})
- ENDIF (X11_dpms_INCLUDE_PATH)
-
- IF (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
- SET(X11_Xkb_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} )
- ENDIF (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
-
- IF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
- SET(X11_Xkbfile_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} )
- ENDIF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
-
- IF (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
- SET(X11_Xmu_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH})
- ENDIF (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
-
- IF (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
- SET(X11_Xinput_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH})
- ENDIF (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
-
- IF (X11_XSync_INCLUDE_PATH)
- SET(X11_XSync_FOUND TRUE)
- SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XSync_INCLUDE_PATH})
- ENDIF (X11_XSync_INCLUDE_PATH)
-
- IF(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH)
- SET(X11_ICE_FOUND TRUE)
- ENDIF(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH)
-
- IF(X11_SM_LIB AND X11_SM_INCLUDE_PATH)
- SET(X11_SM_FOUND TRUE)
- ENDIF(X11_SM_LIB AND X11_SM_INCLUDE_PATH)
-
+ find_library(X11_ICE_LIB ICE ${X11_LIB_SEARCH_PATH})
+ find_library(X11_SM_LIB SM ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xau_LIB Xau ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xcomposite_LIB Xcomposite ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xcursor_LIB Xcursor ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xdamage_LIB Xdamage ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xdmcp_LIB Xdmcp ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xext_LIB Xext ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xfixes_LIB Xfixes ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xft_LIB Xft ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xi_LIB Xi ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xinput_LIB Xi ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xmu_LIB Xmu ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xrandr_LIB Xrandr ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH})
+ find_library(X11_XRes_LIB XRes ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xscreensaver_LIB Xss ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xt_LIB Xt ${X11_LIB_SEARCH_PATH})
+ find_library(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xv_LIB Xv ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xxf86misc_LIB Xxf86misc ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xxf86vm_LIB Xxf86vm ${X11_LIB_SEARCH_PATH})
+
+ set(X11_LIBRARY_DIR "")
+ if(X11_X11_LIB)
+ get_filename_component(X11_LIBRARY_DIR ${X11_X11_LIB} PATH)
+ endif()
+
+ set(X11_INCLUDE_DIR) # start with empty list
+ if(X11_X11_INCLUDE_PATH)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH})
+ endif()
+
+ if(X11_Xlib_INCLUDE_PATH)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xlib_INCLUDE_PATH})
+ endif()
+
+ if(X11_Xutil_INCLUDE_PATH)
+ set(X11_Xutil_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xutil_INCLUDE_PATH})
+ endif()
+
+ if(X11_Xshape_INCLUDE_PATH)
+ set(X11_Xshape_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xshape_INCLUDE_PATH})
+ endif()
+
+ set(X11_LIBRARIES) # start with empty list
+ if(X11_X11_LIB)
+ set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_X11_LIB})
+ endif()
+
+ if(X11_Xext_LIB)
+ set(X11_Xext_FOUND TRUE)
+ set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIB})
+ endif()
+
+ if(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH)
+ set(X11_Xt_FOUND TRUE)
+ endif()
+
+ if(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
+ set(X11_Xft_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xft_INCLUDE_PATH})
+ endif()
+
+ if(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH)
+ set(X11_Xv_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xv_INCLUDE_PATH})
+ endif()
+
+ if (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH)
+ set(X11_Xau_FOUND TRUE)
+ endif ()
+
+ if (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
+ set(X11_Xdmcp_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdmcp_INCLUDE_PATH})
+ endif ()
+
+ if (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH)
+ set(X11_Xaccess_FOUND TRUE)
+ set(X11_Xaccess_INCLUDE_PATH ${X11_Xaccessstr_INCLUDE_PATH})
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xaccess_INCLUDE_PATH})
+ endif ()
+
+ if (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB)
+ set(X11_Xpm_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xpm_INCLUDE_PATH})
+ endif ()
+
+ if (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB)
+ set(X11_Xcomposite_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcomposite_INCLUDE_PATH})
+ endif ()
+
+ if (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB)
+ set(X11_Xdamage_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdamage_INCLUDE_PATH})
+ endif ()
+
+ if (X11_XShm_INCLUDE_PATH)
+ set(X11_XShm_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XShm_INCLUDE_PATH})
+ endif ()
+
+ if (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
+ set(X11_XTest_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XTest_INCLUDE_PATH})
+ endif ()
+
+ if (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB)
+ set(X11_Xi_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xi_INCLUDE_PATH})
+ endif ()
+
+ if (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB)
+ set(X11_Xinerama_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinerama_INCLUDE_PATH})
+ endif ()
+
+ if (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB)
+ set(X11_Xfixes_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xfixes_INCLUDE_PATH})
+ endif ()
+
+ if (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
+ set(X11_Xrender_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrender_INCLUDE_PATH})
+ endif ()
+
+ if (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB)
+ set(X11_XRes_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XRes_INCLUDE_PATH})
+ endif ()
+
+ if (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
+ set(X11_Xrandr_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH})
+ endif ()
+
+ if (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB)
+ set(X11_xf86misc_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH})
+ endif ()
+
+ if (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB)
+ set(X11_xf86vmode_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH})
+ endif ()
+
+ if (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
+ set(X11_Xcursor_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcursor_INCLUDE_PATH})
+ endif ()
+
+ if (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB)
+ set(X11_Xscreensaver_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xscreensaver_INCLUDE_PATH})
+ endif ()
+
+ if (X11_dpms_INCLUDE_PATH)
+ set(X11_dpms_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_dpms_INCLUDE_PATH})
+ endif ()
+
+ if (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
+ set(X11_Xkb_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} )
+ endif ()
+
+ if (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
+ set(X11_Xkbfile_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} )
+ endif ()
+
+ if (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
+ set(X11_Xmu_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH})
+ endif ()
+
+ if (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
+ set(X11_Xinput_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH})
+ endif ()
+
+ if (X11_XSync_INCLUDE_PATH)
+ set(X11_XSync_FOUND TRUE)
+ set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XSync_INCLUDE_PATH})
+ endif ()
+
+ if(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH)
+ set(X11_ICE_FOUND TRUE)
+ endif()
+
+ if(X11_SM_LIB AND X11_SM_INCLUDE_PATH)
+ set(X11_SM_FOUND TRUE)
+ endif()
+
+ # Most of the X11 headers will be in the same directories, avoid
+ # creating a huge list of duplicates.
+ if (X11_INCLUDE_DIR)
+ list(REMOVE_DUPLICATES X11_INCLUDE_DIR)
+ endif ()
# Deprecated variable for backwards compatibility with CMake 1.4
- IF (X11_X11_INCLUDE_PATH AND X11_LIBRARIES)
- SET(X11_FOUND 1)
- ENDIF (X11_X11_INCLUDE_PATH AND X11_LIBRARIES)
+ if (X11_X11_INCLUDE_PATH AND X11_LIBRARIES)
+ set(X11_FOUND 1)
+ endif ()
- IF(X11_FOUND)
- INCLUDE(CheckFunctionExists)
- INCLUDE(CheckLibraryExists)
+ if(X11_FOUND)
+ include(CheckFunctionExists)
+ include(CheckLibraryExists)
# Translated from an autoconf-generated configure script.
# See libs.m4 in autoconf's m4 directory.
- IF($ENV{ISC} MATCHES "^yes$")
- SET(X11_X_EXTRA_LIBS -lnsl_s -linet)
- ELSE($ENV{ISC} MATCHES "^yes$")
- SET(X11_X_EXTRA_LIBS "")
+ if($ENV{ISC} MATCHES "^yes$")
+ set(X11_X_EXTRA_LIBS -lnsl_s -linet)
+ else()
+ set(X11_X_EXTRA_LIBS "")
# See if XOpenDisplay in X11 works by itself.
CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
- IF(NOT X11_LIB_X11_SOLO)
+ if(NOT X11_LIB_X11_SOLO)
# Find library needed for dnet_ntoa.
CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
- IF (X11_LIB_DNET_HAS_DNET_NTOA)
- SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
- ELSE (X11_LIB_DNET_HAS_DNET_NTOA)
+ if (X11_LIB_DNET_HAS_DNET_NTOA)
+ set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
+ else ()
CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
- IF (X11_LIB_DNET_STUB_HAS_DNET_NTOA)
- SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
- ENDIF (X11_LIB_DNET_STUB_HAS_DNET_NTOA)
- ENDIF (X11_LIB_DNET_HAS_DNET_NTOA)
- ENDIF(NOT X11_LIB_X11_SOLO)
+ if (X11_LIB_DNET_STUB_HAS_DNET_NTOA)
+ set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
+ endif ()
+ endif ()
+ endif()
# Find library needed for gethostbyname.
CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
- IF(NOT CMAKE_HAVE_GETHOSTBYNAME)
+ if(NOT CMAKE_HAVE_GETHOSTBYNAME)
CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
- IF (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
- SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
- ELSE (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+ if (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+ set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
+ else ()
CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
- IF (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
- SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
- ENDIF (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
- ENDIF (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
- ENDIF(NOT CMAKE_HAVE_GETHOSTBYNAME)
+ if (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+ set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
+ endif ()
+ endif ()
+ endif()
# Find library needed for connect.
CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
- IF(NOT CMAKE_HAVE_CONNECT)
+ if(NOT CMAKE_HAVE_CONNECT)
CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
- IF (CMAKE_LIB_SOCKET_HAS_CONNECT)
- SET (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
- ENDIF (CMAKE_LIB_SOCKET_HAS_CONNECT)
- ENDIF(NOT CMAKE_HAVE_CONNECT)
+ if (CMAKE_LIB_SOCKET_HAS_CONNECT)
+ set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
+ endif ()
+ endif()
# Find library needed for remove.
CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE)
- IF(NOT CMAKE_HAVE_REMOVE)
+ if(NOT CMAKE_HAVE_REMOVE)
CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
- IF (CMAKE_LIB_POSIX_HAS_REMOVE)
- SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
- ENDIF (CMAKE_LIB_POSIX_HAS_REMOVE)
- ENDIF(NOT CMAKE_HAVE_REMOVE)
+ if (CMAKE_LIB_POSIX_HAS_REMOVE)
+ set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
+ endif ()
+ endif()
# Find library needed for shmat.
CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT)
- IF(NOT CMAKE_HAVE_SHMAT)
+ if(NOT CMAKE_HAVE_SHMAT)
CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
- IF (CMAKE_LIB_IPS_HAS_SHMAT)
- SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
- ENDIF (CMAKE_LIB_IPS_HAS_SHMAT)
- ENDIF(NOT CMAKE_HAVE_SHMAT)
- ENDIF($ENV{ISC} MATCHES "^yes$")
+ if (CMAKE_LIB_IPS_HAS_SHMAT)
+ set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
+ endif ()
+ endif()
+ endif()
- IF (X11_ICE_FOUND)
+ if (X11_ICE_FOUND)
CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
- IF(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
- SET (X11_X_PRE_LIBS ${X11_ICE_LIB})
- IF(X11_SM_LIB)
- SET (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
- ENDIF(X11_SM_LIB)
- ENDIF(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
- ENDIF (X11_ICE_FOUND)
+ if(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
+ set (X11_X_PRE_LIBS ${X11_ICE_LIB})
+ if(X11_SM_LIB)
+ set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
+ endif()
+ endif()
+ endif ()
# Build the final list of libraries.
- SET(X11_LIBRARIES ${X11_X_PRE_LIBS} ${X11_LIBRARIES} ${X11_X_EXTRA_LIBS})
+ set(X11_LIBRARIES ${X11_X_PRE_LIBS} ${X11_LIBRARIES} ${X11_X_EXTRA_LIBS})
- INCLUDE(FindPackageMessage)
+ include(FindPackageMessage)
FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
"[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
- ELSE (X11_FOUND)
- IF (X11_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Could not find X11")
- ENDIF (X11_FIND_REQUIRED)
- ENDIF (X11_FOUND)
+ else ()
+ if (X11_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find X11")
+ endif ()
+ endif ()
- MARK_AS_ADVANCED(
+ mark_as_advanced(
X11_X11_INCLUDE_PATH
X11_X11_LIB
X11_Xext_LIB
@@ -486,7 +491,7 @@ IF (UNIX)
X11_SM_INCLUDE_PATH
X11_XSync_INCLUDE_PATH
)
- SET(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
-ENDIF (UNIX)
+ set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
+endif ()
# X11_FIND_REQUIRED_<component> could be checked too
diff --git a/Modules/FindXMLRPC.cmake b/Modules/FindXMLRPC.cmake
index eccfb487a..6bb578b46 100644
--- a/Modules/FindXMLRPC.cmake
+++ b/Modules/FindXMLRPC.cmake
@@ -10,7 +10,7 @@
# cgi-server CGI-based server
# abyss-server ABYSS-based server
# Typical usage:
-# FIND_PACKAGE(XMLRPC REQUIRED libwww-client)
+# find_package(XMLRPC REQUIRED libwww-client)
#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
@@ -26,121 +26,121 @@
# License text for the above reference.)
# First find the config script from which to obtain other values.
-FIND_PROGRAM(XMLRPC_C_CONFIG NAMES xmlrpc-c-config)
+find_program(XMLRPC_C_CONFIG NAMES xmlrpc-c-config)
# Check whether we found anything.
-IF(XMLRPC_C_CONFIG)
- SET(XMLRPC_FOUND 1)
-ELSE(XMLRPC_C_CONFIG)
- SET(XMLRPC_FOUND 0)
-ENDIF(XMLRPC_C_CONFIG)
+if(XMLRPC_C_CONFIG)
+ set(XMLRPC_FOUND 1)
+else()
+ set(XMLRPC_FOUND 0)
+endif()
# Lookup the include directories needed for the components requested.
-IF(XMLRPC_FOUND)
+if(XMLRPC_FOUND)
# Use the newer EXECUTE_PROCESS command if it is available.
- IF(COMMAND EXECUTE_PROCESS)
- EXECUTE_PROCESS(
+ if(COMMAND EXECUTE_PROCESS)
+ execute_process(
COMMAND ${XMLRPC_C_CONFIG} ${XMLRPC_FIND_COMPONENTS} --cflags
OUTPUT_VARIABLE XMLRPC_C_CONFIG_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE XMLRPC_C_CONFIG_RESULT
)
- ELSE(COMMAND EXECUTE_PROCESS)
- EXEC_PROGRAM(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --cflags"
+ else()
+ exec_program(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --cflags"
OUTPUT_VARIABLE XMLRPC_C_CONFIG_CFLAGS
RETURN_VALUE XMLRPC_C_CONFIG_RESULT
)
- ENDIF(COMMAND EXECUTE_PROCESS)
+ endif()
# Parse the include flags.
- IF("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+ if("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
# Convert the compile flags to a CMake list.
- STRING(REGEX REPLACE " +" ";"
+ string(REGEX REPLACE " +" ";"
XMLRPC_C_CONFIG_CFLAGS "${XMLRPC_C_CONFIG_CFLAGS}")
# Look for -I options.
- SET(XMLRPC_INCLUDE_DIRS)
- FOREACH(flag ${XMLRPC_C_CONFIG_CFLAGS})
- IF("${flag}" MATCHES "^-I")
- STRING(REGEX REPLACE "^-I" "" DIR "${flag}")
- FILE(TO_CMAKE_PATH "${DIR}" DIR)
- SET(XMLRPC_INCLUDE_DIRS ${XMLRPC_INCLUDE_DIRS} "${DIR}")
- ENDIF("${flag}" MATCHES "^-I")
- ENDFOREACH(flag)
- ELSE("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
- MESSAGE("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]")
- SET(XMLRPC_FOUND 0)
- ENDIF("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
-ENDIF(XMLRPC_FOUND)
+ set(XMLRPC_INCLUDE_DIRS)
+ foreach(flag ${XMLRPC_C_CONFIG_CFLAGS})
+ if("${flag}" MATCHES "^-I")
+ string(REGEX REPLACE "^-I" "" DIR "${flag}")
+ file(TO_CMAKE_PATH "${DIR}" DIR)
+ set(XMLRPC_INCLUDE_DIRS ${XMLRPC_INCLUDE_DIRS} "${DIR}")
+ endif()
+ endforeach()
+ else()
+ message("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]")
+ set(XMLRPC_FOUND 0)
+ endif()
+endif()
# Lookup the libraries needed for the components requested.
-IF(XMLRPC_FOUND)
+if(XMLRPC_FOUND)
# Use the newer EXECUTE_PROCESS command if it is available.
- IF(COMMAND EXECUTE_PROCESS)
- EXECUTE_PROCESS(
+ if(COMMAND EXECUTE_PROCESS)
+ execute_process(
COMMAND ${XMLRPC_C_CONFIG} ${XMLRPC_FIND_COMPONENTS} --libs
OUTPUT_VARIABLE XMLRPC_C_CONFIG_LIBS
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE XMLRPC_C_CONFIG_RESULT
)
- ELSE(COMMAND EXECUTE_PROCESS)
- EXEC_PROGRAM(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --libs"
+ else()
+ exec_program(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --libs"
OUTPUT_VARIABLE XMLRPC_C_CONFIG_LIBS
RETURN_VALUE XMLRPC_C_CONFIG_RESULT
)
- ENDIF(COMMAND EXECUTE_PROCESS)
+ endif()
# Parse the library names and directories.
- IF("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
- STRING(REGEX REPLACE " +" ";"
+ if("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+ string(REGEX REPLACE " +" ";"
XMLRPC_C_CONFIG_LIBS "${XMLRPC_C_CONFIG_LIBS}")
# Look for -L flags for directories and -l flags for library names.
- SET(XMLRPC_LIBRARY_DIRS)
- SET(XMLRPC_LIBRARY_NAMES)
- FOREACH(flag ${XMLRPC_C_CONFIG_LIBS})
- IF("${flag}" MATCHES "^-L")
- STRING(REGEX REPLACE "^-L" "" DIR "${flag}")
- FILE(TO_CMAKE_PATH "${DIR}" DIR)
- SET(XMLRPC_LIBRARY_DIRS ${XMLRPC_LIBRARY_DIRS} "${DIR}")
- ELSEIF("${flag}" MATCHES "^-l")
- STRING(REGEX REPLACE "^-l" "" NAME "${flag}")
- SET(XMLRPC_LIBRARY_NAMES ${XMLRPC_LIBRARY_NAMES} "${NAME}")
- ENDIF("${flag}" MATCHES "^-L")
- ENDFOREACH(flag)
+ set(XMLRPC_LIBRARY_DIRS)
+ set(XMLRPC_LIBRARY_NAMES)
+ foreach(flag ${XMLRPC_C_CONFIG_LIBS})
+ if("${flag}" MATCHES "^-L")
+ string(REGEX REPLACE "^-L" "" DIR "${flag}")
+ file(TO_CMAKE_PATH "${DIR}" DIR)
+ set(XMLRPC_LIBRARY_DIRS ${XMLRPC_LIBRARY_DIRS} "${DIR}")
+ elseif("${flag}" MATCHES "^-l")
+ string(REGEX REPLACE "^-l" "" NAME "${flag}")
+ set(XMLRPC_LIBRARY_NAMES ${XMLRPC_LIBRARY_NAMES} "${NAME}")
+ endif()
+ endforeach()
# Search for each library needed using the directories given.
- FOREACH(name ${XMLRPC_LIBRARY_NAMES})
+ foreach(name ${XMLRPC_LIBRARY_NAMES})
# Look for this library.
- FIND_LIBRARY(XMLRPC_${name}_LIBRARY
+ find_library(XMLRPC_${name}_LIBRARY
NAMES ${name}
HINTS ${XMLRPC_LIBRARY_DIRS}
)
- MARK_AS_ADVANCED(XMLRPC_${name}_LIBRARY)
+ mark_as_advanced(XMLRPC_${name}_LIBRARY)
# If any library is not found then the whole package is not found.
- IF(NOT XMLRPC_${name}_LIBRARY)
- SET(XMLRPC_FOUND 0)
- ENDIF(NOT XMLRPC_${name}_LIBRARY)
+ if(NOT XMLRPC_${name}_LIBRARY)
+ set(XMLRPC_FOUND 0)
+ endif()
# Build an ordered list of all the libraries needed.
- SET(XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES} "${XMLRPC_${name}_LIBRARY}")
- ENDFOREACH(name)
- ELSE("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
- MESSAGE("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]")
- SET(XMLRPC_FOUND 0)
- ENDIF("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
-ENDIF(XMLRPC_FOUND)
+ set(XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES} "${XMLRPC_${name}_LIBRARY}")
+ endforeach()
+ else()
+ message("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]")
+ set(XMLRPC_FOUND 0)
+ endif()
+endif()
# Report the results.
-IF(NOT XMLRPC_FOUND)
- SET(XMLRPC_DIR_MESSAGE
+if(NOT XMLRPC_FOUND)
+ set(XMLRPC_DIR_MESSAGE
"XMLRPC was not found. Make sure the entries XMLRPC_* are set.")
- IF(NOT XMLRPC_FIND_QUIETLY)
- MESSAGE(STATUS "${XMLRPC_DIR_MESSAGE}")
- ELSE(NOT XMLRPC_FIND_QUIETLY)
- IF(XMLRPC_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "${XMLRPC_DIR_MESSAGE}")
- ENDIF(XMLRPC_FIND_REQUIRED)
- ENDIF(NOT XMLRPC_FIND_QUIETLY)
-ENDIF(NOT XMLRPC_FOUND)
+ if(NOT XMLRPC_FIND_QUIETLY)
+ message(STATUS "${XMLRPC_DIR_MESSAGE}")
+ else()
+ if(XMLRPC_FIND_REQUIRED)
+ message(FATAL_ERROR "${XMLRPC_DIR_MESSAGE}")
+ endif()
+ endif()
+endif()
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index 166e29181..00b9c64da 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -34,59 +34,59 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(_ZLIB_SEARCHES)
+set(_ZLIB_SEARCHES)
# Search ZLIB_ROOT first if it is set.
-IF(ZLIB_ROOT)
- SET(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH)
- LIST(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT)
-ENDIF()
+if(ZLIB_ROOT)
+ set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH)
+ list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT)
+endif()
# Normal search.
-SET(_ZLIB_SEARCH_NORMAL
+set(_ZLIB_SEARCH_NORMAL
PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]"
"$ENV{PROGRAMFILES}/zlib"
)
-LIST(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL)
+list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL)
-SET(ZLIB_NAMES z zlib zdll zlib1 zlibd zlibd1)
+set(ZLIB_NAMES z zlib zdll zlib1 zlibd zlibd1)
# Try each search configuration.
-FOREACH(search ${_ZLIB_SEARCHES})
- FIND_PATH(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
- FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
-ENDFOREACH()
+foreach(search ${_ZLIB_SEARCHES})
+ find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
+ find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
+endforeach()
-MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
+mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-IF(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
- FILE(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
+if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
+ file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
- STRING(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
- STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}")
- STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
- SET(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}")
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}")
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}")
# only append a TWEAK version if it exists:
- SET(ZLIB_VERSION_TWEAK "")
- IF( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
- SET(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
- SET(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
- ENDIF( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
+ set(ZLIB_VERSION_TWEAK "")
+ if( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
+ set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
+ endif()
- SET(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
- SET(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
- SET(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
-ENDIF()
+ set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
+ set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
+ set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
+endif()
-# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
VERSION_VAR ZLIB_VERSION_STRING)
-IF(ZLIB_FOUND)
- SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
- SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
-ENDIF()
+if(ZLIB_FOUND)
+ set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
+ set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
+endif()
diff --git a/Modules/Findosg.cmake b/Modules/Findosg.cmake
index 0106372e3..fb7421e85 100644
--- a/Modules/Findosg.cmake
+++ b/Modules/Findosg.cmake
@@ -3,16 +3,16 @@
# introduced in CMake 2.6.3 and not use this Find module directly.
#
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osg
# This module defines
#
diff --git a/Modules/FindosgAnimation.cmake b/Modules/FindosgAnimation.cmake
index b9b44a081..1c8eb5068 100644
--- a/Modules/FindosgAnimation.cmake
+++ b/Modules/FindosgAnimation.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgAnimation
# This module defines
#
diff --git a/Modules/FindosgDB.cmake b/Modules/FindosgDB.cmake
index eabdde72d..76272aa67 100644
--- a/Modules/FindosgDB.cmake
+++ b/Modules/FindosgDB.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgDB
# This module defines
#
diff --git a/Modules/FindosgFX.cmake b/Modules/FindosgFX.cmake
index 81d5af5a2..331475093 100644
--- a/Modules/FindosgFX.cmake
+++ b/Modules/FindosgFX.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgFX
# This module defines
#
diff --git a/Modules/FindosgGA.cmake b/Modules/FindosgGA.cmake
index a4fe79b0d..fd9317d5e 100644
--- a/Modules/FindosgGA.cmake
+++ b/Modules/FindosgGA.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgGA
# This module defines
#
diff --git a/Modules/FindosgIntrospection.cmake b/Modules/FindosgIntrospection.cmake
index 24e6ed585..2394c0592 100644
--- a/Modules/FindosgIntrospection.cmake
+++ b/Modules/FindosgIntrospection.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgINTROSPECTION
# This module defines
#
diff --git a/Modules/FindosgManipulator.cmake b/Modules/FindosgManipulator.cmake
index f71b5fd5c..9e5857083 100644
--- a/Modules/FindosgManipulator.cmake
+++ b/Modules/FindosgManipulator.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgManipulator
# This module defines
#
diff --git a/Modules/FindosgParticle.cmake b/Modules/FindosgParticle.cmake
index f23a83fdd..2f93389ff 100644
--- a/Modules/FindosgParticle.cmake
+++ b/Modules/FindosgParticle.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgParticle
# This module defines
#
diff --git a/Modules/FindosgProducer.cmake b/Modules/FindosgProducer.cmake
index 51f609064..2c3800b54 100644
--- a/Modules/FindosgProducer.cmake
+++ b/Modules/FindosgProducer.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgProducer
# This module defines
#
diff --git a/Modules/FindosgShadow.cmake b/Modules/FindosgShadow.cmake
index 278f8ae9e..ca87b5611 100644
--- a/Modules/FindosgShadow.cmake
+++ b/Modules/FindosgShadow.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgShadow
# This module defines
#
diff --git a/Modules/FindosgSim.cmake b/Modules/FindosgSim.cmake
index 15daf64fe..2fc5105d1 100644
--- a/Modules/FindosgSim.cmake
+++ b/Modules/FindosgSim.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgSim
# This module defines
#
diff --git a/Modules/FindosgTerrain.cmake b/Modules/FindosgTerrain.cmake
index fbf373e59..eafd8fbc0 100644
--- a/Modules/FindosgTerrain.cmake
+++ b/Modules/FindosgTerrain.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgTerrain
# This module defines
#
diff --git a/Modules/FindosgText.cmake b/Modules/FindosgText.cmake
index 22f825f54..57655b196 100644
--- a/Modules/FindosgText.cmake
+++ b/Modules/FindosgText.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgText
# This module defines
#
diff --git a/Modules/FindosgUtil.cmake b/Modules/FindosgUtil.cmake
index 05a74df84..eeabc34af 100644
--- a/Modules/FindosgUtil.cmake
+++ b/Modules/FindosgUtil.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgUtil
# This module defines
#
diff --git a/Modules/FindosgViewer.cmake b/Modules/FindosgViewer.cmake
index 650dbd7ef..2afd76195 100644
--- a/Modules/FindosgViewer.cmake
+++ b/Modules/FindosgViewer.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgViewer
# This module defines
#
diff --git a/Modules/FindosgVolume.cmake b/Modules/FindosgVolume.cmake
index 3ad7edc24..1fa6764a7 100644
--- a/Modules/FindosgVolume.cmake
+++ b/Modules/FindosgVolume.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgVolume
# This module defines
#
diff --git a/Modules/FindosgWidget.cmake b/Modules/FindosgWidget.cmake
index 206a8b7f5..1a51e6014 100644
--- a/Modules/FindosgWidget.cmake
+++ b/Modules/FindosgWidget.cmake
@@ -1,14 +1,14 @@
# This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these
-# modules won't do it for you. This is to allow you control over your own
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
# system piece by piece in case you need to opt out of certain components
# or change the Find behavior for a particular module (perhaps because the
# default FindOpenGL.cmake module doesn't work with your system as an
# example).
# If you want to use a more convenient module that includes everything,
# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
+#
# Locate osgWidget
# This module defines
#
diff --git a/Modules/Findosg_functions.cmake b/Modules/Findosg_functions.cmake
index ab836ff9f..2e908379f 100644
--- a/Modules/Findosg_functions.cmake
+++ b/Modules/Findosg_functions.cmake
@@ -1,11 +1,12 @@
#
# This CMake file contains two macros to assist with searching for OSG
-# libraries and nodekits.
+# libraries and nodekits. Please see FindOpenSceneGraph.cmake for full
+# documentation.
#
#=============================================================================
# Copyright 2009 Kitware, Inc.
-# Copyright 2009 Philip Lowman <philip@yhbt.com>
+# Copyright 2009-2012 Philip Lowman <philip@yhbt.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -26,10 +27,12 @@ function(OSG_FIND_PATH module header)
# Try the user's environment request before anything else.
find_path(${module_uc}_INCLUDE_DIR ${header}
HINTS
- $ENV{${module_uc}_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- $ENV{OSG_ROOT}
+ ENV ${module_uc}_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
+ ENV OSG_ROOT
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
PATH_SUFFIXES include
PATHS
/sw # Fink
@@ -38,7 +41,7 @@ function(OSG_FIND_PATH module header)
/opt
/usr/freeware
)
-endfunction(OSG_FIND_PATH module header)
+endfunction()
#
@@ -50,11 +53,13 @@ function(OSG_FIND_LIBRARY module library)
find_library(${module_uc}_LIBRARY
NAMES ${library}
HINTS
- $ENV{${module_uc}_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- $ENV{OSG_ROOT}
- PATH_SUFFIXES lib64 lib
+ ENV ${module_uc}_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
+ ENV OSG_ROOT
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
+ PATH_SUFFIXES lib
PATHS
/sw # Fink
/opt/local # DarwinPorts
@@ -66,11 +71,13 @@ function(OSG_FIND_LIBRARY module library)
find_library(${module_uc}_LIBRARY_DEBUG
NAMES ${library}d
HINTS
- $ENV{${module_uc}_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- $ENV{OSG_ROOT}
- PATH_SUFFIXES lib64 lib
+ ENV ${module_uc}_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
+ ENV OSG_ROOT
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
+ PATH_SUFFIXES lib
PATHS
/sw # Fink
/opt/local # DarwinPorts
@@ -85,13 +92,13 @@ function(OSG_FIND_LIBRARY module library)
set(${module_uc}_LIBRARIES ${${module_uc}_LIBRARY} PARENT_SCOPE)
else()
# They really have a FOO_LIBRARY_DEBUG
- set(${module_uc}_LIBRARIES
+ set(${module_uc}_LIBRARIES
optimized ${${module_uc}_LIBRARY}
debug ${${module_uc}_LIBRARY_DEBUG}
PARENT_SCOPE
)
endif()
-endfunction(OSG_FIND_LIBRARY module library)
+endfunction()
#
# OSG_MARK_AS_ADVANCED
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index 865a6c5d1..218d47613 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -3,9 +3,9 @@
# configuration to use. wxWidgets is a modular library. To specify the
# modules that you will use, you need to name them as components to
# the package:
-#
-# FIND_PACKAGE(wxWidgets COMPONENTS core base ...)
-#
+#
+# find_package(wxWidgets COMPONENTS core base ...)
+#
# There are two search branches: a windows style and a unix style. For
# windows, the following variables are searched for and set to
# defaults in case of multiple choices. Change them if the defaults
@@ -22,7 +22,7 @@
# - Set to TRUE to exclude linking of
# commonly required libs (e.g., png tiff
# jpeg zlib regex expat).
-#
+#
# For unix style it uses the wx-config utility. You can select between
# debug/release, unicode/ansi, universal/non-universal, and
# static/shared in the QtDialog or ccmake interfaces by turning ON/OFF
@@ -38,7 +38,7 @@
# example, to use the base toolkit found in the /usr/local path, set
# the variable (before calling the FIND_PACKAGE command) as such:
#
-# SET(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr)
+# set(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr)
#
# The following are set after the configuration is done for both
# windows and unix style:
@@ -62,18 +62,18 @@
#
# Sample usage:
# # Note that for MinGW users the order of libs is important!
-# FIND_PACKAGE(wxWidgets COMPONENTS net gl core base)
-# IF(wxWidgets_FOUND)
-# INCLUDE(${wxWidgets_USE_FILE})
+# find_package(wxWidgets COMPONENTS net gl core base)
+# if(wxWidgets_FOUND)
+# include(${wxWidgets_USE_FILE})
# # and for each of your dependent executable/library targets:
-# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
-# ENDIF(wxWidgets_FOUND)
+# target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
+# endif()
#
# If wxWidgets is required (i.e., not an optional part):
-# FIND_PACKAGE(wxWidgets REQUIRED net gl core base)
-# INCLUDE(${wxWidgets_USE_FILE})
+# find_package(wxWidgets REQUIRED net gl core base)
+# include(${wxWidgets_USE_FILE})
# # and for each of your dependent executable/library targets:
-# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
+# target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
#=============================================================================
# Copyright 2004-2009 Kitware, Inc.
@@ -94,7 +94,7 @@
# Remember to connect back to the upper text.
# Sample usage with monolithic wx build:
#
-# FIND_PACKAGE(wxWidgets COMPONENTS mono)
+# find_package(wxWidgets COMPONENTS mono)
# ...
# NOTES
@@ -140,24 +140,24 @@
# FIXME: This and all the DBG_MSG calls should be removed after the
# module stabilizes.
-#
+#
# Helper macro to control the debugging output globally. There are
# two versions for controlling how verbose your output should be.
-MACRO(DBG_MSG _MSG)
-# MESSAGE(STATUS
+macro(DBG_MSG _MSG)
+# message(STATUS
# "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
-ENDMACRO(DBG_MSG)
-MACRO(DBG_MSG_V _MSG)
-# MESSAGE(STATUS
+endmacro()
+macro(DBG_MSG_V _MSG)
+# message(STATUS
# "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
-ENDMACRO(DBG_MSG_V)
+endmacro()
# Clear return values in case the module is loaded more than once.
-SET(wxWidgets_FOUND FALSE)
-SET(wxWidgets_INCLUDE_DIRS "")
-SET(wxWidgets_LIBRARIES "")
-SET(wxWidgets_LIBRARY_DIRS "")
-SET(wxWidgets_CXX_FLAGS "")
+set(wxWidgets_FOUND FALSE)
+set(wxWidgets_INCLUDE_DIRS "")
+set(wxWidgets_LIBRARIES "")
+set(wxWidgets_LIBRARY_DIRS "")
+set(wxWidgets_CXX_FLAGS "")
# Using SYSTEM with INCLUDE_DIRECTORIES in conjunction with wxWidgets on
# the Mac produces compiler errors. Set wxWidgets_INCLUDE_DIRS_NO_SYSTEM
@@ -167,9 +167,9 @@ SET(wxWidgets_CXX_FLAGS "")
# http://www.cmake.org/pipermail/cmake/2008-April/021115.html
# http://www.cmake.org/pipermail/cmake/2008-April/021146.html
#
-IF(APPLE OR CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
- SET(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1)
-ENDIF()
+if(APPLE OR CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
+ set(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1)
+endif()
# DEPRECATED: This is a patch to support the DEPRECATED use of
# wxWidgets_USE_LIBS.
@@ -177,9 +177,9 @@ ENDIF()
# If wxWidgets_USE_LIBS is set:
# - if using <components>, then override wxWidgets_USE_LIBS
# - else set wxWidgets_FIND_COMPONENTS to wxWidgets_USE_LIBS
-IF(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS)
- SET(wxWidgets_FIND_COMPONENTS ${wxWidgets_USE_LIBS})
-ENDIF(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS)
+if(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS)
+ set(wxWidgets_FIND_COMPONENTS ${wxWidgets_USE_LIBS})
+endif()
DBG_MSG("wxWidgets_FIND_COMPONENTS : ${wxWidgets_FIND_COMPONENTS}")
# Add the convenience use file if available.
@@ -187,50 +187,50 @@ DBG_MSG("wxWidgets_FIND_COMPONENTS : ${wxWidgets_FIND_COMPONENTS}")
# Get dir of this file which may reside in:
# - CMAKE_MAKE_ROOT/Modules on CMake installation
# - CMAKE_MODULE_PATH if user prefers his own specialized version
-SET(wxWidgets_USE_FILE "")
-GET_FILENAME_COMPONENT(
+set(wxWidgets_USE_FILE "")
+get_filename_component(
wxWidgets_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
# Prefer an existing customized version, but the user might override
# the FindwxWidgets module and not the UsewxWidgets one.
-IF(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
- SET(wxWidgets_USE_FILE
+if(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
+ set(wxWidgets_USE_FILE
"${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
-ELSE(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
- SET(wxWidgets_USE_FILE UsewxWidgets)
-ENDIF(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
+else()
+ set(wxWidgets_USE_FILE UsewxWidgets)
+endif()
#=====================================================================
#=====================================================================
-IF(WIN32 AND NOT CYGWIN AND NOT MSYS)
- SET(wxWidgets_FIND_STYLE "win32")
-ELSE(WIN32 AND NOT CYGWIN AND NOT MSYS)
- IF(UNIX OR MSYS)
- SET(wxWidgets_FIND_STYLE "unix")
- ENDIF(UNIX OR MSYS)
-ENDIF(WIN32 AND NOT CYGWIN AND NOT MSYS)
+if(WIN32 AND NOT CYGWIN AND NOT MSYS)
+ set(wxWidgets_FIND_STYLE "win32")
+else()
+ if(UNIX OR MSYS)
+ set(wxWidgets_FIND_STYLE "unix")
+ endif()
+endif()
#=====================================================================
# WIN32_FIND_STYLE
#=====================================================================
-IF(wxWidgets_FIND_STYLE STREQUAL "win32")
+if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Useful common wx libs needed by almost all components.
- SET(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat)
+ set(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat)
- # DEPRECATED: Use FIND_PACKAGE(wxWidgets COMPONENTS mono) instead.
- IF(NOT wxWidgets_FIND_COMPONENTS)
- IF(wxWidgets_USE_MONOLITHIC)
- SET(wxWidgets_FIND_COMPONENTS mono)
- ELSE(wxWidgets_USE_MONOLITHIC)
- SET(wxWidgets_FIND_COMPONENTS core base) # this is default
- ENDIF(wxWidgets_USE_MONOLITHIC)
- ENDIF(NOT wxWidgets_FIND_COMPONENTS)
+ # DEPRECATED: Use find_package(wxWidgets COMPONENTS mono) instead.
+ if(NOT wxWidgets_FIND_COMPONENTS)
+ if(wxWidgets_USE_MONOLITHIC)
+ set(wxWidgets_FIND_COMPONENTS mono)
+ else()
+ set(wxWidgets_FIND_COMPONENTS core base) # this is default
+ endif()
+ endif()
# Add the common (usually required libs) unless
# wxWidgets_EXCLUDE_COMMON_LIBRARIES has been set.
- IF(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES)
- LIST(APPEND wxWidgets_FIND_COMPONENTS
+ if(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES)
+ list(APPEND wxWidgets_FIND_COMPONENTS
${wxWidgets_COMMON_LIBRARIES})
- ENDIF(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES)
+ endif()
#-------------------------------------------------------------------
# WIN32: Helper MACROS
@@ -240,19 +240,19 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
# if _CONFIGURATION = mswunivud, then _UNV=univ, _UCD=u _DBG=d
# if _CONFIGURATION = mswu, then _UNV="", _UCD=u _DBG=""
#
- MACRO(WX_GET_NAME_COMPONENTS _CONFIGURATION _UNV _UCD _DBG)
- STRING(REGEX MATCH "univ" ${_UNV} "${_CONFIGURATION}")
- STRING(REGEX REPLACE "msw.*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}")
- IF(${_UCD} STREQUAL ${_CONFIGURATION})
- SET(${_UCD} "")
- ENDIF(${_UCD} STREQUAL ${_CONFIGURATION})
- STRING(REGEX MATCH "d$" ${_DBG} "${_CONFIGURATION}")
- ENDMACRO(WX_GET_NAME_COMPONENTS)
+ macro(WX_GET_NAME_COMPONENTS _CONFIGURATION _UNV _UCD _DBG)
+ string(REGEX MATCH "univ" ${_UNV} "${_CONFIGURATION}")
+ string(REGEX REPLACE "msw.*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}")
+ if(${_UCD} STREQUAL ${_CONFIGURATION})
+ set(${_UCD} "")
+ endif()
+ string(REGEX MATCH "d$" ${_DBG} "${_CONFIGURATION}")
+ endmacro()
#
# Find libraries associated to a configuration.
#
- MACRO(WX_FIND_LIBS _UNV _UCD _DBG)
+ macro(WX_FIND_LIBS _UNV _UCD _DBG)
DBG_MSG_V("m_unv = ${_UNV}")
DBG_MSG_V("m_ucd = ${_UCD}")
DBG_MSG_V("m_dbg = ${_DBG}")
@@ -260,19 +260,19 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
# FIXME: What if both regex libs are available. regex should be
# found outside the loop and only wx${LIB}${_UCD}${_DBG}.
# Find wxWidgets common libraries.
- FOREACH(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
- FIND_LIBRARY(WX_${LIB}${_DBG}
+ foreach(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
+ find_library(WX_${LIB}${_DBG}
NAMES
wx${LIB}${_UCD}${_DBG} # for regex
wx${LIB}${_DBG}
PATHS ${WX_LIB_DIR}
NO_DEFAULT_PATH
)
- MARK_AS_ADVANCED(WX_${LIB}${_DBG})
- ENDFOREACH(LIB)
+ mark_as_advanced(WX_${LIB}${_DBG})
+ endforeach()
# Find wxWidgets multilib base libraries.
- FIND_LIBRARY(WX_base${_DBG}
+ find_library(WX_base${_DBG}
NAMES
wxbase29${_UCD}${_DBG}
wxbase28${_UCD}${_DBG}
@@ -282,9 +282,9 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
PATHS ${WX_LIB_DIR}
NO_DEFAULT_PATH
)
- MARK_AS_ADVANCED(WX_base${_DBG})
- FOREACH(LIB net odbc xml)
- FIND_LIBRARY(WX_${LIB}${_DBG}
+ mark_as_advanced(WX_base${_DBG})
+ foreach(LIB net odbc xml)
+ find_library(WX_${LIB}${_DBG}
NAMES
wxbase29${_UCD}${_DBG}_${LIB}
wxbase28${_UCD}${_DBG}_${LIB}
@@ -294,11 +294,11 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
PATHS ${WX_LIB_DIR}
NO_DEFAULT_PATH
)
- MARK_AS_ADVANCED(WX_${LIB}${_DBG})
- ENDFOREACH(LIB)
+ mark_as_advanced(WX_${LIB}${_DBG})
+ endforeach()
# Find wxWidgets monolithic library.
- FIND_LIBRARY(WX_mono${_DBG}
+ find_library(WX_mono${_DBG}
NAMES
wxmsw${_UNV}29${_UCD}${_DBG}
wxmsw${_UNV}28${_UCD}${_DBG}
@@ -308,12 +308,12 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
PATHS ${WX_LIB_DIR}
NO_DEFAULT_PATH
)
- MARK_AS_ADVANCED(WX_mono${_DBG})
+ mark_as_advanced(WX_mono${_DBG})
# Find wxWidgets multilib libraries.
- FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext
+ foreach(LIB core adv aui html media xrc dbgrid gl qa richtext
stc ribbon propgrid webview)
- FIND_LIBRARY(WX_${LIB}${_DBG}
+ find_library(WX_${LIB}${_DBG}
NAMES
wxmsw${_UNV}29${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}28${_UCD}${_DBG}_${LIB}
@@ -323,111 +323,111 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
PATHS ${WX_LIB_DIR}
NO_DEFAULT_PATH
)
- MARK_AS_ADVANCED(WX_${LIB}${_DBG})
- ENDFOREACH(LIB)
- ENDMACRO(WX_FIND_LIBS)
+ mark_as_advanced(WX_${LIB}${_DBG})
+ endforeach()
+ endmacro()
#
# Clear all library paths, so that FIND_LIBRARY refinds them.
#
# Clear a lib, reset its found flag, and mark as advanced.
- MACRO(WX_CLEAR_LIB _LIB)
- SET(${_LIB} "${_LIB}-NOTFOUND" CACHE FILEPATH "Cleared." FORCE)
- SET(${_LIB}_FOUND FALSE)
- MARK_AS_ADVANCED(${_LIB})
- ENDMACRO(WX_CLEAR_LIB)
+ macro(WX_CLEAR_LIB _LIB)
+ set(${_LIB} "${_LIB}-NOTFOUND" CACHE FILEPATH "Cleared." FORCE)
+ set(${_LIB}_FOUND FALSE)
+ mark_as_advanced(${_LIB})
+ endmacro()
# Clear all debug or release library paths (arguments are "d" or "").
- MACRO(WX_CLEAR_ALL_LIBS _DBG)
+ macro(WX_CLEAR_ALL_LIBS _DBG)
# Clear wxWidgets common libraries.
- FOREACH(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
+ foreach(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
WX_CLEAR_LIB(WX_${LIB}${_DBG})
- ENDFOREACH(LIB)
+ endforeach()
# Clear wxWidgets multilib base libraries.
WX_CLEAR_LIB(WX_base${_DBG})
- FOREACH(LIB net odbc xml)
+ foreach(LIB net odbc xml)
WX_CLEAR_LIB(WX_${LIB}${_DBG})
- ENDFOREACH(LIB)
+ endforeach()
# Clear wxWidgets monolithic library.
WX_CLEAR_LIB(WX_mono${_DBG})
# Clear wxWidgets multilib libraries.
- FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext
+ foreach(LIB core adv aui html media xrc dbgrid gl qa richtext
stc ribbon propgrid)
WX_CLEAR_LIB(WX_${LIB}${_DBG})
- ENDFOREACH(LIB)
- ENDMACRO(WX_CLEAR_ALL_LIBS)
+ endforeach()
+ endmacro()
# Clear all wxWidgets debug libraries.
- MACRO(WX_CLEAR_ALL_DBG_LIBS)
+ macro(WX_CLEAR_ALL_DBG_LIBS)
WX_CLEAR_ALL_LIBS("d")
- ENDMACRO(WX_CLEAR_ALL_DBG_LIBS)
+ endmacro()
# Clear all wxWidgets release libraries.
- MACRO(WX_CLEAR_ALL_REL_LIBS)
+ macro(WX_CLEAR_ALL_REL_LIBS)
WX_CLEAR_ALL_LIBS("")
- ENDMACRO(WX_CLEAR_ALL_REL_LIBS)
+ endmacro()
#
# Set the wxWidgets_LIBRARIES variable.
# Also, Sets output variable wxWidgets_FOUND to FALSE if it fails.
#
- MACRO(WX_SET_LIBRARIES _LIBS _DBG)
+ macro(WX_SET_LIBRARIES _LIBS _DBG)
DBG_MSG_V("Looking for ${${_LIBS}}")
- IF(WX_USE_REL_AND_DBG)
- FOREACH(LIB ${${_LIBS}})
+ if(WX_USE_REL_AND_DBG)
+ foreach(LIB ${${_LIBS}})
DBG_MSG_V("Searching for ${LIB} and ${LIB}d")
DBG_MSG_V("WX_${LIB} : ${WX_${LIB}}")
DBG_MSG_V("WX_${LIB}d : ${WX_${LIB}d}")
- IF(WX_${LIB} AND WX_${LIB}d)
+ if(WX_${LIB} AND WX_${LIB}d)
DBG_MSG_V("Found ${LIB} and ${LIB}d")
- LIST(APPEND wxWidgets_LIBRARIES
+ list(APPEND wxWidgets_LIBRARIES
debug ${WX_${LIB}d} optimized ${WX_${LIB}}
)
- ELSE(WX_${LIB} AND WX_${LIB}d)
+ else()
DBG_MSG_V("- not found due to missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}")
- SET(wxWidgets_FOUND FALSE)
- ENDIF(WX_${LIB} AND WX_${LIB}d)
- ENDFOREACH(LIB)
- ELSE(WX_USE_REL_AND_DBG)
- FOREACH(LIB ${${_LIBS}})
+ set(wxWidgets_FOUND FALSE)
+ endif()
+ endforeach()
+ else()
+ foreach(LIB ${${_LIBS}})
DBG_MSG_V("Searching for ${LIB}${_DBG}")
DBG_MSG_V("WX_${LIB}${_DBG} : ${WX_${LIB}${_DBG}}")
- IF(WX_${LIB}${_DBG})
+ if(WX_${LIB}${_DBG})
DBG_MSG_V("Found ${LIB}${_DBG}")
- LIST(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}})
- ELSE(WX_${LIB}${_DBG})
+ list(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}})
+ else()
DBG_MSG_V(
"- not found due to missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}")
- SET(wxWidgets_FOUND FALSE)
- ENDIF(WX_${LIB}${_DBG})
- ENDFOREACH(LIB)
- ENDIF(WX_USE_REL_AND_DBG)
+ set(wxWidgets_FOUND FALSE)
+ endif()
+ endforeach()
+ endif()
DBG_MSG_V("OpenGL")
- LIST(FIND ${_LIBS} gl WX_USE_GL)
- IF(NOT WX_USE_GL EQUAL -1)
+ list(FIND ${_LIBS} gl WX_USE_GL)
+ if(NOT WX_USE_GL EQUAL -1)
DBG_MSG_V("- is required.")
- LIST(APPEND wxWidgets_LIBRARIES opengl32 glu32)
- ENDIF(NOT WX_USE_GL EQUAL -1)
+ list(APPEND wxWidgets_LIBRARIES opengl32 glu32)
+ endif()
- LIST(APPEND wxWidgets_LIBRARIES winmm comctl32 rpcrt4 wsock32)
- ENDMACRO(WX_SET_LIBRARIES)
+ list(APPEND wxWidgets_LIBRARIES winmm comctl32 rpcrt4 wsock32)
+ endmacro()
#-------------------------------------------------------------------
# WIN32: Start actual work.
#-------------------------------------------------------------------
# Look for an installation tree.
- FIND_PATH(wxWidgets_ROOT_DIR
+ find_path(wxWidgets_ROOT_DIR
NAMES include/wx/wx.h
PATHS
- $ENV{wxWidgets_ROOT_DIR}
- $ENV{WXWIN}
+ ENV wxWidgets_ROOT_DIR
+ ENV WXWIN
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]" # WX 2.6.x
C:/
D:/
- $ENV{ProgramFiles}
- PATH_SUFFIXES
+ ENV ProgramFiles
+ PATH_SUFFIXES
wxWidgets-2.9.4
wxWidgets-2.9.3
wxWidgets-2.9.2
@@ -462,24 +462,24 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
)
# If wxWidgets_ROOT_DIR changed, clear lib dir.
- IF(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR)
- SET(WX_ROOT_DIR ${wxWidgets_ROOT_DIR}
+ if(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR)
+ set(WX_ROOT_DIR ${wxWidgets_ROOT_DIR}
CACHE INTERNAL "wxWidgets_ROOT_DIR")
- SET(wxWidgets_LIB_DIR "wxWidgets_LIB_DIR-NOTFOUND"
+ set(wxWidgets_LIB_DIR "wxWidgets_LIB_DIR-NOTFOUND"
CACHE PATH "Cleared." FORCE)
- ENDIF(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR)
+ endif()
- IF(WX_ROOT_DIR)
+ if(WX_ROOT_DIR)
# Select one default tree inside the already determined wx tree.
# Prefer static/shared order usually consistent with build
# settings.
- IF(MINGW)
- SET(WX_LIB_DIR_PREFIX gcc)
- ELSE(MINGW)
- SET(WX_LIB_DIR_PREFIX vc)
- ENDIF(MINGW)
- IF(BUILD_SHARED_LIBS)
- FIND_PATH(wxWidgets_LIB_DIR
+ if(MINGW)
+ set(WX_LIB_DIR_PREFIX gcc)
+ else()
+ set(WX_LIB_DIR_PREFIX vc)
+ endif()
+ if(BUILD_SHARED_LIBS)
+ find_path(wxWidgets_LIB_DIR
NAMES
msw/wx/setup.h
mswd/wx/setup.h
@@ -495,8 +495,8 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
DOC "Path to wxWidgets libraries?"
NO_DEFAULT_PATH
)
- ELSE(BUILD_SHARED_LIBS)
- FIND_PATH(wxWidgets_LIB_DIR
+ else()
+ find_path(wxWidgets_LIB_DIR
NAMES
msw/wx/setup.h
mswd/wx/setup.h
@@ -512,202 +512,202 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
DOC "Path to wxWidgets libraries?"
NO_DEFAULT_PATH
)
- ENDIF(BUILD_SHARED_LIBS)
+ endif()
# If wxWidgets_LIB_DIR changed, clear all libraries.
- IF(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR)
- SET(WX_LIB_DIR ${wxWidgets_LIB_DIR} CACHE INTERNAL "wxWidgets_LIB_DIR")
+ if(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR)
+ set(WX_LIB_DIR ${wxWidgets_LIB_DIR} CACHE INTERNAL "wxWidgets_LIB_DIR")
WX_CLEAR_ALL_DBG_LIBS()
WX_CLEAR_ALL_REL_LIBS()
- ENDIF(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR)
+ endif()
- IF(WX_LIB_DIR)
+ if(WX_LIB_DIR)
# If building shared libs, define WXUSINGDLL to use dllimport.
- IF(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*")
- SET(wxWidgets_DEFINITIONS WXUSINGDLL)
+ if(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*")
+ set(wxWidgets_DEFINITIONS WXUSINGDLL)
DBG_MSG_V("detected SHARED/DLL tree WX_LIB_DIR=${WX_LIB_DIR}")
- ENDIF(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*")
+ endif()
# Search for available configuration types.
- FOREACH(CFG mswunivud mswunivd mswud mswd mswunivu mswuniv mswu msw)
- SET(WX_${CFG}_FOUND FALSE)
- IF(EXISTS ${WX_LIB_DIR}/${CFG})
- LIST(APPEND WX_CONFIGURATION_LIST ${CFG})
- SET(WX_${CFG}_FOUND TRUE)
- SET(WX_CONFIGURATION ${CFG})
- ENDIF(EXISTS ${WX_LIB_DIR}/${CFG})
- ENDFOREACH(CFG)
+ foreach(CFG mswunivud mswunivd mswud mswd mswunivu mswuniv mswu msw)
+ set(WX_${CFG}_FOUND FALSE)
+ if(EXISTS ${WX_LIB_DIR}/${CFG})
+ list(APPEND WX_CONFIGURATION_LIST ${CFG})
+ set(WX_${CFG}_FOUND TRUE)
+ set(WX_CONFIGURATION ${CFG})
+ endif()
+ endforeach()
DBG_MSG_V("WX_CONFIGURATION_LIST=${WX_CONFIGURATION_LIST}")
- IF(WX_CONFIGURATION)
- SET(wxWidgets_FOUND TRUE)
+ if(WX_CONFIGURATION)
+ set(wxWidgets_FOUND TRUE)
# If the selected configuration wasn't found force the default
# one. Otherwise, use it but still force a refresh for
# updating the doc string with the current list of available
# configurations.
- IF(NOT WX_${wxWidgets_CONFIGURATION}_FOUND)
- SET(wxWidgets_CONFIGURATION ${WX_CONFIGURATION} CACHE STRING
+ if(NOT WX_${wxWidgets_CONFIGURATION}_FOUND)
+ set(wxWidgets_CONFIGURATION ${WX_CONFIGURATION} CACHE STRING
"Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE)
- ELSE(NOT WX_${wxWidgets_CONFIGURATION}_FOUND)
- SET(wxWidgets_CONFIGURATION ${wxWidgets_CONFIGURATION} CACHE STRING
+ else()
+ set(wxWidgets_CONFIGURATION ${wxWidgets_CONFIGURATION} CACHE STRING
"Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE)
- ENDIF(NOT WX_${wxWidgets_CONFIGURATION}_FOUND)
+ endif()
# If release config selected, and both release/debug exist.
- IF(WX_${wxWidgets_CONFIGURATION}d_FOUND)
- OPTION(wxWidgets_USE_REL_AND_DBG
+ if(WX_${wxWidgets_CONFIGURATION}d_FOUND)
+ option(wxWidgets_USE_REL_AND_DBG
"Use release and debug configurations?" TRUE)
- SET(WX_USE_REL_AND_DBG ${wxWidgets_USE_REL_AND_DBG})
- ELSE(WX_${wxWidgets_CONFIGURATION}d_FOUND)
+ set(WX_USE_REL_AND_DBG ${wxWidgets_USE_REL_AND_DBG})
+ else()
# If the option exists (already in cache), force it false.
- IF(wxWidgets_USE_REL_AND_DBG)
- SET(wxWidgets_USE_REL_AND_DBG FALSE CACHE BOOL
+ if(wxWidgets_USE_REL_AND_DBG)
+ set(wxWidgets_USE_REL_AND_DBG FALSE CACHE BOOL
"No ${wxWidgets_CONFIGURATION}d found." FORCE)
- ENDIF(wxWidgets_USE_REL_AND_DBG)
- SET(WX_USE_REL_AND_DBG FALSE)
- ENDIF(WX_${wxWidgets_CONFIGURATION}d_FOUND)
+ endif()
+ set(WX_USE_REL_AND_DBG FALSE)
+ endif()
# Get configuration parameters from the name.
WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG)
# Set wxWidgets lib setup include directory.
- IF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
- SET(wxWidgets_INCLUDE_DIRS
+ if(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
+ set(wxWidgets_INCLUDE_DIRS
${WX_LIB_DIR}/${wxWidgets_CONFIGURATION})
- ELSE(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
+ else()
DBG_MSG("wxWidgets_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.")
- SET(wxWidgets_FOUND FALSE)
- ENDIF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
+ set(wxWidgets_FOUND FALSE)
+ endif()
# Set wxWidgets main include directory.
- IF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
- LIST(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include)
- ELSE(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+ if(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+ list(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include)
+ else()
DBG_MSG("wxWidgets_FOUND FALSE because WX_ROOT_DIR=${WX_ROOT_DIR} has no ${WX_ROOT_DIR}/include/wx/wx.h")
- SET(wxWidgets_FOUND FALSE)
- ENDIF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+ set(wxWidgets_FOUND FALSE)
+ endif()
# Find wxWidgets libraries.
WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}")
- IF(WX_USE_REL_AND_DBG)
+ if(WX_USE_REL_AND_DBG)
WX_FIND_LIBS("${UNV}" "${UCD}" "d")
- ENDIF(WX_USE_REL_AND_DBG)
+ endif()
# Settings for requested libs (i.e., include dir, libraries, etc.).
WX_SET_LIBRARIES(wxWidgets_FIND_COMPONENTS "${DBG}")
# Add necessary definitions for unicode builds
- IF("${UCD}" STREQUAL "u")
- LIST(APPEND wxWidgets_DEFINITIONS UNICODE _UNICODE)
- ENDIF("${UCD}" STREQUAL "u")
+ if("${UCD}" STREQUAL "u")
+ list(APPEND wxWidgets_DEFINITIONS UNICODE _UNICODE)
+ endif()
# Add necessary definitions for debug builds
- SET(wxWidgets_DEFINITIONS_DEBUG _DEBUG __WXDEBUG__)
+ set(wxWidgets_DEFINITIONS_DEBUG _DEBUG __WXDEBUG__)
- ENDIF(WX_CONFIGURATION)
- ENDIF(WX_LIB_DIR)
- ENDIF(WX_ROOT_DIR)
+ endif()
+ endif()
+ endif()
#=====================================================================
# UNIX_FIND_STYLE
#=====================================================================
-ELSE(wxWidgets_FIND_STYLE STREQUAL "win32")
- IF(wxWidgets_FIND_STYLE STREQUAL "unix")
+else()
+ if(wxWidgets_FIND_STYLE STREQUAL "unix")
#-----------------------------------------------------------------
# UNIX: Helper MACROS
#-----------------------------------------------------------------
#
# Set the default values based on "wx-config --selected-config".
#
- MACRO(WX_CONFIG_SELECT_GET_DEFAULT)
- EXECUTE_PROCESS(
+ macro(WX_CONFIG_SELECT_GET_DEFAULT)
+ execute_process(
COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
${wxWidgets_CONFIG_OPTIONS} --selected-config
OUTPUT_VARIABLE _wx_selected_config
RESULT_VARIABLE _wx_result
ERROR_QUIET
)
- IF(_wx_result EQUAL 0)
- FOREACH(_opt_name debug static unicode universal)
- STRING(TOUPPER ${_opt_name} _upper_opt_name)
- IF(_wx_selected_config MATCHES ".*${_opt_name}.*")
- SET(wxWidgets_DEFAULT_${_upper_opt_name} ON)
- ELSE(_wx_selected_config MATCHES ".*${_opt_name}.*")
- SET(wxWidgets_DEFAULT_${_upper_opt_name} OFF)
- ENDIF(_wx_selected_config MATCHES ".*${_opt_name}.*")
- ENDFOREACH(_opt_name)
- ELSE(_wx_result EQUAL 0)
- FOREACH(_upper_opt_name DEBUG STATIC UNICODE UNIVERSAL)
- SET(wxWidgets_DEFAULT_${_upper_opt_name} OFF)
- ENDFOREACH(_upper_opt_name)
- ENDIF(_wx_result EQUAL 0)
- ENDMACRO(WX_CONFIG_SELECT_GET_DEFAULT)
+ if(_wx_result EQUAL 0)
+ foreach(_opt_name debug static unicode universal)
+ string(TOUPPER ${_opt_name} _upper_opt_name)
+ if(_wx_selected_config MATCHES ".*${_opt_name}.*")
+ set(wxWidgets_DEFAULT_${_upper_opt_name} ON)
+ else()
+ set(wxWidgets_DEFAULT_${_upper_opt_name} OFF)
+ endif()
+ endforeach()
+ else()
+ foreach(_upper_opt_name DEBUG STATIC UNICODE UNIVERSAL)
+ set(wxWidgets_DEFAULT_${_upper_opt_name} OFF)
+ endforeach()
+ endif()
+ endmacro()
#
# Query a boolean configuration option to determine if the system
# has both builds available. If so, provide the selection option
# to the user.
#
- MACRO(WX_CONFIG_SELECT_QUERY_BOOL _OPT_NAME _OPT_HELP)
- EXECUTE_PROCESS(
+ macro(WX_CONFIG_SELECT_QUERY_BOOL _OPT_NAME _OPT_HELP)
+ execute_process(
COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=yes
RESULT_VARIABLE _wx_result_yes
OUTPUT_QUIET
ERROR_QUIET
)
- EXECUTE_PROCESS(
+ execute_process(
COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=no
RESULT_VARIABLE _wx_result_no
OUTPUT_QUIET
ERROR_QUIET
)
- STRING(TOUPPER ${_OPT_NAME} _UPPER_OPT_NAME)
- IF(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
- OPTION(wxWidgets_USE_${_UPPER_OPT_NAME}
+ string(TOUPPER ${_OPT_NAME} _UPPER_OPT_NAME)
+ if(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
+ option(wxWidgets_USE_${_UPPER_OPT_NAME}
${_OPT_HELP} ${wxWidgets_DEFAULT_${_UPPER_OPT_NAME}})
- ELSE(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
+ else()
# If option exists (already in cache), force to available one.
- IF(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME})
- IF(_wx_result_yes EQUAL 0)
- SET(wxWidgets_USE_${_UPPER_OPT_NAME} ON CACHE BOOL ${_OPT_HELP} FORCE)
- ELSE(_wx_result_yes EQUAL 0)
- SET(wxWidgets_USE_${_UPPER_OPT_NAME} OFF CACHE BOOL ${_OPT_HELP} FORCE)
- ENDIF(_wx_result_yes EQUAL 0)
- ENDIF(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME})
- ENDIF(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
- ENDMACRO(WX_CONFIG_SELECT_QUERY_BOOL)
-
- #
+ if(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME})
+ if(_wx_result_yes EQUAL 0)
+ set(wxWidgets_USE_${_UPPER_OPT_NAME} ON CACHE BOOL ${_OPT_HELP} FORCE)
+ else()
+ set(wxWidgets_USE_${_UPPER_OPT_NAME} OFF CACHE BOOL ${_OPT_HELP} FORCE)
+ endif()
+ endif()
+ endif()
+ endmacro()
+
+ #
# Set wxWidgets_SELECT_OPTIONS to wx-config options for selecting
# among multiple builds.
#
- MACRO(WX_CONFIG_SELECT_SET_OPTIONS)
- SET(wxWidgets_SELECT_OPTIONS ${wxWidgets_CONFIG_OPTIONS})
- FOREACH(_opt_name debug static unicode universal)
- STRING(TOUPPER ${_opt_name} _upper_opt_name)
- IF(DEFINED wxWidgets_USE_${_upper_opt_name})
- IF(wxWidgets_USE_${_upper_opt_name})
- LIST(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=yes)
- ELSE(wxWidgets_USE_${_upper_opt_name})
- LIST(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=no)
- ENDIF(wxWidgets_USE_${_upper_opt_name})
- ENDIF(DEFINED wxWidgets_USE_${_upper_opt_name})
- ENDFOREACH(_opt_name)
- ENDMACRO(WX_CONFIG_SELECT_SET_OPTIONS)
+ macro(WX_CONFIG_SELECT_SET_OPTIONS)
+ set(wxWidgets_SELECT_OPTIONS ${wxWidgets_CONFIG_OPTIONS})
+ foreach(_opt_name debug static unicode universal)
+ string(TOUPPER ${_opt_name} _upper_opt_name)
+ if(DEFINED wxWidgets_USE_${_upper_opt_name})
+ if(wxWidgets_USE_${_upper_opt_name})
+ list(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=yes)
+ else()
+ list(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=no)
+ endif()
+ endif()
+ endforeach()
+ endmacro()
#-----------------------------------------------------------------
# UNIX: Start actual work.
#-----------------------------------------------------------------
# Support cross-compiling, only search in the target platform.
- FIND_PROGRAM(wxWidgets_CONFIG_EXECUTABLE wx-config
+ find_program(wxWidgets_CONFIG_EXECUTABLE wx-config
ONLY_CMAKE_FIND_ROOT_PATH
)
- IF(wxWidgets_CONFIG_EXECUTABLE)
- SET(wxWidgets_FOUND TRUE)
+ if(wxWidgets_CONFIG_EXECUTABLE)
+ set(wxWidgets_FOUND TRUE)
# get defaults based on "wx-config --selected-config"
WX_CONFIG_SELECT_GET_DEFAULT()
@@ -723,99 +723,99 @@ ELSE(wxWidgets_FIND_STYLE STREQUAL "win32")
DBG_MSG("wxWidgets_SELECT_OPTIONS=${wxWidgets_SELECT_OPTIONS}")
# run the wx-config program to get cxxflags
- EXECUTE_PROCESS(
+ execute_process(
COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
${wxWidgets_SELECT_OPTIONS} --cxxflags
OUTPUT_VARIABLE wxWidgets_CXX_FLAGS
RESULT_VARIABLE RET
ERROR_QUIET
)
- IF(RET EQUAL 0)
- STRING(STRIP "${wxWidgets_CXX_FLAGS}" wxWidgets_CXX_FLAGS)
- SEPARATE_ARGUMENTS(wxWidgets_CXX_FLAGS)
+ if(RET EQUAL 0)
+ string(STRIP "${wxWidgets_CXX_FLAGS}" wxWidgets_CXX_FLAGS)
+ separate_arguments(wxWidgets_CXX_FLAGS)
DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
# parse definitions from cxxflags;
# drop -D* from CXXFLAGS and the -D prefix
- STRING(REGEX MATCHALL "-D[^;]+"
+ string(REGEX MATCHALL "-D[^;]+"
wxWidgets_DEFINITIONS "${wxWidgets_CXX_FLAGS}")
- STRING(REGEX REPLACE "-D[^;]+(;|$)" ""
+ string(REGEX REPLACE "-D[^;]+(;|$)" ""
wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
- STRING(REGEX REPLACE ";$" ""
+ string(REGEX REPLACE ";$" ""
wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
- STRING(REPLACE "-D" ""
+ string(REPLACE "-D" ""
wxWidgets_DEFINITIONS "${wxWidgets_DEFINITIONS}")
# parse include dirs from cxxflags; drop -I prefix
- STRING(REGEX MATCHALL "-I[^;]+"
+ string(REGEX MATCHALL "-I[^;]+"
wxWidgets_INCLUDE_DIRS "${wxWidgets_CXX_FLAGS}")
- STRING(REGEX REPLACE "-I[^;]+;" ""
+ string(REGEX REPLACE "-I[^;]+;" ""
wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
- STRING(REPLACE "-I" ""
+ string(REPLACE "-I" ""
wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}")
DBG_MSG_V("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}")
DBG_MSG_V("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}")
DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
- ELSE(RET EQUAL 0)
- SET(wxWidgets_FOUND FALSE)
+ else()
+ set(wxWidgets_FOUND FALSE)
DBG_MSG_V(
"${wxWidgets_CONFIG_EXECUTABLE} --cxxflags FAILED with RET=${RET}")
- ENDIF(RET EQUAL 0)
+ endif()
# run the wx-config program to get the libs
# - NOTE: wx-config doesn't verify that the libs requested exist
# it just produces the names. Maybe a TRY_COMPILE would
# be useful here...
- STRING(REPLACE ";" ","
+ string(REPLACE ";" ","
wxWidgets_FIND_COMPONENTS "${wxWidgets_FIND_COMPONENTS}")
- EXECUTE_PROCESS(
+ execute_process(
COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
${wxWidgets_SELECT_OPTIONS} --libs ${wxWidgets_FIND_COMPONENTS}
OUTPUT_VARIABLE wxWidgets_LIBRARIES
RESULT_VARIABLE RET
ERROR_QUIET
)
- IF(RET EQUAL 0)
- STRING(STRIP "${wxWidgets_LIBRARIES}" wxWidgets_LIBRARIES)
- SEPARATE_ARGUMENTS(wxWidgets_LIBRARIES)
- STRING(REPLACE "-framework;" "-framework "
+ if(RET EQUAL 0)
+ string(STRIP "${wxWidgets_LIBRARIES}" wxWidgets_LIBRARIES)
+ separate_arguments(wxWidgets_LIBRARIES)
+ string(REPLACE "-framework;" "-framework "
wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
- STRING(REPLACE "-arch;" "-arch "
+ string(REPLACE "-arch;" "-arch "
wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
- STRING(REPLACE "-isysroot;" "-isysroot "
+ string(REPLACE "-isysroot;" "-isysroot "
wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
# extract linkdirs (-L) for rpath (i.e., LINK_DIRECTORIES)
- STRING(REGEX MATCHALL "-L[^;]+"
+ string(REGEX MATCHALL "-L[^;]+"
wxWidgets_LIBRARY_DIRS "${wxWidgets_LIBRARIES}")
- STRING(REPLACE "-L" ""
+ string(REPLACE "-L" ""
wxWidgets_LIBRARY_DIRS "${wxWidgets_LIBRARY_DIRS}")
DBG_MSG_V("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}")
DBG_MSG_V("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}")
- ELSE(RET EQUAL 0)
- SET(wxWidgets_FOUND FALSE)
+ else()
+ set(wxWidgets_FOUND FALSE)
DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${wxWidgets_FIND_COMPONENTS} FAILED with RET=${RET}")
- ENDIF(RET EQUAL 0)
- ENDIF(wxWidgets_CONFIG_EXECUTABLE)
+ endif()
+ endif()
#=====================================================================
# Neither UNIX_FIND_STYLE, nor WIN32_FIND_STYLE
#=====================================================================
- ELSE(wxWidgets_FIND_STYLE STREQUAL "unix")
- IF(NOT wxWidgets_FIND_QUIETLY)
- MESSAGE(STATUS
+ else()
+ if(NOT wxWidgets_FIND_QUIETLY)
+ message(STATUS
"${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): \n"
" Platform unknown/unsupported. It's neither WIN32 nor UNIX "
"find style."
)
- ENDIF(NOT wxWidgets_FIND_QUIETLY)
- ENDIF(wxWidgets_FIND_STYLE STREQUAL "unix")
-ENDIF(wxWidgets_FIND_STYLE STREQUAL "win32")
+ endif()
+ endif()
+endif()
# Debug output:
DBG_MSG("wxWidgets_FOUND : ${wxWidgets_FOUND}")
@@ -827,10 +827,10 @@ DBG_MSG("wxWidgets_USE_FILE : ${wxWidgets_USE_FILE}")
#=====================================================================
#=====================================================================
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(wxWidgets DEFAULT_MSG wxWidgets_FOUND)
# Maintain consistency with all other variables.
-SET(wxWidgets_FOUND ${WXWIDGETS_FOUND})
+set(wxWidgets_FOUND ${WXWIDGETS_FOUND})
#=====================================================================
# Macros for use in wxWidgets apps.
@@ -841,24 +841,24 @@ SET(wxWidgets_FOUND ${WXWIDGETS_FOUND})
#=====================================================================
# Resource file compiler.
-FIND_PROGRAM(wxWidgets_wxrc_EXECUTABLE wxrc
+find_program(wxWidgets_wxrc_EXECUTABLE wxrc
${wxWidgets_ROOT_DIR}/utils/wxrc/vc_msw
)
-#
+#
# WX_SPLIT_ARGUMENTS_ON(<keyword> <left> <right> <arg1> <arg2> ...)
-#
+#
# Sets <left> and <right> to contain arguments to the left and right,
# respectively, of <keyword>.
-#
+#
# Example usage:
-# FUNCTION(WXWIDGETS_ADD_RESOURCES outfiles)
+# function(WXWIDGETS_ADD_RESOURCES outfiles)
# WX_SPLIT_ARGUMENTS_ON(OPTIONS wxrc_files wxrc_options ${ARGN})
# ...
-# ENDFUNCTION(WXWIDGETS_ADD_RESOURCES)
+# endfunction()
#
# WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o file.C)
-#
+#
# NOTE: This is a generic piece of code that should be renamed to
# SPLIT_ARGUMENTS_ON and put in a file serving the same purpose as
# FindPackageStandardArgs.cmake. At the time of this writing
@@ -866,29 +866,29 @@ FIND_PROGRAM(wxWidgets_wxrc_EXECUTABLE wxrc
# here a bit more generalized. So, there are already two find modules
# using this approach.
#
-FUNCTION(WX_SPLIT_ARGUMENTS_ON _keyword _leftvar _rightvar)
+function(WX_SPLIT_ARGUMENTS_ON _keyword _leftvar _rightvar)
# FIXME: Document that the input variables will be cleared.
- #LIST(APPEND ${_leftvar} "")
- #LIST(APPEND ${_rightvar} "")
- SET(${_leftvar} "")
- SET(${_rightvar} "")
-
- SET(_doing_right FALSE)
- FOREACH(element ${ARGN})
- IF("${element}" STREQUAL "${_keyword}")
- SET(_doing_right TRUE)
- ELSE("${element}" STREQUAL "${_keyword}")
- IF(_doing_right)
- LIST(APPEND ${_rightvar} "${element}")
- ELSE(_doing_right)
- LIST(APPEND ${_leftvar} "${element}")
- ENDIF(_doing_right)
- ENDIF("${element}" STREQUAL "${_keyword}")
- ENDFOREACH(element)
-
- SET(${_leftvar} ${${_leftvar}} PARENT_SCOPE)
- SET(${_rightvar} ${${_rightvar}} PARENT_SCOPE)
-ENDFUNCTION(WX_SPLIT_ARGUMENTS_ON)
+ #list(APPEND ${_leftvar} "")
+ #list(APPEND ${_rightvar} "")
+ set(${_leftvar} "")
+ set(${_rightvar} "")
+
+ set(_doing_right FALSE)
+ foreach(element ${ARGN})
+ if("${element}" STREQUAL "${_keyword}")
+ set(_doing_right TRUE)
+ else()
+ if(_doing_right)
+ list(APPEND ${_rightvar} "${element}")
+ else()
+ list(APPEND ${_leftvar} "${element}")
+ endif()
+ endif()
+ endforeach()
+
+ set(${_leftvar} ${${_leftvar}} PARENT_SCOPE)
+ set(${_rightvar} ${${_rightvar}} PARENT_SCOPE)
+endfunction()
#
# WX_GET_DEPENDENCIES_FROM_XML(
@@ -901,7 +901,7 @@ ENDFUNCTION(WX_SPLIT_ARGUMENTS_ON)
#
# FIXME: Add documentation here...
#
-FUNCTION(WX_GET_DEPENDENCIES_FROM_XML
+function(WX_GET_DEPENDENCIES_FROM_XML
_depends
_match_patt
_clean_patt
@@ -909,52 +909,52 @@ FUNCTION(WX_GET_DEPENDENCIES_FROM_XML
_depends_path
)
- STRING(REGEX MATCHALL
+ string(REGEX MATCHALL
${_match_patt}
dep_file_list
"${${_xml_contents}}"
)
- FOREACH(dep_file ${dep_file_list})
- STRING(REGEX REPLACE ${_clean_patt} "" dep_file "${dep_file}")
+ foreach(dep_file ${dep_file_list})
+ string(REGEX REPLACE ${_clean_patt} "" dep_file "${dep_file}")
# make the file have an absolute path
- IF(NOT IS_ABSOLUTE "${dep_file}")
- SET(dep_file "${${_depends_path}}/${dep_file}")
- ENDIF(NOT IS_ABSOLUTE "${dep_file}")
+ if(NOT IS_ABSOLUTE "${dep_file}")
+ set(dep_file "${${_depends_path}}/${dep_file}")
+ endif()
# append file to dependency list
- LIST(APPEND ${_depends} "${dep_file}")
- ENDFOREACH(dep_file)
+ list(APPEND ${_depends} "${dep_file}")
+ endforeach()
- SET(${_depends} ${${_depends}} PARENT_SCOPE)
-ENDFUNCTION(WX_GET_DEPENDENCIES_FROM_XML)
+ set(${_depends} ${${_depends}} PARENT_SCOPE)
+endfunction()
-#
+#
# WXWIDGETS_ADD_RESOURCES(<sources> <xrc_files>
# OPTIONS <options> [NO_CPP_CODE])
-#
+#
# Adds a custom command for resource file compilation of the
# <xrc_files> and appends the output files to <sources>.
-#
+#
# Example usages:
# WXWIDGETS_ADD_RESOURCES(sources xrc/main_frame.xrc)
# WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o altname.cxx)
#
-FUNCTION(WXWIDGETS_ADD_RESOURCES _outfiles)
+function(WXWIDGETS_ADD_RESOURCES _outfiles)
WX_SPLIT_ARGUMENTS_ON(OPTIONS rc_file_list rc_options ${ARGN})
# Parse files for dependencies.
- SET(rc_file_list_abs "")
- SET(rc_depends "")
- FOREACH(rc_file ${rc_file_list})
- GET_FILENAME_COMPONENT(depends_path ${rc_file} PATH)
+ set(rc_file_list_abs "")
+ set(rc_depends "")
+ foreach(rc_file ${rc_file_list})
+ get_filename_component(depends_path ${rc_file} PATH)
- GET_FILENAME_COMPONENT(rc_file_abs ${rc_file} ABSOLUTE)
- LIST(APPEND rc_file_list_abs "${rc_file_abs}")
+ get_filename_component(rc_file_abs ${rc_file} ABSOLUTE)
+ list(APPEND rc_file_list_abs "${rc_file_abs}")
# All files have absolute paths or paths relative to the location
# of the rc file.
- FILE(READ "${rc_file_abs}" rc_file_contents)
+ file(READ "${rc_file_abs}" rc_file_contents)
# get bitmap/bitmap2 files
WX_GET_DEPENDENCIES_FROM_XML(
@@ -982,63 +982,63 @@ FUNCTION(WXWIDGETS_ADD_RESOURCES _outfiles)
rc_file_contents
depends_path
)
- ENDFOREACH(rc_file)
+ endforeach()
#
# Parse options.
- #
+ #
# If NO_CPP_CODE option specified, then produce .xrs file rather
# than a .cpp file (i.e., don't add the default --cpp-code option).
- LIST(FIND rc_options NO_CPP_CODE index)
- IF(index EQUAL -1)
- LIST(APPEND rc_options --cpp-code)
+ list(FIND rc_options NO_CPP_CODE index)
+ if(index EQUAL -1)
+ list(APPEND rc_options --cpp-code)
# wxrc's default output filename for cpp code.
- SET(outfile resource.cpp)
- ELSE(index EQUAL -1)
- LIST(REMOVE_AT rc_options ${index})
+ set(outfile resource.cpp)
+ else()
+ list(REMOVE_AT rc_options ${index})
# wxrc's default output filename for xrs file.
- SET(outfile resource.xrs)
- ENDIF(index EQUAL -1)
+ set(outfile resource.xrs)
+ endif()
# Get output name for use in ADD_CUSTOM_COMMAND.
# - short option scanning
- LIST(FIND rc_options -o index)
- IF(NOT index EQUAL -1)
- MATH(EXPR filename_index "${index} + 1")
- LIST(GET rc_options ${filename_index} outfile)
- #LIST(REMOVE_AT rc_options ${index} ${filename_index})
- ENDIF(NOT index EQUAL -1)
+ list(FIND rc_options -o index)
+ if(NOT index EQUAL -1)
+ math(EXPR filename_index "${index} + 1")
+ list(GET rc_options ${filename_index} outfile)
+ #list(REMOVE_AT rc_options ${index} ${filename_index})
+ endif()
# - long option scanning
- STRING(REGEX MATCH "--output=[^;]*" outfile_opt "${rc_options}")
- IF(outfile_opt)
- STRING(REPLACE "--output=" "" outfile "${outfile_opt}")
- ENDIF(outfile_opt)
- #STRING(REGEX REPLACE "--output=[^;]*;?" "" rc_options "${rc_options}")
- #STRING(REGEX REPLACE ";$" "" rc_options "${rc_options}")
-
- IF(NOT IS_ABSOLUTE "${outfile}")
- SET(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
- ENDIF(NOT IS_ABSOLUTE "${outfile}")
- ADD_CUSTOM_COMMAND(
+ string(REGEX MATCH "--output=[^;]*" outfile_opt "${rc_options}")
+ if(outfile_opt)
+ string(REPLACE "--output=" "" outfile "${outfile_opt}")
+ endif()
+ #string(REGEX REPLACE "--output=[^;]*;?" "" rc_options "${rc_options}")
+ #string(REGEX REPLACE ";$" "" rc_options "${rc_options}")
+
+ if(NOT IS_ABSOLUTE "${outfile}")
+ set(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
+ endif()
+ add_custom_command(
OUTPUT "${outfile}"
COMMAND ${wxWidgets_wxrc_EXECUTABLE} ${rc_options} ${rc_file_list_abs}
DEPENDS ${rc_file_list_abs} ${rc_depends}
)
# Add generated header to output file list.
- LIST(FIND rc_options -e short_index)
- LIST(FIND rc_options --extra-cpp-code long_index)
- IF(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1)
- GET_FILENAME_COMPONENT(outfile_ext ${outfile} EXT)
- STRING(REPLACE "${outfile_ext}" ".h" outfile_header "${outfile}")
- LIST(APPEND ${_outfiles} "${outfile_header}")
- SET_SOURCE_FILES_PROPERTIES(
+ list(FIND rc_options -e short_index)
+ list(FIND rc_options --extra-cpp-code long_index)
+ if(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1)
+ get_filename_component(outfile_ext ${outfile} EXT)
+ string(REPLACE "${outfile_ext}" ".h" outfile_header "${outfile}")
+ list(APPEND ${_outfiles} "${outfile_header}")
+ set_source_files_properties(
"${outfile_header}" PROPERTIES GENERATED TRUE
)
- ENDIF(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1)
+ endif()
# Add generated file to output file list.
- LIST(APPEND ${_outfiles} "${outfile}")
+ list(APPEND ${_outfiles} "${outfile}")
- SET(${_outfiles} ${${_outfiles}} PARENT_SCOPE)
-ENDFUNCTION(WXWIDGETS_ADD_RESOURCES)
+ set(${_outfiles} ${${_outfiles}} PARENT_SCOPE)
+endfunction()
diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake
index dfb28ff90..5030bcc9b 100644
--- a/Modules/FindwxWindows.cmake
+++ b/Modules/FindwxWindows.cmake
@@ -20,17 +20,17 @@
#
# OPTIONS
# If you need OpenGL support please
-# SET(WXWINDOWS_USE_GL 1)
+# set(WXWINDOWS_USE_GL 1)
# in your CMakeLists.txt *before* you include this file.
#
# HAVE_ISYSTEM - true required to replace -I by -isystem on g++
#
# For convenience include Use_wxWindows.cmake in your project's
-# CMakeLists.txt using INCLUDE(Use_wxWindows).
+# CMakeLists.txt using include(Use_wxWindows).
#
# USAGE
-# SET(WXWINDOWS_USE_GL 1)
-# FIND_PACKAGE(wxWindows)
+# set(WXWINDOWS_USE_GL 1)
+# find_package(wxWindows)
#
# NOTES
# wxWidgets 2.6.x is supported for monolithic builds
@@ -83,19 +83,19 @@
#
-IF(WIN32)
- SET(WIN32_STYLE_FIND 1)
-ENDIF(WIN32)
-IF(MINGW)
- SET(WIN32_STYLE_FIND 0)
- SET(UNIX_STYLE_FIND 1)
-ENDIF(MINGW)
-IF(UNIX)
- SET(UNIX_STYLE_FIND 1)
-ENDIF(UNIX)
+if(WIN32)
+ set(WIN32_STYLE_FIND 1)
+endif()
+if(MINGW)
+ set(WIN32_STYLE_FIND 0)
+ set(UNIX_STYLE_FIND 1)
+endif()
+if(UNIX)
+ set(UNIX_STYLE_FIND 1)
+endif()
-IF(WIN32_STYLE_FIND)
+if(WIN32_STYLE_FIND)
## ######################################################################
##
@@ -106,69 +106,68 @@ IF(WIN32_STYLE_FIND)
## fix the root dir to avoid mixing of headers/libs from different
## versions/builds:
- SET (WXWINDOWS_POSSIBLE_ROOT_PATHS
- $ENV{WXWIN}
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]" ## WX 2.6.x
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWindows_is1;Inno Setup: App Path]" ## WX 2.4.x
- C:\\wxWidgets-2.6.2
- D:\\wxWidgets-2.6.2
- C:\\wxWidgets-2.6.1
- D:\\wxWidgets-2.6.1
- C:\\wxWindows-2.4.2
- D:\\wxWindows-2.4.2
- )
-
## WX supports monolithic and multiple smaller libs (since 2.5.x), we prefer monolithic for now.
## monolithic = WX is built as a single big library
## e.g. compile on WIN32 as "nmake -f makefile.vc MONOLITHIC=1 BUILD=debug SHARED=0 USE_OPENGL=1" (JW)
- OPTION(WXWINDOWS_USE_MONOLITHIC "Use monolithic build of WX??" ON)
- MARK_AS_ADVANCED(WXWINDOWS_USE_MONOLITHIC)
+ option(WXWINDOWS_USE_MONOLITHIC "Use monolithic build of WX??" ON)
+ mark_as_advanced(WXWINDOWS_USE_MONOLITHIC)
## GL libs used?
- OPTION(WXWINDOWS_USE_GL "Use Wx with GL support(glcanvas)?" ON)
- MARK_AS_ADVANCED(WXWINDOWS_USE_GL)
+ option(WXWINDOWS_USE_GL "Use Wx with GL support(glcanvas)?" ON)
+ mark_as_advanced(WXWINDOWS_USE_GL)
## avoid mixing of headers and libs between multiple installed WX versions,
## select just one tree here:
- FIND_PATH(WXWINDOWS_ROOT_DIR include/wx/wx.h
- ${WXWINDOWS_POSSIBLE_ROOT_PATHS} )
- # MESSAGE("DBG found WXWINDOWS_ROOT_DIR: ${WXWINDOWS_ROOT_DIR}")
+ find_path(WXWINDOWS_ROOT_DIR include/wx/wx.h
+ HINTS
+ ENV WXWIN
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]" ## WX 2.6.x
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWindows_is1;Inno Setup: App Path]" ## WX 2.4.x
+ PATHS
+ C:/wxWidgets-2.6.2
+ D:/wxWidgets-2.6.2
+ C:/wxWidgets-2.6.1
+ D:/wxWidgets-2.6.1
+ C:/wxWindows-2.4.2
+ D:/wxWindows-2.4.2
+ )
+ # message("DBG found WXWINDOWS_ROOT_DIR: ${WXWINDOWS_ROOT_DIR}")
## find libs for combination of static/shared with release/debug
## be careful if you add something here,
## avoid mixing of headers and libs of different wx versions,
## there may be multiple WX versions installed.
- SET (WXWINDOWS_POSSIBLE_LIB_PATHS
+ set (WXWINDOWS_POSSIBLE_LIB_PATHS
"${WXWINDOWS_ROOT_DIR}/lib"
)
## monolithic?
- IF (WXWINDOWS_USE_MONOLITHIC)
+ if (WXWINDOWS_USE_MONOLITHIC)
- FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY
+ find_library(WXWINDOWS_STATIC_LIBRARY
NAMES wx wxmsw wxmsw26
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
${WXWINDOWS_POSSIBLE_LIB_PATHS}
DOC "wxWindows static release build library" )
- FIND_LIBRARY(WXWINDOWS_STATIC_DEBUG_LIBRARY
+ find_library(WXWINDOWS_STATIC_DEBUG_LIBRARY
NAMES wxd wxmswd wxmsw26d
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
${WXWINDOWS_POSSIBLE_LIB_PATHS}
DOC "wxWindows static debug build library" )
- FIND_LIBRARY(WXWINDOWS_SHARED_LIBRARY
+ find_library(WXWINDOWS_SHARED_LIBRARY
NAMES wxmsw26 wxmsw262 wxmsw24 wxmsw242 wxmsw241 wxmsw240 wx23_2 wx22_9
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_dll"
${WXWINDOWS_POSSIBLE_LIB_PATHS}
DOC "wxWindows shared release build library" )
- FIND_LIBRARY(WXWINDOWS_SHARED_DEBUG_LIBRARY
+ find_library(WXWINDOWS_SHARED_DEBUG_LIBRARY
NAMES wxmsw26d wxmsw262d wxmsw24d wxmsw241d wxmsw240d wx23_2d wx22_9d
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_dll"
@@ -180,14 +179,14 @@ IF(WIN32_STYLE_FIND)
## required for WXWINDOWS_USE_GL
## gl lib is always build separate:
##
- FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY_GL
+ find_library(WXWINDOWS_STATIC_LIBRARY_GL
NAMES wx_gl wxmsw_gl wxmsw26_gl
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
${WXWINDOWS_POSSIBLE_LIB_PATHS}
DOC "wxWindows static release build GL library" )
- FIND_LIBRARY(WXWINDOWS_STATIC_DEBUG_LIBRARY_GL
+ find_library(WXWINDOWS_STATIC_DEBUG_LIBRARY_GL
NAMES wxd_gl wxmswd_gl wxmsw26d_gl
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
@@ -195,70 +194,70 @@ IF(WIN32_STYLE_FIND)
DOC "wxWindows static debug build GL library" )
- FIND_LIBRARY(WXWINDOWS_STATIC_DEBUG_LIBRARY_PNG
+ find_library(WXWINDOWS_STATIC_DEBUG_LIBRARY_PNG
NAMES wxpngd
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
${WXWINDOWS_POSSIBLE_LIB_PATHS}
DOC "wxWindows static debug png library" )
- FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY_PNG
+ find_library(WXWINDOWS_STATIC_LIBRARY_PNG
NAMES wxpng
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
${WXWINDOWS_POSSIBLE_LIB_PATHS}
DOC "wxWindows static png library" )
- FIND_LIBRARY(WXWINDOWS_STATIC_DEBUG_LIBRARY_TIFF
+ find_library(WXWINDOWS_STATIC_DEBUG_LIBRARY_TIFF
NAMES wxtiffd
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
${WXWINDOWS_POSSIBLE_LIB_PATHS}
DOC "wxWindows static debug tiff library" )
- FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY_TIFF
+ find_library(WXWINDOWS_STATIC_LIBRARY_TIFF
NAMES wxtiff
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
${WXWINDOWS_POSSIBLE_LIB_PATHS}
DOC "wxWindows static tiff library" )
- FIND_LIBRARY(WXWINDOWS_STATIC_DEBUG_LIBRARY_JPEG
+ find_library(WXWINDOWS_STATIC_DEBUG_LIBRARY_JPEG
NAMES wxjpegd wxjpgd
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
${WXWINDOWS_POSSIBLE_LIB_PATHS}
DOC "wxWindows static debug jpeg library" )
- FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY_JPEG
+ find_library(WXWINDOWS_STATIC_LIBRARY_JPEG
NAMES wxjpeg wxjpg
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
${WXWINDOWS_POSSIBLE_LIB_PATHS}
DOC "wxWindows static jpeg library" )
- FIND_LIBRARY(WXWINDOWS_STATIC_DEBUG_LIBRARY_ZLIB
+ find_library(WXWINDOWS_STATIC_DEBUG_LIBRARY_ZLIB
NAMES wxzlibd
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
${WXWINDOWS_POSSIBLE_LIB_PATHS}
DOC "wxWindows static debug zlib library" )
- FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY_ZLIB
+ find_library(WXWINDOWS_STATIC_LIBRARY_ZLIB
NAMES wxzlib
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
${WXWINDOWS_POSSIBLE_LIB_PATHS}
DOC "wxWindows static zib library" )
- FIND_LIBRARY(WXWINDOWS_STATIC_DEBUG_LIBRARY_REGEX
+ find_library(WXWINDOWS_STATIC_DEBUG_LIBRARY_REGEX
NAMES wxregexd
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
${WXWINDOWS_POSSIBLE_LIB_PATHS}
DOC "wxWindows static debug regex library" )
- FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY_REGEX
+ find_library(WXWINDOWS_STATIC_LIBRARY_REGEX
NAMES wxregex
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
@@ -268,14 +267,14 @@ IF(WIN32_STYLE_FIND)
## untested:
- FIND_LIBRARY(WXWINDOWS_SHARED_LIBRARY_GL
+ find_library(WXWINDOWS_SHARED_LIBRARY_GL
NAMES wx_gl wxmsw_gl wxmsw26_gl
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_dll"
${WXWINDOWS_POSSIBLE_LIB_PATHS}
DOC "wxWindows shared release build GL library" )
- FIND_LIBRARY(WXWINDOWS_SHARED_DEBUG_LIBRARY_GL
+ find_library(WXWINDOWS_SHARED_DEBUG_LIBRARY_GL
NAMES wxd_gl wxmswd_gl wxmsw26d_gl
PATHS
"${WXWINDOWS_ROOT_DIR}/lib/vc_dll"
@@ -283,11 +282,11 @@ IF(WIN32_STYLE_FIND)
DOC "wxWindows shared debug build GL library" )
- ELSE (WXWINDOWS_USE_MONOLITHIC)
+ else ()
## WX is built as multiple small pieces libraries instead of monolithic
## DEPECATED (jw) replaced by more general WXWINDOWS_USE_MONOLITHIC ON/OFF
- # OPTION(WXWINDOWS_SEPARATE_LIBS_BUILD "Is wxWindows build with separate libs?" OFF)
+ # option(WXWINDOWS_SEPARATE_LIBS_BUILD "Is wxWindows build with separate libs?" OFF)
## HACK: This is very dirty.
## because the libs of a particular version are explicitly listed
@@ -297,9 +296,9 @@ IF(WIN32_STYLE_FIND)
## --> about 288 combinations
## thus we need a different approach so solve this correctly ...
- MESSAGE(STATUS "Warning: You are trying to use wxWidgets without monolithic build (WXWINDOWS_SEPARATE_LIBS_BUILD). This is a HACK, libraries are not verified! (JW).")
+ message(STATUS "Warning: You are trying to use wxWidgets without monolithic build (WXWINDOWS_SEPARATE_LIBS_BUILD). This is a HACK, libraries are not verified! (JW).")
- SET(WXWINDOWS_STATIC_LIBS ${WXWINDOWS_STATIC_LIBS}
+ set(WXWINDOWS_STATIC_LIBS ${WXWINDOWS_STATIC_LIBS}
wxbase26
wxbase26_net
wxbase26_odbc
@@ -323,7 +322,7 @@ IF(WIN32_STYLE_FIND)
wsock32
)
## HACK: feed in to optimized / debug libaries if both were FOUND.
- SET(WXWINDOWS_STATIC_DEBUG_LIBS ${WXWINDOWS_STATIC_DEBUG_LIBS}
+ set(WXWINDOWS_STATIC_DEBUG_LIBS ${WXWINDOWS_STATIC_DEBUG_LIBS}
wxbase26d
wxbase26d_net
wxbase26d_odbc
@@ -346,7 +345,7 @@ IF(WIN32_STYLE_FIND)
rpcrt4
wsock32
)
- ENDIF (WXWINDOWS_USE_MONOLITHIC)
+ endif ()
##
@@ -356,22 +355,22 @@ IF(WIN32_STYLE_FIND)
## if there is at least one shared lib available
## let user choose wether to use shared or static wxwindows libs
- IF(WXWINDOWS_SHARED_LIBRARY OR WXWINDOWS_SHARED_DEBUG_LIBRARY)
+ if(WXWINDOWS_SHARED_LIBRARY OR WXWINDOWS_SHARED_DEBUG_LIBRARY)
## default value OFF because wxWindows MSVS default build is static
- OPTION(WXWINDOWS_USE_SHARED_LIBS
+ option(WXWINDOWS_USE_SHARED_LIBS
"Use shared versions (dll) of wxWindows libraries?" OFF)
- MARK_AS_ADVANCED(WXWINDOWS_USE_SHARED_LIBS)
- ENDIF(WXWINDOWS_SHARED_LIBRARY OR WXWINDOWS_SHARED_DEBUG_LIBRARY)
+ mark_as_advanced(WXWINDOWS_USE_SHARED_LIBS)
+ endif()
## add system libraries wxwindows always seems to depend on
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
comctl32
rpcrt4
wsock32
)
- IF (NOT WXWINDOWS_USE_SHARED_LIBS)
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ if (NOT WXWINDOWS_USE_SHARED_LIBS)
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
## these ones dont seem required, in particular ctl3d32 is not neccesary (Jan Woetzel 07/2003)
# ctl3d32
debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY_ZLIB} optimized ${WXWINDOWS_STATIC_LIBRARY_ZLIB}
@@ -380,15 +379,15 @@ IF(WIN32_STYLE_FIND)
debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY_JPEG} optimized ${WXWINDOWS_STATIC_LIBRARY_JPEG}
debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY_TIFF} optimized ${WXWINDOWS_STATIC_LIBRARY_TIFF}
)
- ENDIF (NOT WXWINDOWS_USE_SHARED_LIBS)
+ endif ()
## opengl/glu: TODO/FIXME: better use FindOpenGL.cmake here
## assume release versions of glu an dopengl, here.
- IF (WXWINDOWS_USE_GL)
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ if (WXWINDOWS_USE_GL)
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
opengl32
glu32 )
- ENDIF (WXWINDOWS_USE_GL)
+ endif ()
##
## select between use of shared or static wxWindows lib then set libs to use
@@ -399,162 +398,162 @@ IF(WIN32_STYLE_FIND)
## then add the build specific include dir for wx/setup.h
##
- IF(WXWINDOWS_USE_SHARED_LIBS)
- ##MESSAGE("DBG wxWindows use shared lib selected.")
+ if(WXWINDOWS_USE_SHARED_LIBS)
+ ##message("DBG wxWindows use shared lib selected.")
## assume that both builds use the same setup(.h) for simplicity
## shared: both wx (debug and release) found?
## assume that both builds use the same setup(.h) for simplicity
- IF(WXWINDOWS_SHARED_DEBUG_LIBRARY AND WXWINDOWS_SHARED_LIBRARY)
- ##MESSAGE("DBG wx shared: debug and optimized found.")
- FIND_PATH(WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
+ if(WXWINDOWS_SHARED_DEBUG_LIBRARY AND WXWINDOWS_SHARED_LIBRARY)
+ ##message("DBG wx shared: debug and optimized found.")
+ find_path(WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
${WXWINDOWS_ROOT_DIR}/lib/mswdlld
${WXWINDOWS_ROOT_DIR}/lib/mswdll
${WXWINDOWS_ROOT_DIR}/lib/vc_dll/mswd
${WXWINDOWS_ROOT_DIR}/lib/vc_dll/msw )
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
debug ${WXWINDOWS_SHARED_DEBUG_LIBRARY}
optimized ${WXWINDOWS_SHARED_LIBRARY} )
- IF (WXWINDOWS_USE_GL)
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ if (WXWINDOWS_USE_GL)
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
debug ${WXWINDOWS_SHARED_DEBUG_LIBRARY_GL}
optimized ${WXWINDOWS_SHARED_LIBRARY_GL} )
- ENDIF (WXWINDOWS_USE_GL)
- ENDIF(WXWINDOWS_SHARED_DEBUG_LIBRARY AND WXWINDOWS_SHARED_LIBRARY)
+ endif ()
+ endif()
## shared: only debug wx lib found?
- IF(WXWINDOWS_SHARED_DEBUG_LIBRARY)
- IF(NOT WXWINDOWS_SHARED_LIBRARY)
- ##MESSAGE("DBG wx shared: debug (but no optimized) found.")
- FIND_PATH(WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
+ if(WXWINDOWS_SHARED_DEBUG_LIBRARY)
+ if(NOT WXWINDOWS_SHARED_LIBRARY)
+ ##message("DBG wx shared: debug (but no optimized) found.")
+ find_path(WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
${WXWINDOWS_ROOT_DIR}/lib/mswdlld
${WXWINDOWS_ROOT_DIR}/lib/vc_dll/mswd )
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
${WXWINDOWS_SHARED_DEBUG_LIBRARY} )
- IF (WXWINDOWS_USE_GL)
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ if (WXWINDOWS_USE_GL)
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
${WXWINDOWS_SHARED_DEBUG_LIBRARY_GL} )
- ENDIF (WXWINDOWS_USE_GL)
- ENDIF(NOT WXWINDOWS_SHARED_LIBRARY)
- ENDIF(WXWINDOWS_SHARED_DEBUG_LIBRARY)
+ endif ()
+ endif()
+ endif()
## shared: only release wx lib found?
- IF(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
- IF(WXWINDOWS_SHARED_LIBRARY)
- ##MESSAGE("DBG wx shared: optimized (but no debug) found.")
- FIND_PATH(WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
+ if(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
+ if(WXWINDOWS_SHARED_LIBRARY)
+ ##message("DBG wx shared: optimized (but no debug) found.")
+ find_path(WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
${WXWINDOWS_ROOT_DIR}/lib/mswdll
${WXWINDOWS_ROOT_DIR}/lib/vc_dll/msw )
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
${WXWINDOWS_SHARED_DEBUG_LIBRARY} )
- IF (WXWINDOWS_USE_GL)
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ if (WXWINDOWS_USE_GL)
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
${WXWINDOWS_SHARED_DEBUG_LIBRARY_GL} )
- ENDIF (WXWINDOWS_USE_GL)
- ENDIF(WXWINDOWS_SHARED_LIBRARY)
- ENDIF(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
+ endif ()
+ endif()
+ endif()
## shared: none found?
- IF(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
- IF(NOT WXWINDOWS_SHARED_LIBRARY)
- MESSAGE(STATUS
+ if(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
+ if(NOT WXWINDOWS_SHARED_LIBRARY)
+ message(STATUS
"No shared wxWindows lib found, but WXWINDOWS_USE_SHARED_LIBS=${WXWINDOWS_USE_SHARED_LIBS}.")
- ENDIF(NOT WXWINDOWS_SHARED_LIBRARY)
- ENDIF(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
+ endif()
+ endif()
#########################################################################################
- ELSE(WXWINDOWS_USE_SHARED_LIBS)
+ else()
- ##jw: DEPRECATED IF(NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
+ ##jw: DEPRECATED if(NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
## static: both wx (debug and release) found?
## assume that both builds use the same setup(.h) for simplicity
- IF(WXWINDOWS_STATIC_DEBUG_LIBRARY AND WXWINDOWS_STATIC_LIBRARY)
- ##MESSAGE("DBG wx static: debug and optimized found.")
- FIND_PATH(WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
+ if(WXWINDOWS_STATIC_DEBUG_LIBRARY AND WXWINDOWS_STATIC_LIBRARY)
+ ##message("DBG wx static: debug and optimized found.")
+ find_path(WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
${WXWINDOWS_ROOT_DIR}/lib/mswd
${WXWINDOWS_ROOT_DIR}/lib/msw
${WXWINDOWS_ROOT_DIR}/lib/vc_lib/mswd
${WXWINDOWS_ROOT_DIR}/lib/vc_lib/msw )
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY}
optimized ${WXWINDOWS_STATIC_LIBRARY} )
- IF (WXWINDOWS_USE_GL)
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ if (WXWINDOWS_USE_GL)
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY_GL}
optimized ${WXWINDOWS_STATIC_LIBRARY_GL} )
- ENDIF (WXWINDOWS_USE_GL)
- ENDIF(WXWINDOWS_STATIC_DEBUG_LIBRARY AND WXWINDOWS_STATIC_LIBRARY)
+ endif ()
+ endif()
## static: only debug wx lib found?
- IF(WXWINDOWS_STATIC_DEBUG_LIBRARY)
- IF(NOT WXWINDOWS_STATIC_LIBRARY)
- ##MESSAGE("DBG wx static: debug (but no optimized) found.")
- FIND_PATH(WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
+ if(WXWINDOWS_STATIC_DEBUG_LIBRARY)
+ if(NOT WXWINDOWS_STATIC_LIBRARY)
+ ##message("DBG wx static: debug (but no optimized) found.")
+ find_path(WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
${WXWINDOWS_ROOT_DIR}/lib/mswd
${WXWINDOWS_ROOT_DIR}/lib/vc_lib/mswd )
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
${WXWINDOWS_STATIC_DEBUG_LIBRARY} )
- IF (WXWINDOWS_USE_GL)
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ if (WXWINDOWS_USE_GL)
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
${WXWINDOWS_STATIC_DEBUG_LIBRARY_GL} )
- ENDIF (WXWINDOWS_USE_GL)
- ENDIF(NOT WXWINDOWS_STATIC_LIBRARY)
- ENDIF(WXWINDOWS_STATIC_DEBUG_LIBRARY)
+ endif ()
+ endif()
+ endif()
## static: only release wx lib found?
- IF(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY)
- IF(WXWINDOWS_STATIC_LIBRARY)
- ##MESSAGE("DBG wx static: optimized (but no debug) found.")
- FIND_PATH(WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
+ if(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY)
+ if(WXWINDOWS_STATIC_LIBRARY)
+ ##message("DBG wx static: optimized (but no debug) found.")
+ find_path(WXWINDOWS_INCLUDE_DIR_SETUPH wx/setup.h
${WXWINDOWS_ROOT_DIR}/lib/msw
${WXWINDOWS_ROOT_DIR}/lib/vc_lib/msw )
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
${WXWINDOWS_STATIC_LIBRARY} )
- IF (WXWINDOWS_USE_GL)
- SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+ if (WXWINDOWS_USE_GL)
+ set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
${WXWINDOWS_STATIC_LIBRARY_GL} )
- ENDIF (WXWINDOWS_USE_GL)
- ENDIF(WXWINDOWS_STATIC_LIBRARY)
- ENDIF(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY)
+ endif ()
+ endif()
+ endif()
## static: none found?
- IF(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY AND NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
- IF(NOT WXWINDOWS_STATIC_LIBRARY)
- MESSAGE(STATUS
+ if(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY AND NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
+ if(NOT WXWINDOWS_STATIC_LIBRARY)
+ message(STATUS
"No static wxWindows lib found, but WXWINDOWS_USE_SHARED_LIBS=${WXWINDOWS_USE_SHARED_LIBS}.")
- ENDIF(NOT WXWINDOWS_STATIC_LIBRARY)
- ENDIF(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY AND NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
- ENDIF(WXWINDOWS_USE_SHARED_LIBS)
+ endif()
+ endif()
+ endif()
## not neccessary in wxWindows 2.4.1 and 2.6.2
## but it may fix a previous bug, see
## http://lists.wxwindows.org/cgi-bin/ezmlm-cgi?8:mss:37574:200305:mpdioeneabobmgjenoap
- OPTION(WXWINDOWS_SET_DEFINITIONS "Set additional defines for wxWindows" OFF)
- MARK_AS_ADVANCED(WXWINDOWS_SET_DEFINITIONS)
- IF (WXWINDOWS_SET_DEFINITIONS)
- SET(WXWINDOWS_DEFINITIONS "-DWINVER=0x400")
- ELSE (WXWINDOWS_SET_DEFINITIONS)
+ option(WXWINDOWS_SET_DEFINITIONS "Set additional defines for wxWindows" OFF)
+ mark_as_advanced(WXWINDOWS_SET_DEFINITIONS)
+ if (WXWINDOWS_SET_DEFINITIONS)
+ set(WXWINDOWS_DEFINITIONS "-DWINVER=0x400")
+ else ()
# clear:
- SET(WXWINDOWS_DEFINITIONS "")
- ENDIF (WXWINDOWS_SET_DEFINITIONS)
+ set(WXWINDOWS_DEFINITIONS "")
+ endif ()
## Find the include directories for wxwindows
## the first, build specific for wx/setup.h was determined before.
## add inc dir for general for "wx/wx.h"
- FIND_PATH(WXWINDOWS_INCLUDE_DIR wx/wx.h
+ find_path(WXWINDOWS_INCLUDE_DIR wx/wx.h
"${WXWINDOWS_ROOT_DIR}/include" )
## append the build specific include dir for wx/setup.h:
- IF (WXWINDOWS_INCLUDE_DIR_SETUPH)
- SET(WXWINDOWS_INCLUDE_DIR ${WXWINDOWS_INCLUDE_DIR} ${WXWINDOWS_INCLUDE_DIR_SETUPH} )
- ENDIF (WXWINDOWS_INCLUDE_DIR_SETUPH)
+ if (WXWINDOWS_INCLUDE_DIR_SETUPH)
+ set(WXWINDOWS_INCLUDE_DIR ${WXWINDOWS_INCLUDE_DIR} ${WXWINDOWS_INCLUDE_DIR_SETUPH} )
+ endif ()
- MARK_AS_ADVANCED(
+ mark_as_advanced(
WXWINDOWS_ROOT_DIR
WXWINDOWS_INCLUDE_DIR
WXWINDOWS_INCLUDE_DIR_SETUPH
@@ -579,9 +578,9 @@ IF(WIN32_STYLE_FIND)
)
-ELSE(WIN32_STYLE_FIND)
+else()
- IF (UNIX_STYLE_FIND)
+ if (UNIX_STYLE_FIND)
## ######################################################################
##
## UNIX/Linux specific:
@@ -590,85 +589,87 @@ ELSE(WIN32_STYLE_FIND)
## 06/2003 Jan Woetzel
##
- OPTION(WXWINDOWS_USE_SHARED_LIBS "Use shared versions (.so) of wxWindows libraries" ON)
- MARK_AS_ADVANCED(WXWINDOWS_USE_SHARED_LIBS)
+ option(WXWINDOWS_USE_SHARED_LIBS "Use shared versions (.so) of wxWindows libraries" ON)
+ mark_as_advanced(WXWINDOWS_USE_SHARED_LIBS)
# JW removed option and force the develper th SET it.
- # OPTION(WXWINDOWS_USE_GL "use wxWindows with GL support (use additional
+ # option(WXWINDOWS_USE_GL "use wxWindows with GL support (use additional
# --gl-libs for wx-config)?" OFF)
# wx-config should be in your path anyhow, usually no need to set WXWIN or
# search in ../wx or ../../wx
- FIND_PROGRAM(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE wx-config
- $ENV{WXWIN}
- $ENV{WXWIN}/bin
+ find_program(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE wx-config
+ HINTS
+ ENV WXWIN
+ $ENV{WXWIN}/bin
+ PATHS
../wx/bin
../../wx/bin )
# check wether wx-config was found:
- IF(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
+ if(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
# use shared/static wx lib?
# remember: always link shared to use systems GL etc. libs (no static
# linking, just link *against* static .a libs)
- IF(WXWINDOWS_USE_SHARED_LIBS)
- SET(WX_CONFIG_ARGS_LIBS "--libs")
- ELSE(WXWINDOWS_USE_SHARED_LIBS)
- SET(WX_CONFIG_ARGS_LIBS "--static --libs")
- ENDIF(WXWINDOWS_USE_SHARED_LIBS)
+ if(WXWINDOWS_USE_SHARED_LIBS)
+ set(WX_CONFIG_ARGS_LIBS "--libs")
+ else()
+ set(WX_CONFIG_ARGS_LIBS "--static --libs")
+ endif()
# do we need additionial wx GL stuff like GLCanvas ?
- IF(WXWINDOWS_USE_GL)
- SET(WX_CONFIG_ARGS_LIBS "${WX_CONFIG_ARGS_LIBS} --gl-libs" )
- ENDIF(WXWINDOWS_USE_GL)
- ##MESSAGE("DBG: WX_CONFIG_ARGS_LIBS=${WX_CONFIG_ARGS_LIBS}===")
+ if(WXWINDOWS_USE_GL)
+ set(WX_CONFIG_ARGS_LIBS "${WX_CONFIG_ARGS_LIBS} --gl-libs" )
+ endif()
+ ##message("DBG: WX_CONFIG_ARGS_LIBS=${WX_CONFIG_ARGS_LIBS}===")
# set CXXFLAGS to be fed into CMAKE_CXX_FLAGS by the user:
- IF (HAVE_ISYSTEM) # does the compiler support -isystem ?
- IF (NOT APPLE) # -isystem seem sto be unsuppored on Mac
- IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX )
- IF (CMAKE_CXX_COMPILER MATCHES g\\+\\+)
- SET(CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags|sed -e s/-I/-isystem/g`")
- ELSE(CMAKE_CXX_COMPILER MATCHES g\\+\\+)
- SET(CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags`")
- ENDIF(CMAKE_CXX_COMPILER MATCHES g\\+\\+)
- ENDIF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX )
- ENDIF (NOT APPLE)
- ENDIF (HAVE_ISYSTEM)
- ##MESSAGE("DBG: for compilation:
+ if (HAVE_ISYSTEM) # does the compiler support -isystem ?
+ if (NOT APPLE) # -isystem seem sto be unsuppored on Mac
+ if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX )
+ if (CMAKE_CXX_COMPILER MATCHES g\\+\\+)
+ set(CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags|sed -e s/-I/-isystem/g`")
+ else()
+ set(CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags`")
+ endif()
+ endif()
+ endif ()
+ endif ()
+ ##message("DBG: for compilation:
##CMAKE_WXWINDOWS_CXX_FLAGS=${CMAKE_WXWINDOWS_CXX_FLAGS}===")
# keep the back-quoted string for clarity
- SET(WXWINDOWS_LIBRARIES "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} ${WX_CONFIG_ARGS_LIBS}`")
- ##MESSAGE("DBG2: for linking:
+ set(WXWINDOWS_LIBRARIES "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} ${WX_CONFIG_ARGS_LIBS}`")
+ ##message("DBG2: for linking:
##WXWINDOWS_LIBRARIES=${WXWINDOWS_LIBRARIES}===")
# evaluate wx-config output to separate linker flags and linkdirs for
# rpath:
- EXEC_PROGRAM(${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE}
+ exec_program(${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE}
ARGS ${WX_CONFIG_ARGS_LIBS}
OUTPUT_VARIABLE WX_CONFIG_LIBS )
## extract linkdirs (-L) for rpath
## use regular expression to match wildcard equivalent "-L*<endchar>"
## with <endchar> is a space or a semicolon
- STRING(REGEX MATCHALL "[-][L]([^ ;])+" WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX "${WX_CONFIG_LIBS}" )
- # MESSAGE("DBG WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX=${WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX}")
+ string(REGEX MATCHALL "[-][L]([^ ;])+" WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX "${WX_CONFIG_LIBS}" )
+ # message("DBG WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX=${WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX}")
## remove prefix -L because we need the pure directory for LINK_DIRECTORIES
## replace -L by ; because the separator seems to be lost otherwise (bug or
## feature?)
- IF(WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX)
- STRING(REGEX REPLACE "[-][L]" ";" WXWINDOWS_LINK_DIRECTORIES ${WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX} )
- # MESSAGE("DBG WXWINDOWS_LINK_DIRECTORIES=${WXWINDOWS_LINK_DIRECTORIES}")
- ENDIF(WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX)
+ if(WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX)
+ string(REGEX REPLACE "[-][L]" ";" WXWINDOWS_LINK_DIRECTORIES ${WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX} )
+ # message("DBG WXWINDOWS_LINK_DIRECTORIES=${WXWINDOWS_LINK_DIRECTORIES}")
+ endif()
## replace space separated string by semicolon separated vector to make it
## work with LINK_DIRECTORIES
- SEPARATE_ARGUMENTS(WXWINDOWS_LINK_DIRECTORIES)
+ separate_arguments(WXWINDOWS_LINK_DIRECTORIES)
- MARK_AS_ADVANCED(
+ mark_as_advanced(
CMAKE_WXWINDOWS_CXX_FLAGS
WXWINDOWS_INCLUDE_DIR
WXWINDOWS_LIBRARIES
@@ -677,30 +678,30 @@ ELSE(WIN32_STYLE_FIND)
## we really need wx-config...
- ELSE(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
- MESSAGE(STATUS "Cannot find wx-config anywhere on the system. Please put the file into your path or specify it in CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE.")
- MARK_AS_ADVANCED(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
- ENDIF(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
+ else()
+ message(STATUS "Cannot find wx-config anywhere on the system. Please put the file into your path or specify it in CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE.")
+ mark_as_advanced(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
+ endif()
- ELSE(UNIX_STYLE_FIND)
- MESSAGE(STATUS "FindwxWindows.cmake: Platform unknown/unsupported by FindwxWindows.cmake. It's neither WIN32 nor UNIX")
- ENDIF(UNIX_STYLE_FIND)
-ENDIF(WIN32_STYLE_FIND)
+ else()
+ message(STATUS "FindwxWindows.cmake: Platform unknown/unsupported by FindwxWindows.cmake. It's neither WIN32 nor UNIX")
+ endif()
+endif()
-IF(WXWINDOWS_LIBRARIES)
- IF(WXWINDOWS_INCLUDE_DIR OR CMAKE_WXWINDOWS_CXX_FLAGS)
+if(WXWINDOWS_LIBRARIES)
+ if(WXWINDOWS_INCLUDE_DIR OR CMAKE_WXWINDOWS_CXX_FLAGS)
## found all we need.
- SET(WXWINDOWS_FOUND 1)
+ set(WXWINDOWS_FOUND 1)
## set deprecated variables for backward compatibility:
- SET(CMAKE_WX_CAN_COMPILE ${WXWINDOWS_FOUND})
- SET(WXWINDOWS_LIBRARY ${WXWINDOWS_LIBRARIES})
- SET(WXWINDOWS_INCLUDE_PATH ${WXWINDOWS_INCLUDE_DIR})
- SET(WXWINDOWS_LINK_DIRECTORIES ${WXWINDOWS_LINK_DIRECTORIES})
- SET(CMAKE_WX_CXX_FLAGS ${CMAKE_WXWINDOWS_CXX_FLAGS})
-
- ENDIF(WXWINDOWS_INCLUDE_DIR OR CMAKE_WXWINDOWS_CXX_FLAGS)
-ENDIF(WXWINDOWS_LIBRARIES)
+ set(CMAKE_WX_CAN_COMPILE ${WXWINDOWS_FOUND})
+ set(WXWINDOWS_LIBRARY ${WXWINDOWS_LIBRARIES})
+ set(WXWINDOWS_INCLUDE_PATH ${WXWINDOWS_INCLUDE_DIR})
+ set(WXWINDOWS_LINK_DIRECTORIES ${WXWINDOWS_LINK_DIRECTORIES})
+ set(CMAKE_WX_CXX_FLAGS ${CMAKE_WXWINDOWS_CXX_FLAGS})
+
+ endif()
+endif()
diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake
index 2455c5f8b..c59e1f839 100644
--- a/Modules/FortranCInterface.cmake
+++ b/Modules/FortranCInterface.cmake
@@ -61,7 +61,7 @@
# If the check fails and QUIET is not given the function terminates
# with a FATAL_ERROR message describing the problem. The purpose of
# this check is to stop a build early for incompatible compiler
-# combinations.
+# combinations. The test is built in the Release configuration.
#
# FortranCInterface is aware of possible GLOBAL and MODULE manglings
# for many Fortran compilers, but it also provides an interface to
@@ -215,7 +215,7 @@ ${_desc_${macro}}
message(AUTHOR_WARNING "No FortranCInterface mangling known for ${f}")
endif()
endif()
- endforeach(f)
+ endforeach()
# Store the content.
configure_file(${FortranCInterface_SOURCE_DIR}/Macro.h.in ${FILE} @ONLY)
@@ -250,6 +250,7 @@ function(FortranCInterface_VERIFY)
message(STATUS "${_desc}")
# Build a sample project which reports symbols.
+ set(CMAKE_TRY_COMPILE_CONFIGURATION Release)
try_compile(FortranCInterface_VERIFY_${lang}_COMPILED
${FortranCInterface_BINARY_DIR}/Verify${lang}
${FortranCInterface_SOURCE_DIR}/Verify
@@ -259,6 +260,9 @@ function(FortranCInterface_VERIFY)
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}"
"-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}"
"-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}"
+ "-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}"
+ "-DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}"
+ "-DCMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE}"
OUTPUT_VARIABLE _output)
file(WRITE "${FortranCInterface_BINARY_DIR}/Verify${lang}/output.txt" "${_output}")
diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake
index 2ea43d132..798c44caa 100644
--- a/Modules/FortranCInterface/Detect.cmake
+++ b/Modules/FortranCInterface/Detect.cmake
@@ -174,7 +174,7 @@ file(APPEND ${FortranCInterface_BINARY_DIR}/Output.cmake "\n")
if(FortranCInterface_GLOBAL_FOUND)
if(FortranCInterface_MODULE_FOUND)
set(_result "Found GLOBAL and MODULE mangling")
- else(FortranCInterface_MODULE_FOUND)
+ else()
set(_result "Found GLOBAL but not MODULE mangling")
endif()
elseif(NOT _result)
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index d215685dd..8f2754ed9 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -126,13 +126,13 @@ function(gp_append_unique list_var value)
if("${item}" STREQUAL "${value}")
set(contains 1)
break()
- endif("${item}" STREQUAL "${value}")
- endforeach(item)
+ endif()
+ endforeach()
if(NOT contains)
set(${list_var} ${${list_var}} "${value}" PARENT_SCOPE)
- endif(NOT contains)
-endfunction(gp_append_unique)
+ endif()
+endfunction()
function(is_file_executable file result_var)
@@ -150,13 +150,13 @@ function(is_file_executable file result_var)
if("${file_full_lower}" MATCHES "\\.exe$")
set(${result_var} 1 PARENT_SCOPE)
return()
- endif("${file_full_lower}" MATCHES "\\.exe$")
+ endif()
# A clause could be added here that uses output or return value of dumpbin
# to determine ${result_var}. In 99%+? practical cases, the exe name
# match will be sufficient...
#
- endif(WIN32 AND NOT UNIX)
+ endif()
# Use the information returned from the Unix shell command "file" to
# determine if ${file_full} should be considered an executable file...
@@ -168,7 +168,8 @@ function(is_file_executable file result_var)
if(UNIX)
if(NOT file_cmd)
find_program(file_cmd "file")
- endif(NOT file_cmd)
+ mark_as_advanced(file_cmd)
+ endif()
if(file_cmd)
execute_process(COMMAND "${file_cmd}" "${file_full}"
@@ -190,11 +191,11 @@ function(is_file_executable file result_var)
#message(STATUS "executable!")
if("${file_ov}" MATCHES "text")
#message(STATUS "but text, so *not* a binary executable!")
- else("${file_ov}" MATCHES "text")
+ else()
set(${result_var} 1 PARENT_SCOPE)
return()
- endif("${file_ov}" MATCHES "text")
- endif("${file_ov}" MATCHES "executable")
+ endif()
+ endif()
# Also detect position independent executables on Linux,
# where "file" gives "shared object ... (uses shared libraries)"
@@ -203,11 +204,11 @@ function(is_file_executable file result_var)
return()
endif()
- else(file_cmd)
+ else()
message(STATUS "warning: No 'file' command, skipping execute_process...")
- endif(file_cmd)
- endif(UNIX)
-endfunction(is_file_executable)
+ endif()
+ endif()
+endfunction()
function(gp_item_default_embedded_path item default_embedded_path_var)
@@ -240,7 +241,7 @@ function(gp_item_default_embedded_path item default_embedded_path_var)
if(item MATCHES "\\.dylib$")
set(path "@executable_path/../MacOS")
set(overridden 1)
- endif(item MATCHES "\\.dylib$")
+ endif()
# Embed frameworks in the embedded "Frameworks" directory (sibling of MacOS):
#
@@ -248,8 +249,8 @@ function(gp_item_default_embedded_path item default_embedded_path_var)
if(item MATCHES "[^/]+\\.framework/")
set(path "@executable_path/../Frameworks")
set(overridden 1)
- endif(item MATCHES "[^/]+\\.framework/")
- endif(NOT overridden)
+ endif()
+ endif()
endif()
# Provide a hook so that projects can override the default embedded location
@@ -257,10 +258,10 @@ function(gp_item_default_embedded_path item default_embedded_path_var)
#
if(COMMAND gp_item_default_embedded_path_override)
gp_item_default_embedded_path_override("${item}" path)
- endif(COMMAND gp_item_default_embedded_path_override)
+ endif()
set(${default_embedded_path_var} "${path}" PARENT_SCOPE)
-endfunction(gp_item_default_embedded_path)
+endfunction()
function(gp_resolve_item context item exepath dirs resolved_item_var)
@@ -271,7 +272,7 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
#
if(IS_ABSOLUTE "${resolved_item}" AND EXISTS "${resolved_item}")
set(resolved 1)
- endif(IS_ABSOLUTE "${resolved_item}" AND EXISTS "${resolved_item}")
+ endif()
if(NOT resolved)
if(item MATCHES "@executable_path")
@@ -285,11 +286,11 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
#message(STATUS "info: embedded item exists (${ri})")
set(resolved 1)
set(resolved_item "${ri}")
- else(EXISTS "${ri}")
+ else()
message(STATUS "warning: embedded item does not exist '${ri}'")
- endif(EXISTS "${ri}")
- endif(item MATCHES "@executable_path")
- endif(NOT resolved)
+ endif()
+ endif()
+ endif()
if(NOT resolved)
if(item MATCHES "@loader_path")
@@ -305,11 +306,11 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
#message(STATUS "info: embedded item exists (${ri})")
set(resolved 1)
set(resolved_item "${ri}")
- else(EXISTS "${ri}")
+ else()
message(STATUS "warning: embedded item does not exist '${ri}'")
- endif(EXISTS "${ri}")
- endif(item MATCHES "@loader_path")
- endif(NOT resolved)
+ endif()
+ endif()
+ endif()
if(NOT resolved)
if(item MATCHES "@rpath")
@@ -326,10 +327,10 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
set(resolved 1)
set(resolved_item "${ri}")
set(ri "ri-NOTFOUND")
- endif(ri)
+ endif()
- endif(item MATCHES "@rpath")
- endif(NOT resolved)
+ endif()
+ endif()
if(NOT resolved)
set(ri "ri-NOTFOUND")
@@ -340,8 +341,8 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
set(resolved 1)
set(resolved_item "${ri}")
set(ri "ri-NOTFOUND")
- endif(ri)
- endif(NOT resolved)
+ endif()
+ endif()
if(NOT resolved)
if(item MATCHES "[^/]+\\.framework/")
@@ -356,9 +357,9 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
set(resolved 1)
set(resolved_item "${fw}")
set(fw "fw-NOTFOUND")
- endif(fw)
- endif(item MATCHES "[^/]+\\.framework/")
- endif(NOT resolved)
+ endif()
+ endif()
+ endif()
# Using find_program on Windows will find dll files that are in the PATH.
# (Converting simple file names into full path names if found.)
@@ -373,16 +374,16 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
set(resolved 1)
set(resolved_item "${ri}")
set(ri "ri-NOTFOUND")
- endif(ri)
- endif(NOT resolved)
- endif(WIN32 AND NOT UNIX)
+ endif()
+ endif()
+ endif()
# Provide a hook so that projects can override item resolution
# by whatever logic they choose:
#
if(COMMAND gp_resolve_item_override)
gp_resolve_item_override("${context}" "${item}" "${exepath}" "${dirs}" resolved_item resolved)
- endif(COMMAND gp_resolve_item_override)
+ endif()
if(NOT resolved)
message(STATUS "
@@ -409,10 +410,10 @@ warning: cannot resolve item '${item}'
# resolved_item_var='${resolved_item_var}'
#******************************************************************************
#")
- endif(NOT resolved)
+ endif()
set(${resolved_item_var} "${resolved_item}" PARENT_SCOPE)
-endfunction(gp_resolve_item)
+endfunction()
function(gp_resolved_file_type original_file file exepath dirs type_var)
@@ -480,9 +481,9 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)")
set(is_system 1)
endif()
- endif(CYGPATH_EXECUTABLE)
- endif(UNIX)
- endif(WIN32)
+ endif()
+ endif()
+ endif()
if(NOT is_system)
get_filename_component(original_path "${original_lower}" PATH)
@@ -551,7 +552,7 @@ function(gp_file_type original_file file type_var)
gp_resolved_file_type("${original_file}" "${file}" "${exepath}" "" type)
set(${type_var} "${type}" PARENT_SCOPE)
-endfunction(gp_file_type)
+endfunction()
function(get_prerequisites target prerequisites_var exclude_system recurse exepath dirs)
@@ -560,11 +561,11 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if(NOT IS_ABSOLUTE "${target}")
message("warning: target '${target}' is not absolute...")
- endif(NOT IS_ABSOLUTE "${target}")
+ endif()
if(NOT EXISTS "${target}")
message("warning: target '${target}' does not exist...")
- endif(NOT EXISTS "${target}")
+ endif()
# <setup-gp_tool-vars>
#
@@ -575,11 +576,11 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
set(gp_tool "ldd")
if(APPLE)
set(gp_tool "otool")
- endif(APPLE)
+ endif()
if(WIN32 AND NOT UNIX) # This is how to check for cygwin, har!
set(gp_tool "dumpbin")
- endif(WIN32 AND NOT UNIX)
- endif("${gp_tool}" STREQUAL "")
+ endif()
+ endif()
set(gp_tool_known 0)
@@ -590,7 +591,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
set(gp_regex_cmp_count 1)
set(gp_tool_known 1)
- endif("${gp_tool}" STREQUAL "ldd")
+ endif()
if("${gp_tool}" STREQUAL "otool")
set(gp_cmd_args "-L")
@@ -599,7 +600,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
set(gp_regex_fallback "")
set(gp_regex_cmp_count 3)
set(gp_tool_known 1)
- endif("${gp_tool}" STREQUAL "otool")
+ endif()
if("${gp_tool}" STREQUAL "dumpbin")
set(gp_cmd_args "/dependents")
@@ -609,14 +610,14 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
set(gp_regex_cmp_count 1)
set(gp_tool_known 1)
set(ENV{VS_UNICODE_OUTPUT} "") # Block extra output from inside VS IDE.
- endif("${gp_tool}" STREQUAL "dumpbin")
+ endif()
if(NOT gp_tool_known)
message(STATUS "warning: gp_tool='${gp_tool}' is an unknown tool...")
message(STATUS "CMake function get_prerequisites needs more code to handle '${gp_tool}'")
message(STATUS "Valid gp_tool values are dumpbin, ldd and otool.")
return()
- endif(NOT gp_tool_known)
+ endif()
set(gp_cmd_paths ${gp_cmd_paths}
"C:/Program Files/Microsoft Visual Studio 9.0/VC/bin"
@@ -634,7 +635,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if(NOT gp_cmd)
message(STATUS "warning: could not find '${gp_tool}' - cannot analyze prerequisites...")
return()
- endif(NOT gp_cmd)
+ endif()
if("${gp_tool}" STREQUAL "dumpbin")
# When running dumpbin, it also needs the "Common7/IDE" directory in the
@@ -654,14 +655,14 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if("${gp_env_path_element}" STREQUAL "${gp_cmd_dlls_dir}")
set(gp_found_cmd_dlls_dir 1)
endif()
- endforeach(gp_env_path_element)
+ endforeach()
if(NOT gp_found_cmd_dlls_dir)
file(TO_NATIVE_PATH "${gp_cmd_dlls_dir}" gp_cmd_dlls_dir)
set(ENV{PATH} "$ENV{PATH};${gp_cmd_dlls_dir}")
endif()
- endif(EXISTS "${gp_cmd_dlls_dir}")
- endif("${gp_tool}" STREQUAL "dumpbin")
+ endif()
+ endif()
#
# </setup-gp_tool-vars>
@@ -669,8 +670,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
set(old_ld_env "$ENV{LD_LIBRARY_PATH}")
foreach(dir ${exepath} ${dirs})
set(ENV{LD_LIBRARY_PATH} "${dir}:$ENV{LD_LIBRARY_PATH}")
- endforeach(dir)
- endif("${gp_tool}" STREQUAL "ldd")
+ endforeach()
+ endif()
# Track new prerequisites at each new level of recursion. Start with an
@@ -687,13 +688,13 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if("${gp_tool}" STREQUAL "ldd")
set(ENV{LD_LIBRARY_PATH} "${old_ld_env}")
- endif("${gp_tool}" STREQUAL "ldd")
+ endif()
if(verbose)
message(STATUS "<RawOutput cmd='${gp_cmd} ${gp_cmd_args} ${target}'>")
message(STATUS "gp_cmd_ov='${gp_cmd_ov}'")
message(STATUS "</RawOutput>")
- endif(verbose)
+ endif()
get_filename_component(target_dir "${target}" PATH)
@@ -716,8 +717,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
# trim
string(REGEX MATCH "[^\n ].*[^\n ]" gp_install_id "${gp_install_id}")
#message("INSTALL ID is \"${gp_install_id}\"")
- endif(gp_install_id)
- endif("${gp_tool}" STREQUAL "otool")
+ endif()
+ endif()
# Analyze each line for file names that match the regular expression:
#
@@ -727,23 +728,23 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
# Extract information from each candidate:
if(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}")
string(REGEX REPLACE "${gp_regex_fallback}" "\\1" raw_item "${candidate}")
- else(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}")
+ else()
string(REGEX REPLACE "${gp_regex}" "\\1" raw_item "${candidate}")
- endif(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}")
+ endif()
if(gp_regex_cmp_count GREATER 1)
string(REGEX REPLACE "${gp_regex}" "\\2" raw_compat_version "${candidate}")
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" compat_major_version "${raw_compat_version}")
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" compat_minor_version "${raw_compat_version}")
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" compat_patch_version "${raw_compat_version}")
- endif(gp_regex_cmp_count GREATER 1)
+ endif()
if(gp_regex_cmp_count GREATER 2)
string(REGEX REPLACE "${gp_regex}" "\\3" raw_current_version "${candidate}")
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" current_major_version "${raw_current_version}")
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" current_minor_version "${raw_current_version}")
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" current_patch_version "${raw_current_version}")
- endif(gp_regex_cmp_count GREATER 2)
+ endif()
# Use the raw_item as the list entries returned by this function. Use the
# gp_resolve_item function to resolve it to an actual full path file if
@@ -757,7 +758,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if("${item}" STREQUAL "${gp_install_id}")
set(add_item 0)
- endif("${item}" STREQUAL "${gp_install_id}")
+ endif()
if(add_item AND ${exclude_system})
set(type "")
@@ -765,8 +766,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if("${type}" STREQUAL "system")
set(add_item 0)
- endif("${type}" STREQUAL "system")
- endif(add_item AND ${exclude_system})
+ endif()
+ endif()
if(add_item)
list(LENGTH ${prerequisites_var} list_length_before_append)
@@ -784,49 +785,49 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if(NOT list_length_before_append EQUAL list_length_after_append)
gp_resolve_item("${target}" "${item}" "${exepath}" "${dirs}" resolved_item)
set(unseen_prereqs ${unseen_prereqs} "${resolved_item}")
- endif(NOT list_length_before_append EQUAL list_length_after_append)
- endif(${recurse})
- endif(add_item)
- else("${candidate}" MATCHES "${gp_regex}")
+ endif()
+ endif()
+ endif()
+ else()
if(verbose)
message(STATUS "ignoring non-matching line: '${candidate}'")
- endif(verbose)
- endif("${candidate}" MATCHES "${gp_regex}")
- endforeach(candidate)
+ endif()
+ endif()
+ endforeach()
list(LENGTH ${prerequisites_var} prerequisites_var_length)
if(prerequisites_var_length GREATER 0)
list(SORT ${prerequisites_var})
- endif(prerequisites_var_length GREATER 0)
+ endif()
if(${recurse})
set(more_inputs ${unseen_prereqs})
foreach(input ${more_inputs})
get_prerequisites("${input}" ${prerequisites_var} ${exclude_system} ${recurse} "${exepath}" "${dirs}")
- endforeach(input)
- endif(${recurse})
+ endforeach()
+ endif()
set(${prerequisites_var} ${${prerequisites_var}} PARENT_SCOPE)
-endfunction(get_prerequisites)
+endfunction()
function(list_prerequisites target)
if("${ARGV1}" STREQUAL "")
set(all 1)
- else("${ARGV1}" STREQUAL "")
+ else()
set(all "${ARGV1}")
- endif("${ARGV1}" STREQUAL "")
+ endif()
if("${ARGV2}" STREQUAL "")
set(exclude_system 0)
- else("${ARGV2}" STREQUAL "")
+ else()
set(exclude_system "${ARGV2}")
- endif("${ARGV2}" STREQUAL "")
+ endif()
if("${ARGV3}" STREQUAL "")
set(verbose 0)
- else("${ARGV3}" STREQUAL "")
+ else()
set(verbose "${ARGV3}")
- endif("${ARGV3}" STREQUAL "")
+ endif()
set(count 0)
set(count_str "")
@@ -842,23 +843,23 @@ function(list_prerequisites target)
if(print_target)
message(STATUS "File '${target}' depends on:")
- endif(print_target)
+ endif()
foreach(d ${prereqs})
math(EXPR count "${count} + 1")
if(print_count)
set(count_str "${count}. ")
- endif(print_count)
+ endif()
if(print_prerequisite_type)
gp_file_type("${target}" "${d}" type)
set(type_str " (${type})")
- endif(print_prerequisite_type)
+ endif()
message(STATUS "${count_str}${d}${type_str}")
- endforeach(d)
-endfunction(list_prerequisites)
+ endforeach()
+endfunction()
function(list_prerequisites_by_glob glob_arg glob_exp)
@@ -872,6 +873,6 @@ function(list_prerequisites_by_glob glob_arg glob_exp)
message(STATUS "=============================================================================")
list_prerequisites("${f}" ${ARGN})
message(STATUS "")
- endif(is_f_executable)
- endforeach(f)
-endfunction(list_prerequisites_by_glob)
+ endif()
+ endforeach()
+endfunction()
diff --git a/Modules/ITKCompatibility.cmake b/Modules/ITKCompatibility.cmake
index efd9c284e..ca2d69bfb 100644
--- a/Modules/ITKCompatibility.cmake
+++ b/Modules/ITKCompatibility.cmake
@@ -13,5 +13,5 @@
# License text for the above reference.)
# work around an old bug in ITK prior to verison 3.0
-SET(TIFF_RIGHT_VERSION 1)
+set(TIFF_RIGHT_VERSION 1)
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 65d254a4a..bd9750185 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -1,6 +1,6 @@
# By including this file, all library files listed in the variable
# CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS will be installed with
-# INSTALL(PROGRAMS ...) into bin for WIN32 and lib
+# install(PROGRAMS ...) into bin for WIN32 and lib
# for non-WIN32. If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP is set to TRUE
# before including this file, then the INSTALL command is not called.
# The user can use the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to use a
@@ -36,196 +36,196 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF(MSVC)
- FILE(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
+if(MSVC)
+ file(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
- IF(CMAKE_CL_64)
- IF(MSVC_VERSION GREATER 1599)
+ if(CMAKE_CL_64)
+ if(MSVC_VERSION GREATER 1599)
# VS 10 and later:
- SET(CMAKE_MSVC_ARCH x64)
- ELSE()
+ set(CMAKE_MSVC_ARCH x64)
+ else()
# VS 9 and earlier:
- SET(CMAKE_MSVC_ARCH amd64)
- ENDIF()
- ELSE(CMAKE_CL_64)
- SET(CMAKE_MSVC_ARCH x86)
- ENDIF(CMAKE_CL_64)
+ set(CMAKE_MSVC_ARCH amd64)
+ endif()
+ else()
+ set(CMAKE_MSVC_ARCH x86)
+ endif()
- GET_FILENAME_COMPONENT(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
- GET_FILENAME_COMPONENT(base_dir "${devenv_dir}/../.." ABSOLUTE)
+ get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
+ get_filename_component(base_dir "${devenv_dir}/../.." ABSOLUTE)
- IF(MSVC70)
- SET(__install__libs
+ if(MSVC70)
+ set(__install__libs
"${SYSTEMROOT}/system32/msvcp70.dll"
"${SYSTEMROOT}/system32/msvcr70.dll"
)
- ENDIF(MSVC70)
+ endif()
- IF(MSVC71)
- SET(__install__libs
+ if(MSVC71)
+ set(__install__libs
"${SYSTEMROOT}/system32/msvcp71.dll"
"${SYSTEMROOT}/system32/msvcr71.dll"
)
- ENDIF(MSVC71)
+ endif()
- IF(MSVC80)
+ if(MSVC80)
# Find the runtime library redistribution directory.
- GET_FILENAME_COMPONENT(msvc_install_dir
+ get_filename_component(msvc_install_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
- FIND_PATH(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
+ find_path(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
PATHS
"${msvc_install_dir}/../../VC/redist"
"${base_dir}/VC/redist"
)
- MARK_AS_ADVANCED(MSVC80_REDIST_DIR)
- SET(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
+ mark_as_advanced(MSVC80_REDIST_DIR)
+ set(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
- IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
- SET(__install__libs
+ if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ set(__install__libs
"${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest"
"${MSVC80_CRT_DIR}/msvcm80.dll"
"${MSVC80_CRT_DIR}/msvcp80.dll"
"${MSVC80_CRT_DIR}/msvcr80.dll"
)
- ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ endif()
- IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
- SET(MSVC80_CRT_DIR
+ if(CMAKE_INSTALL_DEBUG_LIBRARIES)
+ set(MSVC80_CRT_DIR
"${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
- SET(__install__libs ${__install__libs}
+ set(__install__libs ${__install__libs}
"${MSVC80_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
"${MSVC80_CRT_DIR}/msvcm80d.dll"
"${MSVC80_CRT_DIR}/msvcp80d.dll"
"${MSVC80_CRT_DIR}/msvcr80d.dll"
)
- ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
- ENDIF(MSVC80)
+ endif()
+ endif()
- IF(MSVC90)
+ if(MSVC90)
# Find the runtime library redistribution directory.
- GET_FILENAME_COMPONENT(msvc_install_dir
+ get_filename_component(msvc_install_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
- GET_FILENAME_COMPONENT(msvc_express_install_dir
+ get_filename_component(msvc_express_install_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]" ABSOLUTE)
- FIND_PATH(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
+ find_path(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
PATHS
"${msvc_install_dir}/../../VC/redist"
"${msvc_express_install_dir}/../../VC/redist"
"${base_dir}/VC/redist"
)
- MARK_AS_ADVANCED(MSVC90_REDIST_DIR)
- SET(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
+ mark_as_advanced(MSVC90_REDIST_DIR)
+ set(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
- IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
- SET(__install__libs
+ if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ set(__install__libs
"${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest"
"${MSVC90_CRT_DIR}/msvcm90.dll"
"${MSVC90_CRT_DIR}/msvcp90.dll"
"${MSVC90_CRT_DIR}/msvcr90.dll"
)
- ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ endif()
- IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
- SET(MSVC90_CRT_DIR
+ if(CMAKE_INSTALL_DEBUG_LIBRARIES)
+ set(MSVC90_CRT_DIR
"${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
- SET(__install__libs ${__install__libs}
+ set(__install__libs ${__install__libs}
"${MSVC90_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
"${MSVC90_CRT_DIR}/msvcm90d.dll"
"${MSVC90_CRT_DIR}/msvcp90d.dll"
"${MSVC90_CRT_DIR}/msvcr90d.dll"
)
- ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
- ENDIF(MSVC90)
+ endif()
+ endif()
- MACRO(MSVCRT_FILES_FOR_VERSION version)
- SET(v "${version}")
+ macro(MSVCRT_FILES_FOR_VERSION version)
+ set(v "${version}")
# Find the runtime library redistribution directory.
- GET_FILENAME_COMPONENT(msvc_install_dir
+ get_filename_component(msvc_install_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${v}.0;InstallDir]" ABSOLUTE)
- FIND_PATH(MSVC${v}_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT
+ find_path(MSVC${v}_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT
PATHS
"${msvc_install_dir}/../../VC/redist"
"${base_dir}/VC/redist"
"$ENV{ProgramFiles}/Microsoft Visual Studio ${v}.0/VC/redist"
"$ENV{ProgramFiles(x86)}/Microsoft Visual Studio ${v}.0/VC/redist"
)
- MARK_AS_ADVANCED(MSVC${v}_REDIST_DIR)
- SET(MSVC${v}_CRT_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT")
+ mark_as_advanced(MSVC${v}_REDIST_DIR)
+ set(MSVC${v}_CRT_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT")
- IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
- SET(__install__libs
+ if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ set(__install__libs
"${MSVC${v}_CRT_DIR}/msvcp${v}0.dll"
"${MSVC${v}_CRT_DIR}/msvcr${v}0.dll"
)
- ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ endif()
- IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
- SET(MSVC${v}_CRT_DIR
+ if(CMAKE_INSTALL_DEBUG_LIBRARIES)
+ set(MSVC${v}_CRT_DIR
"${MSVC${v}_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.DebugCRT")
- SET(__install__libs ${__install__libs}
+ set(__install__libs ${__install__libs}
"${MSVC${v}_CRT_DIR}/msvcp${v}0d.dll"
"${MSVC${v}_CRT_DIR}/msvcr${v}0d.dll"
)
- ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
- ENDMACRO()
+ endif()
+ endmacro()
- IF(MSVC10)
+ if(MSVC10)
MSVCRT_FILES_FOR_VERSION(10)
- ENDIF()
+ endif()
- IF(MSVC11)
+ if(MSVC11)
MSVCRT_FILES_FOR_VERSION(11)
- ENDIF()
+ endif()
- IF(CMAKE_INSTALL_MFC_LIBRARIES)
- IF(MSVC70)
- SET(__install__libs ${__install__libs}
+ if(CMAKE_INSTALL_MFC_LIBRARIES)
+ if(MSVC70)
+ set(__install__libs ${__install__libs}
"${SYSTEMROOT}/system32/mfc70.dll"
)
- ENDIF(MSVC70)
+ endif()
- IF(MSVC71)
- SET(__install__libs ${__install__libs}
+ if(MSVC71)
+ set(__install__libs ${__install__libs}
"${SYSTEMROOT}/system32/mfc71.dll"
)
- ENDIF(MSVC71)
+ endif()
- IF(MSVC80)
- IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
- SET(MSVC80_MFC_DIR
+ if(MSVC80)
+ if(CMAKE_INSTALL_DEBUG_LIBRARIES)
+ set(MSVC80_MFC_DIR
"${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
- SET(__install__libs ${__install__libs}
+ set(__install__libs ${__install__libs}
"${MSVC80_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
"${MSVC80_MFC_DIR}/mfc80d.dll"
"${MSVC80_MFC_DIR}/mfc80ud.dll"
"${MSVC80_MFC_DIR}/mfcm80d.dll"
"${MSVC80_MFC_DIR}/mfcm80ud.dll"
)
- ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
+ endif()
- SET(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
+ set(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
- IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
- SET(__install__libs ${__install__libs}
+ if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ set(__install__libs ${__install__libs}
"${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest"
"${MSVC80_MFC_DIR}/mfc80.dll"
"${MSVC80_MFC_DIR}/mfc80u.dll"
"${MSVC80_MFC_DIR}/mfcm80.dll"
"${MSVC80_MFC_DIR}/mfcm80u.dll"
)
- ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ endif()
# include the language dll's for vs8 as well as the actuall dll's
- SET(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
+ set(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
- SET(__install__libs ${__install__libs}
+ set(__install__libs ${__install__libs}
"${MSVC80_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
"${MSVC80_MFCLOC_DIR}/mfc80chs.dll"
"${MSVC80_MFCLOC_DIR}/mfc80cht.dll"
@@ -237,39 +237,39 @@ IF(MSVC)
"${MSVC80_MFCLOC_DIR}/mfc80jpn.dll"
"${MSVC80_MFCLOC_DIR}/mfc80kor.dll"
)
- ENDIF(MSVC80)
+ endif()
- IF(MSVC90)
- IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
- SET(MSVC90_MFC_DIR
+ if(MSVC90)
+ if(CMAKE_INSTALL_DEBUG_LIBRARIES)
+ set(MSVC90_MFC_DIR
"${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
- SET(__install__libs ${__install__libs}
+ set(__install__libs ${__install__libs}
"${MSVC90_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
"${MSVC90_MFC_DIR}/mfc90d.dll"
"${MSVC90_MFC_DIR}/mfc90ud.dll"
"${MSVC90_MFC_DIR}/mfcm90d.dll"
"${MSVC90_MFC_DIR}/mfcm90ud.dll"
)
- ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
+ endif()
- SET(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
+ set(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
- IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
- SET(__install__libs ${__install__libs}
+ if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ set(__install__libs ${__install__libs}
"${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest"
"${MSVC90_MFC_DIR}/mfc90.dll"
"${MSVC90_MFC_DIR}/mfc90u.dll"
"${MSVC90_MFC_DIR}/mfcm90.dll"
"${MSVC90_MFC_DIR}/mfcm90u.dll"
)
- ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ endif()
# include the language dll's for vs9 as well as the actuall dll's
- SET(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
+ set(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
- SET(__install__libs ${__install__libs}
+ set(__install__libs ${__install__libs}
"${MSVC90_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
"${MSVC90_MFCLOC_DIR}/mfc90chs.dll"
"${MSVC90_MFCLOC_DIR}/mfc90cht.dll"
@@ -281,121 +281,122 @@ IF(MSVC)
"${MSVC90_MFCLOC_DIR}/mfc90jpn.dll"
"${MSVC90_MFCLOC_DIR}/mfc90kor.dll"
)
- ENDIF(MSVC90)
+ endif()
- MACRO(MFC_FILES_FOR_VERSION version)
- SET(v "${version}")
+ macro(MFC_FILES_FOR_VERSION version)
+ set(v "${version}")
- IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
- SET(MSVC${v}_MFC_DIR
+ if(CMAKE_INSTALL_DEBUG_LIBRARIES)
+ set(MSVC${v}_MFC_DIR
"${MSVC${v}_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.DebugMFC")
- SET(__install__libs ${__install__libs}
+ set(__install__libs ${__install__libs}
"${MSVC${v}_MFC_DIR}/mfc${v}0d.dll"
"${MSVC${v}_MFC_DIR}/mfc${v}0ud.dll"
"${MSVC${v}_MFC_DIR}/mfcm${v}0d.dll"
"${MSVC${v}_MFC_DIR}/mfcm${v}0ud.dll"
)
- ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
+ endif()
- SET(MSVC${v}_MFC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFC")
- IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
- SET(__install__libs ${__install__libs}
+ set(MSVC${v}_MFC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFC")
+ if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ set(__install__libs ${__install__libs}
"${MSVC${v}_MFC_DIR}/mfc${v}0.dll"
"${MSVC${v}_MFC_DIR}/mfc${v}0u.dll"
"${MSVC${v}_MFC_DIR}/mfcm${v}0.dll"
"${MSVC${v}_MFC_DIR}/mfcm${v}0u.dll"
)
- ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+ endif()
# include the language dll's as well as the actuall dll's
- SET(MSVC${v}_MFCLOC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFCLOC")
- SET(__install__libs ${__install__libs}
+ set(MSVC${v}_MFCLOC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFCLOC")
+ set(__install__libs ${__install__libs}
"${MSVC${v}_MFCLOC_DIR}/mfc${v}0chs.dll"
"${MSVC${v}_MFCLOC_DIR}/mfc${v}0cht.dll"
- "${MSVC${v}_MFCLOC_DIR}/mfc${v}0enu.dll"
- "${MSVC${v}_MFCLOC_DIR}/mfc${v}0esp.dll"
"${MSVC${v}_MFCLOC_DIR}/mfc${v}0deu.dll"
+ "${MSVC${v}_MFCLOC_DIR}/mfc${v}0enu.dll"
+ "${MSVC${v}_MFCLOC_DIR}/mfc${v}0esn.dll"
"${MSVC${v}_MFCLOC_DIR}/mfc${v}0fra.dll"
"${MSVC${v}_MFCLOC_DIR}/mfc${v}0ita.dll"
"${MSVC${v}_MFCLOC_DIR}/mfc${v}0jpn.dll"
"${MSVC${v}_MFCLOC_DIR}/mfc${v}0kor.dll"
+ "${MSVC${v}_MFCLOC_DIR}/mfc${v}0rus.dll"
)
- ENDMACRO()
+ endmacro()
- IF(MSVC10)
+ if(MSVC10)
MFC_FILES_FOR_VERSION(10)
- ENDIF()
+ endif()
- IF(MSVC11)
+ if(MSVC11)
MFC_FILES_FOR_VERSION(11)
- ENDIF()
- ENDIF(CMAKE_INSTALL_MFC_LIBRARIES)
+ endif()
+ endif()
- FOREACH(lib
+ foreach(lib
${__install__libs}
)
- IF(EXISTS ${lib})
- SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
+ if(EXISTS ${lib})
+ set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
- ELSE(EXISTS ${lib})
- IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
- MESSAGE(WARNING "system runtime library file does not exist: '${lib}'")
+ else()
+ if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
+ message(WARNING "system runtime library file does not exist: '${lib}'")
# This warning indicates an incomplete Visual Studio installation
# or a bug somewhere above here in this file.
# If you would like to avoid this warning, fix the real problem, or
# set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
# this file.
- ENDIF()
- ENDIF(EXISTS ${lib})
- ENDFOREACH(lib)
-ENDIF(MSVC)
-
-IF(WATCOM)
- GET_FILENAME_COMPONENT( CompilerPath ${CMAKE_C_COMPILER} PATH )
- IF(WATCOM17)
- SET( __install__libs ${CompilerPath}/clbr17.dll
+ endif()
+ endif()
+ endforeach()
+endif()
+
+if(WATCOM)
+ get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH )
+ if(WATCOM17)
+ set( __install__libs ${CompilerPath}/clbr17.dll
${CompilerPath}/mt7r17.dll ${CompilerPath}/plbr17.dll )
- ENDIF()
- IF(WATCOM18)
- SET( __install__libs ${CompilerPath}/clbr18.dll
+ endif()
+ if(WATCOM18)
+ set( __install__libs ${CompilerPath}/clbr18.dll
${CompilerPath}/mt7r18.dll ${CompilerPath}/plbr18.dll )
- ENDIF()
- IF(WATCOM19)
- SET( __install__libs ${CompilerPath}/clbr19.dll
+ endif()
+ if(WATCOM19)
+ set( __install__libs ${CompilerPath}/clbr19.dll
${CompilerPath}/mt7r19.dll ${CompilerPath}/plbr19.dll )
- ENDIF()
- FOREACH(lib
+ endif()
+ foreach(lib
${__install__libs}
)
- IF(EXISTS ${lib})
- SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
+ if(EXISTS ${lib})
+ set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
- ELSE()
- IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
- MESSAGE(WARNING "system runtime library file does not exist: '${lib}'")
+ else()
+ if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
+ message(WARNING "system runtime library file does not exist: '${lib}'")
# This warning indicates an incomplete Watcom installation
# or a bug somewhere above here in this file.
# If you would like to avoid this warning, fix the real problem, or
# set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
# this file.
- ENDIF()
- ENDIF()
- ENDFOREACH()
-ENDIF()
+ endif()
+ endif()
+ endforeach()
+endif()
# Include system runtime libraries in the installation if any are
# specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
-IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
- IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
- IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
- IF(WIN32)
- SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
- ELSE(WIN32)
- SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
- ENDIF(WIN32)
- ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
- INSTALL(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
+if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
+ if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
+ if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
+ if(WIN32)
+ set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
+ else()
+ set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
+ endif()
+ endif()
+ install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION})
- ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
-ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
+ endif()
+endif()
diff --git a/Modules/KDE3Macros.cmake b/Modules/KDE3Macros.cmake
index 5b76000e8..07864f5d8 100644
--- a/Modules/KDE3Macros.cmake
+++ b/Modules/KDE3Macros.cmake
@@ -32,157 +32,157 @@
#neundorf@kde.org
-INCLUDE(AddFileDependencies)
+include(AddFileDependencies)
#create the kidl and skeletion file for dcop stuff
#usage: KDE_ADD_COP_SKELS(foo_SRCS ${dcop_headers})
-MACRO(KDE3_ADD_DCOP_SKELS _sources)
- FOREACH (_current_FILE ${ARGN})
+macro(KDE3_ADD_DCOP_SKELS _sources)
+ foreach (_current_FILE ${ARGN})
- GET_FILENAME_COMPONENT(_tmp_FILE ${_current_FILE} ABSOLUTE)
- GET_FILENAME_COMPONENT(_basename ${_tmp_FILE} NAME_WE)
+ get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
+ get_filename_component(_basename ${_tmp_FILE} NAME_WE)
- SET(_skel ${CMAKE_CURRENT_BINARY_DIR}/${_basename}_skel.cpp)
- SET(_kidl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.kidl)
+ set(_skel ${CMAKE_CURRENT_BINARY_DIR}/${_basename}_skel.cpp)
+ set(_kidl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.kidl)
- IF (NOT HAVE_${_basename}_KIDL_RULE)
- SET(HAVE_${_basename}_KIDL_RULE ON)
+ if (NOT HAVE_${_basename}_KIDL_RULE)
+ set(HAVE_${_basename}_KIDL_RULE ON)
- ADD_CUSTOM_COMMAND(OUTPUT ${_kidl}
+ add_custom_command(OUTPUT ${_kidl}
COMMAND ${KDE3_DCOPIDL_EXECUTABLE}
ARGS ${_tmp_FILE} > ${_kidl}
DEPENDS ${_tmp_FILE}
)
- ENDIF (NOT HAVE_${_basename}_KIDL_RULE)
+ endif ()
- IF (NOT HAVE_${_basename}_SKEL_RULE)
- SET(HAVE_${_basename}_SKEL_RULE ON)
+ if (NOT HAVE_${_basename}_SKEL_RULE)
+ set(HAVE_${_basename}_SKEL_RULE ON)
- ADD_CUSTOM_COMMAND(OUTPUT ${_skel}
+ add_custom_command(OUTPUT ${_skel}
COMMAND ${KDE3_DCOPIDL2CPP_EXECUTABLE}
ARGS --c++-suffix cpp --no-signals --no-stub ${_kidl}
DEPENDS ${_kidl}
)
- ENDIF (NOT HAVE_${_basename}_SKEL_RULE)
+ endif ()
- SET(${_sources} ${${_sources}} ${_skel})
+ set(${_sources} ${${_sources}} ${_skel})
- ENDFOREACH (_current_FILE)
+ endforeach ()
-ENDMACRO(KDE3_ADD_DCOP_SKELS)
+endmacro()
-MACRO(KDE3_ADD_DCOP_STUBS _sources)
- FOREACH (_current_FILE ${ARGN})
+macro(KDE3_ADD_DCOP_STUBS _sources)
+ foreach (_current_FILE ${ARGN})
- GET_FILENAME_COMPONENT(_tmp_FILE ${_current_FILE} ABSOLUTE)
+ get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
- GET_FILENAME_COMPONENT(_basename ${_tmp_FILE} NAME_WE)
+ get_filename_component(_basename ${_tmp_FILE} NAME_WE)
- SET(_stub_CPP ${CMAKE_CURRENT_BINARY_DIR}/${_basename}_stub.cpp)
- SET(_kidl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.kidl)
+ set(_stub_CPP ${CMAKE_CURRENT_BINARY_DIR}/${_basename}_stub.cpp)
+ set(_kidl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.kidl)
- IF (NOT HAVE_${_basename}_KIDL_RULE)
- SET(HAVE_${_basename}_KIDL_RULE ON)
+ if (NOT HAVE_${_basename}_KIDL_RULE)
+ set(HAVE_${_basename}_KIDL_RULE ON)
- ADD_CUSTOM_COMMAND(OUTPUT ${_kidl}
+ add_custom_command(OUTPUT ${_kidl}
COMMAND ${KDE3_DCOPIDL_EXECUTABLE}
ARGS ${_tmp_FILE} > ${_kidl}
DEPENDS ${_tmp_FILE}
)
- ENDIF (NOT HAVE_${_basename}_KIDL_RULE)
+ endif ()
- IF (NOT HAVE_${_basename}_STUB_RULE)
- SET(HAVE_${_basename}_STUB_RULE ON)
+ if (NOT HAVE_${_basename}_STUB_RULE)
+ set(HAVE_${_basename}_STUB_RULE ON)
- ADD_CUSTOM_COMMAND(OUTPUT ${_stub_CPP}
+ add_custom_command(OUTPUT ${_stub_CPP}
COMMAND ${KDE3_DCOPIDL2CPP_EXECUTABLE}
ARGS --c++-suffix cpp --no-signals --no-skel ${_kidl}
DEPENDS ${_kidl}
)
- ENDIF (NOT HAVE_${_basename}_STUB_RULE)
+ endif ()
- SET(${_sources} ${${_sources}} ${_stub_CPP})
+ set(${_sources} ${${_sources}} ${_stub_CPP})
- ENDFOREACH (_current_FILE)
+ endforeach ()
-ENDMACRO(KDE3_ADD_DCOP_STUBS)
+endmacro()
-MACRO(KDE3_ADD_KCFG_FILES _sources)
- FOREACH (_current_FILE ${ARGN})
+macro(KDE3_ADD_KCFG_FILES _sources)
+ foreach (_current_FILE ${ARGN})
- GET_FILENAME_COMPONENT(_tmp_FILE ${_current_FILE} ABSOLUTE)
+ get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
- GET_FILENAME_COMPONENT(_basename ${_tmp_FILE} NAME_WE)
+ get_filename_component(_basename ${_tmp_FILE} NAME_WE)
- FILE(READ ${_tmp_FILE} _contents)
- STRING(REGEX REPLACE "^(.*\n)?File=([^\n]+)\n.*$" "\\2" _kcfg_FILE "${_contents}")
+ file(READ ${_tmp_FILE} _contents)
+ string(REGEX REPLACE "^(.*\n)?File=([^\n]+)\n.*$" "\\2" _kcfg_FILE "${_contents}")
- SET(_src_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
- SET(_header_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
+ set(_src_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
+ set(_header_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
- ADD_CUSTOM_COMMAND(OUTPUT ${_src_FILE}
+ add_custom_command(OUTPUT ${_src_FILE}
COMMAND ${KDE3_KCFGC_EXECUTABLE}
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${_kcfg_FILE} ${_tmp_FILE}
DEPENDS ${_tmp_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/${_kcfg_FILE} )
- SET(${_sources} ${${_sources}} ${_src_FILE})
+ set(${_sources} ${${_sources}} ${_src_FILE})
- ENDFOREACH (_current_FILE)
+ endforeach ()
-ENDMACRO(KDE3_ADD_KCFG_FILES)
+endmacro()
#create the moc files and add them to the list of sources
#usage: KDE_ADD_MOC_FILES(foo_SRCS ${moc_headers})
-MACRO(KDE3_ADD_MOC_FILES _sources)
- FOREACH (_current_FILE ${ARGN})
+macro(KDE3_ADD_MOC_FILES _sources)
+ foreach (_current_FILE ${ARGN})
- GET_FILENAME_COMPONENT(_tmp_FILE ${_current_FILE} ABSOLUTE)
+ get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
- GET_FILENAME_COMPONENT(_basename ${_tmp_FILE} NAME_WE)
- SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc.cpp)
+ get_filename_component(_basename ${_tmp_FILE} NAME_WE)
+ set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc.cpp)
- ADD_CUSTOM_COMMAND(OUTPUT ${_moc}
+ add_custom_command(OUTPUT ${_moc}
COMMAND ${QT_MOC_EXECUTABLE}
ARGS ${_tmp_FILE} -o ${_moc}
DEPENDS ${_tmp_FILE}
)
- SET(${_sources} ${${_sources}} ${_moc})
+ set(${_sources} ${${_sources}} ${_moc})
- ENDFOREACH (_current_FILE)
-ENDMACRO(KDE3_ADD_MOC_FILES)
+ endforeach ()
+endmacro()
-GET_FILENAME_COMPONENT( KDE3_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+get_filename_component( KDE3_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
#create the implementation files from the ui files and add them to the list of sources
#usage: KDE_ADD_UI_FILES(foo_SRCS ${ui_files})
-MACRO(KDE3_ADD_UI_FILES _sources )
- FOREACH (_current_FILE ${ARGN})
+macro(KDE3_ADD_UI_FILES _sources )
+ foreach (_current_FILE ${ARGN})
- GET_FILENAME_COMPONENT(_tmp_FILE ${_current_FILE} ABSOLUTE)
+ get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
- GET_FILENAME_COMPONENT(_basename ${_tmp_FILE} NAME_WE)
- SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
- SET(_src ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
- SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc.cpp)
+ get_filename_component(_basename ${_tmp_FILE} NAME_WE)
+ set(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
+ set(_src ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
+ set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc.cpp)
- ADD_CUSTOM_COMMAND(OUTPUT ${_header}
+ add_custom_command(OUTPUT ${_header}
COMMAND ${QT_UIC_EXECUTABLE}
ARGS -L ${KDE3_LIB_DIR}/kde3/plugins/designer -nounload -o ${_header} ${CMAKE_CURRENT_SOURCE_DIR}/${_current_FILE}
DEPENDS ${_tmp_FILE}
)
- ADD_CUSTOM_COMMAND(OUTPUT ${_src}
+ add_custom_command(OUTPUT ${_src}
COMMAND ${CMAKE_COMMAND}
ARGS
-DKDE_UIC_PLUGIN_DIR:FILEPATH=${KDE3_LIB_DIR}/kde3/plugins/designer
@@ -194,23 +194,23 @@ MACRO(KDE3_ADD_UI_FILES _sources )
DEPENDS ${_header}
)
- ADD_CUSTOM_COMMAND(OUTPUT ${_moc}
+ add_custom_command(OUTPUT ${_moc}
COMMAND ${QT_MOC_EXECUTABLE}
ARGS ${_header} -o ${_moc}
DEPENDS ${_header}
)
- SET(${_sources} ${${_sources}} ${_src} ${_moc} )
+ set(${_sources} ${${_sources}} ${_src} ${_moc} )
- ENDFOREACH (_current_FILE)
-ENDMACRO(KDE3_ADD_UI_FILES)
+ endforeach ()
+endmacro()
-MACRO(KDE3_AUTOMOC)
- SET(_matching_FILES )
- FOREACH (_current_FILE ${ARGN})
+macro(KDE3_AUTOMOC)
+ set(_matching_FILES )
+ foreach (_current_FILE ${ARGN})
- GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
+ get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
# if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
# here. this is required to make bouic work correctly:
@@ -219,193 +219,192 @@ MACRO(KDE3_AUTOMOC)
# cmake is run for the very first time on them -> however the .cpp files might
# exist at a later run. at that time we need to skip them, so that we don't add two
# different rules for the same moc file
- GET_SOURCE_FILE_PROPERTY(_skip ${_abs_FILE} SKIP_AUTOMOC)
+ get_source_file_property(_skip ${_abs_FILE} SKIP_AUTOMOC)
- IF (EXISTS ${_abs_FILE} AND NOT _skip)
+ if (EXISTS ${_abs_FILE} AND NOT _skip)
- FILE(READ ${_abs_FILE} _contents)
+ file(STRINGS ${_abs_FILE} _match REGEX "#include +[^ ]+\\.moc[\">]")
- GET_FILENAME_COMPONENT(_abs_PATH ${_abs_FILE} PATH)
+ get_filename_component(_abs_PATH ${_abs_FILE} PATH)
- STRING(REGEX MATCHALL "#include +[^ ]+\\.moc[\">]" _match "${_contents}")
- IF(_match)
- FOREACH (_current_MOC_INC ${_match})
- STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
+ foreach (_current_MOC_INC IN LISTS _match)
+ string(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
- GET_FILENAME_COMPONENT(_basename ${_current_MOC} NAME_WE)
-# SET(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h)
- SET(_header ${_abs_PATH}/${_basename}.h)
- SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
+ get_filename_component(_basename ${_current_MOC} NAME_WE)
+# set(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h)
+ set(_header ${_abs_PATH}/${_basename}.h)
+ set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
- ADD_CUSTOM_COMMAND(OUTPUT ${_moc}
- COMMAND ${QT_MOC_EXECUTABLE}
- ARGS ${_header} -o ${_moc}
- DEPENDS ${_header}
- )
+ add_custom_command(OUTPUT ${_moc}
+ COMMAND ${QT_MOC_EXECUTABLE}
+ ARGS ${_header} -o ${_moc}
+ DEPENDS ${_header}
+ )
- ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
+ ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
- ENDFOREACH (_current_MOC_INC)
- ENDIF(_match)
-
- ENDIF (EXISTS ${_abs_FILE} AND NOT _skip)
- ENDFOREACH (_current_FILE)
-ENDMACRO(KDE3_AUTOMOC)
+ endforeach ()
+ unset(_match)
+ unset(_header)
+ unset(_moc)
+ endif ()
+ endforeach ()
+endmacro()
# only used internally by KDE3_INSTALL_ICONS
-MACRO (_KDE3_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME)
+macro (_KDE3_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME)
# if the string doesn't match the pattern, the result is the full string, so all three have the same content
- IF (NOT ${_group} STREQUAL ${_install_NAME} )
- SET(_icon_GROUP "actions")
+ if (NOT ${_group} STREQUAL ${_install_NAME} )
+ set(_icon_GROUP "actions")
- IF (${_group} STREQUAL "mime")
- SET(_icon_GROUP "mimetypes")
- ENDIF (${_group} STREQUAL "mime")
+ if (${_group} STREQUAL "mime")
+ set(_icon_GROUP "mimetypes")
+ endif ()
- IF (${_group} STREQUAL "filesys")
- SET(_icon_GROUP "filesystems")
- ENDIF (${_group} STREQUAL "filesys")
+ if (${_group} STREQUAL "filesys")
+ set(_icon_GROUP "filesystems")
+ endif ()
- IF (${_group} STREQUAL "device")
- SET(_icon_GROUP "devices")
- ENDIF (${_group} STREQUAL "device")
+ if (${_group} STREQUAL "device")
+ set(_icon_GROUP "devices")
+ endif ()
- IF (${_group} STREQUAL "app")
- SET(_icon_GROUP "apps")
- ENDIF (${_group} STREQUAL "app")
+ if (${_group} STREQUAL "app")
+ set(_icon_GROUP "apps")
+ endif ()
- IF (${_group} STREQUAL "action")
- SET(_icon_GROUP "actions")
- ENDIF (${_group} STREQUAL "action")
+ if (${_group} STREQUAL "action")
+ set(_icon_GROUP "actions")
+ endif ()
# message(STATUS "icon: ${_current_ICON} size: ${_size} group: ${_group} name: ${_name}" )
- INSTALL(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/ RENAME ${_install_NAME} )
- ENDIF (NOT ${_group} STREQUAL ${_install_NAME} )
+ install(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/ RENAME ${_install_NAME} )
+ endif ()
-ENDMACRO (_KDE3_ADD_ICON_INSTALL_RULE)
+endmacro ()
-MACRO (KDE3_INSTALL_ICONS _theme )
- SET(_defaultpath "${CMAKE_INSTALL_PREFIX}/share/icons")
+macro (KDE3_INSTALL_ICONS _theme )
+ set(_defaultpath "${CMAKE_INSTALL_PREFIX}/share/icons")
# first the png icons
- FILE(GLOB _icons *.png)
- FOREACH (_current_ICON ${_icons} )
- STRING(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\1" _size "${_current_ICON}")
- STRING(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\2" _group "${_current_ICON}")
- STRING(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\3" _name "${_current_ICON}")
+ file(GLOB _icons *.png)
+ foreach (_current_ICON ${_icons} )
+ string(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\1" _size "${_current_ICON}")
+ string(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\2" _group "${_current_ICON}")
+ string(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\3" _name "${_current_ICON}")
_KDE3_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
${_defaultpath}/${_theme}/${_size}x${_size}
${_group} ${_current_ICON} ${_name})
- ENDFOREACH (_current_ICON)
+ endforeach ()
# and now the svg icons
- FILE(GLOB _icons *.svgz)
- FOREACH (_current_ICON ${_icons} )
- STRING(REGEX REPLACE "^.*/crsc\\-([a-z]+)\\-(.+\\.svgz)$" "\\1" _group "${_current_ICON}")
- STRING(REGEX REPLACE "^.*/crsc\\-([a-z]+)\\-(.+\\.svgz)$" "\\2" _name "${_current_ICON}")
+ file(GLOB _icons *.svgz)
+ foreach (_current_ICON ${_icons} )
+ string(REGEX REPLACE "^.*/crsc\\-([a-z]+)\\-(.+\\.svgz)$" "\\1" _group "${_current_ICON}")
+ string(REGEX REPLACE "^.*/crsc\\-([a-z]+)\\-(.+\\.svgz)$" "\\2" _name "${_current_ICON}")
_KDE3_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
${_defaultpath}/${_theme}/scalable
${_group} ${_current_ICON} ${_name})
- ENDFOREACH (_current_ICON)
+ endforeach ()
-ENDMACRO (KDE3_INSTALL_ICONS)
+endmacro ()
-MACRO(KDE3_INSTALL_LIBTOOL_FILE _target)
- GET_TARGET_PROPERTY(_target_location ${_target} LOCATION)
+macro(KDE3_INSTALL_LIBTOOL_FILE _target)
+ get_target_property(_target_location ${_target} LOCATION)
- GET_FILENAME_COMPONENT(_laname ${_target_location} NAME_WE)
- GET_FILENAME_COMPONENT(_soname ${_target_location} NAME)
- SET(_laname ${CMAKE_CURRENT_BINARY_DIR}/${_laname}.la)
+ get_filename_component(_laname ${_target_location} NAME_WE)
+ get_filename_component(_soname ${_target_location} NAME)
+ set(_laname ${CMAKE_CURRENT_BINARY_DIR}/${_laname}.la)
- FILE(WRITE ${_laname} "# ${_laname} - a libtool library file, generated by cmake \n")
- FILE(APPEND ${_laname} "# The name that we can dlopen(3).\n")
- FILE(APPEND ${_laname} "dlname='${_soname}'\n")
- FILE(APPEND ${_laname} "# Names of this library\n")
- IF(CYGWIN)
- FILE(APPEND ${_laname} "library_names='${_soname}'\n")
- ELSE(CYGWIN)
- FILE(APPEND ${_laname} "library_names='${_soname} ${_soname} ${_soname}'\n")
- ENDIF(CYGWIN)
- FILE(APPEND ${_laname} "# The name of the static archive\n")
- FILE(APPEND ${_laname} "old_library=''\n")
- FILE(APPEND ${_laname} "# Libraries that this one depends upon.\n")
- FILE(APPEND ${_laname} "dependency_libs=''\n")
-# FILE(APPEND ${_laname} "dependency_libs='${${_target}_LIB_DEPENDS}'\n")
- FILE(APPEND ${_laname} "# Version information.\ncurrent=0\nage=0\nrevision=0\n")
- FILE(APPEND ${_laname} "# Is this an already installed library?\ninstalled=yes\n")
- FILE(APPEND ${_laname} "# Should we warn about portability when linking against -modules?\nshouldnotlink=yes\n")
- FILE(APPEND ${_laname} "# Files to dlopen/dlpreopen\ndlopen=''\ndlpreopen=''\n")
- FILE(APPEND ${_laname} "# Directory that this library needs to be installed in:\n")
- FILE(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/lib/kde3'\n")
+ file(WRITE ${_laname} "# ${_laname} - a libtool library file, generated by cmake \n")
+ file(APPEND ${_laname} "# The name that we can dlopen(3).\n")
+ file(APPEND ${_laname} "dlname='${_soname}'\n")
+ file(APPEND ${_laname} "# Names of this library\n")
+ if(CYGWIN)
+ file(APPEND ${_laname} "library_names='${_soname}'\n")
+ else()
+ file(APPEND ${_laname} "library_names='${_soname} ${_soname} ${_soname}'\n")
+ endif()
+ file(APPEND ${_laname} "# The name of the static archive\n")
+ file(APPEND ${_laname} "old_library=''\n")
+ file(APPEND ${_laname} "# Libraries that this one depends upon.\n")
+ file(APPEND ${_laname} "dependency_libs=''\n")
+# file(APPEND ${_laname} "dependency_libs='${${_target}_LIB_DEPENDS}'\n")
+ file(APPEND ${_laname} "# Version information.\ncurrent=0\nage=0\nrevision=0\n")
+ file(APPEND ${_laname} "# Is this an already installed library?\ninstalled=yes\n")
+ file(APPEND ${_laname} "# Should we warn about portability when linking against -modules?\nshouldnotlink=yes\n")
+ file(APPEND ${_laname} "# Files to dlopen/dlpreopen\ndlopen=''\ndlpreopen=''\n")
+ file(APPEND ${_laname} "# Directory that this library needs to be installed in:\n")
+ file(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/lib/kde3'\n")
- INSTALL_FILES(${KDE3_LIBTOOL_DIR} FILES ${_laname})
-ENDMACRO(KDE3_INSTALL_LIBTOOL_FILE)
+ install_files(${KDE3_LIBTOOL_DIR} FILES ${_laname})
+endmacro()
-MACRO(KDE3_CREATE_FINAL_FILE _filename)
- FILE(WRITE ${_filename} "//autogenerated file\n")
- FOREACH (_current_FILE ${ARGN})
- FILE(APPEND ${_filename} "#include \"${_current_FILE}\"\n")
- ENDFOREACH (_current_FILE)
+macro(KDE3_CREATE_FINAL_FILE _filename)
+ file(WRITE ${_filename} "//autogenerated file\n")
+ foreach (_current_FILE ${ARGN})
+ file(APPEND ${_filename} "#include \"${_current_FILE}\"\n")
+ endforeach ()
-ENDMACRO(KDE3_CREATE_FINAL_FILE)
+endmacro()
-# OPTION(KDE3_ENABLE_FINAL "Enable final all-in-one compilation")
-OPTION(KDE3_BUILD_TESTS "Build the tests")
+# option(KDE3_ENABLE_FINAL "Enable final all-in-one compilation")
+option(KDE3_BUILD_TESTS "Build the tests")
-MACRO(KDE3_ADD_KPART _target_NAME _with_PREFIX)
+macro(KDE3_ADD_KPART _target_NAME _with_PREFIX)
#is the first argument is "WITH_PREFIX" then keep the standard "lib" prefix, otherwise SET the prefix empty
- IF (${_with_PREFIX} STREQUAL "WITH_PREFIX")
- SET(_first_SRC)
- ELSE (${_with_PREFIX} STREQUAL "WITH_PREFIX")
- SET(_first_SRC ${_with_PREFIX})
- ENDIF (${_with_PREFIX} STREQUAL "WITH_PREFIX")
+ if (${_with_PREFIX} STREQUAL "WITH_PREFIX")
+ set(_first_SRC)
+ else ()
+ set(_first_SRC ${_with_PREFIX})
+ endif ()
-# IF (KDE3_ENABLE_FINAL)
+# if (KDE3_ENABLE_FINAL)
# KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${_first_SRC} ${ARGN})
-# ADD_LIBRARY(${_target_NAME} MODULE ${_target_NAME}_final.cpp)
-# ELSE (KDE3_ENABLE_FINAL)
- ADD_LIBRARY(${_target_NAME} MODULE ${_first_SRC} ${ARGN})
-# ENDIF (KDE3_ENABLE_FINAL)
+# add_library(${_target_NAME} MODULE ${_target_NAME}_final.cpp)
+# else ()
+ add_library(${_target_NAME} MODULE ${_first_SRC} ${ARGN})
+# endif ()
- IF(_first_SRC)
- SET_TARGET_PROPERTIES(${_target_NAME} PROPERTIES PREFIX "")
- ENDIF(_first_SRC)
+ if(_first_SRC)
+ set_target_properties(${_target_NAME} PROPERTIES PREFIX "")
+ endif()
KDE3_INSTALL_LIBTOOL_FILE(${_target_NAME})
-ENDMACRO(KDE3_ADD_KPART)
+endmacro()
-MACRO(KDE3_ADD_KDEINIT_EXECUTABLE _target_NAME )
+macro(KDE3_ADD_KDEINIT_EXECUTABLE _target_NAME )
-# IF (KDE3_ENABLE_FINAL)
+# if (KDE3_ENABLE_FINAL)
# KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${ARGN})
-# ADD_LIBRARY(kdeinit_${_target_NAME} SHARED ${_target_NAME}_final.cpp)
-# ELSE (KDE3_ENABLE_FINAL)
- ADD_LIBRARY(kdeinit_${_target_NAME} SHARED ${ARGN} )
-# ENDIF (KDE3_ENABLE_FINAL)
+# add_library(kdeinit_${_target_NAME} SHARED ${_target_NAME}_final.cpp)
+# else ()
+ add_library(kdeinit_${_target_NAME} SHARED ${ARGN} )
+# endif ()
- CONFIGURE_FILE(${KDE3_MODULE_DIR}/kde3init_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp)
+ configure_file(${KDE3_MODULE_DIR}/kde3init_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp)
- ADD_EXECUTABLE( ${_target_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp )
- TARGET_LINK_LIBRARIES( ${_target_NAME} kdeinit_${_target_NAME} )
+ add_executable( ${_target_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp )
+ target_link_libraries( ${_target_NAME} kdeinit_${_target_NAME} )
-ENDMACRO(KDE3_ADD_KDEINIT_EXECUTABLE)
+endmacro()
-MACRO(KDE3_ADD_EXECUTABLE _target_NAME )
+macro(KDE3_ADD_EXECUTABLE _target_NAME )
-# IF (KDE3_ENABLE_FINAL)
+# if (KDE3_ENABLE_FINAL)
# KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${ARGN})
-# ADD_EXECUTABLE(${_target_NAME} ${_target_NAME}_final.cpp)
-# ELSE (KDE3_ENABLE_FINAL)
- ADD_EXECUTABLE(${_target_NAME} ${ARGN} )
-# ENDIF (KDE3_ENABLE_FINAL)
+# add_executable(${_target_NAME} ${_target_NAME}_final.cpp)
+# else ()
+ add_executable(${_target_NAME} ${ARGN} )
+# endif ()
-ENDMACRO(KDE3_ADD_EXECUTABLE)
+endmacro()
diff --git a/Modules/MacroAddFileDependencies.cmake b/Modules/MacroAddFileDependencies.cmake
index 527447b80..d0605a114 100644
--- a/Modules/MacroAddFileDependencies.cmake
+++ b/Modules/MacroAddFileDependencies.cmake
@@ -2,9 +2,9 @@
# Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged. There are usually
# better ways to specify the correct dependencies.
#
-# MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a convenience
+# MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a convenience
# wrapper around the OBJECT_DEPENDS source file property. You can just
-# use SET_PROPERTY(SOURCE <file> APPEND PROPERTY OBJECT_DEPENDS depend_files) instead.
+# use set_property(SOURCE <file> APPEND PROPERTY OBJECT_DEPENDS depend_files) instead.
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
@@ -19,15 +19,15 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-MACRO (MACRO_ADD_FILE_DEPENDENCIES _file)
+macro (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 (MACRO_ADD_FILE_DEPENDENCIES)
+endmacro ()
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
index 43f72f6aa..ffc425e67 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -37,7 +37,7 @@
;Set compression
SetCompressor @CPACK_NSIS_COMPRESSOR@
-@CPACK_NSIS_DEFINES@
+@CPACK_NSIS_DEFINES@
!include Sections.nsh
@@ -71,7 +71,7 @@ Var AR_RegFlags
; This macro reads component installed flag from the registry and
;changes checked state of the section on the components page.
;Input: section index constant name specified in Section command.
-
+
ClearErrors
;Reading component status from registry
ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" "Installed"
@@ -86,20 +86,20 @@ Var AR_RegFlags
; Note whether this component was installed before
!insertmacro StoreVar ${SecName}_was_installed $AR_RegFlags
IntOp $R0 $AR_RegFlags & $AR_RegFlags
-
+
;Writing modified flags
SectionSetFlags ${${SecName}} $AR_SecFlags
-
+
"default_${SecName}:"
!insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected
!macroend
-
+
!macro FinishSection SecName
; This macro reads section flag set by user and removes the section
;if it is not selected.
;Then it writes component installed flag to registry
;Input: section index constant name specified in Section command.
-
+
SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading section flags
;Checking lowest bit:
IntOp $AR_SecFlags $AR_SecFlags & ${SF_SELECTED}
@@ -110,20 +110,20 @@ Var AR_RegFlags
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" \
"Installed" 0
Goto "exit_${SecName}"
-
+
"leave_${SecName}:"
;Section is selected:
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" \
"Installed" 1
-
+
"exit_${SecName}:"
!macroend
-
+
!macro RemoveSection SecName
; This macro is used to call section's Remove_... macro
;from the uninstaller.
;Input: section index constant name specified in Section command.
-
+
!insertmacro "Remove_${${SecName}}"
!macroend
@@ -132,18 +132,18 @@ Var AR_RegFlags
!insertmacro LoadVar ${SecName}_selected
SectionGetFlags ${${SecName}} $R1
IntOp $R1 $R1 & ${SF_SELECTED} ;Turn off all other bits
-
+
; See if the status has changed:
IntCmp $R0 $R1 "${SecName}_unchanged"
!insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected
-
+
IntCmp $R1 ${SF_SELECTED} "${SecName}_was_selected"
!insertmacro "Deselect_required_by_${SecName}"
goto "${SecName}_unchanged"
-
+
"${SecName}_was_selected:"
!insertmacro "Select_${SecName}_depends"
-
+
"${SecName}_unchanged:"
!macroend
;--- End of Add/Remove macros ---
@@ -153,7 +153,7 @@ Var AR_RegFlags
!define MUI_HEADERIMAGE
!define MUI_ABORTWARNING
-
+
;--------------------------------
; path functions
@@ -168,7 +168,7 @@ Var AR_RegFlags
!include "WinMessages.NSH"
!verbose 4
;====================================================
-; get_NT_environment
+; get_NT_environment
; Returns: the selected environment
; Output : head of the stack
;====================================================
@@ -198,22 +198,22 @@ FunctionEnd
!define WriteEnvStr_RegKey 'HKCU "Environment"'
!endif
!endif
-
+
; AddToPath - Adds the given dir to the search path.
; Input - head of the stack
; Note - Win9x systems requires reboot
-
+
Function AddToPath
Exch $0
Push $1
Push $2
Push $3
-
+
# don't add if the path doesn't exist
IfFileExists "$0\*.*" "" AddToPath_done
-
+
ReadEnvStr $1 PATH
- ; if the path is too long for a NSIS variable NSIS will return a 0
+ ; if the path is too long for a NSIS variable NSIS will return a 0
; length string. If we find that, then warn and skip any path
; modification as it will trash the existing path.
StrLen $2 $1
@@ -243,7 +243,7 @@ Function AddToPath
Call StrStr
Pop $2
StrCmp $2 "" "" AddToPath_done
-
+
Call IsNT
Pop $1
StrCmp $1 1 AddToPath_NT
@@ -258,7 +258,7 @@ Function AddToPath
FileClose $1
SetRebootFlag true
Goto AddToPath_done
-
+
AddToPath_NT:
StrCmp $ADD_TO_PATH_ALL_USERS "1" ReadAllKey
ReadRegStr $1 ${NT_current_env} "PATH"
@@ -279,7 +279,7 @@ Function AddToPath
WriteRegExpandStr ${NT_all_env} "PATH" $0
DoSend:
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-
+
AddToPath_done:
Pop $3
Pop $2
@@ -287,10 +287,10 @@ Function AddToPath
Pop $0
FunctionEnd
-
+
; RemoveFromPath - Remove a given dir from the path
; Input: head of the stack
-
+
Function un.RemoveFromPath
Exch $0
Push $1
@@ -299,9 +299,9 @@ Function un.RemoveFromPath
Push $4
Push $5
Push $6
-
+
IntFmt $6 "%c" 26 # DOS EOF
-
+
Call un.IsNT
Pop $1
StrCmp $1 1 unRemoveFromPath_NT
@@ -313,7 +313,7 @@ Function un.RemoveFromPath
GetFullPathName /SHORT $0 $0
StrCpy $0 "SET PATH=%PATH%;$0"
Goto unRemoveFromPath_dosLoop
-
+
unRemoveFromPath_dosLoop:
FileRead $1 $3
StrCpy $5 $3 1 -1 # read last char
@@ -328,7 +328,7 @@ Function un.RemoveFromPath
unRemoveFromPath_dosLoopRemoveLine:
SetRebootFlag true
Goto unRemoveFromPath_dosLoop
-
+
unRemoveFromPath_dosLoopEnd:
FileClose $2
FileClose $1
@@ -337,7 +337,7 @@ Function un.RemoveFromPath
CopyFiles /SILENT $4 "$1\autoexec.bat"
Delete $4
Goto unRemoveFromPath_done
-
+
unRemoveFromPath_NT:
StrCmp $ADD_TO_PATH_ALL_USERS "1" unReadAllKey
ReadRegStr $1 ${NT_current_env} "PATH"
@@ -361,11 +361,11 @@ Function un.RemoveFromPath
StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
StrCpy $3 $5$6
-
+
StrCpy $5 $3 1 -1 # copy last char
StrCmp $5 ";" 0 +2 # if last char == ;
StrCpy $3 $3 -1 # remove last char
-
+
StrCmp $ADD_TO_PATH_ALL_USERS "1" unWriteAllKey
WriteRegExpandStr ${NT_current_env} "PATH" $3
Goto unDoSend
@@ -373,7 +373,7 @@ Function un.RemoveFromPath
WriteRegExpandStr ${NT_all_env} "PATH" $3
unDoSend:
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-
+
unRemoveFromPath_done:
Pop $6
Pop $5
@@ -383,7 +383,7 @@ Function un.RemoveFromPath
Pop $1
Pop $0
FunctionEnd
-
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Uninstall sutff
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -391,7 +391,7 @@ FunctionEnd
###########################################
# Utility Functions #
###########################################
-
+
;====================================================
; IsNT - Returns 1 if the current system is NT, 0
; otherwise.
@@ -405,7 +405,7 @@ FunctionEnd
; Call IsNT
; Pop $R0
; ($R0 at this point is 1 or 0)
-
+
!macro IsNT un
Function ${un}IsNT
Push $0
@@ -415,7 +415,7 @@ Function ${un}IsNT
Pop $0
Push 0
Return
-
+
IsNT_yes:
; NT!!!
Pop $0
@@ -424,7 +424,7 @@ FunctionEnd
!macroend
!insertmacro IsNT ""
!insertmacro IsNT "un."
-
+
; StrStr
; input, top of stack = string to search for
; top of stack-1 = string to search in
@@ -437,7 +437,7 @@ FunctionEnd
; Call StrStr
; Pop $R0
; ($R0 at this point is "ass string")
-
+
!macro StrStr un
Function ${un}StrStr
Exch $R1 ; st=haystack,old$R1, $R1=needle
@@ -481,7 +481,7 @@ Loop:
StrCmp "$R2" "$\r" RTrim
StrCmp "$R2" ";" RTrim
GoTo Done
-RTrim:
+RTrim:
StrCpy $R1 "$R1" -1
Goto Loop
Done:
@@ -516,7 +516,7 @@ Function DownloadFile
try_again:
NSISdl::download "$1/$0" "$INSTDIR\$0"
-
+
Pop $1
StrCmp $1 "success" success
StrCmp $1 "Cancelled" cancel
@@ -549,10 +549,10 @@ FunctionEnd
!insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@"
Page custom InstallOptionsPage
!insertmacro MUI_PAGE_DIRECTORY
-
+
;Start Menu Folder Page Configuration
- !define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX"
- !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
+ !define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX"
+ !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
@@ -639,10 +639,10 @@ Section "-Core installation"
SetOutPath "$INSTDIR"
@CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS@
@CPACK_NSIS_FULL_INSTALL@
-
+
;Store installation folder
WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "" $INSTDIR
-
+
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
Push "DisplayName"
@@ -660,7 +660,7 @@ Section "-Core installation"
Push "NoRepair"
Push "1"
Call ConditionalAddToRegisty
-
+
!ifdef CPACK_NSIS_ADD_REMOVE
;Create add/remove functionality
Push "ModifyPath"
@@ -671,7 +671,7 @@ Section "-Core installation"
Push "1"
Call ConditionalAddToRegisty
!endif
-
+
; Optional registration
Push "DisplayIcon"
Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@"
@@ -687,7 +687,7 @@ Section "-Core installation"
Call ConditionalAddToRegisty
!insertmacro MUI_INSTALLOPTIONS_READ $INSTALL_DESKTOP "NSIS.InstallOptions.ini" "Field 5" "State"
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
-
+
;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
@CPACK_NSIS_CREATE_ICONS@
@@ -725,7 +725,7 @@ SectionEnd
Section "-Add to path"
Push $INSTDIR\bin
StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 doNotAddToPath
- StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0
+ StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0
Call AddToPath
doNotAddToPath:
SectionEnd
@@ -756,12 +756,12 @@ Function un.onInit
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Power Users group'
Goto done
-
+
noLM:
;Get installation folder from registry if available
done:
-
+
FunctionEnd
;--- Add/Remove callback functions: ---
@@ -770,25 +770,25 @@ FunctionEnd
;List all of your components in following manner here.
@CPACK_NSIS_COMPONENT_SECTION_LIST@
!macroend
-
+
Section -FinishComponents
;Removes unselected components and writes component status to registry
!insertmacro SectionList "FinishSection"
-
-!ifdef CPACK_NSIS_ADD_REMOVE
+
+!ifdef CPACK_NSIS_ADD_REMOVE
; Get the name of the installer executable
System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1'
StrCpy $R3 $R0
-
+
; Strip off the last 13 characters, to see if we have AddRemove.exe
StrLen $R1 $R0
IntOp $R1 $R0 - 13
StrCpy $R2 $R0 13 $R1
StrCmp $R2 "AddRemove.exe" addremove_installed
-
+
; We're not running AddRemove.exe, so install it
CopyFiles $R3 $INSTDIR\AddRemove.exe
-
+
addremove_installed:
!endif
SectionEnd
@@ -825,7 +825,7 @@ Section "Uninstall"
@CPACK_NSIS_DELETE_FILES@
@CPACK_NSIS_DELETE_DIRECTORIES@
-!ifdef CPACK_NSIS_ADD_REMOVE
+!ifdef CPACK_NSIS_ADD_REMOVE
;Remove the add/remove program
Delete "$INSTDIR\AddRemove.exe"
!endif
@@ -842,23 +842,23 @@ Section "Uninstall"
; Removes all optional components
!insertmacro SectionList "RemoveSection"
-
+
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
-
+
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
@CPACK_NSIS_DELETE_ICONS@
@CPACK_NSIS_DELETE_ICONS_EXTRA@
-
+
;Delete empty start menu parent diretories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
-
+
startMenuDeleteLoop:
ClearErrors
RMDir $MUI_TEMP
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
-
+
IfErrors startMenuDeleteLoopDone
-
+
StrCmp "$MUI_TEMP" "$SMPROGRAMS" startMenuDeleteLoopDone startMenuDeleteLoop
startMenuDeleteLoopDone:
@@ -867,17 +867,17 @@ Section "Uninstall"
StrCpy $MUI_TEMP "$START_MENU"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
@CPACK_NSIS_DELETE_ICONS_EXTRA@
-
+
;Delete empty start menu parent diretories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
-
+
secondStartMenuDeleteLoop:
ClearErrors
RMDir $MUI_TEMP
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
-
+
IfErrors secondStartMenuDeleteLoopDone
-
+
StrCmp "$MUI_TEMP" "$SMPROGRAMS" secondStartMenuDeleteLoopDone secondStartMenuDeleteLoop
secondStartMenuDeleteLoopDone:
@@ -902,7 +902,7 @@ SectionEnd
Function .onInit
StrCmp "@CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL@" "ON" 0 inst
- ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "UninstallString"
+ ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "UninstallString"
StrCmp $0 "" inst
MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \
@@ -925,14 +925,14 @@ inst:
; Reads components status for registry
!insertmacro SectionList "InitSection"
- ; check to see if /D has been used to change
- ; the install directory by comparing it to the
+ ; check to see if /D has been used to change
+ ; the install directory by comparing it to the
; install directory that is expected to be the
; default
StrCpy $IS_DEFAULT_INSTALLDIR 0
StrCmp "$INSTDIR" "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@" 0 +2
StrCpy $IS_DEFAULT_INSTALLDIR 1
-
+
StrCpy $SV_ALLUSERS "JustMe"
; if default install dir then change the default
; if it is installed for JustMe
@@ -955,7 +955,7 @@ inst:
;MessageBox MB_OK 'User "$0" is in the Power Users group'
StrCpy $SV_ALLUSERS "AllUsers"
Goto done
-
+
noLM:
StrCpy $SV_ALLUSERS "AllUsers"
;Get installation folder from registry if available
diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake
index a9f773ed1..58c648319 100644
--- a/Modules/Platform/AIX.cmake
+++ b/Modules/Platform/AIX.cmake
@@ -1,6 +1,6 @@
-SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
-SET(CMAKE_DL_LIBS "-lld")
+set(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
+set(CMAKE_DL_LIBS "-lld")
# RPATH support on AIX is called libpath. By default the runtime
# libpath is paths specified by -L followed by /usr/lib and /lib. In
@@ -8,10 +8,10 @@ SET(CMAKE_DL_LIBS "-lld")
# -Wl,-blibpath:/usr/lib:/lib whether RPATH support is on or not.
# When our own RPATH is to be added it may be inserted before the
# "always" paths.
-SET(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib /lib)
+set(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib /lib)
# Files named "libfoo.a" may actually be shared libraries.
-SET_PROPERTY(GLOBAL PROPERTY TARGET_ARCHIVES_MAY_BE_SHARED_LIBS 1)
+set_property(GLOBAL PROPERTY TARGET_ARCHIVES_MAY_BE_SHARED_LIBS 1)
# since .a can be a static or shared library on AIX, we can not do this.
# at some point if we wanted it, we would have to figure out if a .a is
@@ -21,9 +21,9 @@ SET_PROPERTY(GLOBAL PROPERTY TARGET_ARCHIVES_MAY_BE_SHARED_LIBS 1)
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
-#FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
-# SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-bstatic")
-# SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-bdynamic")
-#ENDFOREACH(type)
+#foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+# set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-bstatic")
+# set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-bdynamic")
+#endforeach()
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/BSDOS.cmake b/Modules/Platform/BSDOS.cmake
index cf9d17bfd..47852f8e1 100644
--- a/Modules/Platform/BSDOS.cmake
+++ b/Modules/Platform/BSDOS.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/BeOS.cmake b/Modules/Platform/BeOS.cmake
index 3ffb67cb8..ef811bd9c 100644
--- a/Modules/Platform/BeOS.cmake
+++ b/Modules/Platform/BeOS.cmake
@@ -1,12 +1,12 @@
-SET(BEOS 1)
+set(BEOS 1)
-SET(CMAKE_DL_LIBS root be)
-SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
-SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-nostart")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+set(CMAKE_DL_LIBS root be)
+set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
+set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-nostart")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/BlueGeneL.cmake b/Modules/Platform/BlueGeneL.cmake
index 7794a26cf..082e46cae 100644
--- a/Modules/Platform/BlueGeneL.cmake
+++ b/Modules/Platform/BlueGeneL.cmake
@@ -1,40 +1,40 @@
-#the compute nodes on BlueGene/L don't support shared libs
-SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+#the compute nodes on BlueGene/L don't support shared libs
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "") # -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_SHARED_LIBRARY_C_FLAGS "") # -pic
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "") # -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_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 ".a") # .a
-SET(CMAKE_EXECUTABLE_SUFFIX "") # .exe
-SET(CMAKE_DL_LIBS "" )
+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 ".a") # .a
+set(CMAKE_EXECUTABLE_SUFFIX "") # .exe
+set(CMAKE_DL_LIBS "" )
-SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
-IF(CMAKE_COMPILER_IS_GNUCC)
- SET(CMAKE_C_LINK_EXECUTABLE
+if(CMAKE_COMPILER_IS_GNUCC)
+ set(CMAKE_C_LINK_EXECUTABLE
"<CMAKE_C_COMPILER> -Wl,-relax <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lgcc,-lc -lnss_files -lnss_dns -lresolv")
-ELSE(CMAKE_COMPILER_IS_GNUCC)
+else()
# when using IBM xlc we probably don't want to link to -lgcc
- SET(CMAKE_C_LINK_EXECUTABLE
+ set(CMAKE_C_LINK_EXECUTABLE
"<CMAKE_C_COMPILER> -Wl,-relax <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lc -lnss_files -lnss_dns -lresolv")
-ENDIF(CMAKE_COMPILER_IS_GNUCC)
+endif()
-IF(CMAKE_COMPILER_IS_GNUCXX)
- SET(CMAKE_CXX_LINK_EXECUTABLE
+if(CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_CXX_LINK_EXECUTABLE
"<CMAKE_CXX_COMPILER> -Wl,-relax <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lgcc,-lc -lnss_files -lnss_dns -lresolv")
-ELSE(CMAKE_COMPILER_IS_GNUCXX)
+else()
# when using the IBM xlC we probably don't want to link to -lgcc
- SET(CMAKE_CXX_LINK_EXECUTABLE
+ set(CMAKE_CXX_LINK_EXECUTABLE
"<CMAKE_CXX_COMPILER> -Wl,-relax <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lc -lnss_files -lnss_dns -lresolv")
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+endif()
diff --git a/Modules/Platform/CYGWIN-CXX.cmake b/Modules/Platform/CYGWIN-CXX.cmake
new file mode 100644
index 000000000..bf37f7903
--- /dev/null
+++ b/Modules/Platform/CYGWIN-CXX.cmake
@@ -0,0 +1,7 @@
+if(NOT CMAKE_CXX_COMPILER_NAMES)
+ set(CMAKE_CXX_COMPILER_NAMES c++)
+endif()
+
+# Exclude C++ compilers differing from C compiler only by case
+# because this platform may have a case-insensitive filesystem.
+set(CMAKE_CXX_COMPILER_EXCLUDE CC aCC xlC)
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake
index eae313a50..fe25ab214 100644
--- a/Modules/Platform/CYGWIN-GNU.cmake
+++ b/Modules/Platform/CYGWIN-GNU.cmake
@@ -44,10 +44,10 @@ macro(__cygwin_compiler_gnu lang)
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
- FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
- SET(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Wl,-Bstatic")
- SET(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic")
- ENDFOREACH(type)
+ foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Wl,-Bstatic")
+ set(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic")
+ endforeach()
set(CMAKE_EXE_EXPORTS_${lang}_FLAG "-Wl,--export-all-symbols")
# TODO: Is -Wl,--enable-auto-import now always default?
diff --git a/Modules/Platform/CYGWIN-windres.cmake b/Modules/Platform/CYGWIN-windres.cmake
index 8bc1b15e9..01d6be3df 100644
--- a/Modules/Platform/CYGWIN-windres.cmake
+++ b/Modules/Platform/CYGWIN-windres.cmake
@@ -1 +1 @@
-SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> <SOURCE> <OBJECT>")
+set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> <SOURCE> <OBJECT>")
diff --git a/Modules/Platform/CYGWIN.cmake b/Modules/Platform/CYGWIN.cmake
index b7ad2cee1..22816e77a 100644
--- a/Modules/Platform/CYGWIN.cmake
+++ b/Modules/Platform/CYGWIN.cmake
@@ -43,22 +43,22 @@ if(DEFINED __USE_CMAKE_LEGACY_CYGWIN_WIN32)
unset(__USE_CMAKE_LEGACY_CYGWIN_WIN32)
endif()
-SET(CYGWIN 1)
+set(CYGWIN 1)
-SET(CMAKE_SHARED_LIBRARY_PREFIX "cyg")
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
-SET(CMAKE_SHARED_MODULE_PREFIX "cyg")
-SET(CMAKE_SHARED_MODULE_SUFFIX ".dll")
-SET(CMAKE_IMPORT_LIBRARY_PREFIX "lib")
-SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a")
-SET(CMAKE_EXECUTABLE_SUFFIX ".exe") # .exe
+set(CMAKE_SHARED_LIBRARY_PREFIX "cyg")
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
+set(CMAKE_SHARED_MODULE_PREFIX "cyg")
+set(CMAKE_SHARED_MODULE_SUFFIX ".dll")
+set(CMAKE_IMPORT_LIBRARY_PREFIX "lib")
+set(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a")
+set(CMAKE_EXECUTABLE_SUFFIX ".exe") # .exe
# Modules have a different default prefix that shared libs.
-SET(CMAKE_MODULE_EXISTS 1)
+set(CMAKE_MODULE_EXISTS 1)
-SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a")
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a")
# Shared libraries on cygwin can be named with their version number.
-SET(CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION 1)
+set(CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION 1)
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/Catamount.cmake b/Modules/Platform/Catamount.cmake
index 01493fc21..7e9e02171 100644
--- a/Modules/Platform/Catamount.cmake
+++ b/Modules/Platform/Catamount.cmake
@@ -1,26 +1,26 @@
-#Catamount, which runs on the compute nodes of Cray machines, e.g. RedStorm, doesn't support shared libs
-SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+#Catamount, which runs on the compute nodes of Cray machines, e.g. RedStorm, doesn't support shared libs
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "") # -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_SHARED_LIBRARY_C_FLAGS "") # -pic
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "") # -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_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 ".a") # .a
-SET(CMAKE_EXECUTABLE_SUFFIX "") # .exe
-SET(CMAKE_DL_LIBS "" )
+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 ".a") # .a
+set(CMAKE_EXECUTABLE_SUFFIX "") # .exe
+set(CMAKE_DL_LIBS "" )
-SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
-SET(CMAKE_CXX_LINK_SHARED_LIBRARY)
-SET(CMAKE_CXX_LINK_MODULE_LIBRARY)
-SET(CMAKE_C_LINK_SHARED_LIBRARY)
-SET(CMAKE_C_LINK_MODULE_LIBRARY)
+set(CMAKE_CXX_LINK_SHARED_LIBRARY)
+set(CMAKE_CXX_LINK_MODULE_LIBRARY)
+set(CMAKE_C_LINK_SHARED_LIBRARY)
+set(CMAKE_C_LINK_MODULE_LIBRARY)
diff --git a/Modules/Platform/Darwin-CXX.cmake b/Modules/Platform/Darwin-CXX.cmake
new file mode 100644
index 000000000..bf37f7903
--- /dev/null
+++ b/Modules/Platform/Darwin-CXX.cmake
@@ -0,0 +1,7 @@
+if(NOT CMAKE_CXX_COMPILER_NAMES)
+ set(CMAKE_CXX_COMPILER_NAMES c++)
+endif()
+
+# Exclude C++ compilers differing from C compiler only by case
+# because this platform may have a case-insensitive filesystem.
+set(CMAKE_CXX_COMPILER_EXCLUDE CC aCC xlC)
diff --git a/Modules/Platform/Darwin-Clang-C.cmake b/Modules/Platform/Darwin-Clang-C.cmake
new file mode 100644
index 000000000..0a1502ea9
--- /dev/null
+++ b/Modules/Platform/Darwin-Clang-C.cmake
@@ -0,0 +1,2 @@
+include(Platform/Darwin-Clang)
+__darwin_compiler_clang(C)
diff --git a/Modules/Platform/Darwin-Clang-CXX.cmake b/Modules/Platform/Darwin-Clang-CXX.cmake
new file mode 100644
index 000000000..f8e8d888e
--- /dev/null
+++ b/Modules/Platform/Darwin-Clang-CXX.cmake
@@ -0,0 +1,2 @@
+include(Platform/Darwin-Clang)
+__darwin_compiler_clang(CXX)
diff --git a/Modules/Platform/Darwin-Clang.cmake b/Modules/Platform/Darwin-Clang.cmake
new file mode 100644
index 000000000..de7a85636
--- /dev/null
+++ b/Modules/Platform/Darwin-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(__DARWIN_COMPILER_CLANG)
+ return()
+endif()
+set(__DARWIN_COMPILER_CLANG 1)
+
+macro(__darwin_compiler_clang lang)
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
+ set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -Wl,-headerpad_max_install_names")
+ set(CMAKE_${lang}_SYSROOT_FLAG "-isysroot")
+ set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mmacosx-version-min=")
+endmacro()
diff --git a/Modules/Platform/Darwin-GNU-C.cmake b/Modules/Platform/Darwin-GNU-C.cmake
index 4e326c4ca..efdfd0014 100644
--- a/Modules/Platform/Darwin-GNU-C.cmake
+++ b/Modules/Platform/Darwin-GNU-C.cmake
@@ -1,4 +1,4 @@
include(Platform/Darwin-GNU)
__darwin_compiler_gnu(C)
-cmake_gnu_has_isysroot(C)
+cmake_gnu_set_sysroot_flag(C)
cmake_gnu_set_osx_deployment_target_flag(C)
diff --git a/Modules/Platform/Darwin-GNU-CXX.cmake b/Modules/Platform/Darwin-GNU-CXX.cmake
index b39487e58..e3c2ea7c5 100644
--- a/Modules/Platform/Darwin-GNU-CXX.cmake
+++ b/Modules/Platform/Darwin-GNU-CXX.cmake
@@ -1,4 +1,4 @@
include(Platform/Darwin-GNU)
__darwin_compiler_gnu(CXX)
-cmake_gnu_has_isysroot(CXX)
+cmake_gnu_set_sysroot_flag(CXX)
cmake_gnu_set_osx_deployment_target_flag(CXX)
diff --git a/Modules/Platform/Darwin-GNU.cmake b/Modules/Platform/Darwin-GNU.cmake
index 8a50a6ab9..d9535039f 100644
--- a/Modules/Platform/Darwin-GNU.cmake
+++ b/Modules/Platform/Darwin-GNU.cmake
@@ -24,8 +24,8 @@ macro(__darwin_compiler_gnu lang)
set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -Wl,-headerpad_max_install_names")
endmacro()
-macro(cmake_gnu_has_isysroot lang)
- if("x${CMAKE_${lang}_HAS_ISYSROOT}" STREQUAL "x")
+macro(cmake_gnu_set_sysroot_flag lang)
+ if(NOT DEFINED CMAKE_${lang}_SYSROOT_FLAG)
set(_doc "${lang} compiler has -isysroot")
message(STATUS "Checking whether ${_doc}")
execute_process(
@@ -35,11 +35,12 @@ macro(cmake_gnu_has_isysroot lang)
)
if("${_gcc_help}" MATCHES "isysroot")
message(STATUS "Checking whether ${_doc} - yes")
- set(CMAKE_${lang}_HAS_ISYSROOT 1)
+ set(CMAKE_${lang}_SYSROOT_FLAG "-isysroot")
else()
message(STATUS "Checking whether ${_doc} - no")
- set(CMAKE_${lang}_HAS_ISYSROOT 0)
+ set(CMAKE_${lang}_SYSROOT_FLAG "")
endif()
+ set(CMAKE_${lang}_SYSROOT_FLAG_CODE "set(CMAKE_${lang}_SYSROOT_FLAG \"${CMAKE_${lang}_SYSROOT_FLAG}\")")
endif()
endmacro()
@@ -59,6 +60,6 @@ macro(cmake_gnu_set_osx_deployment_target_flag lang)
message(STATUS "Checking whether ${_doc} - no")
set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "")
endif()
- set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG_CODE "SET(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG \"${CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG}\")")
+ set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG_CODE "set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG \"${CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG}\")")
endif()
endmacro()
diff --git a/Modules/Platform/Darwin-XL-C.cmake b/Modules/Platform/Darwin-XL-C.cmake
index 934ebcc8c..42e94a9d6 100644
--- a/Modules/Platform/Darwin-XL-C.cmake
+++ b/Modules/Platform/Darwin-XL-C.cmake
@@ -1,5 +1,5 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj")
-SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj")
+set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle")
# Enable shared library versioning.
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-install_name")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-install_name")
diff --git a/Modules/Platform/Darwin-XL-CXX.cmake b/Modules/Platform/Darwin-XL-CXX.cmake
index 22ae0183a..65c76f8b7 100644
--- a/Modules/Platform/Darwin-XL-CXX.cmake
+++ b/Modules/Platform/Darwin-XL-CXX.cmake
@@ -1,5 +1,5 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj")
-SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "-bundle")
+set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj")
+set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "-bundle")
# Enable shared library versioning.
-SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-install_name")
+set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-install_name")
diff --git a/Modules/Platform/Darwin-icc.cmake b/Modules/Platform/Darwin-icc.cmake
index b592e5f55..6a46f8e02 100644
--- a/Modules/Platform/Darwin-icc.cmake
+++ b/Modules/Platform/Darwin-icc.cmake
@@ -1,131 +1,131 @@
-SET(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS "" )
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS "")
+set(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS "" )
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS "")
# Setup for Leopard Compatibility
-EXEC_PROGRAM(sw_vers ARGS -productVersion OUTPUT_VARIABLE _OSX_VERSION)
-# MESSAGE (STATUS "_OSX_VERSION: ${_OSX_VERSION}")
-IF ( _OSX_VERSION MATCHES "^10.4" )
- #IF(CMAKE_COMPILER_IS_GNUCC)
- SET (CMAKE_C_FLAGS_INIT "")
- SET (CMAKE_C_FLAGS_DEBUG_INIT "-gdwarf-2")
- SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
- SET (CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
- SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -gdwarf-2")
- SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
- # ENDIF(CMAKE_COMPILER_IS_GNUCC)
-
-# IF(CMAKE_COMPILER_IS_GNUCXX)
- SET (CMAKE_CXX_FLAGS_INIT "")
- SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-gdwarf-2")
- SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
- SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
- SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -gdwarf-2")
- SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
-# ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-ENDIF ( _OSX_VERSION MATCHES "^10.4" )
-
-
-SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
-SET(CMAKE_SHARED_MODULE_PREFIX "lib")
-SET(CMAKE_SHARED_MODULE_SUFFIX ".so")
-SET(CMAKE_MODULE_EXISTS 1)
-SET(CMAKE_DL_LIBS "")
-SET(CMAKE_C_LINK_FLAGS "-Wl,-headerpad_max_install_names")
-SET(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names")
-SET(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
-SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
+exec_program(sw_vers ARGS -productVersion OUTPUT_VARIABLE _OSX_VERSION)
+# message (STATUS "_OSX_VERSION: ${_OSX_VERSION}")
+if ( _OSX_VERSION MATCHES "^10.4" )
+ #if(CMAKE_COMPILER_IS_GNUCC)
+ set (CMAKE_C_FLAGS_INIT "")
+ set (CMAKE_C_FLAGS_DEBUG_INIT "-gdwarf-2")
+ set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
+ set (CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
+ set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -gdwarf-2")
+ set (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ set (CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+ # endif()
+
+# if(CMAKE_COMPILER_IS_GNUCXX)
+ set (CMAKE_CXX_FLAGS_INIT "")
+ set (CMAKE_CXX_FLAGS_DEBUG_INIT "-gdwarf-2")
+ set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
+ set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
+ set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -gdwarf-2")
+ set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ set (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+# endif()
+endif ()
+
+
+set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
+set(CMAKE_SHARED_MODULE_PREFIX "lib")
+set(CMAKE_SHARED_MODULE_SUFFIX ".so")
+set(CMAKE_MODULE_EXISTS 1)
+set(CMAKE_DL_LIBS "")
+set(CMAKE_C_LINK_FLAGS "-Wl,-headerpad_max_install_names")
+set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names")
+set(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
+set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
# setup for universal binaries if sysroot exists
-IF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
+if(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
# set the sysroot to be used if CMAKE_OSX_ARCHITECTURES
# has more than one value
- SET(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk CACHE STRING
+ set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk CACHE STRING
"isysroot used for universal binary support")
# set _CMAKE_OSX_MACHINE to umame -m
- EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE)
+ exec_program(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE)
# check for environment variable CMAKE_OSX_ARCHITECTURES
# if it is set.
- IF(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
- SET(_CMAKE_OSX_MACHINE "$ENV{CMAKE_OSX_ARCHITECTURES}")
- ENDIF(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
+ if(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
+ set(_CMAKE_OSX_MACHINE "$ENV{CMAKE_OSX_ARCHITECTURES}")
+ endif()
# now put _CMAKE_OSX_MACHINE into the cache
- SET(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}
+ set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}
CACHE STRING "Build architectures for OSX")
-ENDIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
+endif()
-IF("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
- SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+if("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
+ set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
"${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress")
-ENDIF("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
+endif()
-IF(NOT XCODE)
+if(NOT XCODE)
# Enable shared library versioning. This flag is not actually referenced
# but the fact that the setting exists will cause the generators to support
# soname computation.
- SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
- SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-install_name")
- SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-install_name")
-ENDIF(NOT XCODE)
+ set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
+ set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-install_name")
+ set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-install_name")
+endif()
# Xcode does not support -isystem yet.
-IF(XCODE)
- SET(CMAKE_INCLUDE_SYSTEM_FLAG_C)
- SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
-ENDIF(XCODE)
+if(XCODE)
+ set(CMAKE_INCLUDE_SYSTEM_FLAG_C)
+ set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+endif()
-SET(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>")
+set(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>")
-SET(CMAKE_C_CREATE_SHARED_LIBRARY
+set(CMAKE_C_CREATE_SHARED_LIBRARY
"<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY
"<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
+set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
"<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_CXX_CREATE_SHARED_MODULE
+set(CMAKE_CXX_CREATE_SHARED_MODULE
"<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_C_CREATE_SHARED_MODULE
+set(CMAKE_C_CREATE_SHARED_MODULE
"<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_Fortran_CREATE_SHARED_MODULE
+set(CMAKE_Fortran_CREATE_SHARED_MODULE
"<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-# We can use $ENV{INTEL_LICENSE_FILE} to try and get at the installation location for ICC.
+# We can use $ENV{INTEL_LICENSE_FILE} to try and get at the installation location for ICC.
# We also need to consider to use cce (which is the 64bit compiler) and not JUST the 32bit compiler.
# I have no idea what the best way to do that would be.
# default to searching for frameworks first
-IF(NOT DEFINED CMAKE_FIND_FRAMEWORK)
- SET(CMAKE_FIND_FRAMEWORK FIRST)
-ENDIF()
+if(NOT DEFINED CMAKE_FIND_FRAMEWORK)
+ set(CMAKE_FIND_FRAMEWORK FIRST)
+endif()
# set up the default search directories for frameworks
-SET(CMAKE_SYSTEM_FRAMEWORK_PATH
+set(CMAKE_SYSTEM_FRAMEWORK_PATH
~/Library/Frameworks
/Library/Frameworks
/Network/Library/Frameworks
/System/Library/Frameworks)
# default to searching for application bundles first
-IF(NOT DEFINED CMAKE_FIND_APPBUNDLE)
- SET(CMAKE_FIND_APPBUNDLE FIRST)
-ENDIF()
+if(NOT DEFINED CMAKE_FIND_APPBUNDLE)
+ set(CMAKE_FIND_APPBUNDLE FIRST)
+endif()
# set up the default search directories for application bundles
-SET(CMAKE_SYSTEM_APPBUNDLE_PATH
+set(CMAKE_SYSTEM_APPBUNDLE_PATH
~/Applications
/Applications
/Developer/Applications)
-INCLUDE(Platform/UnixPaths)
-SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} /sw/include)
-SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} /sw/lib)
+include(Platform/UnixPaths)
+set(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} /sw/include)
+set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} /sw/lib)
diff --git a/Modules/Platform/Darwin-icpc.cmake b/Modules/Platform/Darwin-icpc.cmake
index e247bae28..549feb7f5 100644
--- a/Modules/Platform/Darwin-icpc.cmake
+++ b/Modules/Platform/Darwin-icpc.cmake
@@ -1,3 +1,3 @@
-GET_FILENAME_COMPONENT(CURRENT_SOURCE_PARENT ${CMAKE_CURRENT_LIST_FILE} PATH)
-#MESSAGE (STATUS "CURRENT_SOURCE_PARENT: ${CURRENT_SOURCE_PARENT}")
-INCLUDE ( ${CURRENT_SOURCE_PARENT}/Darwin-icc.cmake)
+get_filename_component(CURRENT_SOURCE_PARENT ${CMAKE_CURRENT_LIST_FILE} PATH)
+#message (STATUS "CURRENT_SOURCE_PARENT: ${CURRENT_SOURCE_PARENT}")
+include ( ${CURRENT_SOURCE_PARENT}/Darwin-icc.cmake)
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index eff07b295..4e7e99ca3 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -1,4 +1,4 @@
-SET(APPLE 1)
+set(APPLE 1)
# Darwin versions:
# 6.x == Mac OSX 10.2 (Jaguar)
@@ -8,261 +8,285 @@ SET(APPLE 1)
# 10.x == Mac OSX 10.6 (Snow Leopard)
# 11.x == Mac OSX 10.7 (Lion)
# 12.x == Mac OSX 10.8 (Mountain Lion)
-STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_SYSTEM_VERSION}")
-STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\2" DARWIN_MINOR_VERSION "${CMAKE_SYSTEM_VERSION}")
+string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_SYSTEM_VERSION}")
+string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\2" DARWIN_MINOR_VERSION "${CMAKE_SYSTEM_VERSION}")
# Do not use the "-Wl,-search_paths_first" flag with the OSX 10.2 compiler.
# Done this way because it is too early to do a TRY_COMPILE.
-IF(NOT DEFINED HAVE_FLAG_SEARCH_PATHS_FIRST)
- SET(HAVE_FLAG_SEARCH_PATHS_FIRST 0)
- IF("${DARWIN_MAJOR_VERSION}" GREATER 6)
- SET(HAVE_FLAG_SEARCH_PATHS_FIRST 1)
- ENDIF("${DARWIN_MAJOR_VERSION}" GREATER 6)
-ENDIF(NOT DEFINED HAVE_FLAG_SEARCH_PATHS_FIRST)
+if(NOT DEFINED HAVE_FLAG_SEARCH_PATHS_FIRST)
+ set(HAVE_FLAG_SEARCH_PATHS_FIRST 0)
+ if("${DARWIN_MAJOR_VERSION}" GREATER 6)
+ set(HAVE_FLAG_SEARCH_PATHS_FIRST 1)
+ endif()
+endif()
# More desirable, but does not work:
- #INCLUDE(CheckCXXCompilerFlag)
+ #include(CheckCXXCompilerFlag)
#CHECK_CXX_COMPILER_FLAG("-Wl,-search_paths_first" HAVE_FLAG_SEARCH_PATHS_FIRST)
-SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
-SET(CMAKE_SHARED_MODULE_PREFIX "lib")
-SET(CMAKE_SHARED_MODULE_SUFFIX ".so")
-SET(CMAKE_MODULE_EXISTS 1)
-SET(CMAKE_DL_LIBS "")
-
-SET(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
-SET(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
-SET(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
-SET(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
-
-SET(CMAKE_C_LINK_FLAGS "-Wl,-headerpad_max_install_names")
-SET(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names")
-
-IF(HAVE_FLAG_SEARCH_PATHS_FIRST)
- SET(CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
- SET(CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
-ENDIF(HAVE_FLAG_SEARCH_PATHS_FIRST)
-
-SET(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
-SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
-SET(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
-SET(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
+set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
+set(CMAKE_SHARED_MODULE_PREFIX "lib")
+set(CMAKE_SHARED_MODULE_SUFFIX ".so")
+set(CMAKE_MODULE_EXISTS 1)
+set(CMAKE_DL_LIBS "")
+
+set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
+set(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
+set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
+set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
+
+set(CMAKE_C_LINK_FLAGS "-Wl,-headerpad_max_install_names")
+set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names")
+
+if(HAVE_FLAG_SEARCH_PATHS_FIRST)
+ set(CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
+ set(CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
+endif()
+
+set(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
+set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
+set(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
+set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
# hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old build tree
# (where install_name_tool was hardcoded) and where CMAKE_INSTALL_NAME_TOOL isn't in the cache
# and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
# hardcode CMAKE_INSTALL_NAME_TOOL here to install_name_tool, so it behaves as it did before, Alex
-IF(NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
- FIND_PROGRAM(CMAKE_INSTALL_NAME_TOOL install_name_tool)
- MARK_AS_ADVANCED(CMAKE_INSTALL_NAME_TOOL)
-ENDIF(NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
-
-# Set the assumed (Pre 10.5 or Default) location of the developer tools
-SET(OSX_DEVELOPER_ROOT "/Developer")
-
-# Use the xcode-select tool if it's available (Xcode >= 3.0 installations)
-FIND_PROGRAM(CMAKE_XCODE_SELECT xcode-select)
-MARK_AS_ADVANCED(CMAKE_XCODE_SELECT)
-IF(CMAKE_XCODE_SELECT)
- EXECUTE_PROCESS(COMMAND ${CMAKE_XCODE_SELECT} "-print-path"
- OUTPUT_VARIABLE OSX_DEVELOPER_ROOT
- OUTPUT_STRIP_TRAILING_WHITESPACE)
-ENDIF(CMAKE_XCODE_SELECT)
-
-# Find installed SDKs
-# Start with Xcode-4.3+ default SDKs directory
-SET(_CMAKE_OSX_SDKS_DIR
- "${OSX_DEVELOPER_ROOT}/Platforms/MacOSX.platform/Developer/SDKs")
-FILE(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*")
-
-# If not present, try pre-4.3 SDKs directory
-IF(NOT _CMAKE_OSX_SDKS)
-SET(_CMAKE_OSX_SDKS_DIR "${OSX_DEVELOPER_ROOT}/SDKs")
- FILE(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*")
-ENDIF(NOT _CMAKE_OSX_SDKS)
-
-EXECUTE_PROCESS(COMMAND sw_vers -productVersion
+if(NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
+ find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool)
+ mark_as_advanced(CMAKE_INSTALL_NAME_TOOL)
+endif()
+
+# Ask xcode-select where to find /Developer or fall back to ancient location.
+execute_process(COMMAND xcode-select -print-path
+ OUTPUT_VARIABLE _stdout
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE _stderr
+ RESULT_VARIABLE _failed)
+if(NOT _failed AND IS_DIRECTORY ${_stdout})
+ set(OSX_DEVELOPER_ROOT ${_stdout})
+elseif(IS_DIRECTORY "/Developer")
+ set(OSX_DEVELOPER_ROOT "/Developer")
+else()
+ set(OSX_DEVELOPER_ROOT "")
+endif()
+
+execute_process(COMMAND sw_vers -productVersion
OUTPUT_VARIABLE CURRENT_OSX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
+# Save CMAKE_OSX_ARCHITECTURES from the environment.
+set(CMAKE_OSX_ARCHITECTURES "$ENV{CMAKE_OSX_ARCHITECTURES}" CACHE STRING
+ "Build architectures for OSX")
+
#----------------------------------------------------------------------------
# _CURRENT_OSX_VERSION - as a two-component string: 10.5, 10.6, ...
#
-STRING(REGEX REPLACE "^([0-9]+\\.[0-9]+).*$" "\\1"
+string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*$" "\\1"
_CURRENT_OSX_VERSION "${CURRENT_OSX_VERSION}")
#----------------------------------------------------------------------------
# CMAKE_OSX_DEPLOYMENT_TARGET
# Set cache variable - end user may change this during ccmake or cmake-gui configure.
-IF(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
- SET(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING
+if(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING
"Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
-ENDIF(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
+endif()
#----------------------------------------------------------------------------
# CMAKE_OSX_SYSROOT
-# Environment variable set by the user overrides our default.
-# Use the same environment variable that Xcode uses.
-SET(ENV_SDKROOT "$ENV{SDKROOT}")
-
-# Set CMAKE_OSX_SYSROOT_DEFAULT based on _CURRENT_OSX_VERSION,
-# accounting for the known specially named SDKs.
-SET(CMAKE_OSX_SYSROOT_DEFAULT
- "${_CMAKE_OSX_SDKS_DIR}/MacOSX${_CURRENT_OSX_VERSION}.sdk")
-
-IF(_CURRENT_OSX_VERSION STREQUAL "10.4")
- SET(CMAKE_OSX_SYSROOT_DEFAULT
- "${_CMAKE_OSX_SDKS_DIR}/MacOSX10.4u.sdk")
-ENDIF(_CURRENT_OSX_VERSION STREQUAL "10.4")
-
-IF(_CURRENT_OSX_VERSION STREQUAL "10.3")
- SET(CMAKE_OSX_SYSROOT_DEFAULT
- "${_CMAKE_OSX_SDKS_DIR}/MacOSX10.3.9.sdk")
-ENDIF(_CURRENT_OSX_VERSION STREQUAL "10.3")
+if(CMAKE_OSX_SYSROOT)
+ # Use the existing value without further computation to choose a default.
+ set(_CMAKE_OSX_SYSROOT_DEFAULT "${CMAKE_OSX_SYSROOT}")
+elseif(NOT "x$ENV{SDKROOT}" STREQUAL "x" AND
+ (NOT "x$ENV{SDKROOT}" MATCHES "/" OR IS_DIRECTORY "$ENV{SDKROOT}"))
+ # Use the value of SDKROOT from the environment.
+ set(_CMAKE_OSX_SYSROOT_DEFAULT "$ENV{SDKROOT}")
+elseif("${CMAKE_GENERATOR}" MATCHES Xcode
+ OR CMAKE_OSX_DEPLOYMENT_TARGET
+ OR CMAKE_OSX_ARCHITECTURES MATCHES "[^;]"
+ OR NOT EXISTS "/usr/include/sys/types.h")
+ # Find installed SDKs in either Xcode-4.3+ or pre-4.3 SDKs directory.
+ set(_CMAKE_OSX_SDKS_DIR "")
+ if(OSX_DEVELOPER_ROOT)
+ foreach(d Platforms/MacOSX.platform/Developer/SDKs SDKs)
+ file(GLOB _CMAKE_OSX_SDKS ${OSX_DEVELOPER_ROOT}/${d}/*)
+ if(_CMAKE_OSX_SDKS)
+ set(_CMAKE_OSX_SDKS_DIR ${OSX_DEVELOPER_ROOT}/${d})
+ break()
+ endif()
+ endforeach()
+ endif()
-# Use environment or default as initial cache value:
-IF(NOT ENV_SDKROOT STREQUAL "")
- SET(CMAKE_OSX_SYSROOT_VALUE ${ENV_SDKROOT})
-ELSE(NOT ENV_SDKROOT STREQUAL "")
- SET(CMAKE_OSX_SYSROOT_VALUE ${CMAKE_OSX_SYSROOT_DEFAULT})
-ENDIF(NOT ENV_SDKROOT STREQUAL "")
+ if(_CMAKE_OSX_SDKS_DIR)
+ # Select SDK for current OSX version accounting for the known
+ # specially named SDKs.
+ set(_CMAKE_OSX_SDKS_VER_SUFFIX_10.4 "u")
+ set(_CMAKE_OSX_SDKS_VER_SUFFIX_10.3 ".9")
+ set(_CMAKE_OSX_SDKS_VER ${_CURRENT_OSX_VERSION}${_CMAKE_OSX_SDKS_VER_SUFFIX_${_CURRENT_OSX_VERSION}})
+ set(_CMAKE_OSX_SYSROOT_DEFAULT
+ "${_CMAKE_OSX_SDKS_DIR}/MacOSX${_CMAKE_OSX_SDKS_VER}.sdk")
+ else()
+ # Assume developer files are in root (such as Xcode 4.5 command-line tools).
+ set(_CMAKE_OSX_SYSROOT_DEFAULT "")
+ endif()
+endif()
# Set cache variable - end user may change this during ccmake or cmake-gui configure.
-SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT_VALUE} CACHE PATH
+# Choose the type based on the current value.
+set(_CMAKE_OSX_SYSROOT_TYPE STRING)
+foreach(v CMAKE_OSX_SYSROOT _CMAKE_OSX_SYSROOT_DEFAULT)
+ if("x${${v}}" MATCHES "/")
+ set(_CMAKE_OSX_SYSROOT_TYPE PATH)
+ break()
+ endif()
+endforeach()
+set(CMAKE_OSX_SYSROOT "${_CMAKE_OSX_SYSROOT_DEFAULT}" CACHE ${_CMAKE_OSX_SYSROOT_TYPE}
"The product will be built against the headers and libraries located inside the indicated SDK.")
-#----------------------------------------------------------------------------
-function(SanityCheckSDKAndDeployTarget _sdk_path _deploy)
- if(_deploy STREQUAL "")
- return()
+# Transform the cached value to something we can use.
+set(_CMAKE_OSX_SYSROOT_ORIG "${CMAKE_OSX_SYSROOT}")
+set(_CMAKE_OSX_SYSROOT_PATH "")
+if(CMAKE_OSX_SYSROOT)
+ if("x${CMAKE_OSX_SYSROOT}" MATCHES "/")
+ # This is a path to the SDK. Make sure it exists.
+ if(NOT IS_DIRECTORY "${CMAKE_OSX_SYSROOT}")
+ message(WARNING "Ignoring CMAKE_OSX_SYSROOT value:\n ${CMAKE_OSX_SYSROOT}\n"
+ "because the directory does not exist.")
+ set(CMAKE_OSX_SYSROOT "")
+ set(_CMAKE_OSX_SYSROOT_ORIG "")
+ endif()
+ set(_CMAKE_OSX_SYSROOT_PATH "${CMAKE_OSX_SYSROOT}")
+ else()
+ # Transform the sdk name into a path.
+ execute_process(
+ COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version Path
+ OUTPUT_VARIABLE _stdout
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE _stderr
+ RESULT_VARIABLE _failed
+ )
+ if(NOT _failed AND IS_DIRECTORY "${_stdout}")
+ set(_CMAKE_OSX_SYSROOT_PATH "${_stdout}")
+ # For non-Xcode generators use the path.
+ if(NOT "${CMAKE_GENERATOR}" MATCHES "Xcode")
+ set(CMAKE_OSX_SYSROOT "${_CMAKE_OSX_SYSROOT_PATH}")
+ endif()
+ endif()
endif()
+endif()
- if(_sdk_path STREQUAL "")
- message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET='${_deploy}' but CMAKE_OSX_SYSROOT is empty... - either set CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to empty")
+# Make sure the combination of SDK and Deployment Target are allowed
+if(CMAKE_OSX_DEPLOYMENT_TARGET)
+ if("${_CMAKE_OSX_SYSROOT_PATH}" MATCHES "^.*/MacOSX([0-9]+\\.[0-9]+)[^/]*\\.sdk")
+ set(_sdk_ver "${CMAKE_MATCH_1}")
+ elseif("${_CMAKE_OSX_SYSROOT_ORIG}" MATCHES "^macosx([0-9]+\\.[0-9]+)$")
+ set(_sdk_ver "${CMAKE_MATCH_1}")
+ else()
+ message(FATAL_ERROR
+ "CMAKE_OSX_DEPLOYMENT_TARGET is '${CMAKE_OSX_DEPLOYMENT_TARGET}' "
+ "but CMAKE_OSX_SYSROOT:\n \"${_CMAKE_OSX_SYSROOT_ORIG}\"\n"
+ "is not set to a MacOSX SDK with a recognized version. "
+ "Either set CMAKE_OSX_SYSROOT to a valid SDK or set "
+ "CMAKE_OSX_DEPLOYMENT_TARGET to empty.")
endif()
-
- string(REGEX REPLACE "(.*MacOSX*)(....)(.*\\.sdk)" "\\2" SDK "${_sdk_path}")
- if(_deploy GREATER "${SDK}")
- message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET (${_deploy}) is greater than CMAKE_OSX_SYSROOT SDK (${_sdk_path}). Please set CMAKE_OSX_DEPLOYMENT_TARGET to ${SDK} or lower")
+ if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER "${_sdk_ver}")
+ message(FATAL_ERROR
+ "CMAKE_OSX_DEPLOYMENT_TARGET (${CMAKE_OSX_DEPLOYMENT_TARGET}) "
+ "is greater than CMAKE_OSX_SYSROOT SDK:\n ${_CMAKE_OSX_SYSROOT_ORIG}\n"
+ "Please set CMAKE_OSX_DEPLOYMENT_TARGET to ${_sdk_ver} or lower.")
endif()
-endfunction(SanityCheckSDKAndDeployTarget)
-#----------------------------------------------------------------------------
-
-# Make sure the combination of SDK and Deployment Target are allowed
-SanityCheckSDKAndDeployTarget("${CMAKE_OSX_SYSROOT}" "${CMAKE_OSX_DEPLOYMENT_TARGET}")
+endif()
-# set _CMAKE_OSX_MACHINE to uname -m
-EXECUTE_PROCESS(COMMAND uname -m
- OUTPUT_STRIP_TRAILING_WHITESPACE
- OUTPUT_VARIABLE _CMAKE_OSX_MACHINE)
-
-# check for Power PC and change to ppc
-IF(_CMAKE_OSX_MACHINE MATCHES "Power")
- SET(_CMAKE_OSX_MACHINE ppc)
-ENDIF(_CMAKE_OSX_MACHINE MATCHES "Power")
-
-# check for environment variable CMAKE_OSX_ARCHITECTURES
-# if it is set.
-IF(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
- SET(CMAKE_OSX_ARCHITECTURES_VALUE "$ENV{CMAKE_OSX_ARCHITECTURES}")
-ELSE(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
- SET(CMAKE_OSX_ARCHITECTURES_VALUE "")
-ENDIF(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
-
-# now put _CMAKE_OSX_MACHINE into the cache
-SET(CMAKE_OSX_ARCHITECTURES ${CMAKE_OSX_ARCHITECTURES_VALUE} CACHE STRING
- "Build architectures for OSX")
-
-
-IF("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
- SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+if("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
+ set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
"${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress")
-ENDIF("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
+endif()
-IF(NOT XCODE)
+if(NOT XCODE)
# Enable shared library versioning. This flag is not actually referenced
# but the fact that the setting exists will cause the generators to support
# soname computation.
- SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
-ENDIF(NOT XCODE)
+ set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
+endif()
# Xcode does not support -isystem yet.
-IF(XCODE)
- SET(CMAKE_INCLUDE_SYSTEM_FLAG_C)
- SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
-ENDIF(XCODE)
+if(XCODE)
+ set(CMAKE_INCLUDE_SYSTEM_FLAG_C)
+ set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+endif()
-IF("${_CURRENT_OSX_VERSION}" VERSION_LESS "10.5")
+if("${_CURRENT_OSX_VERSION}" VERSION_LESS "10.5")
# Need to list dependent shared libraries on link line. When building
# with -isysroot (for universal binaries), the linker always looks for
# dependent libraries under the sysroot. Listing them on the link
# line works around the problem.
- SET(CMAKE_LINK_DEPENDENT_LIBRARY_FILES 1)
-ENDIF()
+ set(CMAKE_LINK_DEPENDENT_LIBRARY_FILES 1)
+endif()
-SET(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
-SET(CMAKE_C_CREATE_SHARED_LIBRARY
+set(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
+set(CMAKE_C_CREATE_SHARED_LIBRARY
"<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY
"<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
+set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
"<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_CXX_CREATE_SHARED_MODULE
+set(CMAKE_CXX_CREATE_SHARED_MODULE
"<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_C_CREATE_SHARED_MODULE
+set(CMAKE_C_CREATE_SHARED_MODULE
"<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_Fortran_CREATE_SHARED_MODULE
+set(CMAKE_Fortran_CREATE_SHARED_MODULE
"<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_C_CREATE_MACOSX_FRAMEWORK
+set(CMAKE_C_CREATE_MACOSX_FRAMEWORK
"<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK
+set(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK
"<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
# default to searching for frameworks first
-IF(NOT DEFINED CMAKE_FIND_FRAMEWORK)
- SET(CMAKE_FIND_FRAMEWORK FIRST)
-ENDIF()
+if(NOT DEFINED CMAKE_FIND_FRAMEWORK)
+ set(CMAKE_FIND_FRAMEWORK FIRST)
+endif()
# set up the default search directories for frameworks
-SET(CMAKE_SYSTEM_FRAMEWORK_PATH
+set(CMAKE_SYSTEM_FRAMEWORK_PATH
~/Library/Frameworks
/Library/Frameworks
/Network/Library/Frameworks
/System/Library/Frameworks)
# default to searching for application bundles first
-IF(NOT DEFINED CMAKE_FIND_APPBUNDLE)
- SET(CMAKE_FIND_APPBUNDLE FIRST)
-ENDIF()
+if(NOT DEFINED CMAKE_FIND_APPBUNDLE)
+ set(CMAKE_FIND_APPBUNDLE FIRST)
+endif()
# set up the default search directories for application bundles
-SET(_apps_paths)
-FOREACH(_path
+set(_apps_paths)
+foreach(_path
"~/Applications"
"/Applications"
"${OSX_DEVELOPER_ROOT}/../Applications" # Xcode 4.3+
"${OSX_DEVELOPER_ROOT}/Applications" # pre-4.3
)
- GET_FILENAME_COMPONENT(_apps "${_path}" ABSOLUTE)
- IF(EXISTS "${_apps}")
- LIST(APPEND _apps_paths "${_apps}")
- ENDIF()
-ENDFOREACH()
-LIST(REMOVE_DUPLICATES _apps_paths)
-SET(CMAKE_SYSTEM_APPBUNDLE_PATH
+ get_filename_component(_apps "${_path}" ABSOLUTE)
+ if(EXISTS "${_apps}")
+ list(APPEND _apps_paths "${_apps}")
+ endif()
+endforeach()
+list(REMOVE_DUPLICATES _apps_paths)
+set(CMAKE_SYSTEM_APPBUNDLE_PATH
${_apps_paths})
-UNSET(_apps_paths)
+unset(_apps_paths)
-INCLUDE(Platform/UnixPaths)
-LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
+include(Platform/UnixPaths)
+list(APPEND CMAKE_SYSTEM_PREFIX_PATH
/sw # Fink
/opt/local # MacPorts
)
diff --git a/Modules/Platform/DragonFly.cmake b/Modules/Platform/DragonFly.cmake
index f6e0f810f..c22677b9d 100644
--- a/Modules/Platform/DragonFly.cmake
+++ b/Modules/Platform/DragonFly.cmake
@@ -2,4 +2,4 @@
# http://www.dragonflybsd.org
# see http://archive.netbsd.se/?ml=dfbsd-users&a=2007-07&m=4678361
-INCLUDE(Platform/FreeBSD)
+include(Platform/FreeBSD)
diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake
index 82fe961fb..cf1850110 100644
--- a/Modules/Platform/FreeBSD.cmake
+++ b/Modules/Platform/FreeBSD.cmake
@@ -1,28 +1,28 @@
-IF(EXISTS /usr/include/dlfcn.h)
- SET(CMAKE_DL_LIBS "")
- SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
- SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
- SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -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 "-Wl,-rpath,") # -rpath
- SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # : or empty
- SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
- SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
- SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
-ENDIF(EXISTS /usr/include/dlfcn.h)
+if(EXISTS /usr/include/dlfcn.h)
+ set(CMAKE_DL_LIBS "")
+ set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
+ set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+ set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -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 "-Wl,-rpath,") # -rpath
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # : or empty
+ set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
+ set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+ set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+endif()
# Shared libraries with no builtin soname may not be linked safely by
# specifying the file path.
-SET(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
+set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
- SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
- SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach()
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/GNU.cmake b/Modules/Platform/GNU.cmake
index 4bcfd51ce..e8c3b657b 100644
--- a/Modules/Platform/GNU.cmake
+++ b/Modules/Platform/GNU.cmake
@@ -1,13 +1,13 @@
# GCC is the default compiler on GNU/Hurd.
-SET(CMAKE_DL_LIBS "dl")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+set(CMAKE_DL_LIBS "dl")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
-SET(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-gnu[a-z0-9_]*")
+set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-gnu[a-z0-9_]*")
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/Generic-ADSP-ASM.cmake b/Modules/Platform/Generic-ADSP-ASM.cmake
index cec4c2f68..63a1388ce 100644
--- a/Modules/Platform/Generic-ADSP-ASM.cmake
+++ b/Modules/Platform/Generic-ADSP-ASM.cmake
@@ -1,7 +1,7 @@
-INCLUDE(Platform/Generic-ADSP-Common)
+include(Platform/Generic-ADSP-Common)
-SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm)
-SET(CMAKE_ASM_OUTPUT_EXTENSION ".doj" )
-SET(CMAKE_ASM_COMPILE_OBJECT
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm)
+set(CMAKE_ASM_OUTPUT_EXTENSION ".doj" )
+set(CMAKE_ASM_COMPILE_OBJECT
"<CMAKE_ASM_COMPILER> <FLAGS> -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o <OBJECT> <SOURCE>")
diff --git a/Modules/Platform/Generic-ADSP-C.cmake b/Modules/Platform/Generic-ADSP-C.cmake
index f0644687f..4b9ed9d07 100644
--- a/Modules/Platform/Generic-ADSP-C.cmake
+++ b/Modules/Platform/Generic-ADSP-C.cmake
@@ -1,20 +1,20 @@
-INCLUDE(Platform/Generic-ADSP-Common)
+include(Platform/Generic-ADSP-Common)
-SET(CMAKE_C_OUTPUT_EXTENSION ".doj")
+set(CMAKE_C_OUTPUT_EXTENSION ".doj")
-SET(CMAKE_C_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_C_FLAGS_MINSIZEREL_INIT "")
-SET(CMAKE_C_FLAGS_RELEASE_INIT "")
-SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "")
+set(CMAKE_C_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_C_FLAGS_MINSIZEREL_INIT "")
+set(CMAKE_C_FLAGS_RELEASE_INIT "")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "")
-SET(CMAKE_C_CREATE_STATIC_LIBRARY
+set(CMAKE_C_CREATE_STATIC_LIBRARY
"<CMAKE_C_COMPILER> -build-lib -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o <TARGET> <CMAKE_C_LINK_FLAGS> <OBJECTS>")
-SET(CMAKE_C_LINK_EXECUTABLE
+set(CMAKE_C_LINK_EXECUTABLE
"<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
-SET(CMAKE_C_CREATE_SHARED_LIBRARY)
-SET(CMAKE_C_CREATE_MODULE_LIBRARY)
+set(CMAKE_C_CREATE_SHARED_LIBRARY)
+set(CMAKE_C_CREATE_MODULE_LIBRARY)
diff --git a/Modules/Platform/Generic-ADSP-CXX.cmake b/Modules/Platform/Generic-ADSP-CXX.cmake
index 21daa81c9..9673aef40 100644
--- a/Modules/Platform/Generic-ADSP-CXX.cmake
+++ b/Modules/Platform/Generic-ADSP-CXX.cmake
@@ -1,18 +1,18 @@
-INCLUDE(Platform/Generic-ADSP-Common)
+include(Platform/Generic-ADSP-Common)
-SET(CMAKE_CXX_OUTPUT_EXTENSION ".doj")
+set(CMAKE_CXX_OUTPUT_EXTENSION ".doj")
-SET(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "")
-SET(CMAKE_CXX_FLAGS_RELEASE_INIT "")
-SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "")
+set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "")
+set(CMAKE_CXX_FLAGS_RELEASE_INIT "")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "")
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
+set(CMAKE_CXX_CREATE_STATIC_LIBRARY
"<CMAKE_CXX_COMPILER> -build-lib -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o <TARGET> <CMAKE_CXX_LINK_FLAGS> <OBJECTS>")
-SET(CMAKE_CXX_LINK_EXECUTABLE
+set(CMAKE_CXX_LINK_EXECUTABLE
"<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY)
-SET(CMAKE_CXX_CREATE_MODULE_LIBRARY)
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY)
+set(CMAKE_CXX_CREATE_MODULE_LIBRARY)
diff --git a/Modules/Platform/Generic-ADSP-Common.cmake b/Modules/Platform/Generic-ADSP-Common.cmake
index 10fb34e00..026f83c48 100644
--- a/Modules/Platform/Generic-ADSP-Common.cmake
+++ b/Modules/Platform/Generic-ADSP-Common.cmake
@@ -6,115 +6,115 @@
# TS (TigerShark)
# 21k (Sharc 21xxx)
-IF(NOT ADSP)
+if(NOT ADSP)
- SET(ADSP TRUE)
+ set(ADSP TRUE)
- SET(CMAKE_STATIC_LIBRARY_SUFFIX ".dlb")
- SET(CMAKE_SHARED_LIBRARY_SUFFIX "")
- SET(CMAKE_EXECUTABLE_SUFFIX ".dxe")
+ set(CMAKE_STATIC_LIBRARY_SUFFIX ".dlb")
+ set(CMAKE_SHARED_LIBRARY_SUFFIX "")
+ set(CMAKE_EXECUTABLE_SUFFIX ".dxe")
- # if ADSP_PROCESSOR has not been set, but CMAKE_SYSTEM_PROCESSOR has,
+ # if ADSP_PROCESSOR has not been set, but CMAKE_SYSTEM_PROCESSOR has,
# assume that this is the processor name to use for the compiler
- IF(CMAKE_SYSTEM_PROCESSOR AND NOT ADSP_PROCESSOR)
- SET(ADSP_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
- ENDIF(CMAKE_SYSTEM_PROCESSOR AND NOT ADSP_PROCESSOR)
+ if(CMAKE_SYSTEM_PROCESSOR AND NOT ADSP_PROCESSOR)
+ set(ADSP_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
+ endif()
# if ADSP_PROCESSOR_SILICIUM_REVISION has not been set, use "none"
- IF(NOT ADSP_PROCESSOR_SILICIUM_REVISION)
- SET(ADSP_PROCESSOR_SILICIUM_REVISION "none")
- ENDIF(NOT ADSP_PROCESSOR_SILICIUM_REVISION)
+ if(NOT ADSP_PROCESSOR_SILICIUM_REVISION)
+ set(ADSP_PROCESSOR_SILICIUM_REVISION "none")
+ endif()
# this file is included from the C and CXX files, so handle both here
- GET_FILENAME_COMPONENT(_ADSP_DIR "${CMAKE_C_COMPILER}" PATH)
- IF(NOT _ADSP_DIR)
- GET_FILENAME_COMPONENT(_ADSP_DIR "${CMAKE_CXX_COMPILER}" PATH)
- ENDIF(NOT _ADSP_DIR)
- IF(NOT _ADSP_DIR)
- GET_FILENAME_COMPONENT(_ADSP_DIR "${CMAKE_ASM_COMPILER}" PATH)
- ENDIF(NOT _ADSP_DIR)
+ get_filename_component(_ADSP_DIR "${CMAKE_C_COMPILER}" PATH)
+ if(NOT _ADSP_DIR)
+ get_filename_component(_ADSP_DIR "${CMAKE_CXX_COMPILER}" PATH)
+ endif()
+ if(NOT _ADSP_DIR)
+ get_filename_component(_ADSP_DIR "${CMAKE_ASM_COMPILER}" PATH)
+ endif()
# detect architecture
- IF(CMAKE_C_COMPILER MATCHES ccblkfn OR CMAKE_CXX_COMPILER MATCHES ccblkfn OR CMAKE_ASM_COMPILER MATCHES easmBLKFN)
- IF(NOT ADSP_PROCESSOR)
- SET(ADSP_PROCESSOR "ADSP-BF561")
- ENDIF(NOT ADSP_PROCESSOR)
- SET(ADSP_BLACKFIN TRUE)
- SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/Blackfin")
- ENDIF(CMAKE_C_COMPILER MATCHES ccblkfn OR CMAKE_CXX_COMPILER MATCHES ccblkfn OR CMAKE_ASM_COMPILER MATCHES easmBLKFN)
+ if(CMAKE_C_COMPILER MATCHES ccblkfn OR CMAKE_CXX_COMPILER MATCHES ccblkfn OR CMAKE_ASM_COMPILER MATCHES easmBLKFN)
+ if(NOT ADSP_PROCESSOR)
+ set(ADSP_PROCESSOR "ADSP-BF561")
+ endif()
+ set(ADSP_BLACKFIN TRUE)
+ set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/Blackfin")
+ endif()
- IF(CMAKE_C_COMPILER MATCHES ccts OR CMAKE_CXX_COMPILER MATCHES ccts OR CMAKE_ASM_COMPILER MATCHES easmTS)
- IF(NOT ADSP_PROCESSOR)
- SET(ADSP_PROCESSOR "ADSP-TS101")
- ENDIF(NOT ADSP_PROCESSOR)
- SET(ADSP_TS TRUE)
- SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/TS")
- ENDIF(CMAKE_C_COMPILER MATCHES ccts OR CMAKE_CXX_COMPILER MATCHES ccts OR CMAKE_ASM_COMPILER MATCHES easmTS)
+ if(CMAKE_C_COMPILER MATCHES ccts OR CMAKE_CXX_COMPILER MATCHES ccts OR CMAKE_ASM_COMPILER MATCHES easmTS)
+ if(NOT ADSP_PROCESSOR)
+ set(ADSP_PROCESSOR "ADSP-TS101")
+ endif()
+ set(ADSP_TS TRUE)
+ set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/TS")
+ endif()
- IF(CMAKE_C_COMPILER MATCHES cc21k OR CMAKE_CXX_COMPILER MATCHES cc21k OR CMAKE_ASM_COMPILER MATCHES easm21k)
- IF(NOT ADSP_PROCESSOR)
- SET(ADSP_PROCESSOR "ADSP-21060")
- ENDIF(NOT ADSP_PROCESSOR)
- SET(ADSP_21K TRUE)
+ if(CMAKE_C_COMPILER MATCHES cc21k OR CMAKE_CXX_COMPILER MATCHES cc21k OR CMAKE_ASM_COMPILER MATCHES easm21k)
+ if(NOT ADSP_PROCESSOR)
+ set(ADSP_PROCESSOR "ADSP-21060")
+ endif()
+ set(ADSP_21K TRUE)
- SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k") # default if nothing matches
- IF (ADSP_PROCESSOR MATCHES "210..$")
- SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k")
- ENDIF(ADSP_PROCESSOR MATCHES "210..$")
+ set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k") # default if nothing matches
+ if (ADSP_PROCESSOR MATCHES "210..$")
+ set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k")
+ endif()
- IF (ADSP_PROCESSOR MATCHES "211..$")
- SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/211k")
- ENDIF(ADSP_PROCESSOR MATCHES "211..$")
+ if (ADSP_PROCESSOR MATCHES "211..$")
+ set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/211k")
+ endif()
- IF (ADSP_PROCESSOR MATCHES "212..$")
- SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/212k")
- ENDIF(ADSP_PROCESSOR MATCHES "212..$")
+ if (ADSP_PROCESSOR MATCHES "212..$")
+ set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/212k")
+ endif()
- IF (ADSP_PROCESSOR MATCHES "213..$")
- SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/213k")
- ENDIF(ADSP_PROCESSOR MATCHES "213..$")
+ if (ADSP_PROCESSOR MATCHES "213..$")
+ set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/213k")
+ endif()
- SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k")
- ENDIF(CMAKE_C_COMPILER MATCHES cc21k OR CMAKE_CXX_COMPILER MATCHES cc21k OR CMAKE_ASM_COMPILER MATCHES easm21k)
+ set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k")
+ endif()
- LINK_DIRECTORIES("${_ADSP_FAMILY_DIR}/lib")
+ link_directories("${_ADSP_FAMILY_DIR}/lib")
# vdk support
- FIND_PROGRAM( ADSP_VDKGEN_EXECUTABLE vdkgen "${_ADSP_FAMILY_DIR}/vdk" )
+ find_program( ADSP_VDKGEN_EXECUTABLE vdkgen "${_ADSP_FAMILY_DIR}/vdk" )
- MACRO(ADSP_GENERATE_VDK VDK_GENERATED_HEADER VDK_GENERATED_SOURCE VDK_KERNEL_SUPPORT_FILE)
- ADD_CUSTOM_COMMAND(
+ macro(ADSP_GENERATE_VDK VDK_GENERATED_HEADER VDK_GENERATED_SOURCE VDK_KERNEL_SUPPORT_FILE)
+ add_custom_command(
OUTPUT ${VDK_GENERATED_HEADER} ${VDK_GENERATED_SOURCE}
COMMAND ${ADSP_VDKGEN_EXECUTABLE} ${VDK_KERNEL_SUPPORT_FILE} -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -MM
DEPENDS ${VDK_KERNEL_SUPPORT_FILE}
)
- ENDMACRO(ADSP_GENERATE_VDK VDK_GENERATED_HEADER VDK_GENERATED_SOURCE VDK_KERNEL_SUPPORT_FILE)
+ endmacro()
# loader support
- FIND_PROGRAM( ADSP_ELFLOADER_EXECUTABLE elfloader "${_ADSP_FAMILY_DIR}" )
+ find_program( ADSP_ELFLOADER_EXECUTABLE elfloader "${_ADSP_FAMILY_DIR}" )
# BOOT_MODE: prom, flash, spi, spislave, UART, TWI, FIFO
# FORMAT: hex, ASCII, binary, include
# WIDTH: 8, 16
- MACRO(ADSP_CREATE_LOADER_FILE TARGET_NAME BOOT_MODE FORMAT WIDTH)
- ADD_CUSTOM_COMMAND(
+ macro(ADSP_CREATE_LOADER_FILE TARGET_NAME BOOT_MODE FORMAT WIDTH)
+ add_custom_command(
TARGET ${TARGET_NAME}
POST_BUILD
COMMAND ${ADSP_ELFLOADER_EXECUTABLE} ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.dxe -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -b ${BOOT_MODE} -f ${FORMAT} -width ${WIDTH} -o ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.ldr
COMMENT "Building the loader file"
)
- ENDMACRO(ADSP_CREATE_LOADER_FILE TARGET_NAME BOOT_MODE FORMAT WIDTH)
+ endmacro()
- MACRO(ADSP_CREATE_LOADER_FILE_INIT TARGET_NAME BOOT_MODE FORMAT WIDTH INITIALIZATION_FILE)
- ADD_CUSTOM_COMMAND(
+ macro(ADSP_CREATE_LOADER_FILE_INIT TARGET_NAME BOOT_MODE FORMAT WIDTH INITIALIZATION_FILE)
+ add_custom_command(
TARGET ${TARGET_NAME}
POST_BUILD
COMMAND ${ADSP_ELFLOADER_EXECUTABLE} ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.dxe -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -b ${BOOT_MODE} -f ${FORMAT} -width ${WIDTH} -o ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.ldr -init ${INITIALIZATION_FILE}
COMMENT "Building the loader file"
)
- ENDMACRO(ADSP_CREATE_LOADER_FILE_INIT TARGET_NAME BOOT_MODE FORMAT WIDTH INITIALIZATION_FILE)
+ endmacro()
-ENDIF(NOT ADSP)
+endif()
diff --git a/Modules/Platform/Generic-SDCC-C.cmake b/Modules/Platform/Generic-SDCC-C.cmake
index ac81c3560..588bf32d9 100644
--- a/Modules/Platform/Generic-SDCC-C.cmake
+++ b/Modules/Platform/Generic-SDCC-C.cmake
@@ -4,51 +4,51 @@
# To use it either a toolchain file is required or cmake has to be run like this:
# cmake -DCMAKE_C_COMPILER=sdcc -DCMAKE_SYSTEM_NAME=Generic <dir...>
# Since sdcc doesn't support C++, C++ support should be disabled in the
-# CMakeLists.txt using the PROJECT() command:
-# PROJECT(my_project C)
+# CMakeLists.txt using the project() command:
+# project(my_project C)
-SET(CMAKE_STATIC_LIBRARY_PREFIX "")
-SET(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
-SET(CMAKE_SHARED_LIBRARY_PREFIX "") # lib
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".lib") # .so
-SET(CMAKE_IMPORT_LIBRARY_PREFIX )
-SET(CMAKE_IMPORT_LIBRARY_SUFFIX )
-SET(CMAKE_EXECUTABLE_SUFFIX ".ihx") # intel hex file
-SET(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
-SET(CMAKE_DL_LIBS "")
+set(CMAKE_STATIC_LIBRARY_PREFIX "")
+set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
+set(CMAKE_SHARED_LIBRARY_PREFIX "") # lib
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".lib") # .so
+set(CMAKE_IMPORT_LIBRARY_PREFIX )
+set(CMAKE_IMPORT_LIBRARY_SUFFIX )
+set(CMAKE_EXECUTABLE_SUFFIX ".ihx") # intel hex file
+set(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
+set(CMAKE_DL_LIBS "")
-SET(CMAKE_C_OUTPUT_EXTENSION ".rel")
+set(CMAKE_C_OUTPUT_EXTENSION ".rel")
# find sdcclib as CMAKE_AR
-# since cmake may already have searched for "ar", sdcclib has to
-# be searched with a different variable name (SDCCLIB_EXECUTABLE)
+# since cmake may already have searched for "ar", sdcclib has to
+# be searched with a different variable name (SDCCLIB_EXECUTABLE)
# and must then be forced into the cache
-GET_FILENAME_COMPONENT(SDCC_LOCATION "${CMAKE_C_COMPILER}" PATH)
-FIND_PROGRAM(SDCCLIB_EXECUTABLE sdcclib PATHS "${SDCC_LOCATION}" NO_DEFAULT_PATH)
-FIND_PROGRAM(SDCCLIB_EXECUTABLE sdcclib)
-SET(CMAKE_AR "${SDCCLIB_EXECUTABLE}" CACHE FILEPATH "The sdcc librarian" FORCE)
+get_filename_component(SDCC_LOCATION "${CMAKE_C_COMPILER}" PATH)
+find_program(SDCCLIB_EXECUTABLE sdcclib PATHS "${SDCC_LOCATION}" NO_DEFAULT_PATH)
+find_program(SDCCLIB_EXECUTABLE sdcclib)
+set(CMAKE_AR "${SDCCLIB_EXECUTABLE}" CACHE FILEPATH "The sdcc librarian" FORCE)
# CMAKE_C_FLAGS_INIT and CMAKE_EXE_LINKER_FLAGS_INIT should be set in a CMAKE_SYSTEM_PROCESSOR file
-IF(NOT DEFINED CMAKE_C_FLAGS_INIT)
- SET(CMAKE_C_FLAGS_INIT "-mmcs51 --model-small")
-ENDIF(NOT DEFINED CMAKE_C_FLAGS_INIT)
+if(NOT DEFINED CMAKE_C_FLAGS_INIT)
+ set(CMAKE_C_FLAGS_INIT "-mmcs51 --model-small")
+endif()
-IF(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT)
- SET (CMAKE_EXE_LINKER_FLAGS_INIT --model-small)
-ENDIF(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT)
+if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT)
+ set (CMAKE_EXE_LINKER_FLAGS_INIT --model-small)
+endif()
# compile a C file into an object file
-SET(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
# link object files to an executable
-SET(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <OBJECTS> --out-fmt-ihx -o <TARGET> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>")
+set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <OBJECTS> --out-fmt-ihx -o <TARGET> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>")
# needs sdcc 2.7.0 + sddclib from cvs
-SET(CMAKE_C_CREATE_STATIC_LIBRARY
+set(CMAKE_C_CREATE_STATIC_LIBRARY
"\"${CMAKE_COMMAND}\" -E remove <TARGET>"
"<CMAKE_AR> -a <TARGET> <LINK_FLAGS> <OBJECTS> ")
# not supported by sdcc
-SET(CMAKE_C_CREATE_SHARED_LIBRARY "")
-SET(CMAKE_C_CREATE_MODULE_LIBRARY "")
+set(CMAKE_C_CREATE_SHARED_LIBRARY "")
+set(CMAKE_C_CREATE_MODULE_LIBRARY "")
diff --git a/Modules/Platform/Generic.cmake b/Modules/Platform/Generic.cmake
index a4e2ec6c1..fcb2699d6 100644
--- a/Modules/Platform/Generic.cmake
+++ b/Modules/Platform/Generic.cmake
@@ -2,16 +2,16 @@
# operating system, typically embedded platforms.
# It is used when CMAKE_SYSTEM_NAME is set to "Generic"
#
-# It is intentionally empty, since nothing is known
+# It is intentionally empty, since nothing is known
# about the platform. So everything has to be specified
# in the system/compiler files ${CMAKE_SYSTEM_NAME}-<compiler_basename>.cmake
# and/or ${CMAKE_SYSTEM_NAME}-<compiler_basename>-${CMAKE_SYSTEM_PROCESSOR}.cmake
# (embedded) targets without operating system usually don't support shared libraries
-SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
# To help the find_xxx() commands, set at least the following so CMAKE_FIND_ROOT_PATH
# works at least for some simple cases:
-SET(CMAKE_SYSTEM_INCLUDE_PATH /include )
-SET(CMAKE_SYSTEM_LIBRARY_PATH /lib )
-SET(CMAKE_SYSTEM_PROGRAM_PATH /bin )
+set(CMAKE_SYSTEM_INCLUDE_PATH /include )
+set(CMAKE_SYSTEM_LIBRARY_PATH /lib )
+set(CMAKE_SYSTEM_PROGRAM_PATH /bin )
diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake
index ab3dc2266..65cc7310d 100644
--- a/Modules/Platform/HP-UX.cmake
+++ b/Modules/Platform/HP-UX.cmake
@@ -1,22 +1,22 @@
-SET(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib)
+set(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib)
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".sl") # .so
-SET(CMAKE_DL_LIBS "dld")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".sl" ".so" ".a")
-SET(CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES ".so")
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".sl") # .so
+set(CMAKE_DL_LIBS "dld")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".sl" ".so" ".a")
+set(CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES ".so")
# The HP linker needs to find transitive shared library dependencies
# in the -L path. Therefore the runtime path must be added to the
# link line with -L flags.
-SET(CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH 1)
-SET(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
+set(CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH 1)
+set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
# Shared libraries with no builtin soname may not be linked safely by
# specifying the file path.
-SET(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
+set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
# set flags for gcc support
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
# Look in both 32-bit and 64-bit implict link directories, but tell
# CMake not to pass the paths to the linker. The linker will find the
@@ -25,9 +25,9 @@ INCLUDE(Platform/UnixPaths)
# CMAKE_SIZEOF_VOID_P is not set until after this file executes, we
# would need to append to CMAKE_SYSTEM_LIBRARY_PATH at a later point
# (after CMakeTest(LANG)Compiler.cmake runs for at least one language).
-LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux32)
-LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux64)
-LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+list(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux32)
+list(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux64)
+list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
/usr/lib/hpux32 /usr/lib/hpux64)
# Initialize C and CXX link type selection flags. These flags are
@@ -35,16 +35,16 @@ LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
# that links to other libraries to select whether to use the static or
# shared versions of the libraries. Note that C modules and shared
# libs are built using ld directly so we leave off the "-Wl," portion.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE)
- SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-a archive")
- SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-a default")
-ENDFOREACH(type)
-FOREACH(type EXE)
- SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-a,archive")
- SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-a,default")
-ENDFOREACH(type)
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
- SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Wl,-a,archive")
- SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Wl,-a,default")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE)
+ set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-a archive")
+ set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-a default")
+endforeach()
+foreach(type EXE)
+ set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-a,archive")
+ set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-a,default")
+endforeach()
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Wl,-a,archive")
+ set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Wl,-a,default")
+endforeach()
diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake
index 9dda3c528..8987783ff 100644
--- a/Modules/Platform/Haiku.cmake
+++ b/Modules/Platform/Haiku.cmake
@@ -1,24 +1,24 @@
-SET(BEOS 1)
+set(BEOS 1)
-SET(CMAKE_DL_LIBS root be)
-SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
-SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-nostart")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+set(CMAKE_DL_LIBS root be)
+set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
+set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-nostart")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-INCLUDE(Platform/UnixPaths)
-LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH /boot/common)
-LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH /boot/common/include)
-LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /boot/common/lib)
-LIST(APPEND CMAKE_SYSTEM_PROGRAM_PATH /boot/common/bin)
-LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES /boot/common/lib)
-LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH /boot/develop/headers/3rdparty)
-LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /boot/develop/lib/x86)
+include(Platform/UnixPaths)
+list(APPEND CMAKE_SYSTEM_PREFIX_PATH /boot/common)
+list(APPEND CMAKE_SYSTEM_INCLUDE_PATH /boot/common/include)
+list(APPEND CMAKE_SYSTEM_LIBRARY_PATH /boot/common/lib)
+list(APPEND CMAKE_SYSTEM_PROGRAM_PATH /boot/common/bin)
+list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES /boot/common/lib)
+list(APPEND CMAKE_SYSTEM_INCLUDE_PATH /boot/develop/headers/3rdparty)
+list(APPEND CMAKE_SYSTEM_LIBRARY_PATH /boot/develop/lib/x86)
-IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
- SET(CMAKE_INSTALL_PREFIX "/boot/common" CACHE PATH
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set(CMAKE_INSTALL_PREFIX "/boot/common" CACHE PATH
"Install path prefix, prepended onto install directories." FORCE)
-ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+endif()
diff --git a/Modules/Platform/IRIX.cmake b/Modules/Platform/IRIX.cmake
index fac941f3b..03e98ccfd 100644
--- a/Modules/Platform/IRIX.cmake
+++ b/Modules/Platform/IRIX.cmake
@@ -1,45 +1,45 @@
-SET(CMAKE_DL_LIBS "")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") # -rpath
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
-IF(NOT CMAKE_COMPILER_IS_GNUCXX)
- SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
+set(CMAKE_DL_LIBS "")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") # -rpath
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
+if(NOT CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_CXX_CREATE_STATIC_LIBRARY
"<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
- SET (CMAKE_CXX_FLAGS_INIT "")
- SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
- SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
- SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
- SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
- SET (CMAKE_C_FLAGS_INIT "")
-ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
+ set (CMAKE_CXX_FLAGS_INIT "")
+ set (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
+ set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
+ set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
+ set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
+ set (CMAKE_C_FLAGS_INIT "")
+endif()
# set flags for gcc support
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
-IF(NOT CMAKE_COMPILER_IS_GNUCC)
- SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE
+if(NOT CMAKE_COMPILER_IS_GNUCC)
+ set (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ set (CMAKE_C_CREATE_ASSEMBLY_SOURCE
"<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE>"
"mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
)
-ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
+endif()
-IF(NOT CMAKE_COMPILER_IS_GNUCXX)
- SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
+if(NOT CMAKE_COMPILER_IS_GNUCXX)
+ set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ set (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
"<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE>"
"mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
)
-ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
+endif()
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
- SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
- SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach()
# The IRIX linker needs to find transitive shared library dependencies
# in the -L path.
-SET(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
+set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
diff --git a/Modules/Platform/IRIX64.cmake b/Modules/Platform/IRIX64.cmake
index b60a7f297..5acbd81fa 100644
--- a/Modules/Platform/IRIX64.cmake
+++ b/Modules/Platform/IRIX64.cmake
@@ -1,73 +1,73 @@
-SET(CMAKE_DL_LIBS "")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") # -rpath
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-IF(NOT CMAKE_COMPILER_IS_GNUCC)
+set(CMAKE_DL_LIBS "")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") # -rpath
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+if(NOT CMAKE_COMPILER_IS_GNUCC)
# Set default flags init.
- SET(CMAKE_C_FLAGS_INIT "")
- SET(CMAKE_CXX_FLAGS_INIT "")
- SET(CMAKE_Fortran_FLAGS_INIT "")
- SET(CMAKE_EXE_LINKER_FLAGS_INIT "")
- SET(CMAKE_SHARED_LINKER_FLAGS_INIT "")
- SET(CMAKE_MODULE_LINKER_FLAGS_INIT "")
-
+ set(CMAKE_C_FLAGS_INIT "")
+ set(CMAKE_CXX_FLAGS_INIT "")
+ set(CMAKE_Fortran_FLAGS_INIT "")
+ set(CMAKE_EXE_LINKER_FLAGS_INIT "")
+ set(CMAKE_SHARED_LINKER_FLAGS_INIT "")
+ set(CMAKE_MODULE_LINKER_FLAGS_INIT "")
+
# If no -o32, -n32, or -64 flag is given, set a reasonable default.
- IF("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
- ELSE("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
+ if("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
+ else()
# Check if this is a 64-bit CMake.
- IF(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$")
- EXEC_PROGRAM(file ARGS ${CMAKE_COMMAND} OUTPUT_VARIABLE CMAKE_FILE_SELF)
- SET(CMAKE_FILE_SELF "${CMAKE_FILE_SELF}" CACHE INTERNAL
+ if(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$")
+ exec_program(file ARGS ${CMAKE_COMMAND} OUTPUT_VARIABLE CMAKE_FILE_SELF)
+ set(CMAKE_FILE_SELF "${CMAKE_FILE_SELF}" CACHE INTERNAL
"Output of file command on ${CMAKE_COMMAND}.")
- ENDIF(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$")
-
+ endif()
+
# Set initial flags to match cmake executable.
- IF(CMAKE_FILE_SELF MATCHES " 64-bit ")
- SET(CMAKE_C_FLAGS_INIT "-64")
- SET(CMAKE_CXX_FLAGS_INIT "-64")
- SET(CMAKE_Fortran_FLAGS_INIT "-64")
- SET(CMAKE_EXE_LINKER_FLAGS_INIT "-64")
- SET(CMAKE_SHARED_LINKER_FLAGS_INIT "-64")
- SET(CMAKE_MODULE_LINKER_FLAGS_INIT "-64")
- ENDIF(CMAKE_FILE_SELF MATCHES " 64-bit ")
- ENDIF("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
-
+ if(CMAKE_FILE_SELF MATCHES " 64-bit ")
+ set(CMAKE_C_FLAGS_INIT "-64")
+ set(CMAKE_CXX_FLAGS_INIT "-64")
+ set(CMAKE_Fortran_FLAGS_INIT "-64")
+ set(CMAKE_EXE_LINKER_FLAGS_INIT "-64")
+ set(CMAKE_SHARED_LINKER_FLAGS_INIT "-64")
+ set(CMAKE_MODULE_LINKER_FLAGS_INIT "-64")
+ endif()
+ endif()
+
# Set remaining defaults.
- SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
+ set(CMAKE_CXX_CREATE_STATIC_LIBRARY
"<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
- SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
- SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
- SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
- SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
-ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
-INCLUDE(Platform/UnixPaths)
+ set (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
+ set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
+ set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
+ set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
+endif()
+include(Platform/UnixPaths)
-IF(NOT CMAKE_COMPILER_IS_GNUCC)
- SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE
+if(NOT CMAKE_COMPILER_IS_GNUCC)
+ 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>"
"mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
)
-ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
+endif()
-IF(NOT CMAKE_COMPILER_IS_GNUCXX)
- SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
+if(NOT CMAKE_COMPILER_IS_GNUCXX)
+ 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>"
"mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
)
-ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
+endif()
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
- SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
- SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach()
# The IRIX linker needs to find transitive shared library dependencies
# in the -L path.
-SET(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
+set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
diff --git a/Modules/Platform/Linux-CXX.cmake b/Modules/Platform/Linux-CXX.cmake
new file mode 100644
index 000000000..b594daeb0
--- /dev/null
+++ b/Modules/Platform/Linux-CXX.cmake
@@ -0,0 +1,3 @@
+if(NOT CMAKE_CXX_COMPILER_NAMES)
+ set(CMAKE_CXX_COMPILER_NAMES c++)
+endif()
diff --git a/Modules/Platform/Linux-Clang-C.cmake b/Modules/Platform/Linux-Clang-C.cmake
index dbf89564a..2a77d2710 100644
--- a/Modules/Platform/Linux-Clang-C.cmake
+++ b/Modules/Platform/Linux-Clang-C.cmake
@@ -1 +1 @@
-INCLUDE(Platform/Linux-GNU-C)
+include(Platform/Linux-GNU-C)
diff --git a/Modules/Platform/Linux-Clang-CXX.cmake b/Modules/Platform/Linux-Clang-CXX.cmake
index 8fe251c4d..9d9a4df66 100644
--- a/Modules/Platform/Linux-Clang-CXX.cmake
+++ b/Modules/Platform/Linux-Clang-CXX.cmake
@@ -1 +1 @@
-INCLUDE(Platform/Linux-GNU-CXX)
+include(Platform/Linux-GNU-CXX)
diff --git a/Modules/Platform/Linux-GNU-C.cmake b/Modules/Platform/Linux-GNU-C.cmake
index 3ab142f13..84dd49269 100644
--- a/Modules/Platform/Linux-GNU-C.cmake
+++ b/Modules/Platform/Linux-GNU-C.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/Linux-GNU)
+include(Platform/Linux-GNU)
__linux_compiler_gnu(C)
diff --git a/Modules/Platform/Linux-GNU-CXX.cmake b/Modules/Platform/Linux-GNU-CXX.cmake
index 9e4f904f2..416233531 100644
--- a/Modules/Platform/Linux-GNU-CXX.cmake
+++ b/Modules/Platform/Linux-GNU-CXX.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/Linux-GNU)
+include(Platform/Linux-GNU)
__linux_compiler_gnu(CXX)
diff --git a/Modules/Platform/Linux-GNU-Fortran.cmake b/Modules/Platform/Linux-GNU-Fortran.cmake
index e364c872a..68e95404b 100644
--- a/Modules/Platform/Linux-GNU-Fortran.cmake
+++ b/Modules/Platform/Linux-GNU-Fortran.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/Linux-GNU)
+include(Platform/Linux-GNU)
__linux_compiler_gnu(Fortran)
diff --git a/Modules/Platform/Linux-Intel-C.cmake b/Modules/Platform/Linux-Intel-C.cmake
index c909e68fc..d1694d64a 100644
--- a/Modules/Platform/Linux-Intel-C.cmake
+++ b/Modules/Platform/Linux-Intel-C.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/Linux-Intel)
+include(Platform/Linux-Intel)
__linux_compiler_intel(C)
diff --git a/Modules/Platform/Linux-Intel-CXX.cmake b/Modules/Platform/Linux-Intel-CXX.cmake
index 0b7daf475..66df3ac2a 100644
--- a/Modules/Platform/Linux-Intel-CXX.cmake
+++ b/Modules/Platform/Linux-Intel-CXX.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/Linux-Intel)
+include(Platform/Linux-Intel)
__linux_compiler_intel(CXX)
diff --git a/Modules/Platform/Linux-Intel-Fortran.cmake b/Modules/Platform/Linux-Intel-Fortran.cmake
index 342b5c2fa..bb671eeb2 100644
--- a/Modules/Platform/Linux-Intel-Fortran.cmake
+++ b/Modules/Platform/Linux-Intel-Fortran.cmake
@@ -1,4 +1,4 @@
-INCLUDE(Platform/Linux-Intel)
+include(Platform/Linux-Intel)
__linux_compiler_intel(Fortran)
set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS} -i_dynamic -nofor_main")
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-i_dynamic")
diff --git a/Modules/Platform/Linux-Intel.cmake b/Modules/Platform/Linux-Intel.cmake
index 47bf24659..2394f1050 100644
--- a/Modules/Platform/Linux-Intel.cmake
+++ b/Modules/Platform/Linux-Intel.cmake
@@ -28,7 +28,7 @@ if(NOT XIAR)
endforeach()
find_program(XIAR NAMES xiar HINTS ${_intel_xiar_hints})
mark_as_advanced(XIAR)
-endif(NOT XIAR)
+endif()
macro(__linux_compiler_intel lang)
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
diff --git a/Modules/Platform/Linux-SunPro-CXX.cmake b/Modules/Platform/Linux-SunPro-CXX.cmake
index 8ee96586d..a07f1ec84 100644
--- a/Modules/Platform/Linux-SunPro-CXX.cmake
+++ b/Modules/Platform/Linux-SunPro-CXX.cmake
@@ -6,4 +6,4 @@ if("${_cxx_flags}" MATCHES "\n-W[^\n]*component")
else()
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG "-rpath-link ")
endif()
-SET(CMAKE_EXE_EXPORTS_CXX_FLAG "--export-dynamic")
+set(CMAKE_EXE_EXPORTS_CXX_FLAG "--export-dynamic")
diff --git a/Modules/Platform/Linux-TinyCC-C.cmake b/Modules/Platform/Linux-TinyCC-C.cmake
index b753268ea..f78e708f9 100644
--- a/Modules/Platform/Linux-TinyCC-C.cmake
+++ b/Modules/Platform/Linux-TinyCC-C.cmake
@@ -1,4 +1,4 @@
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")
-SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "")
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-soname ")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")
+set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-soname ")
diff --git a/Modules/Platform/Linux-XL-C.cmake b/Modules/Platform/Linux-XL-C.cmake
index b1b07f617..f1c584ce5 100644
--- a/Modules/Platform/Linux-XL-C.cmake
+++ b/Modules/Platform/Linux-XL-C.cmake
@@ -1 +1 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj")
diff --git a/Modules/Platform/Linux-XL-CXX.cmake b/Modules/Platform/Linux-XL-CXX.cmake
index 071a975ed..abd3fa497 100644
--- a/Modules/Platform/Linux-XL-CXX.cmake
+++ b/Modules/Platform/Linux-XL-CXX.cmake
@@ -1 +1 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj")
+set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj")
diff --git a/Modules/Platform/Linux-XL-Fortran.cmake b/Modules/Platform/Linux-XL-Fortran.cmake
index 5da574e2e..cdd1f702b 100644
--- a/Modules/Platform/Linux-XL-Fortran.cmake
+++ b/Modules/Platform/Linux-XL-Fortran.cmake
@@ -1 +1 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-qmkshrobj")
+set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-qmkshrobj")
diff --git a/Modules/Platform/Linux-como.cmake b/Modules/Platform/Linux-como.cmake
index 7ea732082..d1550d201 100644
--- a/Modules/Platform/Linux-como.cmake
+++ b/Modules/Platform/Linux-como.cmake
@@ -1,17 +1,17 @@
# create a shared C++ library
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY
"<CMAKE_CXX_COMPILER> --prelink_objects <OBJECTS>"
"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
# create a C++ static library
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
+set(CMAKE_CXX_CREATE_STATIC_LIBRARY
"<CMAKE_CXX_COMPILER> --prelink_objects <OBJECTS>"
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
"<CMAKE_RANLIB> <TARGET> ")
-SET(CMAKE_CXX_LINK_EXECUTABLE
+set(CMAKE_CXX_LINK_EXECUTABLE
"<CMAKE_CXX_COMPILER> --prelink_objects <OBJECTS>"
"<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "")
diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake
index 38f469b33..fe8e0039f 100644
--- a/Modules/Platform/Linux.cmake
+++ b/Modules/Platform/Linux.cmake
@@ -1,22 +1,22 @@
-SET(CMAKE_DL_LIBS "dl")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+set(CMAKE_DL_LIBS "dl")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
# Shared libraries with no builtin soname may not be linked safely by
# specifying the file path.
-SET(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
+set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
- SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
- SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach()
# Debian policy requires that shared libraries be installed without
# executable permission. Fedora policy requires that shared libraries
@@ -26,32 +26,32 @@ ENDFOREACH(type)
# default. In order to support debian packages we provide an option
# here. The option default is based on the current distribution, but
# packagers can set it explicitly on the command line.
-IF(DEFINED CMAKE_INSTALL_SO_NO_EXE)
+if(DEFINED CMAKE_INSTALL_SO_NO_EXE)
# Store the decision variable in the cache. This preserves any
# setting the user provides on the command line.
- SET(CMAKE_INSTALL_SO_NO_EXE "${CMAKE_INSTALL_SO_NO_EXE}" CACHE INTERNAL
+ set(CMAKE_INSTALL_SO_NO_EXE "${CMAKE_INSTALL_SO_NO_EXE}" CACHE INTERNAL
"Install .so files without execute permission.")
-ELSE(DEFINED CMAKE_INSTALL_SO_NO_EXE)
+else()
# Store the decision variable as an internal cache entry to avoid
# checking the platform every time. This option is advanced enough
# that only package maintainers should need to adjust it. They are
# capable of providing a setting on the command line.
- IF(EXISTS "/etc/debian_version")
- SET(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
+ if(EXISTS "/etc/debian_version")
+ set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
"Install .so files without execute permission.")
- ELSE(EXISTS "/etc/debian_version")
- SET(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
+ else()
+ set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
"Install .so files without execute permission.")
- ENDIF(EXISTS "/etc/debian_version")
-ENDIF(DEFINED CMAKE_INSTALL_SO_NO_EXE)
+ endif()
+endif()
# Match multiarch library directory names.
-SET(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*")
+set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*")
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
# Debian has lib64 paths only for compatibility so they should not be
# searched.
-IF(EXISTS "/etc/debian_version")
- SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
-ENDIF(EXISTS "/etc/debian_version")
+if(EXISTS "/etc/debian_version")
+ set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
+endif()
diff --git a/Modules/Platform/MP-RAS.cmake b/Modules/Platform/MP-RAS.cmake
index ff22a4fda..fe8d81a1b 100644
--- a/Modules/Platform/MP-RAS.cmake
+++ b/Modules/Platform/MP-RAS.cmake
@@ -1,14 +1,14 @@
-IF(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
- SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
- SET(CMAKE_C_COMPILE_OPTIONS_PIE -K PIE)
- SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
-ELSE(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
- SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
- SET(CMAKE_C_COMPILE_OPTIONS_PIE -K PIE)
- SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
- SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-Bexport")
-ENDIF(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
+if(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
+ set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
+ set(CMAKE_C_COMPILE_OPTIONS_PIE -K PIE)
+ set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
+else()
+ set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
+ set(CMAKE_C_COMPILE_OPTIONS_PIE -K PIE)
+ set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
+ set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-Bexport")
+endif()
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake
index e1b66b84c..731827599 100644
--- a/Modules/Platform/NetBSD.cmake
+++ b/Modules/Platform/NetBSD.cmake
@@ -1,15 +1,15 @@
-IF(EXISTS /usr/include/dlfcn.h)
- SET(CMAKE_DL_LIBS "")
- SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
- SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
- SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -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 "-Wl,-rpath,") # -rpath
- SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # : or empty
- SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
- SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
- SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
-ENDIF(EXISTS /usr/include/dlfcn.h)
+if(EXISTS /usr/include/dlfcn.h)
+ set(CMAKE_DL_LIBS "")
+ set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
+ set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+ set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -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 "-Wl,-rpath,") # -rpath
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # : or empty
+ set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
+ set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+ set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+endif()
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake
index 49a30e971..9c3255e36 100644
--- a/Modules/Platform/OSF1.cmake
+++ b/Modules/Platform/OSF1.cmake
@@ -1,47 +1,47 @@
-SET(CMAKE_DL_LIBS "")
+set(CMAKE_DL_LIBS "")
-IF(CMAKE_SYSTEM MATCHES "OSF1-1.[012]")
-ENDIF(CMAKE_SYSTEM MATCHES "OSF1-1.[012]")
-IF(CMAKE_SYSTEM MATCHES "OSF1-1.*")
+if(CMAKE_SYSTEM MATCHES "OSF1-1.[012]")
+endif()
+if(CMAKE_SYSTEM MATCHES "OSF1-1.*")
# OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
- SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fpic")
- SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fpie")
- SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fpic") # -pic
- SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fpic") # -pic
-ENDIF(CMAKE_SYSTEM MATCHES "OSF1-1.*")
+ set(CMAKE_C_COMPILE_OPTIONS_PIC "-fpic")
+ set(CMAKE_C_COMPILE_OPTIONS_PIE "-fpie")
+ set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fpic") # -pic
+ set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fpic") # -pic
+endif()
-IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
- SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-expect_unresolved,\\*") # -shared
- IF(CMAKE_COMPILER_IS_GNUCXX)
- SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,-rpath,")
- ELSE(CMAKE_COMPILER_IS_GNUCXX)
- SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-rpath ")
- ENDIF(CMAKE_COMPILER_IS_GNUCXX)
- IF(CMAKE_COMPILER_IS_GNUCC)
- SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
- ELSE(CMAKE_COMPILER_IS_GNUCC)
- SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-rpath ")
- ENDIF(CMAKE_COMPILER_IS_GNUCC)
- SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+ set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-expect_unresolved,\\*") # -shared
+ if(CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,-rpath,")
+ else()
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-rpath ")
+ endif()
+ if(CMAKE_COMPILER_IS_GNUCC)
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+ else()
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-rpath ")
+ endif()
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+endif()
-SET(CMAKE_MAKE_INCLUDE_FROM_ROOT 1) # include $(CMAKE_BINARY_DIR)/...
+set(CMAKE_MAKE_INCLUDE_FROM_ROOT 1) # include $(CMAKE_BINARY_DIR)/...
-IF(CMAKE_COMPILER_IS_GNUCXX)
- # include the gcc flags
-ELSE (CMAKE_COMPILER_IS_GNUCXX)
+if(CMAKE_COMPILER_IS_GNUCXX)
+ # include the gcc flags
+else ()
# use default OSF compiler flags
- SET (CMAKE_C_FLAGS_INIT "")
- SET (CMAKE_C_FLAGS_DEBUG_INIT "-g")
- SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O2 -DNDEBUG")
- SET (CMAKE_C_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
- SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2")
- SET (CMAKE_CXX_FLAGS_INIT "")
- SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
- SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O2 -DNDEBUG")
- SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
- SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-INCLUDE(Platform/UnixPaths)
+ set (CMAKE_C_FLAGS_INIT "")
+ set (CMAKE_C_FLAGS_DEBUG_INIT "-g")
+ set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O2 -DNDEBUG")
+ set (CMAKE_C_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
+ set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2")
+ set (CMAKE_CXX_FLAGS_INIT "")
+ set (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
+ set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O2 -DNDEBUG")
+ set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
+ set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
+endif()
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/OpenBSD.cmake b/Modules/Platform/OpenBSD.cmake
index b4ed66fb0..df240e01b 100644
--- a/Modules/Platform/OpenBSD.cmake
+++ b/Modules/Platform/OpenBSD.cmake
@@ -1,18 +1,18 @@
-INCLUDE(Platform/NetBSD)
+include(Platform/NetBSD)
# On OpenBSD, the compile time linker does not share it's configuration with
# the runtime linker. This will extract the library search paths from the
# system's ld.so.hints file which will allow CMake to set the appropriate
# -rpath-link flags
-IF(NOT CMAKE_PLATFORM_RUNTIME_PATH)
- EXECUTE_PROCESS(COMMAND /sbin/ldconfig -r
+if(NOT CMAKE_PLATFORM_RUNTIME_PATH)
+ execute_process(COMMAND /sbin/ldconfig -r
OUTPUT_VARIABLE LDCONFIG_HINTS
ERROR_QUIET)
- STRING(REGEX REPLACE ".*search\\ directories:\\ ([^\n]*).*" "\\1"
+ string(REGEX REPLACE ".*search\\ directories:\\ ([^\n]*).*" "\\1"
LDCONFIG_HINTS "${LDCONFIG_HINTS}")
- STRING(REGEX REPLACE ":" ";"
+ string(REGEX REPLACE ":" ";"
CMAKE_PLATFORM_RUNTIME_PATH
"${LDCONFIG_HINTS}")
-ENDIF()
+endif()
-SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_OPENBSD_VERSIONING 1)
+set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_OPENBSD_VERSIONING 1)
diff --git a/Modules/Platform/OpenVMS.cmake b/Modules/Platform/OpenVMS.cmake
index c52effab6..b10da2388 100644
--- a/Modules/Platform/OpenVMS.cmake
+++ b/Modules/Platform/OpenVMS.cmake
@@ -1,8 +1,8 @@
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
-SET(CMAKE_C_CREATE_STATIC_LIBRARY
+set(CMAKE_C_CREATE_STATIC_LIBRARY
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>"
"<CMAKE_RANLIB> <TARGET>"
)
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY})
-SET(CMAKE_EXECUTABLE_SUFFIX ".exe") # .exe
+set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY})
+set(CMAKE_EXECUTABLE_SUFFIX ".exe") # .exe
diff --git a/Modules/Platform/QNX.cmake b/Modules/Platform/QNX.cmake
index 8cdbe02c1..2598411cd 100644
--- a/Modules/Platform/QNX.cmake
+++ b/Modules/Platform/QNX.cmake
@@ -1,33 +1,33 @@
-SET(QNXNTO 1)
+set(QNXNTO 1)
# The QNX GCC does not seem to have -isystem so remove the flag.
-SET(CMAKE_INCLUDE_SYSTEM_FLAG_C)
-SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+set(CMAKE_INCLUDE_SYSTEM_FLAG_C)
+set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
-SET(CMAKE_DL_LIBS "")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")
-SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+set(CMAKE_DL_LIBS "")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "")
+set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
# Shared libraries with no builtin soname may not be linked safely by
# specifying the file path.
-SET(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
+set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
- SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
- SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach()
# force the language to be c++ since qnx only has gcc and not g++ and c++?
-SET(CMAKE_CXX_COMPILE_OBJECT
+set(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> -x c++ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/RISCos.cmake b/Modules/Platform/RISCos.cmake
index 3b2a092bf..570cd7b5b 100644
--- a/Modules/Platform/RISCos.cmake
+++ b/Modules/Platform/RISCos.cmake
@@ -1,6 +1,6 @@
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0")
-SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
-SET(CMAKE_DL_LIBS "")
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-D,08000000")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0")
+set(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
+set(CMAKE_DL_LIBS "")
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-D,08000000")
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/SCO_SV.cmake b/Modules/Platform/SCO_SV.cmake
index cbdcb7dae..ddd960083 100644
--- a/Modules/Platform/SCO_SV.cmake
+++ b/Modules/Platform/SCO_SV.cmake
@@ -1,2 +1,2 @@
-SET(CMAKE_DL_LIBS "")
-INCLUDE(Platform/UnixPaths)
+set(CMAKE_DL_LIBS "")
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/SINIX.cmake b/Modules/Platform/SINIX.cmake
index e0809f8e3..c37a113d3 100644
--- a/Modules/Platform/SINIX.cmake
+++ b/Modules/Platform/SINIX.cmake
@@ -1,4 +1,4 @@
-SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
-SET(CMAKE_C_COMPILE_OPTIONS_PIE "")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
-INCLUDE(Platform/UnixPaths)
+set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
+set(CMAKE_C_COMPILE_OPTIONS_PIE "")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/SunOS.cmake b/Modules/Platform/SunOS.cmake
index de287aa70..da20f97a1 100644
--- a/Modules/Platform/SunOS.cmake
+++ b/Modules/Platform/SunOS.cmake
@@ -1,32 +1,32 @@
-IF(CMAKE_SYSTEM MATCHES "SunOS-4.*")
- SET(CMAKE_C_COMPILE_OPTIONS_PIC "-PIC")
- SET(CMAKE_C_COMPILE_OPTIONS_PIE "-PIE")
- SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-PIC")
- SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-r")
- SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-R")
- SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-ENDIF(CMAKE_SYSTEM MATCHES "SunOS-4.*")
+if(CMAKE_SYSTEM MATCHES "SunOS-4.*")
+ set(CMAKE_C_COMPILE_OPTIONS_PIC "-PIC")
+ set(CMAKE_C_COMPILE_OPTIONS_PIE "-PIE")
+ set(CMAKE_SHARED_LIBRARY_C_FLAGS "-PIC")
+ set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-r")
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-R")
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+endif()
-IF(CMAKE_COMPILER_IS_GNUCXX)
- IF(CMAKE_COMPILER_IS_GNUCC)
- SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+if(CMAKE_COMPILER_IS_GNUCXX)
+ if(CMAKE_COMPILER_IS_GNUCC)
+ set(CMAKE_CXX_CREATE_SHARED_LIBRARY
"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
- ELSE(CMAKE_COMPILER_IS_GNUCC)
+ else()
# Take default rule from CMakeDefaultMakeRuleVariables.cmake.
- ENDIF(CMAKE_COMPILER_IS_GNUCC)
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-INCLUDE(Platform/UnixPaths)
+ endif()
+endif()
+include(Platform/UnixPaths)
# Add the compiler's implicit link directories.
-IF("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro)
- LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+if("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro)
+ list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
/opt/SUNWspro/lib /opt/SUNWspro/prod/lib /usr/ccs/lib)
-ENDIF("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro)
+endif()
# The Sun linker needs to find transitive shared library dependencies
# in the -L path.
-SET(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
+set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
# Shared libraries with no builtin soname may not be linked safely by
# specifying the file path.
-SET(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
+set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
diff --git a/Modules/Platform/Tru64.cmake b/Modules/Platform/Tru64.cmake
index cf9d17bfd..47852f8e1 100644
--- a/Modules/Platform/Tru64.cmake
+++ b/Modules/Platform/Tru64.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/ULTRIX.cmake b/Modules/Platform/ULTRIX.cmake
index 4d0cf755d..9db4c7c20 100644
--- a/Modules/Platform/ULTRIX.cmake
+++ b/Modules/Platform/ULTRIX.cmake
@@ -1,5 +1,5 @@
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0")
-SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
-SET(CMAKE_DL_LIBS "")
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-D,08000000")
-INCLUDE(Platform/UnixPaths)
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0")
+set(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
+set(CMAKE_DL_LIBS "")
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-D,08000000")
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/UNIX_SV.cmake b/Modules/Platform/UNIX_SV.cmake
index 869b3a6a0..1ec96aea2 100644
--- a/Modules/Platform/UNIX_SV.cmake
+++ b/Modules/Platform/UNIX_SV.cmake
@@ -1,5 +1,5 @@
-SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
-SET(CMAKE_C_COMPILE_OPTIONS_PIE "")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-Bexport")
-INCLUDE(Platform/UnixPaths)
+set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
+set(CMAKE_C_COMPILE_OPTIONS_PIE "")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-Bexport")
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index 5ee7ddbd6..ccb266330 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -17,21 +17,21 @@
# "CMakeSystemSpecificInformation.cmake" already included it.
# The extra inclusion is a work-around documented next to the include()
# call, so this can be removed when the work-around is removed.
-IF(__UNIX_PATHS_INCLUDED)
- RETURN()
-ENDIF()
-SET(__UNIX_PATHS_INCLUDED 1)
+if(__UNIX_PATHS_INCLUDED)
+ return()
+endif()
+set(__UNIX_PATHS_INCLUDED 1)
-SET(UNIX 1)
+set(UNIX 1)
# also add the install directory of the running cmake to the search directories
# CMAKE_ROOT is CMAKE_INSTALL_PREFIX/share/cmake, so we need to go two levels up
-GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
-GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
+get_filename_component(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
+get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
# List common installation prefixes. These will be used for all
# search types.
-LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
+list(APPEND CMAKE_SYSTEM_PREFIX_PATH
# Standard
/usr/local /usr /
@@ -43,7 +43,7 @@ LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
)
# List common include file locations not under the common prefixes.
-LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
+list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
# Windows API on Cygwin
/usr/include/w32api
@@ -52,11 +52,11 @@ LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
# Other
/usr/pkg/include
- /opt/csw/include /opt/include
+ /opt/csw/include /opt/include
/usr/openwin/include
)
-LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
+list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
# Windows API on Cygwin
/usr/lib/w32api
@@ -65,24 +65,24 @@ LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
# Other
/usr/pkg/lib
- /opt/csw/lib /opt/lib
+ /opt/csw/lib /opt/lib
/usr/openwin/lib
)
-LIST(APPEND CMAKE_SYSTEM_PROGRAM_PATH
+list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
/usr/pkg/bin
)
-LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
/lib /usr/lib /usr/lib32 /usr/lib64
)
-LIST(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
+list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
/usr/include
)
-LIST(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
+list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
/usr/include
)
# Enable use of lib64 search path variants by default.
-SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
+set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
diff --git a/Modules/Platform/UnixWare.cmake b/Modules/Platform/UnixWare.cmake
index 3112ee1ef..e649bd2a4 100644
--- a/Modules/Platform/UnixWare.cmake
+++ b/Modules/Platform/UnixWare.cmake
@@ -1,5 +1,5 @@
-SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
-SET(CMAKE_C_COMPILE_OPTIONS_PIE "")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-Wl,-Bexport")
-INCLUDE(Platform/UnixPaths)
+set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
+set(CMAKE_C_COMPILE_OPTIONS_PIE "")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-Wl,-Bexport")
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/Windows-CXX.cmake b/Modules/Platform/Windows-CXX.cmake
new file mode 100644
index 000000000..bf37f7903
--- /dev/null
+++ b/Modules/Platform/Windows-CXX.cmake
@@ -0,0 +1,7 @@
+if(NOT CMAKE_CXX_COMPILER_NAMES)
+ set(CMAKE_CXX_COMPILER_NAMES c++)
+endif()
+
+# Exclude C++ compilers differing from C compiler only by case
+# because this platform may have a case-insensitive filesystem.
+set(CMAKE_CXX_COMPILER_EXCLUDE CC aCC xlC)
diff --git a/Modules/Platform/Windows-Embarcadero.cmake b/Modules/Platform/Windows-Embarcadero.cmake
index 62e8eb704..1662ac969 100644
--- a/Modules/Platform/Windows-Embarcadero.cmake
+++ b/Modules/Platform/Windows-Embarcadero.cmake
@@ -18,7 +18,7 @@ if(__WINDOWS_EMBARCADERO)
endif()
set(__WINDOWS_EMBARCADERO 1)
-SET(BORLAND 1)
+set(BORLAND 1)
if("${CMAKE_${_lang}_COMPILER_VERSION}" VERSION_LESS 6.30)
# Borland target type flags (bcc32 -h -t):
@@ -43,36 +43,36 @@ endif()
set(_COMPILE_C "-c")
set(_COMPILE_CXX "-P -c")
-SET(CMAKE_LIBRARY_PATH_FLAG "-L")
-SET(CMAKE_LINK_LIBRARY_FLAG "")
+set(CMAKE_LIBRARY_PATH_FLAG "-L")
+set(CMAKE_LINK_LIBRARY_FLAG "")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES "-bcc.lib" ".lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES "-bcc.lib" ".lib")
# uncomment these out to debug makefiles
-#SET(CMAKE_START_TEMP_FILE "")
-#SET(CMAKE_END_TEMP_FILE "")
-#SET(CMAKE_VERBOSE_MAKEFILE 1)
+#set(CMAKE_START_TEMP_FILE "")
+#set(CMAKE_END_TEMP_FILE "")
+#set(CMAKE_VERBOSE_MAKEFILE 1)
# Borland cannot handle + in the file name, so mangle object file name
-SET (CMAKE_MANGLE_OBJECT_FILE_NAMES "ON")
+set (CMAKE_MANGLE_OBJECT_FILE_NAMES "ON")
# extra flags for a win32 exe
-SET(CMAKE_CREATE_WIN32_EXE "${_tW}" )
+set(CMAKE_CREATE_WIN32_EXE "${_tW}" )
# extra flags for a console app
-SET(CMAKE_CREATE_CONSOLE_EXE "${_tC}" )
+set(CMAKE_CREATE_CONSOLE_EXE "${_tC}" )
-SET (CMAKE_BUILD_TYPE Debug CACHE STRING
+set (CMAKE_BUILD_TYPE Debug CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.")
-SET (CMAKE_EXE_LINKER_FLAGS_INIT "${_tM} -lS:10000000 -lSc:10000000 ")
-SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "-v")
-SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "-v")
-SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT})
+set (CMAKE_EXE_LINKER_FLAGS_INIT "${_tM} -lS:10000000 -lSc:10000000 ")
+set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "-v")
+set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "-v")
+set (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT})
macro(__embarcadero_language lang)
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index 4a37eca87..2bb7a2076 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -57,6 +57,10 @@ if("${_help}" MATCHES "GNU ld .* 2\\.1[1-6]")
set(__WINDOWS_GNU_LD_RESPONSE 0)
endif()
+if(NOT CMAKE_GENERATOR_RC AND CMAKE_GENERATOR MATCHES "Unix Makefiles")
+ set(CMAKE_GENERATOR_RC windres)
+endif()
+
enable_language(RC)
macro(__windows_compiler_gnu lang)
@@ -74,7 +78,7 @@ macro(__windows_compiler_gnu lang)
foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
set(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Wl,-Bstatic")
set(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic")
- endforeach(type)
+ endforeach()
endif()
# No -fPIC on Windows
diff --git a/Modules/Platform/Windows-Intel-Fortran.cmake b/Modules/Platform/Windows-Intel-Fortran.cmake
index 5c016a8fd..40523ffe5 100644
--- a/Modules/Platform/Windows-Intel-Fortran.cmake
+++ b/Modules/Platform/Windows-Intel-Fortran.cmake
@@ -4,8 +4,8 @@ set(_COMPILE_Fortran " /fpp")
set(CMAKE_Fortran_MODDIR_FLAG "-module:")
set(CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib")
__windows_compiler_intel(Fortran)
-SET (CMAKE_Fortran_FLAGS_INIT "/W1 /nologo /fpp /libs:dll /threads")
-SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /dbglibs")
-SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O1 /D NDEBUG")
-SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/O2 /D NDEBUG")
-SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O2 /debug:full /D NDEBUG")
+set (CMAKE_Fortran_FLAGS_INIT "/W1 /nologo /fpp /libs:dll /threads")
+set (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /dbglibs")
+set (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O1 /D NDEBUG")
+set (CMAKE_Fortran_FLAGS_RELEASE_INIT "/O2 /D NDEBUG")
+set (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O2 /debug:full /D NDEBUG")
diff --git a/Modules/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake
index 2a54a981b..58da8c56d 100644
--- a/Modules/Platform/Windows-Intel.cmake
+++ b/Modules/Platform/Windows-Intel.cmake
@@ -19,65 +19,65 @@ endif()
set(__WINDOWS_INTEL 1)
# make sure to enable languages after setting configuration types
-ENABLE_LANGUAGE(RC)
-SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
+enable_language(RC)
+set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
-SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
-SET(CMAKE_LINK_LIBRARY_FLAG "")
-SET(WIN32 1)
-IF(CMAKE_VERBOSE_MAKEFILE)
- SET(CMAKE_CL_NOLOGO)
-ELSE(CMAKE_VERBOSE_MAKEFILE)
- SET(CMAKE_CL_NOLOGO "/nologo")
-ENDIF(CMAKE_VERBOSE_MAKEFILE)
-SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
-SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
-SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
+set(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
+set(CMAKE_LINK_LIBRARY_FLAG "")
+set(WIN32 1)
+if(CMAKE_VERBOSE_MAKEFILE)
+ set(CMAKE_CL_NOLOGO)
+else()
+ set(CMAKE_CL_NOLOGO "/nologo")
+endif()
+set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
+set(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
+set(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
# default to Debug builds
-#SET(CMAKE_BUILD_TYPE_INIT Debug)
-SET(CMAKE_BUILD_TYPE_INIT Release)
+#set(CMAKE_BUILD_TYPE_INIT Debug)
+set(CMAKE_BUILD_TYPE_INIT Release)
-SET(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib")
-SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
+set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib")
+set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
# executable linker flags
-SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
-IF(MSVC_C_ARCHITECTURE_ID)
- SET(_MACHINE_ARCH_FLAG "/machine:${MSVC_C_ARCHITECTURE_ID}")
-ELSEIF(MSVC_CXX_ARCHITECTURE_ID)
- SET(_MACHINE_ARCH_FLAG "/machine:${MSVC_CXX_ARCHITECTURE_ID}")
-ELSEIF(MSVC_Fortran_ARCHITECTURE_ID)
- SET(_MACHINE_ARCH_FLAG "/machine:${MSVC_Fortran_ARCHITECTURE_ID}")
-ENDIF()
-SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /INCREMENTAL:YES ${_MACHINE_ARCH_FLAG}")
-SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
-SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug")
+set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
+if(MSVC_C_ARCHITECTURE_ID)
+ set(_MACHINE_ARCH_FLAG "/machine:${MSVC_C_ARCHITECTURE_ID}")
+elseif(MSVC_CXX_ARCHITECTURE_ID)
+ set(_MACHINE_ARCH_FLAG "/machine:${MSVC_CXX_ARCHITECTURE_ID}")
+elseif(MSVC_Fortran_ARCHITECTURE_ID)
+ set(_MACHINE_ARCH_FLAG "/machine:${MSVC_Fortran_ARCHITECTURE_ID}")
+endif()
+set (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /INCREMENTAL:YES ${_MACHINE_ARCH_FLAG}")
+set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
+set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug")
-SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
-INCLUDE("${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake" OPTIONAL)
+include("${CMAKE_PLATFORM_INFO_DIR}/CMakeIntelInformation.cmake" OPTIONAL)
-IF(NOT _INTEL_XILINK_TEST_RUN)
- EXECUTE_PROCESS(COMMAND xilink /?
+if(NOT _INTEL_XILINK_TEST_RUN)
+ execute_process(COMMAND xilink /?
ERROR_VARIABLE _XILINK_ERR
OUTPUT_VARIABLE _XILINK_HELP)
- IF(_XILINK_HELP MATCHES MANIFEST)
- SET(_INTEL_COMPILER_SUPPORTS_MANIFEST 1)
- ENDIF(_XILINK_HELP MATCHES MANIFEST)
- IF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake")
- FILE(WRITE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake
+ if(_XILINK_HELP MATCHES MANIFEST)
+ set(_INTEL_COMPILER_SUPPORTS_MANIFEST 1)
+ endif()
+ if(NOT EXISTS "${CMAKE_PLATFORM_INFO_DIR}/CMakeIntelInformation.cmake")
+ file(WRITE ${CMAKE_PLATFORM_INFO_DIR}/CMakeIntelInformation.cmake
"
-SET(_INTEL_XILINK_TEST_RUN 1)
-SET(_INTEL_COMPILER_SUPPORTS_MANIFEST ${_INTEL_COMPILER_SUPPORTS_MANIFEST})
+set(_INTEL_XILINK_TEST_RUN 1)
+set(_INTEL_COMPILER_SUPPORTS_MANIFEST ${_INTEL_COMPILER_SUPPORTS_MANIFEST})
")
- ENDIF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake")
-ENDIF(NOT _INTEL_XILINK_TEST_RUN)
+ endif()
+endif()
macro(__windows_compiler_intel lang)
set(CMAKE_${lang}_COMPILE_OBJECT
@@ -89,8 +89,9 @@ macro(__windows_compiler_intel lang)
set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
"xilink ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_CREATE_SHARED_MODULE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
+ set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link")
set(CMAKE_${lang}_LINK_EXECUTABLE
- "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link /implib:<TARGET_IMPLIB> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> <OBJECTS> /link /implib:<TARGET_IMPLIB> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000${_FLAGS_${lang}}")
set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Od /RTC1")
set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/DNDEBUG /MD /O1")
@@ -98,11 +99,11 @@ macro(__windows_compiler_intel lang)
set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/DNDEBUG /MD /Zi /O2")
if(_INTEL_COMPILER_SUPPORTS_MANIFEST)
- SET(CMAKE_${lang}_LINK_EXECUTABLE
+ set(CMAKE_${lang}_LINK_EXECUTABLE
"<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_${lang}_LINK_EXECUTABLE}")
- SET(CMAKE_${lang}_CREATE_SHARED_LIBRARY
+ set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
"<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
- SET(CMAKE_${lang}_CREATE_SHARED_MODULE
+ set(CMAKE_${lang}_CREATE_SHARED_MODULE
"<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_${lang}_CREATE_SHARED_MODULE}")
endif()
endmacro()
diff --git a/Modules/Platform/Windows-MSVC-C.cmake b/Modules/Platform/Windows-MSVC-C.cmake
new file mode 100644
index 000000000..e81df9f83
--- /dev/null
+++ b/Modules/Platform/Windows-MSVC-C.cmake
@@ -0,0 +1,2 @@
+include(Platform/Windows-MSVC)
+__windows_compiler_msvc(C)
diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake
new file mode 100644
index 000000000..fdd1dae05
--- /dev/null
+++ b/Modules/Platform/Windows-MSVC-CXX.cmake
@@ -0,0 +1,3 @@
+include(Platform/Windows-MSVC)
+set(_COMPILE_CXX " /TP")
+__windows_compiler_msvc(CXX)
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
new file mode 100644
index 000000000..1f28c503b
--- /dev/null
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -0,0 +1,241 @@
+
+#=============================================================================
+# Copyright 2001-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(__WINDOWS_MSVC)
+ return()
+endif()
+set(__WINDOWS_MSVC 1)
+
+set(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
+set(CMAKE_LINK_LIBRARY_FLAG "")
+set(MSVC 1)
+
+# hack: if a new cmake (which uses CMAKE__LINKER) runs on an old build tree
+# (where link was hardcoded) and where CMAKE_LINKER isn't in the cache
+# and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
+# hardcode CMAKE_LINKER here to link, so it behaves as it did before, Alex
+if(NOT DEFINED CMAKE_LINKER)
+ set(CMAKE_LINKER link)
+endif()
+
+if(CMAKE_VERBOSE_MAKEFILE)
+ set(CMAKE_CL_NOLOGO)
+else()
+ set(CMAKE_CL_NOLOGO "/nologo")
+endif()
+
+set(WIN32 1)
+
+if(CMAKE_SYSTEM_NAME MATCHES "WindowsCE")
+ set(CMAKE_CREATE_WIN32_EXE "/subsystem:windowsce /entry:WinMainCRTStartup")
+ set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /entry:mainACRTStartup")
+else()
+ set(CMAKE_CREATE_WIN32_EXE "/subsystem:windows")
+ set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:console")
+endif()
+
+if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
+ set (CMAKE_NO_BUILD_TYPE 1)
+endif()
+if(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
+ set (CMAKE_NO_BUILD_TYPE 1)
+ set (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING
+ "Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.")
+ mark_as_advanced(CMAKE_CONFIGURATION_TYPES)
+endif()
+
+# make sure to enable languages after setting configuration types
+enable_language(RC)
+set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
+
+if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+ set(MSVC_IDE 1)
+else()
+ set(MSVC_IDE 0)
+endif()
+
+if(NOT MSVC_VERSION)
+ if(CMAKE_C_COMPILER_VERSION)
+ set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
+ else()
+ set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
+ endif()
+ if("${_compiler_version}" MATCHES "^([0-9]+)\\.([0-9]+)")
+ math(EXPR MSVC_VERSION "${CMAKE_MATCH_1}*100 + ${CMAKE_MATCH_2}")
+ else()
+ message(FATAL_ERROR "MSVC compiler version not detected properly: ${_compiler_version}")
+ endif()
+
+ set(MSVC10)
+ set(MSVC11)
+ set(MSVC60)
+ set(MSVC70)
+ set(MSVC71)
+ set(MSVC80)
+ set(MSVC90)
+ set(CMAKE_COMPILER_2005)
+ set(CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+ if(NOT "${_compiler_version}" VERSION_LESS 17)
+ set(MSVC11 1)
+ elseif(NOT "${_compiler_version}" VERSION_LESS 16)
+ set(MSVC10 1)
+ elseif(NOT "${_compiler_version}" VERSION_LESS 15)
+ set(MSVC90 1)
+ elseif(NOT "${_compiler_version}" VERSION_LESS 14)
+ set(MSVC80 1)
+ set(CMAKE_COMPILER_2005 1)
+ elseif(NOT "${_compiler_version}" VERSION_LESS 13.10)
+ set(MSVC71 1)
+ elseif(NOT "${_compiler_version}" VERSION_LESS 13)
+ set(MSVC70 1)
+ else()
+ set(MSVC60 1)
+ set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1)
+ endif()
+endif()
+
+if(MSVC_C_ARCHITECTURE_ID MATCHES 64)
+ set(CMAKE_CL_64 1)
+else()
+ set(CMAKE_CL_64 0)
+endif()
+if(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64)
+ set(CMAKE_CL_64 1)
+endif()
+
+if("${MSVC_VERSION}" GREATER 1599)
+ set(MSVC_INCREMENTAL_DEFAULT ON)
+endif()
+
+# default to Debug builds
+set(CMAKE_BUILD_TYPE_INIT Debug)
+
+if(CMAKE_SYSTEM_NAME MATCHES "WindowsCE")
+ string(TOUPPER "${MSVC_C_ARCHITECTURE_ID}" _MSVC_C_ARCHITECTURE_ID_UPPER)
+ string(TOUPPER "${MSVC_CXX_ARCHITECTURE_ID}" _MSVC_CXX_ARCHITECTURE_ID_UPPER)
+
+ if("${CMAKE_SYSTEM_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)")
+ math(EXPR _CE_VERSION "${CMAKE_MATCH_1}*100 + ${CMAKE_MATCH_2}")
+ elseif("${CMAKE_SYSTEM_VERSION}" STREQUAL "")
+ set(_CE_VERSION "500")
+ else()
+ message(FATAL_ERROR "Invalid Windows CE version: ${CMAKE_SYSTEM_VERSION}")
+ endif()
+
+ set(_PLATFORM_DEFINES "/D_WIN32_WCE=0x${_CE_VERSION} /DUNDER_CE")
+ set(_PLATFORM_DEFINES_C " /D${MSVC_C_ARCHITECTURE_ID} /D_${_MSVC_C_ARCHITECTURE_ID_UPPER}_")
+ set(_PLATFORM_DEFINES_CXX " /D${MSVC_CXX_ARCHITECTURE_ID} /D_${_MSVC_CXX_ARCHITECTURE_ID_UPPER}_")
+
+ set(_RTC1 "")
+ set(_FLAGS_CXX " /GR /EHsc")
+ set(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib")
+ set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /NODEFAULTLIB:libc.lib /NODEFAULTLIB:oldnames.lib")
+else()
+ set(_PLATFORM_DEFINES "/DWIN32")
+
+ if(MSVC_VERSION GREATER 1310)
+ set(_RTC1 "/RTC1")
+ set(_FLAGS_CXX " /GR /EHsc")
+ set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib")
+ else()
+ set(_RTC1 "/GZ")
+ set(_FLAGS_CXX " /GR /GX")
+ set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib")
+ endif()
+endif()
+
+set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
+
+# executable linker flags
+set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
+# set the stack size and the machine type
+set(_MACHINE_ARCH_FLAG ${MSVC_C_ARCHITECTURE_ID})
+if(NOT _MACHINE_ARCH_FLAG)
+ set(_MACHINE_ARCH_FLAG ${MSVC_CXX_ARCHITECTURE_ID})
+endif()
+if(CMAKE_SYSTEM_NAME MATCHES "WindowsCE")
+ if(_MACHINE_ARCH_FLAG MATCHES "ARM")
+ set(_MACHINE_ARCH_FLAG "THUMB")
+ elseif(_MACHINE_ARCH_FLAG MATCHES "SH")
+ set(_MACHINE_ARCH_FLAG "SH4")
+ endif()
+endif()
+set (CMAKE_EXE_LINKER_FLAGS_INIT
+ "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:${_MACHINE_ARCH_FLAG}")
+
+# add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype
+# on versions that support it
+set( MSVC_INCREMENTAL_YES_FLAG "")
+if(NOT MSVC_INCREMENTAL_DEFAULT)
+ set( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:YES")
+else()
+ set( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL" )
+endif()
+
+if (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+ set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
+ set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
+else ()
+ set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
+ set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
+endif ()
+# for release and minsize release default to no incremental linking
+set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT "/INCREMENTAL:NO")
+set(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "/INCREMENTAL:NO")
+
+# copy the EXE_LINKER flags to SHARED and MODULE linker flags
+# shared linker flags
+set (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
+# module linker flags
+set (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
+
+macro(__windows_compiler_msvc lang)
+ if(NOT "${CMAKE_${lang}_COMPILER_VERSION}" VERSION_LESS 14)
+ # for 2005 make sure the manifest is put in the dll with mt
+ set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll ")
+ set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe ")
+ endif()
+ set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
+ "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
+
+ set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
+ set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
+
+ set(CMAKE_${lang}_COMPILE_OBJECT
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE
+ "<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /FoNUL /FAs /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
+
+ set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link")
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+ set(CMAKE_${lang}_LINK_EXECUTABLE
+ "${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> <OBJECTS> /link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+
+ set(CMAKE_${lang}_FLAGS_INIT "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} /D_WINDOWS /W3 /Zm1000${_FLAGS_${lang}}")
+ set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}")
+ set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
+ set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
+ set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
+endmacro()
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake
deleted file mode 100644
index be6abb690..000000000
--- a/Modules/Platform/Windows-cl.cmake
+++ /dev/null
@@ -1,253 +0,0 @@
-# try to load any previously computed information for C on this platform
-INCLUDE( ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake OPTIONAL)
-# try to load any previously computed information for CXX on this platform
-INCLUDE( ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake OPTIONAL)
-
-SET(WIN32 1)
-
-INCLUDE(Platform/cl)
-
-SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
-SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
-
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
- SET (CMAKE_NO_BUILD_TYPE 1)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
-IF(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
- SET (CMAKE_NO_BUILD_TYPE 1)
- SET (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING
- "Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.")
- MARK_AS_ADVANCED(CMAKE_CONFIGURATION_TYPES)
-ENDIF(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
-# does the compiler support pdbtype and is it the newer compiler
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
- SET(CMAKE_COMPILER_2005 1)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
-
-# make sure to enable languages after setting configuration types
-ENABLE_LANGUAGE(RC)
-SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
-
-# for nmake we need to compute some information about the compiler
-# that is being used.
-# the compiler may be free command line, 6, 7, or 71, and
-# each have properties that must be determined.
-# to avoid running these tests with each cmake run, the
-# test results are saved in CMakeCPlatform.cmake, a file
-# that is automatically copied into try_compile directories
-# by the global generator.
-SET(MSVC_IDE 1)
-IF(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
- SET(MSVC_IDE 0)
- IF(NOT CMAKE_VC_COMPILER_TESTS_RUN)
- SET(CMAKE_VC_COMPILER_TESTS 1)
- SET(testNmakeCLVersionFile
- "${CMAKE_ROOT}/Modules/CMakeTestNMakeCLVersion.c")
- STRING(REGEX REPLACE "/" "\\\\" testNmakeCLVersionFile "${testNmakeCLVersionFile}")
- MESSAGE(STATUS "Check for CL compiler version")
- SET(CMAKE_TEST_COMPILER ${CMAKE_C_COMPILER})
- IF (NOT CMAKE_C_COMPILER)
- SET(CMAKE_TEST_COMPILER ${CMAKE_CXX_COMPILER})
- ENDIF(NOT CMAKE_C_COMPILER)
- EXEC_PROGRAM(${CMAKE_TEST_COMPILER}
- ARGS /nologo -EP \"${testNmakeCLVersionFile}\"
- OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
- RETURN_VALUE CMAKE_COMPILER_RETURN
- )
- IF(NOT CMAKE_COMPILER_RETURN)
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Determining the version of compiler passed with the following output:\n"
- "${CMAKE_COMPILER_OUTPUT}\n\n")
- STRING(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}")
- STRING(REGEX REPLACE ".*VERSION=(.*)" "\\1"
- compilerVersion "${compilerVersion}")
- MESSAGE(STATUS "Check for CL compiler version - ${compilerVersion}")
- SET(MSVC60)
- SET(MSVC70)
- SET(MSVC71)
- SET(MSVC80)
- SET(CMAKE_COMPILER_2005)
- IF("${compilerVersion}" LESS 1300)
- SET(MSVC60 1)
- SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1)
- ENDIF("${compilerVersion}" LESS 1300)
- IF("${compilerVersion}" EQUAL 1300)
- SET(MSVC70 1)
- SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
- ENDIF("${compilerVersion}" EQUAL 1300)
- IF("${compilerVersion}" EQUAL 1310)
- SET(MSVC71 1)
- SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
- ENDIF("${compilerVersion}" EQUAL 1310)
- IF("${compilerVersion}" EQUAL 1400)
- SET(MSVC80 1)
- SET(CMAKE_COMPILER_2005 1)
- ENDIF("${compilerVersion}" EQUAL 1400)
- IF("${compilerVersion}" EQUAL 1500)
- SET(MSVC90 1)
- ENDIF("${compilerVersion}" EQUAL 1500)
- IF("${compilerVersion}" EQUAL 1600)
- SET(MSVC10 1)
- ENDIF("${compilerVersion}" EQUAL 1600)
- SET(MSVC_VERSION "${compilerVersion}")
- ELSE(NOT CMAKE_COMPILER_RETURN)
- MESSAGE(STATUS "Check for CL compiler version - failed")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining the version of compiler failed with the following output:\n"
- "${CMAKE_COMPILER_OUTPUT}\n\n")
- ENDIF(NOT CMAKE_COMPILER_RETURN)
- # try to figure out if we are running the free command line
- # tools from Microsoft. These tools do not provide debug libraries,
- # so the link flags used have to be different.
- MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp2")
- SET(testForFreeVCFile
- "${CMAKE_ROOT}/Modules/CMakeTestForFreeVC.cxx")
- STRING(REGEX REPLACE "/" "\\\\" testForFreeVCFile "${testForFreeVCFile}")
- MESSAGE(STATUS "Check if this is a free VC compiler")
- EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp2
- ARGS /nologo /MD /EHsc
- \"${testForFreeVCFile}\"
- OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
- RETURN_VALUE CMAKE_COMPILER_RETURN
- )
- IF(CMAKE_COMPILER_RETURN)
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining if this is a free VC compiler failed with the following output:\n"
- "${CMAKE_COMPILER_OUTPUT}\n\n")
- MESSAGE(STATUS "Check if this is a free VC compiler - yes")
- SET(CMAKE_USING_VC_FREE_TOOLS 1)
- ELSE(CMAKE_COMPILER_RETURN)
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Determining if this is a free VC compiler passed with the following output:\n"
- "${CMAKE_COMPILER_OUTPUT}\n\n")
- MESSAGE(STATUS "Check if this is a free VC compiler - no")
- SET(CMAKE_USING_VC_FREE_TOOLS 0)
- ENDIF(CMAKE_COMPILER_RETURN)
- MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3")
- ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN)
-ENDIF(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
-
-IF(MSVC_C_ARCHITECTURE_ID MATCHES 64)
- SET(CMAKE_CL_64 1)
-ELSE(MSVC_C_ARCHITECTURE_ID MATCHES 64)
- SET(CMAKE_CL_64 0)
-ENDIF(MSVC_C_ARCHITECTURE_ID MATCHES 64)
-IF(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64)
- SET(CMAKE_CL_64 1)
-ENDIF(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64)
-
-IF("${MSVC_VERSION}" GREATER 1599)
- SET(MSVC_INCREMENTAL_DEFAULT ON)
-ENDIF()
-
-# default to Debug builds
-IF(MSVC_VERSION GREATER 1310)
- # for 2005 make sure the manifest is put in the dll with mt
- SET(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
- SET(CMAKE_CXX_CREATE_SHARED_MODULE "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_MODULE}")
- # create a C shared library
- SET(CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
- # create a C shared module just copy the shared library rule
- SET(CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE}")
- SET(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_CXX_LINK_EXECUTABLE}")
- SET(CMAKE_C_LINK_EXECUTABLE "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_C_LINK_EXECUTABLE}")
-
- SET(CMAKE_BUILD_TYPE_INIT Debug)
- SET (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR")
- SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1")
- SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
- SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
- SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
- SET (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000")
- SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1")
- SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
- SET (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
- SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
- SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ")
- SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT}")
-ELSE(MSVC_VERSION GREATER 1310)
- IF(CMAKE_USING_VC_FREE_TOOLS)
- MESSAGE(STATUS "Using FREE VC TOOLS, NO DEBUG available")
- SET(CMAKE_BUILD_TYPE_INIT Release)
- SET (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")
- SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi /Ob0 /Od /GZ")
- SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
- SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
- SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
- SET (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000")
- SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi /Ob0 /Od /GZ")
- SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
- SET (CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
- SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
- ELSE(CMAKE_USING_VC_FREE_TOOLS)
- SET(CMAKE_BUILD_TYPE_INIT Debug)
- SET (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")
- SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /GZ")
- SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
- SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
- SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
- SET (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000")
- SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /GZ")
- SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
- SET (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
- SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
- ENDIF(CMAKE_USING_VC_FREE_TOOLS)
- SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib")
-ENDIF(MSVC_VERSION GREATER 1310)
-
-SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
-
-# executable linker flags
-SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
-# set the stack size and the machine type
-SET(_MACHINE_ARCH_FLAG ${MSVC_C_ARCHITECTURE_ID})
-IF(NOT _MACHINE_ARCH_FLAG)
- SET(_MACHINE_ARCH_FLAG ${MSVC_CXX_ARCHITECTURE_ID})
-ENDIF(NOT _MACHINE_ARCH_FLAG)
-SET (CMAKE_EXE_LINKER_FLAGS_INIT
- "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:${_MACHINE_ARCH_FLAG}")
-
-# add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype
-# on versions that support it
-SET( MSVC_INCREMENTAL_YES_FLAG "")
-IF(NOT MSVC_INCREMENTAL_DEFAULT)
- SET( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:YES")
-ELSE()
- SET( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL" )
-ENDIF()
-
-IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
- SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
- SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
-ELSE (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
- SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
- SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
-ENDIF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
-# for release and minsize release default to no incremental linking
-SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT "/INCREMENTAL:NO")
-SET(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "/INCREMENTAL:NO")
-
-# copy the EXE_LINKER flags to SHARED and MODULE linker flags
-# shared linker flags
-SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
-# module linker flags
-SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
-
-# save computed information for this platform
-IF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake")
- CONFIGURE_FILE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCPlatform.cmake IMMEDIATE)
-ENDIF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake")
-
-IF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake")
- CONFIGURE_FILE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXPlatform.cmake IMMEDIATE)
-ENDIF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake")
diff --git a/Modules/Platform/Windows-cl.cmake.in b/Modules/Platform/Windows-cl.cmake.in
deleted file mode 100644
index 82a0e595f..000000000
--- a/Modules/Platform/Windows-cl.cmake.in
+++ /dev/null
@@ -1,14 +0,0 @@
-SET(CMAKE_VC_COMPILER_TESTS_RUN 1)
-SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE @CMAKE_COMPILER_SUPPORTS_PDBTYPE@)
-SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@)
-SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@)
-SET(CMAKE_CL_64 @CMAKE_CL_64@)
-SET(MSVC60 @MSVC60@)
-SET(MSVC70 @MSVC70@)
-SET(MSVC71 @MSVC71@)
-SET(MSVC80 @MSVC80@)
-SET(MSVC90 @MSVC90@)
-SET(MSVC10 @MSVC10@)
-SET(MSVC_IDE @MSVC_IDE@)
-SET(MSVC_VERSION @MSVC_VERSION@)
-SET(WIN32 1)
diff --git a/Modules/Platform/Windows-df.cmake b/Modules/Platform/Windows-df.cmake
index f5046bf35..7e2ac9fe4 100644
--- a/Modules/Platform/Windows-df.cmake
+++ b/Modules/Platform/Windows-df.cmake
@@ -1,70 +1,71 @@
# compiler support for fortran CVF compiler on windows
-SET(CMAKE_WINDOWS_OBJECT_PATH 1)
-SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
-SET(CMAKE_LINK_LIBRARY_FLAG "")
-SET(WIN32 1)
-IF(CMAKE_VERBOSE_MAKEFILE)
- SET(CMAKE_CL_NOLOGO)
-ELSE(CMAKE_VERBOSE_MAKEFILE)
- SET(CMAKE_CL_NOLOGO "/nologo")
-ENDIF(CMAKE_VERBOSE_MAKEFILE)
+set(CMAKE_WINDOWS_OBJECT_PATH 1)
+set(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
+set(CMAKE_LINK_LIBRARY_FLAG "")
+set(WIN32 1)
+if(CMAKE_VERBOSE_MAKEFILE)
+ set(CMAKE_CL_NOLOGO)
+else()
+ set(CMAKE_CL_NOLOGO "/nologo")
+endif()
-SET(CMAKE_Fortran_MODDIR_FLAG "-module:")
+set(CMAKE_Fortran_MODDIR_FLAG "-module:")
-SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
+set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
"link ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
-SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
+set(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
# create a C++ static library
-SET(CMAKE_Fortran_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
+set(CMAKE_Fortran_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
# compile a C++ file into an object file
-SET(CMAKE_Fortran_COMPILE_OBJECT
+set(CMAKE_Fortran_COMPILE_OBJECT
"<CMAKE_Fortran_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /object:<OBJECT> <FLAGS> /compile_only <SOURCE>${CMAKE_END_TEMP_FILE}")
-SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
+set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
-SET(CMAKE_Fortran_LINK_EXECUTABLE
- "<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /exe:<TARGET> /link <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link")
+set(CMAKE_Fortran_LINK_EXECUTABLE
+ "<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /exe:<TARGET> <OBJECTS> /link <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
-SET(CMAKE_CREATE_WIN32_EXE /winapp)
-SET(CMAKE_CREATE_CONSOLE_EXE )
+set(CMAKE_CREATE_WIN32_EXE /winapp)
+set(CMAKE_CREATE_CONSOLE_EXE )
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
- SET (CMAKE_NO_BUILD_TYPE 1)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
- SET (CMAKE_NO_BUILD_TYPE 1)
- SET (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING
+if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
+ set (CMAKE_NO_BUILD_TYPE 1)
+endif()
+if(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
+ set (CMAKE_NO_BUILD_TYPE 1)
+ set (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING
"Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.")
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
+endif()
# does the compiler support pdbtype and is it the newer compiler
-SET(CMAKE_BUILD_TYPE_INIT Debug)
-SET (CMAKE_Fortran_FLAGS_INIT "")
-SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full")
-SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/Optimize:2 /Define:NDEBUG")
-SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/Optimize:1 /Define:NDEBUG")
-SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/Optimize:1 /debug:full /Define:NDEBUG")
+set(CMAKE_BUILD_TYPE_INIT Debug)
+set (CMAKE_Fortran_FLAGS_INIT "")
+set (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full")
+set (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/Optimize:2 /Define:NDEBUG")
+set (CMAKE_Fortran_FLAGS_RELEASE_INIT "/Optimize:1 /Define:NDEBUG")
+set (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/Optimize:1 /debug:full /Define:NDEBUG")
-SET (CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib")
+set (CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib")
# executable linker flags
-SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
-SET (CMAKE_EXE_LINKER_FLAGS_INIT " /INCREMENTAL:YES")
-IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
- SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept")
- SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept")
-ELSE (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
- SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
- SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug")
-ENDIF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
+set (CMAKE_EXE_LINKER_FLAGS_INIT " /INCREMENTAL:YES")
+if (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+ set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept")
+ set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept")
+else ()
+ set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
+ set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug")
+endif ()
-SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake
index 14b3b81d5..8a03b2972 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -1,122 +1,109 @@
-SET(CMAKE_LIBRARY_PATH_FLAG "libpath ")
-SET(CMAKE_LINK_LIBRARY_FLAG "library ")
-SET(CMAKE_LINK_LIBRARY_FILE_FLAG "library")
-
-IF(CMAKE_VERBOSE_MAKEFILE)
- SET(CMAKE_WCL_QUIET)
- SET(CMAKE_WLINK_QUIET)
- SET(CMAKE_LIB_QUIET)
-ELSE(CMAKE_VERBOSE_MAKEFILE)
- SET(CMAKE_WCL_QUIET "-zq")
- SET(CMAKE_WLINK_QUIET "option quiet")
- SET(CMAKE_LIB_QUIET "-q")
-ENDIF(CMAKE_VERBOSE_MAKEFILE)
+set(CMAKE_LIBRARY_PATH_FLAG "libpath ")
+set(CMAKE_LINK_LIBRARY_FLAG "library ")
+set(CMAKE_LINK_LIBRARY_FILE_FLAG "library")
+
+if(CMAKE_VERBOSE_MAKEFILE)
+ set(CMAKE_WCL_QUIET)
+ set(CMAKE_WLINK_QUIET)
+ set(CMAKE_LIB_QUIET)
+else()
+ set(CMAKE_WCL_QUIET "-zq")
+ set(CMAKE_WLINK_QUIET "option quiet")
+ set(CMAKE_LIB_QUIET "-q")
+endif()
set(CMAKE_CREATE_WIN32_EXE "system nt_win" )
-SET(CMAKE_CREATE_CONSOLE_EXE "system nt" )
+set(CMAKE_CREATE_CONSOLE_EXE "system nt" )
-SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "debug all" )
-SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "debug all" )
-SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
-SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
+set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "debug all" )
+set (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "debug all" )
+set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
+set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
set(CMAKE_C_COMPILE_OPTIONS_DLL "-bd") # Note: This variable is a ';' separated list
set(CMAKE_SHARED_LIBRARY_C_FLAGS "-bd") # ... while this is a space separated string.
-SET(CMAKE_RC_COMPILER "rc" )
-
-SET(CMAKE_BUILD_TYPE_INIT Debug)
-SET (CMAKE_CXX_FLAGS_INIT "-w=3 -xs")
-SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-br -bm -d2")
-SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG")
-SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG")
-SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-br -bm -d2 -ot -dNDEBUG")
-SET (CMAKE_C_FLAGS_INIT "-w=3 ")
-SET (CMAKE_C_FLAGS_DEBUG_INIT "-br -bm -d2 -od")
-SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG")
-SET (CMAKE_C_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG")
-SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-br -bm -d2 -ot -dNDEBUG")
-SET (CMAKE_C_STANDARD_LIBRARIES_INIT "library clbrdll.lib library plbrdll.lib library kernel32.lib library user32.lib library gdi32.lib library winspool.lib library comdlg32.lib library advapi32.lib library shell32.lib library ole32.lib library oleaut32.lib library uuid.lib library odbc32.lib library odbccp32.lib")
-SET (CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
-
-SET(CMAKE_C_CREATE_IMPORT_LIBRARY
+set(CMAKE_RC_COMPILER "rc" )
+
+set(CMAKE_BUILD_TYPE_INIT Debug)
+set (CMAKE_CXX_FLAGS_INIT "-w=3 -xs")
+set (CMAKE_CXX_FLAGS_DEBUG_INIT "-br -bm -d2")
+set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG")
+set (CMAKE_CXX_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG")
+set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-br -bm -d2 -ot -dNDEBUG")
+set (CMAKE_C_FLAGS_INIT "-w=3 ")
+set (CMAKE_C_FLAGS_DEBUG_INIT "-br -bm -d2 -od")
+set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG")
+set (CMAKE_C_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG")
+set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-br -bm -d2 -ot -dNDEBUG")
+set (CMAKE_C_STANDARD_LIBRARIES_INIT "library clbrdll.lib library plbrdll.lib library kernel32.lib library user32.lib library gdi32.lib library winspool.lib library comdlg32.lib library advapi32.lib library shell32.lib library ole32.lib library oleaut32.lib library uuid.lib library odbc32.lib library odbccp32.lib")
+set (CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
+
+set(CMAKE_C_CREATE_IMPORT_LIBRARY
"wlib -c -q -n -b <TARGET_IMPLIB> +'<TARGET_UNQUOTED>'")
-SET(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})
+set(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})
-SET(CMAKE_C_LINK_EXECUTABLE
+set(CMAKE_C_LINK_EXECUTABLE
"wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' <LINK_FLAGS> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
-SET(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE})
+set(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE})
# compile a C++ file into an object file
-SET(CMAKE_CXX_COMPILE_OBJECT
+set(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -d+ <DEFINES> -fo<OBJECT> -c -cc++ <SOURCE>${CMAKE_END_TEMP_FILE}")
# compile a C file into an object file
-SET(CMAKE_C_COMPILE_OBJECT
+set(CMAKE_C_COMPILE_OBJECT
"<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -d+ <DEFINES> -fo<OBJECT> -c -cc <SOURCE>${CMAKE_END_TEMP_FILE}")
# preprocess a C source file
-SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE
+set(CMAKE_C_CREATE_PREPROCESSED_SOURCE
"<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -d+ <DEFINES> -fo<PREPROCESSED_SOURCE> -pl -cc <SOURCE>${CMAKE_END_TEMP_FILE}")
# preprocess a C++ source file
-SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
+set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -d+ <DEFINES> -fo<PREPROCESSED_SOURCE> -pl -cc++ <SOURCE>${CMAKE_END_TEMP_FILE}")
-SET(CMAKE_CXX_CREATE_SHARED_MODULE
+set(CMAKE_CXX_CREATE_SHARED_MODULE
"wlink ${CMAKE_START_TEMP_FILE} system nt_dll ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' <LINK_FLAGS> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY
${CMAKE_CXX_CREATE_SHARED_MODULE}
${CMAKE_CXX_CREATE_IMPORT_LIBRARY})
# create a C shared library
-SET(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
+set(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
# create a C shared module
-SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_MODULE})
+set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_MODULE})
# create a C++ static library
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -c -n -b '<TARGET_UNQUOTED>' <LINK_FLAGS> <OBJECTS> ")
+set(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -c -n -b '<TARGET_UNQUOTED>' <LINK_FLAGS> <OBJECTS> ")
# create a C static library
-SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
-
-IF(NOT CMAKE_WATCOM_COMPILER_TESTS_RUN)
- SET(CMAKE_WATCOM_COMPILER_TESTS_RUN 1)
- SET(testWatcomVersionFile
- "${CMAKE_ROOT}/Modules/CMakeTestWatcomVersion.c")
- STRING(REGEX REPLACE "/" "\\\\" testWatcomVersionFile "${testWatcomVersionFile}")
- MESSAGE(STATUS "Check for Watcom compiler version")
- SET(CMAKE_TEST_COMPILER ${CMAKE_C_COMPILER})
- IF (NOT CMAKE_C_COMPILER)
- SET(CMAKE_TEST_COMPILER ${CMAKE_CXX_COMPILER})
- ENDIF()
- EXECUTE_PROCESS(COMMAND ${CMAKE_TEST_COMPILER}
- -q -pc \"${testWatcomVersionFile}\"
- OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
- RESULT_VARIABLE CMAKE_COMPILER_RETURN
- )
- STRING(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}")
- STRING(REGEX REPLACE ".*VERSION=(.*)" "\\1"
- compilerVersion "${compilerVersion}")
- IF("${CMAKE_COMPILER_RETURN}" STREQUAL "0")
- SET(WATCOM16)
- SET(WATCOM17)
- SET(WATCOM18)
- SET(WATCOM19)
- IF("${compilerVersion}" LESS 1270)
- SET(WATCOM16 1)
- ENDIF()
- IF("${compilerVersion}" EQUAL 1270)
- SET(WATCOM17 1)
- ENDIF()
- IF("${compilerVersion}" EQUAL 1280)
- SET(WATCOM18 1)
- ENDIF()
- IF("${compilerVersion}" EQUAL 1290)
- SET(WATCOM19 1)
- ENDIF()
- ENDIF()
-ENDIF()
+set(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
+
+if(NOT _CMAKE_WATCOM_VERSION)
+ set(_CMAKE_WATCOM_VERSION 1)
+ if(CMAKE_C_COMPILER_VERSION)
+ set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
+ else()
+ set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
+ endif()
+ set(WATCOM16)
+ set(WATCOM17)
+ set(WATCOM18)
+ set(WATCOM19)
+ if("${_compiler_version}" LESS 12.70)
+ set(WATCOM16 1)
+ endif()
+ if("${_compiler_version}" EQUAL 12.70)
+ set(WATCOM17 1)
+ endif()
+ if("${_compiler_version}" EQUAL 12.80)
+ set(WATCOM18 1)
+ endif()
+ if("${_compiler_version}" EQUAL 12.90)
+ set(WATCOM19 1)
+ endif()
+endif()
diff --git a/Modules/Platform/Windows-windres.cmake b/Modules/Platform/Windows-windres.cmake
index 8bc1b15e9..01d6be3df 100644
--- a/Modules/Platform/Windows-windres.cmake
+++ b/Modules/Platform/Windows-windres.cmake
@@ -1 +1 @@
-SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> <SOURCE> <OBJECT>")
+set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> <SOURCE> <OBJECT>")
diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake
index 09cb8d303..b158a9dfb 100644
--- a/Modules/Platform/Windows.cmake
+++ b/Modules/Platform/Windows.cmake
@@ -1,36 +1,36 @@
-SET(WIN32 1)
+set(WIN32 1)
-SET(CMAKE_STATIC_LIBRARY_PREFIX "")
-SET(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
-SET(CMAKE_SHARED_LIBRARY_PREFIX "") # lib
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") # .so
-SET(CMAKE_IMPORT_LIBRARY_PREFIX "")
-SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".lib")
-SET(CMAKE_EXECUTABLE_SUFFIX ".exe") # .exe
-SET(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
-SET(CMAKE_DL_LIBS "")
+set(CMAKE_STATIC_LIBRARY_PREFIX "")
+set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
+set(CMAKE_SHARED_LIBRARY_PREFIX "") # lib
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") # .so
+set(CMAKE_IMPORT_LIBRARY_PREFIX "")
+set(CMAKE_IMPORT_LIBRARY_SUFFIX ".lib")
+set(CMAKE_EXECUTABLE_SUFFIX ".exe") # .exe
+set(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
+set(CMAKE_DL_LIBS "")
-SET(CMAKE_FIND_LIBRARY_PREFIXES "")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
+set(CMAKE_FIND_LIBRARY_PREFIXES "")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
# for borland make long command lines are redirected to a file
# with the following syntax, see Windows-bcc32.cmake for use
-IF(CMAKE_GENERATOR MATCHES "Borland")
- SET(CMAKE_START_TEMP_FILE "@&&|\n")
- SET(CMAKE_END_TEMP_FILE "\n|")
-ENDIF(CMAKE_GENERATOR MATCHES "Borland")
+if(CMAKE_GENERATOR MATCHES "Borland")
+ set(CMAKE_START_TEMP_FILE "@&&|\n")
+ set(CMAKE_END_TEMP_FILE "\n|")
+endif()
# for nmake make long command lines are redirected to a file
# with the following syntax, see Windows-bcc32.cmake for use
-IF(CMAKE_GENERATOR MATCHES "NMake")
- SET(CMAKE_START_TEMP_FILE "@<<\n")
- SET(CMAKE_END_TEMP_FILE "\n<<")
-ENDIF(CMAKE_GENERATOR MATCHES "NMake")
+if(CMAKE_GENERATOR MATCHES "NMake")
+ set(CMAKE_START_TEMP_FILE "@<<\n")
+ set(CMAKE_END_TEMP_FILE "\n<<")
+endif()
-INCLUDE(Platform/WindowsPaths)
+include(Platform/WindowsPaths)
# uncomment these out to debug nmake and borland makefiles
-#SET(CMAKE_START_TEMP_FILE "")
-#SET(CMAKE_END_TEMP_FILE "")
-#SET(CMAKE_VERBOSE_MAKEFILE 1)
+#set(CMAKE_START_TEMP_FILE "")
+#set(CMAKE_END_TEMP_FILE "")
+#set(CMAKE_VERBOSE_MAKEFILE 1)
diff --git a/Modules/Platform/WindowsCE-MSVC-C.cmake b/Modules/Platform/WindowsCE-MSVC-C.cmake
new file mode 100644
index 000000000..ce8060bed
--- /dev/null
+++ b/Modules/Platform/WindowsCE-MSVC-C.cmake
@@ -0,0 +1 @@
+include(Platform/Windows-MSVC-C)
diff --git a/Modules/Platform/WindowsCE-MSVC-CXX.cmake b/Modules/Platform/WindowsCE-MSVC-CXX.cmake
new file mode 100644
index 000000000..281eadc10
--- /dev/null
+++ b/Modules/Platform/WindowsCE-MSVC-CXX.cmake
@@ -0,0 +1 @@
+include(Platform/Windows-MSVC-CXX)
diff --git a/Modules/Platform/WindowsCE-MSVC.cmake b/Modules/Platform/WindowsCE-MSVC.cmake
new file mode 100644
index 000000000..d28b4aba0
--- /dev/null
+++ b/Modules/Platform/WindowsCE-MSVC.cmake
@@ -0,0 +1 @@
+include(Platform/Windows-MSVC)
diff --git a/Modules/Platform/WindowsCE.cmake b/Modules/Platform/WindowsCE.cmake
new file mode 100644
index 000000000..65b2eaed4
--- /dev/null
+++ b/Modules/Platform/WindowsCE.cmake
@@ -0,0 +1 @@
+include(Platform/Windows)
diff --git a/Modules/Platform/WindowsPaths.cmake b/Modules/Platform/WindowsPaths.cmake
index c7b15b342..bd31da021 100644
--- a/Modules/Platform/WindowsPaths.cmake
+++ b/Modules/Platform/WindowsPaths.cmake
@@ -17,10 +17,10 @@
# "CMakeSystemSpecificInformation.cmake" already included it.
# The extra inclusion is a work-around documented next to the include()
# call, so this can be removed when the work-around is removed.
-IF(__WINDOWS_PATHS_INCLUDED)
- RETURN()
-ENDIF()
-SET(__WINDOWS_PATHS_INCLUDED 1)
+if(__WINDOWS_PATHS_INCLUDED)
+ return()
+endif()
+set(__WINDOWS_PATHS_INCLUDED 1)
# Add the program-files folder(s) to the list of installation
# prefixes.
@@ -42,39 +42,39 @@ SET(__WINDOWS_PATHS_INCLUDED 1)
# ENV{ProgramFiles(x86)} = <not set>
# ENV{ProgramFiles} = [C:\Program Files (x86)]
# ENV{ProgramW6432} = [C:\Program Files]
-IF(DEFINED "ENV{ProgramW6432}")
+if(DEFINED "ENV{ProgramW6432}")
# 32-bit binary on 64-bit windows.
# The 64-bit program files are in ProgramW6432.
- LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramW6432}")
+ list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramW6432}")
# The 32-bit program files are in ProgramFiles.
- IF(DEFINED "ENV{ProgramFiles}")
- LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles}")
- ENDIF()
-ELSE()
+ if(DEFINED "ENV{ProgramFiles}")
+ list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles}")
+ endif()
+else()
# 64-bit binary, or 32-bit binary on 32-bit windows.
- IF(DEFINED "ENV{ProgramFiles}")
- LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles}")
- ENDIF()
- IF(DEFINED "ENV{ProgramFiles(x86)}")
+ if(DEFINED "ENV{ProgramFiles}")
+ list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles}")
+ endif()
+ if(DEFINED "ENV{ProgramFiles(x86)}")
# 64-bit binary. 32-bit program files are in ProgramFiles(x86).
- LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles(x86)}")
- ELSEIF(DEFINED "ENV{SystemDrive}")
+ list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles(x86)}")
+ elseif(DEFINED "ENV{SystemDrive}")
# Guess the 32-bit program files location.
- IF(EXISTS "$ENV{SystemDrive}/Program Files (x86)")
- LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
+ if(EXISTS "$ENV{SystemDrive}/Program Files (x86)")
+ list(APPEND CMAKE_SYSTEM_PREFIX_PATH
"$ENV{SystemDrive}/Program Files (x86)")
- ENDIF()
- ENDIF()
-ENDIF()
+ endif()
+ endif()
+endif()
# Add the CMake install location.
-GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
-GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
-LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "${_CMAKE_INSTALL_DIR}")
+get_filename_component(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
+get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
+list(APPEND CMAKE_SYSTEM_PREFIX_PATH "${_CMAKE_INSTALL_DIR}")
# Add other locations.
-LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
+list(APPEND CMAKE_SYSTEM_PREFIX_PATH
# Project install destination.
"${CMAKE_INSTALL_PREFIX}"
@@ -82,15 +82,15 @@ LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
/
)
-LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
+list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
)
# mingw can also link against dlls which can also be in /bin, so list this too
-LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
+list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
"${CMAKE_INSTALL_PREFIX}/bin"
"${_CMAKE_INSTALL_DIR}/bin"
/bin
)
-LIST(APPEND CMAKE_SYSTEM_PROGRAM_PATH
+list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
)
diff --git a/Modules/Platform/Xenix.cmake b/Modules/Platform/Xenix.cmake
index cf9d17bfd..47852f8e1 100644
--- a/Modules/Platform/Xenix.cmake
+++ b/Modules/Platform/Xenix.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/cl.cmake b/Modules/Platform/cl.cmake
deleted file mode 100644
index c0f014b58..000000000
--- a/Modules/Platform/cl.cmake
+++ /dev/null
@@ -1,62 +0,0 @@
-SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
-SET(CMAKE_LINK_LIBRARY_FLAG "")
-SET(MSVC 1)
-
-# hack: if a new cmake (which uses CMAKE__LINKER) runs on an old build tree
-# (where link was hardcoded) and where CMAKE_LINKER isn't in the cache
-# and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
-# hardcode CMAKE_LINKER here to link, so it behaves as it did before, Alex
-IF(NOT DEFINED CMAKE_LINKER)
- SET(CMAKE_LINKER link)
-ENDIF(NOT DEFINED CMAKE_LINKER)
-
-IF(CMAKE_VERBOSE_MAKEFILE)
- SET(CMAKE_CL_NOLOGO)
-ELSE(CMAKE_VERBOSE_MAKEFILE)
- SET(CMAKE_CL_NOLOGO "/nologo")
-ENDIF(CMAKE_VERBOSE_MAKEFILE)
-# create a shared C++ library
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
- "<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
-SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
-
-# create a C shared library
-SET(CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
-
-# create a C shared module
-SET(CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE}")
-
-# create a C++ static library
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
-
-# create a C static library
-SET(CMAKE_C_CREATE_STATIC_LIBRARY "${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
-
-# compile a C++ file into an object file
-SET(CMAKE_CXX_COMPILE_OBJECT
- "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> /TP /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-# compile a C file into an object file
-SET(CMAKE_C_COMPILE_OBJECT
- "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
-SET(CMAKE_C_LINK_EXECUTABLE
- "<CMAKE_C_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> -link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
-
-SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
-SET(CMAKE_CXX_LINK_EXECUTABLE
- "<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> -link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
-
-SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE
- "<CMAKE_C_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
- "<CMAKE_CXX_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> /TP -E <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE
- "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> /FAs /FoNUL /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
- "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> /TP /FAs /FoNUL /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
-
diff --git a/Modules/Platform/eCos.cmake b/Modules/Platform/eCos.cmake
index b437c1a9b..a20382692 100644
--- a/Modules/Platform/eCos.cmake
+++ b/Modules/Platform/eCos.cmake
@@ -1,65 +1,65 @@
# support for eCos http://ecos.sourceware.org
# Guard against multiple inclusion, which e.g. leads to multiple calls to add_definition() #12987
-IF(__ECOS_CMAKE_INCLUDED)
- RETURN()
-ENDIF()
-SET(__ECOS_CMAKE_INCLUDED TRUE)
+if(__ECOS_CMAKE_INCLUDED)
+ return()
+endif()
+set(__ECOS_CMAKE_INCLUDED TRUE)
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "") # -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_SHARED_LIBRARY_C_FLAGS "") # -pic
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "") # -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_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 ".a") # .a
-SET(CMAKE_EXECUTABLE_SUFFIX ".elf") # same suffix as if built using UseEcos.cmake
-SET(CMAKE_DL_LIBS "" )
+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 ".a") # .a
+set(CMAKE_EXECUTABLE_SUFFIX ".elf") # same suffix as if built using UseEcos.cmake
+set(CMAKE_DL_LIBS "" )
-SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
# eCos can be built only with gcc
-GET_PROPERTY(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
-IF(CMAKE_C_COMPILER AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
- MESSAGE(FATAL_ERROR "GNU gcc is required for eCos")
-ENDIF(CMAKE_C_COMPILER AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
-IF(CMAKE_CXX_COMPILER AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
- MESSAGE(FATAL_ERROR "GNU g++ is required for eCos")
-ENDIF(CMAKE_CXX_COMPILER AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
+get_property(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
+if(CMAKE_C_COMPILER AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
+ message(FATAL_ERROR "GNU gcc is required for eCos")
+endif()
+if(CMAKE_CXX_COMPILER AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
+ message(FATAL_ERROR "GNU g++ is required for eCos")
+endif()
# find eCos system files
-FIND_PATH(ECOS_SYSTEM_CONFIG_HEADER_PATH NAMES pkgconf/system.h)
-FIND_LIBRARY(ECOS_SYSTEM_TARGET_LIBRARY NAMES libtarget.a)
+find_path(ECOS_SYSTEM_CONFIG_HEADER_PATH NAMES pkgconf/system.h)
+find_library(ECOS_SYSTEM_TARGET_LIBRARY NAMES libtarget.a)
-IF(NOT ECOS_SYSTEM_CONFIG_HEADER_PATH)
- MESSAGE(FATAL_ERROR "Could not find eCos pkgconf/system.h. Build eCos first and set up CMAKE_FIND_ROOT_PATH correctly.")
-ENDIF(NOT ECOS_SYSTEM_CONFIG_HEADER_PATH)
+if(NOT ECOS_SYSTEM_CONFIG_HEADER_PATH)
+ message(FATAL_ERROR "Could not find eCos pkgconf/system.h. Build eCos first and set up CMAKE_FIND_ROOT_PATH correctly.")
+endif()
-IF(NOT ECOS_SYSTEM_TARGET_LIBRARY)
- MESSAGE(FATAL_ERROR "Could not find eCos \"libtarget.a\". Build eCos first and set up CMAKE_FIND_ROOT_PATH correctly.")
-ENDIF(NOT ECOS_SYSTEM_TARGET_LIBRARY)
+if(NOT ECOS_SYSTEM_TARGET_LIBRARY)
+ message(FATAL_ERROR "Could not find eCos \"libtarget.a\". Build eCos first and set up CMAKE_FIND_ROOT_PATH correctly.")
+endif()
-GET_FILENAME_COMPONENT(ECOS_LIBTARGET_DIRECTORY "${ECOS_SYSTEM_TARGET_LIBRARY}" PATH)
-INCLUDE_DIRECTORIES(${ECOS_SYSTEM_CONFIG_HEADER_PATH})
-ADD_DEFINITIONS(-D__ECOS__=1 -D__ECOS=1)
+get_filename_component(ECOS_LIBTARGET_DIRECTORY "${ECOS_SYSTEM_TARGET_LIBRARY}" PATH)
+include_directories(${ECOS_SYSTEM_CONFIG_HEADER_PATH})
+add_definitions(-D__ECOS__=1 -D__ECOS=1)
# special link commands for eCos executables
-SET(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld <LINK_LIBRARIES>")
-SET(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld <LINK_LIBRARIES>")
+set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld <LINK_LIBRARIES>")
+set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld <LINK_LIBRARIES>")
# eCos doesn't support shared libs
-SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
-SET(CMAKE_CXX_LINK_SHARED_LIBRARY )
-SET(CMAKE_CXX_LINK_MODULE_LIBRARY )
-SET(CMAKE_C_LINK_SHARED_LIBRARY )
-SET(CMAKE_C_LINK_MODULE_LIBRARY )
+set(CMAKE_CXX_LINK_SHARED_LIBRARY )
+set(CMAKE_CXX_LINK_MODULE_LIBRARY )
+set(CMAKE_C_LINK_SHARED_LIBRARY )
+set(CMAKE_C_LINK_MODULE_LIBRARY )
diff --git a/Modules/Platform/gas.cmake b/Modules/Platform/gas.cmake
index c34aef17a..7d2bc8454 100644
--- a/Modules/Platform/gas.cmake
+++ b/Modules/Platform/gas.cmake
@@ -1,19 +1,19 @@
-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_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>")
-SET(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> ")
-SET(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
+set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
"<CMAKE_LINKER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
# to be done
-SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
-SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
+set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
+set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
diff --git a/Modules/Platform/kFreeBSD.cmake b/Modules/Platform/kFreeBSD.cmake
index c1295fb0d..c1db2594d 100644
--- a/Modules/Platform/kFreeBSD.cmake
+++ b/Modules/Platform/kFreeBSD.cmake
@@ -1,4 +1,4 @@
# kFreeBSD looks just like Linux.
-INCLUDE(Platform/Linux)
+include(Platform/Linux)
-SET(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-kfreebsd-gnu[a-z0-9_]*")
+set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-kfreebsd-gnu[a-z0-9_]*")
diff --git a/Modules/Platform/syllable.cmake b/Modules/Platform/syllable.cmake
index 2d11d08b3..69c108db0 100644
--- a/Modules/Platform/syllable.cmake
+++ b/Modules/Platform/syllable.cmake
@@ -9,25 +9,25 @@
# @bindir@/. and @bindir@/../lib are in DLL_PATH
-SET(CMAKE_DL_LIBS "dl")
-SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
-SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -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_SONAME_C_FLAG "-Wl,-soname,")
-#SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+set(CMAKE_DL_LIBS "dl")
+set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
+set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -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_SONAME_C_FLAG "-Wl,-soname,")
+#set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
- SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
- SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach()
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
# these are Syllable specific:
-LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH /usr/indexes)
+list(APPEND CMAKE_SYSTEM_PREFIX_PATH /usr/indexes)
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index eff4766b1..0d1dfda16 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -57,6 +57,7 @@ function(ProcessorCount var)
# Mac, FreeBSD, OpenBSD (systems with sysctl):
find_program(ProcessorCount_cmd_sysctl sysctl
PATHS /usr/sbin /sbin)
+ mark_as_advanced(ProcessorCount_cmd_sysctl)
if(ProcessorCount_cmd_sysctl)
execute_process(COMMAND ${ProcessorCount_cmd_sysctl} -n hw.ncpu
ERROR_QUIET
@@ -69,6 +70,7 @@ function(ProcessorCount var)
if(NOT count)
# Linux (systems with getconf):
find_program(ProcessorCount_cmd_getconf getconf)
+ mark_as_advanced(ProcessorCount_cmd_getconf)
if(ProcessorCount_cmd_getconf)
execute_process(COMMAND ${ProcessorCount_cmd_getconf} _NPROCESSORS_ONLN
ERROR_QUIET
@@ -82,6 +84,7 @@ function(ProcessorCount var)
# HPUX (systems with machinfo):
find_program(ProcessorCount_cmd_machinfo machinfo
PATHS /usr/contrib/bin)
+ mark_as_advanced(ProcessorCount_cmd_machinfo)
if(ProcessorCount_cmd_machinfo)
execute_process(COMMAND ${ProcessorCount_cmd_machinfo}
ERROR_QUIET
@@ -97,6 +100,7 @@ function(ProcessorCount var)
# IRIX (systems with hinv):
find_program(ProcessorCount_cmd_hinv hinv
PATHS /sbin)
+ mark_as_advanced(ProcessorCount_cmd_hinv)
if(ProcessorCount_cmd_hinv)
execute_process(COMMAND ${ProcessorCount_cmd_hinv}
ERROR_QUIET
@@ -112,6 +116,7 @@ function(ProcessorCount var)
# AIX (systems with lsconf):
find_program(ProcessorCount_cmd_lsconf lsconf
PATHS /usr/sbin)
+ mark_as_advanced(ProcessorCount_cmd_lsconf)
if(ProcessorCount_cmd_lsconf)
execute_process(COMMAND ${ProcessorCount_cmd_lsconf}
ERROR_QUIET
@@ -126,6 +131,7 @@ function(ProcessorCount var)
if(NOT count)
# QNX (systems with pidin):
find_program(ProcessorCount_cmd_pidin pidin)
+ mark_as_advanced(ProcessorCount_cmd_pidin)
if(ProcessorCount_cmd_pidin)
execute_process(COMMAND ${ProcessorCount_cmd_pidin} info
ERROR_QUIET
@@ -140,6 +146,7 @@ function(ProcessorCount var)
if(NOT count)
# Sun (systems where uname -X emits "NumCPU" in its output):
find_program(ProcessorCount_cmd_uname uname)
+ mark_as_advanced(ProcessorCount_cmd_uname)
if(ProcessorCount_cmd_uname)
execute_process(COMMAND ${ProcessorCount_cmd_uname} -X
ERROR_QUIET
diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake
index 10af3bc95..6db5da18a 100644
--- a/Modules/Qt4ConfigDependentSettings.cmake
+++ b/Modules/Qt4ConfigDependentSettings.cmake
@@ -16,7 +16,7 @@
###############################################
#
-# configuration/system dependent settings
+# configuration/system dependent settings
#
###############################################
@@ -26,270 +26,270 @@
# if a user needs the dependencies, and they couldn't be found, they can set
# the variables themselves.
-SET(QT_QTGUI_LIB_DEPENDENCIES "")
-SET(QT_QTCORE_LIB_DEPENDENCIES "")
-SET(QT_QTNETWORK_LIB_DEPENDENCIES "")
-SET(QT_QTOPENGL_LIB_DEPENDENCIES "")
-SET(QT_QTDBUS_LIB_DEPENDENCIES "")
-SET(QT_QTHELP_LIB_DEPENDENCIES ${QT_QTCLUCENE_LIBRARY})
+set(QT_QTGUI_LIB_DEPENDENCIES "")
+set(QT_QTCORE_LIB_DEPENDENCIES "")
+set(QT_QTNETWORK_LIB_DEPENDENCIES "")
+set(QT_QTOPENGL_LIB_DEPENDENCIES "")
+set(QT_QTDBUS_LIB_DEPENDENCIES "")
+set(QT_QTHELP_LIB_DEPENDENCIES ${QT_QTCLUCENE_LIBRARY})
-IF(Q_WS_WIN)
+if(Q_WS_WIN)
# On Windows, qconfig.pri has "shared" for shared library builds
- IF(NOT QT_CONFIG MATCHES "shared")
- SET(QT_IS_STATIC 1)
- ENDIF(NOT QT_CONFIG MATCHES "shared")
-ELSE(Q_WS_WIN)
+ if(NOT QT_CONFIG MATCHES "shared")
+ set(QT_IS_STATIC 1)
+ endif()
+else()
# On other platforms, check file extension to know if its static
- IF(QT_QTCORE_LIBRARY_RELEASE)
- GET_FILENAME_COMPONENT(qtcore_lib_ext "${QT_QTCORE_LIBRARY_RELEASE}" EXT)
- IF("${qtcore_lib_ext}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}")
- SET(QT_IS_STATIC 1)
- ENDIF("${qtcore_lib_ext}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}")
- ENDIF(QT_QTCORE_LIBRARY_RELEASE)
- IF(QT_QTCORE_LIBRARY_DEBUG)
- GET_FILENAME_COMPONENT(qtcore_lib_ext "${QT_QTCORE_LIBRARY_DEBUG}" EXT)
- IF(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
- SET(QT_IS_STATIC 1)
- ENDIF(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
- ENDIF(QT_QTCORE_LIBRARY_DEBUG)
-ENDIF(Q_WS_WIN)
+ if(QT_QTCORE_LIBRARY_RELEASE)
+ get_filename_component(qtcore_lib_ext "${QT_QTCORE_LIBRARY_RELEASE}" EXT)
+ if("${qtcore_lib_ext}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(QT_IS_STATIC 1)
+ endif()
+ endif()
+ if(QT_QTCORE_LIBRARY_DEBUG)
+ get_filename_component(qtcore_lib_ext "${QT_QTCORE_LIBRARY_DEBUG}" EXT)
+ if(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
+ set(QT_IS_STATIC 1)
+ endif()
+ endif()
+endif()
# build using shared Qt needs -DQT_DLL on Windows
-IF(Q_WS_WIN AND NOT QT_IS_STATIC)
- SET(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_DLL)
-ENDIF(Q_WS_WIN AND NOT QT_IS_STATIC)
+if(Q_WS_WIN AND NOT QT_IS_STATIC)
+ set(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_DLL)
+endif()
-IF(NOT QT_IS_STATIC)
- RETURN()
-ENDIF(NOT QT_IS_STATIC)
+if(NOT QT_IS_STATIC)
+ return()
+endif()
# QtOpenGL dependencies
find_package(OpenGL)
-SET (QT_QTOPENGL_LIB_DEPENDENCIES ${OPENGL_glu_LIBRARY} ${OPENGL_gl_LIBRARY})
+set (QT_QTOPENGL_LIB_DEPENDENCIES ${OPENGL_glu_LIBRARY} ${OPENGL_gl_LIBRARY})
## system png
-IF(QT_QCONFIG MATCHES "system-png")
+if(QT_QCONFIG MATCHES "system-png")
find_package(PNG)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${PNG_LIBRARY})
-ENDIF(QT_QCONFIG MATCHES "system-png")
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${PNG_LIBRARY})
+endif()
## system jpeg
-IF(QT_QCONFIG MATCHES "system-jpeg")
+if(QT_QCONFIG MATCHES "system-jpeg")
find_package(JPEG)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${JPEG_LIBRARIES})
-ENDIF(QT_QCONFIG MATCHES "system-jpeg")
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${JPEG_LIBRARIES})
+endif()
## system tiff
-IF(QT_QCONFIG MATCHES "system-tiff")
+if(QT_QCONFIG MATCHES "system-tiff")
find_package(TIFF)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${TIFF_LIBRARIES})
-ENDIF(QT_QCONFIG MATCHES "system-tiff")
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${TIFF_LIBRARIES})
+endif()
## system mng
-IF(QT_QCONFIG MATCHES "system-mng")
+if(QT_QCONFIG MATCHES "system-mng")
find_library(MNG_LIBRARY NAMES mng)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${MNG_LIBRARY})
-ENDIF(QT_QCONFIG MATCHES "system-mng")
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${MNG_LIBRARY})
+endif()
# for X11, get X11 library directory
-IF(Q_WS_X11)
- FIND_PACKAGE(X11)
-ENDIF(Q_WS_X11)
+if(Q_WS_X11)
+ find_package(X11)
+endif()
## X11 SM
-IF(QT_QCONFIG MATCHES "x11sm")
- IF(X11_SM_LIB AND X11_ICE_LIB)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_SM_LIB} ${X11_ICE_LIB})
- ENDIF(X11_SM_LIB AND X11_ICE_LIB)
-ENDIF(QT_QCONFIG MATCHES "x11sm")
+if(QT_QCONFIG MATCHES "x11sm")
+ if(X11_SM_LIB AND X11_ICE_LIB)
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_SM_LIB} ${X11_ICE_LIB})
+ endif()
+endif()
## Xi
-IF(QT_QCONFIG MATCHES "tablet")
- IF(X11_Xi_LIB)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xi_LIB})
- ENDIF(X11_Xi_LIB)
-ENDIF(QT_QCONFIG MATCHES "tablet")
+if(QT_QCONFIG MATCHES "tablet")
+ if(X11_Xi_LIB)
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xi_LIB})
+ endif()
+endif()
## Xrender
-IF(QT_QCONFIG MATCHES "xrender")
- IF(X11_Xrender_LIB)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrender_LIB})
- ENDIF(X11_Xrender_LIB)
-ENDIF(QT_QCONFIG MATCHES "xrender")
+if(QT_QCONFIG MATCHES "xrender")
+ if(X11_Xrender_LIB)
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrender_LIB})
+ endif()
+endif()
## Xrandr
-IF(QT_QCONFIG MATCHES "xrandr")
- IF(X11_Xrandr_LIB)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrandr_LIB})
- ENDIF(X11_Xrandr_LIB)
-ENDIF(QT_QCONFIG MATCHES "xrandr")
+if(QT_QCONFIG MATCHES "xrandr")
+ if(X11_Xrandr_LIB)
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrandr_LIB})
+ endif()
+endif()
## Xcursor
-IF(QT_QCONFIG MATCHES "xcursor")
- IF(X11_Xcursor_LIB)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xcursor_LIB})
- ENDIF(X11_Xcursor_LIB)
-ENDIF(QT_QCONFIG MATCHES "xcursor")
+if(QT_QCONFIG MATCHES "xcursor")
+ if(X11_Xcursor_LIB)
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xcursor_LIB})
+ endif()
+endif()
## Xinerama
-IF(QT_QCONFIG MATCHES "xinerama")
- IF(X11_Xinerama_LIB)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xinerama_LIB})
- ENDIF(X11_Xinerama_LIB)
-ENDIF(QT_QCONFIG MATCHES "xinerama")
+if(QT_QCONFIG MATCHES "xinerama")
+ if(X11_Xinerama_LIB)
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xinerama_LIB})
+ endif()
+endif()
## Xfixes
-IF(QT_QCONFIG MATCHES "xfixes")
- IF(X11_Xfixes_LIB)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xfixes_LIB})
- ENDIF(X11_Xfixes_LIB)
-ENDIF(QT_QCONFIG MATCHES "xfixes")
+if(QT_QCONFIG MATCHES "xfixes")
+ if(X11_Xfixes_LIB)
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xfixes_LIB})
+ endif()
+endif()
## fontconfig
-IF(QT_QCONFIG MATCHES "fontconfig")
- FIND_LIBRARY(QT_FONTCONFIG_LIBRARY NAMES fontconfig)
- MARK_AS_ADVANCED(QT_FONTCONFIG_LIBRARY)
- IF(QT_FONTCONFIG_LIBRARY)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_FONTCONFIG_LIBRARY})
- ENDIF(QT_FONTCONFIG_LIBRARY)
-ENDIF(QT_QCONFIG MATCHES "fontconfig")
+if(QT_QCONFIG MATCHES "fontconfig")
+ find_library(QT_FONTCONFIG_LIBRARY NAMES fontconfig)
+ mark_as_advanced(QT_FONTCONFIG_LIBRARY)
+ if(QT_FONTCONFIG_LIBRARY)
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_FONTCONFIG_LIBRARY})
+ endif()
+endif()
## system-freetype
-IF(QT_QCONFIG MATCHES "system-freetype")
+if(QT_QCONFIG MATCHES "system-freetype")
find_package(Freetype)
if(FREETYPE_LIBRARIES)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${FREETYPE_LIBRARIES})
- endif(FREETYPE_LIBRARIES)
-ENDIF(QT_QCONFIG MATCHES "system-freetype")
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${FREETYPE_LIBRARIES})
+ endif()
+endif()
## system-zlib
-IF(QT_QCONFIG MATCHES "system-zlib")
+if(QT_QCONFIG MATCHES "system-zlib")
find_package(ZLIB)
- SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${ZLIB_LIBRARIES})
-ENDIF(QT_QCONFIG MATCHES "system-zlib")
+ set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${ZLIB_LIBRARIES})
+endif()
## openssl
-IF(NOT Q_WS_WIN)
- SET(_QT_NEED_OPENSSL 0)
- IF(QT_VERSION_MINOR LESS 4 AND QT_QCONFIG MATCHES "openssl")
- SET(_QT_NEED_OPENSSL 1)
- ENDIF(QT_VERSION_MINOR LESS 4 AND QT_QCONFIG MATCHES "openssl")
- IF(QT_VERSION_MINOR GREATER 3 AND QT_QCONFIG MATCHES "openssl-linked")
- SET(_QT_NEED_OPENSSL 1)
- ENDIF(QT_VERSION_MINOR GREATER 3 AND QT_QCONFIG MATCHES "openssl-linked")
- IF(_QT_NEED_OPENSSL)
- FIND_PACKAGE(OpenSSL)
- IF(OPENSSL_LIBRARIES)
- SET(QT_QTNETWORK_LIB_DEPENDENCIES ${QT_QTNETWORK_LIB_DEPENDENCIES} ${OPENSSL_LIBRARIES})
- ENDIF(OPENSSL_LIBRARIES)
- ENDIF(_QT_NEED_OPENSSL)
-ENDIF(NOT Q_WS_WIN)
+if(NOT Q_WS_WIN)
+ set(_QT_NEED_OPENSSL 0)
+ if(QT_VERSION_MINOR LESS 4 AND QT_QCONFIG MATCHES "openssl")
+ set(_QT_NEED_OPENSSL 1)
+ endif()
+ if(QT_VERSION_MINOR GREATER 3 AND QT_QCONFIG MATCHES "openssl-linked")
+ set(_QT_NEED_OPENSSL 1)
+ endif()
+ if(_QT_NEED_OPENSSL)
+ find_package(OpenSSL)
+ if(OPENSSL_LIBRARIES)
+ set(QT_QTNETWORK_LIB_DEPENDENCIES ${QT_QTNETWORK_LIB_DEPENDENCIES} ${OPENSSL_LIBRARIES})
+ endif()
+ endif()
+endif()
## dbus
-IF(QT_QCONFIG MATCHES "dbus")
+if(QT_QCONFIG MATCHES "dbus")
- FIND_LIBRARY(QT_DBUS_LIBRARY NAMES dbus-1 )
- IF(QT_DBUS_LIBRARY)
- SET(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY})
- ENDIF(QT_DBUS_LIBRARY)
- MARK_AS_ADVANCED(QT_DBUS_LIBRARY)
+ find_library(QT_DBUS_LIBRARY NAMES dbus-1 )
+ if(QT_DBUS_LIBRARY)
+ set(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY})
+ endif()
+ mark_as_advanced(QT_DBUS_LIBRARY)
-ENDIF(QT_QCONFIG MATCHES "dbus")
+endif()
## glib
-IF(QT_QCONFIG MATCHES "glib")
+if(QT_QCONFIG MATCHES "glib")
# Qt 4.2.0+ uses glib-2.0
- FIND_LIBRARY(QT_GLIB_LIBRARY NAMES glib-2.0 )
- FIND_LIBRARY(QT_GTHREAD_LIBRARY NAMES gthread-2.0 )
- MARK_AS_ADVANCED(QT_GLIB_LIBRARY)
- MARK_AS_ADVANCED(QT_GTHREAD_LIBRARY)
+ find_library(QT_GLIB_LIBRARY NAMES glib-2.0 )
+ find_library(QT_GTHREAD_LIBRARY NAMES gthread-2.0 )
+ mark_as_advanced(QT_GLIB_LIBRARY)
+ mark_as_advanced(QT_GTHREAD_LIBRARY)
- IF(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
- SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
+ if(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
+ set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
${QT_GTHREAD_LIBRARY} ${QT_GLIB_LIBRARY})
- ENDIF(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
+ endif()
# Qt 4.5+ also links to gobject-2.0
- IF(QT_VERSION_MINOR GREATER 4)
- FIND_LIBRARY(QT_GOBJECT_LIBRARY NAMES gobject-2.0 PATHS ${_glib_query_output} )
- MARK_AS_ADVANCED(QT_GOBJECT_LIBRARY)
+ if(QT_VERSION_MINOR GREATER 4)
+ find_library(QT_GOBJECT_LIBRARY NAMES gobject-2.0 PATHS ${_glib_query_output} )
+ mark_as_advanced(QT_GOBJECT_LIBRARY)
- IF(QT_GOBJECT_LIBRARY)
- SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
+ if(QT_GOBJECT_LIBRARY)
+ set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
${QT_GOBJECT_LIBRARY})
- ENDIF(QT_GOBJECT_LIBRARY)
- ENDIF(QT_VERSION_MINOR GREATER 4)
+ endif()
+ endif()
-ENDIF(QT_QCONFIG MATCHES "glib")
+endif()
## clock-monotonic, just see if we need to link with rt
-IF(QT_QCONFIG MATCHES "clock-monotonic")
- SET(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
- SET(CMAKE_REQUIRED_LIBRARIES rt)
+if(QT_QCONFIG MATCHES "clock-monotonic")
+ set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
+ set(CMAKE_REQUIRED_LIBRARIES rt)
CHECK_SYMBOL_EXISTS(_POSIX_TIMERS "unistd.h;time.h" QT_POSIX_TIMERS)
- SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
- IF(QT_POSIX_TIMERS)
- FIND_LIBRARY(QT_RT_LIBRARY NAMES rt)
- MARK_AS_ADVANCED(QT_RT_LIBRARY)
- IF(QT_RT_LIBRARY)
- SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_RT_LIBRARY})
- ENDIF(QT_RT_LIBRARY)
- ENDIF(QT_POSIX_TIMERS)
-ENDIF(QT_QCONFIG MATCHES "clock-monotonic")
-
-
-IF(Q_WS_X11)
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
+ if(QT_POSIX_TIMERS)
+ find_library(QT_RT_LIBRARY NAMES rt)
+ mark_as_advanced(QT_RT_LIBRARY)
+ if(QT_RT_LIBRARY)
+ set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_RT_LIBRARY})
+ endif()
+ endif()
+endif()
+
+
+if(Q_WS_X11)
# X11 libraries Qt always depends on
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xext_LIB} ${X11_X11_LIB})
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xext_LIB} ${X11_X11_LIB})
set(CMAKE_THREAD_PREFER_PTHREADS 1)
find_package(Threads)
if(CMAKE_USE_PTHREADS_INIT)
- SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT})
- endif(CMAKE_USE_PTHREADS_INIT)
+ set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT})
+ endif()
- SET (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_DL_LIBS})
+ set (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_DL_LIBS})
-ENDIF(Q_WS_X11)
+endif()
-IF(Q_WS_WIN)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} imm32 winmm)
- SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ws2_32)
-ENDIF(Q_WS_WIN)
+if(Q_WS_WIN)
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} imm32 winmm)
+ set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ws2_32)
+endif()
-IF(Q_WS_MAC)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework Carbon")
+if(Q_WS_MAC)
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework Carbon")
# Qt 4.0, 4.1, 4.2 use QuickTime
- IF(QT_VERSION_MINOR LESS 3)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework QuickTime")
- ENDIF(QT_VERSION_MINOR LESS 3)
+ if(QT_VERSION_MINOR LESS 3)
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework QuickTime")
+ endif()
# Qt 4.2+ use AppKit
- IF(QT_VERSION_MINOR GREATER 1)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework AppKit")
- ENDIF(QT_VERSION_MINOR GREATER 1)
+ if(QT_VERSION_MINOR GREATER 1)
+ set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework AppKit")
+ endif()
- SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} "-framework ApplicationServices")
-ENDIF(Q_WS_MAC)
+ set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} "-framework ApplicationServices")
+endif()
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index 68f3c8085..251d57c3d 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -21,322 +21,324 @@
######################################
-MACRO (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options)
- SET(${_qt4_files})
- SET(${_qt4_options})
- SET(_QT4_DOING_OPTIONS FALSE)
- FOREACH(_currentArg ${ARGN})
- IF ("${_currentArg}" STREQUAL "OPTIONS")
- SET(_QT4_DOING_OPTIONS TRUE)
- ELSE ("${_currentArg}" STREQUAL "OPTIONS")
- IF(_QT4_DOING_OPTIONS)
- LIST(APPEND ${_qt4_options} "${_currentArg}")
- ELSE(_QT4_DOING_OPTIONS)
- LIST(APPEND ${_qt4_files} "${_currentArg}")
- ENDIF(_QT4_DOING_OPTIONS)
- ENDIF ("${_currentArg}" STREQUAL "OPTIONS")
- ENDFOREACH(_currentArg)
-ENDMACRO (QT4_EXTRACT_OPTIONS)
+macro (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options)
+ set(${_qt4_files})
+ set(${_qt4_options})
+ set(_QT4_DOING_OPTIONS FALSE)
+ foreach(_currentArg ${ARGN})
+ if ("${_currentArg}" STREQUAL "OPTIONS")
+ set(_QT4_DOING_OPTIONS TRUE)
+ else ()
+ if(_QT4_DOING_OPTIONS)
+ list(APPEND ${_qt4_options} "${_currentArg}")
+ else()
+ list(APPEND ${_qt4_files} "${_currentArg}")
+ endif()
+ endif ()
+ endforeach()
+endmacro ()
# macro used to create the names of output files preserving relative dirs
-MACRO (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile )
- STRING(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength)
- STRING(LENGTH ${infile} _infileLength)
- SET(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR})
- IF(_infileLength GREATER _binlength)
- STRING(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
- IF(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
- FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile})
- ELSE(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
- FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
- ENDIF(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
- ELSE(_infileLength GREATER _binlength)
- FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
- ENDIF(_infileLength GREATER _binlength)
- IF(WIN32 AND rel MATCHES "^[a-zA-Z]:") # absolute path
- STRING(REGEX REPLACE "^([a-zA-Z]):(.*)$" "\\1_\\2" rel "${rel}")
- ENDIF(WIN32 AND rel MATCHES "^[a-zA-Z]:")
- SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
- STRING(REPLACE ".." "__" _outfile ${_outfile})
- GET_FILENAME_COMPONENT(outpath ${_outfile} PATH)
- GET_FILENAME_COMPONENT(_outfile ${_outfile} NAME_WE)
- FILE(MAKE_DIRECTORY ${outpath})
- SET(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
-ENDMACRO (QT4_MAKE_OUTPUT_FILE )
-
-
-MACRO (QT4_GET_MOC_FLAGS _moc_flags)
- SET(${_moc_flags})
- GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
-
- FOREACH(_current ${_inc_DIRS})
- IF("${_current}" MATCHES "\\.framework/?$")
- STRING(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}")
- SET(${_moc_flags} ${${_moc_flags}} "-F${framework_path}")
- ELSE("${_current}" MATCHES "\\.framework/?$")
- SET(${_moc_flags} ${${_moc_flags}} "-I${_current}")
- ENDIF("${_current}" MATCHES "\\.framework/?$")
- ENDFOREACH(_current ${_inc_DIRS})
-
- GET_DIRECTORY_PROPERTY(_defines COMPILE_DEFINITIONS)
- FOREACH(_current ${_defines})
- SET(${_moc_flags} ${${_moc_flags}} "-D${_current}")
- ENDFOREACH(_current ${_defines})
-
- IF(Q_WS_WIN)
- SET(${_moc_flags} ${${_moc_flags}} -DWIN32)
- ENDIF(Q_WS_WIN)
-
-ENDMACRO(QT4_GET_MOC_FLAGS)
+macro (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile )
+ string(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength)
+ string(LENGTH ${infile} _infileLength)
+ set(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR})
+ if(_infileLength GREATER _binlength)
+ string(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
+ if(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
+ file(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile})
+ else()
+ file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
+ endif()
+ else()
+ file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
+ endif()
+ if(WIN32 AND rel MATCHES "^[a-zA-Z]:") # absolute path
+ string(REGEX REPLACE "^([a-zA-Z]):(.*)$" "\\1_\\2" rel "${rel}")
+ endif()
+ set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
+ string(REPLACE ".." "__" _outfile ${_outfile})
+ get_filename_component(outpath ${_outfile} PATH)
+ get_filename_component(_outfile ${_outfile} NAME_WE)
+ file(MAKE_DIRECTORY ${outpath})
+ set(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
+endmacro ()
+
+
+macro (QT4_GET_MOC_FLAGS _moc_flags)
+ set(${_moc_flags})
+ get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
+
+ foreach(_current ${_inc_DIRS})
+ if("${_current}" MATCHES "\\.framework/?$")
+ string(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}")
+ set(${_moc_flags} ${${_moc_flags}} "-F${framework_path}")
+ else()
+ set(${_moc_flags} ${${_moc_flags}} "-I${_current}")
+ endif()
+ endforeach()
+
+ get_directory_property(_defines COMPILE_DEFINITIONS)
+ foreach(_current ${_defines})
+ set(${_moc_flags} ${${_moc_flags}} "-D${_current}")
+ endforeach()
+
+ if(Q_WS_WIN)
+ set(${_moc_flags} ${${_moc_flags}} -DWIN32)
+ endif()
+
+endmacro()
# helper macro to set up a moc rule
-MACRO (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options)
+macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options)
# For Windows, create a parameters file to work around command line length limit
- IF (WIN32)
+ if (WIN32)
# Pass the parameters in a file. Set the working directory to
# be that containing the parameters file and reference it by
# just the file name. This is necessary because the moc tool on
# MinGW builds does not seem to handle spaces in the path to the
# file given with the @ syntax.
- GET_FILENAME_COMPONENT(_moc_outfile_name "${outfile}" NAME)
- GET_FILENAME_COMPONENT(_moc_outfile_dir "${outfile}" PATH)
- IF(_moc_outfile_dir)
- SET(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
- ENDIF(_moc_outfile_dir)
- SET (_moc_parameters_file ${outfile}_parameters)
- SET (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
- STRING (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
- FILE (WRITE ${_moc_parameters_file} "${_moc_parameters}")
- ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+ get_filename_component(_moc_outfile_name "${outfile}" NAME)
+ get_filename_component(_moc_outfile_dir "${outfile}" PATH)
+ if(_moc_outfile_dir)
+ set(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
+ endif()
+ set (_moc_parameters_file ${outfile}_parameters)
+ set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
+ string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
+ file (WRITE ${_moc_parameters_file} "${_moc_parameters}")
+ add_custom_command(OUTPUT ${outfile}
COMMAND ${QT_MOC_EXECUTABLE} @${_moc_outfile_name}_parameters
DEPENDS ${infile}
${_moc_working_dir}
VERBATIM)
- ELSE (WIN32)
- ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+ else ()
+ add_custom_command(OUTPUT ${outfile}
COMMAND ${QT_MOC_EXECUTABLE}
ARGS ${moc_flags} ${moc_options} -o ${outfile} ${infile}
DEPENDS ${infile} VERBATIM)
- ENDIF (WIN32)
-ENDMACRO (QT4_CREATE_MOC_COMMAND)
+ endif ()
+endmacro ()
-MACRO (QT4_GENERATE_MOC infile outfile )
+macro (QT4_GENERATE_MOC infile outfile )
# get include dirs and flags
QT4_GET_MOC_FLAGS(moc_flags)
- GET_FILENAME_COMPONENT(abs_infile ${infile} ABSOLUTE)
- SET(_outfile "${outfile}")
- IF(NOT IS_ABSOLUTE "${outfile}")
- SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
- ENDIF(NOT IS_ABSOLUTE "${outfile}")
+ get_filename_component(abs_infile ${infile} ABSOLUTE)
+ set(_outfile "${outfile}")
+ if(NOT IS_ABSOLUTE "${outfile}")
+ set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
+ endif()
QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "")
- SET_SOURCE_FILES_PROPERTIES(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file
-ENDMACRO (QT4_GENERATE_MOC)
+ set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file
+endmacro ()
# QT4_WRAP_CPP(outfiles inputfile ... )
-MACRO (QT4_WRAP_CPP outfiles )
+macro (QT4_WRAP_CPP outfiles )
# get include dirs
QT4_GET_MOC_FLAGS(moc_flags)
QT4_EXTRACT_OPTIONS(moc_files moc_options ${ARGN})
- FOREACH (it ${moc_files})
- GET_FILENAME_COMPONENT(it ${it} ABSOLUTE)
+ foreach (it ${moc_files})
+ get_filename_component(it ${it} ABSOLUTE)
QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile)
QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}")
- SET(${outfiles} ${${outfiles}} ${outfile})
- ENDFOREACH(it)
+ set(${outfiles} ${${outfiles}} ${outfile})
+ endforeach()
-ENDMACRO (QT4_WRAP_CPP)
+endmacro ()
# QT4_WRAP_UI(outfiles inputfile ... )
-MACRO (QT4_WRAP_UI outfiles )
+macro (QT4_WRAP_UI outfiles )
QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
- FOREACH (it ${ui_files})
- GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
- GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
- SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
- ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+ foreach (it ${ui_files})
+ get_filename_component(outfile ${it} NAME_WE)
+ get_filename_component(infile ${it} ABSOLUTE)
+ set(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
+ add_custom_command(OUTPUT ${outfile}
COMMAND ${QT_UIC_EXECUTABLE}
ARGS ${ui_options} -o ${outfile} ${infile}
MAIN_DEPENDENCY ${infile} VERBATIM)
- SET(${outfiles} ${${outfiles}} ${outfile})
- ENDFOREACH (it)
+ set(${outfiles} ${${outfiles}} ${outfile})
+ endforeach ()
-ENDMACRO (QT4_WRAP_UI)
+endmacro ()
# QT4_ADD_RESOURCES(outfiles inputfile ... )
-MACRO (QT4_ADD_RESOURCES outfiles )
+macro (QT4_ADD_RESOURCES outfiles )
QT4_EXTRACT_OPTIONS(rcc_files rcc_options ${ARGN})
- FOREACH (it ${rcc_files})
- GET_FILENAME_COMPONENT(outfilename ${it} NAME_WE)
- GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
- GET_FILENAME_COMPONENT(rc_path ${infile} PATH)
- SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
+ foreach (it ${rcc_files})
+ get_filename_component(outfilename ${it} NAME_WE)
+ get_filename_component(infile ${it} ABSOLUTE)
+ get_filename_component(rc_path ${infile} PATH)
+ set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
- SET(_RC_DEPENDS)
- IF(EXISTS "${infile}")
+ set(_RC_DEPENDS)
+ if(EXISTS "${infile}")
# parse file for dependencies
# all files are absolute paths or relative to the location of the qrc file
- FILE(READ "${infile}" _RC_FILE_CONTENTS)
- STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
- FOREACH(_RC_FILE ${_RC_FILES})
- STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
- IF(NOT IS_ABSOLUTE "${_RC_FILE}")
- SET(_RC_FILE "${rc_path}/${_RC_FILE}")
- ENDIF(NOT IS_ABSOLUTE "${_RC_FILE}")
- SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
- ENDFOREACH(_RC_FILE)
+ file(READ "${infile}" _RC_FILE_CONTENTS)
+ string(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
+ foreach(_RC_FILE ${_RC_FILES})
+ string(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
+ if(NOT IS_ABSOLUTE "${_RC_FILE}")
+ set(_RC_FILE "${rc_path}/${_RC_FILE}")
+ endif()
+ set(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
+ endforeach()
+ unset(_RC_FILES)
+ unset(_RC_FILE_CONTENTS)
# Since this cmake macro is doing the dependency scanning for these files,
# let's make a configured file and add it as a dependency so cmake is run
# again when dependencies need to be recomputed.
QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends)
- CONFIGURE_FILE("${infile}" "${out_depends}" COPY_ONLY)
- ELSE(EXISTS "${infile}")
+ configure_file("${infile}" "${out_depends}" COPY_ONLY)
+ else()
# The .qrc file does not exist (yet). Let's add a dependency and hope
# that it will be generated later
- SET(out_depends)
- ENDIF(EXISTS "${infile}")
+ set(out_depends)
+ endif()
- ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+ add_custom_command(OUTPUT ${outfile}
COMMAND ${QT_RCC_EXECUTABLE}
ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
MAIN_DEPENDENCY ${infile}
DEPENDS ${_RC_DEPENDS} "${out_depends}" VERBATIM)
- SET(${outfiles} ${${outfiles}} ${outfile})
- ENDFOREACH (it)
+ set(${outfiles} ${${outfiles}} ${outfile})
+ endforeach ()
-ENDMACRO (QT4_ADD_RESOURCES)
+endmacro ()
-MACRO(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
- GET_FILENAME_COMPONENT(_infile ${_interface} ABSOLUTE)
- SET(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h")
- SET(_impl "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp")
- SET(_moc "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc")
+macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
+ get_filename_component(_infile ${_interface} ABSOLUTE)
+ set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h")
+ set(_impl "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp")
+ set(_moc "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc")
- GET_SOURCE_FILE_PROPERTY(_nonamespace ${_interface} NO_NAMESPACE)
- IF(_nonamespace)
- SET(_params -N -m)
- ELSE(_nonamespace)
- SET(_params -m)
- ENDIF(_nonamespace)
+ get_source_file_property(_nonamespace ${_interface} NO_NAMESPACE)
+ if(_nonamespace)
+ set(_params -N -m)
+ else()
+ set(_params -m)
+ endif()
- GET_SOURCE_FILE_PROPERTY(_classname ${_interface} CLASSNAME)
- IF(_classname)
- SET(_params ${_params} -c ${_classname})
- ENDIF(_classname)
+ get_source_file_property(_classname ${_interface} CLASSNAME)
+ if(_classname)
+ set(_params ${_params} -c ${_classname})
+ endif()
- GET_SOURCE_FILE_PROPERTY(_include ${_interface} INCLUDE)
- IF(_include)
- SET(_params ${_params} -i ${_include})
- ENDIF(_include)
+ get_source_file_property(_include ${_interface} INCLUDE)
+ if(_include)
+ set(_params ${_params} -i ${_include})
+ endif()
- ADD_CUSTOM_COMMAND(OUTPUT "${_impl}" "${_header}"
+ add_custom_command(OUTPUT "${_impl}" "${_header}"
COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} ${_params} -p ${_basename} ${_infile}
DEPENDS ${_infile} VERBATIM)
- SET_SOURCE_FILES_PROPERTIES("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
+ set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
QT4_GENERATE_MOC("${_header}" "${_moc}")
- LIST(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
+ list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
-ENDMACRO(QT4_ADD_DBUS_INTERFACE)
+endmacro()
-MACRO(QT4_ADD_DBUS_INTERFACES _sources)
- FOREACH (_current_FILE ${ARGN})
- GET_FILENAME_COMPONENT(_infile ${_current_FILE} ABSOLUTE)
- GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME)
+macro(QT4_ADD_DBUS_INTERFACES _sources)
+ foreach (_current_FILE ${ARGN})
+ get_filename_component(_infile ${_current_FILE} ABSOLUTE)
+ get_filename_component(_basename ${_current_FILE} NAME)
# get the part before the ".xml" suffix
- STRING(TOLOWER ${_basename} _basename)
- STRING(REGEX REPLACE "(.*\\.)?([^\\.]+)\\.xml" "\\2" _basename ${_basename})
+ string(TOLOWER ${_basename} _basename)
+ string(REGEX REPLACE "(.*\\.)?([^\\.]+)\\.xml" "\\2" _basename ${_basename})
QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface)
- ENDFOREACH (_current_FILE)
-ENDMACRO(QT4_ADD_DBUS_INTERFACES)
+ endforeach ()
+endmacro()
-MACRO(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options )
+macro(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options )
QT4_EXTRACT_OPTIONS(_customName _qt4_dbus_options ${ARGN})
- GET_FILENAME_COMPONENT(_in_file ${_header} ABSOLUTE)
- GET_FILENAME_COMPONENT(_basename ${_header} NAME_WE)
+ get_filename_component(_in_file ${_header} ABSOLUTE)
+ get_filename_component(_basename ${_header} NAME_WE)
- IF (_customName)
+ if (_customName)
if (IS_ABSOLUTE ${_customName})
get_filename_component(_containingDir ${_customName} PATH)
if (NOT EXISTS ${_containingDir})
file(MAKE_DIRECTORY "${_containingDir}")
endif()
- SET(_target ${_customName})
+ set(_target ${_customName})
else()
- SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName})
+ set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName})
endif()
- ELSE (_customName)
- SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml)
- ENDIF (_customName)
+ else ()
+ set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml)
+ endif ()
- ADD_CUSTOM_COMMAND(OUTPUT ${_target}
+ add_custom_command(OUTPUT ${_target}
COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_qt4_dbus_options} ${_in_file} -o ${_target}
DEPENDS ${_in_file} VERBATIM
)
-ENDMACRO(QT4_GENERATE_DBUS_INTERFACE)
+endmacro()
-MACRO(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optionalBasename _optionalClassName)
- GET_FILENAME_COMPONENT(_infile ${_xml_file} ABSOLUTE)
+macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optionalBasename _optionalClassName)
+ get_filename_component(_infile ${_xml_file} ABSOLUTE)
- SET(_optionalBasename "${ARGV4}")
- IF (_optionalBasename)
- SET(_basename ${_optionalBasename} )
- ELSE (_optionalBasename)
- STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2adaptor" _basename ${_infile})
- STRING(TOLOWER ${_basename} _basename)
- ENDIF (_optionalBasename)
+ set(_optionalBasename "${ARGV4}")
+ if (_optionalBasename)
+ set(_basename ${_optionalBasename} )
+ else ()
+ string(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2adaptor" _basename ${_infile})
+ string(TOLOWER ${_basename} _basename)
+ endif ()
- SET(_optionalClassName "${ARGV5}")
- SET(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h")
- SET(_impl "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp")
- SET(_moc "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc")
+ set(_optionalClassName "${ARGV5}")
+ set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h")
+ set(_impl "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp")
+ set(_moc "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc")
- IF(_optionalClassName)
- ADD_CUSTOM_COMMAND(OUTPUT "${_impl}" "${_header}"
+ if(_optionalClassName)
+ add_custom_command(OUTPUT "${_impl}" "${_header}"
COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile}
DEPENDS ${_infile} VERBATIM
)
- ELSE(_optionalClassName)
- ADD_CUSTOM_COMMAND(OUTPUT "${_impl}" "${_header}"
+ else()
+ add_custom_command(OUTPUT "${_impl}" "${_header}"
COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile}
DEPENDS ${_infile} VERBATIM
)
- ENDIF(_optionalClassName)
+ endif()
QT4_GENERATE_MOC("${_header}" "${_moc}")
- SET_SOURCE_FILES_PROPERTIES("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
+ set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
- LIST(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
-ENDMACRO(QT4_ADD_DBUS_ADAPTOR)
+ list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
+endmacro()
-MACRO(QT4_AUTOMOC)
+macro(QT4_AUTOMOC)
QT4_GET_MOC_FLAGS(_moc_INCS)
- SET(_matching_FILES )
- FOREACH (_current_FILE ${ARGN})
+ set(_matching_FILES )
+ foreach (_current_FILE ${ARGN})
- GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
+ get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
# if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
# This is required to make uic work correctly:
# we need to add generated .cpp files to the sources (to compile them),
@@ -344,98 +346,119 @@ MACRO(QT4_AUTOMOC)
# cmake is run for the very first time on them -> however the .cpp files might
# exist at a later run. at that time we need to skip them, so that we don't add two
# different rules for the same moc file
- GET_SOURCE_FILE_PROPERTY(_skip ${_abs_FILE} SKIP_AUTOMOC)
+ get_source_file_property(_skip ${_abs_FILE} SKIP_AUTOMOC)
- IF ( NOT _skip AND EXISTS ${_abs_FILE} )
+ if ( NOT _skip AND EXISTS ${_abs_FILE} )
- FILE(READ ${_abs_FILE} _contents)
+ file(READ ${_abs_FILE} _contents)
- GET_FILENAME_COMPONENT(_abs_PATH ${_abs_FILE} PATH)
+ get_filename_component(_abs_PATH ${_abs_FILE} PATH)
- STRING(REGEX MATCHALL "# *include +[^ ]+\\.moc[\">]" _match "${_contents}")
- IF(_match)
- FOREACH (_current_MOC_INC ${_match})
- STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
+ string(REGEX MATCHALL "# *include +[^ ]+\\.moc[\">]" _match "${_contents}")
+ if(_match)
+ foreach (_current_MOC_INC ${_match})
+ string(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
- GET_FILENAME_COMPONENT(_basename ${_current_MOC} NAME_WE)
- IF(EXISTS ${_abs_PATH}/${_basename}.hpp)
- SET(_header ${_abs_PATH}/${_basename}.hpp)
- ELSE(EXISTS ${_abs_PATH}/${_basename}.hpp)
- SET(_header ${_abs_PATH}/${_basename}.h)
- ENDIF(EXISTS ${_abs_PATH}/${_basename}.hpp)
- SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
+ get_filename_component(_basename ${_current_MOC} NAME_WE)
+ if(EXISTS ${_abs_PATH}/${_basename}.hpp)
+ set(_header ${_abs_PATH}/${_basename}.hpp)
+ else()
+ set(_header ${_abs_PATH}/${_basename}.h)
+ endif()
+ set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "")
MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
- ENDFOREACH (_current_MOC_INC)
- ENDIF(_match)
- ENDIF ( NOT _skip AND EXISTS ${_abs_FILE} )
- ENDFOREACH (_current_FILE)
-ENDMACRO(QT4_AUTOMOC)
+ endforeach ()
+ endif()
+ endif ()
+ endforeach ()
+endmacro()
-MACRO(QT4_CREATE_TRANSLATION _qm_files)
+macro(QT4_CREATE_TRANSLATION _qm_files)
QT4_EXTRACT_OPTIONS(_lupdate_files _lupdate_options ${ARGN})
- SET(_my_sources)
- SET(_my_dirs)
- SET(_my_tsfiles)
- SET(_ts_pro)
- FOREACH (_file ${_lupdate_files})
- GET_FILENAME_COMPONENT(_ext ${_file} EXT)
- GET_FILENAME_COMPONENT(_abs_FILE ${_file} ABSOLUTE)
- IF(_ext MATCHES "ts")
- LIST(APPEND _my_tsfiles ${_abs_FILE})
- ELSE(_ext MATCHES "ts")
- IF(NOT _ext)
- LIST(APPEND _my_dirs ${_abs_FILE})
- ELSE(NOT _ext)
- LIST(APPEND _my_sources ${_abs_FILE})
- ENDIF(NOT _ext)
- ENDIF(_ext MATCHES "ts")
- ENDFOREACH(_file)
- FOREACH(_ts_file ${_my_tsfiles})
- IF(_my_sources)
+ set(_my_sources)
+ set(_my_dirs)
+ set(_my_tsfiles)
+ set(_ts_pro)
+ foreach (_file ${_lupdate_files})
+ get_filename_component(_ext ${_file} EXT)
+ get_filename_component(_abs_FILE ${_file} ABSOLUTE)
+ if(_ext MATCHES "ts")
+ list(APPEND _my_tsfiles ${_abs_FILE})
+ else()
+ if(NOT _ext)
+ list(APPEND _my_dirs ${_abs_FILE})
+ else()
+ list(APPEND _my_sources ${_abs_FILE})
+ endif()
+ endif()
+ endforeach()
+ foreach(_ts_file ${_my_tsfiles})
+ if(_my_sources)
# make a .pro file to call lupdate on, so we don't make our commands too
# long for some systems
- GET_FILENAME_COMPONENT(_ts_name ${_ts_file} NAME_WE)
- SET(_ts_pro ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lupdate.pro)
- SET(_pro_srcs)
- FOREACH(_pro_src ${_my_sources})
- SET(_pro_srcs "${_pro_srcs} \"${_pro_src}\"")
- ENDFOREACH(_pro_src ${_my_sources})
- SET(_pro_includes)
- GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
- FOREACH(_pro_include ${_inc_DIRS})
- GET_FILENAME_COMPONENT(_abs_include "${_pro_include}" ABSOLUTE)
- SET(_pro_includes "${_pro_includes} \"${_abs_include}\"")
- ENDFOREACH(_pro_include ${CMAKE_CXX_INCLUDE_PATH})
- FILE(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}\nINCLUDEPATH = ${_pro_includes}\n")
- ENDIF(_my_sources)
- ADD_CUSTOM_COMMAND(OUTPUT ${_ts_file}
+ get_filename_component(_ts_name ${_ts_file} NAME_WE)
+ set(_ts_pro ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lupdate.pro)
+ set(_pro_srcs)
+ foreach(_pro_src ${_my_sources})
+ set(_pro_srcs "${_pro_srcs} \"${_pro_src}\"")
+ endforeach()
+ set(_pro_includes)
+ get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
+ foreach(_pro_include ${_inc_DIRS})
+ get_filename_component(_abs_include "${_pro_include}" ABSOLUTE)
+ set(_pro_includes "${_pro_includes} \"${_abs_include}\"")
+ endforeach()
+ file(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}\nINCLUDEPATH = ${_pro_includes}\n")
+ endif()
+ add_custom_command(OUTPUT ${_ts_file}
COMMAND ${QT_LUPDATE_EXECUTABLE}
ARGS ${_lupdate_options} ${_ts_pro} ${_my_dirs} -ts ${_ts_file}
DEPENDS ${_my_sources} ${_ts_pro} VERBATIM)
- ENDFOREACH(_ts_file)
+ endforeach()
QT4_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles})
-ENDMACRO(QT4_CREATE_TRANSLATION)
-
-
-MACRO(QT4_ADD_TRANSLATION _qm_files)
- FOREACH (_current_FILE ${ARGN})
- GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
- GET_FILENAME_COMPONENT(qm ${_abs_FILE} NAME_WE)
- GET_SOURCE_FILE_PROPERTY(output_location ${_abs_FILE} OUTPUT_LOCATION)
- IF(output_location)
- FILE(MAKE_DIRECTORY "${output_location}")
- SET(qm "${output_location}/${qm}.qm")
- ELSE(output_location)
- SET(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
- ENDIF(output_location)
-
- ADD_CUSTOM_COMMAND(OUTPUT ${qm}
+endmacro()
+
+
+macro(QT4_ADD_TRANSLATION _qm_files)
+ foreach (_current_FILE ${ARGN})
+ get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
+ get_filename_component(qm ${_abs_FILE} NAME_WE)
+ get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION)
+ if(output_location)
+ file(MAKE_DIRECTORY "${output_location}")
+ set(qm "${output_location}/${qm}.qm")
+ else()
+ set(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
+ endif()
+
+ add_custom_command(OUTPUT ${qm}
COMMAND ${QT_LRELEASE_EXECUTABLE}
ARGS ${_abs_FILE} -qm ${qm}
DEPENDS ${_abs_FILE} VERBATIM
)
- SET(${_qm_files} ${${_qm_files}} ${qm})
- ENDFOREACH (_current_FILE)
-ENDMACRO(QT4_ADD_TRANSLATION)
+ set(${_qm_files} ${${_qm_files}} ${qm})
+ endforeach ()
+endmacro()
+
+function(qt4_use_modules _target _link_type)
+ if ("${_link_type}" STREQUAL "LINK_PUBLIC" OR "${_link_type}" STREQUAL "LINK_PRIVATE")
+ set(modules ${ARGN})
+ set(link_type ${_link_type})
+ else()
+ set(modules ${_link_type} ${ARGN})
+ endif()
+ foreach(_module ${modules})
+ string(TOUPPER ${_module} _ucmodule)
+ if (NOT QT_QT${_ucmodule}_FOUND)
+ message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.")
+ endif()
+ if ("${_ucmodule}" STREQUAL "MAIN")
+ message(FATAL_ERROR "Can not use \"${_module}\" module with qt4_use_modules.")
+ endif()
+ target_link_libraries(${_target} ${link_type} ${QT_QT${_ucmodule}_LIBRARY})
+ set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${QT_QT${_ucmodule}_INCLUDE_DIR} ${QT_HEADERS_DIR} ${QT_MKSPECS_DIR}/default)
+ set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${QT_QT${_ucmodule}_COMPILE_DEFINITIONS})
+ endforeach()
+endfunction()
diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake
index 2e8ade0df..62137bb28 100644
--- a/Modules/SelectLibraryConfigurations.cmake
+++ b/Modules/SelectLibraryConfigurations.cmake
@@ -6,7 +6,7 @@
# basename_LIBRARY_RELEASE is defined, basename_LIBRARY, basename_LIBRARY_DEBUG,
# and basename_LIBRARY_RELEASE will be set to the release value. If only
# basename_LIBRARY_DEBUG is defined, then basename_LIBRARY,
-# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value.
+# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value.
#
# If the generator supports configuration types, then basename_LIBRARY and
# basename_LIBRARIES will be set with debug and optimized flags specifying the
@@ -38,8 +38,8 @@ macro( _set_library_name basename GOOD BAD )
set( ${basename}_LIBRARY_${BAD} ${${basename}_LIBRARY_${GOOD}} )
set( ${basename}_LIBRARY ${${basename}_LIBRARY_${GOOD}} )
set( ${basename}_LIBRARIES ${${basename}_LIBRARY_${GOOD}} )
- endif( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} )
-endmacro( _set_library_name )
+ endif()
+endmacro()
macro( select_library_configurations basename )
# if only the release version was found, set the debug to be the release
@@ -48,34 +48,40 @@ macro( select_library_configurations basename )
# if only the debug version was found, set the release value to be the
# debug value.
_set_library_name( ${basename} DEBUG RELEASE )
- if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
- NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE)
+
+ # Set a default case, which will come into effect if
+ # -no build type is set and the generator only supports one build type
+ # at a time (i.e. CMAKE_CONFIGURATION_TYPES is false)
+ # -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are the same
+ # -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are both empty
+ set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
+ set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} )
+
+ if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
+ NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE )
# if the generator supports configuration types or CMAKE_BUILD_TYPE
# is set, then set optimized and debug options.
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
- set( ${basename}_LIBRARY
- optimized ${${basename}_LIBRARY_RELEASE}
- debug ${${basename}_LIBRARY_DEBUG} )
- set( ${basename}_LIBRARIES
- optimized ${${basename}_LIBRARY_RELEASE}
- debug ${${basename}_LIBRARY_DEBUG} )
- else( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
- # If there are no configuration types or build type, just use
- # the release version
- set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
- set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} )
- endif( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
+ set( ${basename}_LIBRARY )
+ foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE )
+ list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
+ endforeach()
+ foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG )
+ list( APPEND ${basename}_LIBRARY debug "${_libname}" )
+ endforeach()
+ set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
+ endif()
endif()
- set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
+ set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
"The ${basename} library" )
if( ${basename}_LIBRARY )
set( ${basename}_FOUND TRUE )
- endif( ${basename}_LIBRARY )
+ endif()
- mark_as_advanced( ${basename}_LIBRARY
+ mark_as_advanced( ${basename}_LIBRARY
${basename}_LIBRARY_RELEASE
${basename}_LIBRARY_DEBUG
)
-endmacro( select_library_configurations )
+endmacro()
diff --git a/Modules/SquishTestScript.cmake b/Modules/SquishTestScript.cmake
index 9eac9707f..d5653051b 100644
--- a/Modules/SquishTestScript.cmake
+++ b/Modules/SquishTestScript.cmake
@@ -44,9 +44,9 @@ foreach(i ${squish_env_vars})
endforeach()
if (QT4_INSTALLED)
- # record qt lib directory
+ # record Qt lib directory
set ( ENV{${SQUISH_LIBQTDIR}} ${squish_libqtdir} )
-endif (QT4_INSTALLED)
+endif ()
# run the test
if (WIN32)
@@ -54,19 +54,19 @@ if (WIN32)
COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.bat ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
RESULT_VARIABLE test_rv
)
-endif (WIN32)
+endif ()
if (UNIX)
execute_process(
COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.sh ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
RESULT_VARIABLE test_rv
)
-endif (UNIX)
+endif ()
# check for an error with running the test
if(NOT "${test_rv}" STREQUAL "0")
message(FATAL_ERROR "Error running Squish test")
-endif(NOT "${test_rv}" STREQUAL "0")
+endif()
diff --git a/Modules/SystemInformation.cmake b/Modules/SystemInformation.cmake
index d4f22331d..fa8507106 100644
--- a/Modules/SystemInformation.cmake
+++ b/Modules/SystemInformation.cmake
@@ -12,92 +12,92 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})
-PROJECT(DumpInformation)
+cmake_minimum_required(VERSION ${CMAKE_VERSION})
+project(DumpInformation)
# first get the standard information for th platform
-INCLUDE_DIRECTORIES("This does not exists")
-GET_DIRECTORY_PROPERTY(incl INCLUDE_DIRECTORIES)
-SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${DumpInformation_BINARY_DIR};${DumpInformation_SOURCE_DIR}")
+include_directories("This does not exists")
+get_directory_property(incl INCLUDE_DIRECTORIES)
+set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${DumpInformation_BINARY_DIR};${DumpInformation_SOURCE_DIR}")
-CONFIGURE_FILE("${CMAKE_ROOT}/Modules/SystemInformation.in" "${RESULT_FILE}")
+configure_file("${CMAKE_ROOT}/Modules/SystemInformation.in" "${RESULT_FILE}")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
"\n=================================================================\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
"=== VARIABLES\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
"=================================================================\n")
-GET_CMAKE_PROPERTY(res VARIABLES)
-FOREACH(var ${res})
- FILE(APPEND "${RESULT_FILE}" "${var} \"${${var}}\"\n")
-ENDFOREACH(var ${res})
+get_cmake_property(res VARIABLES)
+foreach(var ${res})
+ file(APPEND "${RESULT_FILE}" "${var} \"${${var}}\"\n")
+endforeach()
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
"\n=================================================================\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
"=== COMMANDS\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
"=================================================================\n")
-GET_CMAKE_PROPERTY(res COMMANDS)
-FOREACH(var ${res})
- FILE(APPEND "${RESULT_FILE}" "${var}\n")
-ENDFOREACH(var ${res})
+get_cmake_property(res COMMANDS)
+foreach(var ${res})
+ file(APPEND "${RESULT_FILE}" "${var}\n")
+endforeach()
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
"\n=================================================================\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
"=== MACROS\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
"=================================================================\n")
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
-GET_CMAKE_PROPERTY(res MACROS)
-FOREACH(var ${res})
- FILE(APPEND "${RESULT_FILE}" "${var}\n")
-ENDFOREACH(var ${res})
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
+get_cmake_property(res MACROS)
+foreach(var ${res})
+ file(APPEND "${RESULT_FILE}" "${var}\n")
+endforeach()
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
"\n=================================================================\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
"=== OTHER\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
"=================================================================\n")
-GET_DIRECTORY_PROPERTY(res INCLUDE_DIRECTORIES)
-FOREACH(var ${res})
- FILE(APPEND "${RESULT_FILE}" "INCLUDE_DIRECTORY: ${var}\n")
-ENDFOREACH(var)
+get_directory_property(res INCLUDE_DIRECTORIES)
+foreach(var ${res})
+ file(APPEND "${RESULT_FILE}" "INCLUDE_DIRECTORY: ${var}\n")
+endforeach()
-GET_DIRECTORY_PROPERTY(res LINK_DIRECTORIES)
-FOREACH(var ${res})
- FILE(APPEND "${RESULT_FILE}" "LINK_DIRECTORIES: ${var}\n")
-ENDFOREACH(var)
+get_directory_property(res LINK_DIRECTORIES)
+foreach(var ${res})
+ file(APPEND "${RESULT_FILE}" "LINK_DIRECTORIES: ${var}\n")
+endforeach()
-GET_DIRECTORY_PROPERTY(res INCLUDE_REGULAR_EXPRESSION)
-FILE(APPEND "${RESULT_FILE}" "INCLUDE_REGULAR_EXPRESSION: ${res}\n")
+get_directory_property(res INCLUDE_REGULAR_EXPRESSION)
+file(APPEND "${RESULT_FILE}" "INCLUDE_REGULAR_EXPRESSION: ${res}\n")
# include other files if they are present, such as when run from within the
# binary tree
-MACRO(DUMP_FILE THE_FILE)
- IF (EXISTS "${THE_FILE}")
- FILE(APPEND "${RESULT_FILE}"
+macro(DUMP_FILE THE_FILE)
+ if (EXISTS "${THE_FILE}")
+ file(APPEND "${RESULT_FILE}"
"\n=================================================================\n")
- FILE(APPEND "${RESULT_FILE}"
+ file(APPEND "${RESULT_FILE}"
"=== ${THE_FILE}\n")
- FILE(APPEND "${RESULT_FILE}"
+ file(APPEND "${RESULT_FILE}"
"=================================================================\n")
-
- FILE(READ "${THE_FILE}" FILE_CONTENTS LIMIT 50000)
- FILE(APPEND "${RESULT_FILE}" "${FILE_CONTENTS}")
- ENDIF (EXISTS "${THE_FILE}")
-ENDMACRO(DUMP_FILE)
+
+ file(READ "${THE_FILE}" FILE_CONTENTS LIMIT 50000)
+ file(APPEND "${RESULT_FILE}" "${FILE_CONTENTS}")
+ endif ()
+endmacro()
DUMP_FILE("../CMakeCache.txt")
DUMP_FILE("../CMakeFiles/CMakeOutput.log")
DUMP_FILE("../CMakeFiles/CMakeError.log")
DUMP_FILE("../CMakeFiles/CMakeSystem.cmake")
-FOREACH (EXTRA_FILE ${EXTRA_DUMP_FILES})
+foreach (EXTRA_FILE ${EXTRA_DUMP_FILES})
DUMP_FILE("${EXTRA_FILE}")
-ENDFOREACH (EXTRA_FILE)
+endforeach ()
diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake
index 996060210..193df8fda 100644
--- a/Modules/TestBigEndian.cmake
+++ b/Modules/TestBigEndian.cmake
@@ -17,96 +17,96 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-MACRO(TEST_BIG_ENDIAN VARIABLE)
- IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
- MESSAGE(STATUS "Check if the system is big endian")
- MESSAGE(STATUS "Searching 16 bit integer")
-
- INCLUDE(CheckTypeSize)
+macro(TEST_BIG_ENDIAN VARIABLE)
+ if("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
+ message(STATUS "Check if the system is big endian")
+ message(STATUS "Searching 16 bit integer")
+
+ include(CheckTypeSize)
CHECK_TYPE_SIZE("unsigned short" CMAKE_SIZEOF_UNSIGNED_SHORT)
- IF(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
- MESSAGE(STATUS "Using unsigned short")
- SET(CMAKE_16BIT_TYPE "unsigned short")
- ELSE(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
+ if(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
+ message(STATUS "Using unsigned short")
+ set(CMAKE_16BIT_TYPE "unsigned short")
+ else()
CHECK_TYPE_SIZE("unsigned int" CMAKE_SIZEOF_UNSIGNED_INT)
- IF(CMAKE_SIZEOF_UNSIGNED_INT)
- MESSAGE(STATUS "Using unsigned int")
- SET(CMAKE_16BIT_TYPE "unsigned int")
+ if(CMAKE_SIZEOF_UNSIGNED_INT)
+ message(STATUS "Using unsigned int")
+ set(CMAKE_16BIT_TYPE "unsigned int")
+
+ else()
- ELSE(CMAKE_SIZEOF_UNSIGNED_INT)
-
CHECK_TYPE_SIZE("unsigned long" CMAKE_SIZEOF_UNSIGNED_LONG)
- IF(CMAKE_SIZEOF_UNSIGNED_LONG)
- MESSAGE(STATUS "Using unsigned long")
- SET(CMAKE_16BIT_TYPE "unsigned long")
- ELSE(CMAKE_SIZEOF_UNSIGNED_LONG)
- MESSAGE(FATAL_ERROR "no suitable type found")
- ENDIF(CMAKE_SIZEOF_UNSIGNED_LONG)
-
- ENDIF(CMAKE_SIZEOF_UNSIGNED_INT)
-
- ENDIF(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
-
-
- CONFIGURE_FILE("${CMAKE_ROOT}/Modules/TestEndianess.c.in"
+ if(CMAKE_SIZEOF_UNSIGNED_LONG)
+ message(STATUS "Using unsigned long")
+ set(CMAKE_16BIT_TYPE "unsigned long")
+ else()
+ message(FATAL_ERROR "no suitable type found")
+ endif()
+
+ endif()
+
+ endif()
+
+
+ configure_file("${CMAKE_ROOT}/Modules/TestEndianess.c.in"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/TestEndianess.c"
IMMEDIATE @ONLY)
-
- FILE(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/TestEndianess.c"
+
+ file(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/TestEndianess.c"
TEST_ENDIANESS_FILE_CONTENT)
- TRY_COMPILE(HAVE_${VARIABLE}
+ try_compile(HAVE_${VARIABLE}
"${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/TestEndianess.c"
OUTPUT_VARIABLE OUTPUT
COPY_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin" )
- IF(HAVE_${VARIABLE})
+ if(HAVE_${VARIABLE})
- FILE(STRINGS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin"
+ file(STRINGS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin"
CMAKE_TEST_ENDIANESS_STRINGS_LE LIMIT_COUNT 1 REGEX "THIS IS LITTLE ENDIAN")
- FILE(STRINGS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin"
+ file(STRINGS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin"
CMAKE_TEST_ENDIANESS_STRINGS_BE LIMIT_COUNT 1 REGEX "THIS IS BIG ENDIAN")
# on mac, if there are universal binaries built both will be true
# return the result depending on the machine on which cmake runs
- IF(CMAKE_TEST_ENDIANESS_STRINGS_BE AND CMAKE_TEST_ENDIANESS_STRINGS_LE)
- IF(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc)
- SET(CMAKE_TEST_ENDIANESS_STRINGS_BE TRUE)
- SET(CMAKE_TEST_ENDIANESS_STRINGS_LE FALSE)
- ELSE(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc)
- SET(CMAKE_TEST_ENDIANESS_STRINGS_BE FALSE)
- SET(CMAKE_TEST_ENDIANESS_STRINGS_LE TRUE)
- ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc)
- MESSAGE(STATUS "TEST_BIG_ENDIAN found different results, consider setting CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no architecture !")
- ENDIF(CMAKE_TEST_ENDIANESS_STRINGS_BE AND CMAKE_TEST_ENDIANESS_STRINGS_LE)
-
- IF(CMAKE_TEST_ENDIANESS_STRINGS_LE)
- SET(${VARIABLE} 0 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE)
- MESSAGE(STATUS "Check if the system is big endian - little endian")
- ENDIF(CMAKE_TEST_ENDIANESS_STRINGS_LE)
-
- IF(CMAKE_TEST_ENDIANESS_STRINGS_BE)
- SET(${VARIABLE} 1 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE)
- MESSAGE(STATUS "Check if the system is big endian - big endian")
- ENDIF(CMAKE_TEST_ENDIANESS_STRINGS_BE)
-
- IF(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE AND NOT CMAKE_TEST_ENDIANESS_STRINGS_LE)
- MESSAGE(SEND_ERROR "TEST_BIG_ENDIAN found no result!")
- ENDIF(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE AND NOT CMAKE_TEST_ENDIANESS_STRINGS_LE)
-
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ if(CMAKE_TEST_ENDIANESS_STRINGS_BE AND CMAKE_TEST_ENDIANESS_STRINGS_LE)
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc)
+ set(CMAKE_TEST_ENDIANESS_STRINGS_BE TRUE)
+ set(CMAKE_TEST_ENDIANESS_STRINGS_LE FALSE)
+ else()
+ set(CMAKE_TEST_ENDIANESS_STRINGS_BE FALSE)
+ set(CMAKE_TEST_ENDIANESS_STRINGS_LE TRUE)
+ endif()
+ message(STATUS "TEST_BIG_ENDIAN found different results, consider setting CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no architecture !")
+ endif()
+
+ if(CMAKE_TEST_ENDIANESS_STRINGS_LE)
+ set(${VARIABLE} 0 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE)
+ message(STATUS "Check if the system is big endian - little endian")
+ endif()
+
+ if(CMAKE_TEST_ENDIANESS_STRINGS_BE)
+ set(${VARIABLE} 1 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE)
+ message(STATUS "Check if the system is big endian - big endian")
+ endif()
+
+ if(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE AND NOT CMAKE_TEST_ENDIANESS_STRINGS_LE)
+ message(SEND_ERROR "TEST_BIG_ENDIAN found no result!")
+ endif()
+
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the system is big endian passed with the following output:\n${OUTPUT}\nTestEndianess.c:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n")
-
- ELSE(HAVE_${VARIABLE})
- MESSAGE(STATUS "Check if the system is big endian - failed")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+
+ else()
+ message(STATUS "Check if the system is big endian - failed")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the system is big endian failed with the following output:\n${OUTPUT}\nTestEndianess.c:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n")
- SET(${VARIABLE})
- ENDIF(HAVE_${VARIABLE})
- ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
-ENDMACRO(TEST_BIG_ENDIAN)
+ set(${VARIABLE})
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/TestCXXAcceptsFlag.cmake b/Modules/TestCXXAcceptsFlag.cmake
index 52d0cf3e6..2694737ef 100644
--- a/Modules/TestCXXAcceptsFlag.cmake
+++ b/Modules/TestCXXAcceptsFlag.cmake
@@ -20,24 +20,24 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-MACRO(CHECK_CXX_ACCEPTS_FLAG FLAGS VARIABLE)
- IF(NOT DEFINED ${VARIABLE})
- MESSAGE(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS}")
- TRY_COMPILE(${VARIABLE}
+macro(CHECK_CXX_ACCEPTS_FLAG FLAGS VARIABLE)
+ if(NOT DEFINED ${VARIABLE})
+ message(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS}")
+ try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/DummyCXXFile.cxx
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${FLAGS}
- OUTPUT_VARIABLE OUTPUT)
- IF(${VARIABLE})
- MESSAGE(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - yes")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ OUTPUT_VARIABLE OUTPUT)
+ if(${VARIABLE})
+ message(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - yes")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the CXX compiler accepts the flag ${FLAGS} passed with "
"the following output:\n${OUTPUT}\n\n")
- ELSE(${VARIABLE})
- MESSAGE(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - no")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ else()
+ message(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - no")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the CXX compiler accepts the flag ${FLAGS} failed with "
"the following output:\n${OUTPUT}\n\n")
- ENDIF(${VARIABLE})
- ENDIF(NOT DEFINED ${VARIABLE})
-ENDMACRO(CHECK_CXX_ACCEPTS_FLAG)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake
index ae2acef7e..9b4d51cda 100644
--- a/Modules/TestForANSIForScope.cmake
+++ b/Modules/TestForANSIForScope.cmake
@@ -16,27 +16,27 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
- MESSAGE(STATUS "Check for ANSI scope")
- TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE ${CMAKE_BINARY_DIR}
+if("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
+ message(STATUS "Check for ANSI scope")
+ try_compile(CMAKE_ANSI_FOR_SCOPE ${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx
OUTPUT_VARIABLE OUTPUT)
- IF (CMAKE_ANSI_FOR_SCOPE)
- MESSAGE(STATUS "Check for ANSI scope - found")
- SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
+ if (CMAKE_ANSI_FOR_SCOPE)
+ message(STATUS "Check for ANSI scope - found")
+ set (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
"Does the compiler support ansi for scope.")
- 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 understands ansi for scopes passed with "
"the following output:\n${OUTPUT}\n\n")
- ELSE (CMAKE_ANSI_FOR_SCOPE)
- MESSAGE(STATUS "Check for ANSI scope - not found")
- SET (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
+ else ()
+ message(STATUS "Check for ANSI scope - not found")
+ set (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
"Does the compiler support ansi for scope.")
- 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 understands ansi for scopes failed with "
"the following output:\n${OUTPUT}\n\n")
- ENDIF (CMAKE_ANSI_FOR_SCOPE)
-ENDIF("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
+ endif ()
+endif()
diff --git a/Modules/TestForANSIStreamHeaders.cmake b/Modules/TestForANSIStreamHeaders.cmake
index 19c1ab2f2..4aa4023e7 100644
--- a/Modules/TestForANSIStreamHeaders.cmake
+++ b/Modules/TestForANSIStreamHeaders.cmake
@@ -16,19 +16,19 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(CheckIncludeFileCXX)
+include(CheckIncludeFileCXX)
-IF(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
+if(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
CHECK_INCLUDE_FILE_CXX(iostream CMAKE_ANSI_STREAM_HEADERS)
- IF (CMAKE_ANSI_STREAM_HEADERS)
- SET (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL
+ if (CMAKE_ANSI_STREAM_HEADERS)
+ set (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL
"Does the compiler support headers like iostream.")
- ELSE (CMAKE_ANSI_STREAM_HEADERS)
- SET (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL
+ else ()
+ set (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL
"Does the compiler support headers like iostream.")
- ENDIF (CMAKE_ANSI_STREAM_HEADERS)
+ endif ()
- MARK_AS_ADVANCED(CMAKE_NO_ANSI_STREAM_HEADERS)
-ENDIF(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
+ mark_as_advanced(CMAKE_NO_ANSI_STREAM_HEADERS)
+endif()
diff --git a/Modules/TestForAnsiForScope.cxx b/Modules/TestForAnsiForScope.cxx
index f2ec76077..e8807ab4a 100644
--- a/Modules/TestForAnsiForScope.cxx
+++ b/Modules/TestForAnsiForScope.cxx
@@ -1,5 +1,5 @@
int main(int, char*[])
-{
+{
int i;
for(int i=0; i < 1; ++i);
(void)i;
diff --git a/Modules/TestForSSTREAM.cmake b/Modules/TestForSSTREAM.cmake
index 8dd53e744..db39c1e70 100644
--- a/Modules/TestForSSTREAM.cmake
+++ b/Modules/TestForSSTREAM.cmake
@@ -16,27 +16,27 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")
- MESSAGE(STATUS "Check for sstream")
- TRY_COMPILE(CMAKE_HAS_ANSI_STRING_STREAM ${CMAKE_BINARY_DIR}
+if("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")
+ message(STATUS "Check for sstream")
+ try_compile(CMAKE_HAS_ANSI_STRING_STREAM ${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/TestForSSTREAM.cxx
OUTPUT_VARIABLE OUTPUT)
- IF (CMAKE_HAS_ANSI_STRING_STREAM)
- MESSAGE(STATUS "Check for sstream - found")
- SET (CMAKE_NO_ANSI_STRING_STREAM 0 CACHE INTERNAL
+ if (CMAKE_HAS_ANSI_STRING_STREAM)
+ message(STATUS "Check for sstream - found")
+ set (CMAKE_NO_ANSI_STRING_STREAM 0 CACHE INTERNAL
"Does the compiler support sstream")
- 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 has sstream passed with "
"the following output:\n${OUTPUT}\n\n")
- ELSE (CMAKE_HAS_ANSI_STRING_STREAM)
- MESSAGE(STATUS "Check for sstream - not found")
- SET (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL
+ else ()
+ message(STATUS "Check for sstream - not found")
+ set (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL
"Does the compiler support sstream")
- 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 has sstream failed with "
"the following output:\n${OUTPUT}\n\n")
- ENDIF (CMAKE_HAS_ANSI_STRING_STREAM)
-ENDIF("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")
+ endif ()
+endif()
diff --git a/Modules/TestForSSTREAM.cxx b/Modules/TestForSSTREAM.cxx
index af4a4bbef..1c939da23 100644
--- a/Modules/TestForSSTREAM.cxx
+++ b/Modules/TestForSSTREAM.cxx
@@ -1,6 +1,6 @@
#include <sstream>
int main(int, char*[])
-{
+{
std::ostringstream os;
os << "12345";
if(os.str().size() == 5)
diff --git a/Modules/TestForSTDNamespace.cmake b/Modules/TestForSTDNamespace.cmake
index 932d6e994..6a7564445 100644
--- a/Modules/TestForSTDNamespace.cmake
+++ b/Modules/TestForSTDNamespace.cmake
@@ -16,27 +16,27 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")
- MESSAGE(STATUS "Check for STD namespace")
- TRY_COMPILE(CMAKE_STD_NAMESPACE ${CMAKE_BINARY_DIR}
+if("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")
+ message(STATUS "Check for STD namespace")
+ try_compile(CMAKE_STD_NAMESPACE ${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/TestForSTDNamespace.cxx
OUTPUT_VARIABLE OUTPUT)
- IF (CMAKE_STD_NAMESPACE)
- MESSAGE(STATUS "Check for STD namespace - found")
- SET (CMAKE_NO_STD_NAMESPACE 0 CACHE INTERNAL
+ if (CMAKE_STD_NAMESPACE)
+ message(STATUS "Check for STD namespace - found")
+ set (CMAKE_NO_STD_NAMESPACE 0 CACHE INTERNAL
"Does the compiler support std::.")
- 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 has std namespace passed with "
"the following output:\n${OUTPUT}\n\n")
- ELSE (CMAKE_STD_NAMESPACE)
- MESSAGE(STATUS "Check for STD namespace - not found")
- SET (CMAKE_NO_STD_NAMESPACE 1 CACHE INTERNAL
+ else ()
+ message(STATUS "Check for STD namespace - not found")
+ set (CMAKE_NO_STD_NAMESPACE 1 CACHE INTERNAL
"Does the compiler support std::.")
- 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 has std namespace failed with "
"the following output:\n${OUTPUT}\n\n")
- ENDIF (CMAKE_STD_NAMESPACE)
-ENDIF("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")
+ endif ()
+endif()
diff --git a/Modules/TestForSTDNamespace.cxx b/Modules/TestForSTDNamespace.cxx
index fc3ac5911..b537d44a9 100644
--- a/Modules/TestForSTDNamespace.cxx
+++ b/Modules/TestForSTDNamespace.cxx
@@ -1,6 +1,6 @@
#include <list>
int main(int, char*[])
-{
+{
std::list<int>();
return 0;
}
diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake
index 60e1e46b4..028df8202 100644
--- a/Modules/UseEcos.cmake
+++ b/Modules/UseEcos.cmake
@@ -30,89 +30,89 @@
# License text for the above reference.)
# first check that ecosconfig is available
-FIND_PROGRAM(ECOSCONFIG_EXECUTABLE NAMES ecosconfig)
-IF(NOT ECOSCONFIG_EXECUTABLE)
- MESSAGE(SEND_ERROR "ecosconfig was not found. Either include it in the system path or set it manually using ccmake.")
-ELSE(NOT ECOSCONFIG_EXECUTABLE)
- MESSAGE(STATUS "Found ecosconfig: ${ECOSCONFIG_EXECUTABLE}")
-ENDIF(NOT ECOSCONFIG_EXECUTABLE)
+find_program(ECOSCONFIG_EXECUTABLE NAMES ecosconfig)
+if(NOT ECOSCONFIG_EXECUTABLE)
+ message(SEND_ERROR "ecosconfig was not found. Either include it in the system path or set it manually using ccmake.")
+else()
+ message(STATUS "Found ecosconfig: ${ECOSCONFIG_EXECUTABLE}")
+endif()
# check that ECOS_REPOSITORY is set correctly
-IF (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
- MESSAGE(SEND_ERROR "The environment variable ECOS_REPOSITORY is not set correctly. Set it to the directory which contains the file ecos.db")
-ELSE (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
- MESSAGE(STATUS "ECOS_REPOSITORY is set to $ENV{ECOS_REPOSITORY}")
-ENDIF (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
+if (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
+ message(SEND_ERROR "The environment variable ECOS_REPOSITORY is not set correctly. Set it to the directory which contains the file ecos.db")
+else ()
+ message(STATUS "ECOS_REPOSITORY is set to $ENV{ECOS_REPOSITORY}")
+endif ()
# check that tclsh (coming with TCL) is available, otherwise ecosconfig doesn't work
-FIND_PACKAGE(Tclsh)
-IF (NOT TCL_TCLSH)
- MESSAGE(SEND_ERROR "The TCL tclsh was not found. Please install TCL, it is required for building eCos applications.")
-ELSE (NOT TCL_TCLSH)
- MESSAGE(STATUS "tlcsh found: ${TCL_TCLSH}")
-ENDIF (NOT TCL_TCLSH)
+find_package(Tclsh)
+if (NOT TCL_TCLSH)
+ message(SEND_ERROR "The TCL tclsh was not found. Please install TCL, it is required for building eCos applications.")
+else ()
+ message(STATUS "tlcsh found: ${TCL_TCLSH}")
+endif ()
#add the globale include-diretories
#usage: ECOS_ADD_INCLUDE_DIRECTORIES()
-MACRO(ECOS_ADD_INCLUDE_DIRECTORIES)
+macro(ECOS_ADD_INCLUDE_DIRECTORIES)
#check for ProjectSources.txt one level higher
- IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
- INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../)
- ELSE (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
- INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/)
- ENDIF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
+ if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../)
+ else ()
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/)
+ endif ()
#the ecos include directory
- INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/ecos/install/include/)
+ include_directories(${CMAKE_CURRENT_BINARY_DIR}/ecos/install/include/)
-ENDMACRO(ECOS_ADD_INCLUDE_DIRECTORIES)
+endmacro()
#we want to compile for the xscale processor, in this case the following macro has to be called
#usage: ECOS_USE_ARM_ELF_TOOLS()
-MACRO (ECOS_USE_ARM_ELF_TOOLS)
- SET(CMAKE_CXX_COMPILER "arm-elf-c++")
- SET(CMAKE_COMPILER_IS_GNUCXX 1)
- SET(CMAKE_C_COMPILER "arm-elf-gcc")
- SET(CMAKE_AR "arm-elf-ar")
- SET(CMAKE_RANLIB "arm-elf-ranlib")
+macro (ECOS_USE_ARM_ELF_TOOLS)
+ set(CMAKE_CXX_COMPILER "arm-elf-c++")
+ set(CMAKE_COMPILER_IS_GNUCXX 1)
+ set(CMAKE_C_COMPILER "arm-elf-gcc")
+ set(CMAKE_AR "arm-elf-ar")
+ set(CMAKE_RANLIB "arm-elf-ranlib")
#for linking
- SET(ECOS_LD_MCPU "-mcpu=xscale")
+ set(ECOS_LD_MCPU "-mcpu=xscale")
#for compiling
- ADD_DEFINITIONS(-mcpu=xscale -mapcs-frame)
+ add_definitions(-mcpu=xscale -mapcs-frame)
#for the obj-tools
- SET(ECOS_ARCH_PREFIX "arm-elf-")
-ENDMACRO (ECOS_USE_ARM_ELF_TOOLS)
+ set(ECOS_ARCH_PREFIX "arm-elf-")
+endmacro ()
#usage: ECOS_USE_PPC_EABI_TOOLS()
-MACRO (ECOS_USE_PPC_EABI_TOOLS)
- SET(CMAKE_CXX_COMPILER "powerpc-eabi-c++")
- SET(CMAKE_COMPILER_IS_GNUCXX 1)
- SET(CMAKE_C_COMPILER "powerpc-eabi-gcc")
- SET(CMAKE_AR "powerpc-eabi-ar")
- SET(CMAKE_RANLIB "powerpc-eabi-ranlib")
+macro (ECOS_USE_PPC_EABI_TOOLS)
+ set(CMAKE_CXX_COMPILER "powerpc-eabi-c++")
+ set(CMAKE_COMPILER_IS_GNUCXX 1)
+ set(CMAKE_C_COMPILER "powerpc-eabi-gcc")
+ set(CMAKE_AR "powerpc-eabi-ar")
+ set(CMAKE_RANLIB "powerpc-eabi-ranlib")
#for linking
- SET(ECOS_LD_MCPU "")
+ set(ECOS_LD_MCPU "")
#for compiling
- ADD_DEFINITIONS()
+ add_definitions()
#for the obj-tools
- SET(ECOS_ARCH_PREFIX "powerpc-eabi-")
-ENDMACRO (ECOS_USE_PPC_EABI_TOOLS)
+ set(ECOS_ARCH_PREFIX "powerpc-eabi-")
+endmacro ()
#usage: ECOS_USE_I386_ELF_TOOLS()
-MACRO (ECOS_USE_I386_ELF_TOOLS)
- SET(CMAKE_CXX_COMPILER "i386-elf-c++")
- SET(CMAKE_COMPILER_IS_GNUCXX 1)
- SET(CMAKE_C_COMPILER "i386-elf-gcc")
- SET(CMAKE_AR "i386-elf-ar")
- SET(CMAKE_RANLIB "i386-elf-ranlib")
+macro (ECOS_USE_I386_ELF_TOOLS)
+ set(CMAKE_CXX_COMPILER "i386-elf-c++")
+ set(CMAKE_COMPILER_IS_GNUCXX 1)
+ set(CMAKE_C_COMPILER "i386-elf-gcc")
+ set(CMAKE_AR "i386-elf-ar")
+ set(CMAKE_RANLIB "i386-elf-ranlib")
#for linking
- SET(ECOS_LD_MCPU "")
+ set(ECOS_LD_MCPU "")
#for compiling
- ADD_DEFINITIONS()
+ add_definitions()
#for the obj-tools
- SET(ECOS_ARCH_PREFIX "i386-elf-")
-ENDMACRO (ECOS_USE_I386_ELF_TOOLS)
+ set(ECOS_ARCH_PREFIX "i386-elf-")
+endmacro ()
#since the actual sources are located one level upwards
@@ -121,84 +121,84 @@ ENDMACRO (ECOS_USE_I386_ELF_TOOLS)
#is the name of the new list of source files with adjusted paths,
#followed by all source files
#usage: ECOS_ADJUST_DIRECTORY(adjusted_SRCS ${my_srcs})
-MACRO(ECOS_ADJUST_DIRECTORY _target_FILES )
- FOREACH (_current_FILE ${ARGN})
- GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
- IF (NOT ${_abs_FILE} STREQUAL ${_current_FILE})
- GET_FILENAME_COMPONENT(_abs_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${_current_FILE} ABSOLUTE)
- ENDIF (NOT ${_abs_FILE} STREQUAL ${_current_FILE})
- LIST(APPEND ${_target_FILES} ${_abs_FILE})
- ENDFOREACH (_current_FILE)
-ENDMACRO(ECOS_ADJUST_DIRECTORY)
+macro(ECOS_ADJUST_DIRECTORY _target_FILES )
+ foreach (_current_FILE ${ARGN})
+ get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
+ if (NOT ${_abs_FILE} STREQUAL ${_current_FILE})
+ get_filename_component(_abs_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${_current_FILE} ABSOLUTE)
+ endif ()
+ list(APPEND ${_target_FILES} ${_abs_FILE})
+ endforeach ()
+endmacro()
# the default ecos config file name
# maybe in the future also out-of-source builds may be possible
-SET(ECOS_CONFIG_FILE ecos.ecc)
+set(ECOS_CONFIG_FILE ecos.ecc)
#creates the dependancy from all source files on the ecos target.ld,
#adds the command for compiling ecos
-MACRO(ECOS_ADD_TARGET_LIB)
+macro(ECOS_ADD_TARGET_LIB)
# when building out-of-source, create the ecos/ subdir
- IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ecos)
- FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ecos)
- ENDIF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ecos)
+ if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ecos)
+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ecos)
+ endif()
#sources depend on target.ld
- SET_SOURCE_FILES_PROPERTIES(
+ set_source_files_properties(
${ARGN}
PROPERTIES
OBJECT_DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib/target.ld
)
- ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib/target.ld
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib/target.ld
COMMAND sh -c \"make -C ${CMAKE_CURRENT_BINARY_DIR}/ecos || exit -1\; if [ -e ${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib/target.ld ] \; then touch ${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib/target.ld\; fi\"
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile
)
- ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile
COMMAND sh -c \" cd ${CMAKE_CURRENT_BINARY_DIR}/ecos\; ${ECOSCONFIG_EXECUTABLE} --config=${CMAKE_CURRENT_SOURCE_DIR}/ecos/${ECOS_CONFIG_FILE} tree || exit -1\;\"
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ecos/${ECOS_CONFIG_FILE}
)
- ADD_CUSTOM_TARGET( ecos make -C ${CMAKE_CURRENT_BINARY_DIR}/ecos/ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile )
-ENDMACRO(ECOS_ADD_TARGET_LIB)
+ add_custom_target( ecos make -C ${CMAKE_CURRENT_BINARY_DIR}/ecos/ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile )
+endmacro()
# get the directory of the current file, used later on in the file
-GET_FILENAME_COMPONENT( ECOS_CMAKE_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+get_filename_component( ECOS_CMAKE_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
#macro for creating an executable ecos application
#the first parameter is the name of the executable,
#the second is the list of all source files (where the path
#has been adjusted beforehand by calling ECOS_ADJUST_DIRECTORY()
#usage: ECOS_ADD_EXECUTABLE(my_app ${adjusted_SRCS})
-MACRO(ECOS_ADD_EXECUTABLE _exe_NAME )
+macro(ECOS_ADD_EXECUTABLE _exe_NAME )
#definitions, valid for all ecos projects
#the optimization and "-g" for debugging has to be enabled
#in the project-specific CMakeLists.txt
- ADD_DEFINITIONS(-D__ECOS__=1 -D__ECOS=1)
- SET(ECOS_DEFINITIONS -Wall -Wno-long-long -pipe -fno-builtin)
+ add_definitions(-D__ECOS__=1 -D__ECOS=1)
+ set(ECOS_DEFINITIONS -Wall -Wno-long-long -pipe -fno-builtin)
#the executable depends on ecos target.ld
ECOS_ADD_TARGET_LIB(${ARGN})
# when using nmake makefiles, the custom buildtype supresses the default cl.exe flags
# and the rules for creating objects are adjusted for gcc
- SET(CMAKE_BUILD_TYPE CUSTOM_ECOS_BUILD)
- SET(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <FLAGS> -o <OBJECT> -c <SOURCE>")
- SET(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <FLAGS> -o <OBJECT> -c <SOURCE>")
+ set(CMAKE_BUILD_TYPE CUSTOM_ECOS_BUILD)
+ set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <FLAGS> -o <OBJECT> -c <SOURCE>")
+ set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <FLAGS> -o <OBJECT> -c <SOURCE>")
# special link commands for ecos-executables
- SET(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
- SET(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <CMAKE_C_LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
+ set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
+ set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <CMAKE_C_LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
# some strict compiler flags
- SET (CMAKE_C_FLAGS "-Wstrict-prototypes")
- SET (CMAKE_CXX_FLAGS "-Woverloaded-virtual -fno-rtti -Wctor-dtor-privacy -fno-strict-aliasing -fno-exceptions")
+ set (CMAKE_C_FLAGS "-Wstrict-prototypes")
+ set (CMAKE_CXX_FLAGS "-Woverloaded-virtual -fno-rtti -Wctor-dtor-privacy -fno-strict-aliasing -fno-exceptions")
- ADD_EXECUTABLE(${_exe_NAME} ${ARGN})
- SET_TARGET_PROPERTIES(${_exe_NAME} PROPERTIES SUFFIX ".elf")
+ add_executable(${_exe_NAME} ${ARGN})
+ set_target_properties(${_exe_NAME} PROPERTIES SUFFIX ".elf")
#create a binary file
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
TARGET ${_exe_NAME}
POST_BUILD
COMMAND ${ECOS_ARCH_PREFIX}objcopy
@@ -206,7 +206,7 @@ MACRO(ECOS_ADD_EXECUTABLE _exe_NAME )
)
#and an srec file
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
TARGET ${_exe_NAME}
POST_BUILD
COMMAND ${ECOS_ARCH_PREFIX}objcopy
@@ -214,17 +214,17 @@ MACRO(ECOS_ADD_EXECUTABLE _exe_NAME )
)
#add the created files to the clean-files
- SET_DIRECTORY_PROPERTIES(
+ set_directory_properties(
PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.bin;${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.srec;${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst;"
)
- ADD_CUSTOM_TARGET(ecosclean ${CMAKE_COMMAND} -DECOS_DIR=${CMAKE_CURRENT_BINARY_DIR}/ecos/ -P ${ECOS_CMAKE_MODULE_DIR}/ecos_clean.cmake )
- ADD_CUSTOM_TARGET(normalclean ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
- ADD_DEPENDENCIES (ecosclean normalclean)
+ add_custom_target(ecosclean ${CMAKE_COMMAND} -DECOS_DIR=${CMAKE_CURRENT_BINARY_DIR}/ecos/ -P ${ECOS_CMAKE_MODULE_DIR}/ecos_clean.cmake )
+ add_custom_target(normalclean ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+ add_dependencies (ecosclean normalclean)
- ADD_CUSTOM_TARGET( listing
+ add_custom_target( listing
COMMAND echo -e \"\\n--- Symbols sorted by address ---\\n\" > ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
COMMAND ${ECOS_ARCH_PREFIX}nm -S -C -n ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
COMMAND echo -e \"\\n--- Symbols sorted by size ---\\n\" >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
@@ -232,5 +232,5 @@ MACRO(ECOS_ADD_EXECUTABLE _exe_NAME )
COMMAND echo -e \"\\n--- Full assembly listing ---\\n\" >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
COMMAND ${ECOS_ARCH_PREFIX}objdump -S -x -d -C ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst )
-ENDMACRO(ECOS_ADD_EXECUTABLE)
+endmacro()
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 0b2d1b833..1b823a8e9 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -198,7 +198,7 @@ function (__java_copy_file src dest comment)
${dest}
DEPENDS ${src}
COMMENT ${comment})
-endfunction (__java_copy_file src dest comment)
+endfunction ()
# define helper scripts
set(_JAVA_CLASS_FILELIST_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaClassFilelist.cmake)
@@ -209,18 +209,18 @@ function(add_jar _TARGET_NAME)
if (NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR)
set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
- endif(NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR)
+ endif()
if (CMAKE_JAVA_JAR_ENTRY_POINT)
set(_ENTRY_POINT_OPTION e)
set(_ENTRY_POINT_VALUE ${CMAKE_JAVA_JAR_ENTRY_POINT})
- endif (CMAKE_JAVA_JAR_ENTRY_POINT)
+ endif ()
if (LIBRARY_OUTPUT_PATH)
set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH})
- else (LIBRARY_OUTPUT_PATH)
+ else ()
set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR})
- endif (LIBRARY_OUTPUT_PATH)
+ endif ()
set(CMAKE_JAVA_INCLUDE_PATH
${CMAKE_JAVA_INCLUDE_PATH}
@@ -231,13 +231,13 @@ function(add_jar _TARGET_NAME)
if (WIN32 AND NOT CYGWIN)
set(CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
- else (WIN32 AND NOT CYGWIN)
+ else ()
set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
- endif(WIN32 AND NOT CYGWIN)
+ endif()
foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH})
set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
- endforeach(JAVA_INCLUDE_DIR)
+ endforeach()
set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_JAVA_TARGET_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
@@ -250,7 +250,7 @@ function(add_jar _TARGET_NAME)
set(_JAVA_TARGET_OUTPUT_LINK "${_TARGET_NAME}.jar")
elseif (CMAKE_JAVA_TARGET_OUTPUT_NAME)
set(_JAVA_TARGET_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}.jar")
- endif (CMAKE_JAVA_TARGET_OUTPUT_NAME AND CMAKE_JAVA_TARGET_VERSION)
+ endif ()
# reset
set(CMAKE_JAVA_TARGET_OUTPUT_NAME)
@@ -270,9 +270,9 @@ function(add_jar _TARGET_NAME)
string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN)
if (${_BIN_LEN} LESS ${_SRC_LEN})
set(_JAVA_REL_PATH ${_JAVA_REL_BINARY_PATH})
- else (${_BIN_LEN} LESS ${_SRC_LEN})
+ else ()
set(_JAVA_REL_PATH ${_JAVA_REL_SOURCE_PATH})
- endif (${_BIN_LEN} LESS ${_SRC_LEN})
+ endif ()
get_filename_component(_JAVA_REL_PATH ${_JAVA_REL_PATH} PATH)
if (_JAVA_EXT MATCHES ".java")
@@ -290,13 +290,13 @@ function(add_jar _TARGET_NAME)
list(APPEND CMAKE_JAVA_INCLUDE_PATH ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}} ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}_CLASSPATH})
list(APPEND _JAVA_DEPENDS ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}})
- else (_JAVA_EXT MATCHES ".java")
+ else ()
__java_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/${_JAVA_SOURCE_FILE}
${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_SOURCE_FILE}
"Copying ${_JAVA_SOURCE_FILE} to the build directory")
list(APPEND _JAVA_RESOURCE_FILES ${_JAVA_SOURCE_FILE})
- endif (_JAVA_EXT MATCHES ".java")
- endforeach(_JAVA_SOURCE_FILE)
+ endif ()
+ endforeach()
# create an empty java_class_filelist
if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
@@ -327,7 +327,7 @@ function(add_jar _TARGET_NAME)
DEPENDS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
- endif (_JAVA_COMPILE_FILES)
+ endif ()
# create the jar file
set(_JAVA_JAR_OUTPUT_PATH
@@ -367,7 +367,7 @@ function(add_jar _TARGET_NAME)
DEPENDS ${_JAVA_RESOURCE_FILES} ${_JAVA_DEPENDS} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist
COMMENT "Creating Java archive ${_JAVA_TARGET_OUTPUT_NAME}"
)
- endif (CMAKE_JNI_TARGET)
+ endif ()
# Add the target and make sure we have the latest resource files.
add_custom_target(${_TARGET_NAME} ALL DEPENDS ${_JAVA_JAR_OUTPUT_PATH})
@@ -398,8 +398,8 @@ function(add_jar _TARGET_NAME)
JNI_SYMLINK
${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
)
- endif (CMAKE_JNI_TARGET)
- endif (_JAVA_TARGET_OUTPUT_LINK)
+ endif ()
+ endif ()
set_property(
TARGET
@@ -417,7 +417,7 @@ function(add_jar _TARGET_NAME)
${CMAKE_JAVA_CLASS_OUTPUT_PATH}
)
-endfunction(add_jar)
+endfunction()
function(INSTALL_JAR _TARGET_NAME _DESTINATION)
get_property(__FILES
@@ -434,10 +434,10 @@ function(INSTALL_JAR _TARGET_NAME _DESTINATION)
DESTINATION
${_DESTINATION}
)
- else (__FILES)
+ else ()
message(SEND_ERROR "The target ${_TARGET_NAME} is not known in this scope.")
- endif (__FILES)
-endfunction(INSTALL_JAR _TARGET_NAME _DESTINATION)
+ endif ()
+endfunction()
function(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION)
get_property(__SYMLINK
@@ -454,10 +454,10 @@ function(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION)
DESTINATION
${_DESTINATION}
)
- else (__SYMLINK)
+ else ()
message(SEND_ERROR "The target ${_TARGET_NAME} is not known in this scope.")
- endif (__SYMLINK)
-endfunction(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION)
+ endif ()
+endfunction()
function (find_jar VARIABLE)
set(_jar_names)
@@ -481,12 +481,12 @@ function (find_jar VARIABLE)
set(_state "paths")
elseif (${arg} STREQUAL "DOC")
set(_state "doc")
- else (${arg} STREQUAL "NAMES")
+ else ()
set(_jar_names ${arg})
if (_jar_doc STREQUAL "NOTSET")
set(_jar_doc "Finding ${arg} jar")
- endif (_jar_doc STREQUAL "NOTSET")
- endif (${arg} STREQUAL "VERSIONS")
+ endif ()
+ endif ()
elseif (${_state} STREQUAL "versions")
if (${arg} STREQUAL "NAMES")
set(_state "names")
@@ -494,9 +494,9 @@ function (find_jar VARIABLE)
set(_state "paths")
elseif (${arg} STREQUAL "DOC")
set(_state "doc")
- else (${arg} STREQUAL "NAMES")
+ else ()
set(_jar_versions ${_jar_versions} ${arg})
- endif (${arg} STREQUAL "NAMES")
+ endif ()
elseif (${_state} STREQUAL "names")
if (${arg} STREQUAL "VERSIONS")
set(_state "versions")
@@ -504,12 +504,12 @@ function (find_jar VARIABLE)
set(_state "paths")
elseif (${arg} STREQUAL "DOC")
set(_state "doc")
- else (${arg} STREQUAL "VERSIONS")
+ else ()
set(_jar_names ${_jar_names} ${arg})
if (_jar_doc STREQUAL "NOTSET")
set(_jar_doc "Finding ${arg} jar")
- endif (_jar_doc STREQUAL "NOTSET")
- endif (${arg} STREQUAL "VERSIONS")
+ endif ()
+ endif ()
elseif (${_state} STREQUAL "paths")
if (${arg} STREQUAL "VERSIONS")
set(_state "versions")
@@ -517,9 +517,9 @@ function (find_jar VARIABLE)
set(_state "names")
elseif (${arg} STREQUAL "DOC")
set(_state "doc")
- else (${arg} STREQUAL "VERSIONS")
+ else ()
set(_jar_paths ${_jar_paths} ${arg})
- endif (${arg} STREQUAL "VERSIONS")
+ endif ()
elseif (${_state} STREQUAL "doc")
if (${arg} STREQUAL "VERSIONS")
set(_state "versions")
@@ -527,29 +527,29 @@ function (find_jar VARIABLE)
set(_state "names")
elseif (${arg} STREQUAL "PATHS")
set(_state "paths")
- else (${arg} STREQUAL "VERSIONS")
+ else ()
set(_jar_doc ${arg})
- endif (${arg} STREQUAL "VERSIONS")
- endif (${_state} STREQUAL "name")
- endforeach (arg ${ARGN})
+ endif ()
+ endif ()
+ endforeach ()
if (NOT _jar_names)
message(FATAL_ERROR "find_jar: No name to search for given")
- endif (NOT _jar_names)
+ endif ()
foreach (jar_name ${_jar_names})
foreach (version ${_jar_versions})
set(_jar_files ${_jar_files} ${jar_name}-${version}.jar)
- endforeach (version ${_jar_versions})
+ endforeach ()
set(_jar_files ${_jar_files} ${jar_name}.jar)
- endforeach (jar_name ${_jar_names})
+ endforeach ()
find_file(${VARIABLE}
NAMES ${_jar_files}
PATHS ${_jar_paths}
DOC ${_jar_doc}
NO_DEFAULT_PATH)
-endfunction (find_jar VARIABLE)
+endfunction ()
function(create_javadoc _target)
set(_javadoc_packages)
@@ -815,8 +815,8 @@ function(create_javadoc _target)
else ()
set(_javadoc_version ${arg})
endif ()
- endif (${_state} STREQUAL "package")
- endforeach (arg ${ARGN})
+ endif ()
+ endforeach ()
set(_javadoc_builddir ${CMAKE_CURRENT_BINARY_DIR}/javadoc/${_target})
set(_javadoc_options -d ${_javadoc_builddir})
@@ -827,12 +827,12 @@ function(create_javadoc _target)
if (_start)
set(_sourcepath ${_path})
set(_start FALSE)
- else (_start)
+ else ()
set(_sourcepath ${_sourcepath}:${_path})
- endif (_start)
- endforeach(_path ${_javadoc_sourcepath})
+ endif ()
+ endforeach()
set(_javadoc_options ${_javadoc_options} -sourcepath ${_sourcepath})
- endif (_javadoc_sourcepath)
+ endif ()
if (_javadoc_classpath)
set(_start TRUE)
@@ -840,32 +840,32 @@ function(create_javadoc _target)
if (_start)
set(_classpath ${_path})
set(_start FALSE)
- else (_start)
+ else ()
set(_classpath ${_classpath}:${_path})
- endif (_start)
- endforeach(_path ${_javadoc_classpath})
+ endif ()
+ endforeach()
set(_javadoc_options ${_javadoc_options} -classpath "${_classpath}")
- endif (_javadoc_classpath)
+ endif ()
if (_javadoc_doctitle)
set(_javadoc_options ${_javadoc_options} -doctitle '${_javadoc_doctitle}')
- endif (_javadoc_doctitle)
+ endif ()
if (_javadoc_windowtitle)
set(_javadoc_options ${_javadoc_options} -windowtitle '${_javadoc_windowtitle}')
- endif (_javadoc_windowtitle)
+ endif ()
if (_javadoc_author)
set(_javadoc_options ${_javadoc_options} -author)
- endif (_javadoc_author)
+ endif ()
if (_javadoc_use)
set(_javadoc_options ${_javadoc_options} -use)
- endif (_javadoc_use)
+ endif ()
if (_javadoc_version)
set(_javadoc_options ${_javadoc_options} -version)
- endif (_javadoc_version)
+ endif ()
add_custom_target(${_target}_javadoc ALL
COMMAND ${Java_JAVADOC_EXECUTABLE} ${_javadoc_options}
@@ -878,4 +878,4 @@ function(create_javadoc _target)
DIRECTORY ${_javadoc_builddir}
DESTINATION ${_javadoc_installpath}
)
-endfunction(create_javadoc)
+endfunction()
diff --git a/Modules/UseJavaClassFilelist.cmake b/Modules/UseJavaClassFilelist.cmake
index c842bf71a..6f3a4e7a9 100644
--- a/Modules/UseJavaClassFilelist.cmake
+++ b/Modules/UseJavaClassFilelist.cmake
@@ -28,25 +28,25 @@ if (CMAKE_JAVA_CLASS_OUTPUT_PATH)
file(GLOB_RECURSE _JAVA_GLOBBED_TMP_FILES "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${JAR_CLASS_PREFIX}/*.class")
if (_JAVA_GLOBBED_TMP_FILES)
list(APPEND _JAVA_GLOBBED_FILES ${_JAVA_GLOBBED_TMP_FILES})
- endif (_JAVA_GLOBBED_TMP_FILES)
- endforeach(JAR_CLASS_PREFIX ${CMAKE_JAR_CLASSES_PREFIX})
+ endif ()
+ endforeach()
else()
file(GLOB_RECURSE _JAVA_GLOBBED_FILES "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/*.class")
- endif (CMAKE_JAR_CLASSES_PREFIX)
+ endif ()
set(_JAVA_CLASS_FILES)
# file(GLOB_RECURSE foo RELATIVE) is broken so we need this.
foreach(_JAVA_GLOBBED_FILE ${_JAVA_GLOBBED_FILES})
file(RELATIVE_PATH _JAVA_CLASS_FILE ${CMAKE_JAVA_CLASS_OUTPUT_PATH} ${_JAVA_GLOBBED_FILE})
set(_JAVA_CLASS_FILES ${_JAVA_CLASS_FILES}${_JAVA_CLASS_FILE}\n)
- endforeach(_JAVA_GLOBBED_FILE ${_JAVA_GLOBBED_FILES})
+ endforeach()
# write to file
file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist ${_JAVA_CLASS_FILES})
- else (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}")
+ else ()
message(SEND_ERROR "FATAL: Java class output path doesn't exist")
- endif (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}")
-else (CMAKE_JAVA_CLASS_OUTPUT_PATH)
+ endif ()
+else ()
message(SEND_ERROR "FATAL: Can't find CMAKE_JAVA_CLASS_OUTPUT_PATH")
-endif (CMAKE_JAVA_CLASS_OUTPUT_PATH)
+endif ()
diff --git a/Modules/UseJavaSymlinks.cmake b/Modules/UseJavaSymlinks.cmake
index c66ee1ea1..88dd7689c 100644
--- a/Modules/UseJavaSymlinks.cmake
+++ b/Modules/UseJavaSymlinks.cmake
@@ -26,7 +26,7 @@ if (UNIX AND _JAVA_TARGET_OUTPUT_LINK)
COMMAND ${LN_EXECUTABLE} -sf "${_JAVA_TARGET_OUTPUT_NAME}" "${_JAVA_TARGET_OUTPUT_LINK}"
WORKING_DIRECTORY ${_JAVA_TARGET_DIR}
)
- else (_JAVA_TARGET_OUTPUT_NAME)
+ else ()
message(SEND_ERROR "FATAL: Can't find _JAVA_TARGET_OUTPUT_NAME")
- endif (_JAVA_TARGET_OUTPUT_NAME)
-endif (UNIX AND _JAVA_TARGET_OUTPUT_LINK)
+ endif ()
+endif ()
diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake
index 7f4318f05..b1569f9da 100644
--- a/Modules/UsePkgConfig.cmake
+++ b/Modules/UsePkgConfig.cmake
@@ -24,55 +24,55 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config )
+find_program(PKGCONFIG_EXECUTABLE NAMES pkg-config )
-MACRO(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
- MESSAGE(STATUS
+macro(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
+ message(STATUS
"WARNING: you are using the obsolete 'PKGCONFIG' macro, use FindPkgConfig")
# reset the variables at the beginning
- SET(${_include_DIR})
- SET(${_link_DIR})
- SET(${_link_FLAGS})
- SET(${_cflags})
+ set(${_include_DIR})
+ set(${_link_DIR})
+ set(${_link_FLAGS})
+ set(${_cflags})
# if pkg-config has been found
- IF(PKGCONFIG_EXECUTABLE)
+ if(PKGCONFIG_EXECUTABLE)
- EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --exists RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
+ exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --exists RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
# and if the package of interest also exists for pkg-config, then get the information
- IF(NOT _return_VALUE)
+ if(NOT _return_VALUE)
- EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=includedir
+ exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=includedir
OUTPUT_VARIABLE ${_include_DIR} )
- STRING(REGEX REPLACE "[\r\n]" " " ${_include_DIR} "${${_include_DIR}}")
+ string(REGEX REPLACE "[\r\n]" " " ${_include_DIR} "${${_include_DIR}}")
- EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=libdir
+ exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=libdir
OUTPUT_VARIABLE ${_link_DIR} )
- STRING(REGEX REPLACE "[\r\n]" " " ${_link_DIR} "${${_link_DIR}}")
+ string(REGEX REPLACE "[\r\n]" " " ${_link_DIR} "${${_link_DIR}}")
- EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --libs
+ exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --libs
OUTPUT_VARIABLE ${_link_FLAGS} )
- STRING(REGEX REPLACE "[\r\n]" " " ${_link_FLAGS} "${${_link_FLAGS}}")
+ string(REGEX REPLACE "[\r\n]" " " ${_link_FLAGS} "${${_link_FLAGS}}")
- EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --cflags
+ exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --cflags
OUTPUT_VARIABLE ${_cflags} )
- STRING(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}")
+ string(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}")
- ELSE( NOT _return_VALUE)
+ else()
- MESSAGE(STATUS "PKGCONFIG() indicates that ${_package} is not installed (install the package which contains ${_package}.pc if you want to support this feature)")
+ message(STATUS "PKGCONFIG() indicates that ${_package} is not installed (install the package which contains ${_package}.pc if you want to support this feature)")
- ENDIF(NOT _return_VALUE)
+ endif()
# if pkg-config has NOT been found, INFORM the user
- ELSE(PKGCONFIG_EXECUTABLE)
+ else()
- MESSAGE(STATUS "WARNING: PKGCONFIG() indicates that the tool pkg-config has not been found on your system. You should install it.")
+ message(STATUS "WARNING: PKGCONFIG() indicates that the tool pkg-config has not been found on your system. You should install it.")
- ENDIF(PKGCONFIG_EXECUTABLE)
+ endif()
-ENDMACRO(PKGCONFIG _include_DIR _link_DIR _link_FLAGS _cflags)
+endmacro()
-MARK_AS_ADVANCED(PKGCONFIG_EXECUTABLE)
+mark_as_advanced(PKGCONFIG_EXECUTABLE)
diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake
index 027504fc5..e8166f4fc 100644
--- a/Modules/UseQt4.cmake
+++ b/Modules/UseQt4.cmake
@@ -16,93 +16,93 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-ADD_DEFINITIONS(${QT_DEFINITIONS})
-SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG QT_DEBUG)
-SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
-SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
-SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
-IF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
- SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS QT_NO_DEBUG)
-ENDIF()
+add_definitions(${QT_DEFINITIONS})
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG QT_DEBUG)
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
+if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
+ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS QT_NO_DEBUG)
+endif()
-INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
+include_directories(${QT_INCLUDE_DIR})
-SET(QT_LIBRARIES "")
-SET(QT_LIBRARIES_PLUGINS "")
+set(QT_LIBRARIES "")
+set(QT_LIBRARIES_PLUGINS "")
-IF (QT_USE_QTMAIN)
- IF (Q_WS_WIN)
- SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
- ENDIF (Q_WS_WIN)
-ENDIF (QT_USE_QTMAIN)
+if (QT_USE_QTMAIN)
+ if (Q_WS_WIN)
+ set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
+ endif ()
+endif ()
-IF(QT_DONT_USE_QTGUI)
- SET(QT_USE_QTGUI 0)
-ELSE(QT_DONT_USE_QTGUI)
- SET(QT_USE_QTGUI 1)
-ENDIF(QT_DONT_USE_QTGUI)
+if(QT_DONT_USE_QTGUI)
+ set(QT_USE_QTGUI 0)
+else()
+ set(QT_USE_QTGUI 1)
+endif()
-IF(QT_DONT_USE_QTCORE)
- SET(QT_USE_QTCORE 0)
-ELSE(QT_DONT_USE_QTCORE)
- SET(QT_USE_QTCORE 1)
-ENDIF(QT_DONT_USE_QTCORE)
+if(QT_DONT_USE_QTCORE)
+ set(QT_USE_QTCORE 0)
+else()
+ set(QT_USE_QTCORE 1)
+endif()
-IF (QT_USE_QT3SUPPORT)
- ADD_DEFINITIONS(-DQT3_SUPPORT)
-ENDIF (QT_USE_QT3SUPPORT)
+if (QT_USE_QT3SUPPORT)
+ add_definitions(-DQT3_SUPPORT)
+endif ()
# list dependent modules, so dependent libraries are added
-SET(QT_QT3SUPPORT_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
-SET(QT_QTSVG_MODULE_DEPENDS QTGUI QTXML QTCORE)
-SET(QT_QTUITOOLS_MODULE_DEPENDS QTGUI QTXML QTCORE)
-SET(QT_QTHELP_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
-IF(QT_QTDBUS_FOUND)
- SET(QT_PHONON_MODULE_DEPENDS QTGUI QTDBUS QTCORE)
-ELSE(QT_QTDBUS_FOUND)
- SET(QT_PHONON_MODULE_DEPENDS QTGUI QTCORE)
-ENDIF(QT_QTDBUS_FOUND)
-SET(QT_QTDBUS_MODULE_DEPENDS QTXML QTCORE)
-SET(QT_QTXMLPATTERNS_MODULE_DEPENDS QTNETWORK QTCORE)
-SET(QT_QAXCONTAINER_MODULE_DEPENDS QTGUI QTCORE)
-SET(QT_QAXSERVER_MODULE_DEPENDS QTGUI QTCORE)
-SET(QT_QTSCRIPTTOOLS_MODULE_DEPENDS QTGUI QTCORE)
-SET(QT_QTWEBKIT_MODULE_DEPENDS QTXMLPATTERNS QTGUI QTCORE)
-SET(QT_QTDECLARATIVE_MODULE_DEPENDS QTSCRIPT QTSVG QTSQL QTXMLPATTERNS QTGUI QTCORE)
-SET(QT_QTMULTIMEDIA_MODULE_DEPENDS QTGUI QTCORE)
-SET(QT_QTOPENGL_MODULE_DEPENDS QTGUI QTCORE)
-SET(QT_QTSCRIPT_MODULE_DEPENDS QTCORE)
-SET(QT_QTGUI_MODULE_DEPENDS QTCORE)
-SET(QT_QTTEST_MODULE_DEPENDS QTCORE)
-SET(QT_QTXML_MODULE_DEPENDS QTCORE)
-SET(QT_QTSQL_MODULE_DEPENDS QTCORE)
-SET(QT_QTNETWORK_MODULE_DEPENDS QTCORE)
+set(QT_QT3SUPPORT_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
+set(QT_QTSVG_MODULE_DEPENDS QTGUI QTXML QTCORE)
+set(QT_QTUITOOLS_MODULE_DEPENDS QTGUI QTXML QTCORE)
+set(QT_QTHELP_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
+if(QT_QTDBUS_FOUND)
+ set(QT_PHONON_MODULE_DEPENDS QTGUI QTDBUS QTCORE)
+else()
+ set(QT_PHONON_MODULE_DEPENDS QTGUI QTCORE)
+endif()
+set(QT_QTDBUS_MODULE_DEPENDS QTXML QTCORE)
+set(QT_QTXMLPATTERNS_MODULE_DEPENDS QTNETWORK QTCORE)
+set(QT_QAXCONTAINER_MODULE_DEPENDS QTGUI QTCORE)
+set(QT_QAXSERVER_MODULE_DEPENDS QTGUI QTCORE)
+set(QT_QTSCRIPTTOOLS_MODULE_DEPENDS QTGUI QTCORE)
+set(QT_QTWEBKIT_MODULE_DEPENDS QTXMLPATTERNS QTGUI QTCORE)
+set(QT_QTDECLARATIVE_MODULE_DEPENDS QTSCRIPT QTSVG QTSQL QTXMLPATTERNS QTGUI QTCORE)
+set(QT_QTMULTIMEDIA_MODULE_DEPENDS QTGUI QTCORE)
+set(QT_QTOPENGL_MODULE_DEPENDS QTGUI QTCORE)
+set(QT_QTSCRIPT_MODULE_DEPENDS QTCORE)
+set(QT_QTGUI_MODULE_DEPENDS QTCORE)
+set(QT_QTTEST_MODULE_DEPENDS QTCORE)
+set(QT_QTXML_MODULE_DEPENDS QTCORE)
+set(QT_QTSQL_MODULE_DEPENDS QTCORE)
+set(QT_QTNETWORK_MODULE_DEPENDS QTCORE)
# Qt modules (in order of dependence)
-FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
+foreach(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG QTUITOOLS QTHELP
QTWEBKIT PHONON QTSCRIPTTOOLS QTMULTIMEDIA QTXMLPATTERNS QTGUI QTTEST
QTDBUS QTXML QTSQL QTNETWORK QTCORE)
- IF (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
- IF (QT_${module}_FOUND)
- IF(QT_USE_${module})
- STRING(REPLACE "QT" "" qt_module_def "${module}")
- ADD_DEFINITIONS(-DQT_${qt_module_def}_LIB)
- INCLUDE_DIRECTORIES(${QT_${module}_INCLUDE_DIR})
- ENDIF(QT_USE_${module})
- SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY})
- SET(QT_LIBRARIES_PLUGINS ${QT_LIBRARIES_PLUGINS} ${QT_${module}_PLUGINS})
- IF(QT_IS_STATIC)
- SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES})
- ENDIF(QT_IS_STATIC)
- FOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
- SET(QT_USE_${depend_module}_DEPENDS 1)
- ENDFOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
- ELSE (QT_${module}_FOUND)
- MESSAGE("Qt ${module} library not found.")
- ENDIF (QT_${module}_FOUND)
- ENDIF (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
-
-ENDFOREACH(module)
+ if (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
+ if (QT_${module}_FOUND)
+ if(QT_USE_${module})
+ string(REPLACE "QT" "" qt_module_def "${module}")
+ add_definitions(-DQT_${qt_module_def}_LIB)
+ include_directories(${QT_${module}_INCLUDE_DIR})
+ endif()
+ set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY})
+ set(QT_LIBRARIES_PLUGINS ${QT_LIBRARIES_PLUGINS} ${QT_${module}_PLUGINS})
+ if(QT_IS_STATIC)
+ set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES})
+ endif()
+ foreach(depend_module ${QT_${module}_MODULE_DEPENDS})
+ set(QT_USE_${depend_module}_DEPENDS 1)
+ endforeach()
+ else ()
+ message("Qt ${module} library not found.")
+ endif ()
+ endif ()
+
+endforeach()
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index ef7672440..2a095854c 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -10,12 +10,12 @@
# Set Source files properties such as CPLUSPLUS and SWIG_FLAGS to specify
# special behavior of SWIG. Also global CMAKE_SWIG_FLAGS can be used to add
# special flags to all swig calls.
-# Another special variable is CMAKE_SWIG_OUTDIR, it allows one to specify
+# Another special variable is CMAKE_SWIG_OUTDIR, it allows one to specify
# where to write all the swig generated module (swig -outdir option)
# The name-specific variable SWIG_MODULE_<name>_EXTRA_DEPS may be used
# to specify extra dependencies for the generated modules.
# If the source file generated by swig need some special flag you can use
-# SET_SOURCE_FILES_PROPERTIES( ${swig_generated_file_fullname}
+# set_source_files_properties( ${swig_generated_file_fullname}
# PROPERTIES COMPILE_FLAGS "-bla")
@@ -33,136 +33,136 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(SWIG_CXX_EXTENSION "cxx")
-SET(SWIG_EXTRA_LIBRARIES "")
+set(SWIG_CXX_EXTENSION "cxx")
+set(SWIG_EXTRA_LIBRARIES "")
-SET(SWIG_PYTHON_EXTRA_FILE_EXTENSION "py")
+set(SWIG_PYTHON_EXTRA_FILE_EXTENSION "py")
#
# For given swig module initialize variables associated with it
#
-MACRO(SWIG_MODULE_INITIALIZE name language)
- STRING(TOUPPER "${language}" swig_uppercase_language)
- STRING(TOLOWER "${language}" swig_lowercase_language)
- SET(SWIG_MODULE_${name}_LANGUAGE "${swig_uppercase_language}")
- SET(SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG "${swig_lowercase_language}")
-
- SET(SWIG_MODULE_${name}_REAL_NAME "${name}")
- IF("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "UNKNOWN")
- MESSAGE(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
- ELSEIF("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PYTHON")
+macro(SWIG_MODULE_INITIALIZE name language)
+ string(TOUPPER "${language}" swig_uppercase_language)
+ string(TOLOWER "${language}" swig_lowercase_language)
+ set(SWIG_MODULE_${name}_LANGUAGE "${swig_uppercase_language}")
+ set(SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG "${swig_lowercase_language}")
+
+ set(SWIG_MODULE_${name}_REAL_NAME "${name}")
+ if("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "UNKNOWN")
+ message(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
+ elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PYTHON")
# when swig is used without the -interface it will produce in the module.py
- # a 'import _modulename' statement, which implies having a corresponding
+ # a 'import _modulename' statement, which implies having a corresponding
# _modulename.so (*NIX), _modulename.pyd (Win32).
- SET(SWIG_MODULE_${name}_REAL_NAME "_${name}")
- ELSEIF("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PERL")
- SET(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")
- ENDIF()
-ENDMACRO(SWIG_MODULE_INITIALIZE)
+ set(SWIG_MODULE_${name}_REAL_NAME "_${name}")
+ elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PERL")
+ set(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")
+ endif()
+endmacro()
#
# For a given language, input file, and output file, determine extra files that
# will be generated. This is internal swig macro.
#
-MACRO(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
- SET(${outfiles} "")
- GET_SOURCE_FILE_PROPERTY(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename
+macro(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
+ set(${outfiles} "")
+ get_source_file_property(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename
${infile} SWIG_MODULE_NAME)
- IF(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
- GET_FILENAME_COMPONENT(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${infile}" NAME_WE)
- ENDIF(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
- FOREACH(it ${SWIG_${language}_EXTRA_FILE_EXTENSION})
- SET(${outfiles} ${${outfiles}}
+ if(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
+ get_filename_component(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${infile}" NAME_WE)
+ endif()
+ foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSION})
+ set(${outfiles} ${${outfiles}}
"${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}.${it}")
- ENDFOREACH(it)
-ENDMACRO(SWIG_GET_EXTRA_OUTPUT_FILES)
+ endforeach()
+endmacro()
#
# Take swig (*.i) file and add proper custom commands for it
#
-MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
- SET(swig_full_infile ${infile})
- GET_FILENAME_COMPONENT(swig_source_file_path "${infile}" PATH)
- GET_FILENAME_COMPONENT(swig_source_file_name_we "${infile}" NAME_WE)
- GET_SOURCE_FILE_PROPERTY(swig_source_file_generated ${infile} GENERATED)
- GET_SOURCE_FILE_PROPERTY(swig_source_file_cplusplus ${infile} CPLUSPLUS)
- GET_SOURCE_FILE_PROPERTY(swig_source_file_flags ${infile} SWIG_FLAGS)
- IF("${swig_source_file_flags}" STREQUAL "NOTFOUND")
- SET(swig_source_file_flags "")
- ENDIF("${swig_source_file_flags}" STREQUAL "NOTFOUND")
- SET(swig_source_file_fullname "${infile}")
- IF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
- STRING(REGEX REPLACE
+macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
+ set(swig_full_infile ${infile})
+ get_filename_component(swig_source_file_path "${infile}" PATH)
+ get_filename_component(swig_source_file_name_we "${infile}" NAME_WE)
+ get_source_file_property(swig_source_file_generated ${infile} GENERATED)
+ get_source_file_property(swig_source_file_cplusplus ${infile} CPLUSPLUS)
+ get_source_file_property(swig_source_file_flags ${infile} SWIG_FLAGS)
+ if("${swig_source_file_flags}" STREQUAL "NOTFOUND")
+ set(swig_source_file_flags "")
+ endif()
+ set(swig_source_file_fullname "${infile}")
+ if(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
+ string(REGEX REPLACE
"^${CMAKE_CURRENT_SOURCE_DIR}" ""
swig_source_file_relative_path
"${swig_source_file_path}")
- ELSE(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
- IF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
- STRING(REGEX REPLACE
+ else()
+ if(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
+ string(REGEX REPLACE
"^${CMAKE_CURRENT_BINARY_DIR}" ""
swig_source_file_relative_path
"${swig_source_file_path}")
- SET(swig_source_file_generated 1)
- ELSE(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
- SET(swig_source_file_relative_path "${swig_source_file_path}")
- IF(swig_source_file_generated)
- SET(swig_source_file_fullname "${CMAKE_CURRENT_BINARY_DIR}/${infile}")
- ELSE(swig_source_file_generated)
- SET(swig_source_file_fullname "${CMAKE_CURRENT_SOURCE_DIR}/${infile}")
- ENDIF(swig_source_file_generated)
- ENDIF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
- ENDIF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
-
- SET(swig_generated_file_fullname
+ set(swig_source_file_generated 1)
+ else()
+ set(swig_source_file_relative_path "${swig_source_file_path}")
+ if(swig_source_file_generated)
+ set(swig_source_file_fullname "${CMAKE_CURRENT_BINARY_DIR}/${infile}")
+ else()
+ set(swig_source_file_fullname "${CMAKE_CURRENT_SOURCE_DIR}/${infile}")
+ endif()
+ endif()
+ endif()
+
+ set(swig_generated_file_fullname
"${CMAKE_CURRENT_BINARY_DIR}")
- IF(swig_source_file_relative_path)
- SET(swig_generated_file_fullname
+ if(swig_source_file_relative_path)
+ set(swig_generated_file_fullname
"${swig_generated_file_fullname}/${swig_source_file_relative_path}")
- ENDIF(swig_source_file_relative_path)
+ endif()
# If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir
- IF(CMAKE_SWIG_OUTDIR)
- SET(swig_outdir ${CMAKE_SWIG_OUTDIR})
- ELSE(CMAKE_SWIG_OUTDIR)
- SET(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
- ENDIF(CMAKE_SWIG_OUTDIR)
+ if(CMAKE_SWIG_OUTDIR)
+ set(swig_outdir ${CMAKE_SWIG_OUTDIR})
+ else()
+ set(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
+ endif()
SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE}
swig_extra_generated_files
"${swig_outdir}"
"${infile}")
- SET(swig_generated_file_fullname
+ set(swig_generated_file_fullname
"${swig_generated_file_fullname}/${swig_source_file_name_we}")
# add the language into the name of the file (i.e. TCL_wrap)
# this allows for the same .i file to be wrapped into different languages
- SET(swig_generated_file_fullname
+ set(swig_generated_file_fullname
"${swig_generated_file_fullname}${SWIG_MODULE_${name}_LANGUAGE}_wrap")
- IF(swig_source_file_cplusplus)
- SET(swig_generated_file_fullname
+ if(swig_source_file_cplusplus)
+ set(swig_generated_file_fullname
"${swig_generated_file_fullname}.${SWIG_CXX_EXTENSION}")
- ELSE(swig_source_file_cplusplus)
- SET(swig_generated_file_fullname
+ else()
+ set(swig_generated_file_fullname
"${swig_generated_file_fullname}.c")
- ENDIF(swig_source_file_cplusplus)
+ endif()
- #MESSAGE("Full path to source file: ${swig_source_file_fullname}")
- #MESSAGE("Full path to the output file: ${swig_generated_file_fullname}")
- GET_DIRECTORY_PROPERTY(cmake_include_directories INCLUDE_DIRECTORIES)
- SET(swig_include_dirs)
- FOREACH(it ${cmake_include_directories})
- SET(swig_include_dirs ${swig_include_dirs} "-I${it}")
- ENDFOREACH(it)
+ #message("Full path to source file: ${swig_source_file_fullname}")
+ #message("Full path to the output file: ${swig_generated_file_fullname}")
+ get_directory_property(cmake_include_directories INCLUDE_DIRECTORIES)
+ set(swig_include_dirs)
+ foreach(it ${cmake_include_directories})
+ set(swig_include_dirs ${swig_include_dirs} "-I${it}")
+ endforeach()
- SET(swig_special_flags)
+ set(swig_special_flags)
# default is c, so add c++ flag if it is c++
- IF(swig_source_file_cplusplus)
- SET(swig_special_flags ${swig_special_flags} "-c++")
- ENDIF(swig_source_file_cplusplus)
- SET(swig_extra_flags)
- IF(SWIG_MODULE_${name}_EXTRA_FLAGS)
- SET(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS})
- ENDIF(SWIG_MODULE_${name}_EXTRA_FLAGS)
- ADD_CUSTOM_COMMAND(
+ if(swig_source_file_cplusplus)
+ set(swig_special_flags ${swig_special_flags} "-c++")
+ endif()
+ set(swig_extra_flags)
+ if(SWIG_MODULE_${name}_EXTRA_FLAGS)
+ set(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS})
+ endif()
+ add_custom_command(
OUTPUT "${swig_generated_file_fullname}" ${swig_extra_generated_files}
# Let's create the ${swig_outdir} at execution time, in case dir contains $(OutDir)
COMMAND ${CMAKE_COMMAND} -E make_directory ${swig_outdir}
@@ -178,54 +178,54 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
"${swig_source_file_fullname}"
MAIN_DEPENDENCY "${swig_source_file_fullname}"
DEPENDS ${SWIG_MODULE_${name}_EXTRA_DEPS}
- COMMENT "Swig source")
- SET_SOURCE_FILES_PROPERTIES("${swig_generated_file_fullname}" ${swig_extra_generated_files}
+ COMMENT "Swig source")
+ set_source_files_properties("${swig_generated_file_fullname}" ${swig_extra_generated_files}
PROPERTIES GENERATED 1)
- SET(${outfiles} "${swig_generated_file_fullname}" ${swig_extra_generated_files})
-ENDMACRO(SWIG_ADD_SOURCE_TO_MODULE)
+ set(${outfiles} "${swig_generated_file_fullname}" ${swig_extra_generated_files})
+endmacro()
#
# Create Swig module
#
-MACRO(SWIG_ADD_MODULE name language)
+macro(SWIG_ADD_MODULE name language)
SWIG_MODULE_INITIALIZE(${name} ${language})
- SET(swig_dot_i_sources)
- SET(swig_other_sources)
- FOREACH(it ${ARGN})
- IF(${it} MATCHES ".*\\.i$")
- SET(swig_dot_i_sources ${swig_dot_i_sources} "${it}")
- ELSE(${it} MATCHES ".*\\.i$")
- SET(swig_other_sources ${swig_other_sources} "${it}")
- ENDIF(${it} MATCHES ".*\\.i$")
- ENDFOREACH(it)
-
- SET(swig_generated_sources)
- FOREACH(it ${swig_dot_i_sources})
+ set(swig_dot_i_sources)
+ set(swig_other_sources)
+ foreach(it ${ARGN})
+ if(${it} MATCHES ".*\\.i$")
+ set(swig_dot_i_sources ${swig_dot_i_sources} "${it}")
+ else()
+ set(swig_other_sources ${swig_other_sources} "${it}")
+ endif()
+ endforeach()
+
+ set(swig_generated_sources)
+ foreach(it ${swig_dot_i_sources})
SWIG_ADD_SOURCE_TO_MODULE(${name} swig_generated_source ${it})
- SET(swig_generated_sources ${swig_generated_sources} "${swig_generated_source}")
- ENDFOREACH(it)
- GET_DIRECTORY_PROPERTY(swig_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
- SET_DIRECTORY_PROPERTIES(PROPERTIES
+ set(swig_generated_sources ${swig_generated_sources} "${swig_generated_source}")
+ endforeach()
+ get_directory_property(swig_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
+ set_directory_properties(PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES "${swig_extra_clean_files};${swig_generated_sources}")
- ADD_LIBRARY(${SWIG_MODULE_${name}_REAL_NAME}
+ add_library(${SWIG_MODULE_${name}_REAL_NAME}
MODULE
${swig_generated_sources}
${swig_other_sources})
- STRING(TOLOWER "${language}" swig_lowercase_language)
- IF ("${swig_lowercase_language}" STREQUAL "java")
- IF (APPLE)
+ string(TOLOWER "${language}" swig_lowercase_language)
+ if ("${swig_lowercase_language}" STREQUAL "java")
+ if (APPLE)
# In java you want:
# System.loadLibrary("LIBRARY");
# then JNI will look for a library whose name is platform dependent, namely
# MacOS : libLIBRARY.jnilib
# Windows: LIBRARY.dll
# Linux : libLIBRARY.so
- SET_TARGET_PROPERTIES (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".jnilib")
- ENDIF (APPLE)
- ENDIF ("${swig_lowercase_language}" STREQUAL "java")
- IF ("${swig_lowercase_language}" STREQUAL "python")
+ set_target_properties (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".jnilib")
+ endif ()
+ endif ()
+ if ("${swig_lowercase_language}" STREQUAL "python")
# this is only needed for the python case where a _modulename.so is generated
- SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "")
+ set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "")
# Python extension modules on Windows must have the extension ".pyd"
# instead of ".dll" as of Python 2.5. Older python versions do support
# this suffix.
@@ -234,20 +234,20 @@ MACRO(SWIG_ADD_MODULE name language)
# Windows: .dll is no longer supported as a filename extension for extension modules.
# .pyd is now the only filename extension that will be searched for.
# </quote>
- IF(WIN32 AND NOT CYGWIN)
- SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".pyd")
- ENDIF(WIN32 AND NOT CYGWIN)
- ENDIF ("${swig_lowercase_language}" STREQUAL "python")
-ENDMACRO(SWIG_ADD_MODULE)
+ if(WIN32 AND NOT CYGWIN)
+ set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".pyd")
+ endif()
+ endif ()
+endmacro()
#
# Like TARGET_LINK_LIBRARIES but for swig modules
#
-MACRO(SWIG_LINK_LIBRARIES name)
- IF(SWIG_MODULE_${name}_REAL_NAME)
- TARGET_LINK_LIBRARIES(${SWIG_MODULE_${name}_REAL_NAME} ${ARGN})
- ELSE(SWIG_MODULE_${name}_REAL_NAME)
- MESSAGE(SEND_ERROR "Cannot find Swig library \"${name}\".")
- ENDIF(SWIG_MODULE_${name}_REAL_NAME)
-ENDMACRO(SWIG_LINK_LIBRARIES name)
+macro(SWIG_LINK_LIBRARIES name)
+ if(SWIG_MODULE_${name}_REAL_NAME)
+ target_link_libraries(${SWIG_MODULE_${name}_REAL_NAME} ${ARGN})
+ else()
+ message(SEND_ERROR "Cannot find Swig library \"${name}\".")
+ endif()
+endmacro()
diff --git a/Modules/UseVTK40.cmake b/Modules/UseVTK40.cmake
index c1157d6be..d6bdaaa52 100644
--- a/Modules/UseVTK40.cmake
+++ b/Modules/UseVTK40.cmake
@@ -19,11 +19,11 @@
# to point here.
# Add compiler flags needed to use VTK.
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VTK_REQUIRED_C_FLAGS}")
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VTK_REQUIRED_CXX_FLAGS}")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VTK_REQUIRED_C_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VTK_REQUIRED_CXX_FLAGS}")
# Add include directories needed to use VTK.
-INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
+include_directories(${VTK_INCLUDE_DIRS})
# Add link directories needed to use VTK.
-LINK_DIRECTORIES(${VTK_LIBRARY_DIRS})
+link_directories(${VTK_LIBRARY_DIRS})
diff --git a/Modules/UseVTKBuildSettings40.cmake b/Modules/UseVTKBuildSettings40.cmake
index 4df59b9dd..474f67c9c 100644
--- a/Modules/UseVTKBuildSettings40.cmake
+++ b/Modules/UseVTKBuildSettings40.cmake
@@ -16,23 +16,23 @@
# Implementation detail for FindVTK.cmake to let it provide a
# VTK_BUILD_SETTINGS_FILE for VTK 4.0.
-SET(CMAKE_BUILD_SETTING_CMAKE_MAJOR_VERSION "${VTK40_CMAKE_MAJOR_VERSION}")
-SET(CMAKE_BUILD_SETTING_CMAKE_MINOR_VERSION "${VTK40_CMAKE_MINOR_VERSION}")
-SET(CMAKE_BUILD_SETTING_PROJECT_NAME "VTK")
+set(CMAKE_BUILD_SETTING_CMAKE_MAJOR_VERSION "${VTK40_CMAKE_MAJOR_VERSION}")
+set(CMAKE_BUILD_SETTING_CMAKE_MINOR_VERSION "${VTK40_CMAKE_MINOR_VERSION}")
+set(CMAKE_BUILD_SETTING_PROJECT_NAME "VTK")
-SET(CMAKE_BUILD_SETTING_C_COMPILER "${VTK40_CMAKE_C_COMPILER}")
-SET(CMAKE_BUILD_SETTING_C_FLAGS "${VTK40_CMAKE_C_FLAGS}")
-SET(CMAKE_BUILD_SETTING_C_FLAGS_DEBUG "${VTK40_CMAKE_C_FLAGS_DEBUG}")
-SET(CMAKE_BUILD_SETTING_C_FLAGS_RELEASE "${VTK40_CMAKE_C_FLAGS_RELEASE}")
-SET(CMAKE_BUILD_SETTING_C_FLAGS_MINSIZEREL "${VTK40_CMAKE_C_FLAGS_MINSIZEREL}")
-SET(CMAKE_BUILD_SETTING_C_FLAGS_RELWITHDEBINFO "${VTK40_CMAKE_C_FLAGS_RELWITHDEBINFO}")
+set(CMAKE_BUILD_SETTING_C_COMPILER "${VTK40_CMAKE_C_COMPILER}")
+set(CMAKE_BUILD_SETTING_C_FLAGS "${VTK40_CMAKE_C_FLAGS}")
+set(CMAKE_BUILD_SETTING_C_FLAGS_DEBUG "${VTK40_CMAKE_C_FLAGS_DEBUG}")
+set(CMAKE_BUILD_SETTING_C_FLAGS_RELEASE "${VTK40_CMAKE_C_FLAGS_RELEASE}")
+set(CMAKE_BUILD_SETTING_C_FLAGS_MINSIZEREL "${VTK40_CMAKE_C_FLAGS_MINSIZEREL}")
+set(CMAKE_BUILD_SETTING_C_FLAGS_RELWITHDEBINFO "${VTK40_CMAKE_C_FLAGS_RELWITHDEBINFO}")
-SET(CMAKE_BUILD_SETTING_CXX_COMPILER "${VTK40_CMAKE_CXX_COMPILER}")
-SET(CMAKE_BUILD_SETTING_CXX_FLAGS "${VTK40_CMAKE_CXX_FLAGS}")
-SET(CMAKE_BUILD_SETTING_CXX_FLAGS_DEBUG "${VTK40_CMAKE_CXX_FLAGS_DEBUG}")
-SET(CMAKE_BUILD_SETTING_CXX_FLAGS_RELEASE "${VTK40_CMAKE_CXX_FLAGS_RELEASE}")
-SET(CMAKE_BUILD_SETTING_CXX_FLAGS_MINSIZEREL "${VTK40_CMAKE_CXX_FLAGS_MINSIZEREL}")
-SET(CMAKE_BUILD_SETTING_CXX_FLAGS_RELWITHDEBINFO "${VTK40_CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
+set(CMAKE_BUILD_SETTING_CXX_COMPILER "${VTK40_CMAKE_CXX_COMPILER}")
+set(CMAKE_BUILD_SETTING_CXX_FLAGS "${VTK40_CMAKE_CXX_FLAGS}")
+set(CMAKE_BUILD_SETTING_CXX_FLAGS_DEBUG "${VTK40_CMAKE_CXX_FLAGS_DEBUG}")
+set(CMAKE_BUILD_SETTING_CXX_FLAGS_RELEASE "${VTK40_CMAKE_CXX_FLAGS_RELEASE}")
+set(CMAKE_BUILD_SETTING_CXX_FLAGS_MINSIZEREL "${VTK40_CMAKE_CXX_FLAGS_MINSIZEREL}")
+set(CMAKE_BUILD_SETTING_CXX_FLAGS_RELWITHDEBINFO "${VTK40_CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
-SET(CMAKE_BUILD_SETTING_BUILD_TYPE "${VTK40_CMAKE_BUILD_TYPE}")
-SET(CMAKE_BUILD_SETTING_BUILD_TOOL "${VTK40_CMAKE_BUILD_TOOL}")
+set(CMAKE_BUILD_SETTING_BUILD_TYPE "${VTK40_CMAKE_BUILD_TYPE}")
+set(CMAKE_BUILD_SETTING_BUILD_TOOL "${VTK40_CMAKE_BUILD_TOOL}")
diff --git a/Modules/UseVTKConfig40.cmake b/Modules/UseVTKConfig40.cmake
index ca5e7aa3c..554b8c447 100644
--- a/Modules/UseVTKConfig40.cmake
+++ b/Modules/UseVTKConfig40.cmake
@@ -17,21 +17,21 @@
# FindVTK.cmake module. Do not include directly.
# Hard-code the version number since it isn't provided by VTK 4.0.
-SET(VTK_MAJOR_VERSION 4)
-SET(VTK_MINOR_VERSION 0)
-SET(VTK_BUILD_VERSION 2)
+set(VTK_MAJOR_VERSION 4)
+set(VTK_MINOR_VERSION 0)
+set(VTK_BUILD_VERSION 2)
# Provide a new UseVTK file that doesn't do a full LOAD_CACHE.
-SET(VTK_USE_FILE ${CMAKE_ROOT}/Modules/UseVTK40.cmake)
+set(VTK_USE_FILE ${CMAKE_ROOT}/Modules/UseVTK40.cmake)
# Provide a build settings file.
-SET(VTK_BUILD_SETTINGS_FILE ${CMAKE_ROOT}/Modules/UseVTKBuildSettings40.cmake)
+set(VTK_BUILD_SETTINGS_FILE ${CMAKE_ROOT}/Modules/UseVTKBuildSettings40.cmake)
# There are no CMake extensions for VTK 4.0.
-SET(VTK_CMAKE_EXTENSIONS_DIR "")
+set(VTK_CMAKE_EXTENSIONS_DIR "")
# grep "VTK40_" UseVTKConfig40.cmake |sed 's/.*VTK40_\([A-Za-z0-9_]*\).*/ \1/'
-LOAD_CACHE(${VTK_DIR} READ_WITH_PREFIX VTK40_
+load_cache(${VTK_DIR} READ_WITH_PREFIX VTK40_
BUILD_SHARED_LIBS
CMAKE_BUILD_TOOL
CMAKE_BUILD_TYPE
@@ -132,124 +132,124 @@ LOAD_CACHE(${VTK_DIR} READ_WITH_PREFIX VTK40_
)
# Copy needed settings from the VTK 4.0 cache.
-SET(VTK_BUILD_SHARED ${VTK40_BUILD_SHARED_LIBS})
-SET(VTK_DEBUG_LEAKS ${VTK40_VTK_DEBUG_LEAKS})
-SET(VTK_HAVE_VG500 ${VTK40_VTK_HAVE_VG500})
-SET(VTK_HAVE_VP1000 ${VTK40_VTK_HAVE_VP1000})
-SET(VTK_USE_MANGLED_MESA ${VTK40_VTK_MANGLE_MESA})
-SET(VTK_MPIRUN_EXE ${VTK40_MPIRUN})
-SET(VTK_MPI_POSTFLAGS ${VTK40_MPI_POSTFLAGS})
-SET(VTK_MPI_PREFLAGS ${VTK40_MPI_PREFLAGS})
-SET(VTK_OPENGL_HAS_OSMESA ${VTK40_VTK_OPENGL_HAS_OSMESA})
-SET(VTK_USE_64BIT_IDS ${VTK40_VTK_USE_64BIT_IDS})
-SET(VTK_USE_ANSI_STDLIB ${VTK40_VTK_USE_ANSI_STDLIB})
-SET(VTK_USE_HYBRID ${VTK40_VTK_USE_HYBRID})
-SET(VTK_USE_MATROX_IMAGING ${VTK40_VTK_USE_MATROX_IMAGING})
-SET(VTK_USE_MPI ${VTK40_VTK_USE_MPI})
-SET(VTK_USE_PARALLEL ${VTK40_VTK_USE_PARALLEL})
-SET(VTK_USE_PATENTED ${VTK40_VTK_USE_PATENTED})
-SET(VTK_USE_RENDERING ${VTK40_VTK_USE_RENDERING})
-SET(VTK_USE_VIDEO_FOR_WINDOWS ${VTK40_VTK_USE_VIDEO_FOR_WINDOWS})
-SET(VTK_USE_VOLUMEPRO ${VTK40_VTK_USE_VOLUMEPRO})
-SET(VTK_USE_X ${VTK40_VTK_USE_X})
-SET(VTK_WRAP_JAVA ${VTK40_VTK_WRAP_JAVA})
-SET(VTK_WRAP_PYTHON ${VTK40_VTK_WRAP_PYTHON})
-SET(VTK_WRAP_TCL ${VTK40_VTK_WRAP_TCL})
+set(VTK_BUILD_SHARED ${VTK40_BUILD_SHARED_LIBS})
+set(VTK_DEBUG_LEAKS ${VTK40_VTK_DEBUG_LEAKS})
+set(VTK_HAVE_VG500 ${VTK40_VTK_HAVE_VG500})
+set(VTK_HAVE_VP1000 ${VTK40_VTK_HAVE_VP1000})
+set(VTK_USE_MANGLED_MESA ${VTK40_VTK_MANGLE_MESA})
+set(VTK_MPIRUN_EXE ${VTK40_MPIRUN})
+set(VTK_MPI_POSTFLAGS ${VTK40_MPI_POSTFLAGS})
+set(VTK_MPI_PREFLAGS ${VTK40_MPI_PREFLAGS})
+set(VTK_OPENGL_HAS_OSMESA ${VTK40_VTK_OPENGL_HAS_OSMESA})
+set(VTK_USE_64BIT_IDS ${VTK40_VTK_USE_64BIT_IDS})
+set(VTK_USE_ANSI_STDLIB ${VTK40_VTK_USE_ANSI_STDLIB})
+set(VTK_USE_HYBRID ${VTK40_VTK_USE_HYBRID})
+set(VTK_USE_MATROX_IMAGING ${VTK40_VTK_USE_MATROX_IMAGING})
+set(VTK_USE_MPI ${VTK40_VTK_USE_MPI})
+set(VTK_USE_PARALLEL ${VTK40_VTK_USE_PARALLEL})
+set(VTK_USE_PATENTED ${VTK40_VTK_USE_PATENTED})
+set(VTK_USE_RENDERING ${VTK40_VTK_USE_RENDERING})
+set(VTK_USE_VIDEO_FOR_WINDOWS ${VTK40_VTK_USE_VIDEO_FOR_WINDOWS})
+set(VTK_USE_VOLUMEPRO ${VTK40_VTK_USE_VOLUMEPRO})
+set(VTK_USE_X ${VTK40_VTK_USE_X})
+set(VTK_WRAP_JAVA ${VTK40_VTK_WRAP_JAVA})
+set(VTK_WRAP_PYTHON ${VTK40_VTK_WRAP_PYTHON})
+set(VTK_WRAP_TCL ${VTK40_VTK_WRAP_TCL})
# Create the list of available kits.
-SET(VTK_KITS COMMON FILTERING GRAPHICS IMAGING IO)
-IF(VTK_USE_RENDERING)
- SET(VTK_KITS ${VTK_KITS} RENDERING)
-ENDIF(VTK_USE_RENDERING)
-IF(VTK_USE_HYBRID)
- SET(VTK_KITS ${VTK_KITS} HYBRID)
-ENDIF(VTK_USE_HYBRID)
-IF(VTK_USE_PARALLEL)
- SET(VTK_KITS ${VTK_KITS} PARALLEL)
-ENDIF(VTK_USE_PARALLEL)
-IF(VTK_USE_PATENTED)
- SET(VTK_KITS ${VTK_KITS} PATENTED)
-ENDIF(VTK_USE_PATENTED)
+set(VTK_KITS COMMON FILTERING GRAPHICS IMAGING IO)
+if(VTK_USE_RENDERING)
+ set(VTK_KITS ${VTK_KITS} RENDERING)
+endif()
+if(VTK_USE_HYBRID)
+ set(VTK_KITS ${VTK_KITS} HYBRID)
+endif()
+if(VTK_USE_PARALLEL)
+ set(VTK_KITS ${VTK_KITS} PARALLEL)
+endif()
+if(VTK_USE_PATENTED)
+ set(VTK_KITS ${VTK_KITS} PATENTED)
+endif()
# Create the list of available languages.
-SET(VTK_LANGUAGES "")
-IF(VTK_WRAP_TCL)
- SET(VTK_LANGUAGES ${VTK_LANGUAGES} TCL)
-ENDIF(VTK_WRAP_TCL)
-IF(VTK_WRAP_PYTHON)
- SET(VTK_LANGUAGES ${VTK_LANGUAGES} PYTHON)
-ENDIF(VTK_WRAP_PYTHON)
-IF(VTK_WRAP_JAVA)
- SET(VTK_LANGUAGES ${VTK_LANGUAGES} JAVA)
-ENDIF(VTK_WRAP_JAVA)
+set(VTK_LANGUAGES "")
+if(VTK_WRAP_TCL)
+ set(VTK_LANGUAGES ${VTK_LANGUAGES} TCL)
+endif()
+if(VTK_WRAP_PYTHON)
+ set(VTK_LANGUAGES ${VTK_LANGUAGES} PYTHON)
+endif()
+if(VTK_WRAP_JAVA)
+ set(VTK_LANGUAGES ${VTK_LANGUAGES} JAVA)
+endif()
# Include directories for other projects installed on the system and
# used by VTK.
-SET(VTK_INCLUDE_DIRS_SYS "")
-IF(VTK_USE_RENDERING)
- SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
+set(VTK_INCLUDE_DIRS_SYS "")
+if(VTK_USE_RENDERING)
+ set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
${VTK40_OPENGL_INCLUDE_PATH} ${VTK40_OPENGL_INCLUDE_DIR})
- IF(VTK_USE_X)
- SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
+ if(VTK_USE_X)
+ set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
${VTK40_CMAKE_Xlib_INCLUDE_PATH} ${VTK40_CMAKE_Xutil_INCLUDE_PATH})
- ENDIF(VTK_USE_X)
-ENDIF(VTK_USE_RENDERING)
+ endif()
+endif()
-IF(VTK_OPENGL_HAS_OSMESA)
- SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
+if(VTK_OPENGL_HAS_OSMESA)
+ set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
${VTK40_OSMESA_INCLUDE_PATH})
-ENDIF(VTK_OPENGL_HAS_OSMESA)
+endif()
-IF(VTK_USE_MPI)
- SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_MPI_INCLUDE_PATH})
-ENDIF(VTK_USE_MPI)
+if(VTK_USE_MPI)
+ set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_MPI_INCLUDE_PATH})
+endif()
-IF(VTK_WRAP_TCL)
- SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_TCL_INCLUDE_PATH})
-ENDIF(VTK_WRAP_TCL)
+if(VTK_WRAP_TCL)
+ set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_TCL_INCLUDE_PATH})
+endif()
-IF(VTK_WRAP_PYTHON)
- SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_PYTHON_INCLUDE_PATH})
-ENDIF(VTK_WRAP_PYTHON)
+if(VTK_WRAP_PYTHON)
+ set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_PYTHON_INCLUDE_PATH})
+endif()
-IF(VTK_WRAP_JAVA)
- SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
+if(VTK_WRAP_JAVA)
+ set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
${VTK40_JAVA_INCLUDE_PATH} ${VTK40_JAVA_INCLUDE_PATH2})
-ENDIF(VTK_WRAP_JAVA)
+endif()
-IF(VTK_HAVE_VG500)
- SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
+if(VTK_HAVE_VG500)
+ set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
${VTK40_VLI_INCLUDE_PATH_FOR_VG500})
-ENDIF(VTK_HAVE_VG500)
+endif()
-IF(VTK_HAVE_VP1000)
- SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
+if(VTK_HAVE_VP1000)
+ set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
${VTK40_VLI_INCLUDE_PATH_FOR_VP1000})
-ENDIF(VTK_HAVE_VP1000)
+endif()
# See if this is a build tree or install tree.
-IF(EXISTS ${VTK_DIR}/Common)
+if(EXISTS ${VTK_DIR}/Common)
# This is a VTK 4.0 build tree.
- SET(VTK_LIBRARY_DIRS ${VTK40_LIBRARY_OUTPUT_PATH})
+ set(VTK_LIBRARY_DIRS ${VTK40_LIBRARY_OUTPUT_PATH})
# Determine the include directories needed.
- SET(VTK_INCLUDE_DIRS ${VTK40_VTK_BINARY_DIR})
- IF(VTK_USE_PARALLEL)
- SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Parallel)
- ENDIF(VTK_USE_PARALLEL)
- IF(VTK_USE_HYBRID)
- SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Hybrid)
- ENDIF(VTK_USE_HYBRID)
- IF(VTK_USE_PATENTED)
- SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Patented)
- ENDIF(VTK_USE_PATENTED)
- IF(VTK_USE_RENDERING)
- SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Rendering)
- ENDIF(VTK_USE_RENDERING)
+ set(VTK_INCLUDE_DIRS ${VTK40_VTK_BINARY_DIR})
+ if(VTK_USE_PARALLEL)
+ set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Parallel)
+ endif()
+ if(VTK_USE_HYBRID)
+ set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Hybrid)
+ endif()
+ if(VTK_USE_PATENTED)
+ set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Patented)
+ endif()
+ if(VTK_USE_RENDERING)
+ set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Rendering)
+ endif()
# These directories are always needed.
- SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}
+ set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}
${VTK40_VTK_SOURCE_DIR}/IO
${VTK40_VTK_SOURCE_DIR}/Imaging
${VTK40_VTK_SOURCE_DIR}/Graphics
@@ -257,119 +257,119 @@ IF(EXISTS ${VTK_DIR}/Common)
${VTK40_VTK_SOURCE_DIR}/Common)
# Give access to a few utilities.
- SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}
+ set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}
${VTK40_VTK_BINARY_DIR}/Utilities/png
${VTK40_VTK_SOURCE_DIR}/Utilities/png
${VTK40_VTK_BINARY_DIR}/Utilities/zlib
${VTK40_VTK_SOURCE_DIR}/Utilities/zlib)
# Executable locations.
- IF(VTK_WRAP_TCL)
- SET(VTK_TCL_EXE ${VTK40_EXECUTABLE_OUTPUT_PATH}/vtk)
- SET(VTK_WRAP_TCL_EXE ${VTK40_VTK_WRAP_TCL_EXE})
- SET(VTK_TCL_HOME ${VTK40_VTK_SOURCE_DIR}/Wrapping/Tcl)
- ENDIF(VTK_WRAP_TCL)
- IF(VTK_WRAP_PYTHON)
- SET(VTK_WRAP_PYTHON_EXE ${VTK40_VTK_WRAP_PYTHON_EXE})
- ENDIF(VTK_WRAP_PYTHON)
- IF(VTK_WRAP_JAVA)
- SET(VTK_PARSE_JAVA_EXE ${VTK40_VTK_PARSE_JAVA_EXE})
- SET(VTK_WRAP_JAVA_EXE ${VTK40_VTK_WRAP_JAVA_EXE})
- ENDIF(VTK_WRAP_JAVA)
-
-ELSE(EXISTS ${VTK_DIR}/Common)
+ if(VTK_WRAP_TCL)
+ set(VTK_TCL_EXE ${VTK40_EXECUTABLE_OUTPUT_PATH}/vtk)
+ set(VTK_WRAP_TCL_EXE ${VTK40_VTK_WRAP_TCL_EXE})
+ set(VTK_TCL_HOME ${VTK40_VTK_SOURCE_DIR}/Wrapping/Tcl)
+ endif()
+ if(VTK_WRAP_PYTHON)
+ set(VTK_WRAP_PYTHON_EXE ${VTK40_VTK_WRAP_PYTHON_EXE})
+ endif()
+ if(VTK_WRAP_JAVA)
+ set(VTK_PARSE_JAVA_EXE ${VTK40_VTK_PARSE_JAVA_EXE})
+ set(VTK_WRAP_JAVA_EXE ${VTK40_VTK_WRAP_JAVA_EXE})
+ endif()
+
+else()
# This is a VTK 4.0 install tree.
- SET(VTK_INCLUDE_DIRS ${VTK_DIR})
- SET(VTK_LIBRARY_DIRS ${VTK40_CMAKE_INSTALL_PREFIX}/lib/vtk)
+ set(VTK_INCLUDE_DIRS ${VTK_DIR})
+ set(VTK_LIBRARY_DIRS ${VTK40_CMAKE_INSTALL_PREFIX}/lib/vtk)
# Executable locations.
- IF(VTK_WRAP_TCL)
- SET(VTK_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtk)
- SET(VTK_WRAP_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapTcl)
- SET(VTK_TCL_HOME ${VTK40_CMAKE_INSTALL_PREFIX}/lib/vtk/tcl)
- ENDIF(VTK_WRAP_TCL)
- IF(VTK_WRAP_PYTHON)
- SET(VTK_WRAP_PYTHON_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapPython)
- ENDIF(VTK_WRAP_PYTHON)
- IF(VTK_WRAP_JAVA)
- SET(VTK_PARSE_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkParseJava)
- SET(VTK_WRAP_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapJava)
- ENDIF(VTK_WRAP_JAVA)
-ENDIF(EXISTS ${VTK_DIR}/Common)
+ if(VTK_WRAP_TCL)
+ set(VTK_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtk)
+ set(VTK_WRAP_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapTcl)
+ set(VTK_TCL_HOME ${VTK40_CMAKE_INSTALL_PREFIX}/lib/vtk/tcl)
+ endif()
+ if(VTK_WRAP_PYTHON)
+ set(VTK_WRAP_PYTHON_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapPython)
+ endif()
+ if(VTK_WRAP_JAVA)
+ set(VTK_PARSE_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkParseJava)
+ set(VTK_WRAP_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapJava)
+ endif()
+endif()
# Add the system include directories last.
-SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS_SYS})
+set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS_SYS})
# Find the required C and C++ compiler flags.
-IF(CMAKE_COMPILER_IS_GNUCXX)
- IF(WIN32)
+if(CMAKE_COMPILER_IS_GNUCXX)
+ if(WIN32)
# The platform is gcc on cygwin.
- SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -mwin32")
- SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -mwin32")
- ENDIF(WIN32)
-ELSE(CMAKE_COMPILER_IS_GNUCXX)
- IF(CMAKE_ANSI_CFLAGS)
- SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
- ENDIF(CMAKE_ANSI_CFLAGS)
- IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
- SET(VTK_REQUIRED_CXX_FLAGS
+ set(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -mwin32")
+ set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -mwin32")
+ endif()
+else()
+ if(CMAKE_ANSI_CFLAGS)
+ set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
+ endif()
+ if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+ set(VTK_REQUIRED_CXX_FLAGS
"${VTK_REQUIRED_CXX_FLAGS} -timplicit_local -no_implicit_include")
- ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+ endif()
+endif()
-IF(VTK_USE_X)
- IF(CMAKE_X_CFLAGS)
- SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_X_CFLAGS}")
- SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} ${CMAKE_X_CFLAGS}")
- ENDIF(CMAKE_X_CFLAGS)
-ENDIF(VTK_USE_X)
+if(VTK_USE_X)
+ if(CMAKE_X_CFLAGS)
+ set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_X_CFLAGS}")
+ set(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} ${CMAKE_X_CFLAGS}")
+ endif()
+endif()
# Copy library dependencies.
-SET(vtkCommonJava_LIB_DEPENDS "${VTK40_vtkCommonJava_LIB_DEPENDS}")
-SET(vtkCommonPython_LIB_DEPENDS "${VTK40_vtkCommonPython_LIB_DEPENDS}")
-SET(vtkCommonTCL_LIB_DEPENDS "${VTK40_vtkCommonTCL_LIB_DEPENDS}")
-SET(vtkCommon_LIB_DEPENDS "${VTK40_vtkCommon_LIB_DEPENDS}")
-SET(vtkFilteringJava_LIB_DEPENDS "${VTK40_vtkFilteringJava_LIB_DEPENDS}")
-SET(vtkFilteringPython_LIB_DEPENDS "${VTK40_vtkFilteringPython_LIB_DEPENDS}")
-SET(vtkFilteringTCL_LIB_DEPENDS "${VTK40_vtkFilteringTCL_LIB_DEPENDS}")
-SET(vtkFiltering_LIB_DEPENDS "${VTK40_vtkFiltering_LIB_DEPENDS}")
-SET(vtkGraphicsJava_LIB_DEPENDS "${VTK40_vtkGraphicsJava_LIB_DEPENDS}")
-SET(vtkGraphicsPython_LIB_DEPENDS "${VTK40_vtkGraphicsPython_LIB_DEPENDS}")
-SET(vtkGraphicsTCL_LIB_DEPENDS "${VTK40_vtkGraphicsTCL_LIB_DEPENDS}")
-SET(vtkGraphics_LIB_DEPENDS "${VTK40_vtkGraphics_LIB_DEPENDS}")
-SET(vtkHybridJava_LIB_DEPENDS "${VTK40_vtkHybridJava_LIB_DEPENDS}")
-SET(vtkHybridPython_LIB_DEPENDS "${VTK40_vtkHybridPython_LIB_DEPENDS}")
-SET(vtkHybridTCL_LIB_DEPENDS "${VTK40_vtkHybridTCL_LIB_DEPENDS}")
-SET(vtkHybrid_LIB_DEPENDS "${VTK40_vtkHybrid_LIB_DEPENDS}")
-SET(vtkIOJava_LIB_DEPENDS "${VTK40_vtkIOJava_LIB_DEPENDS}")
-SET(vtkIOPython_LIB_DEPENDS "${VTK40_vtkIOPython_LIB_DEPENDS}")
-SET(vtkIOTCL_LIB_DEPENDS "${VTK40_vtkIOTCL_LIB_DEPENDS}")
-SET(vtkIO_LIB_DEPENDS "${VTK40_vtkIO_LIB_DEPENDS}")
-SET(vtkImagingJava_LIB_DEPENDS "${VTK40_vtkImagingJava_LIB_DEPENDS}")
-SET(vtkImagingPython_LIB_DEPENDS "${VTK40_vtkImagingPython_LIB_DEPENDS}")
-SET(vtkImagingTCL_LIB_DEPENDS "${VTK40_vtkImagingTCL_LIB_DEPENDS}")
-SET(vtkImaging_LIB_DEPENDS "${VTK40_vtkImaging_LIB_DEPENDS}")
-SET(vtkParallelJava_LIB_DEPENDS "${VTK40_vtkParallelJava_LIB_DEPENDS}")
-SET(vtkParallelPython_LIB_DEPENDS "${VTK40_vtkParallelPython_LIB_DEPENDS}")
-SET(vtkParallelTCL_LIB_DEPENDS "${VTK40_vtkParallelTCL_LIB_DEPENDS}")
-SET(vtkParallel_LIB_DEPENDS "${VTK40_vtkParallel_LIB_DEPENDS}")
-SET(vtkPatentedJava_LIB_DEPENDS "${VTK40_vtkPatentedJava_LIB_DEPENDS}")
-SET(vtkPatentedPython_LIB_DEPENDS "${VTK40_vtkPatentedPython_LIB_DEPENDS}")
-SET(vtkPatentedTCL_LIB_DEPENDS "${VTK40_vtkPatentedTCL_LIB_DEPENDS}")
-SET(vtkPatented_LIB_DEPENDS "${VTK40_vtkPatented_LIB_DEPENDS}")
-SET(vtkRenderingJava_LIB_DEPENDS "${VTK40_vtkRenderingJava_LIB_DEPENDS}")
-SET(vtkRenderingPythonTkWidgets_LIB_DEPENDS "${VTK40_vtkRenderingPythonTkWidgets_LIB_DEPENDS}")
-SET(vtkRenderingPython_LIB_DEPENDS "${VTK40_vtkRenderingPython_LIB_DEPENDS}")
-SET(vtkRenderingTCL_LIB_DEPENDS "${VTK40_vtkRenderingTCL_LIB_DEPENDS}")
-SET(vtkRendering_LIB_DEPENDS "${VTK40_vtkRendering_LIB_DEPENDS}")
-SET(vtkjpeg_LIB_DEPENDS "${VTK40_vtkjpeg_LIB_DEPENDS}")
-SET(vtkpng_LIB_DEPENDS "${VTK40_vtkpng_LIB_DEPENDS}")
-SET(vtkzlib_LIB_DEPENDS "${VTK40_vtkzlib_LIB_DEPENDS}")
+set(vtkCommonJava_LIB_DEPENDS "${VTK40_vtkCommonJava_LIB_DEPENDS}")
+set(vtkCommonPython_LIB_DEPENDS "${VTK40_vtkCommonPython_LIB_DEPENDS}")
+set(vtkCommonTCL_LIB_DEPENDS "${VTK40_vtkCommonTCL_LIB_DEPENDS}")
+set(vtkCommon_LIB_DEPENDS "${VTK40_vtkCommon_LIB_DEPENDS}")
+set(vtkFilteringJava_LIB_DEPENDS "${VTK40_vtkFilteringJava_LIB_DEPENDS}")
+set(vtkFilteringPython_LIB_DEPENDS "${VTK40_vtkFilteringPython_LIB_DEPENDS}")
+set(vtkFilteringTCL_LIB_DEPENDS "${VTK40_vtkFilteringTCL_LIB_DEPENDS}")
+set(vtkFiltering_LIB_DEPENDS "${VTK40_vtkFiltering_LIB_DEPENDS}")
+set(vtkGraphicsJava_LIB_DEPENDS "${VTK40_vtkGraphicsJava_LIB_DEPENDS}")
+set(vtkGraphicsPython_LIB_DEPENDS "${VTK40_vtkGraphicsPython_LIB_DEPENDS}")
+set(vtkGraphicsTCL_LIB_DEPENDS "${VTK40_vtkGraphicsTCL_LIB_DEPENDS}")
+set(vtkGraphics_LIB_DEPENDS "${VTK40_vtkGraphics_LIB_DEPENDS}")
+set(vtkHybridJava_LIB_DEPENDS "${VTK40_vtkHybridJava_LIB_DEPENDS}")
+set(vtkHybridPython_LIB_DEPENDS "${VTK40_vtkHybridPython_LIB_DEPENDS}")
+set(vtkHybridTCL_LIB_DEPENDS "${VTK40_vtkHybridTCL_LIB_DEPENDS}")
+set(vtkHybrid_LIB_DEPENDS "${VTK40_vtkHybrid_LIB_DEPENDS}")
+set(vtkIOJava_LIB_DEPENDS "${VTK40_vtkIOJava_LIB_DEPENDS}")
+set(vtkIOPython_LIB_DEPENDS "${VTK40_vtkIOPython_LIB_DEPENDS}")
+set(vtkIOTCL_LIB_DEPENDS "${VTK40_vtkIOTCL_LIB_DEPENDS}")
+set(vtkIO_LIB_DEPENDS "${VTK40_vtkIO_LIB_DEPENDS}")
+set(vtkImagingJava_LIB_DEPENDS "${VTK40_vtkImagingJava_LIB_DEPENDS}")
+set(vtkImagingPython_LIB_DEPENDS "${VTK40_vtkImagingPython_LIB_DEPENDS}")
+set(vtkImagingTCL_LIB_DEPENDS "${VTK40_vtkImagingTCL_LIB_DEPENDS}")
+set(vtkImaging_LIB_DEPENDS "${VTK40_vtkImaging_LIB_DEPENDS}")
+set(vtkParallelJava_LIB_DEPENDS "${VTK40_vtkParallelJava_LIB_DEPENDS}")
+set(vtkParallelPython_LIB_DEPENDS "${VTK40_vtkParallelPython_LIB_DEPENDS}")
+set(vtkParallelTCL_LIB_DEPENDS "${VTK40_vtkParallelTCL_LIB_DEPENDS}")
+set(vtkParallel_LIB_DEPENDS "${VTK40_vtkParallel_LIB_DEPENDS}")
+set(vtkPatentedJava_LIB_DEPENDS "${VTK40_vtkPatentedJava_LIB_DEPENDS}")
+set(vtkPatentedPython_LIB_DEPENDS "${VTK40_vtkPatentedPython_LIB_DEPENDS}")
+set(vtkPatentedTCL_LIB_DEPENDS "${VTK40_vtkPatentedTCL_LIB_DEPENDS}")
+set(vtkPatented_LIB_DEPENDS "${VTK40_vtkPatented_LIB_DEPENDS}")
+set(vtkRenderingJava_LIB_DEPENDS "${VTK40_vtkRenderingJava_LIB_DEPENDS}")
+set(vtkRenderingPythonTkWidgets_LIB_DEPENDS "${VTK40_vtkRenderingPythonTkWidgets_LIB_DEPENDS}")
+set(vtkRenderingPython_LIB_DEPENDS "${VTK40_vtkRenderingPython_LIB_DEPENDS}")
+set(vtkRenderingTCL_LIB_DEPENDS "${VTK40_vtkRenderingTCL_LIB_DEPENDS}")
+set(vtkRendering_LIB_DEPENDS "${VTK40_vtkRendering_LIB_DEPENDS}")
+set(vtkjpeg_LIB_DEPENDS "${VTK40_vtkjpeg_LIB_DEPENDS}")
+set(vtkpng_LIB_DEPENDS "${VTK40_vtkpng_LIB_DEPENDS}")
+set(vtkzlib_LIB_DEPENDS "${VTK40_vtkzlib_LIB_DEPENDS}")
# List of VTK configuration variables set above.
-# grep "^[ ]*SET(VTK" UseVTKConfig40.cmake |sed 's/[ ]*SET(\([^ ]*\) .*/ \1/'
-SET(VTK_SETTINGS
+# grep "^[ ]*set(VTK" UseVTKConfig40.cmake |sed 's/[ ]*set(\([^ ]*\) .*/ \1/'
+set(VTK_SETTINGS
VTK_BUILD_SHARED
VTK_BUILD_VERSION
VTK_DEBUG_LEAKS
diff --git a/Modules/Use_wxWindows.cmake b/Modules/Use_wxWindows.cmake
index 01a15168e..6c95681e2 100644
--- a/Modules/Use_wxWindows.cmake
+++ b/Modules/Use_wxWindows.cmake
@@ -7,10 +7,10 @@
# USAGE:
# just include Use_wxWindows.cmake
# in your projects CMakeLists.txt
-# INCLUDE( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
+# include( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
##
# if you are sure you need GL then
-# SET(WXWINDOWS_USE_GL 1)
+# set(WXWINDOWS_USE_GL 1)
# *before* you include this file.
#=============================================================================
@@ -31,34 +31,34 @@
# 16.Feb.2004: changed INCLUDE to FIND_PACKAGE to read from users own non-system CMAKE_MODULE_PATH (Jan Woetzel JW)
# 07/2006: rewrite as FindwxWidgets.cmake, kept for backward compatibility JW
-MESSAGE(STATUS "Use_wxWindows.cmake is DEPRECATED. \n"
-"Please use FIND_PACKAGE(wxWidgets) and INCLUDE(${wxWidgets_USE_FILE}) instead. (JW)")
+message(STATUS "Use_wxWindows.cmake is DEPRECATED. \n"
+"Please use find_package(wxWidgets) and include(${wxWidgets_USE_FILE}) instead. (JW)")
# ------------------------
-FIND_PACKAGE( wxWindows )
+find_package( wxWindows )
-IF(WXWINDOWS_FOUND)
+if(WXWINDOWS_FOUND)
-#MESSAGE("DBG Use_wxWindows.cmake: WXWINDOWS_INCLUDE_DIR=${WXWINDOWS_INCLUDE_DIR} WXWINDOWS_LINK_DIRECTORIES=${WXWINDOWS_LINK_DIRECTORIES} WXWINDOWS_LIBRARIES=${WXWINDOWS_LIBRARIES} CMAKE_WXWINDOWS_CXX_FLAGS=${CMAKE_WXWINDOWS_CXX_FLAGS} WXWINDOWS_DEFINITIONS=${WXWINDOWS_DEFINITIONS}")
+#message("DBG Use_wxWindows.cmake: WXWINDOWS_INCLUDE_DIR=${WXWINDOWS_INCLUDE_DIR} WXWINDOWS_LINK_DIRECTORIES=${WXWINDOWS_LINK_DIRECTORIES} WXWINDOWS_LIBRARIES=${WXWINDOWS_LIBRARIES} CMAKE_WXWINDOWS_CXX_FLAGS=${CMAKE_WXWINDOWS_CXX_FLAGS} WXWINDOWS_DEFINITIONS=${WXWINDOWS_DEFINITIONS}")
- IF(WXWINDOWS_INCLUDE_DIR)
- INCLUDE_DIRECTORIES(${WXWINDOWS_INCLUDE_DIR})
- ENDIF(WXWINDOWS_INCLUDE_DIR)
- IF(WXWINDOWS_LINK_DIRECTORIES)
- LINK_DIRECTORIES(${WXWINDOWS_LINK_DIRECTORIES})
- ENDIF(WXWINDOWS_LINK_DIRECTORIES)
- IF(WXWINDOWS_LIBRARIES)
- LINK_LIBRARIES(${WXWINDOWS_LIBRARIES})
- ENDIF(WXWINDOWS_LIBRARIES)
- IF (CMAKE_WXWINDOWS_CXX_FLAGS)
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_WXWINDOWS_CXX_FLAGS}")
- ENDIF(CMAKE_WXWINDOWS_CXX_FLAGS)
- IF(WXWINDOWS_DEFINITIONS)
- ADD_DEFINITIONS(${WXWINDOWS_DEFINITIONS})
- ENDIF(WXWINDOWS_DEFINITIONS)
-ELSE(WXWINDOWS_FOUND)
- MESSAGE(SEND_ERROR "wxWindows not found by Use_wxWindows.cmake")
-ENDIF(WXWINDOWS_FOUND)
+ if(WXWINDOWS_INCLUDE_DIR)
+ include_directories(${WXWINDOWS_INCLUDE_DIR})
+ endif()
+ if(WXWINDOWS_LINK_DIRECTORIES)
+ link_directories(${WXWINDOWS_LINK_DIRECTORIES})
+ endif()
+ if(WXWINDOWS_LIBRARIES)
+ link_libraries(${WXWINDOWS_LIBRARIES})
+ endif()
+ if (CMAKE_WXWINDOWS_CXX_FLAGS)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_WXWINDOWS_CXX_FLAGS}")
+ endif()
+ if(WXWINDOWS_DEFINITIONS)
+ add_definitions(${WXWINDOWS_DEFINITIONS})
+ endif()
+else()
+ message(SEND_ERROR "wxWindows not found by Use_wxWindows.cmake")
+endif()
diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake
index a0f2e8632..bb8c29b3e 100644
--- a/Modules/UsewxWidgets.cmake
+++ b/Modules/UsewxWidgets.cmake
@@ -4,10 +4,10 @@
#
# USAGE
# # Note that for MinGW users the order of libs is important!
-# FIND_PACKAGE(wxWidgets REQUIRED net gl core base)
-# INCLUDE(${wxWidgets_USE_FILE})
+# find_package(wxWidgets REQUIRED net gl core base)
+# include(${wxWidgets_USE_FILE})
# # and for each of your dependent executable/library targets:
-# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
+# target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
#
# DEPRECATED
# LINK_LIBRARIES is not called in favor of adding dependencies per target.
@@ -31,59 +31,59 @@
# debug message and logging.
# comment these out for distribution
-IF (NOT LOGFILE )
- # SET(LOGFILE "${PROJECT_BINARY_DIR}/CMakeOutput.log")
-ENDIF (NOT LOGFILE )
-MACRO(MSG _MSG)
- # FILE(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}\n")
- # MESSAGE(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
-ENDMACRO(MSG)
+if (NOT LOGFILE )
+ # set(LOGFILE "${PROJECT_BINARY_DIR}/CMakeOutput.log")
+endif ()
+macro(MSG _MSG)
+ # file(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}\n")
+ # message(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
+endmacro()
MSG("wxWidgets_FOUND=${wxWidgets_FOUND}")
-IF (wxWidgets_FOUND)
- IF (wxWidgets_INCLUDE_DIRS)
- IF(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
- INCLUDE_DIRECTORIES(${wxWidgets_INCLUDE_DIRS})
- ELSE(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
- INCLUDE_DIRECTORIES(SYSTEM ${wxWidgets_INCLUDE_DIRS})
- ENDIF(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
+if (wxWidgets_FOUND)
+ if (wxWidgets_INCLUDE_DIRS)
+ if(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
+ include_directories(${wxWidgets_INCLUDE_DIRS})
+ else()
+ include_directories(SYSTEM ${wxWidgets_INCLUDE_DIRS})
+ endif()
MSG("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}")
- ENDIF(wxWidgets_INCLUDE_DIRS)
+ endif()
- IF (wxWidgets_LIBRARY_DIRS)
- LINK_DIRECTORIES(${wxWidgets_LIBRARY_DIRS})
+ if (wxWidgets_LIBRARY_DIRS)
+ link_directories(${wxWidgets_LIBRARY_DIRS})
MSG("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}")
- ENDIF(wxWidgets_LIBRARY_DIRS)
+ endif()
- IF (wxWidgets_DEFINITIONS)
- SET_PROPERTY(DIRECTORY APPEND
+ if (wxWidgets_DEFINITIONS)
+ set_property(DIRECTORY APPEND
PROPERTY COMPILE_DEFINITIONS ${wxWidgets_DEFINITIONS})
MSG("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}")
- ENDIF(wxWidgets_DEFINITIONS)
+ endif()
- IF (wxWidgets_DEFINITIONS_DEBUG)
- SET_PROPERTY(DIRECTORY APPEND
+ if (wxWidgets_DEFINITIONS_DEBUG)
+ set_property(DIRECTORY APPEND
PROPERTY COMPILE_DEFINITIONS_DEBUG ${wxWidgets_DEFINITIONS_DEBUG})
MSG("wxWidgets_DEFINITIONS_DEBUG=${wxWidgets_DEFINITIONS_DEBUG}")
- ENDIF(wxWidgets_DEFINITIONS_DEBUG)
+ endif()
- IF (wxWidgets_CXX_FLAGS)
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${wxWidgets_CXX_FLAGS}")
+ if (wxWidgets_CXX_FLAGS)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${wxWidgets_CXX_FLAGS}")
MSG("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
- ENDIF(wxWidgets_CXX_FLAGS)
+ endif()
# DEPRECATED JW
# just for backward compatibility: add deps to all targets
- # library projects better use advanced FIND_PACKAGE(wxWidgets) directly.
- #IF(wxWidgets_LIBRARIES)
- # LINK_LIBRARIES(${wxWidgets_LIBRARIES})
+ # library projects better use advanced find_package(wxWidgets) directly.
+ #if(wxWidgets_LIBRARIES)
+ # link_libraries(${wxWidgets_LIBRARIES})
# # BUG: str too long: MSG("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}")
- # IF(LOGFILE)
- # FILE(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${wxWidgets_LIBRARIES}\n")
- # ENDIF(LOGFILE)
- #ENDIF(wxWidgets_LIBRARIES)
+ # if(LOGFILE)
+ # file(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${wxWidgets_LIBRARIES}\n")
+ # endif()
+ #endif()
-ELSE (wxWidgets_FOUND)
- MESSAGE("wxWidgets requested but not found.")
-ENDIF(wxWidgets_FOUND)
+else ()
+ message("wxWidgets requested but not found.")
+endif()
diff --git a/Modules/VTKCompatibility.cmake b/Modules/VTKCompatibility.cmake
index 802969f2f..b33bf2e16 100644
--- a/Modules/VTKCompatibility.cmake
+++ b/Modules/VTKCompatibility.cmake
@@ -12,41 +12,41 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-IF(APPLE)
- SET(CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_C_CREATE_SHARED_LIBRARY}")
- SET(CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_C_CREATE_SHARED_MODULE}")
- STRING( REGEX REPLACE "CMAKE_C_COMPILER"
+if(APPLE)
+ set(CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_C_CREATE_SHARED_LIBRARY}")
+ set(CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_C_CREATE_SHARED_MODULE}")
+ string( REGEX REPLACE "CMAKE_C_COMPILER"
CMAKE_CXX_COMPILER CMAKE_CXX_CREATE_SHARED_MODULE
"${CMAKE_CXX_CREATE_SHARED_MODULE}")
- STRING( REGEX REPLACE "CMAKE_C_COMPILER"
+ string( REGEX REPLACE "CMAKE_C_COMPILER"
CMAKE_CXX_COMPILER CMAKE_CXX_CREATE_SHARED_LIBRARY
"${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
-ENDIF(APPLE)
+endif()
-SET(VTKFTGL_BINARY_DIR "${VTK_BINARY_DIR}/Utilities/ftgl"
+set(VTKFTGL_BINARY_DIR "${VTK_BINARY_DIR}/Utilities/ftgl"
CACHE INTERNAL "")
-SET(VTKFREETYPE_BINARY_DIR "${VTK_BINARY_DIR}/Utilities/freetype"
+set(VTKFREETYPE_BINARY_DIR "${VTK_BINARY_DIR}/Utilities/freetype"
CACHE INTERNAL "")
-SET(VTKFTGL_SOURCE_DIR "${VTK_SOURCE_DIR}/Utilities/ftgl"
+set(VTKFTGL_SOURCE_DIR "${VTK_SOURCE_DIR}/Utilities/ftgl"
CACHE INTERNAL "")
-SET(VTKFREETYPE_SOURCE_DIR "${VTK_SOURCE_DIR}/Utilities/freetype"
+set(VTKFREETYPE_SOURCE_DIR "${VTK_SOURCE_DIR}/Utilities/freetype"
CACHE INTERNAL "")
-SET(VTK_GLEXT_FILE "${VTK_SOURCE_DIR}/Utilities/ParseOGLExt/headers/glext.h"
+set(VTK_GLEXT_FILE "${VTK_SOURCE_DIR}/Utilities/ParseOGLExt/headers/glext.h"
CACHE FILEPATH
"Location of the OpenGL extensions header file (glext.h).")
-SET(VTK_GLXEXT_FILE
+set(VTK_GLXEXT_FILE
"${VTK_SOURCE_DIR}/Utilities/ParseOGLExt/headers/glxext.h" CACHE FILEPATH
"Location of the GLX extensions header file (glxext.h).")
-SET(VTK_WGLEXT_FILE "${VTK_SOURCE_DIR}/Utilities/ParseOGLExt/headers/wglext.h"
+set(VTK_WGLEXT_FILE "${VTK_SOURCE_DIR}/Utilities/ParseOGLExt/headers/wglext.h"
CACHE FILEPATH
"Location of the WGL extensions header file (wglext.h).")
# work around an old bug in VTK
-SET(TIFF_RIGHT_VERSION 1)
+set(TIFF_RIGHT_VERSION 1)
# for very old VTK (versions prior to 4.2)
-MACRO(SOURCE_FILES)
+macro(SOURCE_FILES)
message (FATAL_ERROR "You are trying to build a very old version of VTK (prior to VTK 4.2). To do this you need to use CMake 2.0 as it was the last version of CMake to support VTK 4.0.")
-ENDMACRO(SOURCE_FILES)
+endmacro()
diff --git a/Modules/WriteBasicConfigVersionFile.cmake b/Modules/WriteBasicConfigVersionFile.cmake
index 038cb5798..4466cd797 100644
--- a/Modules/WriteBasicConfigVersionFile.cmake
+++ b/Modules/WriteBasicConfigVersionFile.cmake
@@ -28,7 +28,7 @@ function(WRITE_BASIC_CONFIG_VERSION_FILE _filename)
if(CVF_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to WRITE_BASIC_CONFIG_VERSION_FILE(): \"${CVF_UNPARSED_ARGUMENTS}\"")
- endif(CVF_UNPARSED_ARGUMENTS)
+ endif()
set(versionTemplateFile "${CMAKE_ROOT}/Modules/BasicConfigVersion-${CVF_COMPATIBILITY}.cmake.in")
if(NOT EXISTS "${versionTemplateFile}")
@@ -41,4 +41,4 @@ function(WRITE_BASIC_CONFIG_VERSION_FILE _filename)
configure_file("${versionTemplateFile}" "${_filename}" @ONLY)
-endfunction(WRITE_BASIC_CONFIG_VERSION_FILE)
+endfunction()
diff --git a/Modules/ecos_clean.cmake b/Modules/ecos_clean.cmake
index 7a563ae23..37a1f93c2 100644
--- a/Modules/ecos_clean.cmake
+++ b/Modules/ecos_clean.cmake
@@ -21,6 +21,6 @@ foreach(_entry ${_files})
get_filename_component(dir ${_entry} NAME)
if(${dir} MATCHES "^[a-z]+$")
file(REMOVE_RECURSE ${_entry})
- endif(${dir} MATCHES "^[a-z]+$")
- endif(IS_DIRECTORY ${_entry})
-endforeach(_entry)
+ endif()
+ endif()
+endforeach()
diff --git a/Modules/kde3uic.cmake b/Modules/kde3uic.cmake
index 6f904ac92..4ad364b50 100644
--- a/Modules/kde3uic.cmake
+++ b/Modules/kde3uic.cmake
@@ -17,7 +17,7 @@
# neundorf@kde.org
-EXECUTE_PROCESS(COMMAND ${KDE_UIC_EXECUTABLE}
+execute_process(COMMAND ${KDE_UIC_EXECUTABLE}
-L ${KDE_UIC_PLUGIN_DIR} -nounload -tr tr2i18n
-impl ${KDE_UIC_H_FILE}
${KDE_UIC_FILE}
@@ -25,9 +25,9 @@ EXECUTE_PROCESS(COMMAND ${KDE_UIC_EXECUTABLE}
ERROR_QUIET
)
-STRING(REGEX REPLACE "tr2i18n\\(\"\"\\)" "QString::null" _uic_CONTENTS "${_uic_CONTENTS}" )
-STRING(REGEX REPLACE "tr2i18n\\(\"\", \"\"\\)" "QString::null" _uic_CONTENTS "${_uic_CONTENTS}" )
+string(REGEX REPLACE "tr2i18n\\(\"\"\\)" "QString::null" _uic_CONTENTS "${_uic_CONTENTS}" )
+string(REGEX REPLACE "tr2i18n\\(\"\", \"\"\\)" "QString::null" _uic_CONTENTS "${_uic_CONTENTS}" )
-FILE(WRITE ${KDE_UIC_CPP_FILE} "#include <kdialog.h>\n#include <klocale.h>\n\n")
-FILE(APPEND ${KDE_UIC_CPP_FILE} "${_uic_CONTENTS}")
+file(WRITE ${KDE_UIC_CPP_FILE} "#include <kdialog.h>\n#include <klocale.h>\n\n")
+file(APPEND ${KDE_UIC_CPP_FILE} "${_uic_CONTENTS}")
diff --git a/Modules/readme.txt b/Modules/readme.txt
index 7d61d8d27..9dc1c6ab3 100644
--- a/Modules/readme.txt
+++ b/Modules/readme.txt
@@ -18,6 +18,9 @@ XXX_VERSION_YY Expect Version YY if true. Make sure at most one of thes
XXX_WRAP_YY If False, do not try to use the relevent CMake wrapping command.
XXX_YY_FOUND If False, optional YY part of XXX sytem is not available.
XXX_FOUND Set to false, or undefined, if we haven't found, or don't want to use XXX.
+XXX_NOT_FOUND_MESSAGE Should be set by config-files in the case that it has set XXX_FOUND to FALSE.
+ The contained message will be printed by the find_package() command and by
+ find_package_handle_standard_args() to inform the user about the problem.
XXX_RUNTIME_LIBRARY_DIRS Optionally, the runtime library search path for use when running an executable linked to shared libraries.
The list should be used by user code to create the PATH on windows or LD_LIBRARY_PATH on unix.
This should not be a cache entry.
@@ -124,7 +127,10 @@ If neither the QUIET nor REQUIRED options are given then the
FindXXX.cmake module should look for the package and complain without
error if the module is not found.
-A package can be provide sub-components.
+FIND_PACKAGE() will set the variable CMAKE_FIND_PACKAGE_NAME to
+contain the actual name of the package.
+
+A package can provide sub-components.
Those components can be listed after the COMPONENTS (or REQUIRED)
or OPTIONAL_COMPONENTS keywords. The set of all listed components will be
specified in a XXX_FIND_COMPONENTS variable.