From c35ced89e650ce1d12184ba488cb8221a92db97d Mon Sep 17 00:00:00 2001 From: Modestas Vainius Date: Wed, 27 Jun 2012 20:52:58 +0300 Subject: [PATCH] Imported Upstream version 2.8.9-rc1 --- CMakeLists.txt | 29 +- ChangeLog.manual | 306 ++++ Docs/CMakeLists.txt | 4 + Docs/bash-completion/CMakeLists.txt | 8 + Docs/bash-completion/cmake | 149 ++ Docs/bash-completion/cpack | 61 + Docs/bash-completion/ctest | 81 + Docs/cmake-completion | 207 --- ...asicConfigVersion-AnyNewerVersion.cmake.in | 5 + .../BasicConfigVersion-ExactVersion.cmake.in | 5 + ...sicConfigVersion-SameMajorVersion.cmake.in | 5 + Modules/CMakeCCompiler.cmake.in | 3 + Modules/CMakeCInformation.cmake | 2 +- Modules/CMakeCXXCompiler.cmake.in | 3 + Modules/CMakeCXXInformation.cmake | 14 +- Modules/CMakeClDeps.cmake | 37 + Modules/CMakeDetermineCCompiler.cmake | 6 +- Modules/CMakeDetermineCXXCompiler.cmake | 1 + Modules/CMakeDetermineCompilerId.cmake | 6 - Modules/CMakeFortranInformation.cmake | 14 +- Modules/CMakeGenericSystem.cmake | 16 +- Modules/CMakePlatformId.h.in | 3 + Modules/CPack.cmake | 5 + Modules/CPackDeb.cmake | 30 +- Modules/CPackNSIS.cmake | 22 +- Modules/CPackRPM.cmake | 5 +- Modules/CheckCCompilerFlag.cmake | 4 +- Modules/CheckCXXCompilerFlag.cmake | 4 +- Modules/Compiler/GNU.cmake | 4 + Modules/Compiler/SCO.cmake | 3 + Modules/Compiler/SunPro-C.cmake | 2 + Modules/Compiler/SunPro-CXX.cmake | 2 + Modules/Compiler/XL.cmake | 2 +- Modules/ExternalProject.cmake | 112 +- Modules/FeatureSummary.cmake | 4 +- Modules/FindArmadillo.cmake | 2 +- Modules/FindBZip2.cmake | 10 +- Modules/FindBullet.cmake | 2 +- Modules/FindCUDA.cmake | 2 +- Modules/FindDevIL.cmake | 21 +- Modules/FindFLTK.cmake | 10 +- Modules/FindFLTK2.cmake | 14 +- Modules/FindLibLZMA.cmake | 69 + Modules/FindLua50.cmake | 6 - Modules/FindLua51.cmake | 4 - Modules/FindOpenAL.cmake | 4 - Modules/FindPhysFS.cmake | 4 - Modules/FindPkgConfig.cmake | 8 +- Modules/FindProducer.cmake | 4 - Modules/FindPythonLibs.cmake | 30 +- Modules/FindQt4.cmake | 51 +- Modules/FindSDL_image.cmake | 4 - Modules/FindSDL_mixer.cmake | 4 - Modules/FindSDL_net.cmake | 4 - Modules/FindSDL_sound.cmake | 20 - Modules/FindSDL_ttf.cmake | 4 - Modules/FindSquish.cmake | 8 +- Modules/FindTCL.cmake | 4 - Modules/FindTclStub.cmake | 2 - Modules/FindwxWidgets.cmake | 4 +- Modules/FindwxWindows.cmake | 2 +- Modules/NSIS.template.in | 23 + Modules/Platform/BeOS.cmake | 2 + Modules/Platform/BlueGeneP-base.cmake | 4 + Modules/Platform/CYGWIN-GNU.cmake | 5 +- Modules/Platform/Darwin-icc.cmake | 15 +- Modules/Platform/Darwin.cmake | 19 +- Modules/Platform/FreeBSD.cmake | 4 +- Modules/Platform/HP-UX-HP.cmake | 1 + Modules/Platform/Haiku.cmake | 2 + Modules/Platform/Linux-Intel.cmake | 2 + Modules/Platform/Linux-PGI.cmake | 2 + Modules/Platform/Linux-PathScale.cmake | 2 + Modules/Platform/MP-RAS.cmake | 4 + Modules/Platform/NetBSD.cmake | 4 +- Modules/Platform/OSF1.cmake | 4 +- Modules/Platform/SINIX.cmake | 2 + Modules/Platform/SunOS.cmake | 8 +- Modules/Platform/UNIX_SV.cmake | 2 + Modules/Platform/UnixWare.cmake | 2 + Modules/Platform/Windows-Embarcadero.cmake | 3 +- Modules/Platform/Windows-GNU.cmake | 6 +- Modules/Platform/Windows-Intel-CXX.cmake | 2 +- Modules/Platform/Windows-Intel.cmake | 2 +- Modules/Platform/Windows-wcl386.cmake | 3 +- Modules/Platform/syllable.cmake | 4 +- Modules/Qt4Macros.cmake | 77 +- Modules/UseJava.cmake | 6 +- Source/CMakeLists.txt | 24 +- Source/CMakeVersion.bash | 7 + Source/CMakeVersion.cmake | 6 + Source/CPack/cmCPackDebGenerator.cxx | 15 +- Source/CPack/cmCPackDebGenerator.h | 11 + Source/CPack/cmCPackDocumentVariables.cxx | 31 + Source/CPack/cmCPackGenerator.cxx | 72 +- Source/CPack/cmCPackGenerator.h | 42 + Source/CPack/cmCPackGeneratorFactory.cxx | 106 +- Source/CPack/cmCPackNSISGenerator.cxx | 18 +- Source/CPack/cmCPackNSISGenerator.h | 2 + Source/CPack/cmCPackRPMGenerator.h | 11 + Source/CTest/cmCTestBZR.cxx | 3 +- Source/CTest/cmCTestCoverageHandler.cxx | 84 +- Source/CTest/cmCTestCoverageHandler.h | 2 + Source/CTest/cmCTestMemCheckHandler.cxx | 2 +- Source/CTest/cmCTestRunTest.cxx | 2 +- Source/CTest/cmCTestScriptHandler.cxx | 6 +- Source/CTest/cmParseCacheCoverage.cxx | 220 +++ Source/CTest/cmParseCacheCoverage.h | 42 + Source/CTest/cmParseGTMCoverage.cxx | 272 ++++ Source/CTest/cmParseGTMCoverage.h | 49 + Source/CTest/cmParseMumpsCoverage.cxx | 165 ++ Source/CTest/cmParseMumpsCoverage.h | 52 + Source/CTest/cmParsePHPCoverage.h | 3 - Source/QtDialog/CMakeSetupDialog.cxx | 2 +- Source/cmAddLibraryCommand.cxx | 15 +- Source/cmArchiveWrite.cxx | 1 + Source/cmCTest.cxx | 23 +- Source/cmCoreTryCompile.cxx | 5 + Source/cmDependsFortranLexer.cxx | 552 ++++--- Source/cmDependsFortranLexer.h | 25 +- Source/cmDependsFortranLexer.in.l | 5 + Source/cmDependsFortranParser.cxx | 810 ++++----- Source/cmDependsFortranParser.y | 8 + Source/cmDependsFortranParserTokens.h | 20 +- Source/cmDocumentVariables.cxx | 48 + Source/cmDocumentationFormatterHTML.cxx | 12 +- Source/cmExportFileGenerator.cxx | 16 +- Source/cmExtraCodeBlocksGenerator.cxx | 46 +- Source/cmExtraCodeBlocksGenerator.h | 2 + Source/cmExtraEclipseCDT4Generator.cxx | 13 +- Source/cmFileCommand.cxx | 8 +- Source/cmFindPackageCommand.cxx | 121 +- Source/cmFindPackageCommand.h | 2 +- Source/cmGeneratorTarget.cxx | 7 - Source/cmGeneratorTarget.h | 1 - Source/cmGlobalGenerator.cxx | 49 + Source/cmGlobalGenerator.h | 8 + Source/cmGlobalKdevelopGenerator.cxx | 3 + Source/cmGlobalNinjaGenerator.cxx | 216 ++- Source/cmGlobalNinjaGenerator.h | 23 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 21 +- Source/cmGlobalVisualStudio10Generator.cxx | 72 + Source/cmGlobalVisualStudio10Generator.h | 21 + Source/cmGlobalVisualStudio11ARMGenerator.cxx | 32 + Source/cmGlobalVisualStudio11ARMGenerator.h | 37 + Source/cmGlobalVisualStudio71Generator.cxx | 14 +- Source/cmGlobalVisualStudio71Generator.h | 4 +- Source/cmGlobalVisualStudio7Generator.cxx | 28 +- Source/cmGlobalVisualStudio7Generator.h | 4 +- Source/cmGlobalVisualStudio8Generator.cxx | 25 +- Source/cmGlobalVisualStudio8Generator.h | 3 +- Source/cmGlobalXCodeGenerator.cxx | 8 +- Source/cmIfCommand.cxx | 13 + Source/cmIncludeExternalMSProjectCommand.cxx | 67 +- Source/cmIncludeExternalMSProjectCommand.h | 12 +- Source/cmInstallCommand.cxx | 77 +- Source/cmInstallCommand.h | 4 +- Source/cmInstallCommandArguments.cxx | 19 +- Source/cmInstallCommandArguments.h | 11 +- Source/cmInstallFilesCommand.cxx | 32 +- Source/cmInstallGenerator.cxx | 12 +- Source/cmInstallProgramsCommand.cxx | 26 +- Source/cmInstallTargetsCommand.cxx | 3 +- Source/cmListCommand.cxx | 15 +- Source/cmLocalGenerator.cxx | 168 +- Source/cmLocalGenerator.h | 14 +- Source/cmLocalNinjaGenerator.cxx | 18 +- Source/cmLocalUnixMakefileGenerator3.cxx | 51 +- Source/cmLocalVisualStudio10Generator.cxx | 8 + Source/cmLocalVisualStudio6Generator.cxx | 2 +- Source/cmLocalVisualStudio7Generator.cxx | 6 +- Source/cmMakefile.cxx | 92 +- Source/cmMakefile.h | 38 +- Source/cmMakefileLibraryTargetGenerator.cxx | 6 +- Source/cmMakefileTargetGenerator.cxx | 38 +- Source/cmMakefileTargetGenerator.h | 1 + Source/cmNinjaNormalTargetGenerator.cxx | 152 +- Source/cmNinjaNormalTargetGenerator.h | 2 +- Source/cmNinjaTargetGenerator.cxx | 140 +- Source/cmNinjaTargetGenerator.h | 3 + Source/cmOrderDirectories.h | 1 - Source/cmPolicies.cxx | 28 + Source/cmPolicies.h | 3 + Source/cmQtAutomoc.cxx | 12 +- Source/cmSetCommand.h | 88 +- Source/cmSystemTools.cxx | 52 +- Source/cmSystemTools.h | 12 +- Source/cmTarget.cxx | 60 +- Source/cmTarget.h | 3 + Source/cmTargetLinkLibrariesCommand.h | 3 +- Source/cmVisualStudio10TargetGenerator.cxx | 144 +- Source/cmVisualStudio10TargetGenerator.h | 16 +- Source/cmake.cxx | 7 +- Source/cmcldeps.cxx | 736 +++++++++ Source/kwsys/CMakeLists.txt | 86 +- Source/kwsys/DateStamp.h.in | 42 - Source/kwsys/SystemInformation.cxx | 2 - Source/kwsys/SystemTools.cxx | 232 ++- Source/kwsys/SystemTools.hxx.in | 6 +- Source/kwsys/hash_fun.hxx.in | 5 +- Source/kwsys/hashtable.hxx.in | 2 +- Source/kwsys/kwsysDateStamp.cmake | 21 - Source/kwsys/kwsysDateStamp.py | 54 - Source/kwsys/kwsysPlatformTestsCXX.cxx | 35 + Source/kwsys/testSystemTools.cxx | 54 + Tests/Assembler/CMakeLists.txt | 1 + Tests/BuildDepends/CMakeLists.txt | 8 +- Tests/CMakeLib/run_compile_commands.cxx | 6 +- Tests/CMakeLists.txt | 104 +- Tests/CMakeOnly/AllFindModules/CMakeLists.txt | 3 +- Tests/CTestUpdateGIT.cmake.in | 3 + Tests/FindPackageModeMakefileTest/Makefile.in | 25 +- Tests/FindPackageTest/CMakeLists.txt | 12 + .../TargetIncludeDirectories/CMakeLists.txt | 4 +- Tests/MumpsCoverage/.gitattributes | 2 + .../Accounts_ReceivableTest.cmcov | 304 ++++ .../Accounts_ReceivableTest.mcov | 1445 +++++++++++++++++ .../DartConfiguration.cache.tcl.in | 8 + Tests/MumpsCoverage/DartConfiguration.tcl.in | 8 + .../Packages/Toolkit/Routines/XINDEX.m | 144 ++ Tests/MumpsCoverage/cache_coverage.cmcov.in | 2 + Tests/MumpsCoverage/gtm_coverage.mcov.in | 2 + Tests/Plugin/CMakeLists.txt | 44 + Tests/Plugin/check_mod_soname.cmake | 14 + .../PositionIndependentTargets/CMakeLists.txt | 13 + .../global/CMakeLists.txt | 37 + Tests/PositionIndependentTargets/main.cpp | 2 + Tests/PositionIndependentTargets/pic_lib.cpp | 12 + Tests/PositionIndependentTargets/pic_main.cpp | 4 + Tests/PositionIndependentTargets/pic_test.h | 20 + .../targets/CMakeLists.txt | 20 + Tests/RunCMake/CMakeLists.txt | 17 +- Tests/RunCMake/Languages/CMakeLists.txt | 3 + .../Languages/NoLangSHARED-result.txt | 1 + .../Languages/NoLangSHARED-stderr.txt | 1 + Tests/RunCMake/Languages/NoLangSHARED.cmake | 1 + Tests/RunCMake/Languages/RunCMakeTest.cmake | 3 + Tests/RunCMake/Languages/foo.nolang | 0 Tests/RunCMake/RunCMake.cmake | 17 +- .../include_external_msproject/CMakeLists.txt | 3 + .../CustomGuid-check.cmake | 1 + .../CustomGuid.cmake | 2 + .../CustomGuidTypePlatform-check.cmake | 1 + .../CustomGuidTypePlatform.cmake | 5 + .../CustomTypePlatform-check.cmake | 1 + .../CustomTypePlatform.cmake | 3 + .../RunCMakeTest.cmake | 6 + .../check_utils.cmake | 109 ++ .../include_external_msproject/main.cpp | 3 + Tests/RunCMake/list/CMakeLists.txt | 3 + Tests/RunCMake/list/EmptyGet0-result.txt | 1 + Tests/RunCMake/list/EmptyGet0-stderr.txt | 4 + Tests/RunCMake/list/EmptyGet0.cmake | 2 + Tests/RunCMake/list/EmptyInsert-1-result.txt | 1 + Tests/RunCMake/list/EmptyInsert-1-stderr.txt | 4 + Tests/RunCMake/list/EmptyInsert-1.cmake | 2 + Tests/RunCMake/list/EmptyRemoveAt0-result.txt | 1 + Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt | 4 + Tests/RunCMake/list/EmptyRemoveAt0.cmake | 2 + Tests/RunCMake/list/RunCMakeTest.cmake | 5 + Tests/SystemInformation/SystemInformation.in | 6 + Tests/VSGNUFortran/c_code/main.c | 2 +- Utilities/.gitattributes | 2 + Utilities/GitSetup/.gitattributes | 7 + Utilities/GitSetup/LICENSE | 202 +++ Utilities/GitSetup/NOTICE | 5 + Utilities/GitSetup/README | 80 + Utilities/GitSetup/config | 9 + Utilities/GitSetup/config.sample | 22 + Utilities/GitSetup/setup-gerrit | 142 ++ Utilities/GitSetup/setup-hooks | 63 + Utilities/GitSetup/setup-ssh | 111 ++ Utilities/GitSetup/setup-stage | 79 + Utilities/GitSetup/setup-user | 39 + Utilities/GitSetup/tips | 55 + Utilities/KWIML/INT.h.in | 228 ++- Utilities/SetupForDevelopment.sh | 13 + Utilities/cmbzip2/sample1.bz2 | Bin 32558 -> 0 bytes Utilities/cmbzip2/sample2.bz2 | Bin 74143 -> 0 bytes Utilities/cmbzip2/sample3.bz2 | Bin 238 -> 0 bytes Utilities/cmlibarchive/CMakeLists.txt | 2 +- .../cmlibarchive/libarchive/archive_endian.h | 6 + .../archive_write_set_format_iso9660.c | 10 +- bootstrap | 76 +- 284 files changed, 9468 insertions(+), 2106 deletions(-) create mode 100644 Docs/CMakeLists.txt create mode 100644 Docs/bash-completion/CMakeLists.txt create mode 100644 Docs/bash-completion/cmake create mode 100644 Docs/bash-completion/cpack create mode 100644 Docs/bash-completion/ctest delete mode 100644 Docs/cmake-completion create mode 100644 Modules/CMakeClDeps.cmake create mode 100644 Modules/FindLibLZMA.cmake create mode 100755 Source/CMakeVersion.bash create mode 100644 Source/CMakeVersion.cmake create mode 100644 Source/CTest/cmParseCacheCoverage.cxx create mode 100644 Source/CTest/cmParseCacheCoverage.h create mode 100644 Source/CTest/cmParseGTMCoverage.cxx create mode 100644 Source/CTest/cmParseGTMCoverage.h create mode 100644 Source/CTest/cmParseMumpsCoverage.cxx create mode 100644 Source/CTest/cmParseMumpsCoverage.h create mode 100644 Source/cmGlobalVisualStudio11ARMGenerator.cxx create mode 100644 Source/cmGlobalVisualStudio11ARMGenerator.h create mode 100644 Source/cmcldeps.cxx delete mode 100644 Source/kwsys/DateStamp.h.in delete mode 100644 Source/kwsys/kwsysDateStamp.cmake delete mode 100755 Source/kwsys/kwsysDateStamp.py create mode 100644 Tests/MumpsCoverage/.gitattributes create mode 100644 Tests/MumpsCoverage/Accounts_ReceivableTest.cmcov create mode 100644 Tests/MumpsCoverage/Accounts_ReceivableTest.mcov create mode 100644 Tests/MumpsCoverage/DartConfiguration.cache.tcl.in create mode 100644 Tests/MumpsCoverage/DartConfiguration.tcl.in create mode 100644 Tests/MumpsCoverage/VistA-FOIA/Packages/Toolkit/Routines/XINDEX.m create mode 100644 Tests/MumpsCoverage/cache_coverage.cmcov.in create mode 100644 Tests/MumpsCoverage/gtm_coverage.mcov.in create mode 100644 Tests/Plugin/check_mod_soname.cmake create mode 100644 Tests/PositionIndependentTargets/CMakeLists.txt create mode 100644 Tests/PositionIndependentTargets/global/CMakeLists.txt create mode 100644 Tests/PositionIndependentTargets/main.cpp create mode 100644 Tests/PositionIndependentTargets/pic_lib.cpp create mode 100644 Tests/PositionIndependentTargets/pic_main.cpp create mode 100644 Tests/PositionIndependentTargets/pic_test.h create mode 100644 Tests/PositionIndependentTargets/targets/CMakeLists.txt create mode 100644 Tests/RunCMake/Languages/CMakeLists.txt create mode 100644 Tests/RunCMake/Languages/NoLangSHARED-result.txt create mode 100644 Tests/RunCMake/Languages/NoLangSHARED-stderr.txt create mode 100644 Tests/RunCMake/Languages/NoLangSHARED.cmake create mode 100644 Tests/RunCMake/Languages/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/Languages/foo.nolang create mode 100644 Tests/RunCMake/include_external_msproject/CMakeLists.txt create mode 100644 Tests/RunCMake/include_external_msproject/CustomGuid-check.cmake create mode 100644 Tests/RunCMake/include_external_msproject/CustomGuid.cmake create mode 100644 Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform-check.cmake create mode 100644 Tests/RunCMake/include_external_msproject/CustomGuidTypePlatform.cmake create mode 100644 Tests/RunCMake/include_external_msproject/CustomTypePlatform-check.cmake create mode 100644 Tests/RunCMake/include_external_msproject/CustomTypePlatform.cmake create mode 100644 Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/include_external_msproject/check_utils.cmake create mode 100644 Tests/RunCMake/include_external_msproject/main.cpp create mode 100644 Tests/RunCMake/list/CMakeLists.txt create mode 100644 Tests/RunCMake/list/EmptyGet0-result.txt create mode 100644 Tests/RunCMake/list/EmptyGet0-stderr.txt create mode 100644 Tests/RunCMake/list/EmptyGet0.cmake create mode 100644 Tests/RunCMake/list/EmptyInsert-1-result.txt create mode 100644 Tests/RunCMake/list/EmptyInsert-1-stderr.txt create mode 100644 Tests/RunCMake/list/EmptyInsert-1.cmake create mode 100644 Tests/RunCMake/list/EmptyRemoveAt0-result.txt create mode 100644 Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt create mode 100644 Tests/RunCMake/list/EmptyRemoveAt0.cmake create mode 100644 Tests/RunCMake/list/RunCMakeTest.cmake create mode 100644 Utilities/.gitattributes create mode 100644 Utilities/GitSetup/.gitattributes create mode 100644 Utilities/GitSetup/LICENSE create mode 100644 Utilities/GitSetup/NOTICE create mode 100644 Utilities/GitSetup/README create mode 100644 Utilities/GitSetup/config create mode 100644 Utilities/GitSetup/config.sample create mode 100755 Utilities/GitSetup/setup-gerrit create mode 100755 Utilities/GitSetup/setup-hooks create mode 100755 Utilities/GitSetup/setup-ssh create mode 100755 Utilities/GitSetup/setup-stage create mode 100755 Utilities/GitSetup/setup-user create mode 100755 Utilities/GitSetup/tips create mode 100755 Utilities/SetupForDevelopment.sh delete mode 100644 Utilities/cmbzip2/sample1.bz2 delete mode 100644 Utilities/cmbzip2/sample2.bz2 delete mode 100644 Utilities/cmbzip2/sample3.bz2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 4795fe073..8522cad28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ #============================================================================= # CMake - Cross Platform Makefile Generator -# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium +# Copyright 2000-2012 Kitware, Inc., Insight Software Consortium # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -9,7 +9,7 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= -CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) +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) @@ -324,10 +324,9 @@ MACRO (CMAKE_BUILD_UTILITIES) #--------------------------------------------------------------------- # Build or use system libarchive for CMake and CTest. IF(CMAKE_USE_SYSTEM_LIBARCHIVE) - IF(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) + IF(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) # added in 2.8.3 FIND_PACKAGE(LibArchive) ELSE() - CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR) INCLUDE(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake) ENDIF() IF(NOT LibArchive_FOUND) @@ -422,26 +421,13 @@ ENDIF() # The main section of the CMakeLists file # #----------------------------------------------------------------------- -# The CMake version number. -SET(CMake_VERSION_MAJOR 2) -SET(CMake_VERSION_MINOR 8) -SET(CMake_VERSION_PATCH 8) -SET(CMake_VERSION_TWEAK 0) -#SET(CMake_VERSION_RC 2) - -# Releases define a tweak level. -IF(DEFINED CMake_VERSION_TWEAK) +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) - - # Use the date as the tweak level. - INCLUDE(${CMake_SOURCE_DIR}/Source/kwsys/kwsysDateStamp.cmake) - SET(CMake_VERSION_TWEAK - "${KWSYS_DATE_STAMP_YEAR}${KWSYS_DATE_STAMP_MONTH}${KWSYS_DATE_STAMP_DAY}" - ) - INCLUDE(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake) ENDIF() @@ -633,6 +619,9 @@ INSTALL( WORLD_READ WORLD_EXECUTE ) +# process docs related install +ADD_SUBDIRECTORY(Docs) + #----------------------------------------------------------------------- # End of the main section of the CMakeLists file #----------------------------------------------------------------------- diff --git a/ChangeLog.manual b/ChangeLog.manual index 691ff9459..6560136ca 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,309 @@ +Changes in CMake 2.8.9-rc1 (since 2.8.8) +---------------------------------------- +Alex Neundorf (12): + -fix #13081: support OBJECT libraries in CodeBlocks/QtCreator projects + CodeBlocks: improve support for OBJECT libraries + fix #13195: avoid multiple mentions of found packages + FeatureSummary.cmake: nicer formatting + -strip trailing whitespace + make default install component name configurable + -add docs for ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} + write_basic_package_version_file() now works with unset CMAKE_SIZEOF_VOID_P + add test for #13241: empty SIZEOF_VOIDP in write_basic_package_version_file + ASM compiler detection: remove debug output (#13270) + Eclipse: parallel build also for "Build project" #13287 + automoc: better error handling (#13299) + +Anthony J. Bentley (1): + FindwxWidgets: Do not use -isystem on OpenBSD (#13219) + +Ben Boeckel (2): + Don't put legacy variables back into the cache + Search for other ABIFLAGS builds of Python + +Bill Hoffman (15): + Add support to ctest for GTM mumps coverage. + Fix warning about char* instead of const char*. + Fix line length. + Add test for mumps coverage. Also refactor code to prepare for cache coverage. + Add virutal destructor to silence warning. + Add support for Cache coverage. + Fix some warnings and a bug where it went past the length of a vector. + Use a script to run the test because WORKING_DIRECTORY is not in 2.8.2. + Use expression to run ctest so it works with Xcode and VS IDE. + Add ability to specify more than one package directory or coverage directory. + Remove uncovered files from cache coverage data. + Disable bullseye coverage for mumps coverage test. + Update test data to match new coverage format. + Do not try to run bullseye coverage if COVFILE env is empty. + CDash now supports lots of files in coverage. So, show all files. + +Brad King (59): + Add LICENSE and NOTICE + Add 'tips' script to suggest local configuration + Add 'setup-user' script to configure authorship information + Add 'setup-hooks' script to install local hooks + Add 'setup-gerrit' script to configure Gerrit access + Add 'setup-stage' script to configure topic stage remote + Add 'setup-ssh' script to configure ssh push access + Add README instructions and sample configuration + Add and configure developer setup helper scripts + Exclude from source archives files specific to Git work tree + Exclude from CMake source archives files specific to Git work tree + Refactor CMake version handling + Document behavior of multiple target_link_libraries calls (#13113) + ctest_coverage: Save/restore LC_ALL around gcov (#13136) + Cleanup custom command .rule file internal handling + Factor out custom command .rule file path generation + VS10: Avoid creating .rule files next to outputs (#13141) + find_package: Document _FIND_* variables (#13142) + find_package: Fix components signature documentation (#13142) + Teach RunCMake tests to allow custom checks + list: Handle errors on empty lists more gracefully (#13138) + include_external_msproject: Test TYPE, GUID, PLATFORM options (#13120) + VS: Fix line-too-long style errors + libarchive: Avoid 'inline' keyword on XL C v6 (#13148) + Intel: On Windows use /EHsc instead of deprecated /GX (#13163) + KWSys: Remove DateStamp + try_compile: Cleanup temporary directories (#13160) + setup-stage: Optionally reconfigure topic stage + CTest: Escape MemCheck test output for XML (#13124) + Documentation: Fix HTML anchor ranges + Require CMake 2.8.2 or higher to build CMake + CTest: Simplify environment save/restore + KWSys: Fix SystemTools environment memory handling (#13156) + VS10: Refactor custom commands to use WriteSource + VS10: Simplify vcxproj.filter file generation + VS10: Convert paths normally unless forced to relative + VS11: Do not use source path conversion workaround specific to VS 10 + VS10: Generate relative source paths when possible (#12570) + Intel: On Windows use /RTC1 instead of deprecated /GZ (#13174) + Test NO_SONAME property (#13155) + KWSys: Remove dependencies on FundamentalType + Documentation: Improve HTML section index format + VS: Restore header files marked as OS X Framework content (#13196) + VS11: Fix ARM architecture hint typo (#13077) + Fortran: Follow <>-style includes (#13239) + bootstrap: Port back to old shells (#13199) + KWSys: Remove unused environ declaration from SystemTools + FindBZip2: Search locations in GnuWin32 registry + cmArchiveWrite: Clear fflags from archive entries + Makefile: Support directory names containing '=' (#12934) + libarchive: Avoid 'inline' on SunPro < 5.9 (#13277) + Avoid direct use of std::(o|)stringstream (#13272) + KWIML: Add interface to report broken integer format macros + KWIML: Report broken integer format macros on AIX 4.3 + add_library: Allow OBJECT library without dynamic linking (#13289) + install: Fix FILES_MATCHING on case-sensitive Mac filesystems (#13177) + Make CTest.UpdateGIT robust to Git safecrlf on Windows + Do not crash on SHARED library without language (#13324) + CMakeDetermineCCompiler: Fix typo "_CXX_" -> "_C_" (#13330) + +Brian Helba (1): + Print any evaluated 'elseif'/'else' commands in trace mode (#13220) + +Charlie Sharpsteen (1): + Mac: Add guards to CMAKE_FIND_FRAMEWORK and CMAKE_FIND_APPBUNDLE defaults + +Clinton Stimpson (1): + cmake-gui: Wait for configure/generate thread to complete before exiting. + +Daniel R. Gomez (6): + KWSys: Fix hashtable prime list on g++ 2.9 (#13273) + Tests/IncludeDirectories: Files must end in a newline (#13314) + Tests/VSGNUFortran: Avoid C++ comment in C code (#13314) + Tests/Assembler: Assemble and link with same flags (#13314) + Fix FindPackageMode test Makefile (#13314) + Avoid string.clear and string.push_back (#13319) + +David Cole (12): + Begin post-2.8.8 development + CPack/NSIS: Add CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS (#13085) + ExternalProject: Add missing COMMAND keyword + ExternalProject: Avoid unnecessary git clones (#12564) + ExternalProject: Refactor repeated code into function (#12564) + ExternalProject: Avoid repeated git clone operations (#12564) + CTest: Modify reg ex so it also works with gcov 4.7 output (#13121) + BZip2: Remove unnecessary *.bz2 files from CMake source tree + Ninja: Enable the ninja generator by default on Windows. + Revert "Millenium update: 79 * (16/9)/(4/3) = 105" + Ninja: Restructure code to work with the Borland compilers + Remove unused ivars to eliminate compiler warnings + +David Faure (1): + Abort FindQt4.cmake if Qt 5 is found. + +Eric NOULARD (12): + Use fakeroot for control.tar.gz as well + Enhancement of bash completion scripts given by Igor Murzov. + Install editors helper files + CPack - preserve timestamp for CPACK_INSTALLED_DIRECTORIES. fixes: #0013193 + CPack add easy possibility to warn about CPACK_SET_DESTDIR + CPack add necessary check to detect/warns/error on ABSOLUTE DESTINATION + Fix KWStyle warning + Use CPACK_xxx and CMAKE_xxx in a consistent way. + CPack allow RPM and DEB generator to be used on OSX. + Calm down Borland compiler warning about "always true" + CPackRPM: avoid leakage of RPM directive from one component to another. + CPackDeb add missing documentation for some CPACK_DEBIAN_xx variables. + +Fraser Hutchison (1): + CPack: Fixed incorrect error log for CPACK_NSIS_MENU_LINKS. + +Jan Schaffmeister (1): + Xcode: Recognize storyboard source files (#13214) + +Jim Hague (2): + libarchive: Avoid trailing , in enum for XL v6 (#13148) + Workaround IBM XL v6 streams seekg bug (#13149) + +Jonathan Klein (1): + FindBullet: Add missing math library name (#13309) + +Joseph Snyder (1): + Change GT.M Coverage Parser global + +Konstantin Tokarev (1): + [OSX] Fixed undefined symbol when linking CMakeLib into shared library + +Kurtis Nusbaum (1): + Added conditional for the phonon backend plugin. + +Leonid Yurchenko (1): + include_external_msproject: Add TYPE, GUID, PLATFORM options (#13120) + +Mario Bensi (1): + Add FindLibLZMA Module + +Mariusz Plucinski (1): + Do not crash on unknown source language (#13323) + +Matt McCormick (1): + ExternalProject: Fix 'make' builds with Ninja (#13159) + +Minmin Gong (1): + VS11: Add ARM architecture generator (#13077) + +Modestas Vainius (3): + Fix CPack RPM man page typo detected by lintian. + Support building shared libraries or modules without soname (#13155) + Fix a few typos in NO_SONAME property description. + +Nicolas Despres (2): + Ninja: Add a convenient 'clean' target. + Ninja: Add a convenient 'help' target. + +Patrick Gansterer (1): + Added CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL + +Peter Collingbourne (2): + Ninja: apply CMAKE__FLAGS_ to executable targets (#13069) + Ninja: mark rules/build file streams failed if error occurred (#13067, #13105) + +Peter Kuemmel (61): + Ninja: ensure output directories exist + Ninja: no 16:9 screens for the cmake team ;) + Ninja: add option to enable ninja where it is not enabled by default + Ninja: remove GCC -Wshadow warning + Ninja: enable Ninja for CodeBlocks + Ninja: no additional variable needed to enable ninja + Ninja: CMAKE_USE_NINJA is the name of the macro + VC Express doesn't support folders, ignore USE_FOLDER property + Ninja: add response file support on Windows + Ninja: 30000 is too long for windows cmd + Ninja: check for valid pointer + Ninja: also create rspfile rules + Ninja: don't break because of empty commands + Ninja: find mingw's resource compiler + Ninja: add dependency tracking for msvc with cldeps + Ninja: add wrapper for cl to extract dependencies + Ninja: allow spaces in source path + Ninja: assume cmcldeps in the same dir as cmake + Ninja: add copyright and description + Ninja: don't set cmcldeps vars to empty string when they are not defined + Ninja: fix ModuleNoticies test + Ninja: don't use cmcldeps for try_compile + Ninja: allow spaces in cldeps's .d file + Ninja: fix line length + Ninja: don't pollute the rules file with useless comments + Ninja: use slahes in .d files + Line Length: <79 + Millenium update: 79 * (16/9)/(4/3) = 105 + Ninja: complete MinGW support + Ninja: use slashes for include dirs, so also slahes are in the .d files + Ninja: ninja can't read dep. pathes with parentheses + Ninja: work with ninja/master, don't compile rc files with cl + Ninja: extract dependencies for .rc files with msvc tools + Ninja: remove unused CommentStream + Ninja: onyl use pre processor for rc file parsing + Ninja: suppress startup logos + Ninja: cmcldeps + Ninja: don't use shell when cmake is called directly + Ninja: ninja now also could read parentheses in .d files + Ninja: fix Linux build + Ninja: sh needs something befor and after && + Ninja: build with old vc versions + Ninja: remove nop line + Ninja: undo all the NOSHELL patches + Ninja: be more accurate when estimating the command line length + Ninja: don't pollute build dir with preprocessed rc files + Ninja: Eclipse and KDevelop fixes for ninja + Ninja: no /nologo option in old rc.exe + Ninja: but cl supports /nologo ... + Ninja: try to make GetProcessId visible + Ninja: build cmcldeps with mingw + Ninja: don't remove space between command and parameters + Ninja: some bytes of the rc files couldn't be piped correctly + Ninja: build server fixes + Ninja: build with old msvc versions + Ninja: msvc6 for-scoping + Ninja: maybe this fixes the bcc32 build + remove warning about unused parameter + Ninja: build server fixes + Ninja: try work around for bcc32 bug + Ninja: disable cldeps for bcc32, it's too old, and ninja would also not build + +Rolf Eike Beer (12): + FindPkgConfig.cmake: fix documented output variable not set (#13125,#13132) + UseJava: fix typo in variable name (#13135) + Check{C,CXX}CompilerFlag: catch more Intel warning types (#12576) + FindPythonLibs: honor EXACT version specification (#13216) + UseJava: fix find_jar() called with multiple files (#13281) + fix some typos + do not explicitely specify /usr and /usr/local as search paths + replace open coded versions of file(TO_CMAKE_PATH) + FindDevIL: clean up documentation formatting + FindQt4: extend documentation + Qt4Macros: improve basename extraction in QT4_ADD_DBUS_INTERFACES + Qt4Macros: add some quotes to prevent damage from spaces in the paths + +Sean McBride (1): + Remove unused ivars to eliminate compiler warnings + +Sebastian Leske (1): + Improve documentation of set command (#13269) + +Stephen Kelly (10): + Fix the number variable comparison when Qt is not found. + Update the docs of IMPORTED_LOCATION_CONFIG to match the code. + Move the EscapeJSON method to a sharable location. + Add newline to the output. + Make the CMAKE_EXPORT_COMPILE_COMMANDS option work with Ninja. + Escape the source file to be compiled if required. + Exclude the CompileCommandOutput test on WIN32. + Add platform variables for position independent code flags + Add platform variable for flags specific to shared libraries + Refactor generation of shared library flags + +Tobias Bieniek (1): + Qt4Macros: Added support for generated resource files + +Zack Galbreath (1): + FindPythonLibs: Document cache variables (#13240) + +Zaheer Chothia (1): + VS: Set Intel Fortran 13 project version + Changes in CMake 2.8.8 (since 2.8.8-rc2) ---------------------------------------- Brad King (1): diff --git a/Docs/CMakeLists.txt b/Docs/CMakeLists.txt new file mode 100644 index 000000000..b04b32d5e --- /dev/null +++ b/Docs/CMakeLists.txt @@ -0,0 +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) diff --git a/Docs/bash-completion/CMakeLists.txt b/Docs/bash-completion/CMakeLists.txt new file mode 100644 index 000000000..592b71e93 --- /dev/null +++ b/Docs/bash-completion/CMakeLists.txt @@ -0,0 +1,8 @@ +# Always install completion file in local dir +# in order to be sure to always be able to install +# in a local user directory rooted in a single directory. +# packager should either patch that out or +# add symlinks to the files in appropriate places +# /etc/bash_completion.d/ +# DATADIR/completions (may be /usr/share//completions +install(FILES cmake cpack ctest DESTINATION ${REL_CMAKE_DATA_DIR}/completions) diff --git a/Docs/bash-completion/cmake b/Docs/bash-completion/cmake new file mode 100644 index 000000000..59b565ac0 --- /dev/null +++ b/Docs/bash-completion/cmake @@ -0,0 +1,149 @@ +# bash completion for cmake(1) -*- shell-script -*- + +_cmake() +{ + local cur prev words cword split=false + _init_completion -n := || return + + # Workaround for options like -DCMAKE_BUILD_TYPE=Release + local prefix= + if [[ $cur == -D* ]]; then + prev=-D + prefix=-D + cur="${cur#-D}" + elif [[ $cur == -U* ]]; then + prev=-U + prefix=-U + cur="${cur#-U}" + fi + + case "$prev" in + -D) + if [[ $cur == *=* ]]; then + # complete values for variables + local var type value + var="${cur%%[:=]*}" + value="${cur#*=}" + + if [[ $cur == CMAKE_BUILD_TYPE* ]]; then # most widely used case + COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo + MinSizeRel' -- "$value" ) ) + return + fi + + if [[ $cur == *:* ]]; then + type="${cur#*:}" + type="${type%%=*}" + else # get type from cache if it's not set explicitly + type=$( cmake -LA -N 2>/dev/null | grep "$var:" \ + 2>/dev/null ) + type="${type#*:}" + type="${type%%=*}" + fi + case "$type" in + FILEPATH) + cur="$value" + _filedir + return + ;; + PATH) + cur="$value" + _filedir -d + return + ;; + BOOL) + COMPREPLY=( $( compgen -W 'ON OFF TRUE FALSE' -- \ + "$value" ) ) + return + ;; + STRING|INTERNAL) + # no completion available + return + ;; + esac + elif [[ $cur == *:* ]]; then + # complete types + local type="${cur#*:}" + COMPREPLY=( $( compgen -W 'FILEPATH PATH STRING BOOL INTERNAL'\ + -S = -- "$type" ) ) + compopt -o nospace + else + # complete variable names + COMPREPLY=( $( compgen -W '$( cmake -LA -N | tail -n +2 | + cut -f1 -d: )' -P "$prefix" -- "$cur" ) ) + compopt -o nospace + fi + return + ;; + -U) + COMPREPLY=( $( compgen -W '$( cmake -LA -N | tail -n +2 | + cut -f1 -d: )' -P "$prefix" -- "$cur" ) ) + return + ;; + esac + + _split_longopt && split=true + + case "$prev" in + -C|-P|--graphviz|--system-information) + _filedir + return + ;; + --build) + _filedir -d + return + ;; + -E) + COMPREPLY=( $( compgen -W "$( cmake -E help |& sed -n \ + '/^ /{s|^ \([^ ]\{1,\}\) .*$|\1|;p}' 2>/dev/null )" \ + -- "$cur" ) ) + return + ;; + -G) + # FIXME: doesn't work properly + local IFS=$'\n' + COMPREPLY=( $( compgen -W '$( cmake --help 2>/dev/null | sed -n \ + "/^.*[^ ].*= Generates/{s|^ *\(.*[^ ]\) *= Generates.*$|\1|;s| |\\\\ |g;p}" \ + 2>/dev/null )' -- "$cur" ) ) + return + ;; + --help-command) + COMPREPLY=( $( compgen -W '$( cmake --help-command-list 2>/dev/null| + tail -n +2 )' -- "$cur" ) ) + return + ;; + --help-module) + COMPREPLY=( $( compgen -W '$( cmake --help-module-list 2>/dev/null| + tail -n +2 )' -- "$cur" ) ) + return + ;; + --help-policy) + COMPREPLY=( $( compgen -W '$( cmake --help-policies 2>/dev/null | + grep "^ CMP" 2>/dev/null )' -- "$cur" ) ) + return + ;; + --help-property) + COMPREPLY=( $( compgen -W '$( cmake --help-property-list \ + 2>/dev/null | tail -n +2 )' -- "$cur" ) ) + return + ;; + --help-variable) + COMPREPLY=( $( compgen -W '$( cmake --help-variable-list \ + 2>/dev/null | tail -n +2 )' -- "$cur" ) ) + return + ;; + esac + + $split && return + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + [[ $COMPREPLY ]] && return + fi + + _filedir +} && +complete -F _cmake cmake + +# ex: ts=4 sw=4 et filetype=sh diff --git a/Docs/bash-completion/cpack b/Docs/bash-completion/cpack new file mode 100644 index 000000000..84dcfd534 --- /dev/null +++ b/Docs/bash-completion/cpack @@ -0,0 +1,61 @@ +# bash completion for cpack(1) -*- shell-script -*- + +_cpack() +{ + local cur prev words cword + _init_completion -n = || return + + case "$prev" in + -G) + COMPREPLY=( $( compgen -W '$( cpack --help 2>/dev/null | + grep "^ .*=\ .*" 2> /dev/null | grep -v "^ -" 2>/dev/null | + cut -d" " -f 3 )' -- "$cur" ) ) + return + ;; + -C) + COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo + MinSizeRel' -- "$cur" ) ) + return + ;; + -D) + [[ $cur == *=* ]] && return # no completion for values + COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \ + 2>/dev/null | tail -n +2 )' -S = -- "$cur" ) ) + compopt -o nospace + return + ;; + -P|-R|--vendor) + # argument required but no completions available + return + ;; + -B) + _filedir -d + return + ;; + --config) + _filedir + return + ;; + --help-command) + COMPREPLY=( $( compgen -W '$( cpack --help-command-list 2>/dev/null| + tail -n +2 )' -- "$cur" ) ) + return + ;; + --help-variable) + COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \ + 2>/dev/null | tail -n +2 )' -- "$cur" ) ) + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + [[ $COMPREPLY ]] && return + fi + + _filedir +} && +complete -F _cpack cpack + +# ex: ts=4 sw=4 et filetype=sh diff --git a/Docs/bash-completion/ctest b/Docs/bash-completion/ctest new file mode 100644 index 000000000..9707f6269 --- /dev/null +++ b/Docs/bash-completion/ctest @@ -0,0 +1,81 @@ +# bash completion for ctest(1) -*- shell-script -*- + +_ctest() +{ + local cur prev words cword + _init_completion -n = || return + + case "$prev" in + -C|--build-config) + COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo + MinSizeRel' -- "$cur" ) ) + return + ;; + -j|--parallel) + COMPREPLY=( $( compgen -W "{1..$(( $(_ncpus)*2 ))}" -- "$cur" ) ) + return + ;; + -O|--output-log|-A|--add-notes|--extra-submit) + _filedir + return + ;; + -L|--label-regex|-LE|--label-exclude|--track|-I|--tests-information|\ + --max-width|--timeout|--stop-time) + # argument required but no completions available + return + ;; + -R|--tests-regex|-E|--exclude-regex) + COMPREPLY=( $( compgen -W '$( ctest -N 2>/dev/null | + grep "^ Test" 2>/dev/null | cut -d: -f 2 )' -- "$cur" ) ) + return + ;; + -D|--dashboard) + if [[ $cur == @(Experimental|Nightly|Continuous)* ]]; then + local model action + action=${cur#@(Experimental|Nightly|Continuous)} + model=${cur%"$action"} + COMPREPLY=( $( compgen -W 'Start Update Configure Build Test + Coverage Submit MemCheck' -P "$model" -- "$action" ) ) + else + COMPREPLY=( $( compgen -W 'Experimental Nightly Continuous' \ + -- "$cur" ) ) + compopt -o nospace + fi + return + ;; + -M|--test-model) + COMPREPLY=( $( compgen -W 'Experimental Nightly Continuous' -- \ + "$cur" ) ) + return + ;; + -T|--test-action) + COMPREPLY=( $( compgen -W 'Start Update Configure Build Test + Coverage Submit MemCheck' -- "$cur" ) ) + return + ;; + -S|--script|-SP|--script-new-process) + # FIXME ? + return + ;; + --interactive-debug-mode) + COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) ) + return + ;; + --help-command) + COMPREPLY=( $( compgen -W '$( ctest --help-command-list 2>/dev/null| + tail -n +2 )' -- "$cur" ) ) + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + [[ $COMPREPLY ]] && return + fi + + _filedir +} && +complete -F _ctest ctest + +# ex: ts=4 sw=4 et filetype=sh diff --git a/Docs/cmake-completion b/Docs/cmake-completion deleted file mode 100644 index d70ac2445..000000000 --- a/Docs/cmake-completion +++ /dev/null @@ -1,207 +0,0 @@ -# -# bash-completion file for CMake -# Provided by Eric NOULARD - eric.noulard@gmail.com -# -# see http://bash-completion.alioth.debian.org/ -# and http://www.cmake.org -# -# We will try to complete cmake commands options -# at 2 (or may be 3 levels) -# [cmake|cpack|ctest] -# -# level0 is top level cmake/cpack/ctest options -# level1 is the first argument of level0 option -# level2 is the seconf argument of level1 argument -# FIXME: I don't know how to handle level2 -# -# The file has been proposed for inclusion in the bash-completion package -# https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312632&group_id=100114 -# In the meantime, -# 1) If you want to test bash completion for cmake/cpack/ctest -# just source the current file at bash prompt -# . ./cmake-completion -# -# 2) If you want to install it for good copy this file to -# cp cmake-completion /etc/bash_completion.d/cmake -# - -# -# cmake command -# -# have cmake && -_cmake() -{ - local cur prev opts words cword - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - # seems to be only available on bash-completion 1.2 - #_get_comp_words_by_ref cur prev - - # cmake command line option we want to complete - opts=`cmake --help | grep "^ \-.*=\ .*" | cut -d" " -f 3 | cut -d= -f 1 | cut -d[ -f 1` - - # - # Complete the arguments to some of - # the most commonly used commands (Level 1). - # - case "${prev}" in - -E) - local running=$(for x in `cmake -E |& grep "^ " | cut -d" " -f 3`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - # FIXME: don't know how to handle multi words completion - # or more precisely word that contains space in them like "Unix Makefiles" - # -G) - # local running=$(for x in `cmake --help | grep "^ .*=\ .*" | grep -v "^ -" | cut -d"=" -f 1 | grep -v "^ "`; do echo \"${x}\" ; done ) - # COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - # return 0 - # ;; - --help-command) - local running=$(for x in `cmake --help-command-list | grep -v "cmake version"`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - --help-module) - local running=$(for x in `cmake --help-module-list | grep -v "cmake version"`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - --help-policy) - local running=$(for x in `cmake --help-policies | grep "^ CMP"`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - --help-property) - local running=$(for x in `cmake --help-property-list | grep -v "cmake version"`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - --help-variable) - local running=$(for x in `cmake --help-variable-list | grep -v "cmake version"`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - *) - ;; - esac - - # - # Complete the arguments to some of - # the most commonly used commands (Level 2). - # ?? How to do that .. - - # - # Complete the option (Level 0 - right after cmake) - # - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) -} && -complete -F _cmake -o default cmake - -# -# cpack command -# -#have cpack && -_cpack() -{ - local cur prev opts words cword - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - # seems to be only available on bash-completion 1.2 - #_get_comp_words_by_ref cur prev - - # cpack command line option we want to complete - opts=`cpack --help | grep "^ \-.*=\ .*" | cut -d" " -f 3 | cut -d= -f 1` - opts="${opts} --help -V" - - # - # Complete the arguments to some of - # the most commonly used commands (Level 1). - # - case "${prev}" in - -G) - local running=$(for x in `cpack --help | grep "^ .*=\ .*" | grep -v "^ -" | cut -d" " -f 3`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - --config) - COMPREPLY=( $(compgen -f ${cur}) ) - return 0 - ;; - --help-variable) - local running=$(for x in `cpack --help-variable-list | grep -v "cpack version" `; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - --help-command) - local running=$(for x in `cpack --help-command-list | grep -v "cpack version" `; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - *) - ;; - esac - - # - # Complete the option (Level 0 - right after cpack) - # - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) -} && -complete -F _cpack -o default cpack - -# -# ctest command -# -# have ctest && -_ctest() -{ - local cur prev opts words cword - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - # seems to be only available on bash-completion 1.2 - #_get_comp_words_by_ref cur prev - - # cmake command line option we want to complete - opts=`ctest --help | grep "\-\-.*" | cut -d" " -f 3 | sed s/,/\\\n/g` - - # - # Complete the arguments to some of - # the most commonly used commands (Level 1). - # - case "${prev}" in - --help-command) - local running=$(for x in `ctest --help-command-list | grep -v "ctest version" `; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - -R|-E) - local running=$(for x in `ctest -N 2> /dev/null | grep "^ Test" | cut -d: -f 2`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - *) - ;; - esac - - # - # Complete the arguments to some of - # the most commonly used commands (Level 2). - # ?? How to do that .. - - # - # Complete the option (Level 0 - right after cmake) - # - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) -} && -complete -F _ctest -o default ctest - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: ts=4 sw=4 et filetype=sh diff --git a/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in index cf53db84a..9f7f03e27 100644 --- a/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in +++ b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in @@ -18,6 +18,11 @@ else() endif() endif() +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") + return() +endif() + # check that the installed version has the same 32/64bit-ness as the one which is currently searching: if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") diff --git a/Modules/BasicConfigVersion-ExactVersion.cmake.in b/Modules/BasicConfigVersion-ExactVersion.cmake.in index c610baa28..63f3f0339 100644 --- a/Modules/BasicConfigVersion-ExactVersion.cmake.in +++ b/Modules/BasicConfigVersion-ExactVersion.cmake.in @@ -34,6 +34,11 @@ if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") endif() +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") + return() +endif() + # check that the installed version has the same 32/64bit-ness as the one which is currently searching: if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") diff --git a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in index 2317fdbb3..7bcea88a5 100644 --- a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in +++ b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in @@ -33,6 +33,11 @@ else() endif() +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") + return() +endif() + # check that the installed version has the same 32/64bit-ness as the one which is currently searching: if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in index b14cf3427..ded8cf6ab 100644 --- a/Modules/CMakeCCompiler.cmake.in +++ b/Modules/CMakeCCompiler.cmake.in @@ -48,3 +48,6 @@ SET(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@") 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 6b5efba9d..afac7a452 100644 --- a/Modules/CMakeCInformation.cmake +++ b/Modules/CMakeCInformation.cmake @@ -164,7 +164,7 @@ INCLUDE(CMakeCommonLanguageInclude) # create a C shared library IF(NOT CMAKE_C_CREATE_SHARED_LIBRARY) SET(CMAKE_C_CREATE_SHARED_LIBRARY - " -o ") + " -o ") ENDIF(NOT CMAKE_C_CREATE_SHARED_LIBRARY) # create a C shared module just copy the shared library rule diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index bc3bc2efb..5b6376a32 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -49,3 +49,6 @@ SET(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@") 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 25abb8c39..9dc9cbd30 100644 --- a/Modules/CMakeCXXInformation.cmake +++ b/Modules/CMakeCXXInformation.cmake @@ -100,6 +100,18 @@ 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_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_SHARED_LIBRARY_CXX_FLAGS) SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) ENDIF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS) @@ -242,7 +254,7 @@ INCLUDE(CMakeCommonLanguageInclude) # create a shared C++ library IF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - " -o ") + " -o ") ENDIF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) # create a c++ shared module copy the shared library rule by default diff --git a/Modules/CMakeClDeps.cmake b/Modules/CMakeClDeps.cmake new file mode 100644 index 000000000..6815e2b75 --- /dev/null +++ b/Modules/CMakeClDeps.cmake @@ -0,0 +1,37 @@ + +#============================================================================= +# Copyright 2012 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# +# When using Ninja cl.exe is wrapped by cmcldeps to extract the included +# headers for dependency tracking. +# +# cmcldeps path is set, and cmcldeps needs to know the localized string +# in front of each include path, so it can remove it. +# + +IF(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND) + STRING(REPLACE "cmake.exe" "cmcldeps.exe" CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND}) + SET(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes) + FILE(WRITE ${showdir}/foo.h "\n") + FILE(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n") + EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c + WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE showOut) + STRING(REPLACE main.c "" showOut1 ${showOut}) + STRING(REPLACE "/" "\\" header1 ${showdir}/foo.h) + STRING(TOLOWER ${header1} header2) + STRING(REPLACE ${header2} "" showOut2 ${showOut1}) + STRING(REPLACE "\n" "" showOut3 ${showOut2}) + SET(SET_CMAKE_CMCLDEPS_EXECUTABLE "SET(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")") + SET(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "SET(CMAKE_CL_SHOWINCLUDE_PREFIX \"${showOut3}\")") +ENDIF() diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index e2e268fb3..9028e8e06 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -32,7 +32,7 @@ # _CMAKE_TOOLCHAIN_PREFIX IF(NOT CMAKE_C_COMPILER) - SET(CMAKE_CXX_COMPILER_INIT NOTFOUND) + SET(CMAKE_C_COMPILER_INIT NOTFOUND) # prefer the environment variable CC IF($ENV{CC} MATCHES ".+") @@ -165,9 +165,7 @@ 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 diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 829836933..7f8f3ec8b 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -173,6 +173,7 @@ 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 diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 686cc9b6a..67f5a5906 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -302,12 +302,6 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang) TIMEOUT 10 ) - IF("${lang}" STREQUAL "ASM") - MESSAGE(STATUS "Checked for ${vendor}") - MESSAGE(STATUS " Output: -${output}-") - MESSAGE(STATUS " Result: -${result}-") - ENDIF("${lang}" STREQUAL "ASM") - IF("${output}" MATCHES "${regex}") FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" " diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake index 76cf34e9f..d962f4cb5 100644 --- a/Modules/CMakeFortranInformation.cmake +++ b/Modules/CMakeFortranInformation.cmake @@ -74,6 +74,18 @@ ENDIF() # catch any modules 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_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) + # 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 @@ -171,7 +183,7 @@ INCLUDE(CMakeCommonLanguageInclude) # create a Fortran shared library IF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY) SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY - " -o ") + " -o ") ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY) # create a Fortran shared module just copy the shared library rule diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake index ee8040e3b..0ccbfac56 100644 --- a/Modules/CMakeGenericSystem.cmake +++ b/Modules/CMakeGenericSystem.cmake @@ -12,7 +12,7 @@ # (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_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 @@ -42,7 +42,7 @@ SET (CMAKE_SKIP_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 @@ -60,6 +60,12 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") ENDIF(CMAKE_GENERATOR MATCHES "Unix Makefiles") ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") +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") # GetDefaultWindowsPrefixBase # @@ -77,6 +83,8 @@ function(GetDefaultWindowsPrefixBase var) # if("${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)") set(arch_hint "x64") + elseif("${CMAKE_GENERATOR}" MATCHES "ARM") + set(arch_hint "ARM") elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8") set(arch_hint "x64") elseif("$ENV{LIB}" MATCHES "(amd64|ia64)") @@ -168,6 +176,10 @@ ELSE(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") + MARK_AS_ADVANCED( CMAKE_SKIP_RPATH CMAKE_SKIP_INSTALL_RPATH diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in index b69bf6310..6341dca9a 100644 --- a/Modules/CMakePlatformId.h.in +++ b/Modules/CMakePlatformId.h.in @@ -97,6 +97,9 @@ # elif defined(_M_IX86) # define ARCHITECTURE_ID "X86" +# elif defined(_M_ARM) +# define ARCHITECTURE_ID "ARM" + # else /* unknown architecture */ # define ARCHITECTURE_ID "" # endif diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 571770e98..e5721192c 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -89,6 +89,7 @@ # CPACK_PACKAGE_FILE_NAME - The name of the package file to generate, # not including the extension. For example, cmake-2.6.1-Linux-i686. # The default value is +# # ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}. ##end # @@ -341,6 +342,10 @@ cpack_set_if_not_set(CPACK_RESOURCE_FILE_WELCOME cpack_set_if_not_set(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}") +IF(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL) + SET(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON) +ENDIF(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL) + IF(CPACK_NSIS_MODIFY_PATH) SET(CPACK_NSIS_MODIFY_PATH ON) ENDIF(CPACK_NSIS_MODIFY_PATH) diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index fe81dc92c..bd3b94d74 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -68,7 +68,11 @@ # CPACK_DEBIAN_PACKAGE_HOMEPAGE # Mandatory : NO # Default : - -# The URL of the web site for this package +# The URL of the web site for this package, preferably (when applicable) the +# site from which the original source can be obtained and any additional +# upstream documentation or information may be found. +# The content of this field is a simple URL without any surrounding +# characters such as <>. ##end ##variable # CPACK_DEBIAN_PACKAGE_SHLIBDEPS @@ -137,6 +141,30 @@ # Packages can declare in their control file that they should overwrite # files in certain other packages, or completely replace other packages. ##end +##variable +# CPACK_DEBIAN_PACKAGE_RECOMMENDS +# Mandatory : NO +# Default : - +# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps +# Allows packages to declare a strong, but not absolute, dependency on other packages. +##end +##variable +# CPACK_DEBIAN_PACKAGE_SUGGESTS +# Mandatory : NO +# Default : - +# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps +# Allows packages to declare a suggested package install grouping. +##end +##variable +# CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA +# Mandatory : NO +# 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 +# "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm") +##end + #============================================================================= # Copyright 2007-2009 Kitware, Inc. diff --git a/Modules/CPackNSIS.cmake b/Modules/CPackNSIS.cmake index 5e2ba17f8..d14005369 100644 --- a/Modules/CPackNSIS.cmake +++ b/Modules/CPackNSIS.cmake @@ -31,13 +31,21 @@ ##end # ##variable -# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that will -# be added to the install Section. +# CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS - Extra NSIS commands that +# will be added to the beginning of the install Section, before your +# install tree is available on the target system. +##end +# +##variable +# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that +# will be added to the end of the install Section, after your +# install tree is available on the target system. ##end # ##variable # CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra NSIS commands that will -# be added to the uninstall Section. +# be added to the uninstall Section, before your install tree is +# removed from the target system. ##end # ##variable @@ -46,6 +54,14 @@ ##end # ##variable +# CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL - Ask about uninstalling +# previous versions first. +# If this is set to "ON", then an installer will look for previous +# installed versions and if one is found, ask the user whether to +# uninstall it before proceeding with the install. +##end +# +##variable # CPACK_NSIS_MODIFY_PATH - Modify PATH toggle. # If this is set to "ON", then an extra page # will appear in the installer that will allow the user to choose diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index cba746fc5..ae9351273 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -488,7 +488,10 @@ FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLIC 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}") -ENDIF(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) # CPACK_RPM_SPEC_INSTALL_POST diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake index 1c08c5959..90d04ac66 100644 --- a/Modules/CheckCCompilerFlag.cmake +++ b/Modules/CheckCCompilerFlag.cmake @@ -33,7 +33,9 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT) FAIL_REGEX "unknown .*option" # Clang FAIL_REGEX "ignoring unknown option" # MSVC FAIL_REGEX "warning D9002" # MSVC, any lang - FAIL_REGEX "option .*not supported" # Intel + FAIL_REGEX "option.*not supported" # Intel + FAIL_REGEX "invalid argument .*option" # Intel + FAIL_REGEX "ignoring option .*argument required" # Intel FAIL_REGEX "[Uu]nknown option" # HP FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro FAIL_REGEX "command option .* is not recognized" # XL diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake index 6fa69b12d..19963ea4c 100644 --- a/Modules/CheckCXXCompilerFlag.cmake +++ b/Modules/CheckCXXCompilerFlag.cmake @@ -33,7 +33,9 @@ MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT) FAIL_REGEX "unknown .*option" # Clang FAIL_REGEX "ignoring unknown option" # MSVC FAIL_REGEX "warning D9002" # MSVC, any lang - FAIL_REGEX "option .*not supported" # Intel + FAIL_REGEX "option.*not supported" # Intel + FAIL_REGEX "invalid argument .*option" # Intel + FAIL_REGEX "ignoring option .*argument required" # Intel FAIL_REGEX "[Uu]nknown option" # HP FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro FAIL_REGEX "command option .* is not recognized" # XL diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index c74c17919..6aecf90e8 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -21,6 +21,10 @@ set(__COMPILER_GNU 1) macro(__compiler_gnu lang) # Feature flags. set(CMAKE_${lang}_VERBOSE_FLAG "-v") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") + if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4) + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") + endif() set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") diff --git a/Modules/Compiler/SCO.cmake b/Modules/Compiler/SCO.cmake index d3deeb177..f673c8f80 100644 --- a/Modules/Compiler/SCO.cmake +++ b/Modules/Compiler/SCO.cmake @@ -20,6 +20,9 @@ set(__COMPILER_SCO 1) macro(__compiler_sco lang) # Feature flags. + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC -Kpic) + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE -Kpie) + set(CMAKE_${lang}_COMPILE_OPTIONS_DLL -belf) set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-Kpic -belf") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-belf -Wl,-Bexport") endmacro() diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake index 656eea624..a1a3ae118 100644 --- a/Modules/Compiler/SunPro-C.cmake +++ b/Modules/Compiler/SunPro-C.cmake @@ -1,5 +1,7 @@ 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") diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake index 3e07e8e48..702e42458 100644 --- a/Modules/Compiler/SunPro-CXX.cmake +++ b/Modules/Compiler/SunPro-CXX.cmake @@ -1,5 +1,7 @@ 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") diff --git a/Modules/Compiler/XL.cmake b/Modules/Compiler/XL.cmake index d2567d513..d293610c3 100644 --- a/Modules/Compiler/XL.cmake +++ b/Modules/Compiler/XL.cmake @@ -47,7 +47,7 @@ macro(__compiler_xl lang) # files so that we export only the symbols actually provided by the sources. set(CMAKE_${lang}_CREATE_SHARED_LIBRARY "${CMAKE_XL_CreateExportList} /objects.exp " - " -Wl,-bE:/objects.exp -o " + " -Wl,-bE:/objects.exp -o " ) endif() endmacro() diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index b6fe19004..a0a9aead5 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -252,12 +252,23 @@ define_property(DIRECTORY PROPERTY "EP_STEP_TARGETS" INHERITED ) -function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag src_name work_dir) +function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag src_name work_dir gitclone_infofile gitclone_stampfile) file(WRITE ${script_filename} "if(\"${git_tag}\" STREQUAL \"\") message(FATAL_ERROR \"Tag for git checkout should not be empty.\") endif() +set(run 0) + +if(\"${gitclone_infofile}\" IS_NEWER_THAN \"${gitclone_stampfile}\") + set(run 1) +endif() + +if(NOT run) + message(STATUS \"Avoiding repeated git clone, stamp file is up to date: '${gitclone_stampfile}'\") + return() +endif() + execute_process( COMMAND \${CMAKE_COMMAND} -E remove_directory \"${source_dir}\" RESULT_VARIABLE error_code @@ -302,6 +313,19 @@ if(error_code) message(FATAL_ERROR \"Failed to update submodules in: '${work_dir}/${src_name}'\") endif() +# Complete success, update the script-last-run stamp file: +# +execute_process( + COMMAND \${CMAKE_COMMAND} -E copy + \"${gitclone_infofile}\" + \"${gitclone_stampfile}\" + WORKING_DIRECTORY \"${work_dir}/${src_name}\" + RESULT_VARIABLE error_code + ) +if(error_code) + message(FATAL_ERROR \"Failed to copy script-last-run stamp file: '${gitclone_stampfile}'\") +endif() + " ) @@ -688,8 +712,12 @@ function(_ep_get_build_command name step cmd_var) endif() else() # if(cfg_cmd_id STREQUAL "configure") # Non-CMake project. Guess "make" and "make install" and "make test". - # But use "$(MAKE)" to get recursive parallel make. - set(cmd "$(MAKE)") + if("${CMAKE_GENERATOR}" MATCHES "Makefiles") + # Try to get the parallel arguments + set(cmd "$(MAKE)") + else() + set(cmd "make") + endif() if(step STREQUAL "INSTALL") set(args install) endif() @@ -824,15 +852,23 @@ function(_ep_get_configuration_subdir_suffix suffix_var) endfunction(_ep_get_configuration_subdir_suffix) -function(ExternalProject_Add_StepTargets name) - set(steps ${ARGN}) +function(_ep_get_step_stampfile name step stampfile_var) + ExternalProject_Get_Property(${name} stamp_dir) _ep_get_configuration_subdir_suffix(cfgdir) - ExternalProject_Get_Property(${name} stamp_dir) + set(stampfile "${stamp_dir}${cfgdir}/${name}-${step}") + + set(${stampfile_var} "${stampfile}" PARENT_SCOPE) +endfunction() + + +function(ExternalProject_Add_StepTargets name) + set(steps ${ARGN}) foreach(step ${steps}) + _ep_get_step_stampfile(${name} ${step} stamp_file) add_custom_target(${name}-${step} - DEPENDS ${stamp_dir}${cfgdir}/${name}-${step}) + DEPENDS ${stamp_file}) # Depend on other external projects (target-level). get_property(deps TARGET ${name} PROPERTY _EP_DEPENDS) @@ -845,23 +881,26 @@ endfunction(ExternalProject_Add_StepTargets) function(ExternalProject_Add_Step name step) set(cmf_dir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles) - ExternalProject_Get_Property(${name} stamp_dir) - _ep_get_configuration_subdir_suffix(cfgdir) + set(complete_stamp_file "${cmf_dir}${cfgdir}/${name}-complete") + _ep_get_step_stampfile(${name} ${step} stamp_file) + add_custom_command(APPEND - OUTPUT ${cmf_dir}${cfgdir}/${name}-complete - DEPENDS ${stamp_dir}${cfgdir}/${name}-${step} + OUTPUT ${complete_stamp_file} + DEPENDS ${stamp_file} ) + _ep_parse_arguments(ExternalProject_Add_Step - ${name} _EP_${step}_ "${ARGN}") + ${name} _EP_${step}_ "${ARGN}") # Steps depending on this step. get_property(dependers TARGET ${name} PROPERTY _EP_${step}_DEPENDERS) foreach(depender IN LISTS dependers) + _ep_get_step_stampfile(${name} ${depender} depender_stamp_file) add_custom_command(APPEND - OUTPUT ${stamp_dir}${cfgdir}/${name}-${depender} - DEPENDS ${stamp_dir}${cfgdir}/${name}-${step} + OUTPUT ${depender_stamp_file} + DEPENDS ${stamp_file} ) endforeach() @@ -871,7 +910,8 @@ function(ExternalProject_Add_Step name step) # Dependencies on steps. get_property(dependees TARGET ${name} PROPERTY _EP_${step}_DEPENDEES) foreach(dependee IN LISTS dependees) - list(APPEND depends ${stamp_dir}${cfgdir}/${name}-${dependee}) + _ep_get_step_stampfile(${name} ${dependee} dependee_stamp_file) + list(APPEND depends ${dependee_stamp_file}) endforeach() # The command to run. @@ -901,10 +941,10 @@ function(ExternalProject_Add_Step name step) # Run every time? get_property(always TARGET ${name} PROPERTY _EP_${step}_ALWAYS) if(always) - set_property(SOURCE ${stamp_dir}${cfgdir}/${name}-${step} PROPERTY SYMBOLIC 1) + set_property(SOURCE ${stamp_file} PROPERTY SYMBOLIC 1) set(touch) else() - set(touch ${CMAKE_COMMAND} -E touch ${stamp_dir}${cfgdir}/${name}-${step}) + set(touch ${CMAKE_COMMAND} -E touch ${stamp_file}) endif() # Wrap with log script? @@ -914,7 +954,7 @@ function(ExternalProject_Add_Step name step) endif() add_custom_command( - OUTPUT ${stamp_dir}${cfgdir}/${name}-${step} + OUTPUT ${stamp_file} COMMENT ${comment} COMMAND ${command} COMMAND ${touch} @@ -1079,9 +1119,15 @@ function(_ep_add_download_command name) set(git_tag "master") endif() + # For the download step, and the git clone operation, only the repository + # should be recorded in a configured RepositoryInfo file. If the repo + # changes, the clone script should be run again. But if only the tag + # changes, avoid running the clone script again. Let the 'always' running + # update step checkout the new tag. + # set(repository ${git_repository}) set(module) - set(tag ${git_tag}) + set(tag) configure_file( "${CMAKE_ROOT}/Modules/RepositoryInfo.txt.in" "${stamp_dir}/${name}-gitinfo.txt" @@ -1097,6 +1143,7 @@ function(_ep_add_download_command name) # _ep_write_gitclone_script(${tmp_dir}/${name}-gitclone.cmake ${source_dir} ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${src_name} ${work_dir} + ${stamp_dir}/${name}-gitinfo.txt ${stamp_dir}/${name}-gitclone-lastrun.txt ) set(comment "Performing download step (git clone) for '${name}'") set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitclone.cmake) @@ -1141,7 +1188,8 @@ function(_ep_add_download_command name) set(comment "Performing download step (verify and extract) for '${name}'") endif() _ep_write_verifyfile_script("${stamp_dir}/verify-${name}.cmake" "${file}" "${md5}") - list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/verify-${name}.cmake) + list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/verify-${name}.cmake + COMMAND) _ep_write_extractfile_script("${stamp_dir}/extract-${name}.cmake" "${name}" "${file}" "${source_dir}") list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/extract-${name}.cmake) endif() @@ -1276,14 +1324,12 @@ endfunction(_ep_add_patch_command) function(_ep_add_configure_command name) ExternalProject_Get_Property(${name} source_dir binary_dir tmp_dir) - _ep_get_configuration_subdir_suffix(cfgdir) - # Depend on other external projects (file-level). set(file_deps) get_property(deps TARGET ${name} PROPERTY _EP_DEPENDS) foreach(dep IN LISTS deps) - get_property(dep_stamp_dir TARGET ${dep} PROPERTY _EP_STAMP_DIR) - list(APPEND file_deps ${dep_stamp_dir}${cfgdir}/${dep}-done) + _ep_get_step_stampfile(${dep} "done" done_stamp_file) + list(APPEND file_deps ${done_stamp_file}) endforeach() get_property(cmd_set TARGET ${name} PROPERTY _EP_CONFIGURE_COMMAND SET) @@ -1446,11 +1492,14 @@ function(ExternalProject_Add name) # Add a custom target for the external project. set(cmf_dir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles) - add_custom_target(${name} ALL DEPENDS ${cmf_dir}${cfgdir}/${name}-complete) + set(complete_stamp_file "${cmf_dir}${cfgdir}/${name}-complete") + + add_custom_target(${name} ALL DEPENDS ${complete_stamp_file}) set_property(TARGET ${name} PROPERTY _EP_IS_EXTERNAL_PROJECT 1) _ep_parse_arguments(ExternalProject_Add ${name} _EP_ "${ARGN}") _ep_set_directories(${name}) - ExternalProject_Get_Property(${name} stamp_dir) + _ep_get_step_stampfile(${name} "done" done_stamp_file) + _ep_get_step_stampfile(${name} "install" install_stamp_file) # The 'complete' step depends on all other steps and creates a # 'done' mark. A dependent external project's 'configure' step @@ -1461,19 +1510,18 @@ function(ExternalProject_Add name) # parallel builds. However, the Ninja generator needs to see the entire # dependency graph, and can cope with custom commands belonging to # multiple targets, so we add the 'done' mark as an output for Ninja only. - set(complete_outputs ${cmf_dir}${cfgdir}/${name}-complete) + set(complete_outputs ${complete_stamp_file}) if(${CMAKE_GENERATOR} MATCHES "Ninja") - set(complete_outputs - ${complete_outputs} ${stamp_dir}${cfgdir}/${name}-done) + set(complete_outputs ${complete_outputs} ${done_stamp_file}) endif() add_custom_command( OUTPUT ${complete_outputs} COMMENT "Completed '${name}'" COMMAND ${CMAKE_COMMAND} -E make_directory ${cmf_dir}${cfgdir} - COMMAND ${CMAKE_COMMAND} -E touch ${cmf_dir}${cfgdir}/${name}-complete - COMMAND ${CMAKE_COMMAND} -E touch ${stamp_dir}${cfgdir}/${name}-done - DEPENDS ${stamp_dir}${cfgdir}/${name}-install + COMMAND ${CMAKE_COMMAND} -E touch ${complete_stamp_file} + COMMAND ${CMAKE_COMMAND} -E touch ${done_stamp_file} + DEPENDS ${install_stamp_file} VERBATIM ) diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index cef647eb5..a5b94d199 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -318,7 +318,7 @@ FUNCTION(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet) GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE) FOREACH(_purpose ${_info}) - SET(_currentFeatureText "${_currentFeatureText}\n * ${_purpose}") + SET(_currentFeatureText "${_currentFeatureText}\n ${_purpose}") ENDFOREACH() ENDIF(includeThisOne) @@ -399,7 +399,7 @@ FUNCTION(FEATURE_SUMMARY) SET(_tmp) _FS_GET_FEATURE_SUMMARY( ${part} _tmp ${_FS_INCLUDE_QUIET_PACKAGES}) IF(_tmp) - SET(_fullText "${_fullText}\n\n-- ${title_${part}}\n${_tmp}") + SET(_fullText "${_fullText}\n-- ${title_${part}}\n${_tmp}\n") IF("${part}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND") SET(requiredPackagesNotFound TRUE) ENDIF() diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake index 50eb78710..84ed3cab6 100644 --- a/Modules/FindArmadillo.cmake +++ b/Modules/FindArmadillo.cmake @@ -74,7 +74,7 @@ endif (ARMADILLO_INCLUDE_DIR) #====================== -# Checks 'RECQUIRED', 'QUIET' and versions. +# Checks 'REQUIRED', 'QUIET' and versions. include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Armadillo REQUIRED_VARS ARMADILLO_LIBRARY ARMADILLO_INCLUDE_DIR diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake index 713019259..ce7f2555d 100644 --- a/Modules/FindBZip2.cmake +++ b/Modules/FindBZip2.cmake @@ -22,11 +22,15 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h ) +SET(_BZIP2_PATHS PATHS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Bzip2;InstallPath]" + ) + +FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h ${_BZIP2_PATHS} PATH_SUFFIXES include) IF (NOT BZIP2_LIBRARIES) - FIND_LIBRARY(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 ) - FIND_LIBRARY(BZIP2_LIBRARY_DEBUG NAMES bzip2d ) + 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) SELECT_LIBRARY_CONFIGURATIONS(BZIP2) diff --git a/Modules/FindBullet.cmake b/Modules/FindBullet.cmake index aea9158e8..c96755fa4 100644 --- a/Modules/FindBullet.cmake +++ b/Modules/FindBullet.cmake @@ -63,7 +63,7 @@ _FIND_BULLET_LIBRARY(BULLET_DYNAMICS_LIBRARY_DEBUG BulletDynamics_Debug BulletD _FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY BulletCollision) _FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY_DEBUG BulletCollision_Debug BulletCollision_d) _FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY BulletMath LinearMath) -_FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY_DEBUG BulletMath_Debug BulletMath_d LinearMath_d) +_FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY_DEBUG BulletMath_Debug BulletMath_d LinearMath_Debug LinearMath_d) _FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY BulletSoftBody) _FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY_DEBUG BulletSoftBody_Debug BulletSoftBody_d) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 9f8d5755f..56a92c199 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -540,7 +540,7 @@ set (CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE}) macro(FIND_LIBRARY_LOCAL_FIRST _var _names _doc) if(CMAKE_SIZEOF_VOID_P EQUAL 8) - # CUDA 3.2+ on Windows moved the library directoryies, so we need the new + # CUDA 3.2+ on Windows moved the library directories, so we need the new # and old paths. set(_cuda_64bit_lib_dir "lib/x64" "lib64" ) endif() diff --git a/Modules/FindDevIL.cmake b/Modules/FindDevIL.cmake index 0e21284dd..4a0fbe064 100644 --- a/Modules/FindDevIL.cmake +++ b/Modules/FindDevIL.cmake @@ -2,11 +2,22 @@ # http://openil.sourceforge.net/ # # This module sets: -# IL_LIBRARIES the name of the IL library. These include the full path to the core DevIL library. This one has to be linked into the application. -# ILU_LIBRARIES the name of the ILU library. Again, the full path. This library is for filters and effects, not actual loading. It doesn't have to be linked if the functionality it provides is not used. -# ILUT_LIBRARIES the name of the ILUT library. Full path. This part of the library interfaces with OpenGL. It is not strictly needed in applications. -# IL_INCLUDE_DIR where to find the il.h, ilu.h and ilut.h files. -# IL_FOUND this is set to TRUE if all the above variables were set. This will be set to false if ILU or ILUT are not found, even if they are not needed. In most systems, if one library is found all the others are as well. That's the way the DevIL developers release it. +# IL_LIBRARIES - the name of the IL library. These include the full path to +# the core DevIL library. This one has to be linked into the +# application. +# ILU_LIBRARIES - the name of the ILU library. Again, the full path. This +# library is for filters and effects, not actual loading. It +# doesn't have to be linked if the functionality it provides +# is not used. +# ILUT_LIBRARIES - the name of the ILUT library. Full path. This part of the +# library interfaces with OpenGL. It is not strictly needed +# in applications. +# IL_INCLUDE_DIR - where to find the il.h, ilu.h and ilut.h files. +# IL_FOUND - this is set to TRUE if all the above variables were set. +# This will be set to false if ILU or ILUT are not found, +# even if they are not needed. In most systems, if one +# library is found all the others are as well. That's the +# way the DevIL developers release it. #============================================================================= # Copyright 2008-2009 Kitware, Inc. diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake index bb18a2e17..bdea95bdc 100644 --- a/Modules/FindFLTK.cmake +++ b/Modules/FindFLTK.cmake @@ -79,18 +79,14 @@ SET(FLTK_DIR_STRING "directory containing FLTKConfig.cmake. This is either the # Search only if the location is not already known. IF(NOT FLTK_DIR) # Get the system search path as a list. - IF(UNIX) - STRING(REGEX MATCHALL "[^:]+" FLTK_DIR_SEARCH1 "$ENV{PATH}") - ELSE(UNIX) - STRING(REGEX REPLACE "\\\\" "/" FLTK_DIR_SEARCH1 "$ENV{PATH}") - ENDIF(UNIX) - STRING(REGEX REPLACE "/;" ";" FLTK_DIR_SEARCH2 ${FLTK_DIR_SEARCH1}) + 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}") # # Look for an installation or build tree. @@ -105,8 +101,6 @@ IF(NOT FLTK_DIR) # Look in standard UNIX install locations. /usr/local/lib/fltk /usr/lib/fltk - /usr/local/include - /usr/include /usr/local/fltk /usr/X11R6/include diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake index 436e280bc..916474579 100644 --- a/Modules/FindFLTK2.cmake +++ b/Modules/FindFLTK2.cmake @@ -59,18 +59,14 @@ SET(FLTK2_DIR_STRING "directory containing FLTK2Config.cmake. This is either th # Search only if the location is not already known. IF(NOT FLTK2_DIR) # Get the system search path as a list. - IF(UNIX) - STRING(REGEX MATCHALL "[^:]+" FLTK2_DIR_SEARCH1 "$ENV{PATH}") - ELSE(UNIX) - STRING(REGEX REPLACE "\\\\" "/" FLTK2_DIR_SEARCH1 "$ENV{PATH}") - ENDIF(UNIX) - STRING(REGEX REPLACE "/;" ";" FLTK2_DIR_SEARCH2 ${FLTK2_DIR_SEARCH1}) + 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}") # # Look for an installation or build tree. @@ -85,8 +81,6 @@ IF(NOT FLTK2_DIR) # Look in standard UNIX install locations. /usr/local/lib/fltk2 /usr/lib/fltk2 - /usr/local/include - /usr/include /usr/local/fltk2 /usr/X11R6/include @@ -193,8 +187,6 @@ IF(FLTK2_DIR) ENDIF(FLTK2_FLUID_EXECUTABLE) SET(FLTK2_INCLUDE_SEARCH_PATH ${FLTK2_INCLUDE_SEARCH_PATH} - /usr/local/include - /usr/include /usr/local/fltk2 /usr/X11R6/include ) @@ -202,8 +194,6 @@ IF(FLTK2_DIR) FIND_PATH(FLTK2_INCLUDE_DIR fltk/run.h ${FLTK2_INCLUDE_SEARCH_PATH}) SET(FLTK2_LIBRARY_SEARCH_PATH ${FLTK2_LIBRARY_SEARCH_PATH} - /usr/lib - /usr/local/lib /usr/local/fltk2/lib /usr/X11R6/lib ${FLTK2_INCLUDE_DIR}/lib diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake new file mode 100644 index 000000000..729f5ce73 --- /dev/null +++ b/Modules/FindLibLZMA.cmake @@ -0,0 +1,69 @@ +# - Find LibLZMA +# Find LibLZMA headers and library +# +# LIBLZMA_FOUND - True if liblzma is found. +# LIBLZMA_INCLUDE_DIRS - Directory where liblzma headers are located. +# LIBLZMA_LIBRARIES - Lzma libraries to link against. +# LIBLZMA_HAS_AUTO_DECODER - True if lzma_auto_decoder() is found (required). +# LIBLZMA_HAS_EASY_ENCODER - True if lzma_easy_encoder() is found (required). +# LIBLZMA_HAS_LZMA_PRESET - True if lzma_lzma_preset() is found (required). +# LIBLZMA_VERSION_MAJOR - The major version of lzma +# LIBLZMA_VERSION_MINOR - The minor version of lzma +# LIBLZMA_VERSION_PATCH - The patch version of lzma +# LIBLZMA_VERSION_STRING - version number as a string (ex: "5.0.3") + +#============================================================================= +# Copyright 2008 Per Øyvind Karlsen +# Copyright 2009 Alexander Neundorf +# Copyright 2009 Helio Chissini de Castro +# Copyright 2012 Mario Bensi +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + + +FIND_PATH(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) + + 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") + +# 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) + 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) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA REQUIRED_VARS LIBLZMA_INCLUDE_DIR + LIBLZMA_LIBRARY + LIBLZMA_HAS_AUTO_DECODER + LIBLZMA_HAS_EASY_ENCODER + LIBLZMA_HAS_LZMA_PRESET + VERSION_VAR LIBLZMA_VERSION_STRING + ) + +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 ) diff --git a/Modules/FindLua50.cmake b/Modules/FindLua50.cmake index ee8b84ecc..9a5cc1703 100644 --- a/Modules/FindLua50.cmake +++ b/Modules/FindLua50.cmake @@ -31,8 +31,6 @@ FIND_PATH(LUA_INCLUDE_DIR lua.h PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave @@ -47,8 +45,6 @@ FIND_LIBRARY(LUA_LIBRARY_lua PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw @@ -67,8 +63,6 @@ ELSE(${LUA_LIBRARY_lua} MATCHES "framework") $ENV{LUA_DIR} PATH_SUFFIXES lib64 lib PATHS - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake index b67dd4cec..e111d3624 100644 --- a/Modules/FindLua51.cmake +++ b/Modules/FindLua51.cmake @@ -32,8 +32,6 @@ FIND_PATH(LUA_INCLUDE_DIR lua.h PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave @@ -48,8 +46,6 @@ FIND_LIBRARY(LUA_LIBRARY PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake index bcba6e220..cb3ce4813 100644 --- a/Modules/FindOpenAL.cmake +++ b/Modules/FindOpenAL.cmake @@ -68,8 +68,6 @@ FIND_PATH(OPENAL_INCLUDE_DIR al.h PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave @@ -85,8 +83,6 @@ FIND_LIBRARY(OPENAL_LIBRARY PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindPhysFS.cmake b/Modules/FindPhysFS.cmake index 80dfd518c..2e3ac1400 100644 --- a/Modules/FindPhysFS.cmake +++ b/Modules/FindPhysFS.cmake @@ -30,8 +30,6 @@ FIND_PATH(PHYSFS_INCLUDE_DIR physfs.h PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave @@ -46,8 +44,6 @@ FIND_LIBRARY(PHYSFS_LIBRARY PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index 5d93ab151..39d3a76ab 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -13,11 +13,10 @@ # When the 'QUIET' argument is set, no status messages will be printed. # # It sets the following variables: -# PKG_CONFIG_FOUND ... true if pkg-config works on the system +# PKG_CONFIG_FOUND ... if pkg-config executable was found # PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program # PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found # (since CMake 2.8.8) -# PKG_CONFIG_FOUND ... if pkg-config executable was found # # For the following variables two sets of values exist; first one is the # common one and has the given PREFIX. The second set contains flags @@ -104,6 +103,11 @@ find_package_handle_standard_args(PkgConfig REQUIRED_VARS PKG_CONFIG_EXECUTABLE VERSION_VAR PKG_CONFIG_VERSION_STRING) +# This is needed because the module name is "PkgConfig" but the name of +# this variable has always been PKG_CONFIG_FOUND so this isn't automatically +# handled by FPHSA. +set(PKG_CONFIG_FOUND "${PKGCONFIG_FOUND}") + # Unsets the given variables macro(_pkgconfig_unset var) set(${var} "" CACHE INTERNAL "") diff --git a/Modules/FindProducer.cmake b/Modules/FindProducer.cmake index 39a94361b..26c804ac1 100644 --- a/Modules/FindProducer.cmake +++ b/Modules/FindProducer.cmake @@ -51,8 +51,6 @@ FIND_PATH(PRODUCER_INCLUDE_DIR Producer/CameraGroup PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local/include - /usr/include /sw/include # Fink /opt/local/include # DarwinPorts /opt/csw/include # Blastwave @@ -69,8 +67,6 @@ FIND_LIBRARY(PRODUCER_LIBRARY $ENV{OSGDIR} PATH_SUFFIXES lib64 lib PATHS - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index fcd0838f1..11ff19623 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -13,6 +13,11 @@ # The Python_ADDITIONAL_VERSIONS variable can be used to specify a list of # version numbers that should be taken into account when searching for Python. # You need to set this variable before calling find_package(PythonLibs). +# +# If you'd like to specify the installation of Python to use, you should modify +# the following cache variables: +# PYTHON_LIBRARY - path to the python library +# PYTHON_INCLUDE_DIR - path to where Python.h is found #============================================================================= # Copyright 2001-2009 Kitware, Inc. @@ -40,13 +45,19 @@ IF(PythonLibs_FIND_VERSION) 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(NOT PythonLibs_FIND_VERSION_EXACT) + 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(NOT PythonLibs_FIND_VERSION_EXACT) + 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]+.*)?$") @@ -82,7 +93,12 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS}) ENDIF(WIN32) FIND_LIBRARY(PYTHON_LIBRARY - NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION} + NAMES + python${_CURRENT_VERSION_NO_DOTS} + python${_CURRENT_VERSION}mu + python${_CURRENT_VERSION}m + python${_CURRENT_VERSION}u + python${_CURRENT_VERSION} PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs @@ -120,12 +136,14 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS}) [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include PATH_SUFFIXES + python${_CURRENT_VERSION}mu + python${_CURRENT_VERSION}m + python${_CURRENT_VERSION}u python${_CURRENT_VERSION} ) - # For backward compatibility, set PYTHON_INCLUDE_PATH, but make it internal. - SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}" CACHE INTERNAL - "Path to where Python.h is found (deprecated)") + # For backward compatibility, set PYTHON_INCLUDE_PATH. + 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 diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 9b646b443..2f1708d70 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -102,15 +102,28 @@ # accompanying header file foo.h. # If a source file has the SKIP_AUTOMOC property set it will be ignored by this macro. # +# You should have a look on the AUTOMOC property for targets to achieve the same results. +# # macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename) -# create a the interface header and implementation files with the +# Create a the interface header and implementation files with the # given basename from the given interface xml file and add it to -# the list of sources +# the list of sources. +# +# You can pass additional parameters to the qdbusxml2cpp call by setting +# properties on the input file: +# +# INCLUDE the given file will be included in the generate interface header +# +# CLASSNAME the generated class is named accordingly +# +# NO_NAMESPACE the generated class is not wrapped in a namespace # # macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... ) -# create the interface header and implementation files -# for all listed interface xml files -# the name will be automatically determined from the name of the xml file +# Create the interface header and implementation files +# for all listed interface xml files. +# The basename will be automatically determined from the name of the xml file. +# +# The source file properties described for QT4_ADD_DBUS_INTERFACE also apply here. # # macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname [basename] [classname]) # create a dbus adaptor (header and implementation file) from the xml file @@ -217,7 +230,7 @@ # QT_QAXCONTAINER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only) # QT_QAXSERVER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only) # QT_QTCORE_INCLUDE_DIR Path to "include/QtCore" -# QT_QTDBUS_INCLUDE_DIR Path to "include/QtDBus" +# QT_QTDBUS_INCLUDE_DIR Path to "include/QtDBus" # QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner" # QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR Path to "include/QtDesigner" # QT_QTGUI_INCLUDE_DIR Path to "include/QtGui" @@ -1059,7 +1072,11 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) SET( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff ) SET( QT_INPUTMETHODS_PLUGINS qimsw_multi ) SET( QT_MOUSEDRIVERS_PLUGINS qwstslibmousehandler ) - SET( QT_PHONON_BACKEND_PLUGINS phonon_qt7 ) + 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 ) @@ -1169,10 +1186,22 @@ ELSE( Qt4_FIND_COMPONENTS ) ENDIF( Qt4_FIND_COMPONENTS ) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4 - REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} - VERSION_VAR QTVERSION - ) +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) +else() + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4 + REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} + VERSION_VAR QTVERSION + ) +endif() ####################################### # diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake index 9a130fa22..f215bda47 100644 --- a/Modules/FindSDL_image.cmake +++ b/Modules/FindSDL_image.cmake @@ -39,8 +39,6 @@ FIND_PATH(SDLIMAGE_INCLUDE_DIR SDL_image.h /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /usr/local/include - /usr/include /sw/include/SDL # Fink /sw/include /opt/local/include/SDL # DarwinPorts @@ -60,8 +58,6 @@ FIND_LIBRARY(SDLIMAGE_LIBRARY PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake index ce1ae9e2c..7cc1a6b09 100644 --- a/Modules/FindSDL_mixer.cmake +++ b/Modules/FindSDL_mixer.cmake @@ -39,8 +39,6 @@ FIND_PATH(SDLMIXER_INCLUDE_DIR SDL_mixer.h /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /usr/local/include - /usr/include /sw/include/SDL # Fink /sw/include /opt/local/include/SDL # DarwinPorts @@ -60,8 +58,6 @@ FIND_LIBRARY(SDLMIXER_LIBRARY PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake index b5ada54b9..ca1de7977 100644 --- a/Modules/FindSDL_net.cmake +++ b/Modules/FindSDL_net.cmake @@ -39,8 +39,6 @@ FIND_PATH(SDLNET_INCLUDE_DIR SDL_net.h /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /usr/local/include - /usr/include /sw/include/SDL # Fink /sw/include /opt/local/include/SDL # DarwinPorts @@ -59,8 +57,6 @@ FIND_LIBRARY(SDLNET_LIBRARY PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake index 8edf6ca05..35294a5e4 100644 --- a/Modules/FindSDL_sound.cmake +++ b/Modules/FindSDL_sound.cmake @@ -86,8 +86,6 @@ FIND_PATH(SDL_SOUND_INCLUDE_DIR SDL_sound.h /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /usr/local/include - /usr/include /sw/include/SDL # Fink /sw/include /opt/local/include/SDL # DarwinPorts @@ -106,8 +104,6 @@ FIND_LIBRARY(SDL_SOUND_LIBRARY $ENV{SDLDIR}/lib $ENV{SDLDIR} PATHS - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -222,8 +218,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -245,8 +239,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -271,8 +263,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -293,8 +283,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -317,8 +305,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -341,8 +327,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -368,8 +352,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -395,8 +377,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake index 3d07ab7a8..184b6c3f5 100644 --- a/Modules/FindSDL_ttf.cmake +++ b/Modules/FindSDL_ttf.cmake @@ -39,8 +39,6 @@ FIND_PATH(SDLTTF_INCLUDE_DIR SDL_ttf.h /usr/local/include/SDL11 # FreeBSD ports /usr/include/SDL12 /usr/include/SDL11 - /usr/local/include - /usr/include /sw/include/SDL # Fink /sw/include /opt/local/include/SDL # DarwinPorts @@ -59,8 +57,6 @@ FIND_LIBRARY(SDLTTF_LIBRARY PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake index b0b6b2f47..48d195a1e 100644 --- a/Modules/FindSquish.cmake +++ b/Modules/FindSquish.cmake @@ -43,18 +43,14 @@ SET(SQUISH_CLIENT_EXECUTABLE_STRING "The squishclient executable program.") # Search only if the location is not already known. IF(NOT SQUISH_INSTALL_DIR) # Get the system search path as a list. - IF(UNIX) - STRING(REGEX MATCHALL "[^:]+" SQUISH_INSTALL_DIR_SEARCH1 "$ENV{PATH}") - ELSE(UNIX) - STRING(REGEX REPLACE "\\\\" "/" SQUISH_INSTALL_DIR_SEARCH1 "$ENV{PATH}") - ENDIF(UNIX) - STRING(REGEX REPLACE "/;" ";" SQUISH_INSTALL_DIR_SEARCH2 ${SQUISH_INSTALL_DIR_SEARCH1}) + 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}") # Look for an installation FIND_PATH(SQUISH_INSTALL_DIR bin/squishrunner diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake index f2c776f97..7f6d3a7ee 100644 --- a/Modules/FindTCL.cmake +++ b/Modules/FindTCL.cmake @@ -82,8 +82,6 @@ SET(TCLTK_POSSIBLE_LIB_PATHS "${TK_LIBRARY_PATH}" "${TCL_TCLSH_PATH_PARENT}/lib" "${TK_WISH_PATH_PARENT}/lib" - /usr/lib - /usr/local/lib ) IF(WIN32) @@ -162,8 +160,6 @@ SET(TCLTK_POSSIBLE_INCLUDE_PATHS ${TK_FRAMEWORK_INCLUDES} "${TCL_TCLSH_PATH_PARENT}/include" "${TK_WISH_PATH_PARENT}/include" - /usr/include - /usr/local/include /usr/include/tcl${TK_LIBRARY_VERSION} /usr/include/tcl${TCL_LIBRARY_VERSION} /usr/include/tcl8.6 diff --git a/Modules/FindTclStub.cmake b/Modules/FindTclStub.cmake index 4db2716de..79d14aeb4 100644 --- a/Modules/FindTclStub.cmake +++ b/Modules/FindTclStub.cmake @@ -66,8 +66,6 @@ SET(TCLTK_POSSIBLE_LIB_PATHS "${TK_LIBRARY_PATH}" "${TCL_TCLSH_PATH_PARENT}/lib" "${TK_WISH_PATH_PARENT}/lib" - /usr/lib - /usr/local/lib ) IF(WIN32) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 0bc617237..865a6c5d1 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -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) +IF(APPLE OR CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") SET(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1) -ENDIF(APPLE) +ENDIF() # DEPRECATED: This is a patch to support the DEPRECATED use of # wxWidgets_USE_LIBS. diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake index f55cf009f..dfb28ff90 100644 --- a/Modules/FindwxWindows.cmake +++ b/Modules/FindwxWindows.cmake @@ -139,7 +139,7 @@ IF(WIN32_STYLE_FIND) ## 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 version s installed. + ## there may be multiple WX versions installed. SET (WXWINDOWS_POSSIBLE_LIB_PATHS "${WXWINDOWS_ROOT_DIR}/lib" ) diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in index 819cc5cc0..43f72f6aa 100644 --- a/Modules/NSIS.template.in +++ b/Modules/NSIS.template.in @@ -637,6 +637,7 @@ Section "-Core installation" ;Use the entire tree produced by the INSTALL target. Keep the ;list of directories here in sync with the RMDir commands below. SetOutPath "$INSTDIR" + @CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS@ @CPACK_NSIS_FULL_INSTALL@ ;Store installation folder @@ -899,6 +900,28 @@ SectionEnd ; "Program Files" for AllUsers, "My Documents" for JustMe... Function .onInit + StrCmp "@CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL@" "ON" 0 inst + + ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "UninstallString" + StrCmp $0 "" inst + + MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \ + "@CPACK_NSIS_PACKAGE_NAME@ is already installed. $\n$\nDo you want to uninstall the old version before installing the new one?" \ + IDYES uninst IDNO inst + Abort + +;Run the uninstaller +uninst: + ClearErrors + ExecWait '$0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file + + IfErrors uninst_failed inst +uninst_failed: + MessageBox MB_OK|MB_ICONSTOP "Uninstall failed." + Abort + + +inst: ; Reads components status for registry !insertmacro SectionList "InitSection" diff --git a/Modules/Platform/BeOS.cmake b/Modules/Platform/BeOS.cmake index 41aa8f742..3ffb67cb8 100644 --- a/Modules/Platform/BeOS.cmake +++ b/Modules/Platform/BeOS.cmake @@ -1,6 +1,8 @@ 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,") diff --git a/Modules/Platform/BlueGeneP-base.cmake b/Modules/Platform/BlueGeneP-base.cmake index 926dbc01e..c0241e19d 100644 --- a/Modules/Platform/BlueGeneP-base.cmake +++ b/Modules/Platform/BlueGeneP-base.cmake @@ -85,11 +85,15 @@ set(CMAKE_DL_LIBS "dl") macro(__BlueGeneP_set_dynamic_flags compiler_id lang) if (${compiler_id} STREQUAL XL) # Flags for XL compilers if we explicitly detected XL + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-qpic") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-qpie") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-qpic") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-qmkshrobj -qnostaticlink") set(BGP_${lang}_DYNAMIC_EXE_FLAGS "-qnostaticlink -qnostaticlink=libgcc") else() # Assume flags for GNU compilers (if the ID is GNU *or* anything else). + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") set(BGP_${lang}_DYNAMIC_EXE_FLAGS "-dynamic") diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake index 5aad45bad..eae313a50 100644 --- a/Modules/Platform/CYGWIN-GNU.cmake +++ b/Modules/Platform/CYGWIN-GNU.cmake @@ -35,7 +35,10 @@ macro(__cygwin_compiler_gnu lang) set(CMAKE_${lang}_LINK_EXECUTABLE " -o -Wl,--out-implib, ${CMAKE_GNULD_IMAGE_VERSION} ") - set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on cygwin + # No -fPIC on cygwin + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "") + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # Initialize C link type selection flags. These flags are used when # building a shared library, shared module, or executable that links diff --git a/Modules/Platform/Darwin-icc.cmake b/Modules/Platform/Darwin-icc.cmake index b62036cfb..b592e5f55 100644 --- a/Modules/Platform/Darwin-icc.cmake +++ b/Modules/Platform/Darwin-icc.cmake @@ -84,11 +84,11 @@ ENDIF(XCODE) SET(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different ") SET(CMAKE_C_CREATE_SHARED_LIBRARY - " -o -install_name ") + " -o ") SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - " -o -install_name ") + " -o ") SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY - " -o -install_name ") + " -o ") SET(CMAKE_CXX_CREATE_SHARED_MODULE " -o ") @@ -106,7 +106,9 @@ SET(CMAKE_Fortran_CREATE_SHARED_MODULE # default to searching for frameworks first -SET(CMAKE_FIND_FRAMEWORK FIRST) +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 ~/Library/Frameworks @@ -115,7 +117,9 @@ SET(CMAKE_SYSTEM_FRAMEWORK_PATH /System/Library/Frameworks) # default to searching for application bundles first -SET(CMAKE_FIND_APPBUNDLE FIRST) +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 ~/Applications @@ -125,4 +129,3 @@ SET(CMAKE_SYSTEM_APPBUNDLE_PATH 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.cmake b/Modules/Platform/Darwin.cmake index f9d37c3af..eff07b295 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -207,11 +207,11 @@ 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 - " -o -install_name ") + " -o ") SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - " -o -install_name ") + " -o ") SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY - " -o -install_name ") + " -o ") SET(CMAKE_CXX_CREATE_SHARED_MODULE " -o ") @@ -223,14 +223,15 @@ SET(CMAKE_Fortran_CREATE_SHARED_MODULE " -o ") SET(CMAKE_C_CREATE_MACOSX_FRAMEWORK - " -o -install_name ") + " -o ") SET(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK - " -o -install_name ") + " -o ") - # default to searching for frameworks first -SET(CMAKE_FIND_FRAMEWORK FIRST) +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 ~/Library/Frameworks @@ -239,7 +240,9 @@ SET(CMAKE_SYSTEM_FRAMEWORK_PATH /System/Library/Frameworks) # default to searching for application bundles first -SET(CMAKE_FIND_APPBUNDLE FIRST) +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 diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake index 033db0659..82fe961fb 100644 --- a/Modules/Platform/FreeBSD.cmake +++ b/Modules/Platform/FreeBSD.cmake @@ -1,6 +1,8 @@ IF(EXISTS /usr/include/dlfcn.h) SET(CMAKE_DL_LIBS "") - SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic + 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 diff --git a/Modules/Platform/HP-UX-HP.cmake b/Modules/Platform/HP-UX-HP.cmake index bce0a8bce..871ea1323 100644 --- a/Modules/Platform/HP-UX-HP.cmake +++ b/Modules/Platform/HP-UX-HP.cmake @@ -19,6 +19,7 @@ endif() set(__HPUX_COMPILER_HP 1) macro(__hpux_compiler_hp lang) + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "+Z") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "+Z") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-Wl,-E,+nodefaultrpath -b -L/usr/lib") set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,+s,-E,+nodefaultrpath") diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake index 8277a247c..9dda3c528 100644 --- a/Modules/Platform/Haiku.cmake +++ b/Modules/Platform/Haiku.cmake @@ -1,6 +1,8 @@ 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,") diff --git a/Modules/Platform/Linux-Intel.cmake b/Modules/Platform/Linux-Intel.cmake index dea8b90dc..47bf24659 100644 --- a/Modules/Platform/Linux-Intel.cmake +++ b/Modules/Platform/Linux-Intel.cmake @@ -31,6 +31,8 @@ if(NOT XIAR) endif(NOT XIAR) macro(__linux_compiler_intel lang) + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") diff --git a/Modules/Platform/Linux-PGI.cmake b/Modules/Platform/Linux-PGI.cmake index ef06acd16..3cbb35c72 100644 --- a/Modules/Platform/Linux-PGI.cmake +++ b/Modules/Platform/Linux-PGI.cmake @@ -20,6 +20,8 @@ set(__LINUX_COMPILER_PGI 1) macro(__linux_compiler_pgi lang) # Shared library compile and link flags. + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") endmacro() diff --git a/Modules/Platform/Linux-PathScale.cmake b/Modules/Platform/Linux-PathScale.cmake index c131af272..d230ab225 100644 --- a/Modules/Platform/Linux-PathScale.cmake +++ b/Modules/Platform/Linux-PathScale.cmake @@ -20,6 +20,8 @@ set(__LINUX_COMPILER_PATHSCALE 1) macro(__linux_compiler_pathscale lang) # Shared library compile and link flags. + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") endmacro() diff --git a/Modules/Platform/MP-RAS.cmake b/Modules/Platform/MP-RAS.cmake index 1e3e2396e..ff22a4fda 100644 --- a/Modules/Platform/MP-RAS.cmake +++ b/Modules/Platform/MP-RAS.cmake @@ -1,6 +1,10 @@ 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*.") diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake index 0fb863619..e1b66b84c 100644 --- a/Modules/Platform/NetBSD.cmake +++ b/Modules/Platform/NetBSD.cmake @@ -1,6 +1,8 @@ IF(EXISTS /usr/include/dlfcn.h) SET(CMAKE_DL_LIBS "") - SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic + 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 diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake index 076410a66..49a30e971 100644 --- a/Modules/Platform/OSF1.cmake +++ b/Modules/Platform/OSF1.cmake @@ -4,7 +4,9 @@ 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_SHARED_LIBRARY_C_FLAGS "-fpic") # -pic + 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.*") diff --git a/Modules/Platform/SINIX.cmake b/Modules/Platform/SINIX.cmake index 4592fdd26..e0809f8e3 100644 --- a/Modules/Platform/SINIX.cmake +++ b/Modules/Platform/SINIX.cmake @@ -1,2 +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) diff --git a/Modules/Platform/SunOS.cmake b/Modules/Platform/SunOS.cmake index 9f2ee2e38..de287aa70 100644 --- a/Modules/Platform/SunOS.cmake +++ b/Modules/Platform/SunOS.cmake @@ -1,6 +1,8 @@ IF(CMAKE_SYSTEM MATCHES "SunOS-4.*") - SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-PIC") - SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-r") + 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.*") @@ -8,7 +10,7 @@ ENDIF(CMAKE_SYSTEM MATCHES "SunOS-4.*") IF(CMAKE_COMPILER_IS_GNUCXX) IF(CMAKE_COMPILER_IS_GNUCC) SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - " -o ") + " -o ") ELSE(CMAKE_COMPILER_IS_GNUCC) # Take default rule from CMakeDefaultMakeRuleVariables.cmake. ENDIF(CMAKE_COMPILER_IS_GNUCC) diff --git a/Modules/Platform/UNIX_SV.cmake b/Modules/Platform/UNIX_SV.cmake index 3b50e0a2d..869b3a6a0 100644 --- a/Modules/Platform/UNIX_SV.cmake +++ b/Modules/Platform/UNIX_SV.cmake @@ -1,3 +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) diff --git a/Modules/Platform/UnixWare.cmake b/Modules/Platform/UnixWare.cmake index c324bc824..3112ee1ef 100644 --- a/Modules/Platform/UnixWare.cmake +++ b/Modules/Platform/UnixWare.cmake @@ -1,3 +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) diff --git a/Modules/Platform/Windows-Embarcadero.cmake b/Modules/Platform/Windows-Embarcadero.cmake index 87b3767cd..62e8eb704 100644 --- a/Modules/Platform/Windows-Embarcadero.cmake +++ b/Modules/Platform/Windows-Embarcadero.cmake @@ -76,7 +76,8 @@ SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_SHARED_LINKER_FLAGS_R macro(__embarcadero_language lang) - set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "${_tD}") + set(CMAKE_${lang}_COMPILE_OPTIONS_DLL "${_tD}") # Note: This variable is a ';' separated list + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "${_tD}") # ... while this is a space separated string. # compile a source file into an object file # place outside the response file because Borland refuses diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index dd476920b..1a2ee5e96 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -77,7 +77,11 @@ macro(__windows_compiler_gnu lang) endforeach(type) endif() - set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on Windows + # No -fPIC on Windows + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "") + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") + set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS ${__WINDOWS_GNU_LD_RESPONSE}) set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 1) diff --git a/Modules/Platform/Windows-Intel-CXX.cmake b/Modules/Platform/Windows-Intel-CXX.cmake index 2845b0ffb..ec5f0aec6 100644 --- a/Modules/Platform/Windows-Intel-CXX.cmake +++ b/Modules/Platform/Windows-Intel-CXX.cmake @@ -1,4 +1,4 @@ include(Platform/Windows-Intel) set(_COMPILE_CXX " /TP") -set(_FLAGS_CXX " /GX /GR") +set(_FLAGS_CXX " /EHsc /GR") __windows_compiler_intel(CXX) diff --git a/Modules/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake index e7462ba9f..2a54a981b 100644 --- a/Modules/Platform/Windows-Intel.cmake +++ b/Modules/Platform/Windows-Intel.cmake @@ -92,7 +92,7 @@ macro(__windows_compiler_intel lang) set(CMAKE_${lang}_LINK_EXECUTABLE " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe -link /implib: ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000${_FLAGS_${lang}}") - set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Od /GZ") + set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Od /RTC1") set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/DNDEBUG /MD /O1") set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/DNDEBUG /MD /O2") set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/DNDEBUG /MD /Zi /O2") diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake index e1140df84..14b3b81d5 100644 --- a/Modules/Platform/Windows-wcl386.cmake +++ b/Modules/Platform/Windows-wcl386.cmake @@ -20,7 +20,8 @@ SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "debug all" ) SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" ) SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" ) -set (CMAKE_SHARED_LIBRARY_C_FLAGS "-bd" ) +set(CMAKE_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" ) diff --git a/Modules/Platform/syllable.cmake b/Modules/Platform/syllable.cmake index 3ce42f6a6..2d11d08b3 100644 --- a/Modules/Platform/syllable.cmake +++ b/Modules/Platform/syllable.cmake @@ -10,7 +10,9 @@ SET(CMAKE_DL_LIBS "dl") -SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic +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,") diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index f327125b2..68f3c8085 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -182,23 +182,31 @@ MACRO (QT4_ADD_RESOURCES outfiles ) GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE) GET_FILENAME_COMPONENT(rc_path ${infile} PATH) SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx) - # 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) - # 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) + 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) + # 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}") + # 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}") + ADD_CUSTOM_COMMAND(OUTPUT ${outfile} COMMAND ${QT_RCC_EXECUTABLE} ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile} @@ -212,9 +220,9 @@ 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) + 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) @@ -233,16 +241,16 @@ MACRO(QT4_ADD_DBUS_INTERFACE _sources _interface _basename) 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}) + QT4_GENERATE_MOC("${_header}" "${_moc}") - SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc}) - MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc}) + LIST(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}") + MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}") ENDMACRO(QT4_ADD_DBUS_INTERFACE) @@ -250,9 +258,10 @@ 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) # get the part before the ".xml" suffix - STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2" _basename ${_current_FILE}) 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) @@ -297,27 +306,27 @@ MACRO(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optional 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(_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} + 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} + ADD_CUSTOM_COMMAND(OUTPUT "${_impl}" "${_header}" COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile} DEPENDS ${_infile} VERBATIM ) ENDIF(_optionalClassName) - QT4_GENERATE_MOC(${_header} ${_moc}) - SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE) - MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc}) + QT4_GENERATE_MOC("${_header}" "${_moc}") + SET_SOURCE_FILES_PROPERTIES("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE) + MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}") - SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc}) + LIST(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}") ENDMACRO(QT4_ADD_DBUS_ADAPTOR) diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake index 84d0afdf2..0b2d1b833 100644 --- a/Modules/UseJava.cmake +++ b/Modules/UseJava.cmake @@ -130,7 +130,7 @@ # Example: # create_javadoc(my_example_doc # PACKAGES com.exmaple.foo com.example.bar -# SOURCEPATH ${CMAKE_CURRENT_SOURCE_PATH} +# SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}" # CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH} # WINDOWTITLE "My example" # DOCTITLE "

