diff options
60 files changed, 1439 insertions, 262 deletions
diff --git a/ChangeLog.manual b/ChangeLog.manual index 134b4aa..0e84fb6 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,578 @@ +Changes in CMake 2.8.12 (since 2.8.12-rc4) +------------------------------------------ +Brad King (4): + Xcode: Fix test architecture selection for Xcode >= 5 + Xcode: Teach Tests/BuildDepends to allow LINK_DEPENDS_NO_SHARED failure + Xcode: Drop XCODE_DEPEND_HELPER for Xcode >= 5 + Xcode: Fix OBJECT library support for Xcode 5 (#14254) + +Stephen Kelly (1): + Genex: Fix processing multiple include directories for relative paths + +Changes in CMake 2.8.12-rc4 (since 2.8.12-rc3) +---------------------------------------------- +Brad King (8): + VS: Future-proof Intel project format selection + MSVC: Drop /link from executable link lines with Ninja + FindCUDA: Always list custom command outputs in their targets + FindPNG: Honor old PNG_LIBRARY if provided (#14398) + FindHDF5: Fix regression in per-configuration library selection + bash-completion: Future-proof --help-*-list "cXXXX version" filtering + OS X: Search system SDKs for frameworks + Use first custom command for the same output (#14446) + +Patrick Gansterer (3): + MSVC: Fix version test for linking corelibc on Windows CE (#14420) + MSVC: Fix WinCE arch family preprocessor symbol (#14436) + VS: Use version-specific subsystem for WinCE compiler id (#14440) + +Rolf Eike Beer (1): + bootstrap: try better workaround for builds on Linux/HPPA + +Stephen Kelly (3): + Add differing target property content to policy CMP0022 warning + Fix CMP0022 warning when no old-style property is set + genex: Fix preprocessing with incomplete content (#14410). + +Changes in CMake 2.8.12-rc3 (since 2.8.12-rc2) +---------------------------------------------- +Robert Maynard (1): + cmMakefile: Do not track CMake temporary files. + +Changes in CMake 2.8.12-rc2 (since 2.8.12-rc1) +---------------------------------------------- +Brad King (2): + Fix RunCMake.Configure test expectation newline matching + Clean up install rules of CMake itself (#14371) + +Clinton Stimpson (1): + OSX: Allow an empty INSTALL_NAME_DIR to override MACOSX_RPATH. + +Eric Bélanger (1): + FindImageMagick: Find libraries named with HDRI support (#14348) + +Raphael Kubo da Costa (1): + FindTCL: Add BSD paths for Tcl/Tk 8.6 + +Robert Maynard (2): + VS: Generate ToolsVersion matching each VS version + cmMakefile: Do not track configured files known to be temporary + +Rolf Eike Beer (1): + CheckC*CompilerFlag: add documentation what to expect from a positive result + +Stephen Kelly (6): + Fix OLD behavior of CMP0021. + try_compile: Extract IMPORTED targets from LINK_DEPENDENT_LIBRARIES + try_compile: Extract IMPORTED targets from INTERFACE_LINK_LIBRARIES + Genex: Fix evaluation of MAP_IMPORTED_CONFIG_<CONFIG> + Fix some whitespace errors in docs. + Normalize system directories from the interface target property + +Yury G. Kudryashov (1): + CPack: Fix a typo in documentation + +Zack Galbreath (1): + CTest: Fix GTM coverage parsing line offset bug + +Changes in CMake 2.8.12-rc1 (since 2.8.11.2) +-------------------------------------------- +Adam J. Weigold (1): + CPackWIX: Add support for custom WiX templates + +Alex Neundorf (12): + CMakeSystem: include toolchain file after setting CMAKE_HOST_ (#13796) + Add support files for C, C++ and ASM for the IAR toolchain. + Add regexps for the IAR toolchain to the vendor list. + Add IAR to the CMakeDetectC(XX)CompilerID.c(pp).in + cmake-gui: use shortcut F only for "Find in Output" + Eclipse: fix #14204 and #14205: no file links to directories + automoc: add a global AUTOMOC_TARGETS_FOLDER property + install: do not strip dll import libraries (#14123) + ExportTargets: add one more comment to the generated file. + Add documentation for the --graphviz support + graphvizoptions: add copyright notice + add macros cmake_print_properties() and cmake_print_variables() + +Alexander Mohr (1): + VS: Detect MSVC compiler id on ARM toolchain + +Andreas Mohr (10): + Fix spelling and typos (affecting users) + Fix spelling and typos (affecting binary data / module messages) + Fix spelling and typos (non-binary) + Fix spelling and typos (product names) + FindwxWidgets: add DOC strings with usual style + Explain distribution of Win9x binary on all Windows versions. + VS10: add detailed comment about MIDL processing + Docs: Update description of CMAKE_(BUILD_TYPE|CONFIGURATION_TYPES) + Docs: Clarify that CMAKE_*_(PREFIX|SUFFIX) affect filenames + Docs: Clarify wording "flag used" => "flag (to|will) be used" + +Ben Boeckel (12): + set_property: Do not remove a property when APPENDing nothing + Tests/RunCMake: Document stripping of expected output + export: Error when exporting a target without a language + variable_watch: Store client data as pointers + variable_watch: Add a deleter for the client data + variable_watch: Match client_data when finding duplicates + variable_watch: Allow specifying the data to match in RemoveWatch + variable_watch: Prevent making extra entries in the watch map + variable_watch: Fix a typo in the error message + variable_watch: Don't share memory for callbacks + variable_watch: Check newValue for NULL + variable_watch: Add test for watching a variable multiple times + +Bill Hoffman (1): + Do not set CMAKE_MATCH_ variables when not neeeded + +Bjoern Thiel (1): + SelectLibraryConfigurations: Fix for cached <base>_LIBRARY + +Brad King (91): + VS: Separate compiler and linker PDB files (#11899, #14062) + MSVC: Invoke 'link' directly for executables + Ninja: Fix OBJECT_DIR placeholder path conversion + VS 10: Escape ; as %3B in preprocessor definitions (#14073) + CTest: Simplify ctest_* command source/build dir lookup + get_filename_component: Add explicit unit tests + get_filename_component: Add DIRECTORY option (#14091) + Xcode: Use explicitFileType to mark source types (#14093) + Check{C,CXX}CompilerFlag: Test using C locale (#14102) + Windows: Search '/' prefix only when cross compiling (#10994) + Recognize ld with toolchain prefix (#13960) + VS: Always initialize CMAKE_CONFIGURATION_TYPES in IDE generators + Begin post-2.8.11 development + Sanitize linker name to parse implicit link line (#14154) + VS: Allow /Fa to set AssemblerListingLocation (#14153) + Tests/IncludeDirectories: Avoid shared library with no symbols + if: Add test for IS_DIRECTORY + try_compile: Add test for bad call error cases + try_compile: Refactor argument processing + variable_watch: Add test for MODIFIED_ACCESS report + bootstrap: Compile KWSys SystemTools with UTIME(S|NSAT) values + variable_watch: Remove leftover debugging code (#14187) + variable_watch: Print accesses as "CMake Debug Log" messages + Docs: Clarify CMAKE_PARENT_LIST_FILE (#14194) + get_filename_component: Test ABSOLUTE of .. after root component + try_compile: Add signature to allow multiple SOURCES + enable_language: Clarify documentation + Split cmBootstrapCommands.cxx into two sources + Document CMAKE_INSTALL_PREFIX in CMAKE_SYSTEM_PREFIX_PATH + cmake: Document "-E tar" support for .zip (#14225) + FindBoost: Clarify failure on missing 'static' libs (#14235) + CMakeDetermineVSServicePack: Improve documentation + CMakeDetermineVSServicePack: Add VS 11 update 1 and 2 (#14239) + Document ENV syntax as a "variable" (#14245) + Embarcadero: Use response files only for includes, objects, and libs + Escape target flags taken from COMPILE_OPTIONS + Refactor target COMPILE_OPTIONS and COMPILE_FLAGS handling + CMakeDetermineVSServicePack: Add VS 11 update 3 + Document removal of 'register' from flex/bison output + VS12: Find proper MSBuild for VSProjectInSubdir test + Fortran: Use explicit type in Fortran 90 check + project: Document top-level CMakeLists.txt requirement + ExternalProject: Document multiple COMMAND lines + include: Clarify variable access scope for included file + VS: Fix /MAP:mapfile flag mapping (#14282) + cmake: On configure error suggest looking at CMake*.log files + try_compile: Escape CMAKE_<lang>_FLAGS in test projects (#14268) + try_compile: Add COPY_FILE_ERROR option to capture failure + FindPNG: Add versioned library names for 1.6 (#14289) + cmake: Fix resource leak reported by cppcheck + VS,Xcode: Drop incorrect legacy dependency trace (#14291) + OS X: Add copyright notices to Darwin-*-Fortran.cmake + VS: Avoid leaking child process output back to IDE (#14266) + Fix ExportImport test cmp0022NEW build on Watcom + add_test: Document test name restrictions (#14298) + UseJava: Update notice of copyright by Kitware + add_custom_command: Manage backtrace memory correctly (#14299) + Teach compiler ABI check to tolerate try_compile COPY_FILE failure + Test COMPILE_DEFINITIONS target property get/set/get round-trip + Check*CompilerFlag: Document use of CMAKE_REQUIRED_DEFINITIONS (#14309) + sha2: Avoid type-punned pointer dereference (#14314) + VS 6: Tell BuildDepends test to tolerate ninjadep failure + cmMakefile: Do not track configured files known to be temporary + libarchive: Update README-CMake.txt for new snapshot + libarchive: Include cm_zlib.h to get zlib used by CMake + libarchive: Silence API deprecation warnings + libarchive: Avoid struct init with variable + libarchive: Remove build options not used by CMake + libarchive: Backport to CMake 2.8.2 + VS10: Honor user-specified /SUBSYSTEM: flag (#14326) + VS10: Escape include paths in XML project files (#14331) + OS X: Search for SDK based on deployment target (#14324) + bootstrap: Do not suppress CMAKE_OSX_SYSROOT if CFLAGS have -isysroot (#14324) + OS X: Enable command-line build without tools in PATH + VS 6,7: Refactor local generators to avoid GetSourceFileWithOutput + cmake-gui: Fix build rules for Qt5 on Windows + Include cmMakefile.h before cm*Lexer.h to get stdint.h first + Skip CTestLimitDashJ test on Borland + Add RunCMake.Syntax test to cover argument parsing + cmListFileLexer: Fix line number after backslash in string + cmListFileLexer: Split normal and legacy unquoted arguments + cmListFileArgument: Generalize 'Quoted' bool to 'Delimeter' enum + Add RunCMake.Syntax test cases for command invocation styles + cmListFileCache: Convert CMake language parser to class + Warn about arguments not separated by whitespace + Warn about unquoted arguments that look like long brackets + cmListFileLexer: Modify flex output to avoid Borland warning + Cygwin: Avoid legacy warnings in RunCMake.* tests + Update version introducing CMP0021, CMP0022, and CMP0023 + OS X: Do not default to non-existent deployment target SDK + Do not warn about left paren not separated by a space + +Christian Maaser (1): + VS: Add support for .NET target framework version + +Clinton Stimpson (12): + Improve documentation for CPACK_PACKAGE_INSTALL_REGISTRY_KEY. + Refactor how bundles and frameworks are supported. + Xcode: Add support for shared library versioning + OS X: Fix getting of CFBundle LOCATION property. + OS X: Add RPATH support for Mac. + Xcode: Add rpath support in Xcode generator. + OS X: Add support for @rpath in export files. + OS X: Add test for rpaths on Mac. + OS X: Improvements for getting install name of dylib. + OS X: Enable rpath support on Mac OS X when find_library() is used. + OS X: Fix regression handling frameworks for Ninja + OS X: If necessary, use xcrun to help find otool used to query install names. + +Cédric OCHS (1): + Xcode: Support XCODE_ATTRIBUTE_ with [variant=<config>] (#12532) + +Daniele E. Domenichelli (15): + FindGTK2: Move check for pangocairo in gtk module + FindGTK2: Detect gthread library + FindFreetype: Detect Freetype installed by GtkMM installer for win + FindGTK2: Do not fail on MSVC11 if vc100 libraries are available + FindGTK2: Add GTK2_DEFINITIONS variable + SelectLibraryConfigurations: Do not cache the _LIBRARY variable + SelectLibraryConfigurations: Use -NOTFOUND instead of copying the vars + FindGTK2: Use GTK_XXX_LIBRARY_DEBUG libraries in debug mode + FindGTK2: Append _LIBRARY to var name in _GTK2_FIND_LIBRARY + FindGTK2: Append _INCLUDE_DIR to var name in _GTK2_FIND_INCLUDE_DIR + FindGTK2: Update local changelog + FindGTK2: Remove GTK2_SKIP_MARK_AS_ADVANCED option + FindGTK2: gthread-2.0 folder does not exist + FindGTK2: Detect gmodule library + FindGTK2: Detect pangoft2 and pangoxft libraries + +David Coppa (1): + OpenBSD: Enable ELF parsing and editing (#14241) + +David Golub (1): + CPack/NSIS: Obtain path from which to uninstall from registry (#14124) + +Eric NOULARD (5): + Add support for componentized USER spec file + CPackRPM add mechanism to remove path from generated list of file in RPM spec. + CPackRPM add /usr/lib64 to the list of builtin to-be-excluded path + CPackRPM protect '@' character in filename processed in the spec file. + CPackRPM make the changelog line conform to expected format + +Fredrik Axelsson (1): + CPackWIX: Handle CPACK_PACKAGE_EXECUTABLES (#13967) + +Funda Wang (1): + FindImageMagick: Find v6 include dir (#14174) + +Graham Markall (2): + OS X: Add Fortran library version flags (#14249) + UseJava: Pass sources to javac using response file (#13028) + +Gregoire Lejeune (1): + Allow using Java in a cross-compilation toolchain + +Ian Monroe (2): + Ninja: use cd /D to set directory on Windows + CPackWIX: Fix MSI package layout regression from parent + +Igor Murzov (2): + bash-completion: Add -S,-SP options arguments completion + bash-completion: Fix/improve generator names extraction + +Jack O'Connor (1): + Eclipse: Add a missing space in the documentation + +Jason Spiro (1): + MinGW: Find mingw32-make included with Code::Blocks IDE (#14302) + +John Farrier (2): + VS: Add Windows Forms Support + VS: Add VS_GLOBAL_ROOTNAMESPACE target property + +Jonas Andersen (1): + VS: Add Resx configuration to the vcxproj file + +LibArchive Upstream (1): + libarchive 3.1.2 (reduced) + +Marc Bartholomaeus (4): + cmake-gui: Add search functions for Output window (#9733) + cmake-gui: Add search functions to the context menu of the Output widget + cmake-gui: Change shortcut of the search field from Ctrl-F to Alt-E + cmake-gui: Add function for going to next error message in Output window + +Marcel Loose (1): + FindCUDA: Remove duplicate entries from INCLUDE_DIRECTORIES. + +Marius Schamschula (1): + FindX11: Search in /opt/X11 for OS X 10.8 (#14232) + +Mathias Gaunard (1): + FindCUDA: CUDA_COMPUTE_BUILD_PATH uses relative paths to binary dir. + +Matt McCormick (1): + ExternalProject: Allow blank SVN_USERNAME/SVN_PASSWORD (#14128) + +Matthew Bentham (1): + Xcode: Honor CMAKE_(MODULE|SHARED)_LINKER_FLAGS_<CONFIG> (#14161) + +Matthew Woehlke (3): + UseJava.cmake: fully use cmake_parse_arguments in add_jar + FindProtobuf: also find pthread + UseJava.cmake: document add_jar compat shim + +Nicolas Despres (1): + Optimize custom command full-path dependency lookup + +Nils Gladitz (1): + Add cmake_host_system_information command + +Patrick Gansterer (20): + Add option to use stdout/stderr of original terminal in cmake --build + Unify the way the flags of a static library are read + Add support for CMAKE_STATIC_LINKER_FLAGS + Add CMAKE_STATIC_LINKER_FLAGS to CMakeCommonLanguageInclude + Add documentation for the missing CMAKE_*_LINKER_FLAGS_* variables + Add additonal tests for the linker flags + VS6: Add handling of CMAKE_*_LINKER_FLAGS_<CONFIG> variables + VS6: Hardcode id_machine_6 for compiler detection + VS10: Do not set the TargetMachine when detecting the compiler + VS: Set CMAKE_VS_PLATFORM_NAME for VS7 and VS71 too + VS: Replace ArchitectureId with PlatformName + VS12: Remove duplicated overload of UseFolderProperty() + Fix detection of WinCE SDKs with 64bit verion of CMake + VS: Unify how the name of the generator is specified + VS10: Add support for assembler code (#11536) + WIN: Use COFF file header header for architecture detection (#14083) + Improve const-correctness in cmVisualStudioGeneratorOptions + Fix setting of the entry point symbol for Windows CE (#14088) + Add support for new Windows CE compiler + VS11: Add support for Windows CE SDKs + +Paul Kunysch (1): + CTest: Add test for running many tests in parallel + +Pavel Shramov (1): + cmDependsC: Collapse relative include paths + +Petr Kmoch (5): + Add projectDir parameter to GenerateBuildCommand + VS: Create parser for Visual Studio .sln files + VS: Use .sln parser to build targets in subdirs with msbuild (#13623) + VS: Add test for building MSBuild project in subdir + ctest_build: Pass projectDir to GenerateBuildCommand + +Reid Kleckner (1): + Ninja: Make cmcldeps depfile output more consistent with 'ninja -t msvc' + +Richard Ulrich (3): + CPackWIX: Handle multiple shortcuts in the start menu + CPackWIX: Add option to specify the language(s) of the installer + CMakeCPack: Provide an upgrade guid for WiX + +Robert Maynard (9): + cmMakefile: Refactor AddCMakeDependFile and AddCMakeOutputFile. + Ninja: Track configured files so we can regenerate them. + cmMakefile: Track configured files so we can regenerate them (#13582) + Add a test to expose a bug with add_custom_command and ninja. + Ninja: GlobalNinjaGenerator WriteBuild and WritePhonyBuild non static + Ninja: Custom Command file depends don't need to exist before building + FindCUDA: Search for libraries in <prefix>/lib/<arch>/nvidida-current. + Ninja: Properly convert all paths to unix style before we do set intersection. + Ninja: Update BuildDepends test to verify cmcldeps depfiles. + +Robin Lee (1): + FindOpenSSL: Fix spelling of CMAKE_CROSSCOMPILING (#14075) + +Rolf Eike Beer (25): + FindOpenGL: simplify OS selection code + FindOpenGL: require headers to be found on non-Windows platforms (#13746) + Tests: create output files for all memory checkers + CTest: use an output file for Valgrind (#14110) + CTest: remove unreachable code and CTestTestMemcheckUnknown test + Tests: remove code duplication in CTestTestMemCheck tests + Tests: verify that memory checker output files are always present + CTest: drop suppression for gcc 2.9.6 errors from default Valgrind flags + Tests: add test for non-existent Valgrind suppression file + CTest: fix comment documenting cmBoundsCheckerParser class + Tests: add a test with custom options passed to valgrind + CTest: make sure never to report negative test times (#14132) + Doc: fix example for FAIL_REGULAR_EXPRESSION + CTest: break after first regex match on output + Tests: ignore Guard Malloc messages in MemChecker tests + CTest: avoid useless changing of directory + Tests: fix build of dummy memtester on AIX + wizard: fix warnings + wizard: simplify control flow + cmTarget: drop the unused local typedef LinkLine + Tests: ignore GuardMalloc messages on all Apple build, not just XCode ones + replace string(... MATCHES "^const$) with string(... STREQUAL "const") + Revert "CTest: fix pre and post test commands with spaces" (#13887) + FindPNG: improve library detection (#14301) + CTest: create one output file per memcheck (#14303) + +Sean McBride (1): + Remove some uses of obsolete 'register' storage specifier + +Sebastian Leske (1): + Document CMAKE_<LANG>_FLAGS variable (#14305) + +Stephen Kelly (126): + Make the QtAutomoc test compile with either Qt 4 or Qt 5 + Add a test for Qt5Automoc + Remove an endif() followed by an if() for the same condition. + Fix some copyastos in the DetermineRCCompiler file. + Test transitive includes from setting the LINK_LIBRARIES property. + Test the use of target transitive compile definitions with moc. + Fix handling of commas in arbitrary content in genexes. + Fix style. + Remove unused marker for a variable which is now used. + Extract the ProcessArbitraryContent method. + Rename the method determining if a genex accepts arbitrary content. + Make it possible for any genex to have arbitrary content at the end. + Add the JOIN generator expression. + Test that linking using the debug keyword to tll works. + automoc: Read target defines unconditionally + Remove unused typedef. + Fix brace indentation. + Add EXPORT_NAME property. + Remove unused vector population. + Sublime: Honor source-level COMPILE_FLAGS property + Docs: cmake -G selects a "build system" generator + Recognize shared library files with a numerical suffix + FindQt4: Fix QUIET failure with Qt 5 but not Qt 4 + Error on relative path in INCLUDE_DIRECTORIES target property. + include_directories: Fix handling of empty or space-only entries + CTest: Read CTEST_PARALLEL_LEVEL from environment + string: Add MAKE_C_IDENTIFIER subcommand + GenerateExportHeader: Add newlines to separate the compiler output. + GenerateExportHeader: Allow use of of this macro with MODULEs. + file: Add GENERATE command to produce files at generate time + Tests/Module/GenerateExportHeader: Test exported free-function + Add $<LINK_LANGUAGE> generator expression + GenerateExportHeader: Generate only C identifiers as defines + Tests/CompileDefinitions: Avoid spaces in defines on VS 6 + Use the qt5::moc imported target instead of a variable. + QtAutomoc: Get the Qt version through the target link interface + Fix indentation. + VS6: Rename some variables to correspond to config values. + Add cmLocalGenerator::GetCompileOptions. + Add <LANG>_COMPILER_ID generator expressions. + cmTarget: Rename struct to be more re-usable. + cmTarget: Rename LinkInterfaceIncludeDirectoriesEntries + Add COMPILE_OPTIONS target property. + Add target_compile_options command. + Introduce target property <LANG>_VISIBILITY_PRESET + Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property. + Qt4Macros: Allow specifying a TARGET in invokations of macros. + Introduce add_compile_options command. + Remove unused cmAddDefinitionsCommand::ParseDefinition method. + Add some spaces to the INCLUDE_DIRECTORIES documentation. + CLI: Suppress the unused warning if the key value pair is cached. + Use --sysroot when cross compiling. + Add missing 'seen' check for evaluating COMPILE_OPTIONS. + Find targets in INTERFACE_COMPILE_OPTIONS when exporting for try_compile. + Use a preprocessor loop to manage the valid transitive properties. + Generate INTERFACE_COMPILE_OPTIONS on export. + Genex: Fix indentation in docs. + cmSystemTools: Fix typo in comment. + Style: Don't put an else after a return. + Add compiler target compile options. + QtAutomoc: Fix handling of list separator for compile definitions. + QtAutomoc: Use config-dependent compile definitions and includes. + De-duplicate version comparison code. + Add generator expressions for version comparision. + Don't run the WarnUnusedCliUnused test on Windows. + Add whitespace after colons in error messages. + Add missing return after error report. + Genex: Make LINK_LANGUAGE report an error when evaluating link libraries. + Genex: Extend EvaluatingLinkLibraries to also check the top target name. + Genex: Report error if a target file is needed to evaluate link libraries. + Add generator expressions for compiler versions. + Split the GeneratorExpression test into a third part. + Remove unused variable. + Add Target API to determine if an include is a system include. + Store system include directories in the cmTarget. + Extend the cmTargetPropCommandBase interface property handling. + Add a SYSTEM parameter to target_include_directories (#14180) + Add entire link interface transitive closure as target depends. + Test non-IMPORTED libraries in the INTERFACE of IMPORTED libraries. + GenexEval: Add abstracted access to link interface for a target. + Introduce the LINK_ONLY generator expression. + Introduce the INTERFACE_LINK_LIBRARIES property. + Export: Generate INTERFACE_LINK_LIBRARIES property on targets. + TLL: Don't populate old link interface if CMP0022 is NEW. + Overload cmLocalGenerator::AppendDefines to add a list. + Add an overload of cmIDEOptions::AddDefines taking a vector of strings. + Refactor cmTarget::GetCompileDefinitions to use an out-vector, not a string. + Document some variables for deprecation control. + Genex: Make CMP0021 and CMP0022 usable with TARGET_POLICY + Revert "Use --sysroot when cross compiling." + Add target property debugging for COMPILE_DEFINITIONS + Mark qt4_use_modules and qt4_automoc as obsolete. + Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property. + Don't add trailing whitespace to error message. + Remove TODO to uniq COMPILE_OPTIONS + Remove the LINK_LANGUAGE generator expression. + Genex: Fix $<CONFIG> with IMPORTED targets and multiple locations. + FindQt4: Don't use Qt component _FOUND vars before they're defined (#14286) + Add a convenient way to add the includes install dir to the INTERFACE. + Use linked frameworks as a source of include directories. + target_link_libraries: Add PUBLIC/PRIVATE/INTERFACE keyword signature + FindQt4: Re-add QAxServer to the QT_MODULES. + FindQt4: Populate the INTERFACE_LINK_LIBRARIES of IMPORTED targets. + Genex: Allow relative paths in INSTALL_INTERFACE. + cmTarget: Fix property name typo in docs. + Docs: Document file(GENERATE) CONDITION as optional. + Qt4Macros: Remove unneeded generate CONDITION. + Qt4Macros: Remove undefined varible use. + Qt4Macros: Simplify some variable population. + Docs: Document existing target property debugging options. + Docs: Trim trailing whitespace in generated doc. + Docs: Generalize and de-duplicate VISIBILITY_PREFIX docs. + Docs: Document variables for default visibility values. + Export: Fix typo of LINK_INTERFACE_LIBRARIES. + cmTarget: Remove duplicates when printing traces of tll signatures + cmTarget: Fix iface libraries and languages for static libraries. + Genex: Disallow LINKER_LANGUAGE only when used on a static library. + install: Remove error condition using INCLUDES DESTINATION without EXPORT. + Fix crash on export of target with empty INTERFACE_INCLUDE_DIRECTORIES. + Allow target commands to be invoked with no items (#14325). + Docs: Fix typo in CMAKE_DEBUG_TARGET_PROPERTIES + cmTarget: Add NAME property + Export: Process generator expressions from INCLUDES DESTINATION. + Add the ALIAS target concept for libraries and executables. + Revert "Add compiler target compile options." + Genex: Fix segfault when parsing ends with parameter expectation. + +Vadim Zhukov (1): + Add cmake_reset_check_state() macro + +Victor Zverovich (1): + Use GmakeErrorParser instead of deprecated MakeErrorParser (fixes bug 0013699) + +Yichao Yu (1): + variable_watch: Add missing string enumeration entry (#14188) + +Ömer Fadıl USTA (3): + ccmake: Add missing initializers reported by cppcheck + libarchive: Fix free() order to avoid accessing freed memory + cmcurl: Fix resource leak reported by cppcheck + Changes in CMake 2.8.11.2 (since 2.8.11.1) ------------------------------------------ Alex Neundorf (1): diff --git a/Docs/bash-completion/cmake b/Docs/bash-completion/cmake index 5f33c09..59e0298 100644 --- a/Docs/bash-completion/cmake +++ b/Docs/bash-completion/cmake @@ -111,12 +111,12 @@ _cmake() ;; --help-command) COMPREPLY=( $( compgen -W '$( cmake --help-command-list 2>/dev/null| - tail -n +2 )' -- "$cur" ) ) + grep -v "^cmake version " )' -- "$cur" ) ) return ;; --help-module) COMPREPLY=( $( compgen -W '$( cmake --help-module-list 2>/dev/null| - tail -n +2 )' -- "$cur" ) ) + grep -v "^cmake version " )' -- "$cur" ) ) return ;; --help-policy) @@ -126,12 +126,12 @@ _cmake() ;; --help-property) COMPREPLY=( $( compgen -W '$( cmake --help-property-list \ - 2>/dev/null | tail -n +2 )' -- "$cur" ) ) + 2>/dev/null | grep -v "^cmake version " )' -- "$cur" ) ) return ;; --help-variable) COMPREPLY=( $( compgen -W '$( cmake --help-variable-list \ - 2>/dev/null | tail -n +2 )' -- "$cur" ) ) + 2>/dev/null | grep -v "^cmake version " )' -- "$cur" ) ) return ;; esac diff --git a/Docs/bash-completion/cpack b/Docs/bash-completion/cpack index 51638c5..9ab6048 100644 --- a/Docs/bash-completion/cpack +++ b/Docs/bash-completion/cpack @@ -20,7 +20,7 @@ _cpack() -D) [[ $cur == *=* ]] && return # no completion for values COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \ - 2>/dev/null | tail -n +2 )' -S = -- "$cur" ) ) + 2>/dev/null | grep -v "^cpack version " )' -S = -- "$cur" ) ) compopt -o nospace return ;; @@ -38,12 +38,12 @@ _cpack() ;; --help-command) COMPREPLY=( $( compgen -W '$( cpack --help-command-list 2>/dev/null| - tail -n +2 )' -- "$cur" ) ) + grep -v "^cpack version " )' -- "$cur" ) ) return ;; --help-variable) COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \ - 2>/dev/null | tail -n +2 )' -- "$cur" ) ) + 2>/dev/null | grep -v "^cpack version " )' -- "$cur" ) ) return ;; esac diff --git a/Docs/bash-completion/ctest b/Docs/bash-completion/ctest index 7433d3d..25cb998 100644 --- a/Docs/bash-completion/ctest +++ b/Docs/bash-completion/ctest @@ -63,7 +63,7 @@ _ctest() ;; --help-command) COMPREPLY=( $( compgen -W '$( ctest --help-command-list 2>/dev/null| - tail -n +2 )' -- "$cur" ) ) + grep -v "^ctest version " )' -- "$cur" ) ) return ;; esac diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index ebd9ce0..da955cb 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -133,7 +133,11 @@ Id flags: ${testflags} endif() if(CMAKE_VS_WINCE_VERSION) set(id_entrypoint "mainACRTStartup") - set(id_subsystem 9) + if("${vs_version}" VERSION_LESS 9) + set(id_subsystem 9) + else() + set(id_subsystem 8) + endif() else() set(id_subsystem 1) endif() @@ -157,7 +161,8 @@ Id flags: ${testflags} ) # Match the compiler location line printed out. if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "CMAKE_${lang}_COMPILER=([^%\r\n]+)[\r\n]") - set(_comp "${CMAKE_MATCH_1}") + # Strip VS diagnostic output from the end of the line. + string(REGEX REPLACE " \\(TaskId:[0-9]*\\)$" "" _comp "${CMAKE_MATCH_1}") if(EXISTS "${_comp}") file(TO_CMAKE_PATH "${_comp}" _comp) set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE) diff --git a/Modules/CMakeGraphVizOptions.cmake b/Modules/CMakeGraphVizOptions.cmake index e4af54c..2f04abb 100644 --- a/Modules/CMakeGraphVizOptions.cmake +++ b/Modules/CMakeGraphVizOptions.cmake @@ -53,7 +53,7 @@ # Default : TRUE ##end ##variable -# GRAPHVIZ_MODULE_LIBS - Set this to FALSE to exclude static libraries from the generated graphs. +# GRAPHVIZ_MODULE_LIBS - Set this to FALSE to exclude module libraries from the generated graphs. # Mandatory : NO # Default : TRUE ##end diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake index d042d5e..3c56b7f 100644 --- a/Modules/CMakePackageConfigHelpers.cmake +++ b/Modules/CMakePackageConfigHelpers.cmake @@ -3,7 +3,8 @@ # CONFIGURE_PACKAGE_CONFIG_FILE(<input> <output> INSTALL_DESTINATION <path> # [PATH_VARS <var1> <var2> ... <varN>] # [NO_SET_AND_CHECK_MACRO] -# [NO_CHECK_REQUIRED_COMPONENTS_MACRO]) +# [NO_CHECK_REQUIRED_COMPONENTS_MACRO] +# [NO_FIND_DEPENDENCY_MACRO]) # # CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain # configure_file() command when creating the <Name>Config.cmake or <Name>-config.cmake @@ -154,7 +155,7 @@ endmacro() function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile) - set(options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO) + set(options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO NO_FIND_DEPENDENCY_MACRO) set(oneValueArgs INSTALL_DESTINATION ) set(multiValueArgs PATH_VARS ) @@ -240,6 +241,40 @@ endmacro() ") endif() + if(NOT CCF_NO_FIND_DEPENDENCY_MACRO) + set(PACKAGE_INIT "${PACKAGE_INIT} +macro(find_dependency dep) + if (NOT \${dep}_FOUND) + if (\${ARGV1}) + set(version \${ARGV1}) + endif() + set(exact_arg) + if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION_EXACT) + set(exact_arg EXACT) + endif() + set(quiet_arg) + if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) + set(quiet_arg QUIET) + endif() + set(required_arg) + if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED) + set(required_arg REQUIRED) + endif() + + find_package(\${dep} \${version} \${exact_arg} \${quiet_arg} \${required_arg}) + if (NOT \${dep}_FOUND) + set(\${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE \"\${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency \${dep} could not be found.\") + set(\${CMAKE_FIND_PACKAGE_NAME}_FOUND False) + return() + endif() + set(required_arg) + set(quiet_arg) + set(exact_arg) + endif() +endmacro() +") + endif() + set(PACKAGE_INIT "${PACKAGE_INIT} ####################################################################################") diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 0390ae4..8270ad4 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1292,22 +1292,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) # Make sure the build system knows the file is generated. set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE) - # Don't add the object file to the list of generated files if we are using - # visual studio and we are attaching the build rule to the cuda file. VS - # will add our object file to the linker automatically for us. - set(cuda_add_generated_file TRUE) - - if(NOT compile_to_ptx AND CMAKE_GENERATOR MATCHES "Visual Studio" AND CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE) - # Visual Studio 8 crashes when you close the solution when you don't add the object file. - if(NOT CMAKE_GENERATOR MATCHES "Visual Studio 8") - #message("Not adding ${generated_file}") - set(cuda_add_generated_file FALSE) - endif() - endif() - - if(cuda_add_generated_file) - list(APPEND _cuda_wrap_generated_files ${generated_file}) - endif() + list(APPEND _cuda_wrap_generated_files ${generated_file}) # Add the other files that we want cmake to clean on a cleanup ########## list(APPEND CUDA_ADDITIONAL_CLEAN_FILES "${cmake_dependency_file}") diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 8514164..0c246a1 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -289,27 +289,13 @@ if( NOT HDF5_FOUND ) ENV HDF5_ROOT PATH_SUFFIXES lib Lib ) select_library_configurations( HDF5_${LIB} ) - # even though we adjusted the individual library names in - # select_library_configurations, we still need to distinguish - # between debug and release variants because HDF5_LIBRARIES will - # need to specify different lists for debug and optimized builds. - # We can't just use the HDF5_${LIB}_LIBRARY variable (which was set - # up by the selection macro above) because it may specify debug and - # optimized variants for a particular library, but a list of - # libraries is allowed to specify debug and optimized only once. - list( APPEND HDF5_${LANGUAGE}_LIBRARIES_DEBUG - ${HDF5_${LIB}_LIBRARY_DEBUG} ) - list( APPEND HDF5_${LANGUAGE}_LIBRARIES_RELEASE - ${HDF5_${LIB}_LIBRARY_RELEASE} ) + list(APPEND HDF5_${LANGUAGE}_LIBRARIES ${HDF5_${LIB}_LIBRARY}) endforeach() list( APPEND HDF5_LIBRARY_DIRS ${HDF5_${LANGUAGE}_LIBRARY_DIRS} ) # Append the libraries for this language binding to the list of all # required libraries. - list( APPEND HDF5_LIBRARIES_DEBUG - ${HDF5_${LANGUAGE}_LIBRARIES_DEBUG} ) - list( APPEND HDF5_LIBRARIES_RELEASE - ${HDF5_${LANGUAGE}_LIBRARIES_RELEASE} ) + list(APPEND HDF5_LIBRARIES ${HDF5_${LANGUAGE}_LIBRARIES}) endforeach() # We may have picked up some duplicates in various lists during the above @@ -329,30 +315,10 @@ if( NOT HDF5_FOUND ) if( HDF5_INCLUDE_DIRS ) _remove_duplicates_from_beginning( HDF5_INCLUDE_DIRS ) endif() - if( HDF5_LIBRARIES_DEBUG ) - _remove_duplicates_from_beginning( HDF5_LIBRARIES_DEBUG ) - endif() - if( HDF5_LIBRARIES_RELEASE ) - _remove_duplicates_from_beginning( HDF5_LIBRARIES_RELEASE ) - endif() if( HDF5_LIBRARY_DIRS ) _remove_duplicates_from_beginning( HDF5_LIBRARY_DIRS ) endif() - # Construct the complete list of HDF5 libraries with debug and optimized - # variants when the generator supports them. - if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) - set( HDF5_LIBRARIES ) - foreach( _lib ${HDF5_LIBRARIES_DEBUG} ) - list( APPEND HDF5_LIBRARIES debug ${_lib} ) - endforeach() - foreach( _lib ${HDF5_LIBRARIES_RELEASE} ) - list( APPEND HDF5_LIBRARIES optimized ${_lib} ) - endforeach() - else() - set( HDF5_LIBRARIES ${HDF5_LIBRARIES_RELEASE} ) - endif() - # If the HDF5 include directory was found, open H5pubconf.h to determine if # HDF5 was compiled with parallel IO support set( HDF5_IS_PARALLEL FALSE ) diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake new file mode 100644 index 0000000..31fe54c --- /dev/null +++ b/Modules/FindLua.cmake @@ -0,0 +1,153 @@ +# Locate Lua library +# This module defines +# LUA_FOUND - if false, do not try to link to Lua +# LUA_LIBRARIES - both lua and lualib +# LUA_INCLUDE_DIR - where to find lua.h +# LUA_VERSION_STRING - the version of Lua found +# LUA_VERSION_MAJOR - the major version of Lua +# LUA_VERSION_MINOR - the minor version of Lua +# LUA_VERSION_PATCH - the patch version of Lua +# +# Note that the expected include convention is +# #include "lua.h" +# and not +# #include <lua/lua.h> +# This is because, the lua location is not standardized and may exist +# in locations other than lua/ + +#============================================================================= +# Copyright 2007-2009 Kitware, Inc. +# Copyright 2013 Rolf Eike Beer <eike@sf-mail.de> +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +unset(_lua_include_subdirs) +unset(_lua_library_names) + +# this is a function only to have all the variables inside go away automatically +function(set_lua_version_vars) + set(LUA_VERSIONS5 5.3 5.2 5.1 5.0) + + if (Lua_FIND_VERSION_EXACT) + if (Lua_FIND_VERSION_COUNT GREATER 1) + set(lua_append_versions ${Lua_FIND_VERSION_MAJOR} ${Lua_FIND_VERSION_MINOR}) + endif () + elseif (Lua_FIND_VERSION) + # once there is a different major version supported this should become a loop + if (NOT Lua_FIND_VERSION_MAJOR GREATER 5) + if (Lua_FIND_VERSION_COUNT EQUAL 1) + set(lua_append_versions ${LUA_VERSIONS5}) + else () + foreach (subver IN LISTS LUA_VERSIONS5) + if (NOT subver VERSION_LESS ${Lua_FIND_VERSION}) + list(APPEND lua_append_versions ${subver}) + endif () + endforeach () + endif () + endif () + else () + # once there is a different major version supported this should become a loop + set(lua_append_versions ${LUA_VERSIONS5}) + endif () + + foreach (ver IN LISTS lua_append_versions) + string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}") + list(APPEND _lua_include_subdirs + include/lua${CMAKE_MATCH_1}${CMAKE_MATCH_2} + include/lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2} + include/lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2} + ) + list(APPEND _lua_library_names + lua${CMAKE_MATCH_1}${CMAKE_MATCH_2} + lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2} + lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2} + ) + endforeach () + + set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE) + set(_lua_library_names "${_lua_library_names}" PARENT_SCOPE) +endfunction(set_lua_version_vars) + +set_lua_version_vars() + +find_path(LUA_INCLUDE_DIR lua.h + HINTS + ENV LUA_DIR + PATH_SUFFIXES ${_lua_include_subdirs} include/lua include + PATHS + ~/Library/Frameworks + /Library/Frameworks + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt +) +unset(_lua_include_subdirs) + +find_library(LUA_LIBRARY + NAMES ${_lua_library_names} lua + HINTS + ENV LUA_DIR + PATH_SUFFIXES lib + PATHS + ~/Library/Frameworks + /Library/Frameworks + /sw + /opt/local + /opt/csw + /opt +) +unset(_lua_library_names) + +if (LUA_LIBRARY) + # include the math library for Unix + if (UNIX AND NOT APPLE AND NOT BEOS) + find_library(LUA_MATH_LIBRARY m) + set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}") + # For Windows and Mac, don't need to explicitly include the math library + else () + set(LUA_LIBRARIES "${LUA_LIBRARY}") + endif () +endif () + +if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h") + # At least 5.[012] have different ways to express the version + # so all of them need to be tested. Lua 5.2 defines LUA_VERSION + # and LUA_RELEASE as joined by the C preprocessor, so avoid those. + file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_strings + REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*") + + string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};") + if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$") + string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};") + string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};") + set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}") + else () + string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};") + if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$") + string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};") + endif () + string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}") + string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}") + string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}") + endif () + + unset(lua_version_strings) +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(Lua + REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR + VERSION_VAR LUA_VERSION_STRING) + +mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY LUA_MATH_LIBRARY) diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake index 33c2971..a2577d2 100644 --- a/Modules/FindPNG.cmake +++ b/Modules/FindPNG.cmake @@ -58,15 +58,19 @@ if(ZLIB_FOUND) list(APPEND PNG_NAMES png${v} libpng${v}) list(APPEND PNG_NAMES_DEBUG png${v}d libpng${v}d) endforeach() -message(STATUS "PNG r: ${PNG_NAMES} d: ${PNG_NAMES_DEBUG}") unset(_PNG_VERSION_SUFFIXES) - find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES}) - find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG}) + # For compatiblity with versions prior to this multi-config search, honor + # any PNG_LIBRARY that is already specified and skip the search. + if(NOT PNG_LIBRARY) + find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES}) + find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG}) + include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) + select_library_configurations(PNG) + mark_as_advanced(PNG_LIBRARY_RELEASE PNG_LIBRARY_DEBUG) + endif() unset(PNG_NAMES) unset(PNG_NAMES_DEBUG) - include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) - select_library_configurations(PNG) # Set by select_library_configurations(), but we want the one from # find_package_handle_standard_args() below. unset(PNG_FOUND) diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake index 7fb65b8..b6b7897 100644 --- a/Modules/FindPythonInterp.cmake +++ b/Modules/FindPythonInterp.cmake @@ -36,28 +36,30 @@ 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}) + if(PythonInterp_FIND_VERSION_COUNT GREATER 1) + set(_PYTHON_FIND_MAJ_MIN "${PythonInterp_FIND_VERSION_MAJOR}.${PythonInterp_FIND_VERSION_MINOR}") + list(APPEND _Python_NAMES + python${_PYTHON_FIND_MAJ_MIN} + python${PythonInterp_FIND_VERSION_MAJOR}) unset(_PYTHON_FIND_OTHER_VERSIONS) if(NOT PythonInterp_FIND_VERSION_EXACT) - foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS}) + foreach(_PYTHON_V ${_PYTHON${PythonInterp_FIND_VERSION_MAJOR}_VERSIONS}) if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN) list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V}) endif() endforeach() endif() unset(_PYTHON_FIND_MAJ_MIN) - unset(_PYTHON_FIND_MAJ) else() - list(APPEND _Python_NAMES python${PythonInterp_FIND_VERSION}) - set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonInterp_FIND_VERSION}_VERSIONS}) + list(APPEND _Python_NAMES python${PythonInterp_FIND_VERSION_MAJOR}) + set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonInterp_FIND_VERSION_MAJOR}_VERSIONS}) endif() else() set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS}) endif() +message(STATUS "names ${_Python_NAMES}") +message(STATUS "other versions ${_PYTHON_FIND_OTHER_VERSIONS}") list(APPEND _Python_NAMES python) # Search for the current active python version first diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index bffa9fb..8356ed9 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -41,9 +41,8 @@ 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}") + if(PythonLibs_FIND_VERSION_COUNT GREATER 1) + set(_PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION_MAJOR}.${PythonLibs_FIND_VERSION_MINOR}") unset(_PYTHON_FIND_OTHER_VERSIONS) if(PythonLibs_FIND_VERSION_EXACT) if(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION) @@ -52,16 +51,15 @@ if(PythonLibs_FIND_VERSION) set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}") endif() else() - foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS}) + foreach(_PYTHON_V ${_PYTHON${PythonLibs_FIND_VERSION_MAJOR}_VERSIONS}) if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN) list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V}) endif() endforeach() endif() unset(_PYTHON_FIND_MAJ_MIN) - unset(_PYTHON_FIND_MAJ) else() - set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION}_VERSIONS}) + set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION_MAJOR}_VERSIONS}) endif() else() set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS}) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 37a894c..28c1b64 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -475,6 +475,8 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") # settings. if(MINGW) set(WX_LIB_DIR_PREFIX gcc) + elseif(CMAKE_CL_64) + set(WX_LIB_DIR_PREFIX vc_x64) else() set(WX_LIB_DIR_PREFIX vc) endif() diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake index 798c44c..afeb9c5 100644 --- a/Modules/FortranCInterface/Detect.cmake +++ b/Modules/FortranCInterface/Detect.cmake @@ -49,7 +49,7 @@ unset(FortranCInterface_COMPILED CACHE) # Locate the sample project executable. if(FortranCInterface_COMPILED) find_program(FortranCInterface_EXE - NAMES FortranCInterface + NAMES FortranCInterface${CMAKE_EXECUTABLE_SUFFIX} PATHS ${FortranCInterface_BINARY_DIR} ${FortranCInterface_BINARY_DIR}/Debug NO_DEFAULT_PATH ) diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake index 4ef14ac..b2fda09 100644 --- a/Modules/GenerateExportHeader.cmake +++ b/Modules/GenerateExportHeader.cmake @@ -1,6 +1,5 @@ # - Function for generation of export macros for libraries -# This module provides the function GENERATE_EXPORT_HEADER() and the -# accompanying ADD_COMPILER_EXPORT_FLAGS() function. +# This module provides the function GENERATE_EXPORT_HEADER(). # # The GENERATE_EXPORT_HEADER function can be used to generate a file suitable # for preprocessor inclusion which contains EXPORT macros to be used in @@ -18,20 +17,17 @@ # [PREFIX_NAME <prefix_name>] # ) # -# ADD_COMPILER_EXPORT_FLAGS( [<output_variable>] ) +# The target properties CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN +# can be used to add the appropriate compile flags for targets. See the +# documentation of those target properties, and the convenience variables +# CMAKE_CXX_VISIBILITY_PRESET and CMAKE_VISIBILITY_INLINES_HIDDEN. # # 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 -# adds -fvisibility=hidden to CMAKE_CXX_FLAGS if supported, and is a no-op on -# Windows which does not need extra compiler flags for exporting support. You -# may optionally pass a single argument to ADD_COMPILER_EXPORT_FLAGS that will -# be populated with the required CXX_FLAGS required to enable visibility support -# for the compiler/architecture in use. +# determined by the name of the library. This means that in the simplest case, +# users of generate_export_header will be equivalent to: # -# This means that in the simplest case, users of these functions will be -# equivalent to: -# -# add_compiler_export_flags() +# set(CMAKE_CXX_VISIBILITY_PRESET hidden) +# set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) # add_library(somelib someclass.cpp) # generate_export_header(somelib) # install(TARGETS somelib DESTINATION ${LIBRARY_INSTALL_DIR}) @@ -128,6 +124,20 @@ # generate_export_header(somelib PREFIX_NAME VTK_) # # Generates the macros VTK_SOMELIB_EXPORT etc. +# +# +# ADD_COMPILER_EXPORT_FLAGS( [<output_variable>] ) +# +# The ADD_COMPILER_EXPORT_FLAGS function +# adds -fvisibility=hidden to CMAKE_CXX_FLAGS if supported, and is a no-op on +# Windows which does not need extra compiler flags for exporting support. You +# may optionally pass a single argument to ADD_COMPILER_EXPORT_FLAGS that will +# be populated with the required CXX_FLAGS required to enable visibility support +# for the compiler/architecture in use. +# +# This function is deprecated. Set the target properties CXX_VISIBILITY_PRESET +# and VISIBILITY_INLINES_HIDDEN instead. +# #============================================================================= # Copyright 2011 Stephen Kelly <steveire@gmail.com> @@ -326,6 +336,17 @@ function(GENERATE_EXPORT_HEADER TARGET_LIBRARY) endfunction() function(add_compiler_export_flags) + if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) + if(CMAKE_WARN_DEPRECATED) + set(messageType WARNING) + endif() + if(CMAKE_ERROR_DEPRECATED) + set(messageType FATAL_ERROR) + endif() + if(messageType) + message(${messageType} "The add_compiler_export_flags function is obsolete. Use the CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN target properties instead.") + endif() + endif() _test_compiler_hidden_visibility() _test_compiler_has_deprecated() diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 0930880..72844b5 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -294,6 +294,15 @@ endif() # set up the default search directories for frameworks set(CMAKE_SYSTEM_FRAMEWORK_PATH ~/Library/Frameworks + ) +if(_CMAKE_OSX_SYSROOT_PATH) + list(APPEND CMAKE_SYSTEM_FRAMEWORK_PATH + ${_CMAKE_OSX_SYSROOT_PATH}/Library/Frameworks + ${_CMAKE_OSX_SYSROOT_PATH}/Network/Library/Frameworks + ${_CMAKE_OSX_SYSROOT_PATH}/System/Library/Frameworks + ) +endif() +list(APPEND CMAKE_SYSTEM_FRAMEWORK_PATH /Library/Frameworks /Network/Library/Frameworks /System/Library/Frameworks) diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 685638a..7036ba0 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -124,8 +124,15 @@ endif() set(CMAKE_BUILD_TYPE_INIT Debug) if(WINCE) - string(TOUPPER "${MSVC_C_ARCHITECTURE_ID}" _MSVC_C_ARCHITECTURE_ID_UPPER) - string(TOUPPER "${MSVC_CXX_ARCHITECTURE_ID}" _MSVC_CXX_ARCHITECTURE_ID_UPPER) + foreach(lang C CXX) + set(_MSVC_${lang}_ARCHITECTURE_FAMILY "${MSVC_${lang}_ARCHITECTURE_ID}") + if(_MSVC_${lang}_ARCHITECTURE_FAMILY STREQUAL "THUMB") + set(_MSVC_${lang}_ARCHITECTURE_FAMILY "ARM") + elseif(_MSVC_${lang}_ARCHITECTURE_FAMILY MATCHES "^SH") + set(_MSVC_${lang}_ARCHITECTURE_FAMILY "SHx") + endif() + string(TOUPPER "${_MSVC_${lang}_ARCHITECTURE_FAMILY}" _MSVC_${lang}_ARCHITECTURE_FAMILY_UPPER) + endforeach() if("${CMAKE_SYSTEM_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)") math(EXPR _CE_VERSION "${CMAKE_MATCH_1}*100 + ${CMAKE_MATCH_2}") @@ -136,15 +143,15 @@ if(WINCE) endif() set(_PLATFORM_DEFINES "/D_WIN32_WCE=0x${_CE_VERSION} /DUNDER_CE") - set(_PLATFORM_DEFINES_C " /D${MSVC_C_ARCHITECTURE_ID} /D_${_MSVC_C_ARCHITECTURE_ID_UPPER}_") - set(_PLATFORM_DEFINES_CXX " /D${MSVC_CXX_ARCHITECTURE_ID} /D_${_MSVC_CXX_ARCHITECTURE_ID_UPPER}_") + set(_PLATFORM_DEFINES_C " /D${_MSVC_C_ARCHITECTURE_FAMILY} /D_${_MSVC_C_ARCHITECTURE_FAMILY_UPPER}_") + set(_PLATFORM_DEFINES_CXX " /D${_MSVC_CXX_ARCHITECTURE_FAMILY} /D_${_MSVC_CXX_ARCHITECTURE_FAMILY_UPPER}_") set(_RTC1 "") set(_FLAGS_CXX " /GR /EHsc") set(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib") set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /NODEFAULTLIB:libc.lib /NODEFAULTLIB:oldnames.lib") - if (MSVC_VERSION LESS 1500) + if (MSVC_VERSION LESS 1600) set(CMAKE_C_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT} corelibc.lib") endif () else() @@ -231,7 +238,6 @@ macro(__windows_compiler_msvc lang) set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /FoNUL /FAs /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}") - set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link") set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1) set(CMAKE_${lang}_LINK_EXECUTABLE "${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 2303ffb..e7d0bb7 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,6 +1,6 @@ # CMake version number components. set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) -set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130911) +set(CMake_VERSION_PATCH 12) +set(CMake_VERSION_TWEAK 20131007) #set(CMake_VERSION_RC 1) diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 4d62f72..a4dfdc9 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -66,9 +66,8 @@ CMakeSetupDialog::CMakeSetupDialog() // create the GUI QSettings settings; settings.beginGroup("Settings/StartPath"); - int h = settings.value("Height", 500).toInt(); - int w = settings.value("Width", 700).toInt(); - this->resize(w, h); + restoreGeometry(settings.value("geometry").toByteArray()); + restoreState(settings.value("windowState").toByteArray()); this->AddVariableCompletions = settings.value("AddVariableCompletionEntries", QStringList("CMAKE_INSTALL_PREFIX")).toStringList(); @@ -299,8 +298,8 @@ CMakeSetupDialog::~CMakeSetupDialog() { QSettings settings; settings.beginGroup("Settings/StartPath"); - settings.setValue("Height", this->height()); - settings.setValue("Width", this->width()); + settings.setValue("windowState", QVariant(saveState())); + settings.setValue("geometry", QVariant(saveGeometry())); settings.setValue("SplitterSizes", this->Splitter->saveState()); // wait for thread to stop diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h index 46cd77e..7bab741 100644 --- a/Source/cmDocumentGeneratorExpressions.h +++ b/Source/cmDocumentGeneratorExpressions.h @@ -40,6 +40,9 @@ "is exported using export(), or when the target is used by another " \ "target in the same buildsystem. Expands to the empty string " \ "otherwise.\n" \ + " $<PLATFORM_ID> = The CMake-id of the platform " \ + " $<PLATFORM_ID:comp> = '1' if the The CMake-id of the " \ + "platform matches comp, otherwise '0'.\n" \ " $<C_COMPILER_ID> = The CMake-id of the C compiler " \ "used.\n" \ " $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C " \ diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index c4f6216..54f41af 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -1578,6 +1578,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "See that target property for additional information.", false, "Variables that Control the Build"); + cm->DefineProperty + ("CMAKE_MAP_IMPORTED_CONFIG_<CONFIG>", cmProperty::VARIABLE, + "Default value for MAP_IMPORTED_CONFIG_<CONFIG> of targets.", + "This variable is used to initialize the " + "MAP_IMPORTED_CONFIG_<CONFIG> property on all the targets. " + "See that target property for additional information.", + false, + "Variables that Control the Build"); // Variables defined when the a language is enabled These variables will // also be defined whenever CMake has loaded its support for compiling (LANG) diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 8cfb656..58ce36b 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -829,10 +829,10 @@ int cmDocumentation::GetStructuredDocFromFile( std::vector<cmDocumentationEntry>& commands, cmake* cm) { - typedef enum sdoce { + enum sdoce { SDOC_NONE, SDOC_MODULE, SDOC_MACRO, SDOC_FUNCTION, SDOC_VARIABLE, SDOC_SECTION, - SDOC_UNKNOWN} sdoc_t; + SDOC_UNKNOWN}; int nbDocItemFound = 0; int docCtxIdx = 0; std::vector<int> docContextStack(60); diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index c97d4ff..c8b4a79 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -162,7 +162,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) if (require2_8_12) { - this->GenerateRequiredCMakeVersion(os, "2.8.11.20130626"); + this->GenerateRequiredCMakeVersion(os, "2.8.12"); } // Now load per-configuration properties for them. diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index e962313..97853f3 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -71,7 +71,7 @@ const char *cmCompiledGeneratorExpression::Evaluate( cmTarget *currentTarget, cmGeneratorExpressionDAGChecker *dagChecker) const { - if (!this->NeedsParsing) + if (!this->NeedsEvaluation) { return this->Input.c_str(); } @@ -129,9 +129,9 @@ cmCompiledGeneratorExpression::cmCompiledGeneratorExpression( cmGeneratorExpressionLexer l; std::vector<cmGeneratorExpressionToken> tokens = l.Tokenize(this->Input.c_str()); - this->NeedsParsing = l.GetSawGeneratorExpression(); + this->NeedsEvaluation = l.GetSawGeneratorExpression(); - if (this->NeedsParsing) + if (this->NeedsEvaluation) { cmGeneratorExpressionParser p(tokens); p.Parse(this->Evaluators); @@ -192,11 +192,12 @@ static std::string stripAllGeneratorExpressions(const std::string &input) std::string result; std::string::size_type pos = 0; std::string::size_type lastPos = pos; + int nestingLevel = 0; while((pos = input.find("$<", lastPos)) != input.npos) { result += input.substr(lastPos, pos - lastPos); pos += 2; - int nestingLevel = 1; + nestingLevel = 1; const char *c = input.c_str() + pos; const char * const cStart = c; for ( ; *c; ++c) @@ -224,7 +225,10 @@ static std::string stripAllGeneratorExpressions(const std::string &input) pos += traversed; lastPos = pos; } - result += input.substr(lastPos); + if (nestingLevel == 0) + { + result += input.substr(lastPos); + } return cmGeneratorExpression::StripEmptyListElements(result); } @@ -234,9 +238,12 @@ static void prefixItems(const std::string &content, std::string &result, { std::vector<std::string> entries; cmGeneratorExpression::Split(content, entries); + const char *sep = ""; for(std::vector<std::string>::const_iterator ei = entries.begin(); ei != entries.end(); ++ei) { + result += sep; + sep = ";"; if (!cmSystemTools::FileIsFullPath(ei->c_str()) && cmGeneratorExpression::Find(*ei) == std::string::npos) { @@ -253,6 +260,7 @@ static std::string stripExportInterface(const std::string &input, { std::string result; + int nestingLevel = 0; std::string::size_type pos = 0; std::string::size_type lastPos = pos; while (true) @@ -282,7 +290,7 @@ static std::string stripExportInterface(const std::string &input, const bool gotInstallInterface = input[pos + 2] == 'I'; pos += gotInstallInterface ? sizeof("$<INSTALL_INTERFACE:") - 1 : sizeof("$<BUILD_INTERFACE:") - 1; - int nestingLevel = 1; + nestingLevel = 1; const char *c = input.c_str() + pos; const char * const cStart = c; for ( ; *c; ++c) @@ -331,7 +339,10 @@ static std::string stripExportInterface(const std::string &input, pos += traversed; lastPos = pos; } - result += input.substr(lastPos); + if (nestingLevel == 0) + { + result += input.substr(lastPos); + } return cmGeneratorExpression::StripEmptyListElements(result); } diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index c20f130..bc0f6c2 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -126,7 +126,7 @@ private: cmListFileBacktrace Backtrace; std::vector<cmGeneratorExpressionEvaluator*> Evaluators; const std::string Input; - bool NeedsParsing; + bool NeedsEvaluation; mutable std::set<cmTarget*> DependTargets; mutable std::set<cmTarget*> AllTargetsSeen; diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index abe4e70..7fd0fdc 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -438,6 +438,39 @@ static const struct CxxCompilerVersionNode : public CompilerVersionNode //---------------------------------------------------------------------------- +struct PlatformIdNode : public cmGeneratorExpressionNode +{ + PlatformIdNode() {} + + virtual int NumExpectedParameters() const { return ZeroOrMoreParameters; } + + std::string Evaluate(const std::vector<std::string> ¶meters, + cmGeneratorExpressionContext *context, + const GeneratorExpressionContent *, + cmGeneratorExpressionDAGChecker *) const + { + const char *platformId = context->Makefile ? + context->Makefile->GetSafeDefinition( + "CMAKE_SYSTEM_NAME") : ""; + if (parameters.size() == 0) + { + return platformId ? platformId : ""; + } + + if (!platformId) + { + return parameters.front().empty() ? "1" : "0"; + } + + if (cmsysString_strcasecmp(parameters.begin()->c_str(), platformId) == 0) + { + return "1"; + } + return "0"; + } +} platformIdNode; + +//---------------------------------------------------------------------------- static const struct VersionGreaterNode : public cmGeneratorExpressionNode { VersionGreaterNode() {} @@ -1356,6 +1389,8 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier) return &cCompilerVersionNode; else if (identifier == "CXX_COMPILER_VERSION") return &cxxCompilerVersionNode; + else if (identifier == "PLATFORM_ID") + return &platformIdNode; else if (identifier == "CONFIGURATION") return &configurationNode; else if (identifier == "CONFIG") diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 7f2b592..799bbdb 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -146,9 +146,17 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, const char* cname = this->GetCMakeInstance()-> GetCacheManager()->GetCacheValue(langComp.c_str()); std::string changeVars; - if(cname && (path != cname) && (optional==false)) + if(cname && !optional) { - std::string cnameString = cname; + std::string cnameString; + if(!cmSystemTools::FileIsFullPath(cname)) + { + cnameString = cmSystemTools::FindProgram(cname); + } + else + { + cnameString = cname; + } std::string pathString = path; // get rid of potentially multiple slashes: cmSystemTools::ConvertToUnixSlashes(cnameString); diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index e4244e0..1a4c7ff 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -202,7 +202,7 @@ std::string cmGlobalVisualStudio8Generator::GetUserMacrosRegKeyBase() } //---------------------------------------------------------------------------- -void cmGlobalVisualStudio8Generator::AddCheckTarget() +bool cmGlobalVisualStudio8Generator::AddCheckTarget() { // Add a special target on which all other targets depend that // checks the build system and optionally re-runs CMake. @@ -216,7 +216,7 @@ void cmGlobalVisualStudio8Generator::AddCheckTarget() // Skip the target if no regeneration is to be done. if(mf->IsOn("CMAKE_SUPPRESS_REGENERATION")) { - return; + return false; } std::string cmake_command = mf->GetRequiredDefinition("CMAKE_COMMAND"); @@ -315,21 +315,24 @@ void cmGlobalVisualStudio8Generator::AddCheckTarget() cmSystemTools::Error("Error adding rule for ", stamps[0].c_str()); } } + + return true; } //---------------------------------------------------------------------------- void cmGlobalVisualStudio8Generator::Generate() { - this->AddCheckTarget(); - - // All targets depend on the build-system check target. - for(std::map<cmStdString,cmTarget *>::const_iterator - ti = this->TotalTargets.begin(); - ti != this->TotalTargets.end(); ++ti) + if(this->AddCheckTarget()) { - if(ti->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET) + // All targets depend on the build-system check target. + for(std::map<cmStdString,cmTarget *>::const_iterator + ti = this->TotalTargets.begin(); + ti != this->TotalTargets.end(); ++ti) { - ti->second->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET); + if(ti->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET) + { + ti->second->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET); + } } } diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index d181742..2376f8a 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -71,7 +71,7 @@ protected: virtual bool VSLinksDependencies() const { return false; } - void AddCheckTarget(); + bool AddCheckTarget(); static cmIDEFlagTable const* GetExtraFlagTableVS8(); virtual void WriteSLNHeader(std::ostream& fout); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 7cb2d1f..0a2b32b 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -431,13 +431,16 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, // Add XCODE depend helper std::string dir = mf->GetCurrentOutputDirectory(); - cmCustomCommandLine makecommand; - makecommand.push_back("make"); - makecommand.push_back("-C"); - makecommand.push_back(dir.c_str()); - makecommand.push_back("-f"); - makecommand.push_back(this->CurrentXCodeHackMakefile.c_str()); - makecommand.push_back(""); // placeholder, see below + cmCustomCommandLine makeHelper; + if(this->XcodeVersion < 50) + { + makeHelper.push_back("make"); + makeHelper.push_back("-C"); + makeHelper.push_back(dir.c_str()); + makeHelper.push_back("-f"); + makeHelper.push_back(this->CurrentXCodeHackMakefile.c_str()); + makeHelper.push_back(""); // placeholder, see below + } // Add ZERO_CHECK bool regenerate = !mf->IsOn("CMAKE_SUPPRESS_REGENERATION"); @@ -477,17 +480,18 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, // run the depend check makefile as a post build rule // this will make sure that when the next target is built // things are up-to-date - if((target.GetType() == cmTarget::EXECUTABLE || + if(!makeHelper.empty() && + (target.GetType() == cmTarget::EXECUTABLE || // Nope - no post-build for OBJECT_LIRBRARY // target.GetType() == cmTarget::OBJECT_LIBRARY || target.GetType() == cmTarget::STATIC_LIBRARY || target.GetType() == cmTarget::SHARED_LIBRARY || target.GetType() == cmTarget::MODULE_LIBRARY)) { - makecommand[makecommand.size()-1] = + makeHelper[makeHelper.size()-1] = // fill placeholder this->PostBuildMakeTarget(target.GetName(), "$(CONFIGURATION)"); cmCustomCommandLines commandLines; - commandLines.push_back(makecommand); + commandLines.push_back(makeHelper); lg->GetMakefile()->AddCustomCommandToTarget(target.GetName(), no_depends, commandLines, @@ -1027,18 +1031,21 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, } } - // Add object library contents as external objects. (Equivalent to - // the externalObjFiles above, except each one is not a cmSourceFile - // within the target.) - std::vector<std::string> objs; - this->GetGeneratorTarget(&cmtarget)->UseObjectLibraries(objs); - for(std::vector<std::string>::const_iterator - oi = objs.begin(); oi != objs.end(); ++oi) + if(this->XcodeVersion < 50) { - std::string obj = *oi; - cmXCodeObject* xsf = - this->CreateXCodeSourceFileFromPath(obj, cmtarget, ""); - externalObjFiles.push_back(xsf); + // Add object library contents as external objects. (Equivalent to + // the externalObjFiles above, except each one is not a cmSourceFile + // within the target.) + std::vector<std::string> objs; + this->GetGeneratorTarget(&cmtarget)->UseObjectLibraries(objs); + for(std::vector<std::string>::const_iterator + oi = objs.begin(); oi != objs.end(); ++oi) + { + std::string obj = *oi; + cmXCodeObject* xsf = + this->CreateXCodeSourceFileFromPath(obj, cmtarget, ""); + externalObjFiles.push_back(xsf); + } } // some build phases only apply to bundles and/or frameworks @@ -2765,13 +2772,6 @@ void cmGlobalXCodeGenerator } } - // Skip link information for static libraries. - if(cmtarget->GetType() == cmTarget::OBJECT_LIBRARY || - cmtarget->GetType() == cmTarget::STATIC_LIBRARY) - { - return; - } - // Loop over configuration types and set per-configuration info. for(std::vector<std::string>::iterator i = this->CurrentConfigurationTypes.begin(); @@ -2784,6 +2784,31 @@ void cmGlobalXCodeGenerator configName = 0; } + if(this->XcodeVersion >= 50) + { + // Add object library contents as link flags. + std::string linkObjs; + const char* sep = ""; + std::vector<std::string> objs; + this->GetGeneratorTarget(cmtarget)->UseObjectLibraries(objs); + for(std::vector<std::string>::const_iterator + oi = objs.begin(); oi != objs.end(); ++oi) + { + linkObjs += sep; + sep = " "; + linkObjs += this->XCodeEscapePath(oi->c_str()); + } + this->AppendBuildSettingAttribute(target, "OTHER_LDFLAGS", + linkObjs.c_str(), configName); + } + + // Skip link information for object libraries. + if(cmtarget->GetType() == cmTarget::OBJECT_LIBRARY || + cmtarget->GetType() == cmTarget::STATIC_LIBRARY) + { + continue; + } + // Compute the link library and directory information. cmComputeLinkInformation* pcli = cmtarget->GetLinkInformation(configName); if(!pcli) @@ -3338,8 +3363,11 @@ void cmGlobalXCodeGenerator cmXCodeObject* t = *i; this->AddDependAndLinkInformation(t); } - // now create xcode depend hack makefile - this->CreateXCodeDependHackTarget(targets); + if(this->XcodeVersion < 50) + { + // now create xcode depend hack makefile + this->CreateXCodeDependHackTarget(targets); + } // now add all targets to the root object cmXCodeObject* allTargets = this->CreateObject(cmXCodeObject::OBJECT_LIST); for(std::vector<cmXCodeObject*>::iterator i = targets.begin(); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 58cc6f4..bd6c860 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1954,23 +1954,27 @@ cmLocalVisualStudio7Generator // Compute the version of the Intel plugin to the VS IDE. // If the key does not exist then use a default guess. - std::string intelVersion = "9.10"; + std::string intelVersion; std::string vskey = gg->GetRegistryBase(); vskey += "\\Packages\\" CM_INTEL_PLUGIN_GUID ";ProductVersion"; cmSystemTools::ReadRegistryValue(vskey.c_str(), intelVersion, cmSystemTools::KeyWOW64_32); - if (intelVersion.find("13") == 0 || - intelVersion.find("12") == 0 || - intelVersion.find("11") == 0) + unsigned int intelVersionNumber = ~0u; + sscanf(intelVersion.c_str(), "%u", &intelVersionNumber); + if(intelVersionNumber >= 11) { - // Version 11.x, 12.x, and 13.x actually use 11.0 in project files! - intelVersion = "11.0" ; + // Default to latest known project file version. + intelVersion = "11.0"; } - else if(intelVersion.find("10") == 0) + else if(intelVersionNumber == 10) { // Version 10.x actually uses 9.10 in project files! intelVersion = "9.10"; } + else + { + // Version <= 9: use ProductVersion from registry. + } fout << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n" << "<VisualStudioProject\n" diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index fd06a33..34541e9 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1069,6 +1069,19 @@ void cmMakefile::UpdateOutputToSourceMap(std::string const& output, cmSourceFile* source) { + OutputToSourceMap::iterator i = this->OutputToSource.find(output); + if(i != this->OutputToSource.end()) + { + // Multiple custom commands produce the same output but may + // be attached to a different source file (MAIN_DEPENDENCY). + // LinearGetSourceFileWithOutput would return the first one, + // so keep the mapping for the first one. + // + // TODO: Warn the user about this case. However, the VS 8 generator + // triggers it for separate generate.stamp rules in ZERO_CHECK and + // individual targets. + return; + } this->OutputToSource[output] = source; } diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 0829cab..4e40f6c 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -21,6 +21,7 @@ #include "cmTarget.h" #include "cmake.h" #include "cmComputeLinkInformation.h" +#include "cmGeneratorExpression.h" #include "cmMakefileExecutableTargetGenerator.h" #include "cmMakefileLibraryTargetGenerator.h" @@ -131,7 +132,14 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules() this->Makefile->GetProperty ("ADDITIONAL_MAKE_CLEAN_FILES")) { - cmSystemTools::ExpandListArgument(additional_clean_files, + const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); + cmListFileBacktrace lfbt; + cmGeneratorExpression ge(lfbt); + cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = + ge.Parse(additional_clean_files); + + cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile, config, + false, this->Target, 0, 0), this->CleanFiles); } diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index a823f05..f9197e0 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -27,11 +27,11 @@ public: cmPolicies::PolicyStatus status) { if (!idString || !shortDescription || ! longDescription) - { + { cmSystemTools::Error("Attempt to define a policy without " "all parameters being specified!"); return; - } + } this->ID = iD; this->IDString = idString; this->ShortDescription = shortDescription; @@ -61,29 +61,29 @@ public: unsigned int tweakV) { if (majorV < this->MajorVersionIntroduced) - { + { return true; - } + } if (majorV > this->MajorVersionIntroduced) - { + { return false; - } + } if (minorV < this->MinorVersionIntroduced) - { + { return true; - } + } if (minorV > this->MinorVersionIntroduced) - { + { return false; - } + } if (patchV < this->PatchVersionIntroduced) - { + { return true; - } + } if (patchV > this->PatchVersionIntroduced) - { + { return false; - } + } return (tweakV < this->TweakVersionIntroduced); } @@ -609,9 +609,9 @@ cmPolicies::~cmPolicies() std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i = this->Policies.begin(); for (;i != this->Policies.end(); ++i) - { + { delete i->second; - } + } } void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD, @@ -626,11 +626,11 @@ void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD, { // a policy must be unique and can only be defined once if (this->Policies.find(iD) != this->Policies.end()) - { + { cmSystemTools::Error("Attempt to redefine a CMake policy for policy " "ID ", this->GetPolicyIDString(iD).c_str()); return; - } + } this->Policies[iD] = new cmPolicy(iD, idString, shortDescription, @@ -784,15 +784,15 @@ bool cmPolicies::GetPolicyDefault(cmMakefile* mf, std::string const& policy, bool cmPolicies::GetPolicyID(const char *id, cmPolicies::PolicyID &pid) { if (!id || strlen(id) < 1) - { + { return false; - } + } std::map<std::string,cmPolicies::PolicyID>::iterator pos = this->PolicyStringMap.find(id); if (pos == this->PolicyStringMap.end()) - { + { return false; - } + } pid = pos->second; return true; } @@ -802,9 +802,9 @@ std::string cmPolicies::GetPolicyIDString(cmPolicies::PolicyID pid) std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos = this->Policies.find(pid); if (pos == this->Policies.end()) - { + { return ""; - } + } return pos->second->IDString; } @@ -815,11 +815,11 @@ std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id) std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos = this->Policies.find(id); if (pos == this->Policies.end()) - { + { cmSystemTools::Error( "Request for warning text for undefined policy!"); return "Request for warning text for undefined policy!"; - } + } cmOStringStream msg; msg << @@ -839,11 +839,11 @@ std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id) std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos = this->Policies.find(id); if (pos == this->Policies.end()) - { + { cmSystemTools::Error( "Request for error text for undefined policy!"); return "Request for error text for undefined policy!"; - } + } cmOStringStream error; error << @@ -869,10 +869,10 @@ cmPolicies::GetPolicyStatus(cmPolicies::PolicyID id) std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos = this->Policies.find(id); if (pos == this->Policies.end()) - { + { // TODO is this right? return cmPolicies::WARN; - } + } return pos->second->Status; } @@ -883,7 +883,7 @@ void cmPolicies::GetDocumentation(std::vector<cmDocumentationEntry>& v) std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i = this->Policies.begin(); for (;i != this->Policies.end(); ++i) - { + { cmOStringStream full; full << i->second->LongDescription; full << "\nThis policy was introduced in CMake version "; @@ -920,7 +920,7 @@ void cmPolicies::GetDocumentation(std::vector<cmDocumentationEntry>& v) i->second->ShortDescription.c_str(), full.str().c_str()); v.push_back(e); - } + } } //---------------------------------------------------------------------------- diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index 93e39ab..54df12c 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -32,16 +32,28 @@ #include "cmQtAutomoc.h" -static bool containsQ_OBJECT(const std::string& text) +static bool requiresMocing(const std::string& text, std::string ¯oName) { // this simple check is much much faster than the regexp - if (strstr(text.c_str(), "Q_OBJECT") == NULL) + if (strstr(text.c_str(), "Q_OBJECT") == NULL + && strstr(text.c_str(), "Q_GADGET") == NULL) { return false; } cmsys::RegularExpression qObjectRegExp("[\n][ \t]*Q_OBJECT[^a-zA-Z0-9_]"); - return qObjectRegExp.find(text); + if (qObjectRegExp.find(text)) + { + macroName = "Q_OBJECT"; + return true; + } + cmsys::RegularExpression qGadgetRegExp("[\n][ \t]*Q_GADGET[^a-zA-Z0-9_]"); + if (qGadgetRegExp.find(text)) + { + macroName = "Q_GADGET"; + return true; + } + return false; } @@ -837,7 +849,8 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/'; const std::string scannedFileBasename = cmsys::SystemTools:: GetFilenameWithoutLastExtension(absFilename); - const bool cppContainsQ_OBJECT = containsQ_OBJECT(contentsString); + std::string macroName; + const bool requiresMoc = requiresMocing(contentsString, macroName); bool dotMocIncluded = false; bool mocUnderscoreIncluded = false; std::string ownMocUnderscoreFile; @@ -908,7 +921,7 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, else { std::string fileToMoc = absFilename; - if ((basename != scannedFileBasename) || (cppContainsQ_OBJECT==false)) + if ((basename != scannedFileBasename) || (requiresMoc==false)) { std::string mocSubDir = extractSubDir(absPath, currentMoc); std::string headerToMoc = findMatchingHeader( @@ -917,12 +930,12 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, { // this is for KDE4 compatibility: fileToMoc = headerToMoc; - if ((cppContainsQ_OBJECT==false) &&(basename==scannedFileBasename)) + if ((requiresMoc==false) &&(basename==scannedFileBasename)) { std::cerr << "AUTOMOC: warning: " << absFilename << ": The file " "includes the moc file \"" << currentMoc << - "\", but does not contain a Q_OBJECT macro. " - "Running moc on " + "\", but does not contain a " << macroName + << " macro. Running moc on " << "\"" << headerToMoc << "\" ! Include \"moc_" << basename << ".cpp\" for a compatiblity with " "strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n" @@ -965,13 +978,14 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, // If this is the case, the moc_foo.cpp should probably be generated from // foo.cpp instead of foo.h, because otherwise it won't build. // But warn, since this is not how it is supposed to be used. - if ((dotMocIncluded == false) && (cppContainsQ_OBJECT == true)) + if ((dotMocIncluded == false) && (requiresMoc == true)) { if (mocUnderscoreIncluded == true) { // this is for KDE4 compatibility: std::cerr << "AUTOMOC: warning: " << absFilename << ": The file " - << "contains a Q_OBJECT macro, but does not include " + << "contains a " << macroName << " macro, but does not " + "include " << "\"" << scannedFileBasename << ".moc\", but instead " "includes " << "\"" << ownMocUnderscoreFile << "\". Running moc on " @@ -986,7 +1000,8 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, { // otherwise always error out since it will not compile: std::cerr << "AUTOMOC: error: " << absFilename << ": The file " - << "contains a Q_OBJECT macro, but does not include " + << "contains a " << macroName << " macro, but does not " + "include " << "\"" << scannedFileBasename << ".moc\" !\n" << std::endl; ::exit(EXIT_FAILURE); @@ -1094,11 +1109,13 @@ void cmQtAutomoc::StrictParseCppFile(const std::string& absFilename, // If this is the case, the moc_foo.cpp should probably be generated from // foo.cpp instead of foo.h, because otherwise it won't build. // But warn, since this is not how it is supposed to be used. - if ((dotMocIncluded == false) && (containsQ_OBJECT(contentsString))) + std::string macroName; + if ((dotMocIncluded == false) && (requiresMocing(contentsString, + macroName))) { // otherwise always error out since it will not compile: std::cerr << "AUTOMOC: error: " << absFilename << ": The file " - << "contains a Q_OBJECT macro, but does not include " + << "contains a " << macroName << " macro, but does not include " << "\"" << scannedFileBasename << ".moc\" !\n" << std::endl; ::exit(EXIT_FAILURE); @@ -1165,7 +1182,8 @@ void cmQtAutomoc::ParseHeaders(const std::set<std::string>& absHeaders, const std::string currentMoc = "moc_" + basename + ".cpp"; const std::string contents = this->ReadAll(headerName); - if (containsQ_OBJECT(contents)) + std::string macroName; + if (requiresMocing(contents, macroName)) { //std::cout << "header contains Q_OBJECT macro"; notIncludedMocs[headerName] = currentMoc; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index d045d73..7df599f 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -924,7 +924,10 @@ void cmTarget::DefineProperties(cmake *cm) "The first configuration in the list found to be provided by the " "imported target is selected. If this property is set and no matching " "configurations are available, then the imported target is considered " - "to be not found. This property is ignored for non-imported targets.", + "to be not found. This property is ignored for non-imported targets.\n" + "This property is initialized by the value of the variable " + "CMAKE_MAP_IMPORTED_CONFIG_<CONFIG> if it is set when a target is " + "created.", false /* TODO: make this chained */ ); cm->DefineProperty @@ -1649,6 +1652,7 @@ void cmTarget::SetMakefile(cmMakefile* mf) "LIBRARY_OUTPUT_DIRECTORY_", "RUNTIME_OUTPUT_DIRECTORY_", "PDB_OUTPUT_DIRECTORY_", + "MAP_IMPORTED_CONFIG_", 0}; for(std::vector<std::string>::iterator ci = configNames.begin(); ci != configNames.end(); ++ci) @@ -2657,6 +2661,11 @@ void cmTarget::FinalizeSystemIncludeDirectories() end = this->Internal->LinkInterfacePropertyEntries.end(); it != end; ++it) { + if (!cmGeneratorExpression::IsValidTargetName(it->Value) + && cmGeneratorExpression::Find(it->Value) == std::string::npos) + { + continue; + } { cmListFileBacktrace lfbt; cmGeneratorExpression ge(lfbt); @@ -3033,15 +3042,11 @@ void cmTarget::SetProperty(const char* prop, const char* value) if (strcmp(prop, "LINK_LIBRARIES") == 0) { this->Internal->LinkInterfacePropertyEntries.clear(); - if (cmGeneratorExpression::IsValidTargetName(value) - || cmGeneratorExpression::Find(value) != std::string::npos) - { - cmListFileBacktrace lfbt; - this->Makefile->GetBacktrace(lfbt); - cmValueWithOrigin entry(value, lfbt); - this->Internal->LinkInterfacePropertyEntries.push_back(entry); - } - // Fall through + cmListFileBacktrace lfbt; + this->Makefile->GetBacktrace(lfbt); + cmValueWithOrigin entry(value, lfbt); + this->Internal->LinkInterfacePropertyEntries.push_back(entry); + return; } this->Properties.SetProperty(prop, value, cmProperty::TARGET); this->MaybeInvalidatePropertyCache(prop); @@ -3099,15 +3104,11 @@ void cmTarget::AppendProperty(const char* prop, const char* value, } if (strcmp(prop, "LINK_LIBRARIES") == 0) { - if (cmGeneratorExpression::IsValidTargetName(value) - || cmGeneratorExpression::Find(value) != std::string::npos) - { - cmListFileBacktrace lfbt; - this->Makefile->GetBacktrace(lfbt); - cmValueWithOrigin entry(value, lfbt); - this->Internal->LinkInterfacePropertyEntries.push_back(entry); - } - // Fall through + cmListFileBacktrace lfbt; + this->Makefile->GetBacktrace(lfbt); + cmValueWithOrigin entry(value, lfbt); + this->Internal->LinkInterfacePropertyEntries.push_back(entry); + return; } this->Properties.AppendProperty(prop, value, cmProperty::TARGET, asString); this->MaybeInvalidatePropertyCache(prop); @@ -3387,6 +3388,11 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config) end = this->Internal->LinkInterfacePropertyEntries.end(); it != end; ++it) { + if (!cmGeneratorExpression::IsValidTargetName(it->Value) + && cmGeneratorExpression::Find(it->Value) == std::string::npos) + { + continue; + } { cmGeneratorExpression ge(lfbt); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = @@ -3585,6 +3591,11 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result, end = this->Internal->LinkInterfacePropertyEntries.end(); it != end; ++it) { + if (!cmGeneratorExpression::IsValidTargetName(it->Value) + && cmGeneratorExpression::Find(it->Value) == std::string::npos) + { + continue; + } { cmGeneratorExpression ge(lfbt); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = @@ -3693,6 +3704,11 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list, end = this->Internal->LinkInterfacePropertyEntries.end(); it != end; ++it) { + if (!cmGeneratorExpression::IsValidTargetName(it->Value) + && cmGeneratorExpression::Find(it->Value) == std::string::npos) + { + continue; + } { cmGeneratorExpression ge(lfbt); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = @@ -4181,6 +4197,22 @@ const char *cmTarget::GetProperty(const char* prop, } return output.c_str(); } + if(strcmp(prop,"LINK_LIBRARIES") == 0) + { + static std::string output; + output = ""; + std::string sep; + for (std::vector<cmValueWithOrigin>::const_iterator + it = this->Internal->LinkInterfacePropertyEntries.begin(), + end = this->Internal->LinkInterfacePropertyEntries.end(); + it != end; ++it) + { + output += sep; + output += it->Value; + sep = ";"; + } + return output.c_str(); + } if (strcmp(prop,"IMPORTED") == 0) { @@ -6443,7 +6475,13 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface, ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n" << "Target \"" << this->GetName() << "\" has a " "INTERFACE_LINK_LIBRARIES property which differs from its " - << linkIfaceProp << " properties."; + << linkIfaceProp << " properties." + "\n" + "INTERFACE_LINK_LIBRARIES:\n " + << newExplicitLibraries + << "\n" + << linkIfaceProp << ":\n " + << (explicitLibraries ? explicitLibraries : "(empty)") << "\n"; this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); } // Fall through diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 290aff0..8b8cb01 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2437,11 +2437,6 @@ int cmake::ActualConfigure() { this->CacheManager->SaveCache(this->GetHomeOutputDirectory()); } - if ( !this->GraphVizFile.empty() ) - { - std::cout << "Generate graphviz: " << this->GraphVizFile << std::endl; - this->GenerateGraphViz(this->GraphVizFile.c_str()); - } if(cmSystemTools::GetErrorOccuredFlag()) { return -1; @@ -2604,6 +2599,11 @@ int cmake::Generate() return -1; } this->GlobalGenerator->Generate(); + if ( !this->GraphVizFile.empty() ) + { + std::cout << "Generate graphviz: " << this->GraphVizFile << std::endl; + this->GenerateGraphViz(this->GraphVizFile.c_str()); + } if(this->WarnUnusedCli) { this->RunCheckForUnusedVariables(); diff --git a/Tests/Architecture/CMakeLists.txt b/Tests/Architecture/CMakeLists.txt index 927ce3f..ea5fc0b 100644 --- a/Tests/Architecture/CMakeLists.txt +++ b/Tests/Architecture/CMakeLists.txt @@ -7,8 +7,8 @@ function(test_for_xcode4 result_var) execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE ov RESULT_VARIABLE rv ) - if("${rv}" STREQUAL "0") - if(ov MATCHES "^Xcode 4.[0-9].*$") + if("${rv}" STREQUAL "0" AND ov MATCHES "^Xcode ([0-9]+)\\.") + if(NOT CMAKE_MATCH_1 VERSION_LESS 4) set(${result_var} 1 PARENT_SCOPE) endif() endif() diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 3af0fda..0687154 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -285,6 +285,8 @@ if(EXISTS "${link_depends_no_shared_check_txt}") file(STRINGS "${link_depends_no_shared_check_txt}" link_depends_no_shared_check LIMIT_COUNT 1) if("${link_depends_no_shared_check}" STREQUAL "0") message(STATUS "link_depends_no_shared_exe is older than link_depends_no_shared_lib as expected.") + elseif(XCODE AND NOT XCODE_VERSION VERSION_LESS 5) + message(STATUS "Known limitation: link_depends_no_shared_exe is newer than link_depends_no_shared_lib but we cannot stop Xcode ${XCODE_VERSION} from enforcing this dependency.") else() message(SEND_ERROR "Project did not rebuild properly: link_depends_no_shared_exe is newer than link_depends_no_shared_lib.") endif() diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index b4c6a07..8806ecd 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -7,8 +7,8 @@ function(test_for_xcode4 result_var) execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE ov RESULT_VARIABLE rv ) - if("${rv}" STREQUAL "0") - if(ov MATCHES "^Xcode 4.[0-9].*$") + if("${rv}" STREQUAL "0" AND ov MATCHES "^Xcode ([0-9]+)\\.") + if(NOT CMAKE_MATCH_1 VERSION_LESS 4) set(${result_var} 1 PARENT_SCOPE) endif() endif() diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 739593c..691728a 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -22,11 +22,18 @@ endmacro() set(DESIRED_QT_VERSION 4) set(NO_QT4_MODULES "Qt3" "KDE3") +# ignore everything that has it's own test in Tests/Module/ +file(GLOB OWN_TEST_MODULES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../../Module/" "${CMAKE_CURRENT_SOURCE_DIR}/../../Module/Find*") +foreach(FIND_MODULE IN LISTS OWN_TEST_MODULES) + string(REGEX REPLACE "^Find" "" _MOD_NAME "${FIND_MODULE}") + list(APPEND NO_FIND_MODULES "${_MOD_NAME}") +endforeach() + # These modules are named Find*.cmake, but are nothing that works in # find_package(). -set(NO_FIND_MODULES "PackageHandleStandardArgs" "PackageMessage") +list(APPEND NO_FIND_MODULES "PackageHandleStandardArgs" "PackageMessage") -foreach(FIND_MODULE ${FIND_MODULES}) +foreach(FIND_MODULE IN LISTS FIND_MODULES) string(REGEX REPLACE ".*/Find(.*)\\.cmake$" "\\1" MODULE_NAME "${FIND_MODULE}") list(FIND NO_QT4_MODULES ${MODULE_NAME} NO_QT4_INDEX) diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt index 344b772..4c49c6a 100644 --- a/Tests/CMakeTests/CMakeLists.txt +++ b/Tests/CMakeTests/CMakeLists.txt @@ -55,6 +55,15 @@ set(GetPrerequisites_PreArgs ) AddCMakeTest(GetPrerequisites "${GetPrerequisites_PreArgs}") +if(GIT_EXECUTABLE) + set(PolicyCheck_PreArgs + "-DCMake_BINARY_DIR:PATH=${CMake_BINARY_DIR}" + "-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}" + "-DGIT_EXECUTABLE:STRING=${GIT_EXECUTABLE}" + ) + AddCMakeTest(PolicyCheck "${PolicyCheck_PreArgs}") +endif() + # Run CheckSourceTree as the very last test in the CMake/CTest/CPack test # suite. It detects if any changes have been made to the CMake source tree # by any previous configure, build or test steps. diff --git a/Tests/CMakeTests/PolicyCheckTest.cmake.in b/Tests/CMakeTests/PolicyCheckTest.cmake.in new file mode 100644 index 0000000..416dc0a --- /dev/null +++ b/Tests/CMakeTests/PolicyCheckTest.cmake.in @@ -0,0 +1,154 @@ +# Check the CMake source tree for suspicious policy introdcutions... +# +message("=============================================================================") +message("CTEST_FULL_OUTPUT (Avoid ctest truncation of output)") +message("") +message("CMake_BINARY_DIR='${CMake_BINARY_DIR}'") +message("CMake_SOURCE_DIR='${CMake_SOURCE_DIR}'") +message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'") +message("") + + +# If this does not appear to be a git checkout, just pass the test here +# and now. (Do not let the test fail if it is run in a tree *exported* from a +# repository or unpacked from a .zip file source installer...) +# +set(is_git_checkout 0) +if(EXISTS "${CMake_SOURCE_DIR}/.git") + set(is_git_checkout 1) +endif() + +message("is_git_checkout='${is_git_checkout}'") +message("") + +if(NOT is_git_checkout) + message("source tree is not a git checkout... test passes by early return...") + return() +endif() + +# If no GIT_EXECUTABLE, see if we can figure out which git was used +# for the ctest_update step on this dashboard... +# +if(is_git_checkout AND NOT GIT_EXECUTABLE) + set(ctest_ini_file "") + set(exe "") + + # Use the old name: + if(EXISTS "${CMake_BINARY_DIR}/DartConfiguration.tcl") + set(ctest_ini_file "${CMake_BINARY_DIR}/DartConfiguration.tcl") + endif() + + # But if it exists, prefer the new name: + if(EXISTS "${CMake_BINARY_DIR}/CTestConfiguration.ini") + set(ctest_ini_file "${CMake_BINARY_DIR}/CTestConfiguration.ini") + endif() + + # If there is a ctest ini file, read the update command or git command + # from it: + # + if(ctest_ini_file) + file(STRINGS "${ctest_ini_file}" line REGEX "^GITCommand: (.*)$") + string(REGEX REPLACE "^GITCommand: (.*)$" "\\1" line "${line}") + if("${line}" MATCHES "^\"") + string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}") + else() + string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}") + endif() + set(exe "${line}") + if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND") + set(exe "") + endif() + if(exe) + message("info: GIT_EXECUTABLE set by 'GITCommand:' from '${ctest_ini_file}'") + endif() + + if(NOT exe) + file(STRINGS "${ctest_ini_file}" line REGEX "^UpdateCommand: (.*)$") + string(REGEX REPLACE "^UpdateCommand: (.*)$" "\\1" line "${line}") + if("${line}" MATCHES "^\"") + string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}") + else() + string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}") + endif() + set(exe "${line}") + if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND") + set(exe "") + endif() + if(exe) + message("info: GIT_EXECUTABLE set by 'UpdateCommand:' from '${ctest_ini_file}'") + endif() + endif() + else() + message("info: no DartConfiguration.tcl or CTestConfiguration.ini file...") + endif() + + # If we have still not grokked the exe, look in the Update.xml file to see + # if we can parse it from there... + # + if(NOT exe) + file(GLOB_RECURSE update_xml_file "${CMake_BINARY_DIR}/Testing/Update.xml") + if(update_xml_file) + file(STRINGS "${update_xml_file}" line + REGEX "^.*<UpdateCommand>(.*)</UpdateCommand>$" LIMIT_COUNT 1) + string(REPLACE ""\;" "\"" line "${line}") + string(REGEX REPLACE "^.*<UpdateCommand>(.*)</UpdateCommand>$" "\\1" line "${line}") + if("${line}" MATCHES "^\"") + string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}") + else() + string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}") + endif() + if(line) + set(exe "${line}") + endif() + if(exe) + message("info: GIT_EXECUTABLE set by '<UpdateCommand>' from '${update_xml_file}'") + endif() + else() + message("info: no Update.xml file...") + endif() + endif() + + if(exe) + set(GIT_EXECUTABLE "${exe}") + message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'") + message("") + + if(NOT EXISTS "${GIT_EXECUTABLE}") + message(FATAL_ERROR "GIT_EXECUTABLE does not exist...") + endif() + else() + message(FATAL_ERROR "could not determine GIT_EXECUTABLE...") + endif() +endif() + + +if(is_git_checkout AND GIT_EXECUTABLE) + # Check with "git grep" if there are any unacceptable cmPolicies additions + # + message("=============================================================================") + message("This is a git checkout, using git grep to verify no unacceptable policies") + message("are being introduced....") + message("") + + execute_process(COMMAND ${GIT_EXECUTABLE} grep -En "[0-9][0-9][0-9][0-9][0-9].*cmPolicies" + WORKING_DIRECTORY ${CMake_SOURCE_DIR} + OUTPUT_VARIABLE grep_output + OUTPUT_STRIP_TRAILING_WHITESPACE) + message("=== output of 'git grep -En \"[0-9][0-9][0-9][0-9][0-9].*cmPolicies\"' ===") + message("${grep_output}") + message("=== end output ===") + message("") + + if(NOT "${grep_output}" STREQUAL "") + message(FATAL_ERROR "git grep output is non-empty... +New CMake policies must be introduced in a non-date-based version number. +Send email to the cmake-developers list to figure out what the target +version number for this policy should be...") + endif() +endif() + + +# Still here? Good then... +# +message("test passes") +message("") diff --git a/Tests/Contracts/Trilinos-10-6/CMakeLists.txt b/Tests/Contracts/Trilinos/CMakeLists.txt index 79ed669..f5757b5 100644 --- a/Tests/Contracts/Trilinos-10-6/CMakeLists.txt +++ b/Tests/Contracts/Trilinos/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.8) -project(Trilinos-10-6) +project(Trilinos) include(ExternalProject) @@ -27,12 +27,12 @@ endif() message(STATUS "HOME='${HOME}'") if(NOT DEFINED url) - set(url "http://www.cmake.org/files/contracts/trilinos-10.6.1.tar.gz") + set(url "http://www.cmake.org/files/contracts/trilinos-11.4.1.tar.gz") endif() message(STATUS "url='${url}'") if(NOT DEFINED md5) - set(md5 "690230465dd21a76e3c6636fd07bd2f0") + set(md5 "28b6a3c7c0fb317b3a237997293faa8b") endif() message(STATUS "md5='${md5}'") diff --git a/Tests/Contracts/Trilinos-10-6/Dashboard.cmake.in b/Tests/Contracts/Trilinos/Dashboard.cmake.in index cc29502..93d4f61 100644 --- a/Tests/Contracts/Trilinos-10-6/Dashboard.cmake.in +++ b/Tests/Contracts/Trilinos/Dashboard.cmake.in @@ -14,7 +14,7 @@ set(ENV{CTEST_SITE} "${CTEST_SITE}") # Allow override of the environment on a per-client basis: # -set(ENV_SCRIPT "$ENV{CMAKE_CONTRACT_Trilinos_10_6_ENV_SCRIPT}") +set(ENV_SCRIPT "$ENV{CMAKE_CONTRACT_Trilinos_ENV_SCRIPT}") if(ENV_SCRIPT AND EXISTS "${ENV_SCRIPT}") include("${ENV_SCRIPT}") endif() @@ -49,7 +49,7 @@ endif() # execute_process(COMMAND "${CMAKE_CTEST_COMMAND}" - -S "${CTEST_SOURCE_DIRECTORY}/cmake/ctest/experimental_build_test.cmake" + -S "${CTEST_SOURCE_DIRECTORY}/cmake/tribits/ctest/experimental_build_test.cmake" -VV WORKING_DIRECTORY "${CTEST_BINARY_DIRECTORY}" RESULT_VARIABLE rv diff --git a/Tests/Contracts/Trilinos-10-6/EnvScript.cmake b/Tests/Contracts/Trilinos/EnvScript.cmake index dacb704..dacb704 100644 --- a/Tests/Contracts/Trilinos-10-6/EnvScript.cmake +++ b/Tests/Contracts/Trilinos/EnvScript.cmake diff --git a/Tests/Contracts/Trilinos-10-6/Patch.cmake b/Tests/Contracts/Trilinos/Patch.cmake index 6c619ac..6c619ac 100644 --- a/Tests/Contracts/Trilinos-10-6/Patch.cmake +++ b/Tests/Contracts/Trilinos/Patch.cmake diff --git a/Tests/Contracts/Trilinos-10-6/RunTest.cmake b/Tests/Contracts/Trilinos/RunTest.cmake index 30124d8..d661a4c 100644 --- a/Tests/Contracts/Trilinos-10-6/RunTest.cmake +++ b/Tests/Contracts/Trilinos/RunTest.cmake @@ -4,4 +4,4 @@ set(dir "${CMAKE_CURRENT_BINARY_DIR}/Contracts/${project}") set(exe "${CMAKE_COMMAND}") set(args -P "${dir}/ValidateBuild.cmake") -set(Trilinos-10-6_RUN_TEST ${exe} ${args}) +set(Trilinos_RUN_TEST ${exe} ${args}) diff --git a/Tests/Contracts/Trilinos-10-6/ValidateBuild.cmake.in b/Tests/Contracts/Trilinos/ValidateBuild.cmake.in index 04bbf21..fa38ada 100644 --- a/Tests/Contracts/Trilinos-10-6/ValidateBuild.cmake.in +++ b/Tests/Contracts/Trilinos/ValidateBuild.cmake.in @@ -20,10 +20,10 @@ message(STATUS "Found len='${len}' *.exe files") # Try to find the Teuchos unit tests executable: # -file(GLOB_RECURSE exe "${binary_dir}/Teuchos_UnitTest_UnitTests.exe") +file(GLOB_RECURSE exe "${binary_dir}/TeuchosCore_UnitTest_UnitTests.exe") list(LENGTH exe len) if(NOT len EQUAL 1) - message(FATAL_ERROR "len='${len}' is not the expected='1' (count of Teuchos_UnitTest_UnitTests.exe)") + message(FATAL_ERROR "len='${len}' is not the expected='1' (count of TeuchosCore_UnitTest_UnitTests.exe)") endif() message(STATUS "Found exe='${exe}'") @@ -31,7 +31,7 @@ message(STATUS "Found exe='${exe}'") # Try to run it: execute_process(COMMAND ${exe} RESULT_VARIABLE rv) if(NOT "${rv}" STREQUAL "0") - message(FATAL_ERROR "rv='${rv}' is not the expected='0' (result of running Teuchos_UnitTest_UnitTests.exe)") + message(FATAL_ERROR "rv='${rv}' is not the expected='0' (result of running TeuchosCore_UnitTest_UnitTests.exe)") endif() message(STATUS "Ran exe='${exe}' rv='${rv}'") diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index 1f23b2a..72ae78f 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -159,7 +159,7 @@ set_property(TARGET testLibRequired APPEND PROPERTY $<BUILD_INTERFACE:$<TARGET_PROPERTY:testLibIncludeRequired5,INTERFACE_INCLUDE_DIRECTORIES>> # Test that the below is non-fatal $<$<STREQUAL:one,two>:$<TARGET_PROPERTY:not_a_target,INTERFACE_INCLUDE_DIRECTORIES>> - $<INSTALL_INTERFACE:include/testLibIncludeRequired7> + $<INSTALL_INTERFACE:include/testLibIncludeRequired7;include/testLibIncludeRequired4> ) set_property(TARGET testLibRequired APPEND PROPERTY diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index 4d8d7ed..47e7882 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -186,6 +186,11 @@ add_custom_target(check-part3 ALL -Dtest_alias_target_name=$<STREQUAL:$<TARGET_PROPERTY:Alias::SomeLib,NAME>,$<TARGET_PROPERTY:empty1,NAME>> -Dtest_early_termination_1=$<$<1:>: -Dtest_early_termination_2=$<$<1:>:, + -Dsystem_name=${CMAKE_HOST_SYSTEM_NAME} + -Dtest_platform_id=$<PLATFORM_ID> + -Dtest_platform_id_Linux=$<PLATFORM_ID:Linux> + -Dtest_platform_id_Windows=$<PLATFORM_ID:Windows> + -Dtest_platform_id_Darwin=$<PLATFORM_ID:Darwin> -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 3)" VERBATIM diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake index 74a596c..93ea487 100644 --- a/Tests/GeneratorExpression/check-part3.cmake +++ b/Tests/GeneratorExpression/check-part3.cmake @@ -26,3 +26,11 @@ check(test_alias_file_lib "1") check(test_alias_target_name "1") check(test_early_termination_1 "$<:") check(test_early_termination_2 "$<:,") +check(test_platform_id "${system_name}") +foreach(system Linux Windows Darwin) + if(system_name STREQUAL system) + check(test_platform_id_${system} 1) + else() + check(test_platform_id_${system} 0) + endif() +endforeach() diff --git a/Tests/MakeClean/ToClean/CMakeLists.txt b/Tests/MakeClean/ToClean/CMakeLists.txt index 28569dd..37d7292 100644 --- a/Tests/MakeClean/ToClean/CMakeLists.txt +++ b/Tests/MakeClean/ToClean/CMakeLists.txt @@ -26,6 +26,18 @@ add_custom_command(OUTPUT ${ToClean_BINARY_DIR}/generated.txt add_custom_target(generate ALL DEPENDS ${ToClean_BINARY_DIR}/generated.txt) set(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/generated.txt") +# Create a custom command whose output should be cleaned, but whose name +# is not known until generate-time +set(copied_exe "$<TARGET_FILE_DIR:toclean>/toclean_copy${CMAKE_EXECUTABLE_SUFFIX}") +add_custom_command(TARGET toclean POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy $<TARGET_FILE:toclean> + ${copied_exe} + ) +set_property(DIRECTORY APPEND PROPERTY + ADDITIONAL_MAKE_CLEAN_FILES ${copied_exe}) +list(APPEND TOCLEAN_FILES "${ToClean_BINARY_DIR}/toclean_copy${CMAKE_EXECUTABLE_SUFFIX}") + # Configure a file listing these build-time-generated files. configure_file(${ToClean_SOURCE_DIR}/ToCleanFiles.cmake.in ${ToClean_BINARY_DIR}/ToCleanFiles.cmake @ONLY IMMEDIATE) diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt index 69e52ac..8ad693a 100644 --- a/Tests/QtAutomoc/CMakeLists.txt +++ b/Tests/QtAutomoc/CMakeLists.txt @@ -41,7 +41,7 @@ add_library(codeeditorLib STATIC codeeditor.cpp) add_library(privateSlot OBJECT private_slot.cpp) add_executable(foo main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp - xyz.cpp yaf.cpp $<TARGET_OBJECTS:privateSlot>) + xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>) set_target_properties(foo codeeditorLib privateSlot PROPERTIES AUTOMOC TRUE) diff --git a/Tests/QtAutomoc/gadget.cpp b/Tests/QtAutomoc/gadget.cpp new file mode 100644 index 0000000..23d95fa --- /dev/null +++ b/Tests/QtAutomoc/gadget.cpp @@ -0,0 +1,4 @@ + +#include "gadget.h" + +#include "moc_gadget.cpp" diff --git a/Tests/QtAutomoc/gadget.h b/Tests/QtAutomoc/gadget.h new file mode 100644 index 0000000..7c688ee --- /dev/null +++ b/Tests/QtAutomoc/gadget.h @@ -0,0 +1,18 @@ + +#ifndef GADGET_H +#define GADGET_H + +#include <QObject> + +class Gadget +{ + Q_GADGET + Q_ENUMS(Type) +public: + enum Type { + Type0, + Type1 + }; +}; + +#endif diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt index 29103c9..93c0ab3 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt @@ -5,4 +5,13 @@ CMake Warning \(dev\) in CMakeLists.txt: Target "bar" has a INTERFACE_LINK_LIBRARIES property which differs from its LINK_INTERFACE_LIBRARIES properties. + + INTERFACE_LINK_LIBRARIES: + + foo + + LINK_INTERFACE_LIBRARIES: + + bat + This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt index 5a5ad27..6370b24 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt @@ -5,4 +5,13 @@ CMake Warning \(dev\) in CMakeLists.txt: Target "bar" has a INTERFACE_LINK_LIBRARIES property which differs from its LINK_INTERFACE_LIBRARIES properties. + + INTERFACE_LINK_LIBRARIES: + + foo + + LINK_INTERFACE_LIBRARIES: + + bat + This warning is for project developers. Use -Wno-dev to suppress it. @@ -692,7 +692,10 @@ if ${cmake_system_linux}; then # avoid binutils problem with large binaries, e.g. when building CMake in debug mode # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50230 if ${cmake_machine_parisc}; then - cmake_ld_flags="${LDFLAGS} -Wl,--unique=.text.*" + # if -O[s23] is given the effect is inverted, so do not use the flag then + if [ "`echo "${CXXFLAGS}" | sed -r '/^(.* )?(-O[s234])( .*)?$/s/.*/-Os/'`" != "-Os" ]; then + cmake_ld_flags="${LDFLAGS} -Wl,--unique=.text.*" + fi fi fi |