From 77543bde41b0e52c3959016698b529835945d62d Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Mon, 13 Aug 2012 13:47:32 -0400 Subject: [PATCH] Convert CMake-language commands to lower case Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code: cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | xargs -0 sed -i -f convert.sed && rm convert.sed --- CMakeCPack.cmake | 134 +- CMakeCPackOptions.cmake.in | 28 +- CMakeGraphVizOptions.cmake | 2 +- CMakeLists.txt | 672 ++++---- CTestConfig.cmake | 2 +- CTestCustom.cmake.in | 18 +- CompileFlags.cmake | 72 +- Docs/CMakeLists.txt | 2 +- Modules/AddFileDependencies.cmake | 18 +- Modules/CMakeASM-ATTInformation.cmake | 10 +- Modules/CMakeASMCompiler.cmake.in | 20 +- Modules/CMakeASMInformation.cmake | 148 +- Modules/CMakeASM_MASMInformation.cmake | 10 +- Modules/CMakeASM_NASMInformation.cmake | 12 +- Modules/CMakeBackwardCompatibilityC.cmake | 82 +- Modules/CMakeBackwardCompatibilityCXX.cmake | 58 +- Modules/CMakeBorlandFindMake.cmake | 4 +- Modules/CMakeCCompiler.cmake.in | 78 +- Modules/CMakeCInformation.cmake | 200 +-- Modules/CMakeCXXCompiler.cmake.in | 80 +- Modules/CMakeCXXInformation.cmake | 306 ++-- Modules/CMakeClDeps.cmake | 28 +- Modules/CMakeCommonLanguageInclude.cmake | 44 +- Modules/CMakeDependentOption.cmake | 48 +- Modules/CMakeDetermineASM-ATTCompiler.cmake | 8 +- Modules/CMakeDetermineASMCompiler.cmake | 192 +-- Modules/CMakeDetermineASM_MASMCompiler.cmake | 16 +- Modules/CMakeDetermineASM_NASMCompiler.cmake | 14 +- Modules/CMakeDetermineCCompiler.cmake | 160 +- Modules/CMakeDetermineCXXCompiler.cmake | 168 +- Modules/CMakeDetermineCompilerABI.cmake | 134 +- Modules/CMakeDetermineCompilerId.cmake | 310 ++-- Modules/CMakeDetermineFortranCompiler.cmake | 196 +-- Modules/CMakeDetermineJavaCompiler.cmake | 84 +- Modules/CMakeDetermineRCCompiler.cmake | 70 +- Modules/CMakeDetermineSystem.cmake | 168 +- Modules/CMakeExpandImportedTargets.cmake | 2 +- Modules/CMakeExportBuildSettings.cmake | 20 +- ...etermineCompilerMacrosAndIncludeDirs.cmake | 110 +- Modules/CMakeFindBinUtils.cmake | 46 +- Modules/CMakeFindCodeBlocks.cmake | 10 +- Modules/CMakeFindEclipseCDT4.cmake | 78 +- Modules/CMakeFindFrameworks.cmake | 26 +- Modules/CMakeFindKDevelop3.cmake | 8 +- Modules/CMakeFindWMake.cmake | 4 +- Modules/CMakeFindXCode.cmake | 4 +- Modules/CMakeForceCompiler.cmake | 64 +- Modules/CMakeFortranCompiler.cmake.in | 84 +- Modules/CMakeFortranInformation.cmake | 268 ++-- Modules/CMakeGenericSystem.cmake | 98 +- Modules/CMakeImportBuildSettings.cmake | 12 +- Modules/CMakeJOMFindMake.cmake | 4 +- Modules/CMakeJavaCompiler.cmake.in | 24 +- Modules/CMakeJavaInformation.cmake | 50 +- Modules/CMakeMSYSFindMake.cmake | 4 +- Modules/CMakeMinGWFindMake.cmake | 14 +- Modules/CMakeNMakeFindMake.cmake | 4 +- Modules/CMakeNinjaFindMake.cmake | 4 +- Modules/CMakePackageConfigHelpers.cmake | 10 +- Modules/CMakePrintSystemInformation.cmake | 46 +- Modules/CMakePushCheckState.cmake | 38 +- Modules/CMakeRCCompiler.cmake.in | 12 +- Modules/CMakeRCInformation.cmake | 30 +- Modules/CMakeSystem.cmake.in | 20 +- Modules/CMakeSystemSpecificInformation.cmake | 46 +- Modules/CMakeTestASM-ATTCompiler.cmake | 6 +- Modules/CMakeTestASMCompiler.cmake | 20 +- Modules/CMakeTestASM_MASMCompiler.cmake | 6 +- Modules/CMakeTestASM_NASMCompiler.cmake | 6 +- Modules/CMakeTestCCompiler.cmake | 60 +- Modules/CMakeTestCXXCompiler.cmake | 60 +- Modules/CMakeTestCompilerCommon.cmake | 10 +- Modules/CMakeTestFortranCompiler.cmake | 84 +- Modules/CMakeTestJavaCompiler.cmake | 2 +- Modules/CMakeTestRCCompiler.cmake | 2 +- Modules/CMakeUnixFindMake.cmake | 4 +- Modules/CMakeVS10FindMake.cmake | 14 +- Modules/CMakeVS11FindMake.cmake | 14 +- Modules/CMakeVS6BackwardCompatibility.cmake | 20 +- Modules/CMakeVS6FindMake.cmake | 8 +- Modules/CMakeVS71FindMake.cmake | 8 +- Modules/CMakeVS7BackwardCompatibility.cmake | 20 +- Modules/CMakeVS7FindMake.cmake | 8 +- Modules/CMakeVS8FindMake.cmake | 16 +- Modules/CMakeVS9FindMake.cmake | 16 +- Modules/CPack.cmake | 132 +- Modules/CPackComponent.cmake | 206 +-- Modules/CPackDeb.cmake | 248 +-- Modules/CPackRPM.cmake | 396 ++--- Modules/CPackZIP.cmake | 46 +- Modules/CTest.cmake | 270 ++-- Modules/CTestTargets.cmake | 78 +- Modules/CheckCCompilerFlag.cmake | 12 +- Modules/CheckCSourceCompiles.cmake | 88 +- Modules/CheckCSourceRuns.cmake | 70 +- Modules/CheckCXXCompilerFlag.cmake | 12 +- Modules/CheckCXXSourceCompiles.cmake | 88 +- Modules/CheckCXXSourceRuns.cmake | 70 +- Modules/CheckCXXSymbolExists.cmake | 6 +- Modules/CheckFortranFunctionExists.cmake | 4 +- Modules/CheckFunctionExists.cmake | 54 +- Modules/CheckIncludeFile.cmake | 60 +- Modules/CheckIncludeFileCXX.cmake | 60 +- Modules/CheckIncludeFiles.cmake | 74 +- Modules/CheckLibraryExists.cmake | 42 +- Modules/CheckSizeOf.cmake | 2 +- Modules/CheckStructHasMember.cmake | 16 +- Modules/CheckSymbolExists.cmake | 70 +- Modules/CheckVariableExists.cmake | 44 +- Modules/Compiler/Absoft-Fortran.cmake | 16 +- Modules/Compiler/GNU-Fortran.cmake | 10 +- Modules/Compiler/GNU.cmake | 2 +- Modules/Compiler/HP-ASM.cmake | 2 +- Modules/Compiler/HP-C.cmake | 6 +- Modules/Compiler/HP-CXX.cmake | 6 +- Modules/Compiler/HP-Fortran.cmake | 2 +- Modules/Compiler/Intel-ASM.cmake | 22 +- Modules/Compiler/Intel-C.cmake | 16 +- Modules/Compiler/Intel-CXX.cmake | 16 +- Modules/Compiler/Intel-Fortran.cmake | 14 +- Modules/Compiler/MIPSpro-C.cmake | 2 +- Modules/Compiler/MIPSpro-CXX.cmake | 2 +- Modules/Compiler/MIPSpro-Fortran.cmake | 2 +- Modules/Compiler/PGI-Fortran.cmake | 10 +- Modules/Compiler/PathScale-Fortran.cmake | 2 +- Modules/Compiler/SunPro-ASM.cmake | 30 +- Modules/Compiler/SunPro-C.cmake | 38 +- Modules/Compiler/SunPro-CXX.cmake | 40 +- Modules/Compiler/SunPro-Fortran.cmake | 26 +- Modules/Compiler/TinyCC-C.cmake | 12 +- Modules/Compiler/XL-ASM.cmake | 14 +- Modules/Compiler/XL-C.cmake | 2 +- Modules/Compiler/XL-CXX.cmake | 4 +- Modules/Compiler/XL-Fortran.cmake | 10 +- Modules/Dart.cmake | 78 +- Modules/DeployQt4.cmake | 4 +- Modules/Documentation.cmake | 26 +- Modules/FLTKCompatibility.cmake | 2 +- Modules/FeatureSummary.cmake | 366 ++--- Modules/FindASPELL.cmake | 10 +- Modules/FindAVIFile.cmake | 20 +- Modules/FindBISON.cmake | 130 +- Modules/FindBZip2.cmake | 32 +- Modules/FindBoost.cmake | 2 +- Modules/FindCABLE.cmake | 44 +- Modules/FindCUDA.cmake | 2 +- Modules/FindCURL.cmake | 38 +- Modules/FindCoin3D.cmake | 62 +- Modules/FindCurses.cmake | 134 +- Modules/FindCygwin.cmake | 8 +- Modules/FindDart.cmake | 6 +- Modules/FindDevIL.cmake | 18 +- Modules/FindDoxygen.cmake | 30 +- Modules/FindEXPAT.cmake | 16 +- Modules/FindFLEX.cmake | 104 +- Modules/FindFLTK.cmake | 288 ++-- Modules/FindFLTK2.cmake | 248 +-- Modules/FindFreetype.cmake | 54 +- Modules/FindGCCXML.cmake | 4 +- Modules/FindGDAL.cmake | 8 +- Modules/FindGIF.cmake | 32 +- Modules/FindGLU.cmake | 12 +- Modules/FindGLUT.cmake | 44 +- Modules/FindGTK.cmake | 68 +- Modules/FindGettext.cmake | 216 +-- Modules/FindGnuTLS.cmake | 34 +- Modules/FindGnuplot.cmake | 22 +- Modules/FindHSPELL.cmake | 20 +- Modules/FindHTMLHelp.cmake | 14 +- Modules/FindITK.cmake | 28 +- Modules/FindImageMagick.cmake | 148 +- Modules/FindJNI.cmake | 194 +-- Modules/FindJPEG.cmake | 24 +- Modules/FindJasper.cmake | 32 +- Modules/FindJava.cmake | 76 +- Modules/FindKDE3.cmake | 228 +-- Modules/FindKDE4.cmake | 86 +- Modules/FindLATEX.cmake | 46 +- Modules/FindLibLZMA.cmake | 36 +- Modules/FindLibXml2.cmake | 32 +- Modules/FindLibXslt.cmake | 34 +- Modules/FindLua50.cmake | 34 +- Modules/FindLua51.cmake | 34 +- Modules/FindMFC.cmake | 50 +- Modules/FindMPEG.cmake | 16 +- Modules/FindMPEG2.cmake | 24 +- Modules/FindMatlab.cmake | 74 +- Modules/FindMotif.cmake | 14 +- Modules/FindOpenAL.cmake | 8 +- Modules/FindOpenGL.cmake | 118 +- Modules/FindOpenSSL.cmake | 80 +- Modules/FindOpenSceneGraph.cmake | 2 +- Modules/FindPHP4.cmake | 38 +- Modules/FindPNG.cmake | 8 +- Modules/FindPackageHandleStandardArgs.cmake | 288 ++-- Modules/FindPackageMessage.cmake | 26 +- Modules/FindPerl.cmake | 46 +- Modules/FindPerlLibs.cmake | 2 +- Modules/FindPhysFS.cmake | 6 +- Modules/FindPike.cmake | 8 +- Modules/FindPostgreSQL.cmake | 4 +- Modules/FindProducer.cmake | 4 +- Modules/FindPythonLibs.cmake | 236 +-- Modules/FindQt.cmake | 166 +- Modules/FindQt3.cmake | 216 +-- Modules/FindQt4.cmake | 822 +++++----- Modules/FindQuickTime.cmake | 16 +- Modules/FindRTI.cmake | 54 +- Modules/FindRuby.cmake | 208 +-- Modules/FindSDL.cmake | 64 +- Modules/FindSDL_image.cmake | 6 +- Modules/FindSDL_mixer.cmake | 6 +- Modules/FindSDL_net.cmake | 6 +- Modules/FindSDL_sound.cmake | 152 +- Modules/FindSDL_ttf.cmake | 6 +- Modules/FindSWIG.cmake | 54 +- Modules/FindSelfPackers.cmake | 30 +- Modules/FindSquish.cmake | 94 +- Modules/FindSubversion.cmake | 80 +- Modules/FindTCL.cmake | 112 +- Modules/FindTIFF.cmake | 26 +- Modules/FindTclStub.cmake | 48 +- Modules/FindTclsh.cmake | 52 +- Modules/FindThreads.cmake | 180 +-- Modules/FindUnixCommands.cmake | 26 +- Modules/FindVTK.cmake | 100 +- Modules/FindWget.cmake | 10 +- Modules/FindWish.cmake | 44 +- Modules/FindX11.cmake | 538 +++---- Modules/FindXMLRPC.cmake | 142 +- Modules/FindZLIB.cmake | 66 +- Modules/FindwxWidgets.cmake | 706 ++++----- Modules/FindwxWindows.cmake | 398 ++--- Modules/ITKCompatibility.cmake | 2 +- Modules/InstallRequiredSystemLibraries.cmake | 314 ++-- Modules/KDE3Macros.cmake | 388 ++--- Modules/MacroAddFileDependencies.cmake | 20 +- Modules/Platform/AIX.cmake | 20 +- Modules/Platform/BSDOS.cmake | 2 +- Modules/Platform/BeOS.cmake | 20 +- Modules/Platform/BlueGeneL.cmake | 52 +- Modules/Platform/CYGWIN-GNU.cmake | 8 +- Modules/Platform/CYGWIN-windres.cmake | 2 +- Modules/Platform/CYGWIN.cmake | 26 +- Modules/Platform/Catamount.cmake | 40 +- Modules/Platform/Darwin-GNU.cmake | 2 +- Modules/Platform/Darwin-XL-C.cmake | 6 +- Modules/Platform/Darwin-XL-CXX.cmake | 6 +- Modules/Platform/Darwin-icc.cmake | 148 +- Modules/Platform/Darwin-icpc.cmake | 6 +- Modules/Platform/Darwin.cmake | 238 +-- Modules/Platform/DragonFly.cmake | 2 +- Modules/Platform/FreeBSD.cmake | 38 +- Modules/Platform/GNU.cmake | 20 +- Modules/Platform/Generic-ADSP-ASM.cmake | 8 +- Modules/Platform/Generic-ADSP-C.cmake | 20 +- Modules/Platform/Generic-ADSP-CXX.cmake | 20 +- Modules/Platform/Generic-ADSP-Common.cmake | 130 +- Modules/Platform/Generic-SDCC-C.cmake | 54 +- Modules/Platform/Generic.cmake | 8 +- Modules/Platform/HP-UX.cmake | 48 +- Modules/Platform/Haiku.cmake | 40 +- Modules/Platform/IRIX.cmake | 54 +- Modules/Platform/IRIX64.cmake | 94 +- Modules/Platform/Linux-Clang-C.cmake | 2 +- Modules/Platform/Linux-Clang-CXX.cmake | 2 +- Modules/Platform/Linux-GNU-C.cmake | 2 +- Modules/Platform/Linux-GNU-CXX.cmake | 2 +- Modules/Platform/Linux-GNU-Fortran.cmake | 2 +- Modules/Platform/Linux-Intel-C.cmake | 2 +- Modules/Platform/Linux-Intel-CXX.cmake | 2 +- Modules/Platform/Linux-Intel-Fortran.cmake | 2 +- Modules/Platform/Linux-SunPro-CXX.cmake | 2 +- Modules/Platform/Linux-TinyCC-C.cmake | 8 +- Modules/Platform/Linux-XL-C.cmake | 2 +- Modules/Platform/Linux-XL-CXX.cmake | 2 +- Modules/Platform/Linux-XL-Fortran.cmake | 2 +- Modules/Platform/Linux-como.cmake | 10 +- Modules/Platform/Linux.cmake | 50 +- Modules/Platform/MP-RAS.cmake | 22 +- Modules/Platform/NetBSD.cmake | 28 +- Modules/Platform/OSF1.cmake | 76 +- Modules/Platform/OpenBSD.cmake | 14 +- Modules/Platform/OpenVMS.cmake | 8 +- Modules/Platform/QNX.cmake | 38 +- Modules/Platform/RISCos.cmake | 10 +- Modules/Platform/SCO_SV.cmake | 4 +- Modules/Platform/SINIX.cmake | 8 +- Modules/Platform/SunOS.cmake | 40 +- Modules/Platform/Tru64.cmake | 2 +- Modules/Platform/ULTRIX.cmake | 10 +- Modules/Platform/UNIX_SV.cmake | 10 +- Modules/Platform/UnixPaths.cmake | 30 +- Modules/Platform/UnixWare.cmake | 10 +- Modules/Platform/Windows-Embarcadero.cmake | 40 +- Modules/Platform/Windows-Intel-Fortran.cmake | 10 +- Modules/Platform/Windows-Intel.cmake | 98 +- Modules/Platform/Windows-cl.cmake | 368 ++--- Modules/Platform/Windows-cl.cmake.in | 28 +- Modules/Platform/Windows-df.cmake | 94 +- Modules/Platform/Windows-wcl386.cmake | 90 +- Modules/Platform/Windows-windres.cmake | 2 +- Modules/Platform/Windows.cmake | 48 +- Modules/Platform/WindowsPaths.cmake | 56 +- Modules/Platform/Xenix.cmake | 2 +- Modules/Platform/cl.cmake | 54 +- Modules/Platform/eCos.cmake | 88 +- Modules/Platform/gas.cmake | 20 +- Modules/Platform/kFreeBSD.cmake | 4 +- Modules/Platform/syllable.cmake | 28 +- Modules/Qt4ConfigDependentSettings.cmake | 326 ++-- Modules/Qt4Macros.cmake | 524 +++--- Modules/SystemInformation.cmake | 104 +- Modules/TestBigEndian.cmake | 112 +- Modules/TestCXXAcceptsFlag.cmake | 26 +- Modules/TestForANSIForScope.cmake | 26 +- Modules/TestForANSIStreamHeaders.cmake | 18 +- Modules/TestForSSTREAM.cmake | 26 +- Modules/TestForSTDNamespace.cmake | 26 +- Modules/UseEcos.cmake | 190 +-- Modules/UsePkgConfig.cmake | 52 +- Modules/UseQt4.cmake | 148 +- Modules/UseSWIG.cmake | 252 +-- Modules/UseVTK40.cmake | 8 +- Modules/UseVTKBuildSettings40.cmake | 34 +- Modules/UseVTKConfig40.cmake | 376 ++--- Modules/Use_wxWindows.cmake | 50 +- Modules/UsewxWidgets.cmake | 80 +- Modules/VTKCompatibility.cmake | 32 +- Modules/kde3uic.cmake | 10 +- Source/CMakeLists.txt | 258 +-- Source/CMakeVersion.cmake | 10 +- Source/CursesDialog/CMakeLists.txt | 14 +- Source/CursesDialog/form/CMakeLists.txt | 22 +- Source/QtDialog/CMakeLists.txt | 82 +- Source/QtDialog/QtDialogCPack.cmake.in | 22 +- .../CMakeVisualStudio6Configurations.cmake | 2 +- Templates/CTestScript.cmake.in | 30 +- Tests/BuildDepends/Project/CMakeLists.txt | 14 +- Tests/BundleGeneratorTest/CMakeLists.txt | 34 +- Tests/BundleTest/BundleSubDir/CMakeLists.txt | 14 +- Tests/BundleTest/CMakeLists.txt | 100 +- Tests/CMakeLists.txt | 1398 ++++++++--------- .../CheckCXXSymbolExists/CMakeLists.txt | 50 +- .../CheckSymbolExists/CMakeLists.txt | 38 +- Tests/CMakeTests/CMakeLists.txt | 14 +- Tests/CMakeTests/ListTest.cmake.in | 90 +- Tests/CMakeTests/ToolchainTest.cmake.in | 2 +- Tests/CMakeTests/VariableWatchTest.cmake.in | 12 +- Tests/CTestTest/test.cmake.in | 28 +- Tests/CTestTest2/test.cmake.in | 42 +- Tests/CTestTestBadExe/CMakeLists.txt | 8 +- Tests/CTestTestBadExe/test.cmake.in | 22 +- Tests/CTestTestChecksum/test.cmake.in | 28 +- .../test1.cmake.in | 22 +- .../test2.cmake.in | 22 +- Tests/CTestTestCostSerial/CMakeLists.txt | 20 +- Tests/CTestTestCostSerial/test.cmake.in | 28 +- Tests/CTestTestCrash/CMakeLists.txt | 8 +- Tests/CTestTestCrash/test.cmake.in | 22 +- Tests/CTestTestCycle/test.cmake.in | 22 +- Tests/CTestTestDepends/test.cmake.in | 22 +- Tests/CTestTestFailedSubmits/test.cmake.in | 22 +- Tests/CTestTestFailure/CMakeLists.txt | 10 +- Tests/CTestTestFailure/testNoBuild.cmake.in | 22 +- Tests/CTestTestFailure/testNoExe.cmake.in | 22 +- Tests/CTestTestParallel/CMakeLists.txt | 20 +- Tests/CTestTestParallel/test.cmake.in | 22 +- Tests/CTestTestResourceLock/CMakeLists.txt | 18 +- Tests/CTestTestResourceLock/test.cmake.in | 22 +- Tests/CTestTestRunScript/hello.cmake.in | 4 +- Tests/CTestTestRunScript/test.cmake.in | 2 +- Tests/CTestTestScheduler/CMakeLists.txt | 14 +- Tests/CTestTestScheduler/test.cmake.in | 28 +- Tests/CTestTestStopTime/CMakeLists.txt | 14 +- Tests/CTestTestStopTime/GetDate.cmake | 226 +-- Tests/CTestTestStopTime/test.cmake.in | 24 +- Tests/CTestTestSubdir/CMakeLists.txt | 10 +- Tests/CTestTestSubdir/subdir/CMakeLists.txt | 4 +- Tests/CTestTestSubdir/subdir2/CMakeLists.txt | 4 +- Tests/CTestTestSubdir/subdir3/CMakeLists.txt | 4 +- Tests/CTestTestSubdir/test.cmake.in | 22 +- Tests/CTestTestTimeout/CMakeLists.txt | 30 +- Tests/CTestTestTimeout/test.cmake.in | 24 +- Tests/CTestTestUpload/CMakeLists.txt | 2 +- Tests/CTestTestUpload/test.cmake.in | 16 +- Tests/CTestTestZeroTimeout/CMakeLists.txt | 12 +- Tests/CTestTestZeroTimeout/test.cmake.in | 24 +- Tests/CommandLineTest/CMakeLists.txt | 86 +- Tests/CommandLineTest/PreLoad.cmake | 2 +- Tests/CompileCommandOutput/CMakeLists.txt | 22 +- Tests/Complex/CMakeLists.txt | 344 ++-- Tests/Complex/Executable/CMakeLists.txt | 166 +- Tests/Complex/Executable/Included.cmake | 2 +- Tests/Complex/Executable/Temp/CMakeLists.txt | 2 +- Tests/Complex/Library/CMakeLists.txt | 120 +- Tests/Complex/Library/test_preprocess.cmake | 14 +- Tests/Complex/VarTests.cmake | 294 ++-- Tests/ComplexOneConfig/CMakeLists.txt | 324 ++-- .../Executable/CMakeLists.txt | 166 +- .../Executable/Included.cmake | 2 +- .../Executable/Temp/CMakeLists.txt | 2 +- Tests/ComplexOneConfig/Library/CMakeLists.txt | 120 +- .../Library/test_preprocess.cmake | 14 +- Tests/ComplexOneConfig/VarTests.cmake | 294 ++-- Tests/Contracts/Trilinos-10-6/Patch.cmake | 8 +- Tests/Contracts/vtk542/RunTest.cmake | 2 +- Tests/CrossCompile/CMakeLists.txt | 10 +- Tests/CustomCommand/CMakeLists.txt | 142 +- .../GeneratedHeader/CMakeLists.txt | 6 +- .../GeneratorInExtraDir/CMakeLists.txt | 10 +- Tests/CustomCommand/check_mark.cmake | 10 +- .../CMakeLists.txt | 12 +- Tests/Dependency/1/CMakeLists.txt | 4 +- Tests/Dependency/CMakeLists.txt | 40 +- Tests/Dependency/Eight/CMakeLists.txt | 4 +- Tests/Dependency/Exec/CMakeLists.txt | 4 +- Tests/Dependency/Exec2/CMakeLists.txt | 4 +- Tests/Dependency/Exec3/CMakeLists.txt | 4 +- Tests/Dependency/Exec4/CMakeLists.txt | 4 +- Tests/Dependency/Five/CMakeLists.txt | 4 +- Tests/Dependency/Four/CMakeLists.txt | 8 +- Tests/Dependency/NoDepA/CMakeLists.txt | 2 +- Tests/Dependency/NoDepB/CMakeLists.txt | 2 +- Tests/Dependency/NoDepC/CMakeLists.txt | 2 +- Tests/Dependency/Seven/CMakeLists.txt | 4 +- Tests/Dependency/Six/CMakeLists.txt | 10 +- Tests/Dependency/Three/CMakeLists.txt | 4 +- Tests/Dependency/Two/CMakeLists.txt | 16 +- Tests/EnforceConfig.cmake.in | 42 +- Tests/ExportImport/InitialCache.cmake.in | 30 +- Tests/ExternalOBJ/CMakeLists.txt | 54 +- Tests/ExternalOBJ/Object/CMakeLists.txt | 18 +- .../Baz 1.1/BazConfigVersion.cmake | 14 +- .../Baz 1.2/CMake/BazConfigVersion.cmake | 14 +- Tests/FindPackageTest/CMakeLists.txt | 388 ++--- ...akeTestExportPackageConfigVersion.cmake.in | 10 +- Tests/FindPackageTest/FindRecursiveA.cmake | 2 +- Tests/FindPackageTest/FindRecursiveB.cmake | 2 +- Tests/FindPackageTest/FindRecursiveC.cmake | 2 +- Tests/FindPackageTest/FindVersionTestA.cmake | 36 +- Tests/FindPackageTest/FindVersionTestB.cmake | 36 +- Tests/FindPackageTest/FindVersionTestC.cmake | 36 +- Tests/FindPackageTest/FindVersionTestD.cmake | 36 +- .../FindPackageTest/lib/TApp/TAppConfig.cmake | 2 +- .../cmake/zot-4.0/zot-config-version.cmake | 14 +- .../lib/arch/zot-3.1/zot-config-version.cmake | 14 +- .../cmake/zot-3.1/zot-config-version.cmake | 6 +- .../cmake/zot-4.0/zot-config-version.cmake | 14 +- .../suffix/test/SuffixTestConfigVersion.cmake | 14 +- .../lib/zot-2.0/zot-config-version.cmake | 8 +- .../lib/zot-3.0/zot-config-version.cmake | 8 +- .../lib/zot-3.1/zot-config-version.cmake | 14 +- .../lib/zot/zot-config-version.cmake | 16 +- .../FindPackageTest/lib/zot/zot-config.cmake | 2 +- Tests/Fortran/Library/CMakeLists.txt | 14 +- Tests/FunctionTest/CMakeLists.txt | 132 +- Tests/FunctionTest/SubDirScope/CMakeLists.txt | 16 +- Tests/IPO/CMakeLists.txt | 2 +- Tests/Jump/CMakeLists.txt | 8 +- Tests/Jump/Executable/CMakeLists.txt | 10 +- Tests/Jump/Library/CMakeLists.txt | 4 +- Tests/Jump/Library/Shared/CMakeLists.txt | 38 +- Tests/Jump/Library/Static/CMakeLists.txt | 2 +- Tests/LibName/CMakeLists.txt | 4 +- Tests/LinkLine/CMakeLists.txt | 12 +- Tests/LinkLineOrder/CMakeLists.txt | 34 +- .../LoadCommand/CMakeCommands/CMakeLists.txt | 18 +- Tests/LoadCommand/CMakeLists.txt | 44 +- .../CMakeCommands/CMakeLists.txt | 24 +- Tests/LoadCommandOneConfig/CMakeLists.txt | 48 +- Tests/MacroTest/CMakeLists.txt | 84 +- Tests/MacroTest/context.cmake | 6 +- Tests/MakeClean/CMakeLists.txt | 42 +- Tests/MakeClean/ToClean/CMakeLists.txt | 24 +- Tests/MakeClean/ToClean/ToCleanFiles.cmake.in | 2 +- Tests/MathTest/CMakeLists.txt | 20 +- Tests/ObjC++/CMakeLists.txt | 6 +- Tests/OutOfBinary/CMakeLists.txt | 2 +- Tests/OutOfSource/CMakeLists.txt | 6 +- .../OutOfSourceSubdir/CMakeLists.txt | 68 +- Tests/OutOfSource/SubDir/CMakeLists.txt | 6 +- Tests/PerConfig/CMakeLists.txt | 36 +- Tests/Plugin/CMakeLists.txt | 90 +- Tests/PreOrder/CMakeLists.txt | 10 +- Tests/PreOrder/Library/CMakeLists.txt | 2 +- Tests/PrecompiledHeader/CMakeLists.txt | 66 +- Tests/SameName/CMakeLists.txt | 8 +- Tests/SameName/Exe1/CMakeLists.txt | 14 +- Tests/SameName/Lib1/CMakeLists.txt | 2 +- Tests/SetLang/CMakeLists.txt | 2 +- Tests/SimpleInstall/CMakeLists.txt | 394 ++--- Tests/SimpleInstall/InstallScript1.cmake | 10 +- Tests/SimpleInstall/InstallScript2.cmake | 26 +- Tests/SimpleInstall/InstallScript3.cmake | 22 +- Tests/SimpleInstall/InstallScript4.cmake | 38 +- Tests/SimpleInstall/PackageScript.cmake | 14 +- Tests/SimpleInstall/PostInstall.cmake | 12 +- Tests/SimpleInstall/PreInstall.cmake | 4 +- Tests/SimpleInstall/TestSubDir/CMakeLists.txt | 6 +- Tests/SimpleInstall/scripts/CMakeLists.txt | 2 +- Tests/SimpleInstallS2/CMakeLists.txt | 394 ++--- Tests/SimpleInstallS2/InstallScript1.cmake | 10 +- Tests/SimpleInstallS2/InstallScript2.cmake | 26 +- Tests/SimpleInstallS2/InstallScript3.cmake | 22 +- Tests/SimpleInstallS2/InstallScript4.cmake | 38 +- Tests/SimpleInstallS2/PackageScript.cmake | 14 +- Tests/SimpleInstallS2/PostInstall.cmake | 12 +- Tests/SimpleInstallS2/PreInstall.cmake | 4 +- .../SimpleInstallS2/TestSubDir/CMakeLists.txt | 6 +- Tests/SimpleInstallS2/scripts/CMakeLists.txt | 2 +- Tests/StringFileTest/CMakeLists.txt | 346 ++-- Tests/SubDir/CMakeLists.txt | 64 +- Tests/SubDir/Examples/CMakeLists.txt | 4 +- Tests/SubDir/Examples/example1/CMakeLists.txt | 6 +- Tests/SubDir/Examples/example2/CMakeLists.txt | 4 +- Tests/SubDir/Executable/CMakeLists.txt | 2 +- Tests/SubDirSpaces/CMakeLists.txt | 84 +- .../Executable Sources/CMakeLists.txt | 2 +- Tests/SubDirSpaces/Executable/CMakeLists.txt | 2 +- .../SubDirSpaces/Some Examples/CMakeLists.txt | 4 +- .../Some Examples/example1/CMakeLists.txt | 6 +- .../Some Examples/example2/CMakeLists.txt | 4 +- Tests/SwigTest/CMakeLists.txt | 78 +- Tests/SystemInformation/CMakeLists.txt | 74 +- Tests/TarTest/CMakeLists.txt | 74 +- Tests/TestDriver/CMakeLists.txt | 12 +- Tests/Testing/CMakeLists.txt | 38 +- Tests/Testing/DartConfig.cmake | 30 +- Tests/Testing/Sub/Sub2/CMakeLists.txt | 4 +- Tests/TryCompile/CMakeLists.txt | 250 +-- Tests/Tutorial/Step7/build1.cmake | 8 +- Tests/Tutorial/Step7/build2.cmake | 6 +- Tests/VSExternalInclude/CMakeLists.txt | 52 +- Tests/VSExternalInclude/Lib1/CMakeLists.txt | 6 +- Tests/VSExternalInclude/Lib2/CMakeLists.txt | 8 +- Tests/Wrapping/CMakeLists.txt | 96 +- Tests/X11/CMakeLists.txt | 44 +- Tests/test_clean.cmake.in | 4 +- Utilities/CMakeLists.txt | 60 +- Utilities/Doxygen/CMakeLists.txt | 18 +- Utilities/KWIML/CMakeLists.txt | 8 +- Utilities/KWStyle/CMakeLists.txt | 60 +- Utilities/Release/Cygwin/CMakeLists.txt | 36 +- Utilities/Release/release_cmake.cmake | 6 +- bootstrap | 14 +- cmake_uninstall.cmake.in | 34 +- 547 files changed, 15862 insertions(+), 15862 deletions(-) diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index 9ee56af57..7a36d5d35 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -11,113 +11,113 @@ #============================================================================= # If the cmake version includes cpack, use it -IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") - IF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") - OPTION(CMAKE_INSTALL_DEBUG_LIBRARIES +if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") + if(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") + option(CMAKE_INSTALL_DEBUG_LIBRARIES "Install Microsoft runtime debug libraries with CMake." FALSE) - MARK_AS_ADVANCED(CMAKE_INSTALL_DEBUG_LIBRARIES) + mark_as_advanced(CMAKE_INSTALL_DEBUG_LIBRARIES) # By default, do not warn when built on machines using only VS Express: - IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) - SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) - ENDIF() + if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) + set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) + endif() - INCLUDE(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake) - ENDIF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") + include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake) + endif(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") - SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool") - SET(CPACK_PACKAGE_VENDOR "Kitware") - SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") - SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") - SET(CPACK_PACKAGE_VERSION "${CMake_VERSION}") - SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") - SET(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}") + set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool") + set(CPACK_PACKAGE_VENDOR "Kitware") + set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") + set(CPACK_PACKAGE_VERSION "${CMake_VERSION}") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") + set(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}") # Make this explicit here, rather than accepting the CPack default value, # so we can refer to it: - SET(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") + set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") # Installers for 32- vs. 64-bit CMake: # - Root install directory (displayed to end user at installer-run time) # - "NSIS package/display name" (text used in the installer GUI) # - Registry key used to store info about the installation - IF(CMAKE_CL_64) - SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") - SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)") - SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)") - ELSE() - SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") - SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") - SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}") - ENDIF() + if(CMAKE_CL_64) + set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") + set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)") + set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)") + else() + set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") + set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") + set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}") + endif() - IF(NOT DEFINED CPACK_SYSTEM_NAME) + if(NOT DEFINED CPACK_SYSTEM_NAME) # make sure package is not Cygwin-unknown, for Cygwin just # cygwin is good for the system name - IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") - SET(CPACK_SYSTEM_NAME Cygwin) - ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") - SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) - ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") - ENDIF(NOT DEFINED CPACK_SYSTEM_NAME) - IF(${CPACK_SYSTEM_NAME} MATCHES Windows) - IF(CMAKE_CL_64) - SET(CPACK_SYSTEM_NAME win64-x64) - ELSE(CMAKE_CL_64) - SET(CPACK_SYSTEM_NAME win32-x86) - ENDIF(CMAKE_CL_64) - ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows) + if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") + set(CPACK_SYSTEM_NAME Cygwin) + else("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") + set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) + endif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") + endif(NOT DEFINED CPACK_SYSTEM_NAME) + if(${CPACK_SYSTEM_NAME} MATCHES Windows) + if(CMAKE_CL_64) + set(CPACK_SYSTEM_NAME win64-x64) + else(CMAKE_CL_64) + set(CPACK_SYSTEM_NAME win32-x86) + endif(CMAKE_CL_64) + endif(${CPACK_SYSTEM_NAME} MATCHES Windows) - IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME) + if(NOT DEFINED CPACK_PACKAGE_FILE_NAME) # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache # default to source package - system, on cygwin system is not # needed - IF(CYGWIN) - SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}") - ELSE(CYGWIN) - SET(CPACK_PACKAGE_FILE_NAME + if(CYGWIN) + set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}") + else(CYGWIN) + set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}") - ENDIF(CYGWIN) - ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME) + endif(CYGWIN) + endif(NOT DEFINED CPACK_PACKAGE_FILE_NAME) - SET(CPACK_PACKAGE_CONTACT "cmake@cmake.org") + set(CPACK_PACKAGE_CONTACT "cmake@cmake.org") - IF(UNIX) - SET(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest") - SET(CPACK_SOURCE_STRIP_FILES "") - SET(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake") - ENDIF(UNIX) + if(UNIX) + set(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest") + set(CPACK_SOURCE_STRIP_FILES "") + set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake") + endif(UNIX) # cygwin specific packaging stuff - IF(CYGWIN) + if(CYGWIN) # setup the cygwin package name - SET(CPACK_PACKAGE_NAME cmake) + set(CPACK_PACKAGE_NAME cmake) # setup the name of the package for cygwin cmake-2.4.3 - SET(CPACK_PACKAGE_FILE_NAME + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CMake_VERSION}") # the source has the same name as the binary - SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}) + set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}) # Create a cygwin version number in case there are changes for cygwin # that are not reflected upstream in CMake - SET(CPACK_CYGWIN_PATCH_NUMBER 1) + set(CPACK_CYGWIN_PATCH_NUMBER 1) # These files are required by the cmCPackCygwinSourceGenerator and the files # put into the release tar files. - SET(CPACK_CYGWIN_BUILD_SCRIPT + set(CPACK_CYGWIN_BUILD_SCRIPT "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.sh") - SET(CPACK_CYGWIN_PATCH_FILE + set(CPACK_CYGWIN_PATCH_FILE "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.patch") # include the sub directory cmake file for cygwin that # configures some files and adds some install targets # this file uses some of the package file name variables - INCLUDE(Utilities/Release/Cygwin/CMakeLists.txt) - ENDIF(CYGWIN) + include(Utilities/Release/Cygwin/CMakeLists.txt) + endif(CYGWIN) # Set the options file that needs to be included inside CMakeCPackOptions.cmake - SET(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake) - CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in" + set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake) + configure_file("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in" "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY) - SET(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake") + set(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake") # include CPack model once all variables are set - INCLUDE(CPack) -ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") + include(CPack) +endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index 28b6ec046..868331f14 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -3,16 +3,16 @@ # in this file. if(CPACK_GENERATOR MATCHES "NSIS") - SET(CPACK_NSIS_INSTALL_ROOT "@CPACK_NSIS_INSTALL_ROOT@") + set(CPACK_NSIS_INSTALL_ROOT "@CPACK_NSIS_INSTALL_ROOT@") # set the install/unistall icon used for the installer itself # There is a bug in NSI that does not handle full unix paths properly. - SET(CPACK_NSIS_MUI_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico") - SET(CPACK_NSIS_MUI_UNIICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico") + set(CPACK_NSIS_MUI_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico") + set(CPACK_NSIS_MUI_UNIICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico") # set the package header icon for MUI - SET(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp") + set(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp") # tell cpack to create links to the doc files - SET(CPACK_NSIS_MENU_LINKS + set(CPACK_NSIS_MENU_LINKS "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-gui.html" "cmake-gui Help" "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help" "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-properties.html" @@ -24,23 +24,23 @@ if(CPACK_GENERATOR MATCHES "NSIS") "http://www.cmake.org" "CMake Web Site" ) # Use the icon from cmake-gui for add-remove programs - SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe") + set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe") - SET(CPACK_NSIS_PACKAGE_NAME "@CPACK_NSIS_PACKAGE_NAME@") - SET(CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, a cross-platform, open-source build system") - SET(CPACK_NSIS_HELP_LINK "http://www.cmake.org") - SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com") - SET(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@) - SET(CPACK_NSIS_MODIFY_PATH ON) + set(CPACK_NSIS_PACKAGE_NAME "@CPACK_NSIS_PACKAGE_NAME@") + set(CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, a cross-platform, open-source build system") + set(CPACK_NSIS_HELP_LINK "http://www.cmake.org") + set(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com") + set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@) + set(CPACK_NSIS_MODIFY_PATH ON) endif(CPACK_GENERATOR MATCHES "NSIS") # include the cpack options for qt dialog if they exisit # they might not if qt was not enabled for the build -INCLUDE("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL) +include("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL) if(CPACK_GENERATOR MATCHES "CygwinSource") # when packaging source make sure the .build directory is not included - SET(CPACK_SOURCE_IGNORE_FILES + set(CPACK_SOURCE_IGNORE_FILES "/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$") endif(CPACK_GENERATOR MATCHES "CygwinSource") diff --git a/CMakeGraphVizOptions.cmake b/CMakeGraphVizOptions.cmake index 038f17e9b..1add78c55 100644 --- a/CMakeGraphVizOptions.cmake +++ b/CMakeGraphVizOptions.cmake @@ -1 +1 @@ -SET(GRAPHVIZ_IGNORE_TARGETS "tartest;testSystemTools;testRegistry;testProcess;testIOS;testHashSTL;testFail;testCommandLineArguments;xrtest;LIBCURL;foo") +set(GRAPHVIZ_IGNORE_TARGETS "tartest;testSystemTools;testRegistry;testProcess;testIOS;testHashSTL;testFail;testCommandLineArguments;xrtest;LIBCURL;foo") diff --git a/CMakeLists.txt b/CMakeLists.txt index f8d17580d..0beed6267 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,71 +9,71 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2 FATAL_ERROR) -SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required -PROJECT(CMake) +cmake_minimum_required(VERSION 2.8.2 FATAL_ERROR) +set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required +project(CMake) -IF(CMAKE_BOOTSTRAP) +if(CMAKE_BOOTSTRAP) # Running from bootstrap script. Set local variable and remove from cache. - SET(CMAKE_BOOTSTRAP 1) - UNSET(CMAKE_BOOTSTRAP CACHE) -ENDIF() + set(CMAKE_BOOTSTRAP 1) + unset(CMAKE_BOOTSTRAP CACHE) +endif() -SET(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin) +set(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin) -IF("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") +if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") # Disallow architecture-specific try_run. It may not run on the host. - MACRO(TRY_RUN) - IF(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) - MESSAGE(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]") - ELSE() + macro(TRY_RUN) + if(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) + message(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]") + else() _TRY_RUN(${ARGV}) - ENDIF() - ENDMACRO() -ENDIF() + endif() + endmacro() +endif() #----------------------------------------------------------------------- # a macro to deal with system libraries, implemented as a macro # simply to improve readability of the main script #----------------------------------------------------------------------- -MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES) +macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) # Options have dependencies. - INCLUDE(CMakeDependentOption) + include(CMakeDependentOption) # Optionally use system xmlrpc. We no longer build or use it by default. - OPTION(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF) - MARK_AS_ADVANCED(CTEST_USE_XMLRPC) + option(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF) + mark_as_advanced(CTEST_USE_XMLRPC) # Allow the user to enable/disable all system utility library options by # defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}. - SET(UTILITIES BZIP2 CURL EXPAT LIBARCHIVE ZLIB) - FOREACH(util ${UTILITIES}) - IF(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util} + set(UTILITIES BZIP2 CURL EXPAT LIBARCHIVE ZLIB) + foreach(util ${UTILITIES}) + if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util} AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES) - SET(CMAKE_USE_SYSTEM_LIBRARY_${util} "${CMAKE_USE_SYSTEM_LIBRARIES}") - ENDIF() - IF(DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}) - IF(CMAKE_USE_SYSTEM_LIBRARY_${util}) - SET(CMAKE_USE_SYSTEM_LIBRARY_${util} ON) - ELSE() - SET(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF) - ENDIF() - IF(CMAKE_BOOTSTRAP) - UNSET(CMAKE_USE_SYSTEM_LIBRARY_${util} CACHE) - ENDIF() - STRING(TOLOWER "${util}" lutil) - SET(CMAKE_USE_SYSTEM_${util} "${CMAKE_USE_SYSTEM_LIBRARY_${util}}" + set(CMAKE_USE_SYSTEM_LIBRARY_${util} "${CMAKE_USE_SYSTEM_LIBRARIES}") + endif() + if(DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}) + if(CMAKE_USE_SYSTEM_LIBRARY_${util}) + set(CMAKE_USE_SYSTEM_LIBRARY_${util} ON) + else() + set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF) + endif() + if(CMAKE_BOOTSTRAP) + unset(CMAKE_USE_SYSTEM_LIBRARY_${util} CACHE) + endif() + string(TOLOWER "${util}" lutil) + set(CMAKE_USE_SYSTEM_${util} "${CMAKE_USE_SYSTEM_LIBRARY_${util}}" CACHE BOOL "Use system-installed ${lutil}" FORCE) - ELSE() - SET(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF) - ENDIF() - ENDFOREACH(util) - IF(CMAKE_BOOTSTRAP) - UNSET(CMAKE_USE_SYSTEM_LIBRARIES CACHE) - ENDIF() + else() + set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF) + endif() + endforeach(util) + if(CMAKE_BOOTSTRAP) + unset(CMAKE_USE_SYSTEM_LIBRARIES CACHE) + endif() # Optionally use system utility libraries. - OPTION(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}") + option(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}") CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl" "${CMAKE_USE_SYSTEM_LIBRARY_CURL}" "NOT CTEST_USE_XMLRPC" ON) CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat" @@ -84,155 +84,155 @@ MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES) "${CMAKE_USE_SYSTEM_LIBRARY_BZIP2}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON) # Mention to the user what system libraries are being used. - FOREACH(util ${UTILITIES}) - IF(CMAKE_USE_SYSTEM_${util}) - MESSAGE(STATUS "Using system-installed ${util}") - ENDIF(CMAKE_USE_SYSTEM_${util}) - ENDFOREACH(util) + foreach(util ${UTILITIES}) + if(CMAKE_USE_SYSTEM_${util}) + message(STATUS "Using system-installed ${util}") + endif(CMAKE_USE_SYSTEM_${util}) + endforeach(util) # Inform utility library header wrappers whether to use system versions. - CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in + configure_file(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in ${CMake_BINARY_DIR}/Utilities/cmThirdParty.h @ONLY) -ENDMACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES) +endmacro(CMAKE_HANDLE_SYSTEM_LIBRARIES) -SET(CMAKE_BUILD_ON_VISUAL_STUDIO 0) -IF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW ) - SET(CMAKE_BUILD_ON_VISUAL_STUDIO 1) -ENDIF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW ) +set(CMAKE_BUILD_ON_VISUAL_STUDIO 0) +if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW ) + set(CMAKE_BUILD_ON_VISUAL_STUDIO 1) +endif(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW ) #----------------------------------------------------------------------- # a macro to determine the generator and ctest executable to use # for testing. Simply to improve readability of the main script. #----------------------------------------------------------------------- -MACRO(CMAKE_SETUP_TESTING) - IF (NOT DART_ROOT) - SET(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM}) - ENDIF (NOT DART_ROOT) +macro(CMAKE_SETUP_TESTING) + if (NOT DART_ROOT) + set(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM}) + endif (NOT DART_ROOT) - IF(BUILD_TESTING) - SET(CMAKE_TEST_GENERATOR "" CACHE STRING + if(BUILD_TESTING) + set(CMAKE_TEST_GENERATOR "" CACHE STRING "Generator used when running tests") - SET(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH + set(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH "Generator used when running tests") - IF(NOT CMAKE_TEST_GENERATOR) - SET(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}") - SET(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}") - ELSE(NOT CMAKE_TEST_GENERATOR) - SET(CMAKE_TEST_DIFFERENT_GENERATOR TRUE) - ENDIF(NOT CMAKE_TEST_GENERATOR) + if(NOT CMAKE_TEST_GENERATOR) + set(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}") + set(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}") + else(NOT CMAKE_TEST_GENERATOR) + set(CMAKE_TEST_DIFFERENT_GENERATOR TRUE) + endif(NOT CMAKE_TEST_GENERATOR) # Are we testing with the MSVC compiler? - SET(CMAKE_TEST_MSVC 0) - IF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR) - SET(CMAKE_TEST_MSVC 1) - ELSE(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR) - IF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR + set(CMAKE_TEST_MSVC 0) + if(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR) + set(CMAKE_TEST_MSVC 1) + else(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR) + if("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio") - SET(CMAKE_TEST_MSVC 1) - ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR + set(CMAKE_TEST_MSVC 1) + endif("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio") - ENDIF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR) + endif(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR) - SET(CMAKE_TEST_SYSTEM_LIBRARIES 0) - FOREACH(util CURL EXPAT XMLRPC ZLIB) - IF(CMAKE_USE_SYSTEM_${util}) - SET(CMAKE_TEST_SYSTEM_LIBRARIES 1) - ENDIF(CMAKE_USE_SYSTEM_${util}) - ENDFOREACH(util) + set(CMAKE_TEST_SYSTEM_LIBRARIES 0) + foreach(util CURL EXPAT XMLRPC ZLIB) + if(CMAKE_USE_SYSTEM_${util}) + set(CMAKE_TEST_SYSTEM_LIBRARIES 1) + endif(CMAKE_USE_SYSTEM_${util}) + endforeach(util) # This variable is set by cmake, however to # test cmake we want to make sure that # the ctest from this cmake is used for testing # and not the ctest from the cmake building and testing # cmake. - SET(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest") - SET(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake") - SET(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack") - ENDIF(BUILD_TESTING) + set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest") + set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake") + set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack") + endif(BUILD_TESTING) # configure some files for testing - CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in" + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake" @ONLY) - CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage + configure_file(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage ${CMake_BINARY_DIR}/Tests/.NoDartCoverage) - CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage + configure_file(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage ${CMake_BINARY_DIR}/Modules/.NoDartCoverage) - CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.cmake.in + configure_file(${CMake_SOURCE_DIR}/CTestCustom.cmake.in ${CMake_BINARY_DIR}/CTestCustom.cmake @ONLY) - CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.ctest.in + configure_file(${CMake_SOURCE_DIR}/CTestCustom.ctest.in ${CMake_BINARY_DIR}/CTestCustom.ctest @ONLY) - IF(BUILD_TESTING AND DART_ROOT) - CONFIGURE_FILE(${CMake_SOURCE_DIR}/CMakeLogo.gif + if(BUILD_TESTING AND DART_ROOT) + configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY) - ENDIF(BUILD_TESTING AND DART_ROOT) - MARK_AS_ADVANCED(DART_ROOT) - MARK_AS_ADVANCED(CURL_TESTING) -ENDMACRO(CMAKE_SETUP_TESTING) + endif(BUILD_TESTING AND DART_ROOT) + mark_as_advanced(DART_ROOT) + mark_as_advanced(CURL_TESTING) +endmacro(CMAKE_SETUP_TESTING) # Provide a way for Visual Studio Express users to turn OFF the new FOLDER # organization feature. Default to ON for non-Express users. Express users must # explicitly turn off this option to build CMake in the Express IDE... # -OPTION(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) -MARK_AS_ADVANCED(CMAKE_USE_FOLDERS) +option(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) +mark_as_advanced(CMAKE_USE_FOLDERS) #----------------------------------------------------------------------- # a macro that only sets the FOLDER target property if it's # "appropriate" #----------------------------------------------------------------------- -MACRO(CMAKE_SET_TARGET_FOLDER tgt folder) - IF(CMAKE_USE_FOLDERS) - SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) +macro(CMAKE_SET_TARGET_FOLDER tgt folder) + if(CMAKE_USE_FOLDERS) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Really, I just want this to be an "if(TARGET ${tgt})" ... # but I'm not sure that our min req'd., CMake 2.4.5 can handle # that... so I'm just activating this for now, with a version # compare, and only for MSVC builds. - IF(MSVC) - IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8) - SET_PROPERTY(TARGET "${tgt}" PROPERTY FOLDER "${folder}") - ENDIF() - ENDIF() - ELSE() - SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS OFF) - ENDIF() -ENDMACRO(CMAKE_SET_TARGET_FOLDER) + if(MSVC) + if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8) + set_property(TARGET "${tgt}" PROPERTY FOLDER "${folder}") + endif() + endif() + else() + set_property(GLOBAL PROPERTY USE_FOLDERS OFF) + endif() +endmacro(CMAKE_SET_TARGET_FOLDER) #----------------------------------------------------------------------- # a macro to build the utilities used by CMake # Simply to improve readability of the main script. #----------------------------------------------------------------------- -MACRO (CMAKE_BUILD_UTILITIES) +macro (CMAKE_BUILD_UTILITIES) #--------------------------------------------------------------------- # Create the KWIML library for CMake. - SET(KWIML cmIML) - SET(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities) - ADD_SUBDIRECTORY(Utilities/KWIML) + set(KWIML cmIML) + set(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities) + add_subdirectory(Utilities/KWIML) #--------------------------------------------------------------------- # Create the kwsys library for CMake. - SET(KWSYS_NAMESPACE cmsys) - SET(KWSYS_USE_SystemTools 1) - SET(KWSYS_USE_Directory 1) - SET(KWSYS_USE_RegularExpression 1) - SET(KWSYS_USE_Base64 1) - SET(KWSYS_USE_MD5 1) - SET(KWSYS_USE_Process 1) - SET(KWSYS_USE_CommandLineArguments 1) - SET(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source) - SET(KWSYS_INSTALL_DOC_DIR "${CMake_DOC_DEST}") - ADD_SUBDIRECTORY(Source/kwsys) - SET(kwsys_folder "Utilities/KWSys") + set(KWSYS_NAMESPACE cmsys) + set(KWSYS_USE_SystemTools 1) + set(KWSYS_USE_Directory 1) + set(KWSYS_USE_RegularExpression 1) + set(KWSYS_USE_Base64 1) + set(KWSYS_USE_MD5 1) + set(KWSYS_USE_Process 1) + set(KWSYS_USE_CommandLineArguments 1) + set(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source) + set(KWSYS_INSTALL_DOC_DIR "${CMake_DOC_DEST}") + add_subdirectory(Source/kwsys) + set(kwsys_folder "Utilities/KWSys") CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}") CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}_c "${kwsys_folder}") CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}EncodeExecutable "${kwsys_folder}") @@ -249,7 +249,7 @@ MACRO (CMAKE_BUILD_UTILITIES) # Setup third-party libraries. # Everything in the tree should be able to include files from the # Utilities directory. - INCLUDE_DIRECTORIES( + include_directories( ${CMake_BINARY_DIR}/Utilities ${CMake_SOURCE_DIR}/Utilities ) @@ -260,237 +260,237 @@ MACRO (CMAKE_BUILD_UTILITIES) #--------------------------------------------------------------------- # Build zlib library for Curl, CMake, and CTest. - SET(CMAKE_ZLIB_HEADER "cm_zlib.h") - IF(CMAKE_USE_SYSTEM_ZLIB) - FIND_PACKAGE(ZLIB) - IF(NOT ZLIB_FOUND) - MESSAGE(FATAL_ERROR + set(CMAKE_ZLIB_HEADER "cm_zlib.h") + if(CMAKE_USE_SYSTEM_ZLIB) + find_package(ZLIB) + if(NOT ZLIB_FOUND) + message(FATAL_ERROR "CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!") - ENDIF(NOT ZLIB_FOUND) - SET(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR}) - SET(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) - ELSE(CMAKE_USE_SYSTEM_ZLIB) - SET(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities) - SET(CMAKE_ZLIB_LIBRARIES cmzlib) - ADD_SUBDIRECTORY(Utilities/cmzlib) + endif(NOT ZLIB_FOUND) + set(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR}) + set(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) + else(CMAKE_USE_SYSTEM_ZLIB) + set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities) + set(CMAKE_ZLIB_LIBRARIES cmzlib) + add_subdirectory(Utilities/cmzlib) CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty") - ENDIF(CMAKE_USE_SYSTEM_ZLIB) + endif(CMAKE_USE_SYSTEM_ZLIB) #--------------------------------------------------------------------- # Build Curl library for CTest. - IF(CMAKE_USE_SYSTEM_CURL) - FIND_PACKAGE(CURL) - IF(NOT CURL_FOUND) - MESSAGE(FATAL_ERROR + if(CMAKE_USE_SYSTEM_CURL) + find_package(CURL) + if(NOT CURL_FOUND) + message(FATAL_ERROR "CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!") - ENDIF(NOT CURL_FOUND) - SET(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS}) - SET(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES}) - ELSE(CMAKE_USE_SYSTEM_CURL) - SET(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER}) - SET(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES}) - SET(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES}) - OPTION(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE) - IF(NOT CMAKE_BUILD_CURL_SHARED) - ADD_DEFINITIONS(-DCURL_STATICLIB) - ENDIF(NOT CMAKE_BUILD_CURL_SHARED) - SET(CMAKE_CURL_INCLUDES) - SET(CMAKE_CURL_LIBRARIES cmcurl) - IF(CMAKE_TESTS_CDASH_SERVER) - SET(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php") - ENDIF(CMAKE_TESTS_CDASH_SERVER) - ADD_SUBDIRECTORY(Utilities/cmcurl) + endif(NOT CURL_FOUND) + set(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS}) + set(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES}) + else(CMAKE_USE_SYSTEM_CURL) + set(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER}) + set(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES}) + set(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES}) + option(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE) + if(NOT CMAKE_BUILD_CURL_SHARED) + add_definitions(-DCURL_STATICLIB) + endif(NOT CMAKE_BUILD_CURL_SHARED) + set(CMAKE_CURL_INCLUDES) + set(CMAKE_CURL_LIBRARIES cmcurl) + if(CMAKE_TESTS_CDASH_SERVER) + set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php") + endif(CMAKE_TESTS_CDASH_SERVER) + add_subdirectory(Utilities/cmcurl) CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty") - ENDIF(CMAKE_USE_SYSTEM_CURL) + endif(CMAKE_USE_SYSTEM_CURL) #--------------------------------------------------------------------- # Build Compress library for CTest. - SET(CMAKE_COMPRESS_INCLUDES + set(CMAKE_COMPRESS_INCLUDES "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress") - SET(CMAKE_COMPRESS_LIBRARIES "cmcompress") - ADD_SUBDIRECTORY(Utilities/cmcompress) + set(CMAKE_COMPRESS_LIBRARIES "cmcompress") + add_subdirectory(Utilities/cmcompress) CMAKE_SET_TARGET_FOLDER(cmcompress "Utilities/3rdParty") - IF(CMAKE_USE_SYSTEM_BZIP2) - FIND_PACKAGE(BZip2) - ELSE() - SET(BZIP2_INCLUDE_DIR + if(CMAKE_USE_SYSTEM_BZIP2) + find_package(BZip2) + else() + set(BZIP2_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2") - SET(BZIP2_LIBRARIES cmbzip2) - ADD_SUBDIRECTORY(Utilities/cmbzip2) + set(BZIP2_LIBRARIES cmbzip2) + add_subdirectory(Utilities/cmbzip2) CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty") - ENDIF() + endif() #--------------------------------------------------------------------- # Build or use system libarchive for CMake and CTest. - IF(CMAKE_USE_SYSTEM_LIBARCHIVE) - IF(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) # added in 2.8.3 - FIND_PACKAGE(LibArchive) - ELSE() - INCLUDE(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake) - ENDIF() - IF(NOT LibArchive_FOUND) - MESSAGE(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!") - ENDIF() - SET(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS}) - SET(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES}) - ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE) - SET(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES}) - SET(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES}) - ADD_DEFINITIONS(-DLIBARCHIVE_STATIC) - SET(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle") - SET(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL") - SET(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support") - SET(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support") - SET(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support") - ADD_SUBDIRECTORY(Utilities/cmlibarchive) + if(CMAKE_USE_SYSTEM_LIBARCHIVE) + if(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) # added in 2.8.3 + find_package(LibArchive) + else() + include(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake) + endif() + if(NOT LibArchive_FOUND) + message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!") + endif() + set(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS}) + set(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES}) + else(CMAKE_USE_SYSTEM_LIBARCHIVE) + set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES}) + set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES}) + add_definitions(-DLIBARCHIVE_STATIC) + set(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle") + set(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL") + set(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support") + set(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support") + set(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support") + add_subdirectory(Utilities/cmlibarchive) CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty") - SET(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES}) - ENDIF(CMAKE_USE_SYSTEM_LIBARCHIVE) + set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES}) + endif(CMAKE_USE_SYSTEM_LIBARCHIVE) #--------------------------------------------------------------------- # Build expat library for CMake and CTest. - IF(CMAKE_USE_SYSTEM_EXPAT) - FIND_PACKAGE(EXPAT) - IF(NOT EXPAT_FOUND) - MESSAGE(FATAL_ERROR + if(CMAKE_USE_SYSTEM_EXPAT) + find_package(EXPAT) + if(NOT EXPAT_FOUND) + message(FATAL_ERROR "CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!") - ENDIF(NOT EXPAT_FOUND) - SET(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS}) - SET(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES}) - ELSE(CMAKE_USE_SYSTEM_EXPAT) - SET(CMAKE_EXPAT_INCLUDES) - SET(CMAKE_EXPAT_LIBRARIES cmexpat) - ADD_SUBDIRECTORY(Utilities/cmexpat) + endif(NOT EXPAT_FOUND) + set(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS}) + set(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES}) + else(CMAKE_USE_SYSTEM_EXPAT) + set(CMAKE_EXPAT_INCLUDES) + set(CMAKE_EXPAT_LIBRARIES cmexpat) + add_subdirectory(Utilities/cmexpat) CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty") - ENDIF(CMAKE_USE_SYSTEM_EXPAT) + endif(CMAKE_USE_SYSTEM_EXPAT) #--------------------------------------------------------------------- # Build XMLRPC library for CMake and CTest. - IF(CTEST_USE_XMLRPC) - FIND_PACKAGE(XMLRPC QUIET REQUIRED libwww-client) - IF(NOT XMLRPC_FOUND) - MESSAGE(FATAL_ERROR + if(CTEST_USE_XMLRPC) + find_package(XMLRPC QUIET REQUIRED libwww-client) + if(NOT XMLRPC_FOUND) + message(FATAL_ERROR "CTEST_USE_XMLRPC is ON but xmlrpc is not found!") - ENDIF(NOT XMLRPC_FOUND) - SET(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS}) - SET(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES}) - ENDIF(CTEST_USE_XMLRPC) + endif(NOT XMLRPC_FOUND) + set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS}) + set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES}) + endif(CTEST_USE_XMLRPC) #--------------------------------------------------------------------- # Use curses? - IF (UNIX) + if (UNIX) # there is a bug in the Syllable libraries which makes linking ccmake fail, Alex - IF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) - SET(CURSES_NEED_NCURSES TRUE) - FIND_PACKAGE(Curses QUIET) - IF (CURSES_LIBRARY) - OPTION(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON) - ELSE (CURSES_LIBRARY) - MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be built.") - SET(BUILD_CursesDialog 0) - ENDIF (CURSES_LIBRARY) - ELSE(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) - SET(BUILD_CursesDialog 0) - ENDIF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) - ELSE (UNIX) - SET(BUILD_CursesDialog 0) - ENDIF (UNIX) - IF(BUILD_CursesDialog) - ADD_SUBDIRECTORY(Source/CursesDialog/form) - ENDIF(BUILD_CursesDialog) -ENDMACRO (CMAKE_BUILD_UTILITIES) + if(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) + set(CURSES_NEED_NCURSES TRUE) + find_package(Curses QUIET) + if (CURSES_LIBRARY) + option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON) + else (CURSES_LIBRARY) + message("Curses libraries were not found. Curses GUI for CMake will not be built.") + set(BUILD_CursesDialog 0) + endif (CURSES_LIBRARY) + else(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) + set(BUILD_CursesDialog 0) + endif(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) + else (UNIX) + set(BUILD_CursesDialog 0) + endif (UNIX) + if(BUILD_CursesDialog) + add_subdirectory(Source/CursesDialog/form) + endif(BUILD_CursesDialog) +endmacro (CMAKE_BUILD_UTILITIES) #----------------------------------------------------------------------- -IF(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") - EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} +if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") + execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dumpversion OUTPUT_VARIABLE _GXX_VERSION ) - STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" + string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" _GXX_VERSION_SHORT ${_GXX_VERSION}) - IF(_GXX_VERSION_SHORT EQUAL 33) - MESSAGE(FATAL_ERROR + if(_GXX_VERSION_SHORT EQUAL 33) + message(FATAL_ERROR "GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n" "Please use GXX 4.2 or greater to build CMake on OpenBSD\n" "${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}") - ENDIF() -ENDIF() + endif() +endif() #----------------------------------------------------------------------- # The main section of the CMakeLists file # #----------------------------------------------------------------------- -INCLUDE(Source/CMakeVersion.cmake) +include(Source/CMakeVersion.cmake) # Releases define a small tweak level. -IF("${CMake_VERSION_TWEAK}" VERSION_LESS 20000000) - SET(CMake_VERSION_IS_RELEASE 1) - SET(CMake_VERSION_SOURCE "") -ELSE() - SET(CMake_VERSION_IS_RELEASE 0) - INCLUDE(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake) -ENDIF() +if("${CMake_VERSION_TWEAK}" VERSION_LESS 20000000) + set(CMake_VERSION_IS_RELEASE 1) + set(CMake_VERSION_SOURCE "") +else() + set(CMake_VERSION_IS_RELEASE 0) + include(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake) +endif() # Compute the full version string. -SET(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}) -IF(${CMake_VERSION_TWEAK} GREATER 0) - SET(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK}) -ENDIF() -IF(CMake_VERSION_RC) - SET(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC}) -ENDIF() -IF(CMake_VERSION_SOURCE) - SET(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE}) -ENDIF() +set(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}) +if(${CMake_VERSION_TWEAK} GREATER 0) + set(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK}) +endif() +if(CMake_VERSION_RC) + set(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC}) +endif() +if(CMake_VERSION_SOURCE) + set(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE}) +endif() # Include the standard Dart testing module -ENABLE_TESTING() -INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake) +enable_testing() +include (${CMAKE_ROOT}/Modules/Dart.cmake) # Set up test-time configuration. -SET_DIRECTORY_PROPERTIES(PROPERTIES +set_directory_properties(PROPERTIES TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake") # where to write the resulting executables and libraries -SET(BUILD_SHARED_LIBS OFF) -SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.") -SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL +set(BUILD_SHARED_LIBS OFF) +set(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.") +set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL "Where to put the libraries for CMake") # The CMake executables usually do not need any rpath to run in the build or # install tree. -SET(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.") +set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.") -SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING +set(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING "Install location for data (relative to prefix).") -SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING +set(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING "Install location for documentation (relative to prefix).") -SET(CMAKE_MAN_DIR "/man" CACHE STRING +set(CMAKE_MAN_DIR "/man" CACHE STRING "Install location for man pages (relative to prefix).") -MARK_AS_ADVANCED(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR) -IF(CYGWIN AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") +mark_as_advanced(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR) +if(CYGWIN AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") # Force doc, data and man dirs to conform to cygwin layout. - SET(CMAKE_DOC_DIR "/share/doc/cmake-${CMake_VERSION}") - SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}") - SET(CMAKE_MAN_DIR "/share/man") + set(CMAKE_DOC_DIR "/share/doc/cmake-${CMake_VERSION}") + set(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}") + set(CMAKE_MAN_DIR "/share/man") # let the user know we just forced these values - MESSAGE(STATUS "Setup for Cygwin packaging") - MESSAGE(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}") - MESSAGE(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}") - MESSAGE(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}") -ENDIF() -STRING(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}") -STRING(REGEX REPLACE "^/" "" CMake_DOC_DEST "${CMAKE_DOC_DIR}") + message(STATUS "Setup for Cygwin packaging") + message(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}") + message(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}") + message(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}") +endif() +string(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}") +string(REGEX REPLACE "^/" "" CMake_DOC_DEST "${CMAKE_DOC_DIR}") -IF(BUILD_TESTING) - INCLUDE(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake) -ENDIF() +if(BUILD_TESTING) + include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake) +endif() # include special compile flags for some compilers -INCLUDE(CompileFlags.cmake) +include(CompileFlags.cmake) # no clue why we are testing for this here -INCLUDE(CheckSymbolExists) +include(CheckSymbolExists) CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV) CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE) @@ -507,9 +507,9 @@ CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE) # to a cdash4simpletest database. In these cases, the CDash dashboards # should be run first. # -IF("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x") - SET(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash") -ENDIF("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x") +if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x") + set(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash") +endif("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x") # build the utilities (a macro defined in this file) CMAKE_BUILD_UTILITIES() @@ -519,35 +519,35 @@ CMAKE_BUILD_UTILITIES() # which isn't in the default linker search path. So without RPATH ccmake # doesn't run and the build doesn't succeed since ccmake is executed for # generating the documentation. -IF(BUILD_CursesDialog) - GET_FILENAME_COMPONENT(_CURSES_DIR "${CURSES_LIBRARY}" PATH) - SET(CURSES_NEED_RPATH FALSE) - IF(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64") - SET(CURSES_NEED_RPATH TRUE) - ENDIF(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64") -ENDIF(BUILD_CursesDialog) +if(BUILD_CursesDialog) + get_filename_component(_CURSES_DIR "${CURSES_LIBRARY}" PATH) + set(CURSES_NEED_RPATH FALSE) + if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64") + set(CURSES_NEED_RPATH TRUE) + endif(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64") +endif(BUILD_CursesDialog) -IF(BUILD_QtDialog) - IF(APPLE) - SET(CMAKE_BUNDLE_NAME +if(BUILD_QtDialog) + if(APPLE) + set(CMAKE_BUNDLE_NAME "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}-${CMake_VERSION_PATCH}") - SET(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}") + set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}") # make sure CMAKE_INSTALL_PREFIX ends in / - STRING(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN) - MATH(EXPR LEN "${LEN} -1" ) - STRING(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH) - IF(NOT "${ENDCH}" STREQUAL "/") - SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/") - ENDIF(NOT "${ENDCH}" STREQUAL "/") - SET(CMAKE_INSTALL_PREFIX + string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN) + math(EXPR LEN "${LEN} -1" ) + string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH) + if(NOT "${ENDCH}" STREQUAL "/") + set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/") + endif(NOT "${ENDCH}" STREQUAL "/") + set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents") - ENDIF(APPLE) + endif(APPLE) - SET(QT_NEED_RPATH FALSE) - IF(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") - SET(QT_NEED_RPATH TRUE) - ENDIF(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") -ENDIF(BUILD_QtDialog) + set(QT_NEED_RPATH FALSE) + if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") + set(QT_NEED_RPATH TRUE) + endif(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") +endif(BUILD_QtDialog) # The same might be true on other systems for other libraries. @@ -555,43 +555,43 @@ ENDIF(BUILD_QtDialog) # since this one has much better RPATH features than cmake 2.2. # The executables are then built with the RPATH for the libraries outside # the build tree, which is both the build and the install RPATH. -IF (UNIX) - IF( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB +if (UNIX) + if( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH) - SET(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.") - SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) - ENDIF(CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB + set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.") + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + endif(CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH) -ENDIF (UNIX) +endif (UNIX) # add the uninstall support -CONFIGURE_FILE( +configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" @ONLY) -ADD_CUSTOM_TARGET(uninstall +add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") -INCLUDE (CMakeCPack.cmake) +include (CMakeCPack.cmake) # setup some Testing support (a macro defined in this file) CMAKE_SETUP_TESTING() -CONFIGURE_FILE( +configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/DartLocal.conf.in" "${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf" COPYONLY) -OPTION(CMAKE_STRICT +option(CMAKE_STRICT "Perform strict testing to record property and variable access. Can be used to report any undefined properties or variables" OFF) -MARK_AS_ADVANCED(CMAKE_STRICT) +mark_as_advanced(CMAKE_STRICT) # build the remaining subdirectories -ADD_SUBDIRECTORY(Source) -ADD_SUBDIRECTORY(Utilities) -ADD_SUBDIRECTORY(Tests) +add_subdirectory(Source) +add_subdirectory(Utilities) +add_subdirectory(Tests) if(BUILD_TESTING) CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests") @@ -600,14 +600,14 @@ CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat") CMAKE_SET_TARGET_FOLDER(documentation "Documentation") # add a test -ADD_TEST(SystemInformationNew "${CMAKE_CMAKE_COMMAND}" +add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}" --system-information -G "${CMAKE_TEST_GENERATOR}" ) # Install license file as it requires. -INSTALL(FILES Copyright.txt DESTINATION ${CMake_DOC_DEST}) +install(FILES Copyright.txt DESTINATION ${CMake_DOC_DEST}) # Install script directories. -INSTALL( +install( DIRECTORY Modules Templates DESTINATION "${CMake_DATA_DEST}" FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ @@ -620,7 +620,7 @@ INSTALL( ) # process docs related install -ADD_SUBDIRECTORY(Docs) +add_subdirectory(Docs) #----------------------------------------------------------------------- # End of the main section of the CMakeLists file @@ -631,4 +631,4 @@ ADD_SUBDIRECTORY(Docs) # to compute the location of the "cmake" executable. We set it here # so that those CMake versions can find it. We wait until after all # the add_subdirectory() calls to avoid affecting the subdirectories. -SET(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR}) +set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR}) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index aaf551a85..92eacd8e3 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -21,5 +21,5 @@ set(CTEST_CDASH_QUERY_VERSION TRUE) # use old trigger stuff so that cmake 2.4 and below will not # get errors on trigger -SET (TRIGGER_SITE +set (TRIGGER_SITE "http://public.kitware.com/cgi-bin/Submit-CMake-TestingResults.cgi") diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index 982919198..52173f3e2 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -1,8 +1,8 @@ -SET(CTEST_CUSTOM_ERROR_MATCH +set(CTEST_CUSTOM_ERROR_MATCH ${CTEST_CUSTOM_ERROR_MATCH} "ERROR:") -SET(CTEST_CUSTOM_WARNING_EXCEPTION +set(CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} "xtree.[0-9]+. : warning C4702: unreachable code" "warning LNK4221" @@ -56,21 +56,21 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION "[0-9,]+ warnings? generated." ) -IF(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode") - SET(CTEST_CUSTOM_COVERAGE_EXCLUDE +if(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode") + set(CTEST_CUSTOM_COVERAGE_EXCLUDE ${CTEST_CUSTOM_COVERAGE_EXCLUDE} "XCode" ) -ENDIF (NOT "@CMAKE_GENERATOR@" MATCHES "Xcode") +endif (NOT "@CMAKE_GENERATOR@" MATCHES "Xcode") -IF(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop") - SET(CTEST_CUSTOM_COVERAGE_EXCLUDE +if(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop") + set(CTEST_CUSTOM_COVERAGE_EXCLUDE ${CTEST_CUSTOM_COVERAGE_EXCLUDE} "Kdevelop" ) -ENDIF (NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop") +endif (NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop") -SET(CTEST_CUSTOM_COVERAGE_EXCLUDE +set(CTEST_CUSTOM_COVERAGE_EXCLUDE ${CTEST_CUSTOM_COVERAGE_EXCLUDE} # Exclude kwsys files from coverage results. They are reported diff --git a/CompileFlags.cmake b/CompileFlags.cmake index 65f4c693c..f144337c3 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -13,52 +13,52 @@ #----------------------------------------------------------------------------- # set some special flags for different compilers # -IF(CMAKE_GENERATOR MATCHES "Visual Studio 7") - SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1) -ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7") -IF(CMAKE_GENERATOR MATCHES "Visual Studio 6") - SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1) -ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6") -INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) +if(CMAKE_GENERATOR MATCHES "Visual Studio 7") + set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) +endif(CMAKE_GENERATOR MATCHES "Visual Studio 7") +if(CMAKE_GENERATOR MATCHES "Visual Studio 6") + set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) +endif(CMAKE_GENERATOR MATCHES "Visual Studio 6") +include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) -IF(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") - SET(_INTEL_WINDOWS 1) -ENDIF() +if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") + set(_INTEL_WINDOWS 1) +endif() # Disable deprecation warnings for standard C functions. # really only needed for newer versions of VS, but should # not hurt other versions, and this will work into the # future -IF(MSVC OR _INTEL_WINDOWS) - ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) -ELSE() -ENDIF() +if(MSVC OR _INTEL_WINDOWS) + add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) +else() +endif() #silence duplicate symbol warnings on AIX -IF(CMAKE_SYSTEM MATCHES "AIX.*") - IF(NOT CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ") - ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) -ENDIF(CMAKE_SYSTEM MATCHES "AIX.*") +if(CMAKE_SYSTEM MATCHES "AIX.*") + if(NOT CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ") + endif(NOT CMAKE_COMPILER_IS_GNUCXX) +endif(CMAKE_SYSTEM MATCHES "AIX.*") -IF(CMAKE_SYSTEM MATCHES "IRIX.*") - IF(NOT CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include") - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15") - ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) -ENDIF(CMAKE_SYSTEM MATCHES "IRIX.*") +if(CMAKE_SYSTEM MATCHES "IRIX.*") + if(NOT CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15") + endif(NOT CMAKE_COMPILER_IS_GNUCXX) +endif(CMAKE_SYSTEM MATCHES "IRIX.*") -IF(CMAKE_SYSTEM MATCHES "OSF1-V.*") - IF(NOT CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") - ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) -ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*") +if(CMAKE_SYSTEM MATCHES "OSF1-V.*") + if(NOT CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") + endif(NOT CMAKE_COMPILER_IS_GNUCXX) +endif(CMAKE_SYSTEM MATCHES "OSF1-V.*") # use the ansi CXX compile flag for building cmake -IF (CMAKE_ANSI_CXXFLAGS) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") -ENDIF (CMAKE_ANSI_CXXFLAGS) +if (CMAKE_ANSI_CXXFLAGS) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") +endif (CMAKE_ANSI_CXXFLAGS) -IF (CMAKE_ANSI_CFLAGS) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") -ENDIF (CMAKE_ANSI_CFLAGS) +if (CMAKE_ANSI_CFLAGS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") +endif (CMAKE_ANSI_CFLAGS) diff --git a/Docs/CMakeLists.txt b/Docs/CMakeLists.txt index b04b32d5e..a5e91c9d1 100644 --- a/Docs/CMakeLists.txt +++ b/Docs/CMakeLists.txt @@ -1,4 +1,4 @@ string(REGEX REPLACE "^/(.*)" "\\1" REL_CMAKE_DATA_DIR "${CMAKE_DATA_DIR}") install(FILES cmake-help.vim cmake-indent.vim cmake-syntax.vim DESTINATION ${REL_CMAKE_DATA_DIR}/editors/vim) install(FILES cmake-mode.el DESTINATION ${REL_CMAKE_DATA_DIR}/editors/emacs) -ADD_SUBDIRECTORY (bash-completion) +add_subdirectory (bash-completion) diff --git a/Modules/AddFileDependencies.cmake b/Modules/AddFileDependencies.cmake index f971e37f5..af7f42f53 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 (_deps) + set(_deps ${ARGN}) + endif (_deps) - SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}") + set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}") -ENDMACRO(ADD_FILE_DEPENDENCIES) +endmacro(ADD_FILE_DEPENDENCIES) 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 " -o ") +set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT " -o ") -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..69554e4cc 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(UNIX) + set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj) +endif(UNIX) -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("${CMAKE_BASE_NAME}" STREQUAL "as") # 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) +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) +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) +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 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(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS) # 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(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ") +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(NOT CMAKE_NO_BUILD_TYPE) + 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(NOT CMAKE_NOT_USING_CONFIG_FLAGS) -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 " -o -c ") -ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT) +if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT) + set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT " -o -c ") +endif(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT) -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 " cr " " ") -ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY) +endif(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY) -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 " -o ") -ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE) +endif(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE) -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(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY) -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(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE) -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 " /c /Fo ") +set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT " /c /Fo ") -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/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake index 60dcb6c08..90ad12e02 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(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(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() + 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) + 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("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$") + 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("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$") + 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(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) -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 839c21d5a..6888636b9 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_HAS_ANSI_STRING_STREAM - has -# 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(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 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(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) 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..6166ec0c1 100644 --- a/Modules/CMakeCCompiler.cmake.in +++ b/Modules/CMakeCCompiler.cmake.in @@ -1,53 +1,53 @@ -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_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") +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) +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) # 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(CMAKE_C_SIZEOF_DATA_PTR) -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(CMAKE_C_COMPILER_ABI) -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@") +set(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@") @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/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake index fab580731..f0b7fe87b 100644 --- a/Modules/CMakeCInformation.cmake +++ b/Modules/CMakeCInformation.cmake @@ -20,60 +20,60 @@ # 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(UNIX) + set(CMAKE_C_OUTPUT_EXTENSION .obj) +endif(UNIX) -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(CMAKE_C_COMPILER_ID) -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(CMAKE_COMPILER_IS_GNUCC) # 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(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) # 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(CMAKE_C_COMPILER_ID) +if (NOT _INCLUDED_FILE) + include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) -ENDIF (NOT _INCLUDED_FILE) +endif (NOT _INCLUDED_FILE) # 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 (NOT _INCLUDED_FILE) -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 @@ -81,58 +81,58 @@ ENDIF() # 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) +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}") +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(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 "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(NOT CMAKE_NO_BUILD_TYPE) + 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(NOT CMAKE_NOT_USING_CONFIG_FLAGS) -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(CMAKE_C_STANDARD_LIBRARIES_INIT) -INCLUDE(CMakeCommonLanguageInclude) +include(CMakeCommonLanguageInclude) # now define the following rule variables @@ -162,58 +162,58 @@ INCLUDE(CMakeCommonLanguageInclude) # 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 " -o ") -ENDIF(NOT CMAKE_C_CREATE_SHARED_LIBRARY) +endif(NOT CMAKE_C_CREATE_SHARED_LIBRARY) # 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(NOT CMAKE_C_CREATE_SHARED_MODULE) # 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 " cr ") -ENDIF() -IF(NOT DEFINED CMAKE_C_ARCHIVE_APPEND) - SET(CMAKE_C_ARCHIVE_APPEND " r ") -ENDIF() -IF(NOT DEFINED CMAKE_C_ARCHIVE_FINISH) - SET(CMAKE_C_ARCHIVE_FINISH " ") -ENDIF() +if(NOT DEFINED CMAKE_C_ARCHIVE_CREATE) + set(CMAKE_C_ARCHIVE_CREATE " cr ") +endif() +if(NOT DEFINED CMAKE_C_ARCHIVE_APPEND) + set(CMAKE_C_ARCHIVE_APPEND " r ") +endif() +if(NOT DEFINED CMAKE_C_ARCHIVE_FINISH) + set(CMAKE_C_ARCHIVE_FINISH " ") +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 " -o -c ") -ENDIF(NOT CMAKE_C_COMPILE_OBJECT) +endif(NOT CMAKE_C_COMPILE_OBJECT) -IF(NOT CMAKE_C_LINK_EXECUTABLE) - SET(CMAKE_C_LINK_EXECUTABLE +if(NOT CMAKE_C_LINK_EXECUTABLE) + set(CMAKE_C_LINK_EXECUTABLE " -o ") -ENDIF(NOT CMAKE_C_LINK_EXECUTABLE) +endif(NOT CMAKE_C_LINK_EXECUTABLE) -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(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG) -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(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP) -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(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG) -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..3cef7f82d 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -1,54 +1,54 @@ -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_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") +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) +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) # 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(CMAKE_CXX_SIZEOF_DATA_PTR) -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(CMAKE_CXX_COMPILER_ABI) -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@") +set(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@") @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/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake index 7d38c64b8..961d9cddf 100644 --- a/Modules/CMakeCXXInformation.cmake +++ b/Modules/CMakeCXXInformation.cmake @@ -20,59 +20,59 @@ # 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(UNIX) + set(CMAKE_CXX_OUTPUT_EXTENSION .obj) +endif(UNIX) -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(CMAKE_CXX_COMPILER_ID) -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(CMAKE_COMPILER_IS_GNUCXX) # 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(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) # 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(CMAKE_CXX_COMPILER_ID) +if (NOT _INCLUDED_FILE) + include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) -ENDIF (NOT _INCLUDED_FILE) +endif (NOT _INCLUDED_FILE) # 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 (NOT _INCLUDED_FILE) -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 @@ -80,150 +80,150 @@ ENDIF() # 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(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS) -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(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC) -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(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE) -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(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL) -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(NOT CMAKE_SHARED_LIBRARY_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(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(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -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(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG) -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(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP) -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(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG) -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(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG) -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(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP) -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(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG) -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(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH) -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(NOT CMAKE_INCLUDE_FLAG_CXX) -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(NOT CMAKE_INCLUDE_FLAG_SEP_CXX) # 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(NOT CMAKE_MODULE_EXISTS) # 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(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS) -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(NOT CMAKE_SHARED_MODULE_CXX_FLAGS) # 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(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS) + 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(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS) +endforeach(type) # 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}") +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 +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 "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(NOT CMAKE_NOT_USING_CONFIG_FLAGS) -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(CMAKE_CXX_STANDARD_LIBRARIES_INIT) -INCLUDE(CMakeCommonLanguageInclude) +include(CMakeCommonLanguageInclude) # now define the following rules: # CMAKE_CXX_CREATE_SHARED_LIBRARY @@ -252,41 +252,41 @@ INCLUDE(CMakeCommonLanguageInclude) # 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 " -o ") -ENDIF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) +endif(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) # 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(NOT CMAKE_CXX_CREATE_SHARED_MODULE) # 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 " cr ") -ENDIF() -IF(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND) - SET(CMAKE_CXX_ARCHIVE_APPEND " r ") -ENDIF() -IF(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH) - SET(CMAKE_CXX_ARCHIVE_FINISH " ") -ENDIF() +if(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE) + set(CMAKE_CXX_ARCHIVE_CREATE " cr ") +endif() +if(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND) + set(CMAKE_CXX_ARCHIVE_APPEND " r ") +endif() +if(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH) + set(CMAKE_CXX_ARCHIVE_FINISH " ") +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 " -o -c ") -ENDIF(NOT CMAKE_CXX_COMPILE_OBJECT) +endif(NOT CMAKE_CXX_COMPILE_OBJECT) -IF(NOT CMAKE_CXX_LINK_EXECUTABLE) - SET(CMAKE_CXX_LINK_EXECUTABLE +if(NOT CMAKE_CXX_LINK_EXECUTABLE) + set(CMAKE_CXX_LINK_EXECUTABLE " -o ") -ENDIF(NOT CMAKE_CXX_LINK_EXECUTABLE) +endif(NOT CMAKE_CXX_LINK_EXECUTABLE) -MARK_AS_ADVANCED( +mark_as_advanced( CMAKE_BUILD_TOOL CMAKE_VERBOSE_MAKEFILE CMAKE_CXX_FLAGS @@ -295,5 +295,5 @@ 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..b52641c53 100644 --- a/Modules/CMakeClDeps.cmake +++ b/Modules/CMakeClDeps.cmake @@ -20,18 +20,18 @@ # 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 +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() + 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() diff --git a/Modules/CMakeCommonLanguageInclude.cmake b/Modules/CMakeCommonLanguageInclude.cmake index aa129de68..99b5f1177 100644 --- a/Modules/CMakeCommonLanguageInclude.cmake +++ b/Modules/CMakeCommonLanguageInclude.cmake @@ -16,72 +16,72 @@ # 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) + endif(NOT CMAKE_NO_BUILD_TYPE) - SET (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING + 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(NOT CMAKE_NOT_USING_CONFIG_FLAGS) # 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 diff --git a/Modules/CMakeDependentOption.cmake b/Modules/CMakeDependentOption.cmake index 8b8dc07fb..98cae45e5 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(${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) 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 7da6ac04a..ad6616cbc 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -14,40 +14,40 @@ # determine the compiler to use for ASM programs -INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake) +include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake) -IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER) +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($ENV{ASM${ASM_DIALECT}} MATCHES ".+") # finally list compilers to try - 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() + 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 + 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() + 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. _cmake_find_compiler(ASM${ASM_DIALECT}) -ELSE(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER) +else(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER) # we only get here if CMAKE_ASM${ASM_DIALECT}_COMPILER was specified using -D or a pre-made CMakeCache.txt # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE @@ -56,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(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) -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 (NOT _CMAKE_TOOLCHAIN_LOCATION) -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(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) + message(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown") +endif(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) @@ -123,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 (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") +endif (NOT _CMAKE_TOOLCHAIN_PREFIX) # 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 (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") +endif (NOT _CMAKE_TOOLCHAIN_PREFIX) # 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 (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") +endif (NOT _CMAKE_TOOLCHAIN_PREFIX) -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(CMAKE_ASM${ASM_DIALECT}_COMPILER) + message(STATUS "Didn't find assembler") +endif(CMAKE_ASM${ASM_DIALECT}_COMPILER) -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 +configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeASM${ASM_DIALECT}Compiler.cmake IMMEDIATE @ONLY) -SET(_CMAKE_ASM_COMPILER) -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..364953791 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(CMAKE_CL_64) + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml) +endif(CMAKE_CL_64) -INCLUDE(CMakeDetermineASMCompiler) -SET(ASM_DIALECT) +include(CMakeDetermineASMCompiler) +set(ASM_DIALECT) diff --git a/Modules/CMakeDetermineASM_NASMCompiler.cmake b/Modules/CMakeDetermineASM_NASMCompiler.cmake index d184c0a81..a9a9e052a 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(NOT CMAKE_ASM_NASM_COMPILER) # 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 3ce968c02..6bed02168 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -31,89 +31,89 @@ # If not already set before, it also sets # _CMAKE_TOOLCHAIN_PREFIX -INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake) +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() +include(Platform/${CMAKE_SYSTEM_NAME}-C OPTIONAL) +if(NOT CMAKE_C_COMPILER_NAMES) + set(CMAKE_C_COMPILER_NAMES cc) +endif() -IF(NOT CMAKE_C_COMPILER) - SET(CMAKE_C_COMPILER_INIT NOTFOUND) +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 ".+") + 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) + 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(NOT CMAKE_C_COMPILER_INIT) - SET(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}cc ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc clang) - ENDIF() + 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(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) + 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) + 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) +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(${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) +if(NOT CMAKE_C_COMPILER_ID_RUN) + set(CMAKE_C_COMPILER_ID_RUN 1) # 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" @@ -122,22 +122,22 @@ IF(NOT CMAKE_C_COMPILER_ID_RUN) ) # 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("${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 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 @@ -146,33 +146,33 @@ 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 (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") # 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-$") + if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) + endif ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") -ENDIF (CMAKE_CROSSCOMPILING +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) +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) # configure variables set in this file for fast reload later on -CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in +configure_file(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in "${CMAKE_PLATFORM_ROOT_BIN}/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 0116d341a..aaabb201c 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -30,42 +30,42 @@ # If not already set before, it also sets # _CMAKE_TOOLCHAIN_PREFIX -INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake) +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() +include(Platform/${CMAKE_SYSTEM_NAME}-CXX OPTIONAL) +if(NOT CMAKE_CXX_COMPILER_NAMES) + set(CMAKE_CXX_COMPILER_NAMES CC) +endif() -IF(NOT CMAKE_CXX_COMPILER) - SET(CMAKE_CXX_COMPILER_INIT NOTFOUND) +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 ".+") + 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) + 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(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() + 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(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 @@ -73,31 +73,31 @@ ELSE(NOT CMAKE_CXX_COMPILER) # 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) + 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) + 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) +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++ @@ -106,45 +106,45 @@ ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION) # 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) +# 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) +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) # 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" ) # 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("${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 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 @@ -153,34 +153,34 @@ 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 (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") # 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-$") + if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") + set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) + endif ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") -ENDIF (CMAKE_CROSSCOMPILING +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) +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) # configure all variables set in this file -CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in +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 ) -SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX") +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index 1c9899e64..b79afdf54 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_DETERMINE_${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_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 ${CMAKE_BINARY_DIR} ${src} CMAKE_FLAGS "${CMAKE_FLAGS}" "-DCMAKE_${lang}_STANDARD_LIBRARIES=" @@ -41,40 +41,40 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src) ) # 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_DETERMINE_${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("${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) - 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(ABI_SIZEOF_DPTR) - 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(ABI_NAME) # 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 +82,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(CMAKE_DETERMINE_${lang}_ABI_COMPILED) + 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(CMAKE_DETERMINE_${lang}_ABI_COMPILED) + endif(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED) +endfunction(CMAKE_DETERMINE_COMPILER_ABI) diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 67f5a5906..6fd0add59 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -16,90 +16,90 @@ # used internally by CMake and should not be included by user code. # If successful, sets CMAKE__COMPILER_ID and CMAKE__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(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}") # 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_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/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(file) + endif(NOT CMAKE_${lang}_COMPILER_ID) + endforeach(flags) # 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(NOT CMAKE_EXECUTABLE_FORMAT) # 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) + 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}" + 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(CMAKE_DETERMINE_COMPILER_ID) #----------------------------------------------------------------------------- # 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(CMAKE_DETERMINE_COMPILER_ID_WRITE) #----------------------------------------------------------------------------- # 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( + if(COMMAND EXECUTE_PROCESS) + execute_process( COMMAND ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_ARG1} ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST} @@ -110,8 +110,8 @@ Id flags: ${testflags} ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT ) - ELSE(COMMAND EXECUTE_PROCESS) - EXEC_PROGRAM( + 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} @@ -120,12 +120,12 @@ Id flags: ${testflags} OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT ) - ENDIF(COMMAND EXECUTE_PROCESS) + endif(COMMAND EXECUTE_PROCESS) # 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 +133,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(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL) # No output files should be inspected. - SET(COMPILER_${lang}_PRODUCED_FILES) - ELSE(CMAKE_${lang}_COMPILER_ID_RESULT) + set(COMPILER_${lang}_PRODUCED_FILES) + else(CMAKE_${lang}_COMPILER_ID_RESULT) # 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 +153,120 @@ ${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 COMPILER_${lang}_PRODUCED_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 + 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) + endforeach(file) - IF(NOT COMPILER_${lang}_PRODUCED_FILES) + 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(NOT COMPILER_${lang}_PRODUCED_FILES) + endif(CMAKE_${lang}_COMPILER_ID_RESULT) # 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(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src) #----------------------------------------------------------------------------- # 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(COMPILER_ID) + 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("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*") + 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("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*") + 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("${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) # 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(COMPILER_ID AND NOT COMPILER_ID_TWICE) # 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(CMAKE_${lang}_COMPILER_ID) # 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(CMAKE_${lang}_COMPILER_ID) + endif(NOT CMAKE_${lang}_COMPILER_ID) # 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("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46") # # 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("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....") # # # 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") +# 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() + endif(NOT CMAKE_EXECUTABLE_FORMAT) + 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(CMAKE_DETERMINE_COMPILER_ID_CHECK lang) #----------------------------------------------------------------------------- # Function to query the compiler vendor. @@ -276,22 +276,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_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang}) + file(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR}) + file(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}) + endif(NOT CMAKE_${lang}_COMPILER_ID_DIR) - FOREACH(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS}) - SET(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}}) - SET(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}}) - 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 +302,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(CMAKE_DETERMINE_COMPILER_ID_VENDOR) diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index 766289ec3..c8e561256 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -19,34 +19,34 @@ # the cmake variable CMAKE_GENERATOR_FC which can be defined by a generator # as a default compiler -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() +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(NOT CMAKE_Fortran_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 ".+") + 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) + 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(NOT CMAKE_Fortran_COMPILER_INIT) + if(NOT CMAKE_Fortran_COMPILER_INIT) # Known compilers: # f77/f90/f95: generic compiler names # g77: GNU Fortran 77 compiler @@ -67,68 +67,68 @@ IF(NOT CMAKE_Fortran_COMPILER) # 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 + 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() + 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(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) + 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} + 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) + endif(CMAKE_Fortran_COMPILER_WITH_PATH) + endif(NOT _CMAKE_USER_Fortran_COMPILER_PATH) +endif(NOT CMAKE_Fortran_COMPILER) -MARK_AS_ADVANCED(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(${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) +if(NOT CMAKE_Fortran_COMPILER_ID_RUN) + set(CMAKE_Fortran_COMPILER_ID_RUN 1) # 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" @@ -137,65 +137,65 @@ IF(NOT CMAKE_Fortran_COMPILER_ID_RUN) ) # 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("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" ) + 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("${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) # 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) + 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) +include(CMakeFindBinUtils) -IF(MSVC_Fortran_ARCHITECTURE_ID) - SET(SET_MSVC_Fortran_ARCHITECTURE_ID - "SET(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})") -ENDIF() +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 +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 ) -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 e899a1e60..f35b9ff5e 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(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_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(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT}) + endif($ENV{JAVA_RUNTIME} 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(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(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT}) + endif($ENV{JAVA_ARCHIVE} MATCHES ".+") - 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(CMAKE_Java_COMPILER_INIT) + find_program(CMAKE_Java_COMPILER NAMES javac PATHS ${Java_BIN_PATH} ) - ENDIF(CMAKE_Java_COMPILER_INIT) + endif(CMAKE_Java_COMPILER_INIT) # 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(CMAKE_Java_RUNTIME_INIT) + find_program(CMAKE_Java_RUNTIME NAMES java PATHS ${Java_BIN_PATH} ) - ENDIF(CMAKE_Java_RUNTIME_INIT) + endif(CMAKE_Java_RUNTIME_INIT) # 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(CMAKE_Java_ARCHIVE_INIT) + 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(CMAKE_Java_ARCHIVE_INIT) +endif(NOT CMAKE_Java_COMPILER) +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 +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") +set(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER") diff --git a/Modules/CMakeDetermineRCCompiler.cmake b/Modules/CMakeDetermineRCCompiler.cmake index 4662e3ad2..41a7af5f4 100644 --- a/Modules/CMakeDetermineRCCompiler.cmake +++ b/Modules/CMakeDetermineRCCompiler.cmake @@ -18,50 +18,50 @@ # 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(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 ".+") # 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(NOT CMAKE_RC_COMPILER_INIT) + endif(CMAKE_GENERATOR_RC) # 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(CMAKE_RC_COMPILER_INIT) + set(CMAKE_RC_COMPILER_LIST rc) + endif(CMAKE_RC_COMPILER_INIT) # 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(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER) +endif(NOT CMAKE_RC_COMPILER) -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 +configure_file(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeRCCompiler.cmake IMMEDIATE) -SET(CMAKE_RC_COMPILER_ENV_VAR "RC") +set(CMAKE_RC_COMPILER_ENV_VAR "RC") diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index c89ccd17d..a72bd5f96 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -42,135 +42,135 @@ # 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() + 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") + if("${val}" GREATER 0) + set(CMAKE_HOST_SYSTEM_PROCESSOR "unknown") + endif("${val}" GREATER 0) + 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(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) # 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. # 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(NOT _INCLUDED_TOOLCHAIN_FILE) - 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(_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 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) +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) +macro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX) + if(NOT ${_PREFIX}_NAME) + set(${_PREFIX}_NAME "UnknownOS") + endif(NOT ${_PREFIX}_NAME) # 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(${_PREFIX}_NAME MATCHES BSD.OS) # 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(${_PREFIX}_NAME MATCHES kFreeBSD) # fix for CYGWIN which has windows version in it - IF(${_PREFIX}_NAME MATCHES CYGWIN) - SET(${_PREFIX}_NAME CYGWIN) - ENDIF(${_PREFIX}_NAME MATCHES CYGWIN) + if(${_PREFIX}_NAME MATCHES CYGWIN) + set(${_PREFIX}_NAME CYGWIN) + endif(${_PREFIX}_NAME MATCHES CYGWIN) # 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(${_PREFIX}_VERSION) -ENDMACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX) +endmacro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX) 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 # 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(PRESET_CMAKE_SYSTEM_NAME) + 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(PRESET_CMAKE_SYSTEM_NAME) # 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(DEFINED CMAKE_TOOLCHAIN_FILE) # 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 + configure_file(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake IMMEDIATE @ONLY) -ENDIF(CMAKE_BINARY_DIR) +endif(CMAKE_BINARY_DIR) diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake index fba071a06..d698ad8b6 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}" ) diff --git a/Modules/CMakeExportBuildSettings.cmake b/Modules/CMakeExportBuildSettings.cmake index 8d316b941..7392e6bec 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(${SETTINGS_FILE} MATCHES ".+") + message(SEND_ERROR "CMAKE_EXPORT_BUILD_SETTINGS called with no argument.") + endif(${SETTINGS_FILE} MATCHES ".+") +endmacro(CMAKE_EXPORT_BUILD_SETTINGS) diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake index 455f95fe3..0fe2abbe5 100644 --- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake +++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake @@ -18,39 +18,39 @@ # 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" ) +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 + 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}) + string(STRIP "${nextLine}" _includePath) + list(APPEND ${_resultIncludeDirs} "${_includePath}") + endforeach(nextLine) - 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 +59,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(nextLine) -ENDMACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang) +endmacro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang) # 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 a5202f402..71537fff3 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -30,46 +30,46 @@ # 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" +else("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio") - 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(NOT CMAKE_RANLIB) - 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" +endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio") # 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(NOT CMAKE_INSTALL_NAME_TOOL) - MARK_AS_ADVANCED(CMAKE_INSTALL_NAME_TOOL) -ENDIF(APPLE) + mark_as_advanced(CMAKE_INSTALL_NAME_TOOL) +endif(APPLE) diff --git a/Modules/CMakeFindCodeBlocks.cmake b/Modules/CMakeFindCodeBlocks.cmake index 23f2c821d..6ca7c1983 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} " ) -ENDIF(CMAKE_CODEBLOCKS_EXECUTABLE) +if(CMAKE_CODEBLOCKS_EXECUTABLE) + set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} " ) +endif(CMAKE_CODEBLOCKS_EXECUTABLE) # 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 86c1a1bc2..37b72fa38 100644 --- a/Modules/CMakeFindEclipseCDT4.cmake +++ b/Modules/CMakeFindEclipseCDT4.cmake @@ -15,42 +15,42 @@ # 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(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() + 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_4.2 "Juno" ) + 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})" @@ -58,28 +58,28 @@ FUNCTION(_FIND_ECLIPSE_VERSION) "3.7 (${_ECLIPSE_VERSION_NAME_3.7})" "4.2 (${_ECLIPSE_VERSION_NAME_4.2})" ) -ENDFUNCTION() +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 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 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..b47f44448 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(EXISTS ${dir}) + endforeach(dir) + endif(APPLE) + endmacro(CMAKE_FIND_FRAMEWORKS) +endif(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED) diff --git a/Modules/CMakeFindKDevelop3.cmake b/Modules/CMakeFindKDevelop3.cmake index 331dc6ef9..dd144842c 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} " ) -ENDIF(CMAKE_KDEVELOP3_EXECUTABLE) +if(CMAKE_KDEVELOP3_EXECUTABLE) + set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} " ) +endif(CMAKE_KDEVELOP3_EXECUTABLE) 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..c56406bb8 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,41 @@ # (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_WORKS TRUE) + 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("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") +endmacro(CMAKE_FORCE_C_COMPILER) -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_WORKS TRUE) + 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("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") +endmacro(CMAKE_FORCE_CXX_COMPILER) -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_WORKS TRUE) + 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("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") +endmacro(CMAKE_FORCE_Fortran_COMPILER) diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in index 53d95525f..d5905123c 100644 --- a/Modules/CMakeFortranCompiler.cmake.in +++ b/Modules/CMakeFortranCompiler.cmake.in @@ -1,52 +1,52 @@ -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_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_ENV_VAR "FC") -SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@) +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) +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) # 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(CMAKE_Fortran_COMPILER_ABI) -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 b965e8368..c63b3dced 100644 --- a/Modules/CMakeFortranInformation.cmake +++ b/Modules/CMakeFortranInformation.cmake @@ -16,40 +16,40 @@ # 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(CMAKE_Fortran_COMPILER_ID) -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(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 RESULT_VARIABLE _INCLUDED_FILE) -ENDIF (NOT _INCLUDED_FILE) +endif (NOT _INCLUDED_FILE) # 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 (NOT _INCLUDED_FILE) -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 @@ -57,122 +57,122 @@ ENDIF() # 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 # 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(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC) -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(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE) -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(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL) # 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(NOT CMAKE_MODULE_EXISTS) # 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_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_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) + 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_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_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 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_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) +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_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}") +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(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 "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 " -o ") -ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY) +endif(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY) # 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(NOT CMAKE_Fortran_CREATE_SHARED_MODULE) # 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 " cr ") -ENDIF() -IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND) - SET(CMAKE_Fortran_ARCHIVE_APPEND " r ") -ENDIF() -IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH) - SET(CMAKE_Fortran_ARCHIVE_FINISH " ") -ENDIF() +if(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE) + set(CMAKE_Fortran_ARCHIVE_CREATE " cr ") +endif() +if(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND) + set(CMAKE_Fortran_ARCHIVE_APPEND " r ") +endif() +if(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH) + set(CMAKE_Fortran_ARCHIVE_FINISH " ") +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 " -c -o ") -ENDIF(NOT CMAKE_Fortran_COMPILE_OBJECT) +endif(NOT CMAKE_Fortran_COMPILE_OBJECT) # 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 " -o ") -ENDIF(NOT CMAKE_Fortran_LINK_EXECUTABLE) +endif(NOT CMAKE_Fortran_LINK_EXECUTABLE) -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(CMAKE_Fortran_STANDARD_LIBRARIES_INIT) -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(NOT CMAKE_NOT_USING_CONFIG_FLAGS) -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..91904d7a5 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_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_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_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(DEFINED CMAKE_RULE_MESSAGES) + 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(CMAKE_GENERATOR MATCHES "Unix Makefiles") +endif(CMAKE_GENERATOR MATCHES "Makefiles") -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(CMAKE_GENERATOR MATCHES "Ninja") # 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(NOT DEFINED CMAKE_INSTALL_PREFIX) # 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(CMAKE_HOST_UNIX) 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(CMAKE_HOST_UNIX) # 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..f0080ecd5 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(${SETTINGS_FILE} MATCHES ".+") + message(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.") + endif(${SETTINGS_FILE} MATCHES ".+") +endmacro(CMAKE_IMPORT_BUILD_SETTINGS) 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 7f812bd32..79208ca51 100644 --- a/Modules/CMakeJavaInformation.cmake +++ b/Modules/CMakeJavaInformation.cmake @@ -18,42 +18,42 @@ # 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) +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 + set(CMAKE_Java_CREATE_STATIC_LIBRARY " -cf -C ${class_files_mask}") # "${class_files_mask}" should really be "" but compling a *.java # file can create more than one *.class file... -ENDIF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY) +endif(NOT CMAKE_Java_CREATE_STATIC_LIBRARY) # 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 " -d ") -ENDIF(NOT CMAKE_Java_COMPILE_OBJECT) +endif(NOT CMAKE_Java_COMPILE_OBJECT) # 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(WIN32 AND NOT CYGWIN) + set(CMAKE_INCLUDE_FLAG_SEP_Java ":") +endif(WIN32 AND NOT CYGWIN) diff --git a/Modules/CMakeMSYSFindMake.cmake b/Modules/CMakeMSYSFindMake.cmake index 29dc2c025..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 +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 61ddb8c6c..9081e68c1 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 +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(CMAKE_SH) -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..457a7ae6d 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 Config.cmake or -config.cmake +# configure_file() command when creating the Config.cmake or -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 and arguments are the input and output file, the same way -# as in CONFIGURE_FILE(). +# as in configure_file(). # # The 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 ConfigVersion.cmake file to . -# 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 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..fa6e81c6c 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(CMAKE_PUSH_CHECK_STATE) -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(CMAKE_POP_CHECK_STATE) 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..2f1387c37 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 " /fo ") -ENDIF(NOT CMAKE_RC_COMPILE_OBJECT) +endif(NOT CMAKE_RC_COMPILE_OBJECT) -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 88b77489b..6f85ccc91 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(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt) +endif(NOT _INCLUDED_SYSTEM_INFO_FILE) # 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(CMAKE_EXTRA_GENERATOR) # 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(NOT CMAKE_MODULE_EXISTS) -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 5a86eb917..9881c9d24 100644 --- a/Modules/CMakeTestCCompiler.cmake +++ b/Modules/CMakeTestCCompiler.cmake @@ -12,16 +12,16 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -INCLUDE(CMakeTestCompilerCommon) +include(CMakeTestCompilerCommon) # 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 +33,55 @@ 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) + set(C_TEST_WAS_RUN 1) +endif(NOT CMAKE_C_COMPILER_WORKS) -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}\" " + 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}\" " "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(NOT CMAKE_C_COMPILER_WORKS) + 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(C_TEST_WAS_RUN) + set(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "") - IF(CMAKE_C_COMPILER_FORCED) + 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) + else(CMAKE_C_COMPILER_FORCED) # Try to identify the ABI and configure it into CMakeCCompiler.cmake - INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) + include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) CMAKE_DETERMINE_COMPILER_ABI(C ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c) - CONFIGURE_FILE( + 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) + 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) -UNSET(__CMAKE_C_COMPILER_OUTPUT) +unset(__CMAKE_C_COMPILER_OUTPUT) diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake index dadec1a65..52eaa3cca 100644 --- a/Modules/CMakeTestCXXCompiler.cmake +++ b/Modules/CMakeTestCXXCompiler.cmake @@ -12,69 +12,69 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -INCLUDE(CMakeTestCompilerCommon) +include(CMakeTestCompilerCommon) # 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) + set(CXX_TEST_WAS_RUN 1) +endif(NOT CMAKE_CXX_COMPILER_WORKS) -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(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 "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(NOT CMAKE_CXX_COMPILER_WORKS) + 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(CXX_TEST_WAS_RUN) + set(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "") - IF(CMAKE_CXX_COMPILER_FORCED) + 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) + else(CMAKE_CXX_COMPILER_FORCED) # Try to identify the ABI and configure it into CMakeCXXCompiler.cmake - INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) + include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp) - CONFIGURE_FILE( + 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) + 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) -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/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake index b2fa16aef..4f711d8e3 100644 --- a/Modules/CMakeTestFortranCompiler.cmake +++ b/Modules/CMakeTestFortranCompiler.cmake @@ -12,90 +12,90 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -INCLUDE(CMakeTestCompilerCommon) +include(CMakeTestCompilerCommon) # 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) + set(FORTRAN_TEST_WAS_RUN 1) +endif(NOT CMAKE_Fortran_COMPILER_WORKS) -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(NOT CMAKE_Fortran_COMPILER_WORKS) + 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(FORTRAN_TEST_WAS_RUN) + set(CMAKE_Fortran_COMPILER_WORKS 1 CACHE INTERNAL "") - IF(CMAKE_Fortran_COMPILER_FORCED) + 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) + else(CMAKE_Fortran_COMPILER_FORCED) # Try to identify the ABI and configure it into CMakeFortranCompiler.cmake - INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.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 " + 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} + 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 + 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 + 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) + 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) - CONFIGURE_FILE( + 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) + 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) 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/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..c55a4c53a 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] @@ -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\\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 c948ff4a0..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 9743c2705..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..790ca2b6a 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(NOT CMAKE_CROSSCOMPILING) -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..c7aba3692 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(NOT CMAKE_CROSSCOMPILING) -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/CPack.cmake b/Modules/CPack.cmake index b79960e02..513e11275 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -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(CPack_CMake_INCLUDED) + set(CPack_CMake_INCLUDED 1) +endif(CPack_CMake_INCLUDED) # 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(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") # 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(NOT DEFINED "${name}") +endmacro(cpack_set_if_not_set) # 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("xxx${var}" MATCHES "xxxCPACK") + endforeach(var ${res}) +endmacro(cpack_encode_variables) # 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_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) +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) +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) cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}") # Root dir: default value should be the string literal "$PROGRAMFILES" @@ -494,7 +494,7 @@ 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 @@ -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(CPACK_MONOLITHIC_INSTALL) # 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(CPACK_MONOLITHIC_INSTALL) +else(DEFINED CPACK_COMPONENTS_ALL) # 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(CPACK_COMPONENTS_LEN EQUAL 1) + set(CPACK_COMPONENTS_LEN) + endif(NOT CPACK_MONOLITHIC_INSTALL) +endif(DEFINED CPACK_COMPONENTS_ALL) # 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 dce34bf3a..d7d3cf84b 100644 --- a/Modules/CPackComponent.cmake +++ b/Modules/CPackComponent.cmake @@ -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(arg_name) + foreach(option ${option_names}) + set(${prefix}_${option} FALSE) + endforeach(option) - 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 (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) # 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(APPENDVAL) + set(${strvar} "${${strvar}})\n") + endif (DEFINED ${var}) +endmacro(cpack_append_variable_set_command) # 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(${CPACK_APP_VALUE_LEN} EQUAL 1) + endif (DEFINED ${var}) +endmacro(cpack_append_string_variable_set_command) # 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(${CPACK_APP_VALUE_LEN} EQUAL 1) + endif (${var}) +endmacro(cpack_append_option_set_command) # 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(COMP) + set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n") + endif(NOT CPACK_COMPONENTS_ALL_SET_BY_USER) + endif(NOT CPACK_MONOLITHIC_INSTALL) 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(CPack_CMake_INCLUDED) +endmacro(cpack_add_component) # 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(CPack_CMake_INCLUDED) +endmacro(cpack_add_component_group) # 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(CPack_CMake_INCLUDED) +endmacro(cpack_add_install_type) -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 (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE}) + 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(CPack_CMake_INCLUDED) +endmacro(cpack_configure_downloads) +endif(NOT CPackComponent_CMake_INCLUDED) diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index bd3b94d74..640cf9a0e 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(CMAKE_BINARY_DIR) -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(NOT UNIX) # CPACK_DEBIAN_PACKAGE_SHLIBDEPS # If specify OFF, only user depends are used -IF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS) - SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) -ENDIF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS) +if(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS) + set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) +endif(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS) -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(FAKEROOT_EXECUTABLE) -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(CPACK_DEBIAN_PACKAGE_DEBUG) # 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(CPACK_DEBIAN_PACKAGE_DEBUG) + if (NOT SHLIBDEPS_RESULT EQUAL 0) + message (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}") + endif (NOT SHLIBDEPS_RESULT EQUAL 0) #Get rid of prefix generated by dpkg-shlibdeps string (REGEX REPLACE "^.*Depends=" "" CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS ${SHLIBDEPS_OUTPUT}) - IF(CPACK_DEBIAN_PACKAGE_DEBUG) - MESSAGE( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}") - ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG) + if(CPACK_DEBIAN_PACKAGE_DEBUG) + message( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}") + endif(CPACK_DEBIAN_PACKAGE_DEBUG) # Remove blank control file # Might not be safe if package actual contain file or directory named debian - FILE(REMOVE_RECURSE "${CPACK_TEMPORARY_DIRECTORY}/debian") + 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) + 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 (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) +else (CPACK_DEBIAN_PACKAGE_SHLIBDEPS) + if(CPACK_DEBIAN_PACKAGE_DEBUG) + message( "CPackDeb Debug: Using only user-provided depends") + endif(CPACK_DEBIAN_PACKAGE_DEBUG) +endif(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) # Let's define the control file found in debian package: @@ -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(NOT CPACK_DEBIAN_PACKAGE_NAME) # 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(NOT CPACK_PACKAGE_VERSION) + set(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION}) +endif(NOT CPACK_DEBIAN_PACKAGE_VERSION) # 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(NOT DPKG_CMD) + execute_process(COMMAND "${DPKG_CMD}" --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE ) -ENDIF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) +endif(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) -# 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(NOT CPACK_DEBIAN_PACKAGE_DEPENDS) # 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(NOT CPACK_PACKAGE_CONTACT) + set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT}) +endif(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER) # 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(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) + set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}) +endif(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION) # 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(NOT CPACK_DEBIAN_PACKAGE_SECTION) # 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(NOT CPACK_DEBIAN_PACKAGE_PRIORITY ) # 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(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) # 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(CPACK_DEBIAN_PACKAGE_DEBUG) # 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(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS) diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 0ac6e17e6..66237d88d 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,22 +239,22 @@ # 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(CMAKE_BINARY_DIR) -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(NOT UNIX) # 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 @@ -262,19 +262,19 @@ IF(RPMBUILD_EXECUTABLE) 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(CPACK_RPM_PACKAGE_DEBUG) +endif(RPMBUILD_EXECUTABLE) -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(NOT RPMBUILD_EXECUTABLE) # 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 @@ -287,37 +287,37 @@ IF(CPACK_RPM_PACKAGE_DEBUG) else (LSB_RELEASE_EXECUTABLE) 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) + message("CPackRPM:Debug: LSB_RELEASE = ${LSB_RELEASE_OUTPUT}") +endif(CPACK_RPM_PACKAGE_DEBUG) # 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(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*") # 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(ALIEN_EXECUTABLE) # 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(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) # # 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(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) # 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(NOT CPACK_RPM_PACKAGE_NAME) # 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(NOT CPACK_PACKAGE_VERSION) + set(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION}) +endif(NOT CPACK_RPM_PACKAGE_VERSION) # Replace '-' in version with '_' # '-' character is an Illegal RPM version character # it is illegal because it is used to separate # RPM "Version" from RPM "Release" -STRING(REPLACE "-" "_" CPACK_RPM_PACKAGE_VERSION ${CPACK_RPM_PACKAGE_VERSION}) +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(CPACK_RPM_PACKAGE_DEBUG) +else(CPACK_RPM_PACKAGE_ARCHITECTURE) + set(TMP_RPM_BUILDARCH "") +endif(CPACK_RPM_PACKAGE_ARCHITECTURE) # 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(NOT CPACK_RPM_PACKAGE_RELEASE) # 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(NOT CPACK_RPM_PACKAGE_LICENSE) # 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(NOT CPACK_RPM_PACKAGE_GROUP) # 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(CPACK_PACKAGE_VENDOR) + set(CPACK_RPM_PACKAGE_VENDOR "unknown") + endif(CPACK_PACKAGE_VENDOR) +endif(NOT CPACK_RPM_PACKAGE_VENDOR) # CPACK_RPM_PACKAGE_SOURCE # The name of the source tarball in case we generate a source RPM @@ -407,35 +407,35 @@ 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 (CPACK_PACKAGE_DESCRIPTION_FILE) + set(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available") + endif (CPACK_PACKAGE_DESCRIPTION_FILE) +endif (NOT CPACK_RPM_PACKAGE_DESCRIPTION) # 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(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_PACKAGE_RELOCATABLE) set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE) @@ -453,57 +453,57 @@ endif(CPACK_RPM_PACKAGE_RELOCATABLE) # 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(CPACK_RPM_PACKAGE_DEBUG) 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(CPACK_RPM_PACKAGE_DEBUG) 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(CPACK_RPM_PACKAGE_DEBUG) 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(CPACK_RPM_PACKAGE_DEBUG) 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(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) # 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(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) +endforeach(_RPM_SPEC_HEADER) # 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(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) # CPACK_RPM_POST_INSTALL_SCRIPT_FILE (or CPACK_RPM__POST_INSTALL_SCRIPT_FILE) # CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE (or CPACK_RPM__POST_UNINSTALL_SCRIPT_FILE) @@ -614,30 +614,30 @@ endif(CPACK_RPM_CHANGELOG_FILE) # 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(CPACK_RPM_PACKAGE_DEBUG) +endif(CPACK_RPM_SPEC_MORE_DEFINE) # 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) +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}") +#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" @@ -666,7 +666,7 @@ endif() # 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 "." ${_RPM_DIRS_TO_OMIT} ) ) +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}" @@ -715,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(CPACK_RPM_PACKAGE_DEBUG) # Create CMake list from CPACK_RPM_INSTALL_FILES string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST) @@ -753,9 +753,9 @@ else() 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(CPACK_RPM_PACKAGE_DEBUG) # Remove trailing space string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST) # Transform endline separated - string into CMake List @@ -774,10 +774,10 @@ if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL) 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) + if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}") message("CPackRPM:Debug: CPACK_RPM_INSTALL_FILES=${CPACK_RPM_INSTALL_FILES}") - ENDIF(CPACK_RPM_PACKAGE_DEBUG) + endif(CPACK_RPM_PACKAGE_DEBUG) else() # reset vars in order to avoid leakage of value(s) from one component to another set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "") @@ -803,28 +803,28 @@ endforeach(F) 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(CPACK_RPM_PACKAGE_DEBUG) # USER generated spec file handling. # We should generate a spec file template: # - either because the user asked for it : CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE # - 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\@ @@ -898,28 +898,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(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE) +endif(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE) # After that we may either use a user provided spec file # or generate one using appropriate variables value. -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(CPACK_RPM_USER_BINARY_SPECFILE) # No User specified spec file, will use the generated spec file - MESSAGE("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}") + 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(CPACK_RPM_USER_BINARY_SPECFILE) -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}" @@ -928,17 +928,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(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) diff --git a/Modules/CPackZIP.cmake b/Modules/CPackZIP.cmake index f80b43903..bf7062a76 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(CMAKE_BINARY_DIR) -FIND_PROGRAM(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramFiles}/WinZip") -IF(ZIP_EXECUTABLE) - SET(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -P \"\" @") - 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 \"\" @") + set(CPACK_ZIP_NEED_QUOTES TRUE) +endif(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 \"\" @") - 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 \"\" @") + set(CPACK_ZIP_NEED_QUOTES TRUE) + 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 \"\" . -i@") - 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 \"\" . -i@") + set(CPACK_ZIP_NEED_QUOTES FALSE) + endif(ZIP_EXECUTABLE) +endif(NOT ZIP_EXECUTABLE) diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake index a32baa223..4e861a92a 100644 --- a/Modules/CTest.cmake +++ b/Modules/CTest.cmake @@ -58,46 +58,46 @@ # (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" +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("${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(BUILD_TESTING) +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(NOT DEFINED "${var}") + endmacro(SET_IF_NOT_SET) - 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(NOT "${val}" MATCHES "^$") + endmacro(SET_IF_SET) - 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(NOT "${val}" MATCHES "^$") + endmacro(SET_IF_SET_AND_NOT_SET) # 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 +107,155 @@ 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(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake") # 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(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") # 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(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") 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(NOT UPDATE_TYPE) - 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(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 "${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT}) - ELSE(UNIX OR BORLAND) - GET_FILENAME_COMPONENT(DART_CXX_NAME + else(UNIX OR BORLAND) + 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(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") 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(DART_CXX_NAME MATCHES "devenv") + set(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}") + endif(NOT BUILDNAME) # 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 "") + 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 --build-dir --output --source --language --") - SET(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name --build-dir --output --target-type --language --") - SET(CTEST_LAUNCH_CUSTOM "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name --build-dir --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) + 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 --build-dir --output --source --language --") + set(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name --build-dir --output --target-type --language --") + set(CTEST_LAUNCH_CUSTOM "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name --build-dir --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) - MARK_AS_ADVANCED( + mark_as_advanced( BZRCOMMAND BZR_UPDATE_OPTIONS COVERAGE_COMMAND @@ -278,9 +278,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(NOT RUN_FROM_DART) +endif(BUILD_TESTING) diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake index bc4d9646a..15be42dac 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(NOT RUN_FROM_CTEST_OR_DART) # 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(CTEST_NEW_FORMAT) + configure_file( ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in ${PROJECT_BINARY_DIR}/DartConfiguration.tcl ) -ENDIF(CTEST_NEW_FORMAT) +endif(CTEST_NEW_FORMAT) # # 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(CMAKE_CONFIGURATION_TYPES) # 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(mode) # 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(testtype) + endforeach(mode) + endif("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)") # 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(NOT _CTEST_TARGETS_ADDED) diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake index 90d04ac66..2f54e392d 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 (CHECK_C_COMPILER_FLAG) diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake index 266933634..3c6e6a9fb 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(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 "-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(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" "${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(${VAR}) + 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(${VAR}) + endif("${VAR}" MATCHES "^${VAR}$") +endmacro(CHECK_C_SOURCE_COMPILES) diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake index feee93a71..a8fb554aa 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(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 "-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(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" "${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(NOT ${VAR}_COMPILED) # 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("${${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") - 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("${${VAR}_EXITCODE}" EQUAL 0) + endif("${VAR}" MATCHES "^${VAR}$") +endmacro(CHECK_C_SOURCE_RUNS) diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake index 19963ea4c..7e763f7fd 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 (CHECK_CXX_COMPILER_FLAG) diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake index 7f7336e5b..d13142362 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(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 "-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(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" "${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(${VAR}) + 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(${VAR}) + endif("${VAR}" MATCHES "^${VAR}$") +endmacro(CHECK_CXX_SOURCE_COMPILES) diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake index cd68d5706..515951741 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(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 "-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(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" "${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(NOT ${VAR}_COMPILED) # 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("${${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") - 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("${${VAR}_EXITCODE}" EQUAL 0) + endif("${VAR}" MATCHES "^${VAR}$") +endmacro(CHECK_CXX_SOURCE_RUNS) diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake index 1b012aefd..ebb3a92d8 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(CHECK_CXX_SYMBOL_EXISTS) diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake index abec9f738..0ccf64a5e 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) @@ -36,7 +36,7 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE) else(CMAKE_REQUIRED_LIBRARIES) set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) endif(CMAKE_REQUIRED_LIBRARIES) - FILE(WRITE + file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f " program TESTFortran diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake index 8c469f012..b9c0f26f8 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(CMAKE_REQUIRED_LIBRARIES) + set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) + endif(CMAKE_REQUIRED_LIBRARIES) + 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(CMAKE_REQUIRED_INCLUDES) + set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES) + endif(CMAKE_REQUIRED_INCLUDES) + 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(${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 "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(${VARIABLE}) + endif("${VARIABLE}" MATCHES "^${VARIABLE}$") +endmacro(CHECK_FUNCTION_EXISTS) diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake index 07a5ef82d..07d4966b9 100644 --- a/Modules/CheckIncludeFile.cmake +++ b/Modules/CheckIncludeFile.cmake @@ -28,24 +28,24 @@ # (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(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 ${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(${ARGC} EQUAL 3) - TRY_COMPILE(${VARIABLE} + try_compile(${VARIABLE} ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} @@ -54,24 +54,24 @@ MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE) "${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}" 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(${ARGC} EQUAL 3) - 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(${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 "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(${VARIABLE}) + endif("${VARIABLE}" MATCHES "^${VARIABLE}$") +endmacro(CHECK_INCLUDE_FILE) diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake index f27d25340..adc39f3cd 100644 --- a/Modules/CheckIncludeFileCXX.cmake +++ b/Modules/CheckIncludeFileCXX.cmake @@ -28,24 +28,24 @@ # (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(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 ${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(${ARGC} EQUAL 3) - TRY_COMPILE(${VARIABLE} + try_compile(${VARIABLE} ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} @@ -54,24 +54,24 @@ MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE) "${CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS}" 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(${ARGC} EQUAL 3) - 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(${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 "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(${VARIABLE}) + endif("${VARIABLE}" MATCHES "^${VARIABLE}$") +endmacro(CHECK_INCLUDE_FILE_CXX) diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake index 6901fbc5d..02e3aac2e 100644 --- a/Modules/CheckIncludeFiles.cmake +++ b/Modules/CheckIncludeFiles.cmake @@ -25,37 +25,37 @@ # (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(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 "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n") - ENDFOREACH(FILE) - SET(CMAKE_CONFIGURABLE_FILE_CONTENT + endforeach(FILE) + 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} @@ -63,20 +63,20 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE) -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(${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 "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(${VARIABLE}) + endif("${VARIABLE}" MATCHES "^${VARIABLE}$") +endmacro(CHECK_INCLUDE_FILES) diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake index 59fca0a32..447e97d75 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(CMAKE_REQUIRED_LIBRARIES) + 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(${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 "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(${VARIABLE}) + endif("${VARIABLE}" MATCHES "^${VARIABLE}$") +endmacro(CHECK_LIBRARY_EXISTS) 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..fb9703ea2 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 (it) - 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 (CHECK_STRUCT_HAS_MEMBER) diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake index e6e677d4f..c843c31e2 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(CHECK_SYMBOL_EXISTS) -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(CMAKE_REQUIRED_LIBRARIES) + set(CHECK_SYMBOL_EXISTS_LIBS) + endif(CMAKE_REQUIRED_LIBRARIES) + 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(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_SYMBOL_EXISTS_INCLUDES) + endif(CMAKE_REQUIRED_INCLUDES) + foreach(FILE ${FILES}) + set(CMAKE_CONFIGURABLE_FILE_CONTENT "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n") - ENDFOREACH(FILE) - SET(CMAKE_CONFIGURABLE_FILE_CONTENT + endforeach(FILE) + 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(${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 "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(${VARIABLE}) + endif("${VARIABLE}" MATCHES "^${VARIABLE}$") +endmacro(_CHECK_SYMBOL_EXISTS) diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake index 7d6c7945d..48e848b31 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(CMAKE_REQUIRED_LIBRARIES) + set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES) + endif(CMAKE_REQUIRED_LIBRARIES) + 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(${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 "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(${VARIABLE}) + endif("${VARIABLE}" MATCHES "^${VARIABLE}$") +endmacro(CHECK_VARIABLE_EXISTS) 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/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..4f316f6e8 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 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 " -S -o ") -SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") +set(CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S -o ") +set(CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") 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 " -S -o ") -SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") +set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -S -o ") +set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") 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..0dd7b0d64 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") -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(UNIX) + set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm) +endif(UNIX) diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index 4be91d084..bca86a0f4 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") -SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") -SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S -o ") +set(CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") +set(CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S -o ") diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index ff01a81f6..354bb1759 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") -SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") -SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -S -o ") +set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") +set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -S -o ") 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..371e23373 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") # 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(type) diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake index a1a3ae118..668ddaea5 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") # 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(type) -SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") -SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S -o ") +set(CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") +set(CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S -o ") diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake index 702e42458..d912eefcd 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") # 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(type) -SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") -SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -S -o ") +set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") +set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -S -o ") # 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 " -xar -o " " ") diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake index 86d6def34..223a6c66a 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") +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..178dd0c5e 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") diff --git a/Modules/Compiler/XL-ASM.cmake b/Modules/Compiler/XL-ASM.cmake index e5d4ffa85..95af2ea53 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") -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 " -+ -o -c ") 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") # [=] 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/Dart.cmake b/Modules/Dart.cmake index e85f093ce..97addcc2a 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(BUILD_TESTING) # 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,25 +44,25 @@ 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 @@ -73,10 +73,10 @@ IF(BUILD_TESTING) 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(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in") # # Section #2: @@ -84,18 +84,18 @@ IF(BUILD_TESTING) # 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(HAVE_DART) - 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(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(RUN_FROM_CTEST_OR_DART 1) + include(CTestTargets) + set(RUN_FROM_CTEST_OR_DART) +endif(BUILD_TESTING) # # End of Dart.cmake diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake index edf4b4e76..6190abed1 100644 --- a/Modules/DeployQt4.cmake +++ b/Modules/DeployQt4.cmake @@ -293,8 +293,8 @@ function(install_qt4_executable executable) resolve_qt4_paths(libs "") install(CODE - "INCLUDE(\"${DeployQt4_cmake_dir}/DeployQt4.cmake\") - SET(BU_CHMOD_BUNDLE_ITEMS TRUE) + "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}\")" ${component} ) diff --git a/Modules/Documentation.cmake b/Modules/Documentation.cmake index aff78c94f..ec989f408 100644 --- a/Modules/Documentation.cmake +++ b/Modules/Documentation.cmake @@ -18,28 +18,28 @@ # # 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) + find_package(UnixCommands) + find_package(Doxygen) + find_package(Gnuplot) + find_package(HTMLHelp) + find_package(Perl) + find_package(Wget) - OPTION(DOCUMENTATION_HTML_HELP + 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 ) @@ -49,4 +49,4 @@ IF (BUILD_DOCUMENTATION) # We will probably need bash to create the custom target # -ENDIF (BUILD_DOCUMENTATION) +endif (BUILD_DOCUMENTATION) 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..718a0d90d 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(ADD_FEATURE_INFO) -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(SET_PACKAGE_PROPERTIES) -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(_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) - 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(includeThisOne) - ENDIF("${_type}" STREQUAL ANY OR "${_type}" STREQUAL "${_currentType}") + endif("${_type}" STREQUAL ANY OR "${_type}" STREQUAL "${_currentType}") - ENDFOREACH(_currentFeature) - SET(${_var} "${_currentFeatureText}" PARENT_SCOPE) -ENDFUNCTION(_FS_GET_FEATURE_SUMMARY) + endforeach(_currentFeature) + set(${_var} "${_currentFeatureText}" PARENT_SCOPE) +endfunction(_FS_GET_FEATURE_SUMMARY) -FUNCTION(FEATURE_SUMMARY) +function(FEATURE_SUMMARY) # CMAKE_PARSE_ARGUMENTS( 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(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(_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(_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() + 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() + else(_FS_FILENAME) + if(NOT _FS_VAR) + message(STATUS "${_fullText}") + endif() + endif() - IF(_FS_VAR) - SET(${_FS_VAR} "${_fullText}" PARENT_SCOPE) - 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() + 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) +endfunction(FEATURE_SUMMARY) # 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(SET_PACKAGE_INFO) -FUNCTION(SET_FEATURE_INFO) +function(SET_FEATURE_INFO) SET_PACKAGE_INFO(${ARGN}) -ENDFUNCTION(SET_FEATURE_INFO) +endfunction(SET_FEATURE_INFO) -FUNCTION(PRINT_ENABLED_FEATURES) +function(PRINT_ENABLED_FEATURES) FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:") -ENDFUNCTION(PRINT_ENABLED_FEATURES) +endfunction(PRINT_ENABLED_FEATURES) -FUNCTION(PRINT_DISABLED_FEATURES) +function(PRINT_DISABLED_FEATURES) FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:") -ENDFUNCTION(PRINT_DISABLED_FEATURES) +endfunction(PRINT_DISABLED_FEATURES) 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 a45ebf8b9..ce4e1e726 100644 --- a/Modules/FindAVIFile.cmake +++ b/Modules/FindAVIFile.cmake @@ -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 (UNIX) # 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/FindBISON.cmake b/Modules/FindBISON.cmake index 7af336788..d0e0a222f 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(BISON_TARGET_option_verbose) # 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_option_extraopts) #============================================================ # 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}") + 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) + endif(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7) + endmacro(BISON_TARGET) # #============================================================ -ENDIF(BISON_EXECUTABLE) +endif(BISON_EXECUTABLE) -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/FindBZip2.cmake b/Modules/FindBZip2.cmake index 75ab50004..121d3f089 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 (NOT BZIP2_LIBRARIES) -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 (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h") # 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 (BZIP2_FOUND) -MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR) +mark_as_advanced(BZIP2_INCLUDE_DIR) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index ad6b1598d..e536b6e4d 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. diff --git a/Modules/FindCABLE.cmake b/Modules/FindCABLE.cmake index 678fb07ca..72a8805ca 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(NOT CABLE) -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(CABLE_LIBRARY_PATH) + find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS ${CABLE_BINARY_DIR}/CableTclFacility ${CABLE_BINARY_DIR}/CableTclFacility/*) - ENDIF(CABLE_LIBRARY_PATH) + endif(CABLE_LIBRARY_PATH) - 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(CABLE_EXECUTABLE_PATH) + find_program(CABLE NAMES cable PATHS ${CABLE_BINARY_DIR}/Executables ${CABLE_BINARY_DIR}/Executables/*) - ENDIF(CABLE_EXECUTABLE_PATH) + endif(CABLE_EXECUTABLE_PATH) - FIND_PATH(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h + find_path(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h ${CABLE_SOURCE_DIR}) -ELSE(CABLE_BUILD_DIR) +else(CABLE_BUILD_DIR) # 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(CABLE_BUILD_DIR) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 56a92c199..94e4500be 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -855,7 +855,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() diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake index 5f2181a99..5c58b8437 100644 --- a/Modules/FindCURL.cmake +++ b/Modules/FindCURL.cmake @@ -21,39 +21,39 @@ # 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 +find_library(CURL_LIBRARY NAMES curl # Windows MSVC prebuilts: curllib libcurl_imp curllib_static ) -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(_curl_version_header) +endif() # 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(CURL_FOUND) diff --git a/Modules/FindCoin3D.cmake b/Modules/FindCoin3D.cmake index 2b4c914f4..914d74b11 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 (CYGWIN) - 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) + 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) + endif (CYGWIN) -ELSE (WIN32) - IF(APPLE) - FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h +else (WIN32) + 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(APPLE) - 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(APPLE) -ENDIF (WIN32) +endif (WIN32) # 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/FindCurses.cmake b/Modules/FindCurses.cmake index 0ea5166d2..de719921e 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(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY) # 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. @@ -55,48 +55,48 @@ ENDIF() # 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 # default search paths. -IF(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES) - INCLUDE(CheckLibraryExists) +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) + 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( CURSES_NCURSES_HAS_WSYNCUP) + endif(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_HAS_WSYNCUP) -ENDIF(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES) +endif(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES) -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(NOT CURSES_USE_NCURSES) # 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 @@ -106,60 +106,60 @@ ELSE(NOT CURSES_USE_NCURSES) # a cache wqith these variables set # 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(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}" 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(CURSES_LIBRARY MATCHES NOTFOUND) + set(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}" CACHE FILEPATH "The curses library" ${FORCE_IT}) - ENDIF(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY) + endif(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY) -ENDIF(NOT CURSES_USE_NCURSES) +endif(NOT CURSES_USE_NCURSES) -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(CURSES_EXTRA_LIBRARY) -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(CURSES_FORM_LIBRARY) # 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 # 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/FindCygwin.cmake b/Modules/FindCygwin.cmake index 28f55ba0c..75e3342ba 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 (WIN32) diff --git a/Modules/FindDart.cmake b/Modules/FindDart.cmake index caca4b868..13e19be7d 100644 --- a/Modules/FindDart.cmake +++ b/Modules/FindDart.cmake @@ -16,7 +16,7 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -FIND_PATH(DART_ROOT README.INSTALL +find_path(DART_ROOT README.INSTALL $ENV{DART_ROOT} ${PROJECT_SOURCE_DIR}/Dart /usr/share/Dart @@ -30,7 +30,7 @@ FIND_PATH(DART_ROOT README.INSTALL # 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 ebfe29898..dacc60422 100644 --- a/Modules/FindDevIL.cmake +++ b/Modules/FindDevIL.cmake @@ -36,38 +36,38 @@ # 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 diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake index a004d7b65..d63044f42 100644 --- a/Modules/FindDoxygen.cmake +++ b/Modules/FindDoxygen.cmake @@ -33,9 +33,9 @@ # 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(Doxygen_FIND_QUIETLY) # ===== Rationale for OS X AppBundle mods below ===== # With the OS X GUI version, Doxygen likes to be installed to /Applications and @@ -54,9 +54,9 @@ 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 @@ -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,8 +88,8 @@ 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 "$ENV{ProgramFiles}/Graphviz 2.21/bin" @@ -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 7a6dbbbd9..e8523a059 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 @@ -46,15 +46,15 @@ endif (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h") # 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(EXPAT_FOUND) -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..64c1d535a 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( [COMPILE_FLAGS ]") - 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() + macro(FLEX_TARGET Name Input Output) + set(FLEX_TARGET_usage "FLEX_TARGET( [COMPILE_FLAGS ]") + 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} + 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(FLEX_TARGET) #============================================================ @@ -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(ADD_FLEX_BISON_DEPENDENCY) #============================================================ -ENDIF(FLEX_EXECUTABLE) +endif(FLEX_EXECUTABLE) -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 8a656f627..402fe2f5e 100644 --- a/Modules/FindFLTK.cmake +++ b/Modules/FindFLTK.cmake @@ -42,56 +42,56 @@ # (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(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(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(APPLE) + set( FLTK_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -lz") +endif(APPLE) # 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(FLTK_INCLUDE_DIR) # 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(dir) + 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} @@ -122,188 +122,188 @@ IF(NOT FLTK_DIR) # Help the user find it if we cannot. DOC "The ${FLTK_DIR_STRING}" ) -ENDIF(NOT FLTK_DIR) +endif(NOT FLTK_DIR) # 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(EXISTS ${FLTK_DIR}/FLTKConfig.cmake) - 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(FLUID_COMMAND) + 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(FLUID_COMMAND) + # 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(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 "Extra libraries for fltk_images library.") - ELSE(FLTK_BUILT_WITH_CMAKE) + else(FLTK_BUILT_WITH_CMAKE) # 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(FLTK_FLUID_EXECUTABLE) # # 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() + 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} + 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() + 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} + 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("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}") + endif(FLTK_CONFIG_SCRIPT) + endif(UNIX) - ENDIF(FLTK_BUILT_WITH_CMAKE) + endif(FLTK_BUILT_WITH_CMAKE) # 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}) + 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) +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(APPLE) + set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${FLTK_PLATFORM_DEPENDENT_LIBS}) + endif(APPLE) # 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(FLTK_FOUND) diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake index c6a978807..059ecdbcf 100644 --- a/Modules/FindFLTK2.cmake +++ b/Modules/FindFLTK2.cmake @@ -23,55 +23,55 @@ # (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(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(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(APPLE) + set( FLTK2_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -lz") +endif(APPLE) # 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(FLTK2_INCLUDE_DIR) + set(FLTK2_INCLUDE_DIR ${FLTK2_DIR}) +endif(FLTK2_INCLUDE_DIR) # 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(dir) + 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} @@ -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(NOT FLTK2_DIR) -ENDIF(NOT FLTK2_DIR) +endif(NOT FLTK2_DIR) # 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(EXISTS ${FLTK2_DIR}/FLTK2Config.cmake) - 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(FLUID_COMMAND) + 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(FLUID_COMMAND) - 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_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_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(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 "Extra libraries for fltk2_images library.") - ELSE(FLTK2_BUILT_WITH_CMAKE) + else(FLTK2_BUILT_WITH_CMAKE) # 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(FLTK2_FLUID_EXECUTABLE) - 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("${FLTK2_IMAGES_LDFLAGS}" MATCHES "${FLTK2_LIBS_EXTRACT_REGEX}") + endif(FLTK2_CONFIG_SCRIPT) + endif(UNIX) - ENDIF(FLTK2_BUILT_WITH_CMAKE) -ENDIF(FLTK2_DIR) + endif(FLTK2_BUILT_WITH_CMAKE) +endif(FLTK2_DIR) -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(NOT ${var}) +endforeach(var) -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(APPLE) + set(FLTK2_LIBRARIES ${FLTK2_LIBRARIES} ${FLTK2_PLATFORM_DEPENDENT_LIBS}) + endif(APPLE) # 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(FLTK2_FOUND) # 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(FLTK2_FIND_REQUIRED) + message(STATUS "FLTK2 was not found.") + endif(FLTK2_FIND_REQUIRED) + endif(NOT FLTK2_FIND_QUIETLY) +endif(FLTK2_FOUND) diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index e6f670256..d89683371 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -38,11 +38,11 @@ # 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} PATHS @@ -51,7 +51,7 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h /usr/freeware/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 PATHS @@ -61,7 +61,7 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h PATH_SUFFIXES freetype2 ) -FIND_LIBRARY(FREETYPE_LIBRARY +find_library(FREETYPE_LIBRARY NAMES freetype libfreetype freetype219 HINTS $ENV{FREETYPE_DIR} @@ -73,38 +73,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(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) +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(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") # 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 3b42a33d4..1e09b8200 100644 --- a/Modules/FindGDAL.cmake +++ b/Modules/FindGDAL.cmake @@ -40,7 +40,7 @@ # #include "gdal.h" -FIND_PATH(GDAL_INCLUDE_DIR gdal.h +find_path(GDAL_INCLUDE_DIR gdal.h HINTS $ENV{GDAL_DIR} $ENV{GDAL_ROOT} @@ -57,12 +57,12 @@ 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} @@ -85,7 +85,7 @@ 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} diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake index 41e909805..ff1d39667 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,7 +26,7 @@ # 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} PATH_SUFFIXES include @@ -36,9 +36,9 @@ 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} @@ -49,7 +49,7 @@ FIND_LIBRARY(GIF_LIBRARY ) # 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/FindGLU.cmake b/Modules/FindGLU.cmake index 5198f11e1..3db2ce4c6 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 (OPENGL_GLU_FOUND) diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake index cfa137516..edff53cb9 100644 --- a/Modules/FindGLUT.cmake +++ b/Modules/FindGLUT.cmake @@ -20,27 +20,27 @@ # (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) +else (WIN32) - IF (APPLE) + 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) + 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 + find_path( GLUT_INCLUDE_DIR GL/glut.h /usr/include/GL /usr/openwin/share/include /usr/openwin/include @@ -48,29 +48,29 @@ ELSE (WIN32) /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 (APPLE) -ENDIF (WIN32) +endif (WIN32) -INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +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} @@ -78,11 +78,11 @@ IF (GLUT_FOUND) ) #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(GLUT_FOUND) -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 3fa75a640..780932e61 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 - 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 + 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,42 @@ 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_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_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(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY) - ENDIF(GTK_gtk_INCLUDE_PATH + endif(GTK_gtk_INCLUDE_PATH AND GTK_glibconfig_INCLUDE_PATH AND GTK_glib_INCLUDE_PATH AND GTK_gtk_LIBRARY AND GTK_glib_LIBRARY) - MARK_AS_ADVANCED( + mark_as_advanced( GTK_gdk_LIBRARY GTK_glib_INCLUDE_PATH GTK_glib_LIBRARY @@ -159,7 +159,7 @@ IF(UNIX) GTK_gtkgl_LIBRARY ) -ENDIF(UNIX) +endif(UNIX) diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake index 6dbc02618..a801a29c8 100644 --- a/Modules/FindGettext.cmake +++ b/Modules/FindGettext.cmake @@ -39,182 +39,182 @@ # (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(GETTEXT_MSGMERGE_EXECUTABLE) -INCLUDE(FindPackageHandleStandardArgs) +include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gettext REQUIRED_VARS GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE VERSION_VAR GETTEXT_VERSION_STRING) -INCLUDE(CMakeParseArguments) +include(CMakeParseArguments) -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(_firstPoFile "${_firstPoFileArg}") - SET(_gmoFiles) - GET_FILENAME_COMPONENT(_potName ${_potFile} NAME) - STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName}) - GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE) + 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") + 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) + 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( + 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 (_currentPoFile ) - 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(GETTEXT_CREATE_TRANSLATIONS ) -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(_parsedArguments_INSTALL_DESTINATION) + list(APPEND _gmoFiles ${_gmoFile}) + endforeach (_lang ) - 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(_parsedArguments_ALL) + add_custom_target(${uniqueTargetName} DEPENDS ${_gmoFiles}) + endif(_parsedArguments_ALL) - ADD_DEPENDENCIES(potfiles ${uniqueTargetName}) + add_dependencies(potfiles ${uniqueTargetName}) -ENDFUNCTION(GETTEXT_PROCESS_POT_FILE) +endfunction(GETTEXT_PROCESS_POT_FILE) -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(_parsedArguments_INSTALL_DESTINATION) + list(APPEND _gmoFiles ${_gmoFile}) + endforeach(_current_PO_FILE) - 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(_parsedArguments_ALL) + add_custom_target(${uniqueTargetName} DEPENDS ${_gmoFiles}) + endif(_parsedArguments_ALL) - ADD_DEPENDENCIES(pofiles ${uniqueTargetName}) + add_dependencies(pofiles ${uniqueTargetName}) -ENDFUNCTION(GETTEXT_PROCESS_PO_FILES) +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 ) +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 ) diff --git a/Modules/FindGnuTLS.cmake b/Modules/FindGnuTLS.cmake index 617f58f26..a05efe6b0 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 (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY) -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 (NOT WIN32) -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 # 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 d5730476d..07af0bf20 100644 --- a/Modules/FindGnuplot.cmake +++ b/Modules/FindGnuplot.cmake @@ -21,9 +21,9 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -INCLUDE(FindCygwin) +include(FindCygwin) -FIND_PROGRAM(GNUPLOT_EXECUTABLE +find_program(GNUPLOT_EXECUTABLE NAMES gnuplot pgnuplot @@ -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 # 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/FindHSPELL.cmake b/Modules/FindHSPELL.cmake index 79bfc81bb..05b55059b 100644 --- a/Modules/FindHSPELL.cmake +++ b/Modules/FindHSPELL.cmake @@ -24,23 +24,23 @@ # (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(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() # 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 00de82afd..d51b3987a 100644 --- a/Modules/FindHTMLHelp.cmake +++ b/Modules/FindHTMLHelp.cmake @@ -18,18 +18,18 @@ # (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" ) - 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 + find_path(HTML_HELP_INCLUDE_PATH htmlhelp.h "${HTML_HELP_COMPILER_PATH}/include" "[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]/include" @@ -37,7 +37,7 @@ IF(WIN32) "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(WIN32) diff --git a/Modules/FindITK.cmake b/Modules/FindITK.cmake index 5b598d230..b0b3f03f0 100644 --- a/Modules/FindITK.cmake +++ b/Modules/FindITK.cmake @@ -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..436bb4bb6 100644 --- a/Modules/FindImageMagick.cmake +++ b/Modules/FindImageMagick.cmake @@ -45,11 +45,11 @@ # ImageMagick__LIBRARIES - Full path to 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(ImageMagick_${component}_INCLUDE_DIR AND ImageMagick_${component}_LIBRARY) +endfunction(FIND_IMAGEMAGICK_API) -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(EXISTS ${_IMAGEMAGICK_EXECUTABLE}) + set(ImageMagick_${component}_FOUND FALSE PARENT_SCOPE) + endif(EXISTS ${_IMAGEMAGICK_EXECUTABLE}) +endfunction(FIND_IMAGEMAGICK_EXE) #--------------------------------------------------------------------- # 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 # ; 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(component STREQUAL "Magick++") + if(ImageMagick_EXECUTABLE_DIR) FIND_IMAGEMAGICK_EXE(${component}) - ENDIF(ImageMagick_EXECUTABLE_DIR) + endif(ImageMagick_EXECUTABLE_DIR) - 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(is_requested GREATER -1) + 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(ImageMagick_FIND_COMPONENTS) + endif(component STREQUAL "Magick++") +endforeach(component) -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(ImageMagick_mogrify_EXECUTABLE) #--------------------------------------------------------------------- # 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 f93b454a4..1dae07e7f 100644 --- a/Modules/FindJNI.cmake +++ b/Modules/FindJNI.cmake @@ -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(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}") + endif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") # Append default list architectures if CMAKE_SYSTEM_PROCESSOR was empty or # system is non-Linux (where the code above has not been well tested) - IF(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux")) - LIST(APPEND _java_libarch "i386" "amd64" "ppc") - ENDIF(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux")) + if(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux")) + list(APPEND _java_libarch "i386" "amd64" "ppc") + endif(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux")) # Sometimes ${CMAKE_SYSTEM_PROCESSOR} is added to the list to prefer # current value to a hardcoded list. Remove possible duplicates. - LIST(REMOVE_DUPLICATES _java_libarch) + 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(_libarch) + else(_path MATCHES "{libarch}") + list(APPEND ${_var} "${_path}") + endif(_path MATCHES "{libarch}") + endforeach(_path) +endmacro(java_append_library_directories) -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,18 +122,18 @@ 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(dir) -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" @@ -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 +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 ../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(EXISTS ${jpath}/${JAVA_LIB_PATH}) + endforeach(JAVA_LIB_PATH) +endforeach(JAVA_PROG) -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(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(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(NOT JAVA_AWT_LIBRARY) - 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(NOT JAVA_JVM_LIBRARY) - 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(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h) + endif(NOT JAVA_AWT_INCLUDE_PATH) # 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(JAVA_HAVE_FRAMEWORK) +else(APPLE) + 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(APPLE) # add in the include path -FIND_PATH(JAVA_INCLUDE_PATH jni.h +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 0b5db4089..9b0d8f48a 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 # 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(JPEG_FOUND) # 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(JPEG_LIBRARY) -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 b6178449b..c5b865a12 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 (NOT JASPER_LIBRARIES) -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 (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h") # 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 (JASPER_FOUND) -MARK_AS_ADVANCED(JASPER_INCLUDE_DIR) +mark_as_advanced(JASPER_INCLUDE_DIR) diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake index 2e50ecac2..24af0e00b 100644 --- a/Modules/FindJava.cmake +++ b/Modules/FindJava.cmake @@ -16,7 +16,7 @@ # 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: @@ -37,9 +37,9 @@ # Java__FOUND - TRUE if 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 # 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(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}" ) # 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( ) set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH}.${Java_VERSION_TWEAK}) endif( ) - ENDIF() + endif() -ENDIF(Java_JAVA_EXECUTABLE) +endif(Java_JAVA_EXECUTABLE) -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} @@ -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 65a559fa7..a8d30a890 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(NOT UNIX AND KDE3_FIND_REQUIRED) # 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(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) -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) +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}) +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 ("${kde_version}" MATCHES "KDE: 3\\.") +endif(KDECONFIG_EXECUTABLE) # 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(KDE3_KDECORE_LIBRARY MATCHES lib64) + set(KDE3_LIBTOOL_DIR /lib/kde3) + endif(KDE3_KDECORE_LIBRARY MATCHES lib64) +endif(NOT KDE3_LIBTOOL_DIR) #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 (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) # 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("${out}" MATCHES "2.9[56]") + endif(CMAKE_COMPILER_IS_GNUCXX) #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(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS) # 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 (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS) # 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 (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS) -#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(KDE3_FOUND) # 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(KDE3_INCLUDE_DIR) + message(STATUS "Didn't find KDE3 headers") + endif(KDE3_INCLUDE_DIR) - 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(KDE3_LIB_DIR) + message(STATUS "Didn't find KDE3 core library") + endif(KDE3_LIB_DIR) - 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(KDE3_DCOPIDL_EXECUTABLE) + message(STATUS "Didn't find the KDE3 dcopidl preprocessor") + endif(KDE3_DCOPIDL_EXECUTABLE) - 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(KDE3_DCOPIDL2CPP_EXECUTABLE) + message(STATUS "Didn't find the KDE3 dcopidl2cpp preprocessor") + endif(KDE3_DCOPIDL2CPP_EXECUTABLE) - 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(KDE3_KCFGC_EXECUTABLE) + message(STATUS "Didn't find the KDE3 kconfig_compiler preprocessor") + endif(KDE3_KCFGC_EXECUTABLE) -ENDMACRO (KDE3_PRINT_RESULTS) +endmacro (KDE3_PRINT_RESULTS) -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 (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND) -IF (NOT KDE3_FIND_QUIETLY) +if (NOT KDE3_FIND_QUIETLY) KDE3_PRINT_RESULTS() -ENDIF (NOT KDE3_FIND_QUIETLY) +endif (NOT KDE3_FIND_QUIETLY) #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 fb9332828..9cff20ebb 100644 --- a/Modules/FindKDE4.cmake +++ b/Modules/FindKDE4.cmake @@ -24,18 +24,18 @@ # 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(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) -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. @@ -43,7 +43,7 @@ FILE(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS) # 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 HINTS @@ -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 (KDE4_FIND_REQUIRED) +endif (NOT KDE4_KDECONFIG_EXECUTABLE) # 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(CMAKE_CROSSCOMPILING) # 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(KDE4_KDECONFIG_EXECUTABLE) + endif(CMAKE_CROSSCOMPILING) +endif(NOT KDE4_DATA_DIR) # 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 (KDE4_FIND_QUIETLY) - IF (KDE4_FIND_REQUIRED) - SET(_req REQUIRED) - ENDIF (KDE4_FIND_REQUIRED) + if (KDE4_FIND_REQUIRED) + set(_req REQUIRED) + endif (KDE4_FIND_REQUIRED) # 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 (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) diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake index 7997ae9c8..020272724 100644 --- a/Modules/FindLATEX.cmake +++ b/Modules/FindLATEX.cmake @@ -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 "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 (WIN32) -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 (WIN32) + find_program(PS2PDF_CONVERTER NAMES ps2pdf14 ps2pdf ) -ENDIF (WIN32) +endif (WIN32) -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..852d61314 100644 --- a/Modules/FindLibLZMA.cmake +++ b/Modules/FindLibLZMA.cmake @@ -29,30 +29,30 @@ # 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(READ "${LIBLZMA_INCLUDE_DIR}/lzma/version.h" 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}") + 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}") +endif(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h") # 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(CheckLibraryExists) 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 (LIBLZMA_LIBRARY) -INCLUDE(FindPackageHandleStandardArgs) +include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA REQUIRED_VARS LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY LIBLZMA_HAS_AUTO_DECODER @@ -61,9 +61,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 (LIBLZMA_FOUND) -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 4fc5d88b1..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 # 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 5196cf758..cfe2e7294 100644 --- a/Modules/FindLua50.cmake +++ b/Modules/FindLua50.cmake @@ -24,7 +24,7 @@ # (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} PATH_SUFFIXES include/lua50 include/lua5.0 include/lua5 include/lua include @@ -37,7 +37,7 @@ 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} @@ -53,10 +53,10 @@ 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(${LUA_LIBRARY_lua} MATCHES "framework") + find_library(LUA_LIBRARY_lualib NAMES lualib50 lualib5.0 lualib5 lualib HINTS $ENV{LUALIB_DIR} @@ -68,23 +68,23 @@ ELSE(${LUA_LIBRARY_lua} MATCHES "framework") /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(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") -INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +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 468b5d4fc..2d189e4c6 100644 --- a/Modules/FindLua51.cmake +++ b/Modules/FindLua51.cmake @@ -25,7 +25,7 @@ # (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} PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include @@ -38,7 +38,7 @@ 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} @@ -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(UNIX AND NOT APPLE) + set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries") + endif(UNIX AND NOT APPLE) +endif(LUA_LIBRARY) -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) +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..f45046dca 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(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW) -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(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 "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(MFC_HAVE_MFC) + endif("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$") - 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(MFC_HAVE_MFC) +endif(MFC_ATTEMPT_TRY_COMPILE) diff --git a/Modules/FindMPEG.cmake b/Modules/FindMPEG.cmake index 545e0490c..698329e9b 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 # 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(MPEG_FOUND) -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 5456e20b6..153ed7f57 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 # 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(SDL_FOUND) +endif(MPEG2_FOUND) -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/FindMatlab.cmake b/Modules/FindMatlab.cmake index 1cdb07174..20dc1daf9 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(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") + 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(${CMAKE_GENERATOR} MATCHES "Visual Studio 7") + 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(${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 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( WIN32 ) + 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(CMAKE_SIZEOF_VOID_P EQUAL 4) # 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(CMAKE_SIZEOF_VOID_P EQUAL 4) + 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(WIN32) # 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(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES) -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 57da1c1e9..5b7e6a108 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(UNIX) # 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 fdac45518..311a11a7f 100644 --- a/Modules/FindOpenAL.cmake +++ b/Modules/FindOpenAL.cmake @@ -61,7 +61,7 @@ # 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} PATH_SUFFIXES include/AL include/OpenAL include @@ -75,7 +75,7 @@ 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} @@ -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 322972a59..15650117b 100644 --- a/Modules/FindOpenGL.cmake +++ b/Modules/FindOpenGL.cmake @@ -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 (CYGWIN) - 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(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) - ENDIF (CYGWIN) + endif (CYGWIN) -ELSE (WIN32) +else (WIN32) - 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(APPLE) # 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(CMAKE_SIZEOF_VOID_P EQUAL 4) + 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(CMAKE_SIZEOF_VOID_P EQUAL 4) # 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 - 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 @@ -101,18 +101,18 @@ ELSE (WIN32) # 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) + 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 + 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(APPLE) +endif (WIN32) -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(OPENGL_xmesa_INCLUDE_DIR) + set( OPENGL_XMESA_FOUND "NO" ) + endif(OPENGL_xmesa_INCLUDE_DIR) - 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(OPENGL_glu_LIBRARY) + set( OPENGL_GLU_FOUND "NO" ) + endif(OPENGL_glu_LIBRARY) # 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(OPENGL_gl_LIBRARY) # 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/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 6642915ce..b812b22bb 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -29,16 +29,16 @@ if (UNIX) pkg_check_modules(_OPENSSL QUIET openssl) endif (UNIX) -IF (WIN32) +if (WIN32) # http://www.slproweb.com/products/Win32OpenSSL.html - SET(_OPENSSL_ROOT_HINTS + 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 + file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) + set(_OPENSSL_ROOT_PATHS "${_programfiles}/OpenSSL" "${_programfiles}/OpenSSL-Win32" "${_programfiles}/OpenSSL-Win64" @@ -46,19 +46,19 @@ IF (WIN32) "C:/OpenSSL-Win32/" "C:/OpenSSL-Win64/" ) - UNSET(_programfiles) - SET(_OPENSSL_ROOT_HINTS_AND_PATHS + unset(_programfiles) + set(_OPENSSL_ROOT_HINTS_AND_PATHS HINTS ${_OPENSSL_ROOT_HINTS} PATHS ${_OPENSSL_ROOT_PATHS} ) -ELSE () - SET(_OPENSSL_ROOT_HINTS +else () + set(_OPENSSL_ROOT_HINTS ${OPENSSL_ROOT_DIR} ENV OPENSSL_ROOT_DIR ) -ENDIF () +endif () -FIND_PATH(OPENSSL_INCLUDE_DIR +find_path(OPENSSL_INCLUDE_DIR NAMES openssl/ssl.h HINTS @@ -68,8 +68,8 @@ FIND_PATH(OPENSSL_INCLUDE_DIR include ) -IF(WIN32 AND NOT CYGWIN) - 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 @@ -84,7 +84,7 @@ 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 ${_OPENSSL_ROOT_HINTS_AND_PATHS} @@ -94,7 +94,7 @@ IF(WIN32 AND NOT CYGWIN) "lib/VC" ) - FIND_LIBRARY(LIB_EAY_RELEASE + find_library(LIB_EAY_RELEASE NAMES libeay32MD libeay32 @@ -105,7 +105,7 @@ IF(WIN32 AND NOT CYGWIN) "lib/VC" ) - FIND_LIBRARY(SSL_EAY_DEBUG + find_library(SSL_EAY_DEBUG NAMES ssleay32MDd ${_OPENSSL_ROOT_HINTS_AND_PATHS} @@ -115,7 +115,7 @@ IF(WIN32 AND NOT CYGWIN) "lib/VC" ) - FIND_LIBRARY(SSL_EAY_RELEASE + find_library(SSL_EAY_RELEASE NAMES ssleay32MD ssleay32 @@ -132,15 +132,15 @@ IF(WIN32 AND NOT CYGWIN) select_library_configurations(SSL_EAY) set( OPENSSL_LIBRARIES ${SSL_EAY_LIBRARY} ${LIB_EAY_LIBRARY} ) - ELSEIF(MINGW) + elseif(MINGW) # same player, for MingW - 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 + 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 ${LIB_EAY_NAMES} ${_OPENSSL_ROOT_HINTS_AND_PATHS} @@ -149,7 +149,7 @@ IF(WIN32 AND NOT CYGWIN) "lib/MinGW" ) - FIND_LIBRARY(SSL_EAY + find_library(SSL_EAY NAMES ${SSL_EAY_NAMES} ${_OPENSSL_ROOT_HINTS_AND_PATHS} @@ -158,13 +158,13 @@ IF(WIN32 AND NOT CYGWIN) "lib/MinGW" ) - MARK_AS_ADVANCED(SSL_EAY LIB_EAY) + mark_as_advanced(SSL_EAY LIB_EAY) set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} ) unset(LIB_EAY_NAMES) unset(SSL_EAY_NAMES) - ELSE(MSVC) + else(MSVC) # Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues: - FIND_LIBRARY(LIB_EAY + find_library(LIB_EAY NAMES libeay32 HINTS @@ -174,7 +174,7 @@ IF(WIN32 AND NOT CYGWIN) lib ) - FIND_LIBRARY(SSL_EAY + find_library(SSL_EAY NAMES ssleay32 HINTS @@ -184,12 +184,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(MSVC) +else(WIN32 AND NOT CYGWIN) - FIND_LIBRARY(OPENSSL_SSL_LIBRARY + find_library(OPENSSL_SSL_LIBRARY NAMES ssl ssleay32 @@ -201,7 +201,7 @@ ELSE(WIN32 AND NOT CYGWIN) lib ) - FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY + find_library(OPENSSL_CRYPTO_LIBRARY NAMES crypto HINTS @@ -211,15 +211,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(WIN32 AND NOT CYGWIN) function(from_hex HEX DEC) string(TOUPPER "${HEX}" HEX) @@ -309,4 +309,4 @@ else (OPENSSL_VERSION) ) endif (OPENSSL_VERSION) -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 9dd2c28f0..17ab05776 100644 --- a/Modules/FindOpenSceneGraph.cmake +++ b/Modules/FindOpenSceneGraph.cmake @@ -161,7 +161,7 @@ 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) diff --git a/Modules/FindPHP4.cmake b/Modules/FindPHP4.cmake index abdabe144..2c6a7c8d0 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(php4_path Zend main TSRM) + set(PHP4_INCLUDE_PATH "${php4_paths}" INTERNAL "PHP4 include paths") +endif(PHP4_FOUND_INCLUDE_PATH) -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(symbol) +endif(APPLE) -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..50cb7d85e 100644 --- a/Modules/FindPNG.cmake +++ b/Modules/FindPNG.cmake @@ -43,15 +43,15 @@ 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) + set (PNG_DEFINITIONS -DPNG_STATIC) endif(BUILD_SHARED_LIBS) endif (CYGWIN) diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index cdcf9ca7c..1dd865281 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -1,7 +1,7 @@ # FIND_PACKAGE_HANDLE_STANDARD_ARGS( ... ) # # 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 _FOUND variable. # The package is considered found if all variables ... 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,209 @@ # (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 (${_NAME}_FIND_REQUIRED) + if (NOT ${_NAME}_FIND_QUIETLY) + message(STATUS "${_msg}") + endif (NOT ${_NAME}_FIND_QUIETLY) + endif (${_NAME}_FIND_REQUIRED) +endmacro(_FPHSA_FAILURE_MESSAGE _msg) # internal helper macro to generate the failure message when used in CONFIG_MODE: -MACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) +macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) # _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(${_NAME}_CONFIG) # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version. # List them all in the error message: - IF(${_NAME}_CONSIDERED_CONFIGS) - SET(configsText "") - LIST(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount) - MATH(EXPR configsCount "${configsCount} - 1") - FOREACH(currentConfigIndex RANGE ${configsCount}) - LIST(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename) - LIST(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version) - SET(configsText "${configsText} ${filename} (version ${version})\n") - ENDFOREACH(currentConfigIndex) + if(${_NAME}_CONSIDERED_CONFIGS) + set(configsText "") + list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount) + math(EXPR configsCount "${configsCount} - 1") + foreach(currentConfigIndex RANGE ${configsCount}) + list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename) + list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version) + set(configsText "${configsText} ${filename} (version ${version})\n") + endforeach(currentConfigIndex) _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}") - ELSE(${_NAME}_CONSIDERED_CONFIGS) + else(${_NAME}_CONSIDERED_CONFIGS) # Simple case: No Config-file was found at all: _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}") - ENDIF(${_NAME}_CONSIDERED_CONFIGS) - ENDIF(${_NAME}_CONFIG) -ENDMACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) + endif(${_NAME}_CONSIDERED_CONFIGS) + endif(${_NAME}_CONFIG) +endmacro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) -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) + 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) + if(${INDEX} EQUAL -1) + set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG}) + set(FPHSA_REQUIRED_VARS ${ARGN}) + set(FPHSA_VERSION_VAR) + else(${INDEX} EQUAL -1) CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN}) - IF(FPHSA_UNPARSED_ARGUMENTS) - MESSAGE(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"") - ENDIF(FPHSA_UNPARSED_ARGUMENTS) + if(FPHSA_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"") + endif(FPHSA_UNPARSED_ARGUMENTS) - 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(NOT FPHSA_FAIL_MESSAGE) + endif(${INDEX} EQUAL -1) # now that we collected all arguments, process them - IF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") - SET(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}") - ENDIF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") + if("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") + set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}") + endif("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") # In config-mode, we rely on the variable _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(FPHSA_CONFIG_MODE) - IF(NOT FPHSA_REQUIRED_VARS) - MESSAGE(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()") - ENDIF(NOT FPHSA_REQUIRED_VARS) + if(NOT FPHSA_REQUIRED_VARS) + message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()") + endif(NOT FPHSA_REQUIRED_VARS) - LIST(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR) + 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(NOT ${_CURRENT_VAR}) + set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]") + endif(NOT ${_CURRENT_VAR}) + endforeach(_CURRENT_VAR) # 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(comp) + set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}") + set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]") + endif(FPHSA_HANDLE_COMPONENTS) # version handling: - SET(VERSION_MSG "") - SET(VERSION_OK TRUE) - SET(VERSION ${${FPHSA_VERSION_VAR}} ) - IF (${_NAME}_FIND_VERSION) + set(VERSION_MSG "") + set(VERSION_OK TRUE) + set(VERSION ${${FPHSA_VERSION_VAR}} ) + if (${_NAME}_FIND_VERSION) - IF(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}") + 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(${_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) + else(VERSION) # if the package was not found, but a version was given, add that to the output: - IF(${_NAME}_FIND_VERSION_EXACT) - SET(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")") - ELSE(${_NAME}_FIND_VERSION_EXACT) - SET(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")") - ENDIF(${_NAME}_FIND_VERSION_EXACT) + 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) + 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(VERSION_OK) + set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]") + else(VERSION_OK) + set(${_NAME_UPPER}_FOUND FALSE) + endif(VERSION_OK) # print the result: - IF (${_NAME_UPPER}_FOUND) + if (${_NAME_UPPER}_FOUND) FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}") - ELSE (${_NAME_UPPER}_FOUND) + else (${_NAME_UPPER}_FOUND) - IF(FPHSA_CONFIG_MODE) + if(FPHSA_CONFIG_MODE) _FPHSA_HANDLE_FAILURE_CONFIG_MODE() - ELSE(FPHSA_CONFIG_MODE) - IF(NOT VERSION_OK) + else(FPHSA_CONFIG_MODE) + if(NOT VERSION_OK) _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})") - ELSE(NOT VERSION_OK) + else(NOT VERSION_OK) _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}") - ENDIF(NOT VERSION_OK) - ENDIF(FPHSA_CONFIG_MODE) + endif(NOT VERSION_OK) + endif(FPHSA_CONFIG_MODE) - ENDIF (${_NAME_UPPER}_FOUND) + endif (${_NAME_UPPER}_FOUND) - 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(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG) diff --git a/Modules/FindPackageMessage.cmake b/Modules/FindPackageMessage.cmake index 48d3472b5..f78792d26 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(X11_FOUND) # ... -# ENDIF(X11_FOUND) +# endif(X11_FOUND) #============================================================================= # 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(NOT "${details}" STREQUAL "${${DETAILS_VAR}}") + endif(NOT ${pkg}_FIND_QUIETLY) +endfunction(FIND_PACKAGE_MESSAGE) diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake index bedb839d1..4f45da619 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( +if(WIN32) + get_filename_component( ActivePerl_CurrentVersion "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl;CurrentVersion]" NAME) - SET(PERL_POSSIBLE_BIN_PATHS ${PERL_POSSIBLE_BIN_PATHS} + set(PERL_POSSIBLE_BIN_PATHS ${PERL_POSSIBLE_BIN_PATHS} "C:/Perl/bin" [HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl\\${ActivePerl_CurrentVersion}]/bin ) -ENDIF(WIN32) +endif(WIN32) -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(PERL_EXECUTABLE) # 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 # 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 3db67acc4..101aebfd4 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) diff --git a/Modules/FindPhysFS.cmake b/Modules/FindPhysFS.cmake index 45f9d2e6f..ae78b27ce 100644 --- a/Modules/FindPhysFS.cmake +++ b/Modules/FindPhysFS.cmake @@ -23,7 +23,7 @@ # (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} PATH_SUFFIXES include/physfs include @@ -36,7 +36,7 @@ FIND_PATH(PHYSFS_INCLUDE_DIR physfs.h /opt ) -FIND_LIBRARY(PHYSFS_LIBRARY +find_library(PHYSFS_LIBRARY NAMES physfs HINTS $ENV{PHYSFSDIR} @@ -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/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake index 94e5676fe..ad671603b 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 /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} "/include") +# set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/include") # 3) Set an environment variable called ${PostgreSQL_ROOT} that points to the root of where you have # installed PostgreSQL, e.g. . # diff --git a/Modules/FindProducer.cmake b/Modules/FindProducer.cmake index f7840c5d1..20266cbf7 100644 --- a/Modules/FindProducer.cmake +++ b/Modules/FindProducer.cmake @@ -42,7 +42,7 @@ # #include # 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} @@ -59,7 +59,7 @@ 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} diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index 11ff19623..932fbdcc9 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) +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) +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 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(WIN32) - 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(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR) - 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(dir) + endif(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR) - 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(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h") - 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(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR) +endforeach(_CURRENT_VERSION) -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( src1 src2 ... srcN) is used to build modules for python. # PYTHON_WRITE_MODULES_HEADER() 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(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) - 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(WIN32 AND NOT CYGWIN) + endif(PYTHON_MODULE_${_NAME}_BUILD_SHARED) - ENDIF(PYTHON_ENABLE_MODULE_${_NAME}) -ENDFUNCTION(PYTHON_ADD_MODULE) + endif(PYTHON_ENABLE_MODULE_${_NAME}) +endfunction(PYTHON_ADD_MODULE) -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(_currentModule ${PY_STATIC_MODULES_LIST}) - 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(_currentModule ${PY_STATIC_MODULES_LIST}) - 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(_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") -# 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(PYTHON_WRITE_MODULES_HEADER) diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake index 5a1f6fc38..53b1da7cf 100644 --- a/Modules/FindQt.cmake +++ b/Modules/FindQt.cmake @@ -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(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(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(GLOB_TEMP_VAR) +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(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(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(GLOB_TEMP_VAR) +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(QTVERSION MATCHES "4.*") + if(QTVERSION MATCHES "Unknown") + set(QT3_INSTALLED TRUE) + endif(QTVERSION MATCHES "Unknown") +endif(QT_QMAKE_EXECUTABLE_FINDQT) -IF(QT_QMAKE_EXECUTABLE_FINDQT) - EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE_FINDQT} +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(QT_QMAKE_EXECUTABLE_FINDQT) -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,11 +89,11 @@ 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(QT4_QGLOBAL_H_FILE) -FIND_FILE( QT3_QGLOBAL_H_FILE qglobal.h +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" @@ -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(QT3_QGLOBAL_H_FILE) -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(QT3_INSTALLED AND QT4_INSTALLED ) # 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(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(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(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(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(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) diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake index 2d8dbde22..0440a8592 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(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) -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(GLOB_PATH) +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,25 +68,25 @@ 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(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h) -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(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}") # 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(QT_INCLUDE_DIR) -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 @@ -104,8 +104,8 @@ IF (QT_MT_REQUIRED) C:/Progra~1/qt/lib ) -ELSE (QT_MT_REQUIRED) - FIND_LIBRARY(QT_QT_LIBRARY +else (QT_MT_REQUIRED) + 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} @@ -123,10 +123,10 @@ ELSE (QT_MT_REQUIRED) /usr/share/qt3/lib C:/Progra~1/qt/lib ) -ENDIF (QT_MT_REQUIRED) +endif (QT_MT_REQUIRED) -FIND_LIBRARY(QT_QASSISTANTCLIENT_LIBRARY +find_library(QT_QASSISTANTCLIENT_LIBRARY NAMES qassistantclient PATHS "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib" @@ -142,7 +142,7 @@ FIND_LIBRARY(QT_QASSISTANTCLIENT_LIBRARY ) # qt 3 should prefer QTDIR over the PATH -FIND_PROGRAM(QT_MOC_EXECUTABLE +find_program(QT_MOC_EXECUTABLE NAMES moc-qt3 moc HINTS $ENV{QTDIR}/bin @@ -160,12 +160,12 @@ FIND_PROGRAM(QT_MOC_EXECUTABLE /usr/X11R6/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_MOC_EXECUTABLE) # qt 3 should prefer QTDIR over the PATH -FIND_PROGRAM(QT_UIC_EXECUTABLE +find_program(QT_UIC_EXECUTABLE NAMES uic-qt3 uic HINTS $ENV{QTDIR}/bin @@ -182,12 +182,12 @@ FIND_PROGRAM(QT_UIC_EXECUTABLE /usr/X11R6/bin ) -IF(QT_UIC_EXECUTABLE) - SET ( QT_WRAP_UI "YES") -ENDIF(QT_UIC_EXECUTABLE) +if(QT_UIC_EXECUTABLE) + set ( QT_WRAP_UI "YES") +endif(QT_UIC_EXECUTABLE) -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" @@ -198,99 +198,99 @@ IF (WIN32) "C:/Program Files/qt/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 (WIN32) #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(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION) # 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 (QT_QTMAIN_LIBRARY) # 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 (QT_QTMAIN_LIBRARY) + else (WIN32 AND NOT CYGWIN) + 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(QT_QT_LIBRARY MATCHES "qt-mt") - ENDIF (WIN32 AND NOT CYGWIN) + endif (WIN32 AND NOT CYGWIN) - 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 (QT_QASSISTANTCLIENT_LIBRARY) # 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 (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(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(QT_MOC_EXECUTABLE) +if(QT_UIC_EXECUTABLE) + execute_process(COMMAND ${QT_UIC_EXECUTABLE} "-version" OUTPUT_VARIABLE QTVERSION_UIC ERROR_QUIET) -ENDIF(QT_UIC_EXECUTABLE) +endif(QT_UIC_EXECUTABLE) -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("${QTVERSION_UIC}" MATCHES ".* 3..*") -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("${QTVERSION_MOC}" MATCHES ".* 3..*") -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 (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3) -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 (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3) -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 e3eb1e69b..e20e76465 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -334,139 +334,139 @@ # (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( component ) # 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_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_QTGUI) + set( QT_DONT_USE_QTGUI 1 ) + endif(NOT QT_USE_QTGUI) -ENDIF( Qt4_FIND_COMPONENTS ) +endif( Qt4_FIND_COMPONENTS ) # 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(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) -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 (QT_${basename}_LIBRARY_RELEASE) - 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 (QT_${basename}_LIBRARY_DEBUG) + endif(NOT TARGET Qt4::${_camelCaseBasename}) # If QT_USE_IMPORTED_TARGETS is enabled, the QT_QTFOO_LIBRARY variables are set to point at these # imported targets. This works better in general, and is also in almost all cases fully # backward compatible. The only issue is when a project A which had this enabled then exports its - # libraries via export or EXPORT_LIBRARY_DEPENDENCIES(). In this case the libraries from project + # 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(QT_USE_IMPORTED_TARGETS) # if the release- as well as the debug-version of the library have been found: - IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) + if (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(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) # if there are no configuration types and CMAKE_BUILD_TYPE has no value # then just use the release libraries - SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} ) - ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) - ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) + set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} ) + endif(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) + endif (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) # if only the release version was found, set the debug variable also to the release version - IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG) - SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE}) - SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE}) - SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE}) - ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG) + if (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG) + set(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE}) + set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE}) + set(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE}) + endif (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG) # if only the debug version was found, set the release variable also to the debug version - IF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE) - SET(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG}) - SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG}) - SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG}) - ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE) + if (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE) + set(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG}) + set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG}) + set(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG}) + endif (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE) # put the value in the cache: - SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE) + set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE) - ENDIF(QT_USE_IMPORTED_TARGETS) + endif(QT_USE_IMPORTED_TARGETS) - SET(QT_${basename}_FOUND 1) + set(QT_${basename}_FOUND 1) - ELSE (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG) + else (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG) - 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 (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG) - 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 (QT_${basename}_INCLUDE_DIR) # Make variables changeble to the advanced user - MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR) -ENDMACRO (_QT4_ADJUST_LIB_VARS) + mark_as_advanced(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR) +endmacro (_QT4_ADJUST_LIB_VARS) function(_QT4_QUERY_QMAKE VAR RESULT) execute_process(COMMAND "${QT_QMAKE_EXECUTABLE}" -query ${VAR} @@ -480,13 +480,13 @@ function(_QT4_QUERY_QMAKE VAR RESULT) endfunction(_QT4_QUERY_QMAKE) -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 +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" @@ -495,224 +495,224 @@ FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS ) # 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(QT_QMAKE_EXECUTABLE_LAST) - 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(QT_QMAKE_EXECUTABLE) + endif(NOT QTVERSION) -ENDIF (QT_QMAKE_EXECUTABLE) +endif (QT_QMAKE_EXECUTABLE) -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(NOT WIN32) set(qt_cross_paths) foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH}) set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/mkspecs") endforeach(qt_cross_path) - SET(QT_MKSPECS_DIR NOTFOUND) - FIND_PATH(QT_MKSPECS_DIR NAMES qconfig.pri + 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() + 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") + if(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri") + file(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents) + string(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG "${_qconfig_FILE_contents}") + string(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG "${_qconfig_FILE_contents}") + string(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}") + string(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}") + string(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}") + endif(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri") + if("${QT_EDITION}" MATCHES "DesktopLight") + set(QT_EDITION_DESKTOPLIGHT 1) + endif("${QT_EDITION}" MATCHES "DesktopLight") # ask qmake for the library dir as a hint, then search for QtCore library and use that as a reference for finding the # others and for setting QT_LIBRARY_DIR - IF (NOT (QT_QTCORE_LIBRARY_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(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG) # 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(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a) + endif(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC) - 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(Qt4_FIND_REQUIRED) + 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) + 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) + 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) # 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(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(APPLE) + set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_OLD}) + endif(APPLE) # 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(QT_USE_FRAMEWORKS) + set(QT_INCLUDE_DIR ${QT_HEADERS_DIR}) + endif(QT_USE_FRAMEWORKS) + endif(QT_HEADERS_DIR) # Set QT_INCLUDES - SET( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR}) + 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 (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED) # 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 + 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 (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED) # 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 (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED) # 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 + 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 (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED) # 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 +724,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(QT_QMAKE_CHANGED) CHECK_CXX_SYMBOL_EXISTS(QT_MAC_USE_COCOA "QtCore/qconfig.h" QT_MAC_USE_COCOA) - ENDIF(Q_WS_MAC) + endif(Q_WS_MAC) - 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 (NOT QT_IS_QTCOPY) + endif (QT_QTCOPY_REQUIRED) # 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 +761,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(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) + 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} + 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,31 +810,31 @@ 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(${QT_MODULE} STREQUAL "phonon") + endforeach(QT_MODULE) - 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(Q_WS_WIN) # 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 @@ -842,7 +842,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) ) # 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 @@ -850,7 +850,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) ) # 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 +864,48 @@ 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) + endforeach(QT_MODULE) # 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(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE) # Set QT_QTDESIGNERCOMPONENTS_LIBRARY - FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH 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(Q_WS_WIN) # Set QT_QTASSISTANTCLIENT_LIBRARY - FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH 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(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE) ############################################ @@ -919,9 +919,9 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) # 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(QT_MODULE) _QT4_ADJUST_LIB_VARS(QtAssistant) _QT4_ADJUST_LIB_VARS(QtAssistantClient) @@ -929,11 +929,11 @@ 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(Q_WS_WIN) ####################################### @@ -944,104 +944,104 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) ####################################### - 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) + 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 + 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 (QT_MOC_EXECUTABLE) - IF (QT_UIC_EXECUTABLE) - SET(QT_WRAP_UI "YES") - ENDIF (QT_UIC_EXECUTABLE) + if (QT_UIC_EXECUTABLE) + set(QT_WRAP_UI "YES") + endif (QT_UIC_EXECUTABLE) - 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) ############################################### @@ -1050,7 +1050,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) # ############################################### - INCLUDE("${_qt4_current_dir}/Qt4ConfigDependentSettings.cmake") + include("${_qt4_current_dir}/Qt4ConfigDependentSettings.cmake") ####################################### @@ -1059,84 +1059,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_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_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 ) + 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) + 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) # 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(QT_IS_STATIC) # 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(QT_IS_STATIC) + endforeach(QT_PLUGIN) + endforeach(QT_PLUGIN_TYPE) ###################################### @@ -1145,57 +1145,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(QT_QMAKE_EXECUTABLE AND QTVERSION) #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(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION) -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) + 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) + set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY) endif(${_COMPONENT} STREQUAL "QTMAIN") - ENDFOREACH( component ) + endforeach( component ) if(Qt4_FIND_COMPONENTS MATCHES QtGui) - SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_UIC_EXECUTABLE) + set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_UIC_EXECUTABLE) endif(Qt4_FIND_COMPONENTS MATCHES QtGui) -ELSE( Qt4_FIND_COMPONENTS ) +else( Qt4_FIND_COMPONENTS ) # 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( Qt4_FIND_COMPONENTS ) 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(Qt4_FIND_REQUIRED) + if(NOT Qt4_FIND_QUIETLY) + message( STATUS "${VERSION_MSG}") + endif(NOT Qt4_FIND_QUIETLY) + endif(Qt4_FIND_REQUIRED) else() FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4 REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} @@ -1209,8 +1209,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 ccbcb3187..518f42323 100644 --- a/Modules/FindQuickTime.cmake +++ b/Modules/FindQuickTime.cmake @@ -25,23 +25,23 @@ # 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 +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 + find_library(QUICKTIME_LIBRARY QuickTime HINTS $ENV{QUICKTIME_DIR}/lib $ENV{QUICKTIME_DIR} ) -ENDIF(APPLE) +endif(APPLE) # 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..e806e03ba 100644 --- a/Modules/FindRTI.cmake +++ b/Modules/FindRTI.cmake @@ -29,73 +29,73 @@ # (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(NOT ${QUIET}) +endmacro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG) # Detect the CERTI installation, http://www.cert.fr/CERTI -IF ("$ENV{CERTI_HOME}" STRGREATER "") - FILE(TO_CMAKE_PATH "$ENV{CERTI_HOME}" CERTI_HOME) +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 "") +endif ("$ENV{CERTI_HOME}" STRGREATER "") -SET(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM") +set(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM") # 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 +set(RTI_POSSIBLE_DIRS ${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_LIBRARY) RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library NOT found") -ENDIF (RTI_LIBRARY) +endif (RTI_LIBRARY) -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 (RTI_FEDTIME_LIBRARY) -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_INCLUDE_DIR) RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers NOT found") -ENDIF (RTI_INCLUDE_DIR) +endif (RTI_INCLUDE_DIR) # 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..b4a306a07 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(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) -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("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19") -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(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT) + set(${OUTVAR} "${_RUBY_OUTPUT}" PARENT_SCOPE) + endfunction(_RUBY_CONFIG_VAR) # 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(RUBY_HAS_VENDOR_RUBY) # 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) + 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( + 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(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) # 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_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) +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 +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( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18 OR "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18 OR RUBY_HDR_DIR) # 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}) +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 ) +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 + 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) +endif(WIN32) -FIND_LIBRARY(RUBY_LIBRARY NAMES ${_RUBY_POSSIBLE_LIB_NAMES} HINTS ${RUBY_POSSIBLE_LIB_DIR} ) +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) +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) +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) 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 363591f0c..65fea848d 100644 --- a/Modules/FindSDL.cmake +++ b/Modules/FindSDL.cmake @@ -65,7 +65,7 @@ # (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 @@ -84,7 +84,7 @@ FIND_PATH(SDL_INCLUDE_DIR SDL.h # 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} @@ -96,13 +96,13 @@ FIND_LIBRARY(SDL_LIBRARY_TEMP /opt ) -IF(NOT SDL_BUILDING_LIBRARY) - IF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework") +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} @@ -113,31 +113,31 @@ IF(NOT SDL_BUILDING_LIBRARY) /opt/csw /opt ) - ENDIF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework") -ENDIF(NOT SDL_BUILDING_LIBRARY) + endif(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework") +endif(NOT SDL_BUILDING_LIBRARY) # 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. # 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(NOT APPLE) # 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(MINGW) -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(NOT SDL_BUILDING_LIBRARY) + if(SDLMAIN_LIBRARY) + set(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP}) + endif(SDLMAIN_LIBRARY) + endif(NOT SDL_BUILDING_LIBRARY) # 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 @@ -145,29 +145,29 @@ IF(SDL_LIBRARY_TEMP) # 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 # "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(APPLE) # 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(NOT APPLE) # 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(MINGW) # 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(SDL_LIBRARY_TEMP) -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) diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake index 7128f67fb..3c1f7a00e 100644 --- a/Modules/FindSDL_image.cmake +++ b/Modules/FindSDL_image.cmake @@ -25,7 +25,7 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -FIND_PATH(SDLIMAGE_INCLUDE_DIR SDL_image.h +find_path(SDLIMAGE_INCLUDE_DIR SDL_image.h HINTS $ENV{SDLIMAGEDIR} $ENV{SDLDIR} @@ -49,7 +49,7 @@ FIND_PATH(SDLIMAGE_INCLUDE_DIR SDL_image.h /opt/include ) -FIND_LIBRARY(SDLIMAGE_LIBRARY +find_library(SDLIMAGE_LIBRARY NAMES SDL_image HINTS $ENV{SDLIMAGEDIR} @@ -64,7 +64,7 @@ FIND_LIBRARY(SDLIMAGE_LIBRARY /opt ) -INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLIMAGE REQUIRED_VARS SDLIMAGE_LIBRARY SDLIMAGE_INCLUDE_DIR) diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake index e8da6407a..ed333eec4 100644 --- a/Modules/FindSDL_mixer.cmake +++ b/Modules/FindSDL_mixer.cmake @@ -25,7 +25,7 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -FIND_PATH(SDLMIXER_INCLUDE_DIR SDL_mixer.h +find_path(SDLMIXER_INCLUDE_DIR SDL_mixer.h HINTS $ENV{SDLMIXERDIR} $ENV{SDLDIR} @@ -49,7 +49,7 @@ FIND_PATH(SDLMIXER_INCLUDE_DIR SDL_mixer.h /opt/include ) -FIND_LIBRARY(SDLMIXER_LIBRARY +find_library(SDLMIXER_LIBRARY NAMES SDL_mixer HINTS $ENV{SDLMIXERDIR} @@ -64,7 +64,7 @@ FIND_LIBRARY(SDLMIXER_LIBRARY /opt ) -INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLMIXER REQUIRED_VARS SDLMIXER_LIBRARY SDLMIXER_INCLUDE_DIR) diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake index f1bd0919e..dcab3fd64 100644 --- a/Modules/FindSDL_net.cmake +++ b/Modules/FindSDL_net.cmake @@ -25,7 +25,7 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -FIND_PATH(SDLNET_INCLUDE_DIR SDL_net.h +find_path(SDLNET_INCLUDE_DIR SDL_net.h HINTS $ENV{SDLNETDIR} $ENV{SDLDIR} @@ -48,7 +48,7 @@ FIND_PATH(SDLNET_INCLUDE_DIR SDL_net.h /opt/include/SDL /opt/include ) -FIND_LIBRARY(SDLNET_LIBRARY +find_library(SDLNET_LIBRARY NAMES SDL_net HINTS $ENV{SDLNETDIR} @@ -63,7 +63,7 @@ FIND_LIBRARY(SDLNET_LIBRARY /opt ) -INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLNET REQUIRED_VARS SDLNET_LIBRARY SDLNET_INCLUDE_DIR) diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake index 963a811f5..06ae203ad 100644 --- a/Modules/FindSDL_sound.cmake +++ b/Modules/FindSDL_sound.cmake @@ -69,11 +69,11 @@ # (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} @@ -96,7 +96,7 @@ FIND_PATH(SDL_SOUND_INCLUDE_DIR SDL_sound.h /opt/include ) -FIND_LIBRARY(SDL_SOUND_LIBRARY +find_library(SDL_SOUND_LIBRARY NAMES SDL_sound HINTS $ENV{SDLSOUNDDIR}/lib @@ -110,7 +110,7 @@ FIND_LIBRARY(SDL_SOUND_LIBRARY /opt/lib ) -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 @@ -121,12 +121,12 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) # 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( + # try_compile( # MY_RESULT # ${CMAKE_BINARY_DIR} # ${PROJECT_SOURCE_DIR}/DetermineSoundLibs.c @@ -139,7 +139,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[]) @@ -163,32 +163,32 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) ) # Calling - # TARGET_LINK_LIBRARIES(DetermineSoundLibs "${SDL_SOUND_LIBRARY} ${SDL_LIBRARY}) + # 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 # 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(lib) - # 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 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 + "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 @@ -196,20 +196,20 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) OUTPUT_VARIABLE MY_OUTPUT ) - # MESSAGE("${MY_RESULT}") - # MESSAGE(${MY_OUTPUT}) + # message("${MY_RESULT}") + # message(${MY_OUTPUT}) - IF(NOT MY_RESULT) + 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 @@ -223,14 +223,14 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) /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_") + 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 @@ -244,15 +244,15 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) /opt/csw/lib /opt/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(MODPLUG_LIBRARY) + endif("${MY_OUTPUT}" MATCHES "MODPLUG_") # 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 @@ -268,11 +268,11 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) /opt/csw/lib /opt/lib ) - IF(VORBIS_LIBRARY) - SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${VORBIS_LIBRARY}) - ENDIF(VORBIS_LIBRARY) + if(VORBIS_LIBRARY) + set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${VORBIS_LIBRARY}) + endif(VORBIS_LIBRARY) - FIND_LIBRARY(OGG_LIBRARY + find_library(OGG_LIBRARY NAMES ogg Ogg OGG PATHS $ENV{OGGDIR}/lib @@ -288,15 +288,15 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) /opt/csw/lib /opt/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(OGG_LIBRARY) + endif("${MY_OUTPUT}" MATCHES "ov_") # 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 @@ -310,15 +310,15 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) /opt/csw/lib /opt/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(SMPEG_LIBRARY) + endif("${MY_OUTPUT}" MATCHES "SMPEG_") # 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 @@ -332,18 +332,18 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) /opt/csw/lib /opt/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(FLAC_LIBRARY) + endif("${MY_OUTPUT}" MATCHES "FLAC_") # 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 @@ -357,14 +357,14 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) /opt/csw/lib /opt/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(SPEEX_LIBRARY) # 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 @@ -382,20 +382,20 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) /opt/csw/lib /opt/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_") + 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) + 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) + 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) +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_SOUND REQUIRED_VARS SDL_SOUND_LIBRARIES SDL_SOUND_INCLUDE_DIR) diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake index 8bba2130f..6f238e6a6 100644 --- a/Modules/FindSDL_ttf.cmake +++ b/Modules/FindSDL_ttf.cmake @@ -25,7 +25,7 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -FIND_PATH(SDLTTF_INCLUDE_DIR SDL_ttf.h +find_path(SDLTTF_INCLUDE_DIR SDL_ttf.h HINTS $ENV{SDLTTFDIR} $ENV{SDLDIR} @@ -49,7 +49,7 @@ FIND_PATH(SDLTTF_INCLUDE_DIR SDL_ttf.h /opt/include ) -FIND_LIBRARY(SDLTTF_LIBRARY +find_library(SDLTTF_LIBRARY NAMES SDL_ttf HINTS $ENV{SDLTTFDIR} @@ -64,7 +64,7 @@ FIND_LIBRARY(SDLTTF_LIBRARY PATH_SUFFIXES lib64 lib ) -INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLTTF REQUIRED_VARS SDLTTF_LIBRARY SDLTTF_INCLUDE_DIR) diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake index d11d1e47b..33cf9d16d 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(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}) # 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(SWIG_version_result) + 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(SWIG_version_result) + endif(SWIG_DIR) + endif(SWIG_swiglib_result) +endif(SWIG_EXECUTABLE) -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 d13b0c4dd..7d446616c 100644 --- a/Modules/FindSelfPackers.cmake +++ b/Modules/FindSelfPackers.cmake @@ -18,9 +18,9 @@ # (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 @@ -29,7 +29,7 @@ FIND_PROGRAM(SELF_PACKER_FOR_EXECUTABLE /sbin ) -FIND_PROGRAM(SELF_PACKER_FOR_SHARED_LIB +find_program(SELF_PACKER_FOR_SHARED_LIB upx ${CYGWIN_INSTALL_PATH}/bin /bin @@ -38,7 +38,7 @@ FIND_PROGRAM(SELF_PACKER_FOR_SHARED_LIB /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 (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx") + set (SELF_PACKER_FOR_EXECUTABLE_FLAGS "" CACHE STRING "Flags for the executable self-packer.") -ENDIF (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx") +endif (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx") -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 (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx") + 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 (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx") -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 3b69b07f7..0127edccc 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 (SQUISH_FOUND) # #============================================================================= @@ -36,24 +36,24 @@ # (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(dir) + 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 # Look for an environment variable SQUISH_INSTALL_DIR. $ENV{SQUISH_INSTALL_DIR} @@ -65,49 +65,49 @@ IF(NOT SQUISH_INSTALL_DIR) DOC "The ${SQUISH_INSTALL_DIR_STRING}" ) -ENDIF(NOT SQUISH_INSTALL_DIR) +endif(NOT SQUISH_INSTALL_DIR) # 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(NOT SQUISH_CLIENT_EXECUTABLE) # 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(NOT SQUISH_SERVER_EXECUTABLE) -ELSE(SQUISH_INSTALL_DIR) - SET(SQUISH_INSTALL_DIR_FOUND 0) -ENDIF(SQUISH_INSTALL_DIR) +else(SQUISH_INSTALL_DIR) + set(SQUISH_INSTALL_DIR_FOUND 0) +endif(SQUISH_INSTALL_DIR) # 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_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_SERVER_EXECUTABLE) + set(SQUISH_SERVER_EXECUTABLE_FOUND 1) +else(SQUISH_SERVER_EXECUTABLE) + set(SQUISH_SERVER_EXECUTABLE_FOUND 0) +endif(SQUISH_SERVER_EXECUTABLE) # 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) +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} +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 +118,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(SQUISH_ADD_TEST) diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake index 4166d99ab..85c51059c 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( ) @@ -25,13 +25,13 @@ # variable: # _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(SUBVERSION_FOUND) #============================================================================= # 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(NOT ${Subversion_svn_info_result} EQUAL 0) - 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(NOT ${Subversion_svn_info_result} EQUAL 0) # 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(Subversion_WC_INFO) - 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(NOT ${Subversion_svn_log_result} EQUAL 0) + endmacro(Subversion_WC_LOG) -ENDIF(Subversion_SVN_EXECUTABLE) +endif(Subversion_SVN_EXECUTABLE) -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 763b5ef54..9fe2c7aeb 100644 --- a/Modules/FindTCL.cmake +++ b/Modules/FindTCL.cmake @@ -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(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 "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}") -ENDIF(TCLSH_VERSION_STRING) +endif(TCLSH_VERSION_STRING) -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( +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" @@ -101,9 +101,9 @@ IF(WIN32) "C:/Program Files/Tcl/lib" "C:/Tcl/lib" ) -ENDIF(WIN32) +endif(WIN32) -FIND_LIBRARY(TCL_LIBRARY +find_library(TCL_LIBRARY NAMES tcl tcl${TCL_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION} @@ -116,7 +116,7 @@ FIND_LIBRARY(TCL_LIBRARY PATHS ${TCLTK_POSSIBLE_LIB_PATHS} ) -FIND_LIBRARY(TK_LIBRARY +find_library(TK_LIBRARY NAMES tk tk${TK_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION} @@ -132,26 +132,26 @@ 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(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(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(dir) + endif(NOT TK_INCLUDE_PATH) +endif(Tk_FRAMEWORKS) -SET(TCLTK_POSSIBLE_INCLUDE_PATHS +set(TCLTK_POSSIBLE_INCLUDE_PATHS "${TCL_LIBRARY_PATH_PARENT}/include" "${TK_LIBRARY_PATH_PARENT}/include" "${TCL_INCLUDE_PATH}" @@ -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(WIN32) -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 # 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 be410fd03..c09c4c947 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 # 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(TIFF_FOUND) -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 1e8350811..cb7727121 100644 --- a/Modules/FindTclStub.cmake +++ b/Modules/FindTclStub.cmake @@ -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( +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" @@ -85,9 +85,9 @@ IF(WIN32) "C:/Program Files/Tcl/lib" "C:/Tcl/lib" ) -ENDIF(WIN32) +endif(WIN32) -FIND_LIBRARY(TCL_STUB_LIBRARY +find_library(TCL_STUB_LIBRARY NAMES tclstub tclstub${TK_LIBRARY_VERSION} tclstub${TCL_TCLSH_VERSION} tclstub${TK_WISH_VERSION} @@ -100,7 +100,7 @@ FIND_LIBRARY(TCL_STUB_LIBRARY PATHS ${TCLTK_POSSIBLE_LIB_PATHS} ) -FIND_LIBRARY(TK_STUB_LIBRARY +find_library(TK_STUB_LIBRARY NAMES tkstub tkstub${TCL_LIBRARY_VERSION} tkstub${TCL_TCLSH_VERSION} tkstub${TK_WISH_VERSION} @@ -113,7 +113,7 @@ FIND_LIBRARY(TK_STUB_LIBRARY PATHS ${TCLTK_POSSIBLE_LIB_PATHS} ) -FIND_LIBRARY(TTK_STUB_LIBRARY +find_library(TTK_STUB_LIBRARY NAMES ttkstub ttkstub${TCL_LIBRARY_VERSION} ttkstub${TCL_TCLSH_VERSION} ttkstub${TK_WISH_VERSION} @@ -124,7 +124,7 @@ FIND_LIBRARY(TTK_STUB_LIBRARY 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 fdeafffaf..1e356f526 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(CYGWIN) -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( +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(WIN32) -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(TCL_TCLSH) # 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 bb1ba3c9f..22bffef4a 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(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(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 + 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 + 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("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG") - 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(NOT CMAKE_HAVE_THREADS_LIBRARY) + endif(CMAKE_HAVE_PTHREAD_H) +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_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 "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) + 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) +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 4ada05c47..a69e3f10c 100644 --- a/Modules/FindUnixCommands.cmake +++ b/Modules/FindUnixCommands.cmake @@ -15,9 +15,9 @@ # (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 @@ -25,11 +25,11 @@ FIND_PROGRAM(BASH /usr/local/bin /sbin ) -MARK_AS_ADVANCED( +mark_as_advanced( BASH ) -FIND_PROGRAM(CP +find_program(CP cp ${CYGWIN_INSTALL_PATH}/bin /bin @@ -37,11 +37,11 @@ FIND_PROGRAM(CP /usr/local/bin /sbin ) -MARK_AS_ADVANCED( +mark_as_advanced( CP ) -FIND_PROGRAM(GZIP +find_program(GZIP gzip ${CYGWIN_INSTALL_PATH}/bin /bin @@ -49,11 +49,11 @@ FIND_PROGRAM(GZIP /usr/local/bin /sbin ) -MARK_AS_ADVANCED( +mark_as_advanced( GZIP ) -FIND_PROGRAM(MV +find_program(MV mv ${CYGWIN_INSTALL_PATH}/bin /bin @@ -61,11 +61,11 @@ FIND_PROGRAM(MV /usr/local/bin /sbin ) -MARK_AS_ADVANCED( +mark_as_advanced( MV ) -FIND_PROGRAM(RM +find_program(RM rm ${CYGWIN_INSTALL_PATH}/bin /bin @@ -73,11 +73,11 @@ FIND_PROGRAM(RM /usr/local/bin /sbin ) -MARK_AS_ADVANCED( +mark_as_advanced( RM ) -FIND_PROGRAM(TAR +find_program(TAR NAMES tar gtar @@ -88,6 +88,6 @@ FIND_PROGRAM(TAR /usr/local/bin /sbin ) -MARK_AS_ADVANCED( +mark_as_advanced( TAR ) diff --git a/Modules/FindVTK.cmake b/Modules/FindVTK.cmake index fbdac7f8f..a6257f5e6 100644 --- a/Modules/FindVTK.cmake +++ b/Modules/FindVTK.cmake @@ -41,53 +41,53 @@ # 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(VTK_BINARY_PATH AND USE_BUILT_VTK) + 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(VTK_INSTALL_PATH AND USE_INSTALLED_VTK) # Look for UseVTK.cmake in build trees or under /include/vtk. - FIND_PATH(VTK_DIR + find_path(VTK_DIR NAMES UseVTK.cmake PATH_SUFFIXES vtk-4.0 vtk HINTS $ENV{VTK_DIR} @@ -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_FOUND) # 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(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) diff --git a/Modules/FindWget.cmake b/Modules/FindWget.cmake index ee4057dfd..a1dd47f77 100644 --- a/Modules/FindWget.cmake +++ b/Modules/FindWget.cmake @@ -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 # 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 8a1cd8d36..5f1789066 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(UNIX) -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( +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(WIN32) -SET(TK_WISH_NAMES +set(TK_WISH_NAMES wish wish${TCL_LIBRARY_VERSION} wish${TK_LIBRARY_VERSION} wish${TCL_TCLSH_VERSION} wish86 wish8.6 @@ -77,9 +77,9 @@ SET(TK_WISH_NAMES 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..1c16af573 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,358 @@ 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_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_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}) + 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_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) + 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_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_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) + 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) + 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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) + if(X11_SM_LIB AND X11_SM_INCLUDE_PATH) + set(X11_SM_FOUND TRUE) + endif(X11_SM_LIB AND X11_SM_INCLUDE_PATH) # 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 (X11_X11_INCLUDE_PATH AND X11_LIBRARIES) - 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($ENV{ISC} MATCHES "^yes$") + 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 (X11_LIB_DNET_HAS_DNET_NTOA) 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 (X11_LIB_DNET_STUB_HAS_DNET_NTOA) + endif (X11_LIB_DNET_HAS_DNET_NTOA) + endif(NOT X11_LIB_X11_SOLO) # 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 (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) 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 (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) + endif (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) + endif(NOT CMAKE_HAVE_GETHOSTBYNAME) # 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 (CMAKE_LIB_SOCKET_HAS_CONNECT) + endif(NOT CMAKE_HAVE_CONNECT) # 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 (CMAKE_LIB_POSIX_HAS_REMOVE) + endif(NOT CMAKE_HAVE_REMOVE) # 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 (CMAKE_LIB_IPS_HAS_SHMAT) + endif(NOT CMAKE_HAVE_SHMAT) + endif($ENV{ISC} MATCHES "^yes$") - 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(X11_SM_LIB) + endif(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER) + endif (X11_ICE_FOUND) # 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 (X11_FOUND) + if (X11_FIND_REQUIRED) + message(FATAL_ERROR "Could not find X11") + endif (X11_FIND_REQUIRED) + endif (X11_FOUND) - MARK_AS_ADVANCED( + mark_as_advanced( X11_X11_INCLUDE_PATH X11_X11_LIB X11_Xext_LIB @@ -486,7 +486,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 (UNIX) # X11_FIND_REQUIRED_ could be checked too diff --git a/Modules/FindXMLRPC.cmake b/Modules/FindXMLRPC.cmake index eccfb487a..0fae1d718 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(XMLRPC_C_CONFIG) + set(XMLRPC_FOUND 0) +endif(XMLRPC_C_CONFIG) # 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(COMMAND EXECUTE_PROCESS) + 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(COMMAND EXECUTE_PROCESS) # 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("${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) # 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(COMMAND EXECUTE_PROCESS) + 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(COMMAND EXECUTE_PROCESS) # 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("${flag}" MATCHES "^-L") + endforeach(flag) # 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(NOT XMLRPC_${name}_LIBRARY) # 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(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) # 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(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) diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake index e42b5a416..6b3c4cf94 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( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$") - SET(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}") - SET(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}") - SET(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}") -ENDIF() + set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}") + set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}") + set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}") +endif() # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if # all listed variables are TRUE -INCLUDE(${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/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index bf45dc616..b1a17a89a 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -4,7 +4,7 @@ # modules that you will use, you need to name them as components to # the package: # -# FIND_PACKAGE(wxWidgets COMPONENTS 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 @@ -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( ${wxWidgets_LIBRARIES}) -# ENDIF(wxWidgets_FOUND) +# target_link_libraries( ${wxWidgets_LIBRARIES}) +# endif(wxWidgets_FOUND) # # 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( ${wxWidgets_LIBRARIES}) +# target_link_libraries( ${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 @@ -143,21 +143,21 @@ # # 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(DBG_MSG) +macro(DBG_MSG_V _MSG) +# message(STATUS # "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") -ENDMACRO(DBG_MSG_V) +endmacro(DBG_MSG_V) # 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 , 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(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS) 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(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") + set(wxWidgets_USE_FILE UsewxWidgets) +endif(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") #===================================================================== #===================================================================== -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(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) #===================================================================== # 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(wxWidgets_USE_MONOLITHIC) + set(wxWidgets_FIND_COMPONENTS core base) # this is default + endif(wxWidgets_USE_MONOLITHIC) + endif(NOT wxWidgets_FIND_COMPONENTS) # 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(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES) #------------------------------------------------------------------- # 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(${_UCD} STREQUAL ${_CONFIGURATION}) + string(REGEX MATCH "d$" ${_DBG} "${_CONFIGURATION}") + endmacro(WX_GET_NAME_COMPONENTS) # # 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(LIB) # 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(LIB) # 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,102 +323,102 @@ 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(LIB) + endmacro(WX_FIND_LIBS) # # 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(WX_CLEAR_LIB) # 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(LIB) # 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(LIB) # 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(LIB) + endmacro(WX_CLEAR_ALL_LIBS) # 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(WX_CLEAR_ALL_DBG_LIBS) # 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(WX_CLEAR_ALL_REL_LIBS) # # 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(WX_${LIB} AND WX_${LIB}d) 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(WX_${LIB} AND WX_${LIB}d) + endforeach(LIB) + else(WX_USE_REL_AND_DBG) + 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(WX_${LIB}${_DBG}) 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(WX_${LIB}${_DBG}) + endforeach(LIB) + endif(WX_USE_REL_AND_DBG) 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(NOT WX_USE_GL EQUAL -1) - LIST(APPEND wxWidgets_LIBRARIES winmm comctl32 rpcrt4 wsock32) - ENDMACRO(WX_SET_LIBRARIES) + list(APPEND wxWidgets_LIBRARIES winmm comctl32 rpcrt4 wsock32) + endmacro(WX_SET_LIBRARIES) #------------------------------------------------------------------- # 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} @@ -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(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR) - 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(MINGW) + set(WX_LIB_DIR_PREFIX vc) + endif(MINGW) + 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(BUILD_SHARED_LIBS) + 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(BUILD_SHARED_LIBS) # 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(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR) - 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(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*") # 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(EXISTS ${WX_LIB_DIR}/${CFG}) + endforeach(CFG) 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(NOT WX_${wxWidgets_CONFIGURATION}_FOUND) + set(wxWidgets_CONFIGURATION ${wxWidgets_CONFIGURATION} CACHE STRING "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE) - ENDIF(NOT WX_${wxWidgets_CONFIGURATION}_FOUND) + endif(NOT WX_${wxWidgets_CONFIGURATION}_FOUND) # 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(WX_${wxWidgets_CONFIGURATION}d_FOUND) # 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(wxWidgets_USE_REL_AND_DBG) + set(WX_USE_REL_AND_DBG FALSE) + endif(WX_${wxWidgets_CONFIGURATION}d_FOUND) # 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(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) 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(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) # Set wxWidgets main include directory. - IF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) - LIST(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include) - ELSE(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) + if(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) + list(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include) + else(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) DBG_MSG("wxWidgets_FOUND FALSE because WX_ROOT_DIR=${WX_ROOT_DIR} has no ${WX_ROOT_DIR}/include/wx/wx.h") - SET(wxWidgets_FOUND FALSE) - ENDIF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) + set(wxWidgets_FOUND FALSE) + endif(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) # Find wxWidgets libraries. WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}") - IF(WX_USE_REL_AND_DBG) + if(WX_USE_REL_AND_DBG) WX_FIND_LIBS("${UNV}" "${UCD}" "d") - ENDIF(WX_USE_REL_AND_DBG) + endif(WX_USE_REL_AND_DBG) # 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("${UCD}" STREQUAL "u") # 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(WX_CONFIGURATION) + endif(WX_LIB_DIR) + endif(WX_ROOT_DIR) #===================================================================== # UNIX_FIND_STYLE #===================================================================== -ELSE(wxWidgets_FIND_STYLE STREQUAL "win32") - IF(wxWidgets_FIND_STYLE STREQUAL "unix") +else(wxWidgets_FIND_STYLE STREQUAL "win32") + 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(_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) # # 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(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0) # 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(_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) # # 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(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) #----------------------------------------------------------------- # 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(RET EQUAL 0) + set(wxWidgets_FOUND FALSE) DBG_MSG_V( "${wxWidgets_CONFIG_EXECUTABLE} --cxxflags FAILED with RET=${RET}") - ENDIF(RET EQUAL 0) + endif(RET EQUAL 0) # 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(RET EQUAL 0) + 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(RET EQUAL 0) + endif(wxWidgets_CONFIG_EXECUTABLE) #===================================================================== # Neither UNIX_FIND_STYLE, nor WIN32_FIND_STYLE #===================================================================== - ELSE(wxWidgets_FIND_STYLE STREQUAL "unix") - IF(NOT wxWidgets_FIND_QUIETLY) - MESSAGE(STATUS + else(wxWidgets_FIND_STYLE STREQUAL "unix") + 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(NOT wxWidgets_FIND_QUIETLY) + endif(wxWidgets_FIND_STYLE STREQUAL "unix") +endif(wxWidgets_FIND_STYLE STREQUAL "win32") # 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,7 +841,7 @@ 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 ) @@ -852,10 +852,10 @@ FIND_PROGRAM(wxWidgets_wxrc_EXECUTABLE wxrc # respectively, of . # # 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) # # WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o file.C) # @@ -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} "") + #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(_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) + set(${_leftvar} ${${_leftvar}} PARENT_SCOPE) + set(${_rightvar} ${${_rightvar}} PARENT_SCOPE) +endfunction(WX_SPLIT_ARGUMENTS_ON) # # 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,25 +909,25 @@ 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(NOT IS_ABSOLUTE "${dep_file}") # append file to dependency list - LIST(APPEND ${_depends} "${dep_file}") - ENDFOREACH(dep_file) + list(APPEND ${_depends} "${dep_file}") + endforeach(dep_file) - SET(${_depends} ${${_depends}} PARENT_SCOPE) -ENDFUNCTION(WX_GET_DEPENDENCIES_FROM_XML) + set(${_depends} ${${_depends}} PARENT_SCOPE) +endfunction(WX_GET_DEPENDENCIES_FROM_XML) # # WXWIDGETS_ADD_RESOURCES( @@ -940,21 +940,21 @@ ENDFUNCTION(WX_GET_DEPENDENCIES_FROM_XML) # 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(rc_file) # # 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(index EQUAL -1) + 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(index EQUAL -1) # 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(NOT index EQUAL -1) # - 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}") + 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( + if(NOT IS_ABSOLUTE "${outfile}") + set(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}") + endif(NOT IS_ABSOLUTE "${outfile}") + 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(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1) # 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(WXWIDGETS_ADD_RESOURCES) diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake index dfb28ff90..66373cdcc 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(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_STYLE_FIND) +if(WIN32_STYLE_FIND) ## ###################################################################### ## @@ -106,7 +106,7 @@ IF(WIN32_STYLE_FIND) ## fix the root dir to avoid mixing of headers/libs from different ## versions/builds: - SET (WXWINDOWS_POSSIBLE_ROOT_PATHS + 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 @@ -121,54 +121,54 @@ IF(WIN32_STYLE_FIND) ## 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 + find_path(WXWINDOWS_ROOT_DIR include/wx/wx.h ${WXWINDOWS_POSSIBLE_ROOT_PATHS} ) - # MESSAGE("DBG found WXWINDOWS_ROOT_DIR: ${WXWINDOWS_ROOT_DIR}") + # 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 +180,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 +195,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 +268,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 +283,11 @@ IF(WIN32_STYLE_FIND) DOC "wxWindows shared debug build GL library" ) - ELSE (WXWINDOWS_USE_MONOLITHIC) + else (WXWINDOWS_USE_MONOLITHIC) ## 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 +297,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 +323,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 +346,7 @@ IF(WIN32_STYLE_FIND) rpcrt4 wsock32 ) - ENDIF (WXWINDOWS_USE_MONOLITHIC) + endif (WXWINDOWS_USE_MONOLITHIC) ## @@ -356,22 +356,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(WXWINDOWS_SHARED_LIBRARY OR WXWINDOWS_SHARED_DEBUG_LIBRARY) ## 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 +380,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 (NOT WXWINDOWS_USE_SHARED_LIBS) ## 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 (WXWINDOWS_USE_GL) ## ## select between use of shared or static wxWindows lib then set libs to use @@ -399,162 +399,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 (WXWINDOWS_USE_GL) + endif(WXWINDOWS_SHARED_DEBUG_LIBRARY AND WXWINDOWS_SHARED_LIBRARY) ## 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 (WXWINDOWS_USE_GL) + endif(NOT WXWINDOWS_SHARED_LIBRARY) + endif(WXWINDOWS_SHARED_DEBUG_LIBRARY) ## 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 (WXWINDOWS_USE_GL) + endif(WXWINDOWS_SHARED_LIBRARY) + endif(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY) ## 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(NOT WXWINDOWS_SHARED_LIBRARY) + endif(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY) ######################################################################################### - ELSE(WXWINDOWS_USE_SHARED_LIBS) + else(WXWINDOWS_USE_SHARED_LIBS) - ##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 (WXWINDOWS_USE_GL) + endif(WXWINDOWS_STATIC_DEBUG_LIBRARY AND WXWINDOWS_STATIC_LIBRARY) ## 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 (WXWINDOWS_USE_GL) + endif(NOT WXWINDOWS_STATIC_LIBRARY) + endif(WXWINDOWS_STATIC_DEBUG_LIBRARY) ## 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 (WXWINDOWS_USE_GL) + endif(WXWINDOWS_STATIC_LIBRARY) + endif(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY) ## 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(NOT WXWINDOWS_STATIC_LIBRARY) + endif(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY AND NOT WXWINDOWS_SEPARATE_LIBS_BUILD) + endif(WXWINDOWS_USE_SHARED_LIBS) ## 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 (WXWINDOWS_SET_DEFINITIONS) # clear: - SET(WXWINDOWS_DEFINITIONS "") - ENDIF (WXWINDOWS_SET_DEFINITIONS) + set(WXWINDOWS_DEFINITIONS "") + endif (WXWINDOWS_SET_DEFINITIONS) ## 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 (WXWINDOWS_INCLUDE_DIR_SETUPH) - MARK_AS_ADVANCED( + mark_as_advanced( WXWINDOWS_ROOT_DIR WXWINDOWS_INCLUDE_DIR WXWINDOWS_INCLUDE_DIR_SETUPH @@ -579,9 +579,9 @@ IF(WIN32_STYLE_FIND) ) -ELSE(WIN32_STYLE_FIND) +else(WIN32_STYLE_FIND) - IF (UNIX_STYLE_FIND) + if (UNIX_STYLE_FIND) ## ###################################################################### ## ## UNIX/Linux specific: @@ -590,85 +590,85 @@ 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 + find_program(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE wx-config $ENV{WXWIN} $ENV{WXWIN}/bin ../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(WXWINDOWS_USE_SHARED_LIBS) + set(WX_CONFIG_ARGS_LIBS "--static --libs") + endif(WXWINDOWS_USE_SHARED_LIBS) # 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(WXWINDOWS_USE_GL) + ##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(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: ##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*" ## with 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(WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX) ## 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 +677,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(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(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(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) -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}) + 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) + endif(WXWINDOWS_INCLUDE_DIR OR CMAKE_WXWINDOWS_CXX_FLAGS) +endif(WXWINDOWS_LIBRARIES) 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..f6b185f14 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(CMAKE_CL_64) + set(CMAKE_MSVC_ARCH x86) + endif(CMAKE_CL_64) - 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(MSVC70) - IF(MSVC71) - SET(__install__libs + if(MSVC71) + set(__install__libs "${SYSTEMROOT}/system32/msvcp71.dll" "${SYSTEMROOT}/system32/msvcr71.dll" ) - ENDIF(MSVC71) + endif(MSVC71) - 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(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) - 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(CMAKE_INSTALL_DEBUG_LIBRARIES) + endif(MSVC80) - 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(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) - 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(CMAKE_INSTALL_DEBUG_LIBRARIES) + endif(MSVC90) - 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(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) - 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(CMAKE_INSTALL_DEBUG_LIBRARIES) + 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(MSVC70) - IF(MSVC71) - SET(__install__libs ${__install__libs} + if(MSVC71) + set(__install__libs ${__install__libs} "${SYSTEMROOT}/system32/mfc71.dll" ) - ENDIF(MSVC71) + endif(MSVC71) - 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(CMAKE_INSTALL_DEBUG_LIBRARIES) - 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(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) # 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(MSVC80) - 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(CMAKE_INSTALL_DEBUG_LIBRARIES) - 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(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) # 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,35 +281,35 @@ IF(MSVC) "${MSVC90_MFCLOC_DIR}/mfc90jpn.dll" "${MSVC90_MFCLOC_DIR}/mfc90kor.dll" ) - ENDIF(MSVC90) + endif(MSVC90) - 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(CMAKE_INSTALL_DEBUG_LIBRARIES) - 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(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) # 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" @@ -320,82 +320,82 @@ IF(MSVC) "${MSVC${v}_MFCLOC_DIR}/mfc${v}0jpn.dll" "${MSVC${v}_MFCLOC_DIR}/mfc${v}0kor.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(CMAKE_INSTALL_MFC_LIBRARIES) - 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(EXISTS ${lib}) + 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) + 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 +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(WIN32) + set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib) + endif(WIN32) + endif(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION) + 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(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP) +endif(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS) diff --git a/Modules/KDE3Macros.cmake b/Modules/KDE3Macros.cmake index 5b76000e8..858b7d63f 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 (NOT HAVE_${_basename}_KIDL_RULE) - 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 (NOT HAVE_${_basename}_SKEL_RULE) - SET(${_sources} ${${_sources}} ${_skel}) + set(${_sources} ${${_sources}} ${_skel}) - ENDFOREACH (_current_FILE) + endforeach (_current_FILE) -ENDMACRO(KDE3_ADD_DCOP_SKELS) +endmacro(KDE3_ADD_DCOP_SKELS) -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 (NOT HAVE_${_basename}_KIDL_RULE) - 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 (NOT HAVE_${_basename}_STUB_RULE) - SET(${_sources} ${${_sources}} ${_stub_CPP}) + set(${_sources} ${${_sources}} ${_stub_CPP}) - ENDFOREACH (_current_FILE) + endforeach (_current_FILE) -ENDMACRO(KDE3_ADD_DCOP_STUBS) +endmacro(KDE3_ADD_DCOP_STUBS) -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 (_current_FILE) -ENDMACRO(KDE3_ADD_KCFG_FILES) +endmacro(KDE3_ADD_KCFG_FILES) #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 (_current_FILE) +endmacro(KDE3_ADD_MOC_FILES) -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 (_current_FILE) +endmacro(KDE3_ADD_UI_FILES) -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,25 +219,25 @@ 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(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) -# 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} + add_custom_command(OUTPUT ${_moc} COMMAND ${QT_MOC_EXECUTABLE} ARGS ${_header} -o ${_moc} DEPENDS ${_header} @@ -245,167 +245,167 @@ MACRO(KDE3_AUTOMOC) ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc}) - ENDFOREACH (_current_MOC_INC) - ENDIF(_match) + endforeach (_current_MOC_INC) + endif(_match) - ENDIF (EXISTS ${_abs_FILE} AND NOT _skip) - ENDFOREACH (_current_FILE) -ENDMACRO(KDE3_AUTOMOC) + endif (EXISTS ${_abs_FILE} AND NOT _skip) + endforeach (_current_FILE) +endmacro(KDE3_AUTOMOC) # 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 (${_group} STREQUAL "mime") - IF (${_group} STREQUAL "filesys") - SET(_icon_GROUP "filesystems") - ENDIF (${_group} STREQUAL "filesys") + if (${_group} STREQUAL "filesys") + set(_icon_GROUP "filesystems") + endif (${_group} STREQUAL "filesys") - IF (${_group} STREQUAL "device") - SET(_icon_GROUP "devices") - ENDIF (${_group} STREQUAL "device") + if (${_group} STREQUAL "device") + set(_icon_GROUP "devices") + endif (${_group} STREQUAL "device") - IF (${_group} STREQUAL "app") - SET(_icon_GROUP "apps") - ENDIF (${_group} STREQUAL "app") + if (${_group} STREQUAL "app") + set(_icon_GROUP "apps") + endif (${_group} STREQUAL "app") - IF (${_group} STREQUAL "action") - SET(_icon_GROUP "actions") - ENDIF (${_group} STREQUAL "action") + if (${_group} STREQUAL "action") + set(_icon_GROUP "actions") + endif (${_group} STREQUAL "action") # 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 (NOT ${_group} STREQUAL ${_install_NAME} ) -ENDMACRO (_KDE3_ADD_ICON_INSTALL_RULE) +endmacro (_KDE3_ADD_ICON_INSTALL_RULE) -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 (_current_ICON) # 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 (_current_ICON) -ENDMACRO (KDE3_INSTALL_ICONS) +endmacro (KDE3_INSTALL_ICONS) -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(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") - INSTALL_FILES(${KDE3_LIBTOOL_DIR} FILES ${_laname}) -ENDMACRO(KDE3_INSTALL_LIBTOOL_FILE) + install_files(${KDE3_LIBTOOL_DIR} FILES ${_laname}) +endmacro(KDE3_INSTALL_LIBTOOL_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 (_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 (_current_FILE) -ENDMACRO(KDE3_CREATE_FINAL_FILE) +endmacro(KDE3_CREATE_FINAL_FILE) -# 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 (${_with_PREFIX} STREQUAL "WITH_PREFIX") + set(_first_SRC ${_with_PREFIX}) + endif (${_with_PREFIX} STREQUAL "WITH_PREFIX") -# 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 (KDE3_ENABLE_FINAL) + add_library(${_target_NAME} MODULE ${_first_SRC} ${ARGN}) +# endif (KDE3_ENABLE_FINAL) - IF(_first_SRC) - SET_TARGET_PROPERTIES(${_target_NAME} PROPERTIES PREFIX "") - ENDIF(_first_SRC) + if(_first_SRC) + set_target_properties(${_target_NAME} PROPERTIES PREFIX "") + endif(_first_SRC) KDE3_INSTALL_LIBTOOL_FILE(${_target_NAME}) -ENDMACRO(KDE3_ADD_KPART) +endmacro(KDE3_ADD_KPART) -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 (KDE3_ENABLE_FINAL) + add_library(kdeinit_${_target_NAME} SHARED ${ARGN} ) +# endif (KDE3_ENABLE_FINAL) - 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(KDE3_ADD_KDEINIT_EXECUTABLE) -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 (KDE3_ENABLE_FINAL) + add_executable(${_target_NAME} ${ARGN} ) +# endif (KDE3_ENABLE_FINAL) -ENDMACRO(KDE3_ADD_EXECUTABLE) +endmacro(KDE3_ADD_EXECUTABLE) diff --git a/Modules/MacroAddFileDependencies.cmake b/Modules/MacroAddFileDependencies.cmake index 36a217a2b..5ed5b8d90 100644 --- a/Modules/MacroAddFileDependencies.cmake +++ b/Modules/MacroAddFileDependencies.cmake @@ -4,7 +4,7 @@ # # 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 APPEND PROPERTY OBJECT_DEPENDS depend_files) instead. +# use set_property(SOURCE 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 (_deps) + set(_deps ${ARGN}) + endif (_deps) - SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}") + set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}") -ENDMACRO (MACRO_ADD_FILE_DEPENDENCIES) +endmacro (MACRO_ADD_FILE_DEPENDENCIES) diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake index a9f773ed1..78221b04f 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(type) -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 4021147e7..b2158f5d7 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) +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 " -Wl,-relax -o -Wl,-lgcc,-lc -lnss_files -lnss_dns -lresolv") -ELSE(CMAKE_COMPILER_IS_GNUCC) +else(CMAKE_COMPILER_IS_GNUCC) # when using IBM xlc we probably don't want to link to -lgcc - SET(CMAKE_C_LINK_EXECUTABLE + set(CMAKE_C_LINK_EXECUTABLE " -Wl,-relax -o -Wl,-lc -lnss_files -lnss_dns -lresolv") -ENDIF(CMAKE_COMPILER_IS_GNUCC) +endif(CMAKE_COMPILER_IS_GNUCC) -IF(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_LINK_EXECUTABLE +if(CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_LINK_EXECUTABLE " -Wl,-relax -o -Wl,-lstdc++,-lgcc,-lc -lnss_files -lnss_dns -lresolv") -ELSE(CMAKE_COMPILER_IS_GNUCXX) +else(CMAKE_COMPILER_IS_GNUCXX) # when using the IBM xlC we probably don't want to link to -lgcc - SET(CMAKE_CXX_LINK_EXECUTABLE + set(CMAKE_CXX_LINK_EXECUTABLE " -Wl,-relax -o -Wl,-lstdc++,-lc -lnss_files -lnss_dns -lresolv") -ENDIF(CMAKE_COMPILER_IS_GNUCXX) +endif(CMAKE_COMPILER_IS_GNUCXX) diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake index eae313a50..2ec22191d 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(type) 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 " -O coff ") +set(CMAKE_RC_COMPILE_OBJECT " -O coff ") 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 cf672c9ce..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) +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-GNU.cmake b/Modules/Platform/Darwin-GNU.cmake index 8a50a6ab9..5e9f8f096 100644 --- a/Modules/Platform/Darwin-GNU.cmake +++ b/Modules/Platform/Darwin-GNU.cmake @@ -59,6 +59,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 621905c41..b8e1bdfba 100644 --- a/Modules/Platform/Darwin-icc.cmake +++ b/Modules/Platform/Darwin-icc.cmake @@ -1,102 +1,102 @@ -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 " -E > ") - SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S -o ") - # ENDIF(CMAKE_COMPILER_IS_GNUCC) +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 " -E > ") + set (CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S -o ") + # 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 " -E > ") - SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -S -o ") -# ENDIF(CMAKE_COMPILER_IS_GNUCXX) -ENDIF ( _OSX_VERSION MATCHES "^10.4" ) +# 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 " -E > ") + set (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -S -o ") +# 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") +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(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "") # 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(EXISTS /Developer/SDKs/MacOSX10.4u.sdk) -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("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$") -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(NOT XCODE) # 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(XCODE) -SET(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different ") +set(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different ") -SET(CMAKE_C_CREATE_SHARED_LIBRARY +set(CMAKE_C_CREATE_SHARED_LIBRARY " -o ") -SET(CMAKE_CXX_CREATE_SHARED_LIBRARY +set(CMAKE_CXX_CREATE_SHARED_LIBRARY " -o ") -SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY +set(CMAKE_Fortran_CREATE_SHARED_LIBRARY " -o ") -SET(CMAKE_CXX_CREATE_SHARED_MODULE +set(CMAKE_CXX_CREATE_SHARED_MODULE " -o ") -SET(CMAKE_C_CREATE_SHARED_MODULE +set(CMAKE_C_CREATE_SHARED_MODULE " -o ") -SET(CMAKE_Fortran_CREATE_SHARED_MODULE +set(CMAKE_Fortran_CREATE_SHARED_MODULE " -o ") @@ -106,26 +106,26 @@ SET(CMAKE_Fortran_CREATE_SHARED_MODULE # 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..8e665d1cd 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,131 +8,131 @@ 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("${DARWIN_MAJOR_VERSION}" GREATER 6) +endif(NOT DEFINED HAVE_FLAG_SEARCH_PATHS_FIRST) # 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_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_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") +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) +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_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) +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") +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" +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) +endif(CMAKE_XCODE_SELECT) # Find installed SDKs # Start with Xcode-4.3+ default SDKs directory -SET(_CMAKE_OSX_SDKS_DIR +set(_CMAKE_OSX_SDKS_DIR "${OSX_DEVELOPER_ROOT}/Platforms/MacOSX.platform/Developer/SDKs") -FILE(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*") +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) +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 +execute_process(COMMAND sw_vers -productVersion OUTPUT_VARIABLE CURRENT_OSX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) #---------------------------------------------------------------------------- # _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(_CURRENT_OSX_VERSION VERSION_GREATER 10.3) #---------------------------------------------------------------------------- # 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(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 +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 +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") +endif(_CURRENT_OSX_VERSION STREQUAL "10.4") -IF(_CURRENT_OSX_VERSION STREQUAL "10.3") - SET(CMAKE_OSX_SYSROOT_DEFAULT +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") +endif(_CURRENT_OSX_VERSION STREQUAL "10.3") # 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(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 "") # Set cache variable - end user may change this during ccmake or cmake-gui configure. -SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT_VALUE} CACHE PATH +set(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT_VALUE} CACHE PATH "The product will be built against the headers and libraries located inside the indicated SDK.") #---------------------------------------------------------------------------- @@ -156,113 +156,113 @@ endfunction(SanityCheckSDKAndDeployTarget) SanityCheckSDKAndDeployTarget("${CMAKE_OSX_SYSROOT}" "${CMAKE_OSX_DEPLOYMENT_TARGET}") # set _CMAKE_OSX_MACHINE to uname -m -EXECUTE_PROCESS(COMMAND 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") +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 "") +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 +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("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$") -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(NOT XCODE) # 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(XCODE) -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 " -o ") -SET(CMAKE_CXX_CREATE_SHARED_LIBRARY +set(CMAKE_CXX_CREATE_SHARED_LIBRARY " -o ") -SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY +set(CMAKE_Fortran_CREATE_SHARED_LIBRARY " -o ") -SET(CMAKE_CXX_CREATE_SHARED_MODULE +set(CMAKE_CXX_CREATE_SHARED_MODULE " -o ") -SET(CMAKE_C_CREATE_SHARED_MODULE +set(CMAKE_C_CREATE_SHARED_MODULE " -o ") -SET(CMAKE_Fortran_CREATE_SHARED_MODULE +set(CMAKE_Fortran_CREATE_SHARED_MODULE " -o ") -SET(CMAKE_C_CREATE_MACOSX_FRAMEWORK +set(CMAKE_C_CREATE_MACOSX_FRAMEWORK " -o ") -SET(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK +set(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK " -o ") # 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..b5779023f 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(EXISTS /usr/include/dlfcn.h) # 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(type) -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 " -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o ") diff --git a/Modules/Platform/Generic-ADSP-C.cmake b/Modules/Platform/Generic-ADSP-C.cmake index d35307bc7..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 " -build-lib -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o ") -SET(CMAKE_C_LINK_EXECUTABLE +set(CMAKE_C_LINK_EXECUTABLE " -o ") -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 42d3d56ac..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 " -build-lib -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o ") -SET(CMAKE_CXX_LINK_EXECUTABLE +set(CMAKE_CXX_LINK_EXECUTABLE " -o ") -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 14b92e95a..9120eed11 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, # 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(CMAKE_SYSTEM_PROCESSOR AND NOT ADSP_PROCESSOR) # 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(NOT ADSP_PROCESSOR_SILICIUM_REVISION) # 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(NOT _ADSP_DIR) + if(NOT _ADSP_DIR) + get_filename_component(_ADSP_DIR "${CMAKE_ASM_COMPILER}" PATH) + endif(NOT _ADSP_DIR) # 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(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 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(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 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(NOT ADSP_PROCESSOR) + 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(ADSP_PROCESSOR MATCHES "210..$") - 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(ADSP_PROCESSOR MATCHES "211..$") - 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(ADSP_PROCESSOR MATCHES "212..$") - 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(ADSP_PROCESSOR MATCHES "213..$") - 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(CMAKE_C_COMPILER MATCHES cc21k OR CMAKE_CXX_COMPILER MATCHES cc21k OR CMAKE_ASM_COMPILER MATCHES easm21k) - 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(ADSP_GENERATE_VDK VDK_GENERATED_HEADER VDK_GENERATED_SOURCE VDK_KERNEL_SUPPORT_FILE) # 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(ADSP_CREATE_LOADER_FILE TARGET_NAME BOOT_MODE FORMAT WIDTH) - 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(ADSP_CREATE_LOADER_FILE_INIT TARGET_NAME BOOT_MODE FORMAT WIDTH INITIALIZATION_FILE) -ENDIF(NOT ADSP) +endif(NOT ADSP) diff --git a/Modules/Platform/Generic-SDCC-C.cmake b/Modules/Platform/Generic-SDCC-C.cmake index 6c36445d7..fc7eb42b8 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 # 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) # 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(NOT DEFINED CMAKE_C_FLAGS_INIT) -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(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT) # compile a C file into an object file -SET(CMAKE_C_COMPILE_OBJECT " -o -c ") +set(CMAKE_C_COMPILE_OBJECT " -o -c ") # link object files to an executable -SET(CMAKE_C_LINK_EXECUTABLE " --out-fmt-ihx -o ") +set(CMAKE_C_LINK_EXECUTABLE " --out-fmt-ihx -o ") # needs sdcc 2.7.0 + sddclib from cvs -SET(CMAKE_C_CREATE_STATIC_LIBRARY +set(CMAKE_C_CREATE_STATIC_LIBRARY "\"${CMAKE_COMMAND}\" -E remove " " -a ") # 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 e6f8b2b1e..fcb2699d6 100644 --- a/Modules/Platform/Generic.cmake +++ b/Modules/Platform/Generic.cmake @@ -8,10 +8,10 @@ # and/or ${CMAKE_SYSTEM_NAME}--${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..33257f973 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(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) diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake index 9dda3c528..ec0b8fafb 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(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) diff --git a/Modules/Platform/IRIX.cmake b/Modules/Platform/IRIX.cmake index fac941f3b..221a61df6 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 " -ar -o ") - 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(NOT CMAKE_COMPILER_IS_GNUCXX) # set flags for gcc support -INCLUDE(Platform/UnixPaths) +include(Platform/UnixPaths) -IF(NOT CMAKE_COMPILER_IS_GNUCC) - SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") - SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE +if(NOT CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") + set (CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S " "mv `basename \"\" | sed 's/\\.[^./]*$$//'`.s " ) -ENDIF(NOT CMAKE_COMPILER_IS_GNUCC) +endif(NOT CMAKE_COMPILER_IS_GNUCC) -IF(NOT CMAKE_COMPILER_IS_GNUCXX) - SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") - SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE +if(NOT CMAKE_COMPILER_IS_GNUCXX) + set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") + set (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -S " "mv `basename \"\" | sed 's/\\.[^./]*$$//'`.s " ) -ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) +endif(NOT CMAKE_COMPILER_IS_GNUCXX) # 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(type) # 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 09fa99884..191dfcc20 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("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)") # 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(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$") # 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(CMAKE_FILE_SELF MATCHES " 64-bit ") + endif("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)") # Set remaining defaults. - SET(CMAKE_CXX_CREATE_STATIC_LIBRARY + set(CMAKE_CXX_CREATE_STATIC_LIBRARY " -ar -o ") - 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(NOT CMAKE_COMPILER_IS_GNUCC) +include(Platform/UnixPaths) -IF(NOT CMAKE_COMPILER_IS_GNUCC) - SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") - SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE +if(NOT CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") + set (CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S " "mv `basename \"\" | sed 's/\\.[^./]*$$//'`.s " ) -ENDIF(NOT CMAKE_COMPILER_IS_GNUCC) +endif(NOT CMAKE_COMPILER_IS_GNUCC) -IF(NOT CMAKE_COMPILER_IS_GNUCXX) - SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") - SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE +if(NOT CMAKE_COMPILER_IS_GNUCXX) + set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") + set (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -S " "mv `basename \"\" | sed 's/\\.[^./]*$$//'`.s " ) -ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) +endif(NOT CMAKE_COMPILER_IS_GNUCXX) # 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(type) # 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-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-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 " --prelink_objects " " -o ") # create a C++ static library -SET(CMAKE_CXX_CREATE_STATIC_LIBRARY +set(CMAKE_CXX_CREATE_STATIC_LIBRARY " --prelink_objects " " cr " " ") -SET(CMAKE_CXX_LINK_EXECUTABLE +set(CMAKE_CXX_LINK_EXECUTABLE " --prelink_objects " " -o ") -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..c1dc6420b 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(type) # 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(DEFINED CMAKE_INSTALL_SO_NO_EXE) # 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(EXISTS "/etc/debian_version") + 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(EXISTS "/etc/debian_version") +endif(DEFINED CMAKE_INSTALL_SO_NO_EXE) # 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(EXISTS "/etc/debian_version") diff --git a/Modules/Platform/MP-RAS.cmake b/Modules/Platform/MP-RAS.cmake index ff22a4fda..ae5fa612e 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(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*.") -INCLUDE(Platform/UnixPaths) +include(Platform/UnixPaths) diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake index e1b66b84c..24dd15c7a 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(EXISTS /usr/include/dlfcn.h) -INCLUDE(Platform/UnixPaths) +include(Platform/UnixPaths) diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake index 3017a07c8..e720e4061 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(CMAKE_SYSTEM MATCHES "OSF1-1.[012]") +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(CMAKE_SYSTEM MATCHES "OSF1-1.*") -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(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.*") -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) +if(CMAKE_COMPILER_IS_GNUCXX) # include the gcc flags -ELSE (CMAKE_COMPILER_IS_GNUCXX) +else (CMAKE_COMPILER_IS_GNUCXX) # 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(CMAKE_COMPILER_IS_GNUCXX) +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 " cr " " " ) -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..fedc0b41b 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(type) # 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 " -x c++ -o -c ") -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 39cb48cd7..a1fc72f20 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(CMAKE_SYSTEM MATCHES "SunOS-4.*") -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 " -o ") - ELSE(CMAKE_COMPILER_IS_GNUCC) + else(CMAKE_COMPILER_IS_GNUCC) # Take default rule from CMakeDefaultMakeRuleVariables.cmake. - ENDIF(CMAKE_COMPILER_IS_GNUCC) -ENDIF(CMAKE_COMPILER_IS_GNUCXX) -INCLUDE(Platform/UnixPaths) + endif(CMAKE_COMPILER_IS_GNUCC) +endif(CMAKE_COMPILER_IS_GNUCXX) +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("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro) # 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 154d7e6ac..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 6aef11180..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 @@ -56,7 +56,7 @@ LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH /usr/openwin/include ) -LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH +list(APPEND CMAKE_SYSTEM_LIBRARY_PATH # Windows API on Cygwin /usr/lib/w32api @@ -69,20 +69,20 @@ LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /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-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-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 16b3c814b..ec78886e1 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 /fo ") +enable_language(RC) +set(CMAKE_COMPILE_RESOURCE "rc /fo ") -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 /fo ") -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(CMAKE_VERBOSE_MAKEFILE) + set(CMAKE_CL_NOLOGO "/nologo") +endif(CMAKE_VERBOSE_MAKEFILE) +set(CMAKE_COMPILE_RESOURCE "rc /fo ") +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_ROOT_BIN}/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(_XILINK_HELP MATCHES MANIFEST) + if(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake") + file(WRITE ${CMAKE_PLATFORM_ROOT_BIN}/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(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake") +endif(NOT _INTEL_XILINK_TEST_RUN) macro(__windows_compiler_intel lang) set(CMAKE_${lang}_COMPILE_OBJECT @@ -98,11 +98,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 " -E vs_link_exe ${CMAKE_${lang}_LINK_EXECUTABLE}") - SET(CMAKE_${lang}_CREATE_SHARED_LIBRARY + set(CMAKE_${lang}_CREATE_SHARED_LIBRARY " -E vs_link_dll ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}") - SET(CMAKE_${lang}_CREATE_SHARED_MODULE + set(CMAKE_${lang}_CREATE_SHARED_MODULE " -E vs_link_dll ${CMAKE_${lang}_CREATE_SHARED_MODULE}") endif() endmacro() diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index 34b11253e..216419f78 100644 --- a/Modules/Platform/Windows-cl.cmake +++ b/Modules/Platform/Windows-cl.cmake @@ -1,32 +1,32 @@ # try to load any previously computed information for C on this platform -INCLUDE( ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake OPTIONAL) +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) +include( ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake OPTIONAL) -SET(WIN32 1) +set(WIN32 1) -INCLUDE(Platform/cl) +include(Platform/cl) -SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) -SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) +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 +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") + 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") +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 /fo ") +enable_language(RC) +set(CMAKE_COMPILE_RESOURCE "rc /fo ") # for nmake we need to compute some information about the compiler # that is being used. @@ -36,218 +36,218 @@ SET(CMAKE_COMPILE_RESOURCE "rc /fo ") # 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 +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} + 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 + 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" + 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 + 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) + 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 + 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 + 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 + 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 + 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") + 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_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() +if("${MSVC_VERSION}" GREATER 1599) + set(MSVC_INCREMENTAL_DEFAULT ON) +endif() # default to Debug builds -IF(MSVC_VERSION GREATER 1310) +if(MSVC_VERSION GREATER 1310) # for 2005 make sure the manifest is put in the dll with mt - SET(CMAKE_CXX_CREATE_SHARED_LIBRARY " -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_LIBRARY}") - SET(CMAKE_CXX_CREATE_SHARED_MODULE " -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_MODULE}") + set(CMAKE_CXX_CREATE_SHARED_LIBRARY " -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_LIBRARY}") + set(CMAKE_CXX_CREATE_SHARED_MODULE " -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}") + 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 " -E vs_link_exe ${CMAKE_CXX_LINK_EXECUTABLE}") - SET(CMAKE_C_LINK_EXECUTABLE " -E vs_link_exe ${CMAKE_C_LINK_EXECUTABLE}") + set(CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE}") + set(CMAKE_CXX_LINK_EXECUTABLE " -E vs_link_exe ${CMAKE_CXX_LINK_EXECUTABLE}") + set(CMAKE_C_LINK_EXECUTABLE " -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_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}") +set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") # executable linker flags -SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") +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 +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() +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) +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") +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}) +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}) +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 +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") +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 +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") +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 index 82a0e595f..4f3ec3ee8 100644 --- a/Modules/Platform/Windows-cl.cmake.in +++ b/Modules/Platform/Windows-cl.cmake.in @@ -1,14 +1,14 @@ -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) +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..dff58c575 100644 --- a/Modules/Platform/Windows-df.cmake +++ b/Modules/Platform/Windows-df.cmake @@ -1,70 +1,70 @@ # 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(CMAKE_VERBOSE_MAKEFILE) + set(CMAKE_CL_NOLOGO "/nologo") +endif(CMAKE_VERBOSE_MAKEFILE) -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: /dll ${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} /out: ") +set(CMAKE_Fortran_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} /out: ") # compile a C++ file into an object file -SET(CMAKE_Fortran_COMPILE_OBJECT +set(CMAKE_Fortran_COMPILE_OBJECT " ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /object: /compile_only ${CMAKE_END_TEMP_FILE}") -SET(CMAKE_COMPILE_RESOURCE "rc /fo ") +set(CMAKE_COMPILE_RESOURCE "rc /fo ") -SET(CMAKE_Fortran_LINK_EXECUTABLE +set(CMAKE_Fortran_LINK_EXECUTABLE " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /exe: /link ${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(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 "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(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") # 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 (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_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 21c4a6907..977531d44 100644 --- a/Modules/Platform/Windows-wcl386.cmake +++ b/Modules/Platform/Windows-wcl386.cmake @@ -1,87 +1,87 @@ -SET(CMAKE_LIBRARY_PATH_FLAG "libpath ") -SET(CMAKE_LINK_LIBRARY_FLAG "library ") -SET(CMAKE_LINK_LIBRARY_FILE_FLAG "library") +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) +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_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_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_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_C_CREATE_IMPORT_LIBRARY "wlib -c -q -n -b +''") -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 '' option caseexact file {} ${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_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -dWIN32 -d+ -fo -c -cc++ ${CMAKE_END_TEMP_FILE}") # compile a C file into an object file -SET(CMAKE_C_COMPILE_OBJECT +set(CMAKE_C_COMPILE_OBJECT " ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -dWIN32 -d+ -fo -c -cc ${CMAKE_END_TEMP_FILE}") # preprocess a C source file -SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE +set(CMAKE_C_CREATE_PREPROCESSED_SOURCE " ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -dWIN32 -d+ -fo -pl -cc ${CMAKE_END_TEMP_FILE}") # preprocess a C++ source file -SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE +set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -dWIN32 -d+ -fo -pl -cc++ ${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 '' option caseexact file {} ${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 '' ") +set(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -c -n -b '' ") # create a C static library -SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY}) +set(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY}) if(NOT _CMAKE_WATCOM_VERSION) set(_CMAKE_WATCOM_VERSION 1) 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 " -O coff ") +set(CMAKE_RC_COMPILE_OBJECT " -O coff ") diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake index 09cb8d303..9481baa8e 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(CMAKE_GENERATOR MATCHES "Borland") # 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(CMAKE_GENERATOR MATCHES "NMake") -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/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)} = # 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 index c0f014b58..c8dc02563 100644 --- a/Modules/Platform/cl.cmake +++ b/Modules/Platform/cl.cmake @@ -1,62 +1,62 @@ -SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") -SET(CMAKE_LINK_LIBRARY_FLAG "") -SET(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(NOT DEFINED CMAKE_LINKER) +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) +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 +set(CMAKE_CXX_CREATE_SHARED_LIBRARY " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out: /implib: /pdb: /dll /version:. ${CMAKE_END_TEMP_FILE}") -SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) +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}") +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 " /lib ${CMAKE_CL_NOLOGO} /out: ") +set(CMAKE_CXX_CREATE_STATIC_LIBRARY " /lib ${CMAKE_CL_NOLOGO} /out: ") # create a C static library -SET(CMAKE_C_CREATE_STATIC_LIBRARY "${CMAKE_CXX_CREATE_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 +set(CMAKE_CXX_COMPILE_OBJECT " ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /TP /Fo /Fd -c ${CMAKE_END_TEMP_FILE}") # compile a C file into an object file -SET(CMAKE_C_COMPILE_OBJECT +set(CMAKE_C_COMPILE_OBJECT " ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /Fo /Fd -c ${CMAKE_END_TEMP_FILE}") -SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1) -SET(CMAKE_C_LINK_EXECUTABLE +set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1) +set(CMAKE_C_LINK_EXECUTABLE " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe /Fd -link /implib: /version:. ${CMAKE_END_TEMP_FILE}") -SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1) -SET(CMAKE_CXX_LINK_EXECUTABLE +set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1) +set(CMAKE_CXX_LINK_EXECUTABLE " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe /Fd -link /implib: /version:. ${CMAKE_END_TEMP_FILE}") -SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE +set(CMAKE_C_CREATE_PREPROCESSED_SOURCE " > ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} -E ${CMAKE_END_TEMP_FILE}") -SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE +set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " > ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /TP -E ${CMAKE_END_TEMP_FILE}") -SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE +set(CMAKE_C_CREATE_ASSEMBLY_SOURCE " ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /FAs /FoNUL /Fa /c ${CMAKE_END_TEMP_FILE}") -SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE +set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /TP /FAs /FoNUL /Fa /c ${CMAKE_END_TEMP_FILE}") diff --git a/Modules/Platform/eCos.cmake b/Modules/Platform/eCos.cmake index b437c1a9b..c839b0ebb 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(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) # 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(NOT ECOS_SYSTEM_CONFIG_HEADER_PATH) -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(NOT ECOS_SYSTEM_TARGET_LIBRARY) -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 " -o -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld ") -SET(CMAKE_C_LINK_EXECUTABLE " -o -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld ") +set(CMAKE_CXX_LINK_EXECUTABLE " -o -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld ") +set(CMAKE_C_LINK_EXECUTABLE " -o -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld ") # 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 b9d2a6582..6ac3b559f 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(UNIX) + set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj) +endif(UNIX) -SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT " -o ") +set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT " -o ") -SET(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY +set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY " cr " " ") -SET(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE +set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE " -o ") # 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..50c695f66 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(type) -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/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake index 665d2747e..2a7a1ce7d 100644 --- a/Modules/Qt4ConfigDependentSettings.cmake +++ b/Modules/Qt4ConfigDependentSettings.cmake @@ -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(NOT QT_CONFIG MATCHES "shared") +else(Q_WS_WIN) # On other platforms, check file extension to know if its static - IF(QT_QTCORE_LIBRARY_RELEASE) - GET_FILENAME_COMPONENT(qtcore_lib_ext "${QT_QTCORE_LIBRARY_RELEASE}" EXT) - 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("${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) # 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(Q_WS_WIN AND NOT QT_IS_STATIC) -IF(NOT QT_IS_STATIC) - RETURN() -ENDIF(NOT QT_IS_STATIC) +if(NOT QT_IS_STATIC) + return() +endif(NOT QT_IS_STATIC) # 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(QT_QCONFIG MATCHES "system-png") ## 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(QT_QCONFIG MATCHES "system-jpeg") ## 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(QT_QCONFIG MATCHES "system-tiff") ## 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(QT_QCONFIG MATCHES "system-mng") # 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(Q_WS_X11) ## 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(X11_SM_LIB AND X11_ICE_LIB) +endif(QT_QCONFIG MATCHES "x11sm") ## 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(X11_Xi_LIB) +endif(QT_QCONFIG MATCHES "tablet") ## 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(X11_Xrender_LIB) +endif(QT_QCONFIG MATCHES "xrender") ## 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(X11_Xrandr_LIB) +endif(QT_QCONFIG MATCHES "xrandr") ## 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(X11_Xcursor_LIB) +endif(QT_QCONFIG MATCHES "xcursor") ## 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(X11_Xinerama_LIB) +endif(QT_QCONFIG MATCHES "xinerama") ## 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(X11_Xfixes_LIB) +endif(QT_QCONFIG MATCHES "xfixes") ## 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(QT_FONTCONFIG_LIBRARY) +endif(QT_QCONFIG MATCHES "fontconfig") ## 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}) + set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${FREETYPE_LIBRARIES}) endif(FREETYPE_LIBRARIES) -ENDIF(QT_QCONFIG MATCHES "system-freetype") +endif(QT_QCONFIG MATCHES "system-freetype") ## 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(QT_QCONFIG MATCHES "system-zlib") ## 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(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) ## 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(QT_DBUS_LIBRARY) + mark_as_advanced(QT_DBUS_LIBRARY) -ENDIF(QT_QCONFIG MATCHES "dbus") +endif(QT_QCONFIG MATCHES "dbus") ## 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_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY) # 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(QT_GOBJECT_LIBRARY) + endif(QT_VERSION_MINOR GREATER 4) -ENDIF(QT_QCONFIG MATCHES "glib") +endif(QT_QCONFIG MATCHES "glib") ## 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") + 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) +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}) + 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_DL_LIBS}) + set (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_DL_LIBS}) -ENDIF(Q_WS_X11) +endif(Q_WS_X11) -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(Q_WS_WIN) -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_VERSION_MINOR LESS 3) # 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(QT_VERSION_MINOR GREATER 1) - 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(Q_WS_MAC) diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 27a8ee878..1e19ff292 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -21,322 +21,322 @@ ###################################### -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 ("${_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 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_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) +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}) + 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}) + 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) + if(Q_WS_WIN) + set(${_moc_flags} ${${_moc_flags}} -DWIN32) + endif(Q_WS_WIN) -ENDMACRO(QT4_GET_MOC_FLAGS) +endmacro(QT4_GET_MOC_FLAGS) # 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(_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} COMMAND ${QT_MOC_EXECUTABLE} @${_moc_outfile_name}_parameters DEPENDS ${infile} ${_moc_working_dir} VERBATIM) - ELSE (WIN32) - ADD_CUSTOM_COMMAND(OUTPUT ${outfile} + else (WIN32) + 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 (WIN32) +endmacro (QT4_CREATE_MOC_COMMAND) -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(NOT IS_ABSOLUTE "${outfile}") QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "") - SET_SOURCE_FILES_PROPERTIES(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file -ENDMACRO (QT4_GENERATE_MOC) + set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file +endmacro (QT4_GENERATE_MOC) # 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(it) -ENDMACRO (QT4_WRAP_CPP) +endmacro (QT4_WRAP_CPP) # 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 (it) -ENDMACRO (QT4_WRAP_UI) +endmacro (QT4_WRAP_UI) # 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 "]*>" "" _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 "]*>" "" _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) # 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(EXISTS "${infile}") # 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(EXISTS "${infile}") - 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 (it) -ENDMACRO (QT4_ADD_RESOURCES) +endmacro (QT4_ADD_RESOURCES) -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(_nonamespace) + set(_params -m) + endif(_nonamespace) - 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(_classname) - 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(_include) - 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(QT4_ADD_DBUS_INTERFACE) -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 (_current_FILE) +endmacro(QT4_ADD_DBUS_INTERFACES) -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 (_customName) + set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml) + endif (_customName) - 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(QT4_GENERATE_DBUS_INTERFACE) -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 (_optionalBasename) + string(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2adaptor" _basename ${_infile}) + string(TOLOWER ${_basename} _basename) + endif (_optionalBasename) - 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(_optionalClassName) + add_custom_command(OUTPUT "${_impl}" "${_header}" COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile} DEPENDS ${_infile} VERBATIM ) - ENDIF(_optionalClassName) + endif(_optionalClassName) 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(QT4_ADD_DBUS_ADAPTOR) -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 +344,98 @@ 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(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}) 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 (_current_MOC_INC) + endif(_match) + endif ( NOT _skip AND EXISTS ${_abs_FILE} ) + endforeach (_current_FILE) +endmacro(QT4_AUTOMOC) -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(_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) # 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(_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} COMMAND ${QT_LUPDATE_EXECUTABLE} ARGS ${_lupdate_options} ${_ts_pro} ${_my_dirs} -ts ${_ts_file} DEPENDS ${_my_sources} ${_ts_pro} VERBATIM) - ENDFOREACH(_ts_file) + endforeach(_ts_file) QT4_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles}) -ENDMACRO(QT4_CREATE_TRANSLATION) +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) +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} + 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 (_current_FILE) +endmacro(QT4_ADD_TRANSLATION) diff --git a/Modules/SystemInformation.cmake b/Modules/SystemInformation.cmake index 443c7aa84..73674e6fa 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(var ${res}) -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(var ${res}) -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(var ${res}) -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(var) -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(var) -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 (EXISTS "${THE_FILE}") +endmacro(DUMP_FILE) 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 (EXTRA_FILE) diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake index bca7979df..d162f13e7 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") +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) + 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(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2) 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(CMAKE_SIZEOF_UNSIGNED_INT) + 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) + 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_INT) - ENDIF(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2) + endif(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2) - CONFIGURE_FILE("${CMAKE_ROOT}/Modules/TestEndianess.c.in" + 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_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_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(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) + 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 + 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(HAVE_${VARIABLE}) + 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(HAVE_${VARIABLE}) + endif("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") +endmacro(TEST_BIG_ENDIAN) diff --git a/Modules/TestCXXAcceptsFlag.cmake b/Modules/TestCXXAcceptsFlag.cmake index 0d945bbdc..58623f8c4 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 + 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(${VARIABLE}) + 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(${VARIABLE}) + endif(NOT DEFINED ${VARIABLE}) +endmacro(CHECK_CXX_ACCEPTS_FLAG) diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake index a60719e1a..d7e2c926f 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 (CMAKE_ANSI_FOR_SCOPE) + 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 (CMAKE_ANSI_FOR_SCOPE) +endif("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$") diff --git a/Modules/TestForANSIStreamHeaders.cmake b/Modules/TestForANSIStreamHeaders.cmake index b542b7481..1ed532ed5 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 (CMAKE_ANSI_STREAM_HEADERS) + set (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL "Does the compiler support headers like iostream.") - ENDIF (CMAKE_ANSI_STREAM_HEADERS) + endif (CMAKE_ANSI_STREAM_HEADERS) - MARK_AS_ADVANCED(CMAKE_NO_ANSI_STREAM_HEADERS) -ENDIF(NOT CMAKE_NO_ANSI_STREAM_HEADERS) + mark_as_advanced(CMAKE_NO_ANSI_STREAM_HEADERS) +endif(NOT CMAKE_NO_ANSI_STREAM_HEADERS) diff --git a/Modules/TestForSSTREAM.cmake b/Modules/TestForSSTREAM.cmake index 30ff3bcb9..cdd809111 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 (CMAKE_HAS_ANSI_STRING_STREAM) + 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 (CMAKE_HAS_ANSI_STRING_STREAM) +endif("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$") diff --git a/Modules/TestForSTDNamespace.cmake b/Modules/TestForSTDNamespace.cmake index 65e0de044..848aa8722 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 (CMAKE_STD_NAMESPACE) + 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 (CMAKE_STD_NAMESPACE) +endif("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$") diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake index 60e1e46b4..e3e7798d8 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(NOT ECOSCONFIG_EXECUTABLE) + message(STATUS "Found ecosconfig: ${ECOSCONFIG_EXECUTABLE}") +endif(NOT ECOSCONFIG_EXECUTABLE) # 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 (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) # 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 (NOT TCL_TCLSH) + message(STATUS "tlcsh found: ${TCL_TCLSH}") +endif (NOT TCL_TCLSH) #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 (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/) + endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt) #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(ECOS_ADD_INCLUDE_DIRECTORIES) #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 (ECOS_USE_ARM_ELF_TOOLS) #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 (ECOS_USE_PPC_EABI_TOOLS) #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 (ECOS_USE_I386_ELF_TOOLS) #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 (NOT ${_abs_FILE} STREQUAL ${_current_FILE}) + list(APPEND ${_target_FILES} ${_abs_FILE}) + endforeach (_current_FILE) +endmacro(ECOS_ADJUST_DIRECTORY) # 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(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ecos) #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(ECOS_ADD_TARGET_LIB) # 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 " -o -c ") - SET(CMAKE_CXX_COMPILE_OBJECT " -o -c ") + set(CMAKE_BUILD_TYPE CUSTOM_ECOS_BUILD) + set(CMAKE_C_COMPILE_OBJECT " -o -c ") + set(CMAKE_CXX_COMPILE_OBJECT " -o -c ") # special link commands for ecos-executables - SET(CMAKE_CXX_LINK_EXECUTABLE " -o ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}") - SET(CMAKE_C_LINK_EXECUTABLE " -o ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}") + set(CMAKE_CXX_LINK_EXECUTABLE " -o ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}") + set(CMAKE_C_LINK_EXECUTABLE " -o ${_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(ECOS_ADD_EXECUTABLE) diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake index 7f4318f05..b4517f75f 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( NOT _return_VALUE) - 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(NOT _return_VALUE) # if pkg-config has NOT been found, INFORM the user - ELSE(PKGCONFIG_EXECUTABLE) + else(PKGCONFIG_EXECUTABLE) - 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(PKGCONFIG_EXECUTABLE) -ENDMACRO(PKGCONFIG _include_DIR _link_DIR _link_FLAGS _cflags) +endmacro(PKGCONFIG _include_DIR _link_DIR _link_FLAGS _cflags) -MARK_AS_ADVANCED(PKGCONFIG_EXECUTABLE) +mark_as_advanced(PKGCONFIG_EXECUTABLE) diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake index d4852a083..260c3cd29 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 (Q_WS_WIN) +endif (QT_USE_QTMAIN) -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(QT_DONT_USE_QTGUI) + set(QT_USE_QTGUI 1) +endif(QT_DONT_USE_QTGUI) -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(QT_DONT_USE_QTCORE) + set(QT_USE_QTCORE 1) +endif(QT_DONT_USE_QTCORE) -IF (QT_USE_QT3SUPPORT) - ADD_DEFINITIONS(-DQT3_SUPPORT) -ENDIF (QT_USE_QT3SUPPORT) +if (QT_USE_QT3SUPPORT) + add_definitions(-DQT3_SUPPORT) +endif (QT_USE_QT3SUPPORT) # 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(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) # 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) + 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) +endforeach(module) diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index a7085ee31..e4e72c2aa 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -15,7 +15,7 @@ # The name-specific variable SWIG_MODULE__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}") +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") + 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 # _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(SWIG_MODULE_INITIALIZE) # # 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(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND") + 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(it) +endmacro(SWIG_GET_EXTRA_OUTPUT_FILES) # # 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("${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 "^${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(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}") + 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_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_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(swig_source_file_relative_path) # 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(CMAKE_SWIG_OUTDIR) + set(swig_outdir ${CMAKE_CURRENT_BINARY_DIR}) + endif(CMAKE_SWIG_OUTDIR) 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(swig_source_file_cplusplus) + set(swig_generated_file_fullname "${swig_generated_file_fullname}.c") - ENDIF(swig_source_file_cplusplus) + endif(swig_source_file_cplusplus) - #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(it) - 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(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( 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} @@ -179,53 +179,53 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) 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} + 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(SWIG_ADD_SOURCE_TO_MODULE) # # 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_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_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(it) + 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 (APPLE) + endif ("${swig_lowercase_language}" STREQUAL "java") + 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. # - 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(WIN32 AND NOT CYGWIN) + endif ("${swig_lowercase_language}" STREQUAL "python") +endmacro(SWIG_ADD_MODULE) # # 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(SWIG_MODULE_${name}_REAL_NAME) + message(SEND_ERROR "Cannot find Swig library \"${name}\".") + endif(SWIG_MODULE_${name}_REAL_NAME) +endmacro(SWIG_LINK_LIBRARIES name) 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..549a792e3 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(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) # 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(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) # 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(VTK_USE_X) +endif(VTK_USE_RENDERING) -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(VTK_OPENGL_HAS_OSMESA) -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(VTK_USE_MPI) -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(VTK_WRAP_TCL) -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(VTK_WRAP_PYTHON) -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(VTK_WRAP_JAVA) -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(VTK_HAVE_VG500) -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(VTK_HAVE_VP1000) # 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(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) # 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) + 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) +else(EXISTS ${VTK_DIR}/Common) # 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(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) # 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(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 "${VTK_REQUIRED_CXX_FLAGS} -timplicit_local -no_implicit_include") - ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*") -ENDIF(CMAKE_COMPILER_IS_GNUCXX) + endif(CMAKE_SYSTEM MATCHES "OSF1-V.*") +endif(CMAKE_COMPILER_IS_GNUCXX) -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(CMAKE_X_CFLAGS) +endif(VTK_USE_X) # 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..681fe28e3 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(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) diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake index a0f2e8632..82a008513 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( ${wxWidgets_LIBRARIES}) +# target_link_libraries( ${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 (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) 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(wxWidgets_INCLUDE_DIRS_NO_SYSTEM) + include_directories(SYSTEM ${wxWidgets_INCLUDE_DIRS}) + endif(wxWidgets_INCLUDE_DIRS_NO_SYSTEM) MSG("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}") - ENDIF(wxWidgets_INCLUDE_DIRS) + endif(wxWidgets_INCLUDE_DIRS) - 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(wxWidgets_LIBRARY_DIRS) - 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(wxWidgets_DEFINITIONS) - 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(wxWidgets_DEFINITIONS_DEBUG) - 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(wxWidgets_CXX_FLAGS) # 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(LOGFILE) + #endif(wxWidgets_LIBRARIES) -ELSE (wxWidgets_FOUND) - MESSAGE("wxWidgets requested but not found.") -ENDIF(wxWidgets_FOUND) +else (wxWidgets_FOUND) + message("wxWidgets requested but not found.") +endif(wxWidgets_FOUND) diff --git a/Modules/VTKCompatibility.cmake b/Modules/VTKCompatibility.cmake index 802969f2f..e1abfbb9f 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(APPLE) -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(SOURCE_FILES) 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 \n#include \n\n") -FILE(APPEND ${KDE_UIC_CPP_FILE} "${_uic_CONTENTS}") +file(WRITE ${KDE_UIC_CPP_FILE} "#include \n#include \n\n") +file(APPEND ${KDE_UIC_CPP_FILE} "${_uic_CONTENTS}") diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index e9c5a587e..106e78f12 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -9,33 +9,33 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= -INCLUDE(CheckIncludeFile) +include(CheckIncludeFile) # Check if we can build support for ELF parsing. CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H) -IF(HAVE_ELF_H) - SET(CMAKE_USE_ELF_PARSER 1) -ELSE(HAVE_ELF_H) - SET(CMAKE_USE_ELF_PARSER) -ENDIF(HAVE_ELF_H) +if(HAVE_ELF_H) + set(CMAKE_USE_ELF_PARSER 1) +else(HAVE_ELF_H) + set(CMAKE_USE_ELF_PARSER) +endif(HAVE_ELF_H) -SET(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR}) +set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR}) # configure the .h file -CONFIGURE_FILE( +configure_file( "${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in" "${CMake_BINARY_DIR}/Source/cmConfigure.h" ) -CONFIGURE_FILE( +configure_file( "${CMake_SOURCE_DIR}/Source/cmVersionConfig.h.in" "${CMake_BINARY_DIR}/Source/cmVersionConfig.h" ) -CONFIGURE_FILE( +configure_file( "${CMake_SOURCE_DIR}/Source/CPack/cmCPackConfigure.h.in" "${CMake_BINARY_DIR}/Source/CPack/cmCPackConfigure.h" ) # add the include path to find the .h -INCLUDE_DIRECTORIES( +include_directories( "${CMake_BINARY_DIR}/Source" "${CMake_SOURCE_DIR}/Source" ${CMAKE_ZLIB_INCLUDES} @@ -45,72 +45,72 @@ INCLUDE_DIRECTORIES( ) # let cmake know it is supposed to use it -ADD_DEFINITIONS(-DCMAKE_BUILD_WITH_CMAKE) +add_definitions(-DCMAKE_BUILD_WITH_CMAKE) -OPTION(CMAKE_REGENERATE_YACCLEX +option(CMAKE_REGENERATE_YACCLEX "Regenerate YACC and LEXX files" OFF) -MARK_AS_ADVANCED(CMAKE_REGENERATE_YACCLEX) -IF(CMAKE_REGENERATE_YACCLEX) - SET(parsersLexers cmDependsFortran cmCommandArgument cmExpr) - FIND_PROGRAM(YACC_EXECUTABLE +mark_as_advanced(CMAKE_REGENERATE_YACCLEX) +if(CMAKE_REGENERATE_YACCLEX) + set(parsersLexers cmDependsFortran cmCommandArgument cmExpr) + find_program(YACC_EXECUTABLE NAMES yacc bison PATHS /usr/bin DOC "Yacc or Bison executable") - FIND_PROGRAM(FLEX_EXECUTABLE + find_program(FLEX_EXECUTABLE NAMES flex PATHS /usr/bin DOC "Flex executable") - MARK_AS_ADVANCED(YACC_EXECUTABLE FLEX_EXECUTABLE) - IF(YACC_EXECUTABLE) - SET(BISON_FLAGS) - IF(YACC_EXECUTABLE MATCHES "bison") - SET(BISON_FLAGS "--yacc") - ENDIF(YACC_EXECUTABLE MATCHES "bison") - SET(yacc_files) - FOREACH(name ${parsersLexers}) - SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Parser.y") - SET(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Parser.cxx") - SET(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}ParserTokens.h") - ADD_CUSTOM_COMMAND( + mark_as_advanced(YACC_EXECUTABLE FLEX_EXECUTABLE) + if(YACC_EXECUTABLE) + set(BISON_FLAGS) + if(YACC_EXECUTABLE MATCHES "bison") + set(BISON_FLAGS "--yacc") + endif(YACC_EXECUTABLE MATCHES "bison") + set(yacc_files) + foreach(name ${parsersLexers}) + set(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Parser.y") + set(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Parser.cxx") + set(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}ParserTokens.h") + add_custom_command( OUTPUT "${dst}" DEPENDS "${src}" COMMAND ${YACC_EXECUTABLE} --name-prefix=${name}_yy --defines=${hdr} -o${dst} ${src} ) - SET(yacc_files ${yacc_files} "${dst}") - ENDFOREACH(name) - ADD_CUSTOM_TARGET(RerunYacc DEPENDS ${yacc_files}) - ENDIF(YACC_EXECUTABLE) - IF(FLEX_EXECUTABLE) - SET(lex_files) - FOREACH(name ${parsersLexers}) - SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Lexer.in.l") - SET(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.cxx") - SET(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.h") - ADD_CUSTOM_COMMAND( + set(yacc_files ${yacc_files} "${dst}") + endforeach(name) + add_custom_target(RerunYacc DEPENDS ${yacc_files}) + endif(YACC_EXECUTABLE) + if(FLEX_EXECUTABLE) + set(lex_files) + foreach(name ${parsersLexers}) + set(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Lexer.in.l") + set(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.cxx") + set(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.h") + add_custom_command( OUTPUT "${dst}" DEPENDS "${src}" COMMAND ${FLEX_EXECUTABLE} --prefix=${name}_yy --header-file=${hdr} -o${dst} ${src} ) - SET(lex_files ${lex_files} "${dst}") - ENDFOREACH(name) - ADD_CUSTOM_TARGET(RerunLex DEPENDS ${lex_files}) - ENDIF(FLEX_EXECUTABLE) + set(lex_files ${lex_files} "${dst}") + endforeach(name) + add_custom_target(RerunLex DEPENDS ${lex_files}) + endif(FLEX_EXECUTABLE) -ENDIF(CMAKE_REGENERATE_YACCLEX) +endif(CMAKE_REGENERATE_YACCLEX) # Check if we can build the ELF parser. -IF(CMAKE_USE_ELF_PARSER) - SET(ELF_SRCS cmELF.h cmELF.cxx) -ENDIF(CMAKE_USE_ELF_PARSER) +if(CMAKE_USE_ELF_PARSER) + set(ELF_SRCS cmELF.h cmELF.cxx) +endif(CMAKE_USE_ELF_PARSER) # # Sources for CMakeLib # -SET(SRCS +set(SRCS cmStandardIncludes.cxx cmArchiveWrite.cxx cmBootstrapCommands.cxx @@ -275,30 +275,30 @@ SET(SRCS ) # Kdevelop only works on UNIX and not windows -IF(UNIX) - SET(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx) -ENDIF(UNIX) +if(UNIX) + set(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx) +endif(UNIX) # Xcode only works on Apple -IF(APPLE) - SET(SRCS ${SRCS} +if(APPLE) + set(SRCS ${SRCS} cmXCodeObject.cxx cmXCode21Object.cxx cmGlobalXCodeGenerator.cxx cmGlobalXCodeGenerator.h cmLocalXCodeGenerator.cxx cmLocalXCodeGenerator.h) -ENDIF(APPLE) +endif(APPLE) -IF (WIN32) - SET(SRCS ${SRCS} +if (WIN32) + set(SRCS ${SRCS} cmCallVisualStudioMacro.cxx cmCallVisualStudioMacro.h ) - IF(NOT UNIX) - SET(SRCS ${SRCS} + if(NOT UNIX) + set(SRCS ${SRCS} cmGlobalBorlandMakefileGenerator.cxx cmGlobalBorlandMakefileGenerator.h cmGlobalMSYSMakefileGenerator.cxx @@ -356,11 +356,11 @@ IF (WIN32) cmWin32ProcessExecution.cxx cmWin32ProcessExecution.h ) - ENDIF(NOT UNIX) -ENDIF (WIN32) + endif(NOT UNIX) +endif (WIN32) # Ninja support -SET(SRCS ${SRCS} +set(SRCS ${SRCS} cmGlobalNinjaGenerator.cxx cmGlobalNinjaGenerator.h cmNinjaTypes.h @@ -373,34 +373,34 @@ SET(SRCS ${SRCS} cmNinjaUtilityTargetGenerator.cxx cmNinjaUtilityTargetGenerator.h ) -IF(WIN32 AND NOT CYGWIN AND NOT BORLAND) - SET_SOURCE_FILES_PROPERTIES(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501) - ADD_EXECUTABLE(cmcldeps cmcldeps.cxx) - TARGET_LINK_LIBRARIES(cmcldeps CMakeLib) - INSTALL_TARGETS(/bin cmcldeps) -ENDIF() +if(WIN32 AND NOT CYGWIN AND NOT BORLAND) + set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501) + add_executable(cmcldeps cmcldeps.cxx) + target_link_libraries(cmcldeps CMakeLib) + install_targets(/bin cmcldeps) +endif() # create a library used by the command line and the GUI -ADD_LIBRARY(CMakeLib ${SRCS}) -TARGET_LINK_LIBRARIES(CMakeLib cmsys +add_library(CMakeLib ${SRCS}) +target_link_libraries(CMakeLib cmsys ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES} ${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES} ${CMAKE_CURL_LIBRARIES} ) # On Apple we need CoreFoundation -IF(APPLE) - TARGET_LINK_LIBRARIES(CMakeLib "-framework CoreFoundation") -ENDIF(APPLE) +if(APPLE) + target_link_libraries(CMakeLib "-framework CoreFoundation") +endif(APPLE) # On some platforms we need the rpcrt4 library for the VS 7 generators. -IF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) - TARGET_LINK_LIBRARIES(CMakeLib rpcrt4) -ENDIF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) +if(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) + target_link_libraries(CMakeLib rpcrt4) +endif(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) # # CTestLib # -INCLUDE_DIRECTORIES( +include_directories( "${CMake_SOURCE_DIR}/Source/CTest" ${CMAKE_XMLRPC_INCLUDES} ${CMAKE_CURL_INCLUDES} @@ -408,7 +408,7 @@ INCLUDE_DIRECTORIES( # # Sources for CTestLib # -SET(CTEST_SRCS cmCTest.cxx +set(CTEST_SRCS cmCTest.cxx CTest/cmProcess.cxx CTest/cmCTestBatchTestHandler.cxx CTest/cmCTestBuildAndTestHandler.cxx @@ -461,13 +461,13 @@ SET(CTEST_SRCS cmCTest.cxx ) # Build CTestLib -ADD_LIBRARY(CTestLib ${CTEST_SRCS}) -TARGET_LINK_LIBRARIES(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES}) +add_library(CTestLib ${CTEST_SRCS}) +target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES}) # # Sources for CPack # -SET(CPACK_SRCS +set(CPACK_SRCS CPack/cmCPackArchiveGenerator.cxx CPack/cmCPackComponentGroup.cxx CPack/cmCPackGeneratorFactory.cxx @@ -483,82 +483,82 @@ SET(CPACK_SRCS CPack/cmCPackDocumentMacros.cxx ) -IF(CYGWIN) - SET(CPACK_SRCS ${CPACK_SRCS} +if(CYGWIN) + set(CPACK_SRCS ${CPACK_SRCS} CPack/cmCPackCygwinBinaryGenerator.cxx CPack/cmCPackCygwinSourceGenerator.cxx ) -ENDIF(CYGWIN) +endif(CYGWIN) -IF(UNIX) - SET(CPACK_SRCS ${CPACK_SRCS} +if(UNIX) + set(CPACK_SRCS ${CPACK_SRCS} CPack/cmCPackDebGenerator.cxx CPack/cmCPackRPMGenerator.cxx ) -ENDIF(UNIX) +endif(UNIX) -IF(APPLE) - SET(CPACK_SRCS ${CPACK_SRCS} +if(APPLE) + set(CPACK_SRCS ${CPACK_SRCS} CPack/cmCPackBundleGenerator.cxx CPack/cmCPackDragNDropGenerator.cxx CPack/cmCPackOSXX11Generator.cxx CPack/cmCPackPackageMakerGenerator.cxx ) -ENDIF(APPLE) +endif(APPLE) # Build CPackLib -ADD_LIBRARY(CPackLib ${CPACK_SRCS}) -TARGET_LINK_LIBRARIES(CPackLib CMakeLib) +add_library(CPackLib ${CPACK_SRCS}) +target_link_libraries(CPackLib CMakeLib) -IF(APPLE) - ADD_EXECUTABLE(cmakexbuild cmakexbuild.cxx) - TARGET_LINK_LIBRARIES(cmakexbuild CMakeLib) - ADD_EXECUTABLE(OSXScriptLauncher +if(APPLE) + add_executable(cmakexbuild cmakexbuild.cxx) + target_link_libraries(cmakexbuild CMakeLib) + add_executable(OSXScriptLauncher CPack/OSXScriptLauncher.cxx) - TARGET_LINK_LIBRARIES(OSXScriptLauncher cmsys) - TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework CoreFoundation") -ENDIF(APPLE) + target_link_libraries(OSXScriptLauncher cmsys) + target_link_libraries(OSXScriptLauncher "-framework CoreFoundation") +endif(APPLE) # Build CMake executable -ADD_EXECUTABLE(cmake cmakemain.cxx) -TARGET_LINK_LIBRARIES(cmake CMakeLib) +add_executable(cmake cmakemain.cxx) +target_link_libraries(cmake CMakeLib) # Build special executable for running programs on Windows 98 -IF(WIN32) - IF(NOT UNIX) - ADD_EXECUTABLE(cmw9xcom cmw9xcom.cxx) - TARGET_LINK_LIBRARIES(cmw9xcom CMakeLib) - INSTALL_TARGETS(/bin cmw9xcom) - ENDIF(NOT UNIX) -ENDIF(WIN32) +if(WIN32) + if(NOT UNIX) + add_executable(cmw9xcom cmw9xcom.cxx) + target_link_libraries(cmw9xcom CMakeLib) + install_targets(/bin cmw9xcom) + endif(NOT UNIX) +endif(WIN32) # Build CTest executable -ADD_EXECUTABLE(ctest ctest.cxx) -TARGET_LINK_LIBRARIES(ctest CTestLib) +add_executable(ctest ctest.cxx) +target_link_libraries(ctest CTestLib) # Build CPack executable -ADD_EXECUTABLE(cpack CPack/cpack.cxx) -TARGET_LINK_LIBRARIES(cpack CPackLib) +add_executable(cpack CPack/cpack.cxx) +target_link_libraries(cpack CPackLib) # Curses GUI -IF(BUILD_CursesDialog) - INCLUDE(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt) -ENDIF(BUILD_CursesDialog) +if(BUILD_CursesDialog) + include(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt) +endif(BUILD_CursesDialog) # Qt GUI -OPTION(BUILD_QtDialog "Build Qt dialog for CMake" FALSE) -IF(BUILD_QtDialog) - SUBDIRS(QtDialog) -ENDIF(BUILD_QtDialog) +option(BUILD_QtDialog "Build Qt dialog for CMake" FALSE) +if(BUILD_QtDialog) + subdirs(QtDialog) +endif(BUILD_QtDialog) -INCLUDE (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL) -INCLUDE (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL) +include (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL) +include (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL) -INSTALL_TARGETS(/bin cmake) -INSTALL_TARGETS(/bin ctest) -INSTALL_TARGETS(/bin cpack) -IF(APPLE) - INSTALL_TARGETS(/bin cmakexbuild) -ENDIF(APPLE) +install_targets(/bin cmake) +install_targets(/bin ctest) +install_targets(/bin cpack) +if(APPLE) + install_targets(/bin cmakexbuild) +endif(APPLE) -INSTALL_FILES(${CMAKE_DATA_DIR}/include cmCPluginAPI.h) +install_files(${CMAKE_DATA_DIR}/include cmCPluginAPI.h) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 01817226b..a18d8208c 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,6 +1,6 @@ # CMake version number components. -SET(CMake_VERSION_MAJOR 2) -SET(CMake_VERSION_MINOR 8) -SET(CMake_VERSION_PATCH 9) -SET(CMake_VERSION_TWEAK 20120813) -#SET(CMake_VERSION_RC 1) +set(CMake_VERSION_MAJOR 2) +set(CMake_VERSION_MINOR 8) +set(CMake_VERSION_PATCH 9) +set(CMake_VERSION_TWEAK 20120813) +#set(CMake_VERSION_RC 1) diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt index 3349ebe96..96e28b491 100644 --- a/Source/CursesDialog/CMakeLists.txt +++ b/Source/CursesDialog/CMakeLists.txt @@ -10,7 +10,7 @@ # See the License for more information. #============================================================================= -SET( CURSES_SRCS +set( CURSES_SRCS CursesDialog/cmCursesBoolWidget CursesDialog/cmCursesCacheEntryComposite CursesDialog/cmCursesDummyWidget @@ -25,13 +25,13 @@ SET( CURSES_SRCS CursesDialog/ccmake ) -INCLUDE_DIRECTORIES(${CMake_SOURCE_DIR}/Source/CursesDialog/form +include_directories(${CMake_SOURCE_DIR}/Source/CursesDialog/form ${CMake_BINARY_DIR}/Source/CursesDialog/form) -INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH}) +include_directories(${CURSES_INCLUDE_PATH}) -ADD_EXECUTABLE(ccmake ${CURSES_SRCS} ) -TARGET_LINK_LIBRARIES(ccmake CMakeLib) -TARGET_LINK_LIBRARIES(ccmake cmForm) +add_executable(ccmake ${CURSES_SRCS} ) +target_link_libraries(ccmake CMakeLib) +target_link_libraries(ccmake cmForm) -INSTALL_TARGETS(/bin ccmake) +install_targets(/bin ccmake) diff --git a/Source/CursesDialog/form/CMakeLists.txt b/Source/CursesDialog/form/CMakeLists.txt index 2435f3935..d5cc1bd07 100644 --- a/Source/CursesDialog/form/CMakeLists.txt +++ b/Source/CursesDialog/form/CMakeLists.txt @@ -9,14 +9,14 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= -PROJECT(CMAKE_FORM) +project(CMAKE_FORM) -INCLUDE_REGULAR_EXPRESSION("^.*$") -INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH} "${CMAKE_CURRENT_BINARY_DIR}") +include_regular_expression("^.*$") +include_directories(${CURSES_INCLUDE_PATH} "${CMAKE_CURRENT_BINARY_DIR}") -CONFIGURE_FILE(cmFormConfigure.h.in "${CMAKE_CURRENT_BINARY_DIR}/cmFormConfigure.h") +configure_file(cmFormConfigure.h.in "${CMAKE_CURRENT_BINARY_DIR}/cmFormConfigure.h") -SET( FORM_SRCS +set( FORM_SRCS fld_arg.c fld_attr.c fld_current.c @@ -58,9 +58,9 @@ SET( FORM_SRCS fty_regex.c ) -INCLUDE_DIRECTORIES(${CMAKE_FORM_SOURCE_DIR}) -ADD_LIBRARY(cmForm ${FORM_SRCS} ) -TARGET_LINK_LIBRARIES(cmForm ${CURSES_LIBRARY}) -IF(CURSES_EXTRA_LIBRARY) - TARGET_LINK_LIBRARIES(cmForm ${CURSES_EXTRA_LIBRARY}) -ENDIF(CURSES_EXTRA_LIBRARY) +include_directories(${CMAKE_FORM_SOURCE_DIR}) +add_library(cmForm ${FORM_SRCS} ) +target_link_libraries(cmForm ${CURSES_LIBRARY}) +if(CURSES_EXTRA_LIBRARY) + target_link_libraries(cmForm ${CURSES_EXTRA_LIBRARY}) +endif(CURSES_EXTRA_LIBRARY) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 07ec10674..d962d8d41 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -9,17 +9,17 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= -PROJECT(QtDialog) -SET(QT_MIN_VERSION "4.4.0") -FIND_PACKAGE(Qt4 REQUIRED) +project(QtDialog) +set(QT_MIN_VERSION "4.4.0") +find_package(Qt4 REQUIRED) -IF(NOT QT4_FOUND) - MESSAGE(SEND_ERROR "Failed to find Qt 4.4 or greater.") -ELSE(NOT QT4_FOUND) +if(NOT QT4_FOUND) + message(SEND_ERROR "Failed to find Qt 4.4 or greater.") +else(NOT QT4_FOUND) - INCLUDE(${QT_USE_FILE}) - SET(CMAKE_PACKAGE_QTGUI TRUE) - SET(SRCS + include(${QT_USE_FILE}) + set(CMAKE_PACKAGE_QTGUI TRUE) + set(SRCS AddCacheEntry.cxx AddCacheEntry.h CMakeSetup.cxx @@ -55,53 +55,53 @@ ELSE(NOT QT4_FOUND) ) QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc) - SET(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS}) - IF(Q_WS_WIN) - SET(SRCS ${SRCS} CMakeSetup.rc) - ENDIF(Q_WS_WIN) - IF(Q_WS_MAC) - SET(SRCS ${SRCS} CMakeSetup.icns) - SET(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns) - SET_SOURCE_FILES_PROPERTIES(CMakeSetup.icns PROPERTIES + set(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS}) + if(Q_WS_WIN) + set(SRCS ${SRCS} CMakeSetup.rc) + endif(Q_WS_WIN) + if(Q_WS_MAC) + set(SRCS ${SRCS} CMakeSetup.icns) + set(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns) + set_source_files_properties(CMakeSetup.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - ENDIF(Q_WS_MAC) + endif(Q_WS_MAC) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + include_directories(${CMAKE_CURRENT_BINARY_DIR}) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - ADD_EXECUTABLE(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS}) - TARGET_LINK_LIBRARIES(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES}) - IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) - IF(APPLE) - SET_TARGET_PROPERTIES(cmake-gui PROPERTIES + add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS}) + target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES}) + if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) + if(APPLE) + set_target_properties(cmake-gui PROPERTIES OUTPUT_NAME ${CMAKE_BUNDLE_NAME}) - ENDIF(APPLE) - SET(CMAKE_INSTALL_DESTINATION_ARGS + endif(APPLE) + set(CMAKE_INSTALL_DESTINATION_ARGS BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}") - ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) + endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) - INSTALL(TARGETS cmake-gui RUNTIME DESTINATION bin ${CMAKE_INSTALL_DESTINATION_ARGS}) + install(TARGETS cmake-gui RUNTIME DESTINATION bin ${CMAKE_INSTALL_DESTINATION_ARGS}) - IF(UNIX) + if(UNIX) # install a desktop file so CMake appears in the application start menu # with an icon - INSTALL(FILES CMake.desktop DESTINATION share/applications ) - INSTALL(FILES CMakeSetup32.png DESTINATION share/pixmaps ) - INSTALL(FILES cmakecache.xml DESTINATION share/mime/packages ) - ENDIF(UNIX) + install(FILES CMake.desktop DESTINATION share/applications ) + install(FILES CMakeSetup32.png DESTINATION share/pixmaps ) + install(FILES cmakecache.xml DESTINATION share/mime/packages ) + endif(UNIX) - IF(APPLE) - SET(CMAKE_POSTFLIGHT_SCRIPT + if(APPLE) + set(CMAKE_POSTFLIGHT_SCRIPT "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh") - SET(CMAKE_POSTUPGRADE_SCRIPT + set(CMAKE_POSTUPGRADE_SCRIPT "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh") configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postflight.sh.in" "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh") configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in" "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh") - INSTALL(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui + install(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)") - ENDIF(APPLE) + endif(APPLE) if(APPLE OR WIN32) # install rules for including 3rd party libs such as Qt @@ -117,7 +117,7 @@ ELSE(NOT QT4_FOUND) ") endif(APPLE OR WIN32) - CONFIGURE_FILE("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in" + configure_file("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in" "${QtDialog_BINARY_DIR}/QtDialogCPack.cmake" @ONLY) -ENDIF(NOT QT4_FOUND) +endif(NOT QT4_FOUND) diff --git a/Source/QtDialog/QtDialogCPack.cmake.in b/Source/QtDialog/QtDialogCPack.cmake.in index e73e23f22..f43e1c33d 100644 --- a/Source/QtDialog/QtDialogCPack.cmake.in +++ b/Source/QtDialog/QtDialogCPack.cmake.in @@ -1,18 +1,18 @@ -SET(IS_APPLE @APPLE@) -SET(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@) +set(IS_APPLE @APPLE@) +set(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@) -IF(CMAKE_PACKAGE_QTGUI) - SET(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES}) - SET(CPACK_CREATE_DESKTOP_LINKS "cmake-gui" ${CPACK_CREATE_DESKTOP_LINKS}) - IF(IS_APPLE) +if(CMAKE_PACKAGE_QTGUI) + set(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES}) + set(CPACK_CREATE_DESKTOP_LINKS "cmake-gui" ${CPACK_CREATE_DESKTOP_LINKS}) + if(IS_APPLE) # for apple install we set the install prefix to # / and then install # cmake into the bundle for cmake-gui and must use DESTDIR - SET(CPACK_SET_DESTDIR TRUE) + set(CPACK_SET_DESTDIR TRUE) # we also want to run post install stuff to setup command line - SET(CPACK_POSTFLIGHT_SCRIPT "@CMAKE_POSTFLIGHT_SCRIPT@") - SET(CPACK_POSTUPGRADE_SCRIPT "@CMAKE_POSTUPGRADE_SCRIPT@") - ENDIF(IS_APPLE) -ENDIF(CMAKE_PACKAGE_QTGUI) + set(CPACK_POSTFLIGHT_SCRIPT "@CMAKE_POSTFLIGHT_SCRIPT@") + set(CPACK_POSTUPGRADE_SCRIPT "@CMAKE_POSTUPGRADE_SCRIPT@") + endif(IS_APPLE) +endif(CMAKE_PACKAGE_QTGUI) diff --git a/Templates/CMakeVisualStudio6Configurations.cmake b/Templates/CMakeVisualStudio6Configurations.cmake index b8e797427..6355969ab 100644 --- a/Templates/CMakeVisualStudio6Configurations.cmake +++ b/Templates/CMakeVisualStudio6Configurations.cmake @@ -1,3 +1,3 @@ # When the dll templates are changed, this list should be # updated with the list of possible configurations. -SET(CMAKE_CONFIGURATION_TYPES Debug Release MinSizeRel RelWithDebInfo) +set(CMAKE_CONFIGURATION_TYPES Debug Release MinSizeRel RelWithDebInfo) diff --git a/Templates/CTestScript.cmake.in b/Templates/CTestScript.cmake.in index 63bd26f47..5fb3529e4 100644 --- a/Templates/CTestScript.cmake.in +++ b/Templates/CTestScript.cmake.in @@ -1,26 +1,26 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.4) +cmake_minimum_required(VERSION 2.4) # This is a template for the CTest script for this system -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "@BUILDNAME@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "@BUILDNAME@") # --- -SET(CTEST_SOURCE_DIRECTORY "@CMAKE_SOURCE_DIR@") -SET(CTEST_BINARY_DIRECTORY "@CMAKE_BINARY_DIR@") -SET(CTEST_UPDATE_COMMAND "@UPDATE_COMMAND@") -SET(CTEST_UPDATE_OPTIONS "@UPDATE_OPTIONS@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "Release") -#SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -#SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -#SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") -#SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMAKE_SOURCE_DIR@") +set(CTEST_BINARY_DIRECTORY "@CMAKE_BINARY_DIR@") +set(CTEST_UPDATE_COMMAND "@UPDATE_COMMAND@") +set(CTEST_UPDATE_OPTIONS "@UPDATE_OPTIONS@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "Release") +#set(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") +#set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") +#set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") +#set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) -SET(CTEST_DROP_METHOD "@DROP_METHOD@") +set(CTEST_DROP_METHOD "@DROP_METHOD@") CTEST_START(Experimental TRACK Weekly) CTEST_UPDATE(SOURCE "${CTEST_SOURCE_DIRECTORY}") diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index ed8b8bf5d..a258de239 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -60,16 +60,16 @@ add_executable(bar bar.cxx ) #----------------------------------------------------------------------------- -IF("${CMAKE_GENERATOR}" MATCHES "Make") +if("${CMAKE_GENERATOR}" MATCHES "Make") # Test the IMPLICIT_DEPENDS feature. - SET(ZOT_DEPENDS IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep.cxx) - SET(ZOT_CUSTOM_DEP + set(ZOT_DEPENDS IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep.cxx) + set(ZOT_CUSTOM_DEP IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep_custom.cxx) -ELSE("${CMAKE_GENERATOR}" MATCHES "Make") +else("${CMAKE_GENERATOR}" MATCHES "Make") # No IMPLICIT_DEPENDS...just depend directly. - SET(ZOT_DEPENDS DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx.in) - SET(ZOT_CUSTOM_DEP DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot_custom.hxx.in) -ENDIF("${CMAKE_GENERATOR}" MATCHES "Make") + set(ZOT_DEPENDS DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx.in) + set(ZOT_CUSTOM_DEP DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot_custom.hxx.in) +endif("${CMAKE_GENERATOR}" MATCHES "Make") add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx COMMAND ${CMAKE_COMMAND} -E copy diff --git a/Tests/BundleGeneratorTest/CMakeLists.txt b/Tests/BundleGeneratorTest/CMakeLists.txt index e1fc2c1d4..037df09c1 100644 --- a/Tests/BundleGeneratorTest/CMakeLists.txt +++ b/Tests/BundleGeneratorTest/CMakeLists.txt @@ -1,23 +1,23 @@ -PROJECT(BundleGeneratorTest) +project(BundleGeneratorTest) -CMAKE_MINIMUM_REQUIRED(VERSION 2.7) +cmake_minimum_required(VERSION 2.7) # Build a shared library and install it in lib/ -ADD_LIBRARY(Library SHARED Library.cxx) -INSTALL(TARGETS Library DESTINATION lib) +add_library(Library SHARED Library.cxx) +install(TARGETS Library DESTINATION lib) # Build an executable and install it in bin/ -ADD_EXECUTABLE(Executable Executable.cxx) -TARGET_LINK_LIBRARIES(Executable Library) -INSTALL(TARGETS Executable DESTINATION bin) +add_executable(Executable Executable.cxx) +target_link_libraries(Executable Library) +install(TARGETS Executable DESTINATION bin) # Use the bundle-generator for packaging ... -SET(CPACK_GENERATOR "Bundle") -SET(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/BundleIcon.icns") -SET(CPACK_BUNDLE_NAME "BundleGeneratorTest") -SET(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist") -SET(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/StartupCommand") -SET(CPACK_PACKAGE_DESCRIPTION "Project for testing OSX bundle generation") +set(CPACK_GENERATOR "Bundle") +set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/BundleIcon.icns") +set(CPACK_BUNDLE_NAME "BundleGeneratorTest") +set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist") +set(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/StartupCommand") +set(CPACK_PACKAGE_DESCRIPTION "Project for testing OSX bundle generation") # The custom volume icon is a copy of the normal Mac OSX volume icon, but # on a white background. This is to differentiate it from the normal one @@ -25,9 +25,9 @@ SET(CPACK_PACKAGE_DESCRIPTION "Project for testing OSX bundle generation") # visual inspection of the mounted volume... This was added when fixing # issue #7523... # -SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/CustomVolumeIcon.icns") +set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/CustomVolumeIcon.icns") -SET(CPACK_PACKAGE_NAME "BundleGeneratorTest") -SET(CPACK_PACKAGE_VERSION "0.1") +set(CPACK_PACKAGE_NAME "BundleGeneratorTest") +set(CPACK_PACKAGE_VERSION "0.1") -INCLUDE(CPack) +include(CPack) diff --git a/Tests/BundleTest/BundleSubDir/CMakeLists.txt b/Tests/BundleTest/BundleSubDir/CMakeLists.txt index 322b2a7d2..1921ce095 100644 --- a/Tests/BundleTest/BundleSubDir/CMakeLists.txt +++ b/Tests/BundleTest/BundleSubDir/CMakeLists.txt @@ -1,36 +1,36 @@ -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist" COMMAND /bin/cp ARGS "${BundleTest_SOURCE_DIR}/randomResourceFile.plist.in" "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist") -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist" PROPERTIES MACOSX_PACKAGE_LOCATION Resources ) -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( "${BundleTest_SOURCE_DIR}/SomeRandomFile.txt" "${BundleTest_SOURCE_DIR}/../../ChangeLog.txt" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS ) -ADD_EXECUTABLE(SecondBundle +add_executable(SecondBundle MACOSX_BUNDLE "${BundleTest_SOURCE_DIR}/BundleTest.cxx" "${BundleTest_SOURCE_DIR}/SomeRandomFile.txt" "${BundleTest_SOURCE_DIR}/../../ChangeLog.txt" "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist" ) -TARGET_LINK_LIBRARIES(SecondBundle BundleTestLib) +target_link_libraries(SecondBundle BundleTestLib) # Test bundle installation. -INSTALL(TARGETS SecondBundle DESTINATION Applications) +install(TARGETS SecondBundle DESTINATION Applications) # Test whether bundles respect the output name. Since the library is # installed into a location that uses this output name this will fail if the # bundle does not respect the name. Also the executable will not be found by # the test driver if this does not work. -SET_TARGET_PROPERTIES(SecondBundle PROPERTIES OUTPUT_NAME SecondBundleExe) +set_target_properties(SecondBundle PROPERTIES OUTPUT_NAME SecondBundleExe) diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt index 5342f49bd..4fb65bfa6 100644 --- a/Tests/BundleTest/CMakeLists.txt +++ b/Tests/BundleTest/CMakeLists.txt @@ -1,28 +1,28 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(BundleTest) -SET(MACOSX_BUNDLE_INFO_STRING "bundle_info_string") -SET(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different ") +project(BundleTest) +set(MACOSX_BUNDLE_INFO_STRING "bundle_info_string") +set(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different ") -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist" COMMAND /bin/cp ARGS "${CMAKE_CURRENT_SOURCE_DIR}/randomResourceFile.plist.in" "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist") -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist" PROPERTIES MACOSX_PACKAGE_LOCATION Resources ) -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( SomeRandomFile.txt "${BundleTest_SOURCE_DIR}/../../ChangeLog.txt" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS ) -SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar") +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar") # Test building a bundle linking to a shared library where the # shared library links to CoreFoundation, but the executable does not @@ -31,74 +31,74 @@ SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar") # if CMake's dependency chaining for libraries with "-framework # blah" style dependencies gets broken... # -ADD_LIBRARY(BundleTestLib SHARED BundleLib.cxx) -TARGET_LINK_LIBRARIES(BundleTestLib "-framework CoreFoundation") +add_library(BundleTestLib SHARED BundleLib.cxx) +target_link_libraries(BundleTestLib "-framework CoreFoundation") -ADD_EXECUTABLE(BundleTest +add_executable(BundleTest MACOSX_BUNDLE BundleTest.cxx SomeRandomFile.txt "${BundleTest_SOURCE_DIR}/../../ChangeLog.txt" "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist" ) -TARGET_LINK_LIBRARIES(BundleTest BundleTestLib) +target_link_libraries(BundleTest BundleTestLib) # -# DO NOT: TARGET_LINK_LIBRARIES(BundleTest "-framework CoreFoundation") +# DO NOT: target_link_libraries(BundleTest "-framework CoreFoundation") # (see above comments about CoreFoundation) # # Test bundle installation. -#INSTALL(TARGETS BundleTestLib DESTINATION Applications/BundleTestExe.app/Contents/Plugins) -INSTALL(TARGETS BundleTestLib DESTINATION Applications/SecondBundleExe.app/Contents/Plugins) -INSTALL(TARGETS BundleTest DESTINATION Applications) +#install(TARGETS BundleTestLib DESTINATION Applications/BundleTestExe.app/Contents/Plugins) +install(TARGETS BundleTestLib DESTINATION Applications/SecondBundleExe.app/Contents/Plugins) +install(TARGETS BundleTest DESTINATION Applications) # Test whether bundles respect the output name. Since the library is # installed into a location that uses this output name this will fail if the # bundle does not respect the name. Also the executable will not be found by # the test driver if this does not work. -SET_TARGET_PROPERTIES(BundleTest PROPERTIES OUTPUT_NAME BundleTestExe) +set_target_properties(BundleTest PROPERTIES OUTPUT_NAME BundleTestExe) # Test executable versioning if it is supported. -IF(NOT XCODE) - SET_TARGET_PROPERTIES(BundleTest PROPERTIES VERSION 1) -ENDIF(NOT XCODE) +if(NOT XCODE) + set_target_properties(BundleTest PROPERTIES VERSION 1) +endif(NOT XCODE) # Make sure the executable can find its installed library. -SET_TARGET_PROPERTIES(BundleTestLib PROPERTIES +set_target_properties(BundleTestLib PROPERTIES INSTALL_NAME_DIR "@executable_path/../Plugins") -INCLUDE(CPack) +include(CPack) # test the framework find stuff -IF(EXISTS /usr/lib/libtcl.dylib +if(EXISTS /usr/lib/libtcl.dylib AND EXISTS /System/Library/Frameworks/Tcl.framework) - SET(TCL NOTFOUND) - FIND_LIBRARY(TCL tcl) - MESSAGE("frame: ${TCL}") - IF(NOT "${TCL}" MATCHES .framework) - MESSAGE(FATAL_ERROR "Could not find tcl framework, found ${TCL}") - ENDIF(NOT "${TCL}" MATCHES .framework) - SET(TCL NOTFOUND) - SET(CMAKE_FIND_FRAMEWORK LAST) - FIND_LIBRARY(TCL tcl) - IF("${TCL}" MATCHES .framework) - MESSAGE(FATAL_ERROR "Found framework and should have found dylib ${TCL}") - ENDIF("${TCL}" MATCHES .framework) - SET(TCL NOTFOUND) - SET(CMAKE_FIND_FRAMEWORK NEVER) - FIND_LIBRARY(TCL tcl) - IF("${TCL}" MATCHES .framework) - MESSAGE(FATAL_ERROR "Found framework and should have found dylib ${TCL}") - ENDIF("${TCL}" MATCHES .framework) - MESSAGE("not frame: ${TCL}") - SET(TCL NOTFOUND) - SET(CMAKE_FIND_FRAMEWORK FIRST) - FIND_LIBRARY(TCL tcl) - IF(NOT "${TCL}" MATCHES .framework) - MESSAGE(FATAL_ERROR "Could not find tcl framework, found ${TCL}") - ENDIF(NOT "${TCL}" MATCHES .framework) - MESSAGE("frame: ${TCL}") -ENDIF(EXISTS /usr/lib/libtcl.dylib + set(TCL NOTFOUND) + find_library(TCL tcl) + message("frame: ${TCL}") + if(NOT "${TCL}" MATCHES .framework) + message(FATAL_ERROR "Could not find tcl framework, found ${TCL}") + endif(NOT "${TCL}" MATCHES .framework) + set(TCL NOTFOUND) + set(CMAKE_FIND_FRAMEWORK LAST) + find_library(TCL tcl) + if("${TCL}" MATCHES .framework) + message(FATAL_ERROR "Found framework and should have found dylib ${TCL}") + endif("${TCL}" MATCHES .framework) + set(TCL NOTFOUND) + set(CMAKE_FIND_FRAMEWORK NEVER) + find_library(TCL tcl) + if("${TCL}" MATCHES .framework) + message(FATAL_ERROR "Found framework and should have found dylib ${TCL}") + endif("${TCL}" MATCHES .framework) + message("not frame: ${TCL}") + set(TCL NOTFOUND) + set(CMAKE_FIND_FRAMEWORK FIRST) + find_library(TCL tcl) + if(NOT "${TCL}" MATCHES .framework) + message(FATAL_ERROR "Could not find tcl framework, found ${TCL}") + endif(NOT "${TCL}" MATCHES .framework) + message("frame: ${TCL}") +endif(EXISTS /usr/lib/libtcl.dylib AND EXISTS /System/Library/Frameworks/Tcl.framework) -SUBDIRS(BundleSubDir) +subdirs(BundleSubDir) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 27ae3a072..70d4171fb 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1,9 +1,9 @@ # a macro for tests that have a simple format where the name matches the # directory and project -MACRO(ADD_TEST_MACRO NAME COMMAND) - STRING(REPLACE "." "/" dir "${NAME}") - STRING(REGEX REPLACE "[^.]*\\." "" proj "${NAME}") - ADD_TEST(${NAME} ${CMAKE_CTEST_COMMAND} +macro(ADD_TEST_MACRO NAME COMMAND) + string(REPLACE "." "/" dir "${NAME}") + string(REGEX REPLACE "[^.]*\\." "" proj "${NAME}") + add_test(${NAME} ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/${dir}" "${CMake_BINARY_DIR}/Tests/${dir}" @@ -13,69 +13,69 @@ MACRO(ADD_TEST_MACRO NAME COMMAND) --build-project ${proj} ${${NAME}_EXTRA_OPTIONS} --test-command ${COMMAND} ${ARGN}) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}") -ENDMACRO(ADD_TEST_MACRO) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}") +endmacro(ADD_TEST_MACRO) -MACRO(REGEX_ESCAPE_STRING _OUT _IN) +macro(REGEX_ESCAPE_STRING _OUT _IN) # Escape special regex metacharacters with a backslash string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" ${_OUT} "${_IN}") -ENDMACRO(REGEX_ESCAPE_STRING _OUT _IN) +endmacro(REGEX_ESCAPE_STRING _OUT _IN) -INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake) +include(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake) # Fake a user home directory to avoid polluting the real one. -IF(DEFINED ENV{HOME} AND NOT CTEST_NO_TEST_HOME) - SET(TEST_HOME "${CMake_BINARY_DIR}/Tests/CMakeFiles/TestHome") - FILE(MAKE_DIRECTORY "${TEST_HOME}") - FILE(WRITE "${TEST_HOME}/.cvspass" ":pserver:anoncvs@www.cmake.org:/cvsroot/KWSys A\n") - SET(TEST_HOME_ENV_CODE "# Fake a user home directory to avoid polluting the real one. +if(DEFINED ENV{HOME} AND NOT CTEST_NO_TEST_HOME) + set(TEST_HOME "${CMake_BINARY_DIR}/Tests/CMakeFiles/TestHome") + file(MAKE_DIRECTORY "${TEST_HOME}") + file(WRITE "${TEST_HOME}/.cvspass" ":pserver:anoncvs@www.cmake.org:/cvsroot/KWSys A\n") + set(TEST_HOME_ENV_CODE "# Fake a user home directory to avoid polluting the real one. # But provide original ENV{HOME} value in ENV{CTEST_REAL_HOME} for tests that # need access to the real HOME directory. -SET(ENV{CTEST_REAL_HOME} \"\$ENV{HOME}\") -SET(ENV{HOME} \"${TEST_HOME}\") +set(ENV{CTEST_REAL_HOME} \"\$ENV{HOME}\") +set(ENV{HOME} \"${TEST_HOME}\") ") -ENDIF() +endif() # Choose a default configuration for CTest tests. -SET(CTestTest_CONFIG Debug) -IF(NOT CMAKE_CONFIGURATION_TYPES AND CMAKE_BUILD_TYPE) - SET(CTestTest_CONFIG ${CMAKE_BUILD_TYPE}) -ENDIF() +set(CTestTest_CONFIG Debug) +if(NOT CMAKE_CONFIGURATION_TYPES AND CMAKE_BUILD_TYPE) + set(CTestTest_CONFIG ${CMAKE_BUILD_TYPE}) +endif() -CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in +configure_file(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in ${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake @ONLY) # Testing -IF(BUILD_TESTING) - IF("${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles" OR ("${CMAKE_TEST_GENERATOR}" MATCHES Ninja AND NOT WIN32)) - SET(TEST_CompileCommandOutput 1) - ENDIF() +if(BUILD_TESTING) + if("${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles" OR ("${CMAKE_TEST_GENERATOR}" MATCHES Ninja AND NOT WIN32)) + set(TEST_CompileCommandOutput 1) + endif() - ADD_SUBDIRECTORY(CMakeLib) - ADD_SUBDIRECTORY(CMakeOnly) - ADD_SUBDIRECTORY(RunCMake) + add_subdirectory(CMakeLib) + add_subdirectory(CMakeOnly) + add_subdirectory(RunCMake) - ADD_SUBDIRECTORY(FindPackageModeMakefileTest) + add_subdirectory(FindPackageModeMakefileTest) # Collect a list of all test build directories. - SET(TEST_BUILD_DIRS) + set(TEST_BUILD_DIRS) # Should the long tests be run? - OPTION(CMAKE_RUN_LONG_TESTS + option(CMAKE_RUN_LONG_TESTS "Should the long tests be run (such as Bootstrap)." ON) - MARK_AS_ADVANCED(CMAKE_RUN_LONG_TESTS) + mark_as_advanced(CMAKE_RUN_LONG_TESTS) - IF (CMAKE_RUN_LONG_TESTS) - OPTION(CTEST_TEST_CTEST + if (CMAKE_RUN_LONG_TESTS) + option(CTEST_TEST_CTEST "Should the tests that run a full sub ctest process be run?" OFF) - MARK_AS_ADVANCED(CTEST_TEST_CTEST) + mark_as_advanced(CTEST_TEST_CTEST) - OPTION(TEST_KDE4_STABLE_BRANCH + option(TEST_KDE4_STABLE_BRANCH "Should the KDE4 stable branch test be run?" OFF) - MARK_AS_ADVANCED(TEST_KDE4_STABLE_BRANCH) - ENDIF (CMAKE_RUN_LONG_TESTS) + mark_as_advanced(TEST_KDE4_STABLE_BRANCH) + endif (CMAKE_RUN_LONG_TESTS) # Should tests that use CVS be run? # @@ -108,35 +108,35 @@ IF(BUILD_TESTING) # well-known bug in kwsys process execution that I would love to get # time to fix. # - OPTION(CTEST_TEST_CPACK + option(CTEST_TEST_CPACK "Should the tests that use '--build-target package' be run?" ON) - MARK_AS_ADVANCED(CTEST_TEST_CPACK) - SET(CTEST_TEST_OSX_ARCH 0) - IF(APPLE) - EXECUTE_PROCESS( + mark_as_advanced(CTEST_TEST_CPACK) + set(CTEST_TEST_OSX_ARCH 0) + if(APPLE) + execute_process( COMMAND sw_vers -productVersion OUTPUT_VARIABLE OSX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) - IF(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]") - MESSAGE(STATUS "Forcing CTEST_TEST_CPACK=OFF on OSX < 10.4") - MESSAGE(STATUS "OSX_VERSION='${OSX_VERSION}'") - SET(CTEST_TEST_CPACK OFF) - ELSE(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]") - SET(CTEST_TEST_OSX_ARCH 1) - ENDIF(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]") - ENDIF(APPLE) + if(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]") + message(STATUS "Forcing CTEST_TEST_CPACK=OFF on OSX < 10.4") + message(STATUS "OSX_VERSION='${OSX_VERSION}'") + set(CTEST_TEST_CPACK OFF) + else(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]") + set(CTEST_TEST_OSX_ARCH 1) + endif(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]") + endif(APPLE) # Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value, # whichever is greater. - SET(CMAKE_LONG_TEST_TIMEOUT 1500) - IF(CTEST_TEST_TIMEOUT) - SET(CMAKE_LONG_TEST_TIMEOUT ${CTEST_TEST_TIMEOUT}) - ENDIF(CTEST_TEST_TIMEOUT) - IF(CMAKE_LONG_TEST_TIMEOUT LESS 1500) - SET(CMAKE_LONG_TEST_TIMEOUT 1500) - ENDIF(CMAKE_LONG_TEST_TIMEOUT LESS 1500) + set(CMAKE_LONG_TEST_TIMEOUT 1500) + if(CTEST_TEST_TIMEOUT) + set(CMAKE_LONG_TEST_TIMEOUT ${CTEST_TEST_TIMEOUT}) + endif(CTEST_TEST_TIMEOUT) + if(CMAKE_LONG_TEST_TIMEOUT LESS 1500) + set(CMAKE_LONG_TEST_TIMEOUT 1500) + endif(CMAKE_LONG_TEST_TIMEOUT LESS 1500) # add a bunch of standard build-and-test style tests ADD_TEST_MACRO(CommandLineTest CommandLineTest) @@ -148,53 +148,53 @@ IF(BUILD_TESTING) ADD_TEST_MACRO(SystemInformation SystemInformation) ADD_TEST_MACRO(MathTest MathTest) # assume no resources building to test - SET(TEST_RESOURCES FALSE) + set(TEST_RESOURCES FALSE) # for windows and cygwin assume we have resources - IF(WIN32 OR CYGWIN) - SET(TEST_RESOURCES TRUE) - ENDIF() + if(WIN32 OR CYGWIN) + set(TEST_RESOURCES TRUE) + endif() # for borland and watcom there is no resource support - IF("${CMAKE_TEST_GENERATOR}" MATCHES "WMake" OR + if("${CMAKE_TEST_GENERATOR}" MATCHES "WMake" OR "${CMAKE_TEST_GENERATOR}" MATCHES "Borland") - SET(TEST_RESOURCES FALSE) - ENDIF() - IF(TEST_RESOURCES) + set(TEST_RESOURCES FALSE) + endif() + if(TEST_RESOURCES) ADD_TEST_MACRO(VSResource VSResource) - ENDIF() + endif() ADD_TEST_MACRO(Simple Simple) ADD_TEST_MACRO(PreOrder PreOrder) ADD_TEST_MACRO(MissingSourceFile MissingSourceFile) - SET_TESTS_PROPERTIES(MissingSourceFile PROPERTIES + set_tests_properties(MissingSourceFile PROPERTIES PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file:[ \r\n]*DoesNotExist/MissingSourceFile.c") - IF(CMAKE_Fortran_COMPILER) + if(CMAKE_Fortran_COMPILER) ADD_TEST_MACRO(FortranOnly FortranOnly) - ENDIF() + endif() # test Visual Studio GNU Fortran mixing with cmake_add_fortran_subdirectory # run this project if we have a working fortran compiler or # the test is enabled with CMAKE_TEST_CMAKE_ADD_FORTRAN cache variable. # If you enable the test, CMake should find the MinGW fortran install, # or in some cases you might need to set the PATH so that cmake can find # the gfortran from mingw. - IF(CMAKE_Fortran_COMPILER OR CMAKE_TEST_CMAKE_ADD_FORTRAN) - SET(CMAKE_SKIP_VSGNUFortran FALSE) + if(CMAKE_Fortran_COMPILER OR CMAKE_TEST_CMAKE_ADD_FORTRAN) + set(CMAKE_SKIP_VSGNUFortran FALSE) # disable test for apple builds using ifort if they are building # more than one architecture, as ifort does not support that. - IF(APPLE AND (CMAKE_Fortran_COMPILER MATCHES ifort)) - LIST(LENGTH CMAKE_OSX_ARCHITECTURES len) - IF("${len}" GREATER 1) - MESSAGE(STATUS "Skip VSGNUFortran for ifort dual cpu mac build") - SET(CMAKE_SKIP_VSGNUFortran TRUE) - ENDIF() - ENDIF() - IF((CMAKE_C_COMPILER MATCHES lsb) + if(APPLE AND (CMAKE_Fortran_COMPILER MATCHES ifort)) + list(LENGTH CMAKE_OSX_ARCHITECTURES len) + if("${len}" GREATER 1) + message(STATUS "Skip VSGNUFortran for ifort dual cpu mac build") + set(CMAKE_SKIP_VSGNUFortran TRUE) + endif() + endif() + if((CMAKE_C_COMPILER MATCHES lsb) AND (CMAKE_Fortran_COMPILER MATCHES ifort)) - MESSAGE(STATUS "Skip VSGNUFortran for ifort and lsb compilers") - SET(CMAKE_SKIP_VSGNUFortran TRUE) - ENDIF() - IF(NOT CMAKE_SKIP_VSGNUFortran) + message(STATUS "Skip VSGNUFortran for ifort and lsb compilers") + set(CMAKE_SKIP_VSGNUFortran TRUE) + endif() + if(NOT CMAKE_SKIP_VSGNUFortran) ADD_TEST_MACRO(VSGNUFortran ${CMAKE_COMMAND} -P runtest.cmake) - ENDIF() - ENDIF() + endif() + endif() ADD_TEST_MACRO(COnly COnly) ADD_TEST_MACRO(CxxOnly CxxOnly) ADD_TEST_MACRO(IPO COnly/COnly) @@ -218,44 +218,44 @@ IF(BUILD_TESTING) ADD_TEST_MACRO(Unset Unset) ADD_TEST_MACRO(PolicyScope PolicyScope) ADD_TEST_MACRO(EmptyLibrary EmptyLibrary) - SET_TESTS_PROPERTIES(EmptyLibrary PROPERTIES + set_tests_properties(EmptyLibrary PROPERTIES PASS_REGULAR_EXPRESSION "CMake Error: CMake can not determine linker language for target:test") ADD_TEST_MACRO(CrossCompile CrossCompile) - SET_TESTS_PROPERTIES(CrossCompile PROPERTIES + set_tests_properties(CrossCompile PROPERTIES PASS_REGULAR_EXPRESSION "TRY_RUN.. invoked in cross-compiling mode") - IF("${CMAKE_TEST_GENERATOR}" MATCHES "Make") + if("${CMAKE_TEST_GENERATOR}" MATCHES "Make") ADD_TEST_MACRO(Policy0002 Policy0002) - ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "Make") - IF(CTEST_TEST_OSX_ARCH) + endif("${CMAKE_TEST_GENERATOR}" MATCHES "Make") + if(CTEST_TEST_OSX_ARCH) ADD_TEST_MACRO(Architecture Architecture) - SET_TESTS_PROPERTIES(Architecture PROPERTIES + set_tests_properties(Architecture PROPERTIES PASS_REGULAR_EXPRESSION "(file is not of required architecture|does not match cputype|not the architecture being linked)") - ENDIF(CTEST_TEST_OSX_ARCH) + endif(CTEST_TEST_OSX_ARCH) - LIST(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX}) + list(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX}) - IF(NOT QT4_FOUND) - FIND_PACKAGE(Qt4) - ENDIF(NOT QT4_FOUND) + if(NOT QT4_FOUND) + find_package(Qt4) + endif(NOT QT4_FOUND) - IF(QT4_FOUND) + if(QT4_FOUND) # test whether the Qt4 which has been found works, on some machines # which run nightly builds there were errors like "wrong file format" # for libQtCore.so. So first check it works, and only if it does add # the automoc test. - INCLUDE(CheckCXXSourceCompiles) - SET(_save_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") - SET(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") + include(CheckCXXSourceCompiles) + set(_save_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") + set(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") - SET(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES}) - SET(CMAKE_REQUIRED_LIBRARIES ${QT_QTCORE_LIBRARIES}) + set(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES}) + set(CMAKE_REQUIRED_LIBRARIES ${QT_QTCORE_LIBRARIES}) CHECK_CXX_SOURCE_COMPILES("#include \n int main() {return (qApp == 0 ? 0 : 1); }\n" QT4_WORKS) - SET(CMAKE_REQUIRED_INCLUDES "${_save_CMAKE_REQUIRED_INCLUDES}") - SET(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}") - ENDIF() + set(CMAKE_REQUIRED_INCLUDES "${_save_CMAKE_REQUIRED_INCLUDES}") + set(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}") + endif() # run test for BundleUtilities on supported platforms/compilers if(MSVC OR @@ -263,7 +263,7 @@ IF(BUILD_TESTING) CMAKE_SYSTEM_NAME MATCHES "Darwin") if(NOT "${CMAKE_TEST_GENERATOR}" STREQUAL "Watcom WMake") - ADD_TEST(BundleUtilities ${CMAKE_CTEST_COMMAND} + add_test(BundleUtilities ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/BundleUtilities" "${CMake_BINARY_DIR}/Tests/BundleUtilities" @@ -271,12 +271,12 @@ IF(BUILD_TESTING) --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project BundleUtilities ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities") # run test for DeployQt4 on supported platforms/compilers (which depends on BundleUtilities) # this test also depends on the existence of the standard qtiff plugin if(QT4_WORKS AND QT_QTSQL_FOUND) - ADD_TEST(Qt4Deploy ${CMAKE_CTEST_COMMAND} + add_test(Qt4Deploy ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Qt4Deploy" "${CMake_BINARY_DIR}/Tests/Qt4Deploy" @@ -287,29 +287,29 @@ IF(BUILD_TESTING) -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Deploy") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Deploy") endif() endif() endif() - SET(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/COnly") - SET(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/CMakeBuildCOnly") - SET(CMAKE_BUILD_TEST_EXE COnly) - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in" + set(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/COnly") + set(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/CMakeBuildCOnly") + set(CMAKE_BUILD_TEST_EXE COnly) + configure_file("${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in" "${CMake_BINARY_DIR}/Tests/CMakeBuildTest.cmake" @ONLY) - ADD_TEST(CMakeBuildTest ${CMAKE_CMAKE_COMMAND} -P + add_test(CMakeBuildTest ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CMakeBuildTest.cmake") - LIST(APPEND TEST_BUILD_DIRS ${CMAKE_BUILD_TEST_BINARY_DIR}) + list(APPEND TEST_BUILD_DIRS ${CMAKE_BUILD_TEST_BINARY_DIR}) # now do it again for a project that has two project commands - SET(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/DoubleProject") - SET(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/DoubleProject") - SET(CMAKE_BUILD_TEST_EXE just_silly) - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in" + set(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/DoubleProject") + set(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/DoubleProject") + set(CMAKE_BUILD_TEST_EXE just_silly) + configure_file("${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in" "${CMake_BINARY_DIR}/Tests/CMakeBuildDoubleProjectTest.cmake" @ONLY) - ADD_TEST(CMakeDoubleProject ${CMAKE_CMAKE_COMMAND} -P + add_test(CMakeDoubleProject ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CMakeBuildDoubleProjectTest.cmake") - LIST(APPEND TEST_BUILD_DIRS ${CMAKE_BUILD_TEST_BINARY_DIR}) + list(APPEND TEST_BUILD_DIRS ${CMAKE_BUILD_TEST_BINARY_DIR}) ADD_TEST_MACRO(Module.CheckTypeSize CheckTypeSize) @@ -333,7 +333,7 @@ IF(BUILD_TESTING) ADD_TEST_MACRO(PositionIndependentTargets PositionIndependentTargets) endif() - ADD_TEST(LinkFlags-prepare + add_test(LinkFlags-prepare ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} --build-and-test "${CMake_SOURCE_DIR}/Tests/LinkFlags" @@ -344,16 +344,16 @@ IF(BUILD_TESTING) --build-target LinkFlags --build-options -DTEST_CONFIG=\${CTEST_CONFIGURATION_TYPE} ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkFlags") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkFlags") - MACRO(ADD_LINK_FLAGS_TEST name depends) - ADD_TEST(LinkFlags-${name} + macro(ADD_LINK_FLAGS_TEST name depends) + add_test(LinkFlags-${name} ${CMAKE_CMAKE_COMMAND} --build "${CMake_BINARY_DIR}/Tests/LinkFlags" --target LinkFlags_${name} --config \${CTEST_CONFIGURATION_TYPE} ) - SET_TESTS_PROPERTIES(LinkFlags-${name} PROPERTIES + set_tests_properties(LinkFlags-${name} PROPERTIES PASS_REGULAR_EXPRESSION "BADFLAG" DEPENDS LinkFlags-${depends}) - ENDMACRO() + endmacro() ADD_LINK_FLAGS_TEST(lib prepare) ADD_LINK_FLAGS_TEST(dll lib) ADD_LINK_FLAGS_TEST(exe dll) @@ -365,12 +365,12 @@ IF(BUILD_TESTING) # build the "Simple" test with the ExtraGenerators, if available # This doesn't test whether the generated project files work (unfortunately), # mainly it tests that cmake doesn't crash when generating these project files. - IF(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop") + if(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop") # check which generators we have - EXEC_PROGRAM(${CMAKE_CMAKE_COMMAND} ARGS --help OUTPUT_VARIABLE cmakeOutput ) + exec_program(${CMAKE_CMAKE_COMMAND} ARGS --help OUTPUT_VARIABLE cmakeOutput ) # check for the Eclipse generator - IF ("${cmakeOutput}" MATCHES Eclipse) - ADD_TEST(Simple_EclipseGenerator ${CMAKE_CTEST_COMMAND} + if ("${cmakeOutput}" MATCHES Eclipse) + add_test(Simple_EclipseGenerator ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Simple" "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator" @@ -379,12 +379,12 @@ IF(BUILD_TESTING) --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project Simple --test-command Simple) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator") - ENDIF ("${cmakeOutput}" MATCHES Eclipse) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator") + endif ("${cmakeOutput}" MATCHES Eclipse) # check for the CodeBlocks generator - IF ("${cmakeOutput}" MATCHES CodeBlocks) - ADD_TEST(Simple_CodeBlocksGenerator ${CMAKE_CTEST_COMMAND} + if ("${cmakeOutput}" MATCHES CodeBlocks) + add_test(Simple_CodeBlocksGenerator ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Simple" "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator" @@ -393,11 +393,11 @@ IF(BUILD_TESTING) --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project Simple --test-command Simple) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator") - ENDIF ("${cmakeOutput}" MATCHES CodeBlocks) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator") + endif ("${cmakeOutput}" MATCHES CodeBlocks) # check for the KDevelop3 generator - IF ("${cmakeOutput}" MATCHES KDevelop3) - ADD_TEST(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND} + if ("${cmakeOutput}" MATCHES KDevelop3) + add_test(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Simple" "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator" @@ -406,17 +406,17 @@ IF(BUILD_TESTING) --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project Simple --test-command Simple) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator") - ENDIF ("${cmakeOutput}" MATCHES KDevelop3) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator") + endif ("${cmakeOutput}" MATCHES KDevelop3) - ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop") + endif(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop") # test for correct sub-project generation # not implemented in VS6 or Xcode - IF(NOT MSVC60 AND NOT XCODE AND NOT MSVC70) + if(NOT MSVC60 AND NOT XCODE AND NOT MSVC70) # run cmake and configure all of SubProject # but only build the independent executable car - ADD_TEST(SubProject ${CMAKE_CTEST_COMMAND} + add_test(SubProject ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubProject" "${CMake_BINARY_DIR}/Tests/SubProject" @@ -427,20 +427,20 @@ IF(BUILD_TESTING) --test-command car ) - IF(${CMAKE_TEST_GENERATOR} MATCHES "Ninja") + if(${CMAKE_TEST_GENERATOR} MATCHES "Ninja") # The Ninja generator does not create a recursive build system. Start # from the root directory. - SET(SubProject_SUBDIR) - ELSE() - SET(SubProject_SUBDIR "/foo") - ENDIF() + set(SubProject_SUBDIR) + else() + set(SubProject_SUBDIR "/foo") + endif() # For stage 2, do not run cmake again. # Then build the foo sub project which should build # the bar library which should be referenced because # foo links to the static library bar, but bar is not # directly in the foo sub project - ADD_TEST(SubProject-Stage2 ${CMAKE_CTEST_COMMAND} + add_test(SubProject-Stage2 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubProject${SubProject_SUBDIR}" "${CMake_BINARY_DIR}/Tests/SubProject${SubProject_SUBDIR}" @@ -452,29 +452,29 @@ IF(BUILD_TESTING) --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubProject/foo" --test-command foo ) - SET_TESTS_PROPERTIES ( SubProject-Stage2 PROPERTIES DEPENDS SubProject) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubProject") - ENDIF(NOT MSVC60 AND NOT XCODE AND NOT MSVC70) + set_tests_properties ( SubProject-Stage2 PROPERTIES DEPENDS SubProject) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubProject") + endif(NOT MSVC60 AND NOT XCODE AND NOT MSVC70) - IF (CMAKE_STRICT) + if (CMAKE_STRICT) ADD_TEST_MACRO(DocTest DocTest) - ENDIF (CMAKE_STRICT) + endif (CMAKE_STRICT) # macro to add a test that will build a nightly release # of CMake for given platform using the release scripts - MACRO(ADD_NIGHTLY_BUILD_TEST name script) - SET(_TEST_DIR "${CMake_BINARY_DIR}/Tests/${name}") - FILE(MAKE_DIRECTORY "${_TEST_DIR}") - FILE(WRITE "${_TEST_DIR}/nightly-cmake.sh" + macro(ADD_NIGHTLY_BUILD_TEST name script) + set(_TEST_DIR "${CMake_BINARY_DIR}/Tests/${name}") + file(MAKE_DIRECTORY "${_TEST_DIR}") + file(WRITE "${_TEST_DIR}/nightly-cmake.sh" "cd ${_TEST_DIR} ${CMake_BINARY_DIR}/bin/cmake -DCMAKE_CREATE_VERSION=nightly -P ${CMake_SOURCE_DIR}/Utilities/Release/${script} ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/Release/upload_release.cmake ") - ADD_TEST(${name} /bin/sh ${_TEST_DIR}/nightly-cmake.sh) - IF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) - SET_TESTS_PROPERTIES (${name} PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) - ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) - ENDMACRO(ADD_NIGHTLY_BUILD_TEST) - IF(CMAKE_BUILD_NIGHTLY_RELEASES) + add_test(${name} /bin/sh ${_TEST_DIR}/nightly-cmake.sh) + if(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) + set_tests_properties (${name} PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) + endif(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) + endmacro(ADD_NIGHTLY_BUILD_TEST) + if(CMAKE_BUILD_NIGHTLY_RELEASES) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyWindows dash2win64_release.cmake) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyMac @@ -483,10 +483,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ dashmacmini5_release.cmake) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux magrathea_release.cmake) - ENDIF(CMAKE_BUILD_NIGHTLY_RELEASES) + endif(CMAKE_BUILD_NIGHTLY_RELEASES) # add tests with more complex invocations - ADD_TEST(Framework ${CMAKE_CTEST_COMMAND} + add_test(Framework ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Framework" "${CMake_BINARY_DIR}/Tests/Framework" @@ -497,9 +497,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/Framework/Install" --test-command bar) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework") - ADD_TEST(TargetName ${CMAKE_CTEST_COMMAND} + add_test(TargetName ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/TargetName" "${CMake_BINARY_DIR}/Tests/TargetName" @@ -510,9 +510,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files ${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world ${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TargetName") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TargetName") - ADD_TEST(LibName ${CMAKE_CTEST_COMMAND} + add_test(LibName ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/LibName" "${CMake_BINARY_DIR}/Tests/LibName" @@ -523,9 +523,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib" --test-command foobar ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName") - ADD_TEST(CustComDepend ${CMAKE_CTEST_COMMAND} + add_test(CustComDepend ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CustComDepend" "${CMake_BINARY_DIR}/Tests/CustComDepend" @@ -536,9 +536,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustComDepend/bin" --test-command foo bar.c ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend") - ADD_TEST(ArgumentExpansion ${CMAKE_CTEST_COMMAND} + add_test(ArgumentExpansion ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/ArgumentExpansion" "${CMake_BINARY_DIR}/Tests/ArgumentExpansion" @@ -547,11 +547,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Tests/ArgumentExpansion/bin" ) - SET_TESTS_PROPERTIES(ArgumentExpansion PROPERTIES + set_tests_properties(ArgumentExpansion PROPERTIES FAIL_REGULAR_EXPRESSION "Unexpected: ") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ArgumentExpansion") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ArgumentExpansion") - ADD_TEST(CustomCommand ${CMAKE_CTEST_COMMAND} + add_test(CustomCommand ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CustomCommand" "${CMake_BINARY_DIR}/Tests/CustomCommand" @@ -562,9 +562,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin" --test-command CustomCommand ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand") - ADD_TEST(CustomCommandWorkingDirectory ${CMAKE_CTEST_COMMAND} + add_test(CustomCommandWorkingDirectory ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CustomCommandWorkingDirectory" "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory" @@ -574,9 +574,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command working ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory") - #ADD_TEST(SimpleExclude ${CMAKE_CTEST_COMMAND} + #add_test(SimpleExclude ${CMAKE_CTEST_COMMAND} # --build-and-test # "${CMake_SOURCE_DIR}/Tests/SimpleExclude" # "${CMake_BINARY_DIR}/Tests/SimpleExclude" @@ -590,7 +590,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ #-P "${CMake_BINARY_DIR}/Tests/SimpleExclude/run.cmake" #) -# ADD_TEST(SameName ${CMAKE_CTEST_COMMAND} +# add_test(SameName ${CMAKE_CTEST_COMMAND} # --build-and-test # "${CMake_SOURCE_DIR}/Tests/SameName" # "${CMake_BINARY_DIR}/Tests/SameName" @@ -601,7 +601,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # --test-command # "${CMake_BINARY_DIR}/Tests/SameName/Exe1/mytest2") - ADD_TEST(OutOfSource ${CMAKE_CTEST_COMMAND} + add_test(OutOfSource ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/OutOfSource" "${CMake_BINARY_DIR}/Tests/OutOfSource" @@ -611,11 +611,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-two-config --test-command "${CMake_BINARY_DIR}/Tests/OutOfSource/SubDir/OutOfSourceSubdir/simple") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSource") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSourceDeep") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfBinary") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSource") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSourceDeep") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfBinary") - ADD_TEST(BuildDepends ${CMAKE_CTEST_COMMAND} + add_test(BuildDepends ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/BuildDepends" "${CMake_BINARY_DIR}/Tests/BuildDepends" @@ -623,11 +623,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project BuildDepends --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends") - SET(SimpleInstallInstallDir + set(SimpleInstallInstallDir "${CMake_BINARY_DIR}/Tests/SimpleInstall/InstallDirectory") - ADD_TEST(SimpleInstall ${CMAKE_CTEST_COMMAND} + add_test(SimpleInstall ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SimpleInstall" "${CMake_BINARY_DIR}/Tests/SimpleInstall" @@ -639,8 +639,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}" "-DCTEST_TEST_CPACK:BOOL=${CTEST_TEST_CPACK}" --test-command ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstExe) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstall") - ADD_TEST(SimpleInstall-Stage2 ${CMAKE_CTEST_COMMAND} + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstall") + add_test(SimpleInstall-Stage2 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SimpleInstallS2" "${CMake_BINARY_DIR}/Tests/SimpleInstallS2" @@ -652,7 +652,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}" "-DSTAGE2:BOOL=1" --test-command ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstExeS2) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstallS2") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstallS2") # By default, run the CPackComponents test if the CTEST_TEST_CPACK # option is ON: @@ -686,7 +686,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ endif(NSIS_MAKENSIS_EXECUTABLE) endif(WIN32) - IF(CTEST_RUN_CPackComponents) + if(CTEST_RUN_CPackComponents) set(CPackComponents_EXTRA_OPTIONS) if(APPLE) set(CPackComponents_EXTRA_OPTIONS -DCPACK_BINARY_DRAGNDROP:BOOL=ON) @@ -696,7 +696,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -DCPACK_BINARY_NSIS:BOOL=ON) endif(NSIS_MAKENSIS_EXECUTABLE) - ADD_TEST(CPackComponents ${CMAKE_CTEST_COMMAND} + add_test(CPackComponents ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CPackComponents" "${CMake_BINARY_DIR}/Tests/CPackComponents" @@ -713,10 +713,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command ${CMAKE_CMAKE_COMMAND} "-DCPackComponents_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponents" -P "${CMake_SOURCE_DIR}/Tests/CPackComponents/VerifyResult.cmake") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents") - ENDIF(CTEST_RUN_CPackComponents) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents") + endif(CTEST_RUN_CPackComponents) - IF(CTEST_RUN_CPackComponentsForAll) + if(CTEST_RUN_CPackComponentsForAll) # Check whether if rpmbuild command is found # before adding RPM tests find_program(RPMBUILD_EXECUTABLE NAMES rpmbuild) @@ -759,7 +759,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set(CPackRun_CPackGen "-DCPackGen=${CPackGen}") foreach(CPackComponentWay ${CWAYLST}) set(CPackRun_CPackComponentWay "-DCPackComponentWay=${CPackComponentWay}") - ADD_TEST(CPackComponentsForAll-${CPackGen}-${CPackComponentWay} ${CMAKE_CTEST_COMMAND} + add_test(CPackComponentsForAll-${CPackGen}-${CPackComponentWay} ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll" "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}" @@ -777,10 +777,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CPackRun_CPackGen}" "${CPackRun_CPackComponentWay}" -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}") endforeach(CPackComponentWay) endforeach(CPackGen) - ENDIF(CTEST_RUN_CPackComponentsForAll) + endif(CTEST_RUN_CPackComponentsForAll) # By default, turn this test off (because it takes a long time...) # @@ -799,8 +799,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ CMAKE_RUN_LONG_TESTS) endif(NOT DEFINED CTEST_RUN_CPackTestAllGenerators) - IF(CTEST_RUN_CPackTestAllGenerators) - ADD_TEST(CPackTestAllGenerators ${CMAKE_CTEST_COMMAND} + if(CTEST_RUN_CPackTestAllGenerators) + add_test(CPackTestAllGenerators ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CPackTestAllGenerators" "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators" @@ -813,16 +813,16 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -D cpack=${CMAKE_CPACK_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/CPackTestAllGenerators/RunCPack.cmake ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators") - ENDIF(CTEST_RUN_CPackTestAllGenerators) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators") + endif(CTEST_RUN_CPackTestAllGenerators) - IF(CTEST_package_X11_TEST) - SET(X11_build_target_arg --build-target package) - ELSE(CTEST_package_X11_TEST) - SET(X11_build_target_arg) - ENDIF(CTEST_package_X11_TEST) + if(CTEST_package_X11_TEST) + set(X11_build_target_arg --build-target package) + else(CTEST_package_X11_TEST) + set(X11_build_target_arg) + endif(CTEST_package_X11_TEST) - ADD_TEST(X11 ${CMAKE_CTEST_COMMAND} + add_test(X11 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/X11" "${CMake_BINARY_DIR}/Tests/X11" @@ -832,53 +832,53 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-two-config ${X11_build_target_arg} --test-command UseX11) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/X11") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/X11") if(NOT DEFINED CTEST_RUN_CMakeTestAllGenerators) set(CTEST_RUN_CMakeTestAllGenerators ON) endif(NOT DEFINED CTEST_RUN_CMakeTestAllGenerators) - IF(CTEST_RUN_CMakeTestAllGenerators) - ADD_TEST(CMakeTestAllGenerators ${CMAKE_CMAKE_COMMAND} + if(CTEST_RUN_CMakeTestAllGenerators) + add_test(CMakeTestAllGenerators ${CMAKE_CMAKE_COMMAND} -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR} -P ${CMake_SOURCE_DIR}/Tests/CMakeTestAllGenerators/RunCMake.cmake ) - LIST(APPEND TEST_BUILD_DIRS + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators") - ENDIF(CTEST_RUN_CMakeTestAllGenerators) + endif(CTEST_RUN_CMakeTestAllGenerators) if(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines) set(CTEST_RUN_CMakeTestBadCommandLines ON) endif(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines) - IF(CTEST_RUN_CMakeTestBadCommandLines) - ADD_TEST(CMakeTestBadCommandLines ${CMAKE_CMAKE_COMMAND} + if(CTEST_RUN_CMakeTestBadCommandLines) + add_test(CMakeTestBadCommandLines ${CMAKE_CMAKE_COMMAND} -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines -D gen=${CMAKE_TEST_GENERATOR} -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR} -P ${CMake_SOURCE_DIR}/Tests/CMakeTestBadCommandLines/RunCMake.cmake ) - LIST(APPEND TEST_BUILD_DIRS + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines") - ENDIF(CTEST_RUN_CMakeTestBadCommandLines) + endif(CTEST_RUN_CMakeTestBadCommandLines) if(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures) set(CTEST_RUN_CMakeTestMultipleConfigures ON) endif(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures) - IF(CTEST_RUN_CMakeTestMultipleConfigures) - ADD_TEST(CMakeTestMultipleConfigures ${CMAKE_CMAKE_COMMAND} + if(CTEST_RUN_CMakeTestMultipleConfigures) + add_test(CMakeTestMultipleConfigures ${CMAKE_CMAKE_COMMAND} -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures -D gen=${CMAKE_TEST_GENERATOR} -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR} -P ${CMake_SOURCE_DIR}/Tests/CMakeTestMultipleConfigures/RunCMake.cmake ) - LIST(APPEND TEST_BUILD_DIRS + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures") - ENDIF(CTEST_RUN_CMakeTestMultipleConfigures) + endif(CTEST_RUN_CMakeTestMultipleConfigures) - ADD_TEST(LoadedCommandOneConfig ${CMAKE_CTEST_COMMAND} + add_test(LoadedCommandOneConfig ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/LoadCommandOneConfig" "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig" @@ -887,9 +887,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command LoadedCommand ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig") - ADD_TEST(complex ${CMAKE_CTEST_COMMAND} + add_test(complex ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Complex" "${CMake_BINARY_DIR}/Tests/Complex" @@ -903,9 +903,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} --test-command complex ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Complex") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Complex") - ADD_TEST(complexOneConfig ${CMAKE_CTEST_COMMAND} + add_test(complexOneConfig ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/ComplexOneConfig" "${CMake_BINARY_DIR}/Tests/ComplexOneConfig" @@ -916,11 +916,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-options -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} --test-command complex) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig") # because of the registry write these tests depend on each other - SET_TESTS_PROPERTIES ( complex PROPERTIES DEPENDS complexOneConfig) + set_tests_properties ( complex PROPERTIES DEPENDS complexOneConfig) - ADD_TEST(Example ${CMAKE_CTEST_COMMAND} + add_test(Example ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Example" "${CMake_BINARY_DIR}/Example" @@ -930,9 +930,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/Example/Demo" --test-command helloDemo ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Example") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Example") - ADD_TEST(Environment ${CMAKE_CTEST_COMMAND} + add_test(Environment ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Environment" "${CMake_BINARY_DIR}/Tests/Environment" @@ -943,10 +943,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --force-new-ctest-process --test-command ${CMAKE_CTEST_COMMAND} -V ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment") - IF(QT4_WORKS AND QT_QTGUI_FOUND) - ADD_TEST(QtAutomoc ${CMAKE_CTEST_COMMAND} + if(QT4_WORKS AND QT_QTGUI_FOUND) + add_test(QtAutomoc ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/QtAutomoc" "${CMake_BINARY_DIR}/Tests/QtAutomoc" @@ -958,10 +958,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} --test-command ${CMAKE_CTEST_COMMAND} -V ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomoc") - ENDIF() + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomoc") + endif() - ADD_TEST(ExternalProject ${CMAKE_CTEST_COMMAND} + add_test(ExternalProject ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/ExternalProject" "${CMake_BINARY_DIR}/Tests/ExternalProject" @@ -972,13 +972,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --force-new-ctest-process --test-command ${CMAKE_CTEST_COMMAND} -V ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject") - SET_TESTS_PROPERTIES(ExternalProject PROPERTIES + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject") + set_tests_properties(ExternalProject PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) # do each of the tutorial steps - FOREACH(STP RANGE 1 7) - ADD_TEST(TutorialStep${STP} ${CMAKE_CTEST_COMMAND} + foreach(STP RANGE 1 7) + add_test(TutorialStep${STP} ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Tutorial/Step${STP}" "${CMake_BINARY_DIR}/Tests/Tutorial/Step${STP}" @@ -987,10 +987,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project Tutorial --test-command Tutorial 25.0) - ENDFOREACH(STP) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial") + endforeach(STP) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial") - ADD_TEST(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} + add_test(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} --build-and-test "${CMake_SOURCE_DIR}/Tests/Testing" "${CMake_BINARY_DIR}/Tests/Testing" @@ -999,10 +999,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} ) - SET_TESTS_PROPERTIES(testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Testing") + set_tests_properties(testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Testing") - ADD_TEST(wrapping ${CMAKE_CTEST_COMMAND} + add_test(wrapping ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Wrapping" "${CMake_BINARY_DIR}/Tests/Wrapping" @@ -1012,7 +1012,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --test-command wrapping ) - ADD_TEST(qtwrapping ${CMAKE_CTEST_COMMAND} + add_test(qtwrapping ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Wrapping" "${CMake_BINARY_DIR}/Tests/Wrapping" @@ -1022,9 +1022,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --test-command qtwrapping ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping") - ADD_TEST(testdriver1 ${CMAKE_CTEST_COMMAND} + add_test(testdriver1 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/TestDriver" "${CMake_BINARY_DIR}/Tests/TestDriver" @@ -1035,7 +1035,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command TestDriverTest test1 ) - ADD_TEST(testdriver2 ${CMAKE_CTEST_COMMAND} + add_test(testdriver2 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/TestDriver" "${CMake_BINARY_DIR}/Tests/TestDriver" @@ -1046,7 +1046,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command TestDriverTest test2 ) - ADD_TEST(testdriver3 ${CMAKE_CTEST_COMMAND} + add_test(testdriver3 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/TestDriver" "${CMake_BINARY_DIR}/Tests/TestDriver" @@ -1056,9 +1056,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project TestDriverTest --test-command TestDriverTest subdir/test3 ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver") - ADD_TEST(Dependency ${CMAKE_CTEST_COMMAND} + add_test(Dependency ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Dependency" "${CMake_BINARY_DIR}/Tests/Dependency" @@ -1068,9 +1068,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project Dependency --test-command exec ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency") - IF("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + if("${CMAKE_SYSTEM_NAME}" MATCHES syllable) # RPATH isn't supported under Syllable, so the tests don't # find their libraries. In order to fix that LIBRARY_OUTPUT_DIR @@ -1078,17 +1078,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # For now we just require on Syllable that the user adjusts the DLL_PATH # environment variable, so except the two tests below all other tests will succeed. - SET(_DLL_PATH "$ENV{DLL_PATH}") - IF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$") - MESSAGE(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/.\" to the DLL_PATH environment variable") - ENDIF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$") - IF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$") - MESSAGE(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/../lib\" to the DLL_PATH environment variable") - ENDIF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$") + set(_DLL_PATH "$ENV{DLL_PATH}") + if(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$") + message(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/.\" to the DLL_PATH environment variable") + endif(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$") + if(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$") + message(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/../lib\" to the DLL_PATH environment variable") + endif(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$") - ELSE("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + else("${CMAKE_SYSTEM_NAME}" MATCHES syllable) - ADD_TEST(JumpWithLibOut ${CMAKE_CTEST_COMMAND} + add_test(JumpWithLibOut ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Jump" "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut" @@ -1101,7 +1101,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command jumpExecutable ) - ADD_TEST(JumpNoLibOut ${CMAKE_CTEST_COMMAND} + add_test(JumpNoLibOut ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Jump" "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut" @@ -1112,9 +1112,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command jumpExecutable ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump") - ADD_TEST(Plugin ${CMAKE_CTEST_COMMAND} + add_test(Plugin ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Plugin" "${CMake_BINARY_DIR}/Tests/Plugin" @@ -1123,14 +1123,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config --test-command bin/example) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin") - IF(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) + if(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) ADD_TEST_MACRO(RuntimePath RuntimePath) - ENDIF(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) - ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + endif(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) + endif("${CMAKE_SYSTEM_NAME}" MATCHES syllable) - ADD_TEST(linkorder1 ${CMAKE_CTEST_COMMAND} + add_test(linkorder1 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/LinkLineOrder" "${CMake_BINARY_DIR}/Tests/LinkLineOrder" @@ -1140,7 +1140,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command Exec1 ) - ADD_TEST(linkorder2 ${CMAKE_CTEST_COMMAND} + add_test(linkorder2 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/LinkLineOrder" "${CMake_BINARY_DIR}/Tests/LinkLineOrder" @@ -1149,19 +1149,19 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project LinkLineOrder --test-command Exec2 ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkLineOrder") - SET_TESTS_PROPERTIES ( qtwrapping PROPERTIES DEPENDS wrapping) - SET_TESTS_PROPERTIES ( testdriver1 PROPERTIES DEPENDS qtwrapping) - SET_TESTS_PROPERTIES ( testdriver2 PROPERTIES DEPENDS testdriver1) - SET_TESTS_PROPERTIES ( testdriver3 PROPERTIES DEPENDS testdriver2) - SET_TESTS_PROPERTIES ( linkorder2 PROPERTIES DEPENDS linkorder1) - SET_TESTS_PROPERTIES ( SimpleInstall-Stage2 PROPERTIES DEPENDS SimpleInstall) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkLineOrder") + set_tests_properties ( qtwrapping PROPERTIES DEPENDS wrapping) + set_tests_properties ( testdriver1 PROPERTIES DEPENDS qtwrapping) + set_tests_properties ( testdriver2 PROPERTIES DEPENDS testdriver1) + set_tests_properties ( testdriver3 PROPERTIES DEPENDS testdriver2) + set_tests_properties ( linkorder2 PROPERTIES DEPENDS linkorder1) + set_tests_properties ( SimpleInstall-Stage2 PROPERTIES DEPENDS SimpleInstall) # Test static linking on toolchains known to support it. - IF("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU)$" + if("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU)$" AND NOT APPLE AND NOT WIN32 AND NOT CYGWIN AND EXISTS "/usr/lib/libm.a") - ADD_TEST(LinkStatic ${CMAKE_CTEST_COMMAND} + add_test(LinkStatic ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/LinkStatic" "${CMake_BINARY_DIR}/Tests/LinkStatic" @@ -1171,10 +1171,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-options -DMATH_LIBRARY:FILEPATH=/usr/lib/libm.a --test-command LinkStatic ) - ENDIF() + endif() - IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR) - ADD_TEST(kwsys ${CMAKE_CTEST_COMMAND} + if(NOT CMAKE_TEST_DIFFERENT_GENERATOR) + add_test(kwsys ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Source/kwsys" "${CMake_BINARY_DIR}/Tests/kwsys" @@ -1183,27 +1183,27 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project kwsys --test-command kwsysTestsCxx testIOS ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys") - ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR) - SET(MAKE_IS_GNU ) - IF(${CMAKE_TEST_MAKEPROGRAM} MATCHES make) - EXEC_PROGRAM( + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys") + endif(NOT CMAKE_TEST_DIFFERENT_GENERATOR) + set(MAKE_IS_GNU ) + if(${CMAKE_TEST_MAKEPROGRAM} MATCHES make) + exec_program( ${CMAKE_TEST_MAKEPROGRAM} ARGS no_such_target --version RETURN_VALUE res OUTPUT_VARIABLE out ) - IF("${res}" EQUAL 0) - IF("${out}" MATCHES "GNU") - SET(MAKE_IS_GNU 1) - ENDIF("${out}" MATCHES "GNU") - ENDIF("${res}" EQUAL 0) - ENDIF(${CMAKE_TEST_MAKEPROGRAM} MATCHES make) + if("${res}" EQUAL 0) + if("${out}" MATCHES "GNU") + set(MAKE_IS_GNU 1) + endif("${out}" MATCHES "GNU") + endif("${res}" EQUAL 0) + endif(${CMAKE_TEST_MAKEPROGRAM} MATCHES make) # only add this test on platforms that support it # some old versions of make simply cannot handle spaces in paths - IF (MAKE_IS_GNU OR + if (MAKE_IS_GNU OR "${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland") - ADD_TEST(SubDirSpaces ${CMAKE_CTEST_COMMAND} + add_test(SubDirSpaces ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubDirSpaces" "${CMake_BINARY_DIR}/Tests/SubDirSpaces" @@ -1216,13 +1216,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/SubDirSpaces/ShouldBeHere" "${CMake_BINARY_DIR}/Tests/SubDirSpaces/testfromsubdir.obj" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDirSpaces") - ENDIF (MAKE_IS_GNU OR + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDirSpaces") + endif (MAKE_IS_GNU OR "${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland") - IF (WIN32) - ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND} + if (WIN32) + add_test(SubDir ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubDir" "${CMake_BINARY_DIR}/Tests/SubDir" @@ -1234,8 +1234,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere" "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.obj" ) - ELSE (WIN32) - ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND} + else (WIN32) + add_test(SubDir ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubDir" "${CMake_BINARY_DIR}/Tests/SubDir" @@ -1247,22 +1247,22 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere" "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.o" ) - ENDIF (WIN32) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir") + endif (WIN32) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir") - IF(CMAKE_TEST_MSVC) + if(CMAKE_TEST_MSVC) ADD_TEST_MACRO(ForceInclude foo) ADD_TEST_MACRO(PrecompiledHeader foo) - ENDIF() - IF(CMAKE_TEST_MSVC OR + endif() + if(CMAKE_TEST_MSVC OR "${CMAKE_TEST_GENERATOR}" MATCHES "(MSYS|MinGW) Makefiles") ADD_TEST_MACRO(ModuleDefinition example_exe) - ENDIF() + endif() ADD_TEST_MACRO(CheckCompilerRelatedVariables CheckCompilerRelatedVariables) - IF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile") - ADD_TEST(MakeClean ${CMAKE_CTEST_COMMAND} + if("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile") + add_test(MakeClean ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/MakeClean" "${CMake_BINARY_DIR}/Tests/MakeClean" @@ -1272,8 +1272,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/MakeClean" --test-command check_clean ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean") - ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean") + endif("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile") if(NOT DEFINED CTEST_RUN_MFC) set(CTEST_RUN_MFC OFF) @@ -1380,12 +1380,12 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MFC") endif() - IF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio") - IF(NOT MSVC60) + if(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio") + if(NOT MSVC60) ADD_TEST_MACRO(SBCS SBCS) - ENDIF(NOT MSVC60) + endif(NOT MSVC60) - ADD_TEST(VSExternalInclude ${CMAKE_CTEST_COMMAND} + add_test(VSExternalInclude ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VSExternalInclude" "${CMake_BINARY_DIR}/Tests/VSExternalInclude" @@ -1394,9 +1394,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project VSExternalInclude --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command VSExternalInclude) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude") - ADD_TEST(VSMidl ${CMAKE_CTEST_COMMAND} + add_test(VSMidl ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VSMidl" "${CMake_BINARY_DIR}/Tests/VSMidl" @@ -1405,14 +1405,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project VSMidl --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command VSMidl) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl") - ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl") + endif(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio") - IF (APPLE) + if (APPLE) if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - SET(BundleTestInstallDir + set(BundleTestInstallDir "${CMake_BINARY_DIR}/Tests/BundleTest/InstallDirectory") - ADD_TEST(BundleTest ${CMAKE_CTEST_COMMAND} + add_test(BundleTest ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/BundleTest" "${CMake_BINARY_DIR}/Tests/BundleTest" @@ -1426,9 +1426,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}" --test-command ${BundleTestInstallDir}/Applications/SecondBundleExe.app/Contents/MacOS/SecondBundleExe) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest") - ADD_TEST(CFBundleTest ${CMAKE_CTEST_COMMAND} + add_test(CFBundleTest ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CFBundleTest" "${CMake_BINARY_DIR}/Tests/CFBundleTest" @@ -1441,14 +1441,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -Ddir=${CMake_BINARY_DIR}/Tests/CFBundleTest -Dgen=${CMAKE_TEST_GENERATOR} -P ${CMake_SOURCE_DIR}/Tests/CFBundleTest/VerifyResult.cmake) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest") ADD_TEST_MACRO(ObjC++ ObjC++) - ENDIF (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - ENDIF (APPLE) + endif (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + endif (APPLE) - IF(APPLE AND CTEST_TEST_CPACK) - ADD_TEST(BundleGeneratorTest ${CMAKE_CTEST_COMMAND} + if(APPLE AND CTEST_TEST_CPACK) + add_test(BundleGeneratorTest ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/BundleGeneratorTest" "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest" @@ -1459,10 +1459,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-target package --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest") - ENDIF(APPLE AND CTEST_TEST_CPACK) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest") + endif(APPLE AND CTEST_TEST_CPACK) - ADD_TEST(WarnUnusedUnusedViaSet ${CMAKE_CTEST_COMMAND} + add_test(WarnUnusedUnusedViaSet ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUnusedViaSet" "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet" @@ -1471,13 +1471,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-noclean --build-project WarnUnusedUnusedViaSet --build-options "--warn-unused-vars") - SET_TESTS_PROPERTIES(WarnUnusedUnusedViaSet PROPERTIES + set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES PASS_REGULAR_EXPRESSION "unused variable \\(changing definition\\) 'UNUSED_VARIABLE'") - SET_TESTS_PROPERTIES(WarnUnusedUnusedViaSet PROPERTIES + set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES FAIL_REGULAR_EXPRESSION "unused variable \\(unsetting\\) 'UNUSED_VARIABLE'") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet") - ADD_TEST(WarnUnusedUnusedViaUnset ${CMAKE_CTEST_COMMAND} + add_test(WarnUnusedUnusedViaUnset ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUnusedViaUnset" "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset" @@ -1486,13 +1486,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-noclean --build-project WarnUnusedUnusedViaUnset --build-options "--warn-unused-vars") - SET_TESTS_PROPERTIES(WarnUnusedUnusedViaUnset PROPERTIES + set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES PASS_REGULAR_EXPRESSION "CMake Warning .*:7 \\(set\\):") - SET_TESTS_PROPERTIES(WarnUnusedUnusedViaUnset PROPERTIES + set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES FAIL_REGULAR_EXPRESSION "CMake Warning .*:5 \\(set\\):") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset") - ADD_TEST(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND} + add_test(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUsage" "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused" @@ -1501,11 +1501,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-noclean --build-project WarnUnusedCliUnused --build-options "-DUNUSED_CLI_VARIABLE=Unused") - SET_TESTS_PROPERTIES(WarnUnusedCliUnused PROPERTIES + set_tests_properties(WarnUnusedCliUnused PROPERTIES PASS_REGULAR_EXPRESSION "CMake Warning:.*Manually-specified variables were not used by the project:.* UNUSED_CLI_VARIABLE") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused") - ADD_TEST(WarnUnusedCliUsed ${CMAKE_CTEST_COMMAND} + add_test(WarnUnusedCliUsed ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUsage" "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed" @@ -1514,13 +1514,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-noclean --build-project WarnUnusedCliUsed --build-options "-DUSED_VARIABLE=Usage proven") - SET_TESTS_PROPERTIES(WarnUnusedCliUsed PROPERTIES + set_tests_properties(WarnUnusedCliUsed PROPERTIES PASS_REGULAR_EXPRESSION "Usage proven") - SET_TESTS_PROPERTIES(WarnUnusedCliUsed PROPERTIES + set_tests_properties(WarnUnusedCliUsed PROPERTIES FAIL_REGULAR_EXPRESSION "CMake Warning: The variable, 'USED_VARIABLE'") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed") - ADD_TEST(WarnUninitialized ${CMAKE_CTEST_COMMAND} + add_test(WarnUninitialized ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUsage" "${CMake_BINARY_DIR}/Tests/WarnUninitialized" @@ -1529,11 +1529,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-noclean --build-project WarnUninitialized --build-options "--warn-uninitialized") - SET_TESTS_PROPERTIES(WarnUninitialized PROPERTIES + set_tests_properties(WarnUninitialized PROPERTIES PASS_REGULAR_EXPRESSION "uninitialized variable 'USED_VARIABLE'") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUninitialized") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUninitialized") - ADD_TEST(TestsWorkingDirectory ${CMAKE_CTEST_COMMAND} + add_test(TestsWorkingDirectory ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/TestsWorkingDirectory" "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory" @@ -1544,200 +1544,200 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --force-new-ctest-process --test-command ${CMAKE_CTEST_COMMAND} -V -C \${CTEST_CONFIGURATION_TYPE} ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory") # Make sure CTest can handle a test with no newline in output. - ADD_TEST(CTest.NoNewline + add_test(CTest.NoNewline ${CMAKE_CMAKE_COMMAND} -E echo_append "This line has no newline!") # A simple test for ctest in script mode - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in" + configure_file("${CMake_SOURCE_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake" @ONLY) -# ADD_TEST(CTest.ScriptMode ${CMAKE_CTEST_COMMAND} +# add_test(CTest.ScriptMode ${CMAKE_CTEST_COMMAND} # -S "${CMake_BINARY_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake" # ) - SET(CTEST_TEST_UPDATE 1) - IF(CTEST_TEST_UPDATE) + set(CTEST_TEST_UPDATE 1) + if(CTEST_TEST_UPDATE) # Test CTest Update with Subversion - FIND_PACKAGE(Subversion QUIET) - IF(Subversion_FOUND) - GET_FILENAME_COMPONENT(_Subversion_BIN_DIR + find_package(Subversion QUIET) + if(Subversion_FOUND) + get_filename_component(_Subversion_BIN_DIR ${Subversion_SVN_EXECUTABLE} PATH) - FIND_PROGRAM(Subversion_SVNADMIN_EXECUTABLE svnadmin + find_program(Subversion_SVNADMIN_EXECUTABLE svnadmin HINTS ${_Subversion_BIN_DIR} ) - MARK_AS_ADVANCED(Subversion_SVNADMIN_EXECUTABLE) - IF(NOT Subversion_SVNADMIN_EXECUTABLE) - SET(Subversion_FOUND FALSE) - ENDIF(NOT Subversion_SVNADMIN_EXECUTABLE) - ENDIF(Subversion_FOUND) - IF(Subversion_FOUND) - SET(CTestUpdateSVN_DIR "CTest UpdateSVN") - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateSVN.cmake.in" + mark_as_advanced(Subversion_SVNADMIN_EXECUTABLE) + if(NOT Subversion_SVNADMIN_EXECUTABLE) + set(Subversion_FOUND FALSE) + endif(NOT Subversion_SVNADMIN_EXECUTABLE) + endif(Subversion_FOUND) + if(Subversion_FOUND) + set(CTestUpdateSVN_DIR "CTest UpdateSVN") + configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateSVN.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestUpdateSVN.cmake" @ONLY) - ADD_TEST(CTest.UpdateSVN ${CMAKE_CMAKE_COMMAND} + add_test(CTest.UpdateSVN ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CTestUpdateSVN.cmake" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateSVN_DIR}") - ENDIF(Subversion_FOUND) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateSVN_DIR}") + endif(Subversion_FOUND) # Test CTest Update with CVS - IF(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) - FIND_PACKAGE(CVS QUIET) - ELSE(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) - FIND_PROGRAM(CVS_EXECUTABLE NAMES cvs) - SET(CVS_FOUND ${CVS_EXECUTABLE}) - ENDIF(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) - SET(CTEST_TEST_UPDATE_CVS ${CVS_FOUND}) - IF(CTEST_TEST_UPDATE_CVS AND NOT UNIX) - IF("${CVS_EXECUTABLE}" MATCHES "cygwin") - MESSAGE(STATUS "No CTest.UpdateCVS test with cygwin cvs.exe outside cygwin!") - SET(CTEST_TEST_UPDATE_CVS 0) - ENDIF("${CVS_EXECUTABLE}" MATCHES "cygwin") - ENDIF(CTEST_TEST_UPDATE_CVS AND NOT UNIX) - IF(CTEST_TEST_UPDATE_CVS) - SET(CTestUpdateCVS_DIR "CTest UpdateCVS") - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateCVS.cmake.in" + if(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) + find_package(CVS QUIET) + else(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) + find_program(CVS_EXECUTABLE NAMES cvs) + set(CVS_FOUND ${CVS_EXECUTABLE}) + endif(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) + set(CTEST_TEST_UPDATE_CVS ${CVS_FOUND}) + if(CTEST_TEST_UPDATE_CVS AND NOT UNIX) + if("${CVS_EXECUTABLE}" MATCHES "cygwin") + message(STATUS "No CTest.UpdateCVS test with cygwin cvs.exe outside cygwin!") + set(CTEST_TEST_UPDATE_CVS 0) + endif("${CVS_EXECUTABLE}" MATCHES "cygwin") + endif(CTEST_TEST_UPDATE_CVS AND NOT UNIX) + if(CTEST_TEST_UPDATE_CVS) + set(CTestUpdateCVS_DIR "CTest UpdateCVS") + configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateCVS.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestUpdateCVS.cmake" @ONLY) - ADD_TEST(CTest.UpdateCVS ${CMAKE_CMAKE_COMMAND} + add_test(CTest.UpdateCVS ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CTestUpdateCVS.cmake" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateCVS_DIR}") - ENDIF(CTEST_TEST_UPDATE_CVS) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateCVS_DIR}") + endif(CTEST_TEST_UPDATE_CVS) # Test CTest Update with BZR - FIND_PROGRAM(BZR_EXECUTABLE NAMES bzr) - MARK_AS_ADVANCED(BZR_EXECUTABLE) - SET(CTEST_TEST_UPDATE_BZR 0) - IF(BZR_EXECUTABLE) - IF(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - SET(CTEST_TEST_UPDATE_BZR 1) - ENDIF(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - ENDIF(BZR_EXECUTABLE) - IF(CTEST_TEST_UPDATE_BZR) + find_program(BZR_EXECUTABLE NAMES bzr) + mark_as_advanced(BZR_EXECUTABLE) + set(CTEST_TEST_UPDATE_BZR 0) + if(BZR_EXECUTABLE) + if(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX) + set(CTEST_TEST_UPDATE_BZR 1) + endif(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX) + endif(BZR_EXECUTABLE) + if(CTEST_TEST_UPDATE_BZR) # Check if xmloutput plugin is there - EXECUTE_PROCESS(COMMAND ${BZR_EXECUTABLE} xmlplugins RESULT_VARIABLE xmlplugres + execute_process(COMMAND ${BZR_EXECUTABLE} xmlplugins RESULT_VARIABLE xmlplugres OUTPUT_QUIET ERROR_QUIET) - IF( NOT ${xmlplugres} ) - SET(CTestUpdateBZR_DIR "CTest UpdateBZR") - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in" + if( NOT ${xmlplugres} ) + set(CTestUpdateBZR_DIR "CTest UpdateBZR") + configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestUpdateBZR.cmake" @ONLY) - ADD_TEST(CTest.UpdateBZR ${CMAKE_CMAKE_COMMAND} + add_test(CTest.UpdateBZR ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CTestUpdateBZR.cmake" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}") - SET(CTestUpdateBZR_DIR "CTest UpdateBZR_CLocale") - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in" + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}") + set(CTestUpdateBZR_DIR "CTest UpdateBZR_CLocale") + configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestUpdateBZR_CLocale.cmake" @ONLY) - ADD_TEST(CTest.UpdateBZR.CLocale ${CMAKE_CMAKE_COMMAND} + add_test(CTest.UpdateBZR.CLocale ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CTestUpdateBZR_CLocale.cmake" ) - SET_TESTS_PROPERTIES(CTest.UpdateBZR.CLocale PROPERTIES ENVIRONMENT LC_ALL=C) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}") - ENDIF( NOT ${xmlplugres} ) - ENDIF(CTEST_TEST_UPDATE_BZR) + set_tests_properties(CTest.UpdateBZR.CLocale PROPERTIES ENVIRONMENT LC_ALL=C) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}") + endif( NOT ${xmlplugres} ) + endif(CTEST_TEST_UPDATE_BZR) # Test CTest Update with GIT - FIND_PROGRAM(GIT_EXECUTABLE NAMES git) - MARK_AS_ADVANCED(GIT_EXECUTABLE) - SET(CTEST_TEST_UPDATE_GIT 0) - IF(GIT_EXECUTABLE) - IF(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - SET(CTEST_TEST_UPDATE_GIT 1) - ENDIF(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - ENDIF(GIT_EXECUTABLE) - IF(CTEST_TEST_UPDATE_GIT) - SET(CTestUpdateGIT_DIR "CTest UpdateGIT") - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateGIT.cmake.in" + find_program(GIT_EXECUTABLE NAMES git) + mark_as_advanced(GIT_EXECUTABLE) + set(CTEST_TEST_UPDATE_GIT 0) + if(GIT_EXECUTABLE) + if(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX) + set(CTEST_TEST_UPDATE_GIT 1) + endif(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX) + endif(GIT_EXECUTABLE) + if(CTEST_TEST_UPDATE_GIT) + set(CTestUpdateGIT_DIR "CTest UpdateGIT") + configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateGIT.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestUpdateGIT.cmake" @ONLY) - ADD_TEST(CTest.UpdateGIT ${CMAKE_CMAKE_COMMAND} + add_test(CTest.UpdateGIT ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CTestUpdateGIT.cmake" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateGIT_DIR}") - ENDIF(CTEST_TEST_UPDATE_GIT) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateGIT_DIR}") + endif(CTEST_TEST_UPDATE_GIT) # Test CTest Update with HG - FIND_PROGRAM(HG_EXECUTABLE NAMES hg) - MARK_AS_ADVANCED(HG_EXECUTABLE) - SET(CTEST_TEST_UPDATE_HG 0) - IF(HG_EXECUTABLE) - IF(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - SET(CTEST_TEST_UPDATE_HG 1) - ENDIF(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - ENDIF(HG_EXECUTABLE) - IF(CTEST_TEST_UPDATE_HG) - SET(CTestUpdateHG_DIR "CTest UpdateHG") - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateHG.cmake.in" + find_program(HG_EXECUTABLE NAMES hg) + mark_as_advanced(HG_EXECUTABLE) + set(CTEST_TEST_UPDATE_HG 0) + if(HG_EXECUTABLE) + if(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX) + set(CTEST_TEST_UPDATE_HG 1) + endif(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX) + endif(HG_EXECUTABLE) + if(CTEST_TEST_UPDATE_HG) + set(CTestUpdateHG_DIR "CTest UpdateHG") + configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateHG.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestUpdateHG.cmake" @ONLY) - ADD_TEST(CTest.UpdateHG ${CMAKE_CMAKE_COMMAND} + add_test(CTest.UpdateHG ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CTestUpdateHG.cmake" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateHG_DIR}") - ENDIF(CTEST_TEST_UPDATE_HG) - ENDIF(CTEST_TEST_UPDATE) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateHG_DIR}") + endif(CTEST_TEST_UPDATE_HG) + endif(CTEST_TEST_UPDATE) - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestFailure/testNoBuild.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoBuild.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestNoBuild ${CMAKE_CTEST_COMMAND} + add_test(CTestTestNoBuild ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoBuild.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testOut1.log" ) - SET_TESTS_PROPERTIES(CTestTestNoBuild PROPERTIES + set_tests_properties(CTestTestNoBuild PROPERTIES FAIL_REGULAR_EXPRESSION "Error" WILL_FAIL true) - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestFailure/testNoExe.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoExe.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestNoExe ${CMAKE_CTEST_COMMAND} + add_test(CTestTestNoExe ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoExe.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testOut2.log" ) - SET_TESTS_PROPERTIES(CTestTestNoExe PROPERTIES DEPENDS CTestTestNoBuild + set_tests_properties(CTestTestNoExe PROPERTIES DEPENDS CTestTestNoBuild PASS_REGULAR_EXPRESSION "Could not find executable" FAIL_REGULAR_EXPRESSION "SegFault") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestUpload/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestUpload ${CMAKE_CTEST_COMMAND} + add_test(CTestTestUpload ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestUpload/testOut.log" ) - SET_TESTS_PROPERTIES(CTestTestUpload PROPERTIES + set_tests_properties(CTestTestUpload PROPERTIES PASS_REGULAR_EXPRESSION "Upload\\.xml") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestConfigFileInBuildDir1 ${CMAKE_CTEST_COMMAND} + add_test(CTestTestConfigFileInBuildDir1 ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/testOut1.log" ) REGEX_ESCAPE_STRING(CTEST_TEST_ESCAPED_SOURCE_DIR "${CMake_SOURCE_DIR}") - SET_TESTS_PROPERTIES(CTestTestConfigFileInBuildDir1 PROPERTIES DEPENDS CTestTestNoBuild + set_tests_properties(CTestTestConfigFileInBuildDir1 PROPERTIES DEPENDS CTestTestNoBuild PASS_REGULAR_EXPRESSION "Reading ctest configuration file: ${CTEST_TEST_ESCAPED_SOURCE_DIR}.Tests.CTestTestConfigFileInBuildDir.CTestConfig.cmake") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake" @ONLY ESCAPE_QUOTES) - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake" "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/CTestConfig.cmake" @ONLY ESCAPE_QUOTES COPYONLY) - ADD_TEST(CTestTestConfigFileInBuildDir2 ${CMAKE_CTEST_COMMAND} + add_test(CTestTestConfigFileInBuildDir2 ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/testOut2.log" ) REGEX_ESCAPE_STRING(CTEST_TEST_ESCAPED_BINARY_DIR "${CMake_BINARY_DIR}") - SET_TESTS_PROPERTIES(CTestTestConfigFileInBuildDir2 PROPERTIES DEPENDS CTestTestNoBuild + set_tests_properties(CTestTestConfigFileInBuildDir2 PROPERTIES DEPENDS CTestTestNoBuild REQUIRED_FILES ${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/CTestConfig.cmake PASS_REGULAR_EXPRESSION "Reading ctest configuration file: ${CTEST_TEST_ESCAPED_BINARY_DIR}.Tests.CTestTestConfigFileInBuildDir2.CTestConfig.cmake") @@ -1829,175 +1829,175 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ADD_TEST_MACRO(CMakeCommands.target_link_libraries target_link_libraries) - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestCrash/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestCrash/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestCrash ${CMAKE_CTEST_COMMAND} + add_test(CTestTestCrash ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestCrash/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCrash/testOutput.log" ) # with watcom the SEGFAULT is not found, it just fails - IF(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") - SET_TESTS_PROPERTIES(CTestTestCrash PROPERTIES + if(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") + set_tests_properties(CTestTestCrash PROPERTIES PASS_REGULAR_EXPRESSION "Failed") - ELSE(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") - SET_TESTS_PROPERTIES(CTestTestCrash PROPERTIES + else(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") + set_tests_properties(CTestTestCrash PROPERTIES PASS_REGULAR_EXPRESSION "(Illegal|SegFault)") - ENDIF(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") + endif(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestBadExe/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestBadExe/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestBadExe ${CMAKE_CTEST_COMMAND} + add_test(CTestTestBadExe ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestBadExe/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestBadExe/testOutput.log" ) - SET(CTestTestBadExe_REGEX "BAD_COMMAND") + set(CTestTestBadExe_REGEX "BAD_COMMAND") # some cygwin can not be made to produce a BAD_COMMAND error # the best we can get from it is a failed test - IF(CYGWIN) - SET(CTestTestBadExe_REGEX "(\\*\\*\\*Failed)|BAD_COMMAND") - ENDIF() - SET_TESTS_PROPERTIES(CTestTestBadExe PROPERTIES + if(CYGWIN) + set(CTestTestBadExe_REGEX "(\\*\\*\\*Failed)|BAD_COMMAND") + endif() + set_tests_properties(CTestTestBadExe PROPERTIES PASS_REGULAR_EXPRESSION "${CTestTestBadExe_REGEX}") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestParallel/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestParallel/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestParallel ${CMAKE_CTEST_COMMAND} + add_test(CTestTestParallel ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestParallel/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestParallel/testOutput.log" ) - ADD_TEST(CTestTestPrintLabels ${CMAKE_CTEST_COMMAND} --print-labels) - SET_TESTS_PROPERTIES(CTestTestPrintLabels PROPERTIES LABELS "Label1;Label2") - SET_TESTS_PROPERTIES(CTestTestPrintLabels PROPERTIES PASS_REGULAR_EXPRESSION + add_test(CTestTestPrintLabels ${CMAKE_CTEST_COMMAND} --print-labels) + set_tests_properties(CTestTestPrintLabels PROPERTIES LABELS "Label1;Label2") + set_tests_properties(CTestTestPrintLabels PROPERTIES PASS_REGULAR_EXPRESSION "All Labels:.* Label1.* Label2") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestResourceLock/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestResourceLock ${CMAKE_CTEST_COMMAND} + add_test(CTestTestResourceLock ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/output.log" ) - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestScheduler/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestScheduler/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestScheduler ${CMAKE_CTEST_COMMAND} + add_test(CTestTestScheduler ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestScheduler/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestScheduler/testOutput.log" ) - SET_TESTS_PROPERTIES(CTestTestScheduler PROPERTIES + set_tests_properties(CTestTestScheduler PROPERTIES PASS_REGULAR_EXPRESSION "Start 1.*Start 2.*Start 3.*Start 4.*Start 4.*Start 3.*Start 2.*Start 1" RESOURCE_LOCK "CostData") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestCostSerial/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestCostSerial/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestCostSerial ${CMAKE_CTEST_COMMAND} + add_test(CTestTestCostSerial ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestCostSerial/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCostSerial/testOutput.log" ) - SET_TESTS_PROPERTIES(CTestTestCostSerial PROPERTIES + set_tests_properties(CTestTestCostSerial PROPERTIES PASS_REGULAR_EXPRESSION "Start 2.*Start 3.*Start 1.*Start 2.*Start 3.*Start 1" RESOURCE_LOCK "CostData") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestStopTime/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/test.cmake" @ONLY ESCAPE_QUOTES) - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestStopTime/GetDate.cmake" "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/GetDate.cmake" COPYONLY) - ADD_TEST(CTestTestStopTime ${CMAKE_CTEST_COMMAND} + add_test(CTestTestStopTime ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/testOutput.log" ) - SET_TESTS_PROPERTIES(CTestTestStopTime PROPERTIES + set_tests_properties(CTestTestStopTime PROPERTIES PASS_REGULAR_EXPRESSION "The stop time has been passed") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestSubdir/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestSubdir/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestSubdir ${CMAKE_CTEST_COMMAND} + add_test(CTestTestSubdir ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestSubdir/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestSubdir/testOutput.log" ) #make sure all 3 subdirs were added - SET_TESTS_PROPERTIES(CTestTestSubdir PROPERTIES + set_tests_properties(CTestTestSubdir PROPERTIES PASS_REGULAR_EXPRESSION "0 tests failed out of 3") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestTimeout/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestTimeout/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestTimeout ${CMAKE_CTEST_COMMAND} + add_test(CTestTestTimeout ${CMAKE_CTEST_COMMAND} -C "\${CTestTest_CONFIG}" -S "${CMake_BINARY_DIR}/Tests/CTestTestTimeout/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestTimeout/testOutput.log" ) - SET_TESTS_PROPERTIES(CTestTestTimeout PROPERTIES + set_tests_properties(CTestTestTimeout PROPERTIES PASS_REGULAR_EXPRESSION "TestTimeout *\\.+ *\\*\\*\\*Timeout.*CheckChild *\\.+ *Passed") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestZeroTimeout/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestZeroTimeout ${CMAKE_CTEST_COMMAND} + add_test(CTestTestZeroTimeout ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/testOutput.log") - SET_TESTS_PROPERTIES(CTestTestZeroTimeout PROPERTIES + set_tests_properties(CTestTestZeroTimeout PROPERTIES FAIL_REGULAR_EXPRESSION "\\*\\*\\*Timeout") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestDepends/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestDepends ${CMAKE_CTEST_COMMAND} + add_test(CTestTestDepends ${CMAKE_CTEST_COMMAND} -C "\${CTestTest_CONFIG}" -S "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestDepends/testOutput.log" ) - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestCycle/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestCycle/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestCycle ${CMAKE_CTEST_COMMAND} + add_test(CTestTestCycle ${CMAKE_CTEST_COMMAND} -C "\${CTestTest_CONFIG}" -S "${CMake_BINARY_DIR}/Tests/CTestTestCycle/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCycle/testOutput.log" ) - SET_TESTS_PROPERTIES(CTestTestCycle PROPERTIES + set_tests_properties(CTestTestCycle PROPERTIES PASS_REGULAR_EXPRESSION "a cycle exists in the test dependency graph") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake" @ONLY ESCAPE_QUOTES) - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/hello.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/hello.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestRunScript ${CMAKE_CTEST_COMMAND} + add_test(CTestTestRunScript ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/testOutput.log" ) - ADD_TEST(CTestTestShowOnly ${CMAKE_CTEST_COMMAND} -N) + add_test(CTestTestShowOnly ${CMAKE_CTEST_COMMAND} -N) - ADD_TEST(CTestBatchTest ${CMAKE_CTEST_COMMAND} -B) + add_test(CTestBatchTest ${CMAKE_CTEST_COMMAND} -B) # Use macro, not function so that build can still be driven by CMake 2.4. # After 2.6 is required, this could be a function without the extra 'set' @@ -2048,120 +2048,120 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ endforeach() - IF (CMAKE_TESTS_CDASH_SERVER) - SET(regex "^([^:]+)://([^/]+)(/.*)$") + if (CMAKE_TESTS_CDASH_SERVER) + set(regex "^([^:]+)://([^/]+)(/.*)$") - IF ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") - SET(protocol "${CMAKE_MATCH_1}") - SET(server "${CMAKE_MATCH_2}") - SET(path "${CMAKE_MATCH_3}") - ELSE ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") - SET(protocol "http") - SET(server "www.cdash.org") - SET(path "/CDash") - MESSAGE("warning: CMAKE_TESTS_CDASH_SERVER does not match expected regex...") - MESSAGE(" ...using default url='${protocol}://${server}${path}' for CTestTest[23]") - ENDIF ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") - ENDIF (CMAKE_TESTS_CDASH_SERVER) + if ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") + set(protocol "${CMAKE_MATCH_1}") + set(server "${CMAKE_MATCH_2}") + set(path "${CMAKE_MATCH_3}") + else ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") + set(protocol "http") + set(server "www.cdash.org") + set(path "/CDash") + message("warning: CMAKE_TESTS_CDASH_SERVER does not match expected regex...") + message(" ...using default url='${protocol}://${server}${path}' for CTestTest[23]") + endif ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") + endif (CMAKE_TESTS_CDASH_SERVER) - IF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER) - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest/test.cmake.in" + if (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER) + configure_file("${CMake_SOURCE_DIR}/Tests/CTestTest/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTest/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTest ${CMAKE_CTEST_COMMAND} + add_test(CTestTest ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTest/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTest/testOutput.log" ) - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest2/test.cmake.in" + configure_file("${CMake_SOURCE_DIR}/Tests/CTestTest2/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTest2/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTest2 ${CMAKE_CTEST_COMMAND} + add_test(CTestTest2 ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTest2/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTest2/testOutput.log" ) - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTestChecksum/test.cmake.in" + configure_file("${CMake_SOURCE_DIR}/Tests/CTestTestChecksum/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestChecksum ${CMAKE_CTEST_COMMAND} + add_test(CTestTestChecksum ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/testOutput.log" ) - SET_TESTS_PROPERTIES(CTestTestChecksum PROPERTIES PASS_REGULAR_EXPRESSION + set_tests_properties(CTestTestChecksum PROPERTIES PASS_REGULAR_EXPRESSION "Submission failed: Checksum failed for file") # these tests take a long time, make sure they have it # if timeouts have not already been set - GET_TEST_PROPERTY(CTestTest TIMEOUT PREVIOUS_TIMEOUT) - IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - SET_TESTS_PROPERTIES ( CTestTest + get_test_property(CTestTest TIMEOUT PREVIOUS_TIMEOUT) + if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + set_tests_properties ( CTestTest PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) - ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - GET_TEST_PROPERTY(CTestTest2 TIMEOUT PREVIOUS_TIMEOUT) - IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - SET_TESTS_PROPERTIES ( CTestTest2 + get_test_property(CTestTest2 TIMEOUT PREVIOUS_TIMEOUT) + if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + set_tests_properties ( CTestTest2 PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) - ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - ENDIF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER) + endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + endif (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER) - IF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH) - IF(UNIX) - IF(NOT QT4_FOUND) - FIND_PACKAGE(Qt4) - ENDIF(NOT QT4_FOUND) + if (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH) + if(UNIX) + if(NOT QT4_FOUND) + find_package(Qt4) + endif(NOT QT4_FOUND) - SET(TRY_BUILD_KDE4 TRUE) - IF(QT4_FOUND) + set(TRY_BUILD_KDE4 TRUE) + if(QT4_FOUND) # check whether it's Qt 4.5 in a cmake 2.4. compatible way: - IF(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache") - SET(TRY_BUILD_KDE4 FALSE) - ENDIF(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache") - ELSE(QT4_FOUND) - SET(TRY_BUILD_KDE4 FALSE) - ENDIF(QT4_FOUND) + if(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache") + set(TRY_BUILD_KDE4 FALSE) + endif(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache") + else(QT4_FOUND) + set(TRY_BUILD_KDE4 FALSE) + endif(QT4_FOUND) - FIND_PACKAGE(Perl) - IF(NOT PERL_FOUND) - SET(TRY_BUILD_KDE4 FALSE) - ENDIF(NOT PERL_FOUND) + find_package(Perl) + if(NOT PERL_FOUND) + set(TRY_BUILD_KDE4 FALSE) + endif(NOT PERL_FOUND) - FIND_PACKAGE(ZLIB) - IF(NOT ZLIB_FOUND) - SET(TRY_BUILD_KDE4 FALSE) - ENDIF(NOT ZLIB_FOUND) + find_package(ZLIB) + if(NOT ZLIB_FOUND) + set(TRY_BUILD_KDE4 FALSE) + endif(NOT ZLIB_FOUND) - IF(TRY_BUILD_KDE4) - FILE(MAKE_DIRECTORY ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest) - SET(TEST_KDE4_BASE_DIR ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest) - CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh.in ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh @ONLY) - EXECUTE_PROCESS(COMMAND chmod 755 ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh ) - ADD_TEST(KDE4StableBranchTest ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh) - ENDIF(TRY_BUILD_KDE4) + if(TRY_BUILD_KDE4) + file(MAKE_DIRECTORY ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest) + set(TEST_KDE4_BASE_DIR ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest) + configure_file(${CMake_SOURCE_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh.in ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh @ONLY) + execute_process(COMMAND chmod 755 ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh ) + add_test(KDE4StableBranchTest ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh) + endif(TRY_BUILD_KDE4) - ENDIF(UNIX) - ENDIF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH) + endif(UNIX) + endif (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH) - IF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) - SET(CMAKE_SKIP_BOOTSTRAP_TEST 1) - ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) - IF(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") + if("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) + set(CMAKE_SKIP_BOOTSTRAP_TEST 1) + endif("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) + if(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") # If there is CMakeLists.txt in the binary tree, assume in-source build - SET(CMAKE_SKIP_BOOTSTRAP_TEST 1) - ENDIF(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") - SET(bootstrap "") - IF(CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST) - IF(UNIX) - SET(bootstrap ${CMake_SOURCE_DIR}/bootstrap) - ELSEIF(MSYS) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bootstrap.bat.in + set(CMAKE_SKIP_BOOTSTRAP_TEST 1) + endif(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") + set(bootstrap "") + if(CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST) + if(UNIX) + set(bootstrap ${CMake_SOURCE_DIR}/bootstrap) + elseif(MSYS) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/bootstrap.bat.in ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.bat @ONLY) - SET(bootstrap ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.bat) - ENDIF() - ENDIF() - IF(bootstrap) - ADD_TEST(BootstrapTest ${CMAKE_CTEST_COMMAND} + set(bootstrap ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.bat) + endif() + endif() + if(bootstrap) + add_test(BootstrapTest ${CMAKE_CTEST_COMMAND} --build-and-test ${CMake_SOURCE_DIR} ${CMake_BINARY_DIR}/Tests/BootstrapTest @@ -2171,20 +2171,20 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-generator "${CMAKE_TEST_GENERATOR}" --test-command ${CMake_BINARY_DIR}/Tests/BootstrapTest/Bootstrap.cmk/cmake) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BootstrapTest") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BootstrapTest") # Make this test run early during parallel execution - SET_TESTS_PROPERTIES(BootstrapTest PROPERTIES COST 5000) + set_tests_properties(BootstrapTest PROPERTIES COST 5000) # provide more time for the bootstrap test - GET_TEST_PROPERTY(BootstrapTest TIMEOUT PREVIOUS_TIMEOUT) - IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - SET_TESTS_PROPERTIES ( BootstrapTest + get_test_property(BootstrapTest TIMEOUT PREVIOUS_TIMEOUT) + if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + set_tests_properties ( BootstrapTest PROPERTIES TIMEOUT 5400) - ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - ENDIF() + endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + endif() - IF(CMAKE_Fortran_COMPILER) - ADD_TEST(Fortran ${CMAKE_CTEST_COMMAND} + if(CMAKE_Fortran_COMPILER) + add_test(Fortran ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Fortran" "${CMake_BINARY_DIR}/Tests/Fortran" @@ -2193,17 +2193,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config --test-command testf) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran") # FortranCInterface tests. - IF(UNIX) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/FortranC/Flags.cmake.in + if(UNIX) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/FortranC/Flags.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FortranC/Flags.cmake @ONLY) - ADD_TEST(FortranC.Flags ${CMAKE_CMAKE_COMMAND} -P + add_test(FortranC.Flags ${CMAKE_CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/FortranC/Flags.cmake) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC/Flags") - ELSE() - ADD_TEST(FortranC ${CMAKE_CTEST_COMMAND} + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC/Flags") + else() + add_test(FortranC ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/FortranC" "${CMake_BINARY_DIR}/Tests/FortranC" @@ -2212,21 +2212,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config --test-command CMakeFiles/FortranCInterface/FortranCInterface) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC") - ENDIF() - ENDIF() + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC") + endif() + endif() find_package(Java COMPONENTS Development QUIET) - IF(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAR_EXECUTABLE AND NOT MINGW + if(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAR_EXECUTABLE AND NOT MINGW AND NOT "${CMAKE_TEST_GENERATOR}" MATCHES "Xcode") - GET_FILENAME_COMPONENT(JNIPATH ${JAVA_COMPILE} PATH) - FIND_FILE(JNI_H jni.h + get_filename_component(JNIPATH ${JAVA_COMPILE} PATH) + find_file(JNI_H jni.h "${JNIPATH}/../include" "${JNIPATH}/../java/include") - IF(JNI_H AND EXISTS "${JNI_H}") # in case jni.h is a broken symlink - FILE(READ "${JNI_H}" JNI_FILE) - IF("${JNI_FILE}" MATCHES "JDK1_2") - ADD_TEST(Java ${CMAKE_CTEST_COMMAND} + if(JNI_H AND EXISTS "${JNI_H}") # in case jni.h is a broken symlink + file(READ "${JNI_H}" JNI_FILE) + if("${JNI_FILE}" MATCHES "JDK1_2") + add_test(Java ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Java" "${CMake_BINARY_DIR}/Tests/Java" @@ -2236,19 +2236,19 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-two-config --build-run-dir "${CMake_BINARY_DIR}/Tests/Java/" --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java") - ENDIF("${JNI_FILE}" MATCHES "JDK1_2") - ENDIF() - ENDIF() + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java") + endif("${JNI_FILE}" MATCHES "JDK1_2") + endif() + endif() # add some cross compiler tests, for now only with makefile based generators - IF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop") + if(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop") # if sdcc is found, build the SimpleCOnly project with sdcc - FIND_PROGRAM(SDCC_EXECUTABLE sdcc) - MARK_AS_ADVANCED(SDCC_EXECUTABLE) - IF(SDCC_EXECUTABLE) - ADD_TEST(SimpleCOnly_sdcc ${CMAKE_CTEST_COMMAND} + find_program(SDCC_EXECUTABLE sdcc) + mark_as_advanced(SDCC_EXECUTABLE) + if(SDCC_EXECUTABLE) + add_test(SimpleCOnly_sdcc ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SimpleCOnly" "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc" @@ -2258,16 +2258,16 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-options "-DCMAKE_SYSTEM_NAME=Generic" "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc") - ENDIF(SDCC_EXECUTABLE) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc") + endif(SDCC_EXECUTABLE) # If a Linux -> MinGW cross compiler is found then try it - FIND_PROGRAM(MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc) - FIND_PROGRAM(MINGW_CXX_LINUX2WIN_EXECUTABLE i586-mingw32msvc-g++) - FIND_PROGRAM(MINGW_RC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-windres) - MARK_AS_ADVANCED(MINGW_CC_LINUX2WIN_EXECUTABLE MINGW_CXX_LINUX2WIN_EXECUTABLE MINGW_RC_LINUX2WIN_EXECUTABLE) - IF(MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE AND MINGW_RC_LINUX2WIN_EXECUTABLE) - ADD_TEST(Simple_Mingw_Linux2Win ${CMAKE_CTEST_COMMAND} + find_program(MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc) + find_program(MINGW_CXX_LINUX2WIN_EXECUTABLE i586-mingw32msvc-g++) + find_program(MINGW_RC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-windres) + mark_as_advanced(MINGW_CC_LINUX2WIN_EXECUTABLE MINGW_CXX_LINUX2WIN_EXECUTABLE MINGW_RC_LINUX2WIN_EXECUTABLE) + if(MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE AND MINGW_RC_LINUX2WIN_EXECUTABLE) + add_test(Simple_Mingw_Linux2Win ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Simple" "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win" @@ -2280,63 +2280,63 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}" "-DCMAKE_RC_COMPILER=${MINGW_RC_LINUX2WIN_EXECUTABLE}" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win") - ENDIF() - ENDIF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win") + endif() + endif(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop") - IF(UNIX) - STRING(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${CMake_BINARY_DIR}/Tests/TestShellInstall/Prefix" + if(UNIX) + string(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${CMake_BINARY_DIR}/Tests/TestShellInstall/Prefix" PREFIX_IS_FOR_TEST) - IF(PREFIX_IS_FOR_TEST) - CONFIGURE_FILE( + if(PREFIX_IS_FOR_TEST) + configure_file( ${CMake_SOURCE_DIR}/Tests/TestInstall.sh.in ${CMake_BINARY_DIR}/Tests/TestShellInstall/TestInstall.sh @ONLY IMMEDIATE ) - ADD_TEST(ShellInstall /bin/sh ${CMake_BINARY_DIR}/Tests/TestShellInstall/TestShellInstall.sh) - ENDIF(PREFIX_IS_FOR_TEST) - ENDIF(UNIX) + add_test(ShellInstall /bin/sh ${CMake_BINARY_DIR}/Tests/TestShellInstall/TestShellInstall.sh) + endif(PREFIX_IS_FOR_TEST) + endif(UNIX) - IF(CMAKE_TEST_PROJECT_CSE_DIR) - SET(script "${CMAKE_TEST_PROJECT_CSE_DIR}/BuildProjectCSE.cmake") - IF(NOT EXISTS "${script}") - SET(script "${CMAKE_TEST_PROJECT_CSE_DIR}/cse_build.cmake") - ENDIF(NOT EXISTS "${script}") - IF(NOT EXISTS "${script}") - MESSAGE("warning: CMAKE_TEST_PROJECT_CSE_DIR set, but no build script found...") - ENDIF(NOT EXISTS "${script}") + if(CMAKE_TEST_PROJECT_CSE_DIR) + set(script "${CMAKE_TEST_PROJECT_CSE_DIR}/BuildProjectCSE.cmake") + if(NOT EXISTS "${script}") + set(script "${CMAKE_TEST_PROJECT_CSE_DIR}/cse_build.cmake") + endif(NOT EXISTS "${script}") + if(NOT EXISTS "${script}") + message("warning: CMAKE_TEST_PROJECT_CSE_DIR set, but no build script found...") + endif(NOT EXISTS "${script}") - ADD_TEST(BuildCSE ${CMAKE_CTEST_COMMAND} -V -S "${script}") - SET_TESTS_PROPERTIES(BuildCSE PROPERTIES TIMEOUT 5400) - ENDIF(CMAKE_TEST_PROJECT_CSE_DIR) + add_test(BuildCSE ${CMAKE_CTEST_COMMAND} -V -S "${script}") + set_tests_properties(BuildCSE PROPERTIES TIMEOUT 5400) + endif(CMAKE_TEST_PROJECT_CSE_DIR) - IF(CMAKE_TEST_PLPLOT_DIR) - ADD_TEST(plplot ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_PLPLOT_DIR}/../../EasyDashboardScripts/plplot.cmake ) - SET_TESTS_PROPERTIES ( plplot PROPERTIES TIMEOUT 5400) - ENDIF(CMAKE_TEST_PLPLOT_DIR) + if(CMAKE_TEST_PLPLOT_DIR) + add_test(plplot ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_PLPLOT_DIR}/../../EasyDashboardScripts/plplot.cmake ) + set_tests_properties ( plplot PROPERTIES TIMEOUT 5400) + endif(CMAKE_TEST_PLPLOT_DIR) - IF(CMAKE_TEST_CHICKEN_DIR) - ADD_TEST(Chicken ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_CHICKEN_DIR}/../../EasyDashboardScripts/Chicken.cmake ) - SET_TESTS_PROPERTIES ( Chicken PROPERTIES TIMEOUT 5400) - ENDIF(CMAKE_TEST_CHICKEN_DIR) + if(CMAKE_TEST_CHICKEN_DIR) + add_test(Chicken ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_CHICKEN_DIR}/../../EasyDashboardScripts/Chicken.cmake ) + set_tests_properties ( Chicken PROPERTIES TIMEOUT 5400) + endif(CMAKE_TEST_CHICKEN_DIR) - IF(CMAKE_TEST_KDELIBS_ALPHA_1_DIR) - ADD_TEST(KDELibsAlpha1 ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_KDELIBS_ALPHA_1_DIR}/../../EasyDashboardScripts/kdelibs.cmake ) - SET_TESTS_PROPERTIES ( KDELibsAlpha1 PROPERTIES TIMEOUT 5400) - ENDIF(CMAKE_TEST_KDELIBS_ALPHA_1_DIR) + if(CMAKE_TEST_KDELIBS_ALPHA_1_DIR) + add_test(KDELibsAlpha1 ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_KDELIBS_ALPHA_1_DIR}/../../EasyDashboardScripts/kdelibs.cmake ) + set_tests_properties ( KDELibsAlpha1 PROPERTIES TIMEOUT 5400) + endif(CMAKE_TEST_KDELIBS_ALPHA_1_DIR) # If this is not an in-source build, provide a target to wipe out # all the test build directories. - IF(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") - CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in + if(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") + configure_file(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in ${CMake_BINARY_DIR}/Tests/test_clean.cmake @ONLY) - ADD_CUSTOM_TARGET(test_clean + add_custom_target(test_clean COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake COMMENT "Removing test build directories." ) - ENDIF(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") + endif(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") - ADD_TEST(CMakeWizardTest ${CMAKE_CMAKE_COMMAND} + add_test(CMakeWizardTest ${CMAKE_CMAKE_COMMAND} -D build_dir:STRING=${CMAKE_CURRENT_BINARY_DIR}/CMakeWizardTest -D source_dir:STRING=${CMAKE_CURRENT_SOURCE_DIR}/Tutorial/Step3 -D CMAKE_CTEST_COMMAND:STRING=${CMAKE_CTEST_COMMAND} @@ -2349,33 +2349,33 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # with at least one CMakeLists.txt file that uses ExternalProject # to download and configure the project. The directory should also # contain a RunTest.cmake file that has a single set of the format: - # SET(project_RUN_TEST testToRun) + # set(project_RUN_TEST testToRun) # The testToRun should be a test executable that can be run to # smoke test the build. - FOREACH(project ${CMAKE_CONTRACT_PROJECTS}) - INCLUDE(Contracts/${project}/RunTest.cmake) + foreach(project ${CMAKE_CONTRACT_PROJECTS}) + include(Contracts/${project}/RunTest.cmake) ADD_TEST_MACRO(Contracts.${project} ${${project}_RUN_TEST}) # Contract test timeout in seconds. # Default to 6 hours. - IF(DEFINED ${project}_TEST_TIMEOUT) - SET(timeout ${${project}_TEST_TIMEOUT}) - ELSEIF(CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT) - SET(timeout ${CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT}) - ELSE() - SET(timeout 21600) - ENDIF() - SET_TESTS_PROPERTIES(Contracts.${project} PROPERTIES TIMEOUT ${timeout}) - ENDFOREACH() + if(DEFINED ${project}_TEST_TIMEOUT) + set(timeout ${${project}_TEST_TIMEOUT}) + elseif(CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT) + set(timeout ${CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT}) + else() + set(timeout 21600) + endif() + set_tests_properties(Contracts.${project} PROPERTIES TIMEOUT ${timeout}) + endforeach() - IF(TEST_CompileCommandOutput) - SET(CompileCommandOutput_EXTRA_OPTIONS + if(TEST_CompileCommandOutput) + set(CompileCommandOutput_EXTRA_OPTIONS --build-options -DMAKE_SUPPORTS_SPACES=${MAKE_IS_GNU}) ADD_TEST_MACRO(CompileCommandOutput "${CMake_BINARY_DIR}/Tests/CMakeLib/runcompilecommands") - ENDIF() + endif() - ADD_TEST(IncludeDirectories ${CMAKE_CTEST_COMMAND} + add_test(IncludeDirectories ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/IncludeDirectories" "${CMake_BINARY_DIR}/Tests/IncludeDirectories" @@ -2384,21 +2384,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project IncludeDirectories --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command IncludeDirectories) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories") - IF(CMAKE_USE_KWSTYLE AND KWSTYLE_EXECUTABLE) + if(CMAKE_USE_KWSTYLE AND KWSTYLE_EXECUTABLE) # The "make StyleCheck" command line as a test. If the test fails, look # for lines like "Error #0 (624) Line length exceed 88 (max=79)" in the # output to find where the style errors are... - ADD_TEST(KWStyle ${KWSTYLE_EXECUTABLE} + add_test(KWStyle ${KWSTYLE_EXECUTABLE} -xml ${CMake_BINARY_DIR}/CMake.kws.xml -o ${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v -D ${CMake_BINARY_DIR}/CMakeKWSFiles.txt ) - SET_TESTS_PROPERTIES(KWStyle PROPERTIES + set_tests_properties(KWStyle PROPERTIES WORKING_DIRECTORY ${CMake_BINARY_DIR}/Utilities/KWStyle) - ENDIF() -ENDIF(BUILD_TESTING) + endif() +endif(BUILD_TESTING) -SUBDIRS(CMakeTests) +subdirs(CMakeTests) diff --git a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt index 1c978c181..70c186cc2 100644 --- a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt +++ b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt @@ -7,56 +7,56 @@ # If you change this test do not forget to change the CheckSymbolExists # test, too. -PROJECT(CheckCXXSymbolExists CXX) +project(CheckCXXSymbolExists CXX) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8 FATAL_ERROR) -SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/../CheckSymbolExists") +set(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/../CheckSymbolExists") -INCLUDE(CheckCXXSymbolExists) +include(CheckCXXSymbolExists) foreach(_config_type Release RelWithDebInfo MinSizeRel Debug) set(CMAKE_TRY_COMPILE_CONFIGURATION ${_config_type}) unset(CSE_RESULT_${_config_type} CACHE) - MESSAGE(STATUS "Testing configuration ${_config_type}") + message(STATUS "Testing configuration ${_config_type}") check_cxx_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_${_config_type}) - IF (CSE_RESULT_${_config_type}) - MESSAGE(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}") - ENDIF (CSE_RESULT_${_config_type}) + if (CSE_RESULT_${_config_type}) + message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}") + endif (CSE_RESULT_${_config_type}) endforeach() set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE}) unset(CSE_RESULT_ERRNO_CERRNO CACHE) -MESSAGE(STATUS "Checking ") +message(STATUS "Checking ") check_cxx_symbol_exists(errno "cerrno" CSE_RESULT_ERRNO_CERRNO) -IF (NOT CSE_RESULT_ERRNO_CERRNO) +if (NOT CSE_RESULT_ERRNO_CERRNO) unset(CSE_RESULT_ERRNO_ERRNOH CACHE) - MESSAGE(STATUS "Checking ") + message(STATUS "Checking ") check_cxx_symbol_exists(errno "errno.h" CSE_RESULT_ERRNO_ERRNOH) - IF (NOT CSE_RESULT_ERRNO_ERRNOH) - MESSAGE(SEND_ERROR "CheckCXXSymbolExists did not find errno in and ") - ELSE (NOT CSE_RESULT_ERRNO_ERRNOH) - MESSAGE(STATUS "errno found in ") - ENDIF (NOT CSE_RESULT_ERRNO_ERRNOH) -ELSE (NOT CSE_RESULT_ERRNO_CERRNO) - MESSAGE(STATUS "errno found in ") -ENDIF (NOT CSE_RESULT_ERRNO_CERRNO) + if (NOT CSE_RESULT_ERRNO_ERRNOH) + message(SEND_ERROR "CheckCXXSymbolExists did not find errno in and ") + else (NOT CSE_RESULT_ERRNO_ERRNOH) + message(STATUS "errno found in ") + endif (NOT CSE_RESULT_ERRNO_ERRNOH) +else (NOT CSE_RESULT_ERRNO_CERRNO) + message(STATUS "errno found in ") +endif (NOT CSE_RESULT_ERRNO_CERRNO) -IF (CMAKE_COMPILER_IS_GNUCXX) +if (CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") unset(CSE_RESULT_O3 CACHE) - MESSAGE(STATUS "Testing with optimization -O3") + message(STATUS "Testing with optimization -O3") check_cxx_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_O3) - IF (CSE_RESULT_O3) - MESSAGE(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing with optimization -O3") - ENDIF (CSE_RESULT_O3) -ENDIF (CMAKE_COMPILER_IS_GNUCXX) + if (CSE_RESULT_O3) + message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing with optimization -O3") + endif (CSE_RESULT_O3) +endif (CMAKE_COMPILER_IS_GNUCXX) diff --git a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt index 7c969d3be..acf0d2df3 100644 --- a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt +++ b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt @@ -7,24 +7,24 @@ # If you change this test do not forget to change the CheckCXXSymbolExists # test, too. -PROJECT(CheckSymbolExists C) +project(CheckSymbolExists C) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8 FATAL_ERROR) -SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}") +set(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}") -INCLUDE(CheckSymbolExists) +include(CheckSymbolExists) foreach(_config_type Release RelWithDebInfo MinSizeRel Debug) set(CMAKE_TRY_COMPILE_CONFIGURATION ${_config_type}) unset(CSE_RESULT_${_config_type} CACHE) - MESSAGE(STATUS "Testing configuration ${_config_type}") + message(STATUS "Testing configuration ${_config_type}") check_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_${_config_type}) - IF (CSE_RESULT_${_config_type}) - MESSAGE(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}") - ENDIF (CSE_RESULT_${_config_type}) + if (CSE_RESULT_${_config_type}) + message(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}") + endif (CSE_RESULT_${_config_type}) endforeach() set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE}) @@ -32,20 +32,20 @@ unset(CSE_RESULT_ERRNO CACHE) check_symbol_exists(errno "errno.h" CSE_RESULT_ERRNO) -IF (NOT CSE_RESULT_ERRNO) - MESSAGE(SEND_ERROR "CheckSymbolExists did not find errno in ") -ELSE (NOT CSE_RESULT_ERRNO) - MESSAGE(STATUS "errno found as expected") -ENDIF (NOT CSE_RESULT_ERRNO) +if (NOT CSE_RESULT_ERRNO) + message(SEND_ERROR "CheckSymbolExists did not find errno in ") +else (NOT CSE_RESULT_ERRNO) + message(STATUS "errno found as expected") +endif (NOT CSE_RESULT_ERRNO) -IF (CMAKE_COMPILER_IS_GNUCC) +if (CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") unset(CSE_RESULT_O3 CACHE) - MESSAGE(STATUS "Testing with optimization -O3") + message(STATUS "Testing with optimization -O3") check_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_O3) - IF (CSE_RESULT_O3) - MESSAGE(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing with optimization -O3") - ENDIF (CSE_RESULT_O3) -ENDIF (CMAKE_COMPILER_IS_GNUCC) + if (CSE_RESULT_O3) + message(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing with optimization -O3") + endif (CSE_RESULT_O3) +endif (CMAKE_COMPILER_IS_GNUCC) diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt index c42c490b0..fadcc1e2a 100644 --- a/Tests/CMakeTests/CMakeLists.txt +++ b/Tests/CMakeTests/CMakeLists.txt @@ -1,12 +1,12 @@ -SET(CMAKE_EXECUTABLE "${CMake_BIN_DIR}/cmake") +set(CMAKE_EXECUTABLE "${CMake_BIN_DIR}/cmake") -MACRO(AddCMakeTest TestName PreArgs) - CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${TestName}Test.cmake.in" +macro(AddCMakeTest TestName PreArgs) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${TestName}Test.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" @ONLY IMMEDIATE) - ADD_TEST(CMake.${TestName} ${CMAKE_EXECUTABLE} ${PreArgs} + add_test(CMake.${TestName} ${CMAKE_EXECUTABLE} ${PreArgs} -P "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" ${ARGN}) -ENDMACRO(AddCMakeTest) +endmacro(AddCMakeTest) AddCMakeTest(List "") @@ -43,12 +43,12 @@ if(HAVE_ELF_H) AddCMakeTest(ELF "") endif() -SET(EndStuff_PreArgs +set(EndStuff_PreArgs "-Ddir:STRING=${CMAKE_CURRENT_BINARY_DIR}/EndStuffTest" ) AddCMakeTest(EndStuff "${EndStuff_PreArgs}") -SET(GetPrerequisites_PreArgs +set(GetPrerequisites_PreArgs "-DCTEST_CONFIGURATION_TYPE:STRING=\\\${CTEST_CONFIGURATION_TYPE}" ) AddCMakeTest(GetPrerequisites "${GetPrerequisites_PreArgs}") diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in index cf6f91a70..5db171c3a 100644 --- a/Tests/CMakeTests/ListTest.cmake.in +++ b/Tests/CMakeTests/ListTest.cmake.in @@ -1,88 +1,88 @@ -MACRO(TEST command expected) - IF("x${result}" STREQUAL "x${expected}") - #MESSAGE("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"") - ELSE("x${result}" STREQUAL "x${expected}") - MESSAGE(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") - ENDIF("x${result}" STREQUAL "x${expected}") -ENDMACRO(TEST command expected) +macro(TEST command expected) + if("x${result}" STREQUAL "x${expected}") + #message("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"") + else("x${result}" STREQUAL "x${expected}") + message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") + endif("x${result}" STREQUAL "x${expected}") +endmacro(TEST command expected) -SET(mylist andy bill ken brad) +set(mylist andy bill ken brad) -LIST(LENGTH mylist result) +list(LENGTH mylist result) TEST("LENGTH mylist result" "4") -LIST(LENGTH "mylist" result) +list(LENGTH "mylist" result) TEST("LENGTH \"mylist\" result" "4") -LIST(LENGTH "nonexiting_list1" result) +list(LENGTH "nonexiting_list1" result) TEST("LENGTH \"nonexiting_list1\" result" "0") -LIST(GET mylist 3 2 1 0 result) +list(GET mylist 3 2 1 0 result) TEST("GET mylist 3 2 1 0 result" "brad;ken;bill;andy") -LIST(GET mylist 0 item0) -LIST(GET mylist 1 item1) -LIST(GET mylist 2 item2) -LIST(GET mylist 3 item3) -SET(result "${item3}" "${item0}" "${item1}" "${item2}") +list(GET mylist 0 item0) +list(GET mylist 1 item1) +list(GET mylist 2 item2) +list(GET mylist 3 item3) +set(result "${item3}" "${item0}" "${item1}" "${item2}") TEST("GET individual 3 2 1 0 result" "brad;andy;bill;ken") -LIST(GET mylist -1 -2 -3 -4 result) +list(GET mylist -1 -2 -3 -4 result) TEST("GET mylist -1 -2 -3 -4 result" "brad;ken;bill;andy") -LIST(GET mylist -1 2 -3 0 result) +list(GET mylist -1 2 -3 0 result) TEST("GET mylist -1 2 -3 0 ${result}" "brad;ken;bill;andy") -LIST(GET "nonexiting_list2" 1 result) +list(GET "nonexiting_list2" 1 result) TEST("GET \"nonexiting_list2\" 1 result" "NOTFOUND") -SET(result andy) -LIST(APPEND result brad) +set(result andy) +list(APPEND result brad) TEST("APPEND result brad" "andy;brad") -LIST(APPEND "nonexiting_list3" brad) -SET(result "${nonexiting_list3}") +list(APPEND "nonexiting_list3" brad) +set(result "${nonexiting_list3}") TEST("APPEND \"nonexiting_list3\" brad" "brad") -LIST(INSERT "nonexiting_list4" 0 andy bill brad ken) -SET(result "${nonexiting_list4}") +list(INSERT "nonexiting_list4" 0 andy bill brad ken) +set(result "${nonexiting_list4}") TEST("APPEND \"nonexiting_list4\" andy bill brad ken" "andy;bill;brad;ken") -SET(result andy brad) -LIST(INSERT result -1 bill ken) +set(result andy brad) +list(INSERT result -1 bill ken) TEST("INSERT result -1 bill ken" "andy;bill;ken;brad") -SET(result andy bill brad ken bob) -LIST(REMOVE_ITEM result bob) +set(result andy bill brad ken bob) +list(REMOVE_ITEM result bob) TEST("REMOVE_ITEM result bob" "andy;bill;brad;ken") -SET(result andy bill bob brad ken peter) -LIST(REMOVE_ITEM result peter bob) +set(result andy bill bob brad ken peter) +list(REMOVE_ITEM result peter bob) TEST("REMOVE_ITEM result peter bob" "andy;bill;brad;ken") -SET(result bob andy bill bob brad ken bob) -LIST(REMOVE_ITEM result bob) +set(result bob andy bill bob brad ken bob) +list(REMOVE_ITEM result bob) TEST("REMOVE_ITEM result bob" "andy;bill;brad;ken") -SET(result andy bill bob brad ken peter) -LIST(REMOVE_AT result 2 -1) +set(result andy bill bob brad ken peter) +list(REMOVE_AT result 2 -1) TEST("REMOVE_AT result 2 -1" "andy;bill;brad;ken") # ken is at index 2, nobody is not in the list so -1 should be returned -SET(mylist andy bill ken brad) -LIST(FIND mylist ken result) +set(mylist andy bill ken brad) +list(FIND mylist ken result) TEST("FIND mylist ken result" "2") -LIST(FIND mylist nobody result) +list(FIND mylist nobody result) TEST("FIND mylist nobody result" "-1") -SET(result ken bill andy brad) -LIST(SORT result) +set(result ken bill andy brad) +list(SORT result) TEST("SORT result" "andy;bill;brad;ken") -SET(result andy bill brad ken) -LIST(REVERSE result) +set(result andy bill brad ken) +list(REVERSE result) TEST("REVERSE result" "ken;brad;bill;andy") -SET(result bill andy bill brad ken ken ken) -LIST(REMOVE_DUPLICATES result) +set(result bill andy bill brad ken ken ken) +list(REMOVE_DUPLICATES result) TEST("REMOVE_DUPLICATES result" "bill;andy;brad;ken") diff --git a/Tests/CMakeTests/ToolchainTest.cmake.in b/Tests/CMakeTests/ToolchainTest.cmake.in index 179945646..cd258db72 100644 --- a/Tests/CMakeTests/ToolchainTest.cmake.in +++ b/Tests/CMakeTests/ToolchainTest.cmake.in @@ -1,7 +1,7 @@ ############################################################ # some preparations so that the CMakeDetermineXXX.cmake files will work in scripted mode -# overwrite MARK_AS_ADVANCED(), since this is used in CMakeDetermineCCompiler.cmake +# overwrite mark_as_advanced(), since this is used in CMakeDetermineCCompiler.cmake # which will complain that it can"t be used in script mode macro(MARK_AS_ADVANCED) endmacro(MARK_AS_ADVANCED) diff --git a/Tests/CMakeTests/VariableWatchTest.cmake.in b/Tests/CMakeTests/VariableWatchTest.cmake.in index bdb4f7ec4..3d290d614 100644 --- a/Tests/CMakeTests/VariableWatchTest.cmake.in +++ b/Tests/CMakeTests/VariableWatchTest.cmake.in @@ -1,15 +1,15 @@ -MESSAGE("Start") +message("Start") -VARIABLE_WATCH(TESTVAR MESSAGE) -VARIABLE_WATCH(TESTVAR1) +variable_watch(TESTVAR MESSAGE) +variable_watch(TESTVAR1) macro(testwatch var access file stack) - MESSAGE("There was a ${access} access done on the variable: ${var} in file ${file}") - MESSAGE("List file stack is: ${stack}") + message("There was a ${access} access done on the variable: ${var} in file ${file}") + message("List file stack is: ${stack}") set(${var}_watched 1) endmacro(testwatch) -VARIABLE_WATCH(somevar testwatch) +variable_watch(somevar testwatch) set(TESTVAR1 "1") set(TESTVAR "1") diff --git a/Tests/CTestTest/test.cmake.in b/Tests/CTestTest/test.cmake.in index 5fede3390..d21dafa43 100644 --- a/Tests/CTestTest/test.cmake.in +++ b/Tests/CTestTest/test.cmake.in @@ -4,25 +4,25 @@ ################################################################### # this is the cvs module name that should be checked out -SET (CTEST_MODULE_NAME SmallAndFast) +set (CTEST_MODULE_NAME SmallAndFast) # these are the the name of the source and binary directory on disk. # They will be appended to DASHBOARD_ROOT -SET (CTEST_SOURCE_NAME SmallAndFast) -SET (CTEST_BINARY_NAME SmallAndFastBuild) +set (CTEST_SOURCE_NAME SmallAndFast) +set (CTEST_BINARY_NAME SmallAndFastBuild) # which ctest command to use for running the dashboard -SET (CTEST_COMMAND +set (CTEST_COMMAND "\"${CTEST_EXECUTABLE_NAME}\" --version" "\"${CTEST_EXECUTABLE_NAME}\" -D Experimental -A \"${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}\"" ) # what cmake command to use for configuring this dashboard -GET_FILENAME_COMPONENT(CTEST_EXECUTABLE_PATH "${CTEST_EXECUTABLE_NAME}" PATH) -SET(CTEST_CMAKE_COMMAND "\"${CTEST_EXECUTABLE_PATH}/cmake\"") +get_filename_component(CTEST_EXECUTABLE_PATH "${CTEST_EXECUTABLE_NAME}" PATH) +set(CTEST_CMAKE_COMMAND "\"${CTEST_EXECUTABLE_PATH}/cmake\"") -MESSAGE("CTest executable: ${CTEST_EXECUTABLE_NAME}") -MESSAGE("CMake executable: ${CTEST_CMAKE_COMMAND}") +message("CTest executable: ${CTEST_EXECUTABLE_NAME}") +message("CMake executable: ${CTEST_CMAKE_COMMAND}") CTEST_SLEEP(1) CTEST_SLEEP(1 1 1) @@ -33,11 +33,11 @@ CTEST_SLEEP(1 1 1) #################################################################### # should ctest wipe the binary tree before running -SET (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) # this is the initial cache to use for the binary tree, be careful to escape # any quotes inside of this string if you use it -SET (CTEST_INITIAL_CACHE " +set (CTEST_INITIAL_CACHE " SITE:STRING=@SITE@ BUILDNAME:STRING=SmallAndFast-@BUILDNAME@ CMAKE_GENERATOR:INTERNAL=@CMAKE_GENERATOR@ @@ -57,12 +57,12 @@ COVERAGE_COMMAND:FILEPATH=@COVERAGE_COMMAND@ # if you do not want to use the default location for a # dashboard then set this variable to the directory # the dashboard should be in -SET (CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@/Tests/CTestTest") +set (CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@/Tests/CTestTest") # set any extra envionment varibles here -SET (CTEST_ENVIRONMENT +set (CTEST_ENVIRONMENT ) -SET (CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTest/SmallAndFast") -SET (CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTest/${CTEST_BINARY_NAME}") +set (CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTest/SmallAndFast") +set (CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTest/${CTEST_BINARY_NAME}") diff --git a/Tests/CTestTest2/test.cmake.in b/Tests/CTestTest2/test.cmake.in index b58b6397e..ec756ddc4 100644 --- a/Tests/CTestTest2/test.cmake.in +++ b/Tests/CTestTest2/test.cmake.in @@ -1,31 +1,31 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "KWSys-@BUILDNAME@-CTest2") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "KWSys-@BUILDNAME@-CTest2") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Source/kwsys") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTest2/kwsysBin") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Source/kwsys") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTest2/kwsysBin") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") +set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") +set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") # By default, CTESTTEST2_USE_PURIFY is not defined. If you want to run purify # on CTestTest2, set CTESTTEST2_USE_PURIFY to ON in CMake's cache. -SET(CTESTTEST2_USE_PURIFY @CTESTTEST2_USE_PURIFY@) -IF("${CTEST_MEMORYCHECK_COMMAND}" MATCHES purify AND NOT CTESTTEST2_USE_PURIFY) - SET(CTEST_MEMORYCHECK_COMMAND) -ENDIF() +set(CTESTTEST2_USE_PURIFY @CTESTTEST2_USE_PURIFY@) +if("${CTEST_MEMORYCHECK_COMMAND}" MATCHES purify AND NOT CTESTTEST2_USE_PURIFY) + set(CTEST_MEMORYCHECK_COMMAND) +endif() #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) -FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " +file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@ CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@ CMAKE_C_COMPILER:STRING=@CMAKE_C_COMPILER@ @@ -55,6 +55,6 @@ set(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard") CTEST_SUBMIT(RETURN_VALUE res) # Test submission of a subset of parts. -SET(CTEST_EXTRA_SUBMIT_FILES ${CTEST_NOTES_FILES}) +set(CTEST_EXTRA_SUBMIT_FILES ${CTEST_NOTES_FILES}) CTEST_SUBMIT(RETURN_VALUE res PARTS ExtraFiles) -SET(CTEST_EXTRA_SUBMIT_FILES) +set(CTEST_EXTRA_SUBMIT_FILES) diff --git a/Tests/CTestTestBadExe/CMakeLists.txt b/Tests/CTestTestBadExe/CMakeLists.txt index 8a925b62f..c71c21516 100644 --- a/Tests/CTestTestBadExe/CMakeLists.txt +++ b/Tests/CTestTestBadExe/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestBadExe) -INCLUDE(CTest) +project(CTestTestBadExe) +include(CTest) -CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/notAnExe.txt" "${CMAKE_CURRENT_BINARY_DIR}/notAnExe.txt" COPYONLY) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/notAnExe.txt" "${CMAKE_CURRENT_BINARY_DIR}/notAnExe.txt" COPYONLY) -ADD_TEST (TestBadExe "${CMAKE_CURRENT_BINARY_DIR}/notAnExe.txt") +add_test (TestBadExe "${CMAKE_CURRENT_BINARY_DIR}/notAnExe.txt") diff --git a/Tests/CTestTestBadExe/test.cmake.in b/Tests/CTestTestBadExe/test.cmake.in index 5d22d3587..2421b136d 100644 --- a/Tests/CTestTestBadExe/test.cmake.in +++ b/Tests/CTestTestBadExe/test.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-BadExe") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-BadExe") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestBadExe") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestBadExe") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestBadExe") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestBadExe") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTestChecksum/test.cmake.in b/Tests/CTestTestChecksum/test.cmake.in index 84135446f..6317500d6 100644 --- a/Tests/CTestTestChecksum/test.cmake.in +++ b/Tests/CTestTestChecksum/test.cmake.in @@ -1,25 +1,25 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Checksum") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Checksum") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestParallel") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParallel") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestParallel") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParallel") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 4) -SET(CTEST_DROP_METHOD "@protocol@") -SET(CTEST_DROP_SITE "@server@") -SET(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard") +set(CTEST_DROP_METHOD "@protocol@") +set(CTEST_DROP_SITE "@server@") +set(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard") CTEST_SUBMIT(RETRY_DELAY 3 RETRY_COUNT 2 INTERNAL_TEST_CHECKSUM RETURN_VALUE res) diff --git a/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in index 498cab280..feaa5c385 100644 --- a/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in +++ b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +cmake_minimum_required(VERSION 2.8) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ConfigFileInBuildDir1") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ConfigFileInBuildDir1") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir1") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir1") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in index d359f2d36..f489114cd 100644 --- a/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in +++ b/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +cmake_minimum_required(VERSION 2.8) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ConfigFileInBuildDir2") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ConfigFileInBuildDir2") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir2") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir2") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestCostSerial/CMakeLists.txt b/Tests/CTestTestCostSerial/CMakeLists.txt index a9a5c2594..29d2983e8 100644 --- a/Tests/CTestTestCostSerial/CMakeLists.txt +++ b/Tests/CTestTestCostSerial/CMakeLists.txt @@ -1,13 +1,13 @@ -CMAKE_MINIMUM_REQUIRED (VERSION 2.6) -PROJECT (CTestTestCostSerial) -INCLUDE (CTest) +cmake_minimum_required (VERSION 2.6) +project (CTestTestCostSerial) +include (CTest) -ADD_EXECUTABLE (Sleep sleep.c) +add_executable (Sleep sleep.c) -FOREACH (index RANGE 1 3) - ADD_TEST (TestSleep${index} Sleep) -ENDFOREACH (index RANGE 1 3) +foreach (index RANGE 1 3) + add_test (TestSleep${index} Sleep) +endforeach (index RANGE 1 3) -SET_TESTS_PROPERTIES(TestSleep1 PROPERTIES COST -500) -SET_TESTS_PROPERTIES(TestSleep2 PROPERTIES COST 12) -SET_TESTS_PROPERTIES(TestSleep3 PROPERTIES COST 0) +set_tests_properties(TestSleep1 PROPERTIES COST -500) +set_tests_properties(TestSleep2 PROPERTIES COST 12) +set_tests_properties(TestSleep3 PROPERTIES COST 0) diff --git a/Tests/CTestTestCostSerial/test.cmake.in b/Tests/CTestTestCostSerial/test.cmake.in index ca216e3fc..3f0f6f8e8 100644 --- a/Tests/CTestTestCostSerial/test.cmake.in +++ b/Tests/CTestTestCostSerial/test.cmake.in @@ -1,24 +1,24 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-CostSerial") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-CostSerial") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCostSerial") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCostSerial") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCostSerial") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCostSerial") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) # Remove old cost data file if it exists -IF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") - FILE(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") -ENDIF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") +if(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") + file(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") +endif(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestCrash/CMakeLists.txt b/Tests/CTestTestCrash/CMakeLists.txt index 0ac6ba03c..77986df34 100644 --- a/Tests/CTestTestCrash/CMakeLists.txt +++ b/Tests/CTestTestCrash/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestCrash) -INCLUDE(CTest) +project(CTestTestCrash) +include(CTest) -ADD_EXECUTABLE (Crash crash.cxx) +add_executable (Crash crash.cxx) -ADD_TEST (TestCrash Crash) +add_test (TestCrash Crash) diff --git a/Tests/CTestTestCrash/test.cmake.in b/Tests/CTestTestCrash/test.cmake.in index 5cec594cd..4e27bc2bc 100644 --- a/Tests/CTestTestCrash/test.cmake.in +++ b/Tests/CTestTestCrash/test.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Crash") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Crash") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCrash") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCrash") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCrash") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCrash") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTestCycle/test.cmake.in b/Tests/CTestTestCycle/test.cmake.in index 201f6044e..22f33770e 100644 --- a/Tests/CTestTestCycle/test.cmake.in +++ b/Tests/CTestTestCycle/test.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Cycle") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Cycle") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCycle") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCycle") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCycle") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCycle") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestDepends/test.cmake.in b/Tests/CTestTestDepends/test.cmake.in index 36a1ebf87..49fc443dd 100644 --- a/Tests/CTestTestDepends/test.cmake.in +++ b/Tests/CTestTestDepends/test.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Depends") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Depends") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestDepends") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestDepends") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestDepends") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestDepends") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestFailedSubmits/test.cmake.in b/Tests/CTestTestFailedSubmits/test.cmake.in index b0e16322d..394400630 100644 --- a/Tests/CTestTestFailedSubmits/test.cmake.in +++ b/Tests/CTestTestFailedSubmits/test.cmake.in @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +cmake_minimum_required(VERSION 2.8) # CTestConfig.cmake settings: set(CTEST_PROJECT_NAME "SmallAndFast") @@ -9,21 +9,21 @@ set(CTEST_PROJECT_NAME "SmallAndFast") set(CTEST_DROP_METHOD "@drop_method@") # Settings: -SET(CTEST_USE_LAUNCHERS 1) +set(CTEST_USE_LAUNCHERS 1) # Emit these compiler warnings: set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} -Wall") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTestLaunchers-@drop_method@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTestLaunchers-@drop_method@") -SET(CTEST_SOURCE_DIRECTORY "@source@") -SET(CTEST_BINARY_DIRECTORY "@build@") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@source@") +set(CTEST_BINARY_DIRECTORY "@build@") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTestFailure/CMakeLists.txt b/Tests/CTestTestFailure/CMakeLists.txt index 690fbfc5c..01fbb2c4f 100644 --- a/Tests/CTestTestFailure/CMakeLists.txt +++ b/Tests/CTestTestFailure/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestFailure) -INCLUDE(CTest) +project(CTestTestFailure) +include(CTest) -ADD_EXECUTABLE (NoBuild badCode.cxx) -TARGET_LINK_LIBRARIES (NoBuild ${EXTRA_LIBS}) +add_executable (NoBuild badCode.cxx) +target_link_libraries (NoBuild ${EXTRA_LIBS}) -ADD_TEST (TestNoExe NoBuild) +add_test (TestNoExe NoBuild) diff --git a/Tests/CTestTestFailure/testNoBuild.cmake.in b/Tests/CTestTestFailure/testNoBuild.cmake.in index 7bc921a31..6edd9dd95 100644 --- a/Tests/CTestTestFailure/testNoBuild.cmake.in +++ b/Tests/CTestTestFailure/testNoBuild.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-NoBuild") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-NoBuild") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestFailure") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailure") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestFailure") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailure") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTestFailure/testNoExe.cmake.in b/Tests/CTestTestFailure/testNoExe.cmake.in index 59c18d752..f09594c2b 100644 --- a/Tests/CTestTestFailure/testNoExe.cmake.in +++ b/Tests/CTestTestFailure/testNoExe.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-NoExe") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-NoExe") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestFailure") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailure") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestFailure") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailure") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTestParallel/CMakeLists.txt b/Tests/CTestTestParallel/CMakeLists.txt index fc53f6874..e47085a09 100644 --- a/Tests/CTestTestParallel/CMakeLists.txt +++ b/Tests/CTestTestParallel/CMakeLists.txt @@ -1,15 +1,15 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestParallel) -INCLUDE(CTest) +project(CTestTestParallel) +include(CTest) -ADD_EXECUTABLE (LockFile lockFile.c) +add_executable (LockFile lockFile.c) -ADD_TEST (TestRunSerial1 LockFile) -ADD_TEST (TestRunSerial2 LockFile) -SET_TESTS_PROPERTIES(TestRunSerial1 TestRunSerial2 PROPERTIES RUN_SERIAL true) +add_test (TestRunSerial1 LockFile) +add_test (TestRunSerial2 LockFile) +set_tests_properties(TestRunSerial1 TestRunSerial2 PROPERTIES RUN_SERIAL true) -ADD_TEST (TestProcessorsGreaterThanMPL1 LockFile) -ADD_TEST (TestProcessorsGreaterThanMPL2 LockFile) -SET_TESTS_PROPERTIES(TestProcessorsGreaterThanMPL1 PROPERTIES PROCESSORS 10) -SET_TESTS_PROPERTIES(TestProcessorsGreaterThanMPL1 PROPERTIES DEPENDS +add_test (TestProcessorsGreaterThanMPL1 LockFile) +add_test (TestProcessorsGreaterThanMPL2 LockFile) +set_tests_properties(TestProcessorsGreaterThanMPL1 PROPERTIES PROCESSORS 10) +set_tests_properties(TestProcessorsGreaterThanMPL1 PROPERTIES DEPENDS TestProcessorsGreaterThanMPL2) diff --git a/Tests/CTestTestParallel/test.cmake.in b/Tests/CTestTestParallel/test.cmake.in index 83845dee4..0418755cf 100644 --- a/Tests/CTestTestParallel/test.cmake.in +++ b/Tests/CTestTestParallel/test.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Parallel") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Parallel") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestParallel") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParallel") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestParallel") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParallel") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTestResourceLock/CMakeLists.txt b/Tests/CTestTestResourceLock/CMakeLists.txt index 1041ef149..4001643fd 100644 --- a/Tests/CTestTestResourceLock/CMakeLists.txt +++ b/Tests/CTestTestResourceLock/CMakeLists.txt @@ -1,13 +1,13 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestResourceLock) -INCLUDE(CTest) +project(CTestTestResourceLock) +include(CTest) -ADD_EXECUTABLE (LockFile lockFile.c) +add_executable (LockFile lockFile.c) -ADD_TEST (TestLockedFile1.1 LockFile locked1.txt) -ADD_TEST (TestLockedFile1.2 LockFile locked1.txt) -SET_TESTS_PROPERTIES(TestLockedFile1.1 TestLockedFile1.2 PROPERTIES RESOURCE_LOCK "locked1.txt") +add_test (TestLockedFile1.1 LockFile locked1.txt) +add_test (TestLockedFile1.2 LockFile locked1.txt) +set_tests_properties(TestLockedFile1.1 TestLockedFile1.2 PROPERTIES RESOURCE_LOCK "locked1.txt") -ADD_TEST (TestLockedFile2.1 LockFile locked2.txt) -ADD_TEST (TestLockedFile2.2 LockFile locked2.txt) -SET_TESTS_PROPERTIES(TestLockedFile2.1 TestLockedFile2.2 PROPERTIES RESOURCE_LOCK "locked2.txt") +add_test (TestLockedFile2.1 LockFile locked2.txt) +add_test (TestLockedFile2.2 LockFile locked2.txt) +set_tests_properties(TestLockedFile2.1 TestLockedFile2.2 PROPERTIES RESOURCE_LOCK "locked2.txt") diff --git a/Tests/CTestTestResourceLock/test.cmake.in b/Tests/CTestTestResourceLock/test.cmake.in index 98c5901c4..571cc5050 100644 --- a/Tests/CTestTestResourceLock/test.cmake.in +++ b/Tests/CTestTestResourceLock/test.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ResourceLock") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ResourceLock") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestResourceLock") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestResourceLock") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestResourceLock") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestResourceLock") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestRunScript/hello.cmake.in b/Tests/CTestTestRunScript/hello.cmake.in index 140df1e02..37905e3c4 100644 --- a/Tests/CTestTestRunScript/hello.cmake.in +++ b/Tests/CTestTestRunScript/hello.cmake.in @@ -1,2 +1,2 @@ -SET(CTEST_RUN_CURRENT_SCRIPT 0) -MESSAGE("hello world") +set(CTEST_RUN_CURRENT_SCRIPT 0) +message("hello world") diff --git a/Tests/CTestTestRunScript/test.cmake.in b/Tests/CTestTestRunScript/test.cmake.in index 8301a56d3..3074a5156 100644 --- a/Tests/CTestTestRunScript/test.cmake.in +++ b/Tests/CTestTestRunScript/test.cmake.in @@ -1,2 +1,2 @@ -SET(CTEST_RUN_CURRENT_SCRIPT 0) +set(CTEST_RUN_CURRENT_SCRIPT 0) CTEST_RUN_SCRIPT("CTestTestRunScript/hello.cmake" RETURN_VALUE res RETURN_VALUE) diff --git a/Tests/CTestTestScheduler/CMakeLists.txt b/Tests/CTestTestScheduler/CMakeLists.txt index 882988fd4..d2b3bb45a 100644 --- a/Tests/CTestTestScheduler/CMakeLists.txt +++ b/Tests/CTestTestScheduler/CMakeLists.txt @@ -1,9 +1,9 @@ -CMAKE_MINIMUM_REQUIRED (VERSION 2.6) -PROJECT (CTestTestScheduler) -INCLUDE (CTest) +cmake_minimum_required (VERSION 2.6) +project (CTestTestScheduler) +include (CTest) -ADD_EXECUTABLE (Sleep sleep.c) +add_executable (Sleep sleep.c) -FOREACH (time RANGE 1 4) - ADD_TEST (TestSleep${time} Sleep ${time}) -ENDFOREACH (time RANGE 1 4) +foreach (time RANGE 1 4) + add_test (TestSleep${time} Sleep ${time}) +endforeach (time RANGE 1 4) diff --git a/Tests/CTestTestScheduler/test.cmake.in b/Tests/CTestTestScheduler/test.cmake.in index 505bd7c5b..87a390a64 100644 --- a/Tests/CTestTestScheduler/test.cmake.in +++ b/Tests/CTestTestScheduler/test.cmake.in @@ -1,24 +1,24 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Scheduler") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Scheduler") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestScheduler") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestScheduler") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestScheduler") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestScheduler") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) # Remove old cost data file if it exists -IF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") - FILE(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") -ENDIF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") +if(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") + file(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") +endif(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestStopTime/CMakeLists.txt b/Tests/CTestTestStopTime/CMakeLists.txt index 5fe30d352..bd8bebdda 100644 --- a/Tests/CTestTestStopTime/CMakeLists.txt +++ b/Tests/CTestTestStopTime/CMakeLists.txt @@ -1,11 +1,11 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestStopTime) -INCLUDE(CTest) +project(CTestTestStopTime) +include(CTest) -ADD_EXECUTABLE (Sleep sleep.c) +add_executable (Sleep sleep.c) -ADD_TEST (TestSleep Sleep 30) -ADD_TEST (ShouldNotRun Sleep 30) +add_test (TestSleep Sleep 30) +add_test (ShouldNotRun Sleep 30) -SET_TESTS_PROPERTIES(ShouldNotRun PROPERTIES DEPENDS TestSleep) -SET_TESTS_PROPERTIES(ShouldNotRun PROPERTIES WILL_FAIL ON) +set_tests_properties(ShouldNotRun PROPERTIES DEPENDS TestSleep) +set_tests_properties(ShouldNotRun PROPERTIES WILL_FAIL ON) diff --git a/Tests/CTestTestStopTime/GetDate.cmake b/Tests/CTestTestStopTime/GetDate.cmake index b79330691..ac8f65df9 100644 --- a/Tests/CTestTestStopTime/GetDate.cmake +++ b/Tests/CTestTestStopTime/GetDate.cmake @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.2) +cmake_minimum_required(VERSION 2.2) -MACRO(GET_DATE) +macro(GET_DATE) # # All macro arguments are optional. # If there's an ARGV0, use it as GD_PREFIX. Default = 'GD_' @@ -34,20 +34,20 @@ MACRO(GET_DATE) # If there's an ARGV0, use it as GD_PREFIX: # - SET(GD_PREFIX "GD_") - IF(NOT "${ARGV0}" STREQUAL "") - SET(GD_PREFIX "${ARGV0}") - ENDIF(NOT "${ARGV0}" STREQUAL "") - IF(NOT "${GD_PREFIX}" STREQUAL "GD_") - SET(${GD_PREFIX}PREFIX "${GD_PREFIX}") - ENDIF(NOT "${GD_PREFIX}" STREQUAL "GD_") + set(GD_PREFIX "GD_") + if(NOT "${ARGV0}" STREQUAL "") + set(GD_PREFIX "${ARGV0}") + endif(NOT "${ARGV0}" STREQUAL "") + if(NOT "${GD_PREFIX}" STREQUAL "GD_") + set(${GD_PREFIX}PREFIX "${GD_PREFIX}") + endif(NOT "${GD_PREFIX}" STREQUAL "GD_") # If there's an ARGV1, use it as ${GD_PREFIX}VERBOSE: # - SET(${GD_PREFIX}VERBOSE "0") - IF(NOT "${ARGV1}" STREQUAL "") - SET(${GD_PREFIX}VERBOSE "${ARGV1}") - ENDIF(NOT "${ARGV1}" STREQUAL "") + set(${GD_PREFIX}VERBOSE "0") + if(NOT "${ARGV1}" STREQUAL "") + set(${GD_PREFIX}VERBOSE "${ARGV1}") + endif(NOT "${ARGV1}" STREQUAL "") # Retrieve the current date and time in the format: # @@ -57,58 +57,58 @@ MACRO(GET_DATE) # Use "echo %DATE% %TIME%" on Windows. # Otherwise, try "date" as implemented on most Unix flavors. # - IF(WIN32) + if(WIN32) # # Use "cmd" shell with %DATE% and %TIME% support... # May need adjustment in different locales or for custom date/time formats # set in the Windows Control Panel. # - SET(${GD_PREFIX}CMD "cmd") - SET(${GD_PREFIX}ARGS "/c echo %DATE% %TIME%") - ELSE(WIN32) + set(${GD_PREFIX}CMD "cmd") + set(${GD_PREFIX}ARGS "/c echo %DATE% %TIME%") + else(WIN32) # # Match the format returned by default in US English Windows: # - SET(${GD_PREFIX}CMD "date") - SET(${GD_PREFIX}ARGS "\"+%a %m/%d/%Y %H:%M:%S.00\"") - ENDIF(WIN32) + set(${GD_PREFIX}CMD "date") + set(${GD_PREFIX}ARGS "\"+%a %m/%d/%Y %H:%M:%S.00\"") + endif(WIN32) - EXEC_PROGRAM("${${GD_PREFIX}CMD}" "." ARGS "${${GD_PREFIX}ARGS}" + exec_program("${${GD_PREFIX}CMD}" "." ARGS "${${GD_PREFIX}ARGS}" OUTPUT_VARIABLE ${GD_PREFIX}OV RETURN_VALUE ${GD_PREFIX}RV ) - IF(${GD_PREFIX}VERBOSE) - MESSAGE(STATUS "") - MESSAGE(STATUS "") - MESSAGE(STATUS "") - MESSAGE(STATUS "GD_PREFIX='${GD_PREFIX}'") - IF(NOT "${GD_PREFIX}" STREQUAL "GD_") - MESSAGE(STATUS "${GD_PREFIX}PREFIX='${${GD_PREFIX}PREFIX}'") - ENDIF(NOT "${GD_PREFIX}" STREQUAL "GD_") - MESSAGE(STATUS "${GD_PREFIX}VERBOSE='${${GD_PREFIX}VERBOSE}'") - MESSAGE(STATUS "") - MESSAGE(STATUS "${GD_PREFIX}CMD='${${GD_PREFIX}CMD}'") - MESSAGE(STATUS "${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}'") - MESSAGE(STATUS "${GD_PREFIX}OV='${${GD_PREFIX}OV}'") - MESSAGE(STATUS "${GD_PREFIX}RV='${${GD_PREFIX}RV}'") - MESSAGE(STATUS "") - ENDIF(${GD_PREFIX}VERBOSE) + if(${GD_PREFIX}VERBOSE) + message(STATUS "") + message(STATUS "") + message(STATUS "") + message(STATUS "GD_PREFIX='${GD_PREFIX}'") + if(NOT "${GD_PREFIX}" STREQUAL "GD_") + message(STATUS "${GD_PREFIX}PREFIX='${${GD_PREFIX}PREFIX}'") + endif(NOT "${GD_PREFIX}" STREQUAL "GD_") + message(STATUS "${GD_PREFIX}VERBOSE='${${GD_PREFIX}VERBOSE}'") + message(STATUS "") + message(STATUS "${GD_PREFIX}CMD='${${GD_PREFIX}CMD}'") + message(STATUS "${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}'") + message(STATUS "${GD_PREFIX}OV='${${GD_PREFIX}OV}'") + message(STATUS "${GD_PREFIX}RV='${${GD_PREFIX}RV}'") + message(STATUS "") + endif(${GD_PREFIX}VERBOSE) - IF("${${GD_PREFIX}RV}" STREQUAL "0") + if("${${GD_PREFIX}RV}" STREQUAL "0") # # Extract eight individual components by matching a regex with paren groupings. # Use the replace functionality and \\1 thru \\8 to extract components. # - SET(${GD_PREFIX}REGEX "([^ ]+) +([^/]+)/([^/]+)/([^ ]+) +([^:]+):([^:]+):([^\\.]+)\\.(.*)") + set(${GD_PREFIX}REGEX "([^ ]+) +([^/]+)/([^/]+)/([^ ]+) +([^:]+):([^:]+):([^\\.]+)\\.(.*)") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\1" ${GD_PREFIX}DAY_OF_WEEK "${${GD_PREFIX}OV}") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\2" ${GD_PREFIX}MONTH "${${GD_PREFIX}OV}") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\3" ${GD_PREFIX}DAY "${${GD_PREFIX}OV}") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\4" ${GD_PREFIX}YEAR "${${GD_PREFIX}OV}") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\5" ${GD_PREFIX}HOUR "${${GD_PREFIX}OV}") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\6" ${GD_PREFIX}MINUTE "${${GD_PREFIX}OV}") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\7" ${GD_PREFIX}SECOND "${${GD_PREFIX}OV}") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\8" ${GD_PREFIX}FRACTIONAL_SECOND "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\1" ${GD_PREFIX}DAY_OF_WEEK "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\2" ${GD_PREFIX}MONTH "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\3" ${GD_PREFIX}DAY "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\4" ${GD_PREFIX}YEAR "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\5" ${GD_PREFIX}HOUR "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\6" ${GD_PREFIX}MINUTE "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\7" ${GD_PREFIX}SECOND "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\8" ${GD_PREFIX}FRACTIONAL_SECOND "${${GD_PREFIX}OV}") # # Verify that extracted components don't have anything obviously @@ -117,93 +117,93 @@ MACRO(GET_DATE) # Expecting a four digit year: # - IF(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$") - MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}' is not a four digit number...") - ENDIF(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$") + if(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$") + message(STATUS "WARNING: Extracted ${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}' is not a four digit number...") + endif(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$") # Expecting month to be <= 12: # - IF(${${GD_PREFIX}MONTH} GREATER 12) - MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}' is greater than 12!") - ENDIF(${${GD_PREFIX}MONTH} GREATER 12) + if(${${GD_PREFIX}MONTH} GREATER 12) + message(STATUS "WARNING: Extracted ${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}' is greater than 12!") + endif(${${GD_PREFIX}MONTH} GREATER 12) # Expecting day to be <= 31: # - IF(${${GD_PREFIX}DAY} GREATER 31) - MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}DAY='${${GD_PREFIX}DAY}' is greater than 31!") - ENDIF(${${GD_PREFIX}DAY} GREATER 31) + if(${${GD_PREFIX}DAY} GREATER 31) + message(STATUS "WARNING: Extracted ${GD_PREFIX}DAY='${${GD_PREFIX}DAY}' is greater than 31!") + endif(${${GD_PREFIX}DAY} GREATER 31) # Expecting hour to be <= 23: # - IF(${${GD_PREFIX}HOUR} GREATER 23) - MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}' is greater than 23!") - ENDIF(${${GD_PREFIX}HOUR} GREATER 23) + if(${${GD_PREFIX}HOUR} GREATER 23) + message(STATUS "WARNING: Extracted ${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}' is greater than 23!") + endif(${${GD_PREFIX}HOUR} GREATER 23) # Expecting minute to be <= 59: # - IF(${${GD_PREFIX}MINUTE} GREATER 59) - MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}' is greater than 59!") - ENDIF(${${GD_PREFIX}MINUTE} GREATER 59) + if(${${GD_PREFIX}MINUTE} GREATER 59) + message(STATUS "WARNING: Extracted ${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}' is greater than 59!") + endif(${${GD_PREFIX}MINUTE} GREATER 59) # Expecting second to be <= 59: # - IF(${${GD_PREFIX}SECOND} GREATER 59) - MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}' is greater than 59!") - ENDIF(${${GD_PREFIX}SECOND} GREATER 59) + if(${${GD_PREFIX}SECOND} GREATER 59) + message(STATUS "WARNING: Extracted ${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}' is greater than 59!") + endif(${${GD_PREFIX}SECOND} GREATER 59) # If individual components are single digit, # prepend a leading zero: # - IF("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$") - SET(${GD_PREFIX}YEAR "0${${GD_PREFIX}YEAR}") - ENDIF("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$") - IF("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$") - SET(${GD_PREFIX}MONTH "0${${GD_PREFIX}MONTH}") - ENDIF("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$") - IF("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$") - SET(${GD_PREFIX}DAY "0${${GD_PREFIX}DAY}") - ENDIF("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$") - IF("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$") - SET(${GD_PREFIX}HOUR "0${${GD_PREFIX}HOUR}") - ENDIF("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$") - IF("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$") - SET(${GD_PREFIX}MINUTE "0${${GD_PREFIX}MINUTE}") - ENDIF("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$") - IF("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$") - SET(${GD_PREFIX}SECOND "0${${GD_PREFIX}SECOND}") - ENDIF("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$") + if("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$") + set(${GD_PREFIX}YEAR "0${${GD_PREFIX}YEAR}") + endif("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$") + if("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$") + set(${GD_PREFIX}MONTH "0${${GD_PREFIX}MONTH}") + endif("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$") + if("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$") + set(${GD_PREFIX}DAY "0${${GD_PREFIX}DAY}") + endif("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$") + if("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$") + set(${GD_PREFIX}HOUR "0${${GD_PREFIX}HOUR}") + endif("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$") + if("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$") + set(${GD_PREFIX}MINUTE "0${${GD_PREFIX}MINUTE}") + endif("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$") + if("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$") + set(${GD_PREFIX}SECOND "0${${GD_PREFIX}SECOND}") + endif("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$") - IF(${GD_PREFIX}VERBOSE) - MESSAGE(STATUS "${GD_PREFIX}REGEX='${${GD_PREFIX}REGEX}'") - MESSAGE(STATUS "${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}'") - MESSAGE(STATUS "${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}'") - MESSAGE(STATUS "${GD_PREFIX}DAY='${${GD_PREFIX}DAY}'") - MESSAGE(STATUS "${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}'") - MESSAGE(STATUS "${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}'") - MESSAGE(STATUS "${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}'") - MESSAGE(STATUS "${GD_PREFIX}FRACTIONAL_SECOND='${${GD_PREFIX}FRACTIONAL_SECOND}'") - MESSAGE(STATUS "${GD_PREFIX}DAY_OF_WEEK='${${GD_PREFIX}DAY_OF_WEEK}'") - MESSAGE(STATUS "") - MESSAGE(STATUS "Counters that change...") - MESSAGE(STATUS "") - MESSAGE(STATUS "...very very quickly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}${${GD_PREFIX}HOUR}${${GD_PREFIX}MINUTE}${${GD_PREFIX}SECOND}${${GD_PREFIX}FRACTIONAL_SECOND}") - MESSAGE(STATUS " every second : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}${${GD_PREFIX}HOUR}${${GD_PREFIX}MINUTE}${${GD_PREFIX}SECOND}") - MESSAGE(STATUS " daily : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}") - MESSAGE(STATUS " monthly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}") - MESSAGE(STATUS " annually : ${${GD_PREFIX}YEAR}") - MESSAGE(STATUS "") - ENDIF(${GD_PREFIX}VERBOSE) - ELSE("${${GD_PREFIX}RV}" STREQUAL "0") - MESSAGE(SEND_ERROR "ERROR: MACRO(GET_DATE) failed. ${GD_PREFIX}CMD='${${GD_PREFIX}CMD}' ${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}' ${GD_PREFIX}OV='${${GD_PREFIX}OV}' ${GD_PREFIX}RV='${${GD_PREFIX}RV}'") - ENDIF("${${GD_PREFIX}RV}" STREQUAL "0") + if(${GD_PREFIX}VERBOSE) + message(STATUS "${GD_PREFIX}REGEX='${${GD_PREFIX}REGEX}'") + message(STATUS "${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}'") + message(STATUS "${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}'") + message(STATUS "${GD_PREFIX}DAY='${${GD_PREFIX}DAY}'") + message(STATUS "${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}'") + message(STATUS "${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}'") + message(STATUS "${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}'") + message(STATUS "${GD_PREFIX}FRACTIONAL_SECOND='${${GD_PREFIX}FRACTIONAL_SECOND}'") + message(STATUS "${GD_PREFIX}DAY_OF_WEEK='${${GD_PREFIX}DAY_OF_WEEK}'") + message(STATUS "") + message(STATUS "Counters that change...") + message(STATUS "") + message(STATUS "...very very quickly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}${${GD_PREFIX}HOUR}${${GD_PREFIX}MINUTE}${${GD_PREFIX}SECOND}${${GD_PREFIX}FRACTIONAL_SECOND}") + message(STATUS " every second : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}${${GD_PREFIX}HOUR}${${GD_PREFIX}MINUTE}${${GD_PREFIX}SECOND}") + message(STATUS " daily : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}") + message(STATUS " monthly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}") + message(STATUS " annually : ${${GD_PREFIX}YEAR}") + message(STATUS "") + endif(${GD_PREFIX}VERBOSE) + else("${${GD_PREFIX}RV}" STREQUAL "0") + message(SEND_ERROR "ERROR: macro(GET_DATE) failed. ${GD_PREFIX}CMD='${${GD_PREFIX}CMD}' ${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}' ${GD_PREFIX}OV='${${GD_PREFIX}OV}' ${GD_PREFIX}RV='${${GD_PREFIX}RV}'") + endif("${${GD_PREFIX}RV}" STREQUAL "0") - IF(${GD_PREFIX}VERBOSE) - MESSAGE(STATUS "") - MESSAGE(STATUS "") - ENDIF(${GD_PREFIX}VERBOSE) -ENDMACRO(GET_DATE) + if(${GD_PREFIX}VERBOSE) + message(STATUS "") + message(STATUS "") + endif(${GD_PREFIX}VERBOSE) +endmacro(GET_DATE) -MACRO(ADD_SECONDS sec) +macro(ADD_SECONDS sec) set(new_min ${${GD_PREFIX}MINUTE}) set(new_hr ${${GD_PREFIX}HOUR}) math(EXPR new_sec "${sec} + ${${GD_PREFIX}SECOND}") @@ -230,4 +230,4 @@ MACRO(ADD_SECONDS sec) if(${hr_len} EQUAL 1) set(new_hr "0${new_hr}") endif() -ENDMACRO(ADD_SECONDS) +endmacro(ADD_SECONDS) diff --git a/Tests/CTestTestStopTime/test.cmake.in b/Tests/CTestTestStopTime/test.cmake.in index 2d03686e6..c3920a414 100644 --- a/Tests/CTestTestStopTime/test.cmake.in +++ b/Tests/CTestTestStopTime/test.cmake.in @@ -1,21 +1,21 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-StopTime") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-StopTime") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestStopTime") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestStopTime") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestStopTime") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestStopTime") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) -INCLUDE("${CTEST_BINARY_DIRECTORY}/GetDate.cmake") +include("${CTEST_BINARY_DIRECTORY}/GetDate.cmake") CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestSubdir/CMakeLists.txt b/Tests/CTestTestSubdir/CMakeLists.txt index 5400ee8c5..b7cc7e2f1 100644 --- a/Tests/CTestTestSubdir/CMakeLists.txt +++ b/Tests/CTestTestSubdir/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestSubdir) -INCLUDE(CTest) +project(CTestTestSubdir) +include(CTest) -ADD_SUBDIRECTORY(subdir) -SUBDIRS(subdir2) -SUBDIRS("${CTestTestSubdir_SOURCE_DIR}/subdir3") +add_subdirectory(subdir) +subdirs(subdir2) +subdirs("${CTestTestSubdir_SOURCE_DIR}/subdir3") diff --git a/Tests/CTestTestSubdir/subdir/CMakeLists.txt b/Tests/CTestTestSubdir/subdir/CMakeLists.txt index b40d316d6..ee555354e 100644 --- a/Tests/CTestTestSubdir/subdir/CMakeLists.txt +++ b/Tests/CTestTestSubdir/subdir/CMakeLists.txt @@ -1,2 +1,2 @@ -ADD_EXECUTABLE (main main.c) -ADD_TEST (TestMain1 main) +add_executable (main main.c) +add_test (TestMain1 main) diff --git a/Tests/CTestTestSubdir/subdir2/CMakeLists.txt b/Tests/CTestTestSubdir/subdir2/CMakeLists.txt index 23f8e07c2..a8d0a779b 100644 --- a/Tests/CTestTestSubdir/subdir2/CMakeLists.txt +++ b/Tests/CTestTestSubdir/subdir2/CMakeLists.txt @@ -1,2 +1,2 @@ -ADD_EXECUTABLE (main2 main.c) -ADD_TEST (TestMain2 main2) +add_executable (main2 main.c) +add_test (TestMain2 main2) diff --git a/Tests/CTestTestSubdir/subdir3/CMakeLists.txt b/Tests/CTestTestSubdir/subdir3/CMakeLists.txt index 9a44b12b8..fbc41d5e6 100644 --- a/Tests/CTestTestSubdir/subdir3/CMakeLists.txt +++ b/Tests/CTestTestSubdir/subdir3/CMakeLists.txt @@ -1,2 +1,2 @@ -ADD_EXECUTABLE (main3 main.c) -ADD_TEST (TestMain3 main3) +add_executable (main3 main.c) +add_test (TestMain3 main3) diff --git a/Tests/CTestTestSubdir/test.cmake.in b/Tests/CTestTestSubdir/test.cmake.in index f240473ee..d1d87adc4 100644 --- a/Tests/CTestTestSubdir/test.cmake.in +++ b/Tests/CTestTestSubdir/test.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Subdir") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Subdir") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestSubdir") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestSubdir") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestSubdir") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestSubdir") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTestTimeout/CMakeLists.txt b/Tests/CTestTestTimeout/CMakeLists.txt index 0fd1cebb3..476d0a5e0 100644 --- a/Tests/CTestTestTimeout/CMakeLists.txt +++ b/Tests/CTestTestTimeout/CMakeLists.txt @@ -1,28 +1,28 @@ cmake_minimum_required (VERSION 2.8) -PROJECT(CTestTestTimeout) -INCLUDE(CTest) +project(CTestTestTimeout) +include(CTest) -IF(NOT TIMEOUT) - IF(CYGWIN) - SET(TIMEOUT 4) # Cygwin CMake sometimes takes > 1 second to load! - ELSE() - SET(TIMEOUT 1) - ENDIF() -ENDIF() +if(NOT TIMEOUT) + if(CYGWIN) + set(TIMEOUT 4) # Cygwin CMake sometimes takes > 1 second to load! + else() + set(TIMEOUT 1) + endif() +endif() -ADD_DEFINITIONS(-DTIMEOUT=${TIMEOUT}) -ADD_EXECUTABLE (Timeout timeout.c) +add_definitions(-DTIMEOUT=${TIMEOUT}) +add_executable (Timeout timeout.c) -ADD_TEST(NAME TestTimeout +add_test(NAME TestTimeout COMMAND ${CMAKE_COMMAND} -D Timeout=$ -D Log=${CMAKE_CURRENT_BINARY_DIR}/timeout.log -P ${CMAKE_CURRENT_SOURCE_DIR}/timeout.cmake ) -SET_TESTS_PROPERTIES(TestTimeout PROPERTIES TIMEOUT ${TIMEOUT}) +set_tests_properties(TestTimeout PROPERTIES TIMEOUT ${TIMEOUT}) -ADD_TEST(NAME CheckChild +add_test(NAME CheckChild COMMAND ${CMAKE_COMMAND} -D Timeout=$ -D Log=${CMAKE_CURRENT_BINARY_DIR}/timeout.log -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake ) -SET_TESTS_PROPERTIES(CheckChild PROPERTIES DEPENDS TestTimeout) +set_tests_properties(CheckChild PROPERTIES DEPENDS TestTimeout) diff --git a/Tests/CTestTestTimeout/test.cmake.in b/Tests/CTestTestTimeout/test.cmake.in index 8a8dc24e5..e34dc07b5 100644 --- a/Tests/CTestTestTimeout/test.cmake.in +++ b/Tests/CTestTestTimeout/test.cmake.in @@ -1,21 +1,21 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Timeout") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Timeout") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestTimeout") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestTimeout") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestTimeout") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestTimeout") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) -FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " +file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " TIMEOUT:STRING=@CTestTestTimeout_TIME@ ") diff --git a/Tests/CTestTestUpload/CMakeLists.txt b/Tests/CTestTestUpload/CMakeLists.txt index bc164b10c..90d811cd9 100644 --- a/Tests/CTestTestUpload/CMakeLists.txt +++ b/Tests/CTestTestUpload/CMakeLists.txt @@ -1,4 +1,4 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestUpload) +project(CTestTestUpload) add_executable (Sleep sleep.c) diff --git a/Tests/CTestTestUpload/test.cmake.in b/Tests/CTestTestUpload/test.cmake.in index acfa233bc..2c0fc3812 100644 --- a/Tests/CTestTestUpload/test.cmake.in +++ b/Tests/CTestTestUpload/test.cmake.in @@ -1,14 +1,14 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Upload") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Upload") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestUpload") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestUpload") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestUpload") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestUpload") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestZeroTimeout/CMakeLists.txt b/Tests/CTestTestZeroTimeout/CMakeLists.txt index 8a5246db1..4d2b79dc2 100644 --- a/Tests/CTestTestZeroTimeout/CMakeLists.txt +++ b/Tests/CTestTestZeroTimeout/CMakeLists.txt @@ -1,8 +1,8 @@ -CMAKE_MINIMUM_REQUIRED (VERSION 2.6) -PROJECT (CTestTestZeroTimeout) -INCLUDE (CTest) +cmake_minimum_required (VERSION 2.6) +project (CTestTestZeroTimeout) +include (CTest) -ADD_EXECUTABLE (Sleep sleep.c) +add_executable (Sleep sleep.c) -ADD_TEST (TestExplicitZeroTimeout Sleep) -SET_TESTS_PROPERTIES(TestExplicitZeroTimeout PROPERTIES TIMEOUT 0) +add_test (TestExplicitZeroTimeout Sleep) +set_tests_properties(TestExplicitZeroTimeout PROPERTIES TIMEOUT 0) diff --git a/Tests/CTestTestZeroTimeout/test.cmake.in b/Tests/CTestTestZeroTimeout/test.cmake.in index 56bae9d17..285a19150 100644 --- a/Tests/CTestTestZeroTimeout/test.cmake.in +++ b/Tests/CTestTestZeroTimeout/test.cmake.in @@ -1,18 +1,18 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ZeroTimeout") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ZeroTimeout") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestZeroTimeout") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestZeroTimeout") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") -SET(CTEST_TEST_TIMEOUT 2) +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestZeroTimeout") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestZeroTimeout") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_TEST_TIMEOUT 2) CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CommandLineTest/CMakeLists.txt b/Tests/CommandLineTest/CMakeLists.txt index 0493a0c4b..8a4b4f4a8 100644 --- a/Tests/CommandLineTest/CMakeLists.txt +++ b/Tests/CommandLineTest/CMakeLists.txt @@ -1,13 +1,13 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CommandLineTest) +project(CommandLineTest) -GET_FILENAME_COMPONENT(CMAKE_BIN_DIR ${CMAKE_COMMAND} PATH) -MACRO(EXEC_CMAKE_COMMAND CMAKE_ARGS) - EXEC_PROGRAM("${CMAKE_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) - IF(${RET}) - MESSAGE(SEND_ERROR "CMake command failed with arguments \"${CMAKE_ARGS}\"") - ENDIF(${RET}) -ENDMACRO(EXEC_CMAKE_COMMAND) +get_filename_component(CMAKE_BIN_DIR ${CMAKE_COMMAND} PATH) +macro(EXEC_CMAKE_COMMAND CMAKE_ARGS) + exec_program("${CMAKE_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) + if(${RET}) + message(SEND_ERROR "CMake command failed with arguments \"${CMAKE_ARGS}\"") + endif(${RET}) +endmacro(EXEC_CMAKE_COMMAND) EXEC_CMAKE_COMMAND("-E chdir \"${CMAKE_CURRENT_SOURCE_DIR}\" \"${CMAKE_COMMAND}\" -E echo \"Hello World\"") EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -L ${CommandLineTest_SOURCE_DIR}\"") @@ -24,22 +24,22 @@ EXEC_CMAKE_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/cmake.html\"") EXEC_CMAKE_COMMAND("--copyright \"${CMAKE_CURRENT_BINARY_DIR}/Copyright.txt\"") EXEC_CMAKE_COMMAND("--version \"${CMAKE_CURRENT_BINARY_DIR}/version.txt\"") -ADD_EXECUTABLE(CommandLineTest CommandLineTest.cxx) +add_executable(CommandLineTest CommandLineTest.cxx) -GET_FILENAME_COMPONENT(CMAKE_COMMAND_PATH "${CMAKE_COMMAND}" PATH) -SET(CTEST_COMMAND "${CMAKE_COMMAND_PATH}/ctest") -MACRO(EXEC_CTEST_COMMAND CMAKE_ARGS) - EXEC_PROGRAM("${CTEST_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) - IF(${RET}) - MESSAGE(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") - ENDIF(${RET}) -ENDMACRO(EXEC_CTEST_COMMAND) -MACRO(EXEC_CTEST_COMMAND_WITH_DIR DIR CMAKE_ARGS) - EXEC_PROGRAM("${CTEST_COMMAND}" "${DIR}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) - IF(${RET}) - MESSAGE(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") - ENDIF(${RET}) -ENDMACRO(EXEC_CTEST_COMMAND_WITH_DIR) +get_filename_component(CMAKE_COMMAND_PATH "${CMAKE_COMMAND}" PATH) +set(CTEST_COMMAND "${CMAKE_COMMAND_PATH}/ctest") +macro(EXEC_CTEST_COMMAND CMAKE_ARGS) + exec_program("${CTEST_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) + if(${RET}) + message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") + endif(${RET}) +endmacro(EXEC_CTEST_COMMAND) +macro(EXEC_CTEST_COMMAND_WITH_DIR DIR CMAKE_ARGS) + exec_program("${CTEST_COMMAND}" "${DIR}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) + if(${RET}) + message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") + endif(${RET}) +endmacro(EXEC_CTEST_COMMAND_WITH_DIR) EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N") EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-R complex -N") @@ -55,25 +55,25 @@ EXEC_CTEST_COMMAND("--help-man \"${CMAKE_CURRENT_BINARY_DIR}/ctest.man\"") EXEC_CTEST_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/ctest.html\"") EXEC_CTEST_COMMAND("--version") -IF(THIS_SHOULD_BE_SET) - MESSAGE(STATUS "***************************") - MESSAGE(STATUS "PreLoad.cmake works fine.") - MESSAGE(STATUS "***************************") -ELSE(THIS_SHOULD_BE_SET) - MESSAGE("***************************") - MESSAGE(FATAL_ERROR "PreLoad.cmake does not work.") -ENDIF(THIS_SHOULD_BE_SET) +if(THIS_SHOULD_BE_SET) + message(STATUS "***************************") + message(STATUS "PreLoad.cmake works fine.") + message(STATUS "***************************") +else(THIS_SHOULD_BE_SET) + message("***************************") + message(FATAL_ERROR "PreLoad.cmake does not work.") +endif(THIS_SHOULD_BE_SET) -IF(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET}) - MESSAGE(SEND_ERROR "Environment variable definition test broken!") -ENDIF(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET}) +if(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET}) + message(SEND_ERROR "Environment variable definition test broken!") +endif(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET}) -SET(ENV{TEST_ENVIRONMENT_VARIABLE} "Environment variable set") -IF("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") - MESSAGE(STATUS "Environment variable set to: $ENV{TEST_ENVIRONMENT_VARIABLE}") - IF(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE}) - MESSAGE(SEND_ERROR "Environment variable definition test failed!") - ENDIF(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE}) -ELSE("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") - MESSAGE(SEND_ERROR "Environment variable setting is broken") -ENDIF("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") +set(ENV{TEST_ENVIRONMENT_VARIABLE} "Environment variable set") +if("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") + message(STATUS "Environment variable set to: $ENV{TEST_ENVIRONMENT_VARIABLE}") + if(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE}) + message(SEND_ERROR "Environment variable definition test failed!") + endif(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE}) +else("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") + message(SEND_ERROR "Environment variable setting is broken") +endif("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") diff --git a/Tests/CommandLineTest/PreLoad.cmake b/Tests/CommandLineTest/PreLoad.cmake index 87284aff0..f059bcea6 100644 --- a/Tests/CommandLineTest/PreLoad.cmake +++ b/Tests/CommandLineTest/PreLoad.cmake @@ -1 +1 @@ -SET(THIS_SHOULD_BE_SET ON CACHE BOOL "Some variable") +set(THIS_SHOULD_BE_SET ON CACHE BOOL "Some variable") diff --git a/Tests/CompileCommandOutput/CMakeLists.txt b/Tests/CompileCommandOutput/CMakeLists.txt index bd8e305c2..6f9468dca 100644 --- a/Tests/CompileCommandOutput/CMakeLists.txt +++ b/Tests/CompileCommandOutput/CMakeLists.txt @@ -2,15 +2,15 @@ cmake_minimum_required (VERSION 2.6) project (CompileCommandOutput CXX) -SET(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") -IF(MAKE_SUPPORTS_SPACES) - SET(test1_srcs "file with spaces.cxx") -ELSE() - SET(test1_srcs "file_with_underscores.cxx") -ENDIF() -ADD_LIBRARY(test1 STATIC ${test1_srcs}) -ADD_LIBRARY(test2 SHARED "../CompileCommandOutput/relative.cxx") -INCLUDE_DIRECTORIES(${CompileCommandOutput_SOURCE_DIR}/../../Source) -ADD_EXECUTABLE(CompileCommandOutput compile_command_output.cxx) -TARGET_LINK_LIBRARIES(CompileCommandOutput test1 test2) +if(MAKE_SUPPORTS_SPACES) + set(test1_srcs "file with spaces.cxx") +else() + set(test1_srcs "file_with_underscores.cxx") +endif() +add_library(test1 STATIC ${test1_srcs}) +add_library(test2 SHARED "../CompileCommandOutput/relative.cxx") +include_directories(${CompileCommandOutput_SOURCE_DIR}/../../Source) +add_executable(CompileCommandOutput compile_command_output.cxx) +target_link_libraries(CompileCommandOutput test1 test2) diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 080428d58..45ea9019a 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -1,32 +1,32 @@ # # A more complex test case # -SET(CMAKE_BACKWARDS_COMPATIBILITY 1.4) -PROJECT (Complex) +set(CMAKE_BACKWARDS_COMPATIBILITY 1.4) +project (Complex) # Try setting a new policy. The IF test is for coverage. -IF(POLICY CMP0003) - CMAKE_POLICY(SET CMP0003 NEW) +if(POLICY CMP0003) + cmake_policy(SET CMP0003 NEW) - CMAKE_POLICY(GET CMP0003 P3) - IF(NOT "${P3}" STREQUAL "NEW") - MESSAGE(FATAL_ERROR "CMAKE_POLICY(GET) did not report NEW!") - ENDIF(NOT "${P3}" STREQUAL "NEW") -ENDIF(POLICY CMP0003) + cmake_policy(GET CMP0003 P3) + if(NOT "${P3}" STREQUAL "NEW") + message(FATAL_ERROR "cmake_policy(GET) did not report NEW!") + endif(NOT "${P3}" STREQUAL "NEW") +endif(POLICY CMP0003) # Test building without per-rule echo lines in Makefiles. -SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF) +set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) -SET(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$") +set(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$") # # Define a macro # -MACRO(ASSERT value msg) - IF (NOT ${value}) - MESSAGE ("Assertion failure:" ${msg} ) - ENDIF (NOT ${value}) -ENDMACRO(ASSERT) +macro(ASSERT value msg) + if (NOT ${value}) + message ("Assertion failure:" ${msg} ) + endif (NOT ${value}) +endmacro(ASSERT) # invoke the macro ASSERT(Complex_BINARY_DIR "The PROJECT command is broken") @@ -34,79 +34,79 @@ ASSERT(Complex_BINARY_DIR "The PROJECT command is broken") # # Define a var args macro, it must take two or four args # -MACRO(TEST_ARGC value1 value2) - ADD_DEFINITIONS(${value1} ${value2}) - IF (${ARGC} MATCHES 4) - ADD_DEFINITIONS(${ARGV2} ${ARGV3}) - ENDIF (${ARGC} MATCHES 4) -ENDMACRO(TEST_ARGC) +macro(TEST_ARGC value1 value2) + add_definitions(${value1} ${value2}) + if (${ARGC} MATCHES 4) + add_definitions(${ARGV2} ${ARGV3}) + endif (${ARGC} MATCHES 4) +endmacro(TEST_ARGC) # invoke the macro TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) -MACRO(TEST_VAR_ARG fa) - IF("${ARGV}" MATCHES "^1;2;3$") - MESSAGE(STATUS "ARGV works") - ELSE("${ARGV}" MATCHES "^1;2;3$") - MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") - ENDIF("${ARGV}" MATCHES "^1;2;3$") - IF("${ARGN}" MATCHES "^2;3$") - MESSAGE(STATUS "ARGN works") - ELSE("${ARGN}" MATCHES "^2;3$") - MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") - ENDIF("${ARGN}" MATCHES "^2;3$") -ENDMACRO(TEST_VAR_ARG) +macro(TEST_VAR_ARG fa) + if("${ARGV}" MATCHES "^1;2;3$") + message(STATUS "ARGV works") + else("${ARGV}" MATCHES "^1;2;3$") + message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") + endif("${ARGV}" MATCHES "^1;2;3$") + if("${ARGN}" MATCHES "^2;3$") + message(STATUS "ARGN works") + else("${ARGN}" MATCHES "^2;3$") + message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") + endif("${ARGN}" MATCHES "^2;3$") +endmacro(TEST_VAR_ARG) TEST_VAR_ARG(1 2 3) # Floating-point comparison test. -IF(2.4 LESS 2.4) - MESSAGE(FATAL_ERROR "Failed: 2.4 LESS 2.4") -ENDIF(2.4 LESS 2.4) -IF(2.4 GREATER 2.4) - MESSAGE(FATAL_ERROR "Failed: 2.4 GREATER 2.4") -ENDIF(2.4 GREATER 2.4) -IF(NOT 2.4 EQUAL 2.4) - MESSAGE(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") -ENDIF(NOT 2.4 EQUAL 2.4) +if(2.4 LESS 2.4) + message(FATAL_ERROR "Failed: 2.4 LESS 2.4") +endif(2.4 LESS 2.4) +if(2.4 GREATER 2.4) + message(FATAL_ERROR "Failed: 2.4 GREATER 2.4") +endif(2.4 GREATER 2.4) +if(NOT 2.4 EQUAL 2.4) + message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") +endif(NOT 2.4 EQUAL 2.4) -IF(CMAKE_SYSTEM MATCHES "OSF1-V.*") - IF(NOT CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") - ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) -ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*") +if(CMAKE_SYSTEM MATCHES "OSF1-V.*") + if(NOT CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") + endif(NOT CMAKE_COMPILER_IS_GNUCXX) +endif(CMAKE_SYSTEM MATCHES "OSF1-V.*") -ADD_DEFINITIONS(-DCMAKE_IS_FUN) -ADD_DEFINITIONS(-DCMAKE_IS_REALLY_FUN) -SET_PROPERTY(DIRECTORY +add_definitions(-DCMAKE_IS_FUN) +add_definitions(-DCMAKE_IS_REALLY_FUN) +set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_RELEASE CMAKE_IS_FUN_IN_RELEASE_MODE ) -SET(TEST_SEP "a b c") -SEPARATE_ARGUMENTS(TEST_SEP) +set(TEST_SEP "a b c") +separate_arguments(TEST_SEP) # # Include vars from a file and from a cache # -IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - INCLUDE(${Complex_SOURCE_DIR}/VarTests.cmake) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) -INCLUDE(fileshouldnotbehere OPTIONAL) -LOAD_CACHE(${Complex_SOURCE_DIR}/Cache +if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) + include(${Complex_SOURCE_DIR}/VarTests.cmake) +endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +include(fileshouldnotbehere OPTIONAL) +load_cache(${Complex_SOURCE_DIR}/Cache EXCLUDE CACHE_TEST_VAR_EXCLUDED INCLUDE_INTERNALS CACHE_TEST_VAR_INTERNAL) -LOAD_CACHE(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2) -IF(${fooCACHE_TEST_VAR2} MATCHES bar) - MESSAGE("Load cache worked: ${fooCACHE_TEST_VAR2}") -ELSE(${fooCACHE_TEST_VAR2} MATCHES bar) - MESSAGE(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}") -ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar) +load_cache(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2) +if(${fooCACHE_TEST_VAR2} MATCHES bar) + message("Load cache worked: ${fooCACHE_TEST_VAR2}") +else(${fooCACHE_TEST_VAR2} MATCHES bar) + message(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}") +endif(${fooCACHE_TEST_VAR2} MATCHES bar) @@ -114,106 +114,106 @@ ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar) # Specify include and lib dirs # (BEFORE is for coverage) # -INCLUDE_DIRECTORIES( +include_directories( Library ) -INCLUDE_DIRECTORIES(BEFORE +include_directories(BEFORE ${Complex_BINARY_DIR} ) -INCLUDE_DIRECTORIES(SYSTEM Library/SystemDir) +include_directories(SYSTEM Library/SystemDir) -INCLUDE_REGULAR_EXPRESSION("^(cmTest|file|sharedFile|test).*$" "^cmMissing") +include_regular_expression("^(cmTest|file|sharedFile|test).*$" "^cmMissing") -LINK_DIRECTORIES( +link_directories( ${Complex_BINARY_DIR}/Library ) # # check for SET CACHE FORCE # -SET(FORCE_TEST 1 CACHE STRING "a test") -SET(FORCE_TEST 0 CACHE STRING "a test" FORCE) +set(FORCE_TEST 1 CACHE STRING "a test") +set(FORCE_TEST 0 CACHE STRING "a test" FORCE) # # Lib and exe path # -SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static") -SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib") -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin") -MESSAGE (Test " " escape " " semi-colon " " \; \;) +message (Test " " escape " " semi-colon " " \; \;) # # Exec program (TODO: test a result) # Increase coverage. # -MESSAGE("\nIgnore this message") -OPTION(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0) -IF (NOT NO_EXEC_PROGRAM) - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}") -ELSE (NOT NO_EXEC_PROGRAM) - MESSAGE("Set this option ON") -ENDIF (NOT NO_EXEC_PROGRAM) +message("\nIgnore this message") +option(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0) +if (NOT NO_EXEC_PROGRAM) + exec_program(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}") +else (NOT NO_EXEC_PROGRAM) + message("Set this option ON") +endif (NOT NO_EXEC_PROGRAM) -MARK_AS_ADVANCED(NO_EXEC_PROGRAM) -MARK_AS_ADVANCED(CLEAR NO_EXEC_PROGRAM) +mark_as_advanced(NO_EXEC_PROGRAM) +mark_as_advanced(CLEAR NO_EXEC_PROGRAM) # Execute a process. Add coverage for this command. -EXECUTE_PROCESS( +execute_process( COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" OUTPUT_VARIABLE TEST_OUT ) -IF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") -ELSE("${TEST_OUT}" MATCHES "^ABCDEFG\n$") - MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") -ENDIF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +if("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +else("${TEST_OUT}" MATCHES "^ABCDEFG\n$") + message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") +endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$") # This test has some problems on UNIX systems. Disabling for now. # -# EXECUTE_PROCESS( +# execute_process( # COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" # COMMAND /process/does/not/exist # OUTPUT_QUIET # ERROR_QUIET # RESULT_VARIABLE RESULT # ) -# IF("${RESULT}" MATCHES "^0$") -# MESSAGE(SEND_ERROR +# if("${RESULT}" MATCHES "^0$") +# message(SEND_ERROR # "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]") -# ELSE("${RESULT}" MATCHES "^0$") -# MESSAGE(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]") -# ENDIF("${RESULT}" MATCHES "^0$") +# else("${RESULT}" MATCHES "^0$") +# message(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]") +# endif("${RESULT}" MATCHES "^0$") # # Create directory. # The 'complex' executable will then test if this dir exists, # sadly it won't be able to remove it. # -MAKE_DIRECTORY("${Complex_BINARY_DIR}/make_dir") +make_directory("${Complex_BINARY_DIR}/make_dir") # # Test FIND_LIBARY # Create a dummy empty lib # -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/dummylib.lib COPYONLY IMMEDIATE) -FOREACH (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl +foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl ${CMAKE_SHARED_LIBRARY_SUFFIX}.2 ${CMAKE_STATIC_LIBRARY_SUFFIX}.2) - CONFIGURE_FILE( + configure_file( ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/libdummylib${ext} COPYONLY IMMEDIATE) -ENDFOREACH (ext) +endforeach (ext) -FIND_LIBRARY(FIND_DUMMY_LIB +find_library(FIND_DUMMY_LIB dummylib PATHS ${Complex_BINARY_DIR}/Library DOC "find dummy lib") -FIND_LIBRARY(FIND_DUMMY_LIB +find_library(FIND_DUMMY_LIB NAMES dummylib dummylib2 PATHS ${Complex_BINARY_DIR}/Library DOC "find dummy lib") @@ -221,104 +221,104 @@ FIND_LIBRARY(FIND_DUMMY_LIB # This doesn't work for platforms that have a shared library and an import # library, like Windows with .dll and .lib. Limit is to ".so" now because it's # known to work there. -IF(CMAKE_SHARED_LIBRARY_SUFFIX STREQUAL ".so") - FIND_LIBRARY(FIND_DUMMY_SHLIB_VERSIONED +if(CMAKE_SHARED_LIBRARY_SUFFIX STREQUAL ".so") + find_library(FIND_DUMMY_SHLIB_VERSIONED NAMES libdummylib${CMAKE_SHARED_LIBRARY_SUFFIX}.2 PATHS ${Complex_BINARY_DIR}/Library DOC "find versioned dummy shared lib" NO_DEFAULT_PATH) - IF(NOT FIND_DUMMY_SHLIB_VERSIONED MATCHES "/libdummylib${CMAKE_SHARED_LIBRARY_SUFFIX}.2") - MESSAGE(SEND_ERROR "FIND_DUMMY_SHLIB_VERSIONED is not set correctly: " + if(NOT FIND_DUMMY_SHLIB_VERSIONED MATCHES "/libdummylib${CMAKE_SHARED_LIBRARY_SUFFIX}.2") + message(SEND_ERROR "FIND_DUMMY_SHLIB_VERSIONED is not set correctly: " "${FIND_DUMMY_SHLIB_VERSIONED}") - ENDIF() -ENDIF() + endif() +endif() # Static library, should work everywhere -FIND_LIBRARY(FIND_DUMMY_STLIB_VERSIONED +find_library(FIND_DUMMY_STLIB_VERSIONED NAMES libdummylib${CMAKE_STATIC_LIBRARY_SUFFIX}.2 PATHS ${Complex_BINARY_DIR}/Library DOC "find versioned dummy static lib" NO_DEFAULT_PATH) -IF(NOT FIND_DUMMY_STLIB_VERSIONED MATCHES "/libdummylib${CMAKE_STATIC_LIBRARY_SUFFIX}.2") - MESSAGE(SEND_ERROR "FIND_DUMMY_STLIB_VERSIONED is not set correctly: " +if(NOT FIND_DUMMY_STLIB_VERSIONED MATCHES "/libdummylib${CMAKE_STATIC_LIBRARY_SUFFIX}.2") + message(SEND_ERROR "FIND_DUMMY_STLIB_VERSIONED is not set correctly: " "${FIND_DUMMY_STLIB_VERSIONED}") -ENDIF() +endif() # # Test SET_SOURCE_FILES_PROPERTIES # -SET_SOURCE_FILES_PROPERTIES(nonexisting_file2 +set_source_files_properties(nonexisting_file2 GENERATED ABSTRACT WRAP_EXCLUDE COMPILE_FLAGS "-foo -bar") -GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT) -GET_SOURCE_FILE_PROPERTY(FILE_HAS_WRAP_EXCLUDE nonexisting_file2 WRAP_EXCLUDE) -GET_SOURCE_FILE_PROPERTY(FILE_COMPILE_FLAGS nonexisting_file2 COMPILE_FLAGS) +get_source_file_property(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT) +get_source_file_property(FILE_HAS_WRAP_EXCLUDE nonexisting_file2 WRAP_EXCLUDE) +get_source_file_property(FILE_COMPILE_FLAGS nonexisting_file2 COMPILE_FLAGS) -SET_SOURCE_FILES_PROPERTIES(nonexisting_file3 PROPERTIES +set_source_files_properties(nonexisting_file3 PROPERTIES GENERATED 1 ABSTRACT 1 WRAP_EXCLUDE 1 COMPILE_FLAGS "-foo -bar") -GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file3 ABSTRACT) -GET_SOURCE_FILE_PROPERTY(FILE_HAS_WRAP_EXCLUDE nonexisting_file3 WRAP_EXCLUDE) -GET_SOURCE_FILE_PROPERTY(FILE_COMPILE_FLAGS nonexisting_file3 COMPILE_FLAGS) +get_source_file_property(FILE_HAS_ABSTRACT nonexisting_file3 ABSTRACT) +get_source_file_property(FILE_HAS_WRAP_EXCLUDE nonexisting_file3 WRAP_EXCLUDE) +get_source_file_property(FILE_COMPILE_FLAGS nonexisting_file3 COMPILE_FLAGS) # # Test registry (win32) # Create a file, put its path in a registry key, try to find the file in that # path using that registry key, then remove the file and the key # -IF (WIN32) - IF (NOT UNIX) - SET(dir "${Complex_BINARY_DIR}/registry_dir") - SET(file "registry_test_dummy") - SET(hkey "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Tests\\Complex;registry_test") - CONFIGURE_FILE( +if (WIN32) + if (NOT UNIX) + set(dir "${Complex_BINARY_DIR}/registry_dir") + set(file "registry_test_dummy") + set(hkey "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Tests\\Complex;registry_test") + configure_file( ${Complex_SOURCE_DIR}/Library/dummy "${dir}/${file}" COPYONLY IMMEDIATE) - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"") - FIND_PATH(REGISTRY_TEST_PATH + exec_program(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"") + find_path(REGISTRY_TEST_PATH ${file} "[${hkey}]" DOC "Registry_Test_Path") - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") - ENDIF (NOT UNIX) -ENDIF (WIN32) + exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") + exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") + endif (NOT UNIX) +endif (WIN32) # # Test a set and a remove # -SET(REMOVE_STRING a b c d e f) -SET(removeVar1 c e) -REMOVE(REMOVE_STRING ${removeVar1} f) +set(REMOVE_STRING a b c d e f) +set(removeVar1 c e) +remove(REMOVE_STRING ${removeVar1} f) # # Test an IF inside a FOREACH. # -FOREACH(x "a") - IF(${x} MATCHES "a") +foreach(x "a") + if(${x} MATCHES "a") # Should always execute. - SET(IF_INSIDE_FOREACH_THEN_EXECUTED 1) - ELSE(${x} MATCHES "a") + set(IF_INSIDE_FOREACH_THEN_EXECUTED 1) + else(${x} MATCHES "a") # Should never execute. - SET(IF_INSIDE_FOREACH_ELSE_EXECUTED 1) - ENDIF(${x} MATCHES "a") -ENDFOREACH(x) + set(IF_INSIDE_FOREACH_ELSE_EXECUTED 1) + endif(${x} MATCHES "a") +endforeach(x) # test WHILE command -SET (while_var 1) -WHILE (while_var LESS 1000) - SET(while_var ${while_var}0) -ENDWHILE(while_var LESS 1000) +set (while_var 1) +while (while_var LESS 1000) + set(while_var ${while_var}0) +endwhile(while_var LESS 1000) -SET(SHOULD_BE_ZERO ) -SET(SHOULD_BE_ONE 1) +set(SHOULD_BE_ZERO ) +set(SHOULD_BE_ONE 1) # test elseif functionality, the mess below tries to catch problem # of clauses being executed early or late etc @@ -367,40 +367,40 @@ endif() # Configure file # (plug vars to #define so that they can be tested) # -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/cmTestConfigure.h.in ${Complex_BINARY_DIR}/cmTestConfigure.h) -SET(STRING_WITH_QUOTES "\"hello world\"") +set(STRING_WITH_QUOTES "\"hello world\"") # test CONFIGURE_FILE with ESCAPE_QUOTES on -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/cmTestConfigureEscape.h.in ${Complex_BINARY_DIR}/cmTestConfigureEscape.h ESCAPE_QUOTES) # Test regular expression commands. -STRING(REGEX MATCH "b" RESULT "abc") -IF(NOT RESULT) - MESSAGE(SEND_ERROR "STRING(REGEX MATCH ... ) test failed.") -ENDIF(NOT RESULT) -STRING(REGEX MATCHALL "b" RESULT "abcb") -IF(NOT RESULT) - MESSAGE(SEND_ERROR "STRING(REGEX MATCHALL ... ) test failed.") -ENDIF(NOT RESULT) -STRING(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") -IF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") - SET(STRING_REGEX_PASSED 1) -ENDIF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") -IF(NOT STRING_REGEX_PASSED) - MESSAGE(SEND_ERROR - "STRING(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") -ENDIF(NOT STRING_REGEX_PASSED) +string(REGEX MATCH "b" RESULT "abc") +if(NOT RESULT) + message(SEND_ERROR "string(REGEX MATCH ... ) test failed.") +endif(NOT RESULT) +string(REGEX MATCHALL "b" RESULT "abcb") +if(NOT RESULT) + message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.") +endif(NOT RESULT) +string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") +if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") + set(STRING_REGEX_PASSED 1) +endif("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") +if(NOT STRING_REGEX_PASSED) + message(SEND_ERROR + "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") +endif(NOT STRING_REGEX_PASSED) # # Create the libs and the main exe # -ADD_SUBDIRECTORY(Library) -ADD_SUBDIRECTORY(Executable) -SUBDIR_DEPENDS(Executable Library) -EXPORT_LIBRARY_DEPENDENCIES(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake) -INCLUDE(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL) +add_subdirectory(Library) +add_subdirectory(Executable) +subdir_depends(Executable Library) +export_library_dependencies(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake) +include(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL) diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index 6ccdaf026..413883551 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -1,116 +1,116 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 1.3) +cmake_minimum_required(VERSION 1.3) # # Create exe. # -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") # Create an imported target for if(TARGET) test below. -ADD_LIBRARY(ExeImportedTarget UNKNOWN IMPORTED) +add_library(ExeImportedTarget UNKNOWN IMPORTED) # Test if(TARGET) command. -IF(NOT TARGET CMakeTestLibrary) - MESSAGE(FATAL_ERROR "IF(NOT TARGET CMakeTestLibrary) returned true!") -ENDIF(NOT TARGET CMakeTestLibrary) -IF(NOT TARGET ExeImportedTarget) - MESSAGE(FATAL_ERROR "IF(NOT TARGET ExeImportedTarget) returned true!") -ENDIF(NOT TARGET ExeImportedTarget) -IF(TARGET LibImportedTarget) - MESSAGE(FATAL_ERROR "IF(TARGET LibImportedTarget) returned true!") -ENDIF(TARGET LibImportedTarget) -IF(TARGET NotATarget) - MESSAGE(FATAL_ERROR "IF(TARGET NotATarget) returned true!") -ENDIF(TARGET NotATarget) +if(NOT TARGET CMakeTestLibrary) + message(FATAL_ERROR "if(NOT TARGET CMakeTestLibrary) returned true!") +endif(NOT TARGET CMakeTestLibrary) +if(NOT TARGET ExeImportedTarget) + message(FATAL_ERROR "if(NOT TARGET ExeImportedTarget) returned true!") +endif(NOT TARGET ExeImportedTarget) +if(TARGET LibImportedTarget) + message(FATAL_ERROR "if(TARGET LibImportedTarget) returned true!") +endif(TARGET LibImportedTarget) +if(TARGET NotATarget) + message(FATAL_ERROR "if(TARGET NotATarget) returned true!") +endif(TARGET NotATarget) # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to -SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) -LINK_LIBRARIES(${COMPLEX_LIBS}) +set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) +link_libraries(${COMPLEX_LIBS}) # Test forcing a .cxx file to not build. -SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES +set_source_files_properties(complex_nobuild.cxx PROPERTIES HEADER_FILE_ONLY 1) # Test forcing a .c file to not build. # This makes sure a mixed language library is created # with header file only sources -SET_SOURCE_FILES_PROPERTIES(complex_nobuild.c PROPERTIES +set_source_files_properties(complex_nobuild.c PROPERTIES HEADER_FILE_ONLY 1) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt) -ADD_CUSTOM_COMMAND(OUTPUT Aout.h COMMAND A > Aout.h VERBATIM) -ADD_EXECUTABLE(complex complex testcflags.c Aout.h) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +add_executable(A A.cxx A.hh A.h A.txt) +add_custom_command(OUTPUT Aout.h COMMAND A > Aout.h VERBATIM) +add_executable(complex complex testcflags.c Aout.h) # Sub1/NameConflictTest.c Sub2/NameConflictTest.c) -ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx +add_executable(complex.file complex.file.cxx complex_nobuild.cxx complex_nobuild.c) -IF (UNIX) - TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS}) -ELSE(UNIX) - IF (NOT BORLAND) - IF(NOT MINGW) - TARGET_LINK_LIBRARIES(complex rpcrt4.lib) - ENDIF(NOT MINGW) - ENDIF(NOT BORLAND) -ENDIF (UNIX) +if (UNIX) + target_link_libraries(complex ${CMAKE_DL_LIBS}) +else(UNIX) + if (NOT BORLAND) + if(NOT MINGW) + target_link_libraries(complex rpcrt4.lib) + endif(NOT MINGW) + endif(NOT BORLAND) +endif (UNIX) # Test linking to static lib when a shared lib has the same name. -IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) - ADD_DEFINITIONS(-DCOMPLEX_TEST_LINK_STATIC) - TARGET_LINK_LIBRARIES(complex CMakeTestLinkStatic) -ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) + add_definitions(-DCOMPLEX_TEST_LINK_STATIC) + target_link_libraries(complex CMakeTestLinkStatic) +endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) # can we get the path to a source file -GET_SOURCE_FILE_PROPERTY(A_LOCATION A.cxx LOCATION) -IF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") - ADD_DEFINITIONS(-DCMAKE_FOUND_ACXX) -ENDIF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") +get_source_file_property(A_LOCATION A.cxx LOCATION) +if ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") + add_definitions(-DCMAKE_FOUND_ACXX) +endif ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") # get the directory parent -GET_DIRECTORY_PROPERTY(P_VALUE PARENT_DIRECTORY) -IF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") - ADD_DEFINITIONS(-DCMAKE_FOUND_PARENT) -ENDIF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") +get_directory_property(P_VALUE PARENT_DIRECTORY) +if ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") + add_definitions(-DCMAKE_FOUND_PARENT) +endif ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") # get the stack of listfiles -INCLUDE(Included.cmake) -IF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") - ADD_DEFINITIONS(-DCMAKE_FOUND_LISTFILE_STACK) -ENDIF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") +include(Included.cmake) +if ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") + add_definitions(-DCMAKE_FOUND_LISTFILE_STACK) +endif ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") # Test add/remove definitions. -ADD_DEFINITIONS( +add_definitions( -DCOMPLEX_DEFINED_PRE -DCOMPLEX_DEFINED -DCOMPLEX_DEFINED_POST -DCOMPLEX_DEFINED ) -REMOVE_DEFINITIONS(-DCOMPLEX_DEFINED) +remove_definitions(-DCOMPLEX_DEFINED) # Test pre-build/pre-link/post-build rules for an executable. -ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD +add_custom_command(TARGET complex PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Executable/prebuild.txt") -ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD +add_custom_command(TARGET complex PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Executable/prelink.txt") -ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD +add_custom_command(TARGET complex POST_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Executable/postbuild.txt") -ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD +add_custom_command(TARGET complex POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy "${Complex_BINARY_DIR}/Executable/postbuild.txt" "${Complex_BINARY_DIR}/Executable/postbuild2.txt") -SET_SOURCE_FILES_PROPERTIES(complex +set_source_files_properties(complex COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS" #" -DFILE_DEFINE_STRING=\\\"hello\\\"" OBJECT_DEPENDS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h ) -SET_TARGET_PROPERTIES(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG") -ADD_CUSTOM_COMMAND( +set_target_properties(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG") +add_custom_command( TARGET complex SOURCE ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in COMMAND ${CMAKE_COMMAND} @@ -121,18 +121,18 @@ ADD_CUSTOM_COMMAND( ) # Test creating an executable that is not built by default. -ADD_EXECUTABLE(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx) -TARGET_LINK_LIBRARIES(notInAllExe notInAllLib) +add_executable(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx) +target_link_libraries(notInAllExe notInAllLib) # Test user-value flag mapping for the VS IDE. -IF(MSVC) - SET_TARGET_PROPERTIES(notInAllExe PROPERTIES +if(MSVC) + set_target_properties(notInAllExe PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT") -ENDIF(MSVC) +endif(MSVC) # Test creating a custom target that builds not-in-all targets. -ADD_CUSTOM_TARGET(notInAllCustom) -ADD_DEPENDENCIES(notInAllCustom notInAllExe) +add_custom_target(notInAllCustom) +add_dependencies(notInAllCustom notInAllExe) # # Output the files required by 'complex' to a file. @@ -141,30 +141,30 @@ ADD_DEPENDENCIES(notInAllCustom notInAllExe) # has no side-effects on the current Makefile (duplicated source file # due to source list expansion done twice). # -ADD_SUBDIRECTORY(Temp) +add_subdirectory(Temp) -IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) - ADD_EXECUTABLE(testSystemDir testSystemDir.cxx) - SET_TARGET_PROPERTIES(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") -ENDIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) +if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) + add_executable(testSystemDir testSystemDir.cxx) + set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") +endif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) # # Extra coverage.Not used. # -INSTALL_TARGETS(/tmp complex) -INSTALL_PROGRAMS(/tmp complex) +install_targets(/tmp complex) +install_programs(/tmp complex) -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/Executable/cmVersion.h.in ${Complex_BINARY_DIR}/cmVersion.h) -SOURCE_GROUP(A_GROUP ".cxx") -SOURCE_GROUP(B_GROUP REGULAR_EXPRESSION "cxx") -SOURCE_GROUP(C_GROUP FILES complex.cxx) +source_group(A_GROUP ".cxx") +source_group(B_GROUP REGULAR_EXPRESSION "cxx") +source_group(C_GROUP FILES complex.cxx) -FILE(WRITE ${Complex_BINARY_DIR}/A/libA.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/A/libC.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/B/libB.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/B/libA.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/C/libC.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/C/libB.a "test") +file(WRITE ${Complex_BINARY_DIR}/A/libA.a "test") +file(WRITE ${Complex_BINARY_DIR}/A/libC.a "test") +file(WRITE ${Complex_BINARY_DIR}/B/libB.a "test") +file(WRITE ${Complex_BINARY_DIR}/B/libA.a "test") +file(WRITE ${Complex_BINARY_DIR}/C/libC.a "test") +file(WRITE ${Complex_BINARY_DIR}/C/libB.a "test") diff --git a/Tests/Complex/Executable/Included.cmake b/Tests/Complex/Executable/Included.cmake index 2d1ea3e8c..520a68be1 100644 --- a/Tests/Complex/Executable/Included.cmake +++ b/Tests/Complex/Executable/Included.cmake @@ -1,2 +1,2 @@ -GET_DIRECTORY_PROPERTY(LF_VALUE LISTFILE_STACK) +get_directory_property(LF_VALUE LISTFILE_STACK) diff --git a/Tests/Complex/Executable/Temp/CMakeLists.txt b/Tests/Complex/Executable/Temp/CMakeLists.txt index 989765e3a..041fcff20 100644 --- a/Tests/Complex/Executable/Temp/CMakeLists.txt +++ b/Tests/Complex/Executable/Temp/CMakeLists.txt @@ -3,6 +3,6 @@ # The 'complex' executable will then test if this file exists and remove it. # The contents of this file is not tested (absolute paths). # -OUTPUT_REQUIRED_FILES( +output_required_files( ${Complex_SOURCE_DIR}/Executable/complex.cxx ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt) diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt index becf67207..41faeba4d 100644 --- a/Tests/Complex/Library/CMakeLists.txt +++ b/Tests/Complex/Library/CMakeLists.txt @@ -1,90 +1,90 @@ -REMOVE_DEFINITIONS(-DCMAKE_IS_REALLY_FUN) +remove_definitions(-DCMAKE_IS_REALLY_FUN) # # Small utility used to create file # UTILITY_SOURCE is used for coverage and for getting the exact name # of the executable. # -UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx) -ADD_EXECUTABLE(create_file create_file.cxx) -SET_TARGET_PROPERTIES(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".") +utility_source(CREATE_FILE_EXE create_file "." create_file.cxx) +add_executable(create_file create_file.cxx) +set_target_properties(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".") # # Create static library # SOURCE_FILES_REMOVE is used for Coverage. empty.h is included for coverage # -AUX_SOURCE_DIRECTORY(ExtraSources LibrarySources) -SET(LibrarySources ${LibrarySources} +aux_source_directory(ExtraSources LibrarySources) +set(LibrarySources ${LibrarySources} file2 empty create_file.cxx GENERATED nonexisting_file) -REMOVE(LibrarySources create_file.cxx GENERATED nonexisting_file) -ADD_LIBRARY(CMakeTestLibrary ${LibrarySources}) +remove(LibrarySources create_file.cxx GENERATED nonexisting_file) +add_library(CMakeTestLibrary ${LibrarySources}) -IF(WIN32) - IF(NOT CYGWIN) - IF(NOT BORLAND) - IF(NOT MINGW) - TARGET_LINK_LIBRARIES(CMakeTestLibrary +if(WIN32) + if(NOT CYGWIN) + if(NOT BORLAND) + if(NOT MINGW) + target_link_libraries(CMakeTestLibrary debug user32.lib) - TARGET_LINK_LIBRARIES(CMakeTestLibrary + target_link_libraries(CMakeTestLibrary optimized kernel32.lib) - ENDIF(NOT MINGW) - ENDIF(NOT BORLAND) - ENDIF(NOT CYGWIN) -ENDIF(WIN32) + endif(NOT MINGW) + endif(NOT BORLAND) + endif(NOT CYGWIN) +endif(WIN32) # # Create shared library # -SET(SharedLibrarySources sharedFile) -ADD_LIBRARY(CMakeTestLibraryShared SHARED ${SharedLibrarySources}) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") -ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c) -DEFINE_PROPERTY( +set(SharedLibrarySources sharedFile) +add_library(CMakeTestLibraryShared SHARED ${SharedLibrarySources}) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") +add_library(CMakeTestCLibraryShared SHARED testConly.c) +define_property( TARGET PROPERTY FOO BRIEF_DOCS "a test property" FULL_DOCS "A simple etst proerty that means nothign and is used for nothing" ) -SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR) -IF(NOT BEOS AND NOT WIN32) # No libm on BeOS. - SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm") -ENDIF(NOT BEOS AND NOT WIN32) -GET_TARGET_PROPERTY(FOO_BAR_VAR CMakeTestCLibraryShared FOO) -IF(${FOO_BAR_VAR} MATCHES "BAR") -ELSE(${FOO_BAR_VAR} MATCHES "BAR") - MESSAGE(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}") -ENDIF(${FOO_BAR_VAR} MATCHES "BAR") +set_target_properties(CMakeTestCLibraryShared PROPERTIES FOO BAR) +if(NOT BEOS AND NOT WIN32) # No libm on BeOS. + set_target_properties(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm") +endif(NOT BEOS AND NOT WIN32) +get_target_property(FOO_BAR_VAR CMakeTestCLibraryShared FOO) +if(${FOO_BAR_VAR} MATCHES "BAR") +else(${FOO_BAR_VAR} MATCHES "BAR") + message(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}") +endif(${FOO_BAR_VAR} MATCHES "BAR") # Create static and shared lib of same name. -IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) - ADD_LIBRARY(CMakeTestLinkStatic STATIC TestLink.c) - ADD_LIBRARY(CMakeTestLinkShared SHARED TestLink.c) - SET_TARGET_PROPERTIES(CMakeTestLinkStatic CMakeTestLinkShared +if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) + add_library(CMakeTestLinkStatic STATIC TestLink.c) + add_library(CMakeTestLinkShared SHARED TestLink.c) + set_target_properties(CMakeTestLinkStatic CMakeTestLinkShared PROPERTIES OUTPUT_NAME CMakeTestLink) -ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) # # Attach pre-build/pre-link/post-build custom-commands to the lib. # Each runs ${CREATE_FILE_EXE} which will create a file. # The 'complex' executable will then test if this file exists and remove it. # -ADD_DEPENDENCIES(CMakeTestLibraryShared create_file) -MESSAGE("complex bin dir is ${Complex_BINARY_DIR}") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD +add_dependencies(CMakeTestLibraryShared create_file) +message("complex bin dir is ${Complex_BINARY_DIR}") +add_custom_command(TARGET CMakeTestLibraryShared PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Library/prebuild.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD +add_custom_command(TARGET CMakeTestLibraryShared PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Library/prelink.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD +add_custom_command(TARGET CMakeTestLibraryShared POST_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Library/postbuild.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD +add_custom_command(TARGET CMakeTestLibraryShared POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy "${Complex_BINARY_DIR}/Library/postbuild.txt" @@ -95,46 +95,46 @@ ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD # It runs ${CREATE_FILE_EXE} which will create a file. # The 'complex' executable will then test if this file exists and remove it. # -ADD_CUSTOM_TARGET(custom_target1 +add_custom_target(custom_target1 ALL ${CREATE_FILE_EXE} "${Complex_BINARY_DIR}/Library/custom_target1.txt") -ADD_DEPENDENCIES(custom_target1 create_file) +add_dependencies(custom_target1 create_file) # # Extra coverage # -SET_SOURCE_FILES_PROPERTIES(file2 PROPERTIES ABSTRACT 1) +set_source_files_properties(file2 PROPERTIES ABSTRACT 1) -INSTALL_FILES(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h) -INSTALL_FILES(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h) +install_files(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h) +install_files(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h) # Test creating a library that is not built by default. -ADD_LIBRARY(notInAllLib EXCLUDE_FROM_ALL notInAllLib.cxx) +add_library(notInAllLib EXCLUDE_FROM_ALL notInAllLib.cxx) # Create an imported target for if(TARGET) test in Executable dir. # That test should not see this target. -ADD_LIBRARY(LibImportedTarget UNKNOWN IMPORTED) +add_library(LibImportedTarget UNKNOWN IMPORTED) # Test generation of preprocessed sources. -IF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) - IF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) +if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) + if(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) # Skip running this part of the test on certain platforms # until they are fixed. - SET(MAYBE_ALL ALL) - LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT) - IF(ARCH_COUNT GREATER 1) + set(MAYBE_ALL ALL) + list(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT) + if(ARCH_COUNT GREATER 1) # OSX does not support preprocessing more than one architecture. - SET(MAYBE_ALL) - ENDIF(ARCH_COUNT GREATER 1) + set(MAYBE_ALL) + endif(ARCH_COUNT GREATER 1) # Custom target to try preprocessing invocation. - ADD_CUSTOM_TARGET(test_preprocess ${MAYBE_ALL} + add_custom_target(test_preprocess ${MAYBE_ALL} COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - ENDIF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) -ENDIF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) + endif(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) +endif("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) diff --git a/Tests/Complex/Library/test_preprocess.cmake b/Tests/Complex/Library/test_preprocess.cmake index d2d9fc652..885c61330 100644 --- a/Tests/Complex/Library/test_preprocess.cmake +++ b/Tests/Complex/Library/test_preprocess.cmake @@ -1,7 +1,7 @@ -SET(TEST_FILE CMakeFiles/create_file.dir/create_file.i) -FILE(READ ${TEST_FILE} CONTENTS) -IF("${CONTENTS}" MATCHES "Unable to close") - MESSAGE(STATUS "${TEST_FILE} created successfully!") -ELSE("${CONTENTS}" MATCHES "Unable to close") - MESSAGE(FATAL_ERROR "${TEST_FILE} creation failed!") -ENDIF("${CONTENTS}" MATCHES "Unable to close") +set(TEST_FILE CMakeFiles/create_file.dir/create_file.i) +file(READ ${TEST_FILE} CONTENTS) +if("${CONTENTS}" MATCHES "Unable to close") + message(STATUS "${TEST_FILE} created successfully!") +else("${CONTENTS}" MATCHES "Unable to close") + message(FATAL_ERROR "${TEST_FILE} creation failed!") +endif("${CONTENTS}" MATCHES "Unable to close") diff --git a/Tests/Complex/VarTests.cmake b/Tests/Complex/VarTests.cmake index c146d1be0..7e968fd62 100644 --- a/Tests/Complex/VarTests.cmake +++ b/Tests/Complex/VarTests.cmake @@ -1,198 +1,198 @@ # # Test SET # -SET (ZERO_VAR 0) -SET (ZERO_VAR2 0) +set (ZERO_VAR 0) +set (ZERO_VAR2 0) -IF(ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED) -ELSE(ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED) -ENDIF(ZERO_VAR) +if(ZERO_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED) +else(ZERO_VAR) + add_definitions(-DSHOULD_BE_DEFINED) +endif(ZERO_VAR) -SET(ONE_VAR 1) -SET(ONE_VAR2 1) -SET(STRING_VAR "CMake is great" CACHE STRING "test a cache variable") +set(ONE_VAR 1) +set(ONE_VAR2 1) +set(STRING_VAR "CMake is great" CACHE STRING "test a cache variable") # # Test VARIABLE_REQUIRES # -VARIABLE_REQUIRES(ONE_VAR +variable_requires(ONE_VAR ONE_VAR_IS_DEFINED ONE_VAR) # # Test various IF/ELSE combinations # -IF(NOT ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT) -ELSE(NOT ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT) -ENDIF(NOT ZERO_VAR) +if(NOT ZERO_VAR) + add_definitions(-DSHOULD_BE_DEFINED_NOT) +else(NOT ZERO_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT) +endif(NOT ZERO_VAR) -IF(NOT ONE_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT2) -ELSE(NOT ONE_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT2) -ENDIF(NOT ONE_VAR) +if(NOT ONE_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT2) +else(NOT ONE_VAR) + add_definitions(-DSHOULD_BE_DEFINED_NOT2) +endif(NOT ONE_VAR) -IF(ONE_VAR AND ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND) -ELSE(ONE_VAR AND ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND) -ENDIF(ONE_VAR AND ONE_VAR2) +if(ONE_VAR AND ONE_VAR2) + add_definitions(-DSHOULD_BE_DEFINED_AND) +else(ONE_VAR AND ONE_VAR2) + add_definitions(-DSHOULD_NOT_BE_DEFINED_AND) +endif(ONE_VAR AND ONE_VAR2) -IF(ONE_VAR AND ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND2) -ELSE(ONE_VAR AND ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND2) -ENDIF(ONE_VAR AND ZERO_VAR) +if(ONE_VAR AND ZERO_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_AND2) +else(ONE_VAR AND ZERO_VAR) + add_definitions(-DSHOULD_BE_DEFINED_AND2) +endif(ONE_VAR AND ZERO_VAR) -IF(ZERO_VAR OR ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR) -ELSE(ZERO_VAR OR ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR) -ENDIF(ZERO_VAR OR ONE_VAR2) +if(ZERO_VAR OR ONE_VAR2) + add_definitions(-DSHOULD_BE_DEFINED_OR) +else(ZERO_VAR OR ONE_VAR2) + add_definitions(-DSHOULD_NOT_BE_DEFINED_OR) +endif(ZERO_VAR OR ONE_VAR2) -IF(ZERO_VAR OR ZERO_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR2) -ELSE(ZERO_VAR OR ZERO_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR2) -ENDIF(ZERO_VAR OR ZERO_VAR2) +if(ZERO_VAR OR ZERO_VAR2) + add_definitions(-DSHOULD_NOT_BE_DEFINED_OR2) +else(ZERO_VAR OR ZERO_VAR2) + add_definitions(-DSHOULD_BE_DEFINED_OR2) +endif(ZERO_VAR OR ZERO_VAR2) -IF(STRING_VAR MATCHES "^CMake") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES) -ELSE(STRING_VAR MATCHES "^CMake") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES) -ENDIF(STRING_VAR MATCHES "^CMake") +if(STRING_VAR MATCHES "^CMake") + add_definitions(-DSHOULD_BE_DEFINED_MATCHES) +else(STRING_VAR MATCHES "^CMake") + add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES) +endif(STRING_VAR MATCHES "^CMake") -IF(STRING_VAR MATCHES "^foo") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES2) -ELSE(STRING_VAR MATCHES "^foo") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES2) -ENDIF(STRING_VAR MATCHES "^foo") +if(STRING_VAR MATCHES "^foo") + add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES2) +else(STRING_VAR MATCHES "^foo") + add_definitions(-DSHOULD_BE_DEFINED_MATCHES2) +endif(STRING_VAR MATCHES "^foo") -IF(COMMAND "IF") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND) -ELSE(COMMAND "IF") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND) -ENDIF(COMMAND "IF") +if(COMMAND "IF") + add_definitions(-DSHOULD_BE_DEFINED_COMMAND) +else(COMMAND "IF") + add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND) +endif(COMMAND "IF") -IF(COMMAND "ROQUEFORT") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND2) -ELSE(COMMAND "ROQUEFORT") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND2) -ENDIF(COMMAND "ROQUEFORT") +if(COMMAND "ROQUEFORT") + add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND2) +else(COMMAND "ROQUEFORT") + add_definitions(-DSHOULD_BE_DEFINED_COMMAND2) +endif(COMMAND "ROQUEFORT") -IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS) -ELSE(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) + add_definitions(-DSHOULD_BE_DEFINED_EXISTS) +else(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) + add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS) +endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) -IF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS2) -ELSE(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS2) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) +if (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) + add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS2) +else(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) + add_definitions(-DSHOULD_BE_DEFINED_EXISTS2) +endif (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) -IF (IS_DIRECTORY ${Complex_SOURCE_DIR}) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY) -ENDIF (IS_DIRECTORY ${Complex_SOURCE_DIR}) +if (IS_DIRECTORY ${Complex_SOURCE_DIR}) + add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY) +endif (IS_DIRECTORY ${Complex_SOURCE_DIR}) -IF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY2) -ENDIF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) +if (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) + add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY2) +endif (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) -SET (SNUM1_VAR "1") -SET (SNUM2_VAR "2") -SET (SNUM3_VAR "1") +set (SNUM1_VAR "1") +set (SNUM2_VAR "2") +set (SNUM3_VAR "1") -IF (SNUM1_VAR LESS SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS) -ELSE (SNUM1_VAR LESS SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS) -ENDIF (SNUM1_VAR LESS SNUM2_VAR) +if (SNUM1_VAR LESS SNUM2_VAR) + add_definitions(-DSHOULD_BE_DEFINED_LESS) +else (SNUM1_VAR LESS SNUM2_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS) +endif (SNUM1_VAR LESS SNUM2_VAR) -IF (SNUM2_VAR LESS SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS2) -ELSE (SNUM2_VAR LESS SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS2) -ENDIF (SNUM2_VAR LESS SNUM1_VAR) +if (SNUM2_VAR LESS SNUM1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS2) +else (SNUM2_VAR LESS SNUM1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_LESS2) +endif (SNUM2_VAR LESS SNUM1_VAR) -IF (SNUM2_VAR GREATER SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER) -ELSE (SNUM2_VAR GREATER SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER) -ENDIF (SNUM2_VAR GREATER SNUM1_VAR) +if (SNUM2_VAR GREATER SNUM1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_GREATER) +else (SNUM2_VAR GREATER SNUM1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER) +endif (SNUM2_VAR GREATER SNUM1_VAR) -IF (SNUM2_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL) -ELSE (SNUM2_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL) -ENDIF (SNUM2_VAR EQUAL SNUM1_VAR) +if (SNUM2_VAR EQUAL SNUM1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) +else (SNUM2_VAR EQUAL SNUM1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_EQUAL) +endif (SNUM2_VAR EQUAL SNUM1_VAR) -IF (SNUM3_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL) -ELSE (SNUM3_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL) -ENDIF (SNUM3_VAR EQUAL SNUM1_VAR) +if (SNUM3_VAR EQUAL SNUM1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_EQUAL) +else (SNUM3_VAR EQUAL SNUM1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) +endif (SNUM3_VAR EQUAL SNUM1_VAR) -IF (SNUM1_VAR GREATER SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER2) -ELSE (SNUM1_VAR GREATER SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER2) -ENDIF (SNUM1_VAR GREATER SNUM2_VAR) +if (SNUM1_VAR GREATER SNUM2_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER2) +else (SNUM1_VAR GREATER SNUM2_VAR) + add_definitions(-DSHOULD_BE_DEFINED_GREATER2) +endif (SNUM1_VAR GREATER SNUM2_VAR) -SET (SSTR1_VAR "abc") -SET (SSTR2_VAR "bcd") +set (SSTR1_VAR "abc") +set (SSTR2_VAR "bcd") -IF (SSTR1_VAR STRLESS SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS) -ELSE (SSTR1_VAR STRLESS SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS) -ENDIF (SSTR1_VAR STRLESS SSTR2_VAR) +if (SSTR1_VAR STRLESS SSTR2_VAR) + add_definitions(-DSHOULD_BE_DEFINED_STRLESS) +else (SSTR1_VAR STRLESS SSTR2_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS) +endif (SSTR1_VAR STRLESS SSTR2_VAR) -IF (SSTR2_VAR STRLESS SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS2) -ELSE (SSTR2_VAR STRLESS SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS2) -ENDIF (SSTR2_VAR STRLESS SSTR1_VAR) +if (SSTR2_VAR STRLESS SSTR1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS2) +else (SSTR2_VAR STRLESS SSTR1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_STRLESS2) +endif (SSTR2_VAR STRLESS SSTR1_VAR) -IF (SSTR2_VAR STRGREATER SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER) -ELSE (SSTR2_VAR STRGREATER SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER) -ENDIF (SSTR2_VAR STRGREATER SSTR1_VAR) +if (SSTR2_VAR STRGREATER SSTR1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_STRGREATER) +else (SSTR2_VAR STRGREATER SSTR1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER) +endif (SSTR2_VAR STRGREATER SSTR1_VAR) -IF (SSTR1_VAR STRGREATER SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER2) -ELSE (SSTR1_VAR STRGREATER SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER2) -ENDIF (SSTR1_VAR STRGREATER SSTR2_VAR) +if (SSTR1_VAR STRGREATER SSTR2_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER2) +else (SSTR1_VAR STRGREATER SSTR2_VAR) + add_definitions(-DSHOULD_BE_DEFINED_STRGREATER2) +endif (SSTR1_VAR STRGREATER SSTR2_VAR) # # Test FOREACH # -FOREACH (INDEX 1 2) - SET(FOREACH_VAR${INDEX} "VALUE${INDEX}") -ENDFOREACH(INDEX) +foreach (INDEX 1 2) + set(FOREACH_VAR${INDEX} "VALUE${INDEX}") +endforeach(INDEX) -SET(FOREACH_CONCAT "") -FOREACH (INDEX a;b;c;d;e;f;g) - SET(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") -ENDFOREACH(INDEX) +set(FOREACH_CONCAT "") +foreach (INDEX a;b;c;d;e;f;g) + set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") +endforeach(INDEX) # # Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations # -FIND_FILE(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR}) +find_file(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR}) -GET_FILENAME_COMPONENT(FILENAME_VAR_PATH ${FILENAME_VAR} PATH) -GET_FILENAME_COMPONENT(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME) -GET_FILENAME_COMPONENT(FILENAME_VAR_NAME ${FILENAME_VAR} NAME) -GET_FILENAME_COMPONENT(FILENAME_VAR_EXT ${FILENAME_VAR} EXT) -GET_FILENAME_COMPONENT(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE) +get_filename_component(FILENAME_VAR_PATH ${FILENAME_VAR} PATH) +get_filename_component(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME) +get_filename_component(FILENAME_VAR_NAME ${FILENAME_VAR} NAME) +get_filename_component(FILENAME_VAR_EXT ${FILENAME_VAR} EXT) +get_filename_component(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE) -FIND_PATH(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR}) -GET_FILENAME_COMPONENT(PATH_VAR_NAME ${PATH_VAR} NAME) +find_path(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR}) +get_filename_component(PATH_VAR_NAME ${PATH_VAR} NAME) diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index 500431cf2..108093384 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -1,32 +1,32 @@ # # A more complex test case # -SET(CMAKE_BACKWARDS_COMPATIBILITY 1.4) -PROJECT (Complex) +set(CMAKE_BACKWARDS_COMPATIBILITY 1.4) +project (Complex) # Try setting a new policy. The IF test is for coverage. -IF(POLICY CMP0003) - CMAKE_POLICY(SET CMP0003 NEW) +if(POLICY CMP0003) + cmake_policy(SET CMP0003 NEW) - CMAKE_POLICY(GET CMP0003 P3) - IF(NOT "${P3}" STREQUAL "NEW") - MESSAGE(FATAL_ERROR "CMAKE_POLICY(GET) did not report NEW!") - ENDIF(NOT "${P3}" STREQUAL "NEW") -ENDIF(POLICY CMP0003) + cmake_policy(GET CMP0003 P3) + if(NOT "${P3}" STREQUAL "NEW") + message(FATAL_ERROR "cmake_policy(GET) did not report NEW!") + endif(NOT "${P3}" STREQUAL "NEW") +endif(POLICY CMP0003) # Test building without per-rule echo lines in Makefiles. -SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF) +set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) -SET(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$") +set(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$") # # Define a macro # -MACRO(ASSERT value msg) - IF (NOT ${value}) - MESSAGE ("Assertion failure:" ${msg} ) - ENDIF (NOT ${value}) -ENDMACRO(ASSERT) +macro(ASSERT value msg) + if (NOT ${value}) + message ("Assertion failure:" ${msg} ) + endif (NOT ${value}) +endmacro(ASSERT) # invoke the macro ASSERT(Complex_BINARY_DIR "The PROJECT command is broken") @@ -34,79 +34,79 @@ ASSERT(Complex_BINARY_DIR "The PROJECT command is broken") # # Define a var args macro, it must take two or four args # -MACRO(TEST_ARGC value1 value2) - ADD_DEFINITIONS(${value1} ${value2}) - IF (${ARGC} MATCHES 4) - ADD_DEFINITIONS(${ARGV2} ${ARGV3}) - ENDIF (${ARGC} MATCHES 4) -ENDMACRO(TEST_ARGC) +macro(TEST_ARGC value1 value2) + add_definitions(${value1} ${value2}) + if (${ARGC} MATCHES 4) + add_definitions(${ARGV2} ${ARGV3}) + endif (${ARGC} MATCHES 4) +endmacro(TEST_ARGC) # invoke the macro TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) -MACRO(TEST_VAR_ARG fa) - IF("${ARGV}" MATCHES "^1;2;3$") - MESSAGE(STATUS "ARGV works") - ELSE("${ARGV}" MATCHES "^1;2;3$") - MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") - ENDIF("${ARGV}" MATCHES "^1;2;3$") - IF("${ARGN}" MATCHES "^2;3$") - MESSAGE(STATUS "ARGN works") - ELSE("${ARGN}" MATCHES "^2;3$") - MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") - ENDIF("${ARGN}" MATCHES "^2;3$") -ENDMACRO(TEST_VAR_ARG) +macro(TEST_VAR_ARG fa) + if("${ARGV}" MATCHES "^1;2;3$") + message(STATUS "ARGV works") + else("${ARGV}" MATCHES "^1;2;3$") + message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") + endif("${ARGV}" MATCHES "^1;2;3$") + if("${ARGN}" MATCHES "^2;3$") + message(STATUS "ARGN works") + else("${ARGN}" MATCHES "^2;3$") + message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") + endif("${ARGN}" MATCHES "^2;3$") +endmacro(TEST_VAR_ARG) TEST_VAR_ARG(1 2 3) # Floating-point comparison test. -IF(2.4 LESS 2.4) - MESSAGE(FATAL_ERROR "Failed: 2.4 LESS 2.4") -ENDIF(2.4 LESS 2.4) -IF(2.4 GREATER 2.4) - MESSAGE(FATAL_ERROR "Failed: 2.4 GREATER 2.4") -ENDIF(2.4 GREATER 2.4) -IF(NOT 2.4 EQUAL 2.4) - MESSAGE(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") -ENDIF(NOT 2.4 EQUAL 2.4) +if(2.4 LESS 2.4) + message(FATAL_ERROR "Failed: 2.4 LESS 2.4") +endif(2.4 LESS 2.4) +if(2.4 GREATER 2.4) + message(FATAL_ERROR "Failed: 2.4 GREATER 2.4") +endif(2.4 GREATER 2.4) +if(NOT 2.4 EQUAL 2.4) + message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") +endif(NOT 2.4 EQUAL 2.4) -IF(CMAKE_SYSTEM MATCHES "OSF1-V.*") - IF(NOT CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") - ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) -ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*") +if(CMAKE_SYSTEM MATCHES "OSF1-V.*") + if(NOT CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") + endif(NOT CMAKE_COMPILER_IS_GNUCXX) +endif(CMAKE_SYSTEM MATCHES "OSF1-V.*") -ADD_DEFINITIONS(-DCMAKE_IS_FUN) -ADD_DEFINITIONS(-DCMAKE_IS_REALLY_FUN) -SET_PROPERTY(DIRECTORY +add_definitions(-DCMAKE_IS_FUN) +add_definitions(-DCMAKE_IS_REALLY_FUN) +set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_RELEASE CMAKE_IS_FUN_IN_RELEASE_MODE ) -SET(TEST_SEP "a b c") -SEPARATE_ARGUMENTS(TEST_SEP) +set(TEST_SEP "a b c") +separate_arguments(TEST_SEP) # # Include vars from a file and from a cache # -IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - INCLUDE(${Complex_SOURCE_DIR}/VarTests.cmake) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) -INCLUDE(fileshouldnotbehere OPTIONAL) -LOAD_CACHE(${Complex_SOURCE_DIR}/Cache +if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) + include(${Complex_SOURCE_DIR}/VarTests.cmake) +endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +include(fileshouldnotbehere OPTIONAL) +load_cache(${Complex_SOURCE_DIR}/Cache EXCLUDE CACHE_TEST_VAR_EXCLUDED INCLUDE_INTERNALS CACHE_TEST_VAR_INTERNAL) -LOAD_CACHE(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2) -IF(${fooCACHE_TEST_VAR2} MATCHES bar) - MESSAGE("Load cache worked: ${fooCACHE_TEST_VAR2}") -ELSE(${fooCACHE_TEST_VAR2} MATCHES bar) - MESSAGE(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}") -ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar) +load_cache(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2) +if(${fooCACHE_TEST_VAR2} MATCHES bar) + message("Load cache worked: ${fooCACHE_TEST_VAR2}") +else(${fooCACHE_TEST_VAR2} MATCHES bar) + message(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}") +endif(${fooCACHE_TEST_VAR2} MATCHES bar) @@ -114,104 +114,104 @@ ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar) # Specify include and lib dirs # (BEFORE is for coverage) # -INCLUDE_DIRECTORIES( +include_directories( Library ) -INCLUDE_DIRECTORIES(BEFORE +include_directories(BEFORE ${Complex_BINARY_DIR} ) -INCLUDE_DIRECTORIES(SYSTEM Library/SystemDir) +include_directories(SYSTEM Library/SystemDir) -INCLUDE_REGULAR_EXPRESSION("^(cmTest|file|sharedFile|test).*$" "^cmMissing") +include_regular_expression("^(cmTest|file|sharedFile|test).*$" "^cmMissing") -LINK_DIRECTORIES( +link_directories( ${Complex_BINARY_DIR}/Library ) # # check for SET CACHE FORCE # -SET(FORCE_TEST 1 CACHE STRING "a test") -SET(FORCE_TEST 0 CACHE STRING "a test" FORCE) +set(FORCE_TEST 1 CACHE STRING "a test") +set(FORCE_TEST 0 CACHE STRING "a test" FORCE) # # Lib and exe path # -SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static") -SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib") -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin") -MESSAGE (Test " " escape " " semi-colon " " \; \;) +message (Test " " escape " " semi-colon " " \; \;) # # Exec program (TODO: test a result) # Increase coverage. # -MESSAGE("\nIgnore this message") -OPTION(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0) -IF (NOT NO_EXEC_PROGRAM) - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}") -ELSE (NOT NO_EXEC_PROGRAM) - MESSAGE("Set this option ON") -ENDIF (NOT NO_EXEC_PROGRAM) +message("\nIgnore this message") +option(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0) +if (NOT NO_EXEC_PROGRAM) + exec_program(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}") +else (NOT NO_EXEC_PROGRAM) + message("Set this option ON") +endif (NOT NO_EXEC_PROGRAM) -MARK_AS_ADVANCED(NO_EXEC_PROGRAM) -MARK_AS_ADVANCED(CLEAR NO_EXEC_PROGRAM) +mark_as_advanced(NO_EXEC_PROGRAM) +mark_as_advanced(CLEAR NO_EXEC_PROGRAM) # Execute a process. Add coverage for this command. -EXECUTE_PROCESS( +execute_process( COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" OUTPUT_VARIABLE TEST_OUT ) -IF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") -ELSE("${TEST_OUT}" MATCHES "^ABCDEFG\n$") - MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") -ENDIF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +if("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +else("${TEST_OUT}" MATCHES "^ABCDEFG\n$") + message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") +endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$") # This test has some problems on UNIX systems. Disabling for now. # -# EXECUTE_PROCESS( +# execute_process( # COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" # COMMAND /process/does/not/exist # OUTPUT_QUIET # ERROR_QUIET # RESULT_VARIABLE RESULT # ) -# IF("${RESULT}" MATCHES "^0$") -# MESSAGE(SEND_ERROR +# if("${RESULT}" MATCHES "^0$") +# message(SEND_ERROR # "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]") -# ELSE("${RESULT}" MATCHES "^0$") -# MESSAGE(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]") -# ENDIF("${RESULT}" MATCHES "^0$") +# else("${RESULT}" MATCHES "^0$") +# message(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]") +# endif("${RESULT}" MATCHES "^0$") # # Create directory. # The 'complex' executable will then test if this dir exists, # sadly it won't be able to remove it. # -MAKE_DIRECTORY("${Complex_BINARY_DIR}/make_dir") +make_directory("${Complex_BINARY_DIR}/make_dir") # # Test FIND_LIBARY # Create a dummy empty lib # -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/dummylib.lib COPYONLY IMMEDIATE) -FOREACH (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl) - CONFIGURE_FILE( +foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl) + configure_file( ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/libdummylib${ext} COPYONLY IMMEDIATE) -ENDFOREACH (ext) +endforeach (ext) -FIND_LIBRARY(FIND_DUMMY_LIB +find_library(FIND_DUMMY_LIB dummylib PATHS ${Complex_BINARY_DIR}/Library DOC "find dummy lib") -FIND_LIBRARY(FIND_DUMMY_LIB +find_library(FIND_DUMMY_LIB NAMES dummylib dummylib2 PATHS ${Complex_BINARY_DIR}/Library DOC "find dummy lib") @@ -219,76 +219,76 @@ FIND_LIBRARY(FIND_DUMMY_LIB # # Test SET_SOURCE_FILES_PROPERTIES # -SET_SOURCE_FILES_PROPERTIES(nonexisting_file2 +set_source_files_properties(nonexisting_file2 GENERATED ABSTRACT WRAP_EXCLUDE COMPILE_FLAGS "-foo -bar") -GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT) -GET_SOURCE_FILE_PROPERTY(FILE_HAS_WRAP_EXCLUDE nonexisting_file2 WRAP_EXCLUDE) -GET_SOURCE_FILE_PROPERTY(FILE_COMPILE_FLAGS nonexisting_file2 COMPILE_FLAGS) +get_source_file_property(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT) +get_source_file_property(FILE_HAS_WRAP_EXCLUDE nonexisting_file2 WRAP_EXCLUDE) +get_source_file_property(FILE_COMPILE_FLAGS nonexisting_file2 COMPILE_FLAGS) -SET_SOURCE_FILES_PROPERTIES(nonexisting_file3 PROPERTIES +set_source_files_properties(nonexisting_file3 PROPERTIES GENERATED 1 ABSTRACT 1 WRAP_EXCLUDE 1 COMPILE_FLAGS "-foo -bar") -GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file3 ABSTRACT) -GET_SOURCE_FILE_PROPERTY(FILE_HAS_WRAP_EXCLUDE nonexisting_file3 WRAP_EXCLUDE) -GET_SOURCE_FILE_PROPERTY(FILE_COMPILE_FLAGS nonexisting_file3 COMPILE_FLAGS) +get_source_file_property(FILE_HAS_ABSTRACT nonexisting_file3 ABSTRACT) +get_source_file_property(FILE_HAS_WRAP_EXCLUDE nonexisting_file3 WRAP_EXCLUDE) +get_source_file_property(FILE_COMPILE_FLAGS nonexisting_file3 COMPILE_FLAGS) # # Test registry (win32) # Create a file, put its path in a registry key, try to find the file in that # path using that registry key, then remove the file and the key # -IF (WIN32) - IF (NOT UNIX) - SET(dir "${Complex_BINARY_DIR}/registry_dir") - SET(file "registry_test_dummy") - SET(hkey "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Tests\\Complex;registry_test") - CONFIGURE_FILE( +if (WIN32) + if (NOT UNIX) + set(dir "${Complex_BINARY_DIR}/registry_dir") + set(file "registry_test_dummy") + set(hkey "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Tests\\Complex;registry_test") + configure_file( ${Complex_SOURCE_DIR}/Library/dummy "${dir}/${file}" COPYONLY IMMEDIATE) - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"") - FIND_PATH(REGISTRY_TEST_PATH + exec_program(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"") + find_path(REGISTRY_TEST_PATH ${file} "[${hkey}]" DOC "Registry_Test_Path") - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") - ENDIF (NOT UNIX) -ENDIF (WIN32) + exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") + exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") + endif (NOT UNIX) +endif (WIN32) # # Test a set and a remove # -SET(REMOVE_STRING a b c d e f) -SET(removeVar1 c e) -REMOVE(REMOVE_STRING ${removeVar1} f) +set(REMOVE_STRING a b c d e f) +set(removeVar1 c e) +remove(REMOVE_STRING ${removeVar1} f) # # Test an IF inside a FOREACH. # -FOREACH(x "a") - IF(${x} MATCHES "a") +foreach(x "a") + if(${x} MATCHES "a") # Should always execute. - SET(IF_INSIDE_FOREACH_THEN_EXECUTED 1) - ELSE(${x} MATCHES "a") + set(IF_INSIDE_FOREACH_THEN_EXECUTED 1) + else(${x} MATCHES "a") # Should never execute. - SET(IF_INSIDE_FOREACH_ELSE_EXECUTED 1) - ENDIF(${x} MATCHES "a") -ENDFOREACH(x) + set(IF_INSIDE_FOREACH_ELSE_EXECUTED 1) + endif(${x} MATCHES "a") +endforeach(x) # test WHILE command -SET (while_var 1) -WHILE (while_var LESS 1000) - SET(while_var ${while_var}0) -ENDWHILE(while_var LESS 1000) +set (while_var 1) +while (while_var LESS 1000) + set(while_var ${while_var}0) +endwhile(while_var LESS 1000) -SET(SHOULD_BE_ZERO ) -SET(SHOULD_BE_ONE 1) +set(SHOULD_BE_ZERO ) +set(SHOULD_BE_ONE 1) # test elseif functionality, the mess below tries to catch problem # of clauses being executed early or late etc @@ -337,40 +337,40 @@ endif() # Configure file # (plug vars to #define so that they can be tested) # -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/cmTestConfigure.h.in ${Complex_BINARY_DIR}/cmTestConfigure.h) -SET(STRING_WITH_QUOTES "\"hello world\"") +set(STRING_WITH_QUOTES "\"hello world\"") # test CONFIGURE_FILE with ESCAPE_QUOTES on -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/cmTestConfigureEscape.h.in ${Complex_BINARY_DIR}/cmTestConfigureEscape.h ESCAPE_QUOTES) # Test regular expression commands. -STRING(REGEX MATCH "b" RESULT "abc") -IF(NOT RESULT) - MESSAGE(SEND_ERROR "STRING(REGEX MATCH ... ) test failed.") -ENDIF(NOT RESULT) -STRING(REGEX MATCHALL "b" RESULT "abcb") -IF(NOT RESULT) - MESSAGE(SEND_ERROR "STRING(REGEX MATCHALL ... ) test failed.") -ENDIF(NOT RESULT) -STRING(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") -IF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") - SET(STRING_REGEX_PASSED 1) -ENDIF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") -IF(NOT STRING_REGEX_PASSED) - MESSAGE(SEND_ERROR - "STRING(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") -ENDIF(NOT STRING_REGEX_PASSED) +string(REGEX MATCH "b" RESULT "abc") +if(NOT RESULT) + message(SEND_ERROR "string(REGEX MATCH ... ) test failed.") +endif(NOT RESULT) +string(REGEX MATCHALL "b" RESULT "abcb") +if(NOT RESULT) + message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.") +endif(NOT RESULT) +string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") +if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") + set(STRING_REGEX_PASSED 1) +endif("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") +if(NOT STRING_REGEX_PASSED) + message(SEND_ERROR + "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") +endif(NOT STRING_REGEX_PASSED) # # Create the libs and the main exe # -ADD_SUBDIRECTORY(Library) -ADD_SUBDIRECTORY(Executable) -SUBDIR_DEPENDS(Executable Library) -EXPORT_LIBRARY_DEPENDENCIES(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake) -INCLUDE(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL) +add_subdirectory(Library) +add_subdirectory(Executable) +subdir_depends(Executable Library) +export_library_dependencies(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake) +include(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL) diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt index 6ccdaf026..413883551 100644 --- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt @@ -1,116 +1,116 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 1.3) +cmake_minimum_required(VERSION 1.3) # # Create exe. # -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") # Create an imported target for if(TARGET) test below. -ADD_LIBRARY(ExeImportedTarget UNKNOWN IMPORTED) +add_library(ExeImportedTarget UNKNOWN IMPORTED) # Test if(TARGET) command. -IF(NOT TARGET CMakeTestLibrary) - MESSAGE(FATAL_ERROR "IF(NOT TARGET CMakeTestLibrary) returned true!") -ENDIF(NOT TARGET CMakeTestLibrary) -IF(NOT TARGET ExeImportedTarget) - MESSAGE(FATAL_ERROR "IF(NOT TARGET ExeImportedTarget) returned true!") -ENDIF(NOT TARGET ExeImportedTarget) -IF(TARGET LibImportedTarget) - MESSAGE(FATAL_ERROR "IF(TARGET LibImportedTarget) returned true!") -ENDIF(TARGET LibImportedTarget) -IF(TARGET NotATarget) - MESSAGE(FATAL_ERROR "IF(TARGET NotATarget) returned true!") -ENDIF(TARGET NotATarget) +if(NOT TARGET CMakeTestLibrary) + message(FATAL_ERROR "if(NOT TARGET CMakeTestLibrary) returned true!") +endif(NOT TARGET CMakeTestLibrary) +if(NOT TARGET ExeImportedTarget) + message(FATAL_ERROR "if(NOT TARGET ExeImportedTarget) returned true!") +endif(NOT TARGET ExeImportedTarget) +if(TARGET LibImportedTarget) + message(FATAL_ERROR "if(TARGET LibImportedTarget) returned true!") +endif(TARGET LibImportedTarget) +if(TARGET NotATarget) + message(FATAL_ERROR "if(TARGET NotATarget) returned true!") +endif(TARGET NotATarget) # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to -SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) -LINK_LIBRARIES(${COMPLEX_LIBS}) +set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) +link_libraries(${COMPLEX_LIBS}) # Test forcing a .cxx file to not build. -SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES +set_source_files_properties(complex_nobuild.cxx PROPERTIES HEADER_FILE_ONLY 1) # Test forcing a .c file to not build. # This makes sure a mixed language library is created # with header file only sources -SET_SOURCE_FILES_PROPERTIES(complex_nobuild.c PROPERTIES +set_source_files_properties(complex_nobuild.c PROPERTIES HEADER_FILE_ONLY 1) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt) -ADD_CUSTOM_COMMAND(OUTPUT Aout.h COMMAND A > Aout.h VERBATIM) -ADD_EXECUTABLE(complex complex testcflags.c Aout.h) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +add_executable(A A.cxx A.hh A.h A.txt) +add_custom_command(OUTPUT Aout.h COMMAND A > Aout.h VERBATIM) +add_executable(complex complex testcflags.c Aout.h) # Sub1/NameConflictTest.c Sub2/NameConflictTest.c) -ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx +add_executable(complex.file complex.file.cxx complex_nobuild.cxx complex_nobuild.c) -IF (UNIX) - TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS}) -ELSE(UNIX) - IF (NOT BORLAND) - IF(NOT MINGW) - TARGET_LINK_LIBRARIES(complex rpcrt4.lib) - ENDIF(NOT MINGW) - ENDIF(NOT BORLAND) -ENDIF (UNIX) +if (UNIX) + target_link_libraries(complex ${CMAKE_DL_LIBS}) +else(UNIX) + if (NOT BORLAND) + if(NOT MINGW) + target_link_libraries(complex rpcrt4.lib) + endif(NOT MINGW) + endif(NOT BORLAND) +endif (UNIX) # Test linking to static lib when a shared lib has the same name. -IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) - ADD_DEFINITIONS(-DCOMPLEX_TEST_LINK_STATIC) - TARGET_LINK_LIBRARIES(complex CMakeTestLinkStatic) -ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) + add_definitions(-DCOMPLEX_TEST_LINK_STATIC) + target_link_libraries(complex CMakeTestLinkStatic) +endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) # can we get the path to a source file -GET_SOURCE_FILE_PROPERTY(A_LOCATION A.cxx LOCATION) -IF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") - ADD_DEFINITIONS(-DCMAKE_FOUND_ACXX) -ENDIF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") +get_source_file_property(A_LOCATION A.cxx LOCATION) +if ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") + add_definitions(-DCMAKE_FOUND_ACXX) +endif ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") # get the directory parent -GET_DIRECTORY_PROPERTY(P_VALUE PARENT_DIRECTORY) -IF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") - ADD_DEFINITIONS(-DCMAKE_FOUND_PARENT) -ENDIF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") +get_directory_property(P_VALUE PARENT_DIRECTORY) +if ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") + add_definitions(-DCMAKE_FOUND_PARENT) +endif ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") # get the stack of listfiles -INCLUDE(Included.cmake) -IF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") - ADD_DEFINITIONS(-DCMAKE_FOUND_LISTFILE_STACK) -ENDIF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") +include(Included.cmake) +if ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") + add_definitions(-DCMAKE_FOUND_LISTFILE_STACK) +endif ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") # Test add/remove definitions. -ADD_DEFINITIONS( +add_definitions( -DCOMPLEX_DEFINED_PRE -DCOMPLEX_DEFINED -DCOMPLEX_DEFINED_POST -DCOMPLEX_DEFINED ) -REMOVE_DEFINITIONS(-DCOMPLEX_DEFINED) +remove_definitions(-DCOMPLEX_DEFINED) # Test pre-build/pre-link/post-build rules for an executable. -ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD +add_custom_command(TARGET complex PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Executable/prebuild.txt") -ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD +add_custom_command(TARGET complex PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Executable/prelink.txt") -ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD +add_custom_command(TARGET complex POST_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Executable/postbuild.txt") -ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD +add_custom_command(TARGET complex POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy "${Complex_BINARY_DIR}/Executable/postbuild.txt" "${Complex_BINARY_DIR}/Executable/postbuild2.txt") -SET_SOURCE_FILES_PROPERTIES(complex +set_source_files_properties(complex COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS" #" -DFILE_DEFINE_STRING=\\\"hello\\\"" OBJECT_DEPENDS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h ) -SET_TARGET_PROPERTIES(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG") -ADD_CUSTOM_COMMAND( +set_target_properties(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG") +add_custom_command( TARGET complex SOURCE ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in COMMAND ${CMAKE_COMMAND} @@ -121,18 +121,18 @@ ADD_CUSTOM_COMMAND( ) # Test creating an executable that is not built by default. -ADD_EXECUTABLE(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx) -TARGET_LINK_LIBRARIES(notInAllExe notInAllLib) +add_executable(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx) +target_link_libraries(notInAllExe notInAllLib) # Test user-value flag mapping for the VS IDE. -IF(MSVC) - SET_TARGET_PROPERTIES(notInAllExe PROPERTIES +if(MSVC) + set_target_properties(notInAllExe PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT") -ENDIF(MSVC) +endif(MSVC) # Test creating a custom target that builds not-in-all targets. -ADD_CUSTOM_TARGET(notInAllCustom) -ADD_DEPENDENCIES(notInAllCustom notInAllExe) +add_custom_target(notInAllCustom) +add_dependencies(notInAllCustom notInAllExe) # # Output the files required by 'complex' to a file. @@ -141,30 +141,30 @@ ADD_DEPENDENCIES(notInAllCustom notInAllExe) # has no side-effects on the current Makefile (duplicated source file # due to source list expansion done twice). # -ADD_SUBDIRECTORY(Temp) +add_subdirectory(Temp) -IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) - ADD_EXECUTABLE(testSystemDir testSystemDir.cxx) - SET_TARGET_PROPERTIES(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") -ENDIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) +if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) + add_executable(testSystemDir testSystemDir.cxx) + set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") +endif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) # # Extra coverage.Not used. # -INSTALL_TARGETS(/tmp complex) -INSTALL_PROGRAMS(/tmp complex) +install_targets(/tmp complex) +install_programs(/tmp complex) -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/Executable/cmVersion.h.in ${Complex_BINARY_DIR}/cmVersion.h) -SOURCE_GROUP(A_GROUP ".cxx") -SOURCE_GROUP(B_GROUP REGULAR_EXPRESSION "cxx") -SOURCE_GROUP(C_GROUP FILES complex.cxx) +source_group(A_GROUP ".cxx") +source_group(B_GROUP REGULAR_EXPRESSION "cxx") +source_group(C_GROUP FILES complex.cxx) -FILE(WRITE ${Complex_BINARY_DIR}/A/libA.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/A/libC.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/B/libB.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/B/libA.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/C/libC.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/C/libB.a "test") +file(WRITE ${Complex_BINARY_DIR}/A/libA.a "test") +file(WRITE ${Complex_BINARY_DIR}/A/libC.a "test") +file(WRITE ${Complex_BINARY_DIR}/B/libB.a "test") +file(WRITE ${Complex_BINARY_DIR}/B/libA.a "test") +file(WRITE ${Complex_BINARY_DIR}/C/libC.a "test") +file(WRITE ${Complex_BINARY_DIR}/C/libB.a "test") diff --git a/Tests/ComplexOneConfig/Executable/Included.cmake b/Tests/ComplexOneConfig/Executable/Included.cmake index 2d1ea3e8c..520a68be1 100644 --- a/Tests/ComplexOneConfig/Executable/Included.cmake +++ b/Tests/ComplexOneConfig/Executable/Included.cmake @@ -1,2 +1,2 @@ -GET_DIRECTORY_PROPERTY(LF_VALUE LISTFILE_STACK) +get_directory_property(LF_VALUE LISTFILE_STACK) diff --git a/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt index 989765e3a..041fcff20 100644 --- a/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt @@ -3,6 +3,6 @@ # The 'complex' executable will then test if this file exists and remove it. # The contents of this file is not tested (absolute paths). # -OUTPUT_REQUIRED_FILES( +output_required_files( ${Complex_SOURCE_DIR}/Executable/complex.cxx ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt) diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt index becf67207..41faeba4d 100644 --- a/Tests/ComplexOneConfig/Library/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt @@ -1,90 +1,90 @@ -REMOVE_DEFINITIONS(-DCMAKE_IS_REALLY_FUN) +remove_definitions(-DCMAKE_IS_REALLY_FUN) # # Small utility used to create file # UTILITY_SOURCE is used for coverage and for getting the exact name # of the executable. # -UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx) -ADD_EXECUTABLE(create_file create_file.cxx) -SET_TARGET_PROPERTIES(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".") +utility_source(CREATE_FILE_EXE create_file "." create_file.cxx) +add_executable(create_file create_file.cxx) +set_target_properties(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".") # # Create static library # SOURCE_FILES_REMOVE is used for Coverage. empty.h is included for coverage # -AUX_SOURCE_DIRECTORY(ExtraSources LibrarySources) -SET(LibrarySources ${LibrarySources} +aux_source_directory(ExtraSources LibrarySources) +set(LibrarySources ${LibrarySources} file2 empty create_file.cxx GENERATED nonexisting_file) -REMOVE(LibrarySources create_file.cxx GENERATED nonexisting_file) -ADD_LIBRARY(CMakeTestLibrary ${LibrarySources}) +remove(LibrarySources create_file.cxx GENERATED nonexisting_file) +add_library(CMakeTestLibrary ${LibrarySources}) -IF(WIN32) - IF(NOT CYGWIN) - IF(NOT BORLAND) - IF(NOT MINGW) - TARGET_LINK_LIBRARIES(CMakeTestLibrary +if(WIN32) + if(NOT CYGWIN) + if(NOT BORLAND) + if(NOT MINGW) + target_link_libraries(CMakeTestLibrary debug user32.lib) - TARGET_LINK_LIBRARIES(CMakeTestLibrary + target_link_libraries(CMakeTestLibrary optimized kernel32.lib) - ENDIF(NOT MINGW) - ENDIF(NOT BORLAND) - ENDIF(NOT CYGWIN) -ENDIF(WIN32) + endif(NOT MINGW) + endif(NOT BORLAND) + endif(NOT CYGWIN) +endif(WIN32) # # Create shared library # -SET(SharedLibrarySources sharedFile) -ADD_LIBRARY(CMakeTestLibraryShared SHARED ${SharedLibrarySources}) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") -ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c) -DEFINE_PROPERTY( +set(SharedLibrarySources sharedFile) +add_library(CMakeTestLibraryShared SHARED ${SharedLibrarySources}) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") +add_library(CMakeTestCLibraryShared SHARED testConly.c) +define_property( TARGET PROPERTY FOO BRIEF_DOCS "a test property" FULL_DOCS "A simple etst proerty that means nothign and is used for nothing" ) -SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR) -IF(NOT BEOS AND NOT WIN32) # No libm on BeOS. - SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm") -ENDIF(NOT BEOS AND NOT WIN32) -GET_TARGET_PROPERTY(FOO_BAR_VAR CMakeTestCLibraryShared FOO) -IF(${FOO_BAR_VAR} MATCHES "BAR") -ELSE(${FOO_BAR_VAR} MATCHES "BAR") - MESSAGE(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}") -ENDIF(${FOO_BAR_VAR} MATCHES "BAR") +set_target_properties(CMakeTestCLibraryShared PROPERTIES FOO BAR) +if(NOT BEOS AND NOT WIN32) # No libm on BeOS. + set_target_properties(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm") +endif(NOT BEOS AND NOT WIN32) +get_target_property(FOO_BAR_VAR CMakeTestCLibraryShared FOO) +if(${FOO_BAR_VAR} MATCHES "BAR") +else(${FOO_BAR_VAR} MATCHES "BAR") + message(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}") +endif(${FOO_BAR_VAR} MATCHES "BAR") # Create static and shared lib of same name. -IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) - ADD_LIBRARY(CMakeTestLinkStatic STATIC TestLink.c) - ADD_LIBRARY(CMakeTestLinkShared SHARED TestLink.c) - SET_TARGET_PROPERTIES(CMakeTestLinkStatic CMakeTestLinkShared +if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) + add_library(CMakeTestLinkStatic STATIC TestLink.c) + add_library(CMakeTestLinkShared SHARED TestLink.c) + set_target_properties(CMakeTestLinkStatic CMakeTestLinkShared PROPERTIES OUTPUT_NAME CMakeTestLink) -ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) # # Attach pre-build/pre-link/post-build custom-commands to the lib. # Each runs ${CREATE_FILE_EXE} which will create a file. # The 'complex' executable will then test if this file exists and remove it. # -ADD_DEPENDENCIES(CMakeTestLibraryShared create_file) -MESSAGE("complex bin dir is ${Complex_BINARY_DIR}") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD +add_dependencies(CMakeTestLibraryShared create_file) +message("complex bin dir is ${Complex_BINARY_DIR}") +add_custom_command(TARGET CMakeTestLibraryShared PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Library/prebuild.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD +add_custom_command(TARGET CMakeTestLibraryShared PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Library/prelink.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD +add_custom_command(TARGET CMakeTestLibraryShared POST_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Library/postbuild.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD +add_custom_command(TARGET CMakeTestLibraryShared POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy "${Complex_BINARY_DIR}/Library/postbuild.txt" @@ -95,46 +95,46 @@ ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD # It runs ${CREATE_FILE_EXE} which will create a file. # The 'complex' executable will then test if this file exists and remove it. # -ADD_CUSTOM_TARGET(custom_target1 +add_custom_target(custom_target1 ALL ${CREATE_FILE_EXE} "${Complex_BINARY_DIR}/Library/custom_target1.txt") -ADD_DEPENDENCIES(custom_target1 create_file) +add_dependencies(custom_target1 create_file) # # Extra coverage # -SET_SOURCE_FILES_PROPERTIES(file2 PROPERTIES ABSTRACT 1) +set_source_files_properties(file2 PROPERTIES ABSTRACT 1) -INSTALL_FILES(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h) -INSTALL_FILES(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h) +install_files(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h) +install_files(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h) # Test creating a library that is not built by default. -ADD_LIBRARY(notInAllLib EXCLUDE_FROM_ALL notInAllLib.cxx) +add_library(notInAllLib EXCLUDE_FROM_ALL notInAllLib.cxx) # Create an imported target for if(TARGET) test in Executable dir. # That test should not see this target. -ADD_LIBRARY(LibImportedTarget UNKNOWN IMPORTED) +add_library(LibImportedTarget UNKNOWN IMPORTED) # Test generation of preprocessed sources. -IF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) - IF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) +if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) + if(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) # Skip running this part of the test on certain platforms # until they are fixed. - SET(MAYBE_ALL ALL) - LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT) - IF(ARCH_COUNT GREATER 1) + set(MAYBE_ALL ALL) + list(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT) + if(ARCH_COUNT GREATER 1) # OSX does not support preprocessing more than one architecture. - SET(MAYBE_ALL) - ENDIF(ARCH_COUNT GREATER 1) + set(MAYBE_ALL) + endif(ARCH_COUNT GREATER 1) # Custom target to try preprocessing invocation. - ADD_CUSTOM_TARGET(test_preprocess ${MAYBE_ALL} + add_custom_target(test_preprocess ${MAYBE_ALL} COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - ENDIF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) -ENDIF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) + endif(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) +endif("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) diff --git a/Tests/ComplexOneConfig/Library/test_preprocess.cmake b/Tests/ComplexOneConfig/Library/test_preprocess.cmake index d2d9fc652..885c61330 100644 --- a/Tests/ComplexOneConfig/Library/test_preprocess.cmake +++ b/Tests/ComplexOneConfig/Library/test_preprocess.cmake @@ -1,7 +1,7 @@ -SET(TEST_FILE CMakeFiles/create_file.dir/create_file.i) -FILE(READ ${TEST_FILE} CONTENTS) -IF("${CONTENTS}" MATCHES "Unable to close") - MESSAGE(STATUS "${TEST_FILE} created successfully!") -ELSE("${CONTENTS}" MATCHES "Unable to close") - MESSAGE(FATAL_ERROR "${TEST_FILE} creation failed!") -ENDIF("${CONTENTS}" MATCHES "Unable to close") +set(TEST_FILE CMakeFiles/create_file.dir/create_file.i) +file(READ ${TEST_FILE} CONTENTS) +if("${CONTENTS}" MATCHES "Unable to close") + message(STATUS "${TEST_FILE} created successfully!") +else("${CONTENTS}" MATCHES "Unable to close") + message(FATAL_ERROR "${TEST_FILE} creation failed!") +endif("${CONTENTS}" MATCHES "Unable to close") diff --git a/Tests/ComplexOneConfig/VarTests.cmake b/Tests/ComplexOneConfig/VarTests.cmake index c146d1be0..7e968fd62 100644 --- a/Tests/ComplexOneConfig/VarTests.cmake +++ b/Tests/ComplexOneConfig/VarTests.cmake @@ -1,198 +1,198 @@ # # Test SET # -SET (ZERO_VAR 0) -SET (ZERO_VAR2 0) +set (ZERO_VAR 0) +set (ZERO_VAR2 0) -IF(ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED) -ELSE(ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED) -ENDIF(ZERO_VAR) +if(ZERO_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED) +else(ZERO_VAR) + add_definitions(-DSHOULD_BE_DEFINED) +endif(ZERO_VAR) -SET(ONE_VAR 1) -SET(ONE_VAR2 1) -SET(STRING_VAR "CMake is great" CACHE STRING "test a cache variable") +set(ONE_VAR 1) +set(ONE_VAR2 1) +set(STRING_VAR "CMake is great" CACHE STRING "test a cache variable") # # Test VARIABLE_REQUIRES # -VARIABLE_REQUIRES(ONE_VAR +variable_requires(ONE_VAR ONE_VAR_IS_DEFINED ONE_VAR) # # Test various IF/ELSE combinations # -IF(NOT ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT) -ELSE(NOT ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT) -ENDIF(NOT ZERO_VAR) +if(NOT ZERO_VAR) + add_definitions(-DSHOULD_BE_DEFINED_NOT) +else(NOT ZERO_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT) +endif(NOT ZERO_VAR) -IF(NOT ONE_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT2) -ELSE(NOT ONE_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT2) -ENDIF(NOT ONE_VAR) +if(NOT ONE_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT2) +else(NOT ONE_VAR) + add_definitions(-DSHOULD_BE_DEFINED_NOT2) +endif(NOT ONE_VAR) -IF(ONE_VAR AND ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND) -ELSE(ONE_VAR AND ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND) -ENDIF(ONE_VAR AND ONE_VAR2) +if(ONE_VAR AND ONE_VAR2) + add_definitions(-DSHOULD_BE_DEFINED_AND) +else(ONE_VAR AND ONE_VAR2) + add_definitions(-DSHOULD_NOT_BE_DEFINED_AND) +endif(ONE_VAR AND ONE_VAR2) -IF(ONE_VAR AND ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND2) -ELSE(ONE_VAR AND ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND2) -ENDIF(ONE_VAR AND ZERO_VAR) +if(ONE_VAR AND ZERO_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_AND2) +else(ONE_VAR AND ZERO_VAR) + add_definitions(-DSHOULD_BE_DEFINED_AND2) +endif(ONE_VAR AND ZERO_VAR) -IF(ZERO_VAR OR ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR) -ELSE(ZERO_VAR OR ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR) -ENDIF(ZERO_VAR OR ONE_VAR2) +if(ZERO_VAR OR ONE_VAR2) + add_definitions(-DSHOULD_BE_DEFINED_OR) +else(ZERO_VAR OR ONE_VAR2) + add_definitions(-DSHOULD_NOT_BE_DEFINED_OR) +endif(ZERO_VAR OR ONE_VAR2) -IF(ZERO_VAR OR ZERO_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR2) -ELSE(ZERO_VAR OR ZERO_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR2) -ENDIF(ZERO_VAR OR ZERO_VAR2) +if(ZERO_VAR OR ZERO_VAR2) + add_definitions(-DSHOULD_NOT_BE_DEFINED_OR2) +else(ZERO_VAR OR ZERO_VAR2) + add_definitions(-DSHOULD_BE_DEFINED_OR2) +endif(ZERO_VAR OR ZERO_VAR2) -IF(STRING_VAR MATCHES "^CMake") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES) -ELSE(STRING_VAR MATCHES "^CMake") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES) -ENDIF(STRING_VAR MATCHES "^CMake") +if(STRING_VAR MATCHES "^CMake") + add_definitions(-DSHOULD_BE_DEFINED_MATCHES) +else(STRING_VAR MATCHES "^CMake") + add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES) +endif(STRING_VAR MATCHES "^CMake") -IF(STRING_VAR MATCHES "^foo") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES2) -ELSE(STRING_VAR MATCHES "^foo") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES2) -ENDIF(STRING_VAR MATCHES "^foo") +if(STRING_VAR MATCHES "^foo") + add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES2) +else(STRING_VAR MATCHES "^foo") + add_definitions(-DSHOULD_BE_DEFINED_MATCHES2) +endif(STRING_VAR MATCHES "^foo") -IF(COMMAND "IF") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND) -ELSE(COMMAND "IF") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND) -ENDIF(COMMAND "IF") +if(COMMAND "IF") + add_definitions(-DSHOULD_BE_DEFINED_COMMAND) +else(COMMAND "IF") + add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND) +endif(COMMAND "IF") -IF(COMMAND "ROQUEFORT") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND2) -ELSE(COMMAND "ROQUEFORT") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND2) -ENDIF(COMMAND "ROQUEFORT") +if(COMMAND "ROQUEFORT") + add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND2) +else(COMMAND "ROQUEFORT") + add_definitions(-DSHOULD_BE_DEFINED_COMMAND2) +endif(COMMAND "ROQUEFORT") -IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS) -ELSE(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) + add_definitions(-DSHOULD_BE_DEFINED_EXISTS) +else(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) + add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS) +endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) -IF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS2) -ELSE(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS2) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) +if (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) + add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS2) +else(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) + add_definitions(-DSHOULD_BE_DEFINED_EXISTS2) +endif (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) -IF (IS_DIRECTORY ${Complex_SOURCE_DIR}) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY) -ENDIF (IS_DIRECTORY ${Complex_SOURCE_DIR}) +if (IS_DIRECTORY ${Complex_SOURCE_DIR}) + add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY) +endif (IS_DIRECTORY ${Complex_SOURCE_DIR}) -IF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY2) -ENDIF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) +if (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) + add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY2) +endif (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) -SET (SNUM1_VAR "1") -SET (SNUM2_VAR "2") -SET (SNUM3_VAR "1") +set (SNUM1_VAR "1") +set (SNUM2_VAR "2") +set (SNUM3_VAR "1") -IF (SNUM1_VAR LESS SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS) -ELSE (SNUM1_VAR LESS SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS) -ENDIF (SNUM1_VAR LESS SNUM2_VAR) +if (SNUM1_VAR LESS SNUM2_VAR) + add_definitions(-DSHOULD_BE_DEFINED_LESS) +else (SNUM1_VAR LESS SNUM2_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS) +endif (SNUM1_VAR LESS SNUM2_VAR) -IF (SNUM2_VAR LESS SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS2) -ELSE (SNUM2_VAR LESS SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS2) -ENDIF (SNUM2_VAR LESS SNUM1_VAR) +if (SNUM2_VAR LESS SNUM1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS2) +else (SNUM2_VAR LESS SNUM1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_LESS2) +endif (SNUM2_VAR LESS SNUM1_VAR) -IF (SNUM2_VAR GREATER SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER) -ELSE (SNUM2_VAR GREATER SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER) -ENDIF (SNUM2_VAR GREATER SNUM1_VAR) +if (SNUM2_VAR GREATER SNUM1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_GREATER) +else (SNUM2_VAR GREATER SNUM1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER) +endif (SNUM2_VAR GREATER SNUM1_VAR) -IF (SNUM2_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL) -ELSE (SNUM2_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL) -ENDIF (SNUM2_VAR EQUAL SNUM1_VAR) +if (SNUM2_VAR EQUAL SNUM1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) +else (SNUM2_VAR EQUAL SNUM1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_EQUAL) +endif (SNUM2_VAR EQUAL SNUM1_VAR) -IF (SNUM3_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL) -ELSE (SNUM3_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL) -ENDIF (SNUM3_VAR EQUAL SNUM1_VAR) +if (SNUM3_VAR EQUAL SNUM1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_EQUAL) +else (SNUM3_VAR EQUAL SNUM1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) +endif (SNUM3_VAR EQUAL SNUM1_VAR) -IF (SNUM1_VAR GREATER SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER2) -ELSE (SNUM1_VAR GREATER SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER2) -ENDIF (SNUM1_VAR GREATER SNUM2_VAR) +if (SNUM1_VAR GREATER SNUM2_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER2) +else (SNUM1_VAR GREATER SNUM2_VAR) + add_definitions(-DSHOULD_BE_DEFINED_GREATER2) +endif (SNUM1_VAR GREATER SNUM2_VAR) -SET (SSTR1_VAR "abc") -SET (SSTR2_VAR "bcd") +set (SSTR1_VAR "abc") +set (SSTR2_VAR "bcd") -IF (SSTR1_VAR STRLESS SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS) -ELSE (SSTR1_VAR STRLESS SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS) -ENDIF (SSTR1_VAR STRLESS SSTR2_VAR) +if (SSTR1_VAR STRLESS SSTR2_VAR) + add_definitions(-DSHOULD_BE_DEFINED_STRLESS) +else (SSTR1_VAR STRLESS SSTR2_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS) +endif (SSTR1_VAR STRLESS SSTR2_VAR) -IF (SSTR2_VAR STRLESS SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS2) -ELSE (SSTR2_VAR STRLESS SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS2) -ENDIF (SSTR2_VAR STRLESS SSTR1_VAR) +if (SSTR2_VAR STRLESS SSTR1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS2) +else (SSTR2_VAR STRLESS SSTR1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_STRLESS2) +endif (SSTR2_VAR STRLESS SSTR1_VAR) -IF (SSTR2_VAR STRGREATER SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER) -ELSE (SSTR2_VAR STRGREATER SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER) -ENDIF (SSTR2_VAR STRGREATER SSTR1_VAR) +if (SSTR2_VAR STRGREATER SSTR1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_STRGREATER) +else (SSTR2_VAR STRGREATER SSTR1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER) +endif (SSTR2_VAR STRGREATER SSTR1_VAR) -IF (SSTR1_VAR STRGREATER SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER2) -ELSE (SSTR1_VAR STRGREATER SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER2) -ENDIF (SSTR1_VAR STRGREATER SSTR2_VAR) +if (SSTR1_VAR STRGREATER SSTR2_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER2) +else (SSTR1_VAR STRGREATER SSTR2_VAR) + add_definitions(-DSHOULD_BE_DEFINED_STRGREATER2) +endif (SSTR1_VAR STRGREATER SSTR2_VAR) # # Test FOREACH # -FOREACH (INDEX 1 2) - SET(FOREACH_VAR${INDEX} "VALUE${INDEX}") -ENDFOREACH(INDEX) +foreach (INDEX 1 2) + set(FOREACH_VAR${INDEX} "VALUE${INDEX}") +endforeach(INDEX) -SET(FOREACH_CONCAT "") -FOREACH (INDEX a;b;c;d;e;f;g) - SET(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") -ENDFOREACH(INDEX) +set(FOREACH_CONCAT "") +foreach (INDEX a;b;c;d;e;f;g) + set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") +endforeach(INDEX) # # Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations # -FIND_FILE(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR}) +find_file(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR}) -GET_FILENAME_COMPONENT(FILENAME_VAR_PATH ${FILENAME_VAR} PATH) -GET_FILENAME_COMPONENT(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME) -GET_FILENAME_COMPONENT(FILENAME_VAR_NAME ${FILENAME_VAR} NAME) -GET_FILENAME_COMPONENT(FILENAME_VAR_EXT ${FILENAME_VAR} EXT) -GET_FILENAME_COMPONENT(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE) +get_filename_component(FILENAME_VAR_PATH ${FILENAME_VAR} PATH) +get_filename_component(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME) +get_filename_component(FILENAME_VAR_NAME ${FILENAME_VAR} NAME) +get_filename_component(FILENAME_VAR_EXT ${FILENAME_VAR} EXT) +get_filename_component(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE) -FIND_PATH(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR}) -GET_FILENAME_COMPONENT(PATH_VAR_NAME ${PATH_VAR} NAME) +find_path(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR}) +get_filename_component(PATH_VAR_NAME ${PATH_VAR} NAME) diff --git a/Tests/Contracts/Trilinos-10-6/Patch.cmake b/Tests/Contracts/Trilinos-10-6/Patch.cmake index 76051eb98..6c619ac4f 100644 --- a/Tests/Contracts/Trilinos-10-6/Patch.cmake +++ b/Tests/Contracts/Trilinos-10-6/Patch.cmake @@ -14,8 +14,8 @@ set(text " # options to avoid CMake warnings about unused variables # -MESSAGE(\"Trilinos_ALLOW_NO_PACKAGES='\${Trilinos_ALLOW_NO_PACKAGES}'\") -MESSAGE(\"Trilinos_WARNINGS_AS_ERRORS_FLAGS='\${Trilinos_WARNINGS_AS_ERRORS_FLAGS}'\") +message(\"Trilinos_ALLOW_NO_PACKAGES='\${Trilinos_ALLOW_NO_PACKAGES}'\") +message(\"Trilinos_WARNINGS_AS_ERRORS_FLAGS='\${Trilinos_WARNINGS_AS_ERRORS_FLAGS}'\") ") file(APPEND "${source_dir}/CMakeLists.txt" "${text}") @@ -31,8 +31,8 @@ set(text " # Use newer than 10.6.1 CTestConfig settings from the Trilinos project. # Send the Trilinos dashboards to the new Trilinos CDash server instance. # -SET(CTEST_NIGHTLY_START_TIME \"04:00:00 UTC\") # 10 PM MDT or 9 PM MST -SET(CTEST_DROP_SITE \"testing.sandia.gov\") +set(CTEST_NIGHTLY_START_TIME \"04:00:00 UTC\") # 10 PM MDT or 9 PM MST +set(CTEST_DROP_SITE \"testing.sandia.gov\") ") file(APPEND "${source_dir}/CTestConfig.cmake" "${text}") diff --git a/Tests/Contracts/vtk542/RunTest.cmake b/Tests/Contracts/vtk542/RunTest.cmake index 4f48e5cd2..b4bd5b087 100644 --- a/Tests/Contracts/vtk542/RunTest.cmake +++ b/Tests/Contracts/vtk542/RunTest.cmake @@ -1 +1 @@ -SET(vtk542_RUN_TEST VTK-build/bin/CommonCxxTests otherArrays) +set(vtk542_RUN_TEST VTK-build/bin/CommonCxxTests otherArrays) diff --git a/Tests/CrossCompile/CMakeLists.txt b/Tests/CrossCompile/CMakeLists.txt index fb9a0d732..121cb815e 100644 --- a/Tests/CrossCompile/CMakeLists.txt +++ b/Tests/CrossCompile/CMakeLists.txt @@ -1,13 +1,13 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CrossCompile) +project(CrossCompile) -UNSET(run_result CACHE) +unset(run_result CACHE) #Simulate the cross compile condition -SET(CMAKE_CROSSCOMPILING ON) +set(CMAKE_CROSSCOMPILING ON) -ADD_EXECUTABLE(CrossCompile main.c) +add_executable(CrossCompile main.c) -TRY_RUN(run_result compile_result +try_run(run_result compile_result ${CrossCompile_BINARY_DIR} ${CrossCompile_SOURCE_DIR}/main.c) diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index c1d2ae09d..58408d7fe 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -2,22 +2,22 @@ # Wrapping # cmake_minimum_required (VERSION 2.6) -PROJECT (CustomCommand) +project (CustomCommand) -ADD_SUBDIRECTORY(GeneratedHeader) +add_subdirectory(GeneratedHeader) # # Lib and exe path # -IF(NOT DEFINED bin_dir) - SET(bin_dir "bin") -ENDIF() +if(NOT DEFINED bin_dir) + set(bin_dir "bin") +endif() -SET (LIBRARY_OUTPUT_PATH +set (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/${bin_dir} CACHE INTERNAL "Single output directory for building all libraries.") -SET (EXECUTABLE_OUTPUT_PATH +set (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/${bin_dir} CACHE INTERNAL "Single output directory for building all executables.") @@ -27,10 +27,10 @@ SET (EXECUTABLE_OUTPUT_PATH # ################################################################ # add the executable that will generate the file -ADD_EXECUTABLE(generator generator.cxx) +add_executable(generator generator.cxx) -GET_TARGET_PROPERTY(generator_PATH generator LOCATION) -MESSAGE("Location ${generator_PATH}") +get_target_property(generator_PATH generator LOCATION) +message("Location ${generator_PATH}") ################################################################ # @@ -38,9 +38,9 @@ MESSAGE("Location ${generator_PATH}") # ################################################################ # add the executable that will generate the file -ADD_EXECUTABLE(wrapper wrapper.cxx) +add_executable(wrapper wrapper.cxx) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${PROJECT_BINARY_DIR}/wrapped.c ${PROJECT_BINARY_DIR}/wrapped_help.c DEPENDS wrapper MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/wrapped.h @@ -55,19 +55,19 @@ ADD_CUSTOM_COMMAND( # Test creating files from a custom target # ################################################################ -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}//doc1.dvi # test 2 slashes +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}//doc1.dvi # test 2 slashes DEPENDS ${PROJECT_SOURCE_DIR}/doc1.tex COMMAND ${CMAKE_COMMAND} ARGS -E copy ${PROJECT_SOURCE_DIR}/doc1.tex ${PROJECT_BINARY_DIR}/doc1.dvi ) -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h COMMAND ${CMAKE_COMMAND} -E echo " Copying doc1.dvi to doc1temp.h." COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1.dvi ${PROJECT_BINARY_DIR}/doc1temp.h ) -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h APPEND +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h APPEND DEPENDS ${PROJECT_BINARY_DIR}/doc1.dvi COMMAND ${CMAKE_COMMAND} -E echo " Copying doc1temp.h to doc1.h." COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1temp.h @@ -77,7 +77,7 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h APPEND ) # Add custom command to generate foo.h. -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.h +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/foo.h DEPENDS ${PROJECT_SOURCE_DIR}/foo.h.in COMMAND ${CMAKE_COMMAND} -E echo " Copying foo.h.in to foo.h." COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/foo.h.in @@ -85,12 +85,12 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.h ) # Add the location of foo.h to the include path. -INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}) +include_directories(${PROJECT_BINARY_DIR}) # Test generation of a file to the build tree without full path. As # of CMake 2.6 custom command outputs specified by relative path go in # the build tree. -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT doc1.txt COMMAND ${CMAKE_COMMAND} -E echo "Example Document Target" > doc1.txt DEPENDS doc1.tex @@ -98,7 +98,7 @@ ADD_CUSTOM_COMMAND( ) # Add a custom target to drive generation of doc1.h. -ADD_CUSTOM_TARGET(TDocument ALL +add_custom_target(TDocument ALL COMMAND ${CMAKE_COMMAND} -E echo " Copying doc1.h to doc2.h." COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1.h ${PROJECT_BINARY_DIR}/doc2.h @@ -109,13 +109,13 @@ ADD_CUSTOM_TARGET(TDocument ALL # Setup a pre- and post-build pair that will fail if not run in the # proper order. -ADD_CUSTOM_COMMAND( +add_custom_command( TARGET TDocument PRE_BUILD COMMAND ${CMAKE_COMMAND} -E echo " Writing doc1pre.txt." COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/doc1.tex ${PROJECT_BINARY_DIR}/doc1pre.txt COMMENT "Running TDocument pre-build commands" ) -ADD_CUSTOM_COMMAND( +add_custom_command( TARGET TDocument POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo " Copying doc1pre.txt to doc2post.txt." COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1pre.txt @@ -128,7 +128,7 @@ ADD_CUSTOM_COMMAND( # Test using a multistep generated file # ################################################################ -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.pre +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/foo.pre DEPENDS ${PROJECT_SOURCE_DIR}/foo.in TDocument # Ensure doc1.h generates before this target COMMAND ${CMAKE_COMMAND} @@ -136,7 +136,7 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.pre ${PROJECT_BINARY_DIR}/foo.pre ) -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.c +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/foo.c DEPENDS ${PROJECT_BINARY_DIR}/foo.pre COMMAND ${CMAKE_COMMAND} ARGS -E copy ${PROJECT_BINARY_DIR}/foo.pre @@ -147,21 +147,21 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.c # file that is not included by any source in this project. This will # test whether all custom command outputs explicitly listed as sources # get generated even if they are not needed by an object file. -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/not_included.h +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/not_included.h DEPENDS ${PROJECT_SOURCE_DIR}/foo.h.in COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/foo.h.in ${PROJECT_BINARY_DIR}/not_included.h ) # Tell the executable where to find not_included.h. -CONFIGURE_FILE( +configure_file( ${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h @ONLY IMMEDIATE ) # add the executable -ADD_EXECUTABLE(CustomCommand +add_executable(CustomCommand ${PROJECT_BINARY_DIR}/foo.h ${PROJECT_BINARY_DIR}/foo.c ${PROJECT_BINARY_DIR}/wrapped.c @@ -174,44 +174,44 @@ ADD_EXECUTABLE(CustomCommand # Add the rule to create generated.c at build time. This is placed # here to test adding the generation rule after referencing the # generated source in a target. -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/generated.c +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/generated.c DEPENDS generator COMMAND ${generator_PATH} ARGS ${PROJECT_BINARY_DIR}/generated.c ) -TARGET_LINK_LIBRARIES(CustomCommand GeneratedHeader) +target_link_libraries(CustomCommand GeneratedHeader) ############################################################################## # Test for using just the target name as executable in the COMMAND # section. Has to be recognized and replaced by CMake with the output # actual location of the executable. # Additionally the generator is created in an extra subdir after the -# ADD_CUSTOM_COMMAND() is used. +# add_custom_command() is used. # -# Test the same for ADD_CUSTOM_TARGET() +# Test the same for add_custom_target() -ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx COMMAND generator_extern ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx ) -ADD_EXECUTABLE(CustomCommandUsingTargetTest main.cxx ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx ) +add_executable(CustomCommandUsingTargetTest main.cxx ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx ) -ADD_CUSTOM_TARGET(RunTarget +add_custom_target(RunTarget COMMAND generator_extern ${CMAKE_CURRENT_BINARY_DIR}/run_target.cxx ) -ADD_CUSTOM_COMMAND(TARGET CustomCommandUsingTargetTest POST_BUILD +add_custom_command(TARGET CustomCommandUsingTargetTest POST_BUILD COMMAND dummy_generator ${CMAKE_CURRENT_BINARY_DIR}/generated_dummy.cxx) -ADD_SUBDIRECTORY(GeneratorInExtraDir) +add_subdirectory(GeneratorInExtraDir) ############################################################################## # Test shell operators in custom commands. -ADD_EXECUTABLE(tcat tcat.cxx) +add_executable(tcat tcat.cxx) -ADD_CUSTOM_COMMAND(OUTPUT gen_redirect.c +add_custom_command(OUTPUT gen_redirect.c DEPENDS tcat gen_redirect_in.c COMMAND tcat < ${CMAKE_CURRENT_SOURCE_DIR}/gen_redirect_in.c > gen_redirect.c COMMAND ${CMAKE_COMMAND} -E echo "#endif" >> gen_redirect.c @@ -220,12 +220,12 @@ ADD_CUSTOM_COMMAND(OUTPUT gen_redirect.c ############################################################################## # Test non-trivial command line arguments in custom commands. -SET(EXPECTED_ARGUMENTS) -SET(CHECK_ARGS) -IF(NOT MSVC71) - SET(CHECK_ARGS -DPATH=c:/posix/path) -ENDIF() -SET(CHECK_ARGS +set(EXPECTED_ARGUMENTS) +set(CHECK_ARGS) +if(NOT MSVC71) + set(CHECK_ARGS -DPATH=c:/posix/path) +endif() +set(CHECK_ARGS ${CHECK_ARGS} c:/posix/path c:\\windows\\path @@ -333,11 +333,11 @@ SET(CHECK_ARGS "one#pound w s" ~ ` ! @ \# $ % ^ & _ - + = : "\;" \" ' , . ? "(" ")" { } [] ) -IF(NOT MINGW) +if(NOT MINGW) # * # MinGW programs on windows always expands the wildcard! # / # MSys make converts a leading slash to the mingw home directory - LIST(APPEND CHECK_ARGS * /) -ENDIF(NOT MINGW) + list(APPEND CHECK_ARGS * /) +endif(NOT MINGW) # The windows command shell does not support a double quote by itself: # double\"quote @@ -352,25 +352,25 @@ ENDIF(NOT MINGW) # | < > << >> &> 2>&1 1>&2 # to allow custom commands to perform redirection. -FOREACH(arg ${CHECK_ARGS} "") - SET(ARG "${arg}") - STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ARG "${ARG}") - STRING(REGEX REPLACE "\"" "\\\\\"" ARG "${ARG}") - SET(EXPECTED_ARGUMENTS +foreach(arg ${CHECK_ARGS} "") + set(ARG "${arg}") + string(REGEX REPLACE "\\\\" "\\\\\\\\" ARG "${ARG}") + string(REGEX REPLACE "\"" "\\\\\"" ARG "${ARG}") + set(EXPECTED_ARGUMENTS "${EXPECTED_ARGUMENTS} \"${ARG}\", ") -ENDFOREACH(arg) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in +endforeach(arg) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c @ONLY IMMEDIATE) -ADD_EXECUTABLE(check_command_line +add_executable(check_command_line ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c) -SET(output_name "check_command_line") -SET_PROPERTY(TARGET check_command_line +set(output_name "check_command_line") +set_property(TARGET check_command_line PROPERTY OUTPUT_NAME ${output_name}) -# SET_TARGET_PROPERTIES(check_command_line PROPERTIES +# set_target_properties(check_command_line PROPERTIES # COMPILE_FLAGS -DCHECK_COMMAND_LINE_VERBOSE) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/command_line_check COMMAND ${CMAKE_COMMAND} -DMARK_FILE=${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt -P ${CMAKE_CURRENT_SOURCE_DIR}/check_mark.cmake @@ -379,9 +379,9 @@ ADD_CUSTOM_COMMAND( VERBATIM COMMENT "Checking custom command line escapes (single'quote)" ) -SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/command_line_check +set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/command_line_check PROPERTIES SYMBOLIC 1) -ADD_CUSTOM_TARGET(do_check_command_line ALL +add_custom_target(do_check_command_line ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/command_line_check COMMAND ${CMAKE_COMMAND} -E echo "Checking custom target command escapes" COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/${output_name} @@ -389,12 +389,12 @@ ADD_CUSTOM_TARGET(do_check_command_line ALL VERBATIM COMMENT "Checking custom target command line escapes ($dollar-signs$)" ) -ADD_DEPENDENCIES(do_check_command_line check_command_line) +add_dependencies(do_check_command_line check_command_line) -ADD_CUSTOM_TARGET(pre_check_command_line +add_custom_target(pre_check_command_line COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt ) -ADD_DEPENDENCIES(do_check_command_line pre_check_command_line) +add_dependencies(do_check_command_line pre_check_command_line) # # @@ -405,34 +405,34 @@ ADD_DEPENDENCIES(do_check_command_line pre_check_command_line) # At first, this reproduces a bug reported by a customer. After fixing it, # having this test here makes sure it stays fixed moving forward. # -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT SameName1.txt COMMAND ${CMAKE_COMMAND} -E touch SameName1.txt ) -ADD_CUSTOM_TARGET(SameName ALL +add_custom_target(SameName ALL DEPENDS SameName1.txt ) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/subdir/SameName COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/subdir COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/subdir/SameName ) -ADD_CUSTOM_TARGET(DifferentName ALL +add_custom_target(DifferentName ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/subdir/SameName ) # # # Per-config target name and generator expressions. -ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig) -ADD_CUSTOM_COMMAND( +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig) +add_custom_command( OUTPUT perconfig.out COMMAND ${PerConfig_COMMAND} DEPENDS ${PerConfig_DEPENDS} VERBATIM ) -SET_PROPERTY(SOURCE perconfig.out PROPERTY SYMBOLIC 1) -ADD_CUSTOM_TARGET(perconfig_target ALL +set_property(SOURCE perconfig.out PROPERTY SYMBOLIC 1) +add_custom_target(perconfig_target ALL COMMAND ${CMAKE_COMMAND} -E echo "perconfig=$" "config=$" DEPENDS perconfig.out) diff --git a/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt b/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt index 2ba8e68c1..f7308e890 100644 --- a/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt +++ b/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt @@ -1,13 +1,13 @@ # Simulate in-source build include-file behavior for out-of-source # builds. -SET(CMAKE_INCLUDE_CURRENT_DIR 1) +set(CMAKE_INCLUDE_CURRENT_DIR 1) -ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.h +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.h COMMAND ${CMAKE_COMMAND} ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/generated.h.in ${CMAKE_CURRENT_BINARY_DIR}/generated.h ) -ADD_LIBRARY(GeneratedHeader main.cpp ${CMAKE_CURRENT_BINARY_DIR}/generated.h) +add_library(GeneratedHeader main.cpp ${CMAKE_CURRENT_BINARY_DIR}/generated.h) diff --git a/Tests/CustomCommand/GeneratorInExtraDir/CMakeLists.txt b/Tests/CustomCommand/GeneratorInExtraDir/CMakeLists.txt index 195a47792..04506db3b 100644 --- a/Tests/CustomCommand/GeneratorInExtraDir/CMakeLists.txt +++ b/Tests/CustomCommand/GeneratorInExtraDir/CMakeLists.txt @@ -1,8 +1,8 @@ -ADD_DEFINITIONS(-DGENERATOR_EXTERN) +add_definitions(-DGENERATOR_EXTERN) # add the executable which will be used for generating files -ADD_EXECUTABLE(generator_extern ../generator.cxx) -SET_TARGET_PROPERTIES(generator_extern PROPERTIES OUTPUT_NAME the_external_generator) +add_executable(generator_extern ../generator.cxx) +set_target_properties(generator_extern PROPERTIES OUTPUT_NAME the_external_generator) -# add an executable which will be called from ADD_CUSTOM_COMMAND( ... POST_BUILD) -ADD_EXECUTABLE(dummy_generator ../generator.cxx) +# add an executable which will be called from add_custom_command( ... POST_BUILD) +add_executable(dummy_generator ../generator.cxx) diff --git a/Tests/CustomCommand/check_mark.cmake b/Tests/CustomCommand/check_mark.cmake index 8b0551f83..f8638d4ac 100644 --- a/Tests/CustomCommand/check_mark.cmake +++ b/Tests/CustomCommand/check_mark.cmake @@ -1,5 +1,5 @@ -IF(EXISTS "${MARK_FILE}") - MESSAGE(FATAL_ERROR "Custom command run more than once!") -ELSE(EXISTS "${MARK_FILE}") - FILE(WRITE "${MARK_FILE}" "check for running custom command twice\n") -ENDIF(EXISTS "${MARK_FILE}") +if(EXISTS "${MARK_FILE}") + message(FATAL_ERROR "Custom command run more than once!") +else(EXISTS "${MARK_FILE}") + file(WRITE "${MARK_FILE}" "check for running custom command twice\n") +endif(EXISTS "${MARK_FILE}") diff --git a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt index f64706485..f917cd7f3 100644 --- a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt +++ b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt @@ -1,28 +1,28 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(TestWorkingDir) +project(TestWorkingDir) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT "${TestWorkingDir_BINARY_DIR}/working.c" COMMAND "${CMAKE_COMMAND}" -E copy ./working.c.in "${TestWorkingDir_BINARY_DIR}/working.c" WORKING_DIRECTORY "${TestWorkingDir_SOURCE_DIR}" COMMENT "custom command" ) -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( "${TestWorkingDir_BINARY_DIR}/customTarget.c" "${TestWorkingDir_BINARY_DIR}/customTarget2.c" PROPERTIES GENERATED 1) -ADD_EXECUTABLE(working "${TestWorkingDir_BINARY_DIR}/working.c" +add_executable(working "${TestWorkingDir_BINARY_DIR}/working.c" "${TestWorkingDir_BINARY_DIR}/customTarget.c") -ADD_CUSTOM_TARGET( +add_custom_target( Custom ALL COMMAND "${CMAKE_COMMAND}" -E copy_if_different ./customTarget.c "${TestWorkingDir_BINARY_DIR}/customTarget.c" WORKING_DIRECTORY "${TestWorkingDir_SOURCE_DIR}" ) -ADD_DEPENDENCIES(working Custom) +add_dependencies(working Custom) file(MAKE_DIRECTORY ${TestWorkingDir_BINARY_DIR}/work) add_custom_command( diff --git a/Tests/Dependency/1/CMakeLists.txt b/Tests/Dependency/1/CMakeLists.txt index b50b2e9c5..a8e74e40b 100644 --- a/Tests/Dependency/1/CMakeLists.txt +++ b/Tests/Dependency/1/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_LIBRARY( One OneSrc.c ) +add_library( One OneSrc.c ) # This library has no dependencies -TARGET_LINK_LIBRARIES( One "" ) +target_link_libraries( One "" ) diff --git a/Tests/Dependency/CMakeLists.txt b/Tests/Dependency/CMakeLists.txt index 86e128f58..ef4204803 100644 --- a/Tests/Dependency/CMakeLists.txt +++ b/Tests/Dependency/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 2.6) -PROJECT( Dependency ) +project( Dependency ) # to test directories with only one character One was changed to 1 # There is one executable that depends on eight libraries. The @@ -29,25 +29,25 @@ PROJECT( Dependency ) # Although SixB does not depend on Two, there is a dependency listed # in the corresponding CMakeLists.txt just because of commands used. -ADD_SUBDIRECTORY(NoDepA) -ADD_SUBDIRECTORY(NoDepB) -ADD_SUBDIRECTORY(NoDepC) -ADD_SUBDIRECTORY(1) -ADD_SUBDIRECTORY(Two) -ADD_SUBDIRECTORY(Three) -ADD_SUBDIRECTORY(Four) -ADD_SUBDIRECTORY(Five) -ADD_SUBDIRECTORY(Six) -ADD_SUBDIRECTORY(Seven) -ADD_SUBDIRECTORY(Eight) -ADD_SUBDIRECTORY(Exec) -ADD_SUBDIRECTORY(Exec2) -ADD_SUBDIRECTORY(Exec3) -ADD_SUBDIRECTORY(Exec4) +add_subdirectory(NoDepA) +add_subdirectory(NoDepB) +add_subdirectory(NoDepC) +add_subdirectory(1) +add_subdirectory(Two) +add_subdirectory(Three) +add_subdirectory(Four) +add_subdirectory(Five) +add_subdirectory(Six) +add_subdirectory(Seven) +add_subdirectory(Eight) +add_subdirectory(Exec) +add_subdirectory(Exec2) +add_subdirectory(Exec3) +add_subdirectory(Exec4) # Specific cases added to test fixes to problems found in real # projects. -ADD_SUBDIRECTORY(Case1) -ADD_SUBDIRECTORY(Case2) -ADD_SUBDIRECTORY(Case3) -ADD_SUBDIRECTORY(Case4) +add_subdirectory(Case1) +add_subdirectory(Case2) +add_subdirectory(Case3) +add_subdirectory(Case4) diff --git a/Tests/Dependency/Eight/CMakeLists.txt b/Tests/Dependency/Eight/CMakeLists.txt index 5d8e7564e..db5e2dfb5 100644 --- a/Tests/Dependency/Eight/CMakeLists.txt +++ b/Tests/Dependency/Eight/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_LIBRARY( Eight EightSrc.c ) -TARGET_LINK_LIBRARIES( Eight Seven ) +add_library( Eight EightSrc.c ) +target_link_libraries( Eight Seven ) diff --git a/Tests/Dependency/Exec/CMakeLists.txt b/Tests/Dependency/Exec/CMakeLists.txt index 97fffe706..a9206857f 100644 --- a/Tests/Dependency/Exec/CMakeLists.txt +++ b/Tests/Dependency/Exec/CMakeLists.txt @@ -1,7 +1,7 @@ # This executable directly depends on NoDepB, NoDepC, SixA and SixB. However, # since NoDepB and NoDepC do not have explicit dependency information, # and they depend on NoDepA, we have to manually specify that dependency. -LINK_LIBRARIES( NoDepB NoDepC NoDepA SixB SixA ) +link_libraries( NoDepB NoDepC NoDepA SixB SixA ) -ADD_EXECUTABLE( exec ExecMain.c ) +add_executable( exec ExecMain.c ) diff --git a/Tests/Dependency/Exec2/CMakeLists.txt b/Tests/Dependency/Exec2/CMakeLists.txt index 84d630ae1..04d6fe810 100644 --- a/Tests/Dependency/Exec2/CMakeLists.txt +++ b/Tests/Dependency/Exec2/CMakeLists.txt @@ -6,7 +6,7 @@ # Now, we must make sure that Seven gets inserted between Five and Two, and # not at the end. Unfortunately, if we get it wrong, the test will only # fail on a platform where the link order makes a difference. -LINK_LIBRARIES( Eight Five ) +link_libraries( Eight Five ) -ADD_EXECUTABLE( exec2 ExecMain.c ) +add_executable( exec2 ExecMain.c ) diff --git a/Tests/Dependency/Exec3/CMakeLists.txt b/Tests/Dependency/Exec3/CMakeLists.txt index b33e732a2..605fbc9f1 100644 --- a/Tests/Dependency/Exec3/CMakeLists.txt +++ b/Tests/Dependency/Exec3/CMakeLists.txt @@ -1,6 +1,6 @@ # Here, Five already has it's immediate dependency, Two satisfied. We must # make sure Two gets output anyway, because Eight indirectly depends on it. -LINK_LIBRARIES( Five Two Eight Five ) +link_libraries( Five Two Eight Five ) -ADD_EXECUTABLE( exec3 ExecMain.c ) +add_executable( exec3 ExecMain.c ) diff --git a/Tests/Dependency/Exec4/CMakeLists.txt b/Tests/Dependency/Exec4/CMakeLists.txt index 6fcb15383..94c6bf588 100644 --- a/Tests/Dependency/Exec4/CMakeLists.txt +++ b/Tests/Dependency/Exec4/CMakeLists.txt @@ -1,6 +1,6 @@ # Even though Five's dependency on Two is explicitly satisfied, Two # must be emitted again in order to satisfy a cyclic dependency on Three. -LINK_LIBRARIES( Five Two Five ) +link_libraries( Five Two Five ) -ADD_EXECUTABLE( exec4 ExecMain.c ) +add_executable( exec4 ExecMain.c ) diff --git a/Tests/Dependency/Five/CMakeLists.txt b/Tests/Dependency/Five/CMakeLists.txt index 27f6a1f5b..19c1c77d3 100644 --- a/Tests/Dependency/Five/CMakeLists.txt +++ b/Tests/Dependency/Five/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_LIBRARY( Five FiveSrc.c ) -TARGET_LINK_LIBRARIES( Five Two ) +add_library( Five FiveSrc.c ) +target_link_libraries( Five Two ) diff --git a/Tests/Dependency/Four/CMakeLists.txt b/Tests/Dependency/Four/CMakeLists.txt index df0f1624e..71c531fe9 100644 --- a/Tests/Dependency/Four/CMakeLists.txt +++ b/Tests/Dependency/Four/CMakeLists.txt @@ -1,6 +1,6 @@ -INCLUDE_DIRECTORIES(${Dependency_BINARY_DIR}/Two) -ADD_LIBRARY( Four FourSrc.c ) -TARGET_LINK_LIBRARIES( Four One Two NoDepA ) +include_directories(${Dependency_BINARY_DIR}/Two) +add_library( Four FourSrc.c ) +target_link_libraries( Four One Two NoDepA ) # TwoCustom must build before Four. -ADD_DEPENDENCIES(Four TwoCustom) +add_dependencies(Four TwoCustom) diff --git a/Tests/Dependency/NoDepA/CMakeLists.txt b/Tests/Dependency/NoDepA/CMakeLists.txt index cedf185fa..543402d9d 100644 --- a/Tests/Dependency/NoDepA/CMakeLists.txt +++ b/Tests/Dependency/NoDepA/CMakeLists.txt @@ -1 +1 @@ -ADD_LIBRARY( NoDepA NoDepASrc.c ) +add_library( NoDepA NoDepASrc.c ) diff --git a/Tests/Dependency/NoDepB/CMakeLists.txt b/Tests/Dependency/NoDepB/CMakeLists.txt index 0d69f6841..1c70f375c 100644 --- a/Tests/Dependency/NoDepB/CMakeLists.txt +++ b/Tests/Dependency/NoDepB/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_LIBRARY( NoDepB NoDepBSrc.c ) +add_library( NoDepB NoDepBSrc.c ) # This library depends on NoDepA, but the # dependency is not explicitly specified. diff --git a/Tests/Dependency/NoDepC/CMakeLists.txt b/Tests/Dependency/NoDepC/CMakeLists.txt index 88b29ba6f..dd41cebb6 100644 --- a/Tests/Dependency/NoDepC/CMakeLists.txt +++ b/Tests/Dependency/NoDepC/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_LIBRARY( NoDepC NoDepCSrc.c ) +add_library( NoDepC NoDepCSrc.c ) # This library depends on NoDepA, but the # dependency is not explicitly specified. diff --git a/Tests/Dependency/Seven/CMakeLists.txt b/Tests/Dependency/Seven/CMakeLists.txt index 51a38d8ed..7fba55cb9 100644 --- a/Tests/Dependency/Seven/CMakeLists.txt +++ b/Tests/Dependency/Seven/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_LIBRARY( Seven SevenSrc.c ) -TARGET_LINK_LIBRARIES( Seven Two ) +add_library( Seven SevenSrc.c ) +target_link_libraries( Seven Two ) diff --git a/Tests/Dependency/Six/CMakeLists.txt b/Tests/Dependency/Six/CMakeLists.txt index d0abdd695..db12051e2 100644 --- a/Tests/Dependency/Six/CMakeLists.txt +++ b/Tests/Dependency/Six/CMakeLists.txt @@ -2,11 +2,11 @@ # use an all-encompassing LINK_LIBRARIES. And sometimes they don't # specify them in the correct order. -LINK_LIBRARIES( Two ) -LINK_LIBRARIES( Five ) +link_libraries( Two ) +link_libraries( Five ) -ADD_LIBRARY( SixA SixASrc.c ) +add_library( SixA SixASrc.c ) -ADD_LIBRARY( SixB SixBSrc.c ) -TARGET_LINK_LIBRARIES( SixB Four ) +add_library( SixB SixBSrc.c ) +target_link_libraries( SixB Four ) diff --git a/Tests/Dependency/Three/CMakeLists.txt b/Tests/Dependency/Three/CMakeLists.txt index 6b20dcb81..3897f0cdd 100644 --- a/Tests/Dependency/Three/CMakeLists.txt +++ b/Tests/Dependency/Three/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_LIBRARY( Three ThreeSrc.c ) -TARGET_LINK_LIBRARIES( Three One Four ) +add_library( Three ThreeSrc.c ) +target_link_libraries( Three One Four ) diff --git a/Tests/Dependency/Two/CMakeLists.txt b/Tests/Dependency/Two/CMakeLists.txt index 587c848f7..19a070328 100644 --- a/Tests/Dependency/Two/CMakeLists.txt +++ b/Tests/Dependency/Two/CMakeLists.txt @@ -1,20 +1,20 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -ADD_LIBRARY( Two TwoSrc.c ) -TARGET_LINK_LIBRARIES( Two Three ) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +add_library( Two TwoSrc.c ) +target_link_libraries( Two Three ) # Setup a target to cause failure if Two does not depend on it or if # Two actually links to it. This will test that a utility dependency # on a library target works properly. -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/two-test.h COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/two-test.h.in ${CMAKE_CURRENT_BINARY_DIR}/two-test.h DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/two-test.h.in ) -ADD_LIBRARY( TwoCustom TwoCustomSrc.c ${CMAKE_CURRENT_BINARY_DIR}/two-test.h) -SET_TARGET_PROPERTIES(TwoCustom PROPERTIES EXCLUDE_FROM_ALL 1) -TARGET_LINK_LIBRARIES(TwoCustom Three) +add_library( TwoCustom TwoCustomSrc.c ${CMAKE_CURRENT_BINARY_DIR}/two-test.h) +set_target_properties(TwoCustom PROPERTIES EXCLUDE_FROM_ALL 1) +target_link_libraries(TwoCustom Three) # Add a utility dependency to make sure it works without linking. -ADD_DEPENDENCIES(Two TwoCustom) +add_dependencies(Two TwoCustom) diff --git a/Tests/EnforceConfig.cmake.in b/Tests/EnforceConfig.cmake.in index c9028a391..27ee1fdd9 100644 --- a/Tests/EnforceConfig.cmake.in +++ b/Tests/EnforceConfig.cmake.in @@ -1,26 +1,26 @@ # Choose a configuration with which to drive CTest tests. -IF(CTEST_CONFIGURATION_TYPE) - SET(CTestTest_CONFIG "${CTEST_CONFIGURATION_TYPE}") -ELSE(CTEST_CONFIGURATION_TYPE) - SET(CTestTest_CONFIG "@CTestTest_CONFIG@") -ENDIF(CTEST_CONFIGURATION_TYPE) +if(CTEST_CONFIGURATION_TYPE) + set(CTestTest_CONFIG "${CTEST_CONFIGURATION_TYPE}") +else(CTEST_CONFIGURATION_TYPE) + set(CTestTest_CONFIG "@CTestTest_CONFIG@") +endif(CTEST_CONFIGURATION_TYPE) # Choose a configuration that was built if none is given. -IF(NOT CTEST_CONFIGURATION_TYPE) - SET(CTEST_CMD "@CMAKE_CTEST_COMMAND@@CMAKE_EXECUTABLE_SUFFIX@") - GET_FILENAME_COMPONENT(CTEST_DIR "${CTEST_CMD}" PATH) - GET_FILENAME_COMPONENT(CTEST_EXE "${CTEST_CMD}" NAME) - FOREACH(cfg Release Debug MinSizeRel RelWithDebInfo) - IF(NOT CTEST_CONFIGURATION_TYPE) - IF(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}") - SET(CTEST_CONFIGURATION_TYPE ${cfg}) - ENDIF(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}") - ENDIF(NOT CTEST_CONFIGURATION_TYPE) - ENDFOREACH(cfg) - IF(NOT CTEST_CONFIGURATION_TYPE) - SET(CTEST_CONFIGURATION_TYPE NoConfig) - ENDIF(NOT CTEST_CONFIGURATION_TYPE) - MESSAGE("Guessing configuration ${CTEST_CONFIGURATION_TYPE}") -ENDIF(NOT CTEST_CONFIGURATION_TYPE) +if(NOT CTEST_CONFIGURATION_TYPE) + set(CTEST_CMD "@CMAKE_CTEST_COMMAND@@CMAKE_EXECUTABLE_SUFFIX@") + get_filename_component(CTEST_DIR "${CTEST_CMD}" PATH) + get_filename_component(CTEST_EXE "${CTEST_CMD}" NAME) + foreach(cfg Release Debug MinSizeRel RelWithDebInfo) + if(NOT CTEST_CONFIGURATION_TYPE) + if(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}") + set(CTEST_CONFIGURATION_TYPE ${cfg}) + endif(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}") + endif(NOT CTEST_CONFIGURATION_TYPE) + endforeach(cfg) + if(NOT CTEST_CONFIGURATION_TYPE) + set(CTEST_CONFIGURATION_TYPE NoConfig) + endif(NOT CTEST_CONFIGURATION_TYPE) + message("Guessing configuration ${CTEST_CONFIGURATION_TYPE}") +endif(NOT CTEST_CONFIGURATION_TYPE) @TEST_HOME_ENV_CODE@ diff --git a/Tests/ExportImport/InitialCache.cmake.in b/Tests/ExportImport/InitialCache.cmake.in index 4893f7020..98d355f8f 100644 --- a/Tests/ExportImport/InitialCache.cmake.in +++ b/Tests/ExportImport/InitialCache.cmake.in @@ -1,15 +1,15 @@ -SET(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE STRING "C Compiler") -SET(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@" CACHE STRING "C Flags") -SET(CMAKE_C_FLAGS_DEBUG "@CMAKE_C_FLAGS_DEBUG@" CACHE STRING "C Flags") -SET(CMAKE_C_FLAGS_RELEASE "@CMAKE_C_FLAGS_RELEASE@" CACHE STRING "C Flags") -SET(CMAKE_C_FLAGS_MINSIZEREL "@CMAKE_C_FLAGS_MINSIZEREL@" CACHE STRING "C Flags") -SET(CMAKE_C_FLAGS_RELWITHDEBINFO "@CMAKE_C_FLAGS_RELWITHDEBINFO@" CACHE STRING "C Flags") -SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@" CACHE STRING "C++ Compiler") -SET(CMAKE_CXX_FLAGS "@CMAKE_CXX_FLAGS@" CACHE STRING "C++ Flags") -SET(CMAKE_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@" CACHE STRING "C++ Flags") -SET(CMAKE_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@" CACHE STRING "C++ Flags") -SET(CMAKE_CXX_FLAGS_MINSIZEREL "@CMAKE_CXX_FLAGS_MINSIZEREL@" CACHE STRING "C++ Flags") -SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@" CACHE STRING "C++ Flags") -SET(CMAKE_INSTALL_PREFIX "@ExportImport_BINARY_DIR@/Root" CACHE STRING "Installation Prefix") -SET(CMAKE_SKIP_RPATH ON CACHE BOOL "No RPATH") -SET(CMAKE_GNUtoMS "@ExportImport_GNUtoMS@" CACHE BOOL "CMAKE_GNUtoMS") +set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE STRING "C Compiler") +set(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@" CACHE STRING "C Flags") +set(CMAKE_C_FLAGS_DEBUG "@CMAKE_C_FLAGS_DEBUG@" CACHE STRING "C Flags") +set(CMAKE_C_FLAGS_RELEASE "@CMAKE_C_FLAGS_RELEASE@" CACHE STRING "C Flags") +set(CMAKE_C_FLAGS_MINSIZEREL "@CMAKE_C_FLAGS_MINSIZEREL@" CACHE STRING "C Flags") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "@CMAKE_C_FLAGS_RELWITHDEBINFO@" CACHE STRING "C Flags") +set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@" CACHE STRING "C++ Compiler") +set(CMAKE_CXX_FLAGS "@CMAKE_CXX_FLAGS@" CACHE STRING "C++ Flags") +set(CMAKE_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@" CACHE STRING "C++ Flags") +set(CMAKE_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@" CACHE STRING "C++ Flags") +set(CMAKE_CXX_FLAGS_MINSIZEREL "@CMAKE_CXX_FLAGS_MINSIZEREL@" CACHE STRING "C++ Flags") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@" CACHE STRING "C++ Flags") +set(CMAKE_INSTALL_PREFIX "@ExportImport_BINARY_DIR@/Root" CACHE STRING "Installation Prefix") +set(CMAKE_SKIP_RPATH ON CACHE BOOL "No RPATH") +set(CMAKE_GNUtoMS "@ExportImport_GNUtoMS@" CACHE BOOL "CMAKE_GNUtoMS") diff --git a/Tests/ExternalOBJ/CMakeLists.txt b/Tests/ExternalOBJ/CMakeLists.txt index 683e7997c..542bfab94 100644 --- a/Tests/ExternalOBJ/CMakeLists.txt +++ b/Tests/ExternalOBJ/CMakeLists.txt @@ -1,51 +1,51 @@ cmake_minimum_required (VERSION 2.6) -PROJECT (ExternalOBJ) +project (ExternalOBJ) -IF(APPLE) +if(APPLE) # 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 Power PC and change to ppc - IF("${_CMAKE_OSX_MACHINE}" MATCHES "Power") - SET(_CMAKE_OSX_MACHINE ppc) - ENDIF("${_CMAKE_OSX_MACHINE}" MATCHES "Power") - SET(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}) -ENDIF(APPLE) + if("${_CMAKE_OSX_MACHINE}" MATCHES "Power") + set(_CMAKE_OSX_MACHINE ppc) + endif("${_CMAKE_OSX_MACHINE}" MATCHES "Power") + set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}) +endif(APPLE) # Build the external object file. -TRY_COMPILE(EXTERNAL_OBJECT_BUILT +try_compile(EXTERNAL_OBJECT_BUILT ${ExternalOBJ_BINARY_DIR}/Object ${ExternalOBJ_SOURCE_DIR}/Object Object external OUTPUT_VARIABLE OUTPUT ) -IF(EXTERNAL_OBJECT_BUILT) - MESSAGE( +if(EXTERNAL_OBJECT_BUILT) + message( "Building external_object.cxx succeeded with the following output:\n" "[${OUTPUT}]" ) -ELSE(EXTERNAL_OBJECT_BUILT) - MESSAGE(FATAL_ERROR +else(EXTERNAL_OBJECT_BUILT) + message(FATAL_ERROR "Building external_object.cxx failed with the following output:\n" "[${OUTPUT}]" ) -ENDIF(EXTERNAL_OBJECT_BUILT) +endif(EXTERNAL_OBJECT_BUILT) # Find the external object file. -SET(DIR ${ExternalOBJ_BINARY_DIR}/Object) -FILE(GLOB_RECURSE EXTERNAL_OBJECT +set(DIR ${ExternalOBJ_BINARY_DIR}/Object) +file(GLOB_RECURSE EXTERNAL_OBJECT "${DIR}/external_object*${CMAKE_CXX_OUTPUT_EXTENSION}") -IF(EXTERNAL_OBJECT) - LIST (GET EXTERNAL_OBJECT 0 EXTERNAL_OBJECT) - MESSAGE("Found \"${EXTERNAL_OBJECT}\".") -ELSE(EXTERNAL_OBJECT) - MESSAGE(FATAL_ERROR "Could not find external object.") -ENDIF(EXTERNAL_OBJECT) +if(EXTERNAL_OBJECT) + list (GET EXTERNAL_OBJECT 0 EXTERNAL_OBJECT) + message("Found \"${EXTERNAL_OBJECT}\".") +else(EXTERNAL_OBJECT) + message(FATAL_ERROR "Could not find external object.") +endif(EXTERNAL_OBJECT) # Test creation of external objects by custom commands. -SET(CUSTOM_OBJECT +set(CUSTOM_OBJECT ${CMAKE_CURRENT_BINARY_DIR}/custom_object${CMAKE_C_OUTPUT_EXTENSION}) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CUSTOM_OBJECT} COMMAND ${CMAKE_COMMAND} -E copy ${EXTERNAL_OBJECT} ${CUSTOM_OBJECT} DEPENDS ${EXTERNAL_OBJECT} @@ -53,11 +53,11 @@ ADD_CUSTOM_COMMAND( message("${EXTERNAL_OBJECT}") # Build an executable using the external object file. -ADD_EXECUTABLE(ExternalOBJ executable.cxx ${CUSTOM_OBJECT}) +add_executable(ExternalOBJ executable.cxx ${CUSTOM_OBJECT}) # A bug showed up in VS2010 where an object file that was # part of a custom commad output worked, but ones that were # not didn't work. So, repeat the executable using the object # directly and not from the output of the copy. -ADD_EXECUTABLE(ExternalOBJ2 executable.cxx ${EXTERNAL_OBJECT}) +add_executable(ExternalOBJ2 executable.cxx ${EXTERNAL_OBJECT}) -ADD_SUBDIRECTORY(Sub) +add_subdirectory(Sub) diff --git a/Tests/ExternalOBJ/Object/CMakeLists.txt b/Tests/ExternalOBJ/Object/CMakeLists.txt index 6f1d7e3fb..b24e91b9a 100644 --- a/Tests/ExternalOBJ/Object/CMakeLists.txt +++ b/Tests/ExternalOBJ/Object/CMakeLists.txt @@ -1,13 +1,13 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(Object) -IF(APPLE) +project(Object) +if(APPLE) # 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 Power PC and change to ppc - IF("${_CMAKE_OSX_MACHINE}" MATCHES "Power") - SET(_CMAKE_OSX_MACHINE ppc) - ENDIF("${_CMAKE_OSX_MACHINE}" MATCHES "Power") - SET(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}) -ENDIF(APPLE) + if("${_CMAKE_OSX_MACHINE}" MATCHES "Power") + set(_CMAKE_OSX_MACHINE ppc) + endif("${_CMAKE_OSX_MACHINE}" MATCHES "Power") + set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}) +endif(APPLE) -ADD_EXECUTABLE(external external_object.cxx external_main.cxx) +add_executable(external external_object.cxx external_main.cxx) diff --git a/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake index 321fa118e..61db4166d 100644 --- a/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake +++ b/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake @@ -1,8 +1,8 @@ -SET(PACKAGE_VERSION 1.1) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) +set(PACKAGE_VERSION 1.1) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) diff --git a/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake index 4576809f5..e0042d5e6 100644 --- a/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake +++ b/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake @@ -1,8 +1,8 @@ -SET(PACKAGE_VERSION 1.2) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) +set(PACKAGE_VERSION 1.2) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index e85fb4dd2..d3446497d 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -1,86 +1,86 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(FindPackageTest) +project(FindPackageTest) -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) # Look for a package which uses FindPackageHandleStandardArgs.cmake with the # new (as of cmake 2.8.3) syntax. This works only if CMP0017 is set to NEW, # because otherwise FindPackageHandleStandardArgs.cmake from the current # directory is included (via CMAKE_MODULE_PATH). -CMAKE_POLICY(SET CMP0017 NEW) -FIND_PACKAGE(ZLIB QUIET) +cmake_policy(SET CMP0017 NEW) +find_package(ZLIB QUIET) # Look for a package that has a find module and may be found. -FIND_PACKAGE(OpenGL QUIET) +find_package(OpenGL QUIET) # Look for a package that has no find module and will not be found. -FIND_PACKAGE(NotAPackage QUIET) +find_package(NotAPackage QUIET) # Look for a package that has an advanced find module. -FIND_PACKAGE(VTK QUIET) +find_package(VTK QUIET) -ADD_EXECUTABLE(FindPackageTest FindPackageTest.cxx) +add_executable(FindPackageTest FindPackageTest.cxx) # test behaviour of cmFindBase wrt. the CMAKE_PREFIX_PATH variable # foo.h should be found in ${CMAKE_CURRENT_SOURCE_DIR}/include: -SET(CMAKE_PREFIX_PATH /blub /blah "${CMAKE_CURRENT_SOURCE_DIR}") -FIND_PATH(FOO_DIR foo.h) +set(CMAKE_PREFIX_PATH /blub /blah "${CMAKE_CURRENT_SOURCE_DIR}") +find_path(FOO_DIR foo.h) -IF(NOT FOO_DIR) - MESSAGE(FATAL_ERROR "Did not find foo.h which is in ${CMAKE_CURRENT_SOURCE_DIR}/include +if(NOT FOO_DIR) + message(FATAL_ERROR "Did not find foo.h which is in ${CMAKE_CURRENT_SOURCE_DIR}/include CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}") -ENDIF(NOT FOO_DIR) +endif(NOT FOO_DIR) -FIND_PACKAGE(VersionTestA 1) -FIND_PACKAGE(VersionTestB 1.2) -FIND_PACKAGE(VersionTestC 1.2.3) -FIND_PACKAGE(VersionTestD 1.2.3.4) +find_package(VersionTestA 1) +find_package(VersionTestB 1.2) +find_package(VersionTestC 1.2.3) +find_package(VersionTestD 1.2.3.4) -FIND_PACKAGE(LotsOfComponents COMPONENTS AComp OPTIONAL_COMPONENTS BComp CComp) -IF(NOT LOTSOFCOMPONENTS_FOUND) - MESSAGE(SEND_ERROR "LotsOfComponents not found !") -ENDIF() +find_package(LotsOfComponents COMPONENTS AComp OPTIONAL_COMPONENTS BComp CComp) +if(NOT LOTSOFCOMPONENTS_FOUND) + message(SEND_ERROR "LotsOfComponents not found !") +endif() #----------------------------------------------------------------------------- # Test system package registry if possible. -SET(CMakeTestSystemPackage "") -IF(WIN32 AND NOT CYGWIN) +set(CMakeTestSystemPackage "") +if(WIN32 AND NOT CYGWIN) # Try writing a value to the system package registry. - SET(_data "${FindPackageTest_SOURCE_DIR}/SystemPackage") - SET(_key "HKLM\\Software\\Kitware\\CMake\\Packages\\CMakeTestSystemPackage") - SET(_file "${FindPackageTest_BINARY_DIR}/CMakeTestSystemPackage.data") - FILE(WRITE ${_file} "${_data}\n") - EXECUTE_PROCESS( + set(_data "${FindPackageTest_SOURCE_DIR}/SystemPackage") + set(_key "HKLM\\Software\\Kitware\\CMake\\Packages\\CMakeTestSystemPackage") + set(_file "${FindPackageTest_BINARY_DIR}/CMakeTestSystemPackage.data") + file(WRITE ${_file} "${_data}\n") + execute_process( COMMAND ${CMAKE_COMMAND} -E md5sum ${_file} OUTPUT_VARIABLE _output ERROR_VARIABLE _error RESULT_VARIABLE _failed OUTPUT_STRIP_TRAILING_WHITESPACE ) - STRING(REGEX REPLACE " .*" "" _value "${_output}") - IF(NOT _failed AND _value) - EXECUTE_PROCESS( + string(REGEX REPLACE " .*" "" _value "${_output}") + if(NOT _failed AND _value) + execute_process( COMMAND reg add "${_key}" /v "${_value}" /t REG_SZ /d "${_data}" /f OUTPUT_VARIABLE _output ERROR_VARIABLE _output RESULT_VARIABLE _failed ) - ENDIF() + endif() # If the above worked, add the rest of the test and a rule to # cleanup the value. - IF(NOT _failed) - MESSAGE(STATUS "HKLM is writable: enabling CMakeTestSystemPackage") - SET(CMakeTestSystemPackage_CLEANUP reg delete "${_key}" /v "${_value}" /f) - SET(CMakeTestSystemPackage CMakeTestSystemPackage) - ELSE() - MESSAGE(STATUS "HKLM is readonly: disabling CMakeTestSystemPackage") - ENDIF() -ENDIF() + if(NOT _failed) + message(STATUS "HKLM is writable: enabling CMakeTestSystemPackage") + set(CMakeTestSystemPackage_CLEANUP reg delete "${_key}" /v "${_value}" /f) + set(CMakeTestSystemPackage CMakeTestSystemPackage) + else() + message(STATUS "HKLM is readonly: disabling CMakeTestSystemPackage") + endif() +endif() #----------------------------------------------------------------------------- -#SET(CMAKE_FIND_DEBUG_MODE 1) +#set(CMAKE_FIND_DEBUG_MODE 1) # For purposes of the test wipe out previous find results. -SET(PACKAGES +set(PACKAGES foo Foo Bar Blub TFramework Tframework TApp Tapp Special VersionedA VersionedB VersionedC VersionedD VersionedE WrongA WrongB WrongC WrongD @@ -91,14 +91,14 @@ SET(PACKAGES SetFoundTRUE SetFoundFALSE ${CMakeTestSystemPackage} ) -FOREACH(p ${PACKAGES}) - SET(${p}_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) -ENDFOREACH(p) +foreach(p ${PACKAGES}) + set(${p}_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) +endforeach(p) # Enable framework and bundle searching. Make sure bundles are found # before unix-syle packages. -SET(CMAKE_FIND_FRAMEWORK LAST) -SET(CMAKE_FIND_APPBUNDLE FIRST) +set(CMAKE_FIND_FRAMEWORK LAST) +set(CMAKE_FIND_APPBUNDLE FIRST) # Set the wrong answer for a find to make sure it re-finds. set(VersionedA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-4.0) @@ -108,219 +108,219 @@ set(VersionedA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-4.0) set(CMAKE_IGNORE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-3.1) # Look for packages with new-style signatures. -FIND_PACKAGE(foo NO_MODULE) -FIND_PACKAGE(Foo CONFIGS FooConfig.cmake) -FIND_PACKAGE(Bar) -SET(CMAKE_DISABLE_FIND_PACKAGE_Blub TRUE) -FIND_PACKAGE(Blub NO_MODULE) -FIND_PACKAGE(TFramework CONFIGS TFrameworkConfig.cmake) -FIND_PACKAGE(Tframework) -FIND_PACKAGE(TApp) -FIND_PACKAGE(Tapp CONFIGS tapp-config.cmake) -FIND_PACKAGE(Special NAMES Suffix SuffixTest PATH_SUFFIXES test) -FIND_PACKAGE(VersionedA 2 NAMES zot) -FIND_PACKAGE(VersionedB 3.1 EXACT NAMES zot) -FIND_PACKAGE(VersionedC 4.0 EXACT NAMES zot) -FIND_PACKAGE(VersionedD 1.1 EXACT NAMES Baz) -FIND_PACKAGE(VersionedE 1.2 EXACT NAMES Baz) +find_package(foo NO_MODULE) +find_package(Foo CONFIGS FooConfig.cmake) +find_package(Bar) +set(CMAKE_DISABLE_FIND_PACKAGE_Blub TRUE) +find_package(Blub NO_MODULE) +find_package(TFramework CONFIGS TFrameworkConfig.cmake) +find_package(Tframework) +find_package(TApp) +find_package(Tapp CONFIGS tapp-config.cmake) +find_package(Special NAMES Suffix SuffixTest PATH_SUFFIXES test) +find_package(VersionedA 2 NAMES zot) +find_package(VersionedB 3.1 EXACT NAMES zot) +find_package(VersionedC 4.0 EXACT NAMES zot) +find_package(VersionedD 1.1 EXACT NAMES Baz) +find_package(VersionedE 1.2 EXACT NAMES Baz) # Test Config files which set Xyz_FOUND themselves: -FIND_PACKAGE(SetFoundTRUE NO_MODULE) -FIND_PACKAGE(SetFoundFALSE NO_MODULE) +find_package(SetFoundTRUE NO_MODULE) +find_package(SetFoundFALSE NO_MODULE) # Test wrong initial path when result is present. -SET(WrongA_DIR "${VersionedD_DIR}") -FIND_PACKAGE(WrongA 1.2 EXACT NAMES Baz) +set(WrongA_DIR "${VersionedD_DIR}") +find_package(WrongA 1.2 EXACT NAMES Baz) # Test wrong initial cache entry of UNINITIALIZED type when result is present. -SET(WrongB_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE) -GET_PROPERTY(type CACHE WrongB_DIR PROPERTY TYPE) -FIND_PACKAGE(WrongB 1.2 EXACT NAMES Baz) +set(WrongB_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE) +get_property(type CACHE WrongB_DIR PROPERTY TYPE) +find_package(WrongB 1.2 EXACT NAMES Baz) # Test wrong initial path when result is missing. -SET(WrongC_DIR "${VersionedD_DIR}") -FIND_PACKAGE(WrongC 1.3 EXACT QUIET NAMES Baz) +set(WrongC_DIR "${VersionedD_DIR}") +find_package(WrongC 1.3 EXACT QUIET NAMES Baz) # Test wrong initial cache entry of UNINITIALIZED type when result is missing. -SET(WrongD_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE) -GET_PROPERTY(type CACHE WrongD_DIR PROPERTY TYPE) -FIND_PACKAGE(WrongD 1.3 EXACT QUIET NAMES Baz) +set(WrongD_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE) +get_property(type CACHE WrongD_DIR PROPERTY TYPE) +find_package(WrongD 1.3 EXACT QUIET NAMES Baz) # HINTS should override the system but PATHS should not -LIST(INSERT CMAKE_SYSTEM_PREFIX_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/A") -FIND_PACKAGE(wibbleA NAMES wibble PATHS B) -FIND_PACKAGE(wibbleB NAMES wibble HINTS B) +list(INSERT CMAKE_SYSTEM_PREFIX_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/A") +find_package(wibbleA NAMES wibble PATHS B) +find_package(wibbleB NAMES wibble HINTS B) # Look for package with recursive find-modules. -FIND_PACKAGE(RecursiveA COMPONENTS A) -FIND_PACKAGE(RecursiveB 2) -FIND_PACKAGE(RecursiveC 3.1 EXACT) +find_package(RecursiveA COMPONENTS A) +find_package(RecursiveB 2) +find_package(RecursiveC 3.1 EXACT) # Test architecture-specific search directories. -SET(CMAKE_LIBRARY_ARCHITECTURE arch) -FIND_PACKAGE(ArchA NAMES Bar) -FIND_PACKAGE(ArchB NAMES Foo CONFIGS FooConfig.cmake) -FIND_PACKAGE(ArchC 3.1 EXACT NAMES zot) -FIND_PACKAGE(ArchD 4.0 EXACT NAMES zot) -UNSET(CMAKE_LIBRARY_ARCHITECTURE) +set(CMAKE_LIBRARY_ARCHITECTURE arch) +find_package(ArchA NAMES Bar) +find_package(ArchB NAMES Foo CONFIGS FooConfig.cmake) +find_package(ArchC 3.1 EXACT NAMES zot) +find_package(ArchD 4.0 EXACT NAMES zot) +unset(CMAKE_LIBRARY_ARCHITECTURE) # Test _DIR environment variable. # We erase the main prefix path to ensure the env var is used. -SET(CMAKE_PREFIX_PATH) -SET(ENV{EnvA_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/lib/zot-3.1") -FIND_PACKAGE(EnvA 3.1 EXACT QUIET NAMES zot) # Should Work -FIND_PACKAGE(EnvB 3.1 EXACT QUIET NAMES zot) # Should Fail +set(CMAKE_PREFIX_PATH) +set(ENV{EnvA_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/lib/zot-3.1") +find_package(EnvA 3.1 EXACT QUIET NAMES zot) # Should Work +find_package(EnvB 3.1 EXACT QUIET NAMES zot) # Should Fail # Test system package registry if available. -IF(CMakeTestSystemPackage) - FIND_PACKAGE(CMakeTestSystemPackage) - EXECUTE_PROCESS(COMMAND ${CMakeTestSystemPackage_CLEANUP} +if(CMakeTestSystemPackage) + find_package(CMakeTestSystemPackage) + execute_process(COMMAND ${CMakeTestSystemPackage_CLEANUP} OUTPUT_VARIABLE _output ERROR_VARIABLE _error) -ENDIF() +endif() # Expected locations at which packages should be found. -SET(foo_EXPECTED "lib/foo-1.2/foo-config.cmake") -SET(Foo_EXPECTED "lib/foo-1.2/CMake/FooConfig.cmake") -SET(Bar_EXPECTED "lib/Bar/BarConfig.cmake") -SET(Blub_MISSING "") -SET(Special_EXPECTED "lib/suffix/test/SuffixTestConfig.cmake") -SET(TFramework_EXPECTED +set(foo_EXPECTED "lib/foo-1.2/foo-config.cmake") +set(Foo_EXPECTED "lib/foo-1.2/CMake/FooConfig.cmake") +set(Bar_EXPECTED "lib/Bar/BarConfig.cmake") +set(Blub_MISSING "") +set(Special_EXPECTED "lib/suffix/test/SuffixTestConfig.cmake") +set(TFramework_EXPECTED "TFramework.framework/Versions/A/Resources/CMake/TFrameworkConfig.cmake") -SET(Tframework_EXPECTED +set(Tframework_EXPECTED "TFramework.framework/Versions/A/Resources/tframework-config.cmake") -SET(TApp_EXPECTED +set(TApp_EXPECTED "TApp.app/Contents/Resources/TAppConfig.cmake") -SET(Tapp_EXPECTED +set(Tapp_EXPECTED "TApp.app/Contents/Resources/cmake/tapp-config.cmake") -SET(VersionedA_EXPECTED "lib/zot-2.0/zot-config.cmake") -SET(VersionedB_EXPECTED "lib/zot-3.1/zot-config.cmake") -SET(VersionedC_EXPECTED "lib/cmake/zot-4.0/zot-config.cmake") -SET(VersionedD_EXPECTED "Baz 1.1/BazConfig.cmake") -SET(VersionedE_EXPECTED "Baz 1.2/CMake/BazConfig.cmake") -SET(WrongA_EXPECTED "${VersionedE_EXPECTED}") -SET(WrongB_EXPECTED "${VersionedE_EXPECTED}") -SET(WrongC_MISSING "WrongC_DIR-NOTFOUND") -SET(WrongD_MISSING "WrongD_DIR-NOTFOUND") -SET(wibbleA_EXPECTED "A/wibble-config.cmake") -SET(wibbleB_EXPECTED "B/wibble-config.cmake") -SET(RecursiveA_EXPECTED "lib/RecursiveA/recursivea-config.cmake") -SET(RecursiveB_EXPECTED "lib/zot-2.0/zot-config.cmake") -SET(RecursiveC_EXPECTED "lib/zot-3.1/zot-config.cmake") -SET(ArchA_EXPECTED "lib/arch/Bar/BarConfig.cmake") -SET(ArchB_EXPECTED "lib/arch/foo-1.2/CMake/FooConfig.cmake") -SET(ArchC_EXPECTED "lib/arch/zot-3.1/zot-config.cmake") -SET(ArchD_EXPECTED "lib/arch/cmake/zot-4.0/zot-config.cmake") -SET(EnvA_EXPECTED "lib/zot-3.1/zot-config.cmake") -SET(EnvB_MISSING "EnvB_DIR-NOTFOUND") -SET(SetFoundTRUE_EXPECTED "cmake/SetFoundTRUEConfig.cmake") -SET(SetFoundFALSE_MISSING "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -SET(CMakeTestSystemPackage_EXPECTED "SystemPackage/CMakeTestSystemPackageConfig.cmake") +set(VersionedA_EXPECTED "lib/zot-2.0/zot-config.cmake") +set(VersionedB_EXPECTED "lib/zot-3.1/zot-config.cmake") +set(VersionedC_EXPECTED "lib/cmake/zot-4.0/zot-config.cmake") +set(VersionedD_EXPECTED "Baz 1.1/BazConfig.cmake") +set(VersionedE_EXPECTED "Baz 1.2/CMake/BazConfig.cmake") +set(WrongA_EXPECTED "${VersionedE_EXPECTED}") +set(WrongB_EXPECTED "${VersionedE_EXPECTED}") +set(WrongC_MISSING "WrongC_DIR-NOTFOUND") +set(WrongD_MISSING "WrongD_DIR-NOTFOUND") +set(wibbleA_EXPECTED "A/wibble-config.cmake") +set(wibbleB_EXPECTED "B/wibble-config.cmake") +set(RecursiveA_EXPECTED "lib/RecursiveA/recursivea-config.cmake") +set(RecursiveB_EXPECTED "lib/zot-2.0/zot-config.cmake") +set(RecursiveC_EXPECTED "lib/zot-3.1/zot-config.cmake") +set(ArchA_EXPECTED "lib/arch/Bar/BarConfig.cmake") +set(ArchB_EXPECTED "lib/arch/foo-1.2/CMake/FooConfig.cmake") +set(ArchC_EXPECTED "lib/arch/zot-3.1/zot-config.cmake") +set(ArchD_EXPECTED "lib/arch/cmake/zot-4.0/zot-config.cmake") +set(EnvA_EXPECTED "lib/zot-3.1/zot-config.cmake") +set(EnvB_MISSING "EnvB_DIR-NOTFOUND") +set(SetFoundTRUE_EXPECTED "cmake/SetFoundTRUEConfig.cmake") +set(SetFoundFALSE_MISSING "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +set(CMakeTestSystemPackage_EXPECTED "SystemPackage/CMakeTestSystemPackageConfig.cmake") # Check the results. -FOREACH(p ${PACKAGES}) - IF(DEFINED ${p}_MISSING) +foreach(p ${PACKAGES}) + if(DEFINED ${p}_MISSING) # Check and report failure. - IF(NOT "${${p}_DIR}" STREQUAL "${${p}_MISSING}") - MESSAGE(SEND_ERROR + if(NOT "${${p}_DIR}" STREQUAL "${${p}_MISSING}") + message(SEND_ERROR "Package ${p} should have been [${${p}_MISSING}] but " "was [${${p}_DIR}]") - ENDIF() - IF(${p}_FOUND) - MESSAGE(SEND_ERROR + endif() + if(${p}_FOUND) + message(SEND_ERROR "Package ${p} should not have been found, but ${p}_FOUND is set to " "\"${${p}_FOUND}\"") - ENDIF() - ELSEIF(${p}_FOUND) + endif() + elseif(${p}_FOUND) # Convert to relative path for comparison to expected location. - FILE(RELATIVE_PATH REL_${p}_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}" + file(RELATIVE_PATH REL_${p}_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}" "${${p}_CONFIG}") # Debugging output. - IF(CMAKE_FIND_DEBUG_MODE) - MESSAGE("Package ${p} found [${REL_${p}_CONFIG}]") - ENDIF(CMAKE_FIND_DEBUG_MODE) + if(CMAKE_FIND_DEBUG_MODE) + message("Package ${p} found [${REL_${p}_CONFIG}]") + endif(CMAKE_FIND_DEBUG_MODE) # Check and report failure. - IF(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") - MESSAGE(SEND_ERROR + if(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") + message(SEND_ERROR "Package ${p} should have been [${${p}_EXPECTED}] but " "was [${REL_${p}_CONFIG}]") - ENDIF(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") - ELSE() - MESSAGE(SEND_ERROR "Package ${p} not found!") - ENDIF() -ENDFOREACH(p) + endif(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") + else() + message(SEND_ERROR "Package ${p} not found!") + endif() +endforeach(p) # Check that version information was extracted. -IF(NOT "${VersionedA_VERSION}" STREQUAL "2.0") - MESSAGE(SEND_ERROR +if(NOT "${VersionedA_VERSION}" STREQUAL "2.0") + message(SEND_ERROR "Package VersionedA is version [${VersionedA_VERSION}], not [2.0]") -ENDIF(NOT "${VersionedA_VERSION}" STREQUAL "2.0") -IF(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") - MESSAGE(SEND_ERROR +endif(NOT "${VersionedA_VERSION}" STREQUAL "2.0") +if(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") + message(SEND_ERROR "Package VersionedA is major version [${VersionedA_VERSION_MAJOR}], not [2]") -ENDIF(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") -IF(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") - MESSAGE(SEND_ERROR +endif(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") +if(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") + message(SEND_ERROR "Package VersionedA is minor version [${VersionedA_VERSION_MINOR}], not [0]") -ENDIF(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") +endif(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") -IF(NOT "${VersionedB_VERSION}" STREQUAL "3.1") - MESSAGE(SEND_ERROR +if(NOT "${VersionedB_VERSION}" STREQUAL "3.1") + message(SEND_ERROR "Package VersionedB is version [${VersionedB_VERSION}], not [3.1]") -ENDIF(NOT "${VersionedB_VERSION}" STREQUAL "3.1") -IF(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") - MESSAGE(SEND_ERROR +endif(NOT "${VersionedB_VERSION}" STREQUAL "3.1") +if(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") + message(SEND_ERROR "Package VersionedB is major version [${VersionedB_VERSION_MAJOR}], not [3]") -ENDIF(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") -IF(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") - MESSAGE(SEND_ERROR +endif(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") +if(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") + message(SEND_ERROR "Package VersionedB is minor version [${VersionedB_VERSION_MINOR}], not [1]") -ENDIF(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") +endif(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") -IF(NOT "${Special_VERSION}" STREQUAL "1.2") - MESSAGE(SEND_ERROR +if(NOT "${Special_VERSION}" STREQUAL "1.2") + message(SEND_ERROR "Package Special is version [${Special_VERSION}], not [1.2]") -ENDIF(NOT "${Special_VERSION}" STREQUAL "1.2") -IF(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR +endif(NOT "${Special_VERSION}" STREQUAL "1.2") +if(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "Package Special is major version [${Special_VERSION_MAJOR}], not [1]") -ENDIF(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${Special_VERSION_MINOR}" STREQUAL "2") - MESSAGE(SEND_ERROR +endif(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") +if(NOT "${Special_VERSION_MINOR}" STREQUAL "2") + message(SEND_ERROR "Package Special is minor version [${Special_VERSION_MINOR}], not [2]") -ENDIF(NOT "${Special_VERSION_MINOR}" STREQUAL "2") +endif(NOT "${Special_VERSION_MINOR}" STREQUAL "2") # Test version number comparison. -IF(NOT "1.2.3.4" VERSION_LESS "1.2.3.5") - MESSAGE(SEND_ERROR "1.2.3.4 VERSION_LESS 1.2.3.5 is not true!") -ENDIF() -IF(NOT "1.2" VERSION_LESS "1.10") - MESSAGE(SEND_ERROR "1.2 VERSION_LESS 1.10 is not true!") -ENDIF() -IF(NOT "1.02" VERSION_GREATER "1.1") - MESSAGE(SEND_ERROR "1.02 VERSION_GREATER 1.1 is not true!") -ENDIF() -IF("1.2.3" VERSION_GREATER "1.2.3.4") - MESSAGE(SEND_ERROR "1.2.3 VERSION_GREATER 1.2.3.4 is not false!") -ENDIF() -IF(NOT "1.2" VERSION_EQUAL "1.2.0.0") - MESSAGE(SEND_ERROR "1.2 VERSION_EQUAL 1.2.0.0 is not true!") -ENDIF() +if(NOT "1.2.3.4" VERSION_LESS "1.2.3.5") + message(SEND_ERROR "1.2.3.4 VERSION_LESS 1.2.3.5 is not true!") +endif() +if(NOT "1.2" VERSION_LESS "1.10") + message(SEND_ERROR "1.2 VERSION_LESS 1.10 is not true!") +endif() +if(NOT "1.02" VERSION_GREATER "1.1") + message(SEND_ERROR "1.02 VERSION_GREATER 1.1 is not true!") +endif() +if("1.2.3" VERSION_GREATER "1.2.3.4") + message(SEND_ERROR "1.2.3 VERSION_GREATER 1.2.3.4 is not false!") +endif() +if(NOT "1.2" VERSION_EQUAL "1.2.0.0") + message(SEND_ERROR "1.2 VERSION_EQUAL 1.2.0.0 is not true!") +endif() #----------------------------------------------------------------------------- # Test export(PACKAGE) with find_package. -MESSAGE(STATUS "Preparing export(PACKAGE) test project") -TRY_COMPILE(EXPORTER_COMPILED +message(STATUS "Preparing export(PACKAGE) test project") +try_compile(EXPORTER_COMPILED ${FindPackageTest_BINARY_DIR}/Exporter ${FindPackageTest_SOURCE_DIR}/Exporter CMakeTestExportPackage dummy OUTPUT_VARIABLE output) -MESSAGE(STATUS "Searching for export(PACKAGE) test project") -SET(CMakeTestExportPackage_DIR "" CACHE FILEPATH +message(STATUS "Searching for export(PACKAGE) test project") +set(CMakeTestExportPackage_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) -STRING(REGEX REPLACE "-.*$" "" version ${CMAKE_VERSION}) -FIND_PACKAGE(CMakeTestExportPackage 1.${version} EXACT REQUIRED) +string(REGEX REPLACE "-.*$" "" version ${CMAKE_VERSION}) +find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED) #----------------------------------------------------------------------------- # Test configure_package_config_file(). diff --git a/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in b/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in index ff450a145..42bd84ea8 100644 --- a/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in +++ b/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in @@ -1,6 +1,6 @@ # Test config file. -SET(PACKAGE_VERSION "1.@CMAKE_VERSION@") -IF("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}") - SET(PACKAGE_VERSION_COMPATIBLE 1) - SET(PACKAGE_VERSION_EXACT 1) -ENDIF() +set(PACKAGE_VERSION "1.@CMAKE_VERSION@") +if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}") + set(PACKAGE_VERSION_COMPATIBLE 1) + set(PACKAGE_VERSION_EXACT 1) +endif() diff --git a/Tests/FindPackageTest/FindRecursiveA.cmake b/Tests/FindPackageTest/FindRecursiveA.cmake index 3af7e99a3..a6d25dc4b 100644 --- a/Tests/FindPackageTest/FindRecursiveA.cmake +++ b/Tests/FindPackageTest/FindRecursiveA.cmake @@ -1 +1 @@ -FIND_PACKAGE(RecursiveA NO_MODULE) +find_package(RecursiveA NO_MODULE) diff --git a/Tests/FindPackageTest/FindRecursiveB.cmake b/Tests/FindPackageTest/FindRecursiveB.cmake index c609ab127..9e28f2ce9 100644 --- a/Tests/FindPackageTest/FindRecursiveB.cmake +++ b/Tests/FindPackageTest/FindRecursiveB.cmake @@ -1 +1 @@ -FIND_PACKAGE(RecursiveB NAMES zot) +find_package(RecursiveB NAMES zot) diff --git a/Tests/FindPackageTest/FindRecursiveC.cmake b/Tests/FindPackageTest/FindRecursiveC.cmake index 018cc7302..cd4400ca0 100644 --- a/Tests/FindPackageTest/FindRecursiveC.cmake +++ b/Tests/FindPackageTest/FindRecursiveC.cmake @@ -1 +1 @@ -FIND_PACKAGE(RecursiveC NAMES zot) +find_package(RecursiveC NAMES zot) diff --git a/Tests/FindPackageTest/FindVersionTestA.cmake b/Tests/FindPackageTest/FindVersionTestA.cmake index 55c67e257..c6031d9dc 100644 --- a/Tests/FindPackageTest/FindVersionTestA.cmake +++ b/Tests/FindPackageTest/FindVersionTestA.cmake @@ -1,18 +1,18 @@ -IF(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION=${VersionTestA_FIND_VERSION} is not 1") -ENDIF(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") -IF(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_MAJOR=${VersionTestA_FIND_VERSION_MAJOR} is not 1") -ENDIF(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR=${VersionTestA_FIND_VERSION_MINOR} is not 0") -ENDIF(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") -IF(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH=${VersionTestA_FIND_VERSION_PATCH} is not 0") -ENDIF(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") -IF(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_TWEAK=${VersionTestA_FIND_VERSION_TWEAK} is not 0") -ENDIF(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") -IF(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_COUNT=${VersionTestA_FIND_VERSION_COUNT} is not 1") -ENDIF(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") +if(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") + message(SEND_ERROR "VersionTestA_FIND_VERSION=${VersionTestA_FIND_VERSION} is not 1") +endif(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") +if(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "VersionTestA_FIND_VERSION_MAJOR=${VersionTestA_FIND_VERSION_MAJOR} is not 1") +endif(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") +if(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") + message(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR=${VersionTestA_FIND_VERSION_MINOR} is not 0") +endif(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") +if(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") + message(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH=${VersionTestA_FIND_VERSION_PATCH} is not 0") +endif(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") +if(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") + message(SEND_ERROR "VersionTestA_FIND_VERSION_TWEAK=${VersionTestA_FIND_VERSION_TWEAK} is not 0") +endif(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") +if(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") + message(SEND_ERROR "VersionTestA_FIND_VERSION_COUNT=${VersionTestA_FIND_VERSION_COUNT} is not 1") +endif(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") diff --git a/Tests/FindPackageTest/FindVersionTestB.cmake b/Tests/FindPackageTest/FindVersionTestB.cmake index 03173c65a..914d5a732 100644 --- a/Tests/FindPackageTest/FindVersionTestB.cmake +++ b/Tests/FindPackageTest/FindVersionTestB.cmake @@ -1,18 +1,18 @@ -IF(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION=${VersionTestB_FIND_VERSION} is not 1.2") -ENDIF(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") -IF(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_MAJOR=${VersionTestB_FIND_VERSION_MAJOR} is not 1") -ENDIF(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_MINOR=${VersionTestB_FIND_VERSION_MINOR} is not 2") -ENDIF(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") -IF(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_PATCH=${VersionTestB_FIND_VERSION_PATCH} is not 0") -ENDIF(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") -IF(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_TWEAK=${VersionTestB_FIND_VERSION_TWEAK} is not 0") -ENDIF(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") -IF(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_COUNT=${VersionTestB_FIND_VERSION_COUNT} is not 2") -ENDIF(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") +if(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") + message(SEND_ERROR "VersionTestB_FIND_VERSION=${VersionTestB_FIND_VERSION} is not 1.2") +endif(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") +if(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "VersionTestB_FIND_VERSION_MAJOR=${VersionTestB_FIND_VERSION_MAJOR} is not 1") +endif(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") +if(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") + message(SEND_ERROR "VersionTestB_FIND_VERSION_MINOR=${VersionTestB_FIND_VERSION_MINOR} is not 2") +endif(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") +if(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") + message(SEND_ERROR "VersionTestB_FIND_VERSION_PATCH=${VersionTestB_FIND_VERSION_PATCH} is not 0") +endif(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") +if(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") + message(SEND_ERROR "VersionTestB_FIND_VERSION_TWEAK=${VersionTestB_FIND_VERSION_TWEAK} is not 0") +endif(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") +if(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") + message(SEND_ERROR "VersionTestB_FIND_VERSION_COUNT=${VersionTestB_FIND_VERSION_COUNT} is not 2") +endif(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") diff --git a/Tests/FindPackageTest/FindVersionTestC.cmake b/Tests/FindPackageTest/FindVersionTestC.cmake index 1344cbc22..66e07ea95 100644 --- a/Tests/FindPackageTest/FindVersionTestC.cmake +++ b/Tests/FindPackageTest/FindVersionTestC.cmake @@ -1,18 +1,18 @@ -IF(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION=${VersionTestC_FIND_VERSION} is not 1.2.3") -ENDIF(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") -IF(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_MAJOR=${VersionTestC_FIND_VERSION_MAJOR} is not 1") -ENDIF(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_MINOR=${VersionTestC_FIND_VERSION_MINOR} is not 2") -ENDIF(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") -IF(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_PATCH=${VersionTestC_FIND_VERSION_PATCH} is not 3") -ENDIF(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") -IF(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_TWEAK=${VersionTestC_FIND_VERSION_TWEAK} is not 0") -ENDIF(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") -IF(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_COUNT=${VersionTestC_FIND_VERSION_COUNT} is not 3") -ENDIF(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") +if(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") + message(SEND_ERROR "VersionTestC_FIND_VERSION=${VersionTestC_FIND_VERSION} is not 1.2.3") +endif(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") +if(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "VersionTestC_FIND_VERSION_MAJOR=${VersionTestC_FIND_VERSION_MAJOR} is not 1") +endif(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") +if(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") + message(SEND_ERROR "VersionTestC_FIND_VERSION_MINOR=${VersionTestC_FIND_VERSION_MINOR} is not 2") +endif(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") +if(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") + message(SEND_ERROR "VersionTestC_FIND_VERSION_PATCH=${VersionTestC_FIND_VERSION_PATCH} is not 3") +endif(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") +if(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") + message(SEND_ERROR "VersionTestC_FIND_VERSION_TWEAK=${VersionTestC_FIND_VERSION_TWEAK} is not 0") +endif(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") +if(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") + message(SEND_ERROR "VersionTestC_FIND_VERSION_COUNT=${VersionTestC_FIND_VERSION_COUNT} is not 3") +endif(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") diff --git a/Tests/FindPackageTest/FindVersionTestD.cmake b/Tests/FindPackageTest/FindVersionTestD.cmake index d3e3f509e..88d92999c 100644 --- a/Tests/FindPackageTest/FindVersionTestD.cmake +++ b/Tests/FindPackageTest/FindVersionTestD.cmake @@ -1,18 +1,18 @@ -IF(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION=${VersionTestD_FIND_VERSION} is not 1.2.3.4") -ENDIF(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") -IF(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_MAJOR=${VersionTestD_FIND_VERSION_MAJOR} is not 1") -ENDIF(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_MINOR=${VersionTestD_FIND_VERSION_MINOR} is not 2") -ENDIF(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") -IF(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_PATCH=${VersionTestD_FIND_VERSION_PATCH} is not 3") -ENDIF(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") -IF(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_TWEAK=${VersionTestD_FIND_VERSION_TWEAK} is not 4") -ENDIF(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") -IF(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_COUNT=${VersionTestD_FIND_VERSION_COUNT} is not 4") -ENDIF(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") +if(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") + message(SEND_ERROR "VersionTestD_FIND_VERSION=${VersionTestD_FIND_VERSION} is not 1.2.3.4") +endif(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") +if(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "VersionTestD_FIND_VERSION_MAJOR=${VersionTestD_FIND_VERSION_MAJOR} is not 1") +endif(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") +if(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") + message(SEND_ERROR "VersionTestD_FIND_VERSION_MINOR=${VersionTestD_FIND_VERSION_MINOR} is not 2") +endif(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") +if(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") + message(SEND_ERROR "VersionTestD_FIND_VERSION_PATCH=${VersionTestD_FIND_VERSION_PATCH} is not 3") +endif(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") +if(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") + message(SEND_ERROR "VersionTestD_FIND_VERSION_TWEAK=${VersionTestD_FIND_VERSION_TWEAK} is not 4") +endif(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") +if(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") + message(SEND_ERROR "VersionTestD_FIND_VERSION_COUNT=${VersionTestD_FIND_VERSION_COUNT} is not 4") +endif(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") diff --git a/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake b/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake index cbf06036e..5ba8d5585 100644 --- a/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake +++ b/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake @@ -1,2 +1,2 @@ # Test config file that should not be found. -MESSAGE("Package TApp found non-bundle first!") +message("Package TApp found non-bundle first!") diff --git a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake index 2f768e8f5..514e830f3 100644 --- a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake @@ -1,7 +1,7 @@ -SET(PACKAGE_VERSION 4.0) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) +set(PACKAGE_VERSION 4.0) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) diff --git a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake index 13763adf1..59fe59d3f 100644 --- a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake @@ -1,7 +1,7 @@ -SET(PACKAGE_VERSION 3.1) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) +set(PACKAGE_VERSION 3.1) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) diff --git a/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake index bee2f0eea..e3e17de7c 100644 --- a/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake @@ -1,4 +1,4 @@ # Claim to be any version to test that CMAKE_IGNORE_PATH hides us. -SET(PACKAGE_VERSION 3.1) -SET(PACKAGE_VERSION_COMPATIBLE 1) -SET(PACKAGE_VERSION_EXACT 1) +set(PACKAGE_VERSION 3.1) +set(PACKAGE_VERSION_COMPATIBLE 1) +set(PACKAGE_VERSION_EXACT 1) diff --git a/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake index 606945f2d..7afcc9b8c 100644 --- a/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake @@ -1,8 +1,8 @@ -SET(PACKAGE_VERSION 4.0) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) +set(PACKAGE_VERSION 4.0) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) diff --git a/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake b/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake index 5c3bddece..4e8ee8284 100644 --- a/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake +++ b/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake @@ -1,7 +1,7 @@ -SET(PACKAGE_VERSION 1.2) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) +set(PACKAGE_VERSION 1.2) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) diff --git a/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake index 10ac53d19..78e41a5fa 100644 --- a/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake @@ -1,5 +1,5 @@ -SET(PACKAGE_VERSION 2.0) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) - SET(PACKAGE_VERSION_COMPATIBLE 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) +set(PACKAGE_VERSION 2.0) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) + set(PACKAGE_VERSION_COMPATIBLE 1) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) diff --git a/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake index af57cfa5c..8e3daff25 100644 --- a/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake @@ -1,5 +1,5 @@ -SET(PACKAGE_VERSION 3.0) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) - SET(PACKAGE_VERSION_COMPATIBLE 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) +set(PACKAGE_VERSION 3.0) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + set(PACKAGE_VERSION_COMPATIBLE 1) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) diff --git a/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake index b54d94ce6..b09c00883 100644 --- a/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake @@ -1,8 +1,8 @@ -SET(PACKAGE_VERSION 3.1) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) +set(PACKAGE_VERSION 3.1) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) diff --git a/Tests/FindPackageTest/lib/zot/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot/zot-config-version.cmake index 2a6be8640..5674f70d7 100644 --- a/Tests/FindPackageTest/lib/zot/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot/zot-config-version.cmake @@ -1,10 +1,10 @@ # This version should never, ever be used. -SET(PACKAGE_VERSION_UNSUITABLE 1) -SET(PACKAGE_VERSION 3.1) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) +set(PACKAGE_VERSION_UNSUITABLE 1) +set(PACKAGE_VERSION 3.1) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) diff --git a/Tests/FindPackageTest/lib/zot/zot-config.cmake b/Tests/FindPackageTest/lib/zot/zot-config.cmake index 442b8a4ec..916818360 100644 --- a/Tests/FindPackageTest/lib/zot/zot-config.cmake +++ b/Tests/FindPackageTest/lib/zot/zot-config.cmake @@ -1,2 +1,2 @@ # Test config file that is unsuitable. -MESSAGE(FATAL_ERROR "Unsuitable version of zot was found") +message(FATAL_ERROR "Unsuitable version of zot was found") diff --git a/Tests/Fortran/Library/CMakeLists.txt b/Tests/Fortran/Library/CMakeLists.txt index fe1368a07..6e39cda1f 100644 --- a/Tests/Fortran/Library/CMakeLists.txt +++ b/Tests/Fortran/Library/CMakeLists.txt @@ -1,11 +1,11 @@ -INCLUDE_DIRECTORIES(${Library_MODDIR}) -ADD_LIBRARY(subdir_mods a.f90 b.f90) -ADD_EXECUTABLE(subdir_exe main.f90) -TARGET_LINK_LIBRARIES(subdir_exe subdir_mods) +include_directories(${Library_MODDIR}) +add_library(subdir_mods a.f90 b.f90) +add_executable(subdir_exe main.f90) +target_link_libraries(subdir_exe subdir_mods) # Test module output directory if available. -IF(CMAKE_Fortran_MODDIR_FLAG) - SET_TARGET_PROPERTIES(subdir_mods PROPERTIES +if(CMAKE_Fortran_MODDIR_FLAG) + set_target_properties(subdir_mods PROPERTIES Fortran_MODULE_DIRECTORY modules ) -ENDIF(CMAKE_Fortran_MODDIR_FLAG) +endif(CMAKE_Fortran_MODDIR_FLAG) diff --git a/Tests/FunctionTest/CMakeLists.txt b/Tests/FunctionTest/CMakeLists.txt index 5d4f42d4a..204a8243c 100644 --- a/Tests/FunctionTest/CMakeLists.txt +++ b/Tests/FunctionTest/CMakeLists.txt @@ -1,46 +1,46 @@ # a simple C only test case cmake_minimum_required (VERSION 2.6) -PROJECT (FunctionTest) +project (FunctionTest) -FUNCTION(FAILED testname) - MESSAGE(SEND_ERROR "${testname} failed ${ARGN}") -ENDFUNCTION(FAILED) +function(FAILED testname) + message(SEND_ERROR "${testname} failed ${ARGN}") +endfunction(FAILED) -FUNCTION(PASS testname) - MESSAGE("${testname} passed ${ARGN}") -ENDFUNCTION(PASS) +function(PASS testname) + message("${testname} passed ${ARGN}") +endfunction(PASS) # test scope -SET(COUNT 3) -FUNCTION(scope_test) - SET(COUNT 4) -ENDFUNCTION(scope_test) +set(COUNT 3) +function(scope_test) + set(COUNT 4) +endfunction(scope_test) scope_test() -IF(COUNT EQUAL "3") +if(COUNT EQUAL "3") PASS("scope") -ELSE(COUNT EQUAL "3") +else(COUNT EQUAL "3") FAILED("COUNT Got: ${COUNT}") -ENDIF(COUNT EQUAL "3") +endif(COUNT EQUAL "3") # test ARGC -FUNCTION(weird_name) - IF("${ARGC}" EQUAL "3") +function(weird_name) + if("${ARGC}" EQUAL "3") PASS("ARGC") - ELSE("${ARGC}" EQUAL "3") + else("${ARGC}" EQUAL "3") FAILED("ARGC" "Got: ${ARGC}") - ENDIF("${ARGC}" EQUAL "3") -ENDFUNCTION(weird_name) + endif("${ARGC}" EQUAL "3") +endfunction(weird_name) WeIrD_nAmE(a1 a2 a3) # test ARGN -FUNCTION(test_argn_function argument) - IF("${ARGN}" EQUAL "3") +function(test_argn_function argument) + if("${ARGN}" EQUAL "3") PASS("ARGN") - ELSE("${ARGN}" EQUAL "3") + else("${ARGN}" EQUAL "3") FAILED("ARGN" "Got: ${ARGN}") - ENDIF("${ARGN}" EQUAL "3") -ENDFUNCTION(test_argn_function) + endif("${ARGN}" EQUAL "3") +endfunction(test_argn_function) Test_Argn_Function(ignored 3) # test argument naming and raise scope @@ -86,91 +86,91 @@ endif (fresult EQUAL 120) # case test -FUNCTION(strange_function m) - SET("${m}" strange_function PARENT_SCOPE) -ENDFUNCTION(strange_function m) +function(strange_function m) + set("${m}" strange_function PARENT_SCOPE) +endfunction(strange_function m) STRANGE_FUNCTION(var) set(second_var "second_var") -IF("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") +if("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") PASS("Case Test" "(${var} ${second_var})") -ELSE("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") +else("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") FAILED("Case test" "(${var} ${second_var})") -ENDIF("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") +endif("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") # test backing up command -FUNCTION(ADD_EXECUTABLE exec) +function(ADD_EXECUTABLE exec) _ADD_EXECUTABLE(mini${exec} ${ARGN}) -ENDFUNCTION(ADD_EXECUTABLE) +endfunction(ADD_EXECUTABLE) # var undef case -FUNCTION(undef_var m) - SET("${m}" PARENT_SCOPE) -ENDFUNCTION(undef_var) +function(undef_var m) + set("${m}" PARENT_SCOPE) +endfunction(undef_var) -SET(FUNCTION_UNDEFINED 1) +set(FUNCTION_UNDEFINED 1) undef_var(FUNCTION_UNDEFINED) -IF(DEFINED FUNCTION_UNDEFINED) +if(DEFINED FUNCTION_UNDEFINED) FAILED("Function Undefine Test" "(${FUNCTION_UNDEFINED})") -ELSE(DEFINED FUNCTION_UNDEFINED) +else(DEFINED FUNCTION_UNDEFINED) PASS("Function Undefine Test" "(${FUNCTION_UNDEFINED})") -ENDIF(DEFINED FUNCTION_UNDEFINED) +endif(DEFINED FUNCTION_UNDEFINED) # Subdirectory scope raise. -SET(SUBDIR_UNDEFINED 1) -ADD_SUBDIRECTORY(SubDirScope) -IF(DEFINED SUBDIR_UNDEFINED) +set(SUBDIR_UNDEFINED 1) +add_subdirectory(SubDirScope) +if(DEFINED SUBDIR_UNDEFINED) FAILED("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})") -ELSE(DEFINED SUBDIR_UNDEFINED) +else(DEFINED SUBDIR_UNDEFINED) PASS("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})") -ENDIF(DEFINED SUBDIR_UNDEFINED) -IF(DEFINED SUBDIR_DEFINED) +endif(DEFINED SUBDIR_UNDEFINED) +if(DEFINED SUBDIR_DEFINED) PASS("Subdir Define Test" "(${SUBDIR_DEFINED})") -ELSE(DEFINED SUBDIR_DEFINED) +else(DEFINED SUBDIR_DEFINED) FAILED("Subdir Define Test" "(${SUBDIR_DEFINED})") -ENDIF(DEFINED SUBDIR_DEFINED) +endif(DEFINED SUBDIR_DEFINED) # Test function-scoped directory. -FUNCTION(ADD_SUBDIR2 dir) - ADD_SUBDIRECTORY("${dir}" "${dir}2") +function(ADD_SUBDIR2 dir) + add_subdirectory("${dir}" "${dir}2") # The parent scope sets in the subdir should be visible here. - IF(DEFINED SUBDIR_UNDEFINED) + if(DEFINED SUBDIR_UNDEFINED) FAILED("Subdir Function Undefine Test 1" "(${SUBDIR_UNDEFINED})") - ELSE(DEFINED SUBDIR_UNDEFINED) + else(DEFINED SUBDIR_UNDEFINED) PASS("Subdir Function Undefine Test 1" "(${SUBDIR_UNDEFINED})") - ENDIF(DEFINED SUBDIR_UNDEFINED) - IF(DEFINED SUBDIR_DEFINED) + endif(DEFINED SUBDIR_UNDEFINED) + if(DEFINED SUBDIR_DEFINED) PASS("Subdir Function Define Test 1" "(${SUBDIR_DEFINED})") - ELSE(DEFINED SUBDIR_DEFINED) + else(DEFINED SUBDIR_DEFINED) FAILED("Subdir Function Define Test 1" "(${SUBDIR_DEFINED})") - ENDIF(DEFINED SUBDIR_DEFINED) -ENDFUNCTION(ADD_SUBDIR2) + endif(DEFINED SUBDIR_DEFINED) +endfunction(ADD_SUBDIR2) # Reset test variables. -SET(SUBDIR_UNDEFINED 1) -SET(SUBDIR_DEFINED) +set(SUBDIR_UNDEFINED 1) +set(SUBDIR_DEFINED) # Run test function. ADD_SUBDIR2(SubDirScope) # The parent scope sets in the subdir should not be visible here. -IF(DEFINED SUBDIR_UNDEFINED) +if(DEFINED SUBDIR_UNDEFINED) PASS("Subdir Function Undefine Test 2" "(${SUBDIR_UNDEFINED})") -ELSE(DEFINED SUBDIR_UNDEFINED) +else(DEFINED SUBDIR_UNDEFINED) FAILED("Subdir Function Undefine Test 2" "(${SUBDIR_UNDEFINED})") -ENDIF(DEFINED SUBDIR_UNDEFINED) -IF(DEFINED SUBDIR_DEFINED) +endif(DEFINED SUBDIR_UNDEFINED) +if(DEFINED SUBDIR_DEFINED) FAILED("Subdir Function Define Test 2" "(${SUBDIR_DEFINED})") -ELSE(DEFINED SUBDIR_DEFINED) +else(DEFINED SUBDIR_DEFINED) PASS("Subdir Function Define Test 2" "(${SUBDIR_DEFINED})") -ENDIF(DEFINED SUBDIR_DEFINED) +endif(DEFINED SUBDIR_DEFINED) -ADD_EXECUTABLE(FunctionTest functionTest.c) +add_executable(FunctionTest functionTest.c) # Use the PROJECT_LABEL property: in IDEs, the project label should appear # in the UI rather than the target name. If this were a good test of the # property rather than just a smoke test, it would verify that the label # actually appears in the UI of the IDE... Or at least that the text appears # somewhere in the generated project files. -SET_PROPERTY(TARGET miniFunctionTest +set_property(TARGET miniFunctionTest PROPERTY PROJECT_LABEL "Test de Fonctionnement") diff --git a/Tests/FunctionTest/SubDirScope/CMakeLists.txt b/Tests/FunctionTest/SubDirScope/CMakeLists.txt index 4a53d2c0a..c40fadb72 100644 --- a/Tests/FunctionTest/SubDirScope/CMakeLists.txt +++ b/Tests/FunctionTest/SubDirScope/CMakeLists.txt @@ -1,14 +1,14 @@ -SET(SUBDIR_DEFINED 1 PARENT_SCOPE) -SET(SUBDIR_UNDEFINED PARENT_SCOPE) +set(SUBDIR_DEFINED 1 PARENT_SCOPE) +set(SUBDIR_UNDEFINED PARENT_SCOPE) # The above sets should not affect the current scope. -IF(DEFINED SUBDIR_UNDEFINED) +if(DEFINED SUBDIR_UNDEFINED) PASS("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})") -ELSE(DEFINED SUBDIR_UNDEFINED) +else(DEFINED SUBDIR_UNDEFINED) FAILED("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})") -ENDIF(DEFINED SUBDIR_UNDEFINED) -IF(DEFINED SUBDIR_DEFINED) +endif(DEFINED SUBDIR_UNDEFINED) +if(DEFINED SUBDIR_DEFINED) FAILED("SubdirScope Define Test" "(${SUBDIR_DEFINED})") -ELSE(DEFINED SUBDIR_DEFINED) +else(DEFINED SUBDIR_DEFINED) PASS("SubdirScope Define Test" "(${SUBDIR_DEFINED})") -ENDIF(DEFINED SUBDIR_DEFINED) +endif(DEFINED SUBDIR_DEFINED) diff --git a/Tests/IPO/CMakeLists.txt b/Tests/IPO/CMakeLists.txt index 595e4f50d..6dabf86bb 100644 --- a/Tests/IPO/CMakeLists.txt +++ b/Tests/IPO/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.8) project(IPO NONE) -SET_PROPERTY(DIRECTORY PROPERTY INTERPROCEDURAL_OPTIMIZATION 1) +set_property(DIRECTORY PROPERTY INTERPROCEDURAL_OPTIMIZATION 1) add_subdirectory(../COnly COnly) add_subdirectory(../CxxOnly CxxOnly) diff --git a/Tests/Jump/CMakeLists.txt b/Tests/Jump/CMakeLists.txt index 4bdafd09b..4c5ad303f 100644 --- a/Tests/Jump/CMakeLists.txt +++ b/Tests/Jump/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(Jump) +project(Jump) -SET(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1) -ADD_SUBDIRECTORY(Executable) -ADD_SUBDIRECTORY(Library) +set(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1) +add_subdirectory(Executable) +add_subdirectory(Library) diff --git a/Tests/Jump/Executable/CMakeLists.txt b/Tests/Jump/Executable/CMakeLists.txt index 7658b7e31..a09bac739 100644 --- a/Tests/Jump/Executable/CMakeLists.txt +++ b/Tests/Jump/Executable/CMakeLists.txt @@ -1,6 +1,6 @@ -IF(NOT LIBRARY_OUTPUT_PATH) - LINK_DIRECTORIES(${Jump_BINARY_DIR}/Library/Static +if(NOT LIBRARY_OUTPUT_PATH) + link_directories(${Jump_BINARY_DIR}/Library/Static ${Jump_BINARY_DIR}/Library/Shared) -ENDIF(NOT LIBRARY_OUTPUT_PATH) -ADD_EXECUTABLE(jumpExecutable jumpExecutable.cxx) -TARGET_LINK_LIBRARIES(jumpExecutable jumpStatic jumpShared) +endif(NOT LIBRARY_OUTPUT_PATH) +add_executable(jumpExecutable jumpExecutable.cxx) +target_link_libraries(jumpExecutable jumpStatic jumpShared) diff --git a/Tests/Jump/Library/CMakeLists.txt b/Tests/Jump/Library/CMakeLists.txt index 2f78c501c..1d9fed934 100644 --- a/Tests/Jump/Library/CMakeLists.txt +++ b/Tests/Jump/Library/CMakeLists.txt @@ -1,2 +1,2 @@ -ADD_SUBDIRECTORY(Static) -ADD_SUBDIRECTORY(Shared) +add_subdirectory(Static) +add_subdirectory(Shared) diff --git a/Tests/Jump/Library/Shared/CMakeLists.txt b/Tests/Jump/Library/Shared/CMakeLists.txt index 44405770f..87d40e54d 100644 --- a/Tests/Jump/Library/Shared/CMakeLists.txt +++ b/Tests/Jump/Library/Shared/CMakeLists.txt @@ -1,26 +1,26 @@ -ADD_LIBRARY(jumpShared SHARED jumpShared.cxx) +add_library(jumpShared SHARED jumpShared.cxx) -IF(WIN32 OR CYGWIN) - SET(SHARED_MUST_BE_IN_EXE_DIR 1) -ENDIF() +if(WIN32 OR CYGWIN) + set(SHARED_MUST_BE_IN_EXE_DIR 1) +endif() -IF(APPLE) - SET(SHARED_MUST_BE_IN_EXE_DIR 1) -ENDIF(APPLE) +if(APPLE) + set(SHARED_MUST_BE_IN_EXE_DIR 1) +endif(APPLE) -IF(SHARED_MUST_BE_IN_EXE_DIR) - SET(LIB_NAME +if(SHARED_MUST_BE_IN_EXE_DIR) + set(LIB_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}jumpShared${CMAKE_SHARED_LIBRARY_SUFFIX}) - SET(EXE_DIR ${Jump_BINARY_DIR}/Executable) - IF(EXECUTABLE_OUTPUT_PATH) - SET(EXE_DIR ${EXECUTABLE_OUTPUT_PATH}) - ENDIF(EXECUTABLE_OUTPUT_PATH) - SET(LIB_DIR ${Jump_BINARY_DIR}/Library/Shared) - IF(LIBRARY_OUTPUT_PATH) - SET(LIB_DIR ${LIBRARY_OUTPUT_PATH}) - ENDIF(LIBRARY_OUTPUT_PATH) - ADD_CUSTOM_COMMAND(TARGET jumpShared + set(EXE_DIR ${Jump_BINARY_DIR}/Executable) + if(EXECUTABLE_OUTPUT_PATH) + set(EXE_DIR ${EXECUTABLE_OUTPUT_PATH}) + endif(EXECUTABLE_OUTPUT_PATH) + set(LIB_DIR ${Jump_BINARY_DIR}/Library/Shared) + if(LIBRARY_OUTPUT_PATH) + set(LIB_DIR ${LIBRARY_OUTPUT_PATH}) + endif(LIBRARY_OUTPUT_PATH) + add_custom_command(TARGET jumpShared POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy ${LIB_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME} ${EXE_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME}) -ENDIF(SHARED_MUST_BE_IN_EXE_DIR) +endif(SHARED_MUST_BE_IN_EXE_DIR) diff --git a/Tests/Jump/Library/Static/CMakeLists.txt b/Tests/Jump/Library/Static/CMakeLists.txt index 23e70c0b1..4ee39545a 100644 --- a/Tests/Jump/Library/Static/CMakeLists.txt +++ b/Tests/Jump/Library/Static/CMakeLists.txt @@ -1 +1 @@ -ADD_LIBRARY(jumpStatic STATIC jumpStatic.cxx) +add_library(jumpStatic STATIC jumpStatic.cxx) diff --git a/Tests/LibName/CMakeLists.txt b/Tests/LibName/CMakeLists.txt index 75dec4eb3..b3ad31114 100644 --- a/Tests/LibName/CMakeLists.txt +++ b/Tests/LibName/CMakeLists.txt @@ -11,9 +11,9 @@ target_link_libraries(foo bar) add_executable(foobar foobar.c) target_link_libraries(foobar foo) -IF(UNIX) +if(UNIX) target_link_libraries(foobar -L/usr/local/lib) -ENDIF(UNIX) +endif(UNIX) # check with lib version diff --git a/Tests/LinkLine/CMakeLists.txt b/Tests/LinkLine/CMakeLists.txt index c8f0ecf63..6154dd469 100644 --- a/Tests/LinkLine/CMakeLists.txt +++ b/Tests/LinkLine/CMakeLists.txt @@ -1,12 +1,12 @@ -PROJECT( LinkLine ) +project( LinkLine ) # Makes sure that the library order as specified by the user are # unchanged by dependency analysis, etc. libOne and libTwo are # dependent on each other. The link line should be -lOne -lTwo -lOne. -ADD_LIBRARY( One One.c ) -ADD_LIBRARY( Two Two.c ) +add_library( One One.c ) +add_library( Two Two.c ) -LINK_LIBRARIES( One Two ) -ADD_EXECUTABLE( LinkLine Exec.c ) -LINK_LIBRARIES( One ) +link_libraries( One Two ) +add_executable( LinkLine Exec.c ) +link_libraries( One ) diff --git a/Tests/LinkLineOrder/CMakeLists.txt b/Tests/LinkLineOrder/CMakeLists.txt index 21a502217..78455e971 100644 --- a/Tests/LinkLineOrder/CMakeLists.txt +++ b/Tests/LinkLineOrder/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT( LinkLineOrder ) +project( LinkLineOrder ) # This tests ensures that the order of libraries are preserved when # they don't have dependency information, even if they are deep in the @@ -9,28 +9,28 @@ PROJECT( LinkLineOrder ) # has no information about these libraries except for the order they # are specified in One. We must make sure we don't lose that. -ADD_LIBRARY( NoDepA NoDepA.c ) -ADD_LIBRARY( NoDepB NoDepB.c ) -ADD_LIBRARY( NoDepC NoDepC.c ) -ADD_LIBRARY( NoDepE NoDepE.c ) -ADD_LIBRARY( NoDepF NoDepF.c ) +add_library( NoDepA NoDepA.c ) +add_library( NoDepB NoDepB.c ) +add_library( NoDepC NoDepC.c ) +add_library( NoDepE NoDepE.c ) +add_library( NoDepF NoDepF.c ) -ADD_LIBRARY( One One.c ) -TARGET_LINK_LIBRARIES( One NoDepC NoDepA NoDepB NoDepE NoDepF NoDepE ) +add_library( One One.c ) +target_link_libraries( One NoDepC NoDepA NoDepB NoDepE NoDepF NoDepE ) -ADD_EXECUTABLE( Exec1 Exec1.c ) -TARGET_LINK_LIBRARIES( Exec1 One ) +add_executable( Exec1 Exec1.c ) +target_link_libraries( Exec1 One ) # Similar situation as One, except at a different level of the # dependency tree. This makes sure that the order is presevered # everywhere in the graph. -ADD_LIBRARY( NoDepX NoDepX.c ) -ADD_LIBRARY( NoDepY NoDepY.c ) -ADD_LIBRARY( NoDepZ NoDepZ.c ) +add_library( NoDepX NoDepX.c ) +add_library( NoDepY NoDepY.c ) +add_library( NoDepZ NoDepZ.c ) -ADD_LIBRARY( Two Two.c ) -TARGET_LINK_LIBRARIES( Two One NoDepZ NoDepX NoDepY ) +add_library( Two Two.c ) +target_link_libraries( Two One NoDepZ NoDepX NoDepY ) -ADD_EXECUTABLE( Exec2 Exec2.c ) -TARGET_LINK_LIBRARIES( Exec2 Two ) +add_executable( Exec2 Exec2.c ) +target_link_libraries( Exec2 Two ) diff --git a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt index 5cdbc59bf..276fdb681 100644 --- a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt +++ b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt @@ -1,14 +1,14 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CMAKE_LOADED_COMMANDS) +project(CMAKE_LOADED_COMMANDS) -IF (MUDSLIDE_TYPE MATCHES MUCHO) - ADD_DEFINITIONS(-DMUCHO_MUDSLIDE) -ENDIF (MUDSLIDE_TYPE MATCHES MUCHO) +if (MUDSLIDE_TYPE MATCHES MUCHO) + add_definitions(-DMUCHO_MUDSLIDE) +endif (MUDSLIDE_TYPE MATCHES MUCHO) -INCLUDE_DIRECTORIES(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) +include_directories(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) -ADD_LIBRARY(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) +add_library(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) -IF(WATCOM) - TARGET_LINK_LIBRARIES(cmCMAKE_TEST_COMMAND clbsdll.lib) -ENDIF(WATCOM) +if(WATCOM) + target_link_libraries(cmCMAKE_TEST_COMMAND clbsdll.lib) +endif(WATCOM) diff --git a/Tests/LoadCommand/CMakeLists.txt b/Tests/LoadCommand/CMakeLists.txt index 32e73f00c..9787f83ad 100644 --- a/Tests/LoadCommand/CMakeLists.txt +++ b/Tests/LoadCommand/CMakeLists.txt @@ -1,63 +1,63 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(LoadCommand) +project(LoadCommand) # set a definition -SET (TEST_COMMAND_TEST1 1) +set (TEST_COMMAND_TEST1 1) -INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) +include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) CHECK_TYPE_SIZE(char SIZEOF_CHAR) CHECK_TYPE_SIZE(short SIZEOF_SHORT) -INCLUDE (CheckFunctionExists) +include (CheckFunctionExists) CHECK_FUNCTION_EXISTS(printf HAVE_PRINTF) CHECK_FUNCTION_EXISTS(vsblabla HAVE_VSBLABLA) -CONFIGURE_FILE(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in +configure_file(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in ${LoadCommand_BINARY_DIR}/LoadedCommand.h) -INCLUDE_DIRECTORIES(${LoadCommand_BINARY_DIR}) +include_directories(${LoadCommand_BINARY_DIR}) # try to compile the command # make sure it is not already loaded -IF(COMMAND CMAKE_TEST_COMMAND) -ELSE(COMMAND CMAKE_TEST_COMMAND) - TRY_COMPILE(COMPILE_OK +if(COMMAND CMAKE_TEST_COMMAND) +else(COMMAND CMAKE_TEST_COMMAND) + try_compile(COMPILE_OK ${LoadCommand_BINARY_DIR}/CMakeCommands ${LoadCommand_SOURCE_DIR}/CMakeCommands CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO OUTPUT_VARIABLE OUTPUT ) # do another TRY_COMPILE to get around make # problem on hp - TRY_COMPILE(COMPILE_OK + try_compile(COMPILE_OK ${LoadCommand_BINARY_DIR}/CMakeCommands ${LoadCommand_SOURCE_DIR}/CMakeCommands CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO OUTPUT_VARIABLE OUTPUT ) -ENDIF(COMMAND CMAKE_TEST_COMMAND) +endif(COMMAND CMAKE_TEST_COMMAND) -MESSAGE("Output from try compile: ${OUTPUT}") +message("Output from try compile: ${OUTPUT}") # if the compile was OK, try loading the command -IF (COMPILE_OK) - LOAD_COMMAND(CMAKE_TEST_COMMAND +if (COMPILE_OK) + load_command(CMAKE_TEST_COMMAND ${LoadCommand_BINARY_DIR}/CMakeCommands ${LoadCommand_BINARY_DIR}/CMakeCommands/Debug ${LoadCommand_BINARY_DIR}/CMakeCommands/Development ) # if the command loaded, execute the command - IF (COMMAND CMAKE_TEST_COMMAND) + if (COMMAND CMAKE_TEST_COMMAND) CMAKE_TEST_COMMAND( "${LoadCommand_SOURCE_DIR}/LoadedCommand.cxx.in" "${LoadCommand_BINARY_DIR}/LoadedCommand2.cxx.in" "${LoadCommand_BINARY_DIR}/LoadedCommand3.cxx" ) - ENDIF (COMMAND CMAKE_TEST_COMMAND) -ELSE (COMPILE_OK) - MESSAGE("failed to compile CMAKE_LOADED_COMMANDS") -ENDIF (COMPILE_OK) + endif (COMMAND CMAKE_TEST_COMMAND) +else (COMPILE_OK) + message("failed to compile CMAKE_LOADED_COMMANDS") +endif (COMPILE_OK) # TEST_DEF is set by the loaded command cmTestCommand.c -IF (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) - ADD_DEFINITIONS(-DCMAKE_IS_FUN) -ENDIF (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) +if (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) + add_definitions(-DCMAKE_IS_FUN) +endif (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt index 953d05c99..2d96b0413 100644 --- a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt +++ b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt @@ -1,17 +1,17 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CMAKE_LOADED_COMMANDS) +project(CMAKE_LOADED_COMMANDS) -IF (MUDSLIDE_TYPE MATCHES MUCHO) - ADD_DEFINITIONS(-DMUCHO_MUDSLIDE) -ENDIF (MUDSLIDE_TYPE MATCHES MUCHO) +if (MUDSLIDE_TYPE MATCHES MUCHO) + add_definitions(-DMUCHO_MUDSLIDE) +endif (MUDSLIDE_TYPE MATCHES MUCHO) -IF(WATCOM) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") -ENDIF(WATCOM) -INCLUDE_DIRECTORIES(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) +if(WATCOM) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +endif(WATCOM) +include_directories(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) -ADD_LIBRARY(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) +add_library(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) -IF(WATCOM) - TARGET_LINK_LIBRARIES(cmCMAKE_TEST_COMMAND clbsdll.lib) -ENDIF(WATCOM) +if(WATCOM) + target_link_libraries(cmCMAKE_TEST_COMMAND clbsdll.lib) +endif(WATCOM) diff --git a/Tests/LoadCommandOneConfig/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeLists.txt index 4bfa59964..a443605f2 100644 --- a/Tests/LoadCommandOneConfig/CMakeLists.txt +++ b/Tests/LoadCommandOneConfig/CMakeLists.txt @@ -1,69 +1,69 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(LoadCommand) +project(LoadCommand) # set a definition -SET (TEST_COMMAND_TEST1 1) +set (TEST_COMMAND_TEST1 1) -INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) +include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) CHECK_TYPE_SIZE(char SIZEOF_CHAR) CHECK_TYPE_SIZE(short SIZEOF_SHORT) -INCLUDE (CheckFunctionExists) +include (CheckFunctionExists) CHECK_FUNCTION_EXISTS(printf HAVE_PRINTF) CHECK_FUNCTION_EXISTS(vsblabla HAVE_VSBLABLA) -INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) +include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) CHECK_INCLUDE_FILE("sys/prctl.h" HAVE_SYS_PRCTL_H) -INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) CHECK_LIBRARY_EXISTS(m ceil "" HAVE_LIBM) -CONFIGURE_FILE(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in +configure_file(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in ${LoadCommand_BINARY_DIR}/LoadedCommand.h) -INCLUDE_DIRECTORIES(${LoadCommand_BINARY_DIR}) +include_directories(${LoadCommand_BINARY_DIR}) # try to compile the command # make sure it is not already loaded -IF(COMMAND CMAKE_TEST_COMMAND) -ELSE(COMMAND CMAKE_TEST_COMMAND) - TRY_COMPILE(COMPILE_OK +if(COMMAND CMAKE_TEST_COMMAND) +else(COMMAND CMAKE_TEST_COMMAND) + try_compile(COMPILE_OK ${LoadCommand_BINARY_DIR}/CMakeCommands ${LoadCommand_SOURCE_DIR}/CMakeCommands CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO OUTPUT_VARIABLE OUTPUT ) # do another TRY_COMPILE to get around make # problem on hp - TRY_COMPILE(COMPILE_OK + try_compile(COMPILE_OK ${LoadCommand_BINARY_DIR}/CMakeCommands ${LoadCommand_SOURCE_DIR}/CMakeCommands CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO OUTPUT_VARIABLE OUTPUT ) -ENDIF(COMMAND CMAKE_TEST_COMMAND) +endif(COMMAND CMAKE_TEST_COMMAND) -MESSAGE("Output from try compile: ${OUTPUT}") +message("Output from try compile: ${OUTPUT}") # if the compile was OK, try loading the command -IF (COMPILE_OK) - LOAD_COMMAND(CMAKE_TEST_COMMAND +if (COMPILE_OK) + load_command(CMAKE_TEST_COMMAND ${LoadCommand_BINARY_DIR}/CMakeCommands ${LoadCommand_BINARY_DIR}/CMakeCommands/Debug ${LoadCommand_BINARY_DIR}/CMakeCommands/Development ) # if the command loaded, execute the command - IF (COMMAND CMAKE_TEST_COMMAND) + if (COMMAND CMAKE_TEST_COMMAND) CMAKE_TEST_COMMAND( "${LoadCommand_SOURCE_DIR}/LoadedCommand.cxx.in" "${LoadCommand_BINARY_DIR}/LoadedCommand2.cxx.in" "${LoadCommand_BINARY_DIR}/LoadedCommand3.cxx" ) - ENDIF (COMMAND CMAKE_TEST_COMMAND) -ELSE (COMPILE_OK) - MESSAGE("failed to compile CMAKE_LOADED_COMMANDS") -ENDIF (COMPILE_OK) + endif (COMMAND CMAKE_TEST_COMMAND) +else (COMPILE_OK) + message("failed to compile CMAKE_LOADED_COMMANDS") +endif (COMPILE_OK) # TEST_DEF is set by the loaded command cmTestCommand.c -IF (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) - ADD_DEFINITIONS(-DCMAKE_IS_FUN) -ENDIF (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) +if (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) + add_definitions(-DCMAKE_IS_FUN) +endif (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) diff --git a/Tests/MacroTest/CMakeLists.txt b/Tests/MacroTest/CMakeLists.txt index ef673fd85..9d189b92a 100644 --- a/Tests/MacroTest/CMakeLists.txt +++ b/Tests/MacroTest/CMakeLists.txt @@ -1,53 +1,53 @@ # a simple C only test case cmake_minimum_required (VERSION 2.6) -PROJECT (MacroTest) +project (MacroTest) -MACRO(FAILED testname) - MESSAGE(SEND_ERROR "${testname} failed ${ARGN}") -ENDMACRO(FAILED) +macro(FAILED testname) + message(SEND_ERROR "${testname} failed ${ARGN}") +endmacro(FAILED) -MACRO(PASS testname) - MESSAGE("${testname} passed ${ARGN}") -ENDMACRO(PASS) +macro(PASS testname) + message("${testname} passed ${ARGN}") +endmacro(PASS) # test ARGC -MACRO(weird_name) - IF("${ARGC}" EQUAL "3") +macro(weird_name) + if("${ARGC}" EQUAL "3") PASS("ARGC") - ELSE("${ARGC}" EQUAL "3") + else("${ARGC}" EQUAL "3") FAILED("ARGC" "Got: ${ARGC}") - ENDIF("${ARGC}" EQUAL "3") -ENDMACRO(weird_name) + endif("${ARGC}" EQUAL "3") +endmacro(weird_name) WeIrD_nAmE(a1 a2 a3) # test ARGN -MACRO(test_argn_macro argument) - IF("${ARGN}" EQUAL "3") +macro(test_argn_macro argument) + if("${ARGN}" EQUAL "3") PASS("ARGN") - ELSE("${ARGN}" EQUAL "3") + else("${ARGN}" EQUAL "3") FAILED("ARGN" "Got: ${ARGN}") - ENDIF("${ARGN}" EQUAL "3") -ENDMACRO(test_argn_macro) + endif("${ARGN}" EQUAL "3") +endmacro(test_argn_macro) Test_Argn_Macro(ignored 3) # case test -MACRO(strange_macro m) - SET("${m}" strange_macro) -ENDMACRO(strange_macro m) +macro(strange_macro m) + set("${m}" strange_macro) +endmacro(strange_macro m) STRANGE_MACRO(var) set(second_var "second_var") -IF("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") +if("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") PASS("Case Test" "(${var} ${second_var})") -ELSE("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") +else("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") FAILED("Case test" "(${var} ${second_var})") -ENDIF("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") +endif("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") # test backing up command -MACRO(ADD_EXECUTABLE exec) +macro(ADD_EXECUTABLE exec) _ADD_EXECUTABLE("mini${exec}" ${ARGN}) -ENDMACRO(ADD_EXECUTABLE) +endmacro(ADD_EXECUTABLE) -INCLUDE(CheckCSourceCompiles) +include(CheckCSourceCompiles) Check_C_Source_Compiles( " #include @@ -62,13 +62,13 @@ int main(int ac, char*av[]){ return 0; }" SOME_CHECK) -IF(SOME_CHECK) - MESSAGE("CheckCSourceCompiles works") -ELSE(SOME_CHECK) - MESSAGE(FATAL_ERROR "CheckCSourceCompiles does not work") -ENDIF(SOME_CHECK) +if(SOME_CHECK) + message("CheckCSourceCompiles works") +else(SOME_CHECK) + message(FATAL_ERROR "CheckCSourceCompiles does not work") +endif(SOME_CHECK) -INCLUDE(CheckCXXSourceCompiles) +include(CheckCXXSourceCompiles) Check_CXX_Source_Compiles( " #include @@ -77,15 +77,15 @@ int main(int ac, char*av[]){ return 0; }" SOME_CHECK) -IF(SOME_CHECK) - MESSAGE("CheckCXXSourceCompiles works") -ELSE(SOME_CHECK) - MESSAGE(FATAL_ERROR "CheckCXXSourceCompiles does not work") -ENDIF(SOME_CHECK) +if(SOME_CHECK) + message("CheckCXXSourceCompiles works") +else(SOME_CHECK) + message(FATAL_ERROR "CheckCXXSourceCompiles does not work") +endif(SOME_CHECK) -ADD_EXECUTABLE(MacroTest macroTest.c) +add_executable(MacroTest macroTest.c) -MACRO(GET_CURRENT_FILE var) - SET(${var} ${CMAKE_CURRENT_LIST_FILE}) -ENDMACRO(GET_CURRENT_FILE) -INCLUDE(context.cmake) +macro(GET_CURRENT_FILE var) + set(${var} ${CMAKE_CURRENT_LIST_FILE}) +endmacro(GET_CURRENT_FILE) +include(context.cmake) diff --git a/Tests/MacroTest/context.cmake b/Tests/MacroTest/context.cmake index f4d7035fb..82eb4856b 100644 --- a/Tests/MacroTest/context.cmake +++ b/Tests/MacroTest/context.cmake @@ -1,10 +1,10 @@ GET_CURRENT_FILE(current_file) -IF(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}") - MESSAGE(FATAL_ERROR +if(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}") + message(FATAL_ERROR "Macro file context is broken. Expected:\n" " ${CMAKE_CURRENT_LIST_FILE}\n" "but got:\n" " ${current_file}\n" "from the macro." ) -ENDIF(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}") +endif(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}") diff --git a/Tests/MakeClean/CMakeLists.txt b/Tests/MakeClean/CMakeLists.txt index 97d3554bd..74007542c 100644 --- a/Tests/MakeClean/CMakeLists.txt +++ b/Tests/MakeClean/CMakeLists.txt @@ -1,47 +1,47 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(MakeClean) +project(MakeClean) # Build the to-clean project. -TRY_COMPILE(TOCLEAN_BUILT +try_compile(TOCLEAN_BUILT ${MakeClean_BINARY_DIR}/ToClean ${MakeClean_SOURCE_DIR}/ToClean ToClean OUTPUT_VARIABLE OUTPUT ) -IF(TOCLEAN_BUILT) - MESSAGE( +if(TOCLEAN_BUILT) + message( "Building ToClean succeeded with the following output:\n" "[${OUTPUT}]" ) -ELSE(TOCLEAN_BUILT) - MESSAGE(FATAL_ERROR +else(TOCLEAN_BUILT) + message(FATAL_ERROR "Building ToClean failed with the following output:\n" "[${OUTPUT}]" ) -ENDIF(TOCLEAN_BUILT) +endif(TOCLEAN_BUILT) # Get the set of files to check from the ToClean project. -INCLUDE(${MakeClean_BINARY_DIR}/ToClean/ToCleanFiles.cmake) +include(${MakeClean_BINARY_DIR}/ToClean/ToCleanFiles.cmake) # Check for the existence of the files. -FOREACH(f ${TOCLEAN_FILES}) - IF(EXISTS "${f}") - ELSE(EXISTS "${f}") - MESSAGE(FATAL_ERROR "File \"${f}\" does not exist!") - ENDIF(EXISTS "${f}") -ENDFOREACH(f) +foreach(f ${TOCLEAN_FILES}) + if(EXISTS "${f}") + else(EXISTS "${f}") + message(FATAL_ERROR "File \"${f}\" does not exist!") + endif(EXISTS "${f}") +endforeach(f) # Configure an executable to check that all the files are missing. -SET(CHECK_FILES) -FOREACH(f ${TOCLEAN_FILES}) - SET(CHECK_FILES "${CHECK_FILES} \"${f}\",\n") -ENDFOREACH(f) -CONFIGURE_FILE(${MakeClean_SOURCE_DIR}/check_clean.c.in +set(CHECK_FILES) +foreach(f ${TOCLEAN_FILES}) + set(CHECK_FILES "${CHECK_FILES} \"${f}\",\n") +endforeach(f) +configure_file(${MakeClean_SOURCE_DIR}/check_clean.c.in ${MakeClean_BINARY_DIR}/check_clean.c @ONLY IMMEDIATE) -ADD_EXECUTABLE(check_clean ${MakeClean_BINARY_DIR}/check_clean.c) +add_executable(check_clean ${MakeClean_BINARY_DIR}/check_clean.c) # After the executable builds, clean the files. -ADD_CUSTOM_COMMAND( +add_custom_command( TARGET check_clean POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND} diff --git a/Tests/MakeClean/ToClean/CMakeLists.txt b/Tests/MakeClean/ToClean/CMakeLists.txt index 50facadb7..28569dd1d 100644 --- a/Tests/MakeClean/ToClean/CMakeLists.txt +++ b/Tests/MakeClean/ToClean/CMakeLists.txt @@ -1,31 +1,31 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(ToClean) +cmake_minimum_required(VERSION 2.6) +project(ToClean) # Build a simple project. -ADD_EXECUTABLE(toclean toclean.cxx) +add_executable(toclean toclean.cxx) # List some build-time-generated files. -GET_TARGET_PROPERTY(TOCLEAN_FILES toclean LOCATION) -SET(TOCLEAN_FILES ${TOCLEAN_FILES} +get_target_property(TOCLEAN_FILES toclean LOCATION) +set(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/toclean.dir/toclean.cxx${CMAKE_CXX_OUTPUT_EXTENSION}") # Create a file that must be registered for cleaning. -FILE(WRITE "${ToClean_BINARY_DIR}/Registered.txt" +file(WRITE "${ToClean_BINARY_DIR}/Registered.txt" "File registered for cleaning.\n") -SET_DIRECTORY_PROPERTIES(PROPERTIES +set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${ToClean_BINARY_DIR}/Registered.txt") -SET(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/Registered.txt") +set(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/Registered.txt") # Create a custom command whose output should be cleaned. -ADD_CUSTOM_COMMAND(OUTPUT ${ToClean_BINARY_DIR}/generated.txt +add_custom_command(OUTPUT ${ToClean_BINARY_DIR}/generated.txt DEPENDS ${ToClean_SOURCE_DIR}/toclean.cxx COMMAND ${CMAKE_COMMAND} ARGS -E copy ${ToClean_SOURCE_DIR}/toclean.cxx ${ToClean_BINARY_DIR}/generated.txt ) -ADD_CUSTOM_TARGET(generate ALL DEPENDS ${ToClean_BINARY_DIR}/generated.txt) -SET(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/generated.txt") +add_custom_target(generate ALL DEPENDS ${ToClean_BINARY_DIR}/generated.txt) +set(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/generated.txt") # Configure a file listing these build-time-generated files. -CONFIGURE_FILE(${ToClean_SOURCE_DIR}/ToCleanFiles.cmake.in +configure_file(${ToClean_SOURCE_DIR}/ToCleanFiles.cmake.in ${ToClean_BINARY_DIR}/ToCleanFiles.cmake @ONLY IMMEDIATE) diff --git a/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in b/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in index 10d11c37a..e7d99470c 100644 --- a/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in +++ b/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in @@ -1 +1 @@ -SET(TOCLEAN_FILES "@TOCLEAN_FILES@") +set(TOCLEAN_FILES "@TOCLEAN_FILES@") diff --git a/Tests/MathTest/CMakeLists.txt b/Tests/MathTest/CMakeLists.txt index d1e5b1acd..44d4aae15 100644 --- a/Tests/MathTest/CMakeLists.txt +++ b/Tests/MathTest/CMakeLists.txt @@ -1,10 +1,10 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(MathTest) +project(MathTest) # Expression test -SET(expressions +set(expressions "5 * ( 3 + 4)" "(1 | 2 | 4 | 8) & 16" "1 +(3*4) + 10 >> 2" @@ -12,18 +12,18 @@ SET(expressions "10000 / (20 / 4)" ) -SET(FILE_EXPRESSIONS "") -FOREACH(expression +set(FILE_EXPRESSIONS "") +foreach(expression ${expressions}) - MATH(EXPR expr "${expression}") - SET(FILE_EXPRESSIONS "${FILE_EXPRESSIONS}TEST_EXPRESSION(${expression}, ${expr})\n") -ENDFOREACH(expression) + math(EXPR expr "${expression}") + set(FILE_EXPRESSIONS "${FILE_EXPRESSIONS}TEST_EXPRESSION(${expression}, ${expr})\n") +endforeach(expression) -CONFIGURE_FILE( +configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/MathTestTests.h.in" "${CMAKE_CURRENT_BINARY_DIR}/MathTestTests.h" @ONLY) -INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}") -ADD_EXECUTABLE(MathTest MathTestExec.cxx) +include_directories("${CMAKE_CURRENT_BINARY_DIR}") +add_executable(MathTest MathTestExec.cxx) diff --git a/Tests/ObjC++/CMakeLists.txt b/Tests/ObjC++/CMakeLists.txt index c892bd0a1..8b1563ed8 100644 --- a/Tests/ObjC++/CMakeLists.txt +++ b/Tests/ObjC++/CMakeLists.txt @@ -1,6 +1,6 @@ # a simple objc++ test case that uses Cocoa framework -PROJECT (ObjC++) +project (ObjC++) -ADD_EXECUTABLE (ObjC++ objc++.mm) -TARGET_LINK_LIBRARIES(ObjC++ "-framework Cocoa") +add_executable (ObjC++ objc++.mm) +target_link_libraries(ObjC++ "-framework Cocoa") diff --git a/Tests/OutOfBinary/CMakeLists.txt b/Tests/OutOfBinary/CMakeLists.txt index fcf90bd0d..e32754143 100644 --- a/Tests/OutOfBinary/CMakeLists.txt +++ b/Tests/OutOfBinary/CMakeLists.txt @@ -1,2 +1,2 @@ -ADD_LIBRARY(outlib outlib.c) +add_library(outlib outlib.c) diff --git a/Tests/OutOfSource/CMakeLists.txt b/Tests/OutOfSource/CMakeLists.txt index e250f4177..420310f5f 100644 --- a/Tests/OutOfSource/CMakeLists.txt +++ b/Tests/OutOfSource/CMakeLists.txt @@ -6,9 +6,9 @@ add_subdirectory(SubDir) get_directory_property(ANIMAL DIRECTORY OutOfSourceSubdir DEFINITION WEASELS) get_directory_property(ANIMALREL DIRECTORY SubDir/../OutOfSourceSubdir DEFINITION WEASELS) -IF(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}") - MESSAGE(FATAL_ERROR "GET_DIRECTORY_PROPERTY does not seem to collapse paths.") -ENDIF(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}") +if(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}") + message(FATAL_ERROR "GET_DIRECTORY_PROPERTY does not seem to collapse paths.") +endif(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}") configure_file( ${OutOfSource_SOURCE_DIR}/testdp.h.in diff --git a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt index c362e79ba..d4188098f 100644 --- a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt +++ b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt @@ -1,62 +1,62 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) -IF ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}") - SET(BUILD_SHARED_LIBS 1) +if ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}") + set(BUILD_SHARED_LIBS 1) # Construct a source file outside the tree whose full path is close to # the path length limit. This will cause the full path to the object # file in the build tree to exceed the maximum path length which will # test cmLocalGenerator::CreateSafeUniqueObjectFileName. - GET_FILENAME_COMPONENT(DEEPDIR + get_filename_component(DEEPDIR ${OutOfSource_BINARY_DIR}/../OutOfSourceDeep/deeper ABSOLUTE) # Test giving the generator a custom limit. - SET(CMAKE_OBJECT_PATH_MAX 220) + set(CMAKE_OBJECT_PATH_MAX 220) # Use a separate variable for computation. - SET(MAXPATH "${CMAKE_OBJECT_PATH_MAX}") + set(MAXPATH "${CMAKE_OBJECT_PATH_MAX}") # VS8 adds "OutOfSource/SubDir/OutOfSourceSubdir/../../../" to the # path of the source file for no good reason. Reduce the length # limit by 46 characters to account for it. It should still be long # enough to require special object file name conversion. - IF(${CMAKE_GENERATOR} MATCHES "Visual Studio (8|10)") - MATH(EXPR MAXPATH "${MAXPATH} - 46") - ENDIF() + if(${CMAKE_GENERATOR} MATCHES "Visual Studio (8|10)") + math(EXPR MAXPATH "${MAXPATH} - 46") + endif() # Ninja imposes a maximum path component count of 30. Permit more # path components in the source path. - IF(${CMAKE_GENERATOR} MATCHES "Ninja") - MATH(EXPR MAXPATH "${MAXPATH} - 44") - ENDIF() + if(${CMAKE_GENERATOR} MATCHES "Ninja") + math(EXPR MAXPATH "${MAXPATH} - 44") + endif() # MAXPATH less 25 for last /and/deeper/simple.cxx part and small safety - MATH(EXPR MAXPATH "${MAXPATH} - 25") - STRING(LENGTH "${DEEPDIR}" DEEPDIR_LEN) - WHILE("${DEEPDIR_LEN}" LESS "${MAXPATH}") - SET(DEEPDIR ${DEEPDIR}/and/deeper) - STRING(LENGTH "${DEEPDIR}" DEEPDIR_LEN) - ENDWHILE("${DEEPDIR_LEN}" LESS "${MAXPATH}") - SET(DEEPSRC ${DEEPDIR}/simple.cxx) - STRING(LENGTH "${DEEPSRC}" DEEPSRC_LEN) - CONFIGURE_FILE(simple.cxx.in ${DEEPSRC} COPYONLY) + math(EXPR MAXPATH "${MAXPATH} - 25") + string(LENGTH "${DEEPDIR}" DEEPDIR_LEN) + while("${DEEPDIR_LEN}" LESS "${MAXPATH}") + set(DEEPDIR ${DEEPDIR}/and/deeper) + string(LENGTH "${DEEPDIR}" DEEPDIR_LEN) + endwhile("${DEEPDIR_LEN}" LESS "${MAXPATH}") + set(DEEPSRC ${DEEPDIR}/simple.cxx) + string(LENGTH "${DEEPSRC}" DEEPSRC_LEN) + configure_file(simple.cxx.in ${DEEPSRC} COPYONLY) # Watcom WMake seems to have problems with long command lines. Just # disable this part of the test until it is resolved. - IF(${CMAKE_GENERATOR} MATCHES "Watcom WMake") - SET(DEEPSRC "") - ADD_DEFINITIONS(-DNO_DEEPSRC) - ENDIF(${CMAKE_GENERATOR} MATCHES "Watcom WMake") + if(${CMAKE_GENERATOR} MATCHES "Watcom WMake") + set(DEEPSRC "") + add_definitions(-DNO_DEEPSRC) + endif(${CMAKE_GENERATOR} MATCHES "Watcom WMake") - ADD_LIBRARY(testlib testlib.cxx) - ADD_EXECUTABLE (simple simple.cxx ../simple.cxx ${DEEPSRC}) - TARGET_LINK_LIBRARIES(simple testlib outlib) -ENDIF ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}") + add_library(testlib testlib.cxx) + add_executable (simple simple.cxx ../simple.cxx ${DEEPSRC}) + target_link_libraries(simple testlib outlib) +endif ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}") # test getting a definition from a subdir -SET (WEASELS SIZZLING) +set (WEASELS SIZZLING) -GET_DIRECTORY_PROPERTY(incDirs INCLUDE_DIRECTORIES) -IF(NOT incDirs) - MESSAGE(FATAL_ERROR "GET_DIRECTORY_PROPERTY(INCLUDE_DIRECTORIES) returned empty list") -ENDIF(NOT incDirs) +get_directory_property(incDirs INCLUDE_DIRECTORIES) +if(NOT incDirs) + message(FATAL_ERROR "get_directory_property(INCLUDE_DIRECTORIES) returned empty list") +endif(NOT incDirs) diff --git a/Tests/OutOfSource/SubDir/CMakeLists.txt b/Tests/OutOfSource/SubDir/CMakeLists.txt index 4fc48e13d..c5df36e1b 100644 --- a/Tests/OutOfSource/SubDir/CMakeLists.txt +++ b/Tests/OutOfSource/SubDir/CMakeLists.txt @@ -1,8 +1,8 @@ -PROJECT(ANOTHER_PROJ) +project(ANOTHER_PROJ) # subdir to an out of source and out of binary directory -ADD_SUBDIRECTORY(${OutOfSource_SOURCE_DIR}/../OutOfBinary +add_subdirectory(${OutOfSource_SOURCE_DIR}/../OutOfBinary ${OutOfSource_BINARY_DIR}/../OutOfBinary) # subdir to a sibling dir -ADD_SUBDIRECTORY(${OutOfSource_SOURCE_DIR}/${KEN}OutOfSourceSubdir OutOfSourceSubdir ) +add_subdirectory(${OutOfSource_SOURCE_DIR}/${KEN}OutOfSourceSubdir OutOfSourceSubdir ) diff --git a/Tests/PerConfig/CMakeLists.txt b/Tests/PerConfig/CMakeLists.txt index 3a473b883..7f461b0ec 100644 --- a/Tests/PerConfig/CMakeLists.txt +++ b/Tests/PerConfig/CMakeLists.txt @@ -1,23 +1,23 @@ project(PerConfig C) # Targets with per-configuration names. -ADD_LIBRARY(pcStatic STATIC pcStatic.c) -SET_PROPERTY(TARGET pcStatic PROPERTY RELEASE_POSTFIX -opt) -SET_PROPERTY(TARGET pcStatic PROPERTY DEBUG_POSTFIX -dbg) -ADD_LIBRARY(pcShared SHARED pcShared.c) -SET_PROPERTY(TARGET pcShared PROPERTY RELEASE_POSTFIX -opt) -SET_PROPERTY(TARGET pcShared PROPERTY DEBUG_POSTFIX -dbg) -SET_PROPERTY(TARGET pcShared PROPERTY VERSION 1.2) -SET_PROPERTY(TARGET pcShared PROPERTY SOVERSION 3) -IF(UNIX AND NOT CYGWIN) - SET(soname_file -DpcShared_soname_file=$) -ENDIF() -ADD_EXECUTABLE(perconfig perconfig.c) -TARGET_LINK_LIBRARIES(perconfig pcStatic pcShared) -SET_PROPERTY(TARGET perconfig PROPERTY RELEASE_POSTFIX -opt) -SET_PROPERTY(TARGET perconfig PROPERTY DEBUG_POSTFIX -dbg) +add_library(pcStatic STATIC pcStatic.c) +set_property(TARGET pcStatic PROPERTY RELEASE_POSTFIX -opt) +set_property(TARGET pcStatic PROPERTY DEBUG_POSTFIX -dbg) +add_library(pcShared SHARED pcShared.c) +set_property(TARGET pcShared PROPERTY RELEASE_POSTFIX -opt) +set_property(TARGET pcShared PROPERTY DEBUG_POSTFIX -dbg) +set_property(TARGET pcShared PROPERTY VERSION 1.2) +set_property(TARGET pcShared PROPERTY SOVERSION 3) +if(UNIX AND NOT CYGWIN) + set(soname_file -DpcShared_soname_file=$) +endif() +add_executable(perconfig perconfig.c) +target_link_libraries(perconfig pcStatic pcShared) +set_property(TARGET perconfig PROPERTY RELEASE_POSTFIX -opt) +set_property(TARGET perconfig PROPERTY DEBUG_POSTFIX -dbg) -SET(PerConfig_COMMAND +set(PerConfig_COMMAND ${CMAKE_COMMAND} -Dconfiguration=$ -Dperconfig_file_dir=$ @@ -30,5 +30,5 @@ SET(PerConfig_COMMAND ${soname_file} -P ${PerConfig_SOURCE_DIR}/perconfig.cmake ) -SET(PerConfig_COMMAND "${PerConfig_COMMAND}" PARENT_SCOPE) -SET(PerConfig_DEPENDS ${PerConfig_SOURCE_DIR}/perconfig.cmake perconfig pcStatic pcShared) +set(PerConfig_COMMAND "${PerConfig_COMMAND}" PARENT_SCOPE) +set(PerConfig_DEPENDS ${PerConfig_SOURCE_DIR}/perconfig.cmake perconfig pcStatic pcShared) diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt index 31ca59c13..d1b8334a9 100644 --- a/Tests/Plugin/CMakeLists.txt +++ b/Tests/Plugin/CMakeLists.txt @@ -1,87 +1,87 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(Plugin) +project(Plugin) # Test per-target output directory properties. -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/bin) -SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/plugin) -SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/static) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/bin) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/plugin) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/static) # We need the dynamic loader support from KWSys to load the plugin in # the executable. -SET(KWSYS_NAMESPACE kwsys) -SET(KWSYS_HEADER_ROOT ${Plugin_BINARY_DIR}/include) -SET(KWSYS_USE_DynamicLoader 1) -ADD_SUBDIRECTORY(${Plugin_SOURCE_DIR}/../../Source/kwsys src/kwsys) +set(KWSYS_NAMESPACE kwsys) +set(KWSYS_HEADER_ROOT ${Plugin_BINARY_DIR}/include) +set(KWSYS_USE_DynamicLoader 1) +add_subdirectory(${Plugin_SOURCE_DIR}/../../Source/kwsys src/kwsys) # Configure the location of plugins. -CONFIGURE_FILE(${Plugin_SOURCE_DIR}/src/example_exe.h.in +configure_file(${Plugin_SOURCE_DIR}/src/example_exe.h.in ${Plugin_BINARY_DIR}/include/example_exe.h @ONLY) # We need to include headers from the source tree and configured # headers in the build tree. -INCLUDE_DIRECTORIES( +include_directories( ${Plugin_BINARY_DIR}/include ${Plugin_SOURCE_DIR}/include ) # Create an executable that exports an API for use by plugins. -ADD_EXECUTABLE(example_exe src/example_exe.cxx) -SET_TARGET_PROPERTIES(example_exe PROPERTIES +add_executable(example_exe src/example_exe.cxx) +set_target_properties(example_exe PROPERTIES ENABLE_EXPORTS 1 OUTPUT_NAME example # Test placing exe import library in unique directory. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/exe ) -TARGET_LINK_LIBRARIES(example_exe kwsys) +target_link_libraries(example_exe kwsys) # Create a plugin that uses the API provided by the executable. # This module "links" to the executable to use the symbols. -ADD_LIBRARY(example_mod_1 MODULE src/example_mod_1.c) -TARGET_LINK_LIBRARIES(example_mod_1 example_exe) +add_library(example_mod_1 MODULE src/example_mod_1.c) +target_link_libraries(example_mod_1 example_exe) -IF(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG AND +if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG AND "${CMAKE_C_CREATE_SHARED_MODULE}" MATCHES "SONAME_FLAG") # Add a second plugin that should not have any soname. - ADD_LIBRARY(example_mod_2 MODULE src/example_mod_1.c) - TARGET_LINK_LIBRARIES(example_mod_2 example_exe) - SET_PROPERTY(TARGET example_mod_2 PROPERTY NO_SONAME 1) + add_library(example_mod_2 MODULE src/example_mod_1.c) + target_link_libraries(example_mod_2 example_exe) + set_property(TARGET example_mod_2 PROPERTY NO_SONAME 1) # Verify that targets export with proper IMPORTED SONAME properties. - EXPORT(TARGETS example_mod_1 example_mod_2 NAMESPACE exp_ + export(TARGETS example_mod_1 example_mod_2 NAMESPACE exp_ FILE ${CMAKE_CURRENT_BINARY_DIR}/mods.cmake) - INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/mods.cmake) - GET_PROPERTY(configs TARGET exp_example_mod_1 PROPERTY IMPORTED_CONFIGURATIONS) - FOREACH(c ${configs}) - STRING(TOUPPER "${c}" CONFIG) - GET_PROPERTY(soname1 TARGET exp_example_mod_1 PROPERTY IMPORTED_SONAME_${CONFIG}) - GET_PROPERTY(soname2 TARGET exp_example_mod_2 PROPERTY IMPORTED_NO_SONAME_${CONFIG}) - IF(soname1) - MESSAGE(STATUS "exp_example_mod_1 has IMPORTED_SONAME_${CONFIG} as expected: ${soname1}") - ELSE() - MESSAGE(SEND_ERROR "exp_example_mod_1 does not have IMPORTED_SONAME_${CONFIG} but should") - ENDIF() - IF(soname2) - MESSAGE(STATUS "exp_example_mod_2 has IMPORTED_NO_SONAME_${CONFIG} as expected: ${soname2}") - ELSE() - MESSAGE(SEND_ERROR "exp_example_mod_2 does not have IMPORTED_NO_SONAME_${CONFIG} but should") - ENDIF() - ENDFOREACH() + include(${CMAKE_CURRENT_BINARY_DIR}/mods.cmake) + get_property(configs TARGET exp_example_mod_1 PROPERTY IMPORTED_CONFIGURATIONS) + foreach(c ${configs}) + string(TOUPPER "${c}" CONFIG) + get_property(soname1 TARGET exp_example_mod_1 PROPERTY IMPORTED_SONAME_${CONFIG}) + get_property(soname2 TARGET exp_example_mod_2 PROPERTY IMPORTED_NO_SONAME_${CONFIG}) + if(soname1) + message(STATUS "exp_example_mod_1 has IMPORTED_SONAME_${CONFIG} as expected: ${soname1}") + else() + message(SEND_ERROR "exp_example_mod_1 does not have IMPORTED_SONAME_${CONFIG} but should") + endif() + if(soname2) + message(STATUS "exp_example_mod_2 has IMPORTED_NO_SONAME_${CONFIG} as expected: ${soname2}") + else() + message(SEND_ERROR "exp_example_mod_2 does not have IMPORTED_NO_SONAME_${CONFIG} but should") + endif() + endforeach() # Parse the binary to check for SONAME if possible. - IF("${CMAKE_EXECUTABLE_FORMAT}" MATCHES "ELF") - FIND_PROGRAM(READELF_EXE readelf) - IF(READELF_EXE) - ADD_CUSTOM_TARGET(check_mod_soname ALL COMMAND + if("${CMAKE_EXECUTABLE_FORMAT}" MATCHES "ELF") + find_program(READELF_EXE readelf) + if(READELF_EXE) + add_custom_target(check_mod_soname ALL COMMAND ${CMAKE_COMMAND} -Dreadelf=${READELF_EXE} -Dmod1=$ -Dmod2=$ -P ${CMAKE_CURRENT_SOURCE_DIR}/check_mod_soname.cmake ) - ADD_DEPENDENCIES(check_mod_soname example_mod_1 example_mod_2) - ENDIF() - ENDIF() -ENDIF() + add_dependencies(check_mod_soname example_mod_1 example_mod_2) + endif() + endif() +endif() # TODO: # - create a plugin that links to a static lib diff --git a/Tests/PreOrder/CMakeLists.txt b/Tests/PreOrder/CMakeLists.txt index 29720e4c1..8b4c43954 100644 --- a/Tests/PreOrder/CMakeLists.txt +++ b/Tests/PreOrder/CMakeLists.txt @@ -1,6 +1,6 @@ # a simple test case -PROJECT (PreOrder) -SET(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1) -ADD_SUBDIRECTORY(Library) -ADD_EXECUTABLE (PreOrder simple.cxx) -TARGET_LINK_LIBRARIES(PreOrder simpleLib) +project (PreOrder) +set(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1) +add_subdirectory(Library) +add_executable (PreOrder simple.cxx) +target_link_libraries(PreOrder simpleLib) diff --git a/Tests/PreOrder/Library/CMakeLists.txt b/Tests/PreOrder/Library/CMakeLists.txt index 6c011eca9..018ffa5e2 100644 --- a/Tests/PreOrder/Library/CMakeLists.txt +++ b/Tests/PreOrder/Library/CMakeLists.txt @@ -1,2 +1,2 @@ -ADD_LIBRARY(simpleLib simpleLib.cxx ) +add_library(simpleLib simpleLib.cxx ) diff --git a/Tests/PrecompiledHeader/CMakeLists.txt b/Tests/PrecompiledHeader/CMakeLists.txt index 3374e325f..e5ac6d347 100644 --- a/Tests/PrecompiledHeader/CMakeLists.txt +++ b/Tests/PrecompiledHeader/CMakeLists.txt @@ -1,59 +1,59 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(PrecompiledHeader C) +project(PrecompiledHeader C) # Make sure the proper compiler is in use. -IF(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") - MESSAGE(FATAL_ERROR "The PrecompiledHeader test works only with MSVC or Intel") -ENDIF() +if(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") + message(FATAL_ERROR "The PrecompiledHeader test works only with MSVC or Intel") +endif() # Compute a custom name for the precompiled header. -IF(CMAKE_CONFIGURATION_TYPES) - SET(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH/${CMAKE_CFG_INTDIR}") - FOREACH(cfg ${CMAKE_CONFIGURATION_TYPES}) - FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH/${cfg}) - ENDFOREACH() -ELSE(CMAKE_CONFIGURATION_TYPES) - SET(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH") - FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH) -ENDIF(CMAKE_CONFIGURATION_TYPES) +if(CMAKE_CONFIGURATION_TYPES) + set(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH/${CMAKE_CFG_INTDIR}") + foreach(cfg ${CMAKE_CONFIGURATION_TYPES}) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH/${cfg}) + endforeach() +else(CMAKE_CONFIGURATION_TYPES) + set(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH") + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH) +endif(CMAKE_CONFIGURATION_TYPES) # The VS6 IDE does not support renaming .pch files with /Fp. -IF("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") - SET(PCH_USE_INCLUDE_DIR 1) - SET(PCH_FILE) -ELSE("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") - SET(PCH_USE_INCLUDE_DIR 0) - SET(PCH_FILE "\"/Fp${PCH_DIR}/foo_precompiled.pch\"") -ENDIF("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") +if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") + set(PCH_USE_INCLUDE_DIR 1) + set(PCH_FILE) +else("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") + set(PCH_USE_INCLUDE_DIR 0) + set(PCH_FILE "\"/Fp${PCH_DIR}/foo_precompiled.pch\"") +endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") # Choose between an explicit include path and using /I during # precompilation. The /I form is used to test that the PCH is # actually used. In practice the include path form would be used. -IF(PCH_USE_INCLUDE_DIR) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) -ELSE(PCH_USE_INCLUDE_DIR) - SET(PCH_INCLUDE_DIR "\"/I${CMAKE_CURRENT_SOURCE_DIR}/include\"") -ENDIF(PCH_USE_INCLUDE_DIR) +if(PCH_USE_INCLUDE_DIR) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) +else(PCH_USE_INCLUDE_DIR) + set(PCH_INCLUDE_DIR "\"/I${CMAKE_CURRENT_SOURCE_DIR}/include\"") +endif(PCH_USE_INCLUDE_DIR) # Create a target that will use a precompiled header. -SET(foo_SRCS foo1.c foo2.c) -ADD_EXECUTABLE(foo foo_precompile.c ${foo_SRCS}) +set(foo_SRCS foo1.c foo2.c) +add_executable(foo foo_precompile.c ${foo_SRCS}) # Setup flags on the target to create and use the precompiled header. -SET_TARGET_PROPERTIES(foo PROPERTIES +set_target_properties(foo PROPERTIES COMPILE_FLAGS "/Yufoo_precompiled.h /FIfoo_precompiled.h ${PCH_FILE}") -SET_SOURCE_FILES_PROPERTIES(foo_precompile.c PROPERTIES +set_source_files_properties(foo_precompile.c PROPERTIES COMPILE_FLAGS "/Ycfoo_precompiled.h ${PCH_INCLUDE_DIR}") # Setup dependencies for precompiled header creation and use. The VS # IDE takes care of this automatically. -IF("${CMAKE_GENERATOR}" MATCHES "Makefile" OR +if("${CMAKE_GENERATOR}" MATCHES "Makefile" OR "${CMAKE_GENERATOR}" MATCHES "Ninja") # This source file creates the precompiled header as a side-effect. - SET_SOURCE_FILES_PROPERTIES(foo_precompile.c PROPERTIES + set_source_files_properties(foo_precompile.c PROPERTIES OBJECT_OUTPUTS "${PCH_DIR}/foo_precompiled.pch") # These source files use the precompiled header. - SET_SOURCE_FILES_PROPERTIES(${foo_SRCS} PROPERTIES + set_source_files_properties(${foo_SRCS} PROPERTIES OBJECT_DEPENDS "${PCH_DIR}/foo_precompiled.pch") -ENDIF("${CMAKE_GENERATOR}" MATCHES "Makefile") +endif("${CMAKE_GENERATOR}" MATCHES "Makefile") diff --git a/Tests/SameName/CMakeLists.txt b/Tests/SameName/CMakeLists.txt index a4b993cfd..d78879dd9 100644 --- a/Tests/SameName/CMakeLists.txt +++ b/Tests/SameName/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(SameName C) +project(SameName C) -ADD_SUBDIRECTORY(Lib1) +add_subdirectory(Lib1) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/Lib1) -ADD_SUBDIRECTORY(Exe1) +include_directories(${PROJECT_SOURCE_DIR}/Lib1) +add_subdirectory(Exe1) diff --git a/Tests/SameName/Exe1/CMakeLists.txt b/Tests/SameName/Exe1/CMakeLists.txt index 3917a2f6b..b9182f209 100644 --- a/Tests/SameName/Exe1/CMakeLists.txt +++ b/Tests/SameName/Exe1/CMakeLists.txt @@ -1,11 +1,11 @@ # a target with the same name as a target in a different dir -ADD_EXECUTABLE(mytest_exe conly.c) -SET_TARGET_PROPERTIES(mytest_exe PROPERTIES OUTPUT_NAME mytest) -TARGET_LINK_LIBRARIES(mytest_exe mytest) +add_executable(mytest_exe conly.c) +set_target_properties(mytest_exe PROPERTIES OUTPUT_NAME mytest) +target_link_libraries(mytest_exe mytest) # and two targets in the same dir with the same name -ADD_LIBRARY(mytest2 ../Lib1/libc1.c) +add_library(mytest2 ../Lib1/libc1.c) -ADD_EXECUTABLE(mytest2_exe conly.c) -SET_TARGET_PROPERTIES(mytest2_exe PROPERTIES OUTPUT_NAME mytest2) -TARGET_LINK_LIBRARIES(mytest2_exe mytest2) +add_executable(mytest2_exe conly.c) +set_target_properties(mytest2_exe PROPERTIES OUTPUT_NAME mytest2) +target_link_libraries(mytest2_exe mytest2) diff --git a/Tests/SameName/Lib1/CMakeLists.txt b/Tests/SameName/Lib1/CMakeLists.txt index 67e7f6843..40fa15422 100644 --- a/Tests/SameName/Lib1/CMakeLists.txt +++ b/Tests/SameName/Lib1/CMakeLists.txt @@ -1 +1 @@ -ADD_LIBRARY(mytest libc1.c) +add_library(mytest libc1.c) diff --git a/Tests/SetLang/CMakeLists.txt b/Tests/SetLang/CMakeLists.txt index ab6570c33..f24e5cb5d 100644 --- a/Tests/SetLang/CMakeLists.txt +++ b/Tests/SetLang/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.6) project(SetLang) # force this to be verbose so I can debug a dashboard entry -SET(CMAKE_VERBOSE_MAKEFILE 1) +set(CMAKE_VERBOSE_MAKEFILE 1) add_library(foo foo.c) add_executable(SetLang bar.c) set_source_files_properties(foo.c bar.c PROPERTIES LANGUAGE CXX) diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt index a47c546e7..f05587eb2 100644 --- a/Tests/SimpleInstall/CMakeLists.txt +++ b/Tests/SimpleInstall/CMakeLists.txt @@ -1,216 +1,216 @@ cmake_minimum_required (VERSION 2.6) -PROJECT (TestSimpleInstall) -SET(CMAKE_VERBOSE_MAKEFILE 1) -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY +project (TestSimpleInstall) +set(CMAKE_VERBOSE_MAKEFILE 1) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${TestSimpleInstall_BINARY_DIR}/bin") -SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${TestSimpleInstall_BINARY_DIR}/lib/static") -SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${TestSimpleInstall_BINARY_DIR}/lib") # Skip generating the rpath pointing at the build tree to make sure # the executable is installed with the proper rpath in the install # tree. -SET(CMAKE_SKIP_BUILD_RPATH 1) +set(CMAKE_SKIP_BUILD_RPATH 1) # Make sure the executable can run from the install tree. -SET(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) +set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) # Skip the dependency that causes a build when installing. This # avoids infinite loops when the post-build rule below installs. -SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1) -SET(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY 1) +set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1) +set(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY 1) -SET(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") +set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") -SET(EXTRA_INSTALL_FLAGS) -MESSAGE("Extra install: ${EXTRA_INSTALL_FLAGS}") +set(EXTRA_INSTALL_FLAGS) +message("Extra install: ${EXTRA_INSTALL_FLAGS}") -IF(STAGE2) - SET(LIBPATHS +if(STAGE2) + set(LIBPATHS ${CMAKE_INSTALL_PREFIX}/MyTest/lib/static ${CMAKE_INSTALL_PREFIX}/MyTest/lib ) - SET(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX} test1rel) - SET(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX}) - SET(t4NAMES test4out test4out${CMAKE_DEBUG_POSTFIX}) + set(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX} test1rel) + set(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX}) + set(t4NAMES test4out test4out${CMAKE_DEBUG_POSTFIX}) # Make sure the install script ran. - SET(CMAKE_INSTALL_SCRIPT_DID_RUN 0) - INCLUDE(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL) - IF(CMAKE_INSTALL_SCRIPT_DID_RUN) - MESSAGE(STATUS "Stage 1 did run install script 2.") - ELSE(CMAKE_INSTALL_SCRIPT_DID_RUN) - MESSAGE(SEND_ERROR "Stage 1 did not run install script 2.") - ENDIF(CMAKE_INSTALL_SCRIPT_DID_RUN) + set(CMAKE_INSTALL_SCRIPT_DID_RUN 0) + include(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL) + if(CMAKE_INSTALL_SCRIPT_DID_RUN) + message(STATUS "Stage 1 did run install script 2.") + else(CMAKE_INSTALL_SCRIPT_DID_RUN) + message(SEND_ERROR "Stage 1 did not run install script 2.") + endif(CMAKE_INSTALL_SCRIPT_DID_RUN) - IF(CYGWIN OR MINGW) - SET(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin") - ENDIF(CYGWIN OR MINGW) - MESSAGE("Search for library in: ${LIBPATHS}") + if(CYGWIN OR MINGW) + set(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin") + endif(CYGWIN OR MINGW) + message("Search for library in: ${LIBPATHS}") - SET(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) - SET(TEST2_LIBRARY "TEST2_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) - SET(TEST4_LIBRARY "TEST4_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) + set(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) + set(TEST2_LIBRARY "TEST2_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) + set(TEST4_LIBRARY "TEST4_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) - FIND_LIBRARY(TEST1_LIBRARY + find_library(TEST1_LIBRARY NAMES ${t1NAMES} PATHS ${LIBPATHS} DOC "First library") - FIND_LIBRARY(TEST2_LIBRARY + find_library(TEST2_LIBRARY NAMES ${t2NAMES} PATHS ${LIBPATHS} DOC "Second library") - FIND_LIBRARY(TEST4_LIBRARY + find_library(TEST4_LIBRARY NAMES ${t4NAMES} PATHS ${LIBPATHS} DOC "Fourth library") # Test importing a library found on disk. - ADD_LIBRARY(lib_test4 UNKNOWN IMPORTED) - SET_PROPERTY(TARGET lib_test4 PROPERTY IMPORTED_LOCATION ${TEST4_LIBRARY}) + add_library(lib_test4 UNKNOWN IMPORTED) + set_property(TARGET lib_test4 PROPERTY IMPORTED_LOCATION ${TEST4_LIBRARY}) - INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/MyTest/include) - ADD_EXECUTABLE (SimpleInstExeS2 inst2.cxx foo.c foo.h) - TARGET_LINK_LIBRARIES(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} lib_test4) - SET(install_target SimpleInstExeS2) + include_directories(${CMAKE_INSTALL_PREFIX}/MyTest/include) + add_executable (SimpleInstExeS2 inst2.cxx foo.c foo.h) + target_link_libraries(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} lib_test4) + set(install_target SimpleInstExeS2) - IF("${TEST1_LIBRARY}" MATCHES "static") - MESSAGE(STATUS "test1 correctly found in lib/static") - ELSE("${TEST1_LIBRARY}" MATCHES "static") - MESSAGE(SEND_ERROR "test1 not found in lib/static!") - ENDIF("${TEST1_LIBRARY}" MATCHES "static") + if("${TEST1_LIBRARY}" MATCHES "static") + message(STATUS "test1 correctly found in lib/static") + else("${TEST1_LIBRARY}" MATCHES "static") + message(SEND_ERROR "test1 not found in lib/static!") + endif("${TEST1_LIBRARY}" MATCHES "static") # Check for failure of configuration-specific installation. - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") - MESSAGE(FATAL_ERROR "Debug-configuration file installed for Release!") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") - MESSAGE(FATAL_ERROR "Release-configuration file installed for Debug!") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") + message(FATAL_ERROR "Debug-configuration file installed for Release!") + endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + message(FATAL_ERROR "Release-configuration file installed for Debug!") + endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") # Check for failure of directory installation. - IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") - MESSAGE(FATAL_ERROR "Directory installation did not install TSD.h") - ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") - MESSAGE(FATAL_ERROR "Directory installation installed CVS directory.") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") - MESSAGE(FATAL_ERROR "Directory installation installed CVS directory.") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") - MESSAGE(FATAL_ERROR "Directory installation installed CMakeLists.txt.") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") - IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") - MESSAGE(FATAL_ERROR "Directory installation did not install alternate TSD.h") - ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") - MESSAGE(FATAL_ERROR "Directory installation installed alternate TSD.cxx") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") + if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") + message(FATAL_ERROR "Directory installation did not install TSD.h") + endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") + message(FATAL_ERROR "Directory installation installed CVS directory.") + endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") + message(FATAL_ERROR "Directory installation installed CVS directory.") + endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") + message(FATAL_ERROR "Directory installation installed CMakeLists.txt.") + endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") + if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") + message(FATAL_ERROR "Directory installation did not install alternate TSD.h") + endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") + message(FATAL_ERROR "Directory installation installed alternate TSD.cxx") + endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") # Check that scripts properly installed. - IF(WIN32 AND NOT CYGWIN) - SET(BAT .bat) - ELSE(WIN32 AND NOT CYGWIN) - SET(BAT) - ENDIF(WIN32 AND NOT CYGWIN) - FOREACH(loc share share/old1 share/old2 share/old3 share/alt) - SET(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}") - EXECUTE_PROCESS( + if(WIN32 AND NOT CYGWIN) + set(BAT .bat) + else(WIN32 AND NOT CYGWIN) + set(BAT) + endif(WIN32 AND NOT CYGWIN) + foreach(loc share share/old1 share/old2 share/old3 share/alt) + set(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}") + execute_process( COMMAND ${CUR_SCRIPT} RESULT_VARIABLE SAMPLE_SCRIPT_RESULT OUTPUT_VARIABLE SAMPLE_SCRIPT_OUTPUT ) - IF(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") - MESSAGE(FATAL_ERROR + if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + message(FATAL_ERROR "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]") - ENDIF(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") - IF(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") - MESSAGE(FATAL_ERROR + endif(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + if(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") + message(FATAL_ERROR "Bad sample script [${CUR_SCRIPT}] output: [${SAMPLE_SCRIPT_OUTPUT}]") - ENDIF(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") - ENDFOREACH(loc) + endif(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") + endforeach(loc) # Check for failure of empty directory installation. - IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") - MESSAGE(FATAL_ERROR "Empty directory installation did not install.") - ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") - FILE(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*") - IF(EMPTY_FILES) - MESSAGE(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].") - ENDIF(EMPTY_FILES) + if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") + message(FATAL_ERROR "Empty directory installation did not install.") + endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") + file(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*") + if(EMPTY_FILES) + message(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].") + endif(EMPTY_FILES) # Make sure the test executable can run from the install tree. - SET_TARGET_PROPERTIES(SimpleInstExeS2 PROPERTIES + set_target_properties(SimpleInstExeS2 PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib) - INSTALL_TARGETS(/MyTest/bin SimpleInstExeS2) + install_targets(/MyTest/bin SimpleInstExeS2) # try to import the exported targets again - SET(SimpleInstallS1_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) - FIND_PACKAGE(SimpleInstallS1 REQUIRED) - GET_TARGET_PROPERTY(simpleInstallImported S1_SimpleInstall IMPORTED) - IF(NOT simpleInstallImported) - MESSAGE(FATAL_ERROR "Target S1_SimpleInstall could not be imported") - ENDIF(NOT simpleInstallImported) + set(SimpleInstallS1_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) + find_package(SimpleInstallS1 REQUIRED) + get_target_property(simpleInstallImported S1_SimpleInstall IMPORTED) + if(NOT simpleInstallImported) + message(FATAL_ERROR "Target S1_SimpleInstall could not be imported") + endif(NOT simpleInstallImported) -ELSE(STAGE2) +else(STAGE2) # Wipe out the install directory to do a fresh test. - FILE(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest) + file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest) # this is stage 1, so create libraries and modules and install everything - ADD_LIBRARY(test1 STATIC lib1.cxx) - ADD_LIBRARY(test2 SHARED lib2.cxx) - ADD_LIBRARY(test3 MODULE lib3.cxx) - ADD_LIBRARY(test4 SHARED lib4.cxx) + add_library(test1 STATIC lib1.cxx) + add_library(test2 SHARED lib2.cxx) + add_library(test3 MODULE lib3.cxx) + add_library(test4 SHARED lib4.cxx) # Test _OUTPUT_NAME properties. - SET_PROPERTY(TARGET test4 PROPERTY ARCHIVE_OUTPUT_NAME test4out) - SET_PROPERTY(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4out) + set_property(TARGET test4 PROPERTY ARCHIVE_OUTPUT_NAME test4out) + set_property(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4out) - ADD_EXECUTABLE (SimpleInstall inst.cxx foo.c foo.h) - TARGET_LINK_LIBRARIES(SimpleInstall test1 test2 test4) - SET(install_target SimpleInstall) + add_executable (SimpleInstall inst.cxx foo.c foo.h) + target_link_libraries(SimpleInstall test1 test2 test4) + set(install_target SimpleInstall) - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe) + set_target_properties(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe) # Disable VERSION test until it is implemented in the Xcode generator. - IF(NOT XCODE) - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES VERSION 1.2) - ENDIF(NOT XCODE) + if(NOT XCODE) + set_target_properties(SimpleInstall PROPERTIES VERSION 1.2) + endif(NOT XCODE) # Make sure the test executable can run from the install tree. - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES + set_target_properties(SimpleInstall PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib) # Test per-configuration output name. - SET_TARGET_PROPERTIES(test1 PROPERTIES RELEASE_OUTPUT_NAME test1rel) - SET_TARGET_PROPERTIES(test2 PROPERTIES PUBLIC_HEADER foo.h) + set_target_properties(test1 PROPERTIES RELEASE_OUTPUT_NAME test1rel) + set_target_properties(test2 PROPERTIES PUBLIC_HEADER foo.h) - IF(CMAKE_GENERATOR MATCHES "Makefiles") - ADD_SUBDIRECTORY(TestSubDir) - ADD_DEPENDENCIES(SimpleInstall TSD) - ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") + if(CMAKE_GENERATOR MATCHES "Makefiles") + add_subdirectory(TestSubDir) + add_dependencies(SimpleInstall TSD) + endif(CMAKE_GENERATOR MATCHES "Makefiles") - ADD_DEPENDENCIES(SimpleInstall test3) - ADD_DEPENDENCIES(test2 test3) - ADD_DEPENDENCIES(test4 test2) + add_dependencies(SimpleInstall test3) + add_dependencies(test2 test3) + add_dependencies(test4 test2) - INSTALL(TARGETS SimpleInstall test1 test2 test3 EXPORT SimpleInstallS1 + install(TARGETS SimpleInstall test1 test2 test3 EXPORT SimpleInstallS1 RUNTIME DESTINATION MyTest/bin COMPONENT Runtime # .exe, .dll LIBRARY DESTINATION MyTest/lib COMPONENT Runtime # .so, mod.dll ARCHIVE DESTINATION MyTest/lib/static COMPONENT Development # .a, .lib PUBLIC_HEADER DESTINATION MyTest/include COMPONENT Development ) - INSTALL(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE + install(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE RUNTIME DESTINATION MyTest/bin LIBRARY DESTINATION MyTest/lib ARCHIVE DESTINATION MyTest/lib/static OPTIONAL # for coverage...target should always exist ) - INSTALL(FILES lib1.h DESTINATION MyTest/include/foo) - INSTALL(FILES lib2.h + install(FILES lib1.h DESTINATION MyTest/include/foo) + install(FILES lib2.h DESTINATION MyTest/include/foo COMPONENT Development PERMISSIONS OWNER_READ OWNER_WRITE @@ -218,40 +218,40 @@ ELSE(STAGE2) ) # Test old-style install commands. - INSTALL_FILES(/MyTest/include FILES lib3.h) - INSTALL_FILES(/MyTest/include/old .h lib3) - INSTALL_FILES(/MyTest/include/old "^lib2.h$") - INSTALL_PROGRAMS(/MyTest/share/old1 FILES + install_files(/MyTest/include FILES lib3.h) + install_files(/MyTest/include/old .h lib3) + install_files(/MyTest/include/old "^lib2.h$") + install_programs(/MyTest/share/old1 FILES scripts/sample_script scripts/sample_script.bat) - INSTALL_PROGRAMS(/MyTest/share/old2 + install_programs(/MyTest/share/old2 scripts/sample_script scripts/sample_script.bat) # "export" the targets collected in "SimpleInstallS1" - INSTALL(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake + install(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake DESTINATION MyTest/lib NAMESPACE S1_ ) - EXPORT(TARGETS SimpleInstall test1 test2 test3 + export(TARGETS SimpleInstall test1 test2 test3 FILE "${CMAKE_CURRENT_BINARY_DIR}/SimpleInstallS1Config.cmake" NAMESPACE S2_ ) - ADD_SUBDIRECTORY(scripts) + add_subdirectory(scripts) # Test optional installation. - INSTALL(FILES does_not_exist.h DESTINATION MyTest/include/foo OPTIONAL) + install(FILES does_not_exist.h DESTINATION MyTest/include/foo OPTIONAL) # Test configuration-specific installation. - INSTALL(FILES lib1.h RENAME lib1release.h CONFIGURATIONS Release + install(FILES lib1.h RENAME lib1release.h CONFIGURATIONS Release DESTINATION MyTest/include/Release ) - INSTALL(FILES lib1.h RENAME lib1debug.h CONFIGURATIONS Debug + install(FILES lib1.h RENAME lib1debug.h CONFIGURATIONS Debug DESTINATION MyTest/include/Debug ) # Test directory installation. - FILE(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") - FILE(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") - INSTALL( + file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") + file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") + install( DIRECTORY TestSubDir scripts/ DESTINATION MyTest/share FILE_PERMISSIONS OWNER_READ OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE @@ -262,14 +262,14 @@ ELSE(STAGE2) ) # Alternate directory installation for coverage. - INSTALL( + install( DIRECTORY scripts/ DESTINATION MyTest/share/alt COMPONENT Development USE_SOURCE_PERMISSIONS PATTERN "CVS" EXCLUDE REGEX "\\.txt$" EXCLUDE ) - INSTALL( + install( DIRECTORY TestSubDir DESTINATION MyTest/share/alt FILE_PERMISSIONS OWNER_READ OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE @@ -278,65 +278,65 @@ ELSE(STAGE2) ) # Test empty directory installation. - INSTALL(DIRECTORY DESTINATION MyTest/share/empty) + install(DIRECTORY DESTINATION MyTest/share/empty) # Test optional directory installation. - INSTALL(DIRECTORY does-not-exist DESTINATION MyTest/share OPTIONAL) + install(DIRECTORY does-not-exist DESTINATION MyTest/share OPTIONAL) # Test user-specified install scripts, with and without COMPONENT. - INSTALL( + install( SCRIPT InstallScript1.cmake - CODE "SET(INSTALL_CODE_DID_RUN 1)" + CODE "set(INSTALL_CODE_DID_RUN 1)" SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/InstallScript2.cmake ) - INSTALL( + install( SCRIPT InstallScript3.cmake - CODE "SET(INSTALL_CODE_WITH_COMPONENT_DID_RUN 1)" + CODE "set(INSTALL_CODE_WITH_COMPONENT_DID_RUN 1)" SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/InstallScript4.cmake COMPONENT Development ) - SET_DIRECTORY_PROPERTIES(PROPERTIES + set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_INSTALL_PREFIX}/InstallScriptOut.cmake;${CMAKE_INSTALL_PREFIX}/InstallScript4Out.cmake") - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT + set_target_properties(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake) - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT + set_target_properties(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake) - SET_TARGET_PROPERTIES(test4 PROPERTIES VERSION 1.2 SOVERSION 3 + set_target_properties(test4 PROPERTIES VERSION 1.2 SOVERSION 3 INSTALL_NAME_DIR @executable_path/../lib) -ENDIF(STAGE2) +endif(STAGE2) -IF(CMAKE_CONFIGURATION_TYPES) - SET(SI_CONFIG -C ${CMAKE_CFG_INTDIR}) -ELSE(CMAKE_CONFIGURATION_TYPES) - SET(SI_CONFIG) -ENDIF(CMAKE_CONFIGURATION_TYPES) +if(CMAKE_CONFIGURATION_TYPES) + set(SI_CONFIG -C ${CMAKE_CFG_INTDIR}) +else(CMAKE_CONFIGURATION_TYPES) + set(SI_CONFIG) +endif(CMAKE_CONFIGURATION_TYPES) # Dummy test of CPack -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack") -SET(CPACK_PACKAGE_VENDOR "Kitware") -SET(CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/PackageScript.cmake") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack") +set(CPACK_PACKAGE_VENDOR "Kitware") +set(CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/PackageScript.cmake") -IF(WIN32 AND NOT UNIX) - FIND_PROGRAM(NSIS_MAKENSIS NAMES makensis +if(WIN32 AND NOT UNIX) + find_program(NSIS_MAKENSIS NAMES makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS] DOC "Where is makensis.exe located" ) - IF(NOT NSIS_MAKENSIS) - SET(CPACK_GENERATOR TGZ) - ENDIF(NOT NSIS_MAKENSIS) -ENDIF(WIN32 AND NOT UNIX) -IF(UNIX AND NOT APPLE) - SET(CPACK_GENERATOR "TGZ;STGZ;TZ") - # FIND_PROGRAM(found_compress + if(NOT NSIS_MAKENSIS) + set(CPACK_GENERATOR TGZ) + endif(NOT NSIS_MAKENSIS) +endif(WIN32 AND NOT UNIX) +if(UNIX AND NOT APPLE) + set(CPACK_GENERATOR "TGZ;STGZ;TZ") + # find_program(found_compress # NAMES compress) - # IF(found_compress) - # FIND_PROGRAM(file_command NAMES file) - # IF(NOT file_command) + # if(found_compress) + # find_program(file_command NAMES file) + # if(NOT file_command) # set(file_command file) - # ENDIF(NOT file_command) - # EXECUTE_PROCESS(COMMAND ${file_command} ${found_compress} + # endif(NOT file_command) + # execute_process(COMMAND ${file_command} ${found_compress} # OUTPUT_VARIABLE output) # set(SKIP_TZ FALSE) # if("${output}" MATCHES "script") @@ -348,39 +348,39 @@ IF(UNIX AND NOT APPLE) # if(NOT SKIP_TZ) # message("compress found and it was not a script") # message("output from file command: [${output}]") - # SET(CPACK_GENERATOR "${CPACK_GENERATOR};TZ") + # set(CPACK_GENERATOR "${CPACK_GENERATOR};TZ") # else(NOT SKIP_TZ) # message("compress found, but it was a script so dont use it") # message("output from file command: [${output}]") # endif(NOT SKIP_TZ) - # ENDIF(found_compress) - FIND_PROGRAM(found_bz2 + # endif(found_compress) + find_program(found_bz2 NAMES bzip2) - IF(found_bz2) - SET(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2") - ENDIF(found_bz2) -ENDIF(UNIX AND NOT APPLE) + if(found_bz2) + set(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2") + endif(found_bz2) +endif(UNIX AND NOT APPLE) -SET(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install") -SET(CMAKE_INSTALL_MFC_LIBRARIES 1) -SET(CMAKE_INSTALL_DEBUG_LIBRARIES 1) -INCLUDE(InstallRequiredSystemLibraries) +set(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install") +set(CMAKE_INSTALL_MFC_LIBRARIES 1) +set(CMAKE_INSTALL_DEBUG_LIBRARIES 1) +include(InstallRequiredSystemLibraries) -IF(CTEST_TEST_CPACK) - SET(PACKAGE_TARGET --build-target package) +if(CTEST_TEST_CPACK) + set(PACKAGE_TARGET --build-target package) # Avoid settings that require the .zip file command line tools... # (just build an NSIS installer without component support) # - SET(CPACK_BINARY_ZIP OFF) - SET(CPACK_MONOLITHIC_INSTALL ON) -ELSE(CTEST_TEST_CPACK) - SET(PACKAGE_TARGET) -ENDIF(CTEST_TEST_CPACK) + set(CPACK_BINARY_ZIP OFF) + set(CPACK_MONOLITHIC_INSTALL ON) +else(CTEST_TEST_CPACK) + set(PACKAGE_TARGET) +endif(CTEST_TEST_CPACK) -INCLUDE(CPack) +include(CPack) -ADD_CUSTOM_COMMAND( +add_custom_command( TARGET ${install_target} POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND} diff --git a/Tests/SimpleInstall/InstallScript1.cmake b/Tests/SimpleInstall/InstallScript1.cmake index 27b7725f8..85465bfed 100644 --- a/Tests/SimpleInstall/InstallScript1.cmake +++ b/Tests/SimpleInstall/InstallScript1.cmake @@ -1,5 +1,5 @@ -MESSAGE("This is install script 1.") -SET(INSTALL_SCRIPT_1_DID_RUN 1) -IF(INSTALL_CODE_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 1 did not run before install code.") -ENDIF(INSTALL_CODE_DID_RUN) +message("This is install script 1.") +set(INSTALL_SCRIPT_1_DID_RUN 1) +if(INSTALL_CODE_DID_RUN) + message(FATAL_ERROR "Install script 1 did not run before install code.") +endif(INSTALL_CODE_DID_RUN) diff --git a/Tests/SimpleInstall/InstallScript2.cmake b/Tests/SimpleInstall/InstallScript2.cmake index 927cae8b6..a675df7ea 100644 --- a/Tests/SimpleInstall/InstallScript2.cmake +++ b/Tests/SimpleInstall/InstallScript2.cmake @@ -1,14 +1,14 @@ -MESSAGE("This is install script 2.") -IF(INSTALL_SCRIPT_1_DID_RUN) - MESSAGE("Install script ordering works.") -ELSE(INSTALL_SCRIPT_1_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 1 did not run before install script 2.") -ENDIF(INSTALL_SCRIPT_1_DID_RUN) -IF(INSTALL_CODE_DID_RUN) - MESSAGE("Install code ordering works.") -ELSE(INSTALL_CODE_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 2 did not run after install code.") -ENDIF(INSTALL_CODE_DID_RUN) -FILE(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake" - "SET(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n" +message("This is install script 2.") +if(INSTALL_SCRIPT_1_DID_RUN) + message("Install script ordering works.") +else(INSTALL_SCRIPT_1_DID_RUN) + message(FATAL_ERROR "Install script 1 did not run before install script 2.") +endif(INSTALL_SCRIPT_1_DID_RUN) +if(INSTALL_CODE_DID_RUN) + message("Install code ordering works.") +else(INSTALL_CODE_DID_RUN) + message(FATAL_ERROR "Install script 2 did not run after install code.") +endif(INSTALL_CODE_DID_RUN) +file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake" + "set(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n" ) diff --git a/Tests/SimpleInstall/InstallScript3.cmake b/Tests/SimpleInstall/InstallScript3.cmake index b1aecd4c2..a955be146 100644 --- a/Tests/SimpleInstall/InstallScript3.cmake +++ b/Tests/SimpleInstall/InstallScript3.cmake @@ -1,12 +1,12 @@ -MESSAGE("This is install script 3.") -SET(INSTALL_SCRIPT_3_DID_RUN 1) -IF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 3 did not run before install code with component.") -ENDIF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +message("This is install script 3.") +set(INSTALL_SCRIPT_3_DID_RUN 1) +if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) + message(FATAL_ERROR "Install script 3 did not run before install code with component.") +endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN) -IF(CMAKE_INSTALL_COMPONENT) -IF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") - MESSAGE("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") - MESSAGE(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.") -ENDIF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -ENDIF(CMAKE_INSTALL_COMPONENT) +if(CMAKE_INSTALL_COMPONENT) +if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") + message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") + message(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.") +endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") +endif(CMAKE_INSTALL_COMPONENT) diff --git a/Tests/SimpleInstall/InstallScript4.cmake b/Tests/SimpleInstall/InstallScript4.cmake index 0ffea4bc8..0bbd9d2c8 100644 --- a/Tests/SimpleInstall/InstallScript4.cmake +++ b/Tests/SimpleInstall/InstallScript4.cmake @@ -1,22 +1,22 @@ -MESSAGE("This is install script 4.") -IF(INSTALL_SCRIPT_3_DID_RUN) - MESSAGE("Install script ordering works.") -ELSE(INSTALL_SCRIPT_3_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 3 did not run before install script 4.") -ENDIF(INSTALL_SCRIPT_3_DID_RUN) -IF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) - MESSAGE("Install code ordering works.") -ELSE(INSTALL_CODE_WITH_COMPONENT_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 4 did not run after install with component code.") -ENDIF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +message("This is install script 4.") +if(INSTALL_SCRIPT_3_DID_RUN) + message("Install script ordering works.") +else(INSTALL_SCRIPT_3_DID_RUN) + message(FATAL_ERROR "Install script 3 did not run before install script 4.") +endif(INSTALL_SCRIPT_3_DID_RUN) +if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) + message("Install code ordering works.") +else(INSTALL_CODE_WITH_COMPONENT_DID_RUN) + message(FATAL_ERROR "Install script 4 did not run after install with component code.") +endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN) -IF(CMAKE_INSTALL_COMPONENT) -IF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") - MESSAGE("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") - MESSAGE(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.") -ENDIF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -ENDIF(CMAKE_INSTALL_COMPONENT) +if(CMAKE_INSTALL_COMPONENT) +if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") + message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") + message(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.") +endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") +endif(CMAKE_INSTALL_COMPONENT) -FILE(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake" - "SET(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n" +file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake" + "set(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n" ) diff --git a/Tests/SimpleInstall/PackageScript.cmake b/Tests/SimpleInstall/PackageScript.cmake index 36429e2f7..be07f89cc 100644 --- a/Tests/SimpleInstall/PackageScript.cmake +++ b/Tests/SimpleInstall/PackageScript.cmake @@ -1,10 +1,10 @@ -MESSAGE("This is packaging script") -MESSAGE("It writes a file with all variables available in ${CMAKE_INSTALL_PREFIX}/AllVariables.txt") +message("This is packaging script") +message("It writes a file with all variables available in ${CMAKE_INSTALL_PREFIX}/AllVariables.txt") -FILE(WRITE ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "") -GET_CMAKE_PROPERTY(res VARIABLES) -FOREACH(var ${res}) - FILE(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt +file(WRITE ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "") +get_cmake_property(res VARIABLES) +foreach(var ${res}) + file(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "${var} \"${${var}}\"\n") -ENDFOREACH(var ${res}) +endforeach(var ${res}) diff --git a/Tests/SimpleInstall/PostInstall.cmake b/Tests/SimpleInstall/PostInstall.cmake index 52ea140a5..222cc5ae9 100644 --- a/Tests/SimpleInstall/PostInstall.cmake +++ b/Tests/SimpleInstall/PostInstall.cmake @@ -1,6 +1,6 @@ -MESSAGE("In post install") -IF(PRE_INSTALL_DID_RUN) - MESSAGE("Pre and post install work fine") -ELSE(PRE_INSTALL_DID_RUN) - MESSAGE(FATAL_ERROR "Pre install did not run before post install") -ENDIF(PRE_INSTALL_DID_RUN) +message("In post install") +if(PRE_INSTALL_DID_RUN) + message("Pre and post install work fine") +else(PRE_INSTALL_DID_RUN) + message(FATAL_ERROR "Pre install did not run before post install") +endif(PRE_INSTALL_DID_RUN) diff --git a/Tests/SimpleInstall/PreInstall.cmake b/Tests/SimpleInstall/PreInstall.cmake index 2ea2f7716..7a9851e1d 100644 --- a/Tests/SimpleInstall/PreInstall.cmake +++ b/Tests/SimpleInstall/PreInstall.cmake @@ -1,2 +1,2 @@ -MESSAGE("This is in pre install") -SET(PRE_INSTALL_DID_RUN 1) +message("This is in pre install") +set(PRE_INSTALL_DID_RUN 1) diff --git a/Tests/SimpleInstall/TestSubDir/CMakeLists.txt b/Tests/SimpleInstall/TestSubDir/CMakeLists.txt index 4f6295300..860e10425 100644 --- a/Tests/SimpleInstall/TestSubDir/CMakeLists.txt +++ b/Tests/SimpleInstall/TestSubDir/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_EXECUTABLE(TSD TSD.cxx TSD_utils.cxx) -INSTALL_FILES(/MyTest/include FILES TSD.h) -INSTALL_TARGETS(/MyTest/bin TSD) +add_executable(TSD TSD.cxx TSD_utils.cxx) +install_files(/MyTest/include FILES TSD.h) +install_targets(/MyTest/bin TSD) diff --git a/Tests/SimpleInstall/scripts/CMakeLists.txt b/Tests/SimpleInstall/scripts/CMakeLists.txt index d46c1652e..ec34e8c50 100644 --- a/Tests/SimpleInstall/scripts/CMakeLists.txt +++ b/Tests/SimpleInstall/scripts/CMakeLists.txt @@ -1 +1 @@ -INSTALL_PROGRAMS(/MyTest/share/old3 "^sample_script(\\.bat)?$") +install_programs(/MyTest/share/old3 "^sample_script(\\.bat)?$") diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt index a47c546e7..f05587eb2 100644 --- a/Tests/SimpleInstallS2/CMakeLists.txt +++ b/Tests/SimpleInstallS2/CMakeLists.txt @@ -1,216 +1,216 @@ cmake_minimum_required (VERSION 2.6) -PROJECT (TestSimpleInstall) -SET(CMAKE_VERBOSE_MAKEFILE 1) -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY +project (TestSimpleInstall) +set(CMAKE_VERBOSE_MAKEFILE 1) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${TestSimpleInstall_BINARY_DIR}/bin") -SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${TestSimpleInstall_BINARY_DIR}/lib/static") -SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${TestSimpleInstall_BINARY_DIR}/lib") # Skip generating the rpath pointing at the build tree to make sure # the executable is installed with the proper rpath in the install # tree. -SET(CMAKE_SKIP_BUILD_RPATH 1) +set(CMAKE_SKIP_BUILD_RPATH 1) # Make sure the executable can run from the install tree. -SET(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) +set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) # Skip the dependency that causes a build when installing. This # avoids infinite loops when the post-build rule below installs. -SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1) -SET(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY 1) +set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1) +set(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY 1) -SET(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") +set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") -SET(EXTRA_INSTALL_FLAGS) -MESSAGE("Extra install: ${EXTRA_INSTALL_FLAGS}") +set(EXTRA_INSTALL_FLAGS) +message("Extra install: ${EXTRA_INSTALL_FLAGS}") -IF(STAGE2) - SET(LIBPATHS +if(STAGE2) + set(LIBPATHS ${CMAKE_INSTALL_PREFIX}/MyTest/lib/static ${CMAKE_INSTALL_PREFIX}/MyTest/lib ) - SET(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX} test1rel) - SET(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX}) - SET(t4NAMES test4out test4out${CMAKE_DEBUG_POSTFIX}) + set(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX} test1rel) + set(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX}) + set(t4NAMES test4out test4out${CMAKE_DEBUG_POSTFIX}) # Make sure the install script ran. - SET(CMAKE_INSTALL_SCRIPT_DID_RUN 0) - INCLUDE(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL) - IF(CMAKE_INSTALL_SCRIPT_DID_RUN) - MESSAGE(STATUS "Stage 1 did run install script 2.") - ELSE(CMAKE_INSTALL_SCRIPT_DID_RUN) - MESSAGE(SEND_ERROR "Stage 1 did not run install script 2.") - ENDIF(CMAKE_INSTALL_SCRIPT_DID_RUN) + set(CMAKE_INSTALL_SCRIPT_DID_RUN 0) + include(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL) + if(CMAKE_INSTALL_SCRIPT_DID_RUN) + message(STATUS "Stage 1 did run install script 2.") + else(CMAKE_INSTALL_SCRIPT_DID_RUN) + message(SEND_ERROR "Stage 1 did not run install script 2.") + endif(CMAKE_INSTALL_SCRIPT_DID_RUN) - IF(CYGWIN OR MINGW) - SET(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin") - ENDIF(CYGWIN OR MINGW) - MESSAGE("Search for library in: ${LIBPATHS}") + if(CYGWIN OR MINGW) + set(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin") + endif(CYGWIN OR MINGW) + message("Search for library in: ${LIBPATHS}") - SET(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) - SET(TEST2_LIBRARY "TEST2_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) - SET(TEST4_LIBRARY "TEST4_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) + set(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) + set(TEST2_LIBRARY "TEST2_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) + set(TEST4_LIBRARY "TEST4_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) - FIND_LIBRARY(TEST1_LIBRARY + find_library(TEST1_LIBRARY NAMES ${t1NAMES} PATHS ${LIBPATHS} DOC "First library") - FIND_LIBRARY(TEST2_LIBRARY + find_library(TEST2_LIBRARY NAMES ${t2NAMES} PATHS ${LIBPATHS} DOC "Second library") - FIND_LIBRARY(TEST4_LIBRARY + find_library(TEST4_LIBRARY NAMES ${t4NAMES} PATHS ${LIBPATHS} DOC "Fourth library") # Test importing a library found on disk. - ADD_LIBRARY(lib_test4 UNKNOWN IMPORTED) - SET_PROPERTY(TARGET lib_test4 PROPERTY IMPORTED_LOCATION ${TEST4_LIBRARY}) + add_library(lib_test4 UNKNOWN IMPORTED) + set_property(TARGET lib_test4 PROPERTY IMPORTED_LOCATION ${TEST4_LIBRARY}) - INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/MyTest/include) - ADD_EXECUTABLE (SimpleInstExeS2 inst2.cxx foo.c foo.h) - TARGET_LINK_LIBRARIES(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} lib_test4) - SET(install_target SimpleInstExeS2) + include_directories(${CMAKE_INSTALL_PREFIX}/MyTest/include) + add_executable (SimpleInstExeS2 inst2.cxx foo.c foo.h) + target_link_libraries(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} lib_test4) + set(install_target SimpleInstExeS2) - IF("${TEST1_LIBRARY}" MATCHES "static") - MESSAGE(STATUS "test1 correctly found in lib/static") - ELSE("${TEST1_LIBRARY}" MATCHES "static") - MESSAGE(SEND_ERROR "test1 not found in lib/static!") - ENDIF("${TEST1_LIBRARY}" MATCHES "static") + if("${TEST1_LIBRARY}" MATCHES "static") + message(STATUS "test1 correctly found in lib/static") + else("${TEST1_LIBRARY}" MATCHES "static") + message(SEND_ERROR "test1 not found in lib/static!") + endif("${TEST1_LIBRARY}" MATCHES "static") # Check for failure of configuration-specific installation. - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") - MESSAGE(FATAL_ERROR "Debug-configuration file installed for Release!") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") - MESSAGE(FATAL_ERROR "Release-configuration file installed for Debug!") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") + message(FATAL_ERROR "Debug-configuration file installed for Release!") + endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + message(FATAL_ERROR "Release-configuration file installed for Debug!") + endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") # Check for failure of directory installation. - IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") - MESSAGE(FATAL_ERROR "Directory installation did not install TSD.h") - ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") - MESSAGE(FATAL_ERROR "Directory installation installed CVS directory.") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") - MESSAGE(FATAL_ERROR "Directory installation installed CVS directory.") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") - MESSAGE(FATAL_ERROR "Directory installation installed CMakeLists.txt.") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") - IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") - MESSAGE(FATAL_ERROR "Directory installation did not install alternate TSD.h") - ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") - MESSAGE(FATAL_ERROR "Directory installation installed alternate TSD.cxx") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") + if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") + message(FATAL_ERROR "Directory installation did not install TSD.h") + endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") + message(FATAL_ERROR "Directory installation installed CVS directory.") + endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") + message(FATAL_ERROR "Directory installation installed CVS directory.") + endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") + message(FATAL_ERROR "Directory installation installed CMakeLists.txt.") + endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") + if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") + message(FATAL_ERROR "Directory installation did not install alternate TSD.h") + endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") + message(FATAL_ERROR "Directory installation installed alternate TSD.cxx") + endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") # Check that scripts properly installed. - IF(WIN32 AND NOT CYGWIN) - SET(BAT .bat) - ELSE(WIN32 AND NOT CYGWIN) - SET(BAT) - ENDIF(WIN32 AND NOT CYGWIN) - FOREACH(loc share share/old1 share/old2 share/old3 share/alt) - SET(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}") - EXECUTE_PROCESS( + if(WIN32 AND NOT CYGWIN) + set(BAT .bat) + else(WIN32 AND NOT CYGWIN) + set(BAT) + endif(WIN32 AND NOT CYGWIN) + foreach(loc share share/old1 share/old2 share/old3 share/alt) + set(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}") + execute_process( COMMAND ${CUR_SCRIPT} RESULT_VARIABLE SAMPLE_SCRIPT_RESULT OUTPUT_VARIABLE SAMPLE_SCRIPT_OUTPUT ) - IF(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") - MESSAGE(FATAL_ERROR + if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + message(FATAL_ERROR "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]") - ENDIF(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") - IF(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") - MESSAGE(FATAL_ERROR + endif(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + if(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") + message(FATAL_ERROR "Bad sample script [${CUR_SCRIPT}] output: [${SAMPLE_SCRIPT_OUTPUT}]") - ENDIF(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") - ENDFOREACH(loc) + endif(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") + endforeach(loc) # Check for failure of empty directory installation. - IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") - MESSAGE(FATAL_ERROR "Empty directory installation did not install.") - ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") - FILE(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*") - IF(EMPTY_FILES) - MESSAGE(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].") - ENDIF(EMPTY_FILES) + if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") + message(FATAL_ERROR "Empty directory installation did not install.") + endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") + file(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*") + if(EMPTY_FILES) + message(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].") + endif(EMPTY_FILES) # Make sure the test executable can run from the install tree. - SET_TARGET_PROPERTIES(SimpleInstExeS2 PROPERTIES + set_target_properties(SimpleInstExeS2 PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib) - INSTALL_TARGETS(/MyTest/bin SimpleInstExeS2) + install_targets(/MyTest/bin SimpleInstExeS2) # try to import the exported targets again - SET(SimpleInstallS1_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) - FIND_PACKAGE(SimpleInstallS1 REQUIRED) - GET_TARGET_PROPERTY(simpleInstallImported S1_SimpleInstall IMPORTED) - IF(NOT simpleInstallImported) - MESSAGE(FATAL_ERROR "Target S1_SimpleInstall could not be imported") - ENDIF(NOT simpleInstallImported) + set(SimpleInstallS1_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) + find_package(SimpleInstallS1 REQUIRED) + get_target_property(simpleInstallImported S1_SimpleInstall IMPORTED) + if(NOT simpleInstallImported) + message(FATAL_ERROR "Target S1_SimpleInstall could not be imported") + endif(NOT simpleInstallImported) -ELSE(STAGE2) +else(STAGE2) # Wipe out the install directory to do a fresh test. - FILE(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest) + file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest) # this is stage 1, so create libraries and modules and install everything - ADD_LIBRARY(test1 STATIC lib1.cxx) - ADD_LIBRARY(test2 SHARED lib2.cxx) - ADD_LIBRARY(test3 MODULE lib3.cxx) - ADD_LIBRARY(test4 SHARED lib4.cxx) + add_library(test1 STATIC lib1.cxx) + add_library(test2 SHARED lib2.cxx) + add_library(test3 MODULE lib3.cxx) + add_library(test4 SHARED lib4.cxx) # Test _OUTPUT_NAME properties. - SET_PROPERTY(TARGET test4 PROPERTY ARCHIVE_OUTPUT_NAME test4out) - SET_PROPERTY(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4out) + set_property(TARGET test4 PROPERTY ARCHIVE_OUTPUT_NAME test4out) + set_property(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4out) - ADD_EXECUTABLE (SimpleInstall inst.cxx foo.c foo.h) - TARGET_LINK_LIBRARIES(SimpleInstall test1 test2 test4) - SET(install_target SimpleInstall) + add_executable (SimpleInstall inst.cxx foo.c foo.h) + target_link_libraries(SimpleInstall test1 test2 test4) + set(install_target SimpleInstall) - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe) + set_target_properties(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe) # Disable VERSION test until it is implemented in the Xcode generator. - IF(NOT XCODE) - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES VERSION 1.2) - ENDIF(NOT XCODE) + if(NOT XCODE) + set_target_properties(SimpleInstall PROPERTIES VERSION 1.2) + endif(NOT XCODE) # Make sure the test executable can run from the install tree. - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES + set_target_properties(SimpleInstall PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib) # Test per-configuration output name. - SET_TARGET_PROPERTIES(test1 PROPERTIES RELEASE_OUTPUT_NAME test1rel) - SET_TARGET_PROPERTIES(test2 PROPERTIES PUBLIC_HEADER foo.h) + set_target_properties(test1 PROPERTIES RELEASE_OUTPUT_NAME test1rel) + set_target_properties(test2 PROPERTIES PUBLIC_HEADER foo.h) - IF(CMAKE_GENERATOR MATCHES "Makefiles") - ADD_SUBDIRECTORY(TestSubDir) - ADD_DEPENDENCIES(SimpleInstall TSD) - ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") + if(CMAKE_GENERATOR MATCHES "Makefiles") + add_subdirectory(TestSubDir) + add_dependencies(SimpleInstall TSD) + endif(CMAKE_GENERATOR MATCHES "Makefiles") - ADD_DEPENDENCIES(SimpleInstall test3) - ADD_DEPENDENCIES(test2 test3) - ADD_DEPENDENCIES(test4 test2) + add_dependencies(SimpleInstall test3) + add_dependencies(test2 test3) + add_dependencies(test4 test2) - INSTALL(TARGETS SimpleInstall test1 test2 test3 EXPORT SimpleInstallS1 + install(TARGETS SimpleInstall test1 test2 test3 EXPORT SimpleInstallS1 RUNTIME DESTINATION MyTest/bin COMPONENT Runtime # .exe, .dll LIBRARY DESTINATION MyTest/lib COMPONENT Runtime # .so, mod.dll ARCHIVE DESTINATION MyTest/lib/static COMPONENT Development # .a, .lib PUBLIC_HEADER DESTINATION MyTest/include COMPONENT Development ) - INSTALL(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE + install(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE RUNTIME DESTINATION MyTest/bin LIBRARY DESTINATION MyTest/lib ARCHIVE DESTINATION MyTest/lib/static OPTIONAL # for coverage...target should always exist ) - INSTALL(FILES lib1.h DESTINATION MyTest/include/foo) - INSTALL(FILES lib2.h + install(FILES lib1.h DESTINATION MyTest/include/foo) + install(FILES lib2.h DESTINATION MyTest/include/foo COMPONENT Development PERMISSIONS OWNER_READ OWNER_WRITE @@ -218,40 +218,40 @@ ELSE(STAGE2) ) # Test old-style install commands. - INSTALL_FILES(/MyTest/include FILES lib3.h) - INSTALL_FILES(/MyTest/include/old .h lib3) - INSTALL_FILES(/MyTest/include/old "^lib2.h$") - INSTALL_PROGRAMS(/MyTest/share/old1 FILES + install_files(/MyTest/include FILES lib3.h) + install_files(/MyTest/include/old .h lib3) + install_files(/MyTest/include/old "^lib2.h$") + install_programs(/MyTest/share/old1 FILES scripts/sample_script scripts/sample_script.bat) - INSTALL_PROGRAMS(/MyTest/share/old2 + install_programs(/MyTest/share/old2 scripts/sample_script scripts/sample_script.bat) # "export" the targets collected in "SimpleInstallS1" - INSTALL(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake + install(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake DESTINATION MyTest/lib NAMESPACE S1_ ) - EXPORT(TARGETS SimpleInstall test1 test2 test3 + export(TARGETS SimpleInstall test1 test2 test3 FILE "${CMAKE_CURRENT_BINARY_DIR}/SimpleInstallS1Config.cmake" NAMESPACE S2_ ) - ADD_SUBDIRECTORY(scripts) + add_subdirectory(scripts) # Test optional installation. - INSTALL(FILES does_not_exist.h DESTINATION MyTest/include/foo OPTIONAL) + install(FILES does_not_exist.h DESTINATION MyTest/include/foo OPTIONAL) # Test configuration-specific installation. - INSTALL(FILES lib1.h RENAME lib1release.h CONFIGURATIONS Release + install(FILES lib1.h RENAME lib1release.h CONFIGURATIONS Release DESTINATION MyTest/include/Release ) - INSTALL(FILES lib1.h RENAME lib1debug.h CONFIGURATIONS Debug + install(FILES lib1.h RENAME lib1debug.h CONFIGURATIONS Debug DESTINATION MyTest/include/Debug ) # Test directory installation. - FILE(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") - FILE(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") - INSTALL( + file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") + file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") + install( DIRECTORY TestSubDir scripts/ DESTINATION MyTest/share FILE_PERMISSIONS OWNER_READ OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE @@ -262,14 +262,14 @@ ELSE(STAGE2) ) # Alternate directory installation for coverage. - INSTALL( + install( DIRECTORY scripts/ DESTINATION MyTest/share/alt COMPONENT Development USE_SOURCE_PERMISSIONS PATTERN "CVS" EXCLUDE REGEX "\\.txt$" EXCLUDE ) - INSTALL( + install( DIRECTORY TestSubDir DESTINATION MyTest/share/alt FILE_PERMISSIONS OWNER_READ OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE @@ -278,65 +278,65 @@ ELSE(STAGE2) ) # Test empty directory installation. - INSTALL(DIRECTORY DESTINATION MyTest/share/empty) + install(DIRECTORY DESTINATION MyTest/share/empty) # Test optional directory installation. - INSTALL(DIRECTORY does-not-exist DESTINATION MyTest/share OPTIONAL) + install(DIRECTORY does-not-exist DESTINATION MyTest/share OPTIONAL) # Test user-specified install scripts, with and without COMPONENT. - INSTALL( + install( SCRIPT InstallScript1.cmake - CODE "SET(INSTALL_CODE_DID_RUN 1)" + CODE "set(INSTALL_CODE_DID_RUN 1)" SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/InstallScript2.cmake ) - INSTALL( + install( SCRIPT InstallScript3.cmake - CODE "SET(INSTALL_CODE_WITH_COMPONENT_DID_RUN 1)" + CODE "set(INSTALL_CODE_WITH_COMPONENT_DID_RUN 1)" SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/InstallScript4.cmake COMPONENT Development ) - SET_DIRECTORY_PROPERTIES(PROPERTIES + set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_INSTALL_PREFIX}/InstallScriptOut.cmake;${CMAKE_INSTALL_PREFIX}/InstallScript4Out.cmake") - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT + set_target_properties(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake) - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT + set_target_properties(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake) - SET_TARGET_PROPERTIES(test4 PROPERTIES VERSION 1.2 SOVERSION 3 + set_target_properties(test4 PROPERTIES VERSION 1.2 SOVERSION 3 INSTALL_NAME_DIR @executable_path/../lib) -ENDIF(STAGE2) +endif(STAGE2) -IF(CMAKE_CONFIGURATION_TYPES) - SET(SI_CONFIG -C ${CMAKE_CFG_INTDIR}) -ELSE(CMAKE_CONFIGURATION_TYPES) - SET(SI_CONFIG) -ENDIF(CMAKE_CONFIGURATION_TYPES) +if(CMAKE_CONFIGURATION_TYPES) + set(SI_CONFIG -C ${CMAKE_CFG_INTDIR}) +else(CMAKE_CONFIGURATION_TYPES) + set(SI_CONFIG) +endif(CMAKE_CONFIGURATION_TYPES) # Dummy test of CPack -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack") -SET(CPACK_PACKAGE_VENDOR "Kitware") -SET(CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/PackageScript.cmake") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack") +set(CPACK_PACKAGE_VENDOR "Kitware") +set(CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/PackageScript.cmake") -IF(WIN32 AND NOT UNIX) - FIND_PROGRAM(NSIS_MAKENSIS NAMES makensis +if(WIN32 AND NOT UNIX) + find_program(NSIS_MAKENSIS NAMES makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS] DOC "Where is makensis.exe located" ) - IF(NOT NSIS_MAKENSIS) - SET(CPACK_GENERATOR TGZ) - ENDIF(NOT NSIS_MAKENSIS) -ENDIF(WIN32 AND NOT UNIX) -IF(UNIX AND NOT APPLE) - SET(CPACK_GENERATOR "TGZ;STGZ;TZ") - # FIND_PROGRAM(found_compress + if(NOT NSIS_MAKENSIS) + set(CPACK_GENERATOR TGZ) + endif(NOT NSIS_MAKENSIS) +endif(WIN32 AND NOT UNIX) +if(UNIX AND NOT APPLE) + set(CPACK_GENERATOR "TGZ;STGZ;TZ") + # find_program(found_compress # NAMES compress) - # IF(found_compress) - # FIND_PROGRAM(file_command NAMES file) - # IF(NOT file_command) + # if(found_compress) + # find_program(file_command NAMES file) + # if(NOT file_command) # set(file_command file) - # ENDIF(NOT file_command) - # EXECUTE_PROCESS(COMMAND ${file_command} ${found_compress} + # endif(NOT file_command) + # execute_process(COMMAND ${file_command} ${found_compress} # OUTPUT_VARIABLE output) # set(SKIP_TZ FALSE) # if("${output}" MATCHES "script") @@ -348,39 +348,39 @@ IF(UNIX AND NOT APPLE) # if(NOT SKIP_TZ) # message("compress found and it was not a script") # message("output from file command: [${output}]") - # SET(CPACK_GENERATOR "${CPACK_GENERATOR};TZ") + # set(CPACK_GENERATOR "${CPACK_GENERATOR};TZ") # else(NOT SKIP_TZ) # message("compress found, but it was a script so dont use it") # message("output from file command: [${output}]") # endif(NOT SKIP_TZ) - # ENDIF(found_compress) - FIND_PROGRAM(found_bz2 + # endif(found_compress) + find_program(found_bz2 NAMES bzip2) - IF(found_bz2) - SET(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2") - ENDIF(found_bz2) -ENDIF(UNIX AND NOT APPLE) + if(found_bz2) + set(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2") + endif(found_bz2) +endif(UNIX AND NOT APPLE) -SET(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install") -SET(CMAKE_INSTALL_MFC_LIBRARIES 1) -SET(CMAKE_INSTALL_DEBUG_LIBRARIES 1) -INCLUDE(InstallRequiredSystemLibraries) +set(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install") +set(CMAKE_INSTALL_MFC_LIBRARIES 1) +set(CMAKE_INSTALL_DEBUG_LIBRARIES 1) +include(InstallRequiredSystemLibraries) -IF(CTEST_TEST_CPACK) - SET(PACKAGE_TARGET --build-target package) +if(CTEST_TEST_CPACK) + set(PACKAGE_TARGET --build-target package) # Avoid settings that require the .zip file command line tools... # (just build an NSIS installer without component support) # - SET(CPACK_BINARY_ZIP OFF) - SET(CPACK_MONOLITHIC_INSTALL ON) -ELSE(CTEST_TEST_CPACK) - SET(PACKAGE_TARGET) -ENDIF(CTEST_TEST_CPACK) + set(CPACK_BINARY_ZIP OFF) + set(CPACK_MONOLITHIC_INSTALL ON) +else(CTEST_TEST_CPACK) + set(PACKAGE_TARGET) +endif(CTEST_TEST_CPACK) -INCLUDE(CPack) +include(CPack) -ADD_CUSTOM_COMMAND( +add_custom_command( TARGET ${install_target} POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND} diff --git a/Tests/SimpleInstallS2/InstallScript1.cmake b/Tests/SimpleInstallS2/InstallScript1.cmake index 27b7725f8..85465bfed 100644 --- a/Tests/SimpleInstallS2/InstallScript1.cmake +++ b/Tests/SimpleInstallS2/InstallScript1.cmake @@ -1,5 +1,5 @@ -MESSAGE("This is install script 1.") -SET(INSTALL_SCRIPT_1_DID_RUN 1) -IF(INSTALL_CODE_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 1 did not run before install code.") -ENDIF(INSTALL_CODE_DID_RUN) +message("This is install script 1.") +set(INSTALL_SCRIPT_1_DID_RUN 1) +if(INSTALL_CODE_DID_RUN) + message(FATAL_ERROR "Install script 1 did not run before install code.") +endif(INSTALL_CODE_DID_RUN) diff --git a/Tests/SimpleInstallS2/InstallScript2.cmake b/Tests/SimpleInstallS2/InstallScript2.cmake index 927cae8b6..a675df7ea 100644 --- a/Tests/SimpleInstallS2/InstallScript2.cmake +++ b/Tests/SimpleInstallS2/InstallScript2.cmake @@ -1,14 +1,14 @@ -MESSAGE("This is install script 2.") -IF(INSTALL_SCRIPT_1_DID_RUN) - MESSAGE("Install script ordering works.") -ELSE(INSTALL_SCRIPT_1_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 1 did not run before install script 2.") -ENDIF(INSTALL_SCRIPT_1_DID_RUN) -IF(INSTALL_CODE_DID_RUN) - MESSAGE("Install code ordering works.") -ELSE(INSTALL_CODE_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 2 did not run after install code.") -ENDIF(INSTALL_CODE_DID_RUN) -FILE(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake" - "SET(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n" +message("This is install script 2.") +if(INSTALL_SCRIPT_1_DID_RUN) + message("Install script ordering works.") +else(INSTALL_SCRIPT_1_DID_RUN) + message(FATAL_ERROR "Install script 1 did not run before install script 2.") +endif(INSTALL_SCRIPT_1_DID_RUN) +if(INSTALL_CODE_DID_RUN) + message("Install code ordering works.") +else(INSTALL_CODE_DID_RUN) + message(FATAL_ERROR "Install script 2 did not run after install code.") +endif(INSTALL_CODE_DID_RUN) +file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake" + "set(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n" ) diff --git a/Tests/SimpleInstallS2/InstallScript3.cmake b/Tests/SimpleInstallS2/InstallScript3.cmake index b1aecd4c2..a955be146 100644 --- a/Tests/SimpleInstallS2/InstallScript3.cmake +++ b/Tests/SimpleInstallS2/InstallScript3.cmake @@ -1,12 +1,12 @@ -MESSAGE("This is install script 3.") -SET(INSTALL_SCRIPT_3_DID_RUN 1) -IF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 3 did not run before install code with component.") -ENDIF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +message("This is install script 3.") +set(INSTALL_SCRIPT_3_DID_RUN 1) +if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) + message(FATAL_ERROR "Install script 3 did not run before install code with component.") +endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN) -IF(CMAKE_INSTALL_COMPONENT) -IF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") - MESSAGE("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") - MESSAGE(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.") -ENDIF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -ENDIF(CMAKE_INSTALL_COMPONENT) +if(CMAKE_INSTALL_COMPONENT) +if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") + message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") + message(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.") +endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") +endif(CMAKE_INSTALL_COMPONENT) diff --git a/Tests/SimpleInstallS2/InstallScript4.cmake b/Tests/SimpleInstallS2/InstallScript4.cmake index 0ffea4bc8..0bbd9d2c8 100644 --- a/Tests/SimpleInstallS2/InstallScript4.cmake +++ b/Tests/SimpleInstallS2/InstallScript4.cmake @@ -1,22 +1,22 @@ -MESSAGE("This is install script 4.") -IF(INSTALL_SCRIPT_3_DID_RUN) - MESSAGE("Install script ordering works.") -ELSE(INSTALL_SCRIPT_3_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 3 did not run before install script 4.") -ENDIF(INSTALL_SCRIPT_3_DID_RUN) -IF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) - MESSAGE("Install code ordering works.") -ELSE(INSTALL_CODE_WITH_COMPONENT_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 4 did not run after install with component code.") -ENDIF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +message("This is install script 4.") +if(INSTALL_SCRIPT_3_DID_RUN) + message("Install script ordering works.") +else(INSTALL_SCRIPT_3_DID_RUN) + message(FATAL_ERROR "Install script 3 did not run before install script 4.") +endif(INSTALL_SCRIPT_3_DID_RUN) +if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) + message("Install code ordering works.") +else(INSTALL_CODE_WITH_COMPONENT_DID_RUN) + message(FATAL_ERROR "Install script 4 did not run after install with component code.") +endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN) -IF(CMAKE_INSTALL_COMPONENT) -IF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") - MESSAGE("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") - MESSAGE(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.") -ENDIF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -ENDIF(CMAKE_INSTALL_COMPONENT) +if(CMAKE_INSTALL_COMPONENT) +if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") + message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") + message(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.") +endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") +endif(CMAKE_INSTALL_COMPONENT) -FILE(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake" - "SET(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n" +file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake" + "set(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n" ) diff --git a/Tests/SimpleInstallS2/PackageScript.cmake b/Tests/SimpleInstallS2/PackageScript.cmake index 36429e2f7..be07f89cc 100644 --- a/Tests/SimpleInstallS2/PackageScript.cmake +++ b/Tests/SimpleInstallS2/PackageScript.cmake @@ -1,10 +1,10 @@ -MESSAGE("This is packaging script") -MESSAGE("It writes a file with all variables available in ${CMAKE_INSTALL_PREFIX}/AllVariables.txt") +message("This is packaging script") +message("It writes a file with all variables available in ${CMAKE_INSTALL_PREFIX}/AllVariables.txt") -FILE(WRITE ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "") -GET_CMAKE_PROPERTY(res VARIABLES) -FOREACH(var ${res}) - FILE(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt +file(WRITE ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "") +get_cmake_property(res VARIABLES) +foreach(var ${res}) + file(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "${var} \"${${var}}\"\n") -ENDFOREACH(var ${res}) +endforeach(var ${res}) diff --git a/Tests/SimpleInstallS2/PostInstall.cmake b/Tests/SimpleInstallS2/PostInstall.cmake index 52ea140a5..222cc5ae9 100644 --- a/Tests/SimpleInstallS2/PostInstall.cmake +++ b/Tests/SimpleInstallS2/PostInstall.cmake @@ -1,6 +1,6 @@ -MESSAGE("In post install") -IF(PRE_INSTALL_DID_RUN) - MESSAGE("Pre and post install work fine") -ELSE(PRE_INSTALL_DID_RUN) - MESSAGE(FATAL_ERROR "Pre install did not run before post install") -ENDIF(PRE_INSTALL_DID_RUN) +message("In post install") +if(PRE_INSTALL_DID_RUN) + message("Pre and post install work fine") +else(PRE_INSTALL_DID_RUN) + message(FATAL_ERROR "Pre install did not run before post install") +endif(PRE_INSTALL_DID_RUN) diff --git a/Tests/SimpleInstallS2/PreInstall.cmake b/Tests/SimpleInstallS2/PreInstall.cmake index 2ea2f7716..7a9851e1d 100644 --- a/Tests/SimpleInstallS2/PreInstall.cmake +++ b/Tests/SimpleInstallS2/PreInstall.cmake @@ -1,2 +1,2 @@ -MESSAGE("This is in pre install") -SET(PRE_INSTALL_DID_RUN 1) +message("This is in pre install") +set(PRE_INSTALL_DID_RUN 1) diff --git a/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt b/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt index 4f6295300..860e10425 100644 --- a/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt +++ b/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_EXECUTABLE(TSD TSD.cxx TSD_utils.cxx) -INSTALL_FILES(/MyTest/include FILES TSD.h) -INSTALL_TARGETS(/MyTest/bin TSD) +add_executable(TSD TSD.cxx TSD_utils.cxx) +install_files(/MyTest/include FILES TSD.h) +install_targets(/MyTest/bin TSD) diff --git a/Tests/SimpleInstallS2/scripts/CMakeLists.txt b/Tests/SimpleInstallS2/scripts/CMakeLists.txt index d46c1652e..ec34e8c50 100644 --- a/Tests/SimpleInstallS2/scripts/CMakeLists.txt +++ b/Tests/SimpleInstallS2/scripts/CMakeLists.txt @@ -1 +1 @@ -INSTALL_PROGRAMS(/MyTest/share/old3 "^sample_script(\\.bat)?$") +install_programs(/MyTest/share/old3 "^sample_script(\\.bat)?$") diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt index 13283d0c2..0af11f75b 100644 --- a/Tests/StringFileTest/CMakeLists.txt +++ b/Tests/StringFileTest/CMakeLists.txt @@ -1,164 +1,164 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(StringFileTest) -INCLUDE_DIRECTORIES(${StringFileTest_BINARY_DIR}) +project(StringFileTest) +include_directories(${StringFileTest_BINARY_DIR}) # Read file test -FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile) +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile) # Test reading a binary file into hex representation -FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/test.bin" hexContents HEX) +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/test.bin" hexContents HEX) -IF("${hexContents}" STREQUAL "0001027700") - MESSAGE("FILE(READ HEX) correctly read [${hexContents}]") -ELSE("${hexContents}" STREQUAL "0001027700") - MESSAGE(SEND_ERROR "FILE(READ HEX) incorrectly read [${hexContents}], but expected was [0001027700]") -ENDIF("${hexContents}" STREQUAL "0001027700") +if("${hexContents}" STREQUAL "0001027700") + message("file(READ HEX) correctly read [${hexContents}]") +else("${hexContents}" STREQUAL "0001027700") + message(SEND_ERROR "file(READ HEX) incorrectly read [${hexContents}], but expected was [0001027700]") +endif("${hexContents}" STREQUAL "0001027700") -# FILE(STRINGS) test -FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings +# file(STRINGS) test +file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings LIMIT_COUNT 1 LIMIT_INPUT 1024 LIMIT_OUTPUT 1024 LENGTH_MINIMUM 10 LENGTH_MAXIMUM 23 REGEX include NEWLINE_CONSUME) -SET(infile_strings_goal "#include \"includefile\"\n") -IF("${infile_strings}" STREQUAL "${infile_strings_goal}") - MESSAGE("FILE(STRINGS) correctly read [${infile_strings}]") -ELSE("${infile_strings}" STREQUAL "${infile_strings_goal}") - MESSAGE(SEND_ERROR - "FILE(STRINGS) incorrectly read [${infile_strings}]") -ENDIF("${infile_strings}" STREQUAL "${infile_strings_goal}") +set(infile_strings_goal "#include \"includefile\"\n") +if("${infile_strings}" STREQUAL "${infile_strings_goal}") + message("file(STRINGS) correctly read [${infile_strings}]") +else("${infile_strings}" STREQUAL "${infile_strings_goal}") + message(SEND_ERROR + "file(STRINGS) incorrectly read [${infile_strings}]") +endif("${infile_strings}" STREQUAL "${infile_strings_goal}") # test reading a file and getting its binary data as hex string -FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infilehex LIMIT 4 HEX) -IF(NOT "${infilehex}" STREQUAL "53313036") - MESSAGE(SEND_ERROR - "FILE(READ ... HEX) error, read: \"${infilehex}\", expected \"53313036\"") -ENDIF(NOT "${infilehex}" STREQUAL "53313036") +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infilehex LIMIT 4 HEX) +if(NOT "${infilehex}" STREQUAL "53313036") + message(SEND_ERROR + "file(READ ... HEX) error, read: \"${infilehex}\", expected \"53313036\"") +endif(NOT "${infilehex}" STREQUAL "53313036") -# test that FILE(STRINGS) also work with Intel hex and Motorola S-record files +# test that file(STRINGS) also work with Intel hex and Motorola S-record files # this file has been created with "sdcc main.c" -FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.ihx" infile_strings REGEX INFO) -SET(infile_strings_goal "INFO:compiler\\[SDCC-HEX\\]") -IF("${infile_strings}" MATCHES "${infile_strings_goal}") - MESSAGE("FILE(STRINGS) correctly read from hex file [${infile_strings}]") -ELSE("${infile_strings}" MATCHES "${infile_strings_goal}") - MESSAGE(SEND_ERROR - "FILE(STRINGS) incorrectly read from hex file [${infile_strings}]") -ENDIF("${infile_strings}" MATCHES "${infile_strings_goal}") +file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.ihx" infile_strings REGEX INFO) +set(infile_strings_goal "INFO:compiler\\[SDCC-HEX\\]") +if("${infile_strings}" MATCHES "${infile_strings_goal}") + message("file(STRINGS) correctly read from hex file [${infile_strings}]") +else("${infile_strings}" MATCHES "${infile_strings_goal}") + message(SEND_ERROR + "file(STRINGS) incorrectly read from hex file [${infile_strings}]") +endif("${infile_strings}" MATCHES "${infile_strings_goal}") # this file has been created with "sdcc main.c --out-fmt-s19" -FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infile_strings REGEX INFO) -SET(infile_strings_goal "INFO:compiler\\[SDCC-SREC\\]") -IF("${infile_strings}" MATCHES "${infile_strings_goal}") - MESSAGE("FILE(STRINGS) correctly read from srec file [${infile_strings}]") -ELSE("${infile_strings}" MATCHES "${infile_strings_goal}") - MESSAGE(SEND_ERROR - "FILE(STRINGS) incorrectly read from srec file [${infile_strings}]") -ENDIF("${infile_strings}" MATCHES "${infile_strings_goal}") +file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infile_strings REGEX INFO) +set(infile_strings_goal "INFO:compiler\\[SDCC-SREC\\]") +if("${infile_strings}" MATCHES "${infile_strings_goal}") + message("file(STRINGS) correctly read from srec file [${infile_strings}]") +else("${infile_strings}" MATCHES "${infile_strings_goal}") + message(SEND_ERROR + "file(STRINGS) incorrectly read from srec file [${infile_strings}]") +endif("${infile_strings}" MATCHES "${infile_strings_goal}") # String test -STRING(REGEX MATCH "[cC][mM][aA][kK][eE]" rmvar "CMake is great") -STRING(REGEX MATCHALL "[cC][mM][aA][kK][eE]" rmallvar "CMake is better than cmake or CMake") -STRING(REGEX REPLACE "[Aa][uU][tT][oO]([cC][oO][nN][fF]|[mM][aA][kK][eE])" +string(REGEX MATCH "[cC][mM][aA][kK][eE]" rmvar "CMake is great") +string(REGEX MATCHALL "[cC][mM][aA][kK][eE]" rmallvar "CMake is better than cmake or CMake") +string(REGEX REPLACE "[Aa][uU][tT][oO]([cC][oO][nN][fF]|[mM][aA][kK][eE])" "CMake" rrepvar "People should use Autoconf and Automake") -STRING(COMPARE EQUAL "CMake" "Autoconf" nceqvar) -STRING(COMPARE EQUAL "CMake" "CMake" ceqvar) -STRING(COMPARE NOTEQUAL "CMake" "Autoconf" cneqvar) -STRING(COMPARE NOTEQUAL "CMake" "CMake" ncneqvar) -STRING(COMPARE LESS "before" "after" nclvar) -STRING(COMPARE LESS "max" "min" clvar) -STRING(COMPARE GREATER "before" "after" cgvar) -STRING(COMPARE GREATER "max" "min" ncgvar) -STRING(ASCII 67 109 97 107 101 savar) -STRING(TOUPPER "CMake" tuvar) -STRING(TOLOWER "CMake" tlvar) -STRING(REPLACE "Autoconf" "CMake" repvar "People should use Autoconf") +string(COMPARE EQUAL "CMake" "Autoconf" nceqvar) +string(COMPARE EQUAL "CMake" "CMake" ceqvar) +string(COMPARE NOTEQUAL "CMake" "Autoconf" cneqvar) +string(COMPARE NOTEQUAL "CMake" "CMake" ncneqvar) +string(COMPARE LESS "before" "after" nclvar) +string(COMPARE LESS "max" "min" clvar) +string(COMPARE GREATER "before" "after" cgvar) +string(COMPARE GREATER "max" "min" ncgvar) +string(ASCII 67 109 97 107 101 savar) +string(TOUPPER "CMake" tuvar) +string(TOLOWER "CMake" tlvar) +string(REPLACE "Autoconf" "CMake" repvar "People should use Autoconf") -IF("abc" STREQUAL "xyz") - MESSAGE(SEND_ERROR "Problem with the IF(STREQUAL), \"abc\" and \"xyz\" considered equal") -ENDIF("abc" STREQUAL "xyz") +if("abc" STREQUAL "xyz") + message(SEND_ERROR "Problem with the if(STREQUAL), \"abc\" and \"xyz\" considered equal") +endif("abc" STREQUAL "xyz") -IF("CMake is cool" MATCHES "(CMake) (is).+") - IF(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool") - MESSAGE(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"CMake is cool\"") - ENDIF(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool") - IF(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake") - MESSAGE(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"CMake\"") - ENDIF(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake") - IF(NOT "${CMAKE_MATCH_2}" STREQUAL "is") - MESSAGE(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected \"is\"") - ENDIF(NOT "${CMAKE_MATCH_2}" STREQUAL "is") -ELSE("CMake is cool" MATCHES "(CMake) (is).+") - MESSAGE(SEND_ERROR "Problem with the IF(MATCHES), no match found") -ENDIF("CMake is cool" MATCHES "(CMake) (is).+") +if("CMake is cool" MATCHES "(CMake) (is).+") + if(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool") + message(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"CMake is cool\"") + endif(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool") + if(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake") + message(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"CMake\"") + endif(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake") + if(NOT "${CMAKE_MATCH_2}" STREQUAL "is") + message(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected \"is\"") + endif(NOT "${CMAKE_MATCH_2}" STREQUAL "is") +else("CMake is cool" MATCHES "(CMake) (is).+") + message(SEND_ERROR "Problem with the if(MATCHES), no match found") +endif("CMake is cool" MATCHES "(CMake) (is).+") -STRING(REGEX MATCH "(People).+CMake" matchResultVar "People should use CMake") -IF(NOT "${matchResultVar}" STREQUAL "People should use CMake") - MESSAGE(SEND_ERROR "STRING(REGEX MATCH) problem: \"${matchResultVar}\", expected \"People should use CMake\"") -ENDIF(NOT "${matchResultVar}" STREQUAL "People should use CMake") -IF(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake") - MESSAGE(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"People should use CMake\"") -ENDIF(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake") -IF(NOT "${CMAKE_MATCH_1}" STREQUAL "People") - MESSAGE(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"People\"") -ENDIF(NOT "${CMAKE_MATCH_1}" STREQUAL "People") -IF(NOT "${CMAKE_MATCH_2}" STREQUAL "") - MESSAGE(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected empty string") -ENDIF(NOT "${CMAKE_MATCH_2}" STREQUAL "") +string(REGEX MATCH "(People).+CMake" matchResultVar "People should use CMake") +if(NOT "${matchResultVar}" STREQUAL "People should use CMake") + message(SEND_ERROR "string(REGEX MATCH) problem: \"${matchResultVar}\", expected \"People should use CMake\"") +endif(NOT "${matchResultVar}" STREQUAL "People should use CMake") +if(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake") + message(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"People should use CMake\"") +endif(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake") +if(NOT "${CMAKE_MATCH_1}" STREQUAL "People") + message(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"People\"") +endif(NOT "${CMAKE_MATCH_1}" STREQUAL "People") +if(NOT "${CMAKE_MATCH_2}" STREQUAL "") + message(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected empty string") +endif(NOT "${CMAKE_MATCH_2}" STREQUAL "") -STRING(STRIP " +string(STRIP " ST1 " ST1) -STRING(STRIP "ST2 " ST2) -STRING(STRIP " ST3" ST3) +string(STRIP "ST2 " ST2) +string(STRIP " ST3" ST3) -FOREACH(var ST1 ST2 ST3) - IF("${var}" STREQUAL "${${var}}") - MESSAGE("[${var}] == [${${var}}]") - ELSE("${var}" STREQUAL "${${var}}") - MESSAGE(SEND_ERROR "Problem with the STRIP command for ${var}: [${${var}}]") - ENDIF("${var}" STREQUAL "${${var}}") -ENDFOREACH(var) +foreach(var ST1 ST2 ST3) + if("${var}" STREQUAL "${${var}}") + message("[${var}] == [${${var}}]") + else("${var}" STREQUAL "${${var}}") + message(SEND_ERROR "Problem with the STRIP command for ${var}: [${${var}}]") + endif("${var}" STREQUAL "${${var}}") +endforeach(var) -STRING(SUBSTRING "People should use Autoconf" 7 10 substringres) -SET(substringres "Everybody ${substringres} CMake") +string(SUBSTRING "People should use Autoconf" 7 10 substringres) +set(substringres "Everybody ${substringres} CMake") -STRING(LENGTH ${substringres} lengthres) +string(LENGTH ${substringres} lengthres) -FILE(RELATIVE_PATH relpath "/usr/local/bin" "/usr/X11R6/bin/xnest") +file(RELATIVE_PATH relpath "/usr/local/bin" "/usr/X11R6/bin/xnest") # Escaping test -SET(var "\\ \" \ \t \n \r \# \( \) \0") -MESSAGE("Output: [${var}]") -SET(var \\ \" \ \t \n \r \# \( \) \0) -MESSAGE("Output: [${var}]") +set(var "\\ \" \ \t \n \r \# \( \) \0") +message("Output: [${var}]") +set(var \\ \" \ \t \n \r \# \( \) \0) +message("Output: [${var}]") # Make-style unquoted argument test -SET(var $(VAR1)$(VAR2)/$(VAR3)) -MESSAGE("Output: [${var}]") -STRING(COMPARE EQUAL "${var}" "$(VAR1)$(VAR2)/$(VAR3)" result) -IF(NOT result) - MESSAGE(SEND_ERROR "Unquoted $(VAR) syntax is broken.") -ENDIF(NOT result) +set(var $(VAR1)$(VAR2)/$(VAR3)) +message("Output: [${var}]") +string(COMPARE EQUAL "${var}" "$(VAR1)$(VAR2)/$(VAR3)" result) +if(NOT result) + message(SEND_ERROR "Unquoted $(VAR) syntax is broken.") +endif(NOT result) # Obscure environment variable name -SET("ENV{x+(y)}" "Obscure environment variable value") -MESSAGE("Output: [$ENV{x+(y)}]") -IF(NOT "$ENV{x+(y)}" STREQUAL "Obscure environment variable value") - MESSAGE(SEND_ERROR "Environment variable \"ENV{x+(y)}\" does not work.") -ENDIF() +set("ENV{x+(y)}" "Obscure environment variable value") +message("Output: [$ENV{x+(y)}]") +if(NOT "$ENV{x+(y)}" STREQUAL "Obscure environment variable value") + message(SEND_ERROR "Environment variable \"ENV{x+(y)}\" does not work.") +endif() # Make directories test -FILE(MAKE_DIRECTORY +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Includes" "${CMAKE_CURRENT_BINARY_DIR}/Directory1" "${CMAKE_CURRENT_BINARY_DIR}/Directory2" ) # Write results to the file (test write file) -SET(file "${CMAKE_CURRENT_BINARY_DIR}/Includes/Values.h") -FILE(WRITE "${file}" "/* this file is generated */\n") -FOREACH(var +set(file "${CMAKE_CURRENT_BINARY_DIR}/Includes/Values.h") +file(WRITE "${file}" "/* this file is generated */\n") +foreach(var rmvar rmallvar rrepvar @@ -177,28 +177,28 @@ FOREACH(var savar tuvar tlvar) - FILE(APPEND "${file}" "#define ${var} \"${${var}}\"\n") -ENDFOREACH(var) + file(APPEND "${file}" "#define ${var} \"${${var}}\"\n") +endforeach(var) # Verify that the file was created recently. -IF(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in") - MESSAGE(FATAL_ERROR "IF(FILE_IS_NEWER) does not seem to work.") -ENDIF(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in") +if(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in") + message(FATAL_ERROR "if(FILE_IS_NEWER) does not seem to work.") +endif(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in") # Test configuration of the string -SET(TEST_DEFINED 123) -SET(TEST_NOT_DEFINED) -STRING(CONFIGURE "${infile}" infile+-/out @ONLY) -SET(infile "${infile+-/out}") +set(TEST_DEFINED 123) +set(TEST_NOT_DEFINED) +string(CONFIGURE "${infile}" infile+-/out @ONLY) +set(infile "${infile+-/out}") # Write include file to a file -STRING(REGEX REPLACE "includefile" "${file}" outfile "${infile}") -FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h-tmp" "${outfile}") -FILE(RENAME "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h-tmp" +string(REGEX REPLACE "includefile" "${file}" outfile "${infile}") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h-tmp" "${outfile}") +file(RENAME "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h-tmp" "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h") # Test file copy with relative paths -FILE(COPY . +file(COPY . DESTINATION src FILE_PERMISSIONS OWNER_READ # test no OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE @@ -207,31 +207,31 @@ FILE(COPY . ) # Test file glob -FILE(GLOB_RECURSE src_files "${CMAKE_CURRENT_SOURCE_DIR}/*") -MESSAGE("Files in ${CMAKE_CURRENT_SOURCE_DIR} are ${src_files}") -SET(expr "${CMAKE_CURRENT_BINARY_DIR}/src/[sS][!a-su-zA-Z0-9][^a-qs-zA-Z0-9]ing?ile*.cxx") -MESSAGE("Glob expression is [${expr}].") -FILE(GLOB src_files "${expr}") -MESSAGE("Globbed files [${src_files}].") -ADD_EXECUTABLE(StringFileTest ${src_files}) +file(GLOB_RECURSE src_files "${CMAKE_CURRENT_SOURCE_DIR}/*") +message("Files in ${CMAKE_CURRENT_SOURCE_DIR} are ${src_files}") +set(expr "${CMAKE_CURRENT_BINARY_DIR}/src/[sS][!a-su-zA-Z0-9][^a-qs-zA-Z0-9]ing?ile*.cxx") +message("Glob expression is [${expr}].") +file(GLOB src_files "${expr}") +message("Globbed files [${src_files}].") +add_executable(StringFileTest ${src_files}) -SET(expr "${CMAKE_CURRENT_SOURCE_DIR}/../*.cxx") -FILE(GLOB_RECURSE rel_src_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/.." "${expr}") -MESSAGE("Globbed files [${rel_src_files}].") +set(expr "${CMAKE_CURRENT_SOURCE_DIR}/../*.cxx") +file(GLOB_RECURSE rel_src_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/.." "${expr}") +message("Globbed files [${rel_src_files}].") # Test FOREACH range -MESSAGE("Cheack if FOREACH with RANGE works") -MACRO(TEST_RANGE ARGS CHECK) - SET(r) - FOREACH(a RANGE ${ARGS}) - SET(r ${r} ${a}) - ENDFOREACH(a) - MESSAGE("FOREACH with RANGE ${ARGS} produces ${r}") - IF("x${r}x" MATCHES "^x${CHECK}x$") - ELSE("x${r}x" MATCHES "^x${CHECK}x$") - MESSAGE(SEND_ERROR "The range resulted in: ${r} should be ${CHECK}") - ENDIF("x${r}x" MATCHES "^x${CHECK}x$") -ENDMACRO(TEST_RANGE) +message("Cheack if FOREACH with RANGE works") +macro(TEST_RANGE ARGS CHECK) + set(r) + foreach(a RANGE ${ARGS}) + set(r ${r} ${a}) + endforeach(a) + message("FOREACH with RANGE ${ARGS} produces ${r}") + if("x${r}x" MATCHES "^x${CHECK}x$") + else("x${r}x" MATCHES "^x${CHECK}x$") + message(SEND_ERROR "The range resulted in: ${r} should be ${CHECK}") + endif("x${r}x" MATCHES "^x${CHECK}x$") +endmacro(TEST_RANGE) TEST_RANGE("5" "0;1;2;3;4;5") TEST_RANGE("3;5" "3;4;5") TEST_RANGE("5;3" "5;4;3") @@ -258,25 +258,25 @@ if(NOT "${var_b}" STREQUAL "x") endif() # Test SUBSTRING command -SET(ST_INPUTSTRING "0123456789") -STRING(SUBSTRING ${ST_INPUTSTRING} 3 0 ST_EMPTY) -STRING(SUBSTRING ${ST_INPUTSTRING} 1 1 ST_ONE) -STRING(SUBSTRING ${ST_INPUTSTRING} 0 10 ST_ALL) -STRING(SUBSTRING ${ST_INPUTSTRING} 0 -1 ST_ALL_MINUS) -STRING(SUBSTRING ${ST_INPUTSTRING} 9 -1 ST_NINE) +set(ST_INPUTSTRING "0123456789") +string(SUBSTRING ${ST_INPUTSTRING} 3 0 ST_EMPTY) +string(SUBSTRING ${ST_INPUTSTRING} 1 1 ST_ONE) +string(SUBSTRING ${ST_INPUTSTRING} 0 10 ST_ALL) +string(SUBSTRING ${ST_INPUTSTRING} 0 -1 ST_ALL_MINUS) +string(SUBSTRING ${ST_INPUTSTRING} 9 -1 ST_NINE) -IF(ST_EMPTY) - MESSAGE(SEND_ERROR "SUBSTRING with length 0 does not return an empty string") -ENDIF(ST_EMPTY) -IF(NOT ST_ONE STREQUAL "1") - MESSAGE(SEND_ERROR "SUBSTING command does not cut the correct selected character, was \"" ${ST_ONE} "\", should be \"1\"") -ENDIF(NOT ST_ONE STREQUAL "1") -IF(NOT ST_INPUTSTRING STREQUAL ST_ALL) - MESSAGE(SEND_ERROR "SUBSTRING does not return the whole string when selected with length") -ENDIF(NOT ST_INPUTSTRING STREQUAL ST_ALL) -IF(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS) - MESSAGE(SEND_ERROR "SUBSTRING does not return the whole string when selected with -1") -ENDIF(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS) -IF(NOT ST_NINE STREQUAL "9") - MESSAGE(SEND_ERROR "SUBSTRING does not return the tail when selected with -1") -ENDIF(NOT ST_NINE STREQUAL "9") +if(ST_EMPTY) + message(SEND_ERROR "SUBSTRING with length 0 does not return an empty string") +endif(ST_EMPTY) +if(NOT ST_ONE STREQUAL "1") + message(SEND_ERROR "SUBSTING command does not cut the correct selected character, was \"" ${ST_ONE} "\", should be \"1\"") +endif(NOT ST_ONE STREQUAL "1") +if(NOT ST_INPUTSTRING STREQUAL ST_ALL) + message(SEND_ERROR "SUBSTRING does not return the whole string when selected with length") +endif(NOT ST_INPUTSTRING STREQUAL ST_ALL) +if(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS) + message(SEND_ERROR "SUBSTRING does not return the whole string when selected with -1") +endif(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS) +if(NOT ST_NINE STREQUAL "9") + message(SEND_ERROR "SUBSTRING does not return the tail when selected with -1") +endif(NOT ST_NINE STREQUAL "9") diff --git a/Tests/SubDir/CMakeLists.txt b/Tests/SubDir/CMakeLists.txt index cf8fe97fa..2aec95635 100644 --- a/Tests/SubDir/CMakeLists.txt +++ b/Tests/SubDir/CMakeLists.txt @@ -1,46 +1,46 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(SUBDIR) -SUBDIRS(Executable EXCLUDE_FROM_ALL Examples) -WRITE_FILE(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.") +project(SUBDIR) +subdirs(Executable EXCLUDE_FROM_ALL Examples) +write_file(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.") #WATCOM WMAKE does not support + in the name of a file! -IF(WATCOM) - SET(PLUS_NAME_FILES +if(WATCOM) + set(PLUS_NAME_FILES AnotherSubdir/pair_int.int.c vcl_algorithm_vcl_pair_double.foo.c) -ELSE(WATCOM) - SET(PLUS_NAME_FILES +else(WATCOM) + set(PLUS_NAME_FILES AnotherSubdir/pair+int.int.c vcl_algorithm+vcl_pair+double.foo.c) -ENDIF(WATCOM) +endif(WATCOM) -ADD_EXECUTABLE(TestFromSubdir +add_executable(TestFromSubdir AnotherSubdir/testfromsubdir.c AnotherSubdir/secondone ${PLUS_NAME_FILES} ) -AUX_SOURCE_DIRECTORY(ThirdSubDir SOURCES) -IF(WATCOM) - FOREACH(f ${SOURCES}) - IF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - ELSE("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - SET(SOURCES2 ${f} ${SOURCES2}) - ENDIF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - ENDFOREACH(f) - SET(SOURCES ${SOURCES2}) - SET(SOURCES ${SOURCES} +aux_source_directory(ThirdSubDir SOURCES) +if(WATCOM) + foreach(f ${SOURCES}) + if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + else("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + set(SOURCES2 ${f} ${SOURCES2}) + endif("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + endforeach(f) + set(SOURCES ${SOURCES2}) + set(SOURCES ${SOURCES} vcl_algorithm_vcl_pair_double.foo.c) -ELSE(WATCOM) - FOREACH(f ${SOURCES}) - IF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - ELSE("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - SET(SOURCES2 ${f} ${SOURCES2}) - MESSAGE("${f}") - ENDIF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - ENDFOREACH(f) - SET(SOURCES ${SOURCES2}) - SET(SOURCES ${SOURCES} +else(WATCOM) + foreach(f ${SOURCES}) + if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + else("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + set(SOURCES2 ${f} ${SOURCES2}) + message("${f}") + endif("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + endforeach(f) + set(SOURCES ${SOURCES2}) + set(SOURCES ${SOURCES} vcl_algorithm+vcl_pair+double.foo.c) -ENDIF(WATCOM) -MESSAGE("Sources: ${SOURCES}") -ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES}) +endif(WATCOM) +message("Sources: ${SOURCES}") +add_executable(TestWithAuxSourceDir ${SOURCES}) diff --git a/Tests/SubDir/Examples/CMakeLists.txt b/Tests/SubDir/Examples/CMakeLists.txt index b0f1e896c..8cd7e24e1 100644 --- a/Tests/SubDir/Examples/CMakeLists.txt +++ b/Tests/SubDir/Examples/CMakeLists.txt @@ -1,3 +1,3 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(Examples) -SUBDIRS(example1 example2) +project(Examples) +subdirs(example1 example2) diff --git a/Tests/SubDir/Examples/example1/CMakeLists.txt b/Tests/SubDir/Examples/example1/CMakeLists.txt index 303618321..20d065e54 100644 --- a/Tests/SubDir/Examples/example1/CMakeLists.txt +++ b/Tests/SubDir/Examples/example1/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(example1) -ADD_EXECUTABLE(example1 example1.cxx) +project(example1) +add_executable(example1 example1.cxx) -ADD_CUSTOM_COMMAND(TARGET example1 POST_BUILD +add_custom_command(TARGET example1 POST_BUILD COMMAND "${CMAKE_COMMAND}" ARGS -E remove ${SUBDIR_BINARY_DIR}/ShouldBeHere COMMENT "Remove marker file that should exist because this should not be run") diff --git a/Tests/SubDir/Examples/example2/CMakeLists.txt b/Tests/SubDir/Examples/example2/CMakeLists.txt index 19a537686..388e33c3d 100644 --- a/Tests/SubDir/Examples/example2/CMakeLists.txt +++ b/Tests/SubDir/Examples/example2/CMakeLists.txt @@ -1,2 +1,2 @@ -PROJECT(example2) -ADD_EXECUTABLE(example2 example2.cxx) +project(example2) +add_executable(example2 example2.cxx) diff --git a/Tests/SubDir/Executable/CMakeLists.txt b/Tests/SubDir/Executable/CMakeLists.txt index d679168d8..77e6751cd 100644 --- a/Tests/SubDir/Executable/CMakeLists.txt +++ b/Tests/SubDir/Executable/CMakeLists.txt @@ -1 +1 @@ -ADD_EXECUTABLE(test test.cxx) +add_executable(test test.cxx) diff --git a/Tests/SubDirSpaces/CMakeLists.txt b/Tests/SubDirSpaces/CMakeLists.txt index a0053a236..f1ace0f79 100644 --- a/Tests/SubDirSpaces/CMakeLists.txt +++ b/Tests/SubDirSpaces/CMakeLists.txt @@ -1,16 +1,16 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(SUBDIR) +project(SUBDIR) # Some systems do not seem to support rpath with spaces. -IF("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX") - SET(CMAKE_SKIP_BUILD_RPATH 1) -ENDIF("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX") +if("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX") + set(CMAKE_SKIP_BUILD_RPATH 1) +endif("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX") # be able to see output from make on dashboards -SET(CMAKE_VERBOSE_MAKEFILE 1) +set(CMAKE_VERBOSE_MAKEFILE 1) message("${CMAKE_MAKE_PROGRAM}") set(CMAKE_PAREN TRUE) -IF("${CMAKE_MAKE_PROGRAM}" MATCHES "wmake") +if("${CMAKE_MAKE_PROGRAM}" MATCHES "wmake") message("wmake does not support () in path") set(CMAKE_PAREN FALSE) elseif("${CMAKE_MAKE_PROGRAM}" MATCHES "make") @@ -23,55 +23,55 @@ elseif("${CMAKE_MAKE_PROGRAM}" MATCHES "make") endif() endif() -IF(CMAKE_PAREN) - ADD_DEFINITIONS(-DCMAKE_PAREN=1) - SUBDIRS("Executable Sources" "Some(x86) Sources" EXCLUDE_FROM_ALL "Some Examples") -ELSE(CMAKE_PAREN) - SUBDIRS("Executable Sources" EXCLUDE_FROM_ALL "Some Examples") -ENDIF(CMAKE_PAREN) +if(CMAKE_PAREN) + add_definitions(-DCMAKE_PAREN=1) + subdirs("Executable Sources" "Some(x86) Sources" EXCLUDE_FROM_ALL "Some Examples") +else(CMAKE_PAREN) + subdirs("Executable Sources" EXCLUDE_FROM_ALL "Some Examples") +endif(CMAKE_PAREN) -WRITE_FILE(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.") +write_file(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.") #WATCOM WMAKE does not support + in the name of a file! -IF(WATCOM) - SET(PLUS_NAME_FILES +if(WATCOM) + set(PLUS_NAME_FILES "Another Subdir/pair_int.int.c" vcl_algorithm_vcl_pair_double.foo.c) -ELSE(WATCOM) - SET(PLUS_NAME_FILES +else(WATCOM) + set(PLUS_NAME_FILES "Another Subdir/pair+int.int.c" vcl_algorithm+vcl_pair+double.foo.c) -ENDIF(WATCOM) +endif(WATCOM) -ADD_EXECUTABLE(TestFromSubdir +add_executable(TestFromSubdir "Another Subdir/testfromsubdir.c" "Another Subdir/secondone" ${PLUS_NAME_FILES} ) -AUX_SOURCE_DIRECTORY(ThirdSubDir SOURCES) -IF(WATCOM) - FOREACH(f ${SOURCES}) - IF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - ELSE("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - SET(SOURCES2 ${f} ${SOURCES2}) - ENDIF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - ENDFOREACH(f) - SET(SOURCES ${SOURCES2}) - SET(SOURCES ${SOURCES} +aux_source_directory(ThirdSubDir SOURCES) +if(WATCOM) + foreach(f ${SOURCES}) + if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + else("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + set(SOURCES2 ${f} ${SOURCES2}) + endif("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + endforeach(f) + set(SOURCES ${SOURCES2}) + set(SOURCES ${SOURCES} vcl_algorithm_vcl_pair_double.foo.c) -ELSE(WATCOM) - FOREACH(f ${SOURCES}) - IF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - ELSE("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - SET(SOURCES2 ${f} ${SOURCES2}) - ENDIF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - ENDFOREACH(f) - SET(SOURCES ${SOURCES2}) - SET(SOURCES ${SOURCES} +else(WATCOM) + foreach(f ${SOURCES}) + if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + else("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + set(SOURCES2 ${f} ${SOURCES2}) + endif("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + endforeach(f) + set(SOURCES ${SOURCES2}) + set(SOURCES ${SOURCES} vcl_algorithm+vcl_pair+double.foo.c) -ENDIF(WATCOM) -ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES}) -IF(CMAKE_PAREN) +endif(WATCOM) +add_executable(TestWithAuxSourceDir ${SOURCES}) +if(CMAKE_PAREN) target_link_libraries(TestWithAuxSourceDir testOddPath) -ENDIF(CMAKE_PAREN) +endif(CMAKE_PAREN) diff --git a/Tests/SubDirSpaces/Executable Sources/CMakeLists.txt b/Tests/SubDirSpaces/Executable Sources/CMakeLists.txt index d679168d8..77e6751cd 100644 --- a/Tests/SubDirSpaces/Executable Sources/CMakeLists.txt +++ b/Tests/SubDirSpaces/Executable Sources/CMakeLists.txt @@ -1 +1 @@ -ADD_EXECUTABLE(test test.cxx) +add_executable(test test.cxx) diff --git a/Tests/SubDirSpaces/Executable/CMakeLists.txt b/Tests/SubDirSpaces/Executable/CMakeLists.txt index d679168d8..77e6751cd 100644 --- a/Tests/SubDirSpaces/Executable/CMakeLists.txt +++ b/Tests/SubDirSpaces/Executable/CMakeLists.txt @@ -1 +1 @@ -ADD_EXECUTABLE(test test.cxx) +add_executable(test test.cxx) diff --git a/Tests/SubDirSpaces/Some Examples/CMakeLists.txt b/Tests/SubDirSpaces/Some Examples/CMakeLists.txt index b0f1e896c..8cd7e24e1 100644 --- a/Tests/SubDirSpaces/Some Examples/CMakeLists.txt +++ b/Tests/SubDirSpaces/Some Examples/CMakeLists.txt @@ -1,3 +1,3 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(Examples) -SUBDIRS(example1 example2) +project(Examples) +subdirs(example1 example2) diff --git a/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt b/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt index 303618321..20d065e54 100644 --- a/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt +++ b/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(example1) -ADD_EXECUTABLE(example1 example1.cxx) +project(example1) +add_executable(example1 example1.cxx) -ADD_CUSTOM_COMMAND(TARGET example1 POST_BUILD +add_custom_command(TARGET example1 POST_BUILD COMMAND "${CMAKE_COMMAND}" ARGS -E remove ${SUBDIR_BINARY_DIR}/ShouldBeHere COMMENT "Remove marker file that should exist because this should not be run") diff --git a/Tests/SubDirSpaces/Some Examples/example2/CMakeLists.txt b/Tests/SubDirSpaces/Some Examples/example2/CMakeLists.txt index 19a537686..388e33c3d 100644 --- a/Tests/SubDirSpaces/Some Examples/example2/CMakeLists.txt +++ b/Tests/SubDirSpaces/Some Examples/example2/CMakeLists.txt @@ -1,2 +1,2 @@ -PROJECT(example2) -ADD_EXECUTABLE(example2 example2.cxx) +project(example2) +add_executable(example2 example2.cxx) diff --git a/Tests/SwigTest/CMakeLists.txt b/Tests/SwigTest/CMakeLists.txt index 7e216446d..b3017f1ab 100644 --- a/Tests/SwigTest/CMakeLists.txt +++ b/Tests/SwigTest/CMakeLists.txt @@ -1,50 +1,50 @@ -SET(language "python") +set(language "python") cmake_minimum_required (VERSION 2.6) -PROJECT(example_${language}_class) +project(example_${language}_class) -FIND_PACKAGE(SWIG REQUIRED) -INCLUDE(${SWIG_USE_FILE}) +find_package(SWIG REQUIRED) +include(${SWIG_USE_FILE}) -IF(${language} MATCHES python) - FIND_PACKAGE(PythonLibs) - INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) - SET(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES}) -ENDIF(${language} MATCHES python) -IF(${language} MATCHES perl) - FIND_PACKAGE(PerlLibs) - INCLUDE_DIRECTORIES(${PERL_INCLUDE_PATH}) - ADD_DEFINITIONS(${PERL_EXTRA_C_FLAGS}) - SET(SWIG_LANG_LIBRARIES ${PERL_LIBRARY}) -ENDIF(${language} MATCHES perl) -IF(${language} MATCHES tcl) - FIND_PACKAGE(TCL) - INCLUDE_DIRECTORIES(${TCL_INCLUDE_PATH}) - SET(SWIG_LANG_LIBRARIES ${TCL_LIBRARY}) -ENDIF(${language} MATCHES tcl) -IF(${language} MATCHES ruby) - FIND_PACKAGE(Ruby) - INCLUDE_DIRECTORIES(${RUBY_INCLUDE_PATH}) - SET(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY}) -ENDIF(${language} MATCHES ruby) -IF(${language} MATCHES php4) - FIND_PACKAGE(PHP4) - INCLUDE_DIRECTORIES(${PHP4_INCLUDE_PATH}) - SET(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY}) -ENDIF(${language} MATCHES php4) -IF(${language} MATCHES pike) - FIND_PACKAGE(Pike) - INCLUDE_DIRECTORIES(${PIKE_INCLUDE_PATH}) - SET(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY}) -ENDIF(${language} MATCHES pike) +if(${language} MATCHES python) + find_package(PythonLibs) + include_directories(${PYTHON_INCLUDE_PATH}) + set(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES}) +endif(${language} MATCHES python) +if(${language} MATCHES perl) + find_package(PerlLibs) + include_directories(${PERL_INCLUDE_PATH}) + add_definitions(${PERL_EXTRA_C_FLAGS}) + set(SWIG_LANG_LIBRARIES ${PERL_LIBRARY}) +endif(${language} MATCHES perl) +if(${language} MATCHES tcl) + find_package(TCL) + include_directories(${TCL_INCLUDE_PATH}) + set(SWIG_LANG_LIBRARIES ${TCL_LIBRARY}) +endif(${language} MATCHES tcl) +if(${language} MATCHES ruby) + find_package(Ruby) + include_directories(${RUBY_INCLUDE_PATH}) + set(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY}) +endif(${language} MATCHES ruby) +if(${language} MATCHES php4) + find_package(PHP4) + include_directories(${PHP4_INCLUDE_PATH}) + set(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY}) +endif(${language} MATCHES php4) +if(${language} MATCHES pike) + find_package(Pike) + include_directories(${PIKE_INCLUDE_PATH}) + set(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY}) +endif(${language} MATCHES pike) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -SET(CMAKE_SWIG_FLAGS "") +set(CMAKE_SWIG_FLAGS "") -SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES CPLUSPLUS ON) -SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES SWIG_FLAGS "-includeall") +set_source_files_properties(example.i PROPERTIES CPLUSPLUS ON) +set_source_files_properties(example.i PROPERTIES SWIG_FLAGS "-includeall") SWIG_ADD_MODULE(example "${language}" example.i example.cxx) SWIG_LINK_LIBRARIES(example ${SWIG_LANG_LIBRARIES}) diff --git a/Tests/SystemInformation/CMakeLists.txt b/Tests/SystemInformation/CMakeLists.txt index 6654664a1..c29f3e863 100644 --- a/Tests/SystemInformation/CMakeLists.txt +++ b/Tests/SystemInformation/CMakeLists.txt @@ -1,61 +1,61 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(SystemInformation) +project(SystemInformation) -INCLUDE_DIRECTORIES("This does not exists") -GET_DIRECTORY_PROPERTY(incl INCLUDE_DIRECTORIES) -SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${SystemInformation_BINARY_DIR};${SystemInformation_SOURCE_DIR}") +include_directories("This does not exists") +get_directory_property(incl INCLUDE_DIRECTORIES) +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${SystemInformation_BINARY_DIR};${SystemInformation_SOURCE_DIR}") -MESSAGE("To prevent CTest from stripping output, you have to display: CTEST_FULL_OUTPUT") +message("To prevent CTest from stripping output, you have to display: CTEST_FULL_OUTPUT") -CONFIGURE_FILE(${SystemInformation_SOURCE_DIR}/SystemInformation.in +configure_file(${SystemInformation_SOURCE_DIR}/SystemInformation.in ${SystemInformation_BINARY_DIR}/SystemInformation.out) -CONFIGURE_FILE(${SystemInformation_SOURCE_DIR}/DumpInformation.h.in +configure_file(${SystemInformation_SOURCE_DIR}/DumpInformation.h.in ${SystemInformation_BINARY_DIR}/DumpInformation.h) -ADD_EXECUTABLE(SystemInformation DumpInformation.cxx) +add_executable(SystemInformation DumpInformation.cxx) -MACRO(FOO args) - MESSAGE("Test macro") -ENDMACRO(FOO) +macro(FOO args) + message("Test macro") +endmacro(FOO) FOO(lala) -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt "") -GET_CMAKE_PROPERTY(res VARIABLES) -FOREACH(var ${res}) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt "") +get_cmake_property(res VARIABLES) +foreach(var ${res}) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt "${var} \"${${var}}\"\n") -ENDFOREACH(var ${res}) +endforeach(var ${res}) -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "") -GET_CMAKE_PROPERTY(res COMMANDS) -FOREACH(var ${res}) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "") +get_cmake_property(res COMMANDS) +foreach(var ${res}) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "${var}\n") -ENDFOREACH(var ${res}) +endforeach(var ${res}) -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "") -GET_CMAKE_PROPERTY(res MACROS) -FOREACH(var ${res}) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "") +get_cmake_property(res MACROS) +foreach(var ${res}) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "${var}\n") -ENDFOREACH(var ${res}) +endforeach(var ${res}) -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "") -GET_DIRECTORY_PROPERTY(res INCLUDE_DIRECTORIES) -FOREACH(var ${res}) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "") +get_directory_property(res INCLUDE_DIRECTORIES) +foreach(var ${res}) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "INCLUDE_DIRECTORY: ${var}\n") -ENDFOREACH(var) +endforeach(var) -GET_DIRECTORY_PROPERTY(res LINK_DIRECTORIES) -FOREACH(var ${res}) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt +get_directory_property(res LINK_DIRECTORIES) +foreach(var ${res}) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "LINK_DIRECTORIES: ${var}\n") -ENDFOREACH(var) +endforeach(var) -GET_DIRECTORY_PROPERTY(res INCLUDE_REGULAR_EXPRESSION) -FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt +get_directory_property(res INCLUDE_REGULAR_EXPRESSION) +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "INCLUDE_REGULAR_EXPRESSION: ${res}\n") diff --git a/Tests/TarTest/CMakeLists.txt b/Tests/TarTest/CMakeLists.txt index a3c5b31ff..b1f1c6dc3 100644 --- a/Tests/TarTest/CMakeLists.txt +++ b/Tests/TarTest/CMakeLists.txt @@ -1,20 +1,20 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(TarTest) +project(TarTest) # this is macro that we will be running -MACRO(EXEC_TAR_COMMAND DIR ARGS) - EXEC_PROGRAM("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET) - IF(${RET}) - MESSAGE(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"") - ENDIF(${RET}) -ENDMACRO(EXEC_TAR_COMMAND) +macro(EXEC_TAR_COMMAND DIR ARGS) + exec_program("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET) + if(${RET}) + message(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"") + endif(${RET}) +endmacro(EXEC_TAR_COMMAND) # Create a directory structure -SET(CHECK_FILES) -MACRO(COPY F1 F2) - CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY) - SET(CHECK_FILES ${CHECK_FILES} "${F2}") -ENDMACRO(COPY) +set(CHECK_FILES) +macro(COPY F1 F2) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY) + set(CHECK_FILES ${CHECK_FILES} "${F2}") +endmacro(COPY) COPY("CMakeLists.txt" "f1.txt") COPY("CMakeLists.txt" "d1/f1.txt") COPY("CMakeLists.txt" "d 2/f1.txt") @@ -23,22 +23,22 @@ COPY("CMakeLists.txt" "d_4/f1.txt") COPY("CMakeLists.txt" "d-4/f1.txt") COPY("CMakeLists.txt" "My Special Directory/f1.txt") -IF(UNIX) - EXEC_PROGRAM("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"") - SET(CHECK_FILES ${CHECK_FILES} "d1/f2.txt") -ENDIF(UNIX) +if(UNIX) + exec_program("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"") + set(CHECK_FILES ${CHECK_FILES} "d1/f2.txt") +endif(UNIX) # cleanup first in case there are files left from previous runs # if the umask is odd on the machine it might create files that # are not automatically over written. These tests are run # each time the configure step is run. -FILE(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar") -FILE(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz") -FILE(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") -FILE(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") +file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar") +file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz") +file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") +file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") -MAKE_DIRECTORY("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") -MAKE_DIRECTORY("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") +make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") +make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") # Run tests @@ -48,22 +48,22 @@ EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}" "cvfz \"${CMAKE_CURRENT_BINARY_DI EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar" "xvf \"${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar\"") EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz" "xvfz \"${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz\"") -MACRO(CHECK_DIR_STRUCTURE DIR) - FOREACH(file ${CHECK_FILES}) - SET(sfile "${DIR}/${file}") - SET(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}") - IF(NOT EXISTS "${sfile}") - MESSAGE(SEND_ERROR "Cannot find file ${sfile}") - ELSE(NOT EXISTS "${sfile}") - EXEC_PROGRAM("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret) - IF(${ret}) - MESSAGE(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different") - ENDIF(${ret}) - ENDIF(NOT EXISTS "${sfile}") - ENDFOREACH(file) -ENDMACRO(CHECK_DIR_STRUCTURE) +macro(CHECK_DIR_STRUCTURE DIR) + foreach(file ${CHECK_FILES}) + set(sfile "${DIR}/${file}") + set(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}") + if(NOT EXISTS "${sfile}") + message(SEND_ERROR "Cannot find file ${sfile}") + else(NOT EXISTS "${sfile}") + exec_program("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret) + if(${ret}) + message(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different") + endif(${ret}) + endif(NOT EXISTS "${sfile}") + endforeach(file) +endmacro(CHECK_DIR_STRUCTURE) CHECK_DIR_STRUCTURE("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar/tar_dir") -ADD_EXECUTABLE(TarTest TestTarExec.cxx) +add_executable(TarTest TestTarExec.cxx) diff --git a/Tests/TestDriver/CMakeLists.txt b/Tests/TestDriver/CMakeLists.txt index cc953ce3f..663ecab55 100644 --- a/Tests/TestDriver/CMakeLists.txt +++ b/Tests/TestDriver/CMakeLists.txt @@ -1,15 +1,15 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(TestDriverTest) +project(TestDriverTest) -SET(Extra_SRCS testExtraStuff.cxx testExtraStuff2.cxx ) -SET(Extra_SRCS ${Extra_SRCS};testExtraStuff3.cxx ) -INCLUDE_DIRECTORIES(${TestDriverTest_SOURCE_DIR}) -CREATE_TEST_SOURCELIST(testSrcs +set(Extra_SRCS testExtraStuff.cxx testExtraStuff2.cxx ) +set(Extra_SRCS ${Extra_SRCS};testExtraStuff3.cxx ) +include_directories(${TestDriverTest_SOURCE_DIR}) +create_test_sourcelist(testSrcs TestDriverTest.cxx test1.cxx test2.cxx subdir/test3.cxx EXTRA_INCLUDE testArgs.h FUNCTION testProccessArgs) -ADD_EXECUTABLE(TestDriverTest ${testSrcs} ${Extra_SRCS}) +add_executable(TestDriverTest ${testSrcs} ${Extra_SRCS}) diff --git a/Tests/Testing/CMakeLists.txt b/Tests/Testing/CMakeLists.txt index 5c6f37c6e..20af09bfa 100644 --- a/Tests/Testing/CMakeLists.txt +++ b/Tests/Testing/CMakeLists.txt @@ -2,58 +2,58 @@ # Testing # cmake_minimum_required (VERSION 2.7) -PROJECT (Testing) +project (Testing) # # Lib and exe path # -SET (LIBRARY_OUTPUT_PATH +set (LIBRARY_OUTPUT_PATH ${Testing_BINARY_DIR}/bin/ CACHE PATH "Single output directory for building all libraries.") -SET (EXECUTABLE_OUTPUT_PATH +set (EXECUTABLE_OUTPUT_PATH ${Testing_BINARY_DIR}/bin/ CACHE PATH "Single output directory for building all executables.") # # Where will executable tests be written ? # -IF (EXECUTABLE_OUTPUT_PATH) - SET (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH}) -ELSE (EXECUTABLE_OUTPUT_PATH) - SET (CXX_TEST_PATH .) -ENDIF (EXECUTABLE_OUTPUT_PATH) +if (EXECUTABLE_OUTPUT_PATH) + set (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH}) +else (EXECUTABLE_OUTPUT_PATH) + set (CXX_TEST_PATH .) +endif (EXECUTABLE_OUTPUT_PATH) # # Include Dart # (will also set NSLOOKUP, HOSTNAME, etc.) # -INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake) +include (${CMAKE_ROOT}/Modules/Dart.cmake) # # Extra coverage # -BUILD_COMMAND(BUILD_COMMAND_VAR ${CMAKE_MAKE_PROGRAM}) -BUILD_NAME(BUILD_NAME_VAR) -SITE_NAME(SITE_NAME_VAR) +build_command(BUILD_COMMAND_VAR ${CMAKE_MAKE_PROGRAM}) +build_name(BUILD_NAME_VAR) +site_name(SITE_NAME_VAR) # # Enable testing # -ENABLE_TESTING() +enable_testing() # # Add test # -ADD_EXECUTABLE(testing testing.cxx) -ADD_TEST(testing.1 ${Testing_BINARY_DIR}/bin/testing) +add_executable(testing testing.cxx) +add_test(testing.1 ${Testing_BINARY_DIR}/bin/testing) # # skip level test # -ADD_SUBDIRECTORY(Sub/Sub2) +add_subdirectory(Sub/Sub2) # Per-config target name and generator expressions. -ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig) -ADD_TEST(NAME testing.perconfig COMMAND perconfig) -ADD_TEST(NAME testing.driver COMMAND ${PerConfig_COMMAND}) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig) +add_test(NAME testing.perconfig COMMAND perconfig) +add_test(NAME testing.driver COMMAND ${PerConfig_COMMAND}) diff --git a/Tests/Testing/DartConfig.cmake b/Tests/Testing/DartConfig.cmake index 9494eeccb..de6ea4b41 100644 --- a/Tests/Testing/DartConfig.cmake +++ b/Tests/Testing/DartConfig.cmake @@ -1,24 +1,24 @@ # Dashboard is opened for submissions for a 24 hour period starting at # the specified NIGHLY_START_TIME. Time is specified in 24 hour format. -SET (NIGHTLY_START_TIME "23:00:00 EST") +set (NIGHTLY_START_TIME "23:00:00 EST") # Dart server to submit results (used by client) -SET (DROP_SITE "") -SET (DROP_LOCATION "") -SET (DROP_SITE_USER "") -SET (DROP_SITE_PASSWORD "") -SET (TRIGGER_SITE "") +set (DROP_SITE "") +set (DROP_LOCATION "") +set (DROP_SITE_USER "") +set (DROP_SITE_PASSWORD "") +set (TRIGGER_SITE "") # Dart server configuration -# SET (CVS_WEB_URL "") -# SET (CVS_WEB_CVSROOT "") -# SET (USE_DOXYGEN "Off") -# SET (DOXYGEN_URL "") -# SET (GNATS_WEB_URL "") +# set (CVS_WEB_URL "") +# set (CVS_WEB_CVSROOT "") +# set (USE_DOXYGEN "Off") +# set (DOXYGEN_URL "") +# set (GNATS_WEB_URL "") # Continuous email delivery variables -# SET (CONTINUOUS_FROM "") -# SET (SMTP_MAILHOST "") -# SET (CONTINUOUS_MONITOR_LIST "") -# SET (CONTINUOUS_BASE_URL "") +# set (CONTINUOUS_FROM "") +# set (SMTP_MAILHOST "") +# set (CONTINUOUS_MONITOR_LIST "") +# set (CONTINUOUS_BASE_URL "") diff --git a/Tests/Testing/Sub/Sub2/CMakeLists.txt b/Tests/Testing/Sub/Sub2/CMakeLists.txt index fb9e8619e..78f4d1a95 100644 --- a/Tests/Testing/Sub/Sub2/CMakeLists.txt +++ b/Tests/Testing/Sub/Sub2/CMakeLists.txt @@ -1,8 +1,8 @@ # # Add test # -ADD_EXECUTABLE(testing2 testing2.cxx) -ADD_TEST(testing.2 ${Testing_BINARY_DIR}/bin/testing2) +add_executable(testing2 testing2.cxx) +add_test(testing.2 ${Testing_BINARY_DIR}/bin/testing2) add_test(NotCycle.a ${CMAKE_COMMAND} -E echo a) add_test(NotCycle.test1 ${CMAKE_COMMAND} -E echo test1) diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt index 8bfb61eef..90f878e7b 100644 --- a/Tests/TryCompile/CMakeLists.txt +++ b/Tests/TryCompile/CMakeLists.txt @@ -1,120 +1,120 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(TryCompile) +project(TryCompile) -MACRO(TEST_ASSERT value msg) - IF (NOT ${value}) - MESSAGE (SEND_ERROR "Assertion failure:" ${msg} ) - ENDIF (NOT ${value}) -ENDMACRO(TEST_ASSERT) +macro(TEST_ASSERT value msg) + if (NOT ${value}) + message (SEND_ERROR "Assertion failure:" ${msg} ) + endif (NOT ${value}) +endmacro(TEST_ASSERT) -MACRO(TEST_FAIL value msg) - IF (${value}) - MESSAGE (SEND_ERROR "Failing test succeeded:" ${msg} ) - ENDIF (${value}) -ENDMACRO(TEST_FAIL) +macro(TEST_FAIL value msg) + if (${value}) + message (SEND_ERROR "Failing test succeeded:" ${msg} ) + endif (${value}) +endmacro(TEST_FAIL) -MACRO(TEST_EXPECT_EXACT command expected) - IF(NOT "x${result}" STREQUAL "x${expected}") - MESSAGE(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") - ENDIF(NOT "x${result}" STREQUAL "x${expected}") -ENDMACRO(TEST_EXPECT_EXACT command expected) +macro(TEST_EXPECT_EXACT command expected) + if(NOT "x${result}" STREQUAL "x${expected}") + message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") + endif(NOT "x${result}" STREQUAL "x${expected}") +endmacro(TEST_EXPECT_EXACT command expected) -MACRO(TEST_EXPECT_CONTAINS command expected) - IF(NOT "${result}" MATCHES "${expected}") - MESSAGE(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") - ENDIF(NOT "${result}" MATCHES "${expected}") -ENDMACRO(TEST_EXPECT_CONTAINS command expected) +macro(TEST_EXPECT_CONTAINS command expected) + if(NOT "${result}" MATCHES "${expected}") + message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") + endif(NOT "${result}" MATCHES "${expected}") +endmacro(TEST_EXPECT_CONTAINS command expected) # try to compile a file that should compile # also check that COPY_FILE works -TRY_COMPILE(SHOULD_PASS +try_compile(SHOULD_PASS ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${TryCompile_SOURCE_DIR}/pass.c OUTPUT_VARIABLE TRY_OUT COPY_FILE ${TryCompile_BINARY_DIR}/CopyOfPass ) -IF(NOT SHOULD_PASS) - MESSAGE(SEND_ERROR "should pass failed ${TRY_OUT}") -ENDIF(NOT SHOULD_PASS) -IF(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") - MESSAGE(SEND_ERROR "COPY_FILE to \"${TryCompile_BINARY_DIR}/CopyOfPass\" failed") -ELSE(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") - FILE(REMOVE "${TryCompile_BINARY_DIR}/CopyOfPass") -ENDIF(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") +if(NOT SHOULD_PASS) + message(SEND_ERROR "should pass failed ${TRY_OUT}") +endif(NOT SHOULD_PASS) +if(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") + message(SEND_ERROR "COPY_FILE to \"${TryCompile_BINARY_DIR}/CopyOfPass\" failed") +else(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") + file(REMOVE "${TryCompile_BINARY_DIR}/CopyOfPass") +endif(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") # try to compile a file that should not compile -TRY_COMPILE(SHOULD_FAIL +try_compile(SHOULD_FAIL ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${TryCompile_SOURCE_DIR}/fail.c OUTPUT_VARIABLE TRY_OUT) -IF(SHOULD_FAIL) - MESSAGE(SEND_ERROR "Should fail passed ${TRY_OUT}") -ENDIF(SHOULD_FAIL) +if(SHOULD_FAIL) + message(SEND_ERROR "Should fail passed ${TRY_OUT}") +endif(SHOULD_FAIL) # try to compile a file that should compile -TRY_COMPILE(SHOULD_PASS +try_compile(SHOULD_PASS ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${TryCompile_SOURCE_DIR}/pass.c OUTPUT_VARIABLE TRY_OUT) -IF(NOT SHOULD_PASS) - MESSAGE(SEND_ERROR "should pass failed ${TRY_OUT}") -ENDIF(NOT SHOULD_PASS) +if(NOT SHOULD_PASS) + message(SEND_ERROR "should pass failed ${TRY_OUT}") +endif(NOT SHOULD_PASS) # try to compile a file that should not compile -TRY_COMPILE(SHOULD_FAIL +try_compile(SHOULD_FAIL ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${TryCompile_SOURCE_DIR}/fail.c OUTPUT_VARIABLE TRY_OUT) -IF(SHOULD_FAIL) - MESSAGE(SEND_ERROR "Should fail passed ${TRY_OUT}") -ENDIF(SHOULD_FAIL) +if(SHOULD_FAIL) + message(SEND_ERROR "Should fail passed ${TRY_OUT}") +endif(SHOULD_FAIL) -IF(NOT SHOULD_FAIL) - IF(SHOULD_PASS) - MESSAGE("All Tests passed, ignore all previous output.") - ELSE(SHOULD_PASS) - MESSAGE("Test failed") - ENDIF(SHOULD_PASS) -ELSE(NOT SHOULD_FAIL) - MESSAGE("Test failed") -ENDIF(NOT SHOULD_FAIL) -TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE +if(NOT SHOULD_FAIL) + if(SHOULD_PASS) + message("All Tests passed, ignore all previous output.") + else(SHOULD_PASS) + message("Test failed") + endif(SHOULD_PASS) +else(NOT SHOULD_FAIL) + message("Test failed") +endif(NOT SHOULD_FAIL) +try_compile(CMAKE_ANSI_FOR_SCOPE ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT) -IF (CMAKE_ANSI_FOR_SCOPE) - MESSAGE("Compiler supports ansi for") -ELSE(CMAKE_ANSI_FOR_SCOPE) - MESSAGE("Compiler does not support ansi for scope") -ENDIF(CMAKE_ANSI_FOR_SCOPE) +if (CMAKE_ANSI_FOR_SCOPE) + message("Compiler supports ansi for") +else(CMAKE_ANSI_FOR_SCOPE) + message("Compiler does not support ansi for scope") +endif(CMAKE_ANSI_FOR_SCOPE) -TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE +try_compile(CMAKE_ANSI_FOR_SCOPE ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT) -IF (CMAKE_ANSI_FOR_SCOPE) - MESSAGE("Compiler supports ansi for") -ELSE(CMAKE_ANSI_FOR_SCOPE) - MESSAGE("Compiler does not support ansi for scope") -ENDIF(CMAKE_ANSI_FOR_SCOPE) +if (CMAKE_ANSI_FOR_SCOPE) + message("Compiler supports ansi for") +else(CMAKE_ANSI_FOR_SCOPE) + message("Compiler does not support ansi for scope") +endif(CMAKE_ANSI_FOR_SCOPE) -MESSAGE("use the module now") -INCLUDE(${CMAKE_ROOT}/Modules/TestForANSIForScope.cmake) -IF (CMAKE_ANSI_FOR_SCOPE) - MESSAGE("Compiler supports ansi for") -ELSE(CMAKE_ANSI_FOR_SCOPE) - MESSAGE("Compiler does not support ansi for scope") -ENDIF(CMAKE_ANSI_FOR_SCOPE) +message("use the module now") +include(${CMAKE_ROOT}/Modules/TestForANSIForScope.cmake) +if (CMAKE_ANSI_FOR_SCOPE) + message("Compiler supports ansi for") +else(CMAKE_ANSI_FOR_SCOPE) + message("Compiler does not support ansi for scope") +endif(CMAKE_ANSI_FOR_SCOPE) -MESSAGE("Testing try_compile project mode") -TRY_COMPILE(TEST_INNER +message("Testing try_compile project mode") +try_compile(TEST_INNER ${TryCompile_BINARY_DIR}/CMakeFiles/Inner ${TryCompile_SOURCE_DIR}/Inner TryCompileInner innerexe OUTPUT_VARIABLE output) TEST_ASSERT(TEST_INNER "try_compile project mode failed:\n${output}") -ADD_EXECUTABLE(TryCompile pass.c) +add_executable(TryCompile pass.c) ###################################### @@ -123,73 +123,73 @@ ADD_EXECUTABLE(TryCompile pass.c) # try to run a file that should compile and run without error # also check that OUTPUT_VARIABLE contains both the compile output # and the run output -TRY_RUN(SHOULD_RUN SHOULD_COMPILE +try_run(SHOULD_RUN SHOULD_COMPILE ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${TryCompile_SOURCE_DIR}/exit_success.c OUTPUT_VARIABLE TRY_OUT) -IF(NOT SHOULD_COMPILE) - MESSAGE(SEND_ERROR "exit_success failed compiling: ${TRY_OUT}") -ENDIF(NOT SHOULD_COMPILE) -IF(NOT "${SHOULD_RUN}" STREQUAL "0") - MESSAGE(SEND_ERROR "exit_success failed running with exit code ${SHOULD_RUN}") -ENDIF(NOT "${SHOULD_RUN}" STREQUAL "0") +if(NOT SHOULD_COMPILE) + message(SEND_ERROR "exit_success failed compiling: ${TRY_OUT}") +endif(NOT SHOULD_COMPILE) +if(NOT "${SHOULD_RUN}" STREQUAL "0") + message(SEND_ERROR "exit_success failed running with exit code ${SHOULD_RUN}") +endif(NOT "${SHOULD_RUN}" STREQUAL "0") # check the compile output for the filename -IF(NOT "${TRY_OUT}" MATCHES "exit_success") - MESSAGE(SEND_ERROR " TRY_OUT didn't contain \"exit_success\": \"${TRY_OUT}\"") -ENDIF(NOT "${TRY_OUT}" MATCHES "exit_success") +if(NOT "${TRY_OUT}" MATCHES "exit_success") + message(SEND_ERROR " TRY_OUT didn't contain \"exit_success\": \"${TRY_OUT}\"") +endif(NOT "${TRY_OUT}" MATCHES "exit_success") # check the run output -IF(NOT "${TRY_OUT}" MATCHES "hello world") - MESSAGE(SEND_ERROR " TRY_OUT didn't contain \"hello world\": \"${TRY_OUT}\"") -ENDIF(NOT "${TRY_OUT}" MATCHES "hello world") +if(NOT "${TRY_OUT}" MATCHES "hello world") + message(SEND_ERROR " TRY_OUT didn't contain \"hello world\": \"${TRY_OUT}\"") +endif(NOT "${TRY_OUT}" MATCHES "hello world") -TRY_RUN(ARG_TEST_RUN ARG_TEST_COMPILE +try_run(ARG_TEST_RUN ARG_TEST_COMPILE ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${TryCompile_SOURCE_DIR}/expect_arg.c OUTPUT_VARIABLE TRY_OUT ARGS arg1 arg2) -IF(NOT ARG_TEST_COMPILE) - MESSAGE(SEND_ERROR "expect_arg failed compiling: ${TRY_OUT}") -ENDIF(NOT ARG_TEST_COMPILE) -IF(NOT "${ARG_TEST_RUN}" STREQUAL "0") - MESSAGE(SEND_ERROR "expect_arg failed running with exit code ${ARG_TEST_RUN} ${TRY_OUT}") -ENDIF(NOT "${ARG_TEST_RUN}" STREQUAL "0") +if(NOT ARG_TEST_COMPILE) + message(SEND_ERROR "expect_arg failed compiling: ${TRY_OUT}") +endif(NOT ARG_TEST_COMPILE) +if(NOT "${ARG_TEST_RUN}" STREQUAL "0") + message(SEND_ERROR "expect_arg failed running with exit code ${ARG_TEST_RUN} ${TRY_OUT}") +endif(NOT "${ARG_TEST_RUN}" STREQUAL "0") # try to run a file that should compile and run, but return an error -TRY_RUN(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE +try_run(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${TryCompile_SOURCE_DIR}/exit_with_error.c COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT RUN_OUTPUT_VARIABLE RUN_OUTPUT) -IF(NOT SHOULD_COMPILE) - MESSAGE(STATUS " exit_with_error failed compiling: ${COMPILE_OUTPUT}") -ENDIF(NOT SHOULD_COMPILE) -IF("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0") - MESSAGE(SEND_ERROR " exit_with_error passed with exit code ${SHOULD_EXIT_WITH_ERROR}") -ENDIF("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0") +if(NOT SHOULD_COMPILE) + message(STATUS " exit_with_error failed compiling: ${COMPILE_OUTPUT}") +endif(NOT SHOULD_COMPILE) +if("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0") + message(SEND_ERROR " exit_with_error passed with exit code ${SHOULD_EXIT_WITH_ERROR}") +endif("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0") # check the compile output, it should contain the filename -IF(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error") - MESSAGE(SEND_ERROR " COMPILE_OUT didn't contain \"exit_with_error\": \"${COMPILE_OUTPUT}\"") -ENDIF(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error") +if(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error") + message(SEND_ERROR " COMPILE_OUT didn't contain \"exit_with_error\": \"${COMPILE_OUTPUT}\"") +endif(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error") #... but not the run time output -IF("${COMPILE_OUTPUT}" MATCHES "hello world") - MESSAGE(SEND_ERROR " COMPILE_OUT contains the run output: \"${COMPILE_OUTPUT}\"") -ENDIF("${COMPILE_OUTPUT}" MATCHES "hello world") +if("${COMPILE_OUTPUT}" MATCHES "hello world") + message(SEND_ERROR " COMPILE_OUT contains the run output: \"${COMPILE_OUTPUT}\"") +endif("${COMPILE_OUTPUT}" MATCHES "hello world") # check the run output, it should stdout -IF(NOT "${RUN_OUTPUT}" MATCHES "hello world") - MESSAGE(SEND_ERROR " RUN_OUTPUT didn't contain \"hello world\": \"${RUN_OUTPUT}\"") -ENDIF(NOT "${RUN_OUTPUT}" MATCHES "hello world") +if(NOT "${RUN_OUTPUT}" MATCHES "hello world") + message(SEND_ERROR " RUN_OUTPUT didn't contain \"hello world\": \"${RUN_OUTPUT}\"") +endif(NOT "${RUN_OUTPUT}" MATCHES "hello world") ####################################################################### # # also test that the CHECK_C_SOURCE_COMPILES, CHECK_CXX_SOURCE_COMPILES # CHECK_C_SOURCE_RUNS and CHECK_CXX_SOURCE_RUNS macros work -INCLUDE(CheckCSourceCompiles) -INCLUDE(CheckCXXSourceCompiles) -INCLUDE(CheckCSourceRuns) -INCLUDE(CheckCXXSourceRuns) +include(CheckCSourceCompiles) +include(CheckCXXSourceCompiles) +include(CheckCSourceRuns) +include(CheckCXXSourceRuns) CHECK_C_SOURCE_COMPILES("I dont build" C_BUILD_SHOULD_FAIL) CHECK_C_SOURCE_COMPILES("int main() {return 0;}" C_BUILD_SHOULD_WORK) @@ -211,27 +211,27 @@ TEST_ASSERT(CXX_BUILD_SHOULD_WORK "CHECK_CXX_SOURCE_COMPILES() failed") TEST_FAIL(CXX_RUN_SHOULD_FAIL "CHECK_CXX_SOURCE_RUNS() succeeded, but should have failed") TEST_ASSERT(CXX_RUN_SHOULD_WORK "CHECK_CXX_SOURCE_RUNS() failed") -FOREACH(lang C CXX) - IF(NOT "${CMAKE_${lang}_COMPILER_ID}" MATCHES "^(PathScale)$") - SET(${lang}_DD --) - ENDIF() -ENDFOREACH() +foreach(lang C CXX) + if(NOT "${CMAKE_${lang}_COMPILER_ID}" MATCHES "^(PathScale)$") + set(${lang}_DD --) + endif() +endforeach() -UNSET(C_BOGUS_FLAG CACHE) -INCLUDE(CheckCCompilerFlag) +unset(C_BOGUS_FLAG CACHE) +include(CheckCCompilerFlag) CHECK_C_COMPILER_FLAG(${C_DD}-_this_is_not_a_flag_ C_BOGUS_FLAG) TEST_FAIL(C_BOGUS_FLAG "CHECK_C_COMPILER_FLAG() succeeded, but should have failed") -UNSET(CXX_BOGUS_FLAG CACHE) -INCLUDE(CheckCXXCompilerFlag) +unset(CXX_BOGUS_FLAG CACHE) +include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG(${CXX_DD}-_this_is_not_a_flag_ CXX_BOGUS_FLAG) TEST_FAIL(CXX_BOGUS_FLAG "CHECK_CXX_COMPILER_FLAG() succeeded, but should have failed") -IF("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") - UNSET(C_STRICT_PROTOTYPES CACHE) +if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") + unset(C_STRICT_PROTOTYPES CACHE) CHECK_C_COMPILER_FLAG("-Werror;-Wstrict-prototypes" C_STRICT_PROTOTYPES) TEST_ASSERT(C_STRICT_PROTOTYPES "CHECK_C_COMPILER_FLAG failed -Werror -Wstrict-prototypes") -ENDIF() +endif() ####################################################################### # diff --git a/Tests/Tutorial/Step7/build1.cmake b/Tests/Tutorial/Step7/build1.cmake index 039d5569b..baa475f28 100644 --- a/Tests/Tutorial/Step7/build1.cmake +++ b/Tests/Tutorial/Step7/build1.cmake @@ -1,5 +1,5 @@ -SET(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/My Tests/CMake/Tests/Tutorial/Step7") -SET(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}-build1") +set(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/My Tests/CMake/Tests/Tutorial/Step7") +set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}-build1") -SET(CTEST_CMAKE_COMMAND "cmake") -SET(CTEST_COMMAND "ctest -D Experimental") +set(CTEST_CMAKE_COMMAND "cmake") +set(CTEST_COMMAND "ctest -D Experimental") diff --git a/Tests/Tutorial/Step7/build2.cmake b/Tests/Tutorial/Step7/build2.cmake index 5112355b2..c2f2e2e10 100644 --- a/Tests/Tutorial/Step7/build2.cmake +++ b/Tests/Tutorial/Step7/build2.cmake @@ -1,6 +1,6 @@ -SET(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/My Tests/CMake/Tests/Tutorial/Step7") -SET(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}-build2") -SET(CTEST_CMAKE_GENERATOR "Visual Studio 8 2005") +set(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/My Tests/CMake/Tests/Tutorial/Step7") +set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}-build2") +set(CTEST_CMAKE_GENERATOR "Visual Studio 8 2005") CTEST_START("Experimental") CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}") diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt index 4a413d598..af0b18f2c 100644 --- a/Tests/VSExternalInclude/CMakeLists.txt +++ b/Tests/VSExternalInclude/CMakeLists.txt @@ -1,54 +1,54 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(VSExternalInclude) +project(VSExternalInclude) -IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") - SET(PROJECT_EXT dsp) -ELSE(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") - SET(PROJECT_EXT vcproj) -ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") -IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[01]") - SET(PROJECT_EXT vcxproj) -ENDIF() +if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") + set(PROJECT_EXT dsp) +else(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") + set(PROJECT_EXT vcproj) +endif(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") +if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[01]") + set(PROJECT_EXT vcxproj) +endif() # make sure directories exists -SET(LIB1_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib1) -MAKE_DIRECTORY("${LIB1_BINARY_DIR}") +set(LIB1_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib1) +make_directory("${LIB1_BINARY_DIR}") -SET(LIB2_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib2) -MAKE_DIRECTORY("${LIB2_BINARY_DIR}") +set(LIB2_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib2) +make_directory("${LIB2_BINARY_DIR}") # generate lib1 -EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB1_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\" +exec_program("${CMAKE_COMMAND}" "${LIB1_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\" \"${VSExternalInclude_SOURCE_DIR}/Lib1\" OUTPUT_VARIABLE OUT) -MESSAGE("CMAKE Ran with the following output:\n\"${OUT}\"") +message("CMAKE Ran with the following output:\n\"${OUT}\"") # generate lib2 -EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB2_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\" +exec_program("${CMAKE_COMMAND}" "${LIB2_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\" \"${VSExternalInclude_SOURCE_DIR}/Lib2\" OUTPUT_VARIABLE OUT) -MESSAGE("CMAKE Ran with the following output:\n\"${OUT}\"") +message("CMAKE Ran with the following output:\n\"${OUT}\"") -INCLUDE_EXTERNAL_MSPROJECT(lib1 ${VSExternalInclude_BINARY_DIR}/Lib1/LIB1.${PROJECT_EXT}) +include_external_msproject(lib1 ${VSExternalInclude_BINARY_DIR}/Lib1/LIB1.${PROJECT_EXT}) # lib2 depends on lib1 -INCLUDE_EXTERNAL_MSPROJECT(lib2 ${VSExternalInclude_BINARY_DIR}/Lib2/LIB2.${PROJECT_EXT} lib1) +include_external_msproject(lib2 ${VSExternalInclude_BINARY_DIR}/Lib2/LIB2.${PROJECT_EXT} lib1) -INCLUDE_DIRECTORIES(${VSExternalInclude_SOURCE_DIR}/Lib2 ${VSExternalInclude_SOURCE_DIR}/Lib1) +include_directories(${VSExternalInclude_SOURCE_DIR}/Lib2 ${VSExternalInclude_SOURCE_DIR}/Lib1) -SET(SOURCES main.cpp) +set(SOURCES main.cpp) -ADD_EXECUTABLE(VSExternalInclude ${SOURCES}) +add_executable(VSExternalInclude ${SOURCES}) # target depends on lib2 -ADD_DEPENDENCIES(VSExternalInclude lib2) +add_dependencies(VSExternalInclude lib2) # VS 10 vcxproj files have depends in them # Since lib1 and lib2 do not depend on each other # then the vcxproj files do not depend on each other # and the sln file can no longer be the only source # of that depend. So, for VS 10 make the executable # depend on lib1 and lib2 -IF(MSVC10 OR MSVC11) - ADD_DEPENDENCIES(VSExternalInclude lib1) -ENDIF() +if(MSVC10 OR MSVC11) + add_dependencies(VSExternalInclude lib1) +endif() # Interaction testing between the FOLDER target property and # INCLUDE_EXTERNAL_MSPROJECT targets: diff --git a/Tests/VSExternalInclude/Lib1/CMakeLists.txt b/Tests/VSExternalInclude/Lib1/CMakeLists.txt index 72ffcedc1..1cb01c5dd 100644 --- a/Tests/VSExternalInclude/Lib1/CMakeLists.txt +++ b/Tests/VSExternalInclude/Lib1/CMakeLists.txt @@ -1,5 +1,5 @@ -PROJECT(LIB1) +project(LIB1) -SET(SOURCES lib1.cpp) +set(SOURCES lib1.cpp) -ADD_LIBRARY(lib1 ${SOURCES}) +add_library(lib1 ${SOURCES}) diff --git a/Tests/VSExternalInclude/Lib2/CMakeLists.txt b/Tests/VSExternalInclude/Lib2/CMakeLists.txt index 31e40e4e1..f726c3f8b 100644 --- a/Tests/VSExternalInclude/Lib2/CMakeLists.txt +++ b/Tests/VSExternalInclude/Lib2/CMakeLists.txt @@ -1,7 +1,7 @@ -PROJECT(VSEXTERNAL_LIB2) +project(VSEXTERNAL_LIB2) -INCLUDE_DIRECTORIES(${VSEXTERNAL_LIB2_SOURCE_DIR}/../Lib1) +include_directories(${VSEXTERNAL_LIB2_SOURCE_DIR}/../Lib1) -SET(SOURCES lib2.cpp) +set(SOURCES lib2.cpp) -ADD_LIBRARY(lib2 ${SOURCES}) +add_library(lib2 ${SOURCES}) diff --git a/Tests/Wrapping/CMakeLists.txt b/Tests/Wrapping/CMakeLists.txt index 5f441dd9e..344b11de2 100644 --- a/Tests/Wrapping/CMakeLists.txt +++ b/Tests/Wrapping/CMakeLists.txt @@ -2,82 +2,82 @@ # Wrapping # cmake_minimum_required (VERSION 2.6) -PROJECT (Wrapping) +project (Wrapping) # Disable cleaning of custom command outputs to preserve the hacks # used to generate the files using CONFIGURE_FILE. -SET_DIRECTORY_PROPERTIES(PROPERTIES CLEAN_NO_CUSTOM 1) +set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1) # # Lib and exe path # -SET (LIBRARY_OUTPUT_PATH +set (LIBRARY_OUTPUT_PATH ${Wrapping_BINARY_DIR}/bin/ CACHE INTERNAL "Single output directory for building all libraries.") -SET (EXECUTABLE_OUTPUT_PATH +set (EXECUTABLE_OUTPUT_PATH ${Wrapping_BINARY_DIR}/bin/ CACHE INTERNAL "Single output directory for building all executables.") # # Where will executable tests be written ? # -IF (EXECUTABLE_OUTPUT_PATH) - SET (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH}) -ELSE (EXECUTABLE_OUTPUT_PATH) - SET (CXX_TEST_PATH .) -ENDIF (EXECUTABLE_OUTPUT_PATH) +if (EXECUTABLE_OUTPUT_PATH) + set (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH}) +else (EXECUTABLE_OUTPUT_PATH) + set (CXX_TEST_PATH .) +endif (EXECUTABLE_OUTPUT_PATH) # # Add exe # -ADD_EXECUTABLE (wrapping wrapping.cxx) +add_executable (wrapping wrapping.cxx) -ADD_EXECUTABLE (Wrap Wrap.c) -IF(WIN32) - SET(EXE_EXT ".exe") -ENDIF(WIN32) -SET(WRAP ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/Wrap${EXE_EXT}) +add_executable (Wrap Wrap.c) +if(WIN32) + set(EXE_EXT ".exe") +endif(WIN32) +set(WRAP ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/Wrap${EXE_EXT}) # # QT Wrappers # -SET (QT_WRAP_CPP "On") -SET (QT_MOC_EXE "echo") -INCLUDE( FindQt3 ) +set (QT_WRAP_CPP "On") +set (QT_MOC_EXE "echo") +include( FindQt3 ) -IF (QT_FOUND AND QT_WRAP_UI) +if (QT_FOUND AND QT_WRAP_UI) message("found qt 3 test it...") - INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} ) - INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ) + include_directories( ${QT_INCLUDE_DIR} ) + include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/foo.ui.in + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/foo.ui.in ${CMAKE_CURRENT_BINARY_DIR}/foo.ui IMMEDIATE) - SET (QT_WRAP_UI "On") - SET (QT_UIC_EXE "${QT_UIC_EXECUTABLE}") + set (QT_WRAP_UI "On") + set (QT_UIC_EXE "${QT_UIC_EXECUTABLE}") - SET (QTUI_SRCS + set (QTUI_SRCS qtwrapping.ui ${CMAKE_CURRENT_BINARY_DIR}/foo.ui ) - QT_WRAP_UI (myqtlib QTUI_H_SRCS QTUI_S_SRCS ${QTUI_SRCS}) - QT_WRAP_CPP (myqtlib QT_MOC_SRCS ${SRCS} vtkTestMoc.h) + qt_wrap_ui (myqtlib QTUI_H_SRCS QTUI_S_SRCS ${QTUI_SRCS}) + qt_wrap_cpp (myqtlib QT_MOC_SRCS ${SRCS} vtkTestMoc.h) - MESSAGE("QT files are ${QTUI_S_SRCS}") - MESSAGE("QT other files are ${QTUI_H_SRCS}") - ADD_DEFINITIONS(${QT_DEFINITIONS}) - ADD_LIBRARY(myqtlib ${QTUI_S_SRCS} ${QT_MOC_SRCS}) - ADD_EXECUTABLE (qtwrapping qtwrappingmain.cxx) - TARGET_LINK_LIBRARIES(qtwrapping myqtlib) + message("QT files are ${QTUI_S_SRCS}") + message("QT other files are ${QTUI_H_SRCS}") + add_definitions(${QT_DEFINITIONS}) + add_library(myqtlib ${QTUI_S_SRCS} ${QT_MOC_SRCS}) + add_executable (qtwrapping qtwrappingmain.cxx) + target_link_libraries(qtwrapping myqtlib) - TARGET_LINK_LIBRARIES( qtwrapping ${QT_LIBRARIES} ) -ELSE (QT_FOUND AND QT_WRAP_UI) - ADD_EXECUTABLE (qtwrapping qtnoqtmain.cxx) -ENDIF (QT_FOUND AND QT_WRAP_UI) + target_link_libraries( qtwrapping ${QT_LIBRARIES} ) +else (QT_FOUND AND QT_WRAP_UI) + add_executable (qtwrapping qtnoqtmain.cxx) +endif (QT_FOUND AND QT_WRAP_UI) # # FLTK Wrappers @@ -85,23 +85,23 @@ ENDIF (QT_FOUND AND QT_WRAP_UI) # Since FLTK_FLUID_EXE is supposed to create a .cxx/.h from a .fl/.fld, # create an empty one so that the dependencies can be met. # -SET (FLTK_SRCS +set (FLTK_SRCS fltk1.fl ) -ADD_EXECUTABLE(fakefluid fakefluid.cxx) -GET_TARGET_PROPERTY(FLUID_LOC fakefluid LOCATION) -SET (FLTK_WRAP_UI "On") -SET (FLTK_FLUID_EXECUTABLE "${FLUID_LOC}") -FLTK_WRAP_UI (wraplibFLTK ${FLTK_SRCS}) -ADD_LIBRARY(wraplibFLTK ${wraplibFLTK_FLTK_UI_SRCS}) -ADD_DEPENDENCIES(wraplibFLTK fakefluid) -ADD_DEPENDENCIES(fakefluid Wrap) +add_executable(fakefluid fakefluid.cxx) +get_target_property(FLUID_LOC fakefluid LOCATION) +set (FLTK_WRAP_UI "On") +set (FLTK_FLUID_EXECUTABLE "${FLUID_LOC}") +fltk_wrap_ui (wraplibFLTK ${FLTK_SRCS}) +add_library(wraplibFLTK ${wraplibFLTK_FLTK_UI_SRCS}) +add_dependencies(wraplibFLTK fakefluid) +add_dependencies(fakefluid Wrap) # # Mangled Mesa # -CONFIGURE_FILE( +configure_file( ${Wrapping_SOURCE_DIR}/dummy ${Wrapping_BINARY_DIR}/gl.h COPYONLY IMMEDIATE) -USE_MANGLED_MESA (${Wrapping_BINARY_DIR} ${Wrapping_BINARY_DIR}/mangled_mesa) +use_mangled_mesa (${Wrapping_BINARY_DIR} ${Wrapping_BINARY_DIR}/mangled_mesa) diff --git a/Tests/X11/CMakeLists.txt b/Tests/X11/CMakeLists.txt index 3859ba229..33ee27720 100644 --- a/Tests/X11/CMakeLists.txt +++ b/Tests/X11/CMakeLists.txt @@ -1,40 +1,40 @@ # a simple C only test case cmake_minimum_required (VERSION 2.6) -PROJECT (UseX11 CXX C) +project (UseX11 CXX C) -INCLUDE (${CMAKE_ROOT}/Modules/FindX11.cmake) -MESSAGE("X11_FOUND: ${X11_FOUND}") +include (${CMAKE_ROOT}/Modules/FindX11.cmake) +message("X11_FOUND: ${X11_FOUND}") -ADD_EXECUTABLE (UseX11 X11.c) +add_executable (UseX11 X11.c) install(TARGETS UseX11 DESTINATION bin) # so for universal binaries this test will fail if # -IF(APPLE) - LIST(LENGTH CMAKE_OSX_ARCHITECTURES NUMARCH) - IF(NUMARCH GREATER 1) - IF(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib) - SET(X11_FOUND FALSE) - MESSAGE("disable X11, because of universal binary and sysroot") - ENDIF(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib) - ENDIF(NUMARCH GREATER 1) -ENDIF(APPLE) +if(APPLE) + list(LENGTH CMAKE_OSX_ARCHITECTURES NUMARCH) + if(NUMARCH GREATER 1) + if(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib) + set(X11_FOUND FALSE) + message("disable X11, because of universal binary and sysroot") + endif(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib) + endif(NUMARCH GREATER 1) +endif(APPLE) -IF(X11_FOUND) - ADD_DEFINITIONS(-DCMAKE_HAS_X) - INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR}) - TARGET_LINK_LIBRARIES(UseX11 ${X11_LIBRARIES}) - IF(APPLE) - ADD_EXECUTABLE(HelloWorldX11 HelloWorldX11.cxx) - TARGET_LINK_LIBRARIES(HelloWorldX11 ${X11_LIBRARIES}) +if(X11_FOUND) + add_definitions(-DCMAKE_HAS_X) + include_directories(${X11_INCLUDE_DIR}) + target_link_libraries(UseX11 ${X11_LIBRARIES}) + if(APPLE) + add_executable(HelloWorldX11 HelloWorldX11.cxx) + target_link_libraries(HelloWorldX11 ${X11_LIBRARIES}) install(TARGETS HelloWorldX11 DESTINATION bin) set(CPACK_BINARY_OSXX11 ON CACHE BOOL "" FORCE) set(CPACK_BINARY_PACKAGEMAKER OFF CACHE BOOL "" FORCE ) set(CPACK_PACKAGE_NAME HelloWorldX11Package) set(CPACK_PACKAGE_EXECUTABLES HelloWorldX11 HelloWorldX11) - ENDIF(APPLE) -ENDIF(X11_FOUND) + endif(APPLE) +endif(X11_FOUND) # build a CPack driven installer package include(CPack) diff --git a/Tests/test_clean.cmake.in b/Tests/test_clean.cmake.in index ce5e62b79..d700749ca 100644 --- a/Tests/test_clean.cmake.in +++ b/Tests/test_clean.cmake.in @@ -1,2 +1,2 @@ -SET(TEST_BUILD_DIRS "@TEST_BUILD_DIRS@") -FILE(REMOVE_RECURSE ${TEST_BUILD_DIRS}) +set(TEST_BUILD_DIRS "@TEST_BUILD_DIRS@") +file(REMOVE_RECURSE ${TEST_BUILD_DIRS}) diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt index 8a52e22b3..98c1cfdf5 100644 --- a/Utilities/CMakeLists.txt +++ b/Utilities/CMakeLists.txt @@ -9,14 +9,14 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= -SUBDIRS(Doxygen KWStyle) +subdirs(Doxygen KWStyle) -MAKE_DIRECTORY(${CMake_BINARY_DIR}/Docs) +make_directory(${CMake_BINARY_DIR}/Docs) # Add a documentation target. -SET(DOC_FILES "") +set(DOC_FILES "") -SET(MAN_FILES +set(MAN_FILES ${CMake_BINARY_DIR}/Docs/cmake.1 ${CMake_BINARY_DIR}/Docs/cmakecommands.1 ${CMake_BINARY_DIR}/Docs/cmakecompat.1 @@ -25,7 +25,7 @@ SET(MAN_FILES ${CMake_BINARY_DIR}/Docs/cmakevars.1 ${CMake_BINARY_DIR}/Docs/cmakemodules.1 ) -SET(TEXT_FILES +set(TEXT_FILES ${CMake_BINARY_DIR}/Docs/cmake.txt ${CMake_BINARY_DIR}/Docs/cmake.docbook ${CMake_BINARY_DIR}/Docs/cmake-policies.txt @@ -35,7 +35,7 @@ SET(TEXT_FILES ${CMake_BINARY_DIR}/Docs/cmake-commands.txt ${CMake_BINARY_DIR}/Docs/cmake-compatcommands.txt ) -SET(HTML_FILES +set(HTML_FILES ${CMake_BINARY_DIR}/Docs/cmake.html ${CMake_BINARY_DIR}/Docs/cmake-policies.html ${CMake_BINARY_DIR}/Docs/cmake-properties.html @@ -45,12 +45,12 @@ SET(HTML_FILES ${CMake_BINARY_DIR}/Docs/cmake-compatcommands.html ) -MACRO(ADD_DOCS target dependency) +macro(ADD_DOCS target dependency) # Generate documentation for "ctest" executable. - GET_TARGET_PROPERTY(CMD ${target} LOCATION) + get_target_property(CMD ${target} LOCATION) # only generate the documentation if the target is actually built - IF(CMD) - ADD_CUSTOM_COMMAND( + if(CMD) + add_custom_command( OUTPUT ${CMake_BINARY_DIR}/Docs/${target}.txt ${${target}-PATH} # Possibly set PATH, see below. COMMAND ${CMD} @@ -61,27 +61,27 @@ MACRO(ADD_DOCS target dependency) DEPENDS ${target} MAIN_DEPENDENCY ${dependency} ) - SET(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/${target}.txt) - LIST(APPEND MAN_FILES ${CMake_BINARY_DIR}/Docs/${target}.1) - LIST(APPEND TEXT_FILES + set(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/${target}.txt) + list(APPEND MAN_FILES ${CMake_BINARY_DIR}/Docs/${target}.1) + list(APPEND TEXT_FILES ${CMake_BINARY_DIR}/Docs/${target}.txt ${CMake_BINARY_DIR}/Docs/${target}.docbook ) - LIST(APPEND HTML_FILES ${CMake_BINARY_DIR}/Docs/${target}.html) - ENDIF(CMD) -ENDMACRO(ADD_DOCS target dependency) + list(APPEND HTML_FILES ${CMake_BINARY_DIR}/Docs/${target}.html) + endif(CMD) +endmacro(ADD_DOCS target dependency) # Help cmake-gui find the Qt DLLs on Windows. -SET(WIN_SHELL_GENS "Visual Studio|NMake|MinGW|Watcom|Borland") -IF(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}" +set(WIN_SHELL_GENS "Visual Studio|NMake|MinGW|Watcom|Borland") +if(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}" AND EXISTS "${QT_QMAKE_EXECUTABLE}" AND NOT CMAKE_NO_AUTO_QT_ENV) - GET_FILENAME_COMPONENT(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH) - IF(EXISTS "${Qt_BIN_DIR}/QtCore4.dll") + get_filename_component(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH) + if(EXISTS "${Qt_BIN_DIR}/QtCore4.dll") # Tell the macro to set the path before running cmake-gui. - STRING(REPLACE ";" "\\;" _PATH "PATH=${Qt_BIN_DIR};%PATH%") - SET(cmake-gui-PATH COMMAND set "${_PATH}") - ENDIF(EXISTS "${Qt_BIN_DIR}/QtCore4.dll") -ENDIF(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}" + string(REPLACE ";" "\\;" _PATH "PATH=${Qt_BIN_DIR};%PATH%") + set(cmake-gui-PATH COMMAND set "${_PATH}") + endif(EXISTS "${Qt_BIN_DIR}/QtCore4.dll") +endif(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}" AND EXISTS "${QT_QMAKE_EXECUTABLE}" AND NOT CMAKE_NO_AUTO_QT_ENV) # add the docs for the executables @@ -93,8 +93,8 @@ ADD_DOCS(cmake-gui ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in) # add the documentation for cmake itself -GET_TARGET_PROPERTY(CMD cmake LOCATION) -ADD_CUSTOM_COMMAND( +get_target_property(CMD cmake LOCATION) +add_custom_command( OUTPUT ${CMake_BINARY_DIR}/Docs/cmake.txt COMMAND ${CMD} ARGS --copyright ${CMake_BINARY_DIR}/Docs/Copyright.txt @@ -124,12 +124,12 @@ ADD_CUSTOM_COMMAND( MAIN_DEPENDENCY ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt ) -INSTALL_FILES(${CMAKE_MAN_DIR}/man1 FILES ${MAN_FILES}) -INSTALL_FILES(${CMAKE_DOC_DIR} FILES ${HTML_FILES} ${TEXT_FILES}) -INSTALL(FILES cmake.m4 DESTINATION share/aclocal) +install_files(${CMAKE_MAN_DIR}/man1 FILES ${MAN_FILES}) +install_files(${CMAKE_DOC_DIR} FILES ${HTML_FILES} ${TEXT_FILES}) +install(FILES cmake.m4 DESTINATION share/aclocal) # Drive documentation generation. -ADD_CUSTOM_TARGET(documentation ALL DEPENDS ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/cmake.txt ) +add_custom_target(documentation ALL DEPENDS ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/cmake.txt ) # Documentation testing. if(BUILD_TESTING) diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt index 2430391fd..ab40fdf8c 100644 --- a/Utilities/Doxygen/CMakeLists.txt +++ b/Utilities/Doxygen/CMakeLists.txt @@ -13,27 +13,27 @@ # # Build the documentation # -INCLUDE (${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL) +include (${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL) -IF (BUILD_DOCUMENTATION) +if (BUILD_DOCUMENTATION) # # Configure the script and the doxyfile, then add target # - IF(NOT DOT_PATH) - GET_FILENAME_COMPONENT(DOT_PATH ${DOT} PATH) - ENDIF(NOT DOT_PATH) + if(NOT DOT_PATH) + get_filename_component(DOT_PATH ${DOT} PATH) + endif(NOT DOT_PATH) - CONFIGURE_FILE( + configure_file( ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in ${CMake_BINARY_DIR}/Utilities/Doxygen/doxyfile) - CONFIGURE_FILE( + configure_file( ${CMake_SOURCE_DIR}/Utilities/Doxygen/doc_makeall.sh.in ${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh) - ADD_CUSTOM_TARGET(DoxygenDoc + add_custom_target(DoxygenDoc ${BASH} ${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh) -ENDIF (BUILD_DOCUMENTATION) +endif (BUILD_DOCUMENTATION) diff --git a/Utilities/KWIML/CMakeLists.txt b/Utilities/KWIML/CMakeLists.txt index 6a8641adc..62b6fffb7 100644 --- a/Utilities/KWIML/CMakeLists.txt +++ b/Utilities/KWIML/CMakeLists.txt @@ -13,8 +13,8 @@ # Import the KWIML directory tree into a subdirectory under a parent # project and configure the library as follows: # -# SET(KWIML myIML) -# SUBDIRS(KWIML) +# set(KWIML myIML) +# subdirs(KWIML) # # Optional settings are as follows: # @@ -22,8 +22,8 @@ # Headers will go in a directory called "${KWIML}" under this root. # For example: # -# SET(KWIML_HEADER_ROOT ${PROJECT_BINARY_DIR}) -# INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}) +# set(KWIML_HEADER_ROOT ${PROJECT_BINARY_DIR}) +# include_directories(${PROJECT_BINARY_DIR}) # # KWIML_INSTALL_INCLUDE_DIR = install KWIML with "make install" # Specify a value relative to the install prefix and do NOT start with '/'. diff --git a/Utilities/KWStyle/CMakeLists.txt b/Utilities/KWStyle/CMakeLists.txt index fbaa67b37..b08dbde6f 100644 --- a/Utilities/KWStyle/CMakeLists.txt +++ b/Utilities/KWStyle/CMakeLists.txt @@ -16,63 +16,63 @@ # Search for a built-from-source KWStyle under Dashboards/Support on a typical # dashboard machines: # -SET(home "$ENV{HOME}") -IF(NOT home) - STRING(REPLACE "\\" "/" home "$ENV{USERPROFILE}") -ENDIF() +set(home "$ENV{HOME}") +if(NOT home) + string(REPLACE "\\" "/" home "$ENV{USERPROFILE}") +endif() -FIND_PROGRAM(KWSTYLE_EXECUTABLE +find_program(KWSTYLE_EXECUTABLE NAMES KWStyle PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Kitware Inc.\\KWStyle 1.0.0]/bin" "${home}/Dashboards/Support/KWStyle/bin" ) -MARK_AS_ADVANCED(KWSTYLE_EXECUTABLE) +mark_as_advanced(KWSTYLE_EXECUTABLE) -SET(CMAKE_USE_KWSTYLE_DEFAULT OFF) -IF(KWSTYLE_EXECUTABLE) - SET(CMAKE_USE_KWSTYLE_DEFAULT ON) -ENDIF() +set(CMAKE_USE_KWSTYLE_DEFAULT OFF) +if(KWSTYLE_EXECUTABLE) + set(CMAKE_USE_KWSTYLE_DEFAULT ON) +endif() -OPTION(CMAKE_USE_KWSTYLE +option(CMAKE_USE_KWSTYLE "Add StyleCheck target and KWStyle test: run KWStyle to check for coding standard violations." ${CMAKE_USE_KWSTYLE_DEFAULT}) -MARK_AS_ADVANCED(CMAKE_USE_KWSTYLE) +mark_as_advanced(CMAKE_USE_KWSTYLE) -IF(CMAKE_USE_KWSTYLE) - OPTION(KWSTYLE_USE_VIM_FORMAT "Set KWStyle to generate errors with a VIM-compatible format." OFF) - OPTION(KWSTYLE_USE_MSVC_FORMAT "Set KWStyle to generate errors with a VisualStudio-compatible format." OFF) - MARK_AS_ADVANCED(KWSTYLE_USE_VIM_FORMAT) - MARK_AS_ADVANCED(KWSTYLE_USE_MSVC_FORMAT) +if(CMAKE_USE_KWSTYLE) + option(KWSTYLE_USE_VIM_FORMAT "Set KWStyle to generate errors with a VIM-compatible format." OFF) + option(KWSTYLE_USE_MSVC_FORMAT "Set KWStyle to generate errors with a VisualStudio-compatible format." OFF) + mark_as_advanced(KWSTYLE_USE_VIM_FORMAT) + mark_as_advanced(KWSTYLE_USE_MSVC_FORMAT) - IF(KWSTYLE_USE_VIM_FORMAT) - SET(KWSTYLE_ARGUMENTS -vim ${KWSTYLE_ARGUMENTS}) - ENDIF(KWSTYLE_USE_VIM_FORMAT) + if(KWSTYLE_USE_VIM_FORMAT) + set(KWSTYLE_ARGUMENTS -vim ${KWSTYLE_ARGUMENTS}) + endif(KWSTYLE_USE_VIM_FORMAT) - IF(KWSTYLE_USE_MSVC_FORMAT) - SET(KWSTYLE_ARGUMENTS -msvc ${KWSTYLE_ARGUMENTS}) - ENDIF(KWSTYLE_USE_MSVC_FORMAT) + if(KWSTYLE_USE_MSVC_FORMAT) + set(KWSTYLE_ARGUMENTS -msvc ${KWSTYLE_ARGUMENTS}) + endif(KWSTYLE_USE_MSVC_FORMAT) - CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMake.kws.xml.in + configure_file(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMake.kws.xml.in ${CMake_BINARY_DIR}/CMake.kws.xml) - CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in + configure_file(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in ${CMake_BINARY_DIR}/CMakeMoreChecks.kws.xml) - CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeFiles.txt.in + configure_file(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeFiles.txt.in ${CMake_BINARY_DIR}/CMakeKWSFiles.txt) - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${CMake_BINARY_DIR}/KWStyleReport.txt COMMAND ${KWSTYLE_EXECUTABLE} ARGS -xml ${CMake_BINARY_DIR}/CMake.kws.xml -o ${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMake_BINARY_DIR}/CMakeKWSFiles.txt COMMENT "Coding Style Checker" ) - ADD_CUSTOM_TARGET(MoreStyleChecks + add_custom_target(MoreStyleChecks COMMAND ${KWSTYLE_EXECUTABLE} -xml ${CMake_BINARY_DIR}/CMakeMoreChecks.kws.xml -html ${CMake_BINARY_DIR}/html -o ${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMake_BINARY_DIR}/CMakeKWSFiles.txt COMMENT "Coding Style Checker, more checks enabled" ) - ADD_CUSTOM_TARGET(StyleCheck DEPENDS ${CMake_BINARY_DIR}/KWStyleReport.txt) -ENDIF(CMAKE_USE_KWSTYLE) + add_custom_target(StyleCheck DEPENDS ${CMake_BINARY_DIR}/KWStyleReport.txt) +endif(CMAKE_USE_KWSTYLE) diff --git a/Utilities/Release/Cygwin/CMakeLists.txt b/Utilities/Release/Cygwin/CMakeLists.txt index 565c9a4d6..6a453615f 100644 --- a/Utilities/Release/Cygwin/CMakeLists.txt +++ b/Utilities/Release/Cygwin/CMakeLists.txt @@ -1,25 +1,25 @@ -FILE(GLOB INSTALLED_CURSES /usr/bin/cygncurses-*.dll) -SET(MAX 0) -FOREACH(f ${INSTALLED_CURSES}) - IF(NOT "${f}" MATCHES "\\+") - STRING(REGEX REPLACE ".*-([0-9]*).dll" "\\1" NUMBER "${f}") - IF(NUMBER GREATER MAX) - SET(MAX ${NUMBER}) - ENDIF(NUMBER GREATER MAX) - ENDIF(NOT "${f}" MATCHES "\\+") -ENDFOREACH(f) -STRING(REGEX REPLACE "/usr/bin/" "\\1" NUMBER "${f}") -SET(CMAKE_NCURSES_VERSION "libncurses${MAX}") -MESSAGE(STATUS "Using curses version: libncurses${MAX}") -CONFIGURE_FILE("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-setup.hint.in" +file(GLOB INSTALLED_CURSES /usr/bin/cygncurses-*.dll) +set(MAX 0) +foreach(f ${INSTALLED_CURSES}) + if(NOT "${f}" MATCHES "\\+") + string(REGEX REPLACE ".*-([0-9]*).dll" "\\1" NUMBER "${f}") + if(NUMBER GREATER MAX) + set(MAX ${NUMBER}) + endif(NUMBER GREATER MAX) + endif(NOT "${f}" MATCHES "\\+") +endforeach(f) +string(REGEX REPLACE "/usr/bin/" "\\1" NUMBER "${f}") +set(CMAKE_NCURSES_VERSION "libncurses${MAX}") +message(STATUS "Using curses version: libncurses${MAX}") +configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-setup.hint.in" "${CMake_BINARY_DIR}/setup.hint") -CONFIGURE_FILE("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/README.cygwin.in" +configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/README.cygwin.in" "${CMake_BINARY_DIR}/Docs/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.README") -INSTALL_FILES(/share/doc/Cygwin FILES +install_files(/share/doc/Cygwin FILES ${CMake_BINARY_DIR}/Docs/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.README ) -CONFIGURE_FILE("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-package.sh.in" +configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-package.sh.in" ${CPACK_CYGWIN_BUILD_SCRIPT}) -CONFIGURE_FILE("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-patch.diff.in" +configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-patch.diff.in" ${CPACK_CYGWIN_PATCH_FILE}) diff --git a/Utilities/Release/release_cmake.cmake b/Utilities/Release/release_cmake.cmake index b5b86aff0..04ec2e5e6 100644 --- a/Utilities/Release/release_cmake.cmake +++ b/Utilities/Release/release_cmake.cmake @@ -73,12 +73,12 @@ configure_file(${SCRIPT_PATH}/release_cmake.sh.in ${SCRIPT_FILE} @ONLY) # run the script by starting a shell on the remote machine # then using the script file as input to the shell -IF(RUN_LOCAL) +if(RUN_LOCAL) message(FATAL_ERROR "run this command: ${RUN_SHELL} ${SCRIPT_FILE}") -ELSE(RUN_LOCAL) +else(RUN_LOCAL) remote_command("run release_cmake-${HOST}.sh on server" "${RUN_SHELL}" ${SCRIPT_FILE}) -ENDIF(RUN_LOCAL) +endif(RUN_LOCAL) # now figure out which types of packages were created set(generators ${CPACK_BINARY_GENERATORS} ${CPACK_SOURCE_GENERATORS}) diff --git a/bootstrap b/bootstrap index 801882d7a..f7bc00436 100755 --- a/bootstrap +++ b/bootstrap @@ -19,7 +19,7 @@ die() { cmake_version_component() { cat "${cmake_source_dir}/Source/CMakeVersion.cmake" | sed -n " -/^SET(CMake_VERSION_${1}/ {s/SET(CMake_VERSION_${1} *\([0-9]*\))/\1/;p;} +/^set(CMake_VERSION_${1}/ {s/set(CMake_VERSION_${1} *\([0-9]*\))/\1/;p;} " } @@ -1493,21 +1493,21 @@ rebuild_cache: echo ' # Generated by '"${cmake_source_dir}"'/bootstrap # Default cmake settings. These may be overridden any settings below. -SET (CMAKE_INSTALL_PREFIX "'"${cmake_prefix_dir}"'" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) -SET (CMAKE_DOC_DIR "'"${cmake_doc_dir}"'" CACHE PATH "Install location for documentation (relative to prefix)." FORCE) -SET (CMAKE_MAN_DIR "'"${cmake_man_dir}"'" CACHE PATH "Install location for man pages (relative to prefix)." FORCE) -SET (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for data (relative to prefix)." FORCE) +set (CMAKE_INSTALL_PREFIX "'"${cmake_prefix_dir}"'" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) +set (CMAKE_DOC_DIR "'"${cmake_doc_dir}"'" CACHE PATH "Install location for documentation (relative to prefix)." FORCE) +set (CMAKE_MAN_DIR "'"${cmake_man_dir}"'" CACHE PATH "Install location for man pages (relative to prefix)." FORCE) +set (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for data (relative to prefix)." FORCE) ' > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" # Add configuration settings given as command-line options. if [ "x${cmake_bootstrap_qt_gui}" != "x" ]; then echo ' -SET (BUILD_QtDialog '"${cmake_bootstrap_qt_gui}"' CACHE BOOL "Build Qt dialog for CMake" FORCE) +set (BUILD_QtDialog '"${cmake_bootstrap_qt_gui}"' CACHE BOOL "Build Qt dialog for CMake" FORCE) ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" fi if [ "x${cmake_bootstrap_qt_qmake}" != "x" ]; then echo ' -SET (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE) +set (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE) ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" fi diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in index 03137d5af..0005d9ef2 100644 --- a/cmake_uninstall.cmake.in +++ b/cmake_uninstall.cmake.in @@ -1,22 +1,22 @@ -IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") -ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") +endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") -FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) -STRING(REGEX REPLACE "\n" ";" files "${files}") -FOREACH(file ${files}) - MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") - IF(EXISTS "$ENV{DESTDIR}${file}") - EXEC_PROGRAM( +file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) +string(REGEX REPLACE "\n" ";" files "${files}") +foreach(file ${files}) + message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") + if(EXISTS "$ENV{DESTDIR}${file}") + exec_program( "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval ) - IF("${rm_retval}" STREQUAL 0) - ELSE("${rm_retval}" STREQUAL 0) - MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") - ENDIF("${rm_retval}" STREQUAL 0) - ELSE(EXISTS "$ENV{DESTDIR}${file}") - MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") - ENDIF(EXISTS "$ENV{DESTDIR}${file}") -ENDFOREACH(file) + if("${rm_retval}" STREQUAL 0) + else("${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") + endif("${rm_retval}" STREQUAL 0) + else(EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") + endif(EXISTS "$ENV{DESTDIR}${file}") +endforeach(file)