diff -Nru cmake-2.8.7/CMakeLists.txt cmake-2.8.9/CMakeLists.txt --- cmake-2.8.7/CMakeLists.txt 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/CMakeLists.txt 2012-08-09 18:15:18.000000000 +0000 @@ -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) @@ -270,7 +270,7 @@ SET(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR}) SET(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) ELSE(CMAKE_USE_SYSTEM_ZLIB) - SET(CMAKE_ZLIB_INCLUDES) + SET(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities) SET(CMAKE_ZLIB_LIBRARIES cmzlib) ADD_SUBDIRECTORY(Utilities/cmzlib) CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty") @@ -324,10 +324,9 @@ #--------------------------------------------------------------------- # 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) @@ -336,13 +335,14 @@ SET(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS}) SET(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES}) ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE) - SET(HAVE_LIBZ 1) - SET(HAVE_ZLIB_H 1) SET(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES}) - SET(ZLIB_LIBRARIES ${CMAKE_ZLIB_LIBRARIES}) SET(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES}) - SET(BUILD_ARCHIVE_WITHIN_CMAKE TRUE) ADD_DEFINITIONS(-DLIBARCHIVE_STATIC) + SET(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle") + SET(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL") + SET(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support") + SET(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support") + SET(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support") ADD_SUBDIRECTORY(Utilities/cmlibarchive) CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty") SET(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES}) @@ -421,26 +421,13 @@ # 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 7) -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() @@ -630,9 +617,11 @@ PATTERN "*.sh*" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - PATTERN "CVS" EXCLUDE ) +# process docs related install +ADD_SUBDIRECTORY(Docs) + #----------------------------------------------------------------------- # End of the main section of the CMakeLists file #----------------------------------------------------------------------- diff -Nru cmake-2.8.7/CTestCustom.cmake.in cmake-2.8.9/CTestCustom.cmake.in --- cmake-2.8.7/CTestCustom.cmake.in 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/CTestCustom.cmake.in 2012-08-09 18:15:18.000000000 +0000 @@ -1,3 +1,7 @@ +SET(CTEST_CUSTOM_ERROR_MATCH + ${CTEST_CUSTOM_ERROR_MATCH} + "ERROR:") + SET(CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} "xtree.[0-9]+. : warning C4702: unreachable code" @@ -36,14 +40,16 @@ "warning.*directory name.*CMake-Xcode.*/bin/.*does not exist.*" "stl_deque.h:1051" "(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)" + "(Lexer|Parser).*warning.*statement is unreachable" + "PGC-W-0095-Type cast required for this conversion.*ProcessUNIX.c" "[Qq]t([Cc]ore|[Gg]ui).*warning.*conversion.*may alter its value" - "Parser.cxx.*warning.*2111-D.*statement is unreachable" "warning:.*is.*very unsafe.*consider using.*" "warning:.*is.*misused, please use.*" "CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element" "cc-3968 CC: WARNING File.*" # "implicit" truncation by static_cast "ld: warning: directory not found for option .-(F|L)" "warning.*This version of Mac OS X is unsupported" + "clang.*: warning: argument unused during compilation: .-g" # Ignore clang's summary warning, assuming prior text has matched some # other warning expression: diff -Nru cmake-2.8.7/ChangeLog.manual cmake-2.8.9/ChangeLog.manual --- cmake-2.8.7/ChangeLog.manual 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/ChangeLog.manual 2012-08-09 18:15:18.000000000 +0000 @@ -1,3 +1,1046 @@ +Changes in CMake 2.8.9 (since 2.8.9-rc3) +---------------------------------------- +None + +Changes in CMake 2.8.9-rc3 (since 2.8.9-rc2) +-------------------------------------------- +Alexey Ozeritsky (1): + Fixed: FindLAPACK does not find MKL 10.3 when using gcc 4.x + +Brad King (3): + pre-commit: Reject C++ code with lines too long + Tests/X11: Add missing include for 'rand' + Tests/ObjC++: Use standard header + +David Cole (1): + CPack: Use bin subdir when looking for dpkg and rpmbuild + +Eric NOULARD (2): + Do not run cpack at CMake time it is not available. + Find dpkg and rpmbuild in usual Fink and MacPort paths + +Nicolas Despres (17): + Ninja: Cannot pass a reference to an anonymous object. + Ninja: Add support for OS X app bundles. + Ninja: Add support for OX X library framework. + Ensure 3rd party libraries are writable. + Remove trailing white-spaces. + Re-factor OS X bundle and framework generation. + Ninja: Copy resource files in the bundle. + Ninja: Add support for CFBundle. + Enable BundleTest with CLang too. + Re-factor CFBundle generation. + Ninja: Use same echo message as makefiles. + Re-factor bundle content copying rules generation. + Re-factor Mac OS X content directory computation. + Re-factor framework directory computation. + Re-factor OS X content generator start up. + Fix memory leak in Makefile generator. + Add missing this->. + +Peter Kuemmel (1): + Ninja: dep files and multiple -arch flags not possible on mac + +Peter Kümmel (24): + Ninja: windres is also used for cross-compiling + Ninja: search for windres with prefix + Ninja: there could be null pointers + Ninja: more searching for windres + Ninja: path is already declared + Ninja: fix GCC 4.7 warning -Wconversion + Ninja: fix sytle + Ninja: also stop when .rc's .d file couldn't be generated + Ninja: readd quotes to src file path before patching it + Ninja: cmcldeps needs absolute paths for RCs + Ninja: on Mac no multiple -arch because of -M + Ninja: fix mis-matching endif() argument + Ninja: also mingw needs TARGET_PDB + Ninja: line length + Ninja: make TARGET_PDB a real .gdb file name + Ninja: make debug symbol suffix configurable by CMAKE_DEBUG_SYMBOL_SUFFIX + Ninja: remove 'friend' in ninja code + Ninja: remove warnings + Ninja: remove 'this' from member initializer list + Ninja: fixes for bcc + Ninja: enable ninja on Mac so all Mac CDash-builds are tested, cleanup later + Ninja: void function can't return a value + Ninja: enable ninja support everywhere + Ninja: also bootstrap ninja files + +Changes in CMake 2.8.9-rc2 (since 2.8.9-rc1) +-------------------------------------------- +Alex Neundorf (4): + -remove trailing whitespace + documentation: preparation for making the man section configurable + man documentation: detect man section from the given filename + Eclipse: fix #13313, always set LANG to C, also if unset + +Bill Hoffman (1): + Remove process execution code from cmcldeps and have it use cmake code. + +Brad King (12): + KWIML: Generalize interface to report broken integer literal macros + KWIML: Teach ABI.h about 'long long' and 'char' on old HP + KWIML: Teach INT.h that no HP platform implements SCN*8 formats + KWIML: Teach INT about broken UINT32_C on old HP + Fix project command documentation typo (#13384) + CTestUpdateSVN: Do not create repo directory first (#13349) + Tests/CustomCommand: Do not use 'main' in a library + AIX-GNU: Link shared libs with -brtl,-bnoipath (#13352) + include: Ignore empty string as file name (#13388) + Add ASM platform information for GNU compiler on AIX (#13390) + if: Document that macro arguments are not variables (#13393) + install: Fix COMPONENT option + +Clinton Stimpson (3): + GetPrerequisites.cmake: detect executables built with the -pie linker flag. + cmake-gui: Fix code to respect current locale. + DeployQt4: workaround bug 13258 where ARGV1 is leaked into a sub function. + +David Cole (7): + STYLE: Fix line length, remove extra blank line + CTest: Refactor error output into ErrorMessageUnknownDashDValue + CTest: Rename local variable for clarity + CTest: Extend -D command line arg handling for variable definitions + CTest: Allow -Dvar=value with no space between the D and the var + CTest: Add test to verify -D variable definitions work + Ninja: Fix typo: tagets -> targets + +Eric NOULARD (3): + Enhance documentation of install command w.r.t. the "Undefined" component. + CPack fix regression between 2.8.7 and 2.8.8 when running cpack with no arg. + Do not provide defaul value for CPACK_PACKAGE_DIRECTORY if found in config. + +Nicolas Despres (1): + Ninja: Clean all symlink created for libraries. + +Peter Kuemmel (6): + Ninja: print error message when command failed + Ninja: also consider variables when checking command line length + Ninja: also consider rule command length for rsp file + Ninja: remove int/size_t warning + Ninja: add soname test case + Ninja: don't shadow 'outputs' variable + +Peter Kümmel (6): + Ninja: also write link libraries to rsp file + Ninja: remove some unused default arguments + Ninja: error on missing rspfile_content + Ninja: disable work around when linking with mingw + Ninja: enable response file support on Mac (length 262144) + Ninja: sysconf() is declared in unistd.h + +Philip Lowman (2): + FindBoost: Fix bug where Boost_FOUND could be false when version specified + FindBoost: Future proof to 1.56 + +Rolf Eike Beer (2): + FindJava: improve version matching (#12878) + fix 2 space bugs in variable documentation + +Stephen Kelly (3): + Use full paths in compile_commands.json for out of source builds. + Construct the full path before escaping it. + Fix PositionIndependentTargets test with clang trunk. + +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): + CheckIncludeFiles: Shorten check description message + +David Cole (3): + CPackNSIS: Rewrite variable documentation to make it more readable. + OS X: Use correct extra path when searching for applicaton bundles (#13066) + OS X: Mark find_program results as advanced + +Eric NOULARD (1): + Fix some doc typo and add an undocumented var. + +Kashif Rasul (1): + OS X: Use OSX_DEVELOPER_ROOT for app search path (#13066) + +Rolf Eike Beer (1): + FindBoost: add support for 1.49 and 1.50 + +Changes in CMake 2.8.8-rc2 (since 2.8.8-rc1) +-------------------------------------------- +Alex Neundorf (4): + make cmLocalGenerator::EscapeForCMake() static + automoc: fix #13018, proper cmake escaping to avoid false rebuilds + automoc: add define to test which caused bug #13018 + fix #13054: support OBJECT libraries in Eclipse + +Ben Boeckel (1): + Create granular targets for Ninja generators too + +Brad King (6): + CTest.UpdateHG: Fix repo URL for leading slash + Always compile sources with known language + Classify known header file extensions as headers + VS: Add CMakeLists.txt re-run rules at start of generation + Test generated module .def files + Ninja: Fix module .def file path conversion + +David Cole (2): + CMake: Clarify SUFFIX target property documentation. + Xcode: Pay attention to custom configuration types (#13082) + +Peter Collingbourne (1): + Ninja: Substitute and in depfile flags + +Rolf Eike Beer (2): + FILE: mention that TO_CMAKE_PATH also handles list delimiters + FIND_LIBRARY: document FIND_LIBRARY_USE_LIB64_PATHS + +Sean McBride (1): + automoc: include on Apple to get pathconf + +Tom Hughes (1): + Override topdir from rpm command line seems necessary on Amazon linux. + +Changes in CMake 2.8.8-rc1 (since 2.8.7) +---------------------------------------- +Aaron C. Meadows (1): + Visual Studio: Allow setting Single Byte Character Set (#12189) + +Alex Neundorf (34): + GNUInstallDirs: add support for Debian multiarch + FindRuby: fix usage of RUBY_VERSION_MAJOR (#12172) + FindRuby: add more possible library names (for ubuntu, #12172) + FindRuby.cmake: add more debug output + fix FeatureSummary for REQUIRED packages, they were reported as OPTIONAL + FindGetText: fix multiple targets with the same name problem (CMP0002) + fix #6976: FindX11 also searches for X11_Xxf86vm_LIB + GenerateExportHeader: use double quotes around _gcc_version + -remove trailing whitespace + -don't pull in CheckTypeSize.cmake from the cmake which is being built + bootstrap: move while() and endwhile() into the bootstrap build + Check*.cmake: Expand imported targets in CMAKE_REQUIRED_LIBRARIES + find_package: print error if an invalid CONFIGS name is used + find_package: rename NoModule to UseFindModules + find_package: improve error message when no Find module is present + find_package: add MODULE mode to use only Find-modules + find_package: add CONFIG mode keyword alias for NO_MODULE + find_package: mention requested version number in error message + add CMakePackageConfigHelpers: configure_package_config_file() + wrap write_basic_config_version_file as write_basic_package_version_file() + find_package: error out if REQUIRED Config has not been found + write_basic_package_version_file(): improve documentation + write_basic_package_version_file: add ExactVersion mode + WriteBasicConfigVersionFile: add test for ExactVersion mode + find_package: allow Config.cmake to set _FOUND to FALSE + find_package: add test for setting Foo_FOUND to FALSE in a Config file + find_package: additional test for checking the error message + find_package: add OPTIONAL_COMPONENTS keyword + FPHSA(): add missing "]" to documentation + find_package: add documentation for OPTIONAL_COMPONENTS + FPHSA(): add HANDLE_COMPONENTS option + add macro check_required_components() to configure_package_config_file() + Eclipse: fix #13036, make version detection work with symlinks + guard eCos.cmake against multiple inclusion (#12987) + +Alexandru Ciobanu (2): + CTest: Detect Xcode error "Command ... failed with exit code" + CTest: Match valgrind errors with "points to" (#12922) + +Alexey Ozeritsky (1): + FindBLAS/FindLAPACK: Work with MKL version 10.3 (#12924, #12925) + +Artur Kedzierski (1): + Add CURL_CA_BUNDLE option for SSL support (#12946) + +Bill Hoffman (12): + Add CMakeAddFortranSubdirectory to use MinGW gfortran in VS + VSGNUFortran: Add special case for SunPro Fortran runtime library + VSGNUFortran: Disable test in special cases + CMakeAddFortranSubdirectory: Make IMPORTED targets GLOBAL + Use upgraded qt on linux build machine. + Teach CTest what a ninja error looks like. + Allow two cmake_add_fortran_subdirectory calls in the same project. + Add ability to include a file in a project via a cache variable. + Fix typo in error message, and remove redundent test. + Ninja: Add a cache option CMAKE_ENABLE_NINJA to enable the ninja generator. + Ninja: Fix for PDB files with spaces in the path. + Fix FindMPI for the intel compiler on linux by looking in implict directories. + +Bjoern Ricks (1): + Fix crash if app bundle executeable couldn't be found + +Brad King (138): + CheckCCompilerFlag: Generalize "but not for C" case (#12633) + complex: Remove ancient unused ComplexRelativePaths test + complex: Sync Tests/ComplexOneConfig with Tests/Complex + complex: Remove dynamic loader tests + complex: Move GeneratedFileStream test to CMakeLibTests + complex: Simplify test for single-character exe name + complex: Move cmSystemTools::UpperCase test to CMakeLibTests + complex: Remove test dependence on cmSystemTools + complex: Remove unused option to test CMakeLib + Intel: Fix Windows per-config Fortran flags (#12642) + libarchive: Remove our copy to make room for new import + libarchive: Add .gitattributes for indentation with tab + libarchive: Add README-CMake.txt + libarchive: Do not build subdirectories not in reduced snapshot + libarchive: Remove -Wall -Werror from build with GNU + libarchive: Build one static cmlibarchive for CMake + libarchive: Include cm_zlib.h to get zlib used by CMake + Handle libarchive API change in archive_read_data_block + Configure libarchive build within CMake + libarchive: Install COPYING with CMake documentation + libarchive: Port to OSF operating system + libarchive: Fix typo in CheckFileOffsetBits + libarchive: Implement custom lseek for Borland + libarchive: Declare mbstate_t and wcrtomb for Borland + libarchive: Cast constants to int64_t instead of using LL suffix + libarchive: Workaround case-insensitive symbols on Borland + libarchive: Clean up configuration within CMake build + libarchive: Cast mode constants to mode_t in case it is signed + libarchive: Fix Windows NT API usage in VS 6 + libarchive: Suppress compiler warnings + libarchive: Fix var decl after statement in archive_string.c + libarchive: Do not use ST_NOATIME if not defined + libarchive: Check for 'struct statvfs' member 'f_iosize' + libarchive: Do not use MNT_NOATIME if not defined + libarchive: Use Apple copyfile.h API only if available + libarchive: Remove hard-coded build configuration + libarchive: Cleanup after ZLIB_WINAPI check + libarchive: Define _XOPEN_SOURCE=500 on HP-UX + libarchive: Include linux/types.h before linux/fiemap.h + libarchive: Rename isoent_rr_move_dir parameter isoent => curent + libarchive: Suppress PathScale compiler warnings + libarchive: Avoid bogus conversion warning from PGI compiler + libarchive: Set .gitattributes to allow trailing whitespace + libarchive: Update README-CMake.txt for new snapshot + libarchive: Restore CMake 2.6.3 as minimum version + bootstrap: Update copyright year in version report + bootstrap: Re-implement command line option processing + bootstrap: Forward options after '--' to cmake + VS10: Fix /pdb option vcxproj element name (#12328) + Add framework to detect compiler version with its id (#12408) + Detect GNU compiler version with its id (#6251) + Detect MSVC compiler version with its id + Detect Intel compiler version with its id (#11937) + Detect Borland compiler version with its id + Detect IBM XL compiler version with its id + Detect PGI compiler version with its id + Detect Clang compiler version with its id + Detect Watcom compiler version with its id + Detect SunPro compiler version with its id + Detect HP compiler version with its id + Document compiler version macro formats used for detection + Detect SGI MIPSpro compiler version with its id + ExternalProject: Fix git.cmd version detection + ExternalProject: Update copyright year + Include bzlib.h consistently across CMake build (#10950) + FindMPI: Append MPI C++ library correctly in non-compiler case (#12874) + Add infrastructure for CMake-only tests + Tolerate cycles in shared library link interfaces (#12647) + cmInstallCommand: Fix line length for style + cmake-mode.el: Indent after multiline argument (#12908) + Clarify IMPORTED_ target property documentation + Optionally allow IMPORTED targets to be globally visible + Add test covering imported target scope rules + VS: Simplify ;-separated attribute value parsing + Fix CXX/Fortran MODULE flags when enabled before C (#12929) + Remove unused test code + Allow directory names containing '=' and warn if necessary (#12934) + Add CheckLanguage module + CMakeAddFortranSubdirectory: Allow full paths to directories + CMakeAddFortranSubdirectory: Fix documentation format and typos + CMakeAddFortranSubdirectory: Find gfortran in PATH + CMakeAddFortranSubdirectory: Validate gfortran architecture + CMakeAddFortranSubdirectory: Always parse arguments + CMakeAddFortranSubdirectory: Add NO_EXTERNAL_INSTALL option + libarchive: Workaround mbsnrtowcs assertion failure on old glibc + Recognize OpenBSD versioned .so names (#12954) + try_compile: Use random executable file name (#12957) + Rename Modules/Platform/Windows-{Borland => Embarcadero}.cmake + Recognize Embarcadero compiler (#12604) + Factor cmInstallType out of cmTarget::TargetType + Add infrastructure for CMakeCommands tests + find_package: Reject mixed use of MODULE- and CONFIG-only options + find_package: Optionally warn when implicitly using Config mode + find_package: Test error and warning messages in failure cases + bootstrap: Convert MSYS paths to Windows format (#13001) + CTest.UpdateHG: Fix repo URL for local filesystem (#13001) + cmcurl: Do not hard-coded Windows check results for MinGW (#13001) + CheckSourceTree: Remove CVS checkout support (#13001) + Fix MSYS CVS local test repo path format (#13001) + find_package: Test that REQUIRED aborts processing correctly + Remove unused partial OBJECT_FILES property implementation + VS: Simplify object name computation + Hide Makefile local object info inside local generator + KWIML: Make test_INT robust to #define-d int#_t and INT#_C + Add stronger infrastructure for CMake-only tests + Use generalized RunCMake test infrastrucure for find_package test + Use generalized RunCMake test infrastrucure for build_command test + Document Fortran_MODULE_DIRECTORY as OUTPUT only (#13034) + Ninja: Constify use of cmCustomCommand + Ninja: Avoid using 'this' in member initializers + Write CMakeCache.txt atomically (#13040) + Add cmGeneratorTarget to represent a target during generation + Create a cmGeneratorTarget for each cmTarget during generation + Simplify cmMakefileTargetGenerator using cmGeneratorTarget + Simplify cmVisualStudio10TargetGenerator using cmGeneratorTarget + Pre-compute object file names before Makefile generation + Pre-compute object file names before VS project generation + Remove unused cmSourceGroup method + Rename/constify build-time config placeholder lookup + Pre-compute and store target object directory in cmGeneratorTarget + Add OBJECT_LIBRARY target type + Build object library targets in Makefiles + Build object library targets in VS + Add $ expression to use an object library + Test OBJECT library success cases + Test OBJECT library failure cases + Test OBJECT library language propagation + Test OBJECT library use without other sources + Document OBJECT library type in add_library command + Simplify cmNinjaTargetGenerator using cmGeneratorTarget + Pre-compute object file names before Ninja generation + Build object library targets in Ninja + Ninja: Honor $ source expressions + find_package: Test rejection of required+optional components + Simplify cmVisualStudio10TargetGenerator source classification + VS10: Fix external objects generated outside target (#13047) + Fix ObjectLibrary test on Watcom + KWIML: Avoid conflict with C++11 user-defined literals + +Christian Andersson (1): + FindPythonLibs: Search for single-user installs on Windows + +Christopher Sean Morrison (1): + cmake-mode.el: Make indentation case-insensitive (#12995) + +Clinton Stimpson (14): + GetPrerequisites: Add support for @rpath on Mac OS X. + GetPrerequisites: Add support for @rpath on Mac OS X. + GetPrerequisites: Add test for @rpath support. + Fix new BundleUtilities test failure on Mac 10.4.x + Fix BundleUtilities test failure with space in build path. + cmake-gui: Improve interrupt granularity to fix bug 12649. + FindQt4: clarify warning message about incorrect Qt installation. + FindQt4: Add include directories for lupdate. + Fix paths/hints for finding qtmain. + DragNDrop: Fix problem with relocated files in Xcode 4.3 + Add test for DeployQt4.cmake + Fix for Qt4Deploy on some test machines. + Remove QtGui dependency in Qt4Deploy test and verify QtSql existance. + DeployQt4: Add path to Qt dlls on Windows. + +Daniel Nelson (1): + CPack Add top level directory in component install for Archive Generators + +David Cole (33): + Begin post-2.8.7 development + Release: Increase timeout for slow-testing cygwin build + Update dashmacmini2 release script to use Qt 4.6.3 + Update dashmacmini2 release script to use Qt 4.8.0 + Tests: Update drop site value for the Trilinos contract test + Update version of Qt for dashmacmini5 produced release binaries + CTestCustom: Suppress clang warning on the dashboard + CMake: Eliminate cmMakefile::IncludeDirectories + Remove cmMakefile::GetIncludeDirectories + Make search paths ordered and unique + Call ExpandVariablesInString for each target's INCLUDE_DIRECTORIES + Update the documentation regarding INCLUDE_DIRECTORIES. + Fix compiler error reported on older Borland dashboard. + Fix compiler warning reported on older Borland dashboard. + Fix shadowed variable warning on dashboard results + Remove trailing white space + Use correct "requires" line in cygwin setup hint file + VS6: Avoid _MBCS define when _SBCS is defined (#12189) + VS6: Avoid SBCS test on VS6 (#12189) + Suppress warnings occurring on the dashboards using the PGI compiler. + CPack: Fix retry logic when calls to hdiutil fail + Ninja: CMake: Adapt Ninja generator for per-target include dirs + Ninja: Add friend struct so it can access the private ConvertToNinjaPath. + Xcode: Detect new default locations of Xcode 4.3 bits and pieces (#12621) + CPack: Use real path to PackageMaker to find its version file (#12621) + Xcode: Re-factor code into GetObjectsNormalDirectory method + Xcode: Re-factor some existing methods into "FromPath" variants + Add a default source group for object files. + Allow txt files as ExtraSources in object library targets + Pre-compute object file names before Xcode generation + Build object library targets in Xcode + Xcode: Honor $ source expressions + Tests: Relax restrictions on version variable contents + +Deborah Pickett (1): + CPackRPM flag direcories with %dir in the generated spec file + +Droscy (1): + FindCxxTest: Add support for CxxTest 4 (#13022) + +Eric NOULARD (41): + Document undocumented (but existing) cpack options (fix #0010134) + Enhance bash completion file for cmake and ctest + Do not add the content of a file if it's a symlink. + CPackArchive restore default behavior and provide new variable. + CPackNSIS fix #0012935 switch from LOG_WARNING to avoid final error. + CPack begin the implementation of --help-command* and --help-variables* + Implement simple CMake script comment markup language. + CPack Documentation extraction from CMake script begins to work + Update bash completion file in order to handle new CPack doc options. + Suppress unused var, beautify code, avoid 1 extra newline. + Fix potential bad memory access, thanks to Eike + Calm down compiler warning about unused var + Really avoid compiler warning about unused vars + Fix another compiler warning due to a typo + Make the load of script documentation more efficient and dynamic. + Example of builtin variable documentation (i.e. only used in C++ source code). + Add missing section markup for CPackComponent + Create getDocumentedModulesListInDir which may be used in other context. + Fix non existent std::string::clear on VS6 + Avoid discovering system infos for documentation. Adding some path is enough. + Dynamically add documentation section specified in documented script. + Add structured documentation for NSIS + Add structure documentation for CPack Bundle generator + Suppress unecessary (now empty) doc sections + Correct copy/paste section name mistake + Put CPack DMG and PackageMaker doc in separate files + More documentation concerning CPack Components + Fix typo in end markup + Try to fix compile error on Win32-vs70 + Do not build RPM if path of the build tree contains space + Fix layout of the CPack Bundle documentation + Fix CPack Drag and Drop generator documentation layout. + Review and update CPack variable documentation. + Update CPackConfig template. + Provide template for CPack Cygwin generator specific variables. + Update CPack PackageMaker variable doc layout + Typo: Add missing ##end for ##module + Fix some typos in CPACK_SET_DESTDIR doc + Add some missing CPACK_NSIS_xxx doc and move some to common CPack section. + CPack STGZ put execute permission on all packages files (component case) + Handle CPACK_MONOLITHIC_INSTALL in some rare use cases. + +Eugene Golushkov (1): + VS: Add support for WinRT project properties (#12930) + +James Bigler (1): + Added support for curand, cusparse, npp, nvcuenc and nvcuvid libraries. + +Jason Erb (1): + FindwxWidgets: Add webview library (#12636) + +LibArchive Upstream (2): + libarchive 3.0.1-r3950 (reduced) + libarchive 3.0.2-r4051 (reduced) + +Matthias Kretz (1): + Improve checks for Open64 and g++ incompatible flags (#12119) + +Mattias Helsing (1): + CPack: Fix NSIS handling of privileged users (#12923) + +Michael Wild (1): + GenerateExportHeader: Fix wrong use of IS_ABSOLUTE (#12645) + +Mike McQuaid (5): + Don't use QT_LIBRARIES_PLUGINS by default. + Fix mismatched arguments. + Fix bad plugin paths. + Ensure libs are passed to BundleUtilities. + Fix plugin installation issues. + +Modestas Vainius (3): + various typo and formatting fixes in manual pages (#12975) + KWIML: Teach ABI.h that MIPS is biendian + Tests: Escape metachars before embedding paths into the regex (#12999) + +Nicolas Despres (5): + ccmake: Factor clear line. + ccmake: Extend clear line. + java: Factor jar output path. + java: Add CMAKE_JAVA_TARGET_OUTPUT_DIR optional variable. + java: Add CMAKE_JAVA_JAR_ENTRY_POINT optional variable. + +Peter Collingbourne (19): + Add cmSystemTools::TrimWhitespace function + Add executable with exports flag support to cmLocalGenerator::GetTargetFlags + Provide dependency file flags to generator + Ninja: Add the Ninja generator + Ninja: Fix a 79-col violation + Ninja: Remove some default arguments + Ninja: Appease various compilers + Ninja: Partially revert "win fixes: escape back slash/colon, use cd. as cmd.exe nop" + Ninja: Identifier encoding rules for ' ' and ':' + Ninja: Backslash rules for Windows + Ninja: Shell encode paths used in "cd" commands + Ninja: Shell encode various CMake invocations + Ninja: Shell encode the command used in custom commands + Ninja: Import library support for Windows + Ninja: Add a missed license header + Ninja: Use cmSystemTools::ExpandListArgument to split compile/link commands + Ninja: Remove an unnecessary variable + Ninja: add support for OBJECT_OUTPUTS, fix PrecompiledHeader test case + Ninja: shell escape $(CMAKE_SOURCE_DIR) and $(CMAKE_BINARY_DIR) + +Peter Kuemmel (12): + Find VC Express during default generator selection (#12917) + Ninja: win fixes: escape back slash/colon, use cd. as cmd.exe nop + Ninja: don't define MSVC_IDE when using the ninja generator + Ninja: also build ninja support on Windows + Ninja: add some hacks for Windows + Ninja: disable unfinished Windows ninja support + Ninja: mark the Windows specific hacks with a comment only + Ninja: windows msvc: create for each target a .pdb file + Ninja: ensure the output dir exists at compile time + Ninja: add .def file support + Ninja: add /DEF: flag to linker call + Ninja: Fix substitution + +Philip Lowman (5): + FindProtobuf: Merge patch that allows extra import dirs + FindProtobuf: Update documentation comment for 2.8.8 + Findosg: New modules for osgQt and osgPresentation + FindALSA: Fix incorrect include path detection + FindALSA: Fix version detection after last commit + +Rolf Eike Beer (95): + remove reference to CVS directory when installing files + CheckSymbolExists: force the compiler to keep the referenced symbol + add a test for Check{,CXX}SymbolExists + FindOpenSSL: improve version number handling + FindOpenSSL: only try to parse opensslv.h if it exists + FindOpenSSL: also parse version number define with uppercase letters + GenerateExportHeader test: add newlines before end of file + add a test that loops through most Find* modules + AllFindModules test: keep complete output + AllFindModules test: also check Qt3 modules if Qt4 is not found + FindPythonInterp: make version selectable + FindPythonInterp: fix version parsing + LoadCommand test: cleanup + FindThreads: Try pthreads with no special option first (#11333) + fix uninitialized var in if(NOT foo bar STREQUAL "foo bar") + use pkg_check_modules() quiet in other modules + FindLibXml2: support version selection + FindGnuTLS: partly support version selection + FindGit: support version number + FindCups: major overhaul + FindEXPAT: support version number + FindCURL: support version selection + FindFLEX: fix version parsing for old flex versions + FindFLEX: fix version parsing when the executable is quoted + FindJasper: find debug libraries + FindJasper: support version number + FindBZip2: add support for version checking + FindBZip2: add support for debug libraries (#12867) + FindImageMagick: make use of more FPHSA features + FindPNG: support version selection + FindRuby: do not blindly set version to 1.8.0 + FindTclsh: support version selection + SelectLibraryConfigurations: do not output identical configurations + FindLua51: add version support + FindTIFF: support version selection + FindCURL: detect version number also for older versions + FindLibXml2: detect version when PkgConfig is not used + FindPostgreSQL: support version selection + FindOpenSSL: properly parse the hex version components + FindBISON: add a version expression for GNU Bison 1.x + FindPythonInterp: try harder to get a version number + FindJasper: fix library name + FindGnuplot: add version selection + FindALSA: support version selection + FindGettext: support version selection + CheckCXXCompilerFlag test: make it a CMakeOnly test + CMakeOnly.AllFindModules: clean up the Qt3/Qt4 code + CMakeOnly.AllFindModules: always check FindQt + CMakeOnly.AllFindModules: suppress two modules from testing + CMakeOnly.AllFindModules: require version for some modules + CheckIncludeFiles: fix status output + FindPerl{,Libs}: move version detection into FindPerl + FindLibArchive: support version selection + FindX11: also search for Xmu (#12447) + detect "pgfortran" as PGI Fortran compiler (#12425) + FindSDL*: use FPHSA (#12467) + AllFindModules test: do not enforce GNUPLOT version + FindPerlLibs: properly detect libperl on Windows (#12224) + CTest: mark all gcov covered files as covered + FindGLUT: honor REQUIRED (#12466) + FindRuby: clean up querying variables from Ruby + FindLibXslt: support version selection + Tests: document where to put tests + FindPkgConfig: support version selection of pkg-config itself + fix the same typos as found by Debian in other places, too + Find_library(): allow searching for versioned shared objects + FindFreetype: support version selection + AllFindModules test: expect more modules to have a version number available + FindOpenMP: do not fail if only C or CXX is enabled (#11910) + FindOpenMP: try the most likely flags first + FindOpenMP: simplify check for enabled languages + UseSWIG: clean up string compares + FindPython{Interp,Libs}: document Python_ADDITIONAL_VERSIONS as input + FindPythonLibs: make the version selection work as for PythonInterp + FindPythonLibs: get the exact version of the found library (#3080) + FindPythonLibs: put debug libraries into PYTHON_LIBRARIES + FindPythonLibs: stop scanning when libraries are found + Check{C,CXX}CompilerFlag: detect ICC error messages + GenerateExportHeader: remove unneeded code + GenerateExportHeader: improve compiler identification + FindOpenSceneGraph: give every message() with an explicit level + FindHSPELL: set HSPELL_VERSION_STRING + FindImageMagick: fix fail if no components were given + FindPythonInterp: rework the version detection + document when version detection will not work + AllFindModules test: once again expand version checking + improve error message on a stray "endwhile()" + add testcases for while()/endwhile() errors + reflect that the QtAutomoc depends on QtGui + FindQt3: fix warning when Qt3 is not found + FindQt3: fix version extraction for versions with letters + FindQt3: let FPHSA handle the version selection + FindQt3: fix detection of Qt3 include directory + AllFindModules test: do not require TCLSH version + add test for get_property() errors + +Stephen Kelly (13): + Fix typos arguement -> argument. + Exit the loop when we have determined the language. + Add whitespace after '.' in CMAKE_SKIP_RPATH docs. + Fix documented function signature to match reality. + Add default initializers for WIN32_EXECUTABLE and MACOSX_BUNDLE + Add an option to skip RPATH during installation. + Refactor GetIncludeFlags to take includes instead of fetching them + Make it safe to call this method without creating duplicates. + Remove include flags memoization. + Add API to get the ordered includes for a target. + Keep the INCLUDE_DIRECTORIES target property up to date. + Extract and use the INCLUDE_DIRECTORIES target properties. + Fix some typos in the docs comments. + +Yury G. Kudryashov (23): + FindDoxygen: add DOXYGEN_VERSION variable + cmInstallCommand: Fix indentation error + cmInstallCommand: Remove duplicated sentence from docs + FindPkgConfig: respect REQUIRED (#12620) + FindPackageHandleStandardArgs: fix documentation + Remove unused file cmake.1 + Fix typo in documentation + Drop if(...) check because condition is always true + CMakeFindPackageMode: fix 32/64bit detection if 'file' is a symlink + Run vim spellcheck on some files + cmPropertyDefinition::IsChained is const + Add 'const' qualifier to some cmCommand members + doxygen: cmPropertyDefinition + doxygen: Improve API docs of GetRealDependency + doxygen: Use proper syntax to document enum + doxygen: Small fixes in cmake.h apidocs + doxygen: fix some comments in cmPolicies.h + doxygen: remove a few comments + doxygen: review cmake.h + doxygen: MathCommand is not about string operators + Rename UsedCommands to FinalPassCommands + Remove UnionsAvailable member from 2 classes + Remove cmExprParserHelper::SetLineFile() + Changes in CMake 2.8.7 (since 2.8.7-rc2) -------------------------------------------- None diff -Nru cmake-2.8.7/Docs/CMakeLists.txt cmake-2.8.9/Docs/CMakeLists.txt --- cmake-2.8.7/Docs/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Docs/CMakeLists.txt 2012-08-09 18:15:18.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Docs/bash-completion/CMakeLists.txt cmake-2.8.9/Docs/bash-completion/CMakeLists.txt --- cmake-2.8.7/Docs/bash-completion/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Docs/bash-completion/CMakeLists.txt 2012-08-09 18:15:18.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Docs/bash-completion/cmake cmake-2.8.9/Docs/bash-completion/cmake --- cmake-2.8.7/Docs/bash-completion/cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Docs/bash-completion/cmake 2012-08-09 18:15:18.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Docs/bash-completion/cpack cmake-2.8.9/Docs/bash-completion/cpack --- cmake-2.8.7/Docs/bash-completion/cpack 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Docs/bash-completion/cpack 2012-08-09 18:15:18.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Docs/bash-completion/ctest cmake-2.8.9/Docs/bash-completion/ctest --- cmake-2.8.7/Docs/bash-completion/ctest 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Docs/bash-completion/ctest 2012-08-09 18:15:18.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Docs/cmake-completion cmake-2.8.9/Docs/cmake-completion --- cmake-2.8.7/Docs/cmake-completion 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Docs/cmake-completion 1970-01-01 00:00:00.000000000 +0000 @@ -1,190 +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 - ;; - --help-command) - local running=$(for x in `cmake --help-command-list`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - --help-module) - local running=$(for x in `cmake --help-module-list`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - --help-policy) - local running=$(for x in `cmake --help-policies | grep "^ CMP"`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - --help-property) - local running=$(for x in `cmake --help-property-list`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - --help-variable) - local running=$(for x in `cmake --help-variable-list`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - *) - ;; - esac - - # - # Complete the arguments to some of - # the most commonly used commands (Level 2). - # ?? How to do that .. - - # - # Complete the option (Level 0 - right after cmake) - # - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) -} && -complete -F _cmake -o default cmake - -# -# cpack command -# -#have cpack && -_cpack() -{ - local cur prev opts words cword - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - # seems to be only available on bash-completion 1.2 - #_get_comp_words_by_ref cur prev - - # cpack command line option we want to complete - opts=`cpack --help | grep "^ \-.*=\ .*" | cut -d" " -f 3 | cut -d= -f 1` - opts="${opts} --help -V" - - # - # Complete the arguments to some of - # the most commonly used commands (Level 1). - # - case "${prev}" in - -G) - local running=$(for x in `cpack --help | grep "^ .*=\ .*" | grep -v "^ -" | cut -d" " -f 3`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - --config) - COMPREPLY=( $(compgen -f ${cur}) ) - return 0 - ;; - *) - ;; - esac - - # - # Complete the option (Level 0 - right after cmake) - # - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) -} && -complete -F _cpack -o default cpack - -# -# cmake command -# -# have ctest && -_ctest() -{ - local cur prev opts words cword - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - # seems to be only available on bash-completion 1.2 - #_get_comp_words_by_ref cur prev - - # cmake command line option we want to complete - opts=`ctest --help | grep "\-\-.*" | cut -d" " -f 3 | sed s/,/\\\n/g` - - # - # Complete the arguments to some of - # the most commonly used commands (Level 1). - # - case "${prev}" in - --help-command) - local running=$(for x in `ctest --help-command-list`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - -R) - local running=$(for x in `ctest -N 2> /dev/null | grep "^ Test" | cut -d: -f 2`; do echo ${x} ; done ) - COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) - return 0 - ;; - *) - ;; - esac - - # - # Complete the arguments to some of - # the most commonly used commands (Level 2). - # ?? How to do that .. - - # - # Complete the option (Level 0 - right after cmake) - # - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) -} && -complete -F _ctest -o default ctest - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: ts=4 sw=4 et filetype=sh \ No newline at end of file diff -Nru cmake-2.8.7/Docs/cmake-mode.el cmake-2.8.9/Docs/cmake-mode.el --- cmake-2.8.7/Docs/cmake-mode.el 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Docs/cmake-mode.el 2012-08-09 18:15:18.000000000 +0000 @@ -68,9 +68,9 @@ "\\|" "[ \t\r\n]" "\\)*")) (defconst cmake-regex-block-open - "^\\(IF\\|MACRO\\|FOREACH\\|ELSE\\|ELSEIF\\|WHILE\\|FUNCTION\\)$") + "^\\([iI][fF]\\|[mM][aA][cC][rR][oO]\\|[fF][oO][rR][eE][aA][cC][hH]\\|[eE][lL][sS][eE]\\|[eE][lL][sS][eE][iI][fF]\\|[wW][hH][iI][lL][eE]\\|[fF][uU][nN][cC][tT][iI][oO][nN]\\)$") (defconst cmake-regex-block-close - "^[ \t]*\\(ENDIF\\|ENDFOREACH\\|ENDMACRO\\|ELSE\\|ELSEIF\\|ENDWHILE\\|ENDFUNCTION\\)[ \t]*(") + "^[ \t]*\\([eE][nN][dD][iI][fF]\\|[eE][nN][dD][fF][oO][rR][eE][aA][cC][hH]\\|[eE][nN][dD][mM][aA][cC][rR][oO]\\|[eE][lL][sS][eE]\\|[eE][lL][sS][eE][iI][fF]\\|[eE][nN][dD][wW][hH][iI][lL][eE]\\|[eE][nN][dD][fF][uU][nN][cC][tT][iI][oO][nN]\\)[ \t]*(") ;------------------------------------------------------------------------------ @@ -99,6 +99,7 @@ (setq region (buffer-substring-no-properties (point) point-start)) (while (and (not (bobp)) (or (looking-at cmake-regex-blank) + (cmake-line-starts-inside-string) (not (and (string-match cmake-regex-indented region) (= (length region) (match-end 0)))))) (forward-line -1) diff -Nru cmake-2.8.7/Modules/AutomocInfo.cmake.in cmake-2.8.9/Modules/AutomocInfo.cmake.in --- cmake-2.8.7/Modules/AutomocInfo.cmake.in 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/AutomocInfo.cmake.in 2012-08-09 18:15:18.000000000 +0000 @@ -1,9 +1,9 @@ -set(AM_SOURCES "@_moc_files@" ) -set(AM_HEADERS "@_moc_headers@" ) -set(AM_MOC_COMPILE_DEFINITIONS "@_moc_compile_defs@") -set(AM_MOC_DEFINITIONS "@_moc_defs@") -set(AM_MOC_INCLUDES "@_moc_incs@") -set(AM_MOC_OPTIONS "@_moc_options@") +set(AM_SOURCES @_moc_files@ ) +set(AM_HEADERS @_moc_headers@ ) +set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@) +set(AM_MOC_DEFINITIONS @_moc_defs@) +set(AM_MOC_INCLUDES @_moc_incs@) +set(AM_MOC_OPTIONS @_moc_options@) set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@") set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/") set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/") @@ -12,5 +12,5 @@ set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/") set(AM_QT_VERSION_MAJOR "@QT_VERSION_MAJOR@" ) set(AM_Qt5Core_VERSION_MAJOR "@Qt5Core_VERSION_MAJOR@" ) -set(AM_TARGET_NAME "@_moc_target_name@") +set(AM_TARGET_NAME @_moc_target_name@) set(AM_RELAXED_MODE "@_moc_relaxed_mode@") diff -Nru cmake-2.8.7/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in cmake-2.8.9/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in --- cmake-2.8.7/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in 2012-08-09 18:15:18.000000000 +0000 @@ -18,6 +18,11 @@ 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 -Nru cmake-2.8.7/Modules/BasicConfigVersion-ExactVersion.cmake.in cmake-2.8.9/Modules/BasicConfigVersion-ExactVersion.cmake.in --- cmake-2.8.7/Modules/BasicConfigVersion-ExactVersion.cmake.in 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/BasicConfigVersion-ExactVersion.cmake.in 2012-08-09 18:15:18.000000000 +0000 @@ -0,0 +1,47 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is equal to the requested version. +# The tweak version component is ignored. +# The variable CVF_VERSION must be set before calling configure_file(). + + +set(PACKAGE_VERSION "@CVF_VERSION@") + +if("@CVF_VERSION@" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\..*") # strip the tweak version + set(CVF_VERSION_NO_TWEAK "${CMAKE_MATCH_1}") +else() + set(CVF_VERSION_NO_TWEAK "@CVF_VERSION@") +endif() + +if("${PACKAGE_FIND_VERSION}" MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)\\..*") # strip the tweak version + set(REQUESTED_VERSION_NO_TWEAK "${CMAKE_MATCH_1}") +else() + set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}") +endif() + +if("${REQUESTED_VERSION_NO_TWEAK}" STREQUAL "${CVF_VERSION_NO_TWEAK}") + set(PACKAGE_VERSION_COMPATIBLE TRUE) +else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) +endif() + +if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) +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") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff -Nru cmake-2.8.7/Modules/BasicConfigVersion-SameMajorVersion.cmake.in cmake-2.8.9/Modules/BasicConfigVersion-SameMajorVersion.cmake.in --- cmake-2.8.7/Modules/BasicConfigVersion-SameMajorVersion.cmake.in 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/BasicConfigVersion-SameMajorVersion.cmake.in 2012-08-09 18:15:18.000000000 +0000 @@ -33,6 +33,11 @@ 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 -Nru cmake-2.8.7/Modules/CMakeAddFortranSubdirectory/build_mingw.cmake.in cmake-2.8.9/Modules/CMakeAddFortranSubdirectory/build_mingw.cmake.in --- cmake-2.8.7/Modules/CMakeAddFortranSubdirectory/build_mingw.cmake.in 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeAddFortranSubdirectory/build_mingw.cmake.in 2012-08-09 18:15:18.000000000 +0000 @@ -0,0 +1,2 @@ +set(ENV{PATH} "@MINGW_PATH@\;$ENV{PATH}") +execute_process(COMMAND "@CMAKE_COMMAND@" --build . ) diff -Nru cmake-2.8.7/Modules/CMakeAddFortranSubdirectory/config_mingw.cmake.in cmake-2.8.9/Modules/CMakeAddFortranSubdirectory/config_mingw.cmake.in --- cmake-2.8.7/Modules/CMakeAddFortranSubdirectory/config_mingw.cmake.in 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeAddFortranSubdirectory/config_mingw.cmake.in 2012-08-09 18:15:18.000000000 +0000 @@ -0,0 +1,9 @@ +set(ENV{PATH} "@MINGW_PATH@\;$ENV{PATH}") +set(CMAKE_COMMAND_LINE "@ARGS_CMAKE_COMMAND_LINE@") +execute_process( + COMMAND "@CMAKE_COMMAND@" "-GMinGW Makefiles" + -DCMAKE_Fortran_COMPILER:PATH=@MINGW_GFORTRAN@ + -DBUILD_SHARED_LIBS=ON + -DCMAKE_GNUtoMS=ON + ${CMAKE_COMMAND_LINE} + "@source_dir@") diff -Nru cmake-2.8.7/Modules/CMakeAddFortranSubdirectory.cmake cmake-2.8.9/Modules/CMakeAddFortranSubdirectory.cmake --- cmake-2.8.7/Modules/CMakeAddFortranSubdirectory.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeAddFortranSubdirectory.cmake 2012-08-09 18:15:18.000000000 +0000 @@ -0,0 +1,206 @@ +# - Use MinGW gfortran from VS if a fortran compiler is not found. +# The 'add_fortran_subdirectory' function adds a subdirectory +# to a project that contains a fortran only sub-project. The module +# will check the current compiler and see if it can support fortran. +# If no fortran compiler is found and the compiler is MSVC, then +# this module will find the MinGW gfortran. It will then use +# an external project to build with the MinGW tools. It will also +# create imported targets for the libraries created. This will only +# work if the fortran code is built into a dll, so BUILD_SHARED_LIBS +# is turned on in the project. In addition the CMAKE_GNUtoMS option +# is set to on, so that the MS .lib files are created. +# Usage is as follows: +# cmake_add_fortran_subdirectory( +# # name of subdirectory +# PROJECT # project name in subdir top CMakeLists.txt +# ARCHIVE_DIR # dir where project places .lib files +# RUNTIME_DIR # dir where project places .dll files +# LIBRARIES ... # names of library targets to import +# LINK_LIBRARIES # link interface libraries for LIBRARIES +# [LINK_LIBS ...]... +# CMAKE_COMMAND_LINE ... # extra command line flags to pass to cmake +# NO_EXTERNAL_INSTALL # skip installation of external project +# ) +# Relative paths in ARCHIVE_DIR and RUNTIME_DIR are interpreted with respect +# to the build directory corresponding to the source directory in which the +# function is invoked. +# +# Limitations: +# +# NO_EXTERNAL_INSTALL is required for forward compatibility with a +# future version that supports installation of the external project +# binaries during "make install". + +#============================================================================= +# Copyright 2011-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.) + + +set(_MS_MINGW_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}) +include(CheckLanguage) +include(ExternalProject) +include(CMakeParseArguments) + +function(_setup_mingw_config_and_build source_dir build_dir) + # Look for a MinGW gfortran. + find_program(MINGW_GFORTRAN + NAMES gfortran + PATHS + c:/MinGW/bin + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin" + ) + if(NOT MINGW_GFORTRAN) + message(FATAL_ERROR + "gfortran not found, please install MinGW with the gfortran option." + "Or set the cache variable MINGW_GFORTRAN to the full path. " + " This is required to build") + endif() + + # Validate the MinGW gfortran we found. + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(_mingw_target "Target:.*64.*mingw") + else() + set(_mingw_target "Target:.*mingw32") + endif() + execute_process(COMMAND "${MINGW_GFORTRAN}" -v + ERROR_VARIABLE out ERROR_STRIP_TRAILING_WHITESPACE) + if(NOT "${out}" MATCHES "${_mingw_target}") + string(REPLACE "\n" "\n " out " ${out}") + message(FATAL_ERROR + "MINGW_GFORTRAN is set to\n" + " ${MINGW_GFORTRAN}\n" + "which is not a MinGW gfortran for this architecture. " + "The output from -v does not match \"${_mingw_target}\":\n" + "${out}\n" + "Set MINGW_GFORTRAN to a proper MinGW gfortran for this architecture." + ) + endif() + + # Configure scripts to run MinGW tools with the proper PATH. + get_filename_component(MINGW_PATH ${MINGW_GFORTRAN} PATH) + file(TO_NATIVE_PATH "${MINGW_PATH}" MINGW_PATH) + string(REPLACE "\\" "\\\\" MINGW_PATH "${MINGW_PATH}") + configure_file( + ${_MS_MINGW_SOURCE_DIR}/CMakeAddFortranSubdirectory/config_mingw.cmake.in + ${build_dir}/config_mingw.cmake + @ONLY) + configure_file( + ${_MS_MINGW_SOURCE_DIR}/CMakeAddFortranSubdirectory/build_mingw.cmake.in + ${build_dir}/build_mingw.cmake + @ONLY) +endfunction() + +function(_add_fortran_library_link_interface library depend_library) + set_target_properties(${library} PROPERTIES + IMPORTED_LINK_INTERFACE_LIBRARIES_NOCONFIG "${depend_library}") +endfunction() + + +function(cmake_add_fortran_subdirectory subdir) + # Parse arguments to function + set(options NO_EXTERNAL_INSTALL) + set(oneValueArgs PROJECT ARCHIVE_DIR RUNTIME_DIR) + set(multiValueArgs LIBRARIES LINK_LIBRARIES CMAKE_COMMAND_LINE) + cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + if(NOT ARGS_NO_EXTERNAL_INSTALL) + message(FATAL_ERROR + "Option NO_EXTERNAL_INSTALL is required (for forward compatibility) " + "but was not given." + ) + endif() + + # if we are not using MSVC without fortran support + # then just use the usual add_subdirectory to build + # the fortran library + check_language(Fortran) + if(NOT (MSVC AND (NOT CMAKE_Fortran_COMPILER))) + add_subdirectory(${subdir}) + return() + endif() + + # if we have MSVC without Intel fortran then setup + # external projects to build with mingw fortran + + set(source_dir "${CMAKE_CURRENT_SOURCE_DIR}/${subdir}") + set(project_name "${ARGS_PROJECT}") + set(library_dir "${ARGS_ARCHIVE_DIR}") + set(binary_dir "${ARGS_RUNTIME_DIR}") + set(libraries ${ARGS_LIBRARIES}) + # use the same directory that add_subdirectory would have used + set(build_dir "${CMAKE_CURRENT_BINARY_DIR}/${subdir}") + foreach(dir_var library_dir binary_dir) + if(NOT IS_ABSOLUTE "${${dir_var}}") + get_filename_component(${dir_var} + "${CMAKE_CURRENT_BINARY_DIR}/${${dir_var}}" ABSOLUTE) + endif() + endforeach() + # create build and configure wrapper scripts + _setup_mingw_config_and_build("${source_dir}" "${build_dir}") + # create the external project + externalproject_add(${project_name}_build + SOURCE_DIR ${source_dir} + BINARY_DIR ${build_dir} + CONFIGURE_COMMAND ${CMAKE_COMMAND} + -P ${build_dir}/config_mingw.cmake + BUILD_COMMAND ${CMAKE_COMMAND} + -P ${build_dir}/build_mingw.cmake + INSTALL_COMMAND "" + ) + # make the external project always run make with each build + externalproject_add_step(${project_name}_build forcebuild + COMMAND ${CMAKE_COMMAND} + -E remove + ${CMAKE_CURRENT_BUILD_DIR}/${project_name}-prefix/src/${project_name}-stamp/${project_name}-build + DEPENDEES configure + DEPENDERS build + ALWAYS 1 + ) + # create imported targets for all libraries + foreach(lib ${libraries}) + add_library(${lib} SHARED IMPORTED GLOBAL) + set_property(TARGET ${lib} APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) + set_target_properties(${lib} PROPERTIES + IMPORTED_IMPLIB_NOCONFIG "${library_dir}/lib${lib}.lib" + IMPORTED_LOCATION_NOCONFIG "${binary_dir}/lib${lib}.dll" + ) + add_dependencies(${lib} ${project_name}_build) + endforeach() + + # now setup link libraries for targets + set(start FALSE) + set(target) + foreach(lib ${ARGS_LINK_LIBRARIES}) + if("${lib}" STREQUAL "LINK_LIBS") + set(start TRUE) + else() + if(start) + if(DEFINED target) + # process current target and target_libs + _add_fortran_library_link_interface(${target} "${target_libs}") + # zero out target and target_libs + set(target) + set(target_libs) + endif() + # save the current target and set start to FALSE + set(target ${lib}) + set(start FALSE) + else() + # append the lib to target_libs + list(APPEND target_libs "${lib}") + endif() + endif() + endforeach() + # process anything that is left in target and target_libs + if(DEFINED target) + _add_fortran_library_link_interface(${target} "${target_libs}") + endif() +endfunction() diff -Nru cmake-2.8.7/Modules/CMakeCCompiler.cmake.in cmake-2.8.9/Modules/CMakeCCompiler.cmake.in --- cmake-2.8.7/Modules/CMakeCCompiler.cmake.in 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeCCompiler.cmake.in 2012-08-09 18:15:18.000000000 +0000 @@ -1,6 +1,7 @@ SET(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@") SET(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@") SET(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@") +SET(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@") SET(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@") @SET_MSVC_C_ARCHITECTURE_ID@ SET(CMAKE_AR "@CMAKE_AR@") @@ -47,3 +48,6 @@ 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 -Nru cmake-2.8.7/Modules/CMakeCCompilerId.c.in cmake-2.8.9/Modules/CMakeCCompilerId.c.in --- cmake-2.8.7/Modules/CMakeCCompilerId.c.in 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeCCompilerId.c.in 2012-08-09 18:15:18.000000000 +0000 @@ -2,27 +2,68 @@ # error "A C++ compiler has been selected for C." #endif +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + #if defined(__18CXX) # define ID_VOID_MAIN #endif #if defined(__INTEL_COMPILER) || defined(__ICC) # define COMPILER_ID "Intel" + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif #elif defined(__clang__) # define COMPILER_ID "Clang" +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF) #elif defined(__BORLANDC__) # define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) #elif defined(__WATCOMC__) # define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100) #elif defined(__SUNPRO_C) # define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_C = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif #elif defined(__HP_cc) # define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) #elif defined(__DECC) # define COMPILER_ID "Compaq" @@ -30,14 +71,25 @@ #elif defined(__IBMC__) # if defined(__COMPILER_VER__) # define COMPILER_ID "zOS" -# elif __IBMC__ >= 800 -# define COMPILER_ID "XL" # else -# define COMPILER_ID "VisualAge" +# if __IBMC__ >= 800 +# define COMPILER_ID "XL" +# else +# define COMPILER_ID "VisualAge" +# endif + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) # endif #elif defined(__PGI) # define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif #elif defined(__PATHSCALE__) # define COMPILER_ID "PathScale" @@ -56,9 +108,29 @@ #elif defined(__GNUC__) # define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif #elif defined(_MSC_VER) # define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) /* Analog Devices C++ compiler for Blackfin, TigerSHARC and @@ -78,6 +150,17 @@ #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) # define COMPILER_ID "MIPSpro" +# if defined(_SGI_COMPILER_VERSION) + /* _SGI_COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) +# else + /* _COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) +# endif /* This compiler is either not known or is too old to define an identification macro. Try to identify the platform and guess that @@ -112,6 +195,9 @@ require += info_compiler[argc]; require += info_platform[argc]; require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif (void)argv; return require; } diff -Nru cmake-2.8.7/Modules/CMakeCInformation.cmake cmake-2.8.9/Modules/CMakeCInformation.cmake --- cmake-2.8.7/Modules/CMakeCInformation.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeCInformation.cmake 2012-08-09 18:15:18.000000000 +0000 @@ -164,7 +164,7 @@ # 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 -Nru cmake-2.8.7/Modules/CMakeCXXCompiler.cmake.in cmake-2.8.9/Modules/CMakeCXXCompiler.cmake.in --- cmake-2.8.7/Modules/CMakeCXXCompiler.cmake.in 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeCXXCompiler.cmake.in 2012-08-09 18:15:18.000000000 +0000 @@ -1,6 +1,7 @@ SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@") SET(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@") SET(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@") +SET(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@") SET(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@") @SET_MSVC_CXX_ARCHITECTURE_ID@ SET(CMAKE_AR "@CMAKE_AR@") @@ -48,3 +49,6 @@ 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 -Nru cmake-2.8.7/Modules/CMakeCXXCompilerId.cpp.in cmake-2.8.9/Modules/CMakeCXXCompilerId.cpp.in --- cmake-2.8.7/Modules/CMakeCXXCompilerId.cpp.in 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeCXXCompilerId.cpp.in 2012-08-09 18:15:18.000000000 +0000 @@ -5,26 +5,67 @@ # error "A C compiler has been selected for C++." #endif +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + #if defined(__COMO__) # define COMPILER_ID "Comeau" #elif defined(__INTEL_COMPILER) || defined(__ICC) # define COMPILER_ID "Intel" + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif #elif defined(__clang__) # define COMPILER_ID "Clang" +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF) #elif defined(__BORLANDC__) # define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) #elif defined(__WATCOMC__) # define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100) #elif defined(__SUNPRO_CC) # define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif #elif defined(__HP_aCC) # define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) #elif defined(__DECCXX) # define COMPILER_ID "Compaq" @@ -32,14 +73,25 @@ #elif defined(__IBMCPP__) # if defined(__COMPILER_VER__) # define COMPILER_ID "zOS" -# elif __IBMCPP__ >= 800 -# define COMPILER_ID "XL" # else -# define COMPILER_ID "VisualAge" +# if __IBMCPP__ >= 800 +# define COMPILER_ID "XL" +# else +# define COMPILER_ID "VisualAge" +# endif + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) # endif #elif defined(__PGI) # define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif #elif defined(__PATHSCALE__) # define COMPILER_ID "PathScale" @@ -55,9 +107,29 @@ #elif defined(__GNUC__) # define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif #elif defined(_MSC_VER) # define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) /* Analog Devices C++ compiler for Blackfin, TigerSHARC and @@ -66,6 +138,17 @@ #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) # define COMPILER_ID "MIPSpro" +# if defined(_SGI_COMPILER_VERSION) + /* _SGI_COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) +# else + /* _COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) +# endif /* This compiler is either not known or is too old to define an identification macro. Try to identify the platform and guess that @@ -96,6 +179,9 @@ int require = 0; require += info_compiler[argc]; require += info_platform[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif (void)argv; return require; } diff -Nru cmake-2.8.7/Modules/CMakeCXXInformation.cmake cmake-2.8.9/Modules/CMakeCXXInformation.cmake --- cmake-2.8.7/Modules/CMakeCXXInformation.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeCXXInformation.cmake 2012-08-09 18:15:18.000000000 +0000 @@ -93,12 +93,6 @@ ENDIF() -# for most systems a module is the same as a shared library -# so unless the variable CMAKE_MODULE_EXISTS is set just -# copy the values from the LIBRARY variables -IF(NOT CMAKE_MODULE_EXISTS) - SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) -ENDIF(NOT CMAKE_MODULE_EXISTS) # Create a set of shared library variable specific to C++ # For 90% of the systems, these are the same flags as the C versions # so if these are not set just copy the flags from the c version @@ -106,6 +100,18 @@ 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) @@ -158,6 +164,14 @@ SET(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C}) ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX) +# for most systems a module is the same as a shared library +# so unless the variable CMAKE_MODULE_EXISTS is set just +# copy the values from the LIBRARY variables +IF(NOT CMAKE_MODULE_EXISTS) + SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) + SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}) +ENDIF(NOT CMAKE_MODULE_EXISTS) + # repeat for modules IF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS) SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) @@ -240,7 +254,7 @@ # 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 -Nru cmake-2.8.7/Modules/CMakeClDeps.cmake cmake-2.8.9/Modules/CMakeClDeps.cmake --- cmake-2.8.7/Modules/CMakeClDeps.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeClDeps.cmake 2012-08-09 18:15:18.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/CMakeDetermineCCompiler.cmake cmake-2.8.9/Modules/CMakeDetermineCCompiler.cmake --- cmake-2.8.7/Modules/CMakeDetermineCCompiler.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeDetermineCCompiler.cmake 2012-08-09 18:15:18.000000000 +0000 @@ -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 @@ 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 -Nru cmake-2.8.7/Modules/CMakeDetermineCXXCompiler.cmake cmake-2.8.9/Modules/CMakeDetermineCXXCompiler.cmake --- cmake-2.8.7/Modules/CMakeDetermineCXXCompiler.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeDetermineCXXCompiler.cmake 2012-08-09 18:15:18.000000000 +0000 @@ -173,6 +173,7 @@ 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 -Nru cmake-2.8.7/Modules/CMakeDetermineCompilerId.cmake cmake-2.8.9/Modules/CMakeDetermineCompilerId.cmake --- cmake-2.8.7/Modules/CMakeDetermineCompilerId.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeDetermineCompilerId.cmake 2012-08-09 18:15:18.000000000 +0000 @@ -55,8 +55,13 @@ # Display the final identification result. IF(CMAKE_${lang}_COMPILER_ID) + IF(CMAKE_${lang}_COMPILER_VERSION) + SET(_version " ${CMAKE_${lang}_COMPILER_VERSION}") + ELSE() + SET(_version "") + ENDIF() MESSAGE(STATUS "The ${lang} compiler identification is " - "${CMAKE_${lang}_COMPILER_ID}") + "${CMAKE_${lang}_COMPILER_ID}${_version}") ELSE(CMAKE_${lang}_COMPILER_ID) MESSAGE(STATUS "The ${lang} compiler identification is unknown") ENDIF(CMAKE_${lang}_COMPILER_ID) @@ -65,6 +70,7 @@ SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE) SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" PARENT_SCOPE) + SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID) #----------------------------------------------------------------------------- @@ -177,9 +183,10 @@ IF(NOT CMAKE_${lang}_COMPILER_ID) # Read the compiler identification string from the executable file. SET(COMPILER_ID) + SET(COMPILER_VERSION) SET(PLATFORM_ID) FILE(STRINGS ${file} - CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 3 REGEX "INFO:") + CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 4 REGEX "INFO:") SET(HAVE_COMPILER_TWICE 0) FOREACH(info ${CMAKE_${lang}_COMPILER_ID_STRINGS}) IF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*") @@ -197,6 +204,11 @@ STRING(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1" ARCHITECTURE_ID "${info}") ENDIF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*") + IF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*") + STRING(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}") + STRING(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}") + STRING(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}") + ENDIF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*") ENDFOREACH(info) # Check if a valid compiler and platform were found. @@ -204,6 +216,7 @@ SET(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}") SET(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}") SET(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}") + SET(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}") ENDIF(COMPILER_ID AND NOT COMPILER_ID_TWICE) # Check the compiler identification string. @@ -251,6 +264,7 @@ SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE) SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" PARENT_SCOPE) + SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) SET(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE) ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang) @@ -288,12 +302,6 @@ 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 -Nru cmake-2.8.7/Modules/CMakeDetermineFortranCompiler.cmake cmake-2.8.9/Modules/CMakeDetermineFortranCompiler.cmake --- cmake-2.8.7/Modules/CMakeDetermineFortranCompiler.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeDetermineFortranCompiler.cmake 2012-08-09 18:15:18.000000000 +0000 @@ -50,7 +50,7 @@ # fort77: native F77 compiler under HP-UX (and some older Crays) # frt: Fujitsu F77 compiler # pathf90/pathf95/pathf2003: PathScale Fortran compiler - # pgf77/pgf90/pgf95: Portland Group F77/F90/F95 compilers + # pgf77/pgf90/pgf95/pgfortran: Portland Group F77/F90/F95 compilers # xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers # lf95: Lahey-Fujitsu F95 compiler # fl32: Microsoft Fortran 77 "PowerStation" compiler @@ -64,8 +64,8 @@ # then 77 or older compilers, gnu is always last in the group, # so if you paid for a compiler it is picked by default. SET(CMAKE_Fortran_COMPILER_LIST - ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 lf95 xlf95 fort - gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77 + ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95 + fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77 frt pgf77 xlf fl32 af77 g77 f77 ) @@ -73,7 +73,7 @@ SET(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77) SET(_Fortran_COMPILER_NAMES_Intel ifort ifc efc) SET(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77) - SET(_Fortran_COMPILER_NAMES_PGI pgf95 pgf90 pgf77) + SET(_Fortran_COMPILER_NAMES_PGI pgf95 pgfortran pgf90 pgf77) SET(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90) SET(_Fortran_COMPILER_NAMES_XL xlf) SET(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf) diff -Nru cmake-2.8.7/Modules/CMakeExpandImportedTargets.cmake cmake-2.8.9/Modules/CMakeExpandImportedTargets.cmake --- cmake-2.8.7/Modules/CMakeExpandImportedTargets.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeExpandImportedTargets.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,129 @@ +# CMAKE_EXPAND_IMPORTED_TARGETS( LIBRARIES lib1 lib2...libN +# [CONFIGURATION ] ) +# +# CMAKE_EXPAND_IMPORTED_TARGETS() takes a list of libraries and replaces +# all imported targets contained in this list with their actual file paths +# of the referenced libraries on disk, including the libraries from their +# link interfaces. +# If a CONFIGURATION is given, it uses the respective configuration of the +# imported targets if it exists. If no CONFIGURATION is given, it uses +# the first configuration from ${CMAKE_CONFIGURATION_TYPES} if set, otherwise +# ${CMAKE_BUILD_TYPE}. +# This macro is used by all Check*.cmake files which use +# TRY_COMPILE() or TRY_RUN() and support CMAKE_REQUIRED_LIBRARIES , so that +# these checks support imported targets in CMAKE_REQUIRED_LIBRARIES: +# cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} +# CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" ) + + +#============================================================================= +# Copyright 2012 Kitware, Inc. +# Copyright 2009-2012 Alexander Neundorf +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +include(CMakeParseArguments) + +function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT ) + + set(options ) + set(oneValueArgs CONFIGURATION ) + set(multiValueArgs LIBRARIES ) + + cmake_parse_arguments(CEIT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(CEIT_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown keywords given to CMAKE_EXPAND_IMPORTED_TARGETS(): \"${CEIT_UNPARSED_ARGUMENTS}\"") + endif() + + if(NOT CEIT_CONFIGURATION) + if(CMAKE_CONFIGURATION_TYPES) + list(GET CMAKE_CONFIGURATION_TYPES 0 CEIT_CONFIGURATION) + else() + set(CEIT_CONFIGURATION ${CMAKE_BUILD_TYPE}) + endif() + endif() + + # handle imported library targets + + set(_CCSR_REQ_LIBS ${CEIT_LIBRARIES}) + + set(_CHECK_FOR_IMPORTED_TARGETS TRUE) + set(_CCSR_LOOP_COUNTER 0) + while(_CHECK_FOR_IMPORTED_TARGETS) + math(EXPR _CCSR_LOOP_COUNTER "${_CCSR_LOOP_COUNTER} + 1 ") + set(_CCSR_NEW_REQ_LIBS ) + set(_CHECK_FOR_IMPORTED_TARGETS FALSE) + foreach(_CURRENT_LIB ${_CCSR_REQ_LIBS}) + get_target_property(_importedConfigs "${_CURRENT_LIB}" IMPORTED_CONFIGURATIONS) + if (_importedConfigs) +# message(STATUS "Detected imported target ${_CURRENT_LIB}") + # Ok, so this is an imported target. + # First we get the imported configurations. + # Then we get the location of the actual library on disk of the first configuration. + # then we'll get its link interface libraries property, + # iterate through it and replace all imported targets we find there + # with there actual location. + + # guard against infinite loop: abort after 100 iterations ( 100 is arbitrary chosen) + if ("${_CCSR_LOOP_COUNTER}" LESS 100) + set(_CHECK_FOR_IMPORTED_TARGETS TRUE) +# else ("${_CCSR_LOOP_COUNTER}" LESS 1) +# message(STATUS "********* aborting loop, counter : ${_CCSR_LOOP_COUNTER}") + endif ("${_CCSR_LOOP_COUNTER}" LESS 100) + + # if one of the imported configurations equals ${CMAKE_TRY_COMPILE_CONFIGURATION}, + # use it, otherwise simply use the first one: + list(FIND _importedConfigs "${CEIT_CONFIGURATION}" _configIndexToUse) + if("${_configIndexToUse}" EQUAL -1) + set(_configIndexToUse 0) + endif("${_configIndexToUse}" EQUAL -1) + list(GET _importedConfigs ${_configIndexToUse} _importedConfigToUse) + + get_target_property(_importedLocation "${_CURRENT_LIB}" IMPORTED_LOCATION_${_importedConfigToUse}) + get_target_property(_linkInterfaceLibs "${_CURRENT_LIB}" IMPORTED_LINK_INTERFACE_LIBRARIES_${_importedConfigToUse} ) + + list(APPEND _CCSR_NEW_REQ_LIBS "${_importedLocation}") +# message(STATUS "Appending lib ${_CURRENT_LIB} as ${_importedLocation}") + if(_linkInterfaceLibs) + foreach(_currentLinkInterfaceLib ${_linkInterfaceLibs}) +# message(STATUS "Appending link interface lib ${_currentLinkInterfaceLib}") + if(_currentLinkInterfaceLib) + list(APPEND _CCSR_NEW_REQ_LIBS "${_currentLinkInterfaceLib}" ) + endif(_currentLinkInterfaceLib) + endforeach(_currentLinkInterfaceLib "${_linkInterfaceLibs}") + endif(_linkInterfaceLibs) + else(_importedConfigs) + # "Normal" libraries are just used as they are. + list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" ) +# message(STATUS "Appending lib directly: ${_CURRENT_LIB}") + endif(_importedConfigs) + endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS}) + + set(_CCSR_REQ_LIBS ${_CCSR_NEW_REQ_LIBS} ) + endwhile(_CHECK_FOR_IMPORTED_TARGETS) + + # Finally we iterate once more over all libraries. This loop only removes + # all remaining imported target names (there shouldn't be any left anyway). + set(_CCSR_NEW_REQ_LIBS ) + foreach(_CURRENT_LIB ${_CCSR_REQ_LIBS}) + get_target_property(_importedConfigs "${_CURRENT_LIB}" IMPORTED_CONFIGURATIONS) + if (NOT _importedConfigs) + list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" ) +# message(STATUS "final: appending ${_CURRENT_LIB}") + else (NOT _importedConfigs) +# message(STATUS "final: skipping ${_CURRENT_LIB}") + endif (NOT _importedConfigs) + endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS}) +# message(STATUS "setting -${_RESULT}- to -${_CCSR_NEW_REQ_LIBS}-") + set(${_RESULT} "${_CCSR_NEW_REQ_LIBS}" PARENT_SCOPE) + +endfunction() diff -Nru cmake-2.8.7/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake cmake-2.8.9/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake --- cmake-2.8.7/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -80,15 +80,10 @@ SET(_orig_lc_all $ENV{LC_ALL}) SET(_orig_lc_messages $ENV{LC_MESSAGES}) SET(_orig_lang $ENV{LANG}) -IF(_orig_lc_all) - SET(ENV{LC_ALL} C) -ENDIF() -IF(_orig_lc_messages) - SET(ENV{LC_MESSAGES} C) -ENDIF() -IF(_orig_lang) - SET(ENV{LANG} C) -ENDIF() + +SET(ENV{LC_ALL} C) +SET(ENV{LC_MESSAGES} C) +SET(ENV{LANG} C) # Now check for C, works for gcc and Intel compiler at least IF (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS) @@ -109,12 +104,6 @@ ENDIF () # Restore original LC_ALL, LC_MESSAGES, and LANG -IF(_orig_lc_all) - SET(ENV{LC_ALL} ${_orig_lc_all}) -ENDIF() -IF(_orig_lc_messages) - SET(ENV{LC_MESSAGES} ${_orig_lc_messages}) -ENDIF() -IF(_orig_lang) - SET(ENV{LANG} ${_orig_lang}) -ENDIF() +SET(ENV{LC_ALL} ${_orig_lc_all}) +SET(ENV{LC_MESSAGES} ${_orig_lc_messages}) +SET(ENV{LANG} ${_orig_lang}) diff -Nru cmake-2.8.7/Modules/CMakeFindEclipseCDT4.cmake cmake-2.8.9/Modules/CMakeFindEclipseCDT4.cmake --- cmake-2.8.7/Modules/CMakeFindEclipseCDT4.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeFindEclipseCDT4.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -20,7 +20,9 @@ FUNCTION(_FIND_ECLIPSE_VERSION) # This code is in a function so the variables used here have only local scope IF(CMAKE_ECLIPSE_EXECUTABLE) - GET_FILENAME_COMPONENT(_ECLIPSE_DIR "${CMAKE_ECLIPSE_EXECUTABLE}" PATH) + # use REALPATH to resolve symlinks (http://public.kitware.com/Bug/view.php?id=13036) + GET_FILENAME_COMPONENT(_REALPATH_CMAKE_ECLIPSE_EXECUTABLE "${CMAKE_ECLIPSE_EXECUTABLE}" REALPATH) + GET_FILENAME_COMPONENT(_ECLIPSE_DIR "${_REALPATH_CMAKE_ECLIPSE_EXECUTABLE}" PATH) FILE(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*") IF("${_ECLIPSE_FEATURE_DIR}" MATCHES ".+org.eclipse.platform_([0-9]+\\.[0-9]+).+") SET(_ECLIPSE_VERSION ${CMAKE_MATCH_1}) diff -Nru cmake-2.8.7/Modules/CMakeFindPackageMode.cmake cmake-2.8.9/Modules/CMakeFindPackageMode.cmake --- cmake-2.8.7/Modules/CMakeFindPackageMode.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeFindPackageMode.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -71,7 +71,8 @@ # use the file utility to check whether itself is 64 bit: find_program(FILE_EXECUTABLE file) if(FILE_EXECUTABLE) - execute_process(COMMAND "${FILE_EXECUTABLE}" "${FILE_EXECUTABLE}" OUTPUT_VARIABLE fileOutput ERROR_QUIET) + get_filename_component(FILE_ABSPATH "${FILE_EXECUTABLE}" ABSOLUTE) + execute_process(COMMAND "${FILE_ABSPATH}" "${FILE_ABSPATH}" OUTPUT_VARIABLE fileOutput ERROR_QUIET) if("${fileOutput}" MATCHES "64-bit") set(CMAKE_SIZEOF_VOID_P 8) endif() diff -Nru cmake-2.8.7/Modules/CMakeFortranInformation.cmake cmake-2.8.9/Modules/CMakeFortranInformation.cmake --- cmake-2.8.7/Modules/CMakeFortranInformation.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeFortranInformation.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -74,6 +74,18 @@ # 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 @@ -109,6 +121,14 @@ SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG}) ENDIF() +# for most systems a module is the same as a shared library +# so unless the variable CMAKE_MODULE_EXISTS is set just +# copy the values from the LIBRARY variables +IF(NOT CMAKE_MODULE_EXISTS) + SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS}) + SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS}) +ENDIF(NOT CMAKE_MODULE_EXISTS) + # repeat for modules IF(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS) SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) @@ -163,7 +183,7 @@ # 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 -Nru cmake-2.8.7/Modules/CMakeGenericSystem.cmake cmake-2.8.9/Modules/CMakeGenericSystem.cmake --- cmake-2.8.7/Modules/CMakeGenericSystem.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeGenericSystem.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 @@ -39,8 +39,10 @@ SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL "If set, runtime paths are not added when using shared libraries.") +SET (CMAKE_SKIP_INSTALL_RPATH "NO" CACHE BOOL + "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 @@ -58,6 +60,12 @@ 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 # @@ -75,6 +83,8 @@ # 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)") @@ -166,7 +176,12 @@ 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 CMAKE_VERBOSE_MAKEFILE ) diff -Nru cmake-2.8.7/Modules/CMakeNinjaFindMake.cmake cmake-2.8.9/Modules/CMakeNinjaFindMake.cmake --- cmake-2.8.7/Modules/CMakeNinjaFindMake.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/CMakeNinjaFindMake.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,17 @@ + +#============================================================================= +# Copyright 2011 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +FIND_PROGRAM(CMAKE_MAKE_PROGRAM ninja + DOC "Program used to build from build.ninja files.") +MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) diff -Nru cmake-2.8.7/Modules/CMakePackageConfigHelpers.cmake cmake-2.8.9/Modules/CMakePackageConfigHelpers.cmake --- cmake-2.8.7/Modules/CMakePackageConfigHelpers.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/CMakePackageConfigHelpers.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,227 @@ +# - CONFIGURE_PACKAGE_CONFIG_FILE(), WRITE_BASIC_PACKAGE_VERSION_FILE() +# +# CONFIGURE_PACKAGE_CONFIG_FILE( INSTALL_DESTINATION +# [PATH_VARS ... ] +# [NO_SET_AND_CHECK_MACRO] +# [NO_CHECK_REQUIRED_COMPONENTS_MACRO]) +# +# CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain +# CONFIGURE_FILE() command when creating the Config.cmake or -config.cmake +# file for installing a project or library. It helps making the resulting package +# relocatable by avoiding hardcoded paths in the installed Config.cmake file. +# +# In a FooConfig.cmake file there may be code like this to make the +# install destinations know to the using project: +# set(FOO_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@" ) +# set(FOO_DATA_DIR "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" ) +# set(FOO_ICONS_DIR "@CMAKE_INSTALL_PREFIX@/share/icons" ) +# ...logic to determine installedPrefix from the own location... +# set(FOO_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@" ) +# All 4 options shown above are not sufficient, since the first 3 hardcode +# the absolute directory locations, and the 4th case works only if the logic +# to determine the installedPrefix is correct, and if CONFIG_INSTALL_DIR contains +# a relative path, which in general cannot be guaranteed. +# This has the effect that the resulting FooConfig.cmake file would work poorly +# under Windows and OSX, where users are used to choose the install location +# of a binary package at install time, independent from how CMAKE_INSTALL_PREFIX +# was set at build/cmake time. +# +# Using CONFIGURE_PACKAGE_CONFIG_FILE() helps. If used correctly, it makes the +# resulting FooConfig.cmake file relocatable. +# Usage: +# 1. write a FooConfig.cmake.in file as you are used to +# 2. insert a line containing only the string "@PACKAGE_INIT@" +# 3. instead of SET(FOO_DIR "@SOME_INSTALL_DIR@"), use SET(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@") +# (this must be after the @PACKAGE_INIT@ line) +# 4. instead of using the normal CONFIGURE_FILE(), use CONFIGURE_PACKAGE_CONFIG_FILE() +# +# The and arguments are the input and output file, the same way +# as in CONFIGURE_FILE(). +# +# The given to INSTALL_DESTINATION must be the destination where the FooConfig.cmake +# file will be installed to. This can either be a relative or absolute path, both work. +# +# The variables to given as PATH_VARS are the variables which contain +# install destinations. For each of them the macro will create a helper variable +# PACKAGE_. These helper variables must be used +# in the FooConfig.cmake.in file for setting the installed location. They are calculated +# by CONFIGURE_PACKAGE_CONFIG_FILE() so that they are always relative to the +# installed location of the package. This works both for relative and also for absolute locations. +# For absolute locations it works only if the absolute location is a subdirectory +# of CMAKE_INSTALL_PREFIX. +# +# By default configure_package_config_file() also generates two helper macros, +# set_and_check() and check_required_components() into the FooConfig.cmake file. +# +# set_and_check() should be used instead of the normal set() +# command for setting directories and file locations. Additionally to setting the +# variable it also checks that the referenced file or directory actually exists +# and fails with a FATAL_ERROR otherwise. This makes sure that the created +# FooConfig.cmake file does not contain wrong references. +# When using the NO_SET_AND_CHECK_MACRO, this macro is not generated into the +# FooConfig.cmake file. +# +# check_required_components() should be called at the end of the +# FooConfig.cmake file if the package supports components. +# This macro checks whether all requested, non-optional components have been found, +# and if this is not the case, sets the Foo_FOUND variable to FALSE, so that the package +# is considered to be not found. +# It does that by testing the Foo__FOUND variables for all requested +# required components. +# When using the NO_CHECK_REQUIRED_COMPONENTS option, this macro is not generated +# into the FooConfig.cmake file. +# +# For an example see below the documentation for WRITE_BASIC_PACKAGE_VERSION_FILE(). +# +# +# WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) ) +# +# Writes a file for use as ConfigVersion.cmake file to . +# See the documentation of FIND_PACKAGE() for details on this. +# filename is the output filename, it should be in the build tree. +# major.minor.patch is the version number of the project to be installed +# The COMPATIBILITY mode AnyNewerVersion means that the installed package version +# will be considered compatible if it is newer or exactly the same as the requested version. +# This mode should be used for packages which are fully backward compatible, +# also across major versions. +# If SameMajorVersion is used instead, then the behaviour differs from AnyNewerVersion +# in that the major version number must be the same as requested, e.g. version 2.0 will +# not be considered compatible if 1.0 is requested. +# This mode should be used for packages which guarantee backward compatibility within the +# same major version. +# If ExactVersion is used, then the package is only considered compatible if the requested +# version matches exactly its own version number (not considering the tweak version). +# For example, version 1.2.3 of a package is only considered compatible to requested version 1.2.3. +# This mode is for packages without compatibility guarantees. +# If your project has more elaborated version matching rules, you will need to write your +# own custom ConfigVersion.cmake file instead of using this macro. +# +# Internally, this macro executes configure_file() to create the resulting +# version file. Depending on the COMPATIBLITY, either the file +# BasicConfigVersion-SameMajorVersion.cmake.in or BasicConfigVersion-AnyNewerVersion.cmake.in +# is used. Please note that these two files are internal to CMake and you should +# not call configure_file() on them yourself, but they can be used as starting +# point to create more sophisticted custom ConfigVersion.cmake files. +# +# +# Example using both configure_package_config_file() and write_basic_package_version_file(): +# CMakeLists.txt: +# set(INCLUDE_INSTALL_DIR include/ ... CACHE ) +# set(LIB_INSTALL_DIR lib/ ... CACHE ) +# set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE ) +# ... +# include(CMakePackageConfigHelpers) +# configure_package_config_file(FooConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake +# INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake +# PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR) +# write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake +# VERSION 1.2.3 +# COMPATIBILITY SameMajorVersion ) +# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake +# DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake ) +# +# With a FooConfig.cmake.in: +# set(FOO_VERSION x.y.z) +# ... +# @PACKAGE_INIT@ +# ... +# set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") +# set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@") +# +# check_required_components(Foo) + + +#============================================================================= +# Copyright 2012 Alexander Neundorf +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +include(CMakeParseArguments) + +include(WriteBasicConfigVersionFile) + +macro(WRITE_BASIC_PACKAGE_VERSION_FILE) + write_basic_config_version_file(${ARGN}) +endmacro() + + +function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile) + set(options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO) + set(oneValueArgs INSTALL_DESTINATION ) + set(multiValueArgs PATH_VARS ) + + cmake_parse_arguments(CCF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(CCF_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown keywords given to CONFIGURE_PACKAGE_CONFIG_FILE(): \"${CCF_UNPARSED_ARGUMENTS}\"") + endif() + + if(NOT CCF_INSTALL_DESTINATION) + message(FATAL_ERROR "No INSTALL_DESTINATION given to CONFIGURE_PACKAGE_CONFIG_FILE()") + endif() + + if(IS_ABSOLUTE "${CCF_INSTALL_DESTINATION}") + set(absInstallDir "${CCF_INSTALL_DESTINATION}") + else() + set(absInstallDir "${CMAKE_INSTALL_PREFIX}/${CCF_INSTALL_DESTINATION}") + endif() + file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${absInstallDir}" "${CMAKE_INSTALL_PREFIX}" ) + + foreach(var ${CCF_PATH_VARS}) + if(NOT DEFINED ${var}) + message(FATAL_ERROR "Variable ${var} does not exist") + else() + if(IS_ABSOLUTE "${${var}}") + string(REPLACE "${CMAKE_INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}" + PACKAGE_${var} "${${var}}") + else() + set(PACKAGE_${var} "\${PACKAGE_PREFIX_DIR}/${${var}}") + endif() + endif() + endforeach() + + set(PACKAGE_INIT " +####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### +get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/${PACKAGE_RELATIVE_PATH}\" ABSOLUTE) +") + + if(NOT CCF_NO_SET_AND_CHECK_MACRO) + set(PACKAGE_INIT "${PACKAGE_INIT} +macro(set_and_check _var _file) + set(\${_var} \"\${_file}\") + if(NOT EXISTS \"\${_file}\") + message(FATAL_ERROR \"File or directory \${_file} referenced by variable \${_var} does not exist !\") + endif() +endmacro() +") + endif() + + + if(NOT CCF_NO_CHECK_REQUIRED_COMPONENTS_MACRO) + set(PACKAGE_INIT "${PACKAGE_INIT} +macro(check_required_components _NAME) + foreach(comp \${\${_NAME}_FIND_COMPONENTS}) + if(NOT \${_NAME}_\${comp}_FOUND) + if(\${_NAME}_FIND_REQUIRED_\${comp}) + set(\${_NAME}_FOUND FALSE) + endif() + endif() + endforeach(comp) +endmacro() +") + endif() + + set(PACKAGE_INIT "${PACKAGE_INIT} +####################################################################################") + + configure_file("${_inputFile}" "${_outputFile}" @ONLY) + +endfunction() diff -Nru cmake-2.8.7/Modules/CMakePlatformId.h.in cmake-2.8.9/Modules/CMakePlatformId.h.in --- cmake-2.8.7/Modules/CMakePlatformId.h.in 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CMakePlatformId.h.in 2012-08-09 18:15:19.000000000 +0000 @@ -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 @@ -105,6 +108,46 @@ # define ARCHITECTURE_ID "" #endif +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + /* Construct the string literal in pieces to prevent the source from getting matched. Store it in a pointer rather than an array because some compilers will just produce instructions to fill the diff -Nru cmake-2.8.7/Modules/CPack.cmake cmake-2.8.9/Modules/CPack.cmake --- cmake-2.8.7/Modules/CPack.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CPack.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,5 +1,7 @@ -# - Build binary and source package installers -# +##section Variables common to all CPack generators +##end +##module +# - Build binary and source package installers. # The CPack module generates binary and source installers in a variety # of formats using the cpack program. Inclusion of the CPack module # adds two new targets to the resulting makefiles, package and @@ -29,16 +31,16 @@ # on a per-generator basis. It only need contain overrides. # # Here's how it works: -# - cpack runs -# - it includes CPackConfig.cmake -# - it iterates over the generators listed in that file's -# CPACK_GENERATOR list variable (unless told to use just a -# specific one via -G on the command line...) -# -# - foreach generator, it then -# - sets CPACK_GENERATOR to the one currently being iterated -# - includes the CPACK_PROJECT_CONFIG_FILE -# - produces the package for that generator +# - cpack runs +# - it includes CPackConfig.cmake +# - it iterates over the generators listed in that file's +# CPACK_GENERATOR list variable (unless told to use just a +# specific one via -G on the command line...) +# +# - foreach generator, it then +# - sets CPACK_GENERATOR to the one currently being iterated +# - includes the CPACK_PROJECT_CONFIG_FILE +# - produces the package for that generator # # This is the key: For each generator listed in CPACK_GENERATOR # in CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR @@ -48,174 +50,225 @@ # Before including this CPack module in your CMakeLists.txt file, # there are a variety of variables that can be set to customize # the resulting installers. The most commonly-used variables are: +##end # -# CPACK_PACKAGE_NAME - The name of the package (or application). If -# not specified, defaults to the project name. -# -# CPACK_PACKAGE_VENDOR - The name of the package vendor (e.g., -# "Kitware"). -# -# CPACK_PACKAGE_VERSION_MAJOR - Package major Version -# -# CPACK_PACKAGE_VERSION_MINOR - Package minor Version -# -# CPACK_PACKAGE_VERSION_PATCH - Package patch Version -# -# CPACK_PACKAGE_DESCRIPTION_FILE - A text file used to describe the -# project. Used, for example, the introduction screen of a -# CPack-generated Windows installer to describe the project. -# -# CPACK_PACKAGE_DESCRIPTION_SUMMARY - Short description of the -# project (only a few words). -# -# CPACK_PACKAGE_FILE_NAME - The name of the package file to generate, -# not including the extension. For example, cmake-2.6.1-Linux-i686. -# -# CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the -# target system, e.g., "CMake 2.5". -# -# CPACK_PROJECT_CONFIG_FILE - File included at cpack time, once per -# generator after setting CPACK_GENERATOR to the actual generator -# being used. Allows per-generator setting of CPACK_* variables at -# cpack time. -# -# CPACK_RESOURCE_FILE_LICENSE - License file for the project, which -# will typically be displayed to the user (often with an explicit -# "Accept" button, for graphical installers) prior to installation. -# -# CPACK_RESOURCE_FILE_README - ReadMe file for the project, which -# typically describes in some detail -# -# CPACK_RESOURCE_FILE_WELCOME - Welcome file for the project, which -# welcomes users to this installer. Typically used in the graphical -# installers on Windows and Mac OS X. -# -# CPACK_MONOLITHIC_INSTALL - Disables the component-based -# installation mechanism, so that all components are always installed. -# -# CPACK_GENERATOR - List of CPack generators to use. If not -# specified, CPack will create a set of options (e.g., -# CPACK_BINARY_NSIS) allowing the user to enable/disable individual -# generators. -# -# CPACK_OUTPUT_CONFIG_FILE - The name of the CPack configuration file -# for binary installers that will be generated by the CPack -# module. Defaults to CPackConfig.cmake. -# -# CPACK_PACKAGE_EXECUTABLES - Lists each of the executables along -# with a text label, to be used to create Start Menu shortcuts on -# Windows. For example, setting this to the list ccmake;CMake will -# create a shortcut named "CMake" that will execute the installed -# executable ccmake. -# -# CPACK_STRIP_FILES - List of files to be stripped. Starting with -# CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which -# enables stripping of all files (a list of files evaluates to TRUE -# in CMake, so this change is compatible). +##variable +# CPACK_PACKAGE_NAME - The name of the package (or application). If +# not specified, defaults to the project name. +##end +# +##variable +# CPACK_PACKAGE_VENDOR - The name of the package vendor. (e.g., +# "Kitware"). +##end +# +##variable +# CPACK_PACKAGE_DIRECTORY - The directory in which CPack is doing its +# packaging. If it is not set then this will default (internally) to the +# build dir. This variable may be defined in CPack config file or from +# the cpack command line option "-B". If set the command line option +# override the value found in the config file. +##end +# +##variable +# CPACK_PACKAGE_VERSION_MAJOR - Package major Version +##end +# +##variable +# CPACK_PACKAGE_VERSION_MINOR - Package minor Version +##end +# +##variable +# CPACK_PACKAGE_VERSION_PATCH - Package patch Version +##end +# +##variable +# CPACK_PACKAGE_DESCRIPTION_FILE - A text file used to describe the +# project. Used, for example, the introduction screen of a +# CPack-generated Windows installer to describe the project. +##end +# +##variable +# CPACK_PACKAGE_DESCRIPTION_SUMMARY - Short description of the +# project (only a few words). +##end +# +##variable +# 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 +# +##variable +# CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the +# target system. This may be used by some CPack generators +# like NSIS to create an installation directory e.g., "CMake 2.5" +# below the installation prefix. All installed element will be +# put inside this directory. +##end +# +##variable +# CPACK_PACKAGE_ICON - A branding image that will be displayed inside +# the installer (used by GUI installers). +##end +# +##variable +# CPACK_PROJECT_CONFIG_FILE - CPack-time project CPack configuration +# file. This file included at cpack time, once per +# generator after CPack has set CPACK_GENERATOR to the actual generator +# being used. It allows per-generator setting of CPACK_* variables at +# cpack time. +##end +# +##variable +# CPACK_RESOURCE_FILE_LICENSE - License to be embedded in the installer. It +# will typically be displayed to the user by the produced installer +# (often with an explicit "Accept" button, for graphical installers) +# prior to installation. This license file is NOT added to installed +# file but is used by some CPack generators like NSIS. If you want +# to install a license file (may be the same as this one) +# along with your project you must add an appropriate CMake INSTALL +# command in your CMakeLists.txt. +##end +# +##variable +# CPACK_RESOURCE_FILE_README - ReadMe file to be embedded in the installer. It +# typically describes in some detail the purpose of the project +# during the installation. Not all CPack generators uses +# this file. +##end +# +##variable +# CPACK_RESOURCE_FILE_WELCOME - Welcome file to be embedded in the +# installer. It welcomes users to this installer. +# Typically used in the graphical installers on Windows and Mac OS X. +##end +# +##variable +# CPACK_MONOLITHIC_INSTALL - Disables the component-based +# installation mechanism. When set the component specification is ignored +# and all installed items are put in a single "MONOLITHIC" package. +# Some CPack generators do monolithic packaging by default and +# may be asked to do component packaging by setting +# CPACK__COMPONENT_INSTALL to 1/TRUE. +##end +# +##variable +# CPACK_GENERATOR - List of CPack generators to use. If not +# specified, CPack will create a set of options CPACK_BINARY_ (e.g., +# CPACK_BINARY_NSIS) allowing the user to enable/disable individual +# generators. This variable may be used on the command line +# as well as in: +# +# cpack -D CPACK_GENERATOR="ZIP;TGZ" /path/to/build/tree +##end +# +##variable +# CPACK_OUTPUT_CONFIG_FILE - The name of the CPack binary configuration +# file. This file is the CPack configuration generated by the CPack module +# for binary installers. Defaults to CPackConfig.cmake. +##end +# +##variable +# CPACK_PACKAGE_EXECUTABLES - Lists each of the executables and associated +# text label to be used to create Start Menu shortcuts. For example, +# setting this to the list ccmake;CMake will +# create a shortcut named "CMake" that will execute the installed +# executable ccmake. Not all CPack generators use it (at least NSIS and +# OSXX11 do). +##end +# +##variable +# CPACK_STRIP_FILES - List of files to be stripped. Starting with +# CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which +# enables stripping of all files (a list of files evaluates to TRUE +# in CMake, so this change is compatible). +##end # # The following CPack variables are specific to source packages, and # will not affect binary packages: # -# CPACK_SOURCE_PACKAGE_FILE_NAME - The name of the source package, -# e.g., cmake-2.6.1 -# -# CPACK_SOURCE_STRIP_FILES - List of files in the source tree that -# will be stripped. Starting with CMake 2.6.0 -# CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables -# stripping of all files (a list of files evaluates to TRUE in CMake, -# so this change is compatible). -# -# CPACK_SOURCE_GENERATOR - List of generators used for the source -# packages. As with CPACK_GENERATOR, if this is not specified then -# CPack will create a set of options (e.g., CPACK_SOURCE_ZIP) -# allowing users to select which packages will be generated. -# -# CPACK_SOURCE_OUTPUT_CONFIG_FILE - The name of the CPack -# configuration file for source installers that will be generated by -# the CPack module. Defaults to CPackSourceConfig.cmake. -# -# CPACK_SOURCE_IGNORE_FILES - Pattern of files in the source tree -# that won't be packaged when building a source package. This is a -# list of patterns, e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.* -# -# The following variables are specific to the DragNDrop installers -# built on Mac OS X: -# -# CPACK_DMG_VOLUME_NAME - The volume name of the generated disk -# image. Defaults to CPACK_PACKAGE_FILE_NAME. -# -# CPACK_DMG_FORMAT - The disk image format. Common values are UDRO -# (UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF -# bzip2-compressed). Refer to hdiutil(1) for more information on -# other available formats. -# -# CPACK_DMG_DS_STORE - Path to a custom .DS_Store file which e.g. -# can be used to specify the Finder window position/geometry and -# layout (such as hidden toolbars, placement of the icons etc.). -# This file has to be generated by the Finder (either manually or -# through OSA-script) using a normal folder from which the .DS_Store -# file can then be extracted. -# -# CPACK_DMG_BACKGROUND_IMAGE - Path to an image file which is to be -# used as the background for the Finder Window when the disk image -# is opened. By default no background image is set. The background -# image is applied after applying the custom .DS_Store file. -# -# CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to -# operate on disk image files on Mac OS X. This variable can be used -# to override the automatically detected command (or specify its -# location if the auto-detection fails to find it.) -# -# CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set -# extended attributes on files and directories on Mac OS X. This -# variable can be used to override the automatically detected -# command (or specify its location if the auto-detection fails to -# find it.) -# -# CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile -# resources on Mac OS X. This variable can be used to override the -# automatically detected command (or specify its location if the -# auto-detection fails to find it.) -# -# The following variable is specific to installers build on Mac OS X -# using PackageMaker: -# -# CPACK_OSX_PACKAGE_VERSION - The version of Mac OS X that the -# resulting PackageMaker archive should be compatible -# with. Different versions of Mac OS X support different -# features. For example, CPack can only build component-based -# installers for Mac OS X 10.4 or newer, and can only build -# installers that download component son-the-fly for Mac OS X 10.5 -# or newer. If left blank, this value will be set to the minimum -# version of Mac OS X that supports the requested features. Set this -# variable to some value (e.g., 10.4) only if you want to guarantee -# that your installer will work on that version of Mac OS X, and -# don't mind missing extra features available in the installer -# shipping with later versions of Mac OS X. +##variable +# CPACK_SOURCE_PACKAGE_FILE_NAME - The name of the source package. For +# example cmake-2.6.1. +##end +# +##variable +# CPACK_SOURCE_STRIP_FILES - List of files in the source tree that +# will be stripped. Starting with CMake 2.6.0 +# CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables +# stripping of all files (a list of files evaluates to TRUE in CMake, +# so this change is compatible). +##end +# +##variable +# CPACK_SOURCE_GENERATOR - List of generators used for the source +# packages. As with CPACK_GENERATOR, if this is not specified then +# CPack will create a set of options (e.g., CPACK_SOURCE_ZIP) +# allowing users to select which packages will be generated. +##end +# +##variable +# CPACK_SOURCE_OUTPUT_CONFIG_FILE - The name of the CPack source +# configuration file. This file is the CPack configuration generated by the +# CPack module for source installers. Defaults to CPackSourceConfig.cmake. +##end +# +##variable +# CPACK_SOURCE_IGNORE_FILES - Pattern of files in the source tree +# that won't be packaged when building a source package. This is a +# list of regular expression patterns (that must be properly escaped), +# e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.* +##end # # The following variables are for advanced uses of CPack: # -# CPACK_CMAKE_GENERATOR - What CMake generator should be used if the -# project is CMake project. Defaults to the value of CMAKE_GENERATOR; -# few users will want to change this setting. -# -# CPACK_INSTALL_CMAKE_PROJECTS - List of four values that specify -# what project to install. The four values are: Build directory, -# Project Name, Project Component, Directory. If omitted, CPack will -# build an installer that installers everything. -# -# CPACK_SYSTEM_NAME - System name, defaults to the value of -# ${CMAKE_SYSTEM_NAME}. -# -# CPACK_PACKAGE_VERSION - Package full version, used internally. By -# default, this is built from CPACK_PACKAGE_VERSION_MAJOR, -# CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH. -# -# CPACK_TOPLEVEL_TAG - Directory for the installed files. -# -# CPACK_INSTALL_COMMANDS - Extra commands to install components. -# -# CPACK_INSTALLED_DIRECTORIES - Extra directories to install. +##variable +# CPACK_CMAKE_GENERATOR - What CMake generator should be used if the +# project is CMake project. Defaults to the value of CMAKE_GENERATOR +# few users will want to change this setting. +##end +# +##variable +# CPACK_INSTALL_CMAKE_PROJECTS - List of four values that specify +# what project to install. The four values are: Build directory, +# Project Name, Project Component, Directory. If omitted, CPack will +# build an installer that installers everything. +##end +# +##variable +# CPACK_SYSTEM_NAME - System name, defaults to the value of +# ${CMAKE_SYSTEM_NAME}. +##end +# +##variable +# CPACK_PACKAGE_VERSION - Package full version, used internally. By +# default, this is built from CPACK_PACKAGE_VERSION_MAJOR, +# CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH. +##end +# +##variable +# CPACK_TOPLEVEL_TAG - Directory for the installed files. +##end +# +##variable +# CPACK_INSTALL_COMMANDS - Extra commands to install components. +##end +# +##variable +# CPACK_INSTALLED_DIRECTORIES - Extra directories to install. +##end +# +##variable +# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when +# installing this project. This is only used +# by installer for Windows. +##end +##variable +# CPACK_CREATE_DESKTOP_LINKS - List of desktop links to create. +##end # #============================================================================= @@ -259,7 +312,7 @@ ENDIF(NOT DEFINED "${name}") ENDMACRO(cpack_set_if_not_set) -# Macro to encode variables for the configuration file +# cpack_encode_variables - Macro to encode variables for the configuration file # find any variable that starts with CPACK and create a variable # _CPACK_OTHER_VARIABLES_ that contains SET commands for # each cpack variable. _CPACK_OTHER_VARIABLES_ is then @@ -297,6 +350,10 @@ 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) @@ -350,6 +407,12 @@ endif(${_cond}) endmacro(cpack_optional_append _list _cond _item) +##variable +# CPACK_BINARY_ - CPack generated options for binary generators. The +# CPack.cmake module generates (when CPACK_GENERATOR is not set) +# a set of CMake options (see CMake option command) which may then be used to +# select the CPack generator(s) to be used when launching the package target. +##end # Provide options to choose generators # we might check here if the required tools for the generates exist # and set the defaults according to the results diff -Nru cmake-2.8.7/Modules/CPackBundle.cmake cmake-2.8.9/Modules/CPackBundle.cmake --- cmake-2.8.7/Modules/CPackBundle.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CPackBundle.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,25 +1,36 @@ +##section Variables specific to CPack Bundle generator +##end +##module # - CPack Bundle generator (Mac OS X) specific options # # Installers built on Mac OS X using the Bundle generator use the -# aforementioned DragNDrop variables, plus the following Bundle-specific -# parameters: -# -# CPACK_BUNDLE_NAME - The name of the generated bundle. This -# appears in the OSX finder as the bundle name. Required. -# -# CPACK_BUNDLE_PLIST - Path to an OSX plist file that will be used -# as the Info.plist for the generated bundle. This assumes that -# the caller has generated or specified their own Info.plist file. -# Required. -# -# CPACK_BUNDLE_ICON - Path to an OSX icns file that will be used as -# the icon for the generated bundle. This is the icon that appears -# in the OSX finder for the bundle, and in the OSX dock when the -# bundle is opened. Required. -# -# CPACK_BUNDLE_STARTUP_SCRIPT - Path to an executable or script that -# will be run whenever an end-user double-clicks the generated bundle -# in the OSX Finder. Optional. +# aforementioned DragNDrop (CPACK_DMG_xxx) variables, plus +# the following Bundle-specific parameters (CPACK_BUNDLE_xxx). +##end +# +##variable +# CPACK_BUNDLE_NAME - The name of the generated bundle. This +# appears in the OSX finder as the bundle name. Required. +##end +# +##variable +# CPACK_BUNDLE_PLIST - Path to an OSX plist file that will be used +# for the generated bundle. This assumes that the caller has generated +# or specified their own Info.plist file. Required. +##end +# +##variable +# CPACK_BUNDLE_ICON - Path to an OSX icon file that will be used as +# the icon for the generated bundle. This is the icon that appears in the +# OSX finder for the bundle, and in the OSX dock when the bundle is opened. +# Required. +##end +# +##variable +# CPACK_BUNDLE_STARTUP_COMMAND - Path to a startup script. This is a path to +# an executable or script that will be run whenever an end-user double-clicks +# the generated bundle in the OSX Finder. Optional. +##end #============================================================================= # Copyright 2006-2009 Kitware, Inc. diff -Nru cmake-2.8.7/Modules/CPackComponent.cmake cmake-2.8.9/Modules/CPackComponent.cmake --- cmake-2.8.7/Modules/CPackComponent.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CPackComponent.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,3 +1,6 @@ +##section Variables concerning CPack Components +##end +##module # - Build binary and source package installers # # The CPackComponent module is the module which handles @@ -20,7 +23,54 @@ # components are identified by the COMPONENT argument of CMake's # INSTALL commands, and should be further described by the following # CPack commands: +##end # +##variable +# CPACK_COMPONENTS_ALL - The list of component to install. +# +# The default value of this variable is computed by CPack +# and contains all components defined by the project. The +# user may set it to only include the specified components. +##end +# +##variable +# CPACK__COMPONENT_INSTALL - Enable/Disable component install for +# CPack generator . +# +# Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy +# default behavior. e.g. RPM builds monolithic whereas NSIS builds component. +# One can change the default behavior by setting this variable to 0/1 or OFF/ON. +##end +##variable +# CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package +# component-aware CPack generators. +# +# Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several +# packages files when asked for component packaging. They group the component +# differently depending on the value of this variable: +# - ONE_PER_GROUP (default): creates one package file per component group +# - ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component +# - IGNORE : creates one package per component, i.e. IGNORE component group +# One can specify different grouping for different CPack generator by using +# a CPACK_PROJECT_CONFIG_FILE. +##end +##variable +# CPACK_COMPONENT__DISPLAY_NAME - The name to be displayed for a component. +##end +##variable +# CPACK_COMPONENT__DESCRIPTION - The description of a component. +##end +##variable +# CPACK_COMPONENT__GROUP - The group of a component. +##end +##variable +# CPACK_COMPONENT__DEPENDS - The dependencies (list of components) +# on which this component depends. +##end +##variable +# CPACK_COMPONENT__REQUIRED - True is this component is required. +##end +##macro # cpack_add_component - Describes a CPack installation component # named by the COMPONENT argument to a CMake INSTALL command. # @@ -90,7 +140,9 @@ # create a file with some name based on CPACK_PACKAGE_FILE_NAME and # the name of the component. See cpack_configure_downloads for more # information. +##end # +##macro # cpack_add_component_group - Describes a group of related CPack # installation components. # @@ -134,7 +186,9 @@ # # BOLD_TITLE indicates that the group title should appear in bold, # to call the user's attention to the group. +##end # +##macro # cpack_add_install_type - Add a new installation type containing a # set of predefined component selections to the graphical installer. # @@ -153,7 +207,9 @@ # DISPLAY_NAME is the displayed name of the install type, which will # typically show up in a drop-down box within a graphical # installer. This value can be any string. +##end # +##macro # cpack_configure_downloads - Configure CPack to download selected # components on-the-fly as part of the installation process. # @@ -203,6 +259,7 @@ # that can be called from Windows' Add/Remove Programs dialog (via the # "Modify" button) to change the set of installed components. NO_ADD_REMOVE # turns off this behavior. This option is ignored on Mac OS X. +##endmacro #============================================================================= # Copyright 2006-2009 Kitware, Inc. diff -Nru cmake-2.8.7/Modules/CPackCygwin.cmake cmake-2.8.9/Modules/CPackCygwin.cmake --- cmake-2.8.7/Modules/CPackCygwin.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/CPackCygwin.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,33 @@ +##section Variables specific to CPack Cygwin generator +##end +##module +# - Cygwin CPack generator (Cygwin). +# The following variable is specific to installers build on +# and/or for Cygwin: +##end +# +##variable +# CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number. +# FIXME: This documentation is incomplete. +##end +##variable +# CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file. +# FIXME: This documentation is incomplete. +##end +##variable +# CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script. +# FIXME: This documentation is incomplete. +##end + +#============================================================================= +# Copyright 2006-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.) diff -Nru cmake-2.8.7/Modules/CPackDMG.cmake cmake-2.8.9/Modules/CPackDMG.cmake --- cmake-2.8.7/Modules/CPackDMG.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/CPackDMG.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,70 @@ +##section Variables specific to CPack DragNDrop generator +##end +##module +# - DragNDrop CPack generator (Mac OS X). +# The following variables are specific to the DragNDrop installers +# built on Mac OS X: +##end +# +##variable +# CPACK_DMG_VOLUME_NAME - The volume name of the generated disk +# image. Defaults to CPACK_PACKAGE_FILE_NAME. +##end +# +##variable +# CPACK_DMG_FORMAT - The disk image format. Common values are UDRO +# (UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF +# bzip2-compressed). Refer to hdiutil(1) for more information on +# other available formats. +##end +# +##variable +# CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store +# file e.g. can be used to specify the Finder window +# position/geometry and layout (such as hidden toolbars, placement of the +# icons etc.). This file has to be generated by the Finder (either manually or +# through OSA-script) using a normal folder from which the .DS_Store +# file can then be extracted. +##end +# +##variable +# CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This +# file will be used as the background for the Finder Window when the disk +# image is opened. By default no background image is set. The background +# image is applied after applying the custom .DS_Store file. +##end +# +##variable +# CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to +# operate on disk image files on Mac OS X. This variable can be used +# to override the automatically detected command (or specify its +# location if the auto-detection fails to find it.) +##end +# +##variable +# CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set +# extended attributes on files and directories on Mac OS X. This +# variable can be used to override the automatically detected +# command (or specify its location if the auto-detection fails to +# find it.) +##end +# +##variable +# CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile +# resources on Mac OS X. This variable can be used to override the +# automatically detected command (or specify its location if the +# auto-detection fails to find it.) +##end + +#============================================================================= +# Copyright 2006-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.) diff -Nru cmake-2.8.7/Modules/CPackDeb.cmake cmake-2.8.9/Modules/CPackDeb.cmake --- cmake-2.8.7/Modules/CPackDeb.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CPackDeb.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,3 +1,6 @@ +##section Variables specific to CPack Debian (DEB) generator +##end +##module # - The builtin (binary) CPack Deb generator (Unix only) # CPackDeb may be used to create Deb package using CPack. # CPackDeb is a CPack generator thus it uses the CPACK_XXX variables @@ -11,43 +14,67 @@ # the wiki: # http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29 # However as a handy reminder here comes the list of specific variables: +##end # +##variable # CPACK_DEBIAN_PACKAGE_NAME # Mandatory : YES # Default : CPACK_PACKAGE_NAME (lower case) # The debian package summary +##end +##variable # CPACK_DEBIAN_PACKAGE_VERSION # Mandatory : YES # Default : CPACK_PACKAGE_VERSION # The debian package version +##end +##variable # CPACK_DEBIAN_PACKAGE_ARCHITECTURE # Mandatory : YES # Default : Output of dpkg --print-architecture (or i386 if dpkg is not found) # The debian package architecture +##end +##variable # CPACK_DEBIAN_PACKAGE_DEPENDS # Mandatory : NO # Default : - # May be used to set deb dependencies. +##end +##variable # CPACK_DEBIAN_PACKAGE_MAINTAINER # Mandatory : YES # Default : CPACK_PACKAGE_CONTACT # The debian package maintainer +##end +##variable # CPACK_DEBIAN_PACKAGE_DESCRIPTION # Mandatory : YES # Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY # The debian package description +##end +##variable # CPACK_DEBIAN_PACKAGE_SECTION # Mandatory : YES # Default : 'devel' # The debian package section +##end +##variable # CPACK_DEBIAN_PACKAGE_PRIORITY # Mandatory : YES # Default : 'optional' # The debian package priority +##end +##variable # 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 # Mandatory : NO # Default : OFF @@ -57,11 +84,15 @@ # if you use this feature, because if you don't dpkg-shlibdeps # may fail to find your own shared libs. # See http://www.cmake.org/Wiki/CMake_RPATH_handling. +##end +##variable # CPACK_DEBIAN_PACKAGE_DEBUG # Mandatory : NO # Default : - # May be set when invoking cpack in order to trace debug information # during CPackDeb run. +##end +##variable # CPACK_DEBIAN_PACKAGE_PREDEPENDS # Mandatory : NO # Default : - @@ -69,12 +100,16 @@ # This field is like Depends, except that it also forces dpkg to complete installation of # the packages named before even starting the installation of the package which declares # the pre-dependency. +##end +##variable # CPACK_DEBIAN_PACKAGE_ENHANCES # Mandatory : NO # Default : - # see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps # This field is similar to Suggests but works in the opposite direction. # It is used to declare that a package can enhance the functionality of another package. +##end +##variable # CPACK_DEBIAN_PACKAGE_BREAKS # Mandatory : NO # Default : - @@ -82,23 +117,54 @@ # When one binary package declares that it breaks another, dpkg will refuse to allow the # package which declares Breaks be installed unless the broken package is deconfigured first, # and it will refuse to allow the broken package to be reconfigured. +##end +##variable # CPACK_DEBIAN_PACKAGE_CONFLICTS # Mandatory : NO # Default : - # see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps # When one binary package declares a conflict with another using a Conflicts field, # dpkg will refuse to allow them to be installed on the system at the same time. +##end +##variable # CPACK_DEBIAN_PACKAGE_PROVIDES # Mandatory : NO # Default : - # see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps # A virtual package is one which appears in the Provides control field of another package. +##end +##variable # CPACK_DEBIAN_PACKAGE_REPLACES # Mandatory : NO # Default : - # see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps # 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 -Nru cmake-2.8.7/Modules/CPackNSIS.cmake cmake-2.8.9/Modules/CPackNSIS.cmake --- cmake-2.8.7/Modules/CPackNSIS.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CPackNSIS.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,70 +1,134 @@ +##section Variables specific to CPack NSIS generator +##end +##module # - CPack NSIS generator specific options # # The following variables are specific to the graphical installers built # on Windows using the Nullsoft Installation System. +##end # -# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when -# installing this project. -# +##variable # CPACK_NSIS_INSTALL_ROOT - The default installation directory presented # to the end user by the NSIS installer is under this root dir. The full # directory presented to the end user is: # ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY} +##end # -# CPACK_NSIS_MUI_ICON - The icon file (.ico) for the generated +##variable +# CPACK_NSIS_MUI_ICON - An icon filename. +# The name of a *.ico file used as the main icon for the generated # install program. +##end # -# CPACK_NSIS_MUI_UNIICON - The icon file (.ico) for the generated +##variable +# CPACK_NSIS_MUI_UNIICON - An icon filename. +# The name of a *.ico file used as the main icon for the generated # uninstall program. +##end # -# CPACK_PACKAGE_ICON - A branding image that will be displayed inside -# the installer. -# -# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that will -# be added to the install Section. +##variable +# CPACK_NSIS_INSTALLER_MUI_ICON_CODE - undocumented. +##end +# +##variable +# 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 # CPACK_NSIS_COMPRESSOR - The arguments that will be passed to the # NSIS SetCompressor command. +##end # -# CPACK_NSIS_MODIFY_PATH - If this is set to "ON", then an extra page +##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 # whether the program directory should be added to the system PATH # variable. +##end # +##variable # CPACK_NSIS_DISPLAY_NAME - The display name string that appears in # the Windows Add/Remove Program control panel +##end # +##variable # CPACK_NSIS_PACKAGE_NAME - The title displayed at the top of the # installer. +##end # +##variable # CPACK_NSIS_INSTALLED_ICON_NAME - A path to the executable that # contains the installer icon. +##end # +##variable # CPACK_NSIS_HELP_LINK - URL to a web site providing assistance in # installing your application. +##end # +##variable # CPACK_NSIS_URL_INFO_ABOUT - URL to a web site providing more # information about your application. +##end # +##variable # CPACK_NSIS_CONTACT - Contact information for questions and comments # about the installation process. +##end # +##variable # CPACK_NSIS_CREATE_ICONS_EXTRA - Additional NSIS commands for # creating start menu shortcuts. +##end # +##variable # CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to # uninstall start menu shortcuts. +##end # +##variable # CPACK_NSIS_EXECUTABLES_DIRECTORY - Creating NSIS start menu links # assumes that they are in 'bin' unless this variable is set. # For example, you would set this to 'exec' if your executables are # in an exec directory. +##end # +##variable # CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option # to run on the finish page of the NSIS installer. +##end +##variable +# CPACK_NSIS_MENU_LINKS - Specify links in [application] menu. +# This should contain a list of pair "link" "link name". The link +# may be an URL or a path relative to installation prefix. +# Like: +# set(CPACK_NSIS_MENU_LINKS +# "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help" +# "http://www.cmake.org" "CMake Web Site") +##end #============================================================================= # Copyright 2006-2009 Kitware, Inc. diff -Nru cmake-2.8.7/Modules/CPackPackageMaker.cmake cmake-2.8.9/Modules/CPackPackageMaker.cmake --- cmake-2.8.7/Modules/CPackPackageMaker.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/CPackPackageMaker.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,35 @@ +##section Variables specific to CPack PackageMaker generator +##end +##module +# - PackageMaker CPack generator (Mac OS X). +# The following variable is specific to installers build on Mac OS X +# using PackageMaker: +##end +# +##variable +# CPACK_OSX_PACKAGE_VERSION - The version of Mac OS X that the +# resulting PackageMaker archive should be compatible with. Different +# versions of Mac OS X support different +# features. For example, CPack can only build component-based +# installers for Mac OS X 10.4 or newer, and can only build +# installers that download component son-the-fly for Mac OS X 10.5 +# or newer. If left blank, this value will be set to the minimum +# version of Mac OS X that supports the requested features. Set this +# variable to some value (e.g., 10.4) only if you want to guarantee +# that your installer will work on that version of Mac OS X, and +# don't mind missing extra features available in the installer +# shipping with later versions of Mac OS X. +##end + +#============================================================================= +# Copyright 2006-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.) diff -Nru cmake-2.8.7/Modules/CPackRPM.cmake cmake-2.8.9/Modules/CPackRPM.cmake --- cmake-2.8.7/Modules/CPackRPM.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CPackRPM.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,3 +1,6 @@ +##section Variables specific to CPack RPM generator +##end +##module # - The builtin (binary) CPack RPM generator (Unix only) # CPackRPM may be used to create RPM package using CPack. # CPackRPM is a CPack generator thus it uses the CPACK_XXX variables @@ -15,52 +18,67 @@ # You'll find a detailed usage of CPackRPM on the wiki: # http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29 # However as a handy reminder here comes the list of specific variables: +##end # -# CPACK_RPM_PACKAGE_SUMMARY +##variable +# CPACK_RPM_PACKAGE_SUMMARY - The RPM package summary. # Mandatory : YES # Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY -# The RPM package summary -# CPACK_RPM_PACKAGE_NAME +##end +##variable +# CPACK_RPM_PACKAGE_NAME - The RPM package name. # Mandatory : YES # Default : CPACK_PACKAGE_NAME -# The RPM package name -# CPACK_RPM_PACKAGE_VERSION +##end +##variable +# CPACK_RPM_PACKAGE_VERSION - The RPM package version. # Mandatory : YES # Default : CPACK_PACKAGE_VERSION -# The RPM package version -# CPACK_RPM_PACKAGE_ARCHITECTURE +##end +##variable +# CPACK_RPM_PACKAGE_ARCHITECTURE - The RPM package architecture. # Mandatory : NO # Default : - -# The RPM package architecture. This may be set to "noarch" if you +# This may be set to "noarch" if you # know you are building a noarch package. -# CPACK_RPM_PACKAGE_RELEASE +##end +##variable +# CPACK_RPM_PACKAGE_RELEASE - The RPM package release. # Mandatory : YES # Default : 1 -# The RPM package release. This is the numbering of the RPM package +# This is the numbering of the RPM package # itself, i.e. the version of the packaging and not the version of the # content (see CPACK_RPM_PACKAGE_VERSION). One may change the default # value if the previous packaging was buggy and/or you want to put here # a fancy Linux distro specific numbering. -# CPACK_RPM_PACKAGE_LICENSE +##end +##variable +# CPACK_RPM_PACKAGE_LICENSE - The RPM package license policy. # Mandatory : YES # Default : "unknown" -# The RPM package license policy. -# CPACK_RPM_PACKAGE_GROUP +##end +##variable +# CPACK_RPM_PACKAGE_GROUP - The RPM package group. # Mandatory : YES # Default : "unknown" -# The RPM package group. -# CPACK_RPM_PACKAGE_VENDOR +##end +##variable +# CPACK_RPM_PACKAGE_VENDOR - The RPM package vendor. # Mandatory : YES # Default : CPACK_PACKAGE_VENDOR if set or "unknown" -# The RPM package vendor. -# CPACK_RPM_PACKAGE_URL +##end +##variable +# CPACK_RPM_PACKAGE_URL - The projects URL. # Mandatory : NO # Default : - -# The projects URL. -# CPACK_RPM_PACKAGE_DESCRIPTION +##end +##variable +# CPACK_RPM_PACKAGE_DESCRIPTION - RPM package description. # Mandatory : YES # Default : CPACK_PACKAGE_DESCRIPTION_FILE if set or "no package description available" -# CPACK_RPM_COMPRESSION_TYPE +##end +##variable +# CPACK_RPM_COMPRESSION_TYPE - RPM compression type. # Mandatory : NO # Default : - # May be used to override RPM compression type to be used @@ -68,7 +86,9 @@ # to lzma or xz compression whereas older cannot use such RPM. # Using this one can enforce compression type to be used. # Possible value are: lzma, xz, bzip2 and gzip. -# CPACK_RPM_PACKAGE_REQUIRES +##end +##variable +# CPACK_RPM_PACKAGE_REQUIRES - RPM spec requires field. # Mandatory : NO # Default : - # May be used to set RPM dependencies (requires). @@ -77,22 +97,30 @@ # set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8") # The required package list of an RPM file could be printed with # rpm -qp --requires file.rpm -# CPACK_RPM_PACKAGE_SUGGESTS +##end +##variable +# CPACK_RPM_PACKAGE_SUGGESTS - RPM spec suggest field. # Mandatory : NO # Default : - # May be used to set weak RPM dependencies (suggests). # Note that you must enclose the complete requires string between quotes. -# CPACK_RPM_PACKAGE_PROVIDES +##end +##variable +# CPACK_RPM_PACKAGE_PROVIDES - RPM spec provides field. # Mandatory : NO # Default : - # May be used to set RPM dependencies (provides). # The provided package list of an RPM file could be printed with # rpm -qp --provides file.rpm -# CPACK_RPM_PACKAGE_OBSOLETES +##end +##variable +# CPACK_RPM_PACKAGE_OBSOLETES - RPM spec obsoletes field. # Mandatory : NO # Default : - # May be used to set RPM packages that are obsoleted by this one. -# CPACK_RPM_PACKAGE_RELOCATABLE +##end +##variable +# CPACK_RPM_PACKAGE_RELOCATABLE - build a relocatable RPM. # Mandatory : NO # Default : CPACK_PACKAGE_RELOCATABLE # If this variable is set to TRUE or ON CPackRPM will try @@ -103,7 +131,9 @@ # If CPACK_SET_DESTDIR is set then you will get a warning message # but if there is file installed with absolute path you'll get # unexpected behavior. -# CPACK_RPM_SPEC_INSTALL_POST [deprecated] +##end +##variable +# CPACK_RPM_SPEC_INSTALL_POST - [deprecated]. # Mandatory : NO # Default : - # This way of specifying post-install script is deprecated use @@ -111,23 +141,31 @@ # May be used to set an RPM post-install command inside the spec file. # For example setting it to "/bin/true" may be used to prevent # rpmbuild to strip binaries. -# CPACK_RPM_SPEC_MORE_DEFINE +##end +##variable +# CPACK_RPM_SPEC_MORE_DEFINE - RPM extended spec definitions lines. # Mandatory : NO # Default : - # May be used to add any %define lines to the generated spec file. -# CPACK_RPM_PACKAGE_DEBUG +##end +##variable +# CPACK_RPM_PACKAGE_DEBUG - Toggle CPackRPM debug output. # Mandatory : NO # Default : - # May be set when invoking cpack in order to trace debug information # during CPack RPM run. For example you may launch CPack like this # cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM -# CPACK_RPM_USER_BINARY_SPECFILE +##end +##variable +# CPACK_RPM_USER_BINARY_SPECFILE - A user provided spec file. # Mandatory : NO # Default : - # May be set by the user in order to specify a USER binary spec file # to be used by CPackRPM instead of generating the file. # The specified file will be processed by CONFIGURE_FILE( @ONLY). -# CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE +##end +##variable +# CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE - Spec file template. # Mandatory : NO # Default : - # If set CPack will generate a template for USER specified binary @@ -135,6 +173,8 @@ # cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM # The user may then use this file in order to hand-craft is own # binary spec file which may be used with CPACK_RPM_USER_BINARY_SPECFILE. +##end +##variable # CPACK_RPM_PRE_INSTALL_SCRIPT_FILE # CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE # Mandatory : NO @@ -143,11 +183,13 @@ # The refered script file(s) will be read and directly # put after the %pre or %preun section # If CPACK_RPM_COMPONENT_INSTALL is set to ON the (un)install script for -# each component can be overriden with +# each component can be overridden with # CPACK_RPM__PRE_INSTALL_SCRIPT_FILE and # CPACK_RPM__PRE_UNINSTALL_SCRIPT_FILE # One may verify which scriptlet has been included with # rpm -qp --scripts package.rpm +##end +##variable # CPACK_RPM_POST_INSTALL_SCRIPT_FILE # CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE # Mandatory : NO @@ -156,26 +198,31 @@ # The refered script file(s) will be read and directly # put after the %post or %postun section # If CPACK_RPM_COMPONENT_INSTALL is set to ON the (un)install script for -# each component can be overriden with +# each component can be overridden with # CPACK_RPM__POST_INSTALL_SCRIPT_FILE and # CPACK_RPM__POST_UNINSTALL_SCRIPT_FILE # One may verify which scriptlet has been included with # rpm -qp --scripts package.rpm +##end +##variable # CPACK_RPM_USER_FILELIST # CPACK_RPM__USER_FILELIST # Mandatory : NO # Default : - -# May be used to explicitely specify %() file line +# May be used to explicitly specify %() file line # in the spec file. Like %config(noreplace) or any other directive # that be found in the %files section. Since CPackRPM is generating # the list of files (and directories) the user specified files of # the CPACK_RPM__USER_FILELIST list will be removed from the generated list. -# CPACK_RPM_CHANGELOG_FILE +##end +##variable +# CPACK_RPM_CHANGELOG_FILE - RPM changelog file. # Mandatory : NO # Default : - # May be used to embed a changelog in the spec file. # The refered file will be read and directly put after the %changelog # section. +##end #============================================================================= # Copyright 2007-2009 Kitware, Inc. @@ -441,7 +488,10 @@ 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 @@ -714,6 +764,25 @@ set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "") endif(CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL) +# Prepend directories in ${CPACK_RPM_INSTALL_FILES} with %dir +# This is necessary to avoid duplicate files since rpmbuild do +# recursion on its own when encountering a pathname which is a directory +# which is not flagged as %dir +string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST) +string(REPLACE "\n" ";" CPACK_RPM_INSTALL_FILES_LIST + "${CPACK_RPM_INSTALL_FILES_LIST}") +string(REPLACE "\"" "" CPACK_RPM_INSTALL_FILES_LIST + "${CPACK_RPM_INSTALL_FILES_LIST}") +set(CPACK_RPM_INSTALL_FILES "") +foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST) + if(IS_DIRECTORY "${WDIR}/${F}") + set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}%dir \"${F}\"\n") + else() + set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n") + endif() +endforeach(F) +set(CPACK_RPM_INSTALL_FILES_LIST "") + # The name of the final spec file to be used by rpmbuild SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.spec") @@ -833,6 +902,7 @@ # Now call rpmbuild using the SPECFILE EXECUTE_PROCESS( COMMAND "${RPMBUILD_EXECUTABLE}" -bb + --define "_topdir ${CPACK_RPM_DIRECTORY}" --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}" "${CPACK_RPM_BINARY_SPECFILE}" WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}" diff -Nru cmake-2.8.7/Modules/CTestTargets.cmake cmake-2.8.9/Modules/CTestTargets.cmake --- cmake-2.8.7/Modules/CTestTargets.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CTestTargets.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -69,7 +69,7 @@ ENDFOREACH(mode) # For Makefile generators add more granular targets. - IF("${CMAKE_GENERATOR}" MATCHES Make) + IF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)") # Make targets for Experimental builds FOREACH(mode Nightly Experimental Continuous) FOREACH(testtype @@ -83,7 +83,7 @@ SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets") ENDFOREACH(testtype) ENDFOREACH(mode) - ENDIF("${CMAKE_GENERATOR}" MATCHES Make) + ENDIF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)") # If requested, add an alias that is the equivalent of the built-in "test" # or "RUN_TESTS" target: diff -Nru cmake-2.8.7/Modules/CheckCCompilerFlag.cmake cmake-2.8.9/Modules/CheckCCompilerFlag.cmake --- cmake-2.8.7/Modules/CheckCCompilerFlag.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CheckCCompilerFlag.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -7,8 +7,9 @@ # that can modify the build. #============================================================================= -# Copyright 2006-2010 Kitware, Inc. +# Copyright 2006-2011 Kitware, Inc. # Copyright 2006 Alexander Neundorf +# Copyright 2011 Matthias Kretz # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -27,15 +28,18 @@ SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}") CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT} # Some compilers do not fail with a bad flag - FAIL_REGEX "warning: command line option .* is valid for .* but not for C" - # Apple gcc + FAIL_REGEX "command line option .* is valid for .* but not for C" # GNU FAIL_REGEX "unrecognized .*option" # GNU 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 "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 + FAIL_REGEX "WARNING: unknown flag:" # Open64 ) SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") ENDMACRO (CHECK_C_COMPILER_FLAG) diff -Nru cmake-2.8.7/Modules/CheckCSourceCompiles.cmake cmake-2.8.9/Modules/CheckCSourceCompiles.cmake --- cmake-2.8.7/Modules/CheckCSourceCompiles.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CheckCSourceCompiles.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -24,6 +24,9 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake") + + MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR) IF("${VAR}" MATCHES "^${VAR}$") SET(_FAIL_REGEX) @@ -40,8 +43,10 @@ SET(MACRO_CHECK_FUNCTION_DEFINITIONS "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") IF(CMAKE_REQUIRED_LIBRARIES) + # this one translates potentially used imported library targets to their files on disk + CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") ELSE(CMAKE_REQUIRED_LIBRARIES) SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES) diff -Nru cmake-2.8.7/Modules/CheckCSourceRuns.cmake cmake-2.8.9/Modules/CheckCSourceRuns.cmake --- cmake-2.8.7/Modules/CheckCSourceRuns.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CheckCSourceRuns.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -24,13 +24,18 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake") + + MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR) IF("${VAR}" MATCHES "^${VAR}$") - SET(MACRO_CHECK_FUNCTION_DEFINITIONS + SET(MACRO_CHECK_FUNCTION_DEFINITIONS "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") IF(CMAKE_REQUIRED_LIBRARIES) + # this one translates potentially used imported library targets to their files on disk + CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") ELSE(CMAKE_REQUIRED_LIBRARIES) SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES) @@ -61,7 +66,7 @@ IF("${${VAR}_EXITCODE}" EQUAL 0) SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}") MESSAGE(STATUS "Performing Test ${VAR} - Success") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n" "${OUTPUT}\n" "Return value: ${${VAR}}\n" @@ -74,7 +79,7 @@ ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") MESSAGE(STATUS "Performing Test ${VAR} - Failed") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n" "${OUTPUT}\n" "Return value: ${${VAR}_EXITCODE}\n" diff -Nru cmake-2.8.7/Modules/CheckCXXCompilerFlag.cmake cmake-2.8.9/Modules/CheckCXXCompilerFlag.cmake --- cmake-2.8.7/Modules/CheckCXXCompilerFlag.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CheckCXXCompilerFlag.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -9,6 +9,7 @@ #============================================================================= # Copyright 2006-2010 Kitware, Inc. # Copyright 2006 Alexander Neundorf +# Copyright 2011 Matthias Kretz # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -27,15 +28,20 @@ SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}") CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT} # Some compilers do not fail with a bad flag + FAIL_REGEX "command line option .* is valid for .* but not for C\\\\+\\\\+" # GNU FAIL_REGEX "unrecognized .*option" # GNU 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 "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 FAIL_REGEX "not supported in this configuration; ignored" # AIX FAIL_REGEX "File with unknown suffix passed to linker" # PGI + FAIL_REGEX "WARNING: unknown flag:" # Open64 ) SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") ENDMACRO (CHECK_CXX_COMPILER_FLAG) diff -Nru cmake-2.8.7/Modules/CheckCXXSourceCompiles.cmake cmake-2.8.9/Modules/CheckCXXSourceCompiles.cmake --- cmake-2.8.7/Modules/CheckCXXSourceCompiles.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CheckCXXSourceCompiles.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -24,6 +24,9 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake") + + MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR) IF("${VAR}" MATCHES "^${VAR}$") SET(_FAIL_REGEX) @@ -41,8 +44,10 @@ SET(MACRO_CHECK_FUNCTION_DEFINITIONS "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") IF(CMAKE_REQUIRED_LIBRARIES) + # this one translates potentially used imported library targets to their files on disk + CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") ELSE(CMAKE_REQUIRED_LIBRARIES) SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES) diff -Nru cmake-2.8.7/Modules/CheckCXXSourceRuns.cmake cmake-2.8.9/Modules/CheckCXXSourceRuns.cmake --- cmake-2.8.7/Modules/CheckCXXSourceRuns.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CheckCXXSourceRuns.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -24,13 +24,18 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake") + + MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR) IF("${VAR}" MATCHES "^${VAR}$") - SET(MACRO_CHECK_FUNCTION_DEFINITIONS + SET(MACRO_CHECK_FUNCTION_DEFINITIONS "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") IF(CMAKE_REQUIRED_LIBRARIES) + # this one translates potentially used imported library targets to their files on disk + CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") ELSE(CMAKE_REQUIRED_LIBRARIES) SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES) @@ -62,9 +67,9 @@ IF("${${VAR}_EXITCODE}" EQUAL 0) SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}") MESSAGE(STATUS "Performing Test ${VAR} - Success") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n" - "${OUTPUT}\n" + "${OUTPUT}\n" "Return value: ${${VAR}}\n" "Source file was:\n${SOURCE}\n") ELSE("${${VAR}_EXITCODE}" EQUAL 0) @@ -75,9 +80,9 @@ ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") MESSAGE(STATUS "Performing Test ${VAR} - Failed") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n" - "${OUTPUT}\n" + "${OUTPUT}\n" "Return value: ${${VAR}_EXITCODE}\n" "Source file was:\n${SOURCE}\n") ENDIF("${${VAR}_EXITCODE}" EQUAL 0) diff -Nru cmake-2.8.7/Modules/CheckFortranFunctionExists.cmake cmake-2.8.9/Modules/CheckFortranFunctionExists.cmake --- cmake-2.8.7/Modules/CheckFortranFunctionExists.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CheckFortranFunctionExists.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -22,12 +22,17 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake") + + macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE) if(NOT DEFINED ${VARIABLE}) message(STATUS "Looking for Fortran ${FUNCTION}") if(CMAKE_REQUIRED_LIBRARIES) + # this one translates potentially used imported library targets to their files on disk + cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") else(CMAKE_REQUIRED_LIBRARIES) set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) endif(CMAKE_REQUIRED_LIBRARIES) @@ -50,13 +55,13 @@ if(${VARIABLE}) set(${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") message(STATUS "Looking for Fortran ${FUNCTION} - found") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n") else(${VARIABLE}) message(STATUS "Looking for Fortran ${FUNCTION} - not found") set(${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") endif(${VARIABLE}) diff -Nru cmake-2.8.7/Modules/CheckFunctionExists.cmake cmake-2.8.9/Modules/CheckFunctionExists.cmake --- cmake-2.8.7/Modules/CheckFunctionExists.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CheckFunctionExists.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -27,14 +27,19 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake") + + MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE) IF("${VARIABLE}" MATCHES "^${VARIABLE}$") - SET(MACRO_CHECK_FUNCTION_DEFINITIONS + SET(MACRO_CHECK_FUNCTION_DEFINITIONS "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}") MESSAGE(STATUS "Looking for ${FUNCTION}") IF(CMAKE_REQUIRED_LIBRARIES) + # this one translates potentially used imported library targets to their files on disk + CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") ELSE(CMAKE_REQUIRED_LIBRARIES) SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES) @@ -55,13 +60,13 @@ IF(${VARIABLE}) SET(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}") MESSAGE(STATUS "Looking for ${FUNCTION} - found") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the function ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n") ELSE(${VARIABLE}) MESSAGE(STATUS "Looking for ${FUNCTION} - not found") SET(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the function ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") ENDIF(${VARIABLE}) diff -Nru cmake-2.8.7/Modules/CheckIncludeFiles.cmake cmake-2.8.9/Modules/CheckIncludeFiles.cmake --- cmake-2.8.7/Modules/CheckIncludeFiles.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CheckIncludeFiles.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -13,7 +13,7 @@ # CMAKE_REQUIRED_INCLUDES = list of include directories #============================================================================= -# Copyright 2003-2009 Kitware, Inc. +# Copyright 2003-2012 Kitware, Inc. # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -44,7 +44,17 @@ CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c" @ONLY IMMEDIATE) - MESSAGE(STATUS "Looking for include files ${VARIABLE}") + SET(_INCLUDE ${INCLUDE}) # remove empty elements + IF("${_INCLUDE}" MATCHES "^([^;]+);.+;([^;]+)$") + LIST(LENGTH _INCLUDE _INCLUDE_LEN) + SET(_description "${_INCLUDE_LEN} include files ${CMAKE_MATCH_1}, ..., ${CMAKE_MATCH_2}") + ELSEIF("${_INCLUDE}" MATCHES "^([^;]+);([^;]+)$") + SET(_description "include files ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}") + ELSE() + SET(_description "include file ${_INCLUDE}") + ENDIF() + + MESSAGE(STATUS "Looking for ${_description}") TRY_COMPILE(${VARIABLE} ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c @@ -54,15 +64,15 @@ "${CHECK_INCLUDE_FILES_INCLUDE_DIRS}" OUTPUT_VARIABLE OUTPUT) IF(${VARIABLE}) - MESSAGE(STATUS "Looking for include files ${VARIABLE} - found") - SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${VARIABLE}") + MESSAGE(STATUS "Looking for ${_description} - found") + SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}") FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if files ${INCLUDE} " "exist passed with the following output:\n" "${OUTPUT}\n\n") ELSE(${VARIABLE}) - MESSAGE(STATUS "Looking for include files ${VARIABLE} - not found.") - SET(${VARIABLE} "" CACHE INTERNAL "Have includes ${VARIABLE}") + MESSAGE(STATUS "Looking for ${_description} - not found.") + SET(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}") FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if files ${INCLUDE} " "exist failed with the following output:\n" diff -Nru cmake-2.8.7/Modules/CheckLanguage.cmake cmake-2.8.9/Modules/CheckLanguage.cmake --- cmake-2.8.7/Modules/CheckLanguage.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/CheckLanguage.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,65 @@ +# - Check if a language can be enabled +# Usage: +# check_language() +# where is a language that may be passed to enable_language() +# such as "Fortran". If CMAKE__COMPILER is already defined the +# check does nothing. Otherwise it tries enabling the language in a +# test project. The result is cached in CMAKE__COMPILER as the +# compiler that was found, or NOTFOUND if the language cannot be enabled. +# +# Example: +# check_language(Fortran) +# if(CMAKE_Fortran_COMPILER) +# enable_language(Fortran) +# else() +# message(STATUS "No Fortran support") +# endif() + +#============================================================================= +# Copyright 2009-2012 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +macro(check_language lang) + if(NOT DEFINED CMAKE_${lang}_COMPILER) + set(_desc "Looking for a ${lang} compiler") + message(STATUS ${_desc}) + file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}/CMakeLists.txt" + "cmake_minimum_required(VERSION 2.8) +project(Check${lang} ${lang}) +file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" + \"set(CMAKE_${lang}_COMPILER \\\"\${CMAKE_${lang}_COMPILER}\\\")\\n\" + ) +") + execute_process( + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang} + COMMAND ${CMAKE_COMMAND} . -G ${CMAKE_GENERATOR} + OUTPUT_VARIABLE output + ERROR_VARIABLE output + RESULT_VARIABLE result + ) + include(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}/result.cmake OPTIONAL) + if(CMAKE_${lang}_COMPILER AND "${result}" STREQUAL "0") + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${_desc} passed with the following output:\n" + "${output}\n") + else() + set(CMAKE_${lang}_COMPILER NOTFOUND) + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "${_desc} failed with the following output:\n" + "${output}\n") + endif() + message(STATUS "${_desc} - ${CMAKE_${lang}_COMPILER}") + set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER}" CACHE FILEPATH "${lang} compiler") + mark_as_advanced(CMAKE_${lang}_COMPILER) + endif() +endmacro() diff -Nru cmake-2.8.7/Modules/CheckLibraryExists.cmake cmake-2.8.9/Modules/CheckLibraryExists.cmake --- cmake-2.8.7/Modules/CheckLibraryExists.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CheckLibraryExists.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -26,21 +26,26 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake") + + MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE) IF("${VARIABLE}" MATCHES "^${VARIABLE}$") - SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION + SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}") MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY}") SET(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY}) IF(CMAKE_REQUIRED_LIBRARIES) - SET(CHECK_LIBRARY_EXISTS_LIBRARIES - ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES}) + # this one translates potentially used imported library targets to their files on disk + CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") + SET(CHECK_LIBRARY_EXISTS_LIBRARIES + ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}) ENDIF(CMAKE_REQUIRED_LIBRARIES) TRY_COMPILE(${VARIABLE} ${CMAKE_BINARY_DIR} ${CMAKE_ROOT}/Modules/CheckFunctionExists.c COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} - CMAKE_FLAGS + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_LIBRARY_EXISTS_DEFINITION} -DLINK_DIRECTORIES:STRING=${LOCATION} "-DLINK_LIBRARIES:STRING=${CHECK_LIBRARY_EXISTS_LIBRARIES}" @@ -49,14 +54,14 @@ IF(${VARIABLE}) MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found") SET(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the function ${FUNCTION} exists in the ${LIBRARY} " "passed with the following output:\n" "${OUTPUT}\n\n") ELSE(${VARIABLE}) MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found") SET(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the function ${FUNCTION} exists in the ${LIBRARY} " "failed with the following output:\n" "${OUTPUT}\n\n") diff -Nru cmake-2.8.7/Modules/CheckPrototypeDefinition.cmake cmake-2.8.9/Modules/CheckPrototypeDefinition.cmake --- cmake-2.8.7/Modules/CheckPrototypeDefinition.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CheckPrototypeDefinition.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -34,8 +34,11 @@ # License text for the above reference.) # +include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake") + get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) + function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE) if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$") @@ -43,8 +46,10 @@ set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS}) if (CMAKE_REQUIRED_LIBRARIES) + # this one translates potentially used imported library targets to their files on disk + cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") set(CHECK_PROTOTYPE_DEFINITION_LIBS - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") else(CMAKE_REQUIRED_LIBRARIES) set(CHECK_PROTOTYPE_DEFINITION_LIBS) endif(CMAKE_REQUIRED_LIBRARIES) diff -Nru cmake-2.8.7/Modules/CheckSymbolExists.cmake cmake-2.8.9/Modules/CheckSymbolExists.cmake --- cmake-2.8.7/Modules/CheckSymbolExists.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CheckSymbolExists.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -35,6 +35,9 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake") + + MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE) _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) ENDMACRO(CHECK_SYMBOL_EXISTS) @@ -44,8 +47,10 @@ SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n") SET(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS}) IF(CMAKE_REQUIRED_LIBRARIES) + # this one translates potentially used imported library targets to their files on disk + CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") SET(CHECK_SYMBOL_EXISTS_LIBS - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") ELSE(CMAKE_REQUIRED_LIBRARIES) SET(CHECK_SYMBOL_EXISTS_LIBS) ENDIF(CMAKE_REQUIRED_LIBRARIES) @@ -60,7 +65,7 @@ "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n") ENDFOREACH(FILE) SET(CMAKE_CONFIGURABLE_FILE_CONTENT - "${CMAKE_CONFIGURABLE_FILE_CONTENT}\nvoid cmakeRequireSymbol(int dummy,...){(void)dummy;}\nint main()\n{\n#ifndef ${SYMBOL}\n cmakeRequireSymbol(0,&${SYMBOL});\n#endif\n return 0;\n}\n") + "${CMAKE_CONFIGURABLE_FILE_CONTENT}\nint main(int argc, char** argv)\n{\n (void)argv;\n#ifndef ${SYMBOL}\n return ((int*)(&${SYMBOL}))[argc];\n#else\n (void)argc;\n return 0;\n#endif\n}\n") CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in" "${SOURCEFILE}" @ONLY IMMEDIATE) diff -Nru cmake-2.8.7/Modules/CheckTypeSize.cmake cmake-2.8.9/Modules/CheckTypeSize.cmake --- cmake-2.8.7/Modules/CheckTypeSize.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CheckTypeSize.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -47,6 +47,7 @@ # License text for the above reference.) include(CheckIncludeFile) +include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake") cmake_policy(PUSH) cmake_minimum_required(VERSION 2.6 FATAL_ERROR) @@ -76,6 +77,10 @@ endforeach() # Perform the check. + + # this one translates potentially used imported library targets to their files on disk + cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") + set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c) set(bin ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.bin) configure_file(${__check_type_size_dir}/CheckTypeSize.c.in ${src} @ONLY) @@ -84,7 +89,7 @@ CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}" "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}" - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}" + "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}" OUTPUT_VARIABLE output COPY_FILE ${bin} ) diff -Nru cmake-2.8.7/Modules/CheckVariableExists.cmake cmake-2.8.9/Modules/CheckVariableExists.cmake --- cmake-2.8.7/Modules/CheckVariableExists.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/CheckVariableExists.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,6 +1,6 @@ # - Check if the variable exists. # CHECK_VARIABLE_EXISTS(VAR VARIABLE) -# +# # VAR - the name of the variable # VARIABLE - variable to store the result # @@ -26,14 +26,19 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake") + + MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE) IF("${VARIABLE}" MATCHES "^${VARIABLE}$") - SET(MACRO_CHECK_VARIABLE_DEFINITIONS + SET(MACRO_CHECK_VARIABLE_DEFINITIONS "-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}") MESSAGE(STATUS "Looking for ${VAR}") IF(CMAKE_REQUIRED_LIBRARIES) + # this one translates potentially used imported library targets to their files on disk + CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") ELSE(CMAKE_REQUIRED_LIBRARIES) SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES) @@ -47,13 +52,13 @@ IF(${VARIABLE}) SET(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}") MESSAGE(STATUS "Looking for ${VAR} - found") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the variable ${VAR} exists passed with the following output:\n" "${OUTPUT}\n\n") ELSE(${VARIABLE}) SET(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}") MESSAGE(STATUS "Looking for ${VAR} - not found") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the variable ${VAR} exists failed with the following output:\n" "${OUTPUT}\n\n") ENDIF(${VARIABLE}) diff -Nru cmake-2.8.7/Modules/Compiler/GNU.cmake cmake-2.8.9/Modules/Compiler/GNU.cmake --- cmake-2.8.7/Modules/Compiler/GNU.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Compiler/GNU.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -21,9 +21,25 @@ 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") + # Older versions of gcc (< 4.5) contain a bug causing them to report a missing + # header file as a warning if depfiles are enabled, causing check_header_file + # tests to always succeed. Work around this by disabling dependency tracking + # in try_compile mode. + GET_PROPERTY(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE) + if(NOT _IN_TC OR CMAKE_FORCE_DEPFILES) + # distcc does not transform -o to -MT when invoking the preprocessor + # internally, as it ought to. Work around this bug by setting -MT here + # even though it isn't strictly necessary. + set(CMAKE_DEPFILE_FLAGS_${lang} "-MMD -MT -MF ") + endif() + # Initial configuration flags. set(CMAKE_${lang}_FLAGS_INIT "") set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g") diff -Nru cmake-2.8.7/Modules/Compiler/SCO.cmake cmake-2.8.9/Modules/Compiler/SCO.cmake --- cmake-2.8.7/Modules/Compiler/SCO.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Compiler/SCO.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -20,6 +20,9 @@ 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 -Nru cmake-2.8.7/Modules/Compiler/SunPro-C.cmake cmake-2.8.9/Modules/Compiler/SunPro-C.cmake --- cmake-2.8.7/Modules/Compiler/SunPro-C.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Compiler/SunPro-C.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/Compiler/SunPro-CXX.cmake cmake-2.8.9/Modules/Compiler/SunPro-CXX.cmake --- cmake-2.8.7/Modules/Compiler/SunPro-CXX.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Compiler/SunPro-CXX.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/Compiler/XL.cmake cmake-2.8.9/Modules/Compiler/XL.cmake --- cmake-2.8.7/Modules/Compiler/XL.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Compiler/XL.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -47,7 +47,7 @@ # 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 -Nru cmake-2.8.7/Modules/DeployQt4.cmake cmake-2.8.9/Modules/DeployQt4.cmake --- cmake-2.8.7/Modules/DeployQt4.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/DeployQt4.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -82,6 +82,7 @@ include(BundleUtilities) set(DeployQt4_cmake_dir "${CMAKE_CURRENT_LIST_DIR}") +set(DeployQt4_apple_plugins_dir "PlugIns") function(write_qt4_conf qt_conf_dir qt_conf_contents) set(qt_conf_path "${qt_conf_dir}/qt.conf") @@ -125,11 +126,17 @@ if(QT_LIBRARY_DIR) list(APPEND dirs "${QT_LIBRARY_DIR}") endif() + if(QT_BINARY_DIR) + list(APPEND dirs "${QT_BINARY_DIR}") + endif() if(APPLE) set(qt_conf_dir "${executable}/Contents/Resources") set(executable_path "${executable}") set(write_qt_conf TRUE) + if(NOT plugins_dir) + set(plugins_dir "${DeployQt4_apple_plugins_dir}") + endif() else() get_filename_component(executable_path "${executable}" PATH) if(NOT executable_path) @@ -141,7 +148,7 @@ foreach(plugin ${qtplugins}) set(installed_plugin_path "") - install_qt4_plugin("${plugin}" "${plugins_dir}" "${executable}" 1 installed_plugin_path) + install_qt4_plugin("${plugin}" "${executable}" 1 installed_plugin_path) list(APPEND libs ${installed_plugin_path}) endforeach() @@ -166,23 +173,19 @@ set(component ${ARGV5}) set(configurations ${ARGV6}) if(EXISTS "${plugin}") - if(plugins_dir) - set(plugins_dir "${plugins_dir}") - else() - if(APPLE) - set(plugins_dir "PlugIns") - else() - set(plugins_dir "plugins") - endif() - endif() if(APPLE) + if(NOT plugins_dir) + set(plugins_dir "${DeployQt4_apple_plugins_dir}") + endif() set(plugins_path "${executable}/Contents/${plugins_dir}") else() - get_filename_component(executable_path "${executable}" PATH) - if(NOT executable_path) - set(executable_path ".") + get_filename_component(plugins_path "${executable}" PATH) + if(NOT plugins_path) + set(plugins_path ".") + endif() + if(plugins_dir) + set(plugins_path "${plugins_path}/${plugins_dir}") endif() - set(plugins_path "${executable_path}/${plugins_dir}") endif() set(plugin_group "") @@ -210,7 +213,7 @@ endif() install(FILES "${plugin}" DESTINATION "${plugins_path}" ${configurations} ${component}) endif() - set(${installed_plugin_path_var} ${${installed_path_var}} "${plugins_path}/${plugin_name}" PARENT_SCOPE) + set(${installed_plugin_path_var} "${plugins_path}/${plugin_name}" PARENT_SCOPE) endif() endfunction() @@ -220,11 +223,7 @@ if(EXISTS "${plugin}") install_qt4_plugin_path("${plugin}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}") else() - if(QT_IS_STATIC) - string(TOUPPER "QT_${plugin}_LIBRARY" plugin_var) - else() - string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var) - endif() + string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var) set(plugin_release_var "${plugin_var}_RELEASE") set(plugin_debug_var "${plugin_var}_DEBUG") set(plugin_release "${${plugin_release_var}}") @@ -232,10 +231,24 @@ if(DEFINED "${plugin_release_var}" AND DEFINED "${plugin_debug_var}" AND NOT EXISTS "${plugin_release}" AND NOT EXISTS "${plugin_debug}") message(WARNING "Qt plugin \"${plugin}\" not recognized or found.") endif() - install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Release|RelWithDebInfo|MinSizeRel") - install_qt4_plugin_path("${plugin_debug}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Debug") + if(NOT EXISTS "${${plugin_debug_var}}") + set(plugin_debug "${plugin_release}") + endif() + + if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}_release" "${plugins_dir}" "${component}" "Release|RelWithDebInfo|MinSizeRel") + install_qt4_plugin_path("${plugin_debug}" "${executable}" "${copy}" "${installed_plugin_path_var}_debug" "${plugins_dir}" "${component}" "Debug") + + if(CMAKE_BUILD_TYPE MATCHES "^Debug$") + set(${installed_plugin_path_var} ${${installed_plugin_path_var}_debug}) + else() + set(${installed_plugin_path_var} ${${installed_plugin_path_var}_release}) + endif() + else() + install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}") + endif() endif() - set(installed_plugin_path_var "${installed_plugin_path_var}" PARENT_SCOPE) + set(${installed_plugin_path_var} ${${installed_plugin_path_var}} PARENT_SCOPE) endfunction() function(install_qt4_executable executable) @@ -248,6 +261,9 @@ if(QT_LIBRARY_DIR) list(APPEND dirs "${QT_LIBRARY_DIR}") endif() + if(QT_BINARY_DIR) + list(APPEND dirs "${QT_BINARY_DIR}") + endif() if(component) set(component COMPONENT ${component}) else() @@ -264,17 +280,17 @@ set(qt_plugins_dir "") endif() - if(NOT qtplugins AND QT_LIBRARIES_PLUGINS) - set(qtplugins "${QT_LIBRARIES_PLUGINS}") + if(QT_IS_STATIC) + message(WARNING "Qt built statically: not installing plugins.") + else() + foreach(plugin ${qtplugins}) + set(installed_plugin_paths "") + install_qt4_plugin("${plugin}" "${executable}" 0 installed_plugin_paths "${plugins_dir}" "${component}") + list(APPEND libs ${installed_plugin_paths}) + endforeach() endif() - foreach(plugin ${qtplugins}) - set(installed_plugin_paths "") - install_qt4_plugin("${plugin}" "${executable}" 0 installed_plugin_paths "${plugins_dir}" "${component}") - list(APPEND libs ${installed_plugin_paths}) - endforeach() - - resolve_qt4_paths(libs) + resolve_qt4_paths(libs "") install(CODE "INCLUDE(\"${DeployQt4_cmake_dir}/DeployQt4.cmake\") diff -Nru cmake-2.8.7/Modules/ExternalProject.cmake cmake-2.8.9/Modules/ExternalProject.cmake --- cmake-2.8.7/Modules/ExternalProject.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/ExternalProject.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -144,7 +144,7 @@ # set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) #============================================================================= -# Copyright 2008-2009 Kitware, Inc. +# Copyright 2008-2012 Kitware, Inc. # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -252,12 +252,23 @@ ) -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 @@ 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 @@ 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,38 +852,55 @@ 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) + foreach(arg IN LISTS deps) + add_dependencies(${name}-${step} ${arg}) + endforeach() endforeach() endfunction(ExternalProject_Add_StepTargets) function(ExternalProject_Add_Step name step) set(cmf_dir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles) - ExternalProject_Get_Property(${name} stamp_dir) - _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() @@ -865,7 +910,8 @@ # 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. @@ -895,10 +941,10 @@ # 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? @@ -908,7 +954,7 @@ endif() add_custom_command( - OUTPUT ${stamp_dir}${cfgdir}/${name}-${step} + OUTPUT ${stamp_file} COMMENT ${comment} COMMAND ${command} COMMAND ${touch} @@ -954,6 +1000,7 @@ execute_process( COMMAND "${git_EXECUTABLE}" --version OUTPUT_VARIABLE ov + ERROR_VARIABLE ev OUTPUT_STRIP_TRAILING_WHITESPACE ) string(REGEX REPLACE "^git version (.+)$" "\\1" version "${ov}") @@ -1072,9 +1119,15 @@ 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" @@ -1090,6 +1143,7 @@ # _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) @@ -1134,7 +1188,8 @@ 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() @@ -1269,14 +1324,12 @@ 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) @@ -1439,25 +1492,36 @@ # 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 # depends on the 'done' mark so that it rebuilds when this project # rebuilds. It is important that 'done' is not the output of any # custom command so that CMake does not propagate build rules to - # other external project targets. + # other external project targets, which may cause problems during + # 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 ${complete_stamp_file}) + if(${CMAKE_GENERATOR} MATCHES "Ninja") + set(complete_outputs ${complete_outputs} ${done_stamp_file}) + endif() + add_custom_command( - OUTPUT ${cmf_dir}${cfgdir}/${name}-complete + 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 -Nru cmake-2.8.7/Modules/FeatureSummary.cmake cmake-2.8.9/Modules/FeatureSummary.cmake --- cmake-2.8.7/Modules/FeatureSummary.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FeatureSummary.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -125,7 +125,7 @@ # # set_package_properties(LibXml2 PROPERTIES TYPE RECOMMENDED # PURPOSE "Enables HTML-import in MyWordProcessor") -# ... +# ... # set_package_properties(LibXml2 PROPERTIES TYPE OPTIONAL # PURPOSE "Enables odt-export in MyWordProcessor") # @@ -318,7 +318,7 @@ 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 @@ 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 -Nru cmake-2.8.7/Modules/FindALSA.cmake cmake-2.8.9/Modules/FindALSA.cmake --- cmake-2.8.7/Modules/FindALSA.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindALSA.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -8,11 +8,12 @@ # # ALSA_INCLUDE_DIR - where to find asoundlib.h, etc. # ALSA_LIBRARY - the asound library +# ALSA_VERSION_STRING - the version of alsa found (since CMake 2.8.8) # #============================================================================= -# Copyright 2009 Kitware, Inc. -# Copyright 2009 Philip Lowman +# Copyright 2009-2011 Kitware, Inc. +# Copyright 2009-2011 Philip Lowman # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -24,8 +25,7 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -find_path(ALSA_INCLUDE_DIR NAMES asoundlib.h - PATH_SUFFIXES alsa +find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h DOC "The ALSA (asound) include directory" ) @@ -33,10 +33,19 @@ DOC "The ALSA (asound) library" ) +if(ALSA_INCLUDE_DIR AND EXISTS "${ALSA_INCLUDE_DIR}/alsa/version.h") + file(STRINGS "${ALSA_INCLUDE_DIR}/alsa/version.h" alsa_version_str REGEX "^#define[\t ]+SND_LIB_VERSION_STR[\t ]+\".*\"") + + string(REGEX REPLACE "^.*SND_LIB_VERSION_STR[\t ]+\"([^\"]*)\".*$" "\\1" ALSA_VERSION_STRING "${alsa_version_str}") + unset(alsa_version_str) +endif() + # handle the QUIETLY and REQUIRED arguments and set ALSA_FOUND to TRUE if # all listed variables are TRUE include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA DEFAULT_MSG ALSA_LIBRARY ALSA_INCLUDE_DIR) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA + REQUIRED_VARS ALSA_LIBRARY ALSA_INCLUDE_DIR + VERSION_VAR ALSA_VERSION_STRING) if(ALSA_FOUND) set( ALSA_LIBRARIES ${ALSA_LIBRARY} ) diff -Nru cmake-2.8.7/Modules/FindArmadillo.cmake cmake-2.8.9/Modules/FindArmadillo.cmake --- cmake-2.8.7/Modules/FindArmadillo.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindArmadillo.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -74,7 +74,7 @@ #====================== -# 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 -Nru cmake-2.8.7/Modules/FindBISON.cmake cmake-2.8.9/Modules/FindBISON.cmake --- cmake-2.8.7/Modules/FindBISON.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindBISON.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -75,8 +75,9 @@ ELSEIF("${BISON_version_output}" MATCHES "^bison[^+]") STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1" BISON_VERSION "${BISON_version_output}") - ELSE() - SET(BISON_VERSION "unknown") + ELSEIF("${BISON_version_output}" MATCHES "^GNU Bison ") + STRING(REGEX REPLACE "^GNU Bison (version )?([^\n]+).*" "\\2" + BISON_VERSION "${BISON_version_output}") ENDIF() ENDIF() diff -Nru cmake-2.8.7/Modules/FindBLAS.cmake cmake-2.8.9/Modules/FindBLAS.cmake --- cmake-2.8.7/Modules/FindBLAS.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindBLAS.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -23,6 +23,7 @@ ########## ### List of vendors (BLA_VENDOR) valid in this module ## Goto,ATLAS PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model), +## Intel10_64lp_seq (intel mkl v10 64 bit,sequential code, lp64 model), ## Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,ACML_GPU,Apple, NAS, Generic # C/CXX should be enabled to use Intel mkl @@ -85,6 +86,7 @@ set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH) endif () endif () + foreach(_library ${_list}) set(_combined_name ${_combined_name}_${_library}) @@ -115,7 +117,7 @@ endforeach(_library ${_list}) if(_libraries_work) # Test this combination of libraries. - set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_threads}) + set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_thread}) # message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") if (_CHECK_FORTRAN) check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS) @@ -460,117 +462,97 @@ else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) find_package(Threads REQUIRED) endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) - if (WIN32) + + set(BLAS_SEARCH_LIBS "") + if(BLA_F95) - if(NOT BLAS95_LIBRARIES) - check_fortran_libraries( - BLAS95_LIBRARIES - BLAS - sgemm - "" - "mkl_blas95;mkl_intel_c;mkl_intel_thread;mkl_core;libguide40" - "" - ) - endif(NOT BLAS95_LIBRARIES) - else(BLA_F95) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - SGEMM - "" - "mkl_c_dll;mkl_intel_thread_dll;mkl_core_dll;libguide40" - "" - ) - endif(NOT BLAS_LIBRARIES) - endif(BLA_F95) - else(WIN32) - if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") - if(BLA_F95) - if(NOT BLAS95_LIBRARIES) - check_fortran_libraries( - BLAS95_LIBRARIES - BLAS - sgemm - "" - "mkl_blas95;mkl_intel;mkl_intel_thread;mkl_core;guide" - "${CMAKE_THREAD_LIBS_INIT};${LM}" - ) - endif(NOT BLAS95_LIBRARIES) - else(BLA_F95) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl_intel;mkl_intel_thread;mkl_core;guide" - "${CMAKE_THREAD_LIBS_INIT}" - "${LM}" - ) - endif(NOT BLAS_LIBRARIES) - endif(BLA_F95) - endif (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") - if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All") - if(BLA_F95) - if(NOT BLAS95_LIBRARIES) - check_fortran_libraries( - BLAS95_LIBRARIES - BLAS - sgemm - "" - "mkl_blas95;mkl_intel_lp64;mkl_intel_thread;mkl_core;guide" - "${CMAKE_THREAD_LIBS_INIT};${LM}" - ) - endif(NOT BLAS95_LIBRARIES) - else(BLA_F95) - if(NOT BLAS_LIBRARIES) + set(BLAS_mkl_SEARCH_SYMBOL SGEMM) + set(_LIBRARIES BLAS95_LIBRARIES) + if (WIN32) + list(APPEND BLAS_SEARCH_LIBS + "mkl_blas95 mkl_intel_c mkl_intel_thread mkl_core libguide40") + else (WIN32) + if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") + list(APPEND BLAS_SEARCH_LIBS + "mkl_blas95 mkl_intel mkl_intel_thread mkl_core guide") + endif () + if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All") + # old version + list(APPEND BLAS_SEARCH_LIBS + "mkl_blas95 mkl_intel_lp64 mkl_intel_thread mkl_core guide") + + # mkl >= 10.3 + if (CMAKE_C_COMPILER MATCHES ".+gcc.*") + list(APPEND BLAS_SEARCH_LIBS + "mkl_blas95_lp64 mkl_intel_lp64 mkl_gnu_thread mkl_core gomp") + else () + list(APPEND BLAS_SEARCH_LIBS + "mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core iomp5") + endif () + endif () + endif (WIN32) + if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All") + list(APPEND BLAS_SEARCH_LIBS + "mkl_blas95_lp64 mkl_intel_lp64 mkl_sequential mkl_core") + endif () + else (BLA_F95) + set(BLAS_mkl_SEARCH_SYMBOL sgemm) + set(_LIBRARIES BLAS_LIBRARIES) + if (WIN32) + list(APPEND BLAS_SEARCH_LIBS + "mkl_c_dll mkl_intel_thread_dll mkl_core_dll libguide40") + else (WIN32) + if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") + list(APPEND BLAS_SEARCH_LIBS + "mkl_intel mkl_intel_thread mkl_core guide") + endif () + if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All") + + # old version + list(APPEND BLAS_SEARCH_LIBS + "mkl_intel_lp64 mkl_intel_thread mkl_core guide") + + # mkl >= 10.3 + if (CMAKE_C_COMPILER MATCHES ".+gcc.*") + list(APPEND BLAS_SEARCH_LIBS + "mkl_intel_lp64 mkl_gnu_thread mkl_core gomp") + else () + list(APPEND BLAS_SEARCH_LIBS + "mkl_intel_lp64 mkl_intel_thread mkl_core iomp5") + endif () + endif () + + #older vesions of intel mkl libs + if (BLA_VENDOR STREQUAL "Intel" OR BLA_VENDOR STREQUAL "All") + list(APPEND BLAS_SEARCH_LIBS + "mkl") + list(APPEND BLAS_SEARCH_LIBS + "mkl_ia32") + list(APPEND BLAS_SEARCH_LIBS + "mkl_em64t") + endif () + endif (WIN32) + if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All") + list(APPEND BLAS_SEARCH_LIBS + "mkl_intel_lp64 mkl_sequential mkl_core") + endif () + endif (BLA_F95) + + foreach (IT ${BLAS_SEARCH_LIBS}) + string(REPLACE " " ";" SEARCH_LIBS ${IT}) + if (${_LIBRARIES}) + else () check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl_intel_lp64;mkl_intel_thread;mkl_core;guide" - "${CMAKE_THREAD_LIBS_INIT};${LM}" - ) - endif(NOT BLAS_LIBRARIES) - endif(BLA_F95) - endif (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All") - endif (WIN32) - #older vesions of intel mkl libs - # BLAS in intel mkl library? (shared) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl;guide" - "${CMAKE_THREAD_LIBS_INIT};${LM}" - ) - endif(NOT BLAS_LIBRARIES) - #BLAS in intel mkl library? (static, 32bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl_ia32;guide" - "${CMAKE_THREAD_LIBS_INIT};${LM}" - ) - endif(NOT BLAS_LIBRARIES) - #BLAS in intel mkl library? (static, em64t 64bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl_em64t;guide" - "${CMAKE_THREAD_LIBS_INIT};${LM}" - ) - endif(NOT BLAS_LIBRARIES) + ${_LIBRARIES} + BLAS + ${BLAS_mkl_SEARCH_SYMBOL} + "" + "${SEARCH_LIBS}" + "${CMAKE_THREAD_LIBS_INIT};${LM}" + ) + endif () + endforeach () + endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") diff -Nru cmake-2.8.7/Modules/FindBZip2.cmake cmake-2.8.9/Modules/FindBZip2.cmake --- cmake-2.8.7/Modules/FindBZip2.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindBZip2.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -5,10 +5,12 @@ # BZIP2_INCLUDE_DIR - the BZip2 include directory # BZIP2_LIBRARIES - Link these to use BZip2 # BZIP2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_ +# BZIP2_VERSION_STRING - the version of BZip2 found (since CMake 2.8.8) #============================================================================= -# Copyright 2006-2009 Kitware, Inc. +# Copyright 2006-2012 Kitware, Inc. # Copyright 2006 Alexander Neundorf +# Copyright 2012 Rolf Eike Beer # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -20,19 +22,35 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h ) - -FIND_LIBRARY(BZIP2_LIBRARIES NAMES bz2 bzip2 ) +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 ${_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) +ENDIF (NOT BZIP2_LIBRARIES) + +IF (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h") + FILE(STRINGS "${BZIP2_INCLUDE_DIR}/bzlib.h" BZLIB_H REGEX "bzip2/libbzip2 version [0-9]+\\.[^ ]+ of [0-9]+ ") + STRING(REGEX REPLACE ".* bzip2/libbzip2 version ([0-9]+\\.[^ ]+) of [0-9]+ .*" "\\1" BZIP2_VERSION_STRING "${BZLIB_H}") +ENDIF (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h") # handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if # all listed variables are TRUE INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2 DEFAULT_MSG BZIP2_LIBRARIES BZIP2_INCLUDE_DIR) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2 + REQUIRED_VARS BZIP2_LIBRARIES BZIP2_INCLUDE_DIR + VERSION_VAR BZIP2_VERSION_STRING) IF (BZIP2_FOUND) INCLUDE(CheckLibraryExists) - CHECK_LIBRARY_EXISTS(${BZIP2_LIBRARIES} BZ2_bzCompressInit "" BZIP2_NEED_PREFIX) + CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX) ENDIF (BZIP2_FOUND) -MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR BZIP2_LIBRARIES) - +MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR) diff -Nru cmake-2.8.7/Modules/FindBoost.cmake cmake-2.8.9/Modules/FindBoost.cmake --- cmake-2.8.7/Modules/FindBoost.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindBoost.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -65,7 +65,9 @@ # 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1, # 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39, 1.39.0, # 1.40, 1.40.0, 1.41, 1.41.0, 1.42, 1.42.0, 1.43, 1.43.0, 1.44, 1.44.0, -# 1.45, 1.45.0, 1.46, 1.46.0, 1.46.1, 1.47, 1.47.0, 1.48, 1.48.0 +# 1.45, 1.45.0, 1.46, 1.46.0, 1.46.1, 1.47, 1.47.0, 1.48, 1.48.0, +# 1.49, 1.49.0, 1.50, 1.50.0, 1.51, 1.51.0, 1.52, 1.52.0, +# 1.53, 1.53.0, 1.54, 1.54.0, 1.55, 1.55.0, 1.56, 1.56.0 # # NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should # add both 1.x and 1.x.0 as shown above. Official Boost include directories @@ -245,7 +247,7 @@ # Copyright 2007 Wengo # Copyright 2007 Mike Jackson # Copyright 2008 Andreas Pakulat -# Copyright 2008-2010 Philip Lowman +# Copyright 2008-2012 Philip Lowman # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -297,6 +299,7 @@ #------------------------------------------------------------------------------- # FindBoost functions & macros # + ############################################ # # Check the existence of the libraries. @@ -427,18 +430,95 @@ endif() endfunction() +# Guesses Boost's compiler prefix used in built library names +# Returns the guess by setting the variable pointed to by _ret +function(_Boost_GUESS_COMPILER_PREFIX _ret) + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" + OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" + OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") + if(WIN32) + set (_boost_COMPILER "-iw") + else() + set (_boost_COMPILER "-il") + endif() + elseif (MSVC11) + set(_boost_COMPILER "-vc110") + elseif (MSVC10) + set(_boost_COMPILER "-vc100") + elseif (MSVC90) + set(_boost_COMPILER "-vc90") + elseif (MSVC80) + set(_boost_COMPILER "-vc80") + elseif (MSVC71) + set(_boost_COMPILER "-vc71") + elseif (MSVC70) # Good luck! + set(_boost_COMPILER "-vc7") # yes, this is correct + elseif (MSVC60) # Good luck! + set(_boost_COMPILER "-vc6") # yes, this is correct + elseif (BORLAND) + set(_boost_COMPILER "-bcb") + elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "SunPro") + set(_boost_COMPILER "-sw") + elseif (MINGW) + if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) + set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34 + else() + _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) + set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}") + endif() + elseif (UNIX) + if (CMAKE_COMPILER_IS_GNUCXX) + if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) + set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34 + else() + _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) + # Determine which version of GCC we have. + if(APPLE) + if(Boost_MINOR_VERSION) + if(${Boost_MINOR_VERSION} GREATER 35) + # In Boost 1.36.0 and newer, the mangled compiler name used + # on Mac OS X/Darwin is "xgcc". + set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}") + else(${Boost_MINOR_VERSION} GREATER 35) + # In Boost <= 1.35.0, there is no mangled compiler name for + # the Mac OS X/Darwin version of GCC. + set(_boost_COMPILER "") + endif(${Boost_MINOR_VERSION} GREATER 35) + else(Boost_MINOR_VERSION) + # We don't know the Boost version, so assume it's + # pre-1.36.0. + set(_boost_COMPILER "") + endif(Boost_MINOR_VERSION) + else() + set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") + endif() + endif() + endif (CMAKE_COMPILER_IS_GNUCXX) + else() + # TODO at least Boost_DEBUG here? + set(_boost_COMPILER "") + endif() + set(${_ret} ${_boost_COMPILER} PARENT_SCOPE) +endfunction() + # # End functions/macros # #------------------------------------------------------------------------------- - - +#------------------------------------------------------------------------------- +# main. +#------------------------------------------------------------------------------- if(NOT DEFINED Boost_USE_MULTITHREADED) set(Boost_USE_MULTITHREADED TRUE) endif() +# Check the version of Boost against the requested version. +if(Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) + message(SEND_ERROR "When requesting a specific version of Boost, you must provide at least the major and minor version numbers, e.g., 1.34") +endif() + if(Boost_FIND_VERSION_EXACT) # The version may appear in a directory with or without the patch # level, even when the patch level is non-zero. @@ -449,7 +529,9 @@ # The user has not requested an exact version. Among known # versions, find those that are acceptable to the user request. set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} - "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1" + "1.56.0" "1.56" "1.55.0" "1.55" "1.54.0" "1.54" + "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51" + "1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1" "1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42" "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0" @@ -479,51 +561,7 @@ # Boost. set(Boost_ERROR_REASON) -set( _boost_IN_CACHE TRUE) -if(Boost_INCLUDE_DIR) - - # On versions < 1.35, remove the System library from the considered list - # since it wasn't added until 1.35. - if(Boost_VERSION AND Boost_FIND_COMPONENTS) - if(Boost_VERSION LESS 103500) - list(REMOVE_ITEM Boost_FIND_COMPONENTS system) - endif() - endif() - - foreach(COMPONENT ${Boost_FIND_COMPONENTS}) - string(TOUPPER ${COMPONENT} COMPONENT) - if(NOT Boost_${COMPONENT}_FOUND) - set( _boost_IN_CACHE FALSE) - endif(NOT Boost_${COMPONENT}_FOUND) - endforeach(COMPONENT) -else(Boost_INCLUDE_DIR) - set( _boost_IN_CACHE FALSE) -endif(Boost_INCLUDE_DIR) - -if(_boost_IN_CACHE) - # in cache already - set(Boost_FOUND TRUE) - foreach(COMPONENT ${Boost_FIND_COMPONENTS}) - string(TOUPPER ${COMPONENT} COMPONENT) - _Boost_ADJUST_LIB_VARS( ${COMPONENT} ) - set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${COMPONENT}_LIBRARY}) - endforeach(COMPONENT) - set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) - if(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") - math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") - math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") - math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") - endif(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} " - "is already in the cache. To view debugging messages, please clear the cache.") - endif() -else(_boost_IN_CACHE) - # Need to search for boost - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost not in cache") # Output some of their choices message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") @@ -737,78 +775,17 @@ message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "using user-specified Boost_COMPILER = ${_boost_COMPILER}") endif() - else(Boost_COMPILER) + else() # Attempt to guess the compiler suffix # NOTE: this is not perfect yet, if you experience any issues # please report them and use the Boost_COMPILER variable # to work around the problems. - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" - OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" - OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") - if(WIN32) - set (_boost_COMPILER "-iw") - else() - set (_boost_COMPILER "-il") - endif() - elseif (MSVC11) - set(_boost_COMPILER "-vc110") - elseif (MSVC10) - set(_boost_COMPILER "-vc100") - elseif (MSVC90) - set(_boost_COMPILER "-vc90") - elseif (MSVC80) - set(_boost_COMPILER "-vc80") - elseif (MSVC71) - set(_boost_COMPILER "-vc71") - elseif (MSVC70) # Good luck! - set(_boost_COMPILER "-vc7") # yes, this is correct - elseif (MSVC60) # Good luck! - set(_boost_COMPILER "-vc6") # yes, this is correct - elseif (BORLAND) - set(_boost_COMPILER "-bcb") - elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "SunPro") - set(_boost_COMPILER "-sw") - elseif (MINGW) - if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) - set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34 - else() - _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) - set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}") - endif() - elseif (UNIX) - if (CMAKE_COMPILER_IS_GNUCXX) - if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) - set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34 - else() - _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) - # Determine which version of GCC we have. - if(APPLE) - if(Boost_MINOR_VERSION) - if(${Boost_MINOR_VERSION} GREATER 35) - # In Boost 1.36.0 and newer, the mangled compiler name used - # on Mac OS X/Darwin is "xgcc". - set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}") - else(${Boost_MINOR_VERSION} GREATER 35) - # In Boost <= 1.35.0, there is no mangled compiler name for - # the Mac OS X/Darwin version of GCC. - set(_boost_COMPILER "") - endif(${Boost_MINOR_VERSION} GREATER 35) - else(Boost_MINOR_VERSION) - # We don't know the Boost version, so assume it's - # pre-1.36.0. - set(_boost_COMPILER "") - endif(Boost_MINOR_VERSION) - else() - set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") - endif() - endif() - endif (CMAKE_COMPILER_IS_GNUCXX) - endif() + _Boost_GUESS_COMPILER_PREFIX(_boost_COMPILER) if(Boost_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "guessed _boost_COMPILER = ${_boost_COMPILER}") endif() - endif(Boost_COMPILER) + endif() set (_boost_MULTITHREADED "-mt") if( NOT Boost_USE_MULTITHREADED ) @@ -943,6 +920,13 @@ endif() endif() + # On versions < 1.35, remove the System library from the considered list + # since it wasn't added until 1.35. + if(Boost_VERSION AND Boost_FIND_COMPONENTS) + if(Boost_VERSION LESS 103500) + list(REMOVE_ITEM Boost_FIND_COMPONENTS system) + endif() + endif() foreach(COMPONENT ${Boost_FIND_COMPONENTS}) string(TOUPPER ${COMPONENT} UPPERCOMPONENT) @@ -1029,10 +1013,18 @@ if( Boost_USE_STATIC_LIBS ) set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) endif() + # ------------------------------------------------------------------------ # End finding boost libraries # ------------------------------------------------------------------------ + # ------------------------------------------------------------------------ + # Begin long process of determining Boost_FOUND, starting with version + # number checks, followed by + # TODO: Ideally the version check logic should happen prior to searching + # for libraries... + # ------------------------------------------------------------------------ + set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR} ) @@ -1041,10 +1033,6 @@ if(Boost_INCLUDE_DIR) set( Boost_FOUND TRUE ) - # Check the version of Boost against the requested version. - if (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) - message(SEND_ERROR "When requesting a specific version of Boost, you must provide at least the major and minor version numbers, e.g., 1.34") - endif (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) if(Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" ) set( Boost_FOUND FALSE ) set(_Boost_VERSION_AGE "old") @@ -1146,7 +1134,7 @@ # Look for the boost library path. # Note that the user may not have installed any libraries - # so it is quite possible the Boost_LIBRARY_PATH may not exist. + # so it is quite possible the Boost_LIBRARY_DIRS may not exist. set(_boost_LIB_DIR ${Boost_INCLUDE_DIR}) if("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+") @@ -1178,6 +1166,10 @@ set( Boost_FOUND FALSE) endif(Boost_INCLUDE_DIR) + # ------------------------------------------------------------------------ + # Notification to end user about what was found + # ------------------------------------------------------------------------ + if(Boost_FOUND) if(NOT Boost_FIND_QUIETLY) message(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") @@ -1200,7 +1192,7 @@ else() if(NOT Boost_FIND_QUIETLY) # we opt not to automatically output Boost_ERROR_REASON here as - # it could be quite lengthy and somewhat imposing in it's requests + # it could be quite lengthy and somewhat imposing in its requests # Since Boost is not always a required dependency we'll leave this # up to the end-user. if(Boost_DEBUG OR Boost_DETAILED_FAILURE_MSG) @@ -1217,4 +1209,3 @@ Boost_INCLUDE_DIRS Boost_LIBRARY_DIRS ) -endif(_boost_IN_CACHE) diff -Nru cmake-2.8.7/Modules/FindBullet.cmake cmake-2.8.9/Modules/FindBullet.cmake --- cmake-2.8.7/Modules/FindBullet.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindBullet.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -63,7 +63,7 @@ _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 -Nru cmake-2.8.7/Modules/FindCUDA.cmake cmake-2.8.9/Modules/FindCUDA.cmake --- cmake-2.8.7/Modules/FindCUDA.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindCUDA.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -216,6 +216,18 @@ # CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS # implementation (alterative to: # CUDA_ADD_CUBLAS_TO_TARGET macro). +# CUDA_curand_LIBRARY -- CUDA Random Number Generation library. +# Only available for CUDA version 3.2+. +# CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library. +# Only available for CUDA version 3.2+. +# CUDA_npp_LIBRARY -- NVIDIA Performance Primitives library. +# Only available for CUDA version 4.0+. +# CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library. +# Only available for CUDA version 3.2+. +# Windows only. +# CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library. +# Only available for CUDA version 3.2+. +# Windows only. # # # James Bigler, NVIDIA Corp (nvidia.com - jbigler) @@ -430,6 +442,11 @@ unset(CUDA_cublasemu_LIBRARY CACHE) unset(CUDA_cufft_LIBRARY CACHE) unset(CUDA_cufftemu_LIBRARY CACHE) + unset(CUDA_curand_LIBRARY CACHE) + unset(CUDA_cusparse_LIBRARY CACHE) + unset(CUDA_npp_LIBRARY CACHE) + unset(CUDA_nvcuvenc_LIBRARY CACHE) + unset(CUDA_nvcuvid_LIBRARY CACHE) endif() if(NOT "${CUDA_SDK_ROOT_DIR}" STREQUAL "${CUDA_SDK_ROOT_DIR_INTERNAL}") @@ -523,7 +540,7 @@ 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() @@ -600,7 +617,7 @@ endif() endif() -# Search for cufft and cublas libraries. +# Search for additional CUDA toolkit libraries. if(CUDA_VERSION VERSION_LESS "3.1") # Emulation libraries aren't available in version 3.1 onward. find_cuda_helper_libs(cufftemu) @@ -608,6 +625,18 @@ endif() find_cuda_helper_libs(cufft) find_cuda_helper_libs(cublas) +if(NOT CUDA_VERSION VERSION_LESS "3.2") + # cusparse showed up in version 3.2 + find_cuda_helper_libs(cusparse) + find_cuda_helper_libs(curand) + if (WIN32) + find_cuda_helper_libs(nvcuvenc) + find_cuda_helper_libs(nvcuvid) + endif() +endif() +if(NOT CUDA_VERSION VERSION_LESS "4.0") + find_cuda_helper_libs(npp) +endif() if (CUDA_BUILD_EMULATION) set(CUDA_CUFFT_LIBRARIES ${CUDA_cufftemu_LIBRARY}) @@ -877,7 +906,7 @@ message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS: '${format}'. Use OBJ or PTX.") endif() - # Set up all the command line flags here, so that they can be overriden on a per target basis. + # Set up all the command line flags here, so that they can be overridden on a per target basis. set(nvcc_flags "") diff -Nru cmake-2.8.7/Modules/FindCURL.cmake cmake-2.8.9/Modules/FindCURL.cmake --- cmake-2.8.7/Modules/FindCURL.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindCURL.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,12 +1,14 @@ # - Find curl # Find the native CURL headers and libraries. # -# CURL_INCLUDE_DIRS - where to find curl/curl.h, etc. -# CURL_LIBRARIES - List of libraries when using curl. -# CURL_FOUND - True if curl found. +# CURL_INCLUDE_DIRS - where to find curl/curl.h, etc. +# CURL_LIBRARIES - List of libraries when using curl. +# CURL_FOUND - True if curl found. +# CURL_VERSION_STRING - the version of curl found (since CMake 2.8.8) #============================================================================= # Copyright 2006-2009 Kitware, Inc. +# Copyright 2012 Rolf Eike Beer # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -32,10 +34,24 @@ ) MARK_AS_ADVANCED(CURL_LIBRARY) +IF(CURL_INCLUDE_DIR) + FOREACH(_curl_version_header curlver.h curl.h) + IF(EXISTS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}") + FILE(STRINGS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"") + + STRING(REGEX REPLACE "^#define[\t ]+LIBCURL_VERSION[\t ]+\"([^\"]*)\".*" "\\1" CURL_VERSION_STRING "${curl_version_str}") + UNSET(curl_version_str) + BREAK() + ENDIF() + ENDFOREACH(_curl_version_header) +ENDIF() + # handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if # all listed variables are TRUE INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL DEFAULT_MSG CURL_LIBRARY CURL_INCLUDE_DIR) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL + REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR + VERSION_VAR CURL_VERSION_STRING) IF(CURL_FOUND) SET(CURL_LIBRARIES ${CURL_LIBRARY}) diff -Nru cmake-2.8.7/Modules/FindCups.cmake cmake-2.8.9/Modules/FindCups.cmake --- cmake-2.8.7/Modules/FindCups.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindCups.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -4,12 +4,14 @@ # CUPS_FOUND - system has Cups # CUPS_INCLUDE_DIR - the Cups include directory # CUPS_LIBRARIES - Libraries needed to use Cups +# CUPS_VERSION_STRING - version of Cups found (since CMake 2.8.8) # Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which # features this function (i.e. at least 1.1.19) #============================================================================= # Copyright 2006-2009 Kitware, Inc. # Copyright 2006 Alexander Neundorf +# Copyright 2012 Rolf Eike Beer # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -21,36 +23,47 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -INCLUDE(CheckLibraryExists) +find_path(CUPS_INCLUDE_DIR cups/cups.h ) -FIND_PATH(CUPS_INCLUDE_DIR cups/cups.h ) +find_library(CUPS_LIBRARIES NAMES cups ) -FIND_LIBRARY(CUPS_LIBRARIES NAMES cups ) +if (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE) + include(CheckLibraryExists) -IF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES) - SET(CUPS_FOUND TRUE) - - # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint) - CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE) - IF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE) - SET(CUPS_FOUND FALSE) - ENDIF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE) - -ELSE (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES) - SET(CUPS_FOUND FALSE) -ENDIF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES) - -IF (CUPS_FOUND) - IF (NOT Cups_FIND_QUIETLY) - MESSAGE(STATUS "Found Cups: ${CUPS_LIBRARIES}") - ENDIF (NOT Cups_FIND_QUIETLY) -ELSE (CUPS_FOUND) - SET(CUPS_LIBRARIES ) - IF (Cups_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could NOT find Cups") - ENDIF (Cups_FIND_REQUIRED) -ENDIF (CUPS_FOUND) - - -MARK_AS_ADVANCED(CUPS_INCLUDE_DIR CUPS_LIBRARIES) + # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint) + CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE) +endif (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE) + +if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h") + file(STRINGS "${CUPS_INCLUDE_DIR}/cups/cups.h" cups_version_str + REGEX "^#[\t ]*define[\t ]+CUPS_VERSION_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$") + + unset(CUPS_VERSION_STRING) + foreach(VPART MAJOR MINOR PATCH) + foreach(VLINE ${cups_version_str}) + if(VLINE MATCHES "^#[\t ]*define[\t ]+CUPS_VERSION_${VPART}") + string(REGEX REPLACE "^#[\t ]*define[\t ]+CUPS_VERSION_${VPART}[\t ]+([0-9]+)$" "\\1" + CUPS_VERSION_PART "${VLINE}") + if(CUPS_VERSION_STRING) + set(CUPS_VERSION_STRING "${CUPS_VERSION_STRING}.${CUPS_VERSION_PART}") + else(CUPS_VERSION_STRING) + set(CUPS_VERSION_STRING "${CUPS_VERSION_PART}") + endif(CUPS_VERSION_STRING) + endif() + endforeach(VLINE) + endforeach(VPART) +endif (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h") + +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) + +if (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cups + REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR CUPS_HAS_IPP_DELETE_ATTRIBUTE + VERSION_VAR CUPS_VERSION_STRING) +else (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cups + REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR + VERSION_VAR CUPS_VERSION_STRING) +endif (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE) +mark_as_advanced(CUPS_INCLUDE_DIR CUPS_LIBRARIES) diff -Nru cmake-2.8.7/Modules/FindCxxTest.cmake cmake-2.8.9/Modules/FindCxxTest.cmake --- cmake-2.8.7/Modules/FindCxxTest.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindCxxTest.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -9,6 +9,7 @@ # Only used in the case both Python & Perl # are detected on the system to control # which CxxTest code generator is used. +# Valid only for CxxTest version 3. # # NOTE: In older versions of this Find Module, # this variable controlled if the Python test @@ -159,7 +160,8 @@ find_package(Perl QUIET) find_path(CXXTEST_INCLUDE_DIR cxxtest/TestSuite.h) -find_program(CXXTEST_PYTHON_TESTGEN_EXECUTABLE cxxtestgen.py +find_program(CXXTEST_PYTHON_TESTGEN_EXECUTABLE + NAMES cxxtestgen cxxtestgen.py PATHS ${CXXTEST_INCLUDE_DIR}) find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl PATHS ${CXXTEST_INCLUDE_DIR}) @@ -167,7 +169,7 @@ if(PYTHONINTERP_FOUND OR PERL_FOUND) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) - if(PYTHONINTERP_FOUND AND (CXXTEST_USE_PYTHON OR NOT PERL_FOUND)) + if(PYTHONINTERP_FOUND AND (CXXTEST_USE_PYTHON OR NOT PERL_FOUND OR NOT DEFINED CXXTEST_USE_PYTHON)) set(CXXTEST_TESTGEN_EXECUTABLE ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE}) set(CXXTEST_TESTGEN_INTERPRETER ${PYTHON_EXECUTABLE}) FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG diff -Nru cmake-2.8.7/Modules/FindDevIL.cmake cmake-2.8.9/Modules/FindDevIL.cmake --- cmake-2.8.7/Modules/FindDevIL.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindDevIL.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/FindDoxygen.cmake cmake-2.8.9/Modules/FindDoxygen.cmake --- cmake-2.8.7/Modules/FindDoxygen.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindDoxygen.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -11,6 +11,7 @@ # # DOXYGEN_EXECUTABLE = The path to the doxygen command. # DOXYGEN_FOUND = Was Doxygen found or not? +# DOXYGEN_VERSION = The version reported by doxygen --version # # DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen. # DOXYGEN_DOT_FOUND = Was Dot found or not? @@ -76,8 +77,12 @@ DOC "Doxygen documentation generation tool (http://www.doxygen.org)" ) +IF(DOXYGEN_EXECUTABLE) + EXECUTE_PROCESS(COMMAND ${DOXYGEN_EXECUTABLE} "--version" OUTPUT_VARIABLE DOXYGEN_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) +ENDIF() + include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen DEFAULT_MSG DOXYGEN_EXECUTABLE) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen REQUIRED_VARS DOXYGEN_EXECUTABLE VERSION_VAR DOXYGEN_VERSION) # # Find Dot... diff -Nru cmake-2.8.7/Modules/FindEXPAT.cmake cmake-2.8.9/Modules/FindEXPAT.cmake --- cmake-2.8.7/Modules/FindEXPAT.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindEXPAT.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -24,10 +24,32 @@ # Look for the library. FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat) +if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h") + file(STRINGS "${EXPAT_INCLUDE_DIR}/expat.h" expat_version_str + REGEX "^#[\t ]*define[\t ]+XML_(MAJOR|MINOR|MICRO)_VERSION[\t ]+[0-9]+$") + + unset(EXPAT_VERSION_STRING) + foreach(VPART MAJOR MINOR MICRO) + foreach(VLINE ${expat_version_str}) + if(VLINE MATCHES "^#[\t ]*define[\t ]+XML_${VPART}_VERSION") + string(REGEX REPLACE "^#[\t ]*define[\t ]+XML_${VPART}_VERSION[\t ]+([0-9]+)$" "\\1" + EXPAT_VERSION_PART "${VLINE}") + if(EXPAT_VERSION_STRING) + set(EXPAT_VERSION_STRING "${EXPAT_VERSION_STRING}.${EXPAT_VERSION_PART}") + else(EXPAT_VERSION_STRING) + set(EXPAT_VERSION_STRING "${EXPAT_VERSION_PART}") + endif(EXPAT_VERSION_STRING) + endif() + endforeach(VLINE) + endforeach(VPART) +endif (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h") + # handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if # all listed variables are TRUE INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT DEFAULT_MSG EXPAT_LIBRARY EXPAT_INCLUDE_DIR) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT + REQUIRED_VARS EXPAT_LIBRARY EXPAT_INCLUDE_DIR + VERSION_VAR EXPAT_VERSION_STRING) # Copy the results to the output variables. IF(EXPAT_FOUND) diff -Nru cmake-2.8.7/Modules/FindFLEX.cmake cmake-2.8.9/Modules/FindFLEX.cmake --- cmake-2.8.7/Modules/FindFLEX.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindFLEX.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -91,8 +91,12 @@ MESSAGE("Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}\nFLEX_VERSION will not be available") ENDIF() ELSE() - STRING(REGEX REPLACE "^flex (.*)$" "\\1" + # older versions of flex printed "/full/path/to/executable version X.Y" + # newer versions use "basename(executable) X.Y" + GET_FILENAME_COMPONENT(FLEX_EXE_NAME "${FLEX_EXECUTABLE}" NAME) + STRING(REGEX REPLACE "^.*${FLEX_EXE_NAME}\"? (version )?([0-9]+[^ ]*)$" "\\2" FLEX_VERSION "${FLEX_version_output}") + UNSET(FLEX_EXE_NAME) ENDIF() #============================================================ diff -Nru cmake-2.8.7/Modules/FindFLTK.cmake cmake-2.8.9/Modules/FindFLTK.cmake --- cmake-2.8.7/Modules/FindFLTK.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindFLTK.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -79,18 +79,14 @@ # 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 @@ # 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 -Nru cmake-2.8.7/Modules/FindFLTK2.cmake cmake-2.8.9/Modules/FindFLTK2.cmake --- cmake-2.8.7/Modules/FindFLTK2.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindFLTK2.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -59,18 +59,14 @@ # 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 @@ # 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 @@ 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 @@ 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 -Nru cmake-2.8.7/Modules/FindFreetype.cmake cmake-2.8.9/Modules/FindFreetype.cmake --- cmake-2.8.7/Modules/FindFreetype.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindFreetype.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -3,6 +3,7 @@ # FREETYPE_LIBRARIES, the library to link against # FREETYPE_FOUND, if false, do not try to link to FREETYPE # FREETYPE_INCLUDE_DIRS, where to find headers. +# FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8) # This is the concatenation of the paths: # FREETYPE_INCLUDE_DIR_ft2build # FREETYPE_INCLUDE_DIR_freetype2 @@ -77,10 +78,33 @@ ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) SET(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}") +IF(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h") + FILE(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h" freetype_version_str + REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$") + + UNSET(FREETYPE_VERSION_STRING) + FOREACH(VPART MAJOR MINOR PATCH) + FOREACH(VLINE ${freetype_version_str}) + IF(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}") + STRING(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1" + FREETYPE_VERSION_PART "${VLINE}") + IF(FREETYPE_VERSION_STRING) + SET(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}") + ELSE(FREETYPE_VERSION_STRING) + SET(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}") + ENDIF(FREETYPE_VERSION_STRING) + UNSET(FREETYPE_VERSION_PART) + ENDIF() + ENDFOREACH(VLINE) + ENDFOREACH(VPART) +ENDIF(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h") + + # handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if # all listed variables are TRUE INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype DEFAULT_MSG FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS) - +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype + REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS + VERSION_VAR FREETYPE_VERSION_STRING) MARK_AS_ADVANCED(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build) diff -Nru cmake-2.8.7/Modules/FindGLUT.cmake cmake-2.8.9/Modules/FindGLUT.cmake --- cmake-2.8.7/Modules/FindGLUT.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindGLUT.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -64,25 +64,23 @@ ENDIF (WIN32) -SET( GLUT_FOUND "NO" ) -IF(GLUT_INCLUDE_DIR) - IF(GLUT_glut_LIBRARY) - # Is -lXi and -lXmu required on all platforms that have it? - # If not, we need some way to figure out what platform we are on. - SET( GLUT_LIBRARIES - ${GLUT_glut_LIBRARY} - ${GLUT_Xmu_LIBRARY} - ${GLUT_Xi_LIBRARY} - ${GLUT_cocoa_LIBRARY} - ) - SET( GLUT_FOUND "YES" ) - - #The following deprecated settings are for backwards compatibility with CMake1.4 - SET (GLUT_LIBRARY ${GLUT_LIBRARIES}) - SET (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR}) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLUT REQUIRED_VARS GLUT_glut_LIBRARY GLUT_INCLUDE_DIR) + +IF (GLUT_FOUND) + # Is -lXi and -lXmu required on all platforms that have it? + # If not, we need some way to figure out what platform we are on. + SET( GLUT_LIBRARIES + ${GLUT_glut_LIBRARY} + ${GLUT_Xmu_LIBRARY} + ${GLUT_Xi_LIBRARY} + ${GLUT_cocoa_LIBRARY} + ) - ENDIF(GLUT_glut_LIBRARY) -ENDIF(GLUT_INCLUDE_DIR) + #The following deprecated settings are for backwards compatibility with CMake1.4 + SET (GLUT_LIBRARY ${GLUT_LIBRARIES}) + SET (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR}) +ENDIF(GLUT_FOUND) MARK_AS_ADVANCED( GLUT_INCLUDE_DIR diff -Nru cmake-2.8.7/Modules/FindGettext.cmake cmake-2.8.9/Modules/FindGettext.cmake --- cmake-2.8.7/Modules/FindGettext.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindGettext.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -4,6 +4,7 @@ # GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool. # GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool. # GETTEXT_FOUND: True if gettext has been found. +# GETTEXT_VERSION_STRING: the version of gettext found (since CMake 2.8.8) # # Additionally it provides the following macros: # GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN ) @@ -42,11 +43,35 @@ FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt) +IF(GETTEXT_MSGMERGE_EXECUTABLE) + EXECUTE_PROCESS(COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --version + OUTPUT_VARIABLE gettext_version + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + IF (gettext_version MATCHES "^msgmerge \\(.*\\) [0-9]") + STRING(REGEX REPLACE "^msgmerge \\([^\\)]*\\) ([0-9\\.]+[^ \n]*).*" "\\1" GETTEXT_VERSION_STRING "${gettext_version}") + ENDIF() + UNSET(gettext_version) +ENDIF(GETTEXT_MSGMERGE_EXECUTABLE) + INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gettext REQUIRED_VARS GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gettext + REQUIRED_VARS GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE + VERSION_VAR GETTEXT_VERSION_STRING) INCLUDE(CMakeParseArguments) +FUNCTION(_GETTEXT_GET_UNIQUE_TARGET_NAME _name _unique_name) + SET(propertyName "_GETTEXT_UNIQUE_COUNTER_${_name}") + GET_PROPERTY(currentCounter GLOBAL PROPERTY "${propertyName}") + IF(NOT currentCounter) + SET(currentCounter 1) + ENDIF() + SET(${_unique_name} "${_name}_${currentCounter}" PARENT_SCOPE) + MATH(EXPR currentCounter "${currentCounter} + 1") + SET_PROPERTY(GLOBAL PROPERTY ${propertyName} ${currentCounter} ) +ENDFUNCTION() + MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg) # make it a real variable, so we can modify it here SET(_firstPoFile "${_firstPoFileArg}") @@ -80,7 +105,15 @@ ENDFOREACH (_currentPoFile ) - ADD_CUSTOM_TARGET(translations ${_addToAll} DEPENDS ${_gmoFiles}) + IF(NOT TARGET translations) + ADD_CUSTOM_TARGET(translations) + ENDIF() + + _GETTEXT_GET_UNIQUE_TARGET_NAME(translations uniqueTargetName) + + ADD_CUSTOM_TARGET(${uniqueTargetName} ${_addToAll} DEPENDS ${_gmoFiles}) + + ADD_DEPENDENCIES(translations ${uniqueTargetName}) ENDMACRO(GETTEXT_CREATE_TRANSLATIONS ) @@ -119,11 +152,20 @@ LIST(APPEND _gmoFiles ${_gmoFile}) ENDFOREACH (_lang ) + IF(NOT TARGET potfiles) + ADD_CUSTOM_TARGET(potfiles) + ENDIF() + + _GETTEXT_GET_UNIQUE_TARGET_NAME( potfiles uniqueTargetName) + IF(_parsedArguments_ALL) - ADD_CUSTOM_TARGET(potfiles ALL DEPENDS ${_gmoFiles}) + ADD_CUSTOM_TARGET(${uniqueTargetName} ALL DEPENDS ${_gmoFiles}) ELSE(_parsedArguments_ALL) - ADD_CUSTOM_TARGET(potfiles DEPENDS ${_gmoFiles}) + ADD_CUSTOM_TARGET(${uniqueTargetName} DEPENDS ${_gmoFiles}) ENDIF(_parsedArguments_ALL) + + ADD_DEPENDENCIES(potfiles ${uniqueTargetName}) + ENDFUNCTION(GETTEXT_PROCESS_POT_FILE) @@ -151,11 +193,21 @@ LIST(APPEND _gmoFiles ${_gmoFile}) ENDFOREACH(_current_PO_FILE) + + IF(NOT TARGET pofiles) + ADD_CUSTOM_TARGET(pofiles) + ENDIF() + + _GETTEXT_GET_UNIQUE_TARGET_NAME( pofiles uniqueTargetName) + IF(_parsedArguments_ALL) - ADD_CUSTOM_TARGET(pofiles ALL DEPENDS ${_gmoFiles}) + ADD_CUSTOM_TARGET(${uniqueTargetName} ALL DEPENDS ${_gmoFiles}) ELSE(_parsedArguments_ALL) - ADD_CUSTOM_TARGET(pofiles DEPENDS ${_gmoFiles}) + ADD_CUSTOM_TARGET(${uniqueTargetName} DEPENDS ${_gmoFiles}) ENDIF(_parsedArguments_ALL) + + ADD_DEPENDENCIES(pofiles ${uniqueTargetName}) + ENDFUNCTION(GETTEXT_PROCESS_PO_FILES) IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) diff -Nru cmake-2.8.7/Modules/FindGit.cmake cmake-2.8.9/Modules/FindGit.cmake --- cmake-2.8.7/Modules/FindGit.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindGit.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,6 +1,7 @@ # The module defines the following variables: # GIT_EXECUTABLE - path to git command line client # GIT_FOUND - true if the command line client was found +# GIT_VERSION_STRING - the version of git found (since CMake 2.8.8) # Example usage: # find_package(Git) # if(GIT_FOUND) @@ -9,6 +10,7 @@ #============================================================================= # Copyright 2010 Kitware, Inc. +# Copyright 2012 Rolf Eike Beer # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -40,8 +42,21 @@ ) mark_as_advanced(GIT_EXECUTABLE) +if(GIT_EXECUTABLE) + execute_process(COMMAND ${GIT_EXECUTABLE} --version + OUTPUT_VARIABLE git_version + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if (git_version MATCHES "^git version [0-9]") + string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}") + endif() + unset(git_version) +endif(GIT_EXECUTABLE) + # Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if # all listed variables are TRUE include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE) +find_package_handle_standard_args(Git + REQUIRED_VARS GIT_EXECUTABLE + VERSION_VAR GIT_VERSION_STRING) diff -Nru cmake-2.8.7/Modules/FindGnuTLS.cmake cmake-2.8.9/Modules/FindGnuTLS.cmake --- cmake-2.8.7/Modules/FindGnuTLS.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindGnuTLS.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -35,9 +35,10 @@ # try using pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls # also fills in GNUTLS_DEFINITIONS, although that isn't normally useful - FIND_PACKAGE(PkgConfig) - PKG_CHECK_MODULES(PC_GNUTLS gnutls) + FIND_PACKAGE(PkgConfig QUIET) + PKG_CHECK_MODULES(PC_GNUTLS QUIET gnutls) SET(GNUTLS_DEFINITIONS ${PC_GNUTLS_CFLAGS_OTHER}) + SET(GNUTLS_VERSION_STRING ${PC_GNUTLS_VERSION}) ENDIF (NOT WIN32) FIND_PATH(GNUTLS_INCLUDE_DIR gnutls/gnutls.h @@ -57,7 +58,9 @@ # handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if # all listed variables are TRUE INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuTLS DEFAULT_MSG GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuTLS + REQUIRED_VARS GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR + VERSION_VAR GNUTLS_VERSION_STRING) IF(GNUTLS_FOUND) SET(GNUTLS_LIBRARIES ${GNUTLS_LIBRARY}) diff -Nru cmake-2.8.7/Modules/FindGnuplot.cmake cmake-2.8.9/Modules/FindGnuplot.cmake --- cmake-2.8.7/Modules/FindGnuplot.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindGnuplot.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -4,6 +4,9 @@ # # GNUPLOT_FOUND - system has Gnuplot # GNUPLOT_EXECUTABLE - the Gnuplot executable +# GNUPLOT_VERSION_STRING - the version of Gnuplot found (since CMake 2.8.8) +# +# GNUPLOT_VERSION_STRING will not work for old versions like 3.7.1. #============================================================================= # Copyright 2002-2009 Kitware, Inc. @@ -29,13 +32,26 @@ ${CYGWIN_INSTALL_PATH}/bin ) +IF (GNUPLOT_EXECUTABLE) + EXECUTE_PROCESS(COMMAND "${GNUPLOT_EXECUTABLE}" --version + OUTPUT_VARIABLE GNUPLOT_OUTPUT_VARIABLE + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + STRING(REGEX REPLACE "^gnuplot ([0-9\\.]+)( patchlevel )?" "\\1." GNUPLOT_VERSION_STRING "${GNUPLOT_OUTPUT_VARIABLE}") + STRING(REGEX REPLACE "\\.$" "" GNUPLOT_VERSION_STRING "${GNUPLOT_VERSION_STRING}") + UNSET(GNUPLOT_OUTPUT_VARIABLE) +ENDIF() + # for compatibility SET(GNUPLOT ${GNUPLOT_EXECUTABLE}) # handle the QUIETLY and REQUIRED arguments and set GNUPLOT_FOUND to TRUE if # all listed variables are TRUE INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gnuplot DEFAULT_MSG GNUPLOT_EXECUTABLE) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gnuplot + REQUIRED_VARS GNUPLOT_EXECUTABLE + VERSION_VAR GNUPLOT_VERSION_STRING) MARK_AS_ADVANCED( GNUPLOT_EXECUTABLE ) diff -Nru cmake-2.8.7/Modules/FindHSPELL.cmake cmake-2.8.9/Modules/FindHSPELL.cmake --- cmake-2.8.7/Modules/FindHSPELL.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindHSPELL.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -32,12 +32,15 @@ FILE(READ "${HSPELL_INCLUDE_DIR}/hspell.h" HSPELL_H) STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MAJOR ([0-9]+).*" "\\1" HSPELL_VERSION_MAJOR "${HSPELL_H}") STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MINOR ([0-9]+).*" "\\1" HSPELL_VERSION_MINOR "${HSPELL_H}") + SET(HSPELL_VERSION_STRING "${HSPELL_VERSION_MAJOR}.${HSPELL_VERSION_MINOR}") ENDIF() # handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if # all listed variables are TRUE INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(HSPELL DEFAULT_MSG HSPELL_LIBRARIES HSPELL_INCLUDE_DIR) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(HSPELL + REQUIRED_VARS HSPELL_LIBRARIES HSPELL_INCLUDE_DIR + VERSION_VAR HSPELL_VERSION_STRING) MARK_AS_ADVANCED(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES) diff -Nru cmake-2.8.7/Modules/FindImageMagick.cmake cmake-2.8.9/Modules/FindImageMagick.cmake --- cmake-2.8.7/Modules/FindImageMagick.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindImageMagick.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -24,6 +24,10 @@ # ImageMagick_EXECUTABLE_DIR - Full path to executables directory. # ImageMagick__FOUND - TRUE if is found. # ImageMagick__EXECUTABLE - Full path to executable. +# ImageMagick_VERSION_STRING - the version of ImageMagick found +# (since CMake 2.8.8) +# +# ImageMagick_VERSION_STRING will not work for old versions like 5.2.3. # # There are also components for the following ImageMagick APIs: # @@ -53,6 +57,7 @@ #============================================================================= # Copyright 2007-2009 Kitware, Inc. # Copyright 2007-2008 Miguel A. Figueroa-Villanueva +# Copyright 2012 Rolf Eike Beer # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -134,7 +139,8 @@ # Find each component. Search for all tools in same dir # ; otherwise they should be found # independently and not in a cohesive module such as this one. -SET(ImageMagick_FOUND TRUE) +UNSET(ImageMagick_REQUIRED_VARS) +UNSET(ImageMagick_DEFAULT_EXECUTABLES) FOREACH(component ${ImageMagick_FIND_COMPONENTS} # DEPRECATED: forced components for backward compatibility convert mogrify import montage composite @@ -143,37 +149,65 @@ FIND_IMAGEMAGICK_API(Magick++ Magick++.h Magick++ CORE_RL_Magick++_ ) + LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_Magick++_LIBRARY) ELSEIF(component STREQUAL "MagickWand") FIND_IMAGEMAGICK_API(MagickWand wand/MagickWand.h Wand MagickWand CORE_RL_wand_ ) + LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickWand_LIBRARY) ELSEIF(component STREQUAL "MagickCore") FIND_IMAGEMAGICK_API(MagickCore magick/MagickCore.h Magick MagickCore CORE_RL_magick_ ) + LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickCore_LIBRARY) ELSE(component STREQUAL "Magick++") IF(ImageMagick_EXECUTABLE_DIR) FIND_IMAGEMAGICK_EXE(${component}) ENDIF(ImageMagick_EXECUTABLE_DIR) + + IF(ImageMagick_FIND_COMPONENTS) + LIST(FIND ImageMagick_FIND_COMPONENTS ${component} is_requested) + IF(is_requested GREATER -1) + LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_${component}_EXECUTABLE) + ENDIF(is_requested GREATER -1) + ELSEIF(ImageMagick_${component}_EXECUTABLE) + # if no components were requested explicitly put all (default) executables + # in the list + LIST(APPEND ImageMagick_DEFAULT_EXECUTABLES ImageMagick_${component}_EXECUTABLE) + ENDIF(ImageMagick_FIND_COMPONENTS) ENDIF(component STREQUAL "Magick++") - - IF(NOT ImageMagick_${component}_FOUND) - LIST(FIND ImageMagick_FIND_COMPONENTS ${component} is_requested) - IF(is_requested GREATER -1) - SET(ImageMagick_FOUND FALSE) - ENDIF(is_requested GREATER -1) - ENDIF(NOT ImageMagick_${component}_FOUND) ENDFOREACH(component) +IF(NOT ImageMagick_FIND_COMPONENTS AND NOT ImageMagick_DEFAULT_EXECUTABLES) + # No components were requested, and none of the default components were + # found. Just insert mogrify into the list of the default components to + # find so FPHSA below has something to check + LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_mogrify_EXECUTABLE) +ELSEIF(ImageMagick_DEFAULT_EXECUTABLES) + LIST(APPEND ImageMagick_REQUIRED_VARS ${ImageMagick_DEFAULT_EXECUTABLES}) +ENDIF() + SET(ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS}) SET(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES}) +IF(ImageMagick_mogrify_EXECUTABLE) + EXECUTE_PROCESS(COMMAND ${ImageMagick_mogrify_EXECUTABLE} -version + OUTPUT_VARIABLE imagemagick_version + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + IF(imagemagick_version MATCHES "^Version: ImageMagick [0-9]") + STRING(REGEX REPLACE "^Version: ImageMagick ([-0-9\\.]+).*" "\\1" ImageMagick_VERSION_STRING "${imagemagick_version}") + ENDIF() + UNSET(imagemagick_version) +ENDIF(ImageMagick_mogrify_EXECUTABLE) + #--------------------------------------------------------------------- # Standard Package Output #--------------------------------------------------------------------- INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS( - ImageMagick DEFAULT_MSG ImageMagick_FOUND +FIND_PACKAGE_HANDLE_STANDARD_ARGS(ImageMagick + REQUIRED_VARS ${ImageMagick_REQUIRED_VARS} + VERSION_VAR ImageMagick_VERSION_STRING ) # Maintain consistency with all other variables. SET(ImageMagick_FOUND ${IMAGEMAGICK_FOUND}) diff -Nru cmake-2.8.7/Modules/FindJasper.cmake cmake-2.8.9/Modules/FindJasper.cmake --- cmake-2.8.7/Modules/FindJasper.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindJasper.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -3,11 +3,13 @@ # # JASPER_FOUND - system has Jasper # JASPER_INCLUDE_DIR - the Jasper include directory -# JASPER_LIBRARIES - The libraries needed to use Jasper +# JASPER_LIBRARIES - the libraries needed to use Jasper +# JASPER_VERSION_STRING - the version of Jasper found (since CMake 2.8.8) #============================================================================= # Copyright 2006-2009 Kitware, Inc. # Copyright 2006 Alexander Neundorf +# Copyright 2012 Rolf Eike Beer # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -19,19 +21,33 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -FIND_PACKAGE(JPEG) - FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h) -FIND_LIBRARY(JASPER_LIBRARY NAMES jasper libjasper) +IF (NOT JASPER_LIBRARIES) + FIND_PACKAGE(JPEG) + + FIND_LIBRARY(JASPER_LIBRARY_RELEASE NAMES jasper libjasper) + FIND_LIBRARY(JASPER_LIBRARY_DEBUG NAMES jasperd) + + INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) + SELECT_LIBRARY_CONFIGURATIONS(JASPER) +ENDIF (NOT JASPER_LIBRARIES) + +IF (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h") + FILE(STRINGS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h" jasper_version_str REGEX "^#define[\t ]+JAS_VERSION[\t ]+\".*\".*") + + STRING(REGEX REPLACE "^#define[\t ]+JAS_VERSION[\t ]+\"([^\"]+)\".*" "\\1" JASPER_VERSION_STRING "${jasper_version_str}") +ENDIF (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h") # handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if # all listed variables are TRUE INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jasper DEFAULT_MSG JASPER_LIBRARY JASPER_INCLUDE_DIR JPEG_LIBRARIES) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jasper + REQUIRED_VARS JASPER_LIBRARIES JASPER_INCLUDE_DIR JPEG_LIBRARIES + VERSION_VAR JASPER_VERSION_STRING) IF (JASPER_FOUND) - SET(JASPER_LIBRARIES ${JASPER_LIBRARY} ${JPEG_LIBRARIES} ) + SET(JASPER_LIBRARIES ${JASPER_LIBRARIES} ${JPEG_LIBRARIES} ) ENDIF (JASPER_FOUND) -MARK_AS_ADVANCED(JASPER_INCLUDE_DIR JASPER_LIBRARY) +MARK_AS_ADVANCED(JASPER_INCLUDE_DIR) diff -Nru cmake-2.8.7/Modules/FindJava.cmake cmake-2.8.9/Modules/FindJava.cmake --- cmake-2.8.7/Modules/FindJava.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindJava.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -107,9 +107,9 @@ # 2. OpenJDK 1.6 # 3. GCJ 1.5 # 4. Kaffe 1.4.2 - IF(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+[oem-]*\".*") + IF(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+.*\".*") # This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer - STRING( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+)[oem-]*\".*" + STRING( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\".*" "\\1" Java_VERSION_STRING "${var}" ) ELSEIF(var MATCHES "java full version \"kaffe-[0-9]+\\.[0-9]+\\.[0-9_]+\".*") # Kaffe style @@ -124,7 +124,7 @@ STRING( REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_MINOR "${Java_VERSION_STRING}" ) STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_PATCH "${Java_VERSION_STRING}" ) # warning tweak version can be empty: - STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+\\_?\\.?([0-9]*)$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" ) + STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+[_\\.]?([0-9]*).*$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" ) if( Java_VERSION_TWEAK STREQUAL "" ) # check case where tweak is not defined set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH}) else( ) diff -Nru cmake-2.8.7/Modules/FindLAPACK.cmake cmake-2.8.9/Modules/FindLAPACK.cmake --- cmake-2.8.7/Modules/FindLAPACK.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindLAPACK.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -219,40 +219,69 @@ endif ( NOT LAPACK_LIBRARIES ) endif () #intel lapack - if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") +if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") + if (NOT WIN32) + set(LM "-lm") + endif () if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) - if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) + if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) find_PACKAGE(Threads) - else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - find_package(Threads REQUIRED) - endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - if (BLA_F95) - if(NOT LAPACK95_LIBRARIES) - check_lapack_libraries( - LAPACK95_LIBRARIES - LAPACK - cheev - "" - "mkl_lapack95" - "${BLAS95_LIBRARIES}" - "${CMAKE_THREAD_LIBS_INIT}" - ) - endif(NOT LAPACK95_LIBRARIES) - else(BLA_F95) - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "mkl_lapack" - "${BLAS_LIBRARIES}" - "${CMAKE_THREAD_LIBS_INIT}" - ) - endif(NOT LAPACK_LIBRARIES) - endif(BLA_F95) + else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) + find_package(Threads REQUIRED) + endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) + if (BLA_F95) + if(NOT LAPACK95_LIBRARIES) + # old + check_lapack_libraries( + LAPACK95_LIBRARIES + LAPACK + cheev + "" + "mkl_lapack95" + "${BLAS95_LIBRARIES}" + "${CMAKE_THREAD_LIBS_INIT};${LM}" + ) + endif(NOT LAPACK95_LIBRARIES) + if(NOT LAPACK95_LIBRARIES) + # new >= 10.3 + check_lapack_libraries( + LAPACK95_LIBRARIES + LAPACK + CHEEV + "" + "mkl_intel_lp64" + "${BLAS95_LIBRARIES}" + "${CMAKE_THREAD_LIBS_INIT};${LM}" + ) + endif(NOT LAPACK95_LIBRARIES) + else(BLA_F95) + if(NOT LAPACK_LIBRARIES) + # old + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "mkl_lapack" + "${BLAS_LIBRARIES}" + "${CMAKE_THREAD_LIBS_INIT};${LM}" + ) + endif(NOT LAPACK_LIBRARIES) + if(NOT LAPACK_LIBRARIES) + # new >= 10.3 + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "mkl_gf_lp64" + "${BLAS_LIBRARIES}" + "${CMAKE_THREAD_LIBS_INIT};${LM}" + ) + endif(NOT LAPACK_LIBRARIES) + endif(BLA_F95) endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) - endif(BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") +endif(BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") else(BLAS_FOUND) message(STATUS "LAPACK requires BLAS") endif(BLAS_FOUND) diff -Nru cmake-2.8.7/Modules/FindLibArchive.cmake cmake-2.8.9/Modules/FindLibArchive.cmake --- cmake-2.8.7/Modules/FindLibArchive.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindLibArchive.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -54,8 +54,9 @@ # itself includes this FindLibArchive when built with an older CMake that does # not provide it. The older CMake also does not have CMAKE_CURRENT_LIST_DIR.) include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) -find_package_handle_standard_args(LibArchive DEFAULT_MSG - LibArchive_LIBRARY LibArchive_INCLUDE_DIR +find_package_handle_standard_args(LibArchive + REQUIRED_VARS LibArchive_LIBRARY LibArchive_INCLUDE_DIR + VERSION_VAR LibArchive_VERSION ) set(LibArchive_FOUND ${LIBARCHIVE_FOUND}) unset(LIBARCHIVE_FOUND) diff -Nru cmake-2.8.7/Modules/FindLibLZMA.cmake cmake-2.8.9/Modules/FindLibLZMA.cmake --- cmake-2.8.7/Modules/FindLibLZMA.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/FindLibLZMA.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/FindLibXml2.cmake cmake-2.8.9/Modules/FindLibXml2.cmake --- cmake-2.8.7/Modules/FindLibXml2.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindLibXml2.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -6,6 +6,7 @@ # LIBXML2_LIBRARIES - The libraries needed to use LibXml2 # LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2 # LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2 +# LIBXML2_VERSION_STRING - the version of LibXml2 found (since CMake 2.8.8) #============================================================================= # Copyright 2006-2009 Kitware, Inc. @@ -23,8 +24,8 @@ # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls -FIND_PACKAGE(PkgConfig) -PKG_CHECK_MODULES(PC_LIBXML libxml-2.0 QUIET) +FIND_PACKAGE(PkgConfig QUIET) +PKG_CHECK_MODULES(PC_LIBXML QUIET libxml-2.0) SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER}) FIND_PATH(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h @@ -44,10 +45,22 @@ # for backwards compat. with KDE 4.0.x: SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}") +IF(PC_LIBXML_VERSION) + SET(LIBXML2_VERSION_STRING ${PC_LIBXML_VERSION}) +ELSEIF(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h") + FILE(STRINGS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h" libxml2_version_str + REGEX "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\".*\"") + + STRING(REGEX REPLACE "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1" + LIBXML2_VERSION_STRING "${libxml2_version_str}") + UNSET(libxml2_version_str) +ENDIF() + # handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if # all listed variables are TRUE INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 + REQUIRED_VARS LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR + VERSION_VAR LIBXML2_VERSION_STRING) MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE) - diff -Nru cmake-2.8.7/Modules/FindLibXslt.cmake cmake-2.8.9/Modules/FindLibXslt.cmake --- cmake-2.8.7/Modules/FindLibXslt.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindLibXslt.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -5,6 +5,7 @@ # LIBXSLT_INCLUDE_DIR - the LibXslt include directory # LIBXSLT_LIBRARIES - Link these to LibXslt # LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt +# LIBXSLT_VERSION_STRING - version of LibXslt found (since CMake 2.8.8) # Additionally, the following two variables are set (but not required for using xslt): # LIBXSLT_EXSLT_LIBRARIES - Link to these if you need to link against the exslt library # LIBXSLT_XSLTPROC_EXECUTABLE - Contains the full path to the xsltproc executable if found @@ -25,7 +26,7 @@ # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls -FIND_PACKAGE(PkgConfig) +FIND_PACKAGE(PkgConfig QUIET) PKG_CHECK_MODULES(PC_LIBXSLT QUIET libxslt) SET(LIBXSLT_DEFINITIONS ${PC_LIBXSLT_CFLAGS_OTHER}) @@ -51,10 +52,21 @@ FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc) -# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if -# all listed variables are TRUE +IF(PC_LIBXSLT_VERSION) + SET(LIBXSLT_VERSION_STRING ${PC_LIBXSLT_VERSION}) +ELSEIF(LIBXSLT_INCLUDE_DIR AND EXISTS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h") + FILE(STRINGS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h" libxslt_version_str + REGEX "^#define[\t ]+LIBXSLT_DOTTED_VERSION[\t ]+\".*\"") + + STRING(REGEX REPLACE "^#define[\t ]+LIBXSLT_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1" + LIBXSLT_VERSION_STRING "${libxslt_version_str}") + UNSET(libxslt_version_str) +ENDIF() + INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt DEFAULT_MSG LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt + REQUIRED_VARS LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR + VERSION_VAR LIBXSLT_VERSION_STRING) MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR LIBXSLT_LIBRARIES diff -Nru cmake-2.8.7/Modules/FindLua50.cmake cmake-2.8.9/Modules/FindLua50.cmake --- cmake-2.8.7/Modules/FindLua50.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindLua50.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -31,8 +31,6 @@ PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave @@ -47,8 +45,6 @@ PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw @@ -67,8 +63,6 @@ $ENV{LUA_DIR} PATH_SUFFIXES lib64 lib PATHS - /usr/local - /usr /sw /opt/local /opt/csw diff -Nru cmake-2.8.7/Modules/FindLua51.cmake cmake-2.8.9/Modules/FindLua51.cmake --- cmake-2.8.7/Modules/FindLua51.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindLua51.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -2,7 +2,8 @@ # This module defines # LUA51_FOUND, if false, do not try to link to Lua # LUA_LIBRARIES -# LUA_INCLUDE_DIR, where to find lua.h +# LUA_INCLUDE_DIR, where to find lua.h +# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8) # # Note that the expected include convention is # #include "lua.h" @@ -31,8 +32,6 @@ PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave @@ -47,8 +46,6 @@ PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw @@ -66,10 +63,19 @@ ENDIF(UNIX AND NOT APPLE) ENDIF(LUA_LIBRARY) +IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h") + FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"") + + STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}") + UNSET(lua_version_str) +ENDIF() + INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) # handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if # all listed variables are TRUE -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51 DEFAULT_MSG LUA_LIBRARIES LUA_INCLUDE_DIR) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51 + REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR + VERSION_VAR LUA_VERSION_STRING) MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY) diff -Nru cmake-2.8.7/Modules/FindMPI.cmake cmake-2.8.9/Modules/FindMPI.cmake --- cmake-2.8.7/Modules/FindMPI.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindMPI.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -354,6 +354,20 @@ # Extract the set of libraries to link against from the link command # line string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") + # add the compiler implicit directories because some compilers + # such as the intel compiler have libraries that show up + # in the showme list that can only be found in the implicit + # link directories of the compiler. Do this for C++ and C + # compilers if the implicit link directories are defined. + if (DEFINED CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES) + set(MPI_LINK_PATH + "${MPI_LINK_PATH};${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}") + endif () + + if (DEFINED CMAKE_C_IMPLICIT_LINK_DIRECTORIES) + set(MPI_LINK_PATH + "${MPI_LINK_PATH};${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") + endif () # Determine full path names for all of the libraries that one needs # to link against in an MPI program @@ -413,7 +427,7 @@ HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} PATH_SUFFIXES lib) if (MPI_LIBRARIES_WORK AND MPI_LIB) - set(MPI_LIBRARIES_WORK "${MPI_LIBRARIES_WORK} ${MPI_LIB}") + list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) endif() endif() diff -Nru cmake-2.8.7/Modules/FindOpenAL.cmake cmake-2.8.9/Modules/FindOpenAL.cmake --- cmake-2.8.7/Modules/FindOpenAL.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindOpenAL.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -68,8 +68,6 @@ PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave @@ -85,8 +83,6 @@ PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff -Nru cmake-2.8.7/Modules/FindOpenMP.cmake cmake-2.8.9/Modules/FindOpenMP.cmake --- cmake-2.8.7/Modules/FindOpenMP.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindOpenMP.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,7 +1,7 @@ # - Finds OpenMP support # This module can be used to detect OpenMP support in a compiler. # If the compiler supports OpenMP, the flags required to compile with -# openmp support are set. +# openmp support are set. # # The following variables are set: # OpenMP_C_FLAGS - flags to add to the C compiler for OpenMP support @@ -13,6 +13,7 @@ #============================================================================= # Copyright 2009 Kitware, Inc. # Copyright 2008-2009 André Rigland Brodtkorb +# Copyright 2012 Rolf Eike Beer # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -24,31 +25,54 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -include(CheckCSourceCompiles) -include(CheckCXXSourceCompiles) -include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) - -set(OpenMP_C_FLAG_CANDIDATES - #Gnu - "-fopenmp" - #Microsoft Visual Studio - "/openmp" - #Intel windows - "-Qopenmp" - #Intel - "-openmp" - #Empty, if compiler automatically accepts openmp - " " - #Sun - "-xopenmp" - #HP - "+Oopenmp" - #IBM XL C/c++ - "-qsmp" - #Portland Group - "-mp" -) -set(OpenMP_CXX_FLAG_CANDIDATES ${OpenMP_C_FLAG_CANDIDATES}) +set(_OPENMP_REQUIRED_VARS) + +function(_OPENMP_FLAG_CANDIDATES LANG) + set(OpenMP_FLAG_CANDIDATES + #GNU + "-fopenmp" + #Microsoft Visual Studio + "/openmp" + #Intel windows + "-Qopenmp" + #PathScale, Intel + "-openmp" + #Empty, if compiler automatically accepts openmp + " " + #Sun + "-xopenmp" + #HP + "+Oopenmp" + #IBM XL C/c++ + "-qsmp" + #Portland Group, MIPSpro + "-mp" + ) + + set(OMP_FLAG_GNU "-fopenmp") + set(OMP_FLAG_HP "+Oopenmp") + if(WIN32) + set(OMP_FLAG_Intel "-Qopenmp") + else() + set(OMP_FLAG_Intel "-openmp") + endif() + set(OMP_FLAG_MIPSpro "-mp") + set(OMP_FLAG_MSVC "/openmp") + set(OMP_FLAG_PathScale "-openmp") + set(OMP_FLAG_PGI "-mp") + set(OMP_FLAG_SunPro "-xopenmp") + set(OMP_FLAG_XL "-qsmp") + + # Move the flag that matches the compiler to the head of the list, + # this is faster and doesn't clutter the output that much. If that + # flag doesn't work we will still try all. + if(OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID}) + list(REMOVE_ITEM OpenMP_FLAG_CANDIDATES "${OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID}}") + list(INSERT OpenMP_FLAG_CANDIDATES 0 "${OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID}}") + endif() + + set(OpenMP_${LANG}_FLAG_CANDIDATES "${OpenMP_FLAG_CANDIDATES}" PARENT_SCOPE) +endfunction(_OPENMP_FLAG_CANDIDATES) # sample openmp source code to test set(OpenMP_C_TEST_SOURCE @@ -62,53 +86,82 @@ #endif } ") -# use the same source for CXX as C for now -set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE}) -# if these are set then do not try to find them again, -# by avoiding any try_compiles for the flags -if(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS) - set(OpenMP_C_FLAG_CANDIDATES) - set(OpenMP_CXX_FLAG_CANDIDATES) -endif(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS) # check c compiler -foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) - set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") - set(CMAKE_REQUIRED_FLAGS "${FLAG}") - unset(OpenMP_FLAG_DETECTED CACHE) - message(STATUS "Try OpenMP C flag = [${FLAG}]") - check_c_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED) - set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") - if(OpenMP_FLAG_DETECTED) - set(OpenMP_C_FLAGS_INTERNAL "${FLAG}") - break() - endif(OpenMP_FLAG_DETECTED) -endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) +if(CMAKE_C_COMPILER_LOADED) + # if these are set then do not try to find them again, + # by avoiding any try_compiles for the flags + if(OpenMP_C_FLAGS) + unset(OpenMP_C_FLAG_CANDIDATES) + else() + _OPENMP_FLAG_CANDIDATES("C") + include(CheckCSourceCompiles) + endif() + + foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) + set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") + set(CMAKE_REQUIRED_FLAGS "${FLAG}") + unset(OpenMP_FLAG_DETECTED CACHE) + message(STATUS "Try OpenMP C flag = [${FLAG}]") + check_c_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED) + set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") + if(OpenMP_FLAG_DETECTED) + set(OpenMP_C_FLAGS_INTERNAL "${FLAG}") + break() + endif(OpenMP_FLAG_DETECTED) + endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) + + set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}" + CACHE STRING "C compiler flags for OpenMP parallization") + + list(APPEND _OPENMP_REQUIRED_VARS OpenMP_C_FLAGS) + unset(OpenMP_C_FLAG_CANDIDATES) +endif() # check cxx compiler -foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) - set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") - set(CMAKE_REQUIRED_FLAGS "${FLAG}") - unset(OpenMP_FLAG_DETECTED CACHE) - message(STATUS "Try OpenMP CXX flag = [${FLAG}]") - check_cxx_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED) - set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") - if(OpenMP_FLAG_DETECTED) - set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}") - break() - endif(OpenMP_FLAG_DETECTED) -endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) - -set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}" - CACHE STRING "C compiler flags for OpenMP parallization") - -set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}" - CACHE STRING "C++ compiler flags for OpenMP parallization") -# handle the standard arguments for find_package -find_package_handle_standard_args(OpenMP DEFAULT_MSG - OpenMP_C_FLAGS OpenMP_CXX_FLAGS ) - -mark_as_advanced( - OpenMP_C_FLAGS - OpenMP_CXX_FLAGS -) +if(CMAKE_CXX_COMPILER_LOADED) + # if these are set then do not try to find them again, + # by avoiding any try_compiles for the flags + if(OpenMP_CXX_FLAGS) + unset(OpenMP_CXX_FLAG_CANDIDATES) + else() + _OPENMP_FLAG_CANDIDATES("CXX") + include(CheckCXXSourceCompiles) + + # use the same source for CXX as C for now + set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE}) + endif() + + foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) + set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") + set(CMAKE_REQUIRED_FLAGS "${FLAG}") + unset(OpenMP_FLAG_DETECTED CACHE) + message(STATUS "Try OpenMP CXX flag = [${FLAG}]") + check_cxx_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED) + set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") + if(OpenMP_FLAG_DETECTED) + set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}") + break() + endif(OpenMP_FLAG_DETECTED) + endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) + + set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}" + CACHE STRING "C++ compiler flags for OpenMP parallization") + + list(APPEND _OPENMP_REQUIRED_VARS OpenMP_CXX_FLAGS) + unset(OpenMP_CXX_FLAG_CANDIDATES) + unset(OpenMP_CXX_TEST_SOURCE) +endif() + +if(_OPENMP_REQUIRED_VARS) + include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) + + find_package_handle_standard_args(OpenMP + REQUIRED_VARS ${_OPENMP_REQUIRED_VARS}) + + mark_as_advanced(${_OPENMP_REQUIRED_VARS}) + + unset(_OPENMP_REQUIRED_VARS) +else() + message(SEND_ERROR "FindOpenMP requires C or CXX language to be enabled") +endif() diff -Nru cmake-2.8.7/Modules/FindOpenSSL.cmake cmake-2.8.9/Modules/FindOpenSSL.cmake --- cmake-2.8.7/Modules/FindOpenSSL.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindOpenSSL.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -7,7 +7,7 @@ # OPENSSL_FOUND - system has the OpenSSL library # OPENSSL_INCLUDE_DIR - the OpenSSL include directory # OPENSSL_LIBRARIES - The libraries needed to use OpenSSL -# OPENSSL_VERSION - This is set to $major.$minor.$revision (eg. 0.9.8) +# OPENSSL_VERSION - This is set to $major.$minor.$revision$path (eg. 0.9.8s) #============================================================================= # Copyright 2006-2009 Kitware, Inc. @@ -25,10 +25,8 @@ # License text for the above reference.) if (UNIX) - find_package(PkgConfig) - if (PKG_CONFIG_FOUND) - pkg_check_modules(_OPENSSL openssl) - endif (PKG_CONFIG_FOUND) + find_package(PkgConfig QUIET) + pkg_check_modules(_OPENSSL QUIET openssl) endif (UNIX) # http://www.slproweb.com/products/Win32OpenSSL.html @@ -215,17 +213,73 @@ ENDIF(WIN32 AND NOT CYGWIN) -if (OPENSSL_INCLUDE_DIR) - file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9][0-9][0-9][0-9].*") +function(from_hex HEX DEC) + string(TOUPPER "${HEX}" HEX) + set(_res 0) + string(LENGTH "${HEX}" _strlen) + + while (_strlen GREATER 0) + math(EXPR _res "${_res} * 16") + string(SUBSTRING "${HEX}" 0 1 NIBBLE) + string(SUBSTRING "${HEX}" 1 -1 HEX) + if (NIBBLE STREQUAL "A") + math(EXPR _res "${_res} + 10") + elseif (NIBBLE STREQUAL "B") + math(EXPR _res "${_res} + 11") + elseif (NIBBLE STREQUAL "C") + math(EXPR _res "${_res} + 12") + elseif (NIBBLE STREQUAL "D") + math(EXPR _res "${_res} + 13") + elseif (NIBBLE STREQUAL "E") + math(EXPR _res "${_res} + 14") + elseif (NIBBLE STREQUAL "F") + math(EXPR _res "${_res} + 15") + else() + math(EXPR _res "${_res} + ${NIBBLE}") + endif() - string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1" OPENSSL_VERSION_MAJOR "${openssl_version_str}") - string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9]([0-9][0-9]).*$" "\\1" OPENSSL_VERSION_MINOR "${openssl_version_str}") - string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9]([0-9][0-9]).*$" "\\1" OPENSSL_VERSION_PATCH "${openssl_version_str}") + string(LENGTH "${HEX}" _strlen) + endwhile() - string(REGEX REPLACE "^0" "" OPENSSL_VERSION_MINOR "${OPENSSL_VERSION_MINOR}") - string(REGEX REPLACE "^0" "" OPENSSL_VERSION_PATCH "${OPENSSL_VERSION_PATCH}") + set(${DEC} ${_res} PARENT_SCOPE) +endfunction(from_hex) + +if (OPENSSL_INCLUDE_DIR) + if (_OPENSSL_VERSION) + set(OPENSSL_VERSION "${_OPENSSL_VERSION}") + elseif(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") + file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str + REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") + + # The version number is encoded as 0xMNNFFPPS: major minor fix patch status + # The status gives if this is a developer or prerelease and is ignored here. + # Major, minor, and fix directly translate into the version numbers shown in + # the string. The patch field translates to the single character suffix that + # indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so + # on. + + string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$" + "\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}") + list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR) + list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR) + from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR) + list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX) + from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX) + list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH) + + if (NOT OPENSSL_VERSION_PATCH STREQUAL "00") + from_hex("${OPENSSL_VERSION_PATCH}" _tmp) + # 96 is the ASCII code of 'a' minus 1 + math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96") + unset(_tmp) + # Once anyone knows how OpenSSL would call the patch versions beyond 'z' + # this should be updated to handle that, too. This has not happened yet + # so it is simply ignored here for now. + string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING) + endif (NOT OPENSSL_VERSION_PATCH STREQUAL "00") - set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_PATCH}") + set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}") + endif (_OPENSSL_VERSION) endif (OPENSSL_INCLUDE_DIR) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) diff -Nru cmake-2.8.7/Modules/FindOpenSceneGraph.cmake cmake-2.8.9/Modules/FindOpenSceneGraph.cmake --- cmake-2.8.7/Modules/FindOpenSceneGraph.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindOpenSceneGraph.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -78,7 +78,7 @@ list(REMOVE_DUPLICATES _osg_modules_to_process) if(OpenSceneGraph_DEBUG) - message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " + message(STATUS "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " "Components = ${_osg_modules_to_process}") endif() @@ -93,7 +93,7 @@ # Try to ascertain the version... if(OSG_INCLUDE_DIR) if(OpenSceneGraph_DEBUG) - message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " + message(STATUS "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " "Detected OSG_INCLUDE_DIR = ${OSG_INCLUDE_DIR}") endif() @@ -127,14 +127,14 @@ string(REGEX REPLACE ".*#define OPENSCENEGRAPH_PATCH_VERSION[ \t]+([0-9]+).*" "\\1" _osg_VERSION_PATCH ${_osg_Version_contents}) else() - message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " + message(WARNING "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " "Failed to parse version number, please report this as a bug") endif() set(OPENSCENEGRAPH_VERSION "${_osg_VERSION_MAJOR}.${_osg_VERSION_MINOR}.${_osg_VERSION_PATCH}" CACHE INTERNAL "The version of OSG which was detected") if(OpenSceneGraph_DEBUG) - message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " + message(STATUS "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " "Detected version ${OPENSCENEGRAPH_VERSION}") endif() endif() @@ -165,7 +165,7 @@ # foreach(_osg_module ${_osg_modules_to_process}) if(OpenSceneGraph_DEBUG) - message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " + message(STATUS "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " "Calling find_package(${_osg_module} ${_osg_required} ${_osg_quiet})") endif() find_package(${_osg_module} ${_osg_quiet}) diff -Nru cmake-2.8.7/Modules/FindPNG.cmake cmake-2.8.9/Modules/FindPNG.cmake --- cmake-2.8.7/Modules/FindPNG.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindPNG.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -7,6 +7,7 @@ # PNG_LIBRARIES, the libraries to link against to use PNG. # PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files. # PNG_FOUND, If false, do not try to use PNG. +# PNG_VERSION_STRING - the version of the PNG library found (since CMake 2.8.8) # Also defined, but not for general use are # PNG_LIBRARY, where to find the PNG library. # For backward compatiblity the variable PNG_INCLUDE_DIR is also set. It has the same value as PNG_INCLUDE_DIRS. @@ -56,11 +57,19 @@ endif (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR) + if (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h") + file(STRINGS "${PNG_PNG_INCLUDE_DIR}/png.h" png_version_str REGEX "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\".+\"") + + string(REGEX REPLACE "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\"([^\"]+)\".*" "\\1" PNG_VERSION_STRING "${png_version_str}") + unset(png_version_str) + endif (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h") endif(ZLIB_FOUND) # handle the QUIETLY and REQUIRED arguments and set PNG_FOUND to TRUE if # all listed variables are TRUE include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -find_package_handle_standard_args(PNG DEFAULT_MSG PNG_LIBRARY PNG_PNG_INCLUDE_DIR) +find_package_handle_standard_args(PNG + REQUIRED_VARS PNG_LIBRARY PNG_PNG_INCLUDE_DIR + VERSION_VAR PNG_VERSION_STRING) mark_as_advanced(PNG_PNG_INCLUDE_DIR PNG_LIBRARY ) diff -Nru cmake-2.8.7/Modules/FindPackageHandleStandardArgs.cmake cmake-2.8.9/Modules/FindPackageHandleStandardArgs.cmake --- cmake-2.8.7/Modules/FindPackageHandleStandardArgs.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindPackageHandleStandardArgs.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -19,7 +19,8 @@ # # The second mode is more powerful and also supports version checking: # FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS ...] -# [VERSION_VAR +# [VERSION_VAR ] +# [HANDLE_COMPONENTS] # [CONFIG_MODE] # [FAIL_MESSAGE "Custom failure message"] ) # @@ -32,10 +33,15 @@ # in the find_package() call. The EXACT keyword is also handled. The default # messages include information about the required version and the version # which has been actually found, both if the version is ok or not. +# If the package supports components, use the HANDLE_COMPONENTS option to enable +# handling them. In this case, find_package_handle_standard_args() will report +# which components have been found and which are missing, and the _FOUND +# variable will be set to FALSE if any of the required components (i.e. not the +# ones listed after OPTIONAL_COMPONENTS) are missing. # Use the option CONFIG_MODE if your FindXXX.cmake module is a wrapper for -# a find_package(... NO_MODULE) call, in this case all the information -# provided by the config-mode of find_package() will be evaluated -# automatically. +# a find_package(... NO_MODULE) call. In this case VERSION_VAR will be set +# to _VERSION and the macro will automatically check whether the +# Config module was found. # Via FAIL_MESSAGE a custom failure message can be specified, if this is not # used, the default message will be displayed. # @@ -128,7 +134,7 @@ # set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in # new extended or in the "old" mode: - SET(options CONFIG_MODE) + SET(options CONFIG_MODE HANDLE_COMPONENTS) SET(oneValueArgs FAIL_MESSAGE VERSION_VAR) SET(multiValueArgs REQUIRED_VARS) SET(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} ) @@ -189,6 +195,36 @@ ENDIF(NOT ${_CURRENT_VAR}) ENDFOREACH(_CURRENT_VAR) + # component handling + UNSET(FOUND_COMPONENTS_MSG) + UNSET(MISSING_COMPONENTS_MSG) + + IF(FPHSA_HANDLE_COMPONENTS) + FOREACH(comp ${${_NAME}_FIND_COMPONENTS}) + IF(${_NAME}_${comp}_FOUND) + + IF(NOT DEFINED FOUND_COMPONENTS_MSG) + SET(FOUND_COMPONENTS_MSG "found components: ") + ENDIF() + SET(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}") + + ELSE() + + IF(NOT DEFINED MISSING_COMPONENTS_MSG) + SET(MISSING_COMPONENTS_MSG "missing components: ") + ENDIF() + SET(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}") + + IF(${_NAME}_FIND_REQUIRED_${comp}) + SET(${_NAME_UPPER}_FOUND FALSE) + SET(MISSING_VARS "${MISSING_VARS} ${comp}") + ENDIF() + + ENDIF() + ENDFOREACH(comp) + SET(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}") + SET(DETAILS "${DETAILS}[c${COMPONENT_MSG}]") + ENDIF(FPHSA_HANDLE_COMPONENTS) # version handling: SET(VERSION_MSG "") @@ -240,7 +276,7 @@ # print the result: IF (${_NAME_UPPER}_FOUND) - FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG}" "${DETAILS}") + FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}") ELSE (${_NAME_UPPER}_FOUND) IF(FPHSA_CONFIG_MODE) diff -Nru cmake-2.8.7/Modules/FindPerl.cmake cmake-2.8.9/Modules/FindPerl.cmake --- cmake-2.8.7/Modules/FindPerl.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindPerl.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,8 +1,9 @@ # - Find perl # this module looks for Perl # -# PERL_EXECUTABLE - the full path to perl -# PERL_FOUND - If false, don't attempt to use perl. +# PERL_EXECUTABLE - the full path to perl +# PERL_FOUND - If false, don't attempt to use perl. +# PERL_VERSION_STRING - version of perl found (since CMake 2.8.8) #============================================================================= # Copyright 2001-2009 Kitware, Inc. @@ -39,12 +40,44 @@ PATHS ${PERL_POSSIBLE_BIN_PATHS} ) +IF(PERL_EXECUTABLE) + ### PERL_VERSION + EXECUTE_PROCESS( + COMMAND + ${PERL_EXECUTABLE} -V:version + OUTPUT_VARIABLE + PERL_VERSION_OUTPUT_VARIABLE + RESULT_VARIABLE + PERL_VERSION_RESULT_VARIABLE + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + IF(NOT PERL_VERSION_RESULT_VARIABLE AND NOT PERL_VERSION_OUTPUT_VARIABLE MATCHES "^version='UNKNOWN'") + STRING(REGEX REPLACE "version='([^']+)'.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE}) + ELSE() + EXECUTE_PROCESS( + COMMAND ${PERL_EXECUTABLE} -v + OUTPUT_VARIABLE PERL_VERSION_OUTPUT_VARIABLE + RESULT_VARIABLE PERL_VERSION_RESULT_VARIABLE + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + IF(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl.*[ \\(]v([0-9\\._]+)[ \\)]") + STRING(REGEX REPLACE ".*This is perl.*[ \\(]v([0-9\\._]+)[ \\)].*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE}) + ELSEIF(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl, version ([0-9\\._]+) +") + STRING(REGEX REPLACE ".*This is perl, version ([0-9\\._]+) +.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE}) + ENDIF() + ENDIF() +ENDIF(PERL_EXECUTABLE) + # Deprecated settings for compatibility with CMake1.4 SET(PERL ${PERL_EXECUTABLE}) # handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if # all listed variables are TRUE INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl DEFAULT_MSG PERL_EXECUTABLE) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl + REQUIRED_VARS PERL_EXECUTABLE + VERSION_VAR PERL_VERSION_STRING) MARK_AS_ADVANCED(PERL_EXECUTABLE) diff -Nru cmake-2.8.7/Modules/FindPerlLibs.cmake cmake-2.8.9/Modules/FindPerlLibs.cmake --- cmake-2.8.7/Modules/FindPerlLibs.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindPerlLibs.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -55,19 +55,6 @@ string(REGEX REPLACE "prefix='([^']+)'.*" "\\1" PERL_PREFIX ${PERL_PREFIX_OUTPUT_VARIABLE}) endif (NOT PERL_PREFIX_RESULT_VARIABLE) - ### PERL_VERSION - execute_process( - COMMAND - ${PERL_EXECUTABLE} -V:version - OUTPUT_VARIABLE - PERL_VERSION_OUTPUT_VARIABLE - RESULT_VARIABLE - PERL_VERSION_RESULT_VARIABLE - ) - if (NOT PERL_VERSION_RESULT_VARIABLE) - string(REGEX REPLACE "version='([^']+)'.*" "\\1" PERL_VERSION ${PERL_VERSION_OUTPUT_VARIABLE}) - endif (NOT PERL_VERSION_RESULT_VARIABLE) - ### PERL_ARCHNAME execute_process( COMMAND @@ -107,6 +94,7 @@ ) if (NOT PERL_SITESEARCH_RESULT_VARIABLE) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITESEARCH ${PERL_SITESEARCH_OUTPUT_VARIABLE}) + file(TO_CMAKE_PATH "${PERL_SITESEARCH}" PERL_SITESEARCH) endif (NOT PERL_SITESEARCH_RESULT_VARIABLE) ### PERL_SITELIB @@ -120,6 +108,7 @@ ) if (NOT PERL_SITELIB_RESULT_VARIABLE) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITELIB ${PERL_SITELIB_OUTPUT_VARIABLE}) + file(TO_CMAKE_PATH "${PERL_SITELIB}" PERL_SITELIB) endif (NOT PERL_SITELIB_RESULT_VARIABLE) ### PERL_VENDORARCH @@ -133,6 +122,7 @@ ) if (NOT PERL_VENDORARCH_RESULT_VARIABLE) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORARCH ${PERL_VENDORARCH_OUTPUT_VARIABLE}) + file(TO_CMAKE_PATH "${PERL_VENDORARCH}" PERL_VENDORARCH) endif (NOT PERL_VENDORARCH_RESULT_VARIABLE) ### PERL_VENDORLIB @@ -146,6 +136,7 @@ ) if (NOT PERL_VENDORLIB_RESULT_VARIABLE) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORLIB ${PERL_VENDORLIB_OUTPUT_VARIABLE}) + file(TO_CMAKE_PATH "${PERL_VENDORLIB}" PERL_VENDORLIB) endif (NOT PERL_VENDORLIB_RESULT_VARIABLE) macro(perl_adjust_darwin_lib_variable varname) @@ -186,6 +177,7 @@ if (NOT PERL_ARCHLIB_RESULT_VARIABLE) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE}) perl_adjust_darwin_lib_variable( ARCHLIB ) + file(TO_CMAKE_PATH "${PERL_ARCHLIB}" PERL_ARCHLIB) endif (NOT PERL_ARCHLIB_RESULT_VARIABLE) ### PERL_PRIVLIB @@ -200,28 +192,10 @@ if (NOT PERL_PRIVLIB_RESULT_VARIABLE) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_PRIVLIB ${PERL_PRIVLIB_OUTPUT_VARIABLE}) perl_adjust_darwin_lib_variable( PRIVLIB ) + file(TO_CMAKE_PATH "${PERL_PRIVLIB}" PERL_PRIVLIB) endif (NOT PERL_PRIVLIB_RESULT_VARIABLE) - - ### PERL_POSSIBLE_INCLUDE_PATHS - set(PERL_POSSIBLE_INCLUDE_PATHS - ${PERL_ARCHLIB}/CORE - /usr/lib/perl5/${PERL_VERSION}/${PERL_ARCHNAME}/CORE - /usr/lib/perl/${PERL_VERSION}/${PERL_ARCHNAME}/CORE - /usr/lib/perl5/${PERL_VERSION}/CORE - /usr/lib/perl/${PERL_VERSION}/CORE - ) - - ### PERL_POSSIBLE_LIB_PATHS - set(PERL_POSSIBLE_LIB_PATHS - ${PERL_ARCHLIB}/CORE - /usr/lib/perl5/${PERL_VERSION}/${PERL_ARCHNAME}/CORE - /usr/lib/perl/${PERL_VERSION}/${PERL_ARCHNAME}/CORE - /usr/lib/perl5/${PERL_VERSION}/CORE - /usr/lib/perl/${PERL_VERSION}/CORE - ) - - ### PERL_POSSIBLE_LIBRARY_NAME + ### PERL_POSSIBLE_LIBRARY_NAMES execute_process( COMMAND ${PERL_EXECUTABLE} -V:libperl @@ -231,10 +205,9 @@ PERL_LIBRARY_RESULT_VARIABLE ) if (NOT PERL_LIBRARY_RESULT_VARIABLE) - foreach(_perl_lib_path ${PERL_POSSIBLE_LIB_PATHS}) - string(REGEX REPLACE "libperl='([^']+)'" "\\1" PERL_LIBRARY_OUTPUT_VARIABLE ${PERL_LIBRARY_OUTPUT_VARIABLE}) - set(PERL_POSSIBLE_LIBRARY_NAME ${PERL_POSSIBLE_LIBRARY_NAME} "${_perl_lib_path}/${PERL_LIBRARY_OUTPUT_VARIABLE}") - endforeach(_perl_lib_path ${PERL_POSSIBLE_LIB_PATHS}) + string(REGEX REPLACE "libperl='([^']+)'.*" "\\1" PERL_POSSIBLE_LIBRARY_NAMES ${PERL_LIBRARY_OUTPUT_VARIABLE}) + else (NOT PERL_LIBRARY_RESULT_VARIABLE) + set(PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING} perl) endif (NOT PERL_LIBRARY_RESULT_VARIABLE) ### PERL_INCLUDE_PATH @@ -242,17 +215,23 @@ NAMES perl.h PATHS - ${PERL_POSSIBLE_INCLUDE_PATHS} + ${PERL_ARCHLIB}/CORE + /usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE + /usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE + /usr/lib/perl5/${PERL_VERSION_STRING}/CORE + /usr/lib/perl/${PERL_VERSION_STRING}/CORE ) - + ### PERL_LIBRARY find_library(PERL_LIBRARY NAMES - ${PERL_POSSIBLE_LIBRARY_NAME} - perl${PERL_VERSION} - perl + ${PERL_POSSIBLE_LIBRARY_NAMES} PATHS - ${PERL_POSSIBLE_LIB_PATHS} + ${PERL_ARCHLIB}/CORE + /usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE + /usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE + /usr/lib/perl5/${PERL_VERSION_STRING}/CORE + /usr/lib/perl/${PERL_VERSION_STRING}/CORE ) endif (PERL_EXECUTABLE) @@ -261,15 +240,16 @@ # all listed variables are TRUE include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) find_package_handle_standard_args(PerlLibs REQUIRED_VARS PERL_LIBRARY PERL_INCLUDE_PATH - VERSION_VAR PERL_VERSION) + VERSION_VAR PERL_VERSION_STRING) # Introduced after CMake 2.6.4 to bring module into compliance set(PERL_INCLUDE_DIR ${PERL_INCLUDE_PATH}) set(PERL_INCLUDE_DIRS ${PERL_INCLUDE_PATH}) set(PERL_LIBRARIES ${PERL_LIBRARY}) +# For backward compatibility with CMake before 2.8.8 +set(PERL_VERSION ${PERL_VERSION_STRING}) mark_as_advanced( PERL_INCLUDE_PATH - PERL_EXECUTABLE PERL_LIBRARY ) diff -Nru cmake-2.8.7/Modules/FindPhysFS.cmake cmake-2.8.9/Modules/FindPhysFS.cmake --- cmake-2.8.7/Modules/FindPhysFS.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindPhysFS.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -30,8 +30,6 @@ PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave @@ -46,8 +44,6 @@ PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw diff -Nru cmake-2.8.7/Modules/FindPkgConfig.cmake cmake-2.8.9/Modules/FindPkgConfig.cmake --- cmake-2.8.7/Modules/FindPkgConfig.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindPkgConfig.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -13,14 +13,16 @@ # 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_EXECUTABLE ... pathname of the pkg-config program -# _FOUND ... set to 1 if module(s) exist +# 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) # # 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 # which are given out when pkgconfig was called with the '--static' # option. +# _FOUND ... set to 1 if module(s) exist # _LIBRARIES ... only the libraries (w/o the '-l') # _LIBRARY_DIRS ... the paths of the libraries (w/o the '-L') # _LDFLAGS ... all required linker flags @@ -85,15 +87,26 @@ ### Common stuff #### set(PKG_CONFIG_VERSION 1) -set(PKG_CONFIG_FOUND 0) find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable") mark_as_advanced(PKG_CONFIG_EXECUTABLE) -if(PKG_CONFIG_EXECUTABLE) - set(PKG_CONFIG_FOUND 1) -endif(PKG_CONFIG_EXECUTABLE) - +if (PKG_CONFIG_EXECUTABLE) + execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --version + OUTPUT_VARIABLE PKG_CONFIG_VERSION_STRING + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) +endif (PKG_CONFIG_EXECUTABLE) + +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +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) diff -Nru cmake-2.8.7/Modules/FindPostgreSQL.cmake cmake-2.8.9/Modules/FindPostgreSQL.cmake --- cmake-2.8.7/Modules/FindPostgreSQL.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindPostgreSQL.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,20 +1,11 @@ # - Find the PostgreSQL installation. -# Usage: -# In your CMakeLists.txt file do something like this: -# ... -# # PostgreSQL -# FIND_PACKAGE(PostgreSQL) -# ... -# if( PostgreSQL_FOUND ) -# include_directories(${PostgreSQL_INCLUDE_DIRS}) -# endif( PostgreSQL_FOUND ) -# ... -# Remember to include ${PostgreSQL_LIBRARIES} in the target_link_libraries() statement. -# -# # In Windows, we make the assumption that, if the PostgreSQL files are installed, the default directory # will be C:\Program Files\PostgreSQL. # +# This module defines +# PostgreSQL_LIBRARIES - the PostgreSQL libraries needed for linking +# PostgreSQL_INCLUDE_DIRS - the directories of the PostgreSQL headers +# PostgreSQL_VERSION_STRING - the version of PostgreSQL found (since CMake 2.8.8) #============================================================================= # Copyright 2004-2009 Kitware, Inc. @@ -150,11 +141,20 @@ ) get_filename_component(PostgreSQL_LIBRARY_DIR ${PostgreSQL_LIBRARY} PATH) +if (PostgreSQL_INCLUDE_DIR AND EXISTS "${PostgreSQL_INCLUDE_DIR}/pg_config.h") + file(STRINGS "${PostgreSQL_INCLUDE_DIR}/pg_config.h" pgsql_version_str + REGEX "^#define[\t ]+PG_VERSION[\t ]+\".*\"") + + string(REGEX REPLACE "^#define[\t ]+PG_VERSION[\t ]+\"([^\"]*)\".*" "\\1" + PostgreSQL_VERSION_STRING "${pgsql_version_str}") + unset(pgsql_version_str) +endif() + # Did we find anything? include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(PostgreSQL DEFAULT_MSG - PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR) - +find_package_handle_standard_args(PostgreSQL + REQUIRED_VARS PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR + VERSION_VAR PostgreSQL_VERSION_STRING) set( PostgreSQL_FOUND ${POSTGRESQL_FOUND}) # Now try to get the include and library path. diff -Nru cmake-2.8.7/Modules/FindProducer.cmake cmake-2.8.9/Modules/FindProducer.cmake --- cmake-2.8.7/Modules/FindProducer.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindProducer.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -51,8 +51,6 @@ 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 @@ $ENV{OSGDIR} PATH_SUFFIXES lib64 lib PATHS - /usr/local - /usr /sw /opt/local /opt/csw diff -Nru cmake-2.8.7/Modules/FindProtobuf.cmake cmake-2.8.9/Modules/FindProtobuf.cmake --- cmake-2.8.7/Modules/FindProtobuf.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindProtobuf.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -7,6 +7,9 @@ # (vsprojects/Debug & vsprojects/Release) will be searched # for libraries and binaries. # +# PROTOBUF_IMPORT_DIRS - List of additional directories to be searched for +# imported .proto files. (New in CMake 2.8.8) +# # Defines the following variables: # # PROTOBUF_FOUND - Found the Google Protocol Buffers library (libprotobuf & header files) @@ -91,6 +94,16 @@ set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) endif() + if(DEFINED PROTOBUF_IMPORT_DIRS) + foreach(DIR ${PROTOBUF_IMPORT_DIRS}) + get_filename_component(ABS_PATH ${DIR} ABSOLUTE) + list(FIND _protobuf_include_path ${ABS_PATH} _contains_already) + if(${_contains_already} EQUAL -1) + list(APPEND _protobuf_include_path -I ${ABS_PATH}) + endif() + endforeach() + endif() + set(${SRCS}) set(${HDRS}) foreach(FIL ${ARGN}) diff -Nru cmake-2.8.7/Modules/FindPythonInterp.cmake cmake-2.8.9/Modules/FindPythonInterp.cmake --- cmake-2.8.7/Modules/FindPythonInterp.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindPythonInterp.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -10,11 +10,14 @@ # PYTHON_VERSION_MINOR - Python minor version found e.g. 5 # PYTHON_VERSION_PATCH - Python patch version found e.g. 2 # -# Python_ADDITIONAL_VERSIONS - list of additional Python versions to search for +# 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(PythonInterp). #============================================================================= # Copyright 2005-2010 Kitware, Inc. # Copyright 2011 Bjoern Ricks +# Copyright 2012 Rolf Eike Beer # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -26,14 +29,51 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +unset(_Python_NAMES) + +set(_PYTHON1_VERSIONS 1.6 1.5) +set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0) +set(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0) + +if(PythonInterp_FIND_VERSION) + if(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$") + string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonInterp_FIND_VERSION}") + string(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}") + list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ_MIN} python${_PYTHON_FIND_MAJ}) + unset(_PYTHON_FIND_OTHER_VERSIONS) + if(NOT PythonInterp_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 PythonInterp_FIND_VERSION_EXACT) + unset(_PYTHON_FIND_MAJ_MIN) + unset(_PYTHON_FIND_MAJ) + else(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$") + list(APPEND _Python_NAMES python${PythonInterp_FIND_VERSION}) + set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonInterp_FIND_VERSION}_VERSIONS}) + endif(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$") +else(PythonInterp_FIND_VERSION) + set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS}) +endif(PythonInterp_FIND_VERSION) + +list(APPEND _Python_NAMES python) + # Search for the current active python version first -find_program(PYTHON_EXECUTABLE NAMES python) +find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES}) # Set up the versions we know about, in the order we will search. Always add # the user supplied additional versions to the front. set(_Python_VERSIONS ${Python_ADDITIONAL_VERSIONS} - 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) + ${_PYTHON_FIND_OTHER_VERSIONS} + ) + +unset(_PYTHON_FIND_OTHER_VERSIONS) +unset(_PYTHON1_VERSIONS) +unset(_PYTHON2_VERSIONS) +unset(_PYTHON3_VERSIONS) # Search for newest python version if python executable isn't found if(NOT PYTHON_EXECUTABLE) @@ -51,12 +91,47 @@ # determine python version string if(PYTHON_EXECUTABLE) - execute_process(COMMAND "${PYTHON_EXECUTABLE}" --version ERROR_VARIABLE _VERSION OUTPUT_QUIET ERROR_STRIP_TRAILING_WHITESPACE) - string(REPLACE "Python " "" PYTHON_VERSION_STRING "${_VERSION}") - string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" PYTHON_VERSION_MAJOR "${PYTHON_VERSION_STRING}") - string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" PYTHON_VERSION_MINOR "${PYTHON_VERSION_STRING}") - string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" PYTHON_VERSION_PATCH "${PYTHON_VERSION_STRING}") -endif() + execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c + "import sys; sys.stdout.write(';'.join([str(x) for x in sys.version_info[:3]]))" + OUTPUT_VARIABLE _VERSION + RESULT_VARIABLE _PYTHON_VERSION_RESULT + ERROR_QUIET) + if(NOT _PYTHON_VERSION_RESULT) + string(REPLACE ";" "." PYTHON_VERSION_STRING "${_VERSION}") + list(GET _VERSION 0 PYTHON_VERSION_MAJOR) + list(GET _VERSION 1 PYTHON_VERSION_MINOR) + list(GET _VERSION 2 PYTHON_VERSION_PATCH) + if(PYTHON_VERSION_PATCH EQUAL 0) + # it's called "Python 2.7", not "2.7.0" + string(REGEX REPLACE "\\.0$" "" PYTHON_VERSION_STRING "${PYTHON_VERSION_STRING}") + endif() + else() + # sys.version predates sys.version_info, so use that + execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "import sys; sys.stdout.write(sys.version)" + OUTPUT_VARIABLE _VERSION + RESULT_VARIABLE _PYTHON_VERSION_RESULT + ERROR_QUIET) + if(NOT _PYTHON_VERSION_RESULT) + string(REGEX REPLACE " .*" "" PYTHON_VERSION_STRING "${_VERSION}") + string(REGEX REPLACE "^([0-9]+)\\.[0-9]+.*" "\\1" PYTHON_VERSION_MAJOR "${PYTHON_VERSION_STRING}") + string(REGEX REPLACE "^[0-9]+\\.([0-9])+.*" "\\1" PYTHON_VERSION_MINOR "${PYTHON_VERSION_STRING}") + if(PYTHON_VERSION_STRING MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+.*") + string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" PYTHON_VERSION_PATCH "${PYTHON_VERSION_STRING}") + else() + set(PYTHON_VERSION_PATCH "0") + endif() + else() + # sys.version was first documented for Python 1.5, so assume + # this is older. + set(PYTHON_VERSION_STRING "1.4") + set(PYTHON_VERSION_MAJOR "1") + set(PYTHON_VERSION_MAJOR "4") + set(PYTHON_VERSION_MAJOR "0") + endif() + endif() + unset(_PYTHON_VERSION_RESULT) + unset(_VERSION) +endif(PYTHON_EXECUTABLE) # handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if # all listed variables are TRUE diff -Nru cmake-2.8.7/Modules/FindPythonLibs.cmake cmake-2.8.9/Modules/FindPythonLibs.cmake --- cmake-2.8.7/Modules/FindPythonLibs.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindPythonLibs.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -7,8 +7,17 @@ # PYTHON_LIBRARIES - path to the python library # PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated) # PYTHON_INCLUDE_DIRS - path to where Python.h is found -# PYTHON_DEBUG_LIBRARIES - path to the debug library -# Python_ADDITIONAL_VERSIONS - list of additional Python versions to search for +# PYTHON_DEBUG_LIBRARIES - path to the debug library (deprecated) +# PYTHONLIBS_VERSION_STRING - version of the Python libs found (since CMake 2.8.8) +# +# 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. @@ -27,11 +36,48 @@ # Search for the python framework on Apple. CMAKE_FIND_FRAMEWORKS(Python) +SET(_PYTHON1_VERSIONS 1.6 1.5) +SET(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0) +SET(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0) + +IF(PythonLibs_FIND_VERSION) + IF(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$") + STRING(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION}") + STRING(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}") + UNSET(_PYTHON_FIND_OTHER_VERSIONS) + IF(PythonLibs_FIND_VERSION_EXACT) + IF(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION) + SET(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}") + ELSE(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION) + SET(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}") + ENDIF(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION) + ELSE(PythonLibs_FIND_VERSION_EXACT) + FOREACH(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS}) + IF(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN) + LIST(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V}) + ENDIF() + ENDFOREACH() + ENDIF(PythonLibs_FIND_VERSION_EXACT) + UNSET(_PYTHON_FIND_MAJ_MIN) + UNSET(_PYTHON_FIND_MAJ) + ELSE(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$") + SET(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION}_VERSIONS}) + ENDIF(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$") +ELSE(PythonLibs_FIND_VERSION) + SET(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS}) +ENDIF(PythonLibs_FIND_VERSION) + # Set up the versions we know about, in the order we will search. Always add # the user supplied additional versions to the front. -set(_Python_VERSIONS +SET(_Python_VERSIONS ${Python_ADDITIONAL_VERSIONS} - 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) + ${_PYTHON_FIND_OTHER_VERSIONS} + ) + +UNSET(_PYTHON_FIND_OTHER_VERSIONS) +UNSET(_PYTHON1_VERSIONS) +UNSET(_PYTHON2_VERSIONS) +UNSET(_PYTHON3_VERSIONS) FOREACH(_CURRENT_VERSION ${_Python_VERSIONS}) STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION}) @@ -40,13 +86,22 @@ NAMES python${_CURRENT_VERSION_NO_DOTS}_d python PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs ) + [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs + [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs + ) 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 # Avoid finding the .dll in the PATH. We want the .lib. NO_SYSTEM_ENVIRONMENT_PATH ) @@ -79,14 +134,28 @@ PATHS ${PYTHON_FRAMEWORK_INCLUDES} [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 + REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"") + STRING(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1" + PYTHONLIBS_VERSION_STRING "${python_version_str}") + UNSET(python_version_str) + ENDIF(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h") + + IF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR) + BREAK() + ENDIF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR) ENDFOREACH(_CURRENT_VERSION) MARK_AS_ADVANCED( @@ -100,13 +169,23 @@ # library. We now set the variables listed by the documentation for this # module. SET(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}") -SET(PYTHON_LIBRARIES "${PYTHON_LIBRARY}") SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}") +# These variables have been historically named in this module different from +# what SELECT_LIBRARY_CONFIGURATIONS() expects. +SET(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}") +SET(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}") +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) +SELECT_LIBRARY_CONFIGURATIONS(PYTHON) +# SELECT_LIBRARY_CONFIGURATIONS() sets ${PREFIX}_FOUND if it has a library. +# Unset this, this prefix doesn't match the module prefix, they are different +# for historical reasons. +UNSET(PYTHON_FOUND) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs DEFAULT_MSG PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) - +FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs + REQUIRED_VARS PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS + VERSION_VAR PYTHONLIBS_VERSION_STRING) # PYTHON_ADD_MODULE( src1 src2 ... srcN) is used to build modules for python. # PYTHON_WRITE_MODULES_HEADER() writes a header file you can include diff -Nru cmake-2.8.7/Modules/FindQt3.cmake cmake-2.8.9/Modules/FindQt3.cmake --- cmake-2.8.7/Modules/FindQt3.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindQt3.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,10 +1,11 @@ # - Locate Qt include paths and libraries # This module defines: -# QT_INCLUDE_DIR - where to find qt.h, etc. -# QT_LIBRARIES - the libraries to link against to use Qt. -# QT_DEFINITIONS - definitions to use when -# compiling code that uses Qt. -# QT_FOUND - If false, don't try to use Qt. +# QT_INCLUDE_DIR - where to find qt.h, etc. +# QT_LIBRARIES - the libraries to link against to use Qt. +# QT_DEFINITIONS - definitions to use when +# compiling code that uses Qt. +# QT_FOUND - If false, don't try to use Qt. +# QT_VERSION_STRING - the version of Qt found # # If you need the multithreaded version of Qt, set QT_MT_REQUIRED to TRUE # @@ -46,13 +47,16 @@ ENDIF(QT4_FOUND) -FILE(GLOB GLOB_PATHS_BIN /usr/lib/qt-3*/bin/) +FILE(GLOB GLOB_PATHS /usr/lib/qt-3*) +FOREACH(GLOB_PATH ${GLOB_PATHS}) + LIST(APPEND GLOB_PATHS_BIN "${GLOB_PATH}/bin") +ENDFOREACH(GLOB_PATH) FIND_PATH(QT_INCLUDE_DIR qt.h "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt" $ENV{QTDIR}/include - ${GLOB_PATHS_BIN} + ${GLOB_PATHS} /usr/local/qt/include /usr/lib/qt/include /usr/lib/qt3/include @@ -71,12 +75,13 @@ IF(QT_INCLUDE_DIR) #extract the version string from qglobal.h FILE(READ ${QT_INCLUDE_DIR}/qglobal.h QGLOBAL_H) - STRING(REGEX MATCH "#define[\t ]+QT_VERSION_STR[\t ]+\"([0-9]+.[0-9]+.[0-9]+)\"" QGLOBAL_H "${QGLOBAL_H}") - STRING(REGEX REPLACE ".*\"([0-9]+.[0-9]+.[0-9]+)\".*" "\\1" qt_version_str "${QGLOBAL_H}") + STRING(REGEX MATCH "#define[\t ]+QT_VERSION_STR[\t ]+\"[0-9]+.[0-9]+.[0-9]+[a-z]*\"" QGLOBAL_H "${QGLOBAL_H}") + STRING(REGEX REPLACE ".*\"([0-9]+.[0-9]+.[0-9]+[a-z]*)\".*" "\\1" qt_version_str "${QGLOBAL_H}") # Under windows the qt library (MSVC) has the format qt-mtXYZ where XYZ is the # version X.Y.Z, so we need to remove the dots from version STRING(REGEX REPLACE "\\." "" qt_version_str_lib "${qt_version_str}") + SET(QT_VERSION_STRING "${qt_version_str}") ENDIF(QT_INCLUDE_DIR) FILE(GLOB GLOB_PATHS_LIB /usr/lib/qt-3*/lib/) @@ -183,67 +188,28 @@ IF (WIN32) FIND_LIBRARY(QT_QTMAIN_LIBRARY qtmain + HINTS + $ENV{QTDIR}/lib "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib" + PATHS "$ENV{ProgramFiles}/qt/lib" - $ENV{QTDIR}/lib "C:/Program Files/qt/lib" + "C:/Program Files/qt/lib" DOC "This Library is only needed by and included with Qt3 on MSWindows. It should be NOTFOUND, undefined or IGNORE otherwise." ) ENDIF (WIN32) - -IF (QT_MIN_VERSION) - - STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" qt_major_vers "${qt_version_str}") - STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" qt_minor_vers "${qt_version_str}") - STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" qt_patch_vers "${qt_version_str}") - - #now parse the parts of the user given version string into variables - STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+$" req_qt_major_vers "${QT_MIN_VERSION}") - IF (NOT req_qt_major_vers) - error_message( "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"3.1.5\"") - ENDIF (NOT req_qt_major_vers) - - STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_qt_major_vers "${QT_MIN_VERSION}") - STRING(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" req_qt_minor_vers "${QT_MIN_VERSION}") - STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}") - - # req = "6.5.4", qt = "3.2.1" - MACRO(error_message msg) - IF(QT3_REQUIRED) - MESSAGE( FATAL_ERROR ${msg}) - ELSE(QT3_REQUIRED) - MESSAGE( STATUS ${msg}) - ENDIF(QT3_REQUIRED) - ENDMACRO(error_message) - - IF (req_qt_major_vers GREATER qt_major_vers) # (6 > 3) ? - ERROR_MESSAGE( "Qt major version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes - ELSE (req_qt_major_vers GREATER qt_major_vers) # no - IF (req_qt_major_vers LESS qt_major_vers) # (6 < 3) ? - SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes - ELSE (req_qt_major_vers LESS qt_major_vers) # ( 6==3) ? - IF (req_qt_minor_vers GREATER qt_minor_vers) # (5>2) ? - ERROR_MESSAGE( "Qt minor version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes - ELSE (req_qt_minor_vers GREATER qt_minor_vers) # no - IF (req_qt_minor_vers LESS qt_minor_vers) # (5<2) ? - SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes - ELSE (req_qt_minor_vers LESS qt_minor_vers) # (5==2) - IF (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ? - ERROR_MESSAGE( "Qt patch level not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes - ELSE (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ? - SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes - ENDIF (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ? - ENDIF (req_qt_minor_vers LESS qt_minor_vers) - ENDIF (req_qt_minor_vers GREATER qt_minor_vers) - ENDIF (req_qt_major_vers LESS qt_major_vers) - ENDIF (req_qt_major_vers GREATER qt_major_vers) -ENDIF (QT_MIN_VERSION) +#support old QT_MIN_VERSION if set, but not if version is supplied by find_package() +IF(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION) + SET(Qt3_FIND_VERSION ${QT_MIN_VERSION}) +ENDIF(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION) # if the include a library are found then we have it INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt3 DEFAULT_MSG QT_QT_LIBRARY QT_INCLUDE_DIR QT_MOC_EXECUTABLE) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt3 + REQUIRED_VARS QT_QT_LIBRARY QT_INCLUDE_DIR QT_MOC_EXECUTABLE + VERSION_VAR QT_VERSION_STRING) SET(QT_FOUND ${QT3_FOUND} ) IF(QT_FOUND) @@ -293,8 +259,16 @@ ENDIF(QT_QT_LIBRARY MATCHES "qt-mt") ENDIF(QT_FOUND) -EXEC_PROGRAM(${QT_MOC_EXECUTABLE} ARGS "-v" OUTPUT_VARIABLE QTVERSION_MOC) -EXEC_PROGRAM(${QT_UIC_EXECUTABLE} ARGS "-version" OUTPUT_VARIABLE QTVERSION_UIC) +IF(QT_MOC_EXECUTABLE) + EXECUTE_PROCESS(COMMAND ${QT_MOC_EXECUTABLE} "-v" + OUTPUT_VARIABLE QTVERSION_MOC + ERROR_QUIET) +ENDIF(QT_MOC_EXECUTABLE) +IF(QT_UIC_EXECUTABLE) + EXECUTE_PROCESS(COMMAND ${QT_UIC_EXECUTABLE} "-version" + OUTPUT_VARIABLE QTVERSION_UIC + ERROR_QUIET) +ENDIF(QT_UIC_EXECUTABLE) SET(_QT_UIC_VERSION_3 FALSE) IF("${QTVERSION_UIC}" MATCHES ".* 3..*") diff -Nru cmake-2.8.7/Modules/FindQt4.cmake cmake-2.8.9/Modules/FindQt4.cmake --- cmake-2.8.7/Modules/FindQt4.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindQt4.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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" @@ -588,8 +601,9 @@ SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE) SET(QT_QTCORE_FOUND 1) ELSE() - MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as ${QT_LIBRARY_DIR_TMP}") - MESSAGE("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly, or it wasn't found for cross compiling.") + MESSAGE(WARNING "${QT_QMAKE_EXECUTABLE} reported QT_INSTALL_LIBS as \"${QT_LIBRARY_DIR_TMP}\" " + "but QtCore could not be found there. " + "Qt is NOT installed correctly for the target build environment.") IF(Qt4_FIND_REQUIRED) MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.") ENDIF(Qt4_FIND_REQUIRED) @@ -1058,7 +1072,11 @@ 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 ) @@ -1168,10 +1186,22 @@ 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 -Nru cmake-2.8.7/Modules/FindRuby.cmake cmake-2.8.9/Modules/FindRuby.cmake --- cmake-2.8.7/Modules/FindRuby.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindRuby.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -60,50 +60,45 @@ FIND_PROGRAM(RUBY_EXECUTABLE NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES}) -IF(RUBY_EXECUTABLE AND NOT RUBY_MAJOR_VERSION) - # query the ruby version - EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['MAJOR']" - OUTPUT_VARIABLE RUBY_VERSION_MAJOR) +IF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) + FUNCTION(_RUBY_CONFIG_VAR RBVAR OUTVAR) + EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['${RBVAR}']" + RESULT_VARIABLE _RUBY_SUCCESS + OUTPUT_VARIABLE _RUBY_OUTPUT + ERROR_QUIET) + IF(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT) + EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['${RBVAR}']" + RESULT_VARIABLE _RUBY_SUCCESS + OUTPUT_VARIABLE _RUBY_OUTPUT + ERROR_QUIET) + ENDIF(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT) + SET(${OUTVAR} "${_RUBY_OUTPUT}" PARENT_SCOPE) + ENDFUNCTION(_RUBY_CONFIG_VAR) - EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['MINOR']" - OUTPUT_VARIABLE RUBY_VERSION_MINOR) - EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['TEENY']" - OUTPUT_VARIABLE RUBY_VERSION_PATCH) + # query the ruby version + _RUBY_CONFIG_VAR("MAJOR" RUBY_VERSION_MAJOR) + _RUBY_CONFIG_VAR("MINOR" RUBY_VERSION_MINOR) + _RUBY_CONFIG_VAR("TEENY" RUBY_VERSION_PATCH) # query the different directories - EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['archdir']" - OUTPUT_VARIABLE RUBY_ARCH_DIR) - - EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['arch']" - OUTPUT_VARIABLE RUBY_ARCH) - - EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['rubyhdrdir']" - OUTPUT_VARIABLE RUBY_HDR_DIR) - - EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['libdir']" - OUTPUT_VARIABLE RUBY_POSSIBLE_LIB_DIR) - - EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['rubylibdir']" - OUTPUT_VARIABLE RUBY_RUBY_LIB_DIR) + _RUBY_CONFIG_VAR("archdir" RUBY_ARCH_DIR) + _RUBY_CONFIG_VAR("arch" RUBY_ARCH) + _RUBY_CONFIG_VAR("rubyhdrdir" RUBY_HDR_DIR) + _RUBY_CONFIG_VAR("libdir" RUBY_POSSIBLE_LIB_DIR) + _RUBY_CONFIG_VAR("rubylibdir" RUBY_RUBY_LIB_DIR) # site_ruby - EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitearchdir']" - OUTPUT_VARIABLE RUBY_SITEARCH_DIR) - - EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitelibdir']" - OUTPUT_VARIABLE RUBY_SITELIB_DIR) + _RUBY_CONFIG_VAR("sitearchdir" RUBY_SITEARCH_DIR) + _RUBY_CONFIG_VAR("sitelibdir" RUBY_SITELIB_DIR) # vendor_ruby available ? EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r vendor-specific -e "print 'true'" OUTPUT_VARIABLE RUBY_HAS_VENDOR_RUBY ERROR_QUIET) IF(RUBY_HAS_VENDOR_RUBY) - EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorlibdir']" - OUTPUT_VARIABLE RUBY_VENDORLIB_DIR) - - EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorarchdir']" - OUTPUT_VARIABLE RUBY_VENDORARCH_DIR) + _RUBY_CONFIG_VAR("vendorlibdir" RUBY_VENDORLIB_DIR) + _RUBY_CONFIG_VAR("vendorarchdir" RUBY_VENDORARCH_DIR) ENDIF(RUBY_HAS_VENDOR_RUBY) # save the results in the cache so we don't have to run ruby the next time again @@ -135,11 +130,11 @@ RUBY_VERSION_MINOR RUBY_VERSION_PATCH ) -ENDIF(RUBY_EXECUTABLE AND NOT RUBY_MAJOR_VERSION) +ENDIF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) # In case RUBY_EXECUTABLE could not be executed (e.g. cross compiling) # try to detect which version we found. This is not too good. -IF(NOT RUBY_VERSION_MAJOR) +IF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) # by default assume 1.8.0 SET(RUBY_VERSION_MAJOR 1) SET(RUBY_VERSION_MINOR 8) @@ -149,13 +144,14 @@ SET(RUBY_VERSION_MAJOR 1) SET(RUBY_VERSION_MINOR 9) ENDIF(${RUBY_EXECUTABLE} MATCHES "ruby1.?9" OR RUBY_HDR_DIR) -ENDIF(NOT RUBY_VERSION_MAJOR) - +ENDIF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) -SET(RUBY_VERSION "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}.${RUBY_VERSION_PATCH}") -SET(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}") -SET(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}") -SET(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}") +IF(RUBY_VERSION_MAJOR) + SET(RUBY_VERSION "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}.${RUBY_VERSION_PATCH}") + SET(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}") + SET(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}") + SET(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}") +ENDIF(RUBY_VERSION_MAJOR) FIND_PATH(RUBY_INCLUDE_DIR NAMES ruby.h @@ -167,7 +163,7 @@ SET(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIR} ) # if ruby > 1.8 is required or if ruby > 1.8 was found, search for the config.h dir -IF( ${Ruby_FIND_VERSION_SHORT_NODOT} GREATER 18 OR ${_RUBY_VERSION_SHORT_NODOT} GREATER 18 OR RUBY_HDR_DIR) +IF( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18 OR "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18 OR RUBY_HDR_DIR) FIND_PATH(RUBY_CONFIG_INCLUDE_DIR NAMES ruby/config.h config.h HINTS @@ -176,11 +172,11 @@ ) SET(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIRS} ${RUBY_CONFIG_INCLUDE_DIR} ) -ENDIF( ${Ruby_FIND_VERSION_SHORT_NODOT} GREATER 18 OR ${_RUBY_VERSION_SHORT_NODOT} GREATER 18 OR RUBY_HDR_DIR) +ENDIF( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18 OR "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18 OR RUBY_HDR_DIR) # Determine the list of possible names for the ruby library -SET(_RUBY_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_RUBY_VERSION_SHORT} ruby${_RUBY_VERSION_SHORT_NODOT}) +SET(_RUBY_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_RUBY_VERSION_SHORT} ruby${_RUBY_VERSION_SHORT_NODOT} ruby-${_RUBY_VERSION_SHORT} ruby-${RUBY_VERSION}) IF(WIN32) SET( _RUBY_MSVC_RUNTIME "" ) @@ -224,6 +220,10 @@ MESSAGE(STATUS "RUBY_POSSIBLE_LIB_DIR: ${RUBY_POSSIBLE_LIB_DIR}") MESSAGE(STATUS "Found RUBY_VERSION: \"${RUBY_VERSION}\" , short: \"${_RUBY_VERSION_SHORT}\", nodot: \"${_RUBY_VERSION_SHORT_NODOT}\"") MESSAGE(STATUS "_RUBY_REQUIRED_VARS: ${_RUBY_REQUIRED_VARS}") + MESSAGE(STATUS "RUBY_EXECUTABLE: ${RUBY_EXECUTABLE}") + MESSAGE(STATUS "RUBY_LIBRARY: ${RUBY_LIBRARY}") + MESSAGE(STATUS "RUBY_INCLUDE_DIR: ${RUBY_INCLUDE_DIR}") + MESSAGE(STATUS "RUBY_CONFIG_INCLUDE_DIR: ${RUBY_CONFIG_INCLUDE_DIR}") MESSAGE(STATUS "--------------------") ENDIF(_RUBY_DEBUG_OUTPUT) diff -Nru cmake-2.8.7/Modules/FindSDL.cmake cmake-2.8.9/Modules/FindSDL.cmake --- cmake-2.8.7/Modules/FindSDL.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindSDL.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -81,7 +81,6 @@ /opt/csw # Blastwave /opt ) -#MESSAGE("SDL_INCLUDE_DIR is ${SDL_INCLUDE_DIR}") # SDL-1.1 is the name used by FreeBSD ports... # don't confuse it for the version number. @@ -97,8 +96,6 @@ /opt ) -#MESSAGE("SDL_LIBRARY_TEMP is ${SDL_LIBRARY_TEMP}") - IF(NOT SDL_BUILDING_LIBRARY) IF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework") # Non-OS X framework versions expect you to also dynamically link to @@ -134,7 +131,6 @@ SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") ENDIF(MINGW) -SET(SDL_FOUND "NO") IF(SDL_LIBRARY_TEMP) # For SDLmain IF(NOT SDL_BUILDING_LIBRARY) @@ -169,9 +165,9 @@ SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found") # Set the temp variable to INTERNAL so it is not seen in the CMake GUI SET(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "") - - SET(SDL_FOUND "YES") ENDIF(SDL_LIBRARY_TEMP) -#MESSAGE("SDL_LIBRARY is ${SDL_LIBRARY}") +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL + REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR) diff -Nru cmake-2.8.7/Modules/FindSDL_image.cmake cmake-2.8.9/Modules/FindSDL_image.cmake --- cmake-2.8.7/Modules/FindSDL_image.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindSDL_image.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -39,8 +39,6 @@ /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,16 +58,13 @@ PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw /opt ) -SET(SDLIMAGE_FOUND "NO") -IF(SDLIMAGE_LIBRARY AND SDLIMAGE_INCLUDE_DIR) - SET(SDLIMAGE_FOUND "YES") -ENDIF(SDLIMAGE_LIBRARY AND SDLIMAGE_INCLUDE_DIR) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLIMAGE + REQUIRED_VARS SDLIMAGE_LIBRARY SDLIMAGE_INCLUDE_DIR) diff -Nru cmake-2.8.7/Modules/FindSDL_mixer.cmake cmake-2.8.9/Modules/FindSDL_mixer.cmake --- cmake-2.8.7/Modules/FindSDL_mixer.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindSDL_mixer.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -39,8 +39,6 @@ /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,16 +58,13 @@ PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw /opt ) -SET(SDLMIXER_FOUND "NO") -IF(SDLMIXER_LIBRARY AND SDLMIXER_INCLUDE_DIR) - SET(SDLMIXER_FOUND "YES") -ENDIF(SDLMIXER_LIBRARY AND SDLMIXER_INCLUDE_DIR) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLMIXER + REQUIRED_VARS SDLMIXER_LIBRARY SDLMIXER_INCLUDE_DIR) diff -Nru cmake-2.8.7/Modules/FindSDL_net.cmake cmake-2.8.9/Modules/FindSDL_net.cmake --- cmake-2.8.7/Modules/FindSDL_net.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindSDL_net.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -39,8 +39,6 @@ /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,16 +57,13 @@ PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw /opt ) -SET(SDLNET_FOUND "NO") -IF(SDLNET_LIBRARY AND SDLNET_INCLUDE_DIR) - SET(SDLNET_FOUND "YES") -ENDIF(SDLNET_LIBRARY AND SDLNET_INCLUDE_DIR) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLNET + REQUIRED_VARS SDLNET_LIBRARY SDLNET_INCLUDE_DIR) diff -Nru cmake-2.8.7/Modules/FindSDL_sound.cmake cmake-2.8.9/Modules/FindSDL_sound.cmake --- cmake-2.8.7/Modules/FindSDL_sound.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindSDL_sound.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -86,8 +86,6 @@ /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,15 +104,12 @@ $ENV{SDLDIR}/lib $ENV{SDLDIR} PATHS - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib /opt/lib ) -SET(SDL_SOUND_FOUND "NO") IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) # CMake is giving me problems using TRY_COMPILE with the CMAKE_FLAGS @@ -223,8 +218,6 @@ $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -246,8 +239,6 @@ $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -272,8 +263,6 @@ $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -294,8 +283,6 @@ $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -318,8 +305,6 @@ $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -342,8 +327,6 @@ $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -369,8 +352,6 @@ $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -396,8 +377,6 @@ $ENV{SDLSOUNDDIR} $ENV{SDLDIR}/lib $ENV{SDLDIR} - /usr/local/lib - /usr/lib /sw/lib /opt/local/lib /opt/csw/lib @@ -414,8 +393,9 @@ ENDIF(NOT MY_RESULT) SET(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries") - SET(SDL_SOUND_FOUND "YES") ENDIF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) - # MESSAGE("SDL_SOUND_LIBRARIES is ${SDL_SOUND_LIBRARIES}") +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_SOUND + REQUIRED_VARS SDL_SOUND_LIBRARIES SDL_SOUND_INCLUDE_DIR) diff -Nru cmake-2.8.7/Modules/FindSDL_ttf.cmake cmake-2.8.9/Modules/FindSDL_ttf.cmake --- cmake-2.8.7/Modules/FindSDL_ttf.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindSDL_ttf.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -39,8 +39,6 @@ /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 @@ PATHS ~/Library/Frameworks /Library/Frameworks - /usr/local - /usr /sw /opt/local /opt/csw @@ -68,8 +64,7 @@ PATH_SUFFIXES lib64 lib ) -SET(SDLTTF_FOUND "NO") -IF(SDLTTF_LIBRARY AND SDLTTF_INCLUDE_DIR) - SET(SDLTTF_FOUND "YES") -ENDIF(SDLTTF_LIBRARY AND SDLTTF_INCLUDE_DIR) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLTTF + REQUIRED_VARS SDLTTF_LIBRARY SDLTTF_INCLUDE_DIR) diff -Nru cmake-2.8.7/Modules/FindSquish.cmake cmake-2.8.9/Modules/FindSquish.cmake --- cmake-2.8.7/Modules/FindSquish.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindSquish.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -43,18 +43,14 @@ # 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 -Nru cmake-2.8.7/Modules/FindTCL.cmake cmake-2.8.9/Modules/FindTCL.cmake --- cmake-2.8.7/Modules/FindTCL.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindTCL.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -48,10 +48,14 @@ INCLUDE(FindTclsh) INCLUDE(FindWish) -GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH) -GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH) -STRING(REGEX REPLACE - "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}") +IF(TCLSH_VERSION_STRING) + SET(TCL_TCLSH_VERSION "${TCLSH_VERSION_STRING}") +ELSE(TCLSH_VERSION_STRING) + GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH) + GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH) + STRING(REGEX REPLACE + "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}") +ENDIF(TCLSH_VERSION_STRING) GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH) GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH) @@ -78,8 +82,6 @@ "${TK_LIBRARY_PATH}" "${TCL_TCLSH_PATH_PARENT}/lib" "${TK_WISH_PATH_PARENT}/lib" - /usr/lib - /usr/local/lib ) IF(WIN32) @@ -158,8 +160,6 @@ ${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 -Nru cmake-2.8.7/Modules/FindTIFF.cmake cmake-2.8.9/Modules/FindTIFF.cmake --- cmake-2.8.7/Modules/FindTIFF.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindTIFF.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -25,10 +25,21 @@ SET(TIFF_NAMES ${TIFF_NAMES} tiff libtiff tiff3 libtiff3) FIND_LIBRARY(TIFF_LIBRARY NAMES ${TIFF_NAMES} ) +IF(TIFF_INCLUDE_DIR AND EXISTS "${TIFF_INCLUDE_DIR}/tiffvers.h") + FILE(STRINGS "${TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str + REGEX "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version .*") + + STRING(REGEX REPLACE "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version +([^ \\n]*).*" + "\\1" TIFF_VERSION_STRING "${tiff_version_str}") + UNSET(tiff_version_str) +ENDIF() + # handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if # all listed variables are TRUE INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIFF DEFAULT_MSG TIFF_LIBRARY TIFF_INCLUDE_DIR) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIFF + REQUIRED_VARS TIFF_LIBRARY TIFF_INCLUDE_DIR + VERSION_VAR TIFF_VERSION_STRING) IF(TIFF_FOUND) SET( TIFF_LIBRARIES ${TIFF_LIBRARY} ) diff -Nru cmake-2.8.7/Modules/FindTclStub.cmake cmake-2.8.9/Modules/FindTclStub.cmake --- cmake-2.8.7/Modules/FindTclStub.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindTclStub.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -66,8 +66,6 @@ "${TK_LIBRARY_PATH}" "${TCL_TCLSH_PATH_PARENT}/lib" "${TK_WISH_PATH_PARENT}/lib" - /usr/lib - /usr/local/lib ) IF(WIN32) diff -Nru cmake-2.8.7/Modules/FindTclsh.cmake cmake-2.8.9/Modules/FindTclsh.cmake --- cmake-2.8.7/Modules/FindTclsh.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindTclsh.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -82,9 +82,19 @@ HINTS ${TCLTK_POSSIBLE_BIN_PATHS} ) +IF(TCL_TCLSH) + EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -E echo puts "\$tcl_version" + COMMAND "${TCL_TCLSH}" + OUTPUT_VARIABLE TCLSH_VERSION_STRING + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) +ENDIF(TCL_TCLSH) + # handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if # all listed variables are TRUE INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Tclsh DEFAULT_MSG TCL_TCLSH) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Tclsh + REQUIRED_VARS TCL_TCLSH + VERSION_VAR TCLSH_VERSION_STRING) MARK_AS_ADVANCED(TCL_TCLSH) diff -Nru cmake-2.8.7/Modules/FindThreads.cmake cmake-2.8.9/Modules/FindThreads.cmake --- cmake-2.8.7/Modules/FindThreads.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindThreads.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -23,6 +23,7 @@ INCLUDE (CheckIncludeFiles) INCLUDE (CheckLibraryExists) +INCLUDE (CheckSymbolExists) SET(Threads_FOUND FALSE) # Do we have sproc? @@ -44,33 +45,41 @@ # SET(CMAKE_HAVE_THREADS_LIBRARY) IF(NOT THREADS_HAVE_PTHREAD_ARG) - - # Do we have -lpthreads - CHECK_LIBRARY_EXISTS(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE) - IF(CMAKE_HAVE_PTHREADS_CREATE) - SET(CMAKE_THREAD_LIBS_INIT "-lpthreads") + # Check if pthread functions are in normal C library + CHECK_SYMBOL_EXISTS(pthread_create pthread.h CMAKE_HAVE_LIBC_CREATE) + IF(CMAKE_HAVE_LIBC_CREATE) + SET(CMAKE_THREAD_LIBS_INIT "") SET(CMAKE_HAVE_THREADS_LIBRARY 1) SET(Threads_FOUND TRUE) ENDIF() - # Ok, how about -lpthread - CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE) - IF(CMAKE_HAVE_PTHREAD_CREATE) - SET(CMAKE_THREAD_LIBS_INIT "-lpthread") - SET(Threads_FOUND TRUE) - SET(CMAKE_HAVE_THREADS_LIBRARY 1) - ENDIF() + IF(NOT CMAKE_HAVE_THREADS_LIBRARY) + # Do we have -lpthreads + CHECK_LIBRARY_EXISTS(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE) + IF(CMAKE_HAVE_PTHREADS_CREATE) + SET(CMAKE_THREAD_LIBS_INIT "-lpthreads") + SET(CMAKE_HAVE_THREADS_LIBRARY 1) + SET(Threads_FOUND TRUE) + ENDIF() - IF(CMAKE_SYSTEM MATCHES "SunOS.*") - # On sun also check for -lthread - CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE) - IF(CMAKE_HAVE_THR_CREATE) - SET(CMAKE_THREAD_LIBS_INIT "-lthread") + # Ok, how about -lpthread + CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE) + IF(CMAKE_HAVE_PTHREAD_CREATE) + SET(CMAKE_THREAD_LIBS_INIT "-lpthread") SET(CMAKE_HAVE_THREADS_LIBRARY 1) SET(Threads_FOUND TRUE) ENDIF() - ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*") + IF(CMAKE_SYSTEM MATCHES "SunOS.*") + # On sun also check for -lthread + CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE) + IF(CMAKE_HAVE_THR_CREATE) + SET(CMAKE_THREAD_LIBS_INIT "-lthread") + SET(CMAKE_HAVE_THREADS_LIBRARY 1) + SET(Threads_FOUND TRUE) + ENDIF() + ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*") + ENDIF(NOT CMAKE_HAVE_THREADS_LIBRARY) ENDIF(NOT THREADS_HAVE_PTHREAD_ARG) IF(NOT CMAKE_HAVE_THREADS_LIBRARY) @@ -111,7 +120,7 @@ ENDIF(CMAKE_HAVE_PTHREAD_H) ENDIF() -IF(CMAKE_THREAD_LIBS_INIT) +IF(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE) SET(CMAKE_USE_PTHREADS_INIT 1) SET(Threads_FOUND TRUE) ENDIF() diff -Nru cmake-2.8.7/Modules/FindX11.cmake cmake-2.8.9/Modules/FindX11.cmake --- cmake-2.8.7/Modules/FindX11.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindX11.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -20,7 +20,7 @@ # X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND # X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND # X11_xf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_xf86misc_FOUND -# X11_xf86vmode_INCLUDE_PATH, X11_xf86vmode_FOUND +# X11_xf86vmode_INCLUDE_PATH, X11_Xxf86vm_LIB X11_xf86vmode_FOUND # X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND # X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND # X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND @@ -29,6 +29,7 @@ # X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND # X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND # X11_Xkbfile_INCLUDE_PATH, X11_Xkbfile_LIB, X11_Xkbfile_FOUND +# X11_Xmu_INCLUDE_PATH, X11_Xmu_LIB, X11_Xmu_FOUND # X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND # X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND # X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND @@ -103,6 +104,7 @@ FIND_PATH(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xpm_INCLUDE_PATH X11/xpm.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h ${X11_INC_SEARCH_PATH}) @@ -134,6 +136,7 @@ FIND_LIBRARY(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xinput_LIB Xi ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xmu_LIB Xmu ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xrandr_LIB Xrandr ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH}) @@ -143,6 +146,7 @@ FIND_LIBRARY(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xv_LIB Xv ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xxf86misc_LIB Xxf86misc ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xxf86vm_LIB Xxf86vm ${X11_LIB_SEARCH_PATH}) SET(X11_LIBRARY_DIR "") IF(X11_X11_LIB) @@ -267,10 +271,10 @@ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH}) ENDIF (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB) - IF (X11_xf86vmode_INCLUDE_PATH) + IF (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB) SET(X11_xf86vmode_FOUND TRUE) SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH}) - ENDIF (X11_xf86vmode_INCLUDE_PATH) + ENDIF (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB) IF (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB) SET(X11_Xcursor_FOUND TRUE) @@ -297,6 +301,11 @@ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} ) ENDIF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH) + IF (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB) + SET(X11_Xmu_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH}) + ENDIF (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB) + IF (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB) SET(X11_Xinput_FOUND TRUE) SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH}) @@ -435,6 +444,7 @@ X11_XRes_INCLUDE_PATH X11_Xxf86misc_LIB X11_xf86misc_INCLUDE_PATH + X11_Xxf86vm_LIB X11_xf86vmode_INCLUDE_PATH X11_Xi_LIB X11_Xi_INCLUDE_PATH @@ -456,6 +466,8 @@ X11_Xkblib_INCLUDE_PATH X11_Xkbfile_INCLUDE_PATH X11_Xkbfile_LIB + X11_Xmu_INCLUDE_PATH + X11_Xmu_LIB X11_Xscreensaver_INCLUDE_PATH X11_Xscreensaver_LIB X11_Xpm_INCLUDE_PATH diff -Nru cmake-2.8.7/Modules/FindosgPresentation.cmake cmake-2.8.9/Modules/FindosgPresentation.cmake --- cmake-2.8.7/Modules/FindosgPresentation.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/FindosgPresentation.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,52 @@ +# This is part of the Findosg* suite used to find OpenSceneGraph components. +# Each component is separate and you must opt in to each module. You must +# also opt into OpenGL and OpenThreads (and Producer if needed) as these +# modules won't do it for you. This is to allow you control over your own +# system piece by piece in case you need to opt out of certain components +# or change the Find behavior for a particular module (perhaps because the +# default FindOpenGL.cmake module doesn't work with your system as an +# example). +# If you want to use a more convenient module that includes everything, +# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules. +# +# Locate osgPresentation +# This module defines +# +# OSGPRESENTATION_FOUND - Was osgPresentation found? +# OSGPRESENTATION_INCLUDE_DIR - Where to find the headers +# OSGPRESENTATION_LIBRARIES - The libraries to link for osgPresentation (use this) +# +# OSGPRESENTATION_LIBRARY - The osgPresentation library +# OSGPRESENTATION_LIBRARY_DEBUG - The osgPresentation debug library +# +# $OSGDIR is an environment variable that would +# correspond to the ./configure --prefix=$OSGDIR +# used in building osg. +# +# Created by Eric Wing. +# Modified to work with osgPresentation by Robert Osfield, January 2012. + +#============================================================================= +# Copyright 2007-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# Header files are presumed to be included like +# #include +# #include + +include(Findosg_functions) +OSG_FIND_PATH (OSGPRESENTATION osgPresentation/SlideEventHandler) +OSG_FIND_LIBRARY(OSGPRESENTATION osgPresentation) + +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgPresentation DEFAULT_MSG + OSGPRESENTATION_LIBRARY OSGPRESENTATION_INCLUDE_DIR) diff -Nru cmake-2.8.7/Modules/FindosgQt.cmake cmake-2.8.9/Modules/FindosgQt.cmake --- cmake-2.8.7/Modules/FindosgQt.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/FindosgQt.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,52 @@ +# This is part of the Findosg* suite used to find OpenSceneGraph components. +# Each component is separate and you must opt in to each module. You must +# also opt into OpenGL and OpenThreads (and Producer if needed) as these +# modules won't do it for you. This is to allow you control over your own +# system piece by piece in case you need to opt out of certain components +# or change the Find behavior for a particular module (perhaps because the +# default FindOpenGL.cmake module doesn't work with your system as an +# example). +# If you want to use a more convenient module that includes everything, +# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules. +# +# Locate osgQt +# This module defines +# +# OSGQT_FOUND - Was osgQt found? +# OSGQT_INCLUDE_DIR - Where to find the headers +# OSGQT_LIBRARIES - The libraries to link for osgQt (use this) +# +# OSGQT_LIBRARY - The osgQt library +# OSGQT_LIBRARY_DEBUG - The osgQt debug library +# +# $OSGDIR is an environment variable that would +# correspond to the ./configure --prefix=$OSGDIR +# used in building osg. +# +# Created by Eric Wing. +# Modified to work with osgQt by Robert Osfield, January 2012. + +#============================================================================= +# Copyright 2007-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# Header files are presumed to be included like +# #include +# #include + +include(Findosg_functions) +OSG_FIND_PATH (OSGQT osgQt/GraphicsWindowQt) +OSG_FIND_LIBRARY(OSGQT osgQt) + +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgQt DEFAULT_MSG + OSGQT_LIBRARY OSGQT_INCLUDE_DIR) diff -Nru cmake-2.8.7/Modules/FindwxWidgets.cmake cmake-2.8.9/Modules/FindwxWidgets.cmake --- cmake-2.8.7/Modules/FindwxWidgets.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindwxWidgets.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -167,9 +167,9 @@ # 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. @@ -312,7 +312,7 @@ # Find wxWidgets multilib libraries. FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext - stc ribbon propgrid) + stc ribbon propgrid webview) FIND_LIBRARY(WX_${LIB}${_DBG} NAMES wxmsw${_UNV}29${_UCD}${_DBG}_${LIB} diff -Nru cmake-2.8.7/Modules/FindwxWindows.cmake cmake-2.8.9/Modules/FindwxWindows.cmake --- cmake-2.8.7/Modules/FindwxWindows.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/FindwxWindows.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -139,7 +139,7 @@ ## 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 -Nru cmake-2.8.7/Modules/GNUInstallDirs.cmake cmake-2.8.9/Modules/GNUInstallDirs.cmake --- cmake-2.8.7/Modules/GNUInstallDirs.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/GNUInstallDirs.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -11,7 +11,7 @@ # SYSCONFDIR - read-only single-machine data (etc) # SHAREDSTATEDIR - modifiable architecture-independent data (com) # LOCALSTATEDIR - modifiable single-machine data (var) -# LIBDIR - object code libraries (lib or lib64) +# LIBDIR - object code libraries (lib or lib64 or lib/ on Debian) # INCLUDEDIR - C header files (include) # OLDINCLUDEDIR - C header files for non-gcc (/usr/include) # DATAROOTDIR - read-only architecture-independent data root (share) @@ -75,18 +75,24 @@ # - we are NOT on debian # - we are on a 64 bits system # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf - # Note that the future of multi-arch handling may be even - # more complicated than that: http://wiki.debian.org/Multiarch + # For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if + # CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu" + # See http://wiki.debian.org/Multiarch if(CMAKE_SYSTEM_NAME MATCHES "Linux" - AND NOT CMAKE_CROSSCOMPILING - AND NOT EXISTS "/etc/debian_version") - if(NOT DEFINED CMAKE_SIZEOF_VOID_P) - message(AUTHOR_WARNING - "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. " - "Please enable at least one language before including GNUInstallDirs.") - else() - if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") - set(_LIBDIR_DEFAULT "lib64") + AND NOT CMAKE_CROSSCOMPILING) + if (EXISTS "/etc/debian_version") # is this a debian system ? + if(CMAKE_LIBRARY_ARCHITECTURE) + set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}") + endif() + else() # not debian, rely on CMAKE_SIZEOF_VOID_P: + if(NOT DEFINED CMAKE_SIZEOF_VOID_P) + message(AUTHOR_WARNING + "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. " + "Please enable at least one language before including GNUInstallDirs.") + else() + if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") + set(_LIBDIR_DEFAULT "lib64") + endif() endif() endif() endif() diff -Nru cmake-2.8.7/Modules/GenerateExportHeader.cmake cmake-2.8.9/Modules/GenerateExportHeader.cmake --- cmake-2.8.7/Modules/GenerateExportHeader.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/GenerateExportHeader.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -18,7 +18,7 @@ # [PREFIX_NAME ] # ) # -# ADD_COMPILER_EXPORT_FLAGS( [FATAL_WARNINGS] ) +# ADD_COMPILER_EXPORT_FLAGS( [] ) # # By default GENERATE_EXPORT_HEADER() generates macro names in a file name # determined by the name of the library. The ADD_COMPILER_EXPORT_FLAGS function @@ -149,46 +149,20 @@ macro(_check_cxx_compiler_attribute _ATTRIBUTE _RESULT) check_cxx_source_compiles("${_ATTRIBUTE} int somefunc() { return 0; } int main() { return somefunc();}" ${_RESULT} - # Some compilers do not fail with a bad flag - FAIL_REGEX "unrecognized .*option" # GNU - FAIL_REGEX "ignoring unknown option" # MSVC - FAIL_REGEX "warning D9002" # MSVC, any lang - FAIL_REGEX "[Uu]nknown option" # HP - FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro - FAIL_REGEX "command option .* is not recognized" # XL ) endmacro() macro(_test_compiler_hidden_visibility) - if(CMAKE_COMPILER_IS_GNUCXX) - exec_program(${CMAKE_C_COMPILER} ARGS --version - OUTPUT_VARIABLE _gcc_version_info) - string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]" - _gcc_version "${_gcc_version_info}") - # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the - # patch level, handle this here: - if(NOT _gcc_version) - string(REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" - _gcc_version "${_gcc_version_info}") - endif() - - if(${_gcc_version} VERSION_LESS "4.2") - set(GCC_TOO_OLD TRUE) - message(WARNING "GCC version older than 4.2") - endif() - endif() - - if(CMAKE_CXX_COMPILER_ID MATCHES Intel) - exec_program(${CMAKE_CXX_COMPILER} ARGS -V - OUTPUT_VARIABLE _intel_version_info) - string(REGEX REPLACE ".*Version ([0-9]+(\\.[0-9]+)+).*" "\\1" - _intel_version "${_intel_version_info}") - - if(${_intel_version} VERSION_LESS "12.0") - set(_INTEL_TOO_OLD TRUE) - message(WARNING "Intel compiler older than 12.0") - endif() + if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.2") + set(GCC_TOO_OLD TRUE) + message(WARNING "GCC version older than 4.2") + elseif(CMAKE_COMPILER_IS_GNUC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "4.2") + set(GCC_TOO_OLD TRUE) + message(WARNING "GCC version older than 4.2") + elseif(CMAKE_CXX_COMPILER_ID MATCHES Intel AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.0") + set(_INTEL_TOO_OLD TRUE) + message(WARNING "Intel compiler older than 12.0") endif() @@ -298,7 +272,7 @@ set(EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_EXPORT_MACRO_NAME}) endif() if(_GEH_EXPORT_FILE_NAME) - if(IS_ABSOLUTE _GEH_EXPORT_FILE_NAME) + if(IS_ABSOLUTE ${_GEH_EXPORT_FILE_NAME}) set(EXPORT_FILE_NAME ${_GEH_EXPORT_FILE_NAME}) else() set(EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/${_GEH_EXPORT_FILE_NAME}") diff -Nru cmake-2.8.7/Modules/GetPrerequisites.cmake cmake-2.8.9/Modules/GetPrerequisites.cmake --- cmake-2.8.7/Modules/GetPrerequisites.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/GetPrerequisites.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -195,6 +195,14 @@ return() endif("${file_ov}" MATCHES "text") endif("${file_ov}" MATCHES "executable") + + # Also detect position independent executables on Linux, + # where "file" gives "shared object ... (uses shared libraries)" + if("${file_ov}" MATCHES "shared object.*\(uses shared libs\)") + set(${result_var} 1 PARENT_SCOPE) + return() + endif() + else(file_cmd) message(STATUS "warning: No 'file' command, skipping execute_process...") endif(file_cmd) @@ -304,6 +312,26 @@ endif(NOT resolved) if(NOT resolved) + if(item MATCHES "@rpath") + # + # @rpath references are relative to the paths built into the binaries with -rpath + # We handle this case like we do for other Unixes + # + string(REPLACE "@rpath/" "" norpath_item "${item}") + + set(ri "ri-NOTFOUND") + find_file(ri "${norpath_item}" ${exepath} ${dirs} NO_DEFAULT_PATH) + if(ri) + #message(STATUS "info: 'find_file' in exepath/dirs (${ri})") + set(resolved 1) + set(resolved_item "${ri}") + set(ri "ri-NOTFOUND") + endif(ri) + + endif(item MATCHES "@rpath") + endif(NOT resolved) + + if(NOT resolved) set(ri "ri-NOTFOUND") find_file(ri "${item}" ${exepath} ${dirs} NO_DEFAULT_PATH) find_file(ri "${item}" ${exepath} ${dirs} /usr/lib) @@ -461,6 +489,15 @@ get_filename_component(path "${lower}" PATH) if("${original_path}" STREQUAL "${path}") set(is_local 1) + else() + string(LENGTH "${original_path}/" original_length) + string(LENGTH "${lower}" path_length) + if(${path_length} GREATER ${original_length}) + string(SUBSTRING "${lower}" 0 ${original_length} path) + if("${original_path}/" STREQUAL "${path}") + set(is_embedded 1) + endif() + endif() endif() endif() endif() diff -Nru cmake-2.8.7/Modules/NSIS.template.in cmake-2.8.9/Modules/NSIS.template.in --- cmake-2.8.7/Modules/NSIS.template.in 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/NSIS.template.in 2012-08-09 18:15:19.000000000 +0000 @@ -637,6 +637,7 @@ ;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 @@ ; "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" @@ -922,12 +945,12 @@ Pop $0 UserInfo::GetAccountType Pop $1 - StrCmp $1 "Admin" 0 +3 + StrCmp $1 "Admin" 0 +4 SetShellVarContext all ;MessageBox MB_OK 'User "$0" is in the Admin group' StrCpy $SV_ALLUSERS "AllUsers" Goto done - StrCmp $1 "Power" 0 +3 + StrCmp $1 "Power" 0 +4 SetShellVarContext all ;MessageBox MB_OK 'User "$0" is in the Power Users group' StrCpy $SV_ALLUSERS "AllUsers" diff -Nru cmake-2.8.7/Modules/Platform/AIX-GNU-ASM.cmake cmake-2.8.9/Modules/Platform/AIX-GNU-ASM.cmake --- cmake-2.8.7/Modules/Platform/AIX-GNU-ASM.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/AIX-GNU-ASM.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,2 @@ +include(Platform/AIX-GNU) +__aix_compiler_gnu(ASM) diff -Nru cmake-2.8.7/Modules/Platform/AIX-GNU.cmake cmake-2.8.9/Modules/Platform/AIX-GNU.cmake --- cmake-2.8.7/Modules/Platform/AIX-GNU.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/AIX-GNU.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -21,5 +21,6 @@ macro(__aix_compiler_gnu lang) set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:") set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") - set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,-G") + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,-G,-brtl,-bnoipath") + set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib endmacro() diff -Nru cmake-2.8.7/Modules/Platform/BeOS.cmake cmake-2.8.9/Modules/Platform/BeOS.cmake --- cmake-2.8.7/Modules/Platform/BeOS.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/BeOS.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/Platform/BlueGeneP-base.cmake cmake-2.8.9/Modules/Platform/BlueGeneP-base.cmake --- cmake-2.8.7/Modules/Platform/BlueGeneP-base.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/BlueGeneP-base.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -85,11 +85,15 @@ 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 -Nru cmake-2.8.7/Modules/Platform/CYGWIN-GNU.cmake cmake-2.8.9/Modules/Platform/CYGWIN-GNU.cmake --- cmake-2.8.7/Modules/Platform/CYGWIN-GNU.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/CYGWIN-GNU.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -35,7 +35,10 @@ 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 -Nru cmake-2.8.7/Modules/Platform/Darwin-icc.cmake cmake-2.8.9/Modules/Platform/Darwin-icc.cmake --- cmake-2.8.7/Modules/Platform/Darwin-icc.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Darwin-icc.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -84,11 +84,11 @@ 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 @@ # 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 @@ /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 @@ 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 -Nru cmake-2.8.7/Modules/Platform/Darwin.cmake cmake-2.8.9/Modules/Platform/Darwin.cmake --- cmake-2.8.7/Modules/Platform/Darwin.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Darwin.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -6,6 +6,8 @@ # 8.x == Mac OSX 10.4 (Tiger) # 9.x == Mac OSX 10.5 (Leopard) # 10.x == Mac OSX 10.6 (Snow Leopard) +# 11.x == Mac OSX 10.7 (Lion) +# 12.x == Mac OSX 10.8 (Mountain Lion) STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_SYSTEM_VERSION}") STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\2" DARWIN_MINOR_VERSION "${CMAKE_SYSTEM_VERSION}") @@ -54,24 +56,31 @@ # hardcode CMAKE_INSTALL_NAME_TOOL here to install_name_tool, so it behaves as it did before, Alex IF(NOT DEFINED CMAKE_INSTALL_NAME_TOOL) FIND_PROGRAM(CMAKE_INSTALL_NAME_TOOL install_name_tool) + MARK_AS_ADVANCED(CMAKE_INSTALL_NAME_TOOL) ENDIF(NOT DEFINED CMAKE_INSTALL_NAME_TOOL) # Set the assumed (Pre 10.5 or Default) location of the developer tools SET(OSX_DEVELOPER_ROOT "/Developer") +# Use the xcode-select tool if it's available (Xcode >= 3.0 installations) +FIND_PROGRAM(CMAKE_XCODE_SELECT xcode-select) +MARK_AS_ADVANCED(CMAKE_XCODE_SELECT) +IF(CMAKE_XCODE_SELECT) + EXECUTE_PROCESS(COMMAND ${CMAKE_XCODE_SELECT} "-print-path" + OUTPUT_VARIABLE OSX_DEVELOPER_ROOT + OUTPUT_STRIP_TRAILING_WHITESPACE) +ENDIF(CMAKE_XCODE_SELECT) + # Find installed SDKs -FILE(GLOB _CMAKE_OSX_SDKS "${OSX_DEVELOPER_ROOT}/SDKs/*") +# Start with Xcode-4.3+ default SDKs directory +SET(_CMAKE_OSX_SDKS_DIR + "${OSX_DEVELOPER_ROOT}/Platforms/MacOSX.platform/Developer/SDKs") +FILE(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*") -# If nothing is found there, then try locating the dev tools based on the xcode-select tool -# (available in Xcode >= 3.0 installations) +# If not present, try pre-4.3 SDKs directory IF(NOT _CMAKE_OSX_SDKS) - FIND_PROGRAM(CMAKE_XCODE_SELECT xcode-select) - IF(CMAKE_XCODE_SELECT) - EXECUTE_PROCESS(COMMAND ${CMAKE_XCODE_SELECT} "-print-path" - OUTPUT_VARIABLE OSX_DEVELOPER_ROOT - OUTPUT_STRIP_TRAILING_WHITESPACE) - FILE(GLOB _CMAKE_OSX_SDKS "${OSX_DEVELOPER_ROOT}/SDKs/*") - ENDIF(CMAKE_XCODE_SELECT) +SET(_CMAKE_OSX_SDKS_DIR "${OSX_DEVELOPER_ROOT}/SDKs") + FILE(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*") ENDIF(NOT _CMAKE_OSX_SDKS) EXECUTE_PROCESS(COMMAND sw_vers -productVersion @@ -103,16 +112,16 @@ # Set CMAKE_OSX_SYSROOT_DEFAULT based on _CURRENT_OSX_VERSION, # accounting for the known specially named SDKs. SET(CMAKE_OSX_SYSROOT_DEFAULT - "${OSX_DEVELOPER_ROOT}/SDKs/MacOSX${_CURRENT_OSX_VERSION}.sdk") + "${_CMAKE_OSX_SDKS_DIR}/MacOSX${_CURRENT_OSX_VERSION}.sdk") IF(_CURRENT_OSX_VERSION STREQUAL "10.4") SET(CMAKE_OSX_SYSROOT_DEFAULT - "${OSX_DEVELOPER_ROOT}/SDKs/MacOSX10.4u.sdk") + "${_CMAKE_OSX_SDKS_DIR}/MacOSX10.4u.sdk") ENDIF(_CURRENT_OSX_VERSION STREQUAL "10.4") IF(_CURRENT_OSX_VERSION STREQUAL "10.3") SET(CMAKE_OSX_SYSROOT_DEFAULT - "${OSX_DEVELOPER_ROOT}/SDKs/MacOSX10.3.9.sdk") + "${_CMAKE_OSX_SDKS_DIR}/MacOSX10.3.9.sdk") ENDIF(_CURRENT_OSX_VERSION STREQUAL "10.3") # Use environment or default as initial cache value: @@ -198,11 +207,11 @@ 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 ") @@ -214,14 +223,15 @@ " -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 @@ -230,12 +240,26 @@ /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 + "~/Applications" + "/Applications" + "${OSX_DEVELOPER_ROOT}/../Applications" # Xcode 4.3+ + "${OSX_DEVELOPER_ROOT}/Applications" # pre-4.3 + ) + GET_FILENAME_COMPONENT(_apps "${_path}" ABSOLUTE) + IF(EXISTS "${_apps}") + LIST(APPEND _apps_paths "${_apps}") + ENDIF() +ENDFOREACH() +LIST(REMOVE_DUPLICATES _apps_paths) SET(CMAKE_SYSTEM_APPBUNDLE_PATH - ~/Applications - /Applications - /Developer/Applications) + ${_apps_paths}) +UNSET(_apps_paths) INCLUDE(Platform/UnixPaths) LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH diff -Nru cmake-2.8.7/Modules/Platform/FreeBSD.cmake cmake-2.8.9/Modules/Platform/FreeBSD.cmake --- cmake-2.8.7/Modules/Platform/FreeBSD.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/FreeBSD.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/Platform/HP-UX-HP.cmake cmake-2.8.9/Modules/Platform/HP-UX-HP.cmake --- cmake-2.8.7/Modules/Platform/HP-UX-HP.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/HP-UX-HP.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -19,6 +19,7 @@ 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 -Nru cmake-2.8.7/Modules/Platform/Haiku.cmake cmake-2.8.9/Modules/Platform/Haiku.cmake --- cmake-2.8.7/Modules/Platform/Haiku.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Haiku.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/Platform/Linux-Intel.cmake cmake-2.8.9/Modules/Platform/Linux-Intel.cmake --- cmake-2.8.7/Modules/Platform/Linux-Intel.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Linux-Intel.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -31,6 +31,8 @@ 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 -Nru cmake-2.8.7/Modules/Platform/Linux-PGI.cmake cmake-2.8.9/Modules/Platform/Linux-PGI.cmake --- cmake-2.8.7/Modules/Platform/Linux-PGI.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Linux-PGI.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -20,6 +20,8 @@ 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 -Nru cmake-2.8.7/Modules/Platform/Linux-PathScale.cmake cmake-2.8.9/Modules/Platform/Linux-PathScale.cmake --- cmake-2.8.7/Modules/Platform/Linux-PathScale.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Linux-PathScale.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -20,6 +20,8 @@ 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 -Nru cmake-2.8.7/Modules/Platform/MP-RAS.cmake cmake-2.8.9/Modules/Platform/MP-RAS.cmake --- cmake-2.8.7/Modules/Platform/MP-RAS.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/MP-RAS.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/Platform/NetBSD.cmake cmake-2.8.9/Modules/Platform/NetBSD.cmake --- cmake-2.8.7/Modules/Platform/NetBSD.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/NetBSD.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/Platform/OSF1.cmake cmake-2.8.9/Modules/Platform/OSF1.cmake --- cmake-2.8.7/Modules/Platform/OSF1.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/OSF1.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -4,7 +4,9 @@ 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 -Nru cmake-2.8.7/Modules/Platform/SINIX.cmake cmake-2.8.9/Modules/Platform/SINIX.cmake --- cmake-2.8.7/Modules/Platform/SINIX.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/SINIX.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/Platform/SunOS.cmake cmake-2.8.9/Modules/Platform/SunOS.cmake --- cmake-2.8.7/Modules/Platform/SunOS.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/SunOS.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 @@ 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 -Nru cmake-2.8.7/Modules/Platform/UNIX_SV.cmake cmake-2.8.9/Modules/Platform/UNIX_SV.cmake --- cmake-2.8.7/Modules/Platform/UNIX_SV.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/UNIX_SV.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/Platform/UnixWare.cmake cmake-2.8.9/Modules/Platform/UnixWare.cmake --- cmake-2.8.7/Modules/Platform/UnixWare.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/UnixWare.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/Platform/Windows-Borland-C.cmake cmake-2.8.9/Modules/Platform/Windows-Borland-C.cmake --- cmake-2.8.7/Modules/Platform/Windows-Borland-C.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Windows-Borland-C.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,2 +1 @@ -include(Platform/Windows-Borland) -__borland_language(C) +include(Platform/Windows-Embarcadero-C) diff -Nru cmake-2.8.7/Modules/Platform/Windows-Borland-CXX.cmake cmake-2.8.9/Modules/Platform/Windows-Borland-CXX.cmake --- cmake-2.8.7/Modules/Platform/Windows-Borland-CXX.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Windows-Borland-CXX.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,2 +1 @@ -include(Platform/Windows-Borland) -__borland_language(CXX) +include(Platform/Windows-Embarcadero-CXX) diff -Nru cmake-2.8.7/Modules/Platform/Windows-Borland.cmake cmake-2.8.9/Modules/Platform/Windows-Borland.cmake --- cmake-2.8.7/Modules/Platform/Windows-Borland.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Windows-Borland.cmake 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ - -#============================================================================= -# Copyright 2002-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -# This module is shared by multiple languages; use include blocker. -if(__WINDOWS_BORLAND) - return() -endif() -set(__WINDOWS_BORLAND 1) - -SET(BORLAND 1) - -# Borland target type flags (bcc32 -h -t): -# -tW GUI App (implies -U__CONSOLE__) -# -tWC Console App (implies -D__CONSOLE__=1) -# -tWD Build a DLL (implies -D__DLL__=1 -D_DLL=1) -# -tWM Enable threads (implies -D__MT__=1 -D_MT=1) -# -tWR Use DLL runtime (implies -D_RTLDLL, and '-tW' too!!) -# -# Notes: -# - The flags affect linking so we pass them to the linker. -# - The flags affect preprocessing so we pass them to the compiler. -# - Since '-tWR' implies '-tW' we use '-tWR -tW-' instead. -# - Since '-tW-' disables '-tWD' we use '-tWR -tW- -tWD' for DLLs. -set(_RTLDLL "-tWR -tW-") -set(_COMPILE_C "-c") -set(_COMPILE_CXX "-P -c") - -SET(CMAKE_LIBRARY_PATH_FLAG "-L") -SET(CMAKE_LINK_LIBRARY_FLAG "") - -SET(CMAKE_FIND_LIBRARY_SUFFIXES "-bcc.lib" ".lib") - -# uncomment these out to debug makefiles -#SET(CMAKE_START_TEMP_FILE "") -#SET(CMAKE_END_TEMP_FILE "") -#SET(CMAKE_VERBOSE_MAKEFILE 1) - -# Borland cannot handle + in the file name, so mangle object file name -SET (CMAKE_MANGLE_OBJECT_FILE_NAMES "ON") - -# extra flags for a win32 exe -SET(CMAKE_CREATE_WIN32_EXE "-tW" ) -# extra flags for a console app -SET(CMAKE_CREATE_CONSOLE_EXE "-tWC" ) - -SET (CMAKE_BUILD_TYPE Debug CACHE STRING - "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.") - -SET (CMAKE_EXE_LINKER_FLAGS_INIT "-tWM -lS:10000000 -lSc:10000000 ") -SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "-v") -SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "-v") -SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT}) -SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT}) -SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT}) -SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT}) -SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT}) -SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT}) - -macro(__borland_language lang) - set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-tWD") - - # compile a source file into an object file - # place outside the response file because Borland refuses - # to parse quotes from the response file. - set(CMAKE_${lang}_COMPILE_OBJECT - " ${_RTLDLL} ${CMAKE_START_TEMP_FILE}-DWIN32 -o ${_COMPILE_${lang}} ${CMAKE_END_TEMP_FILE}" - ) - - set(CMAKE_${lang}_LINK_EXECUTABLE - " ${_RTLDLL} -e ${CMAKE_START_TEMP_FILE} ${CMAKE_END_TEMP_FILE}" - # "implib -c -w " - ) - - # place outside the response file because Borland refuses - # to parse quotes from the response file. - set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE - "cpp32 ${CMAKE_START_TEMP_FILE}-DWIN32 -o ${_COMPILE_${lang}} ${CMAKE_END_TEMP_FILE}" - ) - # Borland >= 5.6 allows -P option for cpp32, <= 5.5 does not - - # Create a module library. - set(CMAKE_${lang}_CREATE_SHARED_MODULE - " ${_RTLDLL} -tWD ${CMAKE_START_TEMP_FILE}-e ${CMAKE_END_TEMP_FILE}" - ) - - # Create an import library for another target. - set(CMAKE_${lang}_CREATE_IMPORT_LIBRARY - "implib -c -w " - ) - - # Create a shared library. - # First create a module and then its import library. - set(CMAKE_${lang}_CREATE_SHARED_LIBRARY - ${CMAKE_${lang}_CREATE_SHARED_MODULE} - ${CMAKE_${lang}_CREATE_IMPORT_LIBRARY} - ) - - # create a static library - set(CMAKE_${lang}_CREATE_STATIC_LIBRARY - "tlib ${CMAKE_START_TEMP_FILE}/p512 /a ${CMAKE_END_TEMP_FILE}" - ) - - # Initial configuration flags. - set(CMAKE_${lang}_FLAGS_INIT "-tWM") - set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-Od -v") - set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-O1 -DNDEBUG") - set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-O2 -DNDEBUG") - set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-Od") - set(CMAKE_${lang}_STANDARD_LIBRARIES_INIT "import32.lib") -endmacro() diff -Nru cmake-2.8.7/Modules/Platform/Windows-Embarcadero-C.cmake cmake-2.8.9/Modules/Platform/Windows-Embarcadero-C.cmake --- cmake-2.8.7/Modules/Platform/Windows-Embarcadero-C.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Windows-Embarcadero-C.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,3 @@ +set(_lang C) +include(Platform/Windows-Embarcadero) +__embarcadero_language(C) diff -Nru cmake-2.8.7/Modules/Platform/Windows-Embarcadero-CXX.cmake cmake-2.8.9/Modules/Platform/Windows-Embarcadero-CXX.cmake --- cmake-2.8.7/Modules/Platform/Windows-Embarcadero-CXX.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Windows-Embarcadero-CXX.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,3 @@ +set(_lang CXX) +include(Platform/Windows-Embarcadero) +__embarcadero_language(CXX) diff -Nru cmake-2.8.7/Modules/Platform/Windows-Embarcadero.cmake cmake-2.8.9/Modules/Platform/Windows-Embarcadero.cmake --- cmake-2.8.7/Modules/Platform/Windows-Embarcadero.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Windows-Embarcadero.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,130 @@ + +#============================================================================= +# Copyright 2002-2012 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# This module is shared by multiple languages; use include blocker. +if(__WINDOWS_EMBARCADERO) + return() +endif() +set(__WINDOWS_EMBARCADERO 1) + +SET(BORLAND 1) + +if("${CMAKE_${_lang}_COMPILER_VERSION}" VERSION_LESS 6.30) + # Borland target type flags (bcc32 -h -t): + set(_tW "-tW") # -tW GUI App (implies -U__CONSOLE__) + set(_tC "-tWC") # -tWC Console App (implies -D__CONSOLE__=1) + set(_tD "-tWD") # -tWD Build a DLL (implies -D__DLL__=1 -D_DLL=1) + set(_tM "-tWM") # -tWM Enable threads (implies -D__MT__=1 -D_MT=1) + set(_tR "-tWR -tW-") # -tWR Use DLL runtime (implies -D_RTLDLL, and '-tW' too!!) + # Notes: + # - The flags affect linking so we pass them to the linker. + # - The flags affect preprocessing so we pass them to the compiler. + # - Since '-tWR' implies '-tW' we use '-tWR -tW-' instead. + # - Since '-tW-' disables '-tWD' we use '-tWR -tW- -tWD' for DLLs. +else() + set(EMBARCADERO 1) + set(_tC "-tC") # Target is a console application + set(_tD "-tD") # Target is a shared library + set(_tM "-tM") # Target is multi-threaded + set(_tR "-tR") # Target uses the dynamic RTL + set(_tW "-tW") # Target is a Windows application +endif() +set(_COMPILE_C "-c") +set(_COMPILE_CXX "-P -c") + +SET(CMAKE_LIBRARY_PATH_FLAG "-L") +SET(CMAKE_LINK_LIBRARY_FLAG "") + +SET(CMAKE_FIND_LIBRARY_SUFFIXES "-bcc.lib" ".lib") + +# uncomment these out to debug makefiles +#SET(CMAKE_START_TEMP_FILE "") +#SET(CMAKE_END_TEMP_FILE "") +#SET(CMAKE_VERBOSE_MAKEFILE 1) + +# Borland cannot handle + in the file name, so mangle object file name +SET (CMAKE_MANGLE_OBJECT_FILE_NAMES "ON") + +# extra flags for a win32 exe +SET(CMAKE_CREATE_WIN32_EXE "${_tW}" ) +# extra flags for a console app +SET(CMAKE_CREATE_CONSOLE_EXE "${_tC}" ) + +SET (CMAKE_BUILD_TYPE Debug CACHE STRING + "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.") + +SET (CMAKE_EXE_LINKER_FLAGS_INIT "${_tM} -lS:10000000 -lSc:10000000 ") +SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "-v") +SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "-v") +SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT}) +SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT}) +SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT}) +SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT}) +SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT}) +SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT}) + + +macro(__embarcadero_language lang) + 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 + # to parse quotes from the response file. + set(CMAKE_${lang}_COMPILE_OBJECT + " ${_tR} ${CMAKE_START_TEMP_FILE}-DWIN32 -o ${_COMPILE_${lang}} ${CMAKE_END_TEMP_FILE}" + ) + + set(CMAKE_${lang}_LINK_EXECUTABLE + " ${_tR} -e ${CMAKE_START_TEMP_FILE} ${CMAKE_END_TEMP_FILE}" + # "implib -c -w " + ) + + # place outside the response file because Borland refuses + # to parse quotes from the response file. + set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE + "cpp32 ${CMAKE_START_TEMP_FILE}-DWIN32 -o ${_COMPILE_${lang}} ${CMAKE_END_TEMP_FILE}" + ) + # Borland >= 5.6 allows -P option for cpp32, <= 5.5 does not + + # Create a module library. + set(CMAKE_${lang}_CREATE_SHARED_MODULE + " ${_tR} ${_tD} ${CMAKE_START_TEMP_FILE}-e ${CMAKE_END_TEMP_FILE}" + ) + + # Create an import library for another target. + set(CMAKE_${lang}_CREATE_IMPORT_LIBRARY + "implib -c -w " + ) + + # Create a shared library. + # First create a module and then its import library. + set(CMAKE_${lang}_CREATE_SHARED_LIBRARY + ${CMAKE_${lang}_CREATE_SHARED_MODULE} + ${CMAKE_${lang}_CREATE_IMPORT_LIBRARY} + ) + + # create a static library + set(CMAKE_${lang}_CREATE_STATIC_LIBRARY + "tlib ${CMAKE_START_TEMP_FILE}/p512 /a ${CMAKE_END_TEMP_FILE}" + ) + + # Initial configuration flags. + set(CMAKE_${lang}_FLAGS_INIT "${_tM}") + set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-Od -v") + set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-O1 -DNDEBUG") + set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-O2 -DNDEBUG") + set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-Od") + set(CMAKE_${lang}_STANDARD_LIBRARIES_INIT "import32.lib") +endmacro() diff -Nru cmake-2.8.7/Modules/Platform/Windows-GNU.cmake cmake-2.8.9/Modules/Platform/Windows-GNU.cmake --- cmake-2.8.7/Modules/Platform/Windows-GNU.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Windows-GNU.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -77,7 +77,11 @@ 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) @@ -111,7 +115,9 @@ list(APPEND CMAKE_${lang}_ABI_FILES "Platform/Windows-GNU-${lang}-ABI") # Support very long lists of object files. - if("${CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG}" STREQUAL "@") + # TODO: check for which gcc versions this is still needed, not needed for gcc >= 4.4. + # Ninja generator doesn't support this work around. + if("${CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG}" STREQUAL "@" AND NOT CMAKE_GENERATOR MATCHES "Ninja") foreach(rule CREATE_SHARED_MODULE CREATE_SHARED_LIBRARY LINK_EXECUTABLE) # The gcc/collect2/ld toolchain does not use response files # internally so we cannot pass long object lists. Instead pass diff -Nru cmake-2.8.7/Modules/Platform/Windows-Intel-CXX.cmake cmake-2.8.9/Modules/Platform/Windows-Intel-CXX.cmake --- cmake-2.8.7/Modules/Platform/Windows-Intel-CXX.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Windows-Intel-CXX.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/Platform/Windows-Intel-Fortran.cmake cmake-2.8.9/Modules/Platform/Windows-Intel-Fortran.cmake --- cmake-2.8.7/Modules/Platform/Windows-Intel-Fortran.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Windows-Intel-Fortran.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -6,6 +6,6 @@ __windows_compiler_intel(Fortran) SET (CMAKE_Fortran_FLAGS_INIT "/W1 /nologo /fpp /libs:dll /threads") SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /dbglibs") -SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /D NDEBUG") -SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/O1 /D NDEBUG") -SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O1 /debug:full /D NDEBUG") +SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O1 /D NDEBUG") +SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/O2 /D NDEBUG") +SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O2 /debug:full /D NDEBUG") diff -Nru cmake-2.8.7/Modules/Platform/Windows-Intel.cmake cmake-2.8.9/Modules/Platform/Windows-Intel.cmake --- cmake-2.8.7/Modules/Platform/Windows-Intel.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Windows-Intel.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -92,7 +92,7 @@ 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 -Nru cmake-2.8.7/Modules/Platform/Windows-cl.cmake cmake-2.8.9/Modules/Platform/Windows-cl.cmake --- cmake-2.8.7/Modules/Platform/Windows-cl.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Windows-cl.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -37,7 +37,7 @@ # that is automatically copied into try_compile directories # by the global generator. SET(MSVC_IDE 1) -IF(CMAKE_GENERATOR MATCHES "Makefiles") +IF(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja") SET(MSVC_IDE 0) IF(NOT CMAKE_VC_COMPILER_TESTS_RUN) SET(CMAKE_VC_COMPILER_TESTS 1) @@ -125,7 +125,7 @@ ENDIF(CMAKE_COMPILER_RETURN) MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3") ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) -ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") +ENDIF(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja") IF(MSVC_C_ARCHITECTURE_ID MATCHES 64) SET(CMAKE_CL_64 1) diff -Nru cmake-2.8.7/Modules/Platform/Windows-wcl386.cmake cmake-2.8.9/Modules/Platform/Windows-wcl386.cmake --- cmake-2.8.7/Modules/Platform/Windows-wcl386.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/Windows-wcl386.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -20,7 +20,8 @@ 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 -Nru cmake-2.8.7/Modules/Platform/eCos.cmake cmake-2.8.9/Modules/Platform/eCos.cmake --- cmake-2.8.7/Modules/Platform/eCos.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/eCos.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,5 +1,12 @@ # support for eCos http://ecos.sourceware.org -SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic + +# Guard against multiple inclusion, which e.g. leads to multiple calls to add_definition() #12987 +IF(__ECOS_CMAKE_INCLUDED) + RETURN() +ENDIF() +SET(__ECOS_CMAKE_INCLUDED TRUE) + +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "") # -shared SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") # -rpath diff -Nru cmake-2.8.7/Modules/Platform/syllable.cmake cmake-2.8.9/Modules/Platform/syllable.cmake --- cmake-2.8.7/Modules/Platform/syllable.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Platform/syllable.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Modules/Qt4Macros.cmake cmake-2.8.9/Modules/Qt4Macros.cmake --- cmake-2.8.7/Modules/Qt4Macros.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/Qt4Macros.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -182,23 +182,31 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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) @@ -393,7 +402,13 @@ FOREACH(_pro_src ${_my_sources}) SET(_pro_srcs "${_pro_srcs} \"${_pro_src}\"") ENDFOREACH(_pro_src ${_my_sources}) - FILE(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}") + SET(_pro_includes) + GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES) + FOREACH(_pro_include ${_inc_DIRS}) + GET_FILENAME_COMPONENT(_abs_include "${_pro_include}" ABSOLUTE) + SET(_pro_includes "${_pro_includes} \"${_abs_include}\"") + ENDFOREACH(_pro_include ${CMAKE_CXX_INCLUDE_PATH}) + FILE(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}\nINCLUDEPATH = ${_pro_includes}\n") ENDIF(_my_sources) ADD_CUSTOM_COMMAND(OUTPUT ${_ts_file} COMMAND ${QT_LUPDATE_EXECUTABLE} diff -Nru cmake-2.8.7/Modules/SelectLibraryConfigurations.cmake cmake-2.8.9/Modules/SelectLibraryConfigurations.cmake --- cmake-2.8.7/Modules/SelectLibraryConfigurations.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/SelectLibraryConfigurations.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -15,7 +15,6 @@ # basename_LIBRARY and basename_LIBRARIES will take only the release values. #============================================================================= -# Copyright 2009 Kitware, Inc. # Copyright 2009 Will Dicharry # Copyright 2005-2009 Kitware, Inc. # @@ -49,7 +48,8 @@ # if only the debug version was found, set the release value to be the # debug value. _set_library_name( ${basename} DEBUG RELEASE ) - if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE ) + if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND + NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE) # if the generator supports configuration types or CMAKE_BUILD_TYPE # is set, then set optimized and debug options. if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) @@ -65,7 +65,7 @@ set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} ) endif( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) - endif( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE ) + endif() set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library" ) @@ -79,4 +79,3 @@ ${basename}_LIBRARY_DEBUG ) endmacro( select_library_configurations ) - diff -Nru cmake-2.8.7/Modules/UseJava.cmake cmake-2.8.9/Modules/UseJava.cmake --- cmake-2.8.7/Modules/UseJava.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/UseJava.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -25,6 +25,15 @@ # set(CMAKE_JAVA_TARGET_OUTPUT_NAME shibboleet.jar) # add_jar(foobar foobar.java) # +# To use a different output directory than CMAKE_CURRENT_BINARY_DIR +# you can set it with: +# +# set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin) +# +# To define an entry point in your jar you can set it with: +# +# set(CMAKE_JAVA_JAR_ENTRY_POINT com/examples/MyProject/Main) +# # To add a VERSION to the target output name you can set it using # CMAKE_JAVA_TARGET_VERSION. This will create a jar file with the name # shibboleet-1.0.0.jar and will create a symlink shibboleet.jar @@ -112,7 +121,7 @@ # [VERSION TRUE|FALSE] # ) # -# Create jave documentation based on files or packages. For more +# Create java documentation based on files or packages. For more # details please read the javadoc manpage. # # There are two main signatures for create_javadoc. The first @@ -121,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

" @@ -198,10 +207,19 @@ function(add_jar _TARGET_NAME) set(_JAVA_SOURCE_FILES ${ARGN}) + if (NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR) + set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif(NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR) + + if (CMAKE_JAVA_JAR_ENTRY_POINT) + set(_ENTRY_POINT_OPTION e) + set(_ENTRY_POINT_VALUE ${CMAKE_JAVA_JAR_ENTRY_POINT}) + endif (CMAKE_JAVA_JAR_ENTRY_POINT) + if (LIBRARY_OUTPUT_PATH) set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH}) else (LIBRARY_OUTPUT_PATH) - set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) + set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR}) endif (LIBRARY_OUTPUT_PATH) set(CMAKE_JAVA_INCLUDE_PATH @@ -221,7 +239,7 @@ set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") endforeach(JAVA_INCLUDE_DIR) - set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir") + set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_JAVA_TARGET_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir") set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}.jar") if (CMAKE_JAVA_TARGET_OUTPUT_NAME AND CMAKE_JAVA_TARGET_VERSION) @@ -246,7 +264,7 @@ get_filename_component(_JAVA_PATH ${_JAVA_SOURCE_FILE} PATH) get_filename_component(_JAVA_FULL ${_JAVA_SOURCE_FILE} ABSOLUTE) - file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${CMAKE_CURRENT_BINARY_DIR} ${_JAVA_FULL}) + file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR} ${_JAVA_FULL}) file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL}) string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN) string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN) @@ -312,20 +330,22 @@ endif (_JAVA_COMPILE_FILES) # create the jar file + set(_JAVA_JAR_OUTPUT_PATH + ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME}) if (CMAKE_JNI_TARGET) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} + OUTPUT ${_JAVA_JAR_OUTPUT_PATH} COMMAND ${Java_JAR_EXECUTABLE} - -cf ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} + -cf${_ENTRY_POINT_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE} ${_JAVA_RESOURCE_FILES} @java_class_filelist COMMAND ${CMAKE_COMMAND} - -D_JAVA_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR} + -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR} -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME} -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK} -P ${_JAVA_SYMLINK_SCRIPT} COMMAND ${CMAKE_COMMAND} - -D_JAVA_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR} - -D_JAVA_TARGET_OUTPUT_NAME=${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} + -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR} + -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_JAR_OUTPUT_PATH} -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK} -P ${_JAVA_SYMLINK_SCRIPT} DEPENDS ${_JAVA_RESOURCE_FILES} ${_JAVA_DEPENDS} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist @@ -334,12 +354,12 @@ ) else () add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} + OUTPUT ${_JAVA_JAR_OUTPUT_PATH} COMMAND ${Java_JAR_EXECUTABLE} - -cf ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} + -cf${_ENTRY_POINT_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE} ${_JAVA_RESOURCE_FILES} @java_class_filelist COMMAND ${CMAKE_COMMAND} - -D_JAVA_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR} + -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR} -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME} -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK} -P ${_JAVA_SYMLINK_SCRIPT} @@ -350,14 +370,14 @@ endif (CMAKE_JNI_TARGET) # Add the target and make sure we have the latest resource files. - add_custom_target(${_TARGET_NAME} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME}) + add_custom_target(${_TARGET_NAME} ALL DEPENDS ${_JAVA_JAR_OUTPUT_PATH}) set_property( TARGET ${_TARGET_NAME} PROPERTY INSTALL_FILES - ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} + ${_JAVA_JAR_OUTPUT_PATH} ) if (_JAVA_TARGET_OUTPUT_LINK) @@ -366,8 +386,8 @@ ${_TARGET_NAME} PROPERTY INSTALL_FILES - ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} - ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_LINK} + ${_JAVA_JAR_OUTPUT_PATH} + ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK} ) if (CMAKE_JNI_TARGET) @@ -376,7 +396,7 @@ ${_TARGET_NAME} PROPERTY JNI_SYMLINK - ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_LINK} + ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK} ) endif (CMAKE_JNI_TARGET) endif (_JAVA_TARGET_OUTPUT_LINK) @@ -386,7 +406,7 @@ ${_TARGET_NAME} PROPERTY JAR_FILE - ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} + ${_JAVA_JAR_OUTPUT_PATH} ) set_property( @@ -513,9 +533,9 @@ 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 -Nru cmake-2.8.7/Modules/UseSWIG.cmake cmake-2.8.9/Modules/UseSWIG.cmake --- cmake-2.8.7/Modules/UseSWIG.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/UseSWIG.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -47,20 +47,17 @@ SET(SWIG_MODULE_${name}_LANGUAGE "${swig_uppercase_language}") SET(SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG "${swig_lowercase_language}") - IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xUNKNOWNx$") - MESSAGE(FATAL_ERROR "SWIG Error: Language \"${language}\" not found") - ENDIF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xUNKNOWNx$") - SET(SWIG_MODULE_${name}_REAL_NAME "${name}") - IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPYTHONx$") + IF("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "UNKNOWN") + MESSAGE(FATAL_ERROR "SWIG Error: Language \"${language}\" not found") + ELSEIF("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PYTHON") # when swig is used without the -interface it will produce in the module.py # a 'import _modulename' statement, which implies having a corresponding # _modulename.so (*NIX), _modulename.pyd (Win32). SET(SWIG_MODULE_${name}_REAL_NAME "_${name}") - ENDIF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPYTHONx$") - IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPERLx$") + ELSEIF("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PERL") SET(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow") - ENDIF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPERLx$") + ENDIF() ENDMACRO(SWIG_MODULE_INITIALIZE) # diff -Nru cmake-2.8.7/Modules/WriteBasicConfigVersionFile.cmake cmake-2.8.9/Modules/WriteBasicConfigVersionFile.cmake --- cmake-2.8.7/Modules/WriteBasicConfigVersionFile.cmake 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/WriteBasicConfigVersionFile.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -1,31 +1,6 @@ # WRITE_BASIC_CONFIG_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion) ) # -# Writes a file for use as ConfigVersion.cmake file to . -# See the documentation of FIND_PACKAGE() for details on this. -# filename is the output filename, it should be in the build tree. -# major.minor.patch is the version number of the project to be installed -# The COMPATIBILITY mode AnyNewerVersion means that the installed package version -# will be considered compatible if it is newer or exactly the same as the requested version. -# If SameMajorVersion is used instead, then the behaviour differs from AnyNewerVersion -# in that the major version number must be the same as requested, e.g. version 2.0 will -# not be considered compatible if 1.0 is requested. -# If your project has more elaborated version matching rules, you will need to write your -# own custom ConfigVersion.cmake file instead of using this macro. -# -# Example: -# write_basic_config_version_file(${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake -# VERSION 1.2.3 -# COMPATIBILITY SameMajorVersion ) -# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake -# ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake -# DESTINATION lib/cmake/Foo ) -# -# Internally, this macro executes configure_file() to create the resulting -# version file. Depending on the COMPATIBLITY, either the file -# BasicConfigVersion-SameMajorVersion.cmake.in or BasicConfigVersion-AnyNewerVersion.cmake.in -# is used. Please note that these two files are internal to CMake and you should -# not call configure_file() on them yourself, but they can be used as starting -# point to create more sophisticted custom ConfigVersion.cmake files. +# Deprecated, see WRITE_BASIC_PACKAGE_VERSION_FILE(), it is identical. #============================================================================= # Copyright 2008-2011 Alexander Neundorf, diff -Nru cmake-2.8.7/Modules/readme.txt cmake-2.8.9/Modules/readme.txt --- cmake-2.8.7/Modules/readme.txt 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Modules/readme.txt 2012-08-09 18:15:19.000000000 +0000 @@ -57,7 +57,7 @@ # - This is a cool module # This module does really cool stuff. # It can do even more than you think. -# +# # It even needs to paragraphs to tell you about it. # And it defines the following variables: # VAR_COOL - this is great isn't it? @@ -119,17 +119,31 @@ REQUIRED option is given to the command it will set the variable XXX_FIND_REQUIRED to true before loading the FindXXX.cmake module. If this variable is set the module should issue a FATAL_ERROR if the -package cannot be found. For each package-specific component, say -YYY, listed after the REQUIRED option a variable XXX_FIND_REQUIRED_YYY -to true. The set of components listed after either the REQUIRED -option or the COMPONENTS option will be specified in a -XXX_FIND_COMPONENTS variable. This can be used by the FindXXX.cmake -module to determine which sub-components of the package must be found. +package cannot be found. If neither the QUIET nor REQUIRED options are given then the FindXXX.cmake module should look for the package and complain without error if the module is not found. -To get this behaviour you can use the FIND_PACKAGE_HANDLE_STANDARD_ARGS() +A package can be provide sub-components. +Those components can be listed after the COMPONENTS (or REQUIRED) +or OPTIONAL_COMPONENTS keywords. The set of all listed components will be +specified in a XXX_FIND_COMPONENTS variable. +For each package-specific component, say Yyy, a variable XXX_FIND_REQUIRED_Yyy +will be set to true if it listed after COMPONENTS and it will be set to false +if it was listed after OPTIONAL_COMPONENTS. +Using those variables a FindXXX.cmake module and also a XXXConfig.cmake package +configuration file can determine whether and which components have been requested, +and whether they were requested as required or as optional. +For each of the requested components a XXX_Yyy_FOUND variable should be set +accordingly. +The per-package XXX_FOUND variable should be only set to true if all requested +required components have been found. A missing optional component should not +keep the XXX_FOUND variable from being set to true. +If the package provides XXX_INCLUDE_DIRS and XXX_LIBRARIES variables, the include +dirs and libraries for all components which were requested and which have been +found should be added to those two variables. + +To get this behaviour you can use the FIND_PACKAGE_HANDLE_STANDARD_ARGS() macro, as an example see FindJPEG.cmake. For internal implementation, it's a generally accepted convention that variables starting with diff -Nru cmake-2.8.7/Source/CMakeLists.txt cmake-2.8.9/Source/CMakeLists.txt --- cmake-2.8.7/Source/CMakeLists.txt 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/CMakeLists.txt 2012-08-09 18:15:19.000000000 +0000 @@ -185,6 +185,8 @@ cmGeneratedFileStream.cxx cmGeneratorExpression.cxx cmGeneratorExpression.h + cmGeneratorTarget.cxx + cmGeneratorTarget.h cmGlobalGenerator.cxx cmGlobalGenerator.h cmGlobalUnixMakefileGenerator3.cxx @@ -217,6 +219,8 @@ cmMakefileExecutableTargetGenerator.cxx cmMakefileLibraryTargetGenerator.cxx cmMakefileUtilityTargetGenerator.cxx + cmOSXBundleGenerator.cxx + cmOSXBundleGenerator.h cmNewLineStyle.h cmNewLineStyle.cxx cmOrderDirectories.cxx @@ -335,6 +339,8 @@ cmGlobalVisualStudio11Generator.cxx cmGlobalVisualStudio11Win64Generator.h cmGlobalVisualStudio11Win64Generator.cxx + cmGlobalVisualStudio11ARMGenerator.h + cmGlobalVisualStudio11ARMGenerator.cxx cmGlobalVisualStudioGenerator.cxx cmGlobalVisualStudioGenerator.h cmGlobalWatcomWMakeGenerator.cxx @@ -353,6 +359,27 @@ ENDIF(NOT UNIX) ENDIF (WIN32) +# Ninja support +SET(SRCS ${SRCS} + cmGlobalNinjaGenerator.cxx + cmGlobalNinjaGenerator.h + cmNinjaTypes.h + cmLocalNinjaGenerator.cxx + cmLocalNinjaGenerator.h + cmNinjaTargetGenerator.cxx + cmNinjaTargetGenerator.h + cmNinjaNormalTargetGenerator.cxx + cmNinjaNormalTargetGenerator.h + cmNinjaUtilityTargetGenerator.cxx + cmNinjaUtilityTargetGenerator.h + ) +IF(WIN32 AND NOT CYGWIN AND NOT BORLAND) + SET_SOURCE_FILES_PROPERTIES(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501) + ADD_EXECUTABLE(cmcldeps cmcldeps.cxx) + TARGET_LINK_LIBRARIES(cmcldeps CMakeLib) + INSTALL_TARGETS(/bin cmcldeps) +ENDIF() + # create a library used by the command line and the GUI ADD_LIBRARY(CMakeLib ${SRCS}) TARGET_LINK_LIBRARIES(CMakeLib cmsys @@ -391,6 +418,9 @@ 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 @@ -449,6 +479,8 @@ CPack/cmCPackTarBZip2Generator.cxx CPack/cmCPackTarCompressGenerator.cxx CPack/cmCPackZIPGenerator.cxx + CPack/cmCPackDocumentVariables.cxx + CPack/cmCPackDocumentMacros.cxx ) IF(CYGWIN) diff -Nru cmake-2.8.7/Source/CMakeVersion.bash cmake-2.8.9/Source/CMakeVersion.bash --- cmake-2.8.7/Source/CMakeVersion.bash 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Source/CMakeVersion.bash 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Source/CMakeVersion.cmake cmake-2.8.9/Source/CMakeVersion.cmake --- cmake-2.8.7/Source/CMakeVersion.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Source/CMakeVersion.cmake 2012-08-09 18:15:19.000000000 +0000 @@ -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 3) diff -Nru cmake-2.8.7/Source/CPack/cmCPackArchiveGenerator.cxx cmake-2.8.9/Source/CPack/cmCPackArchiveGenerator.cxx --- cmake-2.8.7/Source/CPack/cmCPackArchiveGenerator.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackArchiveGenerator.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -57,13 +57,20 @@ std::string dir = cmSystemTools::GetCurrentWorkingDirectory(); // Change to local toplevel cmSystemTools::ChangeDirectory(localToplevel.c_str()); + std::string filePrefix; + if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY")) + { + filePrefix = this->GetOption("CPACK_PACKAGE_FILE_NAME"); + filePrefix += "/"; + } std::vector::const_iterator fileIt; for (fileIt = component->Files.begin(); fileIt != component->Files.end(); ++fileIt ) { + std::string rp = filePrefix + *fileIt; cmCPackLogger(cmCPackLog::LOG_DEBUG,"Adding file: " - << (*fileIt) << std::endl); - archive.Add(*fileIt); + << rp << std::endl); + archive.Add(rp); if (!archive) { cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: " @@ -240,7 +247,7 @@ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: " << toplevel << std::endl); - if (SupportsComponentInstallation()) { + if (WantsComponentInstallation()) { // CASE 1 : COMPONENT ALL-IN-ONE package // If ALL COMPONENTS in ONE package has been requested // then the package file is unique and should be open here. diff -Nru cmake-2.8.7/Source/CPack/cmCPackDebGenerator.cxx cmake-2.8.9/Source/CPack/cmCPackDebGenerator.cxx --- cmake-2.8.7/Source/CPack/cmCPackDebGenerator.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackDebGenerator.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -236,7 +236,7 @@ int retval = -1; /* Are we in the component packaging case */ - if (SupportsComponentInstallation()) { + if (WantsComponentInstallation()) { // CASE 1 : COMPONENT ALL-IN-ONE package // If ALL GROUPS or ALL COMPONENTS in ONE package has been requested // then the package file is unique and should be open here. @@ -480,11 +480,16 @@ // 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 -Nru cmake-2.8.7/Source/CPack/cmCPackDebGenerator.h cmake-2.8.9/Source/CPack/cmCPackDebGenerator.h --- cmake-2.8.7/Source/CPack/cmCPackDebGenerator.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackDebGenerator.h 2012-08-09 18:15:19.000000000 +0000 @@ -31,6 +31,20 @@ cmCPackDebGenerator(); virtual ~cmCPackDebGenerator(); + static bool CanGenerate() + { +#ifdef __APPLE__ + // on MacOS enable CPackDeb iff dpkg is found + std::vector locations; + locations.push_back("/sw/bin"); // Fink + locations.push_back("/opt/local/bin"); // MacPorts + return cmSystemTools::FindProgram("dpkg",locations) != "" ? true : false; +#else + // legacy behavior on other systems + return true; +#endif + } + protected: virtual int InitializeInternal(); /** diff -Nru cmake-2.8.7/Source/CPack/cmCPackDocumentMacros.cxx cmake-2.8.9/Source/CPack/cmCPackDocumentMacros.cxx --- cmake-2.8.7/Source/CPack/cmCPackDocumentMacros.cxx 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackDocumentMacros.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,16 @@ +#include "cmCPackDocumentMacros.h" + +void cmCPackDocumentMacros::GetMacrosDocumentation( + std::vector& ) +{ + // Commented-out example of use + // + // cmDocumentationEntry e("cpack_", + // "Brief Description" + // "which may be on several lines.", + // "Long description in pre-formatted format" + // " blah\n" + // " blah\n" + //); + //v.push_back(e); +} diff -Nru cmake-2.8.7/Source/CPack/cmCPackDocumentMacros.h cmake-2.8.9/Source/CPack/cmCPackDocumentMacros.h --- cmake-2.8.7/Source/CPack/cmCPackDocumentMacros.h 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackDocumentMacros.h 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,21 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#ifndef cmCPackDocumentMacros_h +#define cmCPackDocumentMacros_h +#include "cmStandardIncludes.h" +class cmCPackDocumentMacros +{ +public: + static void GetMacrosDocumentation(std::vector& v); +}; + +#endif diff -Nru cmake-2.8.7/Source/CPack/cmCPackDocumentVariables.cxx cmake-2.8.9/Source/CPack/cmCPackDocumentVariables.cxx --- cmake-2.8.7/Source/CPack/cmCPackDocumentVariables.cxx 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackDocumentVariables.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,111 @@ +#include "cmCPackDocumentVariables.h" +#include "cmake.h" + +void cmCPackDocumentVariables::DefineVariables(cmake* cm) +{ + // Subsection: variables defined/used by cpack, + // which are common to all CPack generators + + cm->DefineProperty + ("CPACK_PACKAGING_INSTALL_PREFIX", cmProperty::VARIABLE, + "The prefix used in the built package.", + "Each CPack generator has a default value (like /usr)." + " This default value may" + " be overwritten from the CMakeLists.txt or the cpack command line" + " by setting an alternative value.\n" + "e.g. " + " set(CPACK_PACKAGING_INSTALL_PREFIX \"/opt\")\n" + "This is not the same purpose as CMAKE_INSTALL_PREFIX which" + " is used when installing from the build tree without building" + " a package." + "", false, + "Variables common to all CPack generators"); + + cm->DefineProperty + ("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", cmProperty::VARIABLE, + "Boolean toggle to include/exclude top level directory.", + "When preparing a package CPack installs the item under" + " the so-called top level directory. The purpose of" + " is to include (set to 1 or ON or TRUE) the top level directory" + " in the package or not (set to 0 or OFF or FALSE).\n" + "Each CPack generator as a built-in default value for this" + " variable. E.g. Archive generators (ZIP, TGZ, ...) includes" + " the top level whereas RPM or DEB don't. The user may override" + " the default value byt setting this variable.\n" + "There is a similar variable " + "CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY" + "which may be used to override the behavior for the component" + "packaging case which may have different default value for" + "historical (now backward compatibility) reason.", false, + "Variables common to all CPack generators"); + + cm->DefineProperty + ("CPACK_SET_DESTDIR", cmProperty::VARIABLE, + "Boolean toggle to make CPack use DESTDIR mechanism when" + " packaging.", "DESTDIR means DESTination DIRectory." + " It is commonly used by makefile " + "users in order to install software at non-default location. It " + "is a basic relocation mechanism. " + "It is usually invoked like this:\n" + " make DESTDIR=/home/john install\n" + "which will install the concerned software using the" + " installation prefix, e.g. \"/usr/local\" prepended with " + "the DESTDIR value which finally gives \"/home/john/usr/local\"." + " When preparing a package, CPack first installs the items to be " + "packaged in a local (to the build tree) directory by using the " + "same DESTDIR mechanism. Nevertheless, if " + "CPACK_SET_DESTDIR is set then CPack will set DESTDIR before" + " doing the local install. The most noticeable difference is" + " that without CPACK_SET_DESTDIR, CPack uses " + "CPACK_PACKAGING_INSTALL_PREFIX as a prefix whereas with " + "CPACK_SET_DESTDIR set, CPack will use CMAKE_INSTALL_PREFIX as" + " a prefix.\n" + "Manually setting CPACK_SET_DESTDIR may help (or simply be" + " necessary) if some install rules uses absolute " + "DESTINATION (see CMake INSTALL command)." + " However, starting with" + " CPack/CMake 2.8.3 RPM and DEB installers tries to handle DESTDIR" + " automatically so that it is seldom necessary for the user to set" + " it.", false, + "Variables common to all CPack generators"); + + cm->DefineProperty + ("CPACK_INSTALL_SCRIPT", cmProperty::VARIABLE, + "Extra CMake script provided by the user.", + "If set this CMake script will be executed by CPack " + "during its local [CPack-private] installation " + "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 -Nru cmake-2.8.7/Source/CPack/cmCPackDocumentVariables.h cmake-2.8.9/Source/CPack/cmCPackDocumentVariables.h --- cmake-2.8.7/Source/CPack/cmCPackDocumentVariables.h 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackDocumentVariables.h 2012-08-09 18:15:19.000000000 +0000 @@ -0,0 +1,21 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#ifndef cmCPackDocumentVariables_h +#define cmCPackDocumentVariables_h +class cmake; +class cmCPackDocumentVariables +{ +public: + static void DefineVariables(cmake* cm); +}; + +#endif diff -Nru cmake-2.8.7/Source/CPack/cmCPackDragNDropGenerator.cxx cmake-2.8.9/Source/CPack/cmCPackDragNDropGenerator.cxx --- cmake-2.8.7/Source/CPack/cmCPackDragNDropGenerator.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackDragNDropGenerator.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -63,6 +63,12 @@ //---------------------------------------------------------------------- int cmCPackDragNDropGenerator::InitializeInternal() { + // Starting with Xcode 4.3, look in "/Applications/Xcode.app" first: + // + std::vector paths; + paths.push_back("/Applications/Xcode.app/Contents/Developer/Tools"); + paths.push_back("/Developer/Tools"); + const std::string hdiutil_path = cmSystemTools::FindProgram("hdiutil", std::vector(), false); if(hdiutil_path.empty()) @@ -75,7 +81,7 @@ this->SetOptionIfNotSet("CPACK_COMMAND_HDIUTIL", hdiutil_path.c_str()); const std::string setfile_path = cmSystemTools::FindProgram("SetFile", - std::vector(1, "/Developer/Tools"), false); + paths, false); if(setfile_path.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, @@ -86,7 +92,7 @@ this->SetOptionIfNotSet("CPACK_COMMAND_SETFILE", setfile_path.c_str()); const std::string rez_path = cmSystemTools::FindProgram("Rez", - std::vector(1, "/Developer/Tools"), false); + paths, false); if(rez_path.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, @@ -421,6 +427,7 @@ if(ifs.is_open()) { cmGeneratedFileStream osf(sla_r.c_str()); + osf << "#include \n\n"; osf << SLAHeader; osf << "\n"; osf << "data 'TEXT' (5002, \"English\") {\n"; @@ -481,13 +488,11 @@ // Rez the SLA cmOStringStream embed_sla_command; - embed_sla_command << "/bin/bash -c \""; // need expansion of "*.r" embed_sla_command << this->GetOption("CPACK_COMMAND_REZ"); - embed_sla_command << " /Developer/Headers/FlatCarbon/*.r "; - embed_sla_command << "'" << sla_r << "'"; + embed_sla_command << " \"" << sla_r << "\""; embed_sla_command << " -a -o "; - embed_sla_command << "'" << temp_udco << "'\""; - + embed_sla_command << "\"" << temp_udco << "\""; + if(!this->RunCommand(embed_sla_command, &error)) { cmCPackLogger(cmCPackLog::LOG_ERROR, diff -Nru cmake-2.8.7/Source/CPack/cmCPackGenerator.cxx cmake-2.8.9/Source/CPack/cmCPackGenerator.cxx --- cmake-2.8.7/Source/CPack/cmCPackGenerator.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackGenerator.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -62,10 +62,31 @@ //---------------------------------------------------------------------- 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 @@ 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); @@ -691,6 +715,11 @@ // one install directory for each component. tempInstallDirectory += GetComponentInstallDirNameSuffix(installComponent); + if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY")) + { + tempInstallDirectory += "/"; + tempInstallDirectory += this->GetOption("CPACK_PACKAGE_FILE_NAME"); + } } if (!setDestDir) @@ -823,8 +852,35 @@ 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) @@ -948,6 +1004,8 @@ 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; @@ -1426,12 +1484,31 @@ } //---------------------------------------------------------------------- +enum cmCPackGenerator::CPackSetDestdirSupport +cmCPackGenerator::SupportsSetDestdir() const +{ + return cmCPackGenerator::SETDESTDIR_SUPPORTED; +} + +//---------------------------------------------------------------------- +bool cmCPackGenerator::SupportsAbsoluteDestination() const +{ + return true; +} + +//---------------------------------------------------------------------- bool cmCPackGenerator::SupportsComponentInstallation() const { return false; } //---------------------------------------------------------------------- +bool cmCPackGenerator::WantsComponentInstallation() const +{ + return (!IsOn("CPACK_MONOLITHIC_INSTALL") & SupportsComponentInstallation()); +} + +//---------------------------------------------------------------------- cmCPackInstallationType* cmCPackGenerator::GetInstallationType(const char *projectName, const char *name) diff -Nru cmake-2.8.7/Source/CPack/cmCPackGenerator.h cmake-2.8.9/Source/CPack/cmCPackGenerator.h --- cmake-2.8.7/Source/CPack/cmCPackGenerator.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackGenerator.h 2012-08-09 18:15:19.000000000 +0000 @@ -63,6 +63,16 @@ 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 * to redefine @ref PackageFiles, because in fact @@ -189,7 +199,53 @@ 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 + * CPACK__COMPONENT_INSTALL in order to make this + * method return true. + * @return true if supported, false otherwise + */ virtual bool SupportsComponentInstallation() const; + /** + * Does the currently running generator want a component installation. + * The generator may support component installation but he may + * be requiring monolithic install using CPACK_MONOLITHIC_INSTALL. + * @return true if component installation is supported and wanted. + */ + virtual bool WantsComponentInstallation() const; virtual cmCPackInstallationType* GetInstallationType(const char *projectName, const char* name); virtual cmCPackComponent* GetComponent(const char *projectName, diff -Nru cmake-2.8.7/Source/CPack/cmCPackGeneratorFactory.cxx cmake-2.8.9/Source/CPack/cmCPackGeneratorFactory.cxx --- cmake-2.8.7/Source/CPack/cmCPackGeneratorFactory.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackGeneratorFactory.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Source/CPack/cmCPackNSISGenerator.cxx cmake-2.8.9/Source/CPack/cmCPackNSISGenerator.cxx --- cmake-2.8.7/Source/CPack/cmCPackNSISGenerator.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackNSISGenerator.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -64,6 +64,7 @@ << std::endl); return false; } + std::string nsisFileName = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); std::string tmpFile = nsisFileName; tmpFile += "/NSISOutput.log"; @@ -344,9 +345,9 @@ if ( cmSystemTools::IsOn(this->GetOption( "CPACK_INCLUDE_TOPLEVEL_DIRECTORY")) ) { - cmCPackLogger(cmCPackLog::LOG_ERROR, - "NSIS Generator cannot work with CPACK_INCLUDE_TOPLEVEL_DIRECTORY. " - "This option will be ignored." + cmCPackLogger(cmCPackLog::LOG_WARNING, + "NSIS Generator cannot work with CPACK_INCLUDE_TOPLEVEL_DIRECTORY set. " + "This option will be reset to 0 (for this generator only)." << std::endl); this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", 0); } @@ -542,8 +543,8 @@ { 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; } @@ -631,6 +632,19 @@ } //---------------------------------------------------------------------- +enum cmCPackGenerator::CPackSetDestdirSupport +cmCPackNSISGenerator::SupportsSetDestdir() const +{ + return cmCPackGenerator::SETDESTDIR_SHOULD_NOT_BE_USED; +} + +//---------------------------------------------------------------------- +bool cmCPackNSISGenerator::SupportsAbsoluteDestination() const +{ + return false; +} + +//---------------------------------------------------------------------- bool cmCPackNSISGenerator::SupportsComponentInstallation() const { return true; diff -Nru cmake-2.8.7/Source/CPack/cmCPackNSISGenerator.h cmake-2.8.9/Source/CPack/cmCPackNSISGenerator.h --- cmake-2.8.7/Source/CPack/cmCPackNSISGenerator.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackNSISGenerator.h 2012-08-09 18:15:19.000000000 +0000 @@ -44,6 +44,8 @@ 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 -Nru cmake-2.8.7/Source/CPack/cmCPackOSXX11Generator.cxx cmake-2.8.9/Source/CPack/cmCPackOSXX11Generator.cxx --- cmake-2.8.7/Source/CPack/cmCPackOSXX11Generator.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackOSXX11Generator.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -170,23 +170,25 @@ << "\" create -ov -format UDZO -srcfolder \"" << diskImageDirectory.c_str() << "\" \"" << packageFileNames[0] << "\""; - int retVal = 1; cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Compress disk image using command: " << dmgCmd.str().c_str() << std::endl); // since we get random dashboard failures with this one // try running it more than once - int numTries = 4; + int retVal = 1; + int numTries = 10; bool res = false; while(numTries > 0) { res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output, &retVal, 0, this->GeneratorVerbose, 0); - if(res && retVal) + if ( res && !retVal ) { numTries = -1; + break; } + cmSystemTools::Delay(500); numTries--; } if ( !res || retVal ) diff -Nru cmake-2.8.7/Source/CPack/cmCPackPackageMakerGenerator.cxx cmake-2.8.9/Source/CPack/cmCPackPackageMakerGenerator.cxx --- cmake-2.8.7/Source/CPack/cmCPackPackageMakerGenerator.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackPackageMakerGenerator.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -319,17 +319,19 @@ << "\" \"" << packageFileNames[0] << "\""; std::string output; int retVal = 1; - int numTries = 4; + int numTries = 10; bool res = false; while(numTries > 0) { res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output, &retVal, 0, this->GeneratorVerbose, 0); - if(res && retVal) + if ( res && !retVal ) { numTries = -1; + break; } + cmSystemTools::Delay(500); numTries--; } if ( !res || retVal ) @@ -353,24 +355,73 @@ cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackPackageMakerGenerator::Initialize()" << std::endl); this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr"); - std::vector path; - std::string pkgPath - = "/Developer/Applications/Utilities/PackageMaker.app/Contents"; - std::string versionFile = pkgPath + "/version.plist"; - if ( !cmSystemTools::FileExists(versionFile.c_str()) ) + + // Starting with Xcode 4.3, PackageMaker is a separate app, and you + // can put it anywhere you want. So... use a variable for its location. + // People who put it in unexpected places can use the variable to tell + // us where it is. + // + // Use the following locations, in "most recent installation" order, + // to search for the PackageMaker app. Assume people who copy it into + // the new Xcode 4.3 app in "/Applications" will copy it into the nested + // Applications folder inside the Xcode bundle itself. Or directly in + // the "/Applications" directory. + // + // If found, save result in the CPACK_INSTALLER_PROGRAM variable. + + std::vector paths; + paths.push_back( + "/Applications/Xcode.app/Contents/Applications" + "/PackageMaker.app/Contents/MacOS"); + paths.push_back( + "/Applications/Utilities" + "/PackageMaker.app/Contents/MacOS"); + paths.push_back( + "/Applications" + "/PackageMaker.app/Contents/MacOS"); + paths.push_back( + "/Developer/Applications/Utilities" + "/PackageMaker.app/Contents/MacOS"); + paths.push_back( + "/Developer/Applications" + "/PackageMaker.app/Contents/MacOS"); + + std::string pkgPath; + const char *inst_program = this->GetOption("CPACK_INSTALLER_PROGRAM"); + if (inst_program && *inst_program) + { + pkgPath = inst_program; + } + else { - pkgPath = "/Developer/Applications/PackageMaker.app/Contents"; - std::string newVersionFile = pkgPath + "/version.plist"; - if ( !cmSystemTools::FileExists(newVersionFile.c_str()) ) + pkgPath = cmSystemTools::FindProgram("PackageMaker", paths, false); + if ( pkgPath.empty() ) { - cmCPackLogger(cmCPackLog::LOG_ERROR, - "Cannot find PackageMaker compiler version file: " - << versionFile.c_str() << " or " << newVersionFile.c_str() + cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find PackageMaker compiler" << std::endl); return 0; } - versionFile = newVersionFile; + this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", pkgPath.c_str()); } + + // Get path to the real PackageMaker, not a symlink: + pkgPath = cmSystemTools::GetRealPath(pkgPath.c_str()); + // Up from there to find the version.plist file in the "Contents" dir: + std::string contents_dir; + contents_dir = cmSystemTools::GetFilenamePath(pkgPath); + contents_dir = cmSystemTools::GetFilenamePath(contents_dir); + + std::string versionFile = contents_dir + "/version.plist"; + + if ( !cmSystemTools::FileExists(versionFile.c_str()) ) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Cannot find PackageMaker compiler version file: " + << versionFile.c_str() + << std::endl); + return 0; + } + std::ifstream ifs(versionFile.c_str()); if ( !ifs ) { @@ -378,6 +429,7 @@ "Cannot open PackageMaker compiler version file" << std::endl); return 0; } + // Check the PackageMaker version cmsys::RegularExpression rexKey("CFBundleShortVersionString"); cmsys::RegularExpression rexVersion("([0-9]+.[0-9.]+)"); @@ -440,17 +492,8 @@ this->PackageCompatibilityVersion = 10.3; } - pkgPath += "/MacOS"; - path.push_back(pkgPath); - pkgPath = cmSystemTools::FindProgram("PackageMaker", path, false); - if ( pkgPath.empty() ) - { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find PackageMaker compiler" - << std::endl); - return 0; - } - this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", pkgPath.c_str()); - pkgPath = cmSystemTools::FindProgram("hdiutil", path, false); + std::vector no_paths; + pkgPath = cmSystemTools::FindProgram("hdiutil", no_paths, false); if ( pkgPath.empty() ) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find hdiutil compiler" diff -Nru cmake-2.8.7/Source/CPack/cmCPackRPMGenerator.cxx cmake-2.8.9/Source/CPack/cmCPackRPMGenerator.cxx --- cmake-2.8.7/Source/CPack/cmCPackRPMGenerator.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackRPMGenerator.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -201,7 +201,7 @@ << toplevel << std::endl); /* Are we in the component packaging case */ - if (SupportsComponentInstallation()) { + if (WantsComponentInstallation()) { // CASE 1 : COMPONENT ALL-IN-ONE package // If ALL COMPONENTS in ONE package has been requested // then the package file is unique and should be open here. diff -Nru cmake-2.8.7/Source/CPack/cmCPackRPMGenerator.h cmake-2.8.9/Source/CPack/cmCPackRPMGenerator.h --- cmake-2.8.7/Source/CPack/cmCPackRPMGenerator.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackRPMGenerator.h 2012-08-09 18:15:19.000000000 +0000 @@ -35,6 +35,20 @@ cmCPackRPMGenerator(); virtual ~cmCPackRPMGenerator(); + static bool CanGenerate() + { +#ifdef __APPLE__ + // on MacOS enable CPackRPM iff rpmbuild is found + std::vector locations; + locations.push_back("/sw/bin"); // Fink + locations.push_back("/opt/local/bin"); // MacPorts + return cmSystemTools::FindProgram("rpmbuild") != "" ? true : false; +#else + // legacy behavior on other systems + return true; +#endif + } + protected: virtual int InitializeInternal(); virtual int PackageFiles(); diff -Nru cmake-2.8.7/Source/CPack/cmCPackSTGZGenerator.cxx cmake-2.8.9/Source/CPack/cmCPackSTGZGenerator.cxx --- cmake-2.8.7/Source/CPack/cmCPackSTGZGenerator.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cmCPackSTGZGenerator.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -54,21 +54,32 @@ //---------------------------------------------------------------------- int cmCPackSTGZGenerator::PackageFiles() { + bool retval = true; if ( !this->Superclass::PackageFiles() ) { return 0; } - return cmSystemTools::SetPermissions(packageFileNames[0].c_str(), + + /* TGZ generator (our Superclass) may + * have generated several packages (component packaging) + * so we must iterate over generated packages. + */ + for (std::vector::iterator it=packageFileNames.begin(); + it != packageFileNames.end(); ++it) + { + retval &= cmSystemTools::SetPermissions((*it).c_str(), #if defined( _MSC_VER ) || defined( __MINGW32__ ) - S_IREAD | S_IWRITE | S_IEXEC + S_IREAD | S_IWRITE | S_IEXEC #elif defined( __BORLANDC__ ) - S_IRUSR | S_IWUSR | S_IXUSR + S_IRUSR | S_IWUSR | S_IXUSR #else - S_IRUSR | S_IWUSR | S_IXUSR | - S_IRGRP | S_IWGRP | S_IXGRP | - S_IROTH | S_IWOTH | S_IXOTH + S_IRUSR | S_IWUSR | S_IXUSR | + S_IRGRP | S_IWGRP | S_IXGRP | + S_IROTH | S_IWOTH | S_IXOTH #endif - ); + ); + } + return retval; } //---------------------------------------------------------------------- diff -Nru cmake-2.8.7/Source/CPack/cpack.cxx cmake-2.8.9/Source/CPack/cpack.cxx --- cmake-2.8.7/Source/CPack/cpack.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CPack/cpack.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -14,6 +14,8 @@ // Need these for documentation support. #include "cmake.h" #include "cmDocumentation.h" +#include "cmCPackDocumentVariables.h" +#include "cmCPackDocumentMacros.h" #include "cmCPackGeneratorFactory.h" #include "cmCPackGenerator.h" #include "cmake.h" @@ -24,6 +26,7 @@ #include "cmCPackLog.h" #include +#include #include // auto_ptr //---------------------------------------------------------------------------- @@ -71,6 +74,59 @@ {"--config ", "Specify the config file.", "Specify the config file to use to create the package. By default " "CPackConfig.cmake in the current directory will be used." }, + {"--verbose,-V","enable verbose output","Run cpack with verbose output."}, + {"--debug","enable debug output (for CPack developers)", + "Run cpack with debug output (for CPack developers)."}, + {"-P ","override/define CPACK_PACKAGE_NAME", + "If the package name is not specified on cpack commmand line then" + "CPack.cmake defines it as CMAKE_PROJECT_NAME"}, + {"-R ","override/define CPACK_PACKAGE_VERSION", + "If version is not specified on cpack command line then" + "CPack.cmake defines it from CPACK_PACKAGE_VERSION_[MAJOR|MINOR|PATCH]" + "look into CPack.cmake for detail"}, + {"-B ","override/define CPACK_PACKAGE_DIRECTORY", + "The directory where CPack will be doing its packaging work." + "The resulting package will be found there. Inside this directory" + "CPack creates '_CPack_Packages' sub-directory which is the" + "CPack temporary directory."}, + {"--vendor ","override/define CPACK_PACKAGE_VENDOR", + "If vendor is not specified on cpack command line " + "(or inside CMakeLists.txt) then" + "CPack.cmake defines it with a default value"}, + {"--help-command cmd [file]", "Print help for a single command and exit.", + "Full documentation specific to the given command is displayed. " + "If a file is specified, the documentation is written into and the output " + "format is determined depending on the filename suffix. Supported are man " + "page, HTML, DocBook and plain text."}, + {"--help-command-list [file]", "List available commands and exit.", + "The list contains all commands for which help may be obtained by using " + "the --help-command argument followed by a command name. " + "If a file is specified, the documentation is written into and the output " + "format is determined depending on the filename suffix. Supported are man " + "page, HTML, DocBook and plain text."}, + {"--help-commands [file]", "Print help for all commands and exit.", + "Full documentation specific for all current command is displayed." + "If a file is specified, the documentation is written into and the output " + "format is determined depending on the filename suffix. Supported are man " + "page, HTML, DocBook and plain text."}, + {"--help-variable var [file]", + "Print help for a single variable and exit.", + "Full documentation specific to the given variable is displayed." + "If a file is specified, the documentation is written into and the output " + "format is determined depending on the filename suffix. Supported are man " + "page, HTML, DocBook and plain text."}, + {"--help-variable-list [file]", "List documented variables and exit.", + "The list contains all variables for which help may be obtained by using " + "the --help-variable argument followed by a variable name. If a file is " + "specified, the help is written into it." + "If a file is specified, the documentation is written into and the output " + "format is determined depending on the filename suffix. Supported are man " + "page, HTML, DocBook and plain text."}, + {"--help-variables [file]", "Print help for all variables and exit.", + "Full documentation for all variables is displayed." + "If a file is specified, the documentation is written into and the output " + "format is determined depending on the filename suffix. Supported are man " + "page, HTML, DocBook and plain text."}, {0,0,0} }; @@ -118,12 +174,15 @@ return 1; } + //---------------------------------------------------------------------------- // this is CPack. int main (int argc, char *argv[]) { cmSystemTools::FindExecutableDirectory(argv[0]); cmCPackLog log; + int nocwd = 0; + log.SetErrorPrefix("CPack Error: "); log.SetWarningPrefix("CPack Warning: "); log.SetOutputPrefix("CPack: "); @@ -135,6 +194,7 @@ { cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "Current working directory cannot be established." << std::endl); + nocwd = 1; } std::string generator; @@ -147,8 +207,7 @@ std::string helpHTML; std::string cpackProjectName; - std::string cpackProjectDirectory - = cmsys::SystemTools::GetCurrentWorkingDirectory(); + std::string cpackProjectDirectory; std::string cpackBuildConfig; std::string cpackProjectVersion; std::string cpackProjectPatch; @@ -160,7 +219,6 @@ cpackConfigFile = ""; - cmDocumentation doc; cmsys::CommandLineArguments arg; arg.Initialize(argc, argv); typedef cmsys::CommandLineArguments argT; @@ -233,17 +291,29 @@ generators.SetLogger(&log); cmCPackGenerator* cpackGenerator = 0; - if ( !helpFull.empty() || !helpMAN.empty() || - !helpHTML.empty() || helpVersion ) + cmDocumentation doc; + doc.addCPackStandardDocSections(); + /* Were we invoked to display doc or to do some work ? + * Unlike cmake launching cpack with zero argument + * should launch cpack using "cpackConfigFile" if it exists + * in the current directory. + */ + if((doc.CheckOptions(argc, argv,"-G") || nocwd) && !(argc==1)) + { + help = true; + } + else { - help = true; + help = false; } + // This part is used for cpack documentation lookup as well. + cminst.AddCMakePaths(); + if ( parsed && !help ) { // find out which system cpack is running on, so it can setup the search // paths, so FIND_XXX() commands can be used in scripts - cminst.AddCMakePaths(); std::string systemFile = globalMF->GetModulesFile("CMakeDetermineSystem.cmake"); if (!globalMF->ReadListFile(0, systemFile.c_str())) @@ -303,10 +373,24 @@ globalMF->AddDefinition("CPACK_PACKAGE_VENDOR", cpackProjectVendor.c_str()); } + // if this is not empty it has been set on the command line + // go for it. Command line override values set in config file. if ( !cpackProjectDirectory.empty() ) { globalMF->AddDefinition("CPACK_PACKAGE_DIRECTORY", - cpackProjectDirectory.c_str()); + cpackProjectDirectory.c_str()); + } + // The value has not been set on the command line + else + { + // get a default value (current working directory) + cpackProjectDirectory = cmsys::SystemTools::GetCurrentWorkingDirectory(); + // use default value iff no value has been provided by the config file + if (!globalMF->IsSet("CPACK_PACKAGE_DIRECTORY")) + { + globalMF->AddDefinition("CPACK_PACKAGE_DIRECTORY", + cpackProjectDirectory.c_str()); + } } if ( !cpackBuildConfig.empty() ) { @@ -440,16 +524,54 @@ } } + /* In this case we are building the documentation object + * instance in order to create appropriate structure + * in order to satisfy the appropriate --help-xxx request + */ if ( help ) { - doc.CheckOptions(argc, argv); // Construct and print requested documentation. + doc.SetName("cpack"); doc.SetSection("Name",cmDocumentationName); doc.SetSection("Usage",cmDocumentationUsage); doc.SetSection("Description",cmDocumentationDescription); doc.PrependSection("Options",cmDocumentationOptions); + // statically (in C++ code) defined variables + cmCPackDocumentVariables::DefineVariables(&cminst); + + std::vector commands; + + std::string docedFile; + std::string docPath; + cmDocumentation::documentedModulesList_t docedModList; + + docedFile = globalMF->GetModulesFile("CPack.cmake"); + if (docedFile.length()!=0) + { + docPath = cmSystemTools::GetFilenamePath(docedFile.c_str()); + doc.getDocumentedModulesListInDir(docPath,"CPack*.cmake",docedModList); + } + + // parse the files for documentation. + cmDocumentation::documentedModulesList_t::iterator docedIt; + for (docedIt = docedModList.begin(); + docedIt!= docedModList.end(); ++docedIt) + { + doc.GetStructuredDocFromFile( + (docedIt->first).c_str(), + commands,&cminst); + } + + std::map propDocs; + cminst.GetPropertiesDocumentation(propDocs); + doc.SetSections(propDocs); + cminst.GetCommandDocumentation(commands,true,false); + // statically (in C++ code) defined macros/commands + cmCPackDocumentMacros::GetMacrosDocumentation(commands); + doc.SetSection("Commands",commands); + std::vector v; cmCPackGeneratorFactory::DescriptionsMap::const_iterator generatorIt; for( generatorIt = generators.GetGeneratorsList().begin(); diff -Nru cmake-2.8.7/Source/CTest/cmCTestBZR.cxx cmake-2.8.9/Source/CTest/cmCTestBZR.cxx --- cmake-2.8.7/Source/CTest/cmCTestBZR.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestBZR.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -128,13 +128,12 @@ { 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 -Nru cmake-2.8.7/Source/CTest/cmCTestBuildCommand.h cmake-2.8.9/Source/CTest/cmCTestBuildCommand.h --- cmake-2.8.7/Source/CTest/cmCTestBuildCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestBuildCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -43,12 +43,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "ctest_build";} + virtual const char* GetName() const { return "ctest_build";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Build the project."; } @@ -57,7 +57,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " ctest_build([BUILD build_dir] [TARGET target] [RETURN_VALUE res]\n" diff -Nru cmake-2.8.7/Source/CTest/cmCTestBuildHandler.cxx cmake-2.8.9/Source/CTest/cmCTestBuildHandler.cxx --- cmake-2.8.7/Source/CTest/cmCTestBuildHandler.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestBuildHandler.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -94,6 +94,7 @@ ": Invalid argument", "^The project cannot be built\\.", "^\\[ERROR\\]", + "^Command .* failed with exit code", 0 }; diff -Nru cmake-2.8.7/Source/CTest/cmCTestConfigureCommand.h cmake-2.8.9/Source/CTest/cmCTestConfigureCommand.h --- cmake-2.8.7/Source/CTest/cmCTestConfigureCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestConfigureCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -38,12 +38,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "ctest_configure";} + virtual const char* GetName() const { return "ctest_configure";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Configure the project build tree."; } @@ -51,7 +51,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " ctest_configure([BUILD build_dir] [SOURCE source_dir] [APPEND]\n" diff -Nru cmake-2.8.7/Source/CTest/cmCTestCoverageCommand.h cmake-2.8.9/Source/CTest/cmCTestCoverageCommand.h --- cmake-2.8.7/Source/CTest/cmCTestCoverageCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestCoverageCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -39,12 +39,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "ctest_coverage";} + virtual const char* GetName() const { return "ctest_coverage";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Collect coverage tool results."; } @@ -52,7 +52,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " ctest_coverage([BUILD build_dir] [RETURN_VALUE res] [APPEND]\n" diff -Nru cmake-2.8.7/Source/CTest/cmCTestCoverageHandler.cxx cmake-2.8.9/Source/CTest/cmCTestCoverageHandler.cxx --- cmake-2.8.7/Source/CTest/cmCTestCoverageHandler.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestCoverageHandler.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -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 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); @@ -555,7 +565,7 @@ covSumFile << "\tCTest->GetShortPathToFile(fullFileName.c_str())) - << "\" Covered=\"" << (tested > 0 ? "true":"false") << "\">\n" + << "\" Covered=\"" << (tested+untested > 0 ? "true":"false") << "\">\n" << "\t\t" << tested << "\n" << "\t\t" << untested << "\n" << "\t\t"; @@ -751,6 +761,73 @@ } 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 @@ 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 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 @@ 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 -Nru cmake-2.8.7/Source/CTest/cmCTestCoverageHandler.h cmake-2.8.9/Source/CTest/cmCTestCoverageHandler.h --- cmake-2.8.7/Source/CTest/cmCTestCoverageHandler.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestCoverageHandler.h 2012-08-09 18:15:19.000000000 +0000 @@ -70,6 +70,8 @@ //! 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 -Nru cmake-2.8.7/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h cmake-2.8.9/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h --- cmake-2.8.7/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -48,12 +48,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "ctest_empty_binary_directory";} + virtual const char* GetName() const { return "ctest_empty_binary_directory";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "empties the binary directory"; } @@ -61,7 +61,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " ctest_empty_binary_directory( directory )\n" diff -Nru cmake-2.8.7/Source/CTest/cmCTestMemCheckCommand.h cmake-2.8.9/Source/CTest/cmCTestMemCheckCommand.h --- cmake-2.8.7/Source/CTest/cmCTestMemCheckCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestMemCheckCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -41,12 +41,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "ctest_memcheck";} + virtual const char* GetName() const { return "ctest_memcheck";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Run tests with a dynamic analysis tool."; } @@ -54,7 +54,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " ctest_memcheck([BUILD build_dir] [RETURN_VALUE res] [APPEND]\n" diff -Nru cmake-2.8.7/Source/CTest/cmCTestMemCheckHandler.cxx cmake-2.8.9/Source/CTest/cmCTestMemCheckHandler.cxx --- cmake-2.8.7/Source/CTest/cmCTestMemCheckHandler.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestMemCheckHandler.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -358,7 +358,7 @@ os << "\t\t\n" - << logTag << memcheckstr << std::endl + << logTag << cmXMLSafe(memcheckstr) << std::endl << "\t\n"; this->WriteTestResultFooter(os, result); if ( current < cc ) @@ -679,7 +679,7 @@ " bytes in [0-9,]+ blocks are definitely lost" " in loss record [0-9,]+ of [0-9,]+"); cmsys::RegularExpression vgPAR( - "== .*Syscall param .* contains unaddressable byte\\(s\\)"); + "== .*Syscall param .* (contains|points to) unaddressable byte\\(s\\)"); cmsys::RegularExpression vgMPK1( "== .*[0-9,]+ bytes in [0-9,]+ blocks are possibly lost in" " loss record [0-9,]+ of [0-9,]+"); diff -Nru cmake-2.8.7/Source/CTest/cmCTestReadCustomFilesCommand.h cmake-2.8.9/Source/CTest/cmCTestReadCustomFilesCommand.h --- cmake-2.8.7/Source/CTest/cmCTestReadCustomFilesCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestReadCustomFilesCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -46,12 +46,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "ctest_read_custom_files";} + virtual const char* GetName() const { return "ctest_read_custom_files";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "read CTestCustom files."; } @@ -59,7 +59,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " ctest_read_custom_files( directory ... )\n" diff -Nru cmake-2.8.7/Source/CTest/cmCTestRunScriptCommand.h cmake-2.8.9/Source/CTest/cmCTestRunScriptCommand.h --- cmake-2.8.7/Source/CTest/cmCTestRunScriptCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestRunScriptCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -47,12 +47,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "ctest_run_script";} + virtual const char* GetName() const { return "ctest_run_script";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "runs a ctest -S script"; } @@ -60,7 +60,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " ctest_run_script([NEW_PROCESS] script_file_name script_file_name1 \n" diff -Nru cmake-2.8.7/Source/CTest/cmCTestRunTest.cxx cmake-2.8.9/Source/CTest/cmCTestRunTest.cxx --- cmake-2.8.7/Source/CTest/cmCTestRunTest.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestRunTest.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -671,7 +671,7 @@ if (environment && environment->size()>0) { - cmSystemTools::AppendEnv(environment); + cmSystemTools::AppendEnv(*environment); } return this->TestProcess->StartProcess(); diff -Nru cmake-2.8.7/Source/CTest/cmCTestScriptHandler.cxx cmake-2.8.9/Source/CTest/cmCTestScriptHandler.cxx --- cmake-2.8.7/Source/CTest/cmCTestScriptHandler.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestScriptHandler.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -435,6 +435,15 @@ return 2; } + // Add definitions of variables passed in on the command line: + const std::map &defs = + this->CTest->GetDefinitions(); + for (std::map::const_iterator it = defs.begin(); + it != defs.end(); ++it) + { + this->Makefile->AddDefinition(it->first.c_str(), it->second.c_str()); + } + // finally read in the script if (!this->Makefile->ReadListFile(0, script.c_str()) || cmSystemTools::GetErrorOccuredFlag()) @@ -643,11 +652,7 @@ { 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 -Nru cmake-2.8.7/Source/CTest/cmCTestSleepCommand.h cmake-2.8.9/Source/CTest/cmCTestSleepCommand.h --- cmake-2.8.7/Source/CTest/cmCTestSleepCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestSleepCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -47,12 +47,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "ctest_sleep";} + virtual const char* GetName() const { return "ctest_sleep";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "sleeps for some amount of time"; } @@ -60,7 +60,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " ctest_sleep()\n" diff -Nru cmake-2.8.7/Source/CTest/cmCTestStartCommand.h cmake-2.8.9/Source/CTest/cmCTestStartCommand.h --- cmake-2.8.7/Source/CTest/cmCTestStartCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestStartCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -55,12 +55,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "ctest_start";} + virtual const char* GetName() const { return "ctest_start";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Starts the testing for a given model"; } @@ -68,7 +68,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " ctest_start(Model [TRACK ] [APPEND] [source [binary]])\n" diff -Nru cmake-2.8.7/Source/CTest/cmCTestSubmitCommand.h cmake-2.8.9/Source/CTest/cmCTestSubmitCommand.h --- cmake-2.8.7/Source/CTest/cmCTestSubmitCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestSubmitCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -48,12 +48,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "ctest_submit";} + virtual const char* GetName() const { return "ctest_submit";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Submit results to a dashboard server."; } @@ -61,7 +61,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " ctest_submit([PARTS ...] [FILES ...] [RETRY_COUNT count] " diff -Nru cmake-2.8.7/Source/CTest/cmCTestTestCommand.h cmake-2.8.9/Source/CTest/cmCTestTestCommand.h --- cmake-2.8.7/Source/CTest/cmCTestTestCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestTestCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -39,12 +39,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "ctest_test";} + virtual const char* GetName() const { return "ctest_test";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Run tests in the project build tree."; } @@ -52,7 +52,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " ctest_test([BUILD build_dir] [APPEND]\n" diff -Nru cmake-2.8.7/Source/CTest/cmCTestTestHandler.cxx cmake-2.8.9/Source/CTest/cmCTestTestHandler.cxx --- cmake-2.8.7/Source/CTest/cmCTestTestHandler.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestTestHandler.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -59,11 +59,11 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "subdirs";} + virtual const char* GetName() const { return "subdirs";} // Unused methods - virtual const char* GetTerseDocumentation() { return ""; } - virtual const char* GetFullDocumentation() { return ""; } + virtual const char* GetTerseDocumentation() const { return ""; } + virtual const char* GetFullDocumentation() const { return ""; } cmTypeMacro(cmCTestSubdirCommand, cmCommand); @@ -161,11 +161,11 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "add_subdirectory";} + virtual const char* GetName() const { return "add_subdirectory";} // Unused methods - virtual const char* GetTerseDocumentation() { return ""; } - virtual const char* GetFullDocumentation() { return ""; } + virtual const char* GetTerseDocumentation() const { return ""; } + virtual const char* GetFullDocumentation() const { return ""; } cmTypeMacro(cmCTestAddSubdirectoryCommand, cmCommand); @@ -251,11 +251,11 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "ADD_TEST";} + virtual const char* GetName() const { return "ADD_TEST";} // Unused methods - virtual const char* GetTerseDocumentation() { return ""; } - virtual const char* GetFullDocumentation() { return ""; } + virtual const char* GetTerseDocumentation() const { return ""; } + virtual const char* GetFullDocumentation() const { return ""; } cmTypeMacro(cmCTestAddTestCommand, cmCommand); @@ -299,11 +299,11 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "SET_TESTS_PROPERTIES";} + virtual const char* GetName() const { return "SET_TESTS_PROPERTIES";} // Unused methods - virtual const char* GetTerseDocumentation() { return ""; } - virtual const char* GetFullDocumentation() { return ""; } + virtual const char* GetTerseDocumentation() const { return ""; } + virtual const char* GetFullDocumentation() const { return ""; } cmTypeMacro(cmCTestSetTestsPropertiesCommand, cmCommand); diff -Nru cmake-2.8.7/Source/CTest/cmCTestUpdateCommand.h cmake-2.8.9/Source/CTest/cmCTestUpdateCommand.h --- cmake-2.8.7/Source/CTest/cmCTestUpdateCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestUpdateCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -39,12 +39,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "ctest_update";} + virtual const char* GetName() const { return "ctest_update";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Update the work tree from version control."; } @@ -52,7 +52,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " ctest_update([SOURCE source] [RETURN_VALUE res])\n" diff -Nru cmake-2.8.7/Source/CTest/cmCTestUploadCommand.h cmake-2.8.9/Source/CTest/cmCTestUploadCommand.h --- cmake-2.8.7/Source/CTest/cmCTestUploadCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmCTestUploadCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -43,12 +43,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "ctest_upload";} + virtual const char* GetName() const { return "ctest_upload";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Upload files to a dashboard server."; } @@ -56,7 +56,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " ctest_upload(FILES ...)\n" diff -Nru cmake-2.8.7/Source/CTest/cmParseCacheCoverage.cxx cmake-2.8.9/Source/CTest/cmParseCacheCoverage.cxx --- cmake-2.8.7/Source/CTest/cmParseCacheCoverage.cxx 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmParseCacheCoverage.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Source/CTest/cmParseCacheCoverage.h cmake-2.8.9/Source/CTest/cmParseCacheCoverage.h --- cmake-2.8.7/Source/CTest/cmParseCacheCoverage.h 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmParseCacheCoverage.h 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Source/CTest/cmParseGTMCoverage.cxx cmake-2.8.9/Source/CTest/cmParseGTMCoverage.cxx --- cmake-2.8.7/Source/CTest/cmParseGTMCoverage.cxx 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmParseGTMCoverage.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Source/CTest/cmParseGTMCoverage.h cmake-2.8.9/Source/CTest/cmParseGTMCoverage.h --- cmake-2.8.7/Source/CTest/cmParseGTMCoverage.h 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmParseGTMCoverage.h 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Source/CTest/cmParseMumpsCoverage.cxx cmake-2.8.9/Source/CTest/cmParseMumpsCoverage.cxx --- cmake-2.8.7/Source/CTest/cmParseMumpsCoverage.cxx 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmParseMumpsCoverage.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Source/CTest/cmParseMumpsCoverage.h cmake-2.8.9/Source/CTest/cmParseMumpsCoverage.h --- cmake-2.8.7/Source/CTest/cmParseMumpsCoverage.h 1970-01-01 00:00:00.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmParseMumpsCoverage.h 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Source/CTest/cmParsePHPCoverage.h cmake-2.8.9/Source/CTest/cmParsePHPCoverage.h --- cmake-2.8.7/Source/CTest/cmParsePHPCoverage.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CTest/cmParsePHPCoverage.h 2012-08-09 18:15:19.000000000 +0000 @@ -37,9 +37,6 @@ 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 -Nru cmake-2.8.7/Source/CursesDialog/ccmake.cxx cmake-2.8.9/Source/CursesDialog/ccmake.cxx --- cmake-2.8.7/Source/CursesDialog/ccmake.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CursesDialog/ccmake.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -102,6 +102,7 @@ { cmSystemTools::FindExecutableDirectory(argv[0]); cmDocumentation doc; + doc.addCMakeStandardDocSections(); if(doc.CheckOptions(argc, argv)) { cmake hcm; diff -Nru cmake-2.8.7/Source/CursesDialog/cmCursesMainForm.cxx cmake-2.8.9/Source/CursesDialog/cmCursesMainForm.cxx --- cmake-2.8.7/Source/CursesDialog/cmCursesMainForm.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/CursesDialog/cmCursesMainForm.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -409,12 +409,11 @@ char thirdLine[512]=""; if (process) { - sprintf(firstLine, - " "); - sprintf(secondLine, - " "); - sprintf(thirdLine, - " "); + const char* clearLine = + " "; + strcpy(firstLine, clearLine); + strcpy(secondLine, clearLine); + strcpy(thirdLine, clearLine); } else { diff -Nru cmake-2.8.7/Source/QtDialog/AddCacheEntry.cxx cmake-2.8.9/Source/QtDialog/AddCacheEntry.cxx --- cmake-2.8.7/Source/QtDialog/AddCacheEntry.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/QtDialog/AddCacheEntry.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -15,7 +15,7 @@ #include static const int NumTypes = 4; -static const QString TypeStrings[NumTypes] = +static const QByteArray TypeStrings[NumTypes] = { "BOOL", "PATH", "FILEPATH", "STRING" }; static const QCMakeProperty::PropertyType Types[NumTypes] = { QCMakeProperty::BOOL, QCMakeProperty::PATH, diff -Nru cmake-2.8.7/Source/QtDialog/CMakeLists.txt cmake-2.8.9/Source/QtDialog/CMakeLists.txt --- cmake-2.8.7/Source/QtDialog/CMakeLists.txt 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/QtDialog/CMakeLists.txt 2012-08-09 18:15:19.000000000 +0000 @@ -10,11 +10,11 @@ # See the License for more information. #============================================================================= PROJECT(QtDialog) -SET(QT_MIN_VERSION "4.3.0") +SET(QT_MIN_VERSION "4.4.0") FIND_PACKAGE(Qt4 REQUIRED) IF(NOT QT4_FOUND) - MESSAGE(SEND_ERROR "Failed to find Qt 4.3 or greater.") + MESSAGE(SEND_ERROR "Failed to find Qt 4.4 or greater.") ELSE(NOT QT4_FOUND) INCLUDE(${QT_USE_FILE}) @@ -36,14 +36,14 @@ QMacInstallDialog.cxx QMacInstallDialog.h ) - QT4_WRAP_UI(UI_SRCS + QT4_WRAP_UI(UI_SRCS CMakeSetupDialog.ui Compilers.ui CrossCompiler.ui AddCacheEntry.ui MacInstallDialog.ui ) - QT4_WRAP_CPP(MOC_SRCS + QT4_WRAP_CPP(MOC_SRCS AddCacheEntry.h Compilers.h CMakeSetupDialog.h @@ -76,7 +76,7 @@ SET_TARGET_PROPERTIES(cmake-gui PROPERTIES OUTPUT_NAME ${CMAKE_BUNDLE_NAME}) ENDIF(APPLE) - SET(CMAKE_INSTALL_DESTINATION_ARGS + SET(CMAKE_INSTALL_DESTINATION_ARGS BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}") ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) @@ -112,11 +112,12 @@ endif(APPLE) install(CODE " include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\") + set(BU_CHMOD_BUNDLE_ITEMS ON) fixup_bundle(\"${fixup_exe}\" \"\" \"${QT_LIBRARY_DIR};${QT_BINARY_DIR}\") ") endif(APPLE OR WIN32) CONFIGURE_FILE("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in" - "${QtDialog_BINARY_DIR}/QtDialogCPack.cmake" @ONLY) + "${QtDialog_BINARY_DIR}/QtDialogCPack.cmake" @ONLY) ENDIF(NOT QT4_FOUND) diff -Nru cmake-2.8.7/Source/QtDialog/CMakeSetup.cxx cmake-2.8.9/Source/QtDialog/CMakeSetup.cxx --- cmake-2.8.7/Source/QtDialog/CMakeSetup.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/QtDialog/CMakeSetup.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -64,6 +64,7 @@ // check docs first so that X is not need to get docs // do docs, if args were given cmDocumentation doc; + doc.addCMakeStandardDocSections(); if(argc >1 && doc.CheckOptions(argc, argv)) { // Construct and print requested documentation. @@ -124,7 +125,7 @@ // pick up translation files if they exists in the data directory QDir translationsDir = cmExecDir; - translationsDir.cd(".." CMAKE_DATA_DIR); + translationsDir.cd(QString::fromLocal8Bit(".." CMAKE_DATA_DIR)); translationsDir.cd("i18n"); QTranslator translator; QString transfile = QString("cmake_%1").arg(QLocale::system().name()); @@ -156,15 +157,15 @@ arg.Parse(); if(!sourceDirectory.empty() && !binaryDirectory.empty()) { - dialog.setSourceDirectory(sourceDirectory.c_str()); - dialog.setBinaryDirectory(binaryDirectory.c_str()); + dialog.setSourceDirectory(QString::fromLocal8Bit(sourceDirectory.c_str())); + dialog.setBinaryDirectory(QString::fromLocal8Bit(binaryDirectory.c_str())); } else { QStringList args = app.arguments(); if(args.count() == 2) { - cmsys_stl::string filePath = cmSystemTools::CollapseFullPath(args[1].toAscii().data()); + cmsys_stl::string filePath = cmSystemTools::CollapseFullPath(args[1].toLocal8Bit().data()); // check if argument is a directory containing CMakeCache.txt cmsys_stl::string buildFilePath = @@ -183,12 +184,18 @@ if(cmSystemTools::FileExists(buildFilePath.c_str())) { - dialog.setBinaryDirectory(cmSystemTools::GetFilenamePath(buildFilePath).c_str()); + dialog.setBinaryDirectory( + QString::fromLocal8Bit( + cmSystemTools::GetFilenamePath(buildFilePath).c_str() + ) + ); } else if(cmSystemTools::FileExists(srcFilePath.c_str())) { - dialog.setSourceDirectory(filePath.c_str()); - dialog.setBinaryDirectory(cmSystemTools::CollapseFullPath(".").c_str()); + dialog.setSourceDirectory(QString::fromLocal8Bit(filePath.c_str())); + dialog.setBinaryDirectory( + QString::fromLocal8Bit(cmSystemTools::CollapseFullPath(".").c_str()) + ); } } } diff -Nru cmake-2.8.7/Source/QtDialog/CMakeSetupDialog.cxx cmake-2.8.9/Source/QtDialog/CMakeSetupDialog.cxx --- cmake-2.8.7/Source/QtDialog/CMakeSetupDialog.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/QtDialog/CMakeSetupDialog.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -288,7 +288,7 @@ // wait for thread to stop this->CMakeThread->quit(); - this->CMakeThread->wait(2000); + this->CMakeThread->wait(); } bool CMakeSetupDialog::prepareConfigure() @@ -299,9 +299,8 @@ if(!dir.exists()) { QString msg = tr("Build directory does not exist, " - "should I create it?") - + "\n\n" - + tr("Directory: "); + "should I create it?\n\n" + "Directory: "); msg += bindir; QString title = tr("Create Directory"); QMessageBox::StandardButton btn; @@ -490,9 +489,9 @@ // don't close if we're busy, unless the user really wants to if(this->CurrentState == Configuring) { - QString msg = "You are in the middle of a Configure.\n" + QString msg = tr("You are in the middle of a Configure.\n" "If you Exit now the configure information will be lost.\n" - "Are you sure you want to Exit?"; + "Are you sure you want to Exit?"); QString title = tr("Confirm Exit"); QMessageBox::StandardButton btn; btn = QMessageBox::critical(this, title, msg, @@ -554,8 +553,7 @@ void CMakeSetupDialog::doInterrupt() { this->enterState(Interrupting); - QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(), - "interrupt", Qt::QueuedConnection); + this->CMakeThread->cmakeInstance()->interrupt(); } void CMakeSetupDialog::doSourceBrowse() @@ -716,33 +714,33 @@ QString mode = dialog.getCrossIncludeMode(); m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE", - "CMake Find Include Mode", mode, false); + tr("CMake Find Include Mode"), mode, false); mode = dialog.getCrossLibraryMode(); m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY", - "CMake Find Library Mode", mode, false); + tr("CMake Find Library Mode"), mode, false); mode = dialog.getCrossProgramMode(); m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM", - "CMake Find Program Mode", mode, false); + tr("CMake Find Program Mode"), mode, false); QString rootPath = dialog.getCrossRoot(); m->insertProperty(QCMakeProperty::PATH, "CMAKE_FIND_ROOT_PATH", - "CMake Find Root Path", rootPath, false); + tr("CMake Find Root Path"), rootPath, false); QString systemName = dialog.getSystemName(); m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_NAME", - "CMake System Name", systemName, false); + tr("CMake System Name"), systemName, false); QString cxxCompiler = dialog.getCXXCompiler(); m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER", - "CXX compiler.", cxxCompiler, false); + tr("CXX compiler."), cxxCompiler, false); QString cCompiler = dialog.getCCompiler(); m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER", - "C compiler.", cCompiler, false); + tr("C compiler."), cCompiler, false); } else if(dialog.crossCompilerToolChainFile()) { QString toolchainFile = dialog.getCrossCompilerToolChainFile(); m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE", - "Cross Compile ToolChain File", toolchainFile, false); + tr("Cross Compile ToolChain File"), toolchainFile, false); } return true; } @@ -773,7 +771,7 @@ void CMakeSetupDialog::doDeleteCache() { QString title = tr("Delete Cache"); - QString msg = "Are you sure you want to delete the cache?"; + QString msg = tr("Are you sure you want to delete the cache?"); QMessageBox::StandardButton btn; btn = QMessageBox::information(this, title, msg, QMessageBox::Yes | QMessageBox::No); @@ -787,9 +785,9 @@ void CMakeSetupDialog::doAbout() { - QString msg = "CMake %1\n" + QString msg = tr("CMake %1\n" "Using Qt %2\n" - "www.cmake.org"; + "www.cmake.org"); msg = msg.arg(cmVersion::GetCMakeVersion()); msg = msg.arg(qVersion()); diff -Nru cmake-2.8.7/Source/QtDialog/FirstConfigure.cxx cmake-2.8.9/Source/QtDialog/FirstConfigure.cxx --- cmake-2.8.7/Source/QtDialog/FirstConfigure.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/QtDialog/FirstConfigure.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -17,10 +17,10 @@ l->addWidget(this->GeneratorOptions); l->addSpacing(6); - this->CompilerSetupOptions[0] = new QRadioButton("Use default native compilers", this); - this->CompilerSetupOptions[1] = new QRadioButton("Specify native compilers", this); - this->CompilerSetupOptions[2] = new QRadioButton("Specify toolchain file for cross-compiling", this); - this->CompilerSetupOptions[3] = new QRadioButton("Specify options for cross-compiling", this); + this->CompilerSetupOptions[0] = new QRadioButton(tr("Use default native compilers"), this); + this->CompilerSetupOptions[1] = new QRadioButton(tr("Specify native compilers"), this); + this->CompilerSetupOptions[2] = new QRadioButton(tr("Specify toolchain file for cross-compiling"), this); + this->CompilerSetupOptions[3] = new QRadioButton(tr("Specify options for cross-compiling"), this); l->addWidget(this->CompilerSetupOptions[0]); l->addWidget(this->CompilerSetupOptions[1]); l->addWidget(this->CompilerSetupOptions[2]); @@ -159,9 +159,9 @@ // fill in combo boxes QStringList modes; - modes << "Search in Target Root, then native system"; - modes << "Search only in Target Root"; - modes << "Search only in native system"; + modes << tr("Search in Target Root, then native system"); + modes << tr("Search only in Target Root"); + modes << tr("Search only in native system"); crossProgramMode->addItems(modes); crossLibraryMode->addItems(modes); crossIncludeMode->addItems(modes); diff -Nru cmake-2.8.7/Source/QtDialog/QCMake.cxx cmake-2.8.9/Source/QtDialog/QCMake.cxx --- cmake-2.8.7/Source/QtDialog/QCMake.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/QtDialog/QCMake.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -46,16 +46,16 @@ } #endif - QString cmakeCommand = QString("cmake")+cmSystemTools::GetExecutableExtension(); + QString cmakeCommand = QString("cmake")+QString::fromLocal8Bit(cmSystemTools::GetExecutableExtension()); cmakeCommand = execDir.filePath(cmakeCommand); cmSystemTools::DisableRunCommandOutput(); cmSystemTools::SetRunCommandHideConsole(true); cmSystemTools::SetErrorCallback(QCMake::errorCallback, this); - cmSystemTools::FindExecutableDirectory(cmakeCommand.toAscii().data()); + cmSystemTools::FindExecutableDirectory(cmakeCommand.toLocal8Bit().data()); this->CMakeInstance = new cmake; - this->CMakeInstance->SetCMakeCommand(cmakeCommand.toAscii().data()); + this->CMakeInstance->SetCMakeCommand(cmakeCommand.toLocal8Bit().data()); #if defined(Q_OS_MAC) this->CMakeInstance->SetCMakeEditCommand("cmake-gui.app/Contents/MacOS/cmake-gui"); #else @@ -63,6 +63,8 @@ #endif this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this); + cmSystemTools::SetInterruptCallback(QCMake::interruptCallback, this); + std::vector generators; this->CMakeInstance->GetRegisteredGenerators(generators); std::vector::iterator iter; @@ -77,7 +79,7 @@ { continue; } - this->AvailableGenerators.append(iter->c_str()); + this->AvailableGenerators.append(QString::fromLocal8Bit(iter->c_str())); } } @@ -95,7 +97,7 @@ void QCMake::setSourceDirectory(const QString& _dir) { QString dir = - cmSystemTools::GetActualCaseForPath(_dir.toAscii().data()).c_str(); + QString::fromLocal8Bit(cmSystemTools::GetActualCaseForPath(_dir.toLocal8Bit().data()).c_str()); if(this->SourceDirectory != dir) { this->SourceDirectory = QDir::fromNativeSeparators(dir); @@ -106,7 +108,7 @@ void QCMake::setBinaryDirectory(const QString& _dir) { QString dir = - cmSystemTools::GetActualCaseForPath(_dir.toAscii().data()).c_str(); + QString::fromLocal8Bit(cmSystemTools::GetActualCaseForPath(_dir.toLocal8Bit().data()).c_str()); if(this->BinaryDirectory != dir) { this->BinaryDirectory = QDir::fromNativeSeparators(dir); @@ -130,14 +132,14 @@ cmCacheManager::CacheIterator itm = cachem->NewIterator(); if ( itm.Find("CMAKE_HOME_DIRECTORY")) { - setSourceDirectory(itm.GetValue()); + setSourceDirectory(QString::fromLocal8Bit(itm.GetValue())); } if ( itm.Find("CMAKE_GENERATOR")) { const char* extraGen = cachem->GetCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: CreateFullGeneratorName(itm.GetValue(), extraGen); - this->setGenerator(curGen.c_str()); + this->setGenerator(QString::fromLocal8Bit(curGen.c_str())); } } } @@ -158,18 +160,19 @@ UINT lastErrorMode = SetErrorMode(0); #endif - this->CMakeInstance->SetHomeDirectory(this->SourceDirectory.toAscii().data()); - this->CMakeInstance->SetStartDirectory(this->SourceDirectory.toAscii().data()); - this->CMakeInstance->SetHomeOutputDirectory(this->BinaryDirectory.toAscii().data()); - this->CMakeInstance->SetStartOutputDirectory(this->BinaryDirectory.toAscii().data()); + this->CMakeInstance->SetHomeDirectory(this->SourceDirectory.toLocal8Bit().data()); + this->CMakeInstance->SetStartDirectory(this->SourceDirectory.toLocal8Bit().data()); + this->CMakeInstance->SetHomeOutputDirectory(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->SetStartOutputDirectory(this->BinaryDirectory.toLocal8Bit().data()); this->CMakeInstance->SetGlobalGenerator( - this->CMakeInstance->CreateGlobalGenerator(this->Generator.toAscii().data())); + this->CMakeInstance->CreateGlobalGenerator(this->Generator.toLocal8Bit().data())); this->CMakeInstance->LoadCache(); this->CMakeInstance->SetSuppressDevWarnings(this->SuppressDevWarnings); this->CMakeInstance->SetWarnUninitialized(this->WarnUninitializedMode); this->CMakeInstance->SetWarnUnused(this->WarnUnusedMode); this->CMakeInstance->PreLoadCMakeFiles(); + InterruptFlag = 0; cmSystemTools::ResetErrorOccuredFlag(); int err = this->CMakeInstance->Configure(); @@ -188,7 +191,9 @@ UINT lastErrorMode = SetErrorMode(0); #endif + InterruptFlag = 0; cmSystemTools::ResetErrorOccuredFlag(); + int err = this->CMakeInstance->Generate(); #ifdef Q_OS_WIN @@ -217,11 +222,11 @@ } QCMakeProperty prop; - prop.Key = i.GetName(); + prop.Key = QString::fromLocal8Bit(i.GetName()); int idx = props.indexOf(prop); if(idx == -1) { - toremove.append(i.GetName()); + toremove.append(QString::fromLocal8Bit(i.GetName())); } else { @@ -232,7 +237,7 @@ } else { - i.SetValue(prop.Value.toString().toAscii().data()); + i.SetValue(prop.Value.toString().toLocal8Bit().data()); } props.removeAt(idx); } @@ -242,47 +247,47 @@ // remove some properites foreach(QString s, toremove) { - this->CMakeInstance->UnwatchUnusedCli(s.toAscii().data()); + this->CMakeInstance->UnwatchUnusedCli(s.toLocal8Bit().data()); - cachem->RemoveCacheEntry(s.toAscii().data()); + cachem->RemoveCacheEntry(s.toLocal8Bit().data()); } // add some new properites foreach(QCMakeProperty s, props) { - this->CMakeInstance->WatchUnusedCli(s.Key.toAscii().data()); + this->CMakeInstance->WatchUnusedCli(s.Key.toLocal8Bit().data()); if(s.Type == QCMakeProperty::BOOL) { - this->CMakeInstance->AddCacheEntry(s.Key.toAscii().data(), + this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toBool() ? "ON" : "OFF", - s.Help.toAscii().data(), + s.Help.toLocal8Bit().data(), cmCacheManager::BOOL); } else if(s.Type == QCMakeProperty::STRING) { - this->CMakeInstance->AddCacheEntry(s.Key.toAscii().data(), - s.Value.toString().toAscii().data(), - s.Help.toAscii().data(), + this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), + s.Value.toString().toLocal8Bit().data(), + s.Help.toLocal8Bit().data(), cmCacheManager::STRING); } else if(s.Type == QCMakeProperty::PATH) { - this->CMakeInstance->AddCacheEntry(s.Key.toAscii().data(), - s.Value.toString().toAscii().data(), - s.Help.toAscii().data(), + this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), + s.Value.toString().toLocal8Bit().data(), + s.Help.toLocal8Bit().data(), cmCacheManager::PATH); } else if(s.Type == QCMakeProperty::FILEPATH) { - this->CMakeInstance->AddCacheEntry(s.Key.toAscii().data(), - s.Value.toString().toAscii().data(), - s.Help.toAscii().data(), + this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), + s.Value.toString().toLocal8Bit().data(), + s.Help.toLocal8Bit().data(), cmCacheManager::FILEPATH); } } - cachem->SaveCache(this->BinaryDirectory.toAscii().data()); + cachem->SaveCache(this->BinaryDirectory.toLocal8Bit().data()); } QCMakePropertyList QCMake::properties() const @@ -302,9 +307,9 @@ } QCMakeProperty prop; - prop.Key = i.GetName(); - prop.Help = i.GetProperty("HELPSTRING"); - prop.Value = i.GetValue(); + prop.Key = QString::fromLocal8Bit(i.GetName()); + prop.Help = QString::fromLocal8Bit(i.GetProperty("HELPSTRING")); + prop.Value = QString::fromLocal8Bit(i.GetValue()); prop.Advanced = i.GetPropertyAsBool("ADVANCED"); if(i.GetType() == cmCacheManager::BOOL) @@ -325,7 +330,7 @@ prop.Type = QCMakeProperty::STRING; if (i.PropertyExists("STRINGS")) { - prop.Strings = QString(i.GetProperty("STRINGS")).split(";"); + prop.Strings = QString::fromLocal8Bit(i.GetProperty("STRINGS")).split(";"); } } @@ -337,7 +342,13 @@ void QCMake::interrupt() { - cmSystemTools::SetFatalErrorOccured(); + this->InterruptFlag.ref(); +} + +bool QCMake::interruptCallback(void* cd) +{ + QCMake* self = reinterpret_cast(cd); + return self->InterruptFlag; } void QCMake::progressCallback(const char* msg, float percent, void* cd) @@ -345,11 +356,11 @@ QCMake* self = reinterpret_cast(cd); if(percent >= 0) { - emit self->progressChanged(msg, percent); + emit self->progressChanged(QString::fromLocal8Bit(msg), percent); } else { - emit self->outputMessage(msg); + emit self->outputMessage(QString::fromLocal8Bit(msg)); } QCoreApplication::processEvents(); } @@ -358,7 +369,7 @@ bool& /*stop*/, void* cd) { QCMake* self = reinterpret_cast(cd); - emit self->errorMessage(msg); + emit self->errorMessage(QString::fromLocal8Bit(msg)); QCoreApplication::processEvents(); } @@ -385,9 +396,9 @@ void QCMake::deleteCache() { // delete cache - this->CMakeInstance->GetCacheManager()->DeleteCache(this->BinaryDirectory.toAscii().data()); + this->CMakeInstance->GetCacheManager()->DeleteCache(this->BinaryDirectory.toLocal8Bit().data()); // reload to make our cache empty - this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toAscii().data()); + this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); // emit no generator and no properties this->setGenerator(QString()); QCMakePropertyList props = this->properties(); @@ -400,7 +411,7 @@ QCMakePropertyList props; emit this->propertiesChanged(props); // reload - this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toAscii().data()); + this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); // emit new cache properties props = this->properties(); emit this->propertiesChanged(props); diff -Nru cmake-2.8.7/Source/QtDialog/QCMake.h cmake-2.8.9/Source/QtDialog/QCMake.h --- cmake-2.8.7/Source/QtDialog/QCMake.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/QtDialog/QCMake.h 2012-08-09 18:15:19.000000000 +0000 @@ -23,6 +23,7 @@ #include #include #include +#include class cmake; @@ -78,7 +79,7 @@ void generate(); /// set the property values void setProperties(const QCMakePropertyList&); - /// interrupt the configure or generate process + /// interrupt the configure or generate process (if connecting, make a direct connection) void interrupt(); /// delete the cache in binary directory void deleteCache(); @@ -133,6 +134,7 @@ protected: cmake* CMakeInstance; + static bool interruptCallback(void*); static void progressCallback(const char* msg, float percent, void* cd); static void errorCallback(const char* msg, const char* title, bool&, void* cd); @@ -145,6 +147,7 @@ QString Generator; QStringList AvailableGenerators; QString CMakeExecutable; + QAtomicInt InterruptFlag; }; #endif // __QCMake_h diff -Nru cmake-2.8.7/Source/QtDialog/QMacInstallDialog.cxx cmake-2.8.9/Source/QtDialog/QMacInstallDialog.cxx --- cmake-2.8.7/Source/QtDialog/QMacInstallDialog.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/QtDialog/QMacInstallDialog.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -34,12 +34,11 @@ { QDir installDir(this->Internals->InstallPrefix->text()); QString installTo = installDir.path(); - if(!cmSystemTools::FileExists(installTo.toAscii().data())) + if(!cmSystemTools::FileExists(installTo.toLocal8Bit().data())) { QString message = tr("Build install does not exist, " - "should I create it?") - + "\n\n" - + tr("Directory: "); + "should I create it?\n\n" + "Directory: "); message += installDir.path(); QString title = tr("Create Directory"); QMessageBox::StandardButton btn; @@ -47,7 +46,7 @@ QMessageBox::Yes | QMessageBox::No); if(btn == QMessageBox::Yes) { - cmSystemTools::MakeDirectory(installTo.toAscii().data()); + cmSystemTools::MakeDirectory(installTo.toLocal8Bit().data()); } } QDir cmExecDir(QApplication::applicationDirPath()); @@ -66,14 +65,14 @@ newName += "/"; newName += filename; // Remove the old files - if(cmSystemTools::FileExists(newName.toAscii().data())) + if(cmSystemTools::FileExists(newName.toLocal8Bit().data())) { - std::cout << "rm [" << newName.toAscii().data() << "]\n"; - if(!cmSystemTools::RemoveFile(newName.toAscii().data())) + std::cout << "rm [" << newName.toLocal8Bit().data() << "]\n"; + if(!cmSystemTools::RemoveFile(newName.toLocal8Bit().data())) { QString message = tr("Failed to remove file " "installation may be incomplete: "); - message += newName.toAscii().data(); + message += newName; QString title = tr("Error Removing file"); QMessageBox::StandardButton btn = QMessageBox::critical(this, title, message, @@ -84,14 +83,14 @@ } } } - std::cout << "ln -s [" << file.toAscii().data() << "] ["; - std::cout << newName.toAscii().data() << "]\n"; - if(!cmSystemTools::CreateSymlink(file.toAscii().data(), - newName.toAscii().data())) + std::cout << "ln -s [" << file.toLocal8Bit().data() << "] ["; + std::cout << newName.toLocal8Bit().data() << "]\n"; + if(!cmSystemTools::CreateSymlink(file.toLocal8Bit().data(), + newName.toLocal8Bit().data())) { QString message = tr("Failed create symlink " "installation may be incomplete: "); - message += newName.toAscii().data(); + message += newName; QString title = tr("Error Creating Symlink"); QMessageBox::StandardButton btn = QMessageBox::critical(this, title, message, diff -Nru cmake-2.8.7/Source/cmAddCustomCommandCommand.h cmake-2.8.9/Source/cmAddCustomCommandCommand.h --- cmake-2.8.7/Source/cmAddCustomCommandCommand.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmAddCustomCommandCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -44,12 +44,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() {return "add_custom_command";} + virtual const char* GetName() const {return "add_custom_command";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Add a custom build rule to the generated build system."; } @@ -57,7 +57,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return "There are two main signatures for add_custom_command " diff -Nru cmake-2.8.7/Source/cmAddCustomTargetCommand.h cmake-2.8.9/Source/cmAddCustomTargetCommand.h --- cmake-2.8.7/Source/cmAddCustomTargetCommand.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmAddCustomTargetCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -42,13 +42,13 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() + virtual const char* GetName() const {return "add_custom_target";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Add a target with no output so it will always be built."; } @@ -56,7 +56,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " add_custom_target(Name [ALL] [command1 [args1...]]\n" diff -Nru cmake-2.8.7/Source/cmAddDefinitionsCommand.h cmake-2.8.9/Source/cmAddDefinitionsCommand.h --- cmake-2.8.7/Source/cmAddDefinitionsCommand.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmAddDefinitionsCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -41,12 +41,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() {return "add_definitions";} + virtual const char* GetName() const {return "add_definitions";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Adds -D define flags to the compilation of source files."; } @@ -54,7 +54,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " add_definitions(-DFOO -DBAR ...)\n" diff -Nru cmake-2.8.7/Source/cmAddDependenciesCommand.h cmake-2.8.9/Source/cmAddDependenciesCommand.h --- cmake-2.8.7/Source/cmAddDependenciesCommand.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmAddDependenciesCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -40,12 +40,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "add_dependencies";} + virtual const char* GetName() const { return "add_dependencies";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Add a dependency between top-level targets."; } @@ -53,7 +53,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " add_dependencies(target-name depend-target1\n" diff -Nru cmake-2.8.7/Source/cmAddExecutableCommand.cxx cmake-2.8.9/Source/cmAddExecutableCommand.cxx --- cmake-2.8.7/Source/cmAddExecutableCommand.cxx 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmAddExecutableCommand.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -29,6 +29,7 @@ bool use_macbundle = false; bool excludeFromAll = false; bool importTarget = false; + bool importGlobal = false; while ( s != args.end() ) { if (*s == "WIN32") @@ -51,6 +52,11 @@ ++s; importTarget = true; } + else if(importTarget && *s == "GLOBAL") + { + ++s; + importGlobal = true; + } else { break; @@ -92,7 +98,8 @@ } // Create the imported target. - this->Makefile->AddImportedTarget(exename.c_str(), cmTarget::EXECUTABLE); + this->Makefile->AddImportedTarget(exename.c_str(), cmTarget::EXECUTABLE, + importGlobal); return true; } diff -Nru cmake-2.8.7/Source/cmAddExecutableCommand.h cmake-2.8.9/Source/cmAddExecutableCommand.h --- cmake-2.8.7/Source/cmAddExecutableCommand.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmAddExecutableCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -41,12 +41,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "add_executable";} + virtual const char* GetName() const { return "add_executable";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Add an executable to the project using the specified source files."; @@ -55,7 +55,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " add_executable( [WIN32] [MACOSX_BUNDLE]\n" @@ -92,12 +92,12 @@ "\n" "The add_executable command can also create IMPORTED executable " "targets using this signature:\n" - " add_executable( IMPORTED)\n" + " add_executable( IMPORTED [GLOBAL])\n" "An IMPORTED executable target references an executable file located " "outside the project. " "No rules are generated to build it. " "The target name has scope in the directory in which it is created " - "and below. " + "and below, but the GLOBAL option extends visibility. " "It may be referenced like any target built within the project. " "IMPORTED executables are useful for convenient reference from " "commands like add_custom_command. " diff -Nru cmake-2.8.7/Source/cmAddLibraryCommand.cxx cmake-2.8.9/Source/cmAddLibraryCommand.cxx --- cmake-2.8.7/Source/cmAddLibraryCommand.cxx 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmAddLibraryCommand.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -31,6 +31,7 @@ } bool excludeFromAll = false; bool importTarget = false; + bool importGlobal = false; std::vector::const_iterator s = args.begin(); @@ -63,6 +64,12 @@ type = cmTarget::MODULE_LIBRARY; haveSpecifiedType = true; } + else if(libType == "OBJECT") + { + ++s; + type = cmTarget::OBJECT_LIBRARY; + haveSpecifiedType = true; + } else if(libType == "UNKNOWN") { ++s; @@ -79,6 +86,11 @@ ++s; importTarget = true; } + else if(importTarget && *s == "GLOBAL") + { + ++s; + importGlobal = true; + } else { break; @@ -90,16 +102,17 @@ 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; } @@ -112,6 +125,14 @@ this->SetError("called with IMPORTED argument but no library type."); return false; } + if(type == cmTarget::OBJECT_LIBRARY) + { + this->Makefile->IssueMessage( + cmake::FATAL_ERROR, + "The OBJECT library type may not be used for IMPORTED libraries." + ); + return true; + } // Make sure the target does not already exist. if(this->Makefile->FindTargetToUse(libName.c_str())) @@ -124,7 +145,7 @@ } // Create the imported target. - this->Makefile->AddImportedTarget(libName.c_str(), type); + this->Makefile->AddImportedTarget(libName.c_str(), type, importGlobal); return true; } diff -Nru cmake-2.8.7/Source/cmAddLibraryCommand.h cmake-2.8.9/Source/cmAddLibraryCommand.h --- cmake-2.8.7/Source/cmAddLibraryCommand.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmAddLibraryCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -41,12 +41,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "add_library";} + virtual const char* GetName() const { return "add_library";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Add a library to the project using the specified source files."; } @@ -54,7 +54,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " add_library( [STATIC | SHARED | MODULE]\n" @@ -96,12 +96,13 @@ "\n" "The add_library command can also create IMPORTED library " "targets using this signature:\n" - " add_library( IMPORTED)\n" + " add_library( IMPORTED\n" + " [GLOBAL])\n" "An IMPORTED library target references a library file located " "outside the project. " "No rules are generated to build it. " "The target name has scope in the directory in which it is created " - "and below. " + "and below, but the GLOBAL option extends visibility. " "It may be referenced like any target built within the project. " "IMPORTED libraries are useful for convenient reference from " "commands like target_link_libraries. " @@ -111,6 +112,26 @@ "(and its per-configuration version IMPORTED_LOCATION_) " "which specifies the location of the main library file on disk. " "See documentation of the IMPORTED_* properties for more information." + "\n" + "The signature\n" + " add_library( OBJECT ...)\n" + "creates a special \"object library\" target. " + "An object library compiles source files but does not archive or link " + "their object files into a library. " + "Instead other targets created by add_library or add_executable may " + "reference the objects using an expression of the form " + "$ as a source, where \"objlib\" is the " + "object library name. " + "For example:\n" + " add_library(... $ ...)\n" + " add_executable(... $ ...)\n" + "will include objlib's object files in a library and an executable " + "along with those compiled from their own sources. " + "Object libraries may contain only sources (and headers) that compile " + "to object files. " + "They may contain custom commands generating such sources, but not " + "PRE_BUILD, PRE_LINK, or POST_BUILD commands. " + "Object libraries cannot be imported, exported, installed, or linked." ; } diff -Nru cmake-2.8.7/Source/cmAddSubDirectoryCommand.h cmake-2.8.9/Source/cmAddSubDirectoryCommand.h --- cmake-2.8.7/Source/cmAddSubDirectoryCommand.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmAddSubDirectoryCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -42,12 +42,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "add_subdirectory";} + virtual const char* GetName() const { return "add_subdirectory";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Add a subdirectory to the build."; } @@ -55,7 +55,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " add_subdirectory(source_dir [binary_dir] \n" diff -Nru cmake-2.8.7/Source/cmAddTestCommand.h cmake-2.8.9/Source/cmAddTestCommand.h --- cmake-2.8.7/Source/cmAddTestCommand.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmAddTestCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -41,12 +41,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "add_test";} + virtual const char* GetName() const { return "add_test";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Add a test to the project with the specified arguments."; } @@ -54,7 +54,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " add_test(testname Exename arg1 arg2 ... )\n" diff -Nru cmake-2.8.7/Source/cmArchiveWrite.cxx cmake-2.8.9/Source/cmArchiveWrite.cxx --- cmake-2.8.7/Source/cmArchiveWrite.cxx 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmArchiveWrite.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -240,6 +240,7 @@ // 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: "; @@ -247,10 +248,14 @@ return false; } - // Content. - if(size_t size = static_cast(archive_entry_size(e))) + // do not copy content of symlink + if (!archive_entry_symlink(e)) { - return this->AddData(file, size); + // Content. + if(size_t size = static_cast(archive_entry_size(e))) + { + return this->AddData(file, size); + } } return true; } diff -Nru cmake-2.8.7/Source/cmAuxSourceDirectoryCommand.h cmake-2.8.9/Source/cmAuxSourceDirectoryCommand.h --- cmake-2.8.7/Source/cmAuxSourceDirectoryCommand.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmAuxSourceDirectoryCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -44,12 +44,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "aux_source_directory";} + virtual const char* GetName() const { return "aux_source_directory";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Find all source files in a directory."; } @@ -57,7 +57,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " aux_source_directory( )\n" diff -Nru cmake-2.8.7/Source/cmBootstrapCommands.cxx cmake-2.8.9/Source/cmBootstrapCommands.cxx --- cmake-2.8.7/Source/cmBootstrapCommands.cxx 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmBootstrapCommands.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -12,7 +12,7 @@ // This file is used to compile all the commands // that CMake knows about at compile time. // This is sort of a boot strapping approach since you would -// like to have CMake to build CMake. +// like to have CMake to build CMake. #include "cmCommands.h" #include "cmAddCustomCommandCommand.cxx" #include "cmAddCustomTargetCommand.cxx" @@ -38,6 +38,7 @@ #include "cmEndFunctionCommand.cxx" #include "cmEndIfCommand.cxx" #include "cmEndMacroCommand.cxx" +#include "cmEndWhileCommand.cxx" #include "cmExecProgramCommand.cxx" #include "cmExecuteProcessCommand.cxx" #include "cmExternalMakefileProjectGenerator.cxx" @@ -91,6 +92,7 @@ #include "cmTryCompileCommand.cxx" #include "cmTryRunCommand.cxx" #include "cmUnsetCommand.cxx" +#include "cmWhileCommand.cxx" void GetBootstrapCommands(std::list& commands) { @@ -111,11 +113,12 @@ commands.push_back(new cmDefinePropertyCommand); commands.push_back(new cmElseCommand); commands.push_back(new cmEnableLanguageCommand); - commands.push_back(new cmEnableTestingCommand); + commands.push_back(new cmEnableTestingCommand); commands.push_back(new cmEndForEachCommand); commands.push_back(new cmEndFunctionCommand); commands.push_back(new cmEndIfCommand); commands.push_back(new cmEndMacroCommand); + commands.push_back(new cmEndWhileCommand); commands.push_back(new cmExecProgramCommand); commands.push_back(new cmExecuteProcessCommand); commands.push_back(new cmFileCommand); @@ -164,4 +167,5 @@ commands.push_back(new cmTryCompileCommand); commands.push_back(new cmTryRunCommand); commands.push_back(new cmUnsetCommand); + commands.push_back(new cmWhileCommand); } diff -Nru cmake-2.8.7/Source/cmBreakCommand.h cmake-2.8.9/Source/cmBreakCommand.h --- cmake-2.8.7/Source/cmBreakCommand.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmBreakCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -40,17 +40,17 @@ /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() { return true; } + virtual bool IsScriptable() const { return true; } /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() {return "break";} + virtual const char* GetName() const {return "break";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Break from an enclosing foreach or while loop."; } @@ -58,7 +58,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " break()\n" diff -Nru cmake-2.8.7/Source/cmBuildCommand.h cmake-2.8.9/Source/cmBuildCommand.h --- cmake-2.8.7/Source/cmBuildCommand.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmBuildCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -50,12 +50,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() {return "build_command";} + virtual const char* GetName() const {return "build_command";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Get the command line to build this project."; } @@ -63,7 +63,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " build_command(\n" diff -Nru cmake-2.8.7/Source/cmBuildNameCommand.h cmake-2.8.9/Source/cmBuildNameCommand.h --- cmake-2.8.7/Source/cmBuildNameCommand.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmBuildNameCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -40,17 +40,17 @@ /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() { return true; } + virtual bool IsScriptable() const { return true; } /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() {return "build_name";} + virtual const char* GetName() const {return "build_name";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Deprecated. Use ${CMAKE_SYSTEM} and ${CMAKE_CXX_COMPILER} instead."; @@ -59,7 +59,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " build_name(variable)\n" @@ -69,7 +69,7 @@ } /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() + virtual bool IsDiscouraged() const { return true; } diff -Nru cmake-2.8.7/Source/cmCMakeMinimumRequired.h cmake-2.8.9/Source/cmCMakeMinimumRequired.h --- cmake-2.8.7/Source/cmCMakeMinimumRequired.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmCMakeMinimumRequired.h 2012-08-09 18:15:19.000000000 +0000 @@ -40,17 +40,17 @@ /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() { return true; } + virtual bool IsScriptable() const { return true; } /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() {return "cmake_minimum_required";} + virtual const char* GetName() const {return "cmake_minimum_required";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Set the minimum required version of cmake for a project."; } @@ -58,7 +58,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " cmake_minimum_required(VERSION major[.minor[.patch[.tweak]]]\n" diff -Nru cmake-2.8.7/Source/cmCMakePolicyCommand.h cmake-2.8.9/Source/cmCMakePolicyCommand.h --- cmake-2.8.7/Source/cmCMakePolicyCommand.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmCMakePolicyCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -41,17 +41,17 @@ /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() { return true; } + virtual bool IsScriptable() const { return true; } /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() {return "cmake_policy";} + virtual const char* GetName() const {return "cmake_policy";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Manage CMake Policy settings."; } @@ -59,7 +59,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return "As CMake evolves it is sometimes necessary to change existing " diff -Nru cmake-2.8.7/Source/cmCTest.cxx cmake-2.8.9/Source/cmCTest.cxx --- cmake-2.8.7/Source/cmCTest.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmCTest.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -48,7 +48,7 @@ #include #include -#include // auto_ptr +#include #include #include @@ -509,7 +509,7 @@ 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 @@ 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 @@ } 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 @@ "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 @@ *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 @@ } cmsysProcess_Delete(cp); - if (modifyEnv) - { - cmSystemTools::RestoreEnv(origEnv); - } - return result; } @@ -1951,29 +1944,6 @@ } else { - cmCTestLog(this, ERROR_MESSAGE, - "CTest -D called with incorrect option: " - << targ << std::endl); - cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl - << " " << "ctest" << " -D Continuous" << std::endl - << " " << "ctest" - << " -D Continuous(Start|Update|Configure|Build)" << std::endl - << " " << "ctest" - << " -D Continuous(Test|Coverage|MemCheck|Submit)" - << std::endl - << " " << "ctest" << " -D Experimental" << std::endl - << " " << "ctest" - << " -D Experimental(Start|Update|Configure|Build)" - << std::endl - << " " << "ctest" - << " -D Experimental(Test|Coverage|MemCheck|Submit)" - << std::endl - << " " << "ctest" << " -D Nightly" << std::endl - << " " << "ctest" - << " -D Nightly(Start|Update|Configure|Build)" << std::endl - << " " << "ctest" - << " -D Nightly(Test|Coverage|MemCheck|Submit)" << std::endl - << " " << "ctest" << " -D NightlyMemoryCheck" << std::endl); return false; } return true; @@ -1981,6 +1951,27 @@ //---------------------------------------------------------------------- +void cmCTest::ErrorMessageUnknownDashDValue(std::string &val) +{ + cmCTestLog(this, ERROR_MESSAGE, + "CTest -D called with incorrect option: " << val << std::endl); + + cmCTestLog(this, ERROR_MESSAGE, + "Available options are:" << std::endl + << " ctest -D Continuous" << std::endl + << " ctest -D Continuous(Start|Update|Configure|Build)" << std::endl + << " ctest -D Continuous(Test|Coverage|MemCheck|Submit)" << std::endl + << " ctest -D Experimental" << std::endl + << " ctest -D Experimental(Start|Update|Configure|Build)" << std::endl + << " ctest -D Experimental(Test|Coverage|MemCheck|Submit)" << std::endl + << " ctest -D Nightly" << std::endl + << " ctest -D Nightly(Start|Update|Configure|Build)" << std::endl + << " ctest -D Nightly(Test|Coverage|MemCheck|Submit)" << std::endl + << " ctest -D NightlyMemoryCheck" << std::endl); +} + + +//---------------------------------------------------------------------- bool cmCTest::CheckArgument(const std::string& arg, const char* varg1, const char* varg2) { @@ -2239,13 +2230,29 @@ } //---------------------------------------------------------------------- +bool cmCTest::AddVariableDefinition(const std::string &arg) +{ + std::string name; + std::string value; + cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + + if (cmCacheManager::ParseEntry(arg.c_str(), name, value, type)) + { + this->Definitions[name] = value; + return true; + } + + return false; +} + +//---------------------------------------------------------------------- // the main entry point of ctest, called from main int cmCTest::Run(std::vector &args, std::string* output) { this->FindRunningCMake(); const char* ctestExec = "ctest"; bool cmakeAndTest = false; - bool performSomeTest = true; + bool executeTests = true; bool SRArgumentSpecified = false; // copy the command line @@ -2270,14 +2277,29 @@ this->ProduceXML = true; i++; std::string targ = args[i]; - // AddTestsForDashboard parses the dashborad type and converts it + // AddTestsForDashboard parses the dashboard type and converts it // into the separate stages if (!this->AddTestsForDashboardType(targ)) { - performSomeTest = false; + if (!this->AddVariableDefinition(targ)) + { + this->ErrorMessageUnknownDashDValue(targ); + executeTests = false; + } } } + // If it's not exactly -D, but it starts with -D, then try to parse out + // a variable definition from it, same as CMake does. Unsuccessful + // attempts are simply ignored since previous ctest versions ignore + // this too. (As well as many other unknown command line args.) + // + if(arg != "-D" && cmSystemTools::StringStartsWith(arg.c_str(), "-D")) + { + std::string input = arg.substr(2); + this->AddVariableDefinition(input); + } + if(this->CheckArgument(arg, "-T", "--test-action") && (i < args.size() -1) ) { @@ -2285,7 +2307,7 @@ i++; if ( !this->SetTest(args[i].c_str(), false) ) { - performSomeTest = false; + executeTests = false; cmCTestLog(this, ERROR_MESSAGE, "CTest -T called with incorrect option: " << args[i].c_str() << std::endl); @@ -2323,7 +2345,7 @@ } else { - performSomeTest = false; + executeTests = false; cmCTestLog(this, ERROR_MESSAGE, "CTest -M called with incorrect option: " << str.c_str() << std::endl); @@ -2394,8 +2416,7 @@ return retv; } - // if some tests must be run - if(performSomeTest) + if(executeTests) { int res; // call process directory diff -Nru cmake-2.8.7/Source/cmCTest.h cmake-2.8.9/Source/cmCTest.h --- cmake-2.8.7/Source/cmCTest.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmCTest.h 2012-08-09 18:15:19.000000000 +0000 @@ -417,6 +417,12 @@ bool GetLabelSummary() { return this->LabelSummary;} std::string GetCostDataFile(); + + const std::map &GetDefinitions() + { + return this->Definitions; + } + private: std::string ConfigType; std::string ScheduleType; @@ -516,6 +522,12 @@ //! parse the option after -D and convert it into the appropriate steps bool AddTestsForDashboardType(std::string &targ); + //! read as "emit an error message for an unknown -D value" + void ErrorMessageUnknownDashDValue(std::string &val); + + //! add a variable definition from a command line -D value + bool AddVariableDefinition(const std::string &arg); + //! parse and process most common command line arguments void HandleCommandLineArguments(size_t &i, std::vector &args); @@ -558,6 +570,8 @@ int OutputLogFileLastTag; bool OutputTestOutputOnTestFailure; + + std::map Definitions; }; class cmCTestLogWrite diff -Nru cmake-2.8.7/Source/cmCacheManager.cxx cmake-2.8.9/Source/cmCacheManager.cxx --- cmake-2.8.7/Source/cmCacheManager.cxx 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmCacheManager.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -13,6 +13,7 @@ #include "cmCacheManager.h" #include "cmSystemTools.h" #include "cmCacheManager.h" +#include "cmGeneratedFileStream.h" #include "cmMakefile.h" #include "cmake.h" #include "cmVersion.h" @@ -431,9 +432,8 @@ { std::string cacheFile = path; cacheFile += "/CMakeCache.txt"; - std::string tempFile = cacheFile; - tempFile += ".tmp"; - std::ofstream fout(tempFile.c_str()); + cmGeneratedFileStream fout(cacheFile.c_str()); + fout.SetCopyIfDifferent(true); if(!fout) { cmSystemTools::Error("Unable to open cache file for save. ", @@ -561,10 +561,7 @@ } } fout << "\n"; - fout.close(); - cmSystemTools::CopyFileIfDifferent(tempFile.c_str(), - cacheFile.c_str()); - cmSystemTools::RemoveFile(tempFile.c_str()); + fout.Close(); std::string checkCacheFile = path; checkCacheFile += cmake::GetCMakeFilesDirectory(); cmSystemTools::MakeDirectory(checkCacheFile.c_str()); diff -Nru cmake-2.8.7/Source/cmCommand.h cmake-2.8.9/Source/cmCommand.h --- cmake-2.8.7/Source/cmCommand.h 2011-12-30 16:49:56.000000000 +0000 +++ cmake-2.8.9/Source/cmCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -96,7 +96,7 @@ /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() + virtual bool IsScriptable() const { return false; } @@ -105,25 +105,36 @@ * This determines if usage of the method is discouraged or not. * This is currently only used for generating the documentation. */ - virtual bool IsDiscouraged() + virtual bool IsDiscouraged() const { return false; } /** + * This is used to avoid including this command + * in documentation. This is mainly used by + * cmMacroHelperCommand and cmFunctionHelperCommand + * which cannot provide appropriate documentation. + */ + virtual bool ShouldAppearInDocumentation() const + { + return true; + } + + /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() = 0; + virtual const char* GetName() const = 0; /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() = 0; + virtual const char* GetTerseDocumentation() const = 0; /** * More documentation. */ - virtual const char* GetFullDocumentation() = 0; + virtual const char* GetFullDocumentation() const = 0; /** * Enable the command. @@ -140,7 +151,7 @@ /** * Query whether the command is enabled. */ - bool GetEnabled() + bool GetEnabled() const {return this->Enabled;} /** diff -Nru cmake-2.8.7/Source/cmCommandArgumentParserHelper.h cmake-2.8.9/Source/cmCommandArgumentParserHelper.h --- cmake-2.8.7/Source/cmCommandArgumentParserHelper.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmCommandArgumentParserHelper.h 2012-08-09 18:15:19.000000000 +0000 @@ -81,7 +81,6 @@ cmStdString InputBuffer; std::vector OutputBuffer; int CurrentLine; - int UnionsAvailable; int Verbose; void Print(const char* place, const char* str); diff -Nru cmake-2.8.7/Source/cmCommandArgumentsHelper.cxx cmake-2.8.9/Source/cmCommandArgumentsHelper.cxx --- cmake-2.8.7/Source/cmCommandArgumentsHelper.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmCommandArgumentsHelper.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -178,7 +178,7 @@ void cmCAString::DoReset() { - this->String = this->DefaultString; + this->String = ""; } cmCAEnabler::cmCAEnabler(cmCommandArgumentsHelper* args, diff -Nru cmake-2.8.7/Source/cmCommandArgumentsHelper.h cmake-2.8.9/Source/cmCommandArgumentsHelper.h --- cmake-2.8.7/Source/cmCommandArgumentsHelper.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmCommandArgumentsHelper.h 2012-08-09 18:15:19.000000000 +0000 @@ -125,11 +125,8 @@ /// Return the string const std::string& GetString() const {return this->String;} const char* GetCString() const {return this->String.c_str();} - void SetDefaultString(const char* text) - {this->DefaultString = (text ? text : "");} private: std::string String; - std::string DefaultString; unsigned int DataStart; virtual bool DoConsume(const std::string& arg, unsigned int index); virtual void DoReset(); diff -Nru cmake-2.8.7/Source/cmCommands.cxx cmake-2.8.9/Source/cmCommands.cxx --- cmake-2.8.7/Source/cmCommands.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmCommands.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -14,7 +14,6 @@ #include "cmAuxSourceDirectoryCommand.cxx" #include "cmBuildNameCommand.cxx" #include "cmElseIfCommand.cxx" -#include "cmEndWhileCommand.cxx" #include "cmExportCommand.cxx" #include "cmExportLibraryDependencies.cxx" #include "cmFLTKWrapUICommand.cxx" @@ -34,7 +33,6 @@ #include "cmVariableRequiresCommand.cxx" #include "cmVariableWatchCommand.cxx" -#include "cmWhileCommand.cxx" #include "cmWriteFileCommand.cxx" // This one must be last because it includes windows.h and @@ -53,7 +51,6 @@ commands.push_back(new cmAuxSourceDirectoryCommand); commands.push_back(new cmBuildNameCommand); commands.push_back(new cmElseIfCommand); - commands.push_back(new cmEndWhileCommand); commands.push_back(new cmExportCommand); commands.push_back(new cmExportLibraryDependenciesCommand); commands.push_back(new cmFLTKWrapUICommand); @@ -73,7 +70,6 @@ commands.push_back(new cmUtilitySourceCommand); commands.push_back(new cmVariableRequiresCommand); commands.push_back(new cmVariableWatchCommand); - commands.push_back(new cmWhileCommand); commands.push_back(new cmWriteFileCommand); #endif } diff -Nru cmake-2.8.7/Source/cmComputeLinkDepends.cxx cmake-2.8.9/Source/cmComputeLinkDepends.cxx --- cmake-2.8.7/Source/cmComputeLinkDepends.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmComputeLinkDepends.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -27,7 +27,7 @@ This file computes an ordered list of link items to use when linking a single target in one configuration. Each link item is identified by the string naming it. A graph of dependencies is created in which -each node corresponds to one item and directed eges lead from nodes to +each node corresponds to one item and directed edges lead from nodes to those which must *follow* them on the link line. For example, the graph @@ -42,7 +42,7 @@ There are two types of items: those with known direct dependencies and those without known dependencies. We will call the two types "known -items" and "unknown items", respecitvely. Known items are those whose +items" and "unknown items", respectively. Known items are those whose names correspond to targets (built or imported) and those for which an old-style _LIB_DEPENDS variable is defined. All other items are unknown and we must infer dependencies for them. For items that look @@ -150,7 +150,7 @@ twice for non-trivial). If at any time another component finishes and re-adds an already pending component, the pending component is reset so that it needs to be seen in its entirety again. This ensures that -all dependencies of a component are satisified no matter where it +all dependencies of a component are satisfied no matter where it appears. After the original link line has been completed, we append to it the @@ -358,7 +358,7 @@ this->AddLinkEntries(depender_index, iface->Libraries); // Handle dependent shared libraries. - this->QueueSharedDependencies(depender_index, iface->SharedDeps); + this->FollowSharedDeps(depender_index, iface); // Support for CMP0003. for(std::vector::const_iterator @@ -379,6 +379,23 @@ //---------------------------------------------------------------------------- void cmComputeLinkDepends +::FollowSharedDeps(int depender_index, cmTarget::LinkInterface const* iface, + bool follow_interface) +{ + // Follow dependencies if we have not followed them already. + if(this->SharedDepFollowed.insert(depender_index).second) + { + if(follow_interface) + { + this->QueueSharedDependencies(depender_index, iface->Libraries); + } + this->QueueSharedDependencies(depender_index, iface->SharedDeps); + } +} + +//---------------------------------------------------------------------------- +void +cmComputeLinkDepends ::QueueSharedDependencies(int depender_index, std::vector const& deps) { @@ -430,8 +447,7 @@ entry.Target->GetLinkInterface(this->Config)) { // Follow public and private dependencies transitively. - this->QueueSharedDependencies(index, iface->Libraries); - this->QueueSharedDependencies(index, iface->SharedDeps); + this->FollowSharedDeps(index, iface, true); } } } @@ -617,6 +633,19 @@ tgt = 0; } + if(tgt && tgt->GetType() == cmTarget::OBJECT_LIBRARY) + { + cmOStringStream e; + e << "Target \"" << this->Target->GetName() << "\" links to " + "OBJECT library \"" << tgt->GetName() << "\" but this is not " + "allowed. " + "One may link only to STATIC or SHARED libraries, or to executables " + "with the ENABLE_EXPORTS property set."; + this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(), + this->Target->GetBacktrace()); + tgt = 0; + } + // Return the target found, if any. return tgt; } diff -Nru cmake-2.8.7/Source/cmComputeLinkDepends.h cmake-2.8.9/Source/cmComputeLinkDepends.h --- cmake-2.8.7/Source/cmComputeLinkDepends.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmComputeLinkDepends.h 2012-08-09 18:15:19.000000000 +0000 @@ -105,6 +105,10 @@ int DependerIndex; }; std::queue SharedDepQueue; + std::set SharedDepFollowed; + void FollowSharedDeps(int depender_index, + cmTarget::LinkInterface const* iface, + bool follow_interface = false); void QueueSharedDependencies(int depender_index, std::vector const& deps); void HandleSharedDependency(SharedDepEntry const& dep); diff -Nru cmake-2.8.7/Source/cmComputeLinkInformation.cxx cmake-2.8.9/Source/cmComputeLinkInformation.cxx --- cmake-2.8.7/Source/cmComputeLinkInformation.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmComputeLinkInformation.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -248,6 +248,10 @@ this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator(); this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance(); + // Check whether to recognize OpenBSD-style library versioned names. + this->OpenBSD = this->Makefile->GetCMakeInstance() + ->GetPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING"); + // The configuration being linked. this->Config = config; @@ -973,7 +977,15 @@ } // Finish the list. - libext += ")$"; + libext += ")"; + + // Add an optional OpenBSD version component. + if(this->OpenBSD) + { + libext += "(\\.[0-9]+\\.[0-9]+)?"; + } + + libext += "$"; return libext; } @@ -1760,6 +1772,7 @@ !linking_for_install); bool use_link_rpath = outputRuntime && linking_for_install && + !this->Makefile->IsOn("CMAKE_SKIP_INSTALL_RPATH") && this->Target->GetPropertyAsBool("INSTALL_RPATH_USE_LINK_PATH"); // Construct the RPATH. diff -Nru cmake-2.8.7/Source/cmComputeLinkInformation.h cmake-2.8.9/Source/cmComputeLinkInformation.h --- cmake-2.8.7/Source/cmComputeLinkInformation.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmComputeLinkInformation.h 2012-08-09 18:15:19.000000000 +0000 @@ -128,6 +128,7 @@ cmsys::RegularExpression ExtractSharedLibraryName; cmsys::RegularExpression ExtractAnyLibraryName; std::string SharedRegexString; + bool OpenBSD; void AddLinkPrefix(const char* p); void AddLinkExtension(const char* e, LinkType type); std::string CreateExtensionRegex(std::vector const& exts); diff -Nru cmake-2.8.7/Source/cmComputeTargetDepends.cxx cmake-2.8.9/Source/cmComputeTargetDepends.cxx --- cmake-2.8.7/Source/cmComputeTargetDepends.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmComputeTargetDepends.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -31,7 +31,7 @@ build order is safe. For most target types cyclic dependencies are not allowed. However -STATIC libraries may depend on each other in a cyclic fasion. In +STATIC libraries may depend on each other in a cyclic fashion. In general the directed dependency graph forms a directed-acyclic-graph of strongly connected components. All strongly connected components should consist of only STATIC_LIBRARY targets. diff -Nru cmake-2.8.7/Source/cmConfigureFileCommand.h cmake-2.8.9/Source/cmConfigureFileCommand.h --- cmake-2.8.7/Source/cmConfigureFileCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmConfigureFileCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -34,17 +34,17 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "configure_file";} + virtual const char* GetName() const { return "configure_file";} /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() { return true; } + virtual bool IsScriptable() const { return true; } /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Copy a file to another location and modify its contents."; } @@ -52,7 +52,7 @@ /** * Longer documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " configure_file( \n" diff -Nru cmake-2.8.7/Source/cmCoreTryCompile.cxx cmake-2.8.9/Source/cmCoreTryCompile.cxx --- cmake-2.8.7/Source/cmCoreTryCompile.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmCoreTryCompile.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -26,6 +26,7 @@ const char* sourceDirectory = argv[2].c_str(); const char* projectName = 0; const char* targetName = 0; + char targetNameBuf[64]; int extraArgs = 0; // look for CMAKE_FLAGS and store them @@ -152,11 +153,11 @@ std::string ccFile = this->BinaryDirectory + "/CMakeCache.txt"; cmSystemTools::RemoveFile(ccFile.c_str()); - // we need to create a directory and CMakeList file etc... + // we need to create a directory and CMakeLists file etc... // first create the directories sourceDirectory = this->BinaryDirectory.c_str(); - // now create a CMakeList.txt file in that directory + // now create a CMakeLists.txt file in that directory FILE *fout = fopen(outFileName.c_str(),"w"); if (!fout) { @@ -280,17 +281,25 @@ 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). */ + sprintf(targetNameBuf, "cmTryCompileExec%u", + cmSystemTools::RandomSeed()); + targetName = targetNameBuf; /* Put the executable at a known location (for COPY_FILE). */ fprintf(fout, "SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n", this->BinaryDirectory.c_str()); /* Create the actual executable. */ - fprintf(fout, "ADD_EXECUTABLE(cmTryCompileExec \"%s\")\n",source.c_str()); - fprintf(fout, - "TARGET_LINK_LIBRARIES(cmTryCompileExec ${LINK_LIBRARIES})\n"); + fprintf(fout, "ADD_EXECUTABLE(%s \"%s\")\n", targetName, source.c_str()); + fprintf(fout, "TARGET_LINK_LIBRARIES(%s ${LINK_LIBRARIES})\n",targetName); fclose(fout); projectName = "CMAKE_TRY_COMPILE"; - targetName = "cmTryCompileExec"; // if the source is not in CMakeTmp if(source.find("CMakeTmp") == source.npos) { @@ -399,6 +408,7 @@ if(cmSystemTools::FileIsDirectory(fullPath.c_str())) { this->CleanupFiles(fullPath.c_str()); + cmSystemTools::RemoveADirectory(fullPath.c_str()); } else { diff -Nru cmake-2.8.7/Source/cmCreateTestSourceList.cxx cmake-2.8.9/Source/cmCreateTestSourceList.cxx --- cmake-2.8.7/Source/cmCreateTestSourceList.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmCreateTestSourceList.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -70,7 +70,7 @@ if (cmSystemTools::GetFilenameExtension(*i).size() < 2) { this->SetError( - "You must specify a file extenion for the test driver file."); + "You must specify a file extension for the test driver file."); return false; } std::string driver = this->Makefile->GetCurrentOutputDirectory(); diff -Nru cmake-2.8.7/Source/cmCreateTestSourceList.h cmake-2.8.9/Source/cmCreateTestSourceList.h --- cmake-2.8.7/Source/cmCreateTestSourceList.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmCreateTestSourceList.h 2012-08-09 18:15:19.000000000 +0000 @@ -40,12 +40,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() {return "create_test_sourcelist";} + virtual const char* GetName() const {return "create_test_sourcelist";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Create a test driver and source list for building test programs."; } @@ -53,7 +53,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " create_test_sourcelist(sourceListName driverName\n" diff -Nru cmake-2.8.7/Source/cmDefinePropertyCommand.h cmake-2.8.9/Source/cmDefinePropertyCommand.h --- cmake-2.8.7/Source/cmDefinePropertyCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmDefinePropertyCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -32,12 +32,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "define_property";} + virtual const char* GetName() const { return "define_property";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Define and document custom properties."; } @@ -45,7 +45,7 @@ /** * Longer documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " define_property(LocalGenerator->GetMakefile(); - if(const char* includePath = mf->GetDefinition(includePathVar.c_str())) + includePath = mf->GetDefinition(includePathVar.c_str()); + if(includePath) { cmSystemTools::ExpandListArgument(includePath, this->IncludePath); } + else + { + // Fallback to the old directory level variable if no per-target var: + includePathVar = "CMAKE_"; + includePathVar += lang; + includePathVar += "_INCLUDE_PATH"; + includePath = mf->GetDefinition(includePathVar.c_str()); + if(includePath) + { + cmSystemTools::ExpandListArgument(includePath, this->IncludePath); + } + } } diff -Nru cmake-2.8.7/Source/cmDependsFortran.cxx cmake-2.8.9/Source/cmDependsFortran.cxx --- cmake-2.8.7/Source/cmDependsFortran.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmDependsFortran.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -30,7 +30,7 @@ class cmDependsFortranSourceInfo { public: - // The name of the soruce file. + // The name of the source file. std::string Source; // Set of provided and required modules. @@ -810,8 +810,8 @@ * -GNU * -Intel * - * Eat the stream content until all recompile only realated changes - * are left bedind. + * Eat the stream content until all recompile only related changes + * are left behind. */ if (strcmp(compilerId, "GNU") == 0 ) { @@ -852,7 +852,7 @@ } } - // Compare the remainng content. If no compiler id matched above, + // Compare the remaining content. If no compiler id matched above, // including the case none was given, this will compare the whole // content. if(!cmDependsFortranStreamsDiffer(finModFile, finStampFile)) @@ -1209,7 +1209,7 @@ * cmDependsFortranParser_RuleIf(..) */ - // Allways taken unless an #ifdef or #ifndef-branch has been taken + // Always taken unless an #ifdef or #ifndef-branch has been taken // already. If the second condition isn't meet already // (parser->InPPFalseBranch == 0) correct it. if(!parser->SkipToEnd.empty() && @@ -1228,7 +1228,7 @@ return; } - // parser->InPPFalseBranch is either 0 or 1. We change it denpending on + // parser->InPPFalseBranch is either 0 or 1. We change it depending on // parser->SkipToEnd.top() if(!parser->SkipToEnd.empty() && parser->SkipToEnd.top()) diff -Nru cmake-2.8.7/Source/cmDependsFortranLexer.cxx cmake-2.8.9/Source/cmDependsFortranLexer.cxx --- cmake-2.8.7/Source/cmDependsFortranLexer.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmDependsFortranLexer.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -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 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 @@ #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -169,7 +170,15 @@ /* 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 @@ #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 @@ *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 @@ 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 @@ 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 @@ 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, + 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, - 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 @@ /*--------------------------------------------------------------------------*/ -#line 670 "cmDependsFortranLexer.cxx" +#line 678 "cmDependsFortranLexer.cxx" #define INITIAL 0 #define free_fmt 1 @@ -796,7 +808,12 @@ /* 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 @@ /* 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 @@ 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 @@ 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 @@ 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 @@ 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_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_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 @@ } 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 @@ 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 @@ } case 9: YY_RULE_SETUP -#line 115 "cmDependsFortranLexer.in.l" +#line 111 "cmDependsFortranLexer.in.l" { cmDependsFortranParser_StringAppend(yyextra, yytext[0]); } @@ -1057,96 +1074,99 @@ 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_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 @@ } } 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 @@ 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 @@ 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 @@ } /** 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 @@ } /** 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 @@ #define YYTABLES_NAME "yytables" -#line 180 "cmDependsFortranLexer.in.l" +#line 181 "cmDependsFortranLexer.in.l" diff -Nru cmake-2.8.7/Source/cmDependsFortranLexer.h cmake-2.8.9/Source/cmDependsFortranLexer.h --- cmake-2.8.7/Source/cmDependsFortranLexer.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmDependsFortranLexer.h 2012-08-09 18:15:19.000000000 +0000 @@ -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 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 @@ #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -138,7 +139,15 @@ /* 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 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 @@ /* 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 -Nru cmake-2.8.7/Source/cmDependsFortranLexer.in.l cmake-2.8.9/Source/cmDependsFortranLexer.in.l --- cmake-2.8.7/Source/cmDependsFortranLexer.in.l 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmDependsFortranLexer.in.l 2012-08-09 18:15:19.000000000 +0000 @@ -115,6 +115,11 @@ !.*\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 -Nru cmake-2.8.7/Source/cmDependsFortranParser.cxx cmake-2.8.9/Source/cmDependsFortranParser.cxx --- cmake-2.8.7/Source/cmDependsFortranParser.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmDependsFortranParser.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -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 @@ #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 @@ CPP_TOENDL = 282, UNTERMINATED_STRING = 283, STRING = 284, - WORD = 285 + WORD = 285, + CPP_INCLUDE_ANGLE = 286 }; #endif /* Tokens. */ @@ -248,6 +248,7 @@ #define UNTERMINATED_STRING 283 #define STRING 284 #define WORD 285 +#define CPP_INCLUDE_ANGLE 286 @@ -256,15 +257,15 @@ 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 @@ /* 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 @@ #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 @@ # 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 @@ # 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 @@ ((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 @@ #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 @@ 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 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 @@ "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 @@ 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 @@ /* 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 @@ { \ yychar = (Token); \ yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -839,19 +857,10 @@ #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 @@ # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -1146,115 +1154,142 @@ } # 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) +/* 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. + + 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) { - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - 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) + 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 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; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; + } + } - if (yyresult) + 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_ + } + + yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* 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 @@ } } + /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus @@ -1303,12 +1339,9 @@ #endif /* ! YYPARSE_PARAM */ - - - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ +/*----------. +| yyparse. | +`----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1495,7 +1528,7 @@ /* 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 @@ 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 @@ { 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ } 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 @@ } 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 @@ } 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 @@ } 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 @@ } 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 @@ | 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 @@ #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 @@ 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 @@ 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 @@ -/* Line 1675 of yacc.c */ -#line 283 "cmDependsFortranParser.y" +/* Line 2067 of yacc.c */ +#line 286 "cmDependsFortranParser.y" /* End of grammar */ diff -Nru cmake-2.8.7/Source/cmDependsFortranParser.y cmake-2.8.9/Source/cmDependsFortranParser.y --- cmake-2.8.7/Source/cmDependsFortranParser.y 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmDependsFortranParser.y 2012-08-09 18:15:19.000000000 +0000 @@ -102,6 +102,7 @@ %token CPP_TOENDL %token UNTERMINATED_STRING %token STRING WORD +%token CPP_INCLUDE_ANGLE /*-------------------------------------------------------------------------*/ /* grammar */ @@ -192,6 +193,13 @@ 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 -Nru cmake-2.8.7/Source/cmDependsFortranParserTokens.h cmake-2.8.9/Source/cmDependsFortranParserTokens.h --- cmake-2.8.7/Source/cmDependsFortranParserTokens.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmDependsFortranParserTokens.h 2012-08-09 18:15:19.000000000 +0000 @@ -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 -Nru cmake-2.8.7/Source/cmDocumentVariables.cxx cmake-2.8.9/Source/cmDocumentVariables.cxx --- cmake-2.8.7/Source/cmDocumentVariables.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmDocumentVariables.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -218,7 +218,7 @@ "Full path to ctest command installed with cmake.", "This is the full path to the CTest executable ctest " "which is useful from custom commands that want " - " to use the cmake -E option for portable system " + "to use the cmake -E option for portable system " "commands.",false, "Variables that Provide Information"); @@ -354,8 +354,10 @@ "If true, do not add run time path information.", "If this is set to TRUE, then the rpath information " "is not added to compiled executables. The default " - "is to add rpath information if the platform supports it." - "This allows for easy running from the build tree.",false, + "is to add rpath information if the platform supports it. " + "This allows for easy running from the build tree. To omit RPATH " + "in the install step, but not the build step, use " + "CMAKE_SKIP_INSTALL_RPATH instead.",false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_SOURCE_DIR", cmProperty::VARIABLE, @@ -521,6 +523,16 @@ "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.", "This specifies what prefixes to add to library names when " @@ -746,6 +758,26 @@ "Variables That Change Behavior"); cm->DefineProperty + ("CMAKE_FIND_PACKAGE_WARN_NO_MODULE", cmProperty::VARIABLE, + "Tell find_package to warn if called without an explicit mode.", + "If find_package is called without an explicit mode option " + "(MODULE, CONFIG or NO_MODULE) and no Find.cmake module is " + "in CMAKE_MODULE_PATH then CMake implicitly assumes that the " + "caller intends to search for a package configuration file. " + "If no package configuration file is found then the wording " + "of the failure message must account for both the case that the " + "package is really missing and the case that the project has a " + "bug and failed to provide the intended Find module. " + "If instead the caller specifies an explicit mode option then " + "the failure message can be more specific." + "\n" + "Set CMAKE_FIND_PACKAGE_WARN_NO_MODULE to TRUE to tell find_package " + "to warn when it implicitly assumes Config mode. " + "This helps developers enforce use of an explicit mode in all calls " + "to find_package within a project.", false, + "Variables That Change Behavior"); + + cm->DefineProperty ("CMAKE_USER_MAKE_RULES_OVERRIDE", cmProperty::VARIABLE, "Specify a CMake file that overrides platform information.", "CMake loads the specified file while enabling support for each " @@ -811,6 +843,36 @@ "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 @@ -895,7 +957,7 @@ cm->DefineProperty ("BORLAND", cmProperty::VARIABLE, - "True of the borland compiler is being used.", + "True if the borland compiler is being used.", "This is set to true if the Borland compiler is being used.",false, "Variables That Describe the System"); @@ -1181,6 +1243,20 @@ "Variables that Control the Build"); cm->DefineProperty + ("CMAKE_SKIP_INSTALL_RPATH", cmProperty::VARIABLE, + "Do not include RPATHs in the install tree.", + "Normally CMake uses the build tree for the RPATH when building " + "executables etc on systems that use RPATH. When the software " + "is installed the executables etc are relinked by CMake to have " + "the install RPATH. If this variable is set to true then the software " + "is always installed without RPATH, even if RPATH is enabled when " + "building. This can be useful for example to allow running tests from " + "the build directory with RPATH enabled before the installation step. " + "To omit RPATH in both the build and install steps, use " + "CMAKE_SKIP_RPATH instead.",false, + "Variables that Control the Build"); + + cm->DefineProperty ("CMAKE_EXE_LINKER_FLAGS", cmProperty::VARIABLE, "Linker flags used to create executables.", "Flags used by the linker when creating an executable.",false, @@ -1258,6 +1334,30 @@ "See that target property for additional information.", false, "Variables that Control the Build"); + cm->DefineProperty + ("CMAKE_WIN32_EXECUTABLE", cmProperty::VARIABLE, + "Default value for WIN32_EXECUTABLE of targets.", + "This variable is used to initialize the " + "WIN32_EXECUTABLE property on all the targets. " + "See that target property for additional information.", + false, + "Variables that Control the Build"); + cm->DefineProperty + ("CMAKE_MACOSX_BUNDLE", cmProperty::VARIABLE, + "Default value for MACOSX_BUNDLE of targets.", + "This variable is used to initialize the " + "MACOSX_BUNDLE property on all the targets. " + "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) @@ -1301,6 +1401,15 @@ "Variables for Languages"); cm->DefineProperty + ("CMAKE__COMPILER_VERSION", cmProperty::VARIABLE, + "An internal variable subject to change.", + "Compiler version in major[.minor[.patch[.tweak]]] format. " + "This variable is reserved for internal use by CMake and is not " + "guaranteed to be set.", + false, + "Variables for Languages"); + + cm->DefineProperty ("CMAKE_INTERNAL_PLATFORM_ABI", cmProperty::VARIABLE, "An internal variable subject to change.", "This is used in determining the compiler ABI and is subject to change.", diff -Nru cmake-2.8.7/Source/cmDocumentation.cxx cmake-2.8.9/Source/cmDocumentation.cxx --- cmake-2.8.7/Source/cmDocumentation.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmDocumentation.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -14,7 +14,9 @@ #include "cmSystemTools.h" #include "cmVersion.h" #include +#include +#include //---------------------------------------------------------------------------- static const char *cmDocumentationStandardOptions[][3] = @@ -219,56 +221,8 @@ cmDocumentation::cmDocumentation() :CurrentFormatter(0) { - this->SetForm(TextForm); - - cmDocumentationSection *sec; - - sec = new cmDocumentationSection("Author","AUTHOR"); - sec->Append(cmDocumentationEntry - (0, - "This manual page was generated by the \"--help-man\" option.", - 0)); - this->AllSections["Author"] = sec; - - sec = new cmDocumentationSection("Copyright","COPYRIGHT"); - sec->Append(cmDocumentationCopyright); - this->AllSections["Copyright"] = sec; - - sec = new cmDocumentationSection("See Also","SEE ALSO"); - sec->Append(cmDocumentationStandardSeeAlso); - this->AllSections["Standard See Also"] = sec; - - sec = new cmDocumentationSection("Options","OPTIONS"); - sec->Append(cmDocumentationStandardOptions); - this->AllSections["Options"] = sec; - - sec = new cmDocumentationSection("Properties","PROPERTIES"); - sec->Append(cmPropertiesDocumentationDescription); - this->AllSections["Properties Description"] = sec; - - sec = new cmDocumentationSection("Generators","GENERATORS"); - sec->Append(cmDocumentationGeneratorsHeader); - this->AllSections["Generators"] = sec; - - sec = new cmDocumentationSection("Compatibility Commands", - "COMPATIBILITY COMMANDS"); - sec->Append(cmCompatCommandsDocumentationDescription); - this->AllSections["Compatibility Commands"] = sec; - - - this->PropertySections.push_back("Properties of Global Scope"); - this->PropertySections.push_back("Properties on Directories"); - this->PropertySections.push_back("Properties on Targets"); - this->PropertySections.push_back("Properties on Tests"); - this->PropertySections.push_back("Properties on Source Files"); - this->PropertySections.push_back("Properties on Cache Entries"); - - this->VariableSections.push_back("Variables that Provide Information"); - this->VariableSections.push_back("Variables That Change Behavior"); - this->VariableSections.push_back("Variables That Describe the System"); - this->VariableSections.push_back("Variables that Control the Build"); - this->VariableSections.push_back("Variables for Languages"); - + this->SetForm(TextForm, 0); + this->addCommonStandardDocSections(); this->ShowGenerators = true; } @@ -559,6 +513,8 @@ { if(line.size() && line[0] == '#') { + /* line beginnings with ## are mark-up ignore them */ + if (line.size()>=2 && line[1] == '#') continue; // blank line if(line.size() <= 2) { @@ -638,7 +594,7 @@ i != this->RequestedHelpItems.end(); ++i) { - this->SetForm(i->HelpForm); + this->SetForm(i->HelpForm, i->ManSection); this->CurrentArgument = i->Argument; // If a file name was given, use it. Otherwise, default to the // given stream. @@ -686,7 +642,8 @@ cmDocumentation::Form cmDocumentation::GetFormFromFilename( - const std::string& filename) + const std::string& filename, + int* manSection) { std::string ext = cmSystemTools::GetFilenameLastExtension(filename); ext = cmSystemTools::UpperCase(ext); @@ -703,6 +660,10 @@ // ".1" to ".9" should be manpages if ((ext.length()==2) && (ext[1] >='1') && (ext[1]<='9')) { + if (manSection) + { + *manSection = ext[1] - '0'; + } return cmDocumentation::ManForm; } @@ -710,6 +671,423 @@ } //---------------------------------------------------------------------------- +void cmDocumentation::addCommonStandardDocSections() +{ + cmDocumentationSection *sec; + + sec = new cmDocumentationSection("Author","AUTHOR"); + sec->Append(cmDocumentationEntry + (0, + "This manual page was generated by the \"--help-man\" option.", + 0)); + this->AllSections["Author"] = sec; + + sec = new cmDocumentationSection("Copyright","COPYRIGHT"); + sec->Append(cmDocumentationCopyright); + this->AllSections["Copyright"] = sec; + + sec = new cmDocumentationSection("See Also","SEE ALSO"); + sec->Append(cmDocumentationStandardSeeAlso); + this->AllSections["Standard See Also"] = sec; + + sec = new cmDocumentationSection("Options","OPTIONS"); + sec->Append(cmDocumentationStandardOptions); + this->AllSections["Options"] = sec; + + sec = new cmDocumentationSection("Compatibility Commands", + "COMPATIBILITY COMMANDS"); + sec->Append(cmCompatCommandsDocumentationDescription); + this->AllSections["Compatibility Commands"] = sec; +} + +//---------------------------------------------------------------------------- +void cmDocumentation::addCMakeStandardDocSections() +{ + cmDocumentationSection *sec; + + sec = new cmDocumentationSection("Properties","PROPERTIES"); + sec->Append(cmPropertiesDocumentationDescription); + this->AllSections["Properties Description"] = sec; + + sec = new cmDocumentationSection("Generators","GENERATORS"); + sec->Append(cmDocumentationGeneratorsHeader); + this->AllSections["Generators"] = sec; + + this->PropertySections.push_back("Properties of Global Scope"); + this->PropertySections.push_back("Properties on Directories"); + this->PropertySections.push_back("Properties on Targets"); + this->PropertySections.push_back("Properties on Tests"); + this->PropertySections.push_back("Properties on Source Files"); + this->PropertySections.push_back("Properties on Cache Entries"); + + this->VariableSections.push_back("Variables that Provide Information"); + this->VariableSections.push_back("Variables That Change Behavior"); + this->VariableSections.push_back("Variables That Describe the System"); + this->VariableSections.push_back("Variables that Control the Build"); + this->VariableSections.push_back("Variables for Languages"); + +} + +//---------------------------------------------------------------------------- +void cmDocumentation::addCTestStandardDocSections() +{ + // This is currently done for backward compatibility reason + // We may suppress some of these. + addCMakeStandardDocSections(); +} + +//---------------------------------------------------------------------------- +void cmDocumentation::addCPackStandardDocSections() +{ + cmDocumentationSection *sec; + + sec = new cmDocumentationSection("Generators","GENERATORS"); + sec->Append(cmDocumentationGeneratorsHeader); + this->AllSections["Generators"] = sec; + + this->VariableSections.push_back( + "Variables common to all CPack generators"); +} + +void cmDocumentation::addAutomaticVariableSections(const std::string& section) +{ + std::vector::iterator it; + it = std::find(this->VariableSections.begin(), + this->VariableSections.end(), + section); + /* if the section does not exist then add it */ + if (it==this->VariableSections.end()) + { + this->VariableSections.push_back(section); + } +} +//---------------------------------------------------------------------------- +int cmDocumentation::getDocumentedModulesListInDir( + std::string path, + std::string globExpr, + documentedModulesList_t& docedModuleList) +{ + cmsys::Glob gl; + std::string findExpr; + std::vector files; + std::string line; + documentedModuleSectionPair_t docPair; + int nbDocumentedModules = 0; + + findExpr = path + "/" + globExpr; + if (gl.FindFiles(findExpr)) + { + files = gl.GetFiles(); + for (std::vector::iterator itf=files.begin(); + itf!=files.end();++itf) + { + std::ifstream fin((*itf).c_str()); + // file access trouble ignore it (ignore this kind of error) + if (!fin) continue; + /* read first line in order to get doc section */ + if (cmSystemTools::GetLineFromStream(fin, line)) + { + /* Doc section indicates that + * this file has structured doc in it. + */ + if (line.find("##section")!=std::string::npos) + { + // ok found one more documented module + ++nbDocumentedModules; + docPair.first = *itf; + // 10 is the size of '##section' + 1 + docPair.second = line.substr(10,std::string::npos); + docedModuleList.push_back(docPair); + } + // No else if no section is found (undocumented module) + } + // No else cannot read first line (ignore this kind of error) + line = ""; + } + } + if (nbDocumentedModules>0) + { + return 0; + } + else + { + return 1; + } +} + +//---------------------------------------------------------------------------- +static void trim(std::string& s) +{ + std::string::size_type pos = s.find_last_not_of(' '); + if(pos != std::string::npos) + { + s.erase(pos + 1); + pos = s.find_first_not_of(' '); + if(pos != std::string::npos) s.erase(0, pos); + } + else + { + s.erase(s.begin(), s.end()); + } +} + +int cmDocumentation::GetStructuredDocFromFile( + const char* fname, + std::vector& commands, + cmake* cm) +{ + typedef enum sdoce { + SDOC_NONE, SDOC_MODULE, SDOC_MACRO, SDOC_FUNCTION, SDOC_VARIABLE, + SDOC_SECTION, + SDOC_UNKNOWN} sdoc_t; + int nbDocItemFound = 0; + int docCtxIdx = 0; + std::vector docContextStack(60); + docContextStack[docCtxIdx]=SDOC_NONE; + cmDocumentationEntry e; + std::ifstream fin(fname); + if(!fin) + { + return nbDocItemFound; + } + std::string section; + std::string name; + std::string full; + std::string brief; + std::string line; + bool newCtx = false; /* we've just entered ## context */ + bool inBrief = false; /* we are currently parsing brief desc. */ + bool inFullFirstParagraph = false; /* we are currently parsing full + desc. first paragraph */ + brief = ""; + full = ""; + bool newParagraph = true; + while ( fin && cmSystemTools::GetLineFromStream(fin, line) ) + { + if(line.size() && line[0] == '#') + { + /* handle structured doc context */ + if ((line.size()>=2) && line[1]=='#') + { + /* markup word is following '##' stopping at first space + * Some markup word like 'section' may have more characters + * following but we don't handle those here. + */ + std::string mkword = line.substr(2,line.find(' ',2)-2); + if (mkword=="macro") + { + docCtxIdx++; + docContextStack[docCtxIdx]=SDOC_MACRO; + newCtx = true; + } + else if (mkword=="variable") + { + docCtxIdx++; + docContextStack[docCtxIdx]=SDOC_VARIABLE; + newCtx = true; + } + else if (mkword=="function") + { + docCtxIdx++; + docContextStack[docCtxIdx]=SDOC_FUNCTION; + newCtx = true; + } + else if (mkword=="module") + { + docCtxIdx++; + docContextStack[docCtxIdx]=SDOC_MODULE; + newCtx = true; + } + else if (mkword=="section") + { + docCtxIdx++; + docContextStack[docCtxIdx]=SDOC_SECTION; + // 10 is the size of '##section' + 1 + section = line.substr(10,std::string::npos); + /* drop the rest of the line */ + line = ""; + newCtx = true; + } + else if (mkword.substr(0,3)=="end") + { + switch (docContextStack[docCtxIdx]) { + case SDOC_MACRO: + /* for now MACRO and FUNCTION are handled in the same way */ + case SDOC_FUNCTION: + commands.push_back(cmDocumentationEntry(name.c_str(), + brief.c_str(),full.c_str())); + break; + case SDOC_VARIABLE: + this->addAutomaticVariableSections(section); + cm->DefineProperty + (name.c_str(), cmProperty::VARIABLE, + brief.c_str(), + full.c_str(),false, + section.c_str()); + break; + case SDOC_MODULE: + /* not implemented */ + break; + case SDOC_SECTION: + /* not implemented */ + break; + default: + /* ignore other cases */ + break; + } + docCtxIdx--; + newCtx = false; + ++nbDocItemFound; + } + else + { + // error out unhandled context + return nbDocItemFound; + } + /* context is set go to next doc line */ + continue; + } + + // Now parse the text attached to the context + + // The first line after the context mark-up contains:: + // name - brief until. (brief is dot terminated or + // followed by a blank line) + if (newCtx) + { + // no brief (for easy variable definition) + if (line.find("-")==std::string::npos) + { + name = line.substr(1,std::string::npos); + trim(name); + brief = ""; + inBrief = false; + full = ""; + } + // here we have a name and brief beginning + else + { + name = line.substr(1,line.find("-")-1); + trim(name); + // we are parsing the brief context + brief = line.substr(line.find("-")+1,std::string::npos); + trim(brief); + // Brief may already be terminated on the first line + if (brief.find('.')!=std::string::npos) + { + inBrief = false; + full = brief.substr(brief.find('.')+1,std::string::npos); + trim(full); + inFullFirstParagraph = true; + brief = brief.substr(0,brief.find('.')); + } + // brief is continued on following lines + else + { + inBrief = true; + full = ""; + } + } + newCtx = false; + continue; + } + // blank line + if(line.size() <= 2) + { + if (inBrief) { + inBrief = false; + full = ""; + } else { + if (full.length()>0) + { + full += "\n"; + } + // the first paragraph of full has ended + inFullFirstParagraph = false; + } + newParagraph = true; + } + // brief is terminated by '.' + else if (inBrief && (line.find('.')!=std::string::npos)) + { + /* the brief just ended */ + inBrief = false; + std::string endBrief = line.substr(1,line.find('.')); + trim(endBrief); + trim(brief); + brief += " " + endBrief; + full += line.substr(line.find('.')+1,std::string::npos); + trim(full); + inFullFirstParagraph = true; + } + // we handle full text or multi-line brief. + else + { + std::string* text; + if (inBrief) + { + text = &brief; + } + else + { + text = &full; + } + // two spaces + if(line[1] == ' ' && line[2] == ' ') + { + // there is no "full first paragraph at all." + if (line[3] == ' ') + { + inFullFirstParagraph = false; + } + + if(!newParagraph && !inFullFirstParagraph) + { + *text += "\n"; + newParagraph = true; + } + // Skip #, and leave space for pre-formatted + if (inFullFirstParagraph) + { + std::string temp = line.c_str()+1; + trim(temp); + *text += " " + temp; + } + else + { + *text += line.c_str()+1; + *text += "\n"; + } + } + else if(line[1] == ' ') + { + if(!newParagraph) + { + *text += " "; + } + newParagraph = false; + // skip # and space + *text += line.c_str()+2; + } + else + { + if(!newParagraph) + { + *text += " "; + } + newParagraph = false; + // skip # + *text += line.c_str()+1; + } + } + } + /* next line is not the first context line */ + newCtx = false; + } + return nbDocItemFound; +} + +//---------------------------------------------------------------------------- bool cmDocumentation::CheckOptions(int argc, const char* const* argv, const char* exitOpt) { @@ -755,49 +1133,57 @@ { help.HelpType = cmDocumentation::Properties; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-policies") == 0) { help.HelpType = cmDocumentation::Policies; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-variables") == 0) { help.HelpType = cmDocumentation::Variables; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-modules") == 0) { help.HelpType = cmDocumentation::Modules; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-custom-modules") == 0) { help.HelpType = cmDocumentation::CustomModules; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-commands") == 0) { help.HelpType = cmDocumentation::Commands; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-compatcommands") == 0) { help.HelpType = cmDocumentation::CompatCommands; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-full") == 0) { help.HelpType = cmDocumentation::Full; GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-html") == 0) { @@ -810,6 +1196,7 @@ help.HelpType = cmDocumentation::Full; GET_OPT_ARGUMENT(help.Filename); help.HelpForm = cmDocumentation::ManForm; + help.ManSection = 1; } else if(strcmp(argv[i], "--help-command") == 0) { @@ -817,35 +1204,40 @@ GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); help.Argument = cmSystemTools::LowerCase(help.Argument); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-module") == 0) { help.HelpType = cmDocumentation::SingleModule; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-property") == 0) { help.HelpType = cmDocumentation::SingleProperty; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-policy") == 0) { help.HelpType = cmDocumentation::SinglePolicy; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-variable") == 0) { help.HelpType = cmDocumentation::SingleVariable; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); - help.HelpForm = this->GetFormFromFilename(help.Filename); + help.HelpForm = this->GetFormFromFilename(help.Filename, + &help.ManSection); } else if(strcmp(argv[i], "--help-command-list") == 0) { @@ -896,9 +1288,9 @@ } //---------------------------------------------------------------------------- -void cmDocumentation::Print(Form f, std::ostream& os) +void cmDocumentation::Print(Form f, int manSection, std::ostream& os) { - this->SetForm(f); + this->SetForm(f, manSection); this->Print(os); } @@ -1506,7 +1898,7 @@ } //---------------------------------------------------------------------------- -void cmDocumentation::SetForm(Form f) +void cmDocumentation::SetForm(Form f, int manSection) { switch(f) { @@ -1517,6 +1909,7 @@ this->CurrentFormatter = &this->DocbookFormatter; break; case ManForm: + this->ManFormatter.SetManSection(manSection); this->CurrentFormatter = &this->ManFormatter; break; case TextForm: diff -Nru cmake-2.8.7/Source/cmDocumentation.h cmake-2.8.9/Source/cmDocumentation.h --- cmake-2.8.7/Source/cmDocumentation.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmDocumentation.h 2012-08-09 18:15:19.000000000 +0000 @@ -21,6 +21,7 @@ #include "cmDocumentationFormatterText.h" #include "cmDocumentationFormatterUsage.h" #include "cmDocumentationSection.h" +#include "cmake.h" namespace cmsys { @@ -32,21 +33,36 @@ { public: cmDocumentation(); - + ~cmDocumentation(); + + /** + * An helper type pair for [structured] documented modules. + * The comment of those module contains structure markup + * which makes it possible to retrieve the documentation + * of variables, macros and functions defined in the module. + * - first is the filename of the module + * - second is the section of the doc the module belongs too + */ + typedef std::pair documentedModuleSectionPair_t; + /** + * A list of documented module(s). + */ + typedef std::list documentedModulesList_t; + // High-level interface for standard documents: - + /** * Check command line arguments for documentation options. Returns * true if documentation options are found, and false otherwise. * When true is returned, PrintRequestedDocumentation should be - * called. exitOpt can be used for things like cmake -E, so that + * called. exitOpt can be used for things like cmake -E, so that * all arguments after the -E are ignored and not searched for * help arguments. */ - bool CheckOptions(int argc, const char* const* argv, + bool CheckOptions(int argc, const char* const* argv, const char* exitOpt =0); - + /** * Print help requested on the command line. Call after * CheckOptions returns true. Returns true on success, and false @@ -54,12 +70,12 @@ * command line cannot be written. */ bool PrintRequestedDocumentation(std::ostream& os); - + /** Print help of the given type. */ bool PrintDocumentation(Type ht, std::ostream& os, const char* docname=0); void SetShowGenerators(bool showGen) { this->ShowGenerators = showGen; } - + /** Set the program name for standard document generation. */ void SetName(const char* name); @@ -92,8 +108,8 @@ * Print documentation in the given form. All previously added * sections will be generated. */ - void Print(Form f, std::ostream& os); - + void Print(Form f, int manSection, std::ostream& os); + /** * Print documentation in the current form. All previously added * sections will be generated. @@ -109,24 +125,79 @@ void SetSeeAlsoList(const char *data[][3]); /** Clear all previously added sections of help. */ - void ClearSections(); - + void ClearSections(); + /** Set cmake root so we can find installed files */ void SetCMakeRoot(const char* root) { this->CMakeRoot = root;} /** Set CMAKE_MODULE_PATH so we can find additional cmake modules */ void SetCMakeModulePath(const char* path) { this->CMakeModulePath = path;} - - static Form GetFormFromFilename(const std::string& filename); + static Form GetFormFromFilename(const std::string& filename, + int* ManSection); + + /** Add common (to all tools) documentation section(s) */ + void addCommonStandardDocSections(); + + /** Add the CMake standard documentation section(s) */ + void addCMakeStandardDocSections(); + + /** Add the CTest standard documentation section(s) */ + void addCTestStandardDocSections(); + + /** Add the CPack standard documentation section(s) */ + void addCPackStandardDocSections(); + + /** Add automatic variables sections */ + void addAutomaticVariableSections(const std::string& section); + + /** + * Retrieve the list of documented module located in + * path which match the globing expression globExpr. + * @param[in] path, directory where to start the search + * we will recurse into it. + * @param[in] globExpr, the globing expression used to + * match the file in path. + * @param[out] the list of obtained pairs (may be empty) + * @return 0 on success 1 on error or empty list + */ + int getDocumentedModulesListInDir( + std::string path, + std::string globExpr, + documentedModulesList_t& docModuleList); + + /** + * Get the documentation of macros, functions and variable documented + * with CMake structured documentation in a CMake script. + * (in fact it may be in any file which follow the structured doc format) + * Structured documentation begin with + * ## (double sharp) in column 1 & 2 immediately followed + * by a markup. Those ## are ignored by the legacy module + * documentation parser @see CreateSingleModule. + * Current markup are ##section, ##module, + * ##macro, ##function, ##variable and ##end. + * ##end is closing either of the previous ones. + * @param[in] fname the script file name to be parsed for documentation + * @param[in,out] commands the vector of command/macros documentation + * entry found in the script file. + * @param[in,out] the cmake object instance to which variable documentation + * will be attached (using @see cmake::DefineProperty) + * @param[in] the documentation section in which the property will be + * inserted. + * @return the number of documented items (command and variable) + * found in the file. + */ + int GetStructuredDocFromFile(const char* fname, + std::vector& commands, + cmake* cm); private: - void SetForm(Form f); + void SetForm(Form f, int manSection); void SetDocName(const char* docname); - bool CreateSingleModule(const char* fname, + bool CreateSingleModule(const char* fname, const char* moduleName, cmDocumentationSection &sec); - void CreateModuleDocsForDir(cmsys::Directory& dir, + void CreateModuleDocsForDir(cmsys::Directory& dir, cmDocumentationSection &moduleSection); bool CreateModulesSection(); bool CreateCustomModulesSection(); @@ -166,7 +237,7 @@ std::string NameString; std::string DocName; std::map AllSections; - + std::string SeeAlsoString; std::string CMakeRoot; std::string CMakeModulePath; @@ -177,11 +248,12 @@ struct RequestedHelpItem { - RequestedHelpItem():HelpForm(TextForm), HelpType(None) {} + RequestedHelpItem():HelpForm(TextForm), HelpType(None), ManSection(1) {} cmDocumentationEnums::Form HelpForm; cmDocumentationEnums::Type HelpType; std::string Filename; std::string Argument; + int ManSection; }; std::vector RequestedHelpItems; diff -Nru cmake-2.8.7/Source/cmDocumentationFormatterHTML.cxx cmake-2.8.9/Source/cmDocumentationFormatterHTML.cxx --- cmake-2.8.7/Source/cmDocumentationFormatterHTML.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmDocumentationFormatterHTML.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -127,7 +127,7 @@ { os << "

" << name << "

\n"; + os << "\">" << name << "\n"; } // Is a list needed? @@ -145,7 +145,7 @@ cmDocumentationPrintHTMLId(os, op->Name.c_str()); os << "\">"; this->PrintHTMLEscapes(os, op->Name.c_str()); - os << ""; + os << "\n"; } } os << "\n" ; @@ -167,9 +167,9 @@ { 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 @@ return; } - os << "

Master Index " + os << "

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

\n"; + << "

\n"; if (!sections.empty()) { diff -Nru cmake-2.8.7/Source/cmDocumentationFormatterMan.cxx cmake-2.8.9/Source/cmDocumentationFormatterMan.cxx --- cmake-2.8.7/Source/cmDocumentationFormatterMan.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmDocumentationFormatterMan.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -19,9 +19,15 @@ cmDocumentationFormatterMan::cmDocumentationFormatterMan() :cmDocumentationFormatter() +,ManSection(1) { } +void cmDocumentationFormatterMan::SetManSection(int manSection) +{ + this->ManSection = manSection; +} + void cmDocumentationFormatterMan ::PrintSection(std::ostream& os, const cmDocumentationSection §ion, @@ -32,9 +38,9 @@ os << ".SH " << name << "\n"; } - const std::vector &entries = + const std::vector &entries = section.GetEntries(); - for(std::vector::const_iterator op = entries.begin(); + for(std::vector::const_iterator op = entries.begin(); op != entries.end(); ++op) { if(op->Name.size()) @@ -58,7 +64,7 @@ cmSystemTools::ReplaceString(man_text, "-", "\\-"); } -void cmDocumentationFormatterMan::PrintPreformatted(std::ostream& os, +void cmDocumentationFormatterMan::PrintPreformatted(std::ostream& os, const char* text) { std::string man_text = text; @@ -69,7 +75,7 @@ os << ".fi\n\n"; } -void cmDocumentationFormatterMan::PrintParagraph(std::ostream& os, +void cmDocumentationFormatterMan::PrintParagraph(std::ostream& os, const char* text) { std::string man_text = text; @@ -87,7 +93,7 @@ this->EscapeText(s_docname); this->EscapeText(s_appname); - os << ".TH " << s_docname << " 1 \"" + os << ".TH " << s_docname << " " << this->ManSection << " \"" << cmSystemTools::GetCurrentDateTime("%B %d, %Y").c_str() << "\" \"" << s_appname << " " << cmVersion::GetCMakeVersion() diff -Nru cmake-2.8.7/Source/cmDocumentationFormatterMan.h cmake-2.8.9/Source/cmDocumentationFormatterMan.h --- cmake-2.8.7/Source/cmDocumentationFormatterMan.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmDocumentationFormatterMan.h 2012-08-09 18:15:19.000000000 +0000 @@ -22,6 +22,8 @@ public: cmDocumentationFormatterMan(); + void SetManSection(int manSection); + virtual cmDocumentationEnums::Form GetForm() const { return cmDocumentationEnums::ManForm;} @@ -35,6 +37,7 @@ private: void EscapeText(std::string& man_text); + int ManSection; }; #endif diff -Nru cmake-2.8.7/Source/cmElseCommand.h cmake-2.8.9/Source/cmElseCommand.h --- cmake-2.8.7/Source/cmElseCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmElseCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -40,17 +40,17 @@ /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() { return true; } + virtual bool IsScriptable() const { return true; } /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "else";} + virtual const char* GetName() const { return "else";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Starts the else portion of an if block."; } @@ -58,7 +58,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " else(expression)\n" diff -Nru cmake-2.8.7/Source/cmElseIfCommand.h cmake-2.8.9/Source/cmElseIfCommand.h --- cmake-2.8.7/Source/cmElseIfCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmElseIfCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -40,17 +40,17 @@ /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() { return true; } + virtual bool IsScriptable() const { return true; } /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "elseif";} + virtual const char* GetName() const { return "elseif";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Starts the elseif portion of an if block."; } @@ -58,7 +58,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " elseif(expression)\n" diff -Nru cmake-2.8.7/Source/cmEnableLanguageCommand.h cmake-2.8.9/Source/cmEnableLanguageCommand.h --- cmake-2.8.7/Source/cmEnableLanguageCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmEnableLanguageCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -43,12 +43,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() {return "enable_language";} + virtual const char* GetName() const {return "enable_language";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Enable a language (CXX/C/Fortran/etc)"; } @@ -56,7 +56,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " enable_language(languageName [OPTIONAL] )\n" diff -Nru cmake-2.8.7/Source/cmEnableTestingCommand.h cmake-2.8.9/Source/cmEnableTestingCommand.h --- cmake-2.8.7/Source/cmEnableTestingCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmEnableTestingCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -48,12 +48,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "enable_testing";} + virtual const char* GetName() const { return "enable_testing";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Enable testing for current directory and below."; } @@ -61,7 +61,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " enable_testing()\n" diff -Nru cmake-2.8.7/Source/cmEndForEachCommand.h cmake-2.8.9/Source/cmEndForEachCommand.h --- cmake-2.8.7/Source/cmEndForEachCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmEndForEachCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -47,17 +47,17 @@ /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() { return true; } + virtual bool IsScriptable() const { return true; } /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "endforeach";} + virtual const char* GetName() const { return "endforeach";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Ends a list of commands in a FOREACH block."; } @@ -65,7 +65,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " endforeach(expression)\n" diff -Nru cmake-2.8.7/Source/cmEndFunctionCommand.h cmake-2.8.9/Source/cmEndFunctionCommand.h --- cmake-2.8.7/Source/cmEndFunctionCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmEndFunctionCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -47,17 +47,17 @@ /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() { return true; } + virtual bool IsScriptable() const { return true; } /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "endfunction";} + virtual const char* GetName() const { return "endfunction";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Ends a list of commands in a function block."; } @@ -65,7 +65,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " endfunction(expression)\n" diff -Nru cmake-2.8.7/Source/cmEndIfCommand.h cmake-2.8.9/Source/cmEndIfCommand.h --- cmake-2.8.7/Source/cmEndIfCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmEndIfCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -40,17 +40,17 @@ /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() { return true; } + virtual bool IsScriptable() const { return true; } /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "endif";} + virtual const char* GetName() const { return "endif";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Ends a list of commands in an if block."; } @@ -58,7 +58,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " endif(expression)\n" diff -Nru cmake-2.8.7/Source/cmEndMacroCommand.h cmake-2.8.9/Source/cmEndMacroCommand.h --- cmake-2.8.7/Source/cmEndMacroCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmEndMacroCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -47,17 +47,17 @@ /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() { return true; } + virtual bool IsScriptable() const { return true; } /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "endmacro";} + virtual const char* GetName() const { return "endmacro";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Ends a list of commands in a macro block."; } @@ -65,7 +65,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " endmacro(expression)\n" diff -Nru cmake-2.8.7/Source/cmEndWhileCommand.cxx cmake-2.8.9/Source/cmEndWhileCommand.cxx --- cmake-2.8.7/Source/cmEndWhileCommand.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmEndWhileCommand.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -12,12 +12,21 @@ #include "cmEndWhileCommand.h" bool cmEndWhileCommand -::InvokeInitialPass(std::vector const&, +::InvokeInitialPass(std::vector const& args, cmExecutionStatus &) { - this->SetError("An ENDWHILE command was found outside of a proper " - "WHILE ENDWHILE structure. Or its arguments did not " - "match the opening WHILE command."); + if (args.empty()) + { + this->SetError("An ENDWHILE command was found outside of a proper " + "WHILE ENDWHILE structure."); + } + else + { + this->SetError("An ENDWHILE command was found outside of a proper " + "WHILE ENDWHILE structure. Or its arguments did not " + "match the opening WHILE command."); + } + return false; } diff -Nru cmake-2.8.7/Source/cmEndWhileCommand.h cmake-2.8.9/Source/cmEndWhileCommand.h --- cmake-2.8.7/Source/cmEndWhileCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmEndWhileCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -34,7 +34,7 @@ * Override cmCommand::InvokeInitialPass to get arguments before * expansion. */ - virtual bool InvokeInitialPass(std::vector const&, + virtual bool InvokeInitialPass(std::vector const& args, cmExecutionStatus &status); /** @@ -47,17 +47,17 @@ /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() { return true; } + virtual bool IsScriptable() const { return true; } /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "endwhile";} + virtual const char* GetName() const { return "endwhile";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Ends a list of commands in a while block."; } @@ -65,7 +65,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " endwhile(expression)\n" diff -Nru cmake-2.8.7/Source/cmExecProgramCommand.h cmake-2.8.9/Source/cmExecProgramCommand.h --- cmake-2.8.7/Source/cmExecProgramCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmExecProgramCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -42,18 +42,18 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() + virtual const char* GetName() const {return "exec_program";} /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() { return true; } + virtual bool IsScriptable() const { return true; } /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Deprecated. Use the execute_process() command instead."; @@ -62,7 +62,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return "Run an executable program during the processing of the CMakeList.txt" @@ -84,7 +84,7 @@ } /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() + virtual bool IsDiscouraged() const { return true; } diff -Nru cmake-2.8.7/Source/cmExecuteProcessCommand.h cmake-2.8.9/Source/cmExecuteProcessCommand.h --- cmake-2.8.7/Source/cmExecuteProcessCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmExecuteProcessCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -41,18 +41,18 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() + virtual const char* GetName() const {return "execute_process";} /** * This determines if the command is invoked when in script mode. */ - virtual bool IsScriptable() { return true; } + virtual bool IsScriptable() const { return true; } /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Execute one or more child processes."; } @@ -60,7 +60,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " execute_process(COMMAND [args1...]]\n" diff -Nru cmake-2.8.7/Source/cmExportCommand.cxx cmake-2.8.9/Source/cmExportCommand.cxx --- cmake-2.8.7/Source/cmExportCommand.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmExportCommand.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -124,6 +124,14 @@ { targets.push_back(target); } + else if(target->GetType() == cmTarget::OBJECT_LIBRARY) + { + cmOStringStream e; + e << "given OBJECT library \"" << *currentTarget + << "\" which may not be exported."; + this->SetError(e.str().c_str()); + return false; + } else { cmOStringStream e; diff -Nru cmake-2.8.7/Source/cmExportCommand.h cmake-2.8.9/Source/cmExportCommand.h --- cmake-2.8.7/Source/cmExportCommand.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmExportCommand.h 2012-08-09 18:15:19.000000000 +0000 @@ -45,12 +45,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "export";} + virtual const char* GetName() const { return "export";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Export targets from the build tree for use by outside projects."; @@ -59,7 +59,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return " export(TARGETS [target1 [target2 [...]]] [NAMESPACE ]\n" diff -Nru cmake-2.8.7/Source/cmExportFileGenerator.cxx cmake-2.8.9/Source/cmExportFileGenerator.cxx --- cmake-2.8.7/Source/cmExportFileGenerator.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmExportFileGenerator.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -137,10 +137,20 @@ (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 -Nru cmake-2.8.7/Source/cmExportLibraryDependencies.h cmake-2.8.9/Source/cmExportLibraryDependencies.h --- cmake-2.8.7/Source/cmExportLibraryDependencies.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmExportLibraryDependencies.h 2012-08-09 18:15:19.000000000 +0000 @@ -48,12 +48,12 @@ /** * The name of the command as specified in CMakeList.txt. */ - virtual const char* GetName() { return "export_library_dependencies";} + virtual const char* GetName() const { return "export_library_dependencies";} /** * Succinct documentation. */ - virtual const char* GetTerseDocumentation() + virtual const char* GetTerseDocumentation() const { return "Deprecated. Use INSTALL(EXPORT) or EXPORT command."; } @@ -61,7 +61,7 @@ /** * More documentation. */ - virtual const char* GetFullDocumentation() + virtual const char* GetFullDocumentation() const { return "This command generates an old-style library dependencies file. " @@ -83,7 +83,7 @@ } /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() + virtual bool IsDiscouraged() const { return true; } diff -Nru cmake-2.8.7/Source/cmExprParserHelper.cxx cmake-2.8.9/Source/cmExprParserHelper.cxx --- cmake-2.8.7/Source/cmExprParserHelper.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmExprParserHelper.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -30,12 +30,6 @@ this->CleanupParser(); } -void cmExprParserHelper::SetLineFile(long line, const char* file) -{ - this->FileLine = line; - this->FileName = file; -} - int cmExprParserHelper::ParseString(const char* str, int verb) { if ( !str) diff -Nru cmake-2.8.7/Source/cmExprParserHelper.h cmake-2.8.9/Source/cmExprParserHelper.h --- cmake-2.8.7/Source/cmExprParserHelper.h 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmExprParserHelper.h 2012-08-09 18:15:19.000000000 +0000 @@ -46,8 +46,6 @@ int GetResult() { return this->Result; } - void SetLineFile(long line, const char* file); - const char* GetError() { return this->ErrorString.c_str(); } private: @@ -55,7 +53,6 @@ cmStdString InputBuffer; std::vector OutputBuffer; int CurrentLine; - int UnionsAvailable; int Verbose; void Print(const char* place, const char* str); diff -Nru cmake-2.8.7/Source/cmExtraCodeBlocksGenerator.cxx cmake-2.8.9/Source/cmExtraCodeBlocksGenerator.cxx --- cmake-2.8.7/Source/cmExtraCodeBlocksGenerator.cxx 2011-12-30 16:49:57.000000000 +0000 +++ cmake-2.8.9/Source/cmExtraCodeBlocksGenerator.cxx 2012-08-09 18:15:19.000000000 +0000 @@ -60,6 +60,7 @@ // disable until somebody actually tests it: // this->SupportedGlobalGenerators.push_back("MSYS Makefiles"); #endif + this->SupportedGlobalGenerators.push_back("Ninja"); this->SupportedGlobalGenerators.push_back("Unix Makefiles"); } @@ -383,6 +384,7 @@ 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()); @@ -392,10 +394,6 @@ make.c_str(), makefile, compiler.c_str()); } break; - // ignore these: - case cmTarget::INSTALL_FILES: - case cmTarget::INSTALL_PROGRAMS: - case cmTarget::INSTALL_DIRECTORY: default: break; } @@ -424,6 +422,7 @@ 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(); @@ -536,6 +535,31 @@ } +// 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, @@ -574,7 +598,18 @@ } const char* buildType = makefile->GetDefinition("CMAKE_BUILD_TYPE"); - fout<<"