My example

" @@ -533,9 +533,9 @@ function (find_jar VARIABLE) endif (${_state} STREQUAL "name") endforeach (arg ${ARGN}) - if (${_jar_names} STREQUAL "") + if (NOT _jar_names) message(FATAL_ERROR "find_jar: No name to search for given") - endif (${_jar_names} STREQUAL "") + endif (NOT _jar_names) foreach (jar_name ${_jar_names}) foreach (version ${_jar_versions}) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index f9d1c0359..2c6bc7665 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -337,6 +337,8 @@ IF (WIN32) cmGlobalVisualStudio11Generator.cxx cmGlobalVisualStudio11Win64Generator.h cmGlobalVisualStudio11Win64Generator.cxx + cmGlobalVisualStudio11ARMGenerator.h + cmGlobalVisualStudio11ARMGenerator.cxx cmGlobalVisualStudioGenerator.cxx cmGlobalVisualStudioGenerator.h cmGlobalWatcomWMakeGenerator.cxx @@ -355,18 +357,18 @@ IF (WIN32) ENDIF(NOT UNIX) ENDIF (WIN32) -# turn on Ninja by default +# Turn on Ninja by default, but disable it +# on platforms where it does not pass all tests. +# Enforce Ninja support by setting CMAKE_USE_NINJA set(_CMAKE_DEFAULT_NINJA_VALUE TRUE) -# turn it off for platforms where it does not pass all the -# tests -if(WIN32 OR APPLE) +if(APPLE) SET(_CMAKE_DEFAULT_NINJA_VALUE FALSE) endif() SET(CMAKE_ENABLE_NINJA ${_CMAKE_DEFAULT_NINJA_VALUE} CACHE BOOL - "Enable the ninja generator for CMake. currently not fully working for Windows or OSX") + "Enable the ninja generator for CMake. When enabled, some CMake tests still fail on OSX") MARK_AS_ADVANCED(CMAKE_ENABLE_NINJA) IF(CMAKE_ENABLE_NINJA) - MESSAGE(STATUS "Enable ninja generator.") + MESSAGE(STATUS "Ninja generator enabled.") SET(SRCS ${SRCS} cmGlobalNinjaGenerator.cxx cmGlobalNinjaGenerator.h @@ -381,8 +383,13 @@ IF(CMAKE_ENABLE_NINJA) cmNinjaUtilityTargetGenerator.h ) ADD_DEFINITIONS(-DCMAKE_USE_NINJA) + 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) + INSTALL_TARGETS(/bin cmcldeps) + ENDIF() ELSE() - MESSAGE(STATUS "Disable ninja generator.") + MESSAGE(STATUS "Ninja generator disabled, enable it with -DCMAKE_ENABLE_NINJA=ON") ENDIF() # create a library used by the command line and the GUI @@ -423,6 +430,9 @@ SET(CTEST_SRCS cmCTest.cxx CTest/cmCTestConfigureHandler.cxx CTest/cmCTestCoverageCommand.cxx CTest/cmCTestCoverageHandler.cxx + CTest/cmParseMumpsCoverage.cxx + CTest/cmParseCacheCoverage.cxx + CTest/cmParseGTMCoverage.cxx CTest/cmParsePHPCoverage.cxx CTest/cmCTestEmptyBinaryDirectoryCommand.cxx CTest/cmCTestGenericHandler.cxx diff --git a/Source/CMakeVersion.bash b/Source/CMakeVersion.bash new file mode 100755 index 000000000..126adba8e --- /dev/null +++ b/Source/CMakeVersion.bash @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Update the version component if it looks like a date or -f is given. +if test "x$1" = "x-f"; then shift ; n='*' ; else n='\{8\}' ; fi +if test "$#" -gt 0; then echo 1>&2 "usage: CMakeVersion.bash [-f]"; exit 1; fi +sed -i -e ' +s/\(^SET(CMake_VERSION_TWEAK\) [0-9]'"$n"'\(.*\)/\1 '"$(date +%Y%m%d)"'\2/ +' "${BASH_SOURCE%/*}/CMakeVersion.cmake" diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake new file mode 100644 index 000000000..f4f94cc2f --- /dev/null +++ b/Source/CMakeVersion.cmake @@ -0,0 +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 0) +SET(CMake_VERSION_RC 1) diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 178a18d2f..fa456deff 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -480,11 +480,16 @@ int cmCPackDebGenerator::createDeb() // Do not end the md5sum file with yet another (invalid) } - cmd = "\""; - cmd += cmakeExecutable; - cmd += "\" -E tar cfz control.tar.gz ./control ./md5sums"; - const char* controlExtra = - this->GetOption("CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA"); + cmd = ""; + if (NULL != this->GetOption("CPACK_DEBIAN_FAKEROOT_EXECUTABLE")) + { + cmd = this->GetOption("CPACK_DEBIAN_FAKEROOT_EXECUTABLE"); + } + cmd += " \""; + cmd += cmakeExecutable; + cmd += "\" -E tar cfz control.tar.gz ./control ./md5sums"; + const char* controlExtra = + this->GetOption("CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA"); if( controlExtra ) { std::vector controlExtraList; diff --git a/Source/CPack/cmCPackDebGenerator.h b/Source/CPack/cmCPackDebGenerator.h index f536c474e..7f2352f15 100644 --- a/Source/CPack/cmCPackDebGenerator.h +++ b/Source/CPack/cmCPackDebGenerator.h @@ -31,6 +31,17 @@ public: cmCPackDebGenerator(); virtual ~cmCPackDebGenerator(); + static bool CanGenerate() + { +#ifdef __APPLE__ + // on MacOS enable CPackDeb iff dpkg is found + return cmSystemTools::FindProgram("dpkg") != "" ? true : false; +#else + // legacy behavior on other systems + return true; +#endif + } + protected: virtual int InitializeInternal(); /** diff --git a/Source/CPack/cmCPackDocumentVariables.cxx b/Source/CPack/cmCPackDocumentVariables.cxx index d2e3802c6..edbef45ef 100644 --- a/Source/CPack/cmCPackDocumentVariables.cxx +++ b/Source/CPack/cmCPackDocumentVariables.cxx @@ -77,4 +77,35 @@ void cmCPackDocumentVariables::DefineVariables(cmake* cm) "which is done right before packaging the files." " The script is not called by e.g.: make install.", false, "Variables common to all CPack generators"); + + cm->DefineProperty + ("CPACK_ABSOLUTE_DESTINATION_FILES", cmProperty::VARIABLE, + "List of files which have been installed using " + " an ABSOLUTE DESTINATION path.", + "This variable is a Read-Only variable which is set internally" + " by CPack during installation and before packaging using" + " CMAKE_ABSOLUTE_DESTINATION_FILES defined in cmake_install.cmake " + "scripts. The value can be used within CPack project configuration" + " file and/or CPack.cmake file of generator.", false, + "Variables common to all CPack generators"); + + cm->DefineProperty + ("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE, + "Ask CPack to warn each time a file with absolute INSTALL" + " DESTINATION is encountered.", + "This variable triggers the definition of " + "CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION when CPack runs" + " cmake_install.cmake scripts.", false, + "Variables common to all CPack generators"); + + cm->DefineProperty + ("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE, + "Ask CPack to error out as soon as a file with absolute INSTALL" + " DESTINATION is encountered.", + "The fatal error is emitted before the installation of " + "the offending file takes place. Some CPack generators, like NSIS," + "enforce this internally. " + "This variable triggers the definition of" + "CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION when CPack runs" + "Variables common to all CPack generators"); } diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 0f832b395..0177653f5 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -62,10 +62,31 @@ void cmCPackGenerator::DisplayVerboseOutput(const char* msg, //---------------------------------------------------------------------- int cmCPackGenerator::PrepareNames() -{ +{ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Create temp directory." << std::endl); + // checks CPACK_SET_DESTDIR support + if (IsOn("CPACK_SET_DESTDIR")) + { + if (SETDESTDIR_UNSUPPORTED==SupportsSetDestdir()) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "CPACK_SET_DESTDIR is set to ON but the '" + << Name << "' generator does NOT support it." + << std::endl); + return 0; + } + else if (SETDESTDIR_SHOULD_NOT_BE_USED==SupportsSetDestdir()) + { + cmCPackLogger(cmCPackLog::LOG_WARNING, + "CPACK_SET_DESTDIR is set to ON but it is " + << "usually a bad idea to do that with '" + << Name << "' generator. Use at your own risk." + << std::endl); + } + } + std::string tempDirectory = this->GetOption("CPACK_PACKAGE_DIRECTORY"); tempDirectory += "/_CPack_Packages/"; const char* toplevelTag = this->GetOption("CPACK_TOPLEVEL_TAG"); @@ -388,8 +409,11 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( std::string>(targetFile,inFileRelative)); } /* If it is not a symlink then do a plain copy */ - else if ( !cmSystemTools::CopyFileIfDifferent(inFile.c_str(), - filePath.c_str()) ) + else if (!( + cmSystemTools::CopyFileIfDifferent(inFile.c_str(),filePath.c_str()) + && + cmSystemTools::CopyFileTime(inFile.c_str(),filePath.c_str()) + ) ) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying file: " << inFile.c_str() << " -> " << filePath.c_str() << std::endl); @@ -828,8 +852,35 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( filesBefore = glB.GetFiles(); std::sort(filesBefore.begin(),filesBefore.end()); } + + // If CPack was asked to warn on ABSOLUTE INSTALL DESTINATION + // then forward request to cmake_install.cmake script + if (this->GetOption("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION")) + { + mf->AddDefinition("CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION", + "1"); + } + // If current CPack generator does support + // ABSOLUTE INSTALL DESTINATION or CPack has been asked for + // then ask cmake_install.cmake script to error out + // as soon as it occurs (before installing file) + if (!SupportsAbsoluteDestination() || + this->GetOption("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION")) + { + mf->AddDefinition("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", + "1"); + } // do installation int res = mf->ReadListFile(0, installFile.c_str()); + // forward definition of CMAKE_ABSOLUTE_DESTINATION_FILES + // to CPack (may be used by generators like CPack RPM or DEB) + // in order to transparently handle ABSOLUTE PATH + if (mf->GetDefinition("CMAKE_ABSOLUTE_DESTINATION_FILES")) + { + mf->AddDefinition("CPACK_ABSOLUTE_DESTINATION_FILES", + mf->GetDefinition("CMAKE_ABSOLUTE_DESTINATION_FILES")); + } + // Now rebuild the list of files after installation // of the current component (if we are in component install) if (componentInstall) @@ -953,6 +1004,8 @@ int cmCPackGenerator::DoPackage() cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Create package using " << this->Name.c_str() << std::endl); + // Prepare CPack internal name and check + // values for many CPACK_xxx vars if ( !this->PrepareNames() ) { return 0; @@ -1430,6 +1483,19 @@ std::string cmCPackGenerator::GetComponentPackageFileName( return initialPackageFileName + suffix; } +//---------------------------------------------------------------------- +enum cmCPackGenerator::CPackSetDestdirSupport +cmCPackGenerator::SupportsSetDestdir() const +{ + return cmCPackGenerator::SETDESTDIR_SUPPORTED; +} + +//---------------------------------------------------------------------- +bool cmCPackGenerator::SupportsAbsoluteDestination() const +{ + return true; +} + //---------------------------------------------------------------------- bool cmCPackGenerator::SupportsComponentInstallation() const { diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 55afb4489..6748512d2 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -62,6 +62,16 @@ public: { this->GeneratorVerbose = val ? cmSystemTools::OUTPUT_MERGE : cmSystemTools::OUTPUT_NONE; } + /** + * Returns true if the generator may work on this system. + * Rational: + * Some CPack generator may run on some host and may not on others + * (with the same system) because some tools are missing. If the tool + * is missing then CPack won't activate (in the CPackGeneratorFactory) + * this particular generator. + */ + static bool CanGenerate() { return true; } + /** * Do the actual whole package processing. * Subclass may redefine it but its usually enough @@ -189,6 +199,38 @@ protected: virtual int InstallProjectViaInstallCMakeProjects( bool setDestDir, const char* tempInstallDirectory); + /** + * The various level of support of + * CPACK_SET_DESTDIR used by the generator. + */ + enum CPackSetDestdirSupport { + /* the generator works with or without it */ + SETDESTDIR_SUPPORTED, + /* the generator works best if automatically handled */ + SETDESTDIR_INTERNALLY_SUPPORTED, + /* no official support, use at your own risk */ + SETDESTDIR_SHOULD_NOT_BE_USED, + /* officially NOT supported */ + SETDESTDIR_UNSUPPORTED + }; + + /** + * Does the CPack generator support CPACK_SET_DESTDIR? + * The default legacy value is 'SETDESTDIR_SUPPORTED' generator + * have to override it in order change this. + * @return CPackSetDestdirSupport + */ + virtual enum CPackSetDestdirSupport SupportsSetDestdir() const; + + /** + * Does the CPack generator support absolute path + * in INSTALL DESTINATION? + * The default legacy value is 'true' generator + * have to override it in order change this. + * @return true if supported false otherwise + */ + virtual bool SupportsAbsoluteDestination() const; + /** * Does the CPack generator support component installation?. * Some Generators requires the user to set diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index a04b40394..37ff46041 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -31,7 +31,7 @@ # include "cmCPackCygwinSourceGenerator.h" #endif -#if !defined(_WIN32) && !defined(__APPLE__) \ +#if !defined(_WIN32) \ && !defined(__QNXNTO__) && !defined(__BEOS__) # include "cmCPackDebGenerator.h" # include "cmCPackRPMGenerator.h" @@ -40,44 +40,90 @@ #include "cmCPackLog.h" +#if defined(__BORLANDC__) +# pragma warn -8008 /* condition is always true */ +#endif + //---------------------------------------------------------------------- cmCPackGeneratorFactory::cmCPackGeneratorFactory() { - this->RegisterGenerator("TGZ", "Tar GZip compression", - cmCPackTGZGenerator::CreateGenerator); - this->RegisterGenerator("STGZ", "Self extracting Tar GZip compression", - cmCPackSTGZGenerator::CreateGenerator); - this->RegisterGenerator("NSIS", "Null Soft Installer", - cmCPackNSISGenerator::CreateGenerator); + if (cmCPackTGZGenerator::CanGenerate()) + { + this->RegisterGenerator("TGZ", "Tar GZip compression", + cmCPackTGZGenerator::CreateGenerator); + } + if (cmCPackSTGZGenerator::CanGenerate()) + { + this->RegisterGenerator("STGZ", "Self extracting Tar GZip compression", + cmCPackSTGZGenerator::CreateGenerator); + } + if (cmCPackNSISGenerator::CanGenerate()) + { + this->RegisterGenerator("NSIS", "Null Soft Installer", + cmCPackNSISGenerator::CreateGenerator); + } #ifdef __CYGWIN__ - this->RegisterGenerator("CygwinBinary", "Cygwin Binary Installer", - cmCPackCygwinBinaryGenerator::CreateGenerator); - this->RegisterGenerator("CygwinSource", "Cygwin Source Installer", - cmCPackCygwinSourceGenerator::CreateGenerator); + if (cmCPackCygwinBinaryGenerator::CanGenerate()) + { + this->RegisterGenerator("CygwinBinary", "Cygwin Binary Installer", + cmCPackCygwinBinaryGenerator::CreateGenerator); + } + if (cmCPackCygwinSourceGenerator::CanGenerate()) + { + this->RegisterGenerator("CygwinSource", "Cygwin Source Installer", + cmCPackCygwinSourceGenerator::CreateGenerator); + } #endif - this->RegisterGenerator("ZIP", "ZIP file format", - cmCPackZIPGenerator::CreateGenerator); - this->RegisterGenerator("TBZ2", "Tar BZip2 compression", - cmCPackTarBZip2Generator::CreateGenerator); - this->RegisterGenerator("TZ", "Tar Compress compression", - cmCPackTarCompressGenerator::CreateGenerator); + if (cmCPackZIPGenerator::CanGenerate()) + { + this->RegisterGenerator("ZIP", "ZIP file format", + cmCPackZIPGenerator::CreateGenerator); + } + if (cmCPackTarBZip2Generator::CanGenerate()) + { + this->RegisterGenerator("TBZ2", "Tar BZip2 compression", + cmCPackTarBZip2Generator::CreateGenerator); + } + if (cmCPackTarCompressGenerator::CanGenerate()) + { + this->RegisterGenerator("TZ", "Tar Compress compression", + cmCPackTarCompressGenerator::CreateGenerator); + } #ifdef __APPLE__ - this->RegisterGenerator("DragNDrop", "Mac OSX Drag And Drop", - cmCPackDragNDropGenerator::CreateGenerator); - this->RegisterGenerator("Bundle", "Mac OSX bundle", - cmCPackBundleGenerator::CreateGenerator); - this->RegisterGenerator("PackageMaker", "Mac OSX Package Maker installer", - cmCPackPackageMakerGenerator::CreateGenerator); - this->RegisterGenerator("OSXX11", "Mac OSX X11 bundle", - cmCPackOSXX11Generator::CreateGenerator); + if (cmCPackDragNDropGenerator::CanGenerate()) + { + this->RegisterGenerator("DragNDrop", "Mac OSX Drag And Drop", + cmCPackDragNDropGenerator::CreateGenerator); + } + if (cmCPackBundleGenerator::CanGenerate()) + { + this->RegisterGenerator("Bundle", "Mac OSX bundle", + cmCPackBundleGenerator::CreateGenerator); + } + if (cmCPackPackageMakerGenerator::CanGenerate()) + { + this->RegisterGenerator("PackageMaker", "Mac OSX Package Maker installer", + cmCPackPackageMakerGenerator::CreateGenerator); + } + if (cmCPackOSXX11Generator::CanGenerate()) + { + this->RegisterGenerator("OSXX11", "Mac OSX X11 bundle", + cmCPackOSXX11Generator::CreateGenerator); + } #endif -#if !defined(_WIN32) && !defined(__APPLE__) \ +#if !defined(_WIN32) \ && !defined(__QNXNTO__) && !defined(__BEOS__) - this->RegisterGenerator("DEB", "Debian packages", - cmCPackDebGenerator::CreateGenerator); - this->RegisterGenerator("RPM", "RPM packages", - cmCPackRPMGenerator::CreateGenerator); + if (cmCPackDebGenerator::CanGenerate()) + { + this->RegisterGenerator("DEB", "Debian packages", + cmCPackDebGenerator::CreateGenerator); + } + if (cmCPackRPMGenerator::CanGenerate()) + { + this->RegisterGenerator("RPM", "RPM packages", + cmCPackRPMGenerator::CreateGenerator); + } #endif } diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 0787ef901..7b5251148 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -64,6 +64,7 @@ int cmCPackNSISGenerator::PackageFiles() << std::endl); return false; } + std::string nsisFileName = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); std::string tmpFile = nsisFileName; tmpFile += "/NSISOutput.log"; @@ -542,8 +543,8 @@ void cmCPackNSISGenerator::CreateMenuLinks( cmOStringStream& str, { cmCPackLogger( cmCPackLog::LOG_ERROR, - "CPACK_PACKAGE_EXECUTABLES should contain pairs of and " - "." << std::endl); + "CPACK_NSIS_MENU_LINKS should contain pairs of and " + "." << std::endl); return; } @@ -630,6 +631,19 @@ bool cmCPackNSISGenerator::GetListOfSubdirectories(const char* topdir, return true; } +//---------------------------------------------------------------------- +enum cmCPackGenerator::CPackSetDestdirSupport +cmCPackNSISGenerator::SupportsSetDestdir() const +{ + return cmCPackGenerator::SETDESTDIR_SHOULD_NOT_BE_USED; +} + +//---------------------------------------------------------------------- +bool cmCPackNSISGenerator::SupportsAbsoluteDestination() const +{ + return false; +} + //---------------------------------------------------------------------- bool cmCPackNSISGenerator::SupportsComponentInstallation() const { diff --git a/Source/CPack/cmCPackNSISGenerator.h b/Source/CPack/cmCPackNSISGenerator.h index 7bccb89fb..82248546f 100644 --- a/Source/CPack/cmCPackNSISGenerator.h +++ b/Source/CPack/cmCPackNSISGenerator.h @@ -44,6 +44,8 @@ protected: bool GetListOfSubdirectories(const char* dir, std::vector& dirs); + enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const; + virtual bool SupportsAbsoluteDestination() const; virtual bool SupportsComponentInstallation() const; /// Produce a string that contains the NSIS code to describe a diff --git a/Source/CPack/cmCPackRPMGenerator.h b/Source/CPack/cmCPackRPMGenerator.h index 4883a0d60..eec8204da 100644 --- a/Source/CPack/cmCPackRPMGenerator.h +++ b/Source/CPack/cmCPackRPMGenerator.h @@ -35,6 +35,17 @@ public: cmCPackRPMGenerator(); virtual ~cmCPackRPMGenerator(); + static bool CanGenerate() + { +#ifdef __APPLE__ + // on MacOS enable CPackRPM iff rpmbuild is found + return cmSystemTools::FindProgram("rpmbuild") != "" ? true : false; +#else + // legacy behavior on other systems + return true; +#endif + } + protected: virtual int InitializeInternal(); virtual int PackageFiles(); diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx index 36302df19..381c70ce5 100644 --- a/Source/CTest/cmCTestBZR.cxx +++ b/Source/CTest/cmCTestBZR.cxx @@ -128,13 +128,12 @@ class cmCTestBZR::RevnoParser: public cmCTestVC::LineParser { public: RevnoParser(cmCTestBZR* bzr, const char* prefix, std::string& rev): - BZR(bzr), Rev(rev) + Rev(rev) { this->SetLog(&bzr->Log, prefix); this->RegexRevno.compile("^([0-9]+)$"); } private: - cmCTestBZR* BZR; std::string& Rev; cmsys::RegularExpression RegexRevno; virtual bool ProcessLine() diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 309abb16d..81d366937 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -11,6 +11,8 @@ ============================================================================*/ #include "cmCTestCoverageHandler.h" #include "cmParsePHPCoverage.h" +#include "cmParseGTMCoverage.h" +#include "cmParseCacheCoverage.h" #include "cmCTest.h" #include "cmake.h" #include "cmMakefile.h" @@ -373,21 +375,29 @@ int cmCTestCoverageHandler::ProcessHandler() } int file_count = 0; file_count += this->HandleGCovCoverage(&cont); + error = cont.Error; if ( file_count < 0 ) { return error; } file_count += this->HandleTracePyCoverage(&cont); + error = cont.Error; if ( file_count < 0 ) { return error; } file_count += this->HandlePHPCoverage(&cont); + error = cont.Error; if ( file_count < 0 ) { return error; } + file_count += this->HandleMumpsCoverage(&cont); error = cont.Error; + if ( file_count < 0 ) + { + return error; + } std::set uncovered = this->FindUncoveredFiles(&cont); @@ -751,6 +761,73 @@ int cmCTestCoverageHandler::HandlePHPCoverage( } return static_cast(cont->TotalCoverage.size()); } +//---------------------------------------------------------------------- +int cmCTestCoverageHandler::HandleMumpsCoverage( + cmCTestCoverageHandlerContainer* cont) +{ + // try gtm coverage + cmParseGTMCoverage cov(*cont, this->CTest); + std::string coverageFile = this->CTest->GetBinaryDir() + + "/gtm_coverage.mcov"; + if(cmSystemTools::FileExists(coverageFile.c_str())) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Parsing Cache Coverage: " << coverageFile + << std::endl); + cov.ReadCoverageFile(coverageFile.c_str()); + return static_cast(cont->TotalCoverage.size()); + } + else + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + " Cannot find foobar GTM coverage file: " << coverageFile + << std::endl); + } + cmParseCacheCoverage ccov(*cont, this->CTest); + coverageFile = this->CTest->GetBinaryDir() + + "/cache_coverage.cmcov"; + if(cmSystemTools::FileExists(coverageFile.c_str())) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Parsing Cache Coverage: " << coverageFile + << std::endl); + ccov.ReadCoverageFile(coverageFile.c_str()); + } + else + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + " Cannot find Cache coverage file: " << coverageFile + << std::endl); + } + return static_cast(cont->TotalCoverage.size()); +} + +struct cmCTestCoverageHandlerLocale +{ + cmCTestCoverageHandlerLocale() + { + if(const char* l = cmSystemTools::GetEnv("LC_ALL")) + { + lc_all = l; + } + if(lc_all != "C") + { + cmSystemTools::PutEnv("LC_ALL=C"); + } + } + ~cmCTestCoverageHandlerLocale() + { + if(!lc_all.empty()) + { + cmSystemTools::PutEnv(("LC_ALL=" + lc_all).c_str()); + } + else + { + cmSystemTools::UnsetEnv("LC_ALL"); + } + } + std::string lc_all; +}; //---------------------------------------------------------------------- int cmCTestCoverageHandler::HandleGCovCoverage( @@ -773,7 +850,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( std::string st2gcovOutputRex1 = "^File *[`'](.*)'$"; std::string st2gcovOutputRex2 = "Lines executed: *[0-9]+\\.[0-9]+% of [0-9]+$"; - std::string st2gcovOutputRex3 = "^(.*):creating [`'](.*\\.gcov)'"; + std::string st2gcovOutputRex3 = "^(.*)reating [`'](.*\\.gcov)'"; std::string st2gcovOutputRex4 = "^(.*):unexpected EOF *$"; std::string st2gcovOutputRex5 = "^(.*):cannot open source file*$"; std::string st2gcovOutputRex6 @@ -815,7 +892,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( int file_count = 0; // make sure output from gcov is in English! - cmSystemTools::PutEnv("LC_ALL=POSIX"); + cmCTestCoverageHandlerLocale locale_C; + static_cast(locale_C); // files is a list of *.da and *.gcda files with coverage data in them. // These are binary files that you give as input to gcov so that it will @@ -1778,7 +1856,7 @@ int cmCTestCoverageHandler::HandleBullseyeCoverage( cmCTestCoverageHandlerContainer* cont) { const char* covfile = cmSystemTools::GetEnv("COVFILE"); - if(!covfile) + if(!covfile || strlen(covfile) == 0) { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " COVFILE environment variable not found, not running " diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h index d3e8503e1..92b0b2285 100644 --- a/Source/CTest/cmCTestCoverageHandler.h +++ b/Source/CTest/cmCTestCoverageHandler.h @@ -70,6 +70,8 @@ private: //! Handle coverage using xdebug php coverage int HandlePHPCoverage(cmCTestCoverageHandlerContainer* cont); + //! Handle coverage for mumps + int HandleMumpsCoverage(cmCTestCoverageHandlerContainer* cont); //! Handle coverage using Bullseye int HandleBullseyeCoverage(cmCTestCoverageHandlerContainer* cont); diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 035aaa9f9..3e4ecddaa 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -358,7 +358,7 @@ void cmCTestMemCheckHandler::GenerateDartOutput(std::ostream& os) os << "\t\t\n" - << logTag << memcheckstr << std::endl + << logTag << cmXMLSafe(memcheckstr) << std::endl << "\t\n"; this->WriteTestResultFooter(os, result); if ( current < cc ) diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 81f18b05c..c3de5dcf6 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -671,7 +671,7 @@ bool cmCTestRunTest::ForkProcess(double testTimeOut, bool explicitTimeout, if (environment && environment->size()>0) { - cmSystemTools::AppendEnv(environment); + cmSystemTools::AppendEnv(*environment); } return this->TestProcess->StartProcess(); diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 5841b8d42..d3ab2efda 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -643,11 +643,7 @@ int cmCTestScriptHandler::RunCurrentScript() { std::vector envArgs; cmSystemTools::ExpandListArgument(this->CTestEnv.c_str(),envArgs); - // for each variable/argument do a putenv - for (unsigned i = 0; i < envArgs.size(); ++i) - { - cmSystemTools::PutEnv(envArgs[i].c_str()); - } + cmSystemTools::AppendEnv(envArgs); } // now that we have done most of the error checking finally run the diff --git a/Source/CTest/cmParseCacheCoverage.cxx b/Source/CTest/cmParseCacheCoverage.cxx new file mode 100644 index 000000000..137f344df --- /dev/null +++ b/Source/CTest/cmParseCacheCoverage.cxx @@ -0,0 +1,220 @@ +#include "cmStandardIncludes.h" +#include +#include +#include "cmSystemTools.h" +#include "cmParseCacheCoverage.h" +#include +#include + + +cmParseCacheCoverage::cmParseCacheCoverage( + cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest) + :cmParseMumpsCoverage(cont, ctest) +{ +} + + +bool cmParseCacheCoverage::LoadCoverageData(const char* d) +{ + // load all the .mcov files in the specified directory + cmsys::Directory dir; + if(!dir.Load(d)) + { + return false; + } + size_t numf; + unsigned int i; + numf = dir.GetNumberOfFiles(); + for (i = 0; i < numf; i++) + { + std::string file = dir.GetFile(i); + if(file != "." && file != ".." + && !cmSystemTools::FileIsDirectory(file.c_str())) + { + std::string path = d; + path += "/"; + path += file; + if(cmSystemTools::GetFilenameLastExtension(path) == ".cmcov") + { + if(!this->ReadCMCovFile(path.c_str())) + { + return false; + } + } + } + } + return true; +} + +// not currently used, but leave it in case we want it in the future +void cmParseCacheCoverage::RemoveUnCoveredFiles() +{ + // loop over the coverage data computed and remove all files + // that only have -1 or 0 for the lines. + cmCTestCoverageHandlerContainer::TotalCoverageMap::iterator ci = + this->Coverage.TotalCoverage.begin(); + while(ci != this->Coverage.TotalCoverage.end()) + { + cmCTestCoverageHandlerContainer::SingleFileCoverageVector& v = + ci->second; + bool nothing = true; + for(cmCTestCoverageHandlerContainer::SingleFileCoverageVector::iterator i= + v.begin(); i != v.end(); ++i) + { + if(*i > 0) + { + nothing = false; + break; + } + } + if(nothing) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "No coverage found in: " << ci->first + << std::endl); + this->Coverage.TotalCoverage.erase(ci++); + } + else + { + ++ci; + } + } +} + +bool cmParseCacheCoverage::SplitString(std::vector& args, + std::string const& line) +{ + std::string::size_type pos1 = 0; + std::string::size_type pos2 = line.find(',', 0); + if(pos2 == std::string::npos) + { + return false; + } + std::string arg; + while(pos2 != std::string::npos) + { + arg = line.substr(pos1, pos2-pos1); + args.push_back(arg); + pos1 = pos2+1; + pos2 = line.find(',',pos1); + } + arg = line.substr(pos1); + args.push_back(arg); + return true; +} + +bool cmParseCacheCoverage::ReadCMCovFile(const char* file) +{ + std::ifstream in(file); + if(!in) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Can not open : " + << file << "\n"); + return false; + } + std::string line; + std::vector separateLine; + if(!cmSystemTools::GetLineFromStream(in, line)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Empty file : " + << file << " referenced in this line of cmcov data:\n" + "[" << line << "]\n"); + return false; + } + separateLine.clear(); + this->SplitString(separateLine, line); + if(separateLine.size() !=4 || separateLine[0] != "Routine" + || separateLine[1] != "Line" || separateLine[2] != "RtnLine" + || separateLine[3] != "Code") + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Bad first line of cmcov file : " + << file << " line:\n" + "[" << line << "]\n"); + } + std::string routine; + std::string filepath; + while(cmSystemTools::GetLineFromStream(in, line)) + { + // clear out line argument vector + separateLine.clear(); + // parse the comma separated line + this->SplitString(separateLine, line); + // might have more because code could have a quoted , in it + // but we only care about the first 3 args anyway + if(separateLine.size() < 4) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Bad line of cmcov file expected at least 4 found: " + << separateLine.size() << " " + << file << " line:\n" + "[" << line << "]\n"); + for(std::string::size_type i = 0; i < separateLine.size(); ++i) + { + cmCTestLog(this->CTest, ERROR_MESSAGE,"" + << separateLine[1] << " "); + } + cmCTestLog(this->CTest, ERROR_MESSAGE, "\n"); + return false; + } + // if we do not have a routine yet, then it should be + // the first argument in the vector + if(routine.size() == 0) + { + routine = separateLine[0]; + // Find the full path to the file + if(!this->FindMumpsFile(routine, filepath)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Could not find mumps file for routine: " + << routine << "\n"); + filepath = ""; + continue; // move to next line + } + } + // if we have a routine name, check for end of routine + else + { + // Totals in arg 0 marks the end of a routine + if(separateLine[0].substr(0, 6) == "Totals") + { + routine = ""; // at the end of this routine + filepath = ""; + continue; // move to next line + } + } + // if the file path was not found for the routine + // move to next line. We should have already warned + // after the call to FindMumpsFile that we did not find + // it, so don't report again to cut down on output + if(filepath.size() == 0) + { + continue; + } + // now we are ready to set the coverage from the line of data + cmCTestCoverageHandlerContainer::SingleFileCoverageVector& + coverageVector = this->Coverage.TotalCoverage[filepath]; + std::string::size_type linenumber = atoi(separateLine[1].c_str()) -1; + int count = atoi(separateLine[2].c_str()); + if(linenumber > coverageVector.size()) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Parse error line is greater than number of lines in file: " + << linenumber << " " << filepath << "\n"); + continue; // skip setting count to avoid crash + } + // now add to count for linenumber + // for some reason the cache coverage adds extra lines to the + // end of the file in some cases. Since they do not exist, we will + // mark them as non executable + while(linenumber >= coverageVector.size()) + { + coverageVector.push_back(-1); + } + coverageVector[linenumber] += count; + } + return true; +} diff --git a/Source/CTest/cmParseCacheCoverage.h b/Source/CTest/cmParseCacheCoverage.h new file mode 100644 index 000000000..114eb92d3 --- /dev/null +++ b/Source/CTest/cmParseCacheCoverage.h @@ -0,0 +1,42 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc. + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ + +#ifndef cmParseCacheCoverage_h +#define cmParseCacheCoverage_h + +#include "cmParseMumpsCoverage.h" + +/** \class cmParseCacheCoverage + * \brief Parse Cache coverage information + * + * This class is used to parse Cache coverage information for + * mumps. + */ +class cmParseCacheCoverage : public cmParseMumpsCoverage +{ +public: + cmParseCacheCoverage(cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest); +protected: + // implement virtual from parent + bool LoadCoverageData(const char* dir); + // remove files with no coverage + void RemoveUnCoveredFiles(); + // Read a single mcov file + bool ReadCMCovFile(const char* f); + // split a string based on , + bool SplitString(std::vector& args, + std::string const& line); +}; + + +#endif diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx new file mode 100644 index 000000000..5dfcfe50a --- /dev/null +++ b/Source/CTest/cmParseGTMCoverage.cxx @@ -0,0 +1,272 @@ +#include "cmStandardIncludes.h" +#include +#include +#include "cmSystemTools.h" +#include "cmParseGTMCoverage.h" +#include +#include + + +cmParseGTMCoverage::cmParseGTMCoverage(cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest) + :cmParseMumpsCoverage(cont, ctest) +{ +} + + +bool cmParseGTMCoverage::LoadCoverageData(const char* d) +{ + // load all the .mcov files in the specified directory + cmsys::Directory dir; + if(!dir.Load(d)) + { + return false; + } + size_t numf; + unsigned int i; + numf = dir.GetNumberOfFiles(); + for (i = 0; i < numf; i++) + { + std::string file = dir.GetFile(i); + if(file != "." && file != ".." + && !cmSystemTools::FileIsDirectory(file.c_str())) + { + std::string path = d; + path += "/"; + path += file; + if(cmSystemTools::GetFilenameLastExtension(path) == ".mcov") + { + if(!this->ReadMCovFile(path.c_str())) + { + return false; + } + } + } + } + return true; +} + +bool cmParseGTMCoverage::ReadMCovFile(const char* file) +{ + std::ifstream in(file); + if(!in) + { + return false; + } + std::string line; + std::string lastfunction; + std::string lastroutine; + std::string lastpath; + int lastoffset = 0; + while( cmSystemTools::GetLineFromStream(in, line)) + { + // only look at lines that have coverage data + if(line.find("^ZZCOVERAGE") == line.npos) + { + continue; + } + std::string filepath; + std::string function; + std::string routine; + int linenumber = 0; + int count = 0; + this->ParseMCOVLine(line, routine, function, linenumber, count); + // skip this one + if(routine == "RSEL") + { + continue; + } + // no need to search the file if we just did it + if(function == lastfunction && lastroutine == routine) + { + if(lastpath.size()) + { + this->Coverage.TotalCoverage[lastpath][lastoffset + linenumber] + += count; + } + else + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Can not find mumps file : " + << lastroutine << + " referenced in this line of mcov data:\n" + "[" << line << "]\n"); + } + continue; + } + // Find the full path to the file + bool found = this->FindMumpsFile(routine, filepath); + if(found) + { + int lineoffset; + if(this->FindFunctionInMumpsFile(filepath, + function, + lineoffset)) + { + cmCTestCoverageHandlerContainer::SingleFileCoverageVector& + coverageVector = this->Coverage.TotalCoverage[filepath]; + coverageVector[lineoffset + linenumber] += count; + } + lastoffset = lineoffset; + } + else + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Can not find mumps file : " + << routine << " referenced in this line of mcov data:\n" + "[" << line << "]\n"); + } + lastfunction = function; + lastroutine = routine; + lastpath = filepath; + } + return true; +} + +bool cmParseGTMCoverage::FindFunctionInMumpsFile(std::string const& filepath, + std::string const& function, + int& lineoffset) +{ + std::ifstream in(filepath.c_str()); + if(!in) + { + return false; + } + std::string line; + int linenum = 0; + while( cmSystemTools::GetLineFromStream(in, line)) + { + std::string::size_type pos = line.find(function.c_str()); + if(pos == 0) + { + char nextchar = line[function.size()]; + if(nextchar == ' ' || nextchar == '(') + { + lineoffset = linenum; + return true; + } + } + if(pos == 1) + { + char prevchar = line[0]; + char nextchar = line[function.size()+1]; + if(prevchar == '%' && (nextchar == ' ' || nextchar == '(')) + { + lineoffset = linenum; + return true; + } + } + linenum++; // move to next line count + } + lineoffset = 0; + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Could not find entry point : " + << function << " in " << filepath << "\n"); + return false; +} + +bool cmParseGTMCoverage::ParseMCOVLine(std::string const& line, + std::string& routine, + std::string& function, + int& linenumber, + int& count) +{ + // this method parses lines from the .mcov file + // each line has ^COVERAGE(...) in it, and there + // are several varients of coverage lines: + // + // ^COVERAGE("DIC11","PR1",0)="2:0:0:0" + // ( file , entry, line ) = "number_executed:timing_info" + // ^COVERAGE("%RSEL","SRC")="1:0:0:0" + // ( file , entry ) = "number_executed:timing_info" + // ^COVERAGE("%RSEL","init",8,"FOR_LOOP",1)=1 + // ( file , entry, line, IGNORE ) =number_executed + std::vector args; + std::string::size_type pos = line.find('(', 0); + // if no ( is found, then return line has no coverage + if(pos == std::string::npos) + { + return false; + } + std::string arg; + bool done = false; + // separate out all of the comma separated arguments found + // in the COVERAGE(...) line + while(line[pos] && !done) + { + // save the char we are looking at + char cur = line[pos]; + // , or ) means end of argument + if(cur == ',' || cur == ')') + { + // save the argument into the argument vector + args.push_back(arg); + // start on a new argument + arg = ""; + // if we are at the end of the ), then finish while loop + if(cur == ')') + { + done = true; + } + } + else + { + // all chars except ", (, and % get stored in the arg string + if(cur != '\"' && cur != '(' && cur != '%') + { + arg.append(1, line[pos]); + } + } + // move to next char + pos++; + } + // now parse the right hand side of the = + pos = line.find('='); + // no = found, this is an error + if(pos == line.npos) + { + return false; + } + pos++; // move past = + + // if the next positing is not a ", then this is a + // COVERAGE(..)=count line and turn the rest of the string + // past the = into an integer and set it to count + if(line[pos] != '\"') + { + count = atoi(line.substr(pos).c_str()); + } + else + { + // this means line[pos] is a ", and we have a + // COVERAGE(...)="1:0:0:0" type of line + pos++; // move past " + // find the first : past the " + std::string::size_type pos2 = line.find(':', pos); + // turn the string between the " and the first : into an integer + // and set it to count + count = atoi(line.substr(pos, pos2-pos).c_str()); + } + // less then two arguments is an error + if(args.size() < 2) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error parsing mcov line: [" << line << "]\n"); + return false; + } + routine = args[0]; // the routine is the first argument + function = args[1]; // the function in the routine is the second + // in the two argument only format + // ^COVERAGE("%RSEL","SRC"), the line offset is 0 + if(args.size() == 2) + { + linenumber = 0; + } + else + { + // this is the format for this line + // ^COVERAGE("%RSEL","SRC",count) + linenumber = atoi(args[2].c_str()); + } + return true; +} diff --git a/Source/CTest/cmParseGTMCoverage.h b/Source/CTest/cmParseGTMCoverage.h new file mode 100644 index 000000000..c6d7ef919 --- /dev/null +++ b/Source/CTest/cmParseGTMCoverage.h @@ -0,0 +1,49 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc. + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ + +#ifndef cmParseGTMCoverage_h +#define cmParseGTMCoverage_h + +#include "cmParseMumpsCoverage.h" + +/** \class cmParseGTMCoverage + * \brief Parse GTM coverage information + * + * This class is used to parse GTM coverage information for + * mumps. + */ +class cmParseGTMCoverage : public cmParseMumpsCoverage +{ +public: + cmParseGTMCoverage(cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest); +protected: + // implement virtual from parent + bool LoadCoverageData(const char* dir); + // Read a single mcov file + bool ReadMCovFile(const char* f); + // find out what line in a mumps file (filepath) the given entry point + // or function is. lineoffset is set by this method. + bool FindFunctionInMumpsFile(std::string const& filepath, + std::string const& function, + int& lineoffset); + // parse a line from a .mcov file, and fill in the + // routine, function, linenumber and coverage count + bool ParseMCOVLine(std::string const& line, + std::string& routine, + std::string& function, + int& linenumber, + int& count); +}; + + +#endif diff --git a/Source/CTest/cmParseMumpsCoverage.cxx b/Source/CTest/cmParseMumpsCoverage.cxx new file mode 100644 index 000000000..37e8bd082 --- /dev/null +++ b/Source/CTest/cmParseMumpsCoverage.cxx @@ -0,0 +1,165 @@ +#include "cmStandardIncludes.h" +#include +#include +#include "cmSystemTools.h" +#include "cmParseGTMCoverage.h" +#include +#include + + +cmParseMumpsCoverage::cmParseMumpsCoverage( + cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest) + :Coverage(cont), CTest(ctest) +{ +} + +cmParseMumpsCoverage::~cmParseMumpsCoverage() +{ +} + +bool cmParseMumpsCoverage::ReadCoverageFile(const char* file) +{ + // Read the gtm_coverage.mcov file, that has two lines of data: + // packages:/full/path/to/Vista/Packages + // coverage_dir:/full/path/to/dir/with/*.mcov + std::ifstream in(file); + if(!in) + { + return false; + } + std::string line; + while(cmSystemTools::GetLineFromStream(in, line)) + { + std::string::size_type pos = line.find(':', 0); + std::string packages; + if(pos != std::string::npos) + { + std::string type = line.substr(0, pos); + std::string path = line.substr(pos+1); + if(type == "packages") + { + this->LoadPackages(path.c_str()); + } + else if(type == "coverage_dir") + { + this->LoadCoverageData(path.c_str()); + } + else + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Parse Error in Mumps coverage file :\n" + << file << + "\ntype: [" << type << "]\npath:[" << path << "]\n" + "input line: [" << line << "]\n"); + } + } + } + return true; +} + +void cmParseMumpsCoverage::InitializeMumpsFile(std::string& file) +{ + // initialize the coverage information for a given mumps file + std::ifstream in(file.c_str()); + if(!in) + { + return; + } + std::string line; + cmCTestCoverageHandlerContainer::SingleFileCoverageVector& + coverageVector = this->Coverage.TotalCoverage[file]; + if(!cmSystemTools::GetLineFromStream(in, line)) + { + return; + } + // first line of a .m file can never be run + coverageVector.push_back(-1); + while( cmSystemTools::GetLineFromStream(in, line) ) + { + // putting in a 0 for a line means it is executable code + // putting in a -1 for a line means it is not executable code + int val = -1; // assume line is not executable + bool found = false; + std::string::size_type i = 0; + // (1) Search for the first whitespace or semicolon character on a line. + //This will skip over labels if the line starts with one, or will simply + //be the first character on the line for non-label lines. + for(; i < line.size(); ++i) + { + if(line[i] == ' ' || line[i] == '\t' || line[i] == ';') + { + found = true; + break; + } + } + if(found) + { + // (2) If the first character found above is whitespace then continue the + // search for the first following non-whitespace character. + if(line[i] == ' ' || line[i] == '\t') + { + while(i < line.size() && (line[i] == ' ' || line[i] == '\t')) + { + i++; + } + } + // (3) If the character found is not a semicolon then the line counts for + // coverage. + if(i < line.size() && line[i] != ';') + { + val = 0; + } + } + coverageVector.push_back(val); + } +} + +bool cmParseMumpsCoverage::LoadPackages(const char* d) +{ + cmsys::Glob glob; + glob.RecurseOn(); + std::string pat = d; + pat += "/*.m"; + glob.FindFiles(pat.c_str()); + std::vector& files = glob.GetFiles(); + std::vector::iterator fileIt; + for ( fileIt = files.begin(); fileIt != files.end(); + ++ fileIt ) + { + std::string name = cmSystemTools::GetFilenameName(*fileIt); + this->RoutineToDirectory[name.substr(0, name.size()-2)] = *fileIt; + // initialze each file, this is left out until CDash is fixed + // to handle large numbers of files + this->InitializeMumpsFile(*fileIt); + } + return true; +} + +bool cmParseMumpsCoverage::FindMumpsFile(std::string const& routine, + std::string& filepath) +{ + std::map::iterator i = + this->RoutineToDirectory.find(routine); + if(i != this->RoutineToDirectory.end()) + { + filepath = i->second; + return true; + } + else + { + // try some alternate names + const char* tryname[] = {"GUX", "GTM", "ONT", 0}; + for(int k=0; tryname[k] != 0; k++) + { + std::string routine2 = routine + tryname[k]; + i = this->RoutineToDirectory.find(routine2); + if(i != this->RoutineToDirectory.end()) + { + filepath = i->second; + return true; + } + } + } + return false; +} diff --git a/Source/CTest/cmParseMumpsCoverage.h b/Source/CTest/cmParseMumpsCoverage.h new file mode 100644 index 000000000..c1effa79b --- /dev/null +++ b/Source/CTest/cmParseMumpsCoverage.h @@ -0,0 +1,52 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc. + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ + +#ifndef cmParseMumpsCoverage_h +#define cmParseMumpsCoverage_h + +#include "cmStandardIncludes.h" +#include "cmCTestCoverageHandler.h" + +/** \class cmParseMumpsCoverage + * \brief Parse Mumps coverage information + * + * This class is used as the base class for Mumps coverage + * parsing. + */ +class cmParseMumpsCoverage +{ +public: + cmParseMumpsCoverage(cmCTestCoverageHandlerContainer& cont, + cmCTest* ctest); + virtual ~cmParseMumpsCoverage(); + // This is the toplevel coverage file locating the coverage files + // and the mumps source code package tree. + bool ReadCoverageFile(const char* file); +protected: + // sub classes will use this to + // load all coverage files found in the given directory + virtual bool LoadCoverageData(const char* d) = 0; + // search the package directory for mumps files and fill + // in the RoutineToDirectory map + bool LoadPackages(const char* dir); + // initialize the coverage information for a single mumps file + void InitializeMumpsFile(std::string& file); + // Find mumps file for routine + bool FindMumpsFile(std::string const& routine, + std::string& filepath); +protected: + std::map RoutineToDirectory; + cmCTestCoverageHandlerContainer& Coverage; + cmCTest* CTest; +}; + +#endif diff --git a/Source/CTest/cmParsePHPCoverage.h b/Source/CTest/cmParsePHPCoverage.h index ce5741d0b..d50a83c58 100644 --- a/Source/CTest/cmParsePHPCoverage.h +++ b/Source/CTest/cmParsePHPCoverage.h @@ -37,9 +37,6 @@ private: bool ReadInt(std::ifstream& in, int& v); bool ReadCoverageArray(std::ifstream& in, cmStdString const&); bool ReadUntil(std::ifstream& in, char until); - typedef std::map FileLineCoverage; - std::map FileToCoverage; - std::map FileCoverage; cmCTestCoverageHandlerContainer& Coverage; cmCTest* CTest; }; diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 45b4cd3c5..5cd4f29dd 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -288,7 +288,7 @@ CMakeSetupDialog::~CMakeSetupDialog() // wait for thread to stop this->CMakeThread->quit(); - this->CMakeThread->wait(2000); + this->CMakeThread->wait(); } bool CMakeSetupDialog::prepareConfigure() diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index c1d0e9d6d..fd39eec02 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -102,16 +102,17 @@ bool cmAddLibraryCommand STATIC. But at this point we know only the name of the target, but not yet its linker language. */ if ((type != cmTarget::STATIC_LIBRARY) && + (type != cmTarget::OBJECT_LIBRARY) && (this->Makefile->GetCMakeInstance()->GetPropertyAsBool( "TARGET_SUPPORTS_SHARED_LIBS") == false)) { - std::string msg = "ADD_LIBRARY for library "; - msg += args[0]; - msg += " is used with the "; - msg += type==cmTarget::SHARED_LIBRARY ? "SHARED" : "MODULE"; - msg += " option, but the target platform supports only STATIC libraries. " - "Building it STATIC instead. This may lead to problems."; - cmSystemTools::Message(msg.c_str() ,"Warning"); + cmOStringStream w; + w << + "ADD_LIBRARY called with " << + (type==cmTarget::SHARED_LIBRARY ? "SHARED" : "MODULE") << + " option but the target platform does not support dynamic linking. " + "Building a STATIC library instead. This may lead to problems."; + this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); type = cmTarget::STATIC_LIBRARY; } diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index dc6b749b2..b410e440e 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -240,6 +240,7 @@ bool cmArchiveWrite::AddFile(const char* file, // Clear acl and xattr fields not useful for distribution. archive_entry_acl_clear(e); archive_entry_xattr_clear(e); + archive_entry_set_fflags(e, 0, 0); if(archive_write_header(this->Archive, e) != ARCHIVE_OK) { this->Error = "archive_write_header: "; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 3f7fdc7a2..4aff64bd8 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -48,7 +48,7 @@ #include #include -#include // auto_ptr +#include #include #include @@ -509,7 +509,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) cmake cm; cmGlobalGenerator gg; gg.SetCMakeInstance(&cm); - std::auto_ptr lg(gg.CreateLocalGenerator()); + cmsys::auto_ptr lg(gg.CreateLocalGenerator()); cmMakefile *mf = lg->GetMakefile(); if ( !this->ReadCustomConfigurationFileTree(this->BinaryDir.c_str(), mf) ) { @@ -1277,7 +1277,6 @@ int cmCTest::RunTest(std::vector argv, std::ostream* log, double testTimeOut, std::vector* environment) { - std::vector origEnv; bool modifyEnv = (environment && environment->size()>0); // determine how much time we have @@ -1334,9 +1333,11 @@ int cmCTest::RunTest(std::vector argv, } std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory(); + cmsys::auto_ptr saveEnv; if (modifyEnv) { - origEnv = cmSystemTools::AppendEnv(environment); + saveEnv.reset(new cmSystemTools::SaveRestoreEnvironment); + cmSystemTools::AppendEnv(*environment); } *retVal = inst.Run(args, output); @@ -1351,11 +1352,6 @@ int cmCTest::RunTest(std::vector argv, "Internal cmCTest object used to run test." << std::endl << *output << std::endl); - if (modifyEnv) - { - cmSystemTools::RestoreEnv(origEnv); - } - return cmsysProcess_State_Exited; } std::vector tempOutput; @@ -1364,9 +1360,11 @@ int cmCTest::RunTest(std::vector argv, *output = ""; } + cmsys::auto_ptr saveEnv; if (modifyEnv) { - origEnv = cmSystemTools::AppendEnv(environment); + saveEnv.reset(new cmSystemTools::SaveRestoreEnvironment); + cmSystemTools::AppendEnv(*environment); } cmsysProcess* cp = cmsysProcess_New(); @@ -1436,11 +1434,6 @@ int cmCTest::RunTest(std::vector argv, } cmsysProcess_Delete(cp); - if (modifyEnv) - { - cmSystemTools::RestoreEnv(origEnv); - } - return result; } diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 48f644b8d..1ae70350b 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -281,6 +281,10 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) flag += this->Makefile->GetSafeDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); cmakeFlags.push_back(flag); } + if(this->Makefile->GetDefinition("CMAKE_POSITION_INDEPENDENT_CODE")!=0) + { + fprintf(fout, "SET(CMAKE_POSITION_INDEPENDENT_CODE \"ON\")\n"); + } /* Use a random file name to avoid rapid creation and deletion of the same executable name (some filesystems fail on that). */ @@ -404,6 +408,7 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir) if(cmSystemTools::FileIsDirectory(fullPath.c_str())) { this->CleanupFiles(fullPath.c_str()); + cmSystemTools::RemoveADirectory(fullPath.c_str()); } else { diff --git a/Source/cmDependsFortranLexer.cxx b/Source/cmDependsFortranLexer.cxx index 438af2df5..b0d9a742d 100644 --- a/Source/cmDependsFortranLexer.cxx +++ b/Source/cmDependsFortranLexer.cxx @@ -20,7 +20,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 34 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -65,7 +65,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -96,6 +95,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -169,7 +170,15 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -203,13 +212,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - * Given that the standard has decreed that size_t exists since 1989, - * I guess we can afford to depend on it. Manoj. - */ - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; @@ -367,8 +369,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 43 -#define YY_END_OF_BUFFER 44 +#define YY_NUM_RULES 44 +#define YY_END_OF_BUFFER 45 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -376,25 +378,26 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[161] = +static yyconst flex_int16_t yy_accept[165] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 44, 38, 40, 39, 42, 1, 38, 31, 2, 33, - 38, 39, 36, 38, 37, 38, 37, 40, 38, 39, - 38, 37, 9, 8, 9, 4, 3, 38, 0, 10, - 0, 0, 0, 0, 0, 31, 31, 32, 34, 36, - 38, 37, 0, 41, 37, 0, 0, 0, 0, 0, - 0, 0, 0, 38, 0, 11, 37, 0, 0, 5, - 0, 0, 0, 27, 0, 0, 31, 31, 31, 31, - 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, + 45, 39, 41, 40, 43, 1, 39, 32, 2, 34, + 39, 40, 37, 39, 38, 39, 38, 41, 39, 40, + 39, 38, 9, 8, 9, 4, 3, 39, 0, 10, + 0, 0, 0, 0, 0, 32, 32, 33, 35, 37, + 39, 38, 0, 42, 38, 0, 0, 0, 0, 0, + 0, 0, 0, 39, 0, 11, 38, 0, 0, 5, + 0, 0, 0, 28, 0, 0, 32, 32, 32, 32, + 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 28, 29, 0, 0, 0, 0, 0, 0, - 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, - 0, 30, 25, 0, 0, 18, 0, 0, 24, 19, - 0, 0, 17, 0, 0, 16, 26, 0, 0, 15, - 20, 0, 7, 35, 7, 13, 0, 12, 14, 0 + 0, 0, 29, 30, 0, 0, 0, 0, 0, 0, + 0, 23, 24, 0, 0, 0, 0, 0, 0, 0, + 0, 31, 26, 0, 0, 19, 0, 0, 25, 20, + 0, 0, 18, 0, 0, 17, 27, 0, 0, 16, + 21, 0, 7, 36, 7, 14, 0, 13, 15, 0, + 0, 0, 12, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -404,15 +407,15 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 6, 7, 8, 9, 1, 10, 11, 1, 1, 12, 1, 13, 1, 1, 1, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 15, 16, 1, - 17, 18, 19, 1, 20, 20, 21, 22, 23, 24, - 20, 20, 25, 20, 20, 26, 20, 27, 20, 20, - 20, 20, 28, 20, 29, 20, 20, 20, 20, 20, - 1, 30, 1, 1, 31, 1, 20, 20, 32, 33, - - 34, 35, 20, 20, 36, 20, 20, 37, 20, 38, - 20, 20, 20, 20, 39, 20, 40, 20, 20, 20, - 20, 20, 1, 1, 1, 1, 1, 1, 1, 1, + 14, 14, 14, 14, 14, 14, 14, 15, 16, 17, + 18, 19, 20, 1, 21, 21, 22, 23, 24, 25, + 21, 21, 26, 21, 21, 27, 21, 28, 21, 21, + 21, 21, 29, 21, 30, 21, 21, 21, 21, 21, + 1, 31, 1, 1, 32, 1, 21, 21, 33, 34, + + 35, 36, 21, 21, 37, 21, 21, 38, 21, 39, + 21, 21, 21, 21, 40, 21, 41, 21, 21, 21, + 21, 21, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -429,178 +432,187 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[41] = +static yyconst flex_int32_t yy_meta[42] = { 0, 1, 2, 2, 3, 4, 3, 3, 1, 1, 3, - 3, 1, 3, 5, 1, 3, 3, 1, 1, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, - 5, 6, 6, 6, 6, 6, 6, 6, 6, 6 + 3, 1, 3, 5, 1, 3, 1, 3, 6, 1, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 1, 5, 7, 7, 7, 7, 7, 7, 7, 7, + 7 } ; -static yyconst flex_int16_t yy_base[169] = +static yyconst flex_int16_t yy_base[174] = { 0, - 0, 39, 0, 40, 184, 47, 43, 53, 55, 63, - 186, 0, 476, 476, 164, 476, 79, 72, 476, 476, - 143, 476, 130, 126, 0, 83, 119, 85, 149, 139, - 189, 220, 476, 131, 89, 476, 476, 0, 132, 476, - 259, 37, 69, 76, 34, 119, 137, 476, 0, 476, - 121, 0, 150, 476, 0, 154, 298, 0, 75, 138, - 142, 72, 127, 338, 94, 476, 0, 84, 158, 186, - 81, 145, 108, 172, 147, 173, 260, 266, 284, 299, - 272, 173, 178, 286, 245, 258, 285, 285, 78, 71, - 207, 476, 288, 291, 296, 304, 310, 315, 317, 326, - - 330, 330, 335, 338, 338, 341, 343, 341, 348, 62, - 52, 346, 476, 476, 353, 355, 357, 352, 359, 359, - 359, 476, 476, 363, 365, 370, 366, 375, 46, 38, - 378, 476, 476, 378, 381, 476, 376, 384, 476, 476, - 384, 387, 476, 115, 0, 476, 476, 388, 393, 476, - 476, 394, 476, 476, 476, 476, 398, 476, 476, 476, - 432, 438, 443, 445, 451, 457, 463, 469 + 0, 40, 0, 41, 188, 48, 44, 54, 56, 65, + 186, 0, 505, 505, 171, 505, 81, 74, 505, 505, + 158, 505, 151, 137, 0, 85, 122, 87, 153, 145, + 194, 226, 505, 143, 91, 505, 505, 0, 142, 505, + 266, 34, 70, 74, 34, 122, 141, 505, 0, 505, + 112, 0, 98, 505, 0, 154, 306, 0, 43, 133, + 139, 46, 130, 347, 130, 505, 0, 121, 163, 179, + 104, 156, 129, 176, 147, 178, 214, 267, 273, 292, + 279, 179, 249, 280, 257, 265, 288, 289, 116, 107, + 317, 505, 287, 289, 291, 302, 307, 310, 307, 311, + + 316, 326, 329, 333, 332, 336, 347, 345, 349, 101, + 86, 346, 505, 505, 350, 351, 353, 350, 357, 362, + 362, 505, 505, 367, 369, 371, 366, 372, 56, 47, + 374, 505, 505, 374, 379, 505, 374, 387, 505, 505, + 387, 391, 505, 117, 0, 505, 505, 392, 394, 505, + 505, 394, 505, 505, 505, 505, 395, 419, 505, 429, + 0, 25, 505, 505, 446, 453, 459, 462, 469, 476, + 483, 490, 497 } ; -static yyconst flex_int16_t yy_def[169] = +static yyconst flex_int16_t yy_def[174] = { 0, - 160, 1, 1, 1, 1, 1, 161, 161, 161, 161, - 160, 162, 160, 160, 163, 160, 162, 160, 160, 160, - 162, 160, 160, 162, 164, 162, 164, 160, 162, 160, - 165, 160, 160, 160, 160, 160, 160, 162, 163, 160, - 160, 160, 160, 160, 160, 160, 166, 160, 162, 160, - 162, 164, 160, 160, 27, 160, 160, 57, 160, 160, - 160, 160, 160, 165, 165, 160, 32, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 166, 166, 166, 166, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 167, 168, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 0, - 160, 160, 160, 160, 160, 160, 160, 160 + 164, 1, 1, 1, 1, 1, 165, 165, 165, 165, + 164, 166, 164, 164, 167, 164, 166, 164, 164, 164, + 166, 164, 164, 166, 168, 166, 168, 164, 166, 164, + 169, 164, 164, 164, 164, 164, 164, 166, 167, 164, + 164, 164, 164, 164, 164, 164, 170, 164, 166, 164, + 166, 168, 164, 164, 27, 164, 164, 57, 164, 164, + 164, 164, 164, 169, 169, 164, 32, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 170, 170, 170, 170, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 171, 172, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 173, 173, 164, 0, 164, 164, 164, 164, 164, 164, + 164, 164, 164 } ; -static yyconst flex_int16_t yy_nxt[517] = +static yyconst flex_int16_t yy_nxt[547] = { 0, 12, 13, 14, 13, 13, 15, 16, 12, 17, 18, - 19, 12, 20, 12, 21, 22, 23, 12, 24, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, - 27, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 28, 28, 145, 28, 28, 34, 29, 29, 28, 30, - 144, 28, 35, 36, 29, 34, 130, 34, 31, 71, - 76, 37, 35, 36, 35, 34, 129, 32, 32, 37, - 71, 76, 35, 46, 46, 111, 46, 47, 32, 32, - 41, 48, 110, 41, 53, 54, 56, 53, 90, 56, - 69, 70, 57, 69, 72, 73, 66, 83, 88, 74, - - 42, 43, 75, 44, 93, 72, 73, 45, 83, 88, - 74, 42, 43, 75, 44, 93, 154, 154, 45, 38, - 46, 46, 81, 46, 47, 81, 38, 38, 48, 96, - 38, 89, 55, 38, 40, 68, 38, 38, 78, 46, - 96, 78, 79, 63, 51, 82, 80, 50, 38, 55, - 58, 53, 54, 58, 53, 56, 82, 49, 56, 69, - 70, 57, 69, 84, 85, 86, 40, 99, 87, 94, - 59, 60, 95, 61, 84, 85, 86, 62, 99, 87, - 94, 59, 60, 95, 61, 160, 30, 91, 62, 64, - 91, 66, 160, 97, 100, 92, 64, 64, 98, 101, - - 64, 102, 64, 64, 97, 100, 64, 64, 91, 98, - 101, 91, 102, 160, 160, 160, 92, 160, 64, 64, - 65, 65, 66, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 67, 65, 65, 65, 65, 65, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 65, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 41, 78, 46, 41, 78, 79, 105, 78, 46, 80, - 78, 79, 160, 81, 160, 80, 81, 105, 160, 106, - 42, 43, 160, 44, 107, 78, 46, 45, 78, 79, - 106, 42, 43, 80, 44, 107, 82, 160, 45, 58, - - 78, 46, 58, 78, 79, 108, 109, 82, 80, 160, - 103, 160, 112, 104, 113, 160, 108, 109, 114, 59, - 60, 103, 61, 112, 104, 113, 62, 160, 115, 114, - 59, 60, 116, 61, 160, 160, 117, 62, 64, 115, - 66, 160, 118, 116, 160, 64, 64, 117, 119, 64, - 120, 64, 64, 118, 121, 64, 64, 160, 122, 119, - 123, 120, 124, 125, 126, 121, 127, 64, 64, 122, - 128, 123, 131, 124, 125, 126, 132, 127, 133, 134, - 135, 128, 136, 131, 137, 138, 139, 132, 140, 133, - 134, 135, 141, 136, 142, 137, 138, 139, 143, 140, - - 146, 147, 148, 141, 149, 142, 150, 151, 152, 143, - 156, 146, 147, 148, 157, 149, 158, 150, 151, 152, - 159, 156, 160, 160, 160, 157, 160, 158, 160, 160, - 160, 159, 33, 33, 33, 33, 33, 33, 38, 160, - 160, 160, 38, 39, 39, 39, 39, 39, 39, 52, - 52, 65, 65, 65, 65, 65, 65, 77, 77, 77, - 77, 77, 77, 153, 153, 153, 160, 153, 153, 155, - 160, 155, 160, 155, 155, 11, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160 + 19, 12, 20, 12, 21, 22, 12, 23, 12, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 26, 27, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 28, 28, 163, 28, 28, 34, 29, 29, 28, + 30, 145, 28, 35, 36, 29, 34, 71, 34, 31, + 144, 76, 37, 35, 36, 35, 83, 34, 71, 32, + 32, 37, 76, 88, 35, 46, 46, 83, 46, 47, + 32, 32, 41, 48, 88, 41, 53, 54, 56, 53, + 130, 56, 69, 70, 57, 69, 72, 73, 74, 53, + + 54, 75, 53, 42, 43, 129, 44, 72, 73, 74, + 45, 111, 75, 81, 42, 43, 81, 44, 154, 154, + 110, 45, 38, 46, 46, 90, 46, 47, 93, 38, + 38, 48, 66, 38, 89, 55, 38, 82, 38, 93, + 38, 38, 78, 46, 40, 78, 79, 68, 82, 63, + 80, 96, 38, 55, 58, 56, 51, 58, 56, 84, + 85, 57, 96, 86, 69, 70, 87, 69, 99, 50, + 84, 85, 49, 40, 86, 59, 60, 87, 61, 99, + 91, 94, 62, 91, 95, 164, 59, 60, 92, 61, + 30, 164, 94, 62, 64, 95, 66, 164, 97, 164, + + 100, 64, 64, 98, 164, 64, 101, 64, 64, 97, + 64, 100, 64, 64, 98, 78, 46, 101, 78, 79, + 164, 164, 164, 80, 64, 64, 65, 65, 66, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 67, + 65, 65, 65, 65, 65, 65, 67, 67, 67, 67, + 67, 67, 67, 67, 67, 67, 65, 67, 67, 67, + 67, 67, 67, 67, 67, 67, 67, 41, 78, 46, + 41, 78, 79, 102, 78, 46, 80, 78, 79, 105, + 81, 164, 80, 81, 102, 164, 164, 106, 42, 43, + 105, 44, 107, 78, 46, 45, 78, 79, 106, 42, + + 43, 80, 44, 107, 82, 103, 45, 58, 104, 108, + 58, 109, 112, 113, 114, 82, 103, 164, 91, 104, + 108, 91, 109, 112, 113, 114, 92, 115, 59, 60, + 116, 61, 117, 118, 119, 62, 164, 120, 115, 59, + 60, 116, 61, 117, 118, 119, 62, 64, 120, 66, + 164, 121, 164, 122, 64, 64, 123, 124, 64, 125, + 64, 64, 121, 64, 122, 64, 64, 123, 124, 126, + 125, 127, 128, 131, 132, 133, 134, 64, 64, 135, + 126, 136, 127, 128, 131, 132, 133, 134, 137, 138, + 135, 139, 136, 140, 141, 142, 143, 146, 147, 137, + + 138, 148, 139, 149, 140, 141, 142, 143, 146, 147, + 150, 151, 148, 152, 149, 156, 157, 158, 159, 164, + 160, 150, 151, 160, 152, 164, 156, 157, 158, 159, + 160, 164, 164, 160, 164, 161, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 161, 33, 33, 33, 33, + 33, 33, 33, 38, 164, 164, 164, 38, 38, 39, + 39, 39, 39, 39, 39, 39, 52, 164, 52, 65, + 65, 65, 65, 65, 65, 65, 77, 77, 77, 77, + 77, 77, 77, 153, 153, 153, 164, 153, 153, 153, + 155, 164, 155, 164, 155, 155, 155, 162, 162, 162, + + 162, 162, 164, 162, 11, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164 } ; -static yyconst flex_int16_t yy_chk[517] = +static yyconst flex_int16_t yy_chk[547] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 4, 130, 2, 4, 7, 2, 4, 6, 6, - 129, 6, 7, 7, 6, 8, 111, 9, 6, 42, - 45, 9, 8, 8, 9, 10, 110, 6, 6, 10, - 42, 45, 10, 18, 18, 90, 18, 18, 6, 6, - 17, 18, 89, 17, 26, 26, 28, 26, 68, 28, - 35, 35, 28, 35, 43, 43, 65, 59, 62, 44, - - 17, 17, 44, 17, 71, 43, 43, 17, 59, 62, - 44, 17, 17, 44, 17, 71, 144, 144, 17, 27, - 46, 46, 51, 46, 46, 51, 27, 27, 46, 73, - 27, 63, 27, 27, 39, 34, 27, 27, 47, 47, - 73, 47, 47, 30, 24, 51, 47, 23, 27, 27, - 29, 53, 53, 29, 53, 56, 51, 21, 56, 69, - 69, 56, 69, 60, 60, 61, 15, 75, 61, 72, - 29, 29, 72, 29, 60, 60, 61, 29, 75, 61, - 72, 29, 29, 72, 29, 11, 5, 70, 29, 31, - 70, 31, 0, 74, 76, 70, 31, 31, 74, 82, - - 31, 83, 31, 31, 74, 76, 31, 31, 91, 74, - 82, 91, 83, 0, 0, 0, 91, 0, 31, 31, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 1, 2, 4, 162, 2, 4, 7, 2, 4, 6, + 6, 130, 6, 7, 7, 6, 8, 42, 9, 6, + 129, 45, 9, 8, 8, 9, 59, 10, 42, 6, + 6, 10, 45, 62, 10, 18, 18, 59, 18, 18, + 6, 6, 17, 18, 62, 17, 26, 26, 28, 26, + 111, 28, 35, 35, 28, 35, 43, 43, 44, 53, + + 53, 44, 53, 17, 17, 110, 17, 43, 43, 44, + 17, 90, 44, 51, 17, 17, 51, 17, 144, 144, + 89, 17, 27, 46, 46, 68, 46, 46, 71, 27, + 27, 46, 65, 27, 63, 27, 27, 51, 27, 71, + 27, 27, 47, 47, 39, 47, 47, 34, 51, 30, + 47, 73, 27, 27, 29, 56, 24, 29, 56, 60, + 60, 56, 73, 61, 69, 69, 61, 69, 75, 23, + 60, 60, 21, 15, 61, 29, 29, 61, 29, 75, + 70, 72, 29, 70, 72, 11, 29, 29, 70, 29, + 5, 0, 72, 29, 31, 72, 31, 0, 74, 0, + + 76, 31, 31, 74, 0, 31, 82, 31, 31, 74, + 31, 76, 31, 31, 74, 77, 77, 82, 77, 77, + 0, 0, 0, 77, 31, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 41, 77, 77, 41, 77, 77, 85, 78, 78, 77, - 78, 78, 0, 81, 0, 78, 81, 85, 0, 86, - 41, 41, 0, 41, 86, 79, 79, 41, 79, 79, - 86, 41, 41, 79, 41, 86, 81, 0, 41, 57, - - 80, 80, 57, 80, 80, 87, 88, 81, 80, 0, - 84, 0, 93, 84, 94, 0, 87, 88, 95, 57, - 57, 84, 57, 93, 84, 94, 57, 0, 96, 95, - 57, 57, 97, 57, 0, 0, 98, 57, 64, 96, - 64, 0, 99, 97, 0, 64, 64, 98, 100, 64, - 101, 64, 64, 99, 102, 64, 64, 0, 103, 100, - 104, 101, 105, 106, 107, 102, 108, 64, 64, 103, - 109, 104, 112, 105, 106, 107, 115, 108, 116, 117, - 118, 109, 119, 112, 120, 121, 124, 115, 125, 116, - 117, 118, 126, 119, 127, 120, 121, 124, 128, 125, - - 131, 134, 135, 126, 137, 127, 138, 141, 142, 128, - 148, 131, 134, 135, 149, 137, 152, 138, 141, 142, - 157, 148, 0, 0, 0, 149, 0, 152, 0, 0, - 0, 157, 161, 161, 161, 161, 161, 161, 162, 0, - 0, 0, 162, 163, 163, 163, 163, 163, 163, 164, - 164, 165, 165, 165, 165, 165, 165, 166, 166, 166, - 166, 166, 166, 167, 167, 167, 0, 167, 167, 168, - 0, 168, 0, 168, 168, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160 + 32, 32, 32, 32, 32, 32, 32, 41, 78, 78, + 41, 78, 78, 83, 79, 79, 78, 79, 79, 85, + 81, 0, 79, 81, 83, 0, 0, 86, 41, 41, + 85, 41, 86, 80, 80, 41, 80, 80, 86, 41, + + 41, 80, 41, 86, 81, 84, 41, 57, 84, 87, + 57, 88, 93, 94, 95, 81, 84, 0, 91, 84, + 87, 91, 88, 93, 94, 95, 91, 96, 57, 57, + 97, 57, 98, 99, 100, 57, 0, 101, 96, 57, + 57, 97, 57, 98, 99, 100, 57, 64, 101, 64, + 0, 102, 0, 103, 64, 64, 104, 105, 64, 106, + 64, 64, 102, 64, 103, 64, 64, 104, 105, 107, + 106, 108, 109, 112, 115, 116, 117, 64, 64, 118, + 107, 119, 108, 109, 112, 115, 116, 117, 120, 121, + 118, 124, 119, 125, 126, 127, 128, 131, 134, 120, + + 121, 135, 124, 137, 125, 126, 127, 128, 131, 134, + 138, 141, 135, 142, 137, 148, 149, 152, 157, 0, + 158, 138, 141, 158, 142, 0, 148, 149, 152, 157, + 160, 0, 0, 160, 0, 158, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 160, 165, 165, 165, 165, + 165, 165, 165, 166, 0, 0, 0, 166, 166, 167, + 167, 167, 167, 167, 167, 167, 168, 0, 168, 169, + 169, 169, 169, 169, 169, 169, 170, 170, 170, 170, + 170, 170, 170, 171, 171, 171, 0, 171, 171, 171, + 172, 0, 172, 0, 172, 172, 172, 173, 173, 173, + + 173, 173, 0, 173, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164 } ; /* The intent behind this definition is that it'll catch @@ -673,7 +685,7 @@ Modify cmDependsFortranLexer.h: /*--------------------------------------------------------------------------*/ -#line 670 "cmDependsFortranLexer.cxx" +#line 678 "cmDependsFortranLexer.cxx" #define INITIAL 0 #define free_fmt 1 @@ -796,7 +808,12 @@ static int input (yyscan_t yyscanner ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -804,7 +821,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -815,7 +832,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - int n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -901,10 +918,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 75 "cmDependsFortranLexer.in.l" +#line 71 "cmDependsFortranLexer.in.l" -#line 901 "cmDependsFortranLexer.cxx" +#line 914 "cmDependsFortranLexer.cxx" if ( !yyg->yy_init ) { @@ -958,13 +975,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 161 ) + if ( yy_current_state >= 165 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 476 ); + while ( yy_base[yy_current_state] != 505 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -990,7 +1007,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 77 "cmDependsFortranLexer.in.l" +#line 73 "cmDependsFortranLexer.in.l" { cmDependsFortranParser_StringStart(yyextra); cmDependsFortranParser_SetOldStartcond(yyextra, YY_START); @@ -999,7 +1016,7 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP -#line 83 "cmDependsFortranLexer.in.l" +#line 79 "cmDependsFortranLexer.in.l" { cmDependsFortranParser_StringStart(yyextra); cmDependsFortranParser_SetOldStartcond(yyextra, YY_START); @@ -1007,10 +1024,10 @@ YY_RULE_SETUP } YY_BREAK case 3: -#line 90 "cmDependsFortranLexer.in.l" +#line 86 "cmDependsFortranLexer.in.l" case 4: YY_RULE_SETUP -#line 90 "cmDependsFortranLexer.in.l" +#line 86 "cmDependsFortranLexer.in.l" { BEGIN(cmDependsFortranParser_GetOldStartcond(yyextra) ); yylvalp->string = strdup(cmDependsFortranParser_StringEnd(yyextra)); @@ -1018,17 +1035,17 @@ YY_RULE_SETUP } case 5: /* rule 5 can match eol */ -#line 97 "cmDependsFortranLexer.in.l" +#line 93 "cmDependsFortranLexer.in.l" case 6: /* rule 6 can match eol */ YY_RULE_SETUP -#line 97 "cmDependsFortranLexer.in.l" +#line 93 "cmDependsFortranLexer.in.l" /* Ignore (continued strings, free fmt) */ YY_BREAK case 7: /* rule 7 can match eol */ YY_RULE_SETUP -#line 99 "cmDependsFortranLexer.in.l" +#line 95 "cmDependsFortranLexer.in.l" { if (cmDependsFortranParser_GetOldStartcond(yyextra) == fixed_fmt) ; /* Ignore (cont. strings, fixed fmt) */ @@ -1041,7 +1058,7 @@ YY_RULE_SETUP case 8: /* rule 8 can match eol */ YY_RULE_SETUP -#line 109 "cmDependsFortranLexer.in.l" +#line 105 "cmDependsFortranLexer.in.l" { unput ('\n'); BEGIN(INITIAL); @@ -1049,7 +1066,7 @@ YY_RULE_SETUP } case 9: YY_RULE_SETUP -#line 115 "cmDependsFortranLexer.in.l" +#line 111 "cmDependsFortranLexer.in.l" { cmDependsFortranParser_StringAppend(yyextra, yytext[0]); } @@ -1057,96 +1074,99 @@ YY_RULE_SETUP case 10: /* rule 10 can match eol */ YY_RULE_SETUP -#line 119 "cmDependsFortranLexer.in.l" +#line 115 "cmDependsFortranLexer.in.l" { return EOSTMT; } /* Treat comments like */ case 11: /* rule 11 can match eol */ YY_RULE_SETUP -#line 120 "cmDependsFortranLexer.in.l" +#line 116 "cmDependsFortranLexer.in.l" { return EOSTMT; } /* empty lines */ case 12: +/* rule 12 can match eol */ YY_RULE_SETUP -#line 122 "cmDependsFortranLexer.in.l" -{ return CPP_INCLUDE; } +#line 118 "cmDependsFortranLexer.in.l" +{ + yytext[yyleng-1] = 0; + yylvalp->string = strdup(strchr(yytext, '<')+1); + return CPP_INCLUDE_ANGLE; +} case 13: YY_RULE_SETUP #line 123 "cmDependsFortranLexer.in.l" -{ return F90PPR_INCLUDE; } +{ return CPP_INCLUDE; } case 14: YY_RULE_SETUP #line 124 "cmDependsFortranLexer.in.l" -{ return COCO_INCLUDE; } +{ return F90PPR_INCLUDE; } case 15: YY_RULE_SETUP -#line 126 "cmDependsFortranLexer.in.l" -{ return CPP_DEFINE; } +#line 125 "cmDependsFortranLexer.in.l" +{ return COCO_INCLUDE; } case 16: YY_RULE_SETUP #line 127 "cmDependsFortranLexer.in.l" -{ return F90PPR_DEFINE; } +{ return CPP_DEFINE; } case 17: YY_RULE_SETUP -#line 129 "cmDependsFortranLexer.in.l" -{ return CPP_UNDEF; } +#line 128 "cmDependsFortranLexer.in.l" +{ return F90PPR_DEFINE; } case 18: YY_RULE_SETUP #line 130 "cmDependsFortranLexer.in.l" -{ return F90PPR_UNDEF; } +{ return CPP_UNDEF; } case 19: YY_RULE_SETUP -#line 132 "cmDependsFortranLexer.in.l" -{ return CPP_IFDEF; } +#line 131 "cmDependsFortranLexer.in.l" +{ return F90PPR_UNDEF; } case 20: YY_RULE_SETUP #line 133 "cmDependsFortranLexer.in.l" -{ return CPP_IFNDEF; } +{ return CPP_IFDEF; } case 21: YY_RULE_SETUP #line 134 "cmDependsFortranLexer.in.l" -{ return CPP_IF; } +{ return CPP_IFNDEF; } case 22: YY_RULE_SETUP #line 135 "cmDependsFortranLexer.in.l" -{ return CPP_ELIF; } +{ return CPP_IF; } case 23: YY_RULE_SETUP #line 136 "cmDependsFortranLexer.in.l" -{ return CPP_ELSE; } +{ return CPP_ELIF; } case 24: YY_RULE_SETUP #line 137 "cmDependsFortranLexer.in.l" -{ return CPP_ENDIF; } +{ return CPP_ELSE; } case 25: YY_RULE_SETUP -#line 139 "cmDependsFortranLexer.in.l" -{ return F90PPR_IFDEF; } +#line 138 "cmDependsFortranLexer.in.l" +{ return CPP_ENDIF; } case 26: YY_RULE_SETUP #line 140 "cmDependsFortranLexer.in.l" -{ return F90PPR_IFNDEF; } +{ return F90PPR_IFDEF; } case 27: YY_RULE_SETUP #line 141 "cmDependsFortranLexer.in.l" -{ return F90PPR_IF; } +{ return F90PPR_IFNDEF; } case 28: YY_RULE_SETUP #line 142 "cmDependsFortranLexer.in.l" -{ return F90PPR_ELIF; } +{ return F90PPR_IF; } case 29: YY_RULE_SETUP #line 143 "cmDependsFortranLexer.in.l" -{ return F90PPR_ELSE; } +{ return F90PPR_ELIF; } case 30: YY_RULE_SETUP #line 144 "cmDependsFortranLexer.in.l" -{ return F90PPR_ENDIF; } -/* Line continuations, possible involving comments. */ +{ return F90PPR_ELSE; } case 31: -/* rule 31 can match eol */ YY_RULE_SETUP -#line 147 "cmDependsFortranLexer.in.l" - - YY_BREAK +#line 145 "cmDependsFortranLexer.in.l" +{ return F90PPR_ENDIF; } +/* Line continuations, possible involving comments. */ case 32: /* rule 32 can match eol */ YY_RULE_SETUP @@ -1154,59 +1174,65 @@ YY_RULE_SETUP YY_BREAK case 33: +/* rule 33 can match eol */ YY_RULE_SETUP -#line 150 "cmDependsFortranLexer.in.l" -{ return COMMA; } +#line 149 "cmDependsFortranLexer.in.l" + + YY_BREAK case 34: YY_RULE_SETUP -#line 152 "cmDependsFortranLexer.in.l" -{ return DCOLON; } +#line 151 "cmDependsFortranLexer.in.l" +{ return COMMA; } case 35: -/* rule 35 can match eol */ YY_RULE_SETUP -#line 154 "cmDependsFortranLexer.in.l" -{ return GARBAGE; } +#line 153 "cmDependsFortranLexer.in.l" +{ return DCOLON; } case 36: +/* rule 36 can match eol */ YY_RULE_SETUP -#line 156 "cmDependsFortranLexer.in.l" -{ return ASSIGNMENT_OP; } +#line 155 "cmDependsFortranLexer.in.l" +{ return GARBAGE; } case 37: YY_RULE_SETUP -#line 158 "cmDependsFortranLexer.in.l" +#line 157 "cmDependsFortranLexer.in.l" +{ return ASSIGNMENT_OP; } +case 38: +YY_RULE_SETUP +#line 159 "cmDependsFortranLexer.in.l" { yylvalp->string = strdup(yytext); return WORD; } -case 38: +case 39: YY_RULE_SETUP -#line 163 "cmDependsFortranLexer.in.l" +#line 164 "cmDependsFortranLexer.in.l" { return GARBAGE; } -case 39: -/* rule 39 can match eol */ +case 40: +/* rule 40 can match eol */ YY_RULE_SETUP -#line 165 "cmDependsFortranLexer.in.l" +#line 166 "cmDependsFortranLexer.in.l" { return EOSTMT; } -case 40: +case 41: YY_RULE_SETUP -#line 168 "cmDependsFortranLexer.in.l" +#line 169 "cmDependsFortranLexer.in.l" /* Ignore */ YY_BREAK -case 41: -/* rule 41 can match eol */ +case 42: +/* rule 42 can match eol */ YY_RULE_SETUP -#line 169 "cmDependsFortranLexer.in.l" +#line 170 "cmDependsFortranLexer.in.l" /* Ignore line-endings preceeded by \ */ YY_BREAK -case 42: +case 43: YY_RULE_SETUP -#line 171 "cmDependsFortranLexer.in.l" +#line 172 "cmDependsFortranLexer.in.l" { return *yytext; } case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(free_fmt): case YY_STATE_EOF(fixed_fmt): case YY_STATE_EOF(str_sq): case YY_STATE_EOF(str_dq): -#line 173 "cmDependsFortranLexer.in.l" +#line 174 "cmDependsFortranLexer.in.l" { if(!cmDependsFortranParser_FilePop(yyextra) ) { @@ -1214,12 +1240,12 @@ case YY_STATE_EOF(str_dq): } } YY_BREAK -case 43: +case 44: YY_RULE_SETUP -#line 180 "cmDependsFortranLexer.in.l" +#line 181 "cmDependsFortranLexer.in.l" ECHO; YY_BREAK -#line 1247 "cmDependsFortranLexer.cxx" +#line 1270 "cmDependsFortranLexer.cxx" case YY_END_OF_BUFFER: { @@ -1512,7 +1538,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 161 ) + if ( yy_current_state >= 165 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1541,11 +1567,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 161 ) + if ( yy_current_state >= 165 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 160); + yy_is_jam = (yy_current_state == 164); return yy_is_jam ? 0 : yy_current_state; } @@ -1991,7 +2017,7 @@ YY_BUFFER_STATE cmDependsFortran_yy_scan_string (yyconst char * yystr , yyscan_t } /** Setup the input buffer state to scan the given bytes. The next call to cmDependsFortran_yylex() will - * scan from a @e copy of @a yybytes. + * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. @@ -2154,7 +2180,7 @@ void cmDependsFortran_yyset_lineno (int line_number , yyscan_t yyscanner) } /** Set the current column. - * @param column_no + * @param line_number * @param yyscanner The scanner object. */ void cmDependsFortran_yyset_column (int column_no , yyscan_t yyscanner) @@ -2374,7 +2400,7 @@ void cmDependsFortran_yyfree (void * ptr , yyscan_t) #define YYTABLES_NAME "yytables" -#line 180 "cmDependsFortranLexer.in.l" +#line 181 "cmDependsFortranLexer.in.l" diff --git a/Source/cmDependsFortranLexer.h b/Source/cmDependsFortranLexer.h index 85e861dd8..8e24cfd80 100644 --- a/Source/cmDependsFortranLexer.h +++ b/Source/cmDependsFortranLexer.h @@ -20,7 +20,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 34 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -65,7 +65,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -96,6 +95,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -138,7 +139,15 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif #ifndef YY_TYPEDEF_YY_BUFFER_STATE @@ -146,13 +155,6 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - * Given that the standard has decreed that size_t exists since 1989, - * I guess we can afford to depend on it. Manoj. - */ - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; @@ -304,7 +306,12 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Number of entries by which start-condition stack grows. */ diff --git a/Source/cmDependsFortranLexer.in.l b/Source/cmDependsFortranLexer.in.l index af8e37d22..40e80b719 100644 --- a/Source/cmDependsFortranLexer.in.l +++ b/Source/cmDependsFortranLexer.in.l @@ -115,6 +115,11 @@ Modify cmDependsFortranLexer.h: !.*\n { return EOSTMT; } /* Treat comments like */ ^[cC*dD].*\n { return EOSTMT; } /* empty lines */ +^[ \t]*#[ \t]*include[ \t]*<[^>]+> { + yytext[yyleng-1] = 0; + yylvalp->string = strdup(strchr(yytext, '<')+1); + return CPP_INCLUDE_ANGLE; +} ^[ \t]*#[ \t]*include { return CPP_INCLUDE; } \$[ \t]*include { return F90PPR_INCLUDE; } \?\?[ \t]*include { return COCO_INCLUDE; } diff --git a/Source/cmDependsFortranParser.cxx b/Source/cmDependsFortranParser.cxx index ea31d3a47..7b49a9c5c 100644 --- a/Source/cmDependsFortranParser.cxx +++ b/Source/cmDependsFortranParser.cxx @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.1" +#define YYBISON_VERSION "2.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -74,7 +73,7 @@ /* Copy the first part of user declarations. */ -/* Line 189 of yacc.c */ +/* Line 268 of yacc.c */ #line 1 "cmDependsFortranParser.y" /*============================================================================ @@ -161,8 +160,8 @@ static bool cmDependsFortranParserIsKeyword(const char* word, #endif -/* Line 189 of yacc.c */ -#line 172 "cmDependsFortranParser.cxx" +/* Line 268 of yacc.c */ +#line 165 "cmDependsFortranParser.cxx" /* Enabling traces. */ #ifndef YYDEBUG @@ -216,7 +215,8 @@ static bool cmDependsFortranParserIsKeyword(const char* word, CPP_TOENDL = 282, UNTERMINATED_STRING = 283, STRING = 284, - WORD = 285 + WORD = 285, + CPP_INCLUDE_ANGLE = 286 }; #endif /* Tokens. */ @@ -248,6 +248,7 @@ static bool cmDependsFortranParserIsKeyword(const char* word, #define UNTERMINATED_STRING 283 #define STRING 284 #define WORD 285 +#define CPP_INCLUDE_ANGLE 286 @@ -256,15 +257,15 @@ static bool cmDependsFortranParserIsKeyword(const char* word, typedef union YYSTYPE { -/* Line 214 of yacc.c */ -#line 94 "cmDependsFortranParser.y" +/* Line 293 of yacc.c */ +#line 89 "cmDependsFortranParser.y" char* string; -/* Line 214 of yacc.c */ -#line 274 "cmDependsFortranParser.cxx" +/* Line 293 of yacc.c */ +#line 269 "cmDependsFortranParser.cxx" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -275,8 +276,8 @@ typedef union YYSTYPE /* Copy the second part of user declarations. */ -/* Line 264 of yacc.c */ -#line 286 "cmDependsFortranParser.cxx" +/* Line 343 of yacc.c */ +#line 281 "cmDependsFortranParser.cxx" #ifdef short # undef short @@ -326,7 +327,7 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if YYENABLE_NLS +# if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -379,11 +380,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -406,24 +407,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -452,23 +453,7 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of @@ -488,23 +473,43 @@ union yyalloc #endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 271 +#define YYLAST 276 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 31 +#define YYNTOKENS 32 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 16 /* YYNRULES -- Number of rules. */ -#define YYNRULES 52 +#define YYNRULES 53 /* YYNRULES -- Number of states. */ -#define YYNSTATES 94 +#define YYNSTATES 97 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 285 +#define YYMAXUTOK 286 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -540,7 +545,7 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30 + 25, 26, 27, 28, 29, 30, 31 }; #if YYDEBUG @@ -549,43 +554,43 @@ static const yytype_uint8 yytranslate[] = static const yytype_uint8 yyprhs[] = { 0, 0, 3, 4, 7, 9, 11, 16, 19, 24, - 30, 38, 43, 48, 53, 58, 63, 68, 72, 76, - 80, 84, 89, 93, 95, 97, 99, 101, 103, 105, - 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, - 127, 129, 131, 133, 135, 136, 139, 141, 143, 145, - 147, 149, 151 + 30, 38, 43, 47, 52, 57, 62, 67, 72, 76, + 80, 84, 88, 93, 97, 99, 101, 103, 105, 107, + 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, + 129, 131, 133, 135, 137, 139, 140, 143, 145, 147, + 149, 151, 153, 155 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 32, 0, -1, -1, 32, 33, -1, 35, -1, 34, - -1, 30, 4, 45, 3, -1, 30, 3, -1, 30, - 30, 45, 3, -1, 30, 26, 30, 45, 3, -1, - 30, 25, 30, 26, 30, 45, 3, -1, 30, 29, - 45, 3, -1, 36, 29, 45, 3, -1, 37, 30, - 45, 3, -1, 38, 30, 45, 3, -1, 39, 30, - 45, 3, -1, 40, 30, 45, 3, -1, 41, 45, - 3, -1, 42, 45, 3, -1, 43, 45, 3, -1, - 44, 45, 3, -1, 30, 5, 45, 3, -1, 5, - 45, 3, -1, 3, -1, 1, -1, 6, -1, 7, - -1, 8, -1, 10, -1, 9, -1, 12, -1, 11, - -1, 13, -1, 19, -1, 14, -1, 20, -1, 15, - -1, 21, -1, 17, -1, 23, -1, 16, -1, 22, - -1, 18, -1, 24, -1, -1, 45, 46, -1, 30, - -1, 29, -1, 5, -1, 4, -1, 26, -1, 25, - -1, 28, -1 + 33, 0, -1, -1, 33, 34, -1, 36, -1, 35, + -1, 30, 4, 46, 3, -1, 30, 3, -1, 30, + 30, 46, 3, -1, 30, 26, 30, 46, 3, -1, + 30, 25, 30, 26, 30, 46, 3, -1, 30, 29, + 46, 3, -1, 31, 46, 3, -1, 37, 29, 46, + 3, -1, 38, 30, 46, 3, -1, 39, 30, 46, + 3, -1, 40, 30, 46, 3, -1, 41, 30, 46, + 3, -1, 42, 46, 3, -1, 43, 46, 3, -1, + 44, 46, 3, -1, 45, 46, 3, -1, 30, 5, + 46, 3, -1, 5, 46, 3, -1, 3, -1, 1, + -1, 6, -1, 7, -1, 8, -1, 10, -1, 9, + -1, 12, -1, 11, -1, 13, -1, 19, -1, 14, + -1, 20, -1, 15, -1, 21, -1, 17, -1, 23, + -1, 16, -1, 22, -1, 18, -1, 24, -1, -1, + 46, 47, -1, 30, -1, 29, -1, 5, -1, 4, + -1, 26, -1, 25, -1, 28, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 115, 115, 115, 117, 117, 119, 125, 135, 165, - 176, 189, 200, 207, 213, 219, 225, 231, 236, 241, - 246, 251, 255, 256, 257, 262, 262, 262, 263, 263, - 264, 264, 265, 265, 266, 266, 267, 267, 268, 268, - 269, 269, 270, 270, 271, 271, 274, 275, 276, 277, - 278, 279, 280 + 0, 111, 111, 111, 113, 113, 115, 121, 131, 161, + 172, 185, 196, 203, 210, 216, 222, 228, 234, 239, + 244, 249, 254, 258, 259, 260, 265, 265, 265, 266, + 266, 267, 267, 268, 268, 269, 269, 270, 270, 271, + 271, 272, 272, 273, 273, 274, 274, 277, 278, 279, + 280, 281, 282, 283 }; #endif @@ -600,9 +605,9 @@ static const char *const yytname[] = "CPP_IF", "CPP_ELSE", "CPP_ELIF", "CPP_ENDIF", "F90PPR_IFDEF", "F90PPR_IFNDEF", "F90PPR_IF", "F90PPR_ELSE", "F90PPR_ELIF", "F90PPR_ENDIF", "COMMA", "DCOLON", "CPP_TOENDL", "UNTERMINATED_STRING", - "STRING", "WORD", "$accept", "code", "stmt", "assignment_stmt", - "keyword_stmt", "include", "define", "undef", "ifdef", "ifndef", "if", - "elif", "else", "endif", "other", "misc_code", 0 + "STRING", "WORD", "CPP_INCLUDE_ANGLE", "$accept", "code", "stmt", + "assignment_stmt", "keyword_stmt", "include", "define", "undef", "ifdef", + "ifndef", "if", "elif", "else", "endif", "other", "misc_code", 0 }; #endif @@ -614,163 +619,168 @@ static const yytype_uint16 yytoknum[] = 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285 + 285, 286 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 31, 32, 32, 33, 33, 34, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 36, 36, 36, 37, 37, - 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, - 43, 43, 44, 44, 45, 45, 46, 46, 46, 46, - 46, 46, 46 + 0, 32, 33, 33, 34, 34, 35, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 37, 37, 37, 38, + 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, + 43, 44, 44, 45, 45, 46, 46, 47, 47, 47, + 47, 47, 47, 47 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 2, 1, 1, 4, 2, 4, 5, - 7, 4, 4, 4, 4, 4, 4, 3, 3, 3, - 3, 4, 3, 1, 1, 1, 1, 1, 1, 1, + 7, 4, 3, 4, 4, 4, 4, 4, 3, 3, + 3, 3, 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, - 1, 1, 1 + 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, + 1, 1, 1, 1 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { - 2, 0, 1, 24, 23, 44, 25, 26, 27, 29, - 28, 31, 30, 32, 34, 36, 40, 38, 42, 33, - 35, 37, 41, 39, 43, 0, 3, 5, 4, 0, - 0, 0, 0, 0, 44, 44, 44, 44, 0, 7, - 44, 44, 0, 0, 44, 44, 44, 44, 44, 44, - 44, 0, 0, 0, 0, 22, 49, 48, 51, 50, - 52, 47, 46, 45, 0, 0, 0, 44, 0, 0, - 0, 0, 0, 0, 0, 17, 18, 19, 20, 6, - 21, 0, 0, 11, 8, 12, 13, 14, 15, 16, - 44, 9, 0, 10 + 2, 0, 1, 25, 24, 45, 26, 27, 28, 30, + 29, 32, 31, 33, 35, 37, 41, 39, 43, 34, + 36, 38, 42, 40, 44, 0, 45, 3, 5, 4, + 0, 0, 0, 0, 0, 45, 45, 45, 45, 0, + 7, 45, 45, 0, 0, 45, 45, 0, 45, 45, + 45, 45, 45, 0, 0, 0, 0, 23, 50, 49, + 52, 51, 53, 48, 47, 46, 0, 0, 0, 45, + 0, 0, 12, 0, 0, 0, 0, 0, 18, 19, + 20, 21, 6, 22, 0, 0, 11, 8, 13, 14, + 15, 16, 17, 45, 9, 0, 10 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 1, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 63 + -1, 1, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 65 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -35 +#define YYPACT_NINF -29 static const yytype_int16 yypact[] = { - -35, 29, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, 241, -35, -35, -35, -25, - -22, -21, -13, -12, -35, -35, -35, -35, 57, -35, - -35, -35, -11, -10, -35, -35, -35, -35, -35, -35, - -35, 63, 69, 75, 103, -35, -35, -35, -35, -35, - -35, -35, -35, -35, 109, 115, -5, -35, 121, 149, - 155, 161, 167, 195, 201, -35, -35, -35, -35, -35, - -35, -8, 207, -35, -35, -35, -35, -35, -35, -35, - -35, -35, 213, -35 + -29, 39, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, 246, -29, -29, -29, -29, + -28, -27, -22, -17, -16, -29, -29, -29, -29, 2, + -29, -29, -29, -13, -12, -29, -29, 61, -29, -29, + -29, -29, -29, 68, 74, 80, 108, -29, -29, -29, + -29, -29, -29, -29, -29, -29, 114, 120, -24, -29, + 126, 154, -29, 160, 166, 172, 200, 206, -29, -29, + -29, -29, -29, -29, -9, 212, -29, -29, -29, -29, + -29, -29, -29, -29, -29, 218, -29 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -34, -35 + -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -26, -29 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ + number is the opposite. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 51, 52, 53, 54, 46, 0, 64, 65, 47, 48, - 68, 69, 70, 71, 72, 73, 74, 49, 50, 66, - 67, 81, 90, 0, 0, 0, 0, 0, 0, 2, - 3, 0, 4, 82, 5, 6, 7, 8, 9, 10, + 47, 48, 84, 49, 0, 57, 58, 59, 50, 53, + 54, 55, 56, 51, 52, 66, 67, 68, 69, 70, + 71, 93, 73, 74, 75, 76, 77, 60, 61, 0, + 62, 63, 64, 0, 0, 0, 0, 0, 0, 2, + 3, 0, 4, 85, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 0, 0, 92, 0, 0, 25, - 55, 56, 57, 0, 0, 0, 75, 56, 57, 0, - 0, 0, 76, 56, 57, 0, 0, 0, 77, 56, - 57, 0, 58, 59, 0, 60, 61, 62, 58, 59, - 0, 60, 61, 62, 58, 59, 0, 60, 61, 62, - 58, 59, 0, 60, 61, 62, 78, 56, 57, 0, - 0, 0, 79, 56, 57, 0, 0, 0, 80, 56, - 57, 0, 0, 0, 83, 56, 57, 0, 58, 59, - 0, 60, 61, 62, 58, 59, 0, 60, 61, 62, - 58, 59, 0, 60, 61, 62, 58, 59, 0, 60, - 61, 62, 84, 56, 57, 0, 0, 0, 85, 56, - 57, 0, 0, 0, 86, 56, 57, 0, 0, 0, - 87, 56, 57, 0, 58, 59, 0, 60, 61, 62, - 58, 59, 0, 60, 61, 62, 58, 59, 0, 60, - 61, 62, 58, 59, 0, 60, 61, 62, 88, 56, - 57, 0, 0, 0, 89, 56, 57, 0, 0, 0, - 91, 56, 57, 0, 0, 0, 93, 56, 57, 0, - 58, 59, 0, 60, 61, 62, 58, 59, 0, 60, - 61, 62, 58, 59, 0, 60, 61, 62, 58, 59, - 0, 60, 61, 62, 39, 40, 41, 0, 0, 0, + 21, 22, 23, 24, 72, 58, 59, 95, 0, 25, + 26, 78, 58, 59, 0, 0, 0, 79, 58, 59, + 0, 0, 0, 80, 58, 59, 60, 61, 0, 62, + 63, 64, 0, 60, 61, 0, 62, 63, 64, 60, + 61, 0, 62, 63, 64, 60, 61, 0, 62, 63, + 64, 81, 58, 59, 0, 0, 0, 82, 58, 59, + 0, 0, 0, 83, 58, 59, 0, 0, 0, 86, + 58, 59, 0, 60, 61, 0, 62, 63, 64, 60, + 61, 0, 62, 63, 64, 60, 61, 0, 62, 63, + 64, 60, 61, 0, 62, 63, 64, 87, 58, 59, + 0, 0, 0, 88, 58, 59, 0, 0, 0, 89, + 58, 59, 0, 0, 0, 90, 58, 59, 0, 60, + 61, 0, 62, 63, 64, 60, 61, 0, 62, 63, + 64, 60, 61, 0, 62, 63, 64, 60, 61, 0, + 62, 63, 64, 91, 58, 59, 0, 0, 0, 92, + 58, 59, 0, 0, 0, 94, 58, 59, 0, 0, + 0, 96, 58, 59, 0, 60, 61, 0, 62, 63, + 64, 60, 61, 0, 62, 63, 64, 60, 61, 0, + 62, 63, 64, 60, 61, 0, 62, 63, 64, 40, + 41, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 42, 43, 0, 0, - 44, 45 + 0, 43, 44, 0, 0, 45, 46 }; +#define yypact_value_is_default(yystate) \ + ((yystate) == (-29)) + +#define yytable_value_is_error(yytable_value) \ + YYID (0) + static const yytype_int8 yycheck[] = { - 34, 35, 36, 37, 29, -1, 40, 41, 30, 30, - 44, 45, 46, 47, 48, 49, 50, 30, 30, 30, - 30, 26, 30, -1, -1, -1, -1, -1, -1, 0, - 1, -1, 3, 67, 5, 6, 7, 8, 9, 10, + 26, 29, 26, 30, -1, 3, 4, 5, 30, 35, + 36, 37, 38, 30, 30, 41, 42, 30, 30, 45, + 46, 30, 48, 49, 50, 51, 52, 25, 26, -1, + 28, 29, 30, -1, -1, -1, -1, -1, -1, 0, + 1, -1, 3, 69, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, -1, -1, 90, -1, -1, 30, - 3, 4, 5, -1, -1, -1, 3, 4, 5, -1, - -1, -1, 3, 4, 5, -1, -1, -1, 3, 4, - 5, -1, 25, 26, -1, 28, 29, 30, 25, 26, - -1, 28, 29, 30, 25, 26, -1, 28, 29, 30, - 25, 26, -1, 28, 29, 30, 3, 4, 5, -1, - -1, -1, 3, 4, 5, -1, -1, -1, 3, 4, - 5, -1, -1, -1, 3, 4, 5, -1, 25, 26, - -1, 28, 29, 30, 25, 26, -1, 28, 29, 30, - 25, 26, -1, 28, 29, 30, 25, 26, -1, 28, - 29, 30, 3, 4, 5, -1, -1, -1, 3, 4, - 5, -1, -1, -1, 3, 4, 5, -1, -1, -1, - 3, 4, 5, -1, 25, 26, -1, 28, 29, 30, - 25, 26, -1, 28, 29, 30, 25, 26, -1, 28, - 29, 30, 25, 26, -1, 28, 29, 30, 3, 4, - 5, -1, -1, -1, 3, 4, 5, -1, -1, -1, - 3, 4, 5, -1, -1, -1, 3, 4, 5, -1, - 25, 26, -1, 28, 29, 30, 25, 26, -1, 28, - 29, 30, 25, 26, -1, 28, 29, 30, 25, 26, - -1, 28, 29, 30, 3, 4, 5, -1, -1, -1, + 21, 22, 23, 24, 3, 4, 5, 93, -1, 30, + 31, 3, 4, 5, -1, -1, -1, 3, 4, 5, + -1, -1, -1, 3, 4, 5, 25, 26, -1, 28, + 29, 30, -1, 25, 26, -1, 28, 29, 30, 25, + 26, -1, 28, 29, 30, 25, 26, -1, 28, 29, + 30, 3, 4, 5, -1, -1, -1, 3, 4, 5, + -1, -1, -1, 3, 4, 5, -1, -1, -1, 3, + 4, 5, -1, 25, 26, -1, 28, 29, 30, 25, + 26, -1, 28, 29, 30, 25, 26, -1, 28, 29, + 30, 25, 26, -1, 28, 29, 30, 3, 4, 5, + -1, -1, -1, 3, 4, 5, -1, -1, -1, 3, + 4, 5, -1, -1, -1, 3, 4, 5, -1, 25, + 26, -1, 28, 29, 30, 25, 26, -1, 28, 29, + 30, 25, 26, -1, 28, 29, 30, 25, 26, -1, + 28, 29, 30, 3, 4, 5, -1, -1, -1, 3, + 4, 5, -1, -1, -1, 3, 4, 5, -1, -1, + -1, 3, 4, 5, -1, 25, 26, -1, 28, 29, + 30, 25, 26, -1, 28, 29, 30, 25, 26, -1, + 28, 29, 30, 25, 26, -1, 28, 29, 30, 3, + 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 25, 26, -1, -1, - 29, 30 + -1, 25, 26, -1, -1, 29, 30 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 32, 0, 1, 3, 5, 6, 7, 8, 9, + 0, 33, 0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 30, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 3, - 4, 5, 25, 26, 29, 30, 29, 30, 30, 30, - 30, 45, 45, 45, 45, 3, 4, 5, 25, 26, - 28, 29, 30, 46, 45, 45, 30, 30, 45, 45, - 45, 45, 45, 45, 45, 3, 3, 3, 3, 3, - 3, 26, 45, 3, 3, 3, 3, 3, 3, 3, - 30, 3, 45, 3 + 20, 21, 22, 23, 24, 30, 31, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 3, 4, 5, 25, 26, 29, 30, 46, 29, 30, + 30, 30, 30, 46, 46, 46, 46, 3, 4, 5, + 25, 26, 28, 29, 30, 47, 46, 46, 30, 30, + 46, 46, 3, 46, 46, 46, 46, 46, 3, 3, + 3, 3, 3, 3, 26, 46, 3, 3, 3, 3, + 3, 3, 3, 30, 3, 46, 3 }; #define yyerrok (yyerrstatus = 0) @@ -785,9 +795,18 @@ static const yytype_uint8 yystos[] = /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ + Once GCC version 2 has supplanted version 1, this can go. However, + YYFAIL appears to be in use. Nevertheless, it is formally deprecated + in Bison 2.4.2's NEWS entry, where a plan to phase it out is + discussed. */ #define YYFAIL goto yyerrlab +#if defined YYFAIL + /* This is here to suppress warnings from the GCC cpp's + -Wunused-macros. Normally we don't worry about that warning, but + some users do, and we want to make it easy for users to remove + YYFAIL uses, which will produce warnings from Bison 2.5. */ +#endif #define YYRECOVERING() (!!yyerrstatus) @@ -797,7 +816,6 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -839,19 +857,10 @@ while (YYID (0)) #endif -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ +/* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif @@ -1043,7 +1052,6 @@ int yydebug; # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -1146,115 +1154,142 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = 0; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } + } + } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; + yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; - if (yysize_overflow) - return YYSIZE_MAXIMUM; + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } - if (yyresult) + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; } - return yysize; - } + else + { + yyp++; + yyformat++; + } + } + return 0; } #endif /* YYERROR_VERBOSE */ - /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1287,6 +1322,7 @@ yydestruct (yymsg, yytype, yyvaluep) } } + /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus @@ -1303,12 +1339,9 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ - - - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ +/*----------. +| yyparse. | +`----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1495,7 +1528,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -1526,7 +1559,7 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) + if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -1582,8 +1615,8 @@ yyreduce: { case 6: -/* Line 1455 of yacc.c */ -#line 120 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 116 "cmDependsFortranParser.y" { free((yyvsp[(1) - (4)].string)); } @@ -1591,8 +1624,8 @@ yyreduce: case 7: -/* Line 1455 of yacc.c */ -#line 126 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 122 "cmDependsFortranParser.y" { if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (2)].string), "interface")) { @@ -1606,8 +1639,8 @@ yyreduce: case 8: -/* Line 1455 of yacc.c */ -#line 136 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 132 "cmDependsFortranParser.y" { if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (4)].string), "use")) { @@ -1641,8 +1674,8 @@ yyreduce: case 9: -/* Line 1455 of yacc.c */ -#line 166 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 162 "cmDependsFortranParser.y" { if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (5)].string), "use")) { @@ -1657,8 +1690,8 @@ yyreduce: case 10: -/* Line 1455 of yacc.c */ -#line 177 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 173 "cmDependsFortranParser.y" { if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (7)].string), "use") && cmDependsFortranParserIsKeyword((yyvsp[(3) - (7)].string), "non_intrinsic") ) @@ -1675,8 +1708,8 @@ yyreduce: case 11: -/* Line 1455 of yacc.c */ -#line 190 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 186 "cmDependsFortranParser.y" { if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (4)].string), "include")) { @@ -1691,8 +1724,20 @@ yyreduce: case 12: -/* Line 1455 of yacc.c */ -#line 201 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 197 "cmDependsFortranParser.y" + { + cmDependsFortranParser* parser = + cmDependsFortran_yyget_extra(yyscanner); + cmDependsFortranParser_RuleInclude(parser, (yyvsp[(1) - (3)].string)); + free((yyvsp[(1) - (3)].string)); + } + break; + + case 13: + +/* Line 1806 of yacc.c */ +#line 204 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); @@ -1701,10 +1746,10 @@ yyreduce: } break; - case 13: + case 14: -/* Line 1455 of yacc.c */ -#line 208 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 211 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleDefine(parser, (yyvsp[(2) - (4)].string)); @@ -1712,10 +1757,10 @@ yyreduce: } break; - case 14: + case 15: -/* Line 1455 of yacc.c */ -#line 214 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 217 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleUndef(parser, (yyvsp[(2) - (4)].string)); @@ -1723,10 +1768,10 @@ yyreduce: } break; - case 15: + case 16: -/* Line 1455 of yacc.c */ -#line 220 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 223 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleIfdef(parser, (yyvsp[(2) - (4)].string)); @@ -1734,10 +1779,10 @@ yyreduce: } break; - case 16: + case 17: -/* Line 1455 of yacc.c */ -#line 226 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 229 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleIfndef(parser, (yyvsp[(2) - (4)].string)); @@ -1745,75 +1790,86 @@ yyreduce: } break; - case 17: + case 18: -/* Line 1455 of yacc.c */ -#line 232 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 235 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleIf(parser); } break; - case 18: + case 19: -/* Line 1455 of yacc.c */ -#line 237 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 240 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleElif(parser); } break; - case 19: + case 20: -/* Line 1455 of yacc.c */ -#line 242 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 245 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleElse(parser); } break; - case 20: + case 21: -/* Line 1455 of yacc.c */ -#line 247 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 250 "cmDependsFortranParser.y" { cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); cmDependsFortranParser_RuleEndif(parser); } break; - case 21: + case 22: -/* Line 1455 of yacc.c */ -#line 252 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 255 "cmDependsFortranParser.y" { free((yyvsp[(1) - (4)].string)); } break; - case 46: + case 47: -/* Line 1455 of yacc.c */ -#line 274 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 277 "cmDependsFortranParser.y" { free ((yyvsp[(1) - (1)].string)); } break; - case 47: + case 48: -/* Line 1455 of yacc.c */ -#line 275 "cmDependsFortranParser.y" +/* Line 1806 of yacc.c */ +#line 278 "cmDependsFortranParser.y" { free ((yyvsp[(1) - (1)].string)); } break; -/* Line 1455 of yacc.c */ -#line 1821 "cmDependsFortranParser.cxx" +/* Line 1806 of yacc.c */ +#line 1860 "cmDependsFortranParser.cxx" default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -1841,6 +1897,10 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -1848,37 +1908,36 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; } } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } +# undef YYSYNTAX_ERROR #endif } @@ -1939,7 +1998,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) + if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -1998,8 +2057,13 @@ yyexhaustedlab: yyreturn: if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -2024,7 +2088,7 @@ yyreturn: -/* Line 1675 of yacc.c */ -#line 283 "cmDependsFortranParser.y" +/* Line 2067 of yacc.c */ +#line 286 "cmDependsFortranParser.y" /* End of grammar */ diff --git a/Source/cmDependsFortranParser.y b/Source/cmDependsFortranParser.y index 00d3327a7..5681d698c 100644 --- a/Source/cmDependsFortranParser.y +++ b/Source/cmDependsFortranParser.y @@ -102,6 +102,7 @@ static bool cmDependsFortranParserIsKeyword(const char* word, %token CPP_TOENDL %token UNTERMINATED_STRING %token STRING WORD +%token CPP_INCLUDE_ANGLE /*-------------------------------------------------------------------------*/ /* grammar */ @@ -192,6 +193,13 @@ keyword_stmt: free($1); free($2); } +| CPP_INCLUDE_ANGLE other EOSTMT + { + cmDependsFortranParser* parser = + cmDependsFortran_yyget_extra(yyscanner); + cmDependsFortranParser_RuleInclude(parser, $1); + free($1); + } | include STRING other EOSTMT { cmDependsFortranParser* parser = diff --git a/Source/cmDependsFortranParserTokens.h b/Source/cmDependsFortranParserTokens.h index 0bbcaaea1..941eda09c 100644 --- a/Source/cmDependsFortranParserTokens.h +++ b/Source/cmDependsFortranParserTokens.h @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,6 +30,7 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ + /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -64,7 +64,8 @@ CPP_TOENDL = 282, UNTERMINATED_STRING = 283, STRING = 284, - WORD = 285 + WORD = 285, + CPP_INCLUDE_ANGLE = 286 }; #endif /* Tokens. */ @@ -96,6 +97,7 @@ #define UNTERMINATED_STRING 283 #define STRING 284 #define WORD 285 +#define CPP_INCLUDE_ANGLE 286 @@ -104,12 +106,14 @@ typedef union YYSTYPE { -/* Line 1676 of yacc.c */ -#line 94 "cmDependsFortranParser.y" +/* Line 2068 of yacc.c */ +#line 89 "cmDependsFortranParser.y" char* string; -/* Line 1676 of yacc.c */ + + +/* Line 2068 of yacc.c */ #line 118 "cmDependsFortranParserTokens.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 897e516b9..592d93164 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -522,6 +522,16 @@ void cmDocumentVariables::DefineVariables(cmake* cm) false, "Variables That Change Behavior"); + cm->DefineProperty + ("CMAKE_INSTALL_DEFAULT_COMPONENT_NAME", cmProperty::VARIABLE, + "Default component used in install() commands.", + "If an install() command is used without the COMPONENT argument, " + "these files will be grouped into a default component. The name of this " + "default install component will be taken from this variable. " + "It defaults to \"Unspecified\". ", + false, + "Variables That Change Behavior"); + cm->DefineProperty ("CMAKE_FIND_LIBRARY_PREFIXES", cmProperty::VARIABLE, "Prefixes to prepend when looking for libraries.", @@ -833,6 +843,36 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Default is ON.",false, "Variables That Change Behavior"); + cm->DefineProperty + ("CMAKE_ABSOLUTE_DESTINATION_FILES", cmProperty::VARIABLE, + "List of files which have been installed using " + " an ABSOLUTE DESTINATION path.", + "This variable is defined by CMake-generated cmake_install.cmake " + "scripts." + " It can be used (read-only) by program or script that source those" + " install scripts. This is used by some CPack generators (e.g. RPM).", + false, + "Variables That Change Behavior"); + + cm->DefineProperty + ("CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE, + "Ask cmake_install.cmake script to warn each time a file with " + "absolute INSTALL DESTINATION is encountered.", + "This variable is used by CMake-generated cmake_install.cmake" + " scripts. If ones set this variable to ON while running the" + " script, it may get warning messages from the script.", false, + "Variables That Change Behavior"); + + cm->DefineProperty + ("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE, + "Ask cmake_install.cmake script to error out as soon as " + "a file with absolute INSTALL DESTINATION is encountered.", + "The fatal error is emitted before the installation of " + "the offending file takes place." + " This variable is used by CMake-generated cmake_install.cmake" + " scripts. If ones set this variable to ON while running the" + " script, it may get fatal error messages from the script.",false, + "Variables That Change Behavior"); // Variables defined by CMake that describe the system @@ -1310,6 +1350,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "See that target property for additional information.", false, "Variables that Control the Build"); + cm->DefineProperty + ("CMAKE_POSITION_INDEPENDENT_FLAGS", cmProperty::VARIABLE, + "Default value for POSITION_INDEPENDENT_CODE of targets.", + "This variable is used to initialize the " + "POSITION_INDEPENDENT_CODE property on all the targets. " + "See that target property for additional information.", + false, + "Variables that Control the Build"); // Variables defined when the a language is enabled These variables will // also be defined whenever CMake has loaded its support for compiling (LANG) diff --git a/Source/cmDocumentationFormatterHTML.cxx b/Source/cmDocumentationFormatterHTML.cxx index 6ced1e4d0..cd0077ed9 100644 --- a/Source/cmDocumentationFormatterHTML.cxx +++ b/Source/cmDocumentationFormatterHTML.cxx @@ -127,7 +127,7 @@ void cmDocumentationFormatterHTML { os << "

