diff options
36 files changed, 848 insertions, 108 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 788b386..a586764 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -418,7 +418,7 @@ ENDIF() # The CMake version number. SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MINOR 8) -SET(CMake_VERSION_PATCH 5) +SET(CMake_VERSION_PATCH 6) #SET(CMake_VERSION_TWEAK 0) #SET(CMake_VERSION_RC 1) diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index 0e61da4..1a46688 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -44,6 +44,10 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION "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" + + # Ignore clang's summary warning, assuming prior text has matched some + # other warning expression: + "[0-9,]+ warnings? generated." ) IF(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode") diff --git a/ChangeLog.manual b/ChangeLog.manual index a00ce00..3199767 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,437 @@ +Changes in CMake 2.8.6 (since 2.8.6-rc4) +---------------------------------------- +Alex Neundorf (5): + Remove trailing whitespace + Minor improvements to the UsePkgConfig.cmake docs + Remove trailing whitespace + Improve behaviour of --find-package mode with try_run/try_compile + Use makefile->IssueMessage() for better error messages + +Bill Hoffman (2): + Use version 11.0 for 12.x and 9.10 for 10.x intel versions to fix 12.1 vsIDE. + Also, check for 11.x as an intel fortran version. + +Brad King (2): + Add Visual Studio 11 generator for x86 and x64 tools + Teach our tests about special cases for VS 11 + +David Cole (1): + CTestCustom.cmake: Ignore clang's summary warning + +Philip Lowman (1): + FindBullet: Also search for _Debug postfixed library names + +Raphael Kubo da Costa (1): + Fix typo in set_target_properties' documentation. + +Rolf Eike Beer (1): + Fix typo in UsePkgConfig.cmake + +Changes in CMake 2.8.6-rc4 (since 2.8.6-rc3) +-------------------------------------------- +Alex Neundorf (3): + FindFLEX.cmake: also search the include dir + Fix typos in FeatureSummary.cmake (#12462) + Don't warn when setting a property multiple times to the same value #12464 + +Bill Hoffman (2): + For VS Intel Fortran IDE builds, add a check to find the Fortran library PATH. + Enable Fortran tests for IDE builds. + +Brad King (5): + FortranCInterface: Compile separate Fortran lib in VerifyC[XX] + Move IntelVSImplicitPath project to better location + Simplify IntelVSImplicitPath detection project + libarchive: Fix ssize_t detection with mingwrt 3.20 + Make file(DOWNLOAD) fail on http error + +David Cole (8): + Tests: Add a KWStyle test, equivalent to the make StyleCheck target + KWStyle Test: Activate by default if KWStyle is found + Xcode: Use EFFECTIVE_PLATFORM_NAME reference in ComputeOutputDir + Xcode: Add test to demonstrate iOS project in Xcode + CMake: Reference test targets only when BUILD_TESTING is ON + Tests: Add the more modern Mac64 nightly build + Release Scripts: Use Qt 4.7.4 on dashmacmini5 (#12460) + Revert "FindThreads: Try pthreads with no special option first (#11333)" + +Eric NOULARD (4): + CPack fix #12449 doc mispelled + CPack fix template too + CPackDeb fix #10325 automagically use fakeroot for DEB if fakeroot is found + CPackRPM authorize per-component pre/post-[un]install scripts (#0012063) + +Marcus D. Hanwell (4): + Just code style changes. + Don't warn when nothing to do in visibility function. + Made ADD_COMPILER_EXPORT_FLAGS into a macro. + Make add_compiler_export_flags a function again. + +Rolf Eike Beer (1): + remove stray brace in CPackDeb documentation + +Changes in CMake 2.8.6-rc3 (since 2.8.6-rc2) +-------------------------------------------- +Alexey Ozeritsky (2): + FindBLAS/LAPACK fixes + FindBLAS/LAPACK fixes + +Andreas Schneider (1): + Modules: Add support for more java archives in add_jar(). + +Björn Ricks (4): + Search for the installed python interpreter first + Determine python version + Update documentation of FindPythonInterp.cmake + Use FIND_PACKAGE_HANDLE_STANDARD_ARGS second mode + +Brad King (5): + VS: Map per-source Fortran flags to IDE options + VS: Map Fortran free- and fixed-format flags to IDE options + Fortran: Add support for free- and fixed-form flags + Xcode: Honor Fortran_FORMAT target and source file property + Set CMAKE_<lang>_COMPILER_ID for VS generators + +David Cole (8): + KWSys: Remove always-true dir_only parameter + KWSys: Add symlinks to directories as files (#12284) + FindPackageMessage: Eliminate new lines in cache entries + FindPackageMessage: Eliminate new lines using REGEX REPLACE + CMake: Add SaveCache at the end of successful Generate calls + Suppress Qt warning for dashmacmini5 builds + Suppress Qt warning for dashmacmini5 builds + Tests: Look for "Illegal" or "SegFault" in the output + +Eric NOULARD (2): + CPack fix #12366 components RPM packages have the same package name + CPackRPM fix #12305, include directories in RPM package + +Johan Björk (5): + Xcode: No spaces in makefile target names (#12370) + CMake: Write symlinks to directories as files in archives (#12284) + CPack: Do not recurse through directory symlinks (#12284) + Xcode: Do not emit the ZERO_CHECK target more than once + Xcode: Honor -g0 to disable debugging (#12377) + +Johannes Stallkamp (1): + CTest: Fixed valgrind output parsing (#12260) + +Matt McCormick (1): + CMake: Remove documentation for -E build (#12446) + +Stephen Kelly (2): + Add some more unit tests. + Don't put what some compilers consider junk at the end of the line. + +Thomas Jarosch (3): + CTest: Fix memory leaks on error + Fix file() command descriptor leak on error + ccmake: Fix off-by-one memory access error + +Changes in CMake 2.8.6-rc2 (since 2.8.6-rc1) +-------------------------------------------- +Brad King (2): + KWSys: Add hash function for std::string + KWSys: Fix std::string hash function for Borland + +Clinton Stimpson (1): + qt4: also find QtUiTools when cross compiling with mingw. + +David Cole (3): + Xcode4: Requires more quoting of single quote char + cmake.m4: Use modern signature of install(FILES ...) + CMake Release Scripts: Changes for next release candidate... + +David Faure (1): + Don't use a variable name that might be used in other files. + +Stephen Kelly (73): + Create moc files in the current binary dir, not the top level. + Make the formatting of feature_summary output a little better. + Add the GenerateExportMacro with unit tests. + Handle the case where the user changes the DEFINE_SYMBOL property. + Add a newline at the end of the file. + Add a newline at the end of the file. + Add missing licence header. + Remove the fatal_warnings option which is no longer used. + Test for features, not specific compilers. + Simplify. We already know we have hidden visibility at this point. + Simplify the compiler feature check + Add some debug output. + Short-circuit the tests on unsupported compilers. + Test expected no-op instead of aborting the build. + Fix tests with clang. + Fix typo and tests failing as a result. + Only run the failure tests with gcc >= 4.2 + Set the CMAKE_RUNTIME_OUTPUT_DIRECTORY for windows builds. + Only set the COMPILER_HAS_HIDDEN_VISIBILITY if GCC >= 4.2 + Disable all export macros on Borland. + Another attempt to fix the tests on Borland. + Use the correct project name compiletest not compilefail + Fix off-by-not in test for Borland. + Another attempt at fixing Borland. + Add some debug output to narrow down deprecation test issues + Export deprecated free methods too. + Remember to surround the other deprecated test in the Borland check. + Only set the deprecated attribute if hidden visibilty is enabled. + Make sure the hidden visibility variables never get set on MINGW. + Don't use hidden visibility on non-mingw windows either. + Don't export methods on already exported classes. + Split the deprecated available check from setting macro values. + Test for compiler features, instead of for specific platforms. + Exclude the XL compiler from the hidden-visibility test. + Add the COMPILER_HAS_DEPRECATED only if it has a declspec variant + Don't change the expected build result based on the platform. + Expect the tests to pass if hidden visibilty is not enabled. + Test -Werror instead of enabling it per compiler. + Add some messaging output to make remaining issues findable. + Perform the -Werror test only once. + Test for deprecated attribute before declspec. + Try to error on deprecated on Intel and SunCC. + Borland can't do deprecated. + Fixup forgotten part of aed84517c942a4c40f493fcf997cdf6a047349f8 + Disable testing of deprecated macros. + Don't enable deprecated on HP. + Don't enable deprecated on old GCC + Exclude cygwin from the hidden visibility feature. + Exclude PGI from exports and deprecated. + Start testing expected values for compiler flags. + Exclude win32 from hidden visibility checks. + Comment the test assertion for now + Test the correct cxx variable. + Fix the version extraction regex for clang. + Hopefully add version extraction for Intel. + Add some settings for non-truncation of test output. + Fix up the regex command for Intel. + Test for too-old-intel compilers. + Possibly fix test on HPUX. + Possibly fix configuration test on AIX. + Try to make the macros do almost nothing for Watcom. + More consistency in the macro options. + Add missing NO_EXPORT macro variant. + Look for errors reported by PGI too. + Quote paths in case there is a space in one of them. + Disable the tests for Watcom. + Fix Compiler id variable name. + Add quotes in case cmake is installed in a prefix with a space. + Fix the feature of using a specific prefix for macros. + Add documentation about the prefix and no_deprecated options. + Remove blank line at the start of the file. + Don't start a line with a dash(-) + Fix up verbatim code sections of the dox. + +Todd Gamblin (3): + FindBoost: Call find_package with NO_MODULE first + Fix XL compilers on non-AIX machines. + Fixed link bugs in BlueGeneP build. + +Changes in CMake 2.8.6-rc1 (since 2.8.5) +-------------------------------------------- +Aaron C. Meadows (1): + FindSubversion: Invoke svn non-interactively (#12304) + +Alex Neundorf (92): + Add a switch to disable a find_package() call completely + Add documentation for the CMAKE_DISABLE_FIND_PACKAGE_<Name> switch + Add a basic test for CMAKE_DISABLE_FIND_PACKAGE_<package> + Add macros cmake_push/pop_check_state() as discussed on the list. + Fix copyright notice test + Add CheckCXXSymbolExists.cmake, so this can be used also for C++ + Minor fix to try_compile() docs (#12333) + Fix #12342: Add APPEND_STRING option to set_property() + Extend FeatureSummary: add PURPOSE of package and TYPE + FeatureSummary.cmake: remove "comment" field + FeatureSummary.cmake: add INCLUDE_QUIET_PACKAGES keyword + FeatureSummary.cmake: error out when a REQUIRED package is missing + FeatureSummary.cmake: only higher TYPEs can override previous TYPEs + FeatureSummary.cmake: cosmetics + FeatureSummary.cmake: update documentation + Remove debug output from CheckSymbolExists + Don't put files from CMAKE_ROOT into CodeBlocks projects (#12110) + More PATH_SUFFIXES for finding Postgresql and also search catalog/pg_type.h + Use FPHSA(), remove unnecessary stuff and don't recommend link_directories() + Mark the results from find() as advanced + FindPostgreSQL: fix PATH_SUFFIXES, better output for FPHSA + Strip trailing whitespace + FindGIF/FindFreetype.cmake: remove standard search paths from find-calls + FindGif: add giflib4 as one more name for the library under Windows + Add basic version check for giflib + Patch by Campbell Barton: puts definitions into C::B project file + Remove useless line of code + Also put builtin include dirs into CodeBlocks project file + Remove trailing whitespace + Also search for libxkbfile, XSync and SM include dir + Provide macro write_basic_config_version_file() + Add example to documentation + Add some tests for write_basic_config_version_file() + Fix copyright notice + Really fix copyright notice + Set UNSUITABLE instead of not COMPATIBLE + Improve documentation for WriteBasicConfigVersionFile.cmake + Add macros GETTEXT_PROCESS_POT() and GETTEXT_PROCESS_PO_FILES() + Support REQUIRED in FindGettext.cmake (using FPHSA.cmake) + Fix #12358: make optionally enabling ASM work again + Start work on automoc: add empty cmQtAutomoc class + Start implementing skeleton for automoc in cmake + Add actual automoc code from automoc + Remove the need to check for .h/.cxx during buildtime + Add the cmake module required currently for automoc + Add AUTOMOC to the add_library() command + Fix line lengths + Move code for parsing a cpp-file from the big loop to separate function + Initialize verbose based onb the env.var. + Color output when running moc + Add the generated automoc.cpp file to the cleaned files + Use cout instead of printf() + Remove trailing whitespace + Refactor SetupAutomocTarget() so it can be run after creating the target + Remove trailing whitespace + Move automoc processing from add_executable/library to cmGlobalGenerator + Nicer progress message for the automoc target + Add a test for automoc + Add documentation for AUTOMOC, add initialization via CMAKE_AUTOMOC + Fix logic which decides when to execute automoc test + Automoc.cmake is not needed anymore + Fix build: non-void function must return a value + Fix warnings + Fix bootstrap test with automoc + Only enable the automoc test after checking that Qt4 works + Fix build: use std::ios::out|ios::trunc instead of std::ios_base::out + Silence warning in automoc: use long instead of int + Fix automoc with VS builds: apply patch from Bill + Make clLocalGenerator::GetTargetFlags() public + Add find-package mode, which does nothing yet + Implement find-package mode of cmake + Replace cmake::GetScriptMode() with GetWorkingMode() + Fix copyright notice in new CMakeFindPackageMode.cmake + Better support for lib64 and Debian multiarch + Use the file-utility to test for 64bit if there is no /usr/lib64 + Add a cmake.m4 for using cmake in autoconf projects instead of pkgconfig + Improve documentation for --find-package mode + Add a test for the new --find-package mode + Only run the test if we are using a makefile generator under UNIX + The makefile for the test was kindof wrong + Fix test on OpenBSD with BSD make + Rename helper macros print_compile_flags() to set_compile_flags_var() + Dont check for -isysroot and -mmacosx-version on OSX in --find-package mode + Disable any STATUS output in --find-package mode + Much improved test, should now be executed on all UNIXes + Make the --find-package test harder + Make the test harder by always having a space in the include dirs + Only enable the test when using GNU make + Fix line length + Use $(CXXFLAGS) and $(LDFLAGS) in the --find-package test Makefile + Require the current cmake version in --find-package mode + Fix --find-package mode on Cygwin, where enable_language(RC) is called + +Alexey Ozeritsky (5): + fixed: search of acml libraries + gotoblas supported + ACML-GPU supported + ACML-GPU supportede + fixed: search of ATLAS library for C/C++-only projects + +Andreas Schneider (6): + FindJava: Find missing java development executables. + Modules: Added CMake Java support. + Tests: Java tests should test UseJava.cmake + Tests: Check for the new Java exeutable variables. + Java: Use set_property/get_property for target variables. + Java: Fix documentation format and indentation + +Arnaud Gelas (1): + Search for the ASPELL executable + +Bill Hoffman (5): + Only pay for unused variable checking if it is on. + Initial support for Intel Fortran VS2010. + Fix custom commands in VS2010 Fortran projects using CFG_INTDIR and test. + Use MSBuild when devenv is not around, since VCExpress seems broken. + Fix for bug #12413, nmake did not handle targets with + in the name. + +Brad King (13): + MinGW: Remove old workaround and use native echo (#12283) + Document caveat of custom commands in multiple targets (#12311) + cmSystemTools: Remove trailing whitespace + RunSingleCommand: Fix indentation + RunSingleCommand: Avoid assignment in condition + Documentation: WIN32 not defined on Cygwin (#12334) + KWSys: Simplify SystemTools::GetTime implementation (#12261) + KWSys: Avoid conversion warning in SystemTools::GetTime + KWSys: Fix using long long and __int64 with hash_(set|map) + KWSys: __int64 and long long may be same type in specialization + XL: Fix old VisualAge branding of Fortran compiler + Do not crash when an imported target depends on a missing target + Fix CHECK_(C|CXX)_COMPILER_FLAG for Clang (#12394) + +Clinton Stimpson (5): + Add -DQT_NO_DEBUG if no build type is specified so Qt plugins will work. + Add qt4/QtCore to help find Qt headers when cross-compiling. + Qt4: Fix reference of undefined variable when detecting frameworks on Mac OS X + Remove C compiler requirement from FindQt4.cmake + CPack/NSIS: Fix reinstall and multiple install issues when using components. + +David Cole (26): + Begin post-2.8.5 development + Fix Architecture test to work with Xcode 4 + Fix BuildDepends test to work with Xcode 4 + Base architecture choice logic on Xcode version + Use correct default multiple architecture values in test + Add use of EFFECTIVE_PLATFORM_NAME to generated Xcode projects. + Correct KWStyle line too long error + Add fail regex to detect supported warning flags correctly. + Add support for Visual Studio project-specific globals (#8707) + Fix machine-specific UpdateGIT test failures + Ensure libgmp-10.dll is in the PATH for CMakeTestAllGenerators + Watcom: Add -c flag to wlib calls (#12245) + Add Watcom support to InstallRequiredSystemLibraries (#11866) + Watcom: Use correct args for execute_process call (#11866) + CTest: print failed tests in index order (#11746) + Fix line too long style violation + Documentation: Fix comments in the source code (#10941) + Add more find_path locations for DCMTK header files (#12323) + VS9: Add include_directories to midl command lines + KWSys: Remove translation path for "/tmp_mnt/" (#10595) + VS10: Avoid unnecessary rebuilds for custom commands + QtAutomoc test: Pass QT_QMAKE_EXECUTABLE + QtAutomoc: Eliminate compiler warning + CheckSymbolExists: Use IMMEDIATE flag for configure_file (#11333) + Xcode: Suppress same-old warning again. + Xcode: Save object id values in CMakeCache.txt (#11690) + +Johan Björk (5): + Xcode: Remove PREBINDING attribute for Xcode 4 and above + RunSingleCommand: Replace verbose boolean with enum + RunSingleCommand: Add a OUTPUT_NORMAL flag. + Xcode: Quote ',' in Xcode string values (#12259) + Xcode: Rearrange CMakeReRun to enable parallel builds + +Matej Hribernik (2): + VS: Factor Find64BitTools out of Win64 generator to parent + Add VisualStudio 9 and 10 generators for Itanium platform + +Modestas Vainius (1): + multiarch: Treat lib/<arch> as implicit link dir (#12326) + +Oliver Buchtala (3): + Java: Create java_class_filelist only if it does't exist. + Java: Added some dependency magic to avoid recompilations. + Java: Create correct jar archive dependencies. + +Rolf Eike Beer (2): + remove extra output message from FindJava.cmake + FindThreads: Try pthreads with no special option first (#11333) + +Steven Velez (1): + VS10: Add SCC support + +Todd Gamblin (2): + Try regular compiler when no MPI compiler. + Fix issues with removing try_compile input file. + +Will Dicharry (1): + Added HDF5 high level Fortran bindings to available components. + Changes in CMake 2.8.5 (since 2.8.5-rc3) -------------------------------------------- Brad King (1): diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake index 55c37c2..1b4532d 100644 --- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake +++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake @@ -25,10 +25,12 @@ MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines IF (${_lang} STREQUAL "c++") SET(_compilerExecutable "${CMAKE_CXX_COMPILER}") + SET(_arg1 "${CMAKE_CXX_COMPILER_ARG1}") ELSE () SET(_compilerExecutable "${CMAKE_C_COMPILER}") + SET(_arg1 "${CMAKE_C_COMPILER_ARG1}") ENDIF () - EXECUTE_PROCESS(COMMAND ${_compilerExecutable} -v -E -x ${_lang} -dD dummy + EXECUTE_PROCESS(COMMAND ${_compilerExecutable} ${_arg1} -v -E -x ${_lang} -dD dummy WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles ERROR_VARIABLE _gccOutput OUTPUT_VARIABLE _gccStdout ) diff --git a/Modules/CMakeVS11FindMake.cmake b/Modules/CMakeVS11FindMake.cmake new file mode 100644 index 0000000..302efaa --- /dev/null +++ b/Modules/CMakeVS11FindMake.cmake @@ -0,0 +1,54 @@ + +#============================================================================= +# Copyright 2007-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.) + +# Look for devenv as a build program. We need to use this to support +# Intel Fortran integration into VS. MSBuild can not be used for that case +# since Intel Fortran uses the older devenv file format. +FIND_PROGRAM(CMAKE_MAKE_PROGRAM + NAMES devenv + HINTS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;EnvironmentDirectory] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup;Dbghelp_path] + "$ENV{ProgramFiles}/Microsoft Visual Studio 11.0/Common7/IDE" + "$ENV{ProgramFiles}/Microsoft Visual Studio11.0/Common7/IDE" + "$ENV{ProgramFiles}/Microsoft Visual Studio 11/Common7/IDE" + "$ENV{ProgramFiles}/Microsoft Visual Studio11/Common7/IDE" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 11.0/Common7/IDE" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio11.0/Common7/IDE" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 11/Common7/IDE" + "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio11/Common7/IDE" + "/Program Files/Microsoft Visual Studio 11.0/Common7/IDE/" + "/Program Files/Microsoft Visual Studio 11/Common7/IDE/" + ) + +# if devenv is not found, then use MSBuild. +# it is expected that if devenv is not found, then we are +# dealing with Visual Studio Express. VCExpress has random +# failures when being run as a command line build tool which +# causes the compiler checks and try-compile stuff to fail. MSbuild +# is a better choice for this. However, VCExpress does not support +# cross compiling needed for Win CE. +IF(NOT CMAKE_CROSSCOMPILING) + FIND_PROGRAM(CMAKE_MAKE_PROGRAM + NAMES MSBuild + HINTS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] + "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/" + "c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/" + "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0;CLR Version]/") +ENDIF() + +MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) +SET(MSVC11 1) +SET(MSVC_VERSION 1700) diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 6d7a3ec..630a0ba 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -216,9 +216,22 @@ MACRO(QT4_ADD_DBUS_INTERFACE _sources _interface _basename) SET(_impl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp) SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc) - # handling more arguments (as in FindQt4.cmake from KDE4) will come soon, then - # _params will be used for more than just -m - SET(_params -m) + GET_SOURCE_FILE_PROPERTY(_nonamespace ${_interface} NO_NAMESPACE) + IF(_nonamespace) + SET(_params -N -m) + ELSE(_nonamespace) + SET(_params -m) + ENDIF(_nonamespace) + + GET_SOURCE_FILE_PROPERTY(_classname ${_interface} CLASSNAME) + IF(_classname) + SET(_params ${_params} -c ${_classname}) + ENDIF(_classname) + + GET_SOURCE_FILE_PROPERTY(_include ${_interface} INCLUDE) + IF(_include) + SET(_params ${_params} -i ${_include}) + ENDIF(_include) ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header} COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} ${_params} -p ${_basename} ${_infile} diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake index 3db9e43..7f4318f 100644 --- a/Modules/UsePkgConfig.cmake +++ b/Modules/UsePkgConfig.cmake @@ -1,4 +1,4 @@ -# - Osolete pkg-config module for CMake, use FindPkgConfig instead. +# - Obsolete pkg-config module for CMake, use FindPkgConfig instead. # # This module defines the following macro: # diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 96b3ea0..ba41d98 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -324,6 +324,10 @@ IF (WIN32) cmGlobalVisualStudio10Win64Generator.cxx cmGlobalVisualStudio10IA64Generator.h cmGlobalVisualStudio10IA64Generator.cxx + cmGlobalVisualStudio11Generator.h + cmGlobalVisualStudio11Generator.cxx + cmGlobalVisualStudio11Win64Generator.h + cmGlobalVisualStudio11Win64Generator.cxx cmGlobalVisualStudioGenerator.cxx cmGlobalVisualStudioGenerator.h cmGlobalWatcomWMakeGenerator.cxx diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 96a214e..dca2fb3 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -22,12 +22,12 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) // which signature were we called with ? this->SrcFileSignature = false; unsigned int i; - + const char* sourceDirectory = argv[2].c_str(); const char* projectName = 0; const char* targetName = 0; int extraArgs = 0; - + // look for CMAKE_FLAGS and store them std::vector<std::string> cmakeFlags; for (i = 3; i < argv.size(); ++i) @@ -37,8 +37,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) // CMAKE_FLAGS is the first argument because we need an argv[0] that // is not used, so it matches regular command line parsing which has // the program name as arg 0 - for (; i < argv.size() && argv[i] != "COMPILE_DEFINITIONS" && - argv[i] != "OUTPUT_VARIABLE"; + for (; i < argv.size() && argv[i] != "COMPILE_DEFINITIONS" && + argv[i] != "OUTPUT_VARIABLE"; ++i) { extraArgs++; @@ -73,8 +73,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) if (argv[i] == "COMPILE_DEFINITIONS") { extraArgs++; - for (i = i + 1; i < argv.size() && argv[i] != "CMAKE_FLAGS" && - argv[i] != "OUTPUT_VARIABLE"; + for (i = i + 1; i < argv.size() && argv[i] != "CMAKE_FLAGS" && + argv[i] != "OUTPUT_VARIABLE"; ++i) { extraArgs++; @@ -101,7 +101,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) break; } } - + // do we have a srcfile signature if (argv.size() - extraArgs == 3) { @@ -133,7 +133,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) } // make sure the binary directory exists cmSystemTools::MakeDirectory(this->BinaryDirectory.c_str()); - + // do not allow recursive try Compiles if (this->BinaryDirectory == this->Makefile->GetHomeOutputDirectory()) { @@ -143,7 +143,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return -1; } - + std::string outFileName = this->BinaryDirectory + "/CMakeLists.txt"; // which signature are we using? If we are using var srcfile bindir if (this->SrcFileSignature) @@ -151,7 +151,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) // remove any CMakeCache.txt files so we will have a clean test std::string ccFile = this->BinaryDirectory + "/CMakeCache.txt"; cmSystemTools::RemoveFile(ccFile.c_str()); - + // we need to create a directory and CMakeList file etc... // first create the directories sourceDirectory = this->BinaryDirectory.c_str(); @@ -226,7 +226,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) langFlags += "_FLAGS"; fprintf(fout, "SET(CMAKE_VERBOSE_MAKEFILE 1)\n"); fprintf(fout, "SET(CMAKE_%s_FLAGS \"", lang); - const char* flags = this->Makefile->GetDefinition(langFlags.c_str()); + const char* flags = this->Makefile->GetDefinition(langFlags.c_str()); if(flags) { fprintf(fout, " %s ", flags); @@ -247,10 +247,10 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) } /* for the TRY_COMPILEs we want to be able to specify the architecture. - So the user can set CMAKE_OSX_ARCHITECTURE to i386;ppc and then set + So the user can set CMAKE_OSX_ARCHITECTURE to i386;ppc and then set CMAKE_TRY_COMPILE_OSX_ARCHITECTURE first to i386 and then to ppc to - have the tests run for each specific architecture. Since - cmLocalGenerator doesn't allow building for "the other" + have the tests run for each specific architecture. Since + cmLocalGenerator doesn't allow building for "the other" architecture only via CMAKE_OSX_ARCHITECTURES. */ if(this->Makefile->GetDefinition("CMAKE_TRY_COMPILE_OSX_ARCHITECTURES")!=0) @@ -286,45 +286,45 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) this->BinaryDirectory.c_str()); /* Create the actual executable. */ fprintf(fout, "ADD_EXECUTABLE(cmTryCompileExec \"%s\")\n",source.c_str()); - fprintf(fout, + fprintf(fout, "TARGET_LINK_LIBRARIES(cmTryCompileExec ${LINK_LIBRARIES})\n"); fclose(fout); projectName = "CMAKE_TRY_COMPILE"; targetName = "cmTryCompileExec"; - // if the source is not in CMakeTmp + // if the source is not in CMakeTmp if(source.find("CMakeTmp") == source.npos) { this->Makefile->AddCMakeDependFile(source.c_str()); } - + } // else the srcdir bindir project target signature else { projectName = argv[3].c_str(); - + if (argv.size() - extraArgs == 5) { targetName = argv[4].c_str(); } } - + bool erroroc = cmSystemTools::GetErrorOccuredFlag(); cmSystemTools::ResetErrorOccuredFlag(); std::string output; // actually do the try compile now that everything is setup - int res = this->Makefile->TryCompile(sourceDirectory, + int res = this->Makefile->TryCompile(sourceDirectory, this->BinaryDirectory.c_str(), - projectName, - targetName, + projectName, + targetName, this->SrcFileSignature, - &cmakeFlags, + &cmakeFlags, &output); if ( erroroc ) { cmSystemTools::SetErrorOccured(); } - + // set the result var to the return value to indicate success or failure this->Makefile->AddCacheDefinition(argv[0].c_str(), (res == 0 ? "TRUE" : "FALSE"), @@ -335,7 +335,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) { this->Makefile->AddDefinition(outputVariable.c_str(), output.c_str()); } - + if (this->SrcFileSignature) { this->FindOutputFile(targetName); @@ -369,7 +369,7 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir) { return; } - + std::string bdir = binDir; if(bdir.find("CMakeTmp") == std::string::npos) { @@ -378,7 +378,7 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir) "CMakeTmp:", binDir); return; } - + cmsys::Directory dir; dir.Load(binDir); size_t fileNum; @@ -388,8 +388,8 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir) if (strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)),".") && strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)),"..")) { - - if(deletedFiles.find( dir.GetFile(static_cast<unsigned long>(fileNum))) + + if(deletedFiles.find( dir.GetFile(static_cast<unsigned long>(fileNum))) == deletedFiles.end()) { deletedFiles.insert(dir.GetFile(static_cast<unsigned long>(fileNum))); diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h index e29dde8..5c67f13 100644 --- a/Source/cmCoreTryCompile.h +++ b/Source/cmCoreTryCompile.h @@ -28,27 +28,27 @@ public: /** * This is the core code for try compile. It is here so that other * commands, such as TryRun can access the same logic without - * duplication. + * duplication. */ int TryCompileCode(std::vector<std::string> const& argv); - /** - * This deletes all the files created by TryCompileCode. + /** + * This deletes all the files created by TryCompileCode. * This way we do not have to rely on the timing and * dependencies of makefiles. */ void CleanupFiles(const char* binDir); - /** - * This tries to find the (executable) file created by + /** + * This tries to find the (executable) file created by TryCompileCode. The result is stored in OutputFile. If nothing is found, the error message is stored in FindErrorMessage. */ void FindOutputFile(const char* targetName); - + cmTypeMacro(cmCoreTryCompile, cmCommand); - + std::string BinaryDirectory; std::string OutputFile; std::string FindErrorMessage; diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 92dee5a..38002ec 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -19,6 +19,7 @@ #include "cmGeneratedFileStream.h" #include "cmTarget.h" #include "cmSystemTools.h" +#include "cmXMLSafe.h" #include <cmsys/SystemTools.hxx> @@ -592,7 +593,8 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, for(std::vector<std::string>::const_iterator di = defs.begin(); di != defs.end(); ++di) { - fout <<" <Add option=\"-D" << di->c_str() << "\" />\n"; + cmXMLSafe safedef(di->c_str()); + fout <<" <Add option=\"-D" << safedef.str() << "\" />\n"; } } diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 1dd9bf3..7beffdc 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -987,17 +987,26 @@ void cmExtraEclipseCDT4Generator // we need the "make" and the C (or C++) compiler which are used, Alex std::string make = makefile.GetRequiredDefinition("CMAKE_MAKE_PROGRAM"); std::string compiler = makefile.GetSafeDefinition("CMAKE_C_COMPILER"); + std::string arg1 = makefile.GetSafeDefinition("CMAKE_C_COMPILER_ARG1"); if (compiler.empty()) { compiler = makefile.GetSafeDefinition("CMAKE_CXX_COMPILER"); + arg1 = makefile.GetSafeDefinition("CMAKE_CXX_COMPILER_ARG1"); } if (compiler.empty()) //Hmm, what to do now ? { compiler = "gcc"; } - // the following right now hardcodes gcc behaviour :-/ + std::string compilerArgs = + "-E -P -v -dD ${plugin_state_location}/${specs_file}"; + if (!arg1.empty()) + { + arg1 += " "; + compilerArgs = arg1 + compilerArgs; + } + fout << "<storageModule moduleId=\"scannerConfiguration\">\n" "<autodiscovery enabled=\"true\" problemReportingEnabled=\"true\"" @@ -1007,7 +1016,7 @@ void cmExtraEclipseCDT4Generator cmExtraEclipseCDT4Generator::AppendScannerProfile(fout, "org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile", true, "", true, "specsFile", - "-E -P -v -dD ${plugin_state_location}/${specs_file}", + compilerArgs, compiler, true, true); cmExtraEclipseCDT4Generator::AppendScannerProfile(fout, "org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile", diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index ce9deb1..183da4a 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -299,11 +299,7 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn) this->GetIgnoredPaths(ignored); this->FilterPaths(this->SearchPaths, ignored); - // Handle search root stuff. - this->RerootPaths(this->SearchPaths); - - // Add a trailing slash to all prefixes to aid the search process. - this->AddTrailingSlashes(this->SearchPaths); + this->ComputeFinalPaths(); return true; } diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index a05e337..b44864e 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -471,8 +471,13 @@ void cmFindCommon::AddPathInternal(std::string const& in_path, } //---------------------------------------------------------------------------- -void cmFindCommon::AddTrailingSlashes(std::vector<std::string>& paths) +void cmFindCommon::ComputeFinalPaths() { + std::vector<std::string>& paths = this->SearchPaths; + + // Expand list of paths inside all search roots. + this->RerootPaths(paths); + // Add a trailing slash to all paths to aid the search process. for(std::vector<std::string>::iterator i = paths.begin(); i != paths.end(); ++i) diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h index 875c223..542805f 100644 --- a/Source/cmFindCommon.h +++ b/Source/cmFindCommon.h @@ -47,8 +47,8 @@ protected: void FilterPaths(std::vector<std::string>& paths, const std::set<std::string>& ignore); - /** Add trailing slashes to all search paths. */ - void AddTrailingSlashes(std::vector<std::string>& paths); + /** Compute final search path list (reroot + trailing slash). */ + void ComputeFinalPaths(); /** Compute the current default root path mode. */ void SelectDefaultRootPathMode(); diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 2e72b58..7d3f09b 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -1243,7 +1243,7 @@ void cmFindPackageCommand::ComputePrefixes() this->AddPrefixesCMakeSystemVariable(); this->AddPrefixesSystemRegistry(); this->AddPrefixesUserGuess(); - this->ComputeFinalPrefixes(); + this->ComputeFinalPaths(); } //---------------------------------------------------------------------------- @@ -1574,18 +1574,6 @@ void cmFindPackageCommand::AddPrefixesUserHints() } //---------------------------------------------------------------------------- -void cmFindPackageCommand::ComputeFinalPrefixes() -{ - std::vector<std::string>& prefixes = this->SearchPaths; - - // Construct the final set of prefixes. - this->RerootPaths(prefixes); - - // Add a trailing slash to all prefixes to aid the search process. - this->AddTrailingSlashes(prefixes); -} - -//---------------------------------------------------------------------------- bool cmFindPackageCommand::SearchDirectory(std::string const& dir) { assert(!dir.empty() && dir[dir.size()-1] == '/'); diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index 2b2e1da..e736352 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -93,7 +93,6 @@ private: void AddPrefixesCMakeSystemVariable(); void AddPrefixesUserGuess(); void AddPrefixesUserHints(); - void ComputeFinalPrefixes(); void LoadPackageRegistryDir(std::string const& dir); void LoadPackageRegistryWinUser(); void LoadPackageRegistryWinSystem(); diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 8573670..18b483d 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -79,7 +79,6 @@ protected: virtual const char* GetIDEVersion() { return "10.0"; } std::string PlatformToolset; -private: bool ExpressEdition; }; #endif diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx new file mode 100644 index 0000000..a70427a --- /dev/null +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -0,0 +1,45 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2011 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. +============================================================================*/ +#include "cmGlobalVisualStudio11Generator.h" +#include "cmMakefile.h" + +//---------------------------------------------------------------------------- +cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator() +{ + this->FindMakeProgramFile = "CMakeVS11FindMake.cmake"; + this->ExpressEdition = false; // TODO: VS 11 Express support + this->PlatformToolset = "v110"; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio11Generator::AddPlatformDefinitions(cmMakefile* mf) +{ + mf->AddDefinition("MSVC11", "1"); + mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86"); + mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86"); +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio11Generator::WriteSLNHeader(std::ostream& fout) +{ + fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n"; + fout << "# Visual Studio 2011\n"; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio11Generator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = "Generates Visual Studio 11 project files."; + entry.Full = ""; +} diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h new file mode 100644 index 0000000..14019a7 --- /dev/null +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -0,0 +1,43 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2011 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 cmGlobalVisualStudio11Generator_h +#define cmGlobalVisualStudio11Generator_h + +#include "cmGlobalVisualStudio10Generator.h" + + +/** \class cmGlobalVisualStudio11Generator */ +class cmGlobalVisualStudio11Generator: + public cmGlobalVisualStudio10Generator +{ +public: + cmGlobalVisualStudio11Generator(); + static cmGlobalGenerator* New() { + return new cmGlobalVisualStudio11Generator; } + + ///! Get the name for the generator. + virtual const char* GetName() const { + return cmGlobalVisualStudio11Generator::GetActualName();} + static const char* GetActualName() {return "Visual Studio 11";} + virtual void AddPlatformDefinitions(cmMakefile* mf); + + virtual void WriteSLNHeader(std::ostream& fout); + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + /** TODO: VS 11 user macro support. */ + virtual std::string GetUserMacrosDirectory() { return ""; } +protected: + virtual const char* GetIDEVersion() { return "11.0"; } +}; +#endif diff --git a/Source/cmGlobalVisualStudio11Win64Generator.cxx b/Source/cmGlobalVisualStudio11Win64Generator.cxx new file mode 100644 index 0000000..10c9027 --- /dev/null +++ b/Source/cmGlobalVisualStudio11Win64Generator.cxx @@ -0,0 +1,33 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2011 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. +============================================================================*/ +#include "cmGlobalVisualStudio11Win64Generator.h" +#include "cmMakefile.h" +#include "cmake.h" + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio11Win64Generator +::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.Name = this->GetName(); + entry.Brief = "Generates Visual Studio 11 Win64 project files."; + entry.Full = ""; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio11Win64Generator +::AddPlatformDefinitions(cmMakefile* mf) +{ + this->cmGlobalVisualStudio11Generator::AddPlatformDefinitions(mf); + mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE"); + mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "x64"); + mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "x64"); +} diff --git a/Source/cmGlobalVisualStudio11Win64Generator.h b/Source/cmGlobalVisualStudio11Win64Generator.h new file mode 100644 index 0000000..53f1953 --- /dev/null +++ b/Source/cmGlobalVisualStudio11Win64Generator.h @@ -0,0 +1,37 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2011 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 cmGlobalVisualStudio11Win64Generator_h +#define cmGlobalVisualStudio11Win64Generator_h + +#include "cmGlobalVisualStudio11Generator.h" + +class cmGlobalVisualStudio11Win64Generator : + public cmGlobalVisualStudio11Generator +{ +public: + cmGlobalVisualStudio11Win64Generator() {} + static cmGlobalGenerator* New() { + return new cmGlobalVisualStudio11Win64Generator; } + + ///! Get the name for the generator. + virtual const char* GetName() const { + return cmGlobalVisualStudio11Win64Generator::GetActualName();} + static const char* GetActualName() {return "Visual Studio 11 Win64";} + + virtual const char* GetPlatformName() const {return "x64";} + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + virtual void AddPlatformDefinitions(cmMakefile* mf); +}; +#endif diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 2eae9d0..da6a1c6 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1559,7 +1559,7 @@ cmLocalUnixMakefileGenerator3 // Create the scanner for this language cmDepends *scanner = 0; - if(lang == "C" || lang == "CXX" || lang == "RC") + if(lang == "C" || lang == "CXX" || lang == "RC" || lang == "ASM") { // TODO: Handle RC (resource files) dependencies correctly. scanner = new cmDependsC(this, targetDir, lang.c_str(), &validDeps); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 5417584..d9b2772 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1836,14 +1836,14 @@ cmLocalVisualStudio7Generator vskey += "\\Packages\\" CM_INTEL_PLUGIN_GUID ";ProductVersion"; cmSystemTools::ReadRegistryValue(vskey.c_str(), intelVersion, cmSystemTools::KeyWOW64_32); - if (intelVersion == "12.0") + if (intelVersion.find("12") == 0 || (intelVersion.find("11") == 0)) { - // Version 12 actually uses 11.0 in project files! + // Version 11.x and 12.x actually use 11.0 in project files! intelVersion = "11.0" ; } - else if(intelVersion == "10.1") + else if(intelVersion.find("10") == 0) { - // Version 10.1 actually uses 9.10 in project files! + // Version 10.x actually uses 9.10 in project files! intelVersion = "9.10"; } diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx index 4d39d54..12ce015 100644 --- a/Source/cmTryCompileCommand.cxx +++ b/Source/cmTryCompileCommand.cxx @@ -20,6 +20,14 @@ bool cmTryCompileCommand return false; } + if(this->Makefile->GetCMakeInstance()->GetWorkingMode() == + cmake::FIND_PACKAGE_MODE) + { + this->Makefile->IssueMessage(cmake::FATAL_ERROR, + "The TRY_COMPILE() command is not supported in --find-package mode."); + return false; + } + this->TryCompileCode(argv); // if They specified clean then we clean up what we can @@ -32,4 +40,3 @@ bool cmTryCompileCommand } return true; } - diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index c9c4ed5..4fc0b13 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -22,6 +22,14 @@ bool cmTryRunCommand return false; } + if(this->Makefile->GetCMakeInstance()->GetWorkingMode() == + cmake::FIND_PACKAGE_MODE) + { + this->Makefile->IssueMessage(cmake::FATAL_ERROR, + "The TRY_RUN() command is not supported in --find-package mode."); + return false; + } + // build an arg list for TryCompile and extract the runArgs, std::vector<std::string> tryCompile; @@ -49,8 +57,8 @@ bool cmTryRunCommand { tryCompile.push_back(argv[i]); } - } - else + } + else { if (argv[i] == "OUTPUT_VARIABLE") { @@ -94,8 +102,8 @@ bool cmTryRunCommand // although they could be used together, don't allow it, because // using OUTPUT_VARIABLE makes crosscompiling harder - if (this->OutputVariable.size() - && ((this->RunOutputVariable.size()) + if (this->OutputVariable.size() + && ((this->RunOutputVariable.size()) || (this->CompileOutputVariable.size()))) { cmSystemTools::Error( @@ -141,8 +149,8 @@ bool cmTryRunCommand std::string runOutputContents; if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING")) { - this->DoNotRunExecutable(runArgs, - argv[3], + this->DoNotRunExecutable(runArgs, + argv[3], captureRunOutput ? &runOutputContents : 0); } else @@ -153,7 +161,7 @@ bool cmTryRunCommand // now put the output into the variables if(this->RunOutputVariable.size()) { - this->Makefile->AddDefinition(this->RunOutputVariable.c_str(), + this->Makefile->AddDefinition(this->RunOutputVariable.c_str(), runOutputContents.c_str()); } @@ -167,7 +175,7 @@ bool cmTryRunCommand { runOutputContents = std::string(compileOutput) + runOutputContents; } - this->Makefile->AddDefinition(this->OutputVariable.c_str(), + this->Makefile->AddDefinition(this->OutputVariable.c_str(), runOutputContents.c_str()); } } @@ -212,9 +220,9 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs, /* This is only used when cross compiling. Instead of running the executable, two cache variables are created which will hold the results - the executable would have produced. + the executable would have produced. */ -void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, +void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, const std::string& srcFile, std::string* out ) @@ -249,7 +257,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, comment += "Run result of TRY_RUN(), indicates whether the executable " "would have been able to run on its target platform.\n"; comment += detailsString; - this->Makefile->AddCacheDefinition(this->RunResultVariable.c_str(), + this->Makefile->AddCacheDefinition(this->RunResultVariable.c_str(), "PLEASE_FILL_OUT-FAILED_TO_RUN", comment.c_str(), cmCacheManager::STRING); @@ -276,7 +284,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, "would have printed on stdout and stderr on its target platform.\n"; comment += detailsString; - this->Makefile->AddCacheDefinition(internalRunOutputName.c_str(), + this->Makefile->AddCacheDefinition(internalRunOutputName.c_str(), "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), cmCacheManager::STRING); @@ -294,7 +302,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, if (error) { static bool firstTryRun = true; - std::ofstream file(resultFileName.c_str(), + std::ofstream file(resultFileName.c_str(), firstTryRun ? std::ios::out : std::ios::app); if ( file ) { diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 41c67e2..05699da 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -68,6 +68,8 @@ # include "cmGlobalVisualStudio10Generator.h" # include "cmGlobalVisualStudio10IA64Generator.h" # include "cmGlobalVisualStudio10Win64Generator.h" +# include "cmGlobalVisualStudio11Generator.h" +# include "cmGlobalVisualStudio11Win64Generator.h" # include "cmGlobalVisualStudio8Win64Generator.h" # include "cmGlobalBorlandMakefileGenerator.h" # include "cmGlobalNMakeMakefileGenerator.h" @@ -2580,6 +2582,10 @@ void cmake::AddDefaultGenerators() &cmGlobalVisualStudio10IA64Generator::New; this->Generators[cmGlobalVisualStudio10Win64Generator::GetActualName()] = &cmGlobalVisualStudio10Win64Generator::New; + this->Generators[cmGlobalVisualStudio11Generator::GetActualName()] = + &cmGlobalVisualStudio11Generator::New; + this->Generators[cmGlobalVisualStudio11Win64Generator::GetActualName()] = + &cmGlobalVisualStudio11Win64Generator::New; this->Generators[cmGlobalVisualStudio71Generator::GetActualName()] = &cmGlobalVisualStudio71Generator::New; this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] = diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 19f42af..434e6af 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -15,7 +15,7 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) # KWSys version date month component. Format is MM. -SET(KWSYS_DATE_STAMP_MONTH 09) +SET(KWSYS_DATE_STAMP_MONTH 10) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 26) +SET(KWSYS_DATE_STAMP_DAY 11) diff --git a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt index 8095a1c..8b279a5 100644 --- a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt +++ b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt @@ -34,6 +34,9 @@ endif() if(DEFINED MSVC10) math(EXPR msvc_total "${msvc_total} + 1") endif() +if(DEFINED MSVC11) + math(EXPR msvc_total "${msvc_total} + 1") +endif() echo_var(MSVC) echo_var(MSVC60) @@ -42,6 +45,7 @@ echo_var(MSVC71) echo_var(MSVC80) echo_var(MSVC90) echo_var(MSVC10) +echo_var(MSVC11) if(MSVC) # diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt index 3edb548..4a5b1cb 100644 --- a/Tests/Module/GenerateExportHeader/CMakeLists.txt +++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt @@ -55,6 +55,29 @@ else() endif() endif() +set(DEPS + libshared + libstatic + lib_shared_and_static +) + +foreach(DEP ${DEPS}) + try_compile(Result ${CMAKE_CURRENT_BINARY_DIR}/${DEP}_build + ${CMAKE_CURRENT_SOURCE_DIR}/${DEP} + ${DEP} + OUTPUT_VARIABLE Out + ) + if (NOT Result) + message("OUTPUT: ${Out}") + endif() +endforeach() + +# The _do_build macro is called from a child scope, where +# the current source and binary dir are different. Save them here +# for use in the macro. +set(TEST_TOP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +set(TEST_TOP_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) + # We seem to get race conditions is writing this stuff to the same file at least on MinGW # So to write to separate source and build directories, we use a count to differentiate. @@ -67,8 +90,6 @@ macro(_do_build Include Library LibrarySource Source) "int main() { ${Source}; }\n" ) - file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/../${LibrarySource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}") - if ("${Library}" STREQUAL "static_variant") set(CONDITIONAL_STATIC_DEFINE "add_definitions(-DLIBSHARED_AND_STATIC_STATIC_DEFINE)\n") endif() @@ -90,13 +111,10 @@ macro(_do_build Include Library LibrarySource Source) " add_definitions(${ERROR_FLAG})\n" "endif()\n" - "if(MSVC)\n" - " add_definitions(-DCOMPILER_IS_MSVC)\n" - "endif()\n" - - "add_subdirectory(\"${LibrarySource}\")\n" + "include(\"${TEST_TOP_BINARY_DIR}/${LibrarySource}_build/Targets.cmake\")\n" - "include_directories(\"${LibrarySource}\" \"\${CMAKE_CURRENT_BINARY_DIR}/${LibrarySource}\")\n" + "include_directories(\"${TEST_TOP_SOURCE_DIR}/${LibrarySource}\"\n" + " \"${TEST_TOP_BINARY_DIR}/${LibrarySource}_build\")\n" "${CONDITIONAL_STATIC_DEFINE}" @@ -125,10 +143,6 @@ include(GenerateExportHeader) add_compiler_export_flags() -if (MSVC) - add_definitions(-DCOMPILER_IS_MSVC) -endif() - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) message("#### COMPILER_HAS_DEPRECATED: " ${COMPILER_HAS_DEPRECATED}) diff --git a/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt b/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt index d19b6dc..be0387f 100644 --- a/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt +++ b/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt @@ -1,4 +1,13 @@ -project(shared_and_static) + +cmake_minimum_required(VERSION 2.8) + +project(lib_shared_and_static) + +include(GenerateExportHeader) + +add_compiler_export_flags() + +set(CMAKE_INCLUDE_CURRENT_DIR ON) set(lib_SRCS libshared_and_static.cpp @@ -10,3 +19,5 @@ add_library(static_variant ${lib_SRCS}) generate_export_header(shared_variant BASE_NAME libshared_and_static) set_target_properties(static_variant PROPERTIES COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE) + +export(TARGETS shared_variant static_variant FILE Targets.cmake) diff --git a/Tests/Module/GenerateExportHeader/libshared/CMakeLists.txt b/Tests/Module/GenerateExportHeader/libshared/CMakeLists.txt index 8e4ee2b..e20adb1 100644 --- a/Tests/Module/GenerateExportHeader/libshared/CMakeLists.txt +++ b/Tests/Module/GenerateExportHeader/libshared/CMakeLists.txt @@ -1,6 +1,16 @@ +cmake_minimum_required(VERSION 2.8) + project(libshared) +include(GenerateExportHeader) + +add_compiler_export_flags() + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + add_library(libshared SHARED libshared.cpp) generate_export_header(libshared) + +export(TARGETS libshared FILE Targets.cmake) diff --git a/Tests/Module/GenerateExportHeader/libstatic/CMakeLists.txt b/Tests/Module/GenerateExportHeader/libstatic/CMakeLists.txt index 8db1827..b2db3ea 100644 --- a/Tests/Module/GenerateExportHeader/libstatic/CMakeLists.txt +++ b/Tests/Module/GenerateExportHeader/libstatic/CMakeLists.txt @@ -1,8 +1,18 @@ +cmake_minimum_required(VERSION 2.8) + project(libstatic) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +include(GenerateExportHeader) + +add_compiler_export_flags() + # Show that the export header has no effect on a static library. add_library(libstatic STATIC libstatic.cpp) generate_export_header(libstatic) + +export(TARGETS libstatic FILE Targets.cmake) diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index b4ec17c..1ed7b83 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -37,6 +37,9 @@ endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio") if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 10") set(PP_VS100 1) endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 10") +if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 11") + set(PP_VS110 1) +endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 11") # Some tests below check the PP_* variables set above. They are meant # to test the case that the build tool is at fault. Other tests below @@ -52,7 +55,7 @@ endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 10") # must not have it escaped inside the configured header. set(STRING_EXTRA "") -if(NOT BORLAND AND NOT PP_VS70 AND NOT PP_VS100) +if(NOT BORLAND AND NOT PP_VS70 AND NOT PP_VS100 AND NOT PP_VS110) # Borland, VS70 IDE: ; # The Borland compiler will simply not accept a non-escaped semicolon # on the command line. If it is escaped \; then the escape character diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt index 1e68968..a2fd619 100644 --- a/Tests/VSExternalInclude/CMakeLists.txt +++ b/Tests/VSExternalInclude/CMakeLists.txt @@ -6,7 +6,7 @@ IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") ELSE(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") SET(PROJECT_EXT vcproj) ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") -IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 10") +IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[01]") SET(PROJECT_EXT vcxproj) ENDIF() @@ -46,7 +46,7 @@ ADD_DEPENDENCIES(VSExternalInclude lib2) # and the sln file can no longer be the only source # of that depend. So, for VS 10 make the executable # depend on lib1 and lib2 -IF(MSVC10) +IF(MSVC10 OR MSVC11) ADD_DEPENDENCIES(VSExternalInclude lib1) ENDIF() diff --git a/Utilities/cmlibarchive/build/cmake/CheckFileOffsetBits.cmake b/Utilities/cmlibarchive/build/cmake/CheckFileOffsetBits.cmake index 5f4e053..472b80d 100644 --- a/Utilities/cmlibarchive/build/cmake/CheckFileOffsetBits.cmake +++ b/Utilities/cmlibarchive/build/cmake/CheckFileOffsetBits.cmake @@ -18,7 +18,7 @@ MACRO (CHECK_FILE_OFFSET_BITS) IF(NOT DEFINED _FILE_OFFSET_BITS) - MESSAGE(STATUS "Cheking _FILE_OFFSET_BITS for large files") + MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files") TRY_COMPILE(__WITHOUT_FILE_OFFSET_BITS_64 ${CMAKE_BINARY_DIR} ${libarchive_SOURCE_DIR}/build/cmake/CheckFileOffsetBits.c @@ -32,10 +32,10 @@ MACRO (CHECK_FILE_OFFSET_BITS) IF(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64) SET(_FILE_OFFSET_BITS 64 CACHE INTERNAL "_FILE_OFFSET_BITS macro needed for large files") - MESSAGE(STATUS "Cheking _FILE_OFFSET_BITS for large files - needed") + MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files - needed") ELSE(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64) SET(_FILE_OFFSET_BITS "" CACHE INTERNAL "_FILE_OFFSET_BITS macro needed for large files") - MESSAGE(STATUS "Cheking _FILE_OFFSET_BITS for large files - not needed") + MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files - not needed") ENDIF(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64) ENDIF(NOT DEFINED _FILE_OFFSET_BITS) |