" << name << "

\n"; + os << "\">" << name << "\n"; } // Is a list needed? @@ -145,7 +145,7 @@ void cmDocumentationFormatterHTML cmDocumentationPrintHTMLId(os, op->Name.c_str()); os << "\">"; this->PrintHTMLEscapes(os, op->Name.c_str()); - os << ""; + os << "\n"; } } os << "\n" ; @@ -167,9 +167,9 @@ void cmDocumentationFormatterHTML { os << " Name.c_str()); - os << "\">"; + os << "\">"; this->PrintHTMLEscapes(os, op->Name.c_str()); - os << ": "; + os << ": "; } this->PrintHTMLEscapes(os, op->Brief.c_str()); if(op->Full.size()) @@ -269,9 +269,9 @@ void cmDocumentationFormatterHTML return; } - os << "

Master Index " + os << "

Master Index " << "CMake " << cmVersion::GetCMakeVersion() - << "

\n"; + << "

\n"; if (!sections.empty()) { diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index c4f5dfb50..eb19df5e2 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -137,10 +137,20 @@ cmExportFileGenerator (mf->IsOn("WIN32") || mf->IsOn("CYGWIN") || mf->IsOn("MINGW")); if(!dll_platform) { - std::string soname = target->GetSOName(config); - std::string prop = "IMPORTED_SONAME"; + std::string prop; + std::string value; + if(target->HasSOName(config)) + { + prop = "IMPORTED_SONAME"; + value = target->GetSOName(config); + } + else + { + prop = "IMPORTED_NO_SONAME"; + value = "TRUE"; + } prop += suffix; - properties[prop] = soname; + properties[prop] = value; } } diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index ccb17f099..5df8627d0 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -59,6 +59,9 @@ cmExtraCodeBlocksGenerator::cmExtraCodeBlocksGenerator() this->SupportedGlobalGenerators.push_back("NMake Makefiles"); // disable until somebody actually tests it: // this->SupportedGlobalGenerators.push_back("MSYS Makefiles"); +#endif +#ifdef CMAKE_USE_NINJA + this->SupportedGlobalGenerators.push_back("Ninja"); #endif this->SupportedGlobalGenerators.push_back("Unix Makefiles"); } @@ -383,6 +386,7 @@ void cmExtraCodeBlocksGenerator case cmTarget::STATIC_LIBRARY: case cmTarget::SHARED_LIBRARY: case cmTarget::MODULE_LIBRARY: + case cmTarget::OBJECT_LIBRARY: { this->AppendTarget(fout, ti->first.c_str(), &ti->second, make.c_str(), makefile, compiler.c_str()); @@ -420,6 +424,7 @@ void cmExtraCodeBlocksGenerator case cmTarget::STATIC_LIBRARY: case cmTarget::SHARED_LIBRARY: case cmTarget::MODULE_LIBRARY: + case cmTarget::OBJECT_LIBRARY: case cmTarget::UTILITY: // can have sources since 2.6.3 { const std::vector&sources=ti->second.GetSourceFiles(); @@ -532,6 +537,31 @@ void cmExtraCodeBlocksGenerator } +// Write a dummy file for OBJECT libraries, so C::B can reference some file +std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile( + cmMakefile* mf, cmTarget* target) const +{ + // this file doesn't seem to be used by C::B in custom makefile mode, + // but we generate a unique file for each OBJECT library so in case + // C::B uses it in some way, the targets don't interfere with each other. + std::string filename = mf->GetCurrentOutputDirectory(); + filename += "/"; + filename += mf->GetLocalGenerator()->GetTargetDirectory(*target); + filename += "/"; + filename += target->GetName(); + filename += ".objlib"; + cmGeneratedFileStream fout(filename.c_str()); + if(fout) + { + fout << "# This is a dummy file for the OBJECT library " + << target->GetName() + << " for the CMake CodeBlocks project generator.\n" + << "# Don't edit, this file will be overwritten.\n"; + } + return filename; +} + + // Generate the xml code for one target. void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, const char* targetName, @@ -570,7 +600,18 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, } const char* buildType = makefile->GetDefinition("CMAKE_BUILD_TYPE"); - fout<<"