From db87209b6d9171246dd28c3608b4f14b9fdefb16 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 14 Mar 2013 12:54:08 -0400 Subject: CMake 2.8.11-rc1 --- ChangeLog.manual | 555 ++++++++++++++++++++++++++++++++++++++++++++++ Source/CMakeVersion.cmake | 6 +- 2 files changed, 558 insertions(+), 3 deletions(-) diff --git a/ChangeLog.manual b/ChangeLog.manual index 90c9162..493686d 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,558 @@ +Changes in CMake 2.8.11-rc1 (since 2.8.10.2) +---------------------------------------------- +Alan Witkowski (1): + FindBullet: Search in per-config dirs on Windows (#13738) + +Aleksey Avdeev (1): + Add module FindIcotool + +Alex Neundorf (30): + Eclipse: add switch to disable linked resources (#13189) + Eclipse: set source path once to fix Eclipse indexer (#13596) + cmDependsC: remove unused member variable + cmDependsC: remove code duplication + cmDependsC: fix indentation + cmDepends: allow multiple dependees per depender + AddCustomCommand: Handle multiple IMPLICIT_DEPENDS files (#10048) + Add support for Texas Instruments DSP compiler (#12405) + Squish: detect version + Squish: use FPHSA + Squish: find executables also under Windows + Squish: rename squish_add_test() to squish_v3_add_test() and fix docs a bit + Squish: use ${CMAKE_CURRENT_LIST_DIR} + Squish: add support for squish 4 (#9734) + Squish: fix new squish_v4_add_test() macro + Automoc: "inherit" FOLDER target property from target (#13688) + FPHSA: don't succeed if only checking for XX_FOUND (#13755) + CONFIGURE_PACKAGE_CONFIG_FILE(): improve generated comments + Automoc: get include dirs without stripping implicit include dirs off + configure_package_config_file: force absolute paths for usr-move + configure_package_config_file(): fix indentation + configure_package_config_file(): extend documentation + documentation: handling of relative paths by include- and link_directories() + automoc: use a std::vector<> instead a std::list + automoc: use the header extensions from cmMakefile + Eclipse: also detect include dirs and macro for clang (#13823) + cmLocalGenerator: remove "virtual" where not used + export files: rewrite the code for checking required targets + FPHSA: Add FOUND_VAR option to specify _FOUND variable name + FPHSA: improve documentation + +Alexander Chehovsky (2): + Xcode: Fix nested source group handling (#12943) + Xcode: Sort source files + +Amine Chadly (2): + file: remove dead code + Add test to secure the file(GLOB empty) behavior. + +Amit Kulkarni (6): + OpenBSD: Install shared libraries without executable permission + OpenBSD: Add paths for Java 1.6.0/1.7.0 JRE/JDK + OpenBSD: Add path for Freetype under X.org + OpenBSD: Add paths for Tcl/Tk 8.4/8.5 + OpenBSD: Add path for Lua 5.1 + OpenBSD: Add paths for Qt3/Qt4 + +Andreas Mohr (4): + Documentation: Correct typos and grammar + Documentation: Clarify some command descriptions + Correct string literal typo (have "(NULL)" like all other cases). + Remove seemingly bogus duplicate CPACK_PACKAGE_FILE_NAME call. + +Anton Helwart (1): + VS: Avoid empty source groups in some cases (#3474) + +Benjamin Eikel (2): + Swap linking order of SDLmain and SDL (#0013769) + FindSDL_...: Restore dropped search paths (#13819) + +Brad King (109): + find_library: Refactor internal name iteration + find_library: Simplify framework search logic + find_library: Generalize helper macro in test case + find_library: Optionally consider all names in each directory + FindBoost: Remove extra indentation level + FindBoost: Mark Boost_DIR cache entry as advanced + FindBoost: Use PATH_SUFFIXES to look in "Program Files" + FindBoost: Overhaul caching and search repeat behavior + FindBoost: Construct a clean Boost_LIBRARIES value + FindBoost: Refactor Boost_FOUND computation and version check + FindBoost: Rewrite documentation + BSD: Do not require dlfcn.h to build shared libs (#13573) + Xcode: Fix ReRunCMake.make path to cmake.check_cache (#13603) + VS10: Refactor link options collection + VS10: Honor /DELAYSIGN and /KEYFILE flags (#13601) + Document external language support policy + CTest: Allow SUBMIT_INDEX with CDash + KWSys: Submit dashboard builds to PublicDashboard + pre-commit: Update KWSys rejection message for new workflow + CTestCustom: Suppress LNK4089 warning about PSAPI + load_command: Deprecate and document pending removal + Documentation: Clarify configure_file behavior + OS X: Warn about known SDK breakage by Xcode 3.2.6 + Optionally skip link dependencies on shared library files + Teach BuildDepends test to cover LINK_DEPENDS_NO_SHARED + Serialize tests for EXCLUDE_FROM_DEFAULT_BUILD + MSVC: Drop default use of /Zm1000 for VS >= 7.1 + Teach find_(path|file) about Linux multiarch (#13742) + Test find_path multiarch support (#13742) + Add policy CMP0019 to skip include/link variable re-expansion + Xcode: Add frameworks search paths from link dependeny closure (#13397) + Makefile: Use modern link information for framework search paths + Documentation: Clarify handling of implicit link directories + Remove references to KWSys Process Win9x support + add_library: Document object library portability suggestion + OS X: Link with all framework search paths, not just the last + OS X: Detect implicit link directories on modern toolchains + OS X: Detect implicit linker framework search paths + Revert "load_command: Deprecate and document pending removal" + VS11: Simplify external object file handling (#13831) + KWIML: Teach ABI about 'long long' on older GNU + CMake: Skip empty link.txt lines (#13845) + ExternalProject: Allow DEPENDS on normal targets (#13849) + VS11: Fix VSExternalInclude test + target_link_libraries: Document that new sigs privatize old (#13876) + Tests: Avoid CTestLimitDashJ crash on Borland 5.8 builds + Fix use of cmTypeMacro in new command classes + Fix cmSystemTools::RenameFile race on Windows + VS 6: Create .rule file directory before file + Add ExternalData module + ExternalData: Remove compatibility with CMake < 2.8.5 + ExternalData: Do not match directory names when resolving DATA{} + ExternalData: Cleanup stray TODO and typo in comments + ExternalData: Remove unused private interface + ExternalData: Improve series matching using an explicit syntax + ExternalData: Add tests covering interfaces and errors + ExternalData: Allow ()-groups in series match regex + ExternalData: Allow DATA{} syntax to reference directories + ExternalData: Generalize hash algo/ext handling + ExternalData: Add support for SHA 1 and 2 hash algorithms + ExternalData: Collapse ../ components in DATA{} paths + Fix Module.ExternalData test on Cygwin + Fix Module.ExternalData test on VS 6 + ExternalData: Attach download rules to content links in IDEs + find_package: Reword _NO_INTERFACES documentation + Normalize full paths in implicit link library list + Fail early if no current working directory exists + MSVC: Fix CMAKE_CL_64 in CXX-only projects (#13896) + ExternalProject: Simplify CMake command line generation + Tests: Run ctest custom commands with VERBATIM + CMake: Add -T option to choose a generator toolset + VS: Implement generator toolset selection (#10722, #13774) + Xcode: Implement generator toolset selection (#9831, #13802) + CTest: Add options to set generator toolset + ExternalProject: Propagate the generator toolset + Tests: Consolidate ctest --build-and-test generator options + Tests: Add generator toolset support + Fix crash on empty CMAKE__COMPILER value (#13901) + file: Do not remove symlinked directories recursively (#10538) + Embarcadero: Fix default link stack/heap flags (#13912) + Avoid duplicate RPATH entries + AIX-GNU: Put implicit link directories in runtime libpath (#13909) + VS: Replace generation timestamp file atomically + VS,Xcode: Remove unused CMAKE_GENERATOR_* variables + Delete entire CMakeFiles directory when deleting CMakeCache.txt (#13756) + Tests/RunCMake: Allow tests to control build tree behavior + Test Unix Makefiles generator support for changing compilers + Xcode: Drop check for circular target dependencies + Xcode: Each target dependency edge needs a unique object (#13935) + Tests: Replace exec_program with execute_process + Tests: Generalize decision for 'make' tool supporting spaces + ExternalData: Test content link with a space in its name + FPHSA: Convert FOUND_VAR failure test to RunCMake + VS: Restore CMAKE_GENERATOR_FC variable + Xcode: Generate recommended artwork setting (#13954) + CTest: Fix ctest_update with 'HEAD' file in source tree + VS 10: Fix CMAKE__STACK_SIZE implementation (#13968) + install(EXPORT): Force absolute paths for usr-move + AIX: Do not use -brtl to create shared libraries (#13997) + add_subdirectory: Compute output dir with consistent slashes (#10072) + ExternalData: Preserve escaped semicolons during argument expansion + Avoid crash when checking property link dependencies without link info + Avoid crash when checking property compatibility without link info + Refactor RunCMake.build_command test to allow more cases + build_command: Fail early without CMAKE_MAKE_PROGRAM (#14005) + CTest: Fail early without PROJECT_BINARY_DIR (#14005) + FindQt4: Fix QT_QMAKE{_QMAKE => }_EXECUTABLE typo + XL: Use -qpic for position independent code (#14010) + Configure Tests/CMakeTests only with BUILD_TESTING ON + +Casey Goodlett (1): + CTest: Prevent creation of unbounded number of tests in ctest (#12904) + +Clemens Heppner (1): + CMake: source_group needs to check its own regex after its children (#13611) + +Clinton Stimpson (5): + Fix for possible Rez errors when creating dmg. + PackageMaker: Enable postflight script in component mode (#12375) + CPack: Fix RPM/Deb package names to not include "ALL_COMPONENTS_IN_ONE" + Qt4: Add SYSTEM option to include_directories. + FindQt4: set QT_VERSION_* variables sooner. + +David Cole (19): + Begin post-2.8.10 development + CPack: Add automatic detection of the Unicode makensis (#9629) + BundleUtilities: Use a more inclusive REGEX for frameworks (#13600) + VS: Avoid empty, unreferenced solution folders... (#13571) + NMake: Add a test to demonstrate EmptyDepends issue (#13392) + NMake: Fix problem with empty DEPENDS args (#13392) + CMake: Remove "/STACK:10000000" from default linker flags (#12437) + Watcom: Avoid prompt from wmake about dll with no exports... + Tests: Use the right path to CPack value for running CPack tests + VS11: Allow using folders with the VS11 Express Edition (#13770) + CPack: Fix dashboard errors (#11575) + CPack: Fix dashboard warnings (#11575) + CPack: Fix dashboard errors and warnings (#11575) + CMake: Stylistic changes and documentation tweaks + CMake: Fix dashboard warnings + CMake: Fix dashboard test failure + CMake: Fix dashboard build errors and warnings + CTest: Coverage handler: expect certain output lines from gcov 4.7 (#13657) + Add CTestLimitDashJ test (#12904) + +David Golub (2): + CPack/NSIS: Fix compatibility issues with prerelease NSIS (#13202) + CPack/NSIS: Add support for 64-bit NSIS (#13203) + +Eric LaFranchi (1): + CPack: WIX Product Icon, UI Banner, UI Dialog support (#13789) + +Eric NOULARD (1): + CPackRPM fix #13898 uses IF(DEFINED var) to avoid wrong var value logic + +Gerald Hofmann (1): + CPack: Fix NSIS version check without release version (#9721) + +James Bigler (4): + Use PRE_LINK instead of PRE_BUILD when testing PRE_LINK. + FindCUDA: Remove linkage against CUDA driver library (#13084) + FindCUDA: Add support for separable compilation + FindCUDA: Added cupti library. + +Janne Rönkkö (1): + FindQt4: Do not use qmake from Qt5 + +Jean-Christophe Fillion-Robin (1): + Add $ generator expression. + +Marcus D. Hanwell (1): + Removed GenerateExportHeader warnings about old compilers + +Mark Salisbury (2): + VS: Specify WinCE subsystem also for DLLs + VS: Specify WinCE subsystems correctly in VS 9 2008 + +Mathias Gaunard (2): + enable CTEST_USE_LAUNCHERS with Ninja too + Ninja: fix usage of cldeps with ctest launchers + +Matt McCormick (7): + ExternalProject: Only run 'git fetch' when required. + ExternalProject: Do smoke tests for Git Tutorial builds. + ExternalProject: Add tests for UPDATE_COMMAND. + ExternalProject: Always do a git fetch for a remote ref. + ExternalProject: Make sure the ExternalProjectUpdate setup is available. + ExternalProject: Verify when a fetch occurs during update test. + ExternalProjectUpdateTest: Only support Git 1.6.5 and greater. + +Matthew Woehlke (1): + ccmake: Allow DEL key in first column + +Michael Tänzer (4): + GetPrerequisites: Move tool search paths up + GetPrerequisites: Add support for objdump + GetPrerequisites: Enable test for BundleUtilities on MinGW + GetPrerequisites: Add documentation for objdump + +Michael Wild (1): + cmDepends: No dependency-vector erasure in CheckDependencies + +Morné Chamberlain (15): + Added a generator for Sublime Text 2 project files. + Added some support for sublimeclang_options in the generated project file. + Changed SublimeClang include path generation to expand to absolute paths. + Cleaned up the Sublime Text 2 Generator code a bit. + Fixed support for the Ninja build system. + Added and cleaned up some comments. + The generator no longer generates an explicit list of source files. + The generator no longer generates absolute paths to the ninja.build/Makefiles. + Added a CMAKE_SUBLIMECLANG_DISABLED variable that disables SublimeClang. + Fixed Sublime Text project generation for in-source builds + Define flags in CMAKE_C(XX)_FLAGS are now included in SublimeClang settings. + SublimeText2 Gen: Improved use of define, include flags from CMAKE_C(XX)_FLAGS + SublimeText2 Gen: Fixed the issue where include directory flags used -D + Sublime Text 2 Gen: Per-source Compile flags are now saved in a separate file. + SublimeText 2 Gen: Set the sublimeclang_options_script property. + +Neil Carlson (1): + NAG: Use -PIC for Fortran position-independent code (#13932) + +Nils Gladitz (2): + CPack: Add a WiX Generator (#11575) + CMake: Add TIMESTAMP subcommand to string and file commands + +Patrick Gansterer (28): + Introduce the abstract class cmGlobalGeneratorFactory + Add cmGlobalGeneratorFactory::GetGenerators() + Search generator in cmake::ExtraGenerators before in cmake::Generators + Allow a GeneratorFactory handling of more than one generator + Make cmGlobalGenerator::GetDocumentation() a static function + VS: Remove AddPlatformDefinitions from platform-specific generators + VS: Fix ArchitectureId of Visual Studio 10 IA64 generator + VS: Remove GetPlatformName from platform-specific generators + VS: Remove EnableLanguage from platform-specific generators + VS: Remove platform specific generator files + FindBISON: Add support for the Win flex-bison distribution + FindFLEX: Add support for the Win flex-bison distribution + VS: Remove TargetMachine for linker when checking compiler id + VS: Add CMAKE_VS_PLATFORM_NAME definition to cmMakefile + VS: Add static method to get the base of the registry + VS: Change variable type of ArchitectureId from const char* to string + VS: Change variable type of Name from const char* to string + VS: Support setting correct subsystem and entry point for WinCE + VS: Add parser for WCE.VCPlatform.config to read WinCE platforms + VS: Allow setting the name of the target platform + VS: Make DetermineCompilerId working with WinCE too + VS: Added "Deploy" at project configuration for WindowsCE targets + Add command to generate environment for a Windows CE SDK + VS: Set the correct SubSystem when determinating the CompilerId + VS: Add the entry point when compiling for WindowsCE + VS: Ignore LIBC.lib when linking the CompilerId executables + Set WINCE to 1 when building for WindowsCE + Ninja: Avoid LNK1170 linker error + +Peter Kümmel (6): + Ninja: encode LINK_FLAGS to handle bash variables + Ninja: fix building from Codeblocks GUI + Ninja: remove implicit dependency on custom command outputs + Ninja: use MinGW generator code in EnableLanguage() + Ninja: the Ninja generator does not support Fortran yet. + Ninja: escape line breaks in literals + +Petr Kmoch (11): + Add tests for list() argument count + Add tests for list() invalid arguments + Consolidate list() argument count testing + Add several get_property() tests + Add tests for EXCLUDE_FROM_DEFAULT_BUILD + Add property EXCLUDE_FROM_DEFAULT_BUILD_ + Define property EXCLUDE_FROM_DEFAULT_BUILD + Add tests for VS_SOLUTION_GLOBAL_SECTIONS + Implement properties VS_GLOBAL_SECTION_* + Define properties VS_GLOBAL_SECTION_* + Documentation: Clarify a few subtleties + +Riku Voipio (1): + KWIML: Teach ABI.h about Aarch64 + +Robert Maynard (4): + XCode generator won't infinitely parse compiler flags (bug #13354). + Correct missing parameter to CMP0018Flags call. + Remove ability to generate sublime clang files. + Update generator to use new cmGeneratorTarget api. + +Rodolfo Schulz de Lima (1): + FindGTK2: Fix GTK2_LIBRARIES order for static gtk libraries + +Rolf Eike Beer (21): + FindQt: improve version selection + FindQt: add some more places to look for Qt3 + Tests: add MajorVersionSelection tests + Linux/PA-RISC: Link with --unique=.text.* to help binutils + FindQt: add to MajorVersionSelection test + CMakeTests: allow to call the check_cmake_test macro with a given file + list: add tests for CMP0007 behavior + GetProperty test: move doc property tests into main process + Find* (and some other): use ${CMAKE_CURRENT_LIST_DIR} in include() + bootstrap: use better defaults for Haiku + Haiku no longer defines __BEOS__ + check for Haiku only with __HAIKU__ + FindLua51: do not try to link libm on BeOS + FindGLUT: BeOS does not have libXi and libXmu + FindOpenGL: add Haiku paths + doc: fix linebreaks in generator expression documentation + ProcessorCount test: fix path to cmsysTestsCxx executable + ProcessorCount test: require SystemInformation process to work + FindOpenMP: improve documentation (#13895) + properly detect processor architecture on Windows + fix Windows processor detection + +Sean McBride (1): + libarchive: fixed undefined left shift with signed ints + +Slava Sysoltsev (1): + FindImageMagick: Search quantum depth suffixes (#13859) + +Stephen Kelly (158): + GenEx: Test early determination of AND and OR + Enable some compiler warnings when building CMake. + Resolve warnings about unused variables. + Resolve warnings about used enum values in switch blocks. + Resolve warnings about shadowing parameters and local variables. + Resolve ambiguity warning regarding use of && and ||. + Remove references to ancient and removed parts of the code. + Always use the auto_ptr from cmsys. + Port cmGeneratorExpression to cmTarget from cmGeneratorTarget. + Split link information processing into two steps. + Revert "Move GetLinkInformation to cmGeneratorTarget" + Genex: Extract a method to parse parameters. + Genex: Ensure that $<0:...> has a parameter. + Genex: Don't segfault on $ + Generate an early-return guard in target Export files. + Fix some warnings from -Wundef + Make targets depend on the link interface of their dependees. + Use cmsys::auto_ptr to manage cmCompiledGeneratorExpressions + Keep track of INCLUDE_DIRECTORIES as a vector of structs. + Add a way to print the origins of used include directories. + Tests: Fix warning about unused variable + Qt4: Add module dependencies to the IMPORTED targets + Don't crash when a target is expected but is not available. + Add test for custom command with a genex referring to a target. + GenEx: Add expressions to specify build- or install-only values + Allow generator expressions to require literals. + Add the TARGET_NAME generator expression. + Add API to extract target names from a genex string. + Add API to populate INTERFACE properties in exported targets. + Make all relevant targets available in the genex context. + Use mapped config properties to evaluate $ + Make cycles in target properties ignored, not an error. + Populate the ExportedTargets member early in GenerateMainFile + Handle INTERFACE properties transitively for includes and defines. + Add CMAKE_BUILD_INTERFACE_INCLUDES build-variable. + Make linking APIs aware of 'head' target + Add LINK_LIBRARIES property for direct target link dependencies + Allow target_link_libraries with IMPORTED targets. + Add the -Wundef flag when compiling CMake. + FindQt4: Add INTERFACE includes and defines to Qt4 targets + Add the target_include_directories command. + Add the target_compile_definitions command. + Keep track of properties used to determine linker libraries. + Add API to calculate link-interface-dependent bool properties or error. + Process the INTERFACE_PIC property from linked dependencies + Fix linking to imported libraries test. + Add cmGeneratorExpression::Split() API. + Don't pass a position when determining if a target name is a literal. + Extract the AddTargetNamespace method. + Split the generator expression before extracting targets. + Split LINK_INTERFACE_LIBRARIES export handling into dedicated method. + Allow generator expressions in LINK_INTERFACE_LIBRARIES. + Add a way to check INTERFACE user property compatibility. + Don't include generator expressions in old-style link handling. + Document the use of generator expressions in new commands. + Add the TARGET_DEFINED generator expression + Strip consecutive semicolons when preprocessing genex strings. + Don't write a comment in the export file without the code. + Only generate one check per missing target. + Move the exported check for dependencies of targets + Move the exported check for file existence. + Add a test for the interfaces in targets exported from the build tree. + Make the BUILD_INTERFACE of export()ed targets work. + Export the INTERFACE_PIC property. + Test evaluation target via export for generator expressions + Make sure generator expressions can be used with target_include_directories. + Populate the link information cache before checking dependent properties. + Exit early if we find an inconsistent property. + Make INTERFACE determined properties readable in generator expressions. + Clear the link information in ClearLinkMaps. + Export the COMPATIBLE_INTERFACE_BOOL content properties + Add the $ expression + Automatically link to the qtmain library when linking to QtCore. + Don't wrap all targets in LINK_LIBRARIES in a TARGET_NAME genex. + Generate new-style cmake code during export. + Store includes from the same include_directories call together. + Only output includes once after the start of 'generate-time' when debugging. + Specify the target whose includes are being listed. + Output include directories as LOG messages, not warnings. + Revert "Allow target_link_libraries with IMPORTED targets." + Disallow porcelain to populate includes and defines of IMPORTED targets. + Exclude the LINK_LIBRARIES related properties from INTERFACE evaluation. + Make calculation of link-interface-dependent properties type-sensitive. + Add the COMPATIBLE_INTERFACE_STRING property. + Move GetCompileDefinitions to cmTarget. + Process COMPILE_DEFINITIONS as generator expressions in QtAutomoc. + Generate the _IMPORT_PREFIX in the non-config export file. + Add the INSTALL_PREFIX genex. + Fix TARGET_PROPERTY target extractions. + Make the Property name protected so that subclasses can use it. + Don't allow targets args in the new target commands. + Make subclasses responsible for joining content. + Use the result of converting to a unix path. + Handle reading empty properties defined by the link interface. + Advance more when preprocessing exported strings. + Make it an error for INSTALL_PREFIX to be evaluated. + Export targets to a targets file, not a Config file. + Add a way to exclude INTERFACE properties from exported targets. + Add API to check if we're reading a includes or defines property. + Add the $ generator expression. + Add includes and compile definitions with target_link_libraries. + Test workaround of bad interface include directories from depends. + Optimize genex evaluation for includes and defines. + Cache context-independent includes on evaluation. + Style: Use this-> when invoking member functions. + Process generator expressions for 'system' include directories. + Deduplicate the isGeneratorExpression method. + De-duplicate validation of genex target names. + Test printing origin of include dirs from tll(). + The COMPATIBLE_INTERFACE does not affect the target it is set on. + Ensure type specific compatible interface properties do not intersect. + Fix generation of COMPILE_DEFINITIONS in DependInfo.cmake. + Fix determination of evaluating link libraries. + Only use early evaluation termination for transitive properties. + Move a special case for PIC from the genex to the cmTarget code. + Don't keep track of content determined by target property values. + Only append build interface include dirs to particular targets. + Ensure that the build interface includes have been added. + Whitelist target types in target_{include_directories,compile_definitions} + Make sure INTERFACE properties work with OBJECT libraries. + Don't allow utility or global targets in the LINKED expression. + Generate config-specific interface link libraries propeties. + Fix determination of when we're evaluating compile definitions. + Rename the IncludeDirectoriesEntry to be more generic. + Don't use LINKED where not needed. + Use the link information as a source of compile definitions and includes. + Revert "Don't allow utility or global targets in the LINKED expression." + Don't populate INTERFACE includes and defines properties in tll. + Revert "Add the $ generator expression." + Revert "find_package: Reword _NO_INTERFACES documentation" + Revert "Add a way to exclude INTERFACE properties from exported targets." + Don't add target-specific interface includes and defines to Qt 4 targets. + Fix GenerateExportHeader documentation #13936 + automoc: Add source file to target early to set the linker language + Keep track of all targets seen while evaluating a genex. + Add a new Export generator for IMPORTED targets. + Handle targets in the LINK_LIBRARIES of try_compile. + Strip stray semicolons when evaluating generator expressions. + Workaround broken code where a target has itself in its link iface. + Fix DAG checker finding cycling dependencies. + Expand includes and defines transitively in 'external' genexes. + Fix constness of accessors. + Fix the tests for evaluating includes and defines. + Memoize includes and defines from interface libraries. + Remove use of TARGET_DEFINED from target_include_directories test. + Remove use of TARGET_DEFINED from the ExportImport test. + Remove use of TARGET_DEFINED from the target_link_libraries test. + Revert "Add the TARGET_DEFINED generator expression" + Only add existing targets to the Qt4 target depends properties. + Fix the cmGeneratorExpression::Split when leading chars are present. + Fix RPATH information when only a genex is used as a link library. + Mention that IMPORTED targets may be created by a find_package call. + Remove unused parameters from target_link_libraries tests. + Only process transitive interface properties for valid target names. + Restore support for target names with '+' (#13986) + Automoc: Don't create automoc targets if Qt is not used (#13999) + cmake-gui: Use -fPIE if required by Qt. + cmake-gui: Workaround bug in Qt 5.0.0 to 5.0.3 QStandardItemModel + +Thomas Klausner (1): + KWIML: Teach ABI.h that VAX is big endian + +Yury G. Kudryashov (3): + Automoc: Fix automoc for OBJECT libraries. + Automoc: add OBJECT library to QtAutomoc test + spell: fix a few typos in comments + Changes in CMake 2.8.10.2 (since 2.8.10.1) ---------------------------------------------- Alex Neundorf (1): diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index d4ef879..e333575 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 10) -set(CMake_VERSION_TWEAK 20130314) -#set(CMake_VERSION_RC 1) +set(CMake_VERSION_PATCH 11) +set(CMake_VERSION_TWEAK 0) +set(CMake_VERSION_RC 1) -- cgit v0.12 From 27fb96b9783ba13ce4c8bd681b73c6f3a892d90c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 16 Mar 2013 15:51:29 +0100 Subject: Make the QtAutomoc test compile with either Qt 4 or Qt 5 --- Tests/QtAutomoc/calwidget.cpp | 17 ++++++++++++----- Tests/QtAutomoc/main.cpp | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Tests/QtAutomoc/calwidget.cpp b/Tests/QtAutomoc/calwidget.cpp index 24f3b4e..cbfa5a8 100644 --- a/Tests/QtAutomoc/calwidget.cpp +++ b/Tests/QtAutomoc/calwidget.cpp @@ -38,7 +38,14 @@ ** ****************************************************************************/ - #include + #include + #include + #include + #include + #include + #include + #include + #include #include "calwidget.h" @@ -414,10 +421,10 @@ QComboBox *Window::createColorComboBox() { QComboBox *comboBox = new QComboBox; - comboBox->addItem(tr("Red"), Qt::red); - comboBox->addItem(tr("Blue"), Qt::blue); - comboBox->addItem(tr("Black"), Qt::black); - comboBox->addItem(tr("Magenta"), Qt::magenta); + comboBox->addItem(tr("Red"), QColor(Qt::red)); + comboBox->addItem(tr("Blue"), QColor(Qt::blue)); + comboBox->addItem(tr("Black"), QColor(Qt::black)); + comboBox->addItem(tr("Magenta"), QColor(Qt::magenta)); return comboBox; } diff --git a/Tests/QtAutomoc/main.cpp b/Tests/QtAutomoc/main.cpp index d952171..bd80180 100644 --- a/Tests/QtAutomoc/main.cpp +++ b/Tests/QtAutomoc/main.cpp @@ -38,7 +38,7 @@ ** ****************************************************************************/ -#include +#include #include "codeeditor.h" #include "calwidget.h" -- cgit v0.12 From e7813b15a63a4ff5150d22b01ef47b51b22045e5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 16 Mar 2013 15:52:18 +0100 Subject: Add a test for Qt5Automoc The same source is used as for the Qt4Automoc test. --- Tests/CMakeLists.txt | 25 ++++++++++++++++++++----- Tests/QtAutomoc/Adir/CMakeLists.txt | 2 +- Tests/QtAutomoc/CMakeLists.txt | 23 +++++++++++++++++++++-- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index e07bb69..c548869 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1003,19 +1003,34 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt") + find_package(Qt5Widgets QUIET NO_MODULE) + if(Qt5Widgets_FOUND) + add_test(Qt5Automoc ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/QtAutomoc" + "${CMake_BINARY_DIR}/Tests/Qt5Automoc" + ${build_generator_args} + --build-project QtAutomoc + --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5Automoc" + --force-new-ctest-process + --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=5 + --test-command ${CMAKE_CTEST_COMMAND} -V + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5Automoc") + endif() if(QT4_WORKS AND QT_QTGUI_FOUND) - add_test(QtAutomoc ${CMAKE_CTEST_COMMAND} + add_test(Qt4Automoc ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/QtAutomoc" - "${CMake_BINARY_DIR}/Tests/QtAutomoc" + "${CMake_BINARY_DIR}/Tests/Qt4Automoc" ${build_generator_args} --build-project QtAutomoc - --build-exe-dir "${CMake_BINARY_DIR}/Tests/QtAutomoc" + --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Automoc" --force-new-ctest-process - --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} + --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=4 --test-command ${CMAKE_CTEST_COMMAND} -V ) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomoc") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Automoc") endif() if(QT4_WORKS AND QT_QTGUI_FOUND) add_test(Qt4Targets ${CMAKE_CTEST_COMMAND} diff --git a/Tests/QtAutomoc/Adir/CMakeLists.txt b/Tests/QtAutomoc/Adir/CMakeLists.txt index abd328e..ebfdb5d 100644 --- a/Tests/QtAutomoc/Adir/CMakeLists.txt +++ b/Tests/QtAutomoc/Adir/CMakeLists.txt @@ -4,5 +4,5 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_BUILD_INTERFACE_INCLUDES ON) add_library(libA SHARED libA.cpp) -target_link_libraries(libA LINK_PUBLIC Qt4::QtCore) +target_link_libraries(libA LINK_PUBLIC ${QT_QTCORE_TARGET}) generate_export_header(libA) diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt index ebfbb03..49d433f 100644 --- a/Tests/QtAutomoc/CMakeLists.txt +++ b/Tests/QtAutomoc/CMakeLists.txt @@ -2,9 +2,28 @@ cmake_minimum_required(VERSION 2.8) project(QtAutomoc) -find_package(Qt4 REQUIRED) +if (QT_TEST_VERSION STREQUAL 4) + find_package(Qt4 REQUIRED) + + include(UseQt4) + + set(QT_QTCORE_TARGET Qt4::QtCore) +else() + if (NOT QT_TEST_VERSION STREQUAL 5) + message(SEND_ERROR "Invalid Qt version specified.") + endif() + find_package(Qt5Widgets REQUIRED) + + set(QT_QTCORE_TARGET Qt5::Core) + + include_directories(${Qt5Widgets_INCLUDE_DIRS}) + set(QT_LIBRARIES Qt5::Widgets) + + if(Qt5_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + endif() +endif() -include(UseQt4) include_directories(${CMAKE_CURRENT_BINARY_DIR}) -- cgit v0.12 From 6489015c75367493c9ea6a7bea69b67a88972651 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 16 Mar 2013 18:57:38 +0100 Subject: Remove an endif() followed by an if() for the same condition. --- Tests/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index c548869..6789db7 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1031,8 +1031,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command ${CMAKE_CTEST_COMMAND} -V ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Automoc") - endif() - if(QT4_WORKS AND QT_QTGUI_FOUND) + add_test(Qt4Targets ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Qt4Targets" -- cgit v0.12 From 875eb8e158e9b8541b2efab09df44b32c6854f04 Mon Sep 17 00:00:00 2001 From: Paul Kunysch Date: Wed, 6 Mar 2013 00:14:58 +0100 Subject: CTest: Add test for running many tests in parallel In particular, this checks that CTest's use of select() has a sufficient file descriptor set size limit (FD_SETSIZE) to handle many child processes at the same time. Running 20 tests requires more than 64 descriptors, the Cygwin default that we override. --- Tests/CMakeLists.txt | 9 +++++++++ Tests/CTestTestFdSetSize/CMakeLists.txt | 9 +++++++++ Tests/CTestTestFdSetSize/CTestConfig.cmake | 1 + Tests/CTestTestFdSetSize/sleep.c | 16 ++++++++++++++++ Tests/CTestTestFdSetSize/test.cmake.in | 23 +++++++++++++++++++++++ 5 files changed, 58 insertions(+) create mode 100644 Tests/CTestTestFdSetSize/CMakeLists.txt create mode 100644 Tests/CTestTestFdSetSize/CTestConfig.cmake create mode 100644 Tests/CTestTestFdSetSize/sleep.c create mode 100644 Tests/CTestTestFdSetSize/test.cmake.in diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index e07bb69..283c846 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2085,6 +2085,15 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ add_test(CTestBatchTest ${CMAKE_CTEST_COMMAND} -B) + configure_file( + "${CMake_SOURCE_DIR}/Tests/CTestTestFdSetSize/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestTestFdSetSize/test.cmake" + @ONLY ESCAPE_QUOTES) + add_test(CTestTestFdSetSize ${CMAKE_CTEST_COMMAND} + -S "${CMake_BINARY_DIR}/Tests/CTestTestFdSetSize/test.cmake" -j20 -V --timeout 120 + --output-log "${CMake_BINARY_DIR}/Tests/CTestTestFdSetSize/testOutput.log" + ) + # Use macro, not function so that build can still be driven by CMake 2.4. # After 2.6 is required, this could be a function without the extra 'set' # calls. diff --git a/Tests/CTestTestFdSetSize/CMakeLists.txt b/Tests/CTestTestFdSetSize/CMakeLists.txt new file mode 100644 index 0000000..f382746 --- /dev/null +++ b/Tests/CTestTestFdSetSize/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required (VERSION 2.8.10) +project (CTestTestFdSetSize) +include (CTest) + +add_executable (Sleep sleep.c) + +foreach (index RANGE 1 20) + add_test (TestSleep${index} Sleep) +endforeach () diff --git a/Tests/CTestTestFdSetSize/CTestConfig.cmake b/Tests/CTestTestFdSetSize/CTestConfig.cmake new file mode 100644 index 0000000..b5f3c33 --- /dev/null +++ b/Tests/CTestTestFdSetSize/CTestConfig.cmake @@ -0,0 +1 @@ +set(CTEST_PROJECT_NAME "CTestTestFdSetSize") diff --git a/Tests/CTestTestFdSetSize/sleep.c b/Tests/CTestTestFdSetSize/sleep.c new file mode 100644 index 0000000..b2e6a87 --- /dev/null +++ b/Tests/CTestTestFdSetSize/sleep.c @@ -0,0 +1,16 @@ +#if defined(_WIN32) +# include +#else +# include +#endif + +/* sleeps for 0.1 second */ +int main(int argc, char** argv) +{ +#if defined(_WIN32) + Sleep(100); +#else + usleep(100 * 1000); +#endif + return 0; +} diff --git a/Tests/CTestTestFdSetSize/test.cmake.in b/Tests/CTestTestFdSetSize/test.cmake.in new file mode 100644 index 0000000..c24f505 --- /dev/null +++ b/Tests/CTestTestFdSetSize/test.cmake.in @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 2.8.10) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-FdSetSize") + +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestFdSetSize") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFdSetSize") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +ctest_start(Experimental) +ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +message("build") +ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +message("test") +ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 20 RETURN_VALUE res) +message("done") -- cgit v0.12 From 81b5fb5b0dd82fb6d68512275a54c50585aafee1 Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Mon, 25 Mar 2013 12:10:05 -0400 Subject: UseJava.cmake: fully use cmake_parse_arguments in add_jar Modify add_jar to fully use named arguments, rather than cmake variables, for specifying output names/directories, etc. For backward compatibility, the old variables are still honored if set, although named arguments will override them. --- Modules/UseJava.cmake | 93 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 58 insertions(+), 35 deletions(-) diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake index 0438695..aa95ed1 100644 --- a/Modules/UseJava.cmake +++ b/Modules/UseJava.cmake @@ -6,6 +6,10 @@ # add_jar(target_name # [SOURCES] source1 [source2 ...] [resource1 ...] # [INCLUDE_JARS jar1 [jar2 ...]] +# [ENTRY_POINT entry] +# [VERSION version] +# [OUTPUT_NAME name] +# [OUTPUT_DIR dir] # ) # # This command creates a .jar. It compiles the given source files @@ -17,6 +21,9 @@ # listed as sources are ignored (as they have been since the first version of # this module). # +# The default OUTPUT_DIR can also be changed by setting the variable +# CMAKE_JAVA_TARGET_OUTPUT_DIR. +# # Additional instructions: # To add compile flags to the target you can set these flags with # the following variable: @@ -30,32 +37,30 @@ # # To use a different output name for the target you can set it with: # -# set(CMAKE_JAVA_TARGET_OUTPUT_NAME shibboleet.jar) -# add_jar(foobar foobar.java) +# add_jar(foobar foobar.java OUTPUT_NAME shibboleet.jar) # # To use a different output directory than CMAKE_CURRENT_BINARY_DIR # you can set it with: # -# set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin) +# add_jar(foobar foobar.java OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin) # -# To define an entry point in your jar you can set it with: +# To define an entry point in your jar you can set it with the ENTRY_POINT +# named argument: # -# set(CMAKE_JAVA_JAR_ENTRY_POINT com/examples/MyProject/Main) +# add_jar(example ENTRY_POINT com/examples/MyProject/Main) # # To add a VERSION to the target output name you can set it using -# CMAKE_JAVA_TARGET_VERSION. This will create a jar file with the name -# shibboleet-1.0.0.jar and will create a symlink shibboleet.jar +# the VERSION named argument to add_jar. This will create a jar file with the +# name shibboleet-1.0.0.jar and will create a symlink shibboleet.jar # pointing to the jar with the version information. # -# set(CMAKE_JAVA_TARGET_VERSION 1.2.0) -# add_jar(shibboleet shibbotleet.java) +# add_jar(shibboleet shibbotleet.java VERSION 1.2.0) # # If the target is a JNI library, utilize the following commands to # create a JNI symbolic link: # # set(CMAKE_JNI_TARGET TRUE) -# set(CMAKE_JAVA_TARGET_VERSION 1.2.0) -# add_jar(shibboleet shibbotleet.java) +# add_jar(shibboleet shibbotleet.java VERSION 1.2.0) # install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet) # install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR}) # @@ -216,23 +221,43 @@ set(_JAVA_SYMLINK_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaSymlinks.cmake) function(add_jar _TARGET_NAME) - cmake_parse_arguments(_add_jar "" "" "SOURCES;INCLUDE_JARS" ${ARGN}) + if(DEFINED CMAKE_JAVA_TARGET_VERSION) + set(_add_jar_VERSION "${CMAKE_JAVA_TARGET_VERSION}") + endif() + if(DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR) + set(_add_jar_OUTPUT_DIR "${CMAKE_JAVA_TARGET_OUTPUT_DIR}") + endif() + if(DEFINED CMAKE_JAVA_TARGET_OUTPUT_NAME) + set(_add_jar_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}") + # reset + set(CMAKE_JAVA_TARGET_OUTPUT_NAME) + endif() + if(DEFINED CMAKE_JAVA_JAR_ENTRY_POINT) + set(_add_jar_ENTRY_POINT "${CMAKE_JAVA_JAR_ENTRY_POINT}") + endif() + + cmake_parse_arguments(_add_jar + "" + "VERSION;OUTPUT_DIR;OUTPUT_NAME;ENTRY_POINT" + "SOURCES;INCLUDE_JARS" + ${ARGN} + ) set(_JAVA_SOURCE_FILES ${_add_jar_SOURCES} ${_add_jar_UNPARSED_ARGUMENTS}) - if (NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR) - set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) + if (NOT DEFINED _add_jar_OUTPUT_DIR) + set(_add_jar_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) endif() - if (CMAKE_JAVA_JAR_ENTRY_POINT) - set(_ENTRY_POINT_OPTION e) - set(_ENTRY_POINT_VALUE ${CMAKE_JAVA_JAR_ENTRY_POINT}) + if (_add_jar_ENTRY_POINT) + set(_ENTRY_POINT_OPTION e) + set(_ENTRY_POINT_VALUE ${_add_jar_ENTRY_POINT}) endif () if (LIBRARY_OUTPUT_PATH) set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH}) else () - set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR}) + set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${_add_jar_OUTPUT_DIR}) endif () set(CMAKE_JAVA_INCLUDE_PATH @@ -252,20 +277,18 @@ function(add_jar _TARGET_NAME) set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") endforeach() - set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_JAVA_TARGET_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir") + set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${_add_jar_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir") set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}.jar") - if (CMAKE_JAVA_TARGET_OUTPUT_NAME AND CMAKE_JAVA_TARGET_VERSION) - set(_JAVA_TARGET_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}-${CMAKE_JAVA_TARGET_VERSION}.jar") - set(_JAVA_TARGET_OUTPUT_LINK "${CMAKE_JAVA_TARGET_OUTPUT_NAME}.jar") - elseif (CMAKE_JAVA_TARGET_VERSION) - set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}-${CMAKE_JAVA_TARGET_VERSION}.jar") + if (_add_jar_OUTPUT_NAME AND _add_jar_VERSION) + set(_JAVA_TARGET_OUTPUT_NAME "${_add_jar_OUTPUT_NAME}-${_add_jar_VERSION}.jar") + set(_JAVA_TARGET_OUTPUT_LINK "${_add_jar_OUTPUT_NAME}.jar") + elseif (_add_jar_VERSION) + set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}-${_add_jar_VERSION}.jar") set(_JAVA_TARGET_OUTPUT_LINK "${_TARGET_NAME}.jar") - elseif (CMAKE_JAVA_TARGET_OUTPUT_NAME) - set(_JAVA_TARGET_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}.jar") + elseif (_add_jar_OUTPUT_NAME) + set(_JAVA_TARGET_OUTPUT_NAME "${_add_jar_OUTPUT_NAME}.jar") endif () - # reset - set(CMAKE_JAVA_TARGET_OUTPUT_NAME) set(_JAVA_CLASS_FILES) set(_JAVA_COMPILE_FILES) @@ -279,7 +302,7 @@ function(add_jar _TARGET_NAME) get_filename_component(_JAVA_FULL ${_JAVA_SOURCE_FILE} ABSOLUTE) if (_JAVA_EXT MATCHES ".java") - file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR} ${_JAVA_FULL}) + file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${_add_jar_OUTPUT_DIR} ${_JAVA_FULL}) file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL}) string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN) string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN) @@ -364,7 +387,7 @@ function(add_jar _TARGET_NAME) # create the jar file set(_JAVA_JAR_OUTPUT_PATH - ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME}) + ${_add_jar_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME}) if (CMAKE_JNI_TARGET) add_custom_command( OUTPUT ${_JAVA_JAR_OUTPUT_PATH} @@ -372,12 +395,12 @@ function(add_jar _TARGET_NAME) -cf${_ENTRY_POINT_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE} ${_JAVA_RESOURCE_FILES} @java_class_filelist COMMAND ${CMAKE_COMMAND} - -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR} + -D_JAVA_TARGET_DIR=${_add_jar_OUTPUT_DIR} -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME} -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK} -P ${_JAVA_SYMLINK_SCRIPT} COMMAND ${CMAKE_COMMAND} - -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR} + -D_JAVA_TARGET_DIR=${_add_jar_OUTPUT_DIR} -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_JAR_OUTPUT_PATH} -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK} -P ${_JAVA_SYMLINK_SCRIPT} @@ -392,7 +415,7 @@ function(add_jar _TARGET_NAME) -cf${_ENTRY_POINT_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE} ${_JAVA_RESOURCE_FILES} @java_class_filelist COMMAND ${CMAKE_COMMAND} - -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR} + -D_JAVA_TARGET_DIR=${_add_jar_OUTPUT_DIR} -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME} -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK} -P ${_JAVA_SYMLINK_SCRIPT} @@ -420,7 +443,7 @@ function(add_jar _TARGET_NAME) PROPERTY INSTALL_FILES ${_JAVA_JAR_OUTPUT_PATH} - ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK} + ${_add_jar_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK} ) if (CMAKE_JNI_TARGET) @@ -429,7 +452,7 @@ function(add_jar _TARGET_NAME) ${_TARGET_NAME} PROPERTY JNI_SYMLINK - ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK} + ${_add_jar_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK} ) endif () endif () -- cgit v0.12 From 2ef908f91147928fb3b37a8439784341eb82ea6a Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Mon, 1 Apr 2013 16:06:22 +0200 Subject: Add support for componentized USER spec file CPACK_RPM_USER_BINARY_SPECFILE can now be specified on a per-component basis using CPACK_RPM__USER_BINARY_SPECFILE. Inspired-By: Theodore Papadopoulo with its patch proposal. --- Modules/CPackRPM.cmake | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index fa79e1b..024822e 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -163,6 +163,8 @@ # May be set by the user in order to specify a USER binary spec file # to be used by CPackRPM instead of generating the file. # The specified file will be processed by configure_file( @ONLY). +# One can provide a component specific file by setting +# CPACK_RPM__USER_BINARY_SPECFILE. ##end ##variable # CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE - Spec file template. @@ -832,11 +834,18 @@ if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}") endif() -# USER generated spec file handling. -# We should generate a spec file template: +# +# USER generated/provided spec file handling. +# + +# We can have a component specific spec file. +if(CPACK_RPM_PACKAGE_COMPONENT AND CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_USER_BINARY_SPECFILE) + set(CPACK_RPM_USER_BINARY_SPECFILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_USER_BINARY_SPECFILE}) +endif() + +# We should generate a USER spec file template: # - either because the user asked for it : CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE # - or the user did not provide one : NOT CPACK_RPM_USER_BINARY_SPECFILE -# if(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE) file(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in "# -*- rpm-spec -*- @@ -902,9 +911,9 @@ mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\" $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -${CPACK_RPM_INSTALL_FILES} -${CPACK_RPM_ABSOLUTE_INSTALL_FILES} -${CPACK_RPM_USER_INSTALL_FILES} +\@CPACK_RPM_INSTALL_FILES\@ +\@CPACK_RPM_ABSOLUTE_INSTALL_FILES\@ +\@CPACK_RPM_USER_INSTALL_FILES\@ %changelog \@CPACK_RPM_SPEC_CHANGELOG\@ -- cgit v0.12 From bac5772b3959c5dfda36f242f8726266f605fe54 Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Fri, 5 Apr 2013 12:43:50 +0200 Subject: CPackRPM add mechanism to remove path from generated list of file in RPM spec. This fixes bug #0013609, and is a possible solution to #0012864 as well. The later will be completely fixed in another way. Both approaches needs to be implemented because the current one is more automatic. Inspired-By: Ari --- Modules/CPackRPM.cmake | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index fa79e1b..bd649bb 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -223,6 +223,24 @@ # The refered file will be read and directly put after the %changelog # section. ##end +##variable +# CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST - list of path to be excluded. +# Mandatory : NO +# Default : /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/include +# May be used to exclude path (directories or files) from the auto-generated +# list of paths discovered by CPack RPM. The defaut value contains a reasonable +# set of values if the variable is not defined by the user. If the variable +# is defined by the user then CPackRPM will NOT any of the default path. +# If you want to add some path to the default list then you can use +# CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION variable. +##end +##variable +# CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION - additional list of path to be excluded. +# Mandatory : NO +# Default : - +# May be used to add more exclude path (directories or files) from the initial +# default list of excluded paths. See CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST. +##end #============================================================================= # Copyright 2007-2009 Kitware, Inc. @@ -666,6 +684,30 @@ if(CPACK_RPM_PACKAGE_RELOCATABLE) endforeach() endif() +if (CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: Initial list of path to OMIT in RPM: ${_RPM_DIRS_TO_OMIT}") +endif() + +if (NOT DEFINED CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST) + set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/include) + if (CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION) + message("CPackRPM:Debug: Adding ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION} to builtin omit list.") + list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST "${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION}") + endif() +endif() + +if(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST) + if (CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST= ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST}") + endif() + foreach(_DIR ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST}) + list(APPEND _RPM_DIRS_TO_OMIT "-o;-path;.${_DIR}") + endforeach() +endif() +if (CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: Final list of path to OMIT in RPM: ${_RPM_DIRS_TO_OMIT}") +endif() + # Use files tree to construct files command (spec file) # We should not forget to include symlinks (thus -o -type l) # We should include directory as well (thus -type d) -- cgit v0.12 From f055c997a5ee186eb2f264cf4425148745ba6514 Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Fri, 5 Apr 2013 12:53:47 +0200 Subject: CPackRPM add /usr/lib64 to the list of builtin to-be-excluded path --- Modules/CPackRPM.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index bd649bb..09910ff 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -226,7 +226,7 @@ ##variable # CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST - list of path to be excluded. # Mandatory : NO -# Default : /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/include +# Default : /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/include # May be used to exclude path (directories or files) from the auto-generated # list of paths discovered by CPack RPM. The defaut value contains a reasonable # set of values if the variable is not defined by the user. If the variable @@ -689,7 +689,7 @@ if (CPACK_RPM_PACKAGE_DEBUG) endif() if (NOT DEFINED CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST) - set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/include) + set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/include) if (CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION) message("CPackRPM:Debug: Adding ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION} to builtin omit list.") list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST "${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION}") -- cgit v0.12 From 42ba1b08f3bd5909238f7c49c31532105ef2b0e7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 5 Apr 2013 08:38:21 -0400 Subject: VS: Separate compiler and linker PDB files (#11899, #14062) The MS tools create two types of PDB files as explained here: http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.71%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.80%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.90%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.100%29.aspx One is created by the compiler (/Fd) and the other by the linker (/pdb). The two options should not specify the same file. Split them up. In the VS IDE generators, simply drop ProgramDataBaseFileName to take the VS default "/Fd$(IntDir)vc$(PlatformToolsetVersion).pdb". In the Makefile generators, set "/Fd" on the compile line to be the directory containing object files (with a trailing slash the compiler will add the "vc$(PlatformToolsetVersion).pdb" filename automatically). Drop the /Fd option from the exe link command line and add "/pdb" instead (already done for dll linking). Update these rules for both MSVC and Intel tools. Drop support for PDB_OUTPUT_DIRECTORY and PDB_NAME in STATIC libraries because the generated .pdb files are only from /Fd and not real linker-generated .pdb files. Update documentation to clarify that the PDB_* properties are only for linker .pdb files. This regresses the PDBDirectoryAndName test for STATIC libraries. Since it is not clear at this time what should be done for STATIC library .pdb files, comment out the relevant portion of the test and leave a TODO comment. --- Modules/Platform/Windows-Intel.cmake | 4 ++-- Modules/Platform/Windows-MSVC.cmake | 4 ++-- Source/cmDocumentVariables.cxx | 2 +- Source/cmLocalVisualStudio7Generator.cxx | 10 ---------- Source/cmTarget.cxx | 8 ++++---- Source/cmVisualStudio10TargetGenerator.cxx | 8 -------- Tests/PDBDirectoryAndName/CMakeLists.txt | 11 +++++------ 7 files changed, 14 insertions(+), 33 deletions(-) diff --git a/Modules/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake index 8a9d630..69a7f2f 100644 --- a/Modules/Platform/Windows-Intel.cmake +++ b/Modules/Platform/Windows-Intel.cmake @@ -81,7 +81,7 @@ endif() macro(__windows_compiler_intel lang) set(CMAKE_${lang}_COMPILE_OBJECT - " ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} /Fo -c ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} /Fo /Fd/ -c ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE " > ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} -E ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1) @@ -91,7 +91,7 @@ macro(__windows_compiler_intel lang) set(CMAKE_${lang}_CREATE_SHARED_MODULE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}") set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link") set(CMAKE_${lang}_LINK_EXECUTABLE - " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe /link /implib: ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe /link /implib: /pdb: ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000${_FLAGS_${lang}}") set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Od /RTC1") set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/DNDEBUG /MD /O1") diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index f9df6d8..28abf05 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -228,7 +228,7 @@ macro(__windows_compiler_msvc lang) set(CMAKE_${lang}_CREATE_STATIC_LIBRARY " /lib ${CMAKE_CL_NOLOGO} /out: ") set(CMAKE_${lang}_COMPILE_OBJECT - " ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} /Fo /Fd -c ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} /Fo /Fd/ -c ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE " > ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} -E ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE @@ -237,7 +237,7 @@ macro(__windows_compiler_msvc lang) 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_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe /Fd /link /implib: /version:. ${CMAKE_END_TEMP_FILE}") + "${_CMAKE_VS_LINK_EXE} ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe /link /implib: /pdb: /version:. ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_FLAGS_INIT "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} /D_WINDOWS /W3${_FLAGS_${lang}}") set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}") diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 50509a0..964ee05 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -1252,7 +1252,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_PDB_OUTPUT_DIRECTORY", cmProperty::VARIABLE, - "Where to put all the MS debug symbol files.", + "Where to put all the MS debug symbol files from linker.", "This variable is used to initialize the " "PDB_OUTPUT_DIRECTORY property on all the targets. " "See that target property for additional information.", diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 7d0bc67..289612d 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -838,16 +838,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX"); fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n"; fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n"; - if(targetBuilds) - { - // We need to specify a program database file name even for - // non-debug configurations because VS still creates .idb files. - fout << "\t\t\t\tProgramDataBaseFileName=\"" - << this->ConvertToXMLOutputPathSingle( - target.GetPDBDirectory(configName).c_str()) - << "/" - << target.GetPDBName(configName) << "\"\n"; - } fout << "/>\n"; // end of FortranProject) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 66c22b1..4c3f1f8 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -873,9 +873,9 @@ void cmTarget::DefineProperties(cmake *cm) cm->DefineProperty ("PDB_NAME", cmProperty::TARGET, - "Output name for MS debug symbols .pdb file.", + "Output name for MS debug symbols .pdb file from linker.", "Set the base name for debug symbols file created for an " - "executable or library target. " + "executable or shared library target. " "If not set, the logical target name is used by default. " "\n" "This property is not implemented by the Visual Studio 6 generator."); @@ -1384,9 +1384,9 @@ void cmTarget::DefineProperties(cmake *cm) cm->DefineProperty ("PDB_OUTPUT_DIRECTORY", cmProperty::TARGET, - "Output directory for MS debug symbols .pdb files.", + "Output directory for MS debug symbols .pdb file from linker.", "This property specifies the directory into which the MS debug symbols " - "will be placed. " + "will be placed by the linker. " "This property is initialized by the value of the variable " "CMAKE_PDB_OUTPUT_DIRECTORY if it is set when a target is created." "\n" diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 1cb9f23..a236831 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1264,14 +1264,6 @@ void cmVisualStudio10TargetGenerator::WriteClOptions( *this->BuildFileStream << configName << "\n"; this->WriteString("$(IntDir)\n", 3); - if(this->Target->GetType() != cmTarget::OBJECT_LIBRARY) - { - this->WriteString("", 3); - *this->BuildFileStream << this->Target->GetPDBDirectory(configName.c_str()) - << "/" - << this->Target->GetPDBName(configName.c_str()) - << "\n"; - } this->WriteString("\n", 2); } diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt index bc2f013..28e46b1 100644 --- a/Tests/PDBDirectoryAndName/CMakeLists.txt +++ b/Tests/PDBDirectoryAndName/CMakeLists.txt @@ -20,7 +20,9 @@ set_target_properties(mylibB PROPERTIES PDB_NAME "mylibB_Special" PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mylibB_PDB" ) -list(APPEND my_targets mylibB) +# TODO: The only .pdb available for a static library is that generated +# by the compiler /Fd option which is not the same as the linker /pdb. +# list(APPEND my_targets mylibB) add_library(mylibC SHARED mylibC.c) set_target_properties(mylibC PROPERTIES @@ -32,7 +34,8 @@ add_library(mylibD STATIC mylibD.c) set_target_properties(mylibD PROPERTIES PDB_NAME "mylibD_Special" ) -list(APPEND my_targets mylibD) +# TODO: See comment for mylibB. +# list(APPEND my_targets mylibD) add_executable(myexe myexe.c) set_target_properties(myexe PROPERTIES @@ -58,10 +61,6 @@ target_link_libraries(myexe2 mylibA mylibD) if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") return() endif() -# PDB output not fully implemented for Intel -if("${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") - return() -endif() set(pdbs "") foreach(t ${my_targets}) -- cgit v0.12 From 83e0fd0d1c01f9ee8b9de9ff7c7230b319248b96 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 5 Apr 2013 14:09:02 -0400 Subject: CMake 2.8.11-rc2 --- ChangeLog.manual | 66 +++++++++++++++++++++++++++++++++++++++++++++++ Source/CMakeVersion.cmake | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/ChangeLog.manual b/ChangeLog.manual index 493686d..df45179 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,69 @@ +Changes in CMake 2.8.11-rc2 (since 2.8.11-rc1) +---------------------------------------------- +Alex Neundorf (6): + Determine C/CXX/Fortran compiler: minor restructuring + Determine C/CXX/Fortran compiler: fix indentation + rename TI_DSP toolchain to TI, since it works also for the ARM compiler + TI compiler: add automatic detection of prefix and suffixes + Modules/readme.txt: switch from "XXX" to "Xxx" + Modules/readme.txt: make lines a bit shorter for easier readability + +Ben Boeckel (1): + Clang: Add -isystem flag support everywhere + +Bill Hoffman (1): + ExternalProject: Retry on a failed git clone + +Brad King (8): + string: Fix regex documentation of '^' and '$' (#14028) + Rename variable for including current directory in interfaces + Replace in CMAKE__COMPILE_OBJECT rule variables + Test evaluation of per-config COMPILE_DEFINITIONS (#14037) + VS: Fix VS 10/11 .sln headers (#14038) + add_dependencies: Distinguish target v. file dependencies in error (#14050) + automoc: Use a pre-build event in VS >= 7 + Handle usr-move without forcing absolute paths (#14041) + +Clinton Stimpson (2): + FindQt4: If Qt5 is in CMAKE_PREFIX_PATH, be sure to find Qt4 includes. + Qt4: Fix typo setting a variable for FindThreads. + +James Bigler (1): + FindCUDA: Use the PRE_LINK mode only for MSVC >= 10 + +Matthew Woehlke (4): + UseJava.cmake: simplify path logic + UseJava.cmake: fix passing jars to add_jar + UseJava.cmake: accept jar targets in add_jar + UseJava.cmake: require explicit request to include jars + +Paul Kunysch (1): + CPack: Avoid "format expects 'unsigned int'" warnings + +Petr Kmoch (1): + cmSystemTools: Generalize TrimWhitespace to all whitespace + +Rex Dieter (1): + FindImageMagick: Search versioned suffixes (#14012) + +Rolf Eike Beer (1): + FindRuby: improve version selection + +Stephen Kelly (13): + FindQt4: Set the Qt4_FOUND variable if Qt4 is found + FindQt4: Set the INTERFACE_QT_MAJOR_VERSION for Qt4::QtCore + Document that CMAKE_AUTOMOC works with Qt 5. + FPHSA: Fix FOUND_VAR check to work with if() auto-dereference + Fix cmGeneratorExpression::Preprocess for interleaved inputs. + cmake-gui: Use the QStandardItemModel workaround until 5.1.0. + Automoc: append implicit includes after user-specified dirs + Fix the evaluation of per-config COMPILE_DEFINITIONS (#14037) + Fix new target commands documentation. + install(EXPORT): Ensure clean INTERFACE_INCLUDE_DIRECTORIES + Report an error on IMPORTED targets with a faulty INTERFACE + Error if linked target has relative paths in INTERFACE_INCLUDE_DIRECTORIES + Fix the Qt 5 version required to run the IncompatibleQt test. + Changes in CMake 2.8.11-rc1 (since 2.8.10.2) ---------------------------------------------- Alan Witkowski (1): diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index e333575..1c8b577 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -3,4 +3,4 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) set(CMake_VERSION_TWEAK 0) -set(CMake_VERSION_RC 1) +set(CMake_VERSION_RC 2) -- cgit v0.12 From fb9f73de644539b4759ba67041d92fc418db0ee9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 8 Apr 2013 12:40:14 -0400 Subject: MSVC: Invoke 'link' directly for executables Update the CMAKE__LINK_EXECUTABLE rule variable to invoke the linker directly instead of through the compiler. We already do this for DLL linking with CMAKE__CREATE_SHARED_LIBRARY. This also works around a VS 6 cl bug. While invoking the link tool internally it fails to correctly quote flags like /pdb:... with spaces in the value. --- Modules/Platform/Windows-MSVC.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 28abf05..794bde7 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -237,7 +237,7 @@ macro(__windows_compiler_msvc lang) 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_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe /link /implib: /pdb: /version:. ${CMAKE_END_TEMP_FILE}") + "${_CMAKE_VS_LINK_EXE} ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out: /implib: /pdb: /version:. ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_FLAGS_INIT "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} /D_WINDOWS /W3${_FLAGS_${lang}}") set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}") -- cgit v0.12 From 87c0d16ab7e4128d81411db35ef05d4428b8c236 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 11 Apr 2013 10:22:44 -0400 Subject: Ninja: Fix OBJECT_DIR placeholder path conversion Transform the path using ConvertToNinjaPath just as we do for all other paths. This fixes the OutOfSource test for objects in the ../OutOfBinary directory by computing the proper full path for the /Fd option. --- Source/cmNinjaTargetGenerator.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 3fb823c..850e5ea 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -569,11 +569,9 @@ cmNinjaTargetGenerator EnsureParentDirectoryExists(objectFileName); std::string objectDir = cmSystemTools::GetFilenamePath(objectFileName); - objectDir = this->GetLocalGenerator()->Convert(objectDir.c_str(), - cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); - vars["OBJECT_DIR"] = objectDir; - + vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat( + ConvertToNinjaPath(objectDir.c_str()).c_str(), + cmLocalGenerator::SHELL); this->SetMsvcTargetPdbVariable(vars); -- cgit v0.12 From 4e4688e46944bd94966d8abdaad68aad1cc2212b Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 11 Apr 2013 11:34:17 -0400 Subject: VS 10: Escape ; as %3B in preprocessor definitions (#14073) Use the suggestion from http://support.microsoft.com/kb/2262855 to escape semicolons in preprocessor definitions for VS >= 10. Update the COMPILE_DEFINITIONS documentation disclaimer list of known limitations accordingly. Update our "Preprocess" test to cover the case. Suggested-by: Jean-Christophe Fillion-Robin --- Source/cmDocumentCompileDefinitions.h | 2 +- Source/cmVisualStudioGeneratorOptions.cxx | 1 + Tests/Preprocess/CMakeLists.txt | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmDocumentCompileDefinitions.h b/Source/cmDocumentCompileDefinitions.h index ef3b3e7..d15bd6d 100644 --- a/Source/cmDocumentCompileDefinitions.h +++ b/Source/cmDocumentCompileDefinitions.h @@ -23,7 +23,7 @@ "in a (configured) header file. Then report the limitation. " \ "Known limitations include:\n" \ " # - broken almost everywhere\n" \ - " ; - broken in VS IDE and Borland Makefiles\n" \ + " ; - broken in VS IDE 7.0 and Borland Makefiles\n" \ " , - broken in VS IDE\n" \ " % - broken in some cases in NMake\n" \ " & | - broken in some cases on MinGW\n" \ diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 1df0d9e..3c1cf95 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -6,6 +6,7 @@ inline std::string cmVisualStudio10GeneratorOptionsEscapeForXML(const char* s) { std::string ret = s; + cmSystemTools::ReplaceString(ret, ";", "%3B"); cmSystemTools::ReplaceString(ret, "&", "&"); cmSystemTools::ReplaceString(ret, "<", "<"); cmSystemTools::ReplaceString(ret, ">", ">"); diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index 78746e7..fed9163 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -55,7 +55,7 @@ endif() # must not have it escaped inside the configured header. set(STRING_EXTRA "") -if(NOT BORLAND AND NOT PP_VS70 AND NOT PP_VS100 AND NOT PP_VS110) +if(NOT BORLAND AND NOT PP_VS70) # Borland, VS70 IDE: ; # The Borland compiler will simply not accept a non-escaped semicolon # on the command line. If it is escaped \; then the escape character @@ -63,7 +63,6 @@ if(NOT BORLAND AND NOT PP_VS70 AND NOT PP_VS100 AND NOT PP_VS110) # # The VS 7.0 IDE separates definitions on semicolons and commas with # no regard for quotes. Fortunately VS 7.1 and above are okay. - # VS 10 seems to also not like semicolons set(SEMICOLON "\;") endif() -- cgit v0.12 From 1b614e018cf835e6e2227ecaa45f33d798d39819 Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Fri, 12 Apr 2013 08:47:59 -0400 Subject: FindOpenSSL: Fix spelling of CMAKE_CROSSCOMPILING (#14075) Use of the mis-spelled variable name 'CMAKE_CROSS_COMPILING' was introduced by commit 4b793ad1 (FindOpenSSL: find cross-compiled OpenSSL from MinGW, 2012-07-23). Fix the spelling. --- Modules/FindOpenSSL.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 224c88e..a7224ea 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -143,7 +143,7 @@ if(WIN32 AND NOT CYGWIN) # same player, for MingW set(LIB_EAY_NAMES libeay32) set(SSL_EAY_NAMES ssleay32) - if(CMAKE_CROSS_COMPILING) + if(CMAKE_CROSSCOMPILING) list(APPEND LIB_EAY_NAMES crypto) list(APPEND SSL_EAY_NAMES ssl) endif() -- cgit v0.12 From de8be9ef7d019023099d28a1f797698ed7b598bd Mon Sep 17 00:00:00 2001 From: Petr Kmoch Date: Thu, 21 Mar 2013 15:53:26 +0100 Subject: Add projectDir parameter to GenerateBuildCommand Extend the cmGlobalGenerator::GenerateBuildCommand virtual method signature with a "projectDir" parameter specifying the top of the project build tree for which the build command will be generated. Populate it from call sites in cmGlobalGenerator::Build where a fully-generated build tree should be available. --- Source/CPack/cmCPackGenerator.cxx | 2 +- Source/CTest/cmCTestBuildCommand.cxx | 2 +- Source/cmBuildCommand.cxx | 4 ++-- Source/cmGlobalGenerator.cxx | 12 +++++++----- Source/cmGlobalGenerator.h | 7 ++++--- Source/cmGlobalNinjaGenerator.cxx | 4 +++- Source/cmGlobalNinjaGenerator.h | 1 + Source/cmGlobalUnixMakefileGenerator3.cxx | 8 +++++--- Source/cmGlobalUnixMakefileGenerator3.h | 3 ++- Source/cmGlobalVisualStudio10Generator.cxx | 5 +++-- Source/cmGlobalVisualStudio10Generator.h | 2 +- Source/cmGlobalVisualStudio6Generator.cxx | 3 +++ Source/cmGlobalVisualStudio6Generator.h | 1 + Source/cmGlobalVisualStudio7Generator.cxx | 4 +++- Source/cmGlobalVisualStudio7Generator.h | 1 + Source/cmGlobalXCodeGenerator.cxx | 2 ++ Source/cmGlobalXCodeGenerator.h | 1 + 17 files changed, 41 insertions(+), 21 deletions(-) diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 7cc1522..3c685bd 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -638,7 +638,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( = this->MakefileMap->GetDefinition("CMAKE_MAKE_PROGRAM"); std::string buildCommand = globalGenerator->GenerateBuildCommand(cmakeMakeProgram, - installProjectName.c_str(), 0, + installProjectName.c_str(), 0, 0, globalGenerator->GetPreinstallTargetName(), buildConfig, false, false); cmCPackLogger(cmCPackLog::LOG_DEBUG, diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index f4d38ce..5cb2a37 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -133,7 +133,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() std::string buildCommand = this->GlobalGenerator-> GenerateBuildCommand(cmakeMakeProgram, - cmakeProjectName, + cmakeProjectName, 0, cmakeBuildAdditionalFlags, cmakeBuildTarget, cmakeBuildConfiguration, true, false); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 91d55a5..b6e2569 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -122,7 +122,7 @@ bool cmBuildCommand // std::string makecommand = this->Makefile->GetLocalGenerator() ->GetGlobalGenerator()->GenerateBuildCommand - (makeprogram, project_name, 0, target, configuration, true, false); + (makeprogram, project_name, 0, 0, target, configuration, true, false); this->Makefile->AddDefinition(variable, makecommand.c_str()); @@ -153,7 +153,7 @@ bool cmBuildCommand std::string makecommand = this->Makefile->GetLocalGenerator() ->GetGlobalGenerator()->GenerateBuildCommand - (makeprogram.c_str(), this->Makefile->GetProjectName(), 0, + (makeprogram.c_str(), this->Makefile->GetProjectName(), 0, 0, 0, configType.c_str(), true, false); if(cacheValue) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index df14331..e6fc630 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1340,11 +1340,13 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir, std::string cmGlobalGenerator ::GenerateBuildCommand(const char* makeProgram, const char *projectName, - const char* additionalOptions, const char *targetName, - const char* config, bool ignoreErrors, bool) + const char *projectDir, const char* additionalOptions, + const char *targetName, const char* config, + bool ignoreErrors, bool) { - // Project name and config are not used yet. + // Project name & dir and config are not used yet. (void)projectName; + (void)projectDir; (void)config; std::string makeCommand = @@ -1411,7 +1413,7 @@ int cmGlobalGenerator::Build( if (clean) { std::string cleanCommand = - this->GenerateBuildCommand(makeCommandCSTR, projectName, + this->GenerateBuildCommand(makeCommandCSTR, projectName, bindir, 0, "clean", config, false, fast); if(output) { @@ -1443,7 +1445,7 @@ int cmGlobalGenerator::Build( // now build std::string makeCommand = - this->GenerateBuildCommand(makeCommandCSTR, projectName, + this->GenerateBuildCommand(makeCommandCSTR, projectName, bindir, extraOptions, target, config, false, fast); if(output) diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 11616e0..9427434 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -121,9 +121,10 @@ public: virtual std::string GenerateBuildCommand( const char* makeProgram, - const char *projectName, const char* additionalOptions, - const char *targetName, - const char* config, bool ignoreErrors, bool fast); + const char *projectName, const char *projectDir, + const char* additionalOptions, + const char *targetName, const char* config, + bool ignoreErrors, bool fast); ///! Set the CMake instance diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index fa277b1..fff972e 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -523,14 +523,16 @@ bool cmGlobalNinjaGenerator::UsingMinGW = false; std::string cmGlobalNinjaGenerator ::GenerateBuildCommand(const char* makeProgram, const char* projectName, + const char* projectDir, const char* additionalOptions, const char* targetName, const char* config, bool ignoreErrors, bool fast) { - // Project name and config are not used yet. + // Project name & dir and config are not used yet. (void)projectName; + (void)projectDir; (void)config; // Ninja does not have -i equivalent option yet. (void)ignoreErrors; diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index c3df7d9..6e93788 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -191,6 +191,7 @@ public: /// Overloaded methods. @see cmGlobalGenerator::GenerateBuildCommand() virtual std::string GenerateBuildCommand(const char* makeProgram, const char* projectName, + const char* projectDir, const char* additionalOptions, const char* targetName, const char* config, diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index e26cca9..88cd6e5 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -517,11 +517,13 @@ cmGlobalUnixMakefileGenerator3 std::string cmGlobalUnixMakefileGenerator3 ::GenerateBuildCommand(const char* makeProgram, const char *projectName, - const char* additionalOptions, const char *targetName, - const char* config, bool ignoreErrors, bool fast) + const char *projectDir, const char* additionalOptions, + const char *targetName, const char* config, + bool ignoreErrors, bool fast) { - // Project name and config are not used yet. + // Project name & dir and config are not used yet. (void)projectName; + (void)projectDir; (void)config; std::string makeCommand = diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 385cdc4..5e9dce3 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -107,7 +107,8 @@ public: // change the build command for speed virtual std::string GenerateBuildCommand (const char* makeProgram, - const char *projectName, const char* additionalOptions, + const char *projectName, const char *projectDir, + const char* additionalOptions, const char *targetName, const char* config, bool ignoreErrors, bool fast); diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index b8c4939..2d0880f 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -215,7 +215,7 @@ std::string cmGlobalVisualStudio10Generator::GetUserMacrosRegKeyBase() std::string cmGlobalVisualStudio10Generator ::GenerateBuildCommand(const char* makeProgram, - const char *projectName, + const char *projectName, const char *projectDir, const char* additionalOptions, const char *targetName, const char* config, bool ignoreErrors, bool fast) { @@ -230,7 +230,8 @@ std::string cmGlobalVisualStudio10Generator lowerCaseCommand.find("VCExpress") != std::string::npos) { return cmGlobalVisualStudio7Generator::GenerateBuildCommand(makeProgram, - projectName, additionalOptions, targetName, config, ignoreErrors, fast); + projectName, projectDir, additionalOptions, targetName, config, + ignoreErrors, fast); } // Otherwise, assume MSBuild command line, and construct accordingly. diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 5926e0f..dbe6044 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -32,7 +32,7 @@ public: virtual std::string GenerateBuildCommand(const char* makeProgram, - const char *projectName, + const char *projectName, const char *projectDir, const char* additionalOptions, const char *targetName, const char* config, bool ignoreErrors, bool); diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index 9f3af71..b3fabda 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -80,12 +80,15 @@ void cmGlobalVisualStudio6Generator::GenerateConfigurations(cmMakefile* mf) std::string cmGlobalVisualStudio6Generator ::GenerateBuildCommand(const char* makeProgram, const char *projectName, + const char *projectDir, const char* additionalOptions, const char *targetName, const char* config, bool ignoreErrors, bool) { + // Visual studio 6 doesn't need project dir + (void) projectDir; // Ingoring errors is not implemented in visual studio 6 (void) ignoreErrors; diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h index 40149e9..6bd39ca 100644 --- a/Source/cmGlobalVisualStudio6Generator.h +++ b/Source/cmGlobalVisualStudio6Generator.h @@ -54,6 +54,7 @@ public: */ virtual std::string GenerateBuildCommand(const char* makeProgram, const char *projectName, + const char *projectDir, const char* additionalOptions, const char *targetName, const char* config, diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 63cbdb8..8a186e7 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -56,10 +56,12 @@ void cmGlobalVisualStudio7Generator std::string cmGlobalVisualStudio7Generator ::GenerateBuildCommand(const char* makeProgram, - const char *projectName, + const char *projectName, const char *projectDir, const char* additionalOptions, const char *targetName, const char* config, bool ignoreErrors, bool) { + // Visual studio 7 doesn't need project dir + (void) projectDir; // Ingoring errors is not implemented in visual studio 6 (void) ignoreErrors; diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 6e78620..3ebb408 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -55,6 +55,7 @@ public: */ virtual std::string GenerateBuildCommand(const char* makeProgram, const char *projectName, + const char *projectDir, const char* additionalOptions, const char *targetName, const char* config, diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index ceac564..d898020 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -260,6 +260,7 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vectorconst& std::string cmGlobalXCodeGenerator ::GenerateBuildCommand(const char* makeProgram, const char *projectName, + const char *projectDir, const char* additionalOptions, const char *targetName, const char* config, @@ -268,6 +269,7 @@ std::string cmGlobalXCodeGenerator { // Config is not used yet (void) ignoreErrors; + (void) projectDir; // now build the test if(makeProgram == 0 || !strlen(makeProgram)) diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 131a6e6..fb897b2 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -55,6 +55,7 @@ public: */ virtual std::string GenerateBuildCommand(const char* makeProgram, const char *projectName, + const char *projectDir, const char* additionalOptions, const char *targetName, const char* config, -- cgit v0.12 From df035e4825189c0d4d9519160d439e7f96a39086 Mon Sep 17 00:00:00 2001 From: Petr Kmoch Date: Tue, 8 Jan 2013 14:10:42 +0100 Subject: VS: Create parser for Visual Studio .sln files Create class cmVisualStudioSlnParser as a generic parser for Visual Studio .sln files. Implement minimum functionality but keep class extensible. Add tests for the class. --- Source/CMakeLists.txt | 4 + Source/cmVisualStudioSlnData.cxx | 62 ++ Source/cmVisualStudioSlnData.h | 58 ++ Source/cmVisualStudioSlnParser.cxx | 712 +++++++++++++++++++++ Source/cmVisualStudioSlnParser.h | 118 ++++ Tests/CMakeLib/CMakeLists.txt | 8 + Tests/CMakeLib/testVisualStudioSlnParser.cxx | 185 ++++++ Tests/CMakeLib/testVisualStudioSlnParser.h.in | 7 + .../testVisualStudioSlnParser_data/.gitattributes | 1 + .../testVisualStudioSlnParser_data/bom.sln-file | 2 + .../err-data.sln-file | 6 + .../err-empty.sln-file | 0 .../err-structure-global.sln-file | 9 + .../err-structure-header.sln-file | 4 + .../err-structure-projectArgs.sln-file | 4 + .../err-structure-projectContents.sln-file | 6 + .../err-structure-projectSection.sln-file | 11 + .../err-structure-strayParen.sln-file | 4 + .../err-structure-strayQuote.sln-file | 4 + .../err-structure-strayQuote2.sln-file | 4 + .../err-structure-topLevel.sln-file | 4 + .../err-structure-unclosed.sln-file | 5 + .../testVisualStudioSlnParser_data/nobom.sln-file | 2 + .../testVisualStudioSlnParser_data/valid.sln-file | 680 ++++++++++++++++++++ 24 files changed, 1900 insertions(+) create mode 100644 Source/cmVisualStudioSlnData.cxx create mode 100644 Source/cmVisualStudioSlnData.h create mode 100644 Source/cmVisualStudioSlnParser.cxx create mode 100644 Source/cmVisualStudioSlnParser.h create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser.cxx create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser.h.in create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/.gitattributes create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/bom.sln-file create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/err-data.sln-file create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/err-empty.sln-file create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-global.sln-file create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-header.sln-file create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectArgs.sln-file create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectContents.sln-file create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectSection.sln-file create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayParen.sln-file create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote.sln-file create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote2.sln-file create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-topLevel.sln-file create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-unclosed.sln-file create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/nobom.sln-file create mode 100644 Tests/CMakeLib/testVisualStudioSlnParser_data/valid.sln-file diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index ab62d2b..7fe3822 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -357,6 +357,10 @@ if (WIN32) cmLocalVisualStudio7Generator.h cmLocalVisualStudioGenerator.cxx cmLocalVisualStudioGenerator.h + cmVisualStudioSlnData.h + cmVisualStudioSlnData.cxx + cmVisualStudioSlnParser.h + cmVisualStudioSlnParser.cxx cmVisualStudioWCEPlatformParser.h cmVisualStudioWCEPlatformParser.cxx cmWin32ProcessExecution.cxx diff --git a/Source/cmVisualStudioSlnData.cxx b/Source/cmVisualStudioSlnData.cxx new file mode 100644 index 0000000..82b4ee8 --- /dev/null +++ b/Source/cmVisualStudioSlnData.cxx @@ -0,0 +1,62 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2013 Kitware, Inc., Insight Software Consortium + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#include "cmVisualStudioSlnData.h" + +//---------------------------------------------------------------------------- +const cmSlnProjectEntry* +cmSlnData::GetProjectByGUID(const std::string& projectGUID) const +{ + ProjectStorage::const_iterator it(ProjectsByGUID.find(projectGUID)); + if (it != ProjectsByGUID.end()) + return &it->second; + else + return NULL; +} + +//---------------------------------------------------------------------------- +const cmSlnProjectEntry* +cmSlnData::GetProjectByName(const std::string& projectName) const +{ + ProjectStringIndex::const_iterator it(ProjectNameIndex.find(projectName)); + if (it != ProjectNameIndex.end()) + return &it->second->second; + else + return NULL; +} + +//---------------------------------------------------------------------------- +std::vector cmSlnData::GetProjects() const +{ + ProjectStringIndex::const_iterator it(this->ProjectNameIndex.begin()), + itEnd(this->ProjectNameIndex.end()); + std::vector result; + for (; it != itEnd; ++it) + result.push_back(it->second->second); + return result; +} + +//---------------------------------------------------------------------------- +cmSlnProjectEntry* cmSlnData::AddProject( + const std::string& projectGUID, + const std::string& projectName, + const std::string& projectRelativePath) +{ + ProjectStorage::iterator it(ProjectsByGUID.find(projectGUID)); + if (it != ProjectsByGUID.end()) + return NULL; + it = ProjectsByGUID.insert( + ProjectStorage::value_type( + projectGUID, + cmSlnProjectEntry(projectGUID, projectName, projectRelativePath))).first; + ProjectNameIndex[projectName] = it; + return &it->second; +} diff --git a/Source/cmVisualStudioSlnData.h b/Source/cmVisualStudioSlnData.h new file mode 100644 index 0000000..ec128cf --- /dev/null +++ b/Source/cmVisualStudioSlnData.h @@ -0,0 +1,58 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2013 Kitware, Inc., Insight Software Consortium + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#ifndef cmVisualStudioSlnData_h +#define cmVisualStudioSlnData_h + +#include "cmStandardIncludes.h" + +class cmSlnProjectEntry +{ +public: + cmSlnProjectEntry() {} + cmSlnProjectEntry(const std::string& guid, + const std::string& name, + const std::string& relativePath) + : Guid(guid), Name(name), RelativePath(relativePath) + {} + + std::string GetGUID() const { return Guid; } + std::string GetName() const { return Name; } + std::string GetRelativePath() const { return RelativePath; } + +private: + std::string Guid, Name, RelativePath; +}; + + +class cmSlnData +{ +public: + const cmSlnProjectEntry* + GetProjectByGUID(const std::string& projectGUID) const; + + const cmSlnProjectEntry* + GetProjectByName(const std::string& projectName) const; + + std::vector GetProjects() const; + + cmSlnProjectEntry* AddProject(const std::string& projectGUID, + const std::string& projectName, + const std::string& projectRelativePath); + +private: + typedef std::map ProjectStorage; + ProjectStorage ProjectsByGUID; + typedef std::map ProjectStringIndex; + ProjectStringIndex ProjectNameIndex; +}; + +#endif diff --git a/Source/cmVisualStudioSlnParser.cxx b/Source/cmVisualStudioSlnParser.cxx new file mode 100644 index 0000000..bae5974 --- /dev/null +++ b/Source/cmVisualStudioSlnParser.cxx @@ -0,0 +1,712 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2013 Kitware, Inc., Insight Software Consortium + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#include "cmVisualStudioSlnParser.h" + +#include "cmSystemTools.h" +#include "cmVisualStudioSlnData.h" + +#include +#include + +//---------------------------------------------------------------------------- +namespace +{ + enum LineFormat + { + LineMultiValueTag, + LineSingleValueTag, + LineKeyValuePair, + LineVerbatim + }; +} + +//---------------------------------------------------------------------------- +class cmVisualStudioSlnParser::ParsedLine +{ +public: + bool IsComment() const; + bool IsKeyValuePair() const; + + const std::string& GetTag() const { return this->Tag; } + const std::string& GetArg() const { return this->Arg.first; } + std::string GetArgVerbatim() const; + size_t GetValueCount() const { return this->Values.size(); } + const std::string& GetValue(size_t idxValue) const; + std::string GetValueVerbatim(size_t idxValue) const; + + void SetTag(const std::string& tag) { this->Tag = tag; } + void SetArg(const std::string& arg) { this->Arg = StringData(arg, false); } + void SetQuotedArg(const std::string& arg) + { this->Arg = StringData(arg, true); } + void AddValue(const std::string& value) + { this->Values.push_back(StringData(value, false)); } + void AddQuotedValue(const std::string& value) + { this->Values.push_back(StringData(value, true)); } + + void CopyVerbatim(const std::string& line) { this->Tag = line; } + +private: + typedef std::pair StringData; + std::string Tag; + StringData Arg; + std::vector Values; + static const std::string BadString; + static const std::string Quote; +}; + +//---------------------------------------------------------------------------- +const std::string cmVisualStudioSlnParser::ParsedLine::BadString; +const std::string cmVisualStudioSlnParser::ParsedLine::Quote("\""); + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::ParsedLine::IsComment() const +{ + assert(!this->Tag.empty()); + return (this->Tag[0]== '#'); +} + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::ParsedLine::IsKeyValuePair() const +{ + assert(!this->Tag.empty()); + return this->Arg.first.empty() && this->Values.size() == 1; +} + +//---------------------------------------------------------------------------- +std::string cmVisualStudioSlnParser::ParsedLine::GetArgVerbatim() const +{ + if (this->Arg.second) + return Quote + this->Arg.first + Quote; + else + return this->Arg.first; +} + +//---------------------------------------------------------------------------- +const std::string& +cmVisualStudioSlnParser::ParsedLine::GetValue(size_t idxValue) const +{ + if (idxValue < this->Values.size()) + return this->Values[idxValue].first; + else + return BadString; +} + +//---------------------------------------------------------------------------- +std::string +cmVisualStudioSlnParser::ParsedLine::GetValueVerbatim(size_t idxValue) const +{ + if (idxValue < this->Values.size()) + { + const StringData& data = this->Values[idxValue]; + if (data.second) + return Quote + data.first + Quote; + else + return data.first; + } + else + return BadString; +} + +//---------------------------------------------------------------------------- +class cmVisualStudioSlnParser::State +{ +public: + explicit State(DataGroupSet requestedData); + + size_t GetCurrentLine() const { return this->CurrentLine; } + bool ReadLine(std::istream& input, std::string& line); + + LineFormat NextLineFormat() const; + + bool Process(const cmVisualStudioSlnParser::ParsedLine& line, + cmSlnData& output, + cmVisualStudioSlnParser::ResultData& result); + + bool Finished(cmVisualStudioSlnParser::ResultData& result); + +private: + enum FileState + { + FileStateStart, + FileStateTopLevel, + FileStateProject, + FileStateProjectDependencies, + FileStateGlobal, + FileStateSolutionConfigurations, + FileStateProjectConfigurations, + FileStateSolutionFilters, + FileStateGlobalSection, + FileStateIgnore + }; + std::stack Stack; + std::string EndIgnoreTag; + DataGroupSet RequestedData; + size_t CurrentLine; + + void IgnoreUntilTag(const std::string& endTag); +}; + +//---------------------------------------------------------------------------- +cmVisualStudioSlnParser::State::State(DataGroupSet requestedData) : + RequestedData(requestedData), + CurrentLine(0) +{ + if (this->RequestedData.test(DataGroupProjectDependenciesBit)) + this->RequestedData.set(DataGroupProjectsBit); + this->Stack.push(FileStateStart); +} + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::State::ReadLine(std::istream& input, + std::string& line) +{ + ++this->CurrentLine; + return !std::getline(input, line).fail(); +} + +//---------------------------------------------------------------------------- +LineFormat cmVisualStudioSlnParser::State::NextLineFormat() const +{ + switch (this->Stack.top()) + { + case FileStateStart: return LineVerbatim; + case FileStateTopLevel: return LineMultiValueTag; + case FileStateProject: return LineSingleValueTag; + case FileStateProjectDependencies: return LineKeyValuePair; + case FileStateGlobal: return LineSingleValueTag; + case FileStateSolutionConfigurations: return LineKeyValuePair; + case FileStateProjectConfigurations: return LineKeyValuePair; + case FileStateSolutionFilters: return LineKeyValuePair; + case FileStateGlobalSection: return LineKeyValuePair; + case FileStateIgnore: return LineVerbatim; + default: + assert(false); + return LineVerbatim; + } +} + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::State::Process( + const cmVisualStudioSlnParser::ParsedLine& line, + cmSlnData& output, cmVisualStudioSlnParser::ResultData& result) +{ + assert(!line.IsComment()); + switch (this->Stack.top()) + { + case FileStateStart: + if (!cmSystemTools::StringStartsWith( + line.GetTag().c_str(), "Microsoft Visual Studio Solution File")) + { + result.SetError(ResultErrorInputStructure, this->GetCurrentLine()); + return false; + } + this->Stack.pop(); + this->Stack.push(FileStateTopLevel); + break; + case FileStateTopLevel: + if (line.GetTag().compare("Project") == 0) + { + if (line.GetValueCount() != 3) + { + result.SetError(ResultErrorInputStructure, this->GetCurrentLine()); + return false; + } + if (this->RequestedData.test(DataGroupProjectsBit)) + { + if (!output.AddProject(line.GetValue(2), + line.GetValue(0), + line.GetValue(1))) + { + result.SetError(ResultErrorInputData, this->GetCurrentLine()); + return false; + } + this->Stack.push(FileStateProject); + } + else + this->IgnoreUntilTag("EndProject"); + } + else if (line.GetTag().compare("Global") == 0) + this->Stack.push(FileStateGlobal); + else + { + result.SetError(ResultErrorInputStructure, this->GetCurrentLine()); + return false; + } + break; + case FileStateProject: + if (line.GetTag().compare("EndProject") == 0) + this->Stack.pop(); + else if (line.GetTag().compare("ProjectSection") == 0) + { + if (line.GetArg().compare("ProjectDependencies") == 0 && + line.GetValue(0).compare("postProject") == 0) + { + if (this->RequestedData.test(DataGroupProjectDependenciesBit)) + this->Stack.push(FileStateProjectDependencies); + else + this->IgnoreUntilTag("EndProjectSection"); + } + else + this->IgnoreUntilTag("EndProjectSection"); + } + else + { + result.SetError(ResultErrorInputStructure, this->GetCurrentLine()); + return false; + } + break; + case FileStateProjectDependencies: + if (line.GetTag().compare("EndProjectSection") == 0) + this->Stack.pop(); + else if (line.IsKeyValuePair()) + // implement dependency storing here, once needed + ; + else + { + result.SetError(ResultErrorInputStructure, this->GetCurrentLine()); + return false; + } + break; + case FileStateGlobal: + if (line.GetTag().compare("EndGlobal") == 0) + this->Stack.pop(); + else if (line.GetTag().compare("GlobalSection") == 0) + { + if (line.GetArg().compare("SolutionConfigurationPlatforms") == 0 && + line.GetValue(0).compare("preSolution") == 0) + { + if (this->RequestedData.test(DataGroupSolutionConfigurationsBit)) + this->Stack.push(FileStateSolutionConfigurations); + else + this->IgnoreUntilTag("EndGlobalSection"); + } + else if (line.GetArg().compare("ProjectConfigurationPlatforms") == 0 && + line.GetValue(0).compare("postSolution") == 0) + { + if (this->RequestedData.test(DataGroupProjectConfigurationsBit)) + this->Stack.push(FileStateProjectConfigurations); + else + this->IgnoreUntilTag("EndGlobalSection"); + } + else if (line.GetArg().compare("NestedProjects") == 0 && + line.GetValue(0).compare("preSolution") == 0) + { + if (this->RequestedData.test(DataGroupSolutionFiltersBit)) + this->Stack.push(FileStateSolutionFilters); + else + this->IgnoreUntilTag("EndGlobalSection"); + } + else if (this->RequestedData.test(DataGroupGenericGlobalSectionsBit)) + this->Stack.push(FileStateGlobalSection); + else + this->IgnoreUntilTag("EndGlobalSection"); + } + else + { + result.SetError(ResultErrorInputStructure, this->GetCurrentLine()); + return false; + } + break; + case FileStateSolutionConfigurations: + if (line.GetTag().compare("EndGlobalSection") == 0) + this->Stack.pop(); + else if (line.IsKeyValuePair()) + // implement configuration storing here, once needed + ; + else + { + result.SetError(ResultErrorInputStructure, this->GetCurrentLine()); + return false; + } + break; + case FileStateProjectConfigurations: + if (line.GetTag().compare("EndGlobalSection") == 0) + this->Stack.pop(); + else if (line.IsKeyValuePair()) + // implement configuration storing here, once needed + ; + else + { + result.SetError(ResultErrorInputStructure, this->GetCurrentLine()); + return false; + } + break; + case FileStateSolutionFilters: + if (line.GetTag().compare("EndGlobalSection") == 0) + this->Stack.pop(); + else if (line.IsKeyValuePair()) + // implement filter storing here, once needed + ; + else + { + result.SetError(ResultErrorInputStructure, this->GetCurrentLine()); + return false; + } + break; + case FileStateGlobalSection: + if (line.GetTag().compare("EndGlobalSection") == 0) + this->Stack.pop(); + else if (line.IsKeyValuePair()) + // implement section storing here, once needed + ; + else + { + result.SetError(ResultErrorInputStructure, this->GetCurrentLine()); + return false; + } + break; + case FileStateIgnore: + if (line.GetTag() == this->EndIgnoreTag) + { + this->Stack.pop(); + this->EndIgnoreTag = ""; + } + break; + default: + result.SetError(ResultErrorBadInternalState, this->GetCurrentLine()); + return false; + } + return true; +} + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::State::Finished( + cmVisualStudioSlnParser::ResultData& result) +{ + if (this->Stack.top() != FileStateTopLevel) + { + result.SetError(ResultErrorInputStructure, this->GetCurrentLine()); + return false; + } + result.Result = ResultOK; + return true; +} + +//---------------------------------------------------------------------------- +void cmVisualStudioSlnParser::State::IgnoreUntilTag(const std::string& endTag) +{ + this->Stack.push(FileStateIgnore); + this->EndIgnoreTag = endTag; +} + +//---------------------------------------------------------------------------- +cmVisualStudioSlnParser::ResultData::ResultData() + : Result(ResultOK) + , ResultLine(0) +{} + +//---------------------------------------------------------------------------- +void cmVisualStudioSlnParser::ResultData::Clear() +{ + *this = ResultData(); +} + +//---------------------------------------------------------------------------- +void cmVisualStudioSlnParser::ResultData::SetError(ParseResult error, + size_t line) +{ + this->Result = error; + this->ResultLine = line; +} + +//---------------------------------------------------------------------------- +const cmVisualStudioSlnParser::DataGroupSet +cmVisualStudioSlnParser::DataGroupProjects( + 1 << cmVisualStudioSlnParser::DataGroupProjectsBit); + +const cmVisualStudioSlnParser::DataGroupSet +cmVisualStudioSlnParser::DataGroupProjectDependencies( + 1 << cmVisualStudioSlnParser::DataGroupProjectDependenciesBit); + +const cmVisualStudioSlnParser::DataGroupSet +cmVisualStudioSlnParser::DataGroupSolutionConfigurations( + 1 << cmVisualStudioSlnParser::DataGroupSolutionConfigurationsBit); + +const cmVisualStudioSlnParser::DataGroupSet +cmVisualStudioSlnParser::DataGroupProjectConfigurations( + 1 << cmVisualStudioSlnParser::DataGroupProjectConfigurationsBit); + +const cmVisualStudioSlnParser::DataGroupSet +cmVisualStudioSlnParser::DataGroupSolutionFilters( + 1 << cmVisualStudioSlnParser::DataGroupSolutionFiltersBit); + +const cmVisualStudioSlnParser::DataGroupSet +cmVisualStudioSlnParser::DataGroupGenericGlobalSections( + 1 << cmVisualStudioSlnParser::DataGroupGenericGlobalSectionsBit); + +const cmVisualStudioSlnParser::DataGroupSet +cmVisualStudioSlnParser::DataGroupAll(~0); + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::Parse(std::istream& input, + cmSlnData& output, + DataGroupSet dataGroups) +{ + this->LastResult.Clear(); + if (!this->IsDataGroupSetSupported(dataGroups)) + { + this->LastResult.SetError(ResultErrorUnsupportedDataGroup, 0); + return false; + } + State state(dataGroups); + return this->ParseImpl(input, output, state); +} + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::ParseFile(const std::string& file, + cmSlnData& output, + DataGroupSet dataGroups) +{ + this->LastResult.Clear(); + if (!this->IsDataGroupSetSupported(dataGroups)) + { + this->LastResult.SetError(ResultErrorUnsupportedDataGroup, 0); + return false; + } + std::ifstream f(file.c_str()); + if (!f) + { + this->LastResult.SetError(ResultErrorOpeningInput, 0); + return false; + } + State state(dataGroups); + return this->ParseImpl(f, output, state); +} + +//---------------------------------------------------------------------------- +cmVisualStudioSlnParser::ParseResult +cmVisualStudioSlnParser::GetParseResult() const +{ + return this->LastResult.Result; +} + +//---------------------------------------------------------------------------- +size_t cmVisualStudioSlnParser::GetParseResultLine() const +{ + return this->LastResult.ResultLine; +} + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::GetParseHadBOM() const +{ + return this->LastResult.HadBOM; +} + +//---------------------------------------------------------------------------- +bool +cmVisualStudioSlnParser::IsDataGroupSetSupported(DataGroupSet dataGroups) const +{ + return (dataGroups & DataGroupProjects) == dataGroups; + //only supporting DataGroupProjects for now +} + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::ParseImpl(std::istream& input, + cmSlnData& output, + State& state) +{ + std::string line; + // Does the .sln start with a Byte Order Mark? + if (!this->ParseBOM(input, line, state)) + return false; + do + { + line = cmSystemTools::TrimWhitespace(line); + if (line.empty()) + continue; + ParsedLine parsedLine; + switch (state.NextLineFormat()) + { + case LineMultiValueTag: + if (!this->ParseMultiValueTag(line, parsedLine, state)) + return false; + break; + case LineSingleValueTag: + if (!this->ParseSingleValueTag(line, parsedLine, state)) + return false; + break; + case LineKeyValuePair: + if (!this->ParseKeyValuePair(line, parsedLine, state)) + return false; + break; + case LineVerbatim: + parsedLine.CopyVerbatim(line); + break; + } + if (parsedLine.IsComment()) + continue; + if (!state.Process(parsedLine, output, this->LastResult)) + return false; + } + while (state.ReadLine(input, line)); + return state.Finished(this->LastResult); +} + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::ParseBOM(std::istream& input, + std::string& line, + State& state) +{ + char bom[4]; + if (!input.get(bom, 4)) + { + this->LastResult.SetError(ResultErrorReadingInput, 1); + return false; + } + this->LastResult.HadBOM = + (bom[0] == char(0xEF) && bom[1] == char(0xBB) && bom[2] == char(0xBF)); + if (!state.ReadLine(input, line)) + { + this->LastResult.SetError(ResultErrorReadingInput, 1); + return false; + } + if (!this->LastResult.HadBOM) + line = bom + line; // it wasn't a BOM, prepend it to first line + return true; +} + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::ParseMultiValueTag(const std::string& line, + ParsedLine& parsedLine, + State& state) +{ + size_t idxEqualSign = line.find('='); + const std::string& fullTag = line.substr(0, idxEqualSign); + if (!this->ParseTag(fullTag, parsedLine, state)) + return false; + if (idxEqualSign != line.npos) + { + size_t idxFieldStart = idxEqualSign + 1; + if (idxFieldStart < line.size()) + { + size_t idxParsing = idxFieldStart; + bool inQuotes = false; + for (;;) + { + idxParsing = line.find_first_of(",\"", idxParsing); + bool fieldOver = false; + if (idxParsing == line.npos) + { + fieldOver = true; + if (inQuotes) + { + this->LastResult.SetError(ResultErrorInputStructure, + state.GetCurrentLine()); + return false; + } + } + else if (line[idxParsing] == ',' && !inQuotes) + fieldOver = true; + else if (line[idxParsing] == '"') + inQuotes = !inQuotes; + if (fieldOver) + { + if (!this->ParseValue(line.substr(idxFieldStart, + idxParsing - idxFieldStart), + parsedLine)) + return false; + if (idxParsing == line.npos) + break; //end of last field + idxFieldStart = idxParsing + 1; + } + ++idxParsing; + } + } + } + return true; +} + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::ParseSingleValueTag(const std::string& line, + ParsedLine& parsedLine, + State& state) +{ + size_t idxEqualSign = line.find('='); + const std::string& fullTag = line.substr(0, idxEqualSign); + if (!this->ParseTag(fullTag, parsedLine, state)) + return false; + if (idxEqualSign != line.npos) + { + if (!this->ParseValue(line.substr(idxEqualSign + 1), parsedLine)) + return false; + } + return true; +} + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::ParseKeyValuePair(const std::string& line, + ParsedLine& parsedLine, + State& /*state*/) +{ + size_t idxEqualSign = line.find('='); + if (idxEqualSign == line.npos) + { + parsedLine.CopyVerbatim(line); + return true; + } + const std::string& key = line.substr(0, idxEqualSign); + parsedLine.SetTag(cmSystemTools::TrimWhitespace(key)); + const std::string& value = line.substr(idxEqualSign + 1); + parsedLine.AddValue(cmSystemTools::TrimWhitespace(value)); + return true; +} + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::ParseTag(const std::string& fullTag, + ParsedLine& parsedLine, + State& state) +{ + size_t idxLeftParen = fullTag.find('('); + if (idxLeftParen == fullTag.npos) + { + parsedLine.SetTag(cmSystemTools::TrimWhitespace(fullTag)); + return true; + } + parsedLine.SetTag( + cmSystemTools::TrimWhitespace(fullTag.substr(0, idxLeftParen))); + size_t idxRightParen = fullTag.rfind(')'); + if (idxRightParen == fullTag.npos) + { + this->LastResult.SetError(ResultErrorInputStructure, + state.GetCurrentLine()); + return false; + } + const std::string& arg = cmSystemTools::TrimWhitespace( + fullTag.substr(idxLeftParen + 1, idxRightParen - idxLeftParen - 1)); + if (arg[0] == '"') + { + if (arg[arg.size() - 1] != '"') + { + this->LastResult.SetError(ResultErrorInputStructure, + state.GetCurrentLine()); + return false; + } + parsedLine.SetQuotedArg(arg.substr(1, arg.size() - 2)); + } + else + parsedLine.SetArg(arg); + return true; +} + +//---------------------------------------------------------------------------- +bool cmVisualStudioSlnParser::ParseValue(const std::string& value, + ParsedLine& parsedLine) +{ + const std::string& trimmed = cmSystemTools::TrimWhitespace(value); + if (trimmed.empty()) + parsedLine.AddValue(trimmed); + else if (trimmed[0] == '"' && trimmed[trimmed.size() - 1] == '"') + parsedLine.AddQuotedValue(trimmed.substr(1, trimmed.size() - 2)); + else + parsedLine.AddValue(trimmed); + return true; +} diff --git a/Source/cmVisualStudioSlnParser.h b/Source/cmVisualStudioSlnParser.h new file mode 100644 index 0000000..bee70cc --- /dev/null +++ b/Source/cmVisualStudioSlnParser.h @@ -0,0 +1,118 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2013 Kitware, Inc., Insight Software Consortium + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#ifndef cmVisualStudioSlnParser_h +#define cmVisualStudioSlnParser_h + +#include "cmStandardIncludes.h" + +#include + + +class cmSlnData; + + +class cmVisualStudioSlnParser +{ +public: + enum ParseResult + { + ResultOK = 0, + + ResultInternalError = -1, + ResultExternalError = 1, + + ResultErrorOpeningInput = ResultExternalError, + ResultErrorReadingInput, + ResultErrorInputStructure, + ResultErrorInputData, + + ResultErrorBadInternalState = ResultInternalError, + ResultErrorUnsupportedDataGroup = ResultInternalError - 1 + }; + + enum DataGroup + { + DataGroupProjectsBit, + DataGroupProjectDependenciesBit, + DataGroupSolutionConfigurationsBit, + DataGroupProjectConfigurationsBit, + DataGroupSolutionFiltersBit, + DataGroupGenericGlobalSectionsBit, + DataGroupCount + }; + + typedef std::bitset DataGroupSet; + + static const DataGroupSet DataGroupProjects; + static const DataGroupSet DataGroupProjectDependencies; + static const DataGroupSet DataGroupSolutionConfigurations; + static const DataGroupSet DataGroupProjectConfigurations; + static const DataGroupSet DataGroupSolutionFilters; + static const DataGroupSet DataGroupGenericGlobalSections; + static const DataGroupSet DataGroupAll; + + bool Parse(std::istream& input, + cmSlnData& output, + DataGroupSet dataGroups = DataGroupAll); + + bool ParseFile(const std::string& file, + cmSlnData& output, + DataGroupSet dataGroups = DataGroupAll); + + ParseResult GetParseResult() const; + + size_t GetParseResultLine() const; + + bool GetParseHadBOM() const; + +protected: + class State; + friend class State; + class ParsedLine; + + struct ResultData + { + ParseResult Result; + size_t ResultLine; + bool HadBOM; + + ResultData(); + void Clear(); + void SetError(ParseResult error, size_t line); + } LastResult; + + bool IsDataGroupSetSupported(DataGroupSet dataGroups) const; + + bool ParseImpl(std::istream& input, cmSlnData& output, State& state); + + bool ParseBOM(std::istream& input, std::string& line, State& state); + + bool ParseMultiValueTag(const std::string& line, + ParsedLine& parsedLine, + State& state); + + bool ParseSingleValueTag(const std::string& line, + ParsedLine& parsedLine, + State& state); + + bool ParseKeyValuePair(const std::string& line, + ParsedLine& parsedLine, + State& state); + + bool ParseTag(const std::string& fullTag, + ParsedLine& parsedLine, + State& state); + + bool ParseValue(const std::string& value, ParsedLine& parsedLine); +}; + +#endif diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt index 4e819f4..a831e30 100644 --- a/Tests/CMakeLib/CMakeLists.txt +++ b/Tests/CMakeLib/CMakeLists.txt @@ -12,6 +12,14 @@ set(CMakeLib_TESTS testXMLSafe ) +if(WIN32 AND NOT UNIX) # Just if(WIN32) when CMake >= 2.8.4 is required + list(APPEND CMakeLib_TESTS + testVisualStudioSlnParser + ) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testVisualStudioSlnParser.h.in + ${CMAKE_CURRENT_BINARY_DIR}/testVisualStudioSlnParser.h @ONLY) +endif() + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testXMLParser.h.in ${CMAKE_CURRENT_BINARY_DIR}/testXMLParser.h @ONLY) diff --git a/Tests/CMakeLib/testVisualStudioSlnParser.cxx b/Tests/CMakeLib/testVisualStudioSlnParser.cxx new file mode 100644 index 0000000..5b62f23 --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser.cxx @@ -0,0 +1,185 @@ +#include "testVisualStudioSlnParser.h" + +#include "cmVisualStudioSlnData.h" +#include "cmVisualStudioSlnParser.h" + +#include + +//---------------------------------------------------------------------------- +static bool parsedRight(cmVisualStudioSlnParser& parser, + const std::string& file, cmSlnData& data, + cmVisualStudioSlnParser::ParseResult expected = + cmVisualStudioSlnParser::ResultOK) +{ + if (parser.ParseFile(SOURCE_DIR "/testVisualStudioSlnParser_data/" + file + + "." SLN_EXTENSION, + data, cmVisualStudioSlnParser::DataGroupProjects)) + { + if (expected == cmVisualStudioSlnParser::ResultOK) + { + return true; + } + } + else + { + if (parser.GetParseResult() == expected) + { + return true; + } + } + cmsys_ios::cerr << "cmVisualStudioSlnParser mis-parsed " << file + << "." SLN_EXTENSION << "; expected result " << expected + << ", got " << parser.GetParseResult() + << cmsys_ios::endl; + return false; +} + +//---------------------------------------------------------------------------- +int testVisualStudioSlnParser(int, char*[]) +{ + cmVisualStudioSlnParser parser; + + // Test clean parser + if (parser.GetParseResult() != cmVisualStudioSlnParser::ResultOK) + { + cmsys_ios::cerr << "cmVisualStudioSlnParser initialisation failed" + << cmsys_ios::endl; + return 1; + } + + // Test parsing valid sln + { + cmSlnData data; + if (!parsedRight(parser, "valid", data)) + { + return 1; + } + const std::vector& projects = data.GetProjects(); + const char * const names[] = + { + "3rdParty", "ALL_BUILD", "CMakeLib", "CMakeLibTests", + "CMakePredefinedTargets", "CPackLib", "CTestDashboardTargets", "CTestLib", + "Continuous", "Documentation", + "Experimental", "INSTALL", "KWSys", "LIBCURL", "Nightly", + "NightlyMemoryCheck", "PACKAGE", "RUN_TESTS", "Tests", "Utilities", + "Win9xCompat", "ZERO_CHECK", "cmIML_test", "cmake", "cmbzip2", "cmcldeps", + "cmcompress", "cmcurl", "cmexpat", "cmlibarchive", "cmsys", + "cmsysEncodeExecutable", "cmsysProcessFwd9x", "cmsysTestDynload", + "cmsysTestProcess", "cmsysTestSharedForward", "cmsysTestsC", + "cmsysTestsCxx", "cmsys_c", "cmw9xcom", "cmzlib", "cpack", "ctest", + "documentation", "memcheck_fail", "pseudo_BC", "pseudo_purify", + "pseudo_valgrind", "test_clean", "uninstall" + }; + const size_t expectedProjectCount = sizeof(names) / sizeof(*names); + if (projects.size() != expectedProjectCount) + { + cmsys_ios::cerr << "cmVisualStudioSlnParser returned bad number of " + << "projects (" << projects.size() << " instead of " + << expectedProjectCount << ')' + << cmsys_ios::endl; + return 1; + } + for (size_t idx = 0; idx < expectedProjectCount; ++idx) + { + if (projects[idx].GetName() != names[idx]) + { + cmsys_ios::cerr << "cmVisualStudioSlnParser returned bad project #" + << idx << "; expected \"" << names[idx] << "\", got \"" + << projects[idx].GetName() << '"' + << cmsys_ios::endl; + return 1; + } + } + if (projects[0].GetRelativePath() != "Utilities\\3rdParty") + { + cmsys_ios::cerr << "cmVisualStudioSlnParser returned bad relative path of " + << "project 3rdParty; expected \"Utilities\\3rdParty\", " + << "got \"" << projects[0].GetRelativePath() << '"' + << cmsys_ios::endl; + return 1; + } + if (projects[2].GetGUID() != "{59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}") + { + cmsys_ios::cerr << "cmVisualStudioSlnParser returned bad relative path of " + << "project CMakeLib; expected " + << "\"{59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}\", " + << "got \"" << projects[2].GetGUID() << '"' + << cmsys_ios::endl; + return 1; + } + } + + // Test BOM parsing + { + cmSlnData data; + + if (!parsedRight(parser, "bom", data)) + { + return 1; + } + if (!parser.GetParseHadBOM()) + { + cmsys_ios::cerr << "cmVisualStudioSlnParser didn't find BOM in bom." + << SLN_EXTENSION + << cmsys_ios::endl; + return 1; + } + + if (!parsedRight(parser, "nobom", data)) + { + return 1; + } + if (parser.GetParseHadBOM()) + { + cmsys_ios::cerr << "cmVisualStudioSlnParser found BOM in nobom." + << SLN_EXTENSION + << cmsys_ios::endl; + return 1; + } + } + + // Test invalid sln + { + { + cmSlnData data; + if (!parsedRight(parser, "err-nonexistent", data, + cmVisualStudioSlnParser::ResultErrorOpeningInput)) + { + return 1; + } + } + { + cmSlnData data; + if (!parsedRight(parser, "err-empty", data, + cmVisualStudioSlnParser::ResultErrorReadingInput)) + { + return 1; + } + } + const char * const files[] = + { + "header", "projectArgs", "topLevel", "projectContents", "projectSection", + "global", "unclosed", "strayQuote", "strayParen", "strayQuote2" + }; + for (size_t idx = 0; idx < sizeof(files) / sizeof(files[0]); ++idx) + { + cmSlnData data; + if (!parsedRight(parser, std::string("err-structure-") + files[idx], data, + cmVisualStudioSlnParser::ResultErrorInputStructure)) + { + return 1; + } + } + { + cmSlnData data; + if (!parsedRight(parser, "err-data", data, + cmVisualStudioSlnParser::ResultErrorInputData)) + { + return 1; + } + } + } + + // All is well + return 0; +} diff --git a/Tests/CMakeLib/testVisualStudioSlnParser.h.in b/Tests/CMakeLib/testVisualStudioSlnParser.h.in new file mode 100644 index 0000000..62c3f4d --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser.h.in @@ -0,0 +1,7 @@ +#ifndef testVisualStudioSlnParser_h +#define testVisualStudioSlnParser_h + +#define SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@" +#define SLN_EXTENSION "sln-file" + +#endif diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/.gitattributes b/Tests/CMakeLib/testVisualStudioSlnParser_data/.gitattributes new file mode 100644 index 0000000..5be3dc5 --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/.gitattributes @@ -0,0 +1 @@ +*.sln-file -crlf whitespace=cr-at-eol diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/bom.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/bom.sln-file new file mode 100644 index 0000000..52c2483 --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/bom.sln-file @@ -0,0 +1,2 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-data.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-data.sln-file new file mode 100644 index 0000000..bd66ed4 --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-data.sln-file @@ -0,0 +1,6 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}" +EndProject diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-empty.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-empty.sln-file new file mode 100644 index 0000000..e69de29 diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-global.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-global.sln-file new file mode 100644 index 0000000..32176b8 --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-global.sln-file @@ -0,0 +1,9 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Global +EndGlobalSection diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-header.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-header.sln-file new file mode 100644 index 0000000..f838a71 --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-header.sln-file @@ -0,0 +1,4 @@ +Microsoft Visual Studio Solution2 File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}" +EndProject diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectArgs.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectArgs.sln-file new file mode 100644 index 0000000..3e8d35a --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectArgs.sln-file @@ -0,0 +1,4 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj" +EndProject diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectContents.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectContents.sln-file new file mode 100644 index 0000000..e0d58c9 --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectContents.sln-file @@ -0,0 +1,6 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}" + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous2", "Continuous2.vcxproj", "{E5071091-DBFB-49E2-AF0F-E8B0FDEF6C89}" + EndProject +EndProject diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectSection.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectSection.sln-file new file mode 100644 index 0000000..ed0aa02 --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-projectSection.sln-file @@ -0,0 +1,11 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", "ZERO_CHECK.vcxproj", "{90BC31D7-A3E8-4F04-8049-2236C239A044}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProject +EndProject diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayParen.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayParen.sln-file new file mode 100644 index 0000000..d2bb9e3 --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayParen.sln-file @@ -0,0 +1,4 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}" = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}" +EndProject diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote.sln-file new file mode 100644 index 0000000..3c1a2ec --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote.sln-file @@ -0,0 +1,4 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89} +EndProject diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote2.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote2.sln-file new file mode 100644 index 0000000..db8bbcf --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-strayQuote2.sln-file @@ -0,0 +1,4 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}) = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}" +EndProject diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-topLevel.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-topLevel.sln-file new file mode 100644 index 0000000..1727bf3 --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-topLevel.sln-file @@ -0,0 +1,4 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +GlobalSection(ExtensibilityGlobals) = postSolution +EndGlobalSection diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-unclosed.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-unclosed.sln-file new file mode 100644 index 0000000..4e6909e --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/err-structure-unclosed.sln-file @@ -0,0 +1,5 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Global + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/nobom.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/nobom.sln-file new file mode 100644 index 0000000..fc1e4e9 --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/nobom.sln-file @@ -0,0 +1,2 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 diff --git a/Tests/CMakeLib/testVisualStudioSlnParser_data/valid.sln-file b/Tests/CMakeLib/testVisualStudioSlnParser_data/valid.sln-file new file mode 100644 index 0000000..7ba28a2 --- /dev/null +++ b/Tests/CMakeLib/testVisualStudioSlnParser_data/valid.sln-file @@ -0,0 +1,680 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ALL_BUILD", "ALL_BUILD.vcxproj", "{BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}" + ProjectSection(ProjectDependencies) = postProject + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} + {B025BD09-8389-4D9F-9150-F33418A664B1} = {B025BD09-8389-4D9F-9150-F33418A664B1} + {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8} = {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8} + {1002C8FC-7242-4A69-AF51-C59BB10BA6D8} = {1002C8FC-7242-4A69-AF51-C59BB10BA6D8} + {0283B293-0067-4D02-ADA6-892704398F48} = {0283B293-0067-4D02-ADA6-892704398F48} + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B} = {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B} + {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8} = {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8} + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} + {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84} = {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84} + {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C} + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} + {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F} + {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} = {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} + {29D5FCAF-20D0-4DEF-8529-F035C249E996} = {29D5FCAF-20D0-4DEF-8529-F035C249E996} + {A0421DCA-AC3E-42D0-94AC-379A21A1E591} = {A0421DCA-AC3E-42D0-94AC-379A21A1E591} + {C6AF7E57-CE57-4462-AE1D-BF520701480E} = {C6AF7E57-CE57-4462-AE1D-BF520701480E} + {F2CAAAB3-9568-4284-B8E3-13955183A6D7} = {F2CAAAB3-9568-4284-B8E3-13955183A6D7} + {D8294E4A-03C5-43D7-AE35-15603F502DC0} = {D8294E4A-03C5-43D7-AE35-15603F502DC0} + {A4921D15-411F-436A-B6F3-F8381652A8E1} = {A4921D15-411F-436A-B6F3-F8381652A8E1} + {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} + {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C} = {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C} + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} + {0E9E295F-3854-415B-AE9F-7B62F17932F5} = {0E9E295F-3854-415B-AE9F-7B62F17932F5} + {4BFA4D7C-C6F7-4270-9E87-B922DCE05644} = {4BFA4D7C-C6F7-4270-9E87-B922DCE05644} + {F77AD922-B4BC-43D7-B268-865312085495} = {F77AD922-B4BC-43D7-B268-865312085495} + {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88} = {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88} + {1DFA0599-77CC-4768-B47A-107EEE86C20C} = {1DFA0599-77CC-4768-B47A-107EEE86C20C} + {0E45A3EF-8636-46CF-94A3-7B5CE875DE48} = {0E45A3EF-8636-46CF-94A3-7B5CE875DE48} + {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C} = {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CMakeLib", "Source\CMakeLib.vcxproj", "{59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} + {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C} + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} + {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F} + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CMakeLibTests", "Tests\CMakeLib\CMakeLibTests.vcxproj", "{B025BD09-8389-4D9F-9150-F33418A664B1}" + ProjectSection(ProjectDependencies) = postProject + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} + {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C} + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} + {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F} + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CPackLib", "Source\CPackLib.vcxproj", "{94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}" + ProjectSection(ProjectDependencies) = postProject + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} + {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C} + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} + {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F} + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CTestLib", "Source\CTestLib.vcxproj", "{1002C8FC-7242-4A69-AF51-C59BB10BA6D8}" + ProjectSection(ProjectDependencies) = postProject + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} + {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C} + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} + {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F} + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Continuous", "Continuous.vcxproj", "{E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Experimental", "Experimental.vcxproj", "{B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INSTALL", "INSTALL.vcxproj", "{3B126B2D-DEAA-4CDF-9F44-28D3600F5754}" + ProjectSection(ProjectDependencies) = postProject + {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C} = {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LIBCURL", "Utilities\cmcurl\LIBCURL.vcxproj", "{0283B293-0067-4D02-ADA6-892704398F48}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Nightly", "Nightly.vcxproj", "{7BAF09E0-DCD4-4567-9486-79E1E5F18333}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NightlyMemoryCheck", "NightlyMemoryCheck.vcxproj", "{D0413FDA-31C5-41C2-A53A-C1B87061EC96}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PACKAGE", "PACKAGE.vcxproj", "{4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}" + ProjectSection(ProjectDependencies) = postProject + {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C} = {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RUN_TESTS", "RUN_TESTS.vcxproj", "{D87B08A8-638E-43FA-96C2-404B41363D3B}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", "ZERO_CHECK.vcxproj", "{90BC31D7-A3E8-4F04-8049-2236C239A044}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmIML_test", "Utilities\KWIML\test\cmIML_test.vcxproj", "{48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmake", "Source\cmake.vcxproj", "{6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}" + ProjectSection(ProjectDependencies) = postProject + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} + {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C} + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} + {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F} + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmbzip2", "Utilities\cmbzip2\cmbzip2.vcxproj", "{1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmcldeps", "Source\cmcldeps.vcxproj", "{A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}" + ProjectSection(ProjectDependencies) = postProject + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} + {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C} + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} + {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F} + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmcompress", "Utilities\cmcompress\cmcompress.vcxproj", "{561AD1BB-6DD3-466D-B270-3696DEE8C26C}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmcurl", "Utilities\cmcurl\cmcurl.vcxproj", "{1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmexpat", "Utilities\cmexpat\cmexpat.vcxproj", "{459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmlibarchive", "Utilities\cmlibarchive\libarchive\cmlibarchive.vcxproj", "{25A91A7A-9C4E-420C-98BD-2D1F0165DA54}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsys", "Source\kwsys\cmsys.vcxproj", "{BDB424DC-15B3-4A06-A1E2-3D61380F359F}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} = {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} + {29D5FCAF-20D0-4DEF-8529-F035C249E996} = {29D5FCAF-20D0-4DEF-8529-F035C249E996} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysEncodeExecutable", "Source\kwsys\cmsysEncodeExecutable.vcxproj", "{4810B052-899E-4CA5-A0BC-2E383F8AEFAE}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysProcessFwd9x", "Source\kwsys\cmsysProcessFwd9x.vcxproj", "{29D5FCAF-20D0-4DEF-8529-F035C249E996}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestDynload", "Source\kwsys\cmsysTestDynload.vcxproj", "{A0421DCA-AC3E-42D0-94AC-379A21A1E591}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestProcess", "Source\kwsys\cmsysTestProcess.vcxproj", "{C6AF7E57-CE57-4462-AE1D-BF520701480E}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestSharedForward", "Source\kwsys\cmsysTestSharedForward.vcxproj", "{F2CAAAB3-9568-4284-B8E3-13955183A6D7}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestsC", "Source\kwsys\cmsysTestsC.vcxproj", "{D8294E4A-03C5-43D7-AE35-15603F502DC0}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsysTestsCxx", "Source\kwsys\cmsysTestsCxx.vcxproj", "{A4921D15-411F-436A-B6F3-F8381652A8E1}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmsys_c", "Source\kwsys\cmsys_c.vcxproj", "{60BEB3AF-B4EF-4363-8747-C40177BC2D9C}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} = {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} + {29D5FCAF-20D0-4DEF-8529-F035C249E996} = {29D5FCAF-20D0-4DEF-8529-F035C249E996} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmw9xcom", "Source\cmw9xcom.vcxproj", "{ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}" + ProjectSection(ProjectDependencies) = postProject + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} + {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {561AD1BB-6DD3-466D-B270-3696DEE8C26C} + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} + {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {BDB424DC-15B3-4A06-A1E2-3D61380F359F} + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmzlib", "Utilities\cmzlib\cmzlib.vcxproj", "{0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpack", "Source\cpack.vcxproj", "{0E9E295F-3854-415B-AE9F-7B62F17932F5}" + ProjectSection(ProjectDependencies) = postProject + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} + {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8} = {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8} + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ctest", "Source\ctest.vcxproj", "{4BFA4D7C-C6F7-4270-9E87-B922DCE05644}" + ProjectSection(ProjectDependencies) = postProject + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} = {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2} + {1002C8FC-7242-4A69-AF51-C59BB10BA6D8} = {1002C8FC-7242-4A69-AF51-C59BB10BA6D8} + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "documentation", "Utilities\documentation.vcxproj", "{F77AD922-B4BC-43D7-B268-865312085495}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8} = {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8} + {0E9E295F-3854-415B-AE9F-7B62F17932F5} = {0E9E295F-3854-415B-AE9F-7B62F17932F5} + {4BFA4D7C-C6F7-4270-9E87-B922DCE05644} = {4BFA4D7C-C6F7-4270-9E87-B922DCE05644} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "memcheck_fail", "Tests\CTestTestMemcheck\memcheck_fail.vcxproj", "{8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pseudo_BC", "Tests\CTestTestMemcheck\pseudo_BC.vcxproj", "{1DFA0599-77CC-4768-B47A-107EEE86C20C}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pseudo_purify", "Tests\CTestTestMemcheck\pseudo_purify.vcxproj", "{0E45A3EF-8636-46CF-94A3-7B5CE875DE48}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pseudo_valgrind", "Tests\CTestTestMemcheck\pseudo_valgrind.vcxproj", "{CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_clean", "Tests\test_clean.vcxproj", "{02D16A66-6D59-4A0E-ABB3-BD12926934FE}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uninstall", "uninstall.vcxproj", "{B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}" + ProjectSection(ProjectDependencies) = postProject + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {90BC31D7-A3E8-4F04-8049-2236C239A044} + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CMakePredefinedTargets", "CMakePredefinedTargets", "{31CE49D7-85CA-41E2-83D2-CC6962519DB6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CTestDashboardTargets", "CTestDashboardTargets", "{BD073C58-BAED-420E-80EA-DC9F52E21AF7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{8ECAB3CD-B434-426B-B63A-115919D393BC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{964DC7DE-990A-4CA4-8395-10D9F9CB2A23}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utilities", "Utilities", "{7E002D15-21D1-4927-B486-82E496444441}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rdParty", "Utilities\3rdParty", "{0984A63C-130E-4B62-9A94-AAC28A88C137}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KWSys", "Utilities\KWSys", "{EF1DFA45-6F7A-4760-8EB5-69A8A221FC54}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Win9xCompat", "Utilities\Win9xCompat", "{2485E202-B981-41E0-98CA-CF363437A4E4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + MinSizeRel|x64 = MinSizeRel|x64 + RelWithDebInfo|x64 = RelWithDebInfo|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.Debug|x64.ActiveCfg = Debug|x64 + {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.Debug|x64.Build.0 = Debug|x64 + {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.Release|x64.ActiveCfg = Release|x64 + {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.Release|x64.Build.0 = Release|x64 + {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {BC04E6F9-A1E4-43BA-88B3-6FBF45FA561C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.Debug|x64.ActiveCfg = Debug|x64 + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.Debug|x64.Build.0 = Debug|x64 + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.Release|x64.ActiveCfg = Release|x64 + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.Release|x64.Build.0 = Release|x64 + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {B025BD09-8389-4D9F-9150-F33418A664B1}.Debug|x64.ActiveCfg = Debug|x64 + {B025BD09-8389-4D9F-9150-F33418A664B1}.Debug|x64.Build.0 = Debug|x64 + {B025BD09-8389-4D9F-9150-F33418A664B1}.Release|x64.ActiveCfg = Release|x64 + {B025BD09-8389-4D9F-9150-F33418A664B1}.Release|x64.Build.0 = Release|x64 + {B025BD09-8389-4D9F-9150-F33418A664B1}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {B025BD09-8389-4D9F-9150-F33418A664B1}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {B025BD09-8389-4D9F-9150-F33418A664B1}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {B025BD09-8389-4D9F-9150-F33418A664B1}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.Debug|x64.ActiveCfg = Debug|x64 + {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.Debug|x64.Build.0 = Debug|x64 + {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.Release|x64.ActiveCfg = Release|x64 + {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.Release|x64.Build.0 = Release|x64 + {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {94EAABE8-174B-4EE9-8EDF-C5FED49A31B8}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.Debug|x64.ActiveCfg = Debug|x64 + {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.Debug|x64.Build.0 = Debug|x64 + {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.Release|x64.ActiveCfg = Release|x64 + {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.Release|x64.Build.0 = Release|x64 + {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {1002C8FC-7242-4A69-AF51-C59BB10BA6D8}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}.Debug|x64.ActiveCfg = Debug|x64 + {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}.Release|x64.ActiveCfg = Release|x64 + {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}.Debug|x64.ActiveCfg = Debug|x64 + {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}.Release|x64.ActiveCfg = Release|x64 + {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {3B126B2D-DEAA-4CDF-9F44-28D3600F5754}.Debug|x64.ActiveCfg = Debug|x64 + {3B126B2D-DEAA-4CDF-9F44-28D3600F5754}.Release|x64.ActiveCfg = Release|x64 + {3B126B2D-DEAA-4CDF-9F44-28D3600F5754}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {3B126B2D-DEAA-4CDF-9F44-28D3600F5754}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {0283B293-0067-4D02-ADA6-892704398F48}.Debug|x64.ActiveCfg = Debug|x64 + {0283B293-0067-4D02-ADA6-892704398F48}.Debug|x64.Build.0 = Debug|x64 + {0283B293-0067-4D02-ADA6-892704398F48}.Release|x64.ActiveCfg = Release|x64 + {0283B293-0067-4D02-ADA6-892704398F48}.Release|x64.Build.0 = Release|x64 + {0283B293-0067-4D02-ADA6-892704398F48}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {0283B293-0067-4D02-ADA6-892704398F48}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {0283B293-0067-4D02-ADA6-892704398F48}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {0283B293-0067-4D02-ADA6-892704398F48}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {7BAF09E0-DCD4-4567-9486-79E1E5F18333}.Debug|x64.ActiveCfg = Debug|x64 + {7BAF09E0-DCD4-4567-9486-79E1E5F18333}.Release|x64.ActiveCfg = Release|x64 + {7BAF09E0-DCD4-4567-9486-79E1E5F18333}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {7BAF09E0-DCD4-4567-9486-79E1E5F18333}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {D0413FDA-31C5-41C2-A53A-C1B87061EC96}.Debug|x64.ActiveCfg = Debug|x64 + {D0413FDA-31C5-41C2-A53A-C1B87061EC96}.Release|x64.ActiveCfg = Release|x64 + {D0413FDA-31C5-41C2-A53A-C1B87061EC96}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {D0413FDA-31C5-41C2-A53A-C1B87061EC96}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}.Debug|x64.ActiveCfg = Debug|x64 + {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}.Release|x64.ActiveCfg = Release|x64 + {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {D87B08A8-638E-43FA-96C2-404B41363D3B}.Debug|x64.ActiveCfg = Debug|x64 + {D87B08A8-638E-43FA-96C2-404B41363D3B}.Release|x64.ActiveCfg = Release|x64 + {D87B08A8-638E-43FA-96C2-404B41363D3B}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {D87B08A8-638E-43FA-96C2-404B41363D3B}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {90BC31D7-A3E8-4F04-8049-2236C239A044}.Debug|x64.ActiveCfg = Debug|x64 + {90BC31D7-A3E8-4F04-8049-2236C239A044}.Debug|x64.Build.0 = Debug|x64 + {90BC31D7-A3E8-4F04-8049-2236C239A044}.Release|x64.ActiveCfg = Release|x64 + {90BC31D7-A3E8-4F04-8049-2236C239A044}.Release|x64.Build.0 = Release|x64 + {90BC31D7-A3E8-4F04-8049-2236C239A044}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {90BC31D7-A3E8-4F04-8049-2236C239A044}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {90BC31D7-A3E8-4F04-8049-2236C239A044}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {90BC31D7-A3E8-4F04-8049-2236C239A044}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.Debug|x64.ActiveCfg = Debug|x64 + {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.Debug|x64.Build.0 = Debug|x64 + {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.Release|x64.ActiveCfg = Release|x64 + {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.Release|x64.Build.0 = Release|x64 + {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {48D43A03-3C1B-439A-9517-8F2A2B4CEC3B}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.Debug|x64.ActiveCfg = Debug|x64 + {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.Debug|x64.Build.0 = Debug|x64 + {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.Release|x64.ActiveCfg = Release|x64 + {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.Release|x64.Build.0 = Release|x64 + {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {6ADE54B3-3FDA-4E76-9B87-66D95E5265A8}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.Debug|x64.ActiveCfg = Debug|x64 + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.Debug|x64.Build.0 = Debug|x64 + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.Release|x64.ActiveCfg = Release|x64 + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.Release|x64.Build.0 = Release|x64 + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.Debug|x64.ActiveCfg = Debug|x64 + {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.Debug|x64.Build.0 = Debug|x64 + {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.Release|x64.ActiveCfg = Release|x64 + {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.Release|x64.Build.0 = Release|x64 + {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {A51EB64E-E1EA-4B4A-8FDC-56ADFE635E84}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.Debug|x64.ActiveCfg = Debug|x64 + {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.Debug|x64.Build.0 = Debug|x64 + {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.Release|x64.ActiveCfg = Release|x64 + {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.Release|x64.Build.0 = Release|x64 + {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {561AD1BB-6DD3-466D-B270-3696DEE8C26C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.Debug|x64.ActiveCfg = Debug|x64 + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.Debug|x64.Build.0 = Debug|x64 + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.Release|x64.ActiveCfg = Release|x64 + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.Release|x64.Build.0 = Release|x64 + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.Debug|x64.ActiveCfg = Debug|x64 + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.Debug|x64.Build.0 = Debug|x64 + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.Release|x64.ActiveCfg = Release|x64 + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.Release|x64.Build.0 = Release|x64 + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.Debug|x64.ActiveCfg = Debug|x64 + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.Debug|x64.Build.0 = Debug|x64 + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.Release|x64.ActiveCfg = Release|x64 + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.Release|x64.Build.0 = Release|x64 + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.Debug|x64.ActiveCfg = Debug|x64 + {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.Debug|x64.Build.0 = Debug|x64 + {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.Release|x64.ActiveCfg = Release|x64 + {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.Release|x64.Build.0 = Release|x64 + {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {BDB424DC-15B3-4A06-A1E2-3D61380F359F}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.Debug|x64.ActiveCfg = Debug|x64 + {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.Debug|x64.Build.0 = Debug|x64 + {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.Release|x64.ActiveCfg = Release|x64 + {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.Release|x64.Build.0 = Release|x64 + {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {4810B052-899E-4CA5-A0BC-2E383F8AEFAE}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {29D5FCAF-20D0-4DEF-8529-F035C249E996}.Debug|x64.ActiveCfg = Debug|x64 + {29D5FCAF-20D0-4DEF-8529-F035C249E996}.Debug|x64.Build.0 = Debug|x64 + {29D5FCAF-20D0-4DEF-8529-F035C249E996}.Release|x64.ActiveCfg = Release|x64 + {29D5FCAF-20D0-4DEF-8529-F035C249E996}.Release|x64.Build.0 = Release|x64 + {29D5FCAF-20D0-4DEF-8529-F035C249E996}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {29D5FCAF-20D0-4DEF-8529-F035C249E996}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {29D5FCAF-20D0-4DEF-8529-F035C249E996}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {29D5FCAF-20D0-4DEF-8529-F035C249E996}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.Debug|x64.ActiveCfg = Debug|x64 + {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.Debug|x64.Build.0 = Debug|x64 + {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.Release|x64.ActiveCfg = Release|x64 + {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.Release|x64.Build.0 = Release|x64 + {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {A0421DCA-AC3E-42D0-94AC-379A21A1E591}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {C6AF7E57-CE57-4462-AE1D-BF520701480E}.Debug|x64.ActiveCfg = Debug|x64 + {C6AF7E57-CE57-4462-AE1D-BF520701480E}.Debug|x64.Build.0 = Debug|x64 + {C6AF7E57-CE57-4462-AE1D-BF520701480E}.Release|x64.ActiveCfg = Release|x64 + {C6AF7E57-CE57-4462-AE1D-BF520701480E}.Release|x64.Build.0 = Release|x64 + {C6AF7E57-CE57-4462-AE1D-BF520701480E}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {C6AF7E57-CE57-4462-AE1D-BF520701480E}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {C6AF7E57-CE57-4462-AE1D-BF520701480E}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {C6AF7E57-CE57-4462-AE1D-BF520701480E}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.Debug|x64.ActiveCfg = Debug|x64 + {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.Debug|x64.Build.0 = Debug|x64 + {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.Release|x64.ActiveCfg = Release|x64 + {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.Release|x64.Build.0 = Release|x64 + {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {F2CAAAB3-9568-4284-B8E3-13955183A6D7}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {D8294E4A-03C5-43D7-AE35-15603F502DC0}.Debug|x64.ActiveCfg = Debug|x64 + {D8294E4A-03C5-43D7-AE35-15603F502DC0}.Debug|x64.Build.0 = Debug|x64 + {D8294E4A-03C5-43D7-AE35-15603F502DC0}.Release|x64.ActiveCfg = Release|x64 + {D8294E4A-03C5-43D7-AE35-15603F502DC0}.Release|x64.Build.0 = Release|x64 + {D8294E4A-03C5-43D7-AE35-15603F502DC0}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {D8294E4A-03C5-43D7-AE35-15603F502DC0}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {D8294E4A-03C5-43D7-AE35-15603F502DC0}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {D8294E4A-03C5-43D7-AE35-15603F502DC0}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {A4921D15-411F-436A-B6F3-F8381652A8E1}.Debug|x64.ActiveCfg = Debug|x64 + {A4921D15-411F-436A-B6F3-F8381652A8E1}.Debug|x64.Build.0 = Debug|x64 + {A4921D15-411F-436A-B6F3-F8381652A8E1}.Release|x64.ActiveCfg = Release|x64 + {A4921D15-411F-436A-B6F3-F8381652A8E1}.Release|x64.Build.0 = Release|x64 + {A4921D15-411F-436A-B6F3-F8381652A8E1}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {A4921D15-411F-436A-B6F3-F8381652A8E1}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {A4921D15-411F-436A-B6F3-F8381652A8E1}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {A4921D15-411F-436A-B6F3-F8381652A8E1}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.Debug|x64.ActiveCfg = Debug|x64 + {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.Debug|x64.Build.0 = Debug|x64 + {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.Release|x64.ActiveCfg = Release|x64 + {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.Release|x64.Build.0 = Release|x64 + {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {60BEB3AF-B4EF-4363-8747-C40177BC2D9C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.Debug|x64.ActiveCfg = Debug|x64 + {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.Debug|x64.Build.0 = Debug|x64 + {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.Release|x64.ActiveCfg = Release|x64 + {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.Release|x64.Build.0 = Release|x64 + {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.Debug|x64.ActiveCfg = Debug|x64 + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.Debug|x64.Build.0 = Debug|x64 + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.Release|x64.ActiveCfg = Release|x64 + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.Release|x64.Build.0 = Release|x64 + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {0E9E295F-3854-415B-AE9F-7B62F17932F5}.Debug|x64.ActiveCfg = Debug|x64 + {0E9E295F-3854-415B-AE9F-7B62F17932F5}.Debug|x64.Build.0 = Debug|x64 + {0E9E295F-3854-415B-AE9F-7B62F17932F5}.Release|x64.ActiveCfg = Release|x64 + {0E9E295F-3854-415B-AE9F-7B62F17932F5}.Release|x64.Build.0 = Release|x64 + {0E9E295F-3854-415B-AE9F-7B62F17932F5}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {0E9E295F-3854-415B-AE9F-7B62F17932F5}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {0E9E295F-3854-415B-AE9F-7B62F17932F5}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {0E9E295F-3854-415B-AE9F-7B62F17932F5}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.Debug|x64.ActiveCfg = Debug|x64 + {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.Debug|x64.Build.0 = Debug|x64 + {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.Release|x64.ActiveCfg = Release|x64 + {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.Release|x64.Build.0 = Release|x64 + {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {4BFA4D7C-C6F7-4270-9E87-B922DCE05644}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {F77AD922-B4BC-43D7-B268-865312085495}.Debug|x64.ActiveCfg = Debug|x64 + {F77AD922-B4BC-43D7-B268-865312085495}.Debug|x64.Build.0 = Debug|x64 + {F77AD922-B4BC-43D7-B268-865312085495}.Release|x64.ActiveCfg = Release|x64 + {F77AD922-B4BC-43D7-B268-865312085495}.Release|x64.Build.0 = Release|x64 + {F77AD922-B4BC-43D7-B268-865312085495}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {F77AD922-B4BC-43D7-B268-865312085495}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {F77AD922-B4BC-43D7-B268-865312085495}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {F77AD922-B4BC-43D7-B268-865312085495}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.Debug|x64.ActiveCfg = Debug|x64 + {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.Debug|x64.Build.0 = Debug|x64 + {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.Release|x64.ActiveCfg = Release|x64 + {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.Release|x64.Build.0 = Release|x64 + {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {8DF3790D-AF1B-4505-BA5B-4D61EF9FBE88}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {1DFA0599-77CC-4768-B47A-107EEE86C20C}.Debug|x64.ActiveCfg = Debug|x64 + {1DFA0599-77CC-4768-B47A-107EEE86C20C}.Debug|x64.Build.0 = Debug|x64 + {1DFA0599-77CC-4768-B47A-107EEE86C20C}.Release|x64.ActiveCfg = Release|x64 + {1DFA0599-77CC-4768-B47A-107EEE86C20C}.Release|x64.Build.0 = Release|x64 + {1DFA0599-77CC-4768-B47A-107EEE86C20C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {1DFA0599-77CC-4768-B47A-107EEE86C20C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {1DFA0599-77CC-4768-B47A-107EEE86C20C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {1DFA0599-77CC-4768-B47A-107EEE86C20C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.Debug|x64.ActiveCfg = Debug|x64 + {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.Debug|x64.Build.0 = Debug|x64 + {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.Release|x64.ActiveCfg = Release|x64 + {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.Release|x64.Build.0 = Release|x64 + {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {0E45A3EF-8636-46CF-94A3-7B5CE875DE48}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.Debug|x64.ActiveCfg = Debug|x64 + {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.Debug|x64.Build.0 = Debug|x64 + {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.Release|x64.ActiveCfg = Release|x64 + {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.Release|x64.Build.0 = Release|x64 + {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {CAEF2D10-B14D-4E0C-8B79-8AC767B12F7C}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {02D16A66-6D59-4A0E-ABB3-BD12926934FE}.Debug|x64.ActiveCfg = Debug|x64 + {02D16A66-6D59-4A0E-ABB3-BD12926934FE}.Release|x64.ActiveCfg = Release|x64 + {02D16A66-6D59-4A0E-ABB3-BD12926934FE}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {02D16A66-6D59-4A0E-ABB3-BD12926934FE}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}.Debug|x64.ActiveCfg = Debug|x64 + {B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}.Release|x64.ActiveCfg = Release|x64 + {B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {B5A9B8B7-53AC-46D7-9ADE-76F708A7189C}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {3B126B2D-DEAA-4CDF-9F44-28D3600F5754} = {31CE49D7-85CA-41E2-83D2-CC6962519DB6} + {4C488FF0-7C06-47FE-A8FD-67DAD51A3E85} = {31CE49D7-85CA-41E2-83D2-CC6962519DB6} + {D87B08A8-638E-43FA-96C2-404B41363D3B} = {31CE49D7-85CA-41E2-83D2-CC6962519DB6} + {90BC31D7-A3E8-4F04-8049-2236C239A044} = {31CE49D7-85CA-41E2-83D2-CC6962519DB6} + {E5071092-DBFB-49E2-AF0F-E8B0FDEF6C89} = {BD073C58-BAED-420E-80EA-DC9F52E21AF7} + {B28E8445-DFD2-46EA-BA6C-C2A1864F2FB1} = {BD073C58-BAED-420E-80EA-DC9F52E21AF7} + {7BAF09E0-DCD4-4567-9486-79E1E5F18333} = {BD073C58-BAED-420E-80EA-DC9F52E21AF7} + {D0413FDA-31C5-41C2-A53A-C1B87061EC96} = {BD073C58-BAED-420E-80EA-DC9F52E21AF7} + {F77AD922-B4BC-43D7-B268-865312085495} = {8ECAB3CD-B434-426B-B63A-115919D393BC} + {B025BD09-8389-4D9F-9150-F33418A664B1} = {964DC7DE-990A-4CA4-8395-10D9F9CB2A23} + {0984A63C-130E-4B62-9A94-AAC28A88C137} = {7E002D15-21D1-4927-B486-82E496444441} + {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54} = {7E002D15-21D1-4927-B486-82E496444441} + {2485E202-B981-41E0-98CA-CF363437A4E4} = {7E002D15-21D1-4927-B486-82E496444441} + {0283B293-0067-4D02-ADA6-892704398F48} = {0984A63C-130E-4B62-9A94-AAC28A88C137} + {1C5345F9-9C47-4F4B-9760-7A74C9D35DE0} = {0984A63C-130E-4B62-9A94-AAC28A88C137} + {561AD1BB-6DD3-466D-B270-3696DEE8C26C} = {0984A63C-130E-4B62-9A94-AAC28A88C137} + {1342243A-C3D9-45A0-B4BC-65A8F16BCC9D} = {0984A63C-130E-4B62-9A94-AAC28A88C137} + {459BD82A-588C-4BFD-B3E6-1E4E3BC1B1E3} = {0984A63C-130E-4B62-9A94-AAC28A88C137} + {25A91A7A-9C4E-420C-98BD-2D1F0165DA54} = {0984A63C-130E-4B62-9A94-AAC28A88C137} + {0B7FB622-7A90-490C-B4E4-2DE3112BB5E0} = {0984A63C-130E-4B62-9A94-AAC28A88C137} + {BDB424DC-15B3-4A06-A1E2-3D61380F359F} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54} + {4810B052-899E-4CA5-A0BC-2E383F8AEFAE} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54} + {29D5FCAF-20D0-4DEF-8529-F035C249E996} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54} + {A0421DCA-AC3E-42D0-94AC-379A21A1E591} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54} + {C6AF7E57-CE57-4462-AE1D-BF520701480E} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54} + {F2CAAAB3-9568-4284-B8E3-13955183A6D7} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54} + {D8294E4A-03C5-43D7-AE35-15603F502DC0} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54} + {A4921D15-411F-436A-B6F3-F8381652A8E1} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54} + {60BEB3AF-B4EF-4363-8747-C40177BC2D9C} = {EF1DFA45-6F7A-4760-8EB5-69A8A221FC54} + {ACC30B92-8B65-4A9D-9BF2-6BBD0B008C8C} = {2485E202-B981-41E0-98CA-CF363437A4E4} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal -- cgit v0.12 From 3cd400060162a0069d5798ce8dc33f0507594938 Mon Sep 17 00:00:00 2001 From: Petr Kmoch Date: Thu, 21 Mar 2013 15:53:26 +0100 Subject: VS: Use .sln parser to build targets in subdirs with msbuild (#13623) Use cmVisualStudioSlnParser in GenerateBuildCommand() to provide correct command line for MSBuild even when target project is stored in a subdirectory. --- Source/cmGlobalVisualStudio10Generator.cxx | 35 ++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 2d0880f..742ab78 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -14,6 +14,8 @@ #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" #include "cmSourceFile.h" +#include "cmVisualStudioSlnData.h" +#include "cmVisualStudioSlnParser.h" #include "cmake.h" static const char vs10Win32generatorName[] = "Visual Studio 10"; @@ -259,9 +261,38 @@ std::string cmGlobalVisualStudio10Generator } else { + std::string targetProject(targetName); + targetProject += ".vcxproj"; + if (targetProject.find('/') == std::string::npos) + { + // it might be in a subdir + cmVisualStudioSlnParser parser; + cmSlnData slnData; + std::string slnFile; + if (projectDir && *projectDir) + { + slnFile = projectDir; + slnFile += '/'; + slnFile += projectName; + } + else + { + slnFile = projectName; + } + if (parser.ParseFile(slnFile + ".sln", slnData, + cmVisualStudioSlnParser::DataGroupProjects)) + { + if (cmSlnProjectEntry const* proj = + slnData.GetProjectByName(targetName)) + { + targetProject = proj->GetRelativePath(); + cmSystemTools::ConvertToUnixSlashes(targetProject); + } + } + } + makeCommand += " "; + makeCommand += targetProject; makeCommand += " "; - makeCommand += targetName; - makeCommand += ".vcxproj "; } makeCommand += "/p:Configuration="; if(config && strlen(config)) -- cgit v0.12 From 1ca93182ad37f6f90ceb0b2a5faaa21ef58ba7e2 Mon Sep 17 00:00:00 2001 From: Petr Kmoch Date: Thu, 3 Jan 2013 13:43:42 +0100 Subject: VS: Add test for building MSBuild project in subdir Add test covering cmGlobalGenerator::GenerateBuildCommand for VS solutions with MSBuild and building a target defined in a subdirectory and not part of ALL. --- Tests/CMakeLists.txt | 23 +++++++++++++++++++++++ Tests/VSProjectInSubdir/CMakeLists.txt | 3 +++ Tests/VSProjectInSubdir/subdir/CMakeLists.txt | 1 + 3 files changed, 27 insertions(+) create mode 100644 Tests/VSProjectInSubdir/CMakeLists.txt create mode 100644 Tests/VSProjectInSubdir/subdir/CMakeLists.txt diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index e07bb69..4eb2f90 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1495,6 +1495,29 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ unset(_last_test) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExcludeFromDefaultBuild") endif() + + if(CMAKE_TEST_GENERATOR MATCHES "Visual Studio ([0-5]|[6-9][0-9])") + if(CMAKE_TEST_MAKEPROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]") + set(MSBUILD_EXECUTABLE "${CMAKE_TEST_MAKEPROGRAM}") + else() + set(_FDIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkDir32]") + set(_FVER "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkVer32]") + find_program(MSBUILD_EXECUTABLE NAMES msbuild HINTS ${_FDIR}/${_FVER}) + endif() + if(MSBUILD_EXECUTABLE) + add_test(NAME VSProjectInSubdir COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/VSProjectInSubdir" + "${CMake_BINARY_DIR}/Tests/VSProjectInSubdir" + --build-two-config + --build-generator ${CMAKE_TEST_GENERATOR} + --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}" + --build-makeprogram "${MSBUILD_EXECUTABLE}" + --build-project VSProjectInSubdir + --build-target test) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSProjectInSubdir") + endif() + endif() endif() if (APPLE) diff --git a/Tests/VSProjectInSubdir/CMakeLists.txt b/Tests/VSProjectInSubdir/CMakeLists.txt new file mode 100644 index 0000000..c164a97 --- /dev/null +++ b/Tests/VSProjectInSubdir/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.10) +project(VSProjectInSubdir NONE) +add_subdirectory(subdir) diff --git a/Tests/VSProjectInSubdir/subdir/CMakeLists.txt b/Tests/VSProjectInSubdir/subdir/CMakeLists.txt new file mode 100644 index 0000000..6c1b6a1 --- /dev/null +++ b/Tests/VSProjectInSubdir/subdir/CMakeLists.txt @@ -0,0 +1 @@ +add_custom_target(test COMMAND ${CMAKE_COMMAND} -E echo test VERBATIM) -- cgit v0.12 From a6c0299c407bc4482140637c0460f71238b4f9d0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 28 Mar 2013 10:05:42 -0400 Subject: CTest: Simplify ctest_* command source/build dir lookup In cmCTestHandlerCommand::InitialPass call InitializeHandler after setting the CTest "SourceDirectory" and "BuildDirectory" configuration values instead of before. This makes the values available to InitializeHandler methods in subclasses, so also drop the duplicate configuration of those values from cmCTestConfigureCommand::InitializeHandler. --- Source/CTest/cmCTestConfigureCommand.cxx | 26 -------------------------- Source/CTest/cmCTestHandlerCommand.cxx | 27 ++++++++++++++------------- 2 files changed, 14 insertions(+), 39 deletions(-) diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx index d6d39a9..db33cb6 100644 --- a/Source/CTest/cmCTestConfigureCommand.cxx +++ b/Source/CTest/cmCTestConfigureCommand.cxx @@ -31,32 +31,6 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() cmSystemTools::ExpandListArgument(this->Values[ctc_OPTIONS], options); } - if ( this->Values[ct_BUILD] ) - { - this->CTest->SetCTestConfiguration("BuildDirectory", - cmSystemTools::CollapseFullPath( - this->Values[ct_BUILD]).c_str()); - } - else - { - this->CTest->SetCTestConfiguration("BuildDirectory", - cmSystemTools::CollapseFullPath( - this->Makefile->GetSafeDefinition("CTEST_BINARY_DIRECTORY")).c_str()); - } - - if ( this->Values[ct_SOURCE] ) - { - this->CTest->SetCTestConfiguration("SourceDirectory", - cmSystemTools::CollapseFullPath( - this->Values[ct_SOURCE]).c_str()); - } - else - { - this->CTest->SetCTestConfiguration("SourceDirectory", - cmSystemTools::CollapseFullPath( - this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY")).c_str()); - } - if ( this->CTest->GetCTestConfiguration("BuildDirectory").empty() ) { this->SetError("Build directory not specified. Either use BUILD " diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index 453e32c..2e2feb0 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -70,19 +70,6 @@ bool cmCTestHandlerCommand this->CTest->SetConfigType(ctestConfigType); } - cmCTestLog(this->CTest, DEBUG, "Initialize handler" << std::endl;); - cmCTestGenericHandler* handler = this->InitializeHandler(); - if ( !handler ) - { - cmCTestLog(this->CTest, ERROR_MESSAGE, - "Cannot instantiate test handler " << this->GetName() - << std::endl); - return false; - } - - handler->SetAppendXML(this->AppendXML); - - handler->PopulateCustomVectors(this->Makefile); if ( this->Values[ct_BUILD] ) { this->CTest->SetCTestConfiguration("BuildDirectory", @@ -119,6 +106,20 @@ bool cmCTestHandlerCommand cmSystemTools::CollapseFullPath( this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY")).c_str()); } + + cmCTestLog(this->CTest, DEBUG, "Initialize handler" << std::endl;); + cmCTestGenericHandler* handler = this->InitializeHandler(); + if ( !handler ) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Cannot instantiate test handler " << this->GetName() + << std::endl); + return false; + } + + handler->SetAppendXML(this->AppendXML); + + handler->PopulateCustomVectors(this->Makefile); if ( this->Values[ct_SUBMIT_INDEX] ) { if(!this->CTest->GetDropSiteCDash() && this->CTest->GetDartVersion() <= 1) -- cgit v0.12 From ac9a5f4d943685f0b49b1a9d03f4e23238df0867 Mon Sep 17 00:00:00 2001 From: Petr Kmoch Date: Thu, 28 Mar 2013 10:10:13 -0400 Subject: ctest_build: Pass projectDir to GenerateBuildCommand This allows the ctest_build command's TARGET option to name a target in a subdirectory and still build properly with msbuild. Add test case covering use of ctest_build() with such a TARGET. --- Source/CTest/cmCTestBuildCommand.cxx | 3 ++- Tests/CMakeLists.txt | 14 ++++++++++++++ .../CTestBuildCommandProjectInSubdir.cmake.in | 12 ++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index 5cb2a37..1f63185 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -130,10 +130,11 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() cmakeBuildConfiguration = config; } + std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory"); std::string buildCommand = this->GlobalGenerator-> GenerateBuildCommand(cmakeMakeProgram, - cmakeProjectName, 0, + cmakeProjectName, dir.c_str(), cmakeBuildAdditionalFlags, cmakeBuildTarget, cmakeBuildConfiguration, true, false); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 4eb2f90..ad81fd6 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1660,6 +1660,20 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # -S "${CMake_BINARY_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake" # ) + # A test for ctest_build() with targets in subdirectories + if(CMAKE_TEST_GENERATOR_TOOLSET) + set(CMAKE_TEST_GENERATOR_TOOLSET_SELECTION "-T;${CMAKE_TEST_GENERATOR_TOOLSET};") + else() + set(CMAKE_TEST_GENERATOR_TOOLSET_SELECTION) + endif() + configure_file("${CMake_SOURCE_DIR}/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake" @ONLY) + unset(CMAKE_TEST_GENERATOR_TOOLSET_SELECTION) + add_test(CTest.BuildCommand.ProjectInSubdir + ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake" + -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_TEST_MAKEPROGRAM}) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CTestBuildCommandProjectInSubdir/Nested") + set(CTEST_TEST_UPDATE 1) if(CTEST_TEST_UPDATE) # Test CTest Update with Subversion diff --git a/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in b/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in new file mode 100644 index 0000000..ea48c78 --- /dev/null +++ b/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 2.8.10) + +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/VSProjectInSubdir") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestBuildCommandProjectInSubdir/Nested") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_PROJECT_NAME "VSProjectInSubdir") +set(CTEST_BUILD_CONFIGURATION "@CTestTest_CONFIG@") + +ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) +ctest_start(Experimental) +ctest_configure(OPTIONS "@CMAKE_TEST_GENERATOR_TOOLSET_SELECTION@-DCMAKE_MAKE_PROGRAM:FILEPATH=@CMAKE_TEST_MAKEPROGRAM@") +ctest_build(TARGET test) -- cgit v0.12 From 8e0da4cddc1d96012007e1e0215ffda841e03c6b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 14 Apr 2013 01:00:19 +0200 Subject: Fix some copyastos in the DetermineRCCompiler file. --- Modules/CMakeDetermineRCCompiler.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/CMakeDetermineRCCompiler.cmake b/Modules/CMakeDetermineRCCompiler.cmake index fa78da0..c4600c7 100644 --- a/Modules/CMakeDetermineRCCompiler.cmake +++ b/Modules/CMakeDetermineRCCompiler.cmake @@ -12,14 +12,14 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -# determine the compiler to use for C programs -# NOTE, a generator may set CMAKE_C_COMPILER before +# determine the compiler to use for RC programs +# NOTE, a generator may set CMAKE_RC_COMPILER before # loading this file to force a compiler. -# use environment variable CCC first if defined by user, next use -# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator +# use environment variable RC first if defined by user, next use +# the cmake variable CMAKE_GENERATOR_RC which can be defined by a generator # as a default compiler if(NOT CMAKE_RC_COMPILER) - # prefer the environment variable CC + # prefer the environment variable RC if($ENV{RC} MATCHES ".+") get_filename_component(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT) if(CMAKE_RC_FLAGS_ENV_INIT) -- cgit v0.12 From efb19b6d45a69ff4c1fac40486a32c4bba5b8739 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Wed, 10 Apr 2013 21:18:38 +0200 Subject: CMakeSystem: include toolchain file after setting CMAKE_HOST_ (#13796) Make the CMAKE_HOST_* variables always available in the toolchain file. They are when the file is included in CMakeDetermineSystem.cmake, and now also here. For the non-cross-compiling case this does not change anything at all. Alex --- Modules/CMakeSystem.cmake.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/CMakeSystem.cmake.in b/Modules/CMakeSystem.cmake.in index 7e2a358..70c98d5 100644 --- a/Modules/CMakeSystem.cmake.in +++ b/Modules/CMakeSystem.cmake.in @@ -1,3 +1,8 @@ +set(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@") +set(CMAKE_HOST_SYSTEM_NAME "@CMAKE_HOST_SYSTEM_NAME@") +set(CMAKE_HOST_SYSTEM_VERSION "@CMAKE_HOST_SYSTEM_VERSION@") +set(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@") + @INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED@ set(CMAKE_SYSTEM "@CMAKE_SYSTEM@") @@ -5,11 +10,6 @@ set(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@") set(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@") set(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@") -set(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@") -set(CMAKE_HOST_SYSTEM_NAME "@CMAKE_HOST_SYSTEM_NAME@") -set(CMAKE_HOST_SYSTEM_VERSION "@CMAKE_HOST_SYSTEM_VERSION@") -set(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@") - set(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@") set(CMAKE_SYSTEM_LOADED 1) -- cgit v0.12 From 22fb73a0d6e27f0ecaf4e10705de204742427b31 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Wed, 4 Jan 2012 21:29:11 +0100 Subject: Add support files for C, C++ and ASM for the IAR toolchain. The original feature request is at http://www.cmake.org/Bug/view.php?id=10176 Documentation can be found at http://www.iar.com/website1/1.0.1.0/675/1/ Alex --- Modules/Compiler/IAR-ASM.cmake | 14 +++++++++++++ Modules/Compiler/IAR-C.cmake | 34 +++++++++++++++++++++++++++++++ Modules/Compiler/IAR-CXX.cmake | 34 +++++++++++++++++++++++++++++++ Modules/Compiler/IAR.cmake | 46 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 128 insertions(+) create mode 100644 Modules/Compiler/IAR-ASM.cmake create mode 100644 Modules/Compiler/IAR-C.cmake create mode 100644 Modules/Compiler/IAR-CXX.cmake create mode 100644 Modules/Compiler/IAR.cmake diff --git a/Modules/Compiler/IAR-ASM.cmake b/Modules/Compiler/IAR-ASM.cmake new file mode 100644 index 0000000..66fb052 --- /dev/null +++ b/Modules/Compiler/IAR-ASM.cmake @@ -0,0 +1,14 @@ +# This file is processed when the IAR compiler is used for an assembler file + +include(Compiler/IAR) + +set(CMAKE_ASM_COMPILE_OBJECT " -o ") + +if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM") + set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa) +endif() + + +if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR") + set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s90;asm;msa) +endif() diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake new file mode 100644 index 0000000..da29447 --- /dev/null +++ b/Modules/Compiler/IAR-C.cmake @@ -0,0 +1,34 @@ +# This file is processed when the IAR compiler is used for a C file + + +include(Compiler/IAR) + +set(CMAKE_C_COMPILE_OBJECT " -o ") +set(CMAKE_C_CREATE_PREPROCESSED_SOURCE " --preprocess=cnl ") +set(CMAKE_C_CREATE_ASSEMBLY_SOURCE " -lAH -o .dummy") + +# The toolchains for ARM and AVR are quite different: +if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM") + + set(CMAKE_C_LINK_EXECUTABLE " -o ") + set(CMAKE_C_CREATE_STATIC_LIBRARY " --create ") + +endif() + + +if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR") + set(CMAKE_C_OUTPUT_EXTENSION ".r90") + + if(NOT CMAKE_C_LINK_FLAGS) + set(CMAKE_C_LINK_FLAGS "-Fmotorola") + endif() + + set(CMAKE_C_LINK_EXECUTABLE " -o ") + set(CMAKE_C_CREATE_STATIC_LIBRARY " -o ") + +endif() + +# add the target specific include directory: +get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH) +get_filename_component(_compilerDir "${_compilerDir}" PATH) +include_directories("${_compilerDir}/inc" ) diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake new file mode 100644 index 0000000..eae9d1b --- /dev/null +++ b/Modules/Compiler/IAR-CXX.cmake @@ -0,0 +1,34 @@ +# This file is processed when the IAR compiler is used for a C++ file + +include(Compiler/IAR) + +set(CMAKE_CXX_COMPILE_OBJECT " -o ") + +set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " --preprocess=cnl ") +set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -lAH -o .dummy") + + + +if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM") + + set(CMAKE_CXX_LINK_EXECUTABLE " -o ") + set(CMAKE_CXX_CREATE_STATIC_LIBRARY " --create ") + +endif() + + +if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR") + set(CMAKE_CXX_OUTPUT_EXTENSION ".r90") + if(NOT CMAKE_CXX_LINK_FLAGS) + set(CMAKE_CXX_LINK_FLAGS "-Fmotorola") + endif() + + set(CMAKE_CXX_LINK_EXECUTABLE " -o ") + set(CMAKE_CXX_CREATE_STATIC_LIBRARY " -o ") + +endif() + +# add the target specific include directory: +get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH) +get_filename_component(_compilerDir "${_compilerDir}" PATH) +include_directories("${_compilerDir}/inc") diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake new file mode 100644 index 0000000..00e4713 --- /dev/null +++ b/Modules/Compiler/IAR.cmake @@ -0,0 +1,46 @@ +# This file is processed when the IAR compiler is used for a C or C++ file +# Documentation can be downloaded here: http://www.iar.com/website1/1.0.1.0/675/1/ +# The initial feature request is here: http://www.cmake.org/Bug/view.php?id=10176 +# It also contains additional links and information. + +if(_IAR_CMAKE_LOADED) + return() +endif() +set(_IAR_CMAKE_LOADED TRUE) + + +get_filename_component(_CMAKE_C_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH) +get_filename_component(_CMAKE_CXX_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH) +get_filename_component(_CMAKE_ASM_TOOLCHAIN_LOCATION "${CMAKE_ASM_COMPILER}" PATH) + + +if("${CMAKE_C_COMPILER}" MATCHES "arm" OR "${CMAKE_CXX_COMPILER}" MATCHES "arm" OR "${CMAKE_ASM_COMPILER}" MATCHES "arm") + set(CMAKE_EXECUTABLE_SUFFIX ".elf") + + # For arm, IAR uses the "ilinkarm" linker and "iarchive" archiver: + find_program(CMAKE_IAR_LINKER ilinkarm HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}") + find_program(CMAKE_IAR_AR iarchive HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}" ) + + set(IAR_TARGET_ARCHITECTURE "ARM" CACHE STRING "IAR compiler target architecture") +endif() + +if("${CMAKE_C_COMPILER}" MATCHES "avr" OR "${CMAKE_CXX_COMPILER}" MATCHES "avr" OR "${CMAKE_ASM_COMPILER}" MATCHES "avr") + set(CMAKE_EXECUTABLE_SUFFIX ".bin") + + # For AVR and AVR32, IAR uses the "xlink" linker and the "xar" archiver: + find_program(CMAKE_IAR_LINKER xlink HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}" ) + find_program(CMAKE_IAR_AR xar HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}" ) + + set(IAR_TARGET_ARCHITECTURE "AVR" CACHE STRING "IAR compiler target architecture") + + set(CMAKE_LIBRARY_PATH_FLAG "-I") + +endif() + +if(NOT IAR_TARGET_ARCHITECTURE) + message(FATAL_ERROR "The IAR compiler for this architecture is not yet supported " + " by CMake. Please go to http://www.cmake.org/Bug and enter a feature request there.") +endif() + +set(CMAKE_LINKER "${CMAKE_IAR_LINKER}" CACHE FILEPATH "The IAR linker" FORCE) +set(CMAKE_AR "${CMAKE_IAR_AR}" CACHE FILEPATH "The IAR archiver" FORCE) -- cgit v0.12 From d33f40638dcc34a8c15b6605325446c777afd249 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Wed, 10 Apr 2013 22:41:15 +0200 Subject: Add regexps for the IAR toolchain to the vendor list. The IAR compilers produce object files where the plain strings at least sometimes can't be found, see: http://www.cmake.org/Bug/view.php?id=10176#c19598 Alex --- Modules/CMakeDetermineASMCompiler.cmake | 4 ++++ Modules/CMakeDetermineCCompiler.cmake | 7 +++++++ Modules/CMakeDetermineCXXCompiler.cmake | 7 +++++++ 3 files changed, 18 insertions(+) diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index 9999f62..3643b17 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -103,6 +103,10 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI "-h") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI "Texas Instruments") + list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU IAR) + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_IAR ) + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_IAR "IAR Assembler") + include(CMakeDetermineCompilerId) CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT}) diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index d2220e0..8769c66 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -120,6 +120,13 @@ if(NOT CMAKE_C_COMPILER_ID_RUN) set(CMAKE_C_COMPILER_ID) file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in CMAKE_C_COMPILER_ID_PLATFORM_CONTENT) + + # The IAR compiler produces weird output. + # See http://www.cmake.org/Bug/view.php?id=10176#c19598 + list(APPEND CMAKE_C_COMPILER_ID_VENDORS IAR) + set(CMAKE_C_COMPILER_ID_VENDOR_FLAGS_IAR ) + set(CMAKE_C_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler") + include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) CMAKE_DETERMINE_COMPILER_ID(C CFLAGS CMakeCCompilerId.c) diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 6f7e8f6..c79ba89 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -116,6 +116,13 @@ if(NOT CMAKE_CXX_COMPILER_ID_RUN) set(CMAKE_CXX_COMPILER_ID) file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT) + + # The IAR compiler produces weird output. + # See http://www.cmake.org/Bug/view.php?id=10176#c19598 + list(APPEND CMAKE_CXX_COMPILER_ID_VENDORS IAR) + set(CMAKE_CXX_COMPILER_ID_VENDOR_FLAGS_IAR ) + set(CMAKE_CXX_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler") + include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) CMAKE_DETERMINE_COMPILER_ID(CXX CXXFLAGS CMakeCXXCompilerId.cpp) -- cgit v0.12 From d118b8b389b680abf5d23ed5e66eabda418b89e0 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Wed, 4 Jan 2012 21:36:49 +0100 Subject: Add IAR to the CMakeDetectC(XX)CompilerID.c(pp).in With the AVR IAR compiler this can't be found, but it works e.g. for the ARM AVR compiler. Alex --- Modules/CMakeCCompilerId.c.in | 7 +++---- Modules/CMakeCXXCompilerId.cpp.in | 5 +++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index c25df0c..66a5582 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -160,10 +160,9 @@ # define COMPILER_ID "ADSP" /* IAR Systems compiler for embedded systems. - http://www.iar.com - Not supported yet by CMake -#elif defined(__IAR_SYSTEMS_ICC__) -# define COMPILER_ID "IAR" */ + http://www.iar.com */ +#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" /* sdcc, the small devices C compiler for embedded systems, http://sdcc.sourceforge.net */ diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index e2119c2..5e87715 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -161,6 +161,11 @@ #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) # define COMPILER_ID "ADSP" +/* IAR Systems compiler for embedded systems. + http://www.iar.com */ +#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" + #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) # define COMPILER_ID "MIPSpro" # if defined(_SGI_COMPILER_VERSION) -- cgit v0.12 From ec1ba9b0ae27a5731b98fecab648fa3edcfcffa2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 16 Apr 2013 09:27:51 -0400 Subject: get_filename_component: Add explicit unit tests Add test RunCMake.get_filename_component to cover cases of the command. Remove redundant coverage of these cases from the "complex" tests. --- Tests/Complex/Executable/complex.cxx | 80 ---------------------- Tests/Complex/VarTests.cmake | 14 ---- Tests/Complex/cmTestConfigure.h.in | 9 --- Tests/ComplexOneConfig/Executable/complex.cxx | 80 ---------------------- Tests/ComplexOneConfig/VarTests.cmake | 14 ---- Tests/ComplexOneConfig/cmTestConfigure.h.in | 9 --- Tests/RunCMake/CMakeLists.txt | 1 + .../RunCMake/get_filename_component/CMakeLists.txt | 3 + .../get_filename_component/KnownComponents.cmake | 32 +++++++++ .../get_filename_component/RunCMakeTest.cmake | 4 ++ .../UnknownComponent-result.txt | 1 + .../UnknownComponent-stderr.txt | 4 ++ .../get_filename_component/UnknownComponent.cmake | 1 + 13 files changed, 46 insertions(+), 206 deletions(-) create mode 100644 Tests/RunCMake/get_filename_component/CMakeLists.txt create mode 100644 Tests/RunCMake/get_filename_component/KnownComponents.cmake create mode 100644 Tests/RunCMake/get_filename_component/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/get_filename_component/UnknownComponent-result.txt create mode 100644 Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt create mode 100644 Tests/RunCMake/get_filename_component/UnknownComponent.cmake diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index 27d70ad..e904f28 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -635,86 +635,6 @@ int main() } // ---------------------------------------------------------------------- - // Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations - -#ifndef FILENAME_VAR_PATH_NAME - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_PATH_NAME is not defined."); -#else - if((strcmp(FILENAME_VAR_PATH_NAME, "Complex") == 0) || - (strcmp(FILENAME_VAR_PATH_NAME, "ComplexOneConfig") == 0)) - { - cmPassed("FILENAME_VAR_PATH_NAME == ", FILENAME_VAR_PATH_NAME); - } - else - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_PATH_NAME == ", FILENAME_VAR_PATH_NAME); - } -#endif - -#ifndef FILENAME_VAR_NAME - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME is not defined."); -#else - if(strcmp(FILENAME_VAR_NAME, "VarTests.cmake") != 0) - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME == ", FILENAME_VAR_NAME); - } - else - { - cmPassed("FILENAME_VAR_NAME == ", FILENAME_VAR_NAME); - } -#endif - -#ifndef FILENAME_VAR_EXT - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_EXT is not defined."); -#else - if(strcmp(FILENAME_VAR_EXT, ".cmake") != 0) - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_EXT == ", FILENAME_VAR_EXT); - } - else - { - cmPassed("FILENAME_VAR_EXT == ", FILENAME_VAR_EXT); - } -#endif - -#ifndef FILENAME_VAR_NAME_WE - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME_WE is not defined."); -#else - if(strcmp(FILENAME_VAR_NAME_WE, "VarTests") != 0) - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME_WE == ", FILENAME_VAR_NAME_WE); - } - else - { - cmPassed("FILENAME_VAR_NAME_WE == ", FILENAME_VAR_NAME_WE); - } -#endif - -#ifndef PATH_VAR_NAME - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "PATH_VAR_NAME is not defined."); -#else - if((strcmp(PATH_VAR_NAME, "Complex") == 0) || - (strcmp(PATH_VAR_NAME, "ComplexOneConfig") == 0)) - { - cmPassed("PATH_VAR_NAME == ", PATH_VAR_NAME); - } - else - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "PATH_VAR_NAME == ", PATH_VAR_NAME); - } -#endif - - // ---------------------------------------------------------------------- // Test LOAD_CACHE #ifndef CACHE_TEST_VAR1 diff --git a/Tests/Complex/VarTests.cmake b/Tests/Complex/VarTests.cmake index 52ec1fc..70b803a 100644 --- a/Tests/Complex/VarTests.cmake +++ b/Tests/Complex/VarTests.cmake @@ -182,17 +182,3 @@ set(FOREACH_CONCAT "") foreach (INDEX a;b;c;d;e;f;g) set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") endforeach() - -# -# Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations -# -find_file(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR}) - -get_filename_component(FILENAME_VAR_PATH ${FILENAME_VAR} PATH) -get_filename_component(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME) -get_filename_component(FILENAME_VAR_NAME ${FILENAME_VAR} NAME) -get_filename_component(FILENAME_VAR_EXT ${FILENAME_VAR} EXT) -get_filename_component(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE) - -find_path(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR}) -get_filename_component(PATH_VAR_NAME ${PATH_VAR} NAME) diff --git a/Tests/Complex/cmTestConfigure.h.in b/Tests/Complex/cmTestConfigure.h.in index 7741b6f..d7424b1 100644 --- a/Tests/Complex/cmTestConfigure.h.in +++ b/Tests/Complex/cmTestConfigure.h.in @@ -15,15 +15,6 @@ // Test WHILE #define WHILE_VALUE ${while_var} -// Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations - -#define FILENAME_VAR_PATH_NAME "${FILENAME_VAR_PATH_NAME}" -#define FILENAME_VAR_NAME "${FILENAME_VAR_NAME}" -#define FILENAME_VAR_EXT "${FILENAME_VAR_EXT}" -#define FILENAME_VAR_NAME_WE "${FILENAME_VAR_NAME_WE}" - -#define PATH_VAR_NAME "${PATH_VAR_NAME}" - // Test LOAD_CACHE #define CACHE_TEST_VAR1 "${CACHE_TEST_VAR1}" diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index 27d70ad..e904f28 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -635,86 +635,6 @@ int main() } // ---------------------------------------------------------------------- - // Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations - -#ifndef FILENAME_VAR_PATH_NAME - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_PATH_NAME is not defined."); -#else - if((strcmp(FILENAME_VAR_PATH_NAME, "Complex") == 0) || - (strcmp(FILENAME_VAR_PATH_NAME, "ComplexOneConfig") == 0)) - { - cmPassed("FILENAME_VAR_PATH_NAME == ", FILENAME_VAR_PATH_NAME); - } - else - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_PATH_NAME == ", FILENAME_VAR_PATH_NAME); - } -#endif - -#ifndef FILENAME_VAR_NAME - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME is not defined."); -#else - if(strcmp(FILENAME_VAR_NAME, "VarTests.cmake") != 0) - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME == ", FILENAME_VAR_NAME); - } - else - { - cmPassed("FILENAME_VAR_NAME == ", FILENAME_VAR_NAME); - } -#endif - -#ifndef FILENAME_VAR_EXT - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_EXT is not defined."); -#else - if(strcmp(FILENAME_VAR_EXT, ".cmake") != 0) - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_EXT == ", FILENAME_VAR_EXT); - } - else - { - cmPassed("FILENAME_VAR_EXT == ", FILENAME_VAR_EXT); - } -#endif - -#ifndef FILENAME_VAR_NAME_WE - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME_WE is not defined."); -#else - if(strcmp(FILENAME_VAR_NAME_WE, "VarTests") != 0) - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME_WE == ", FILENAME_VAR_NAME_WE); - } - else - { - cmPassed("FILENAME_VAR_NAME_WE == ", FILENAME_VAR_NAME_WE); - } -#endif - -#ifndef PATH_VAR_NAME - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "PATH_VAR_NAME is not defined."); -#else - if((strcmp(PATH_VAR_NAME, "Complex") == 0) || - (strcmp(PATH_VAR_NAME, "ComplexOneConfig") == 0)) - { - cmPassed("PATH_VAR_NAME == ", PATH_VAR_NAME); - } - else - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "PATH_VAR_NAME == ", PATH_VAR_NAME); - } -#endif - - // ---------------------------------------------------------------------- // Test LOAD_CACHE #ifndef CACHE_TEST_VAR1 diff --git a/Tests/ComplexOneConfig/VarTests.cmake b/Tests/ComplexOneConfig/VarTests.cmake index 52ec1fc..70b803a 100644 --- a/Tests/ComplexOneConfig/VarTests.cmake +++ b/Tests/ComplexOneConfig/VarTests.cmake @@ -182,17 +182,3 @@ set(FOREACH_CONCAT "") foreach (INDEX a;b;c;d;e;f;g) set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") endforeach() - -# -# Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations -# -find_file(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR}) - -get_filename_component(FILENAME_VAR_PATH ${FILENAME_VAR} PATH) -get_filename_component(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME) -get_filename_component(FILENAME_VAR_NAME ${FILENAME_VAR} NAME) -get_filename_component(FILENAME_VAR_EXT ${FILENAME_VAR} EXT) -get_filename_component(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE) - -find_path(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR}) -get_filename_component(PATH_VAR_NAME ${PATH_VAR} NAME) diff --git a/Tests/ComplexOneConfig/cmTestConfigure.h.in b/Tests/ComplexOneConfig/cmTestConfigure.h.in index 7741b6f..d7424b1 100644 --- a/Tests/ComplexOneConfig/cmTestConfigure.h.in +++ b/Tests/ComplexOneConfig/cmTestConfigure.h.in @@ -15,15 +15,6 @@ // Test WHILE #define WHILE_VALUE ${while_var} -// Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations - -#define FILENAME_VAR_PATH_NAME "${FILENAME_VAR_PATH_NAME}" -#define FILENAME_VAR_NAME "${FILENAME_VAR_NAME}" -#define FILENAME_VAR_EXT "${FILENAME_VAR_EXT}" -#define FILENAME_VAR_NAME_WE "${FILENAME_VAR_NAME_WE}" - -#define PATH_VAR_NAME "${PATH_VAR_NAME}" - // Test LOAD_CACHE #define CACHE_TEST_VAR1 "${CACHE_TEST_VAR1}" diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 402c8a9..f676107 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -71,6 +71,7 @@ add_RunCMake_test(CompatibleInterface) add_RunCMake_test(add_dependencies) add_RunCMake_test(build_command) add_RunCMake_test(find_package) +add_RunCMake_test(get_filename_component) add_RunCMake_test(include) add_RunCMake_test(include_directories) add_RunCMake_test(list) diff --git a/Tests/RunCMake/get_filename_component/CMakeLists.txt b/Tests/RunCMake/get_filename_component/CMakeLists.txt new file mode 100644 index 0000000..e8db6b0 --- /dev/null +++ b/Tests/RunCMake/get_filename_component/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/get_filename_component/KnownComponents.cmake b/Tests/RunCMake/get_filename_component/KnownComponents.cmake new file mode 100644 index 0000000..d5becc0 --- /dev/null +++ b/Tests/RunCMake/get_filename_component/KnownComponents.cmake @@ -0,0 +1,32 @@ +macro(check desc actual expect) + if(NOT "x${actual}" STREQUAL "x${expect}") + message(SEND_ERROR "${desc}: got \"${actual}\", not \"${expect}\"") + endif() +endmacro() + +set(filename "/path/to/filename.ext.in") +set(expect_PATH "/path/to") +set(expect_NAME "filename.ext.in") +set(expect_EXT ".ext.in") +set(expect_NAME_WE "filename") +foreach(c PATH NAME EXT NAME_WE) + get_filename_component(actual_${c} "${filename}" ${c}) + check("${c}" "${actual_${c}}" "${expect_${c}}") +endforeach() + +get_filename_component(test_slashes "c:\\path\\to\\filename.ext.in" PATH) +check("PATH from backslashes" "${test_slashes}" "c:/path/to") + +get_filename_component(test_winroot "c:\\filename.ext.in" PATH) +check("PATH in windows root" "${test_winroot}" "c:/") + +get_filename_component(test_absolute "/path/to/a/../filename.ext.in" ABSOLUTE) +check("ABSOLUTE" "${test_absolute}" "/path/to/filename.ext.in") + +get_filename_component(test_cache "/path/to/filename.ext.in" PATH CACHE) +check("CACHE 1" "${test_cache}" "/path/to") +get_filename_component(test_cache "/path/to/other/filename.ext.in" PATH CACHE) +check("CACHE 2" "${test_cache}" "/path/to") +unset(test_cache CACHE) +get_filename_component(test_cache "/path/to/other/filename.ext.in" PATH CACHE) +check("CACHE 3" "${test_cache}" "/path/to/other") diff --git a/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake b/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake new file mode 100644 index 0000000..156fc8f --- /dev/null +++ b/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake @@ -0,0 +1,4 @@ +include(RunCMake) + +run_cmake(KnownComponents) +run_cmake(UnknownComponent) diff --git a/Tests/RunCMake/get_filename_component/UnknownComponent-result.txt b/Tests/RunCMake/get_filename_component/UnknownComponent-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/get_filename_component/UnknownComponent-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt b/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt new file mode 100644 index 0000000..b146e5b --- /dev/null +++ b/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UnknownComponent.cmake:1 \(get_filename_component\): + get_filename_component unknown component BOGUS +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/get_filename_component/UnknownComponent.cmake b/Tests/RunCMake/get_filename_component/UnknownComponent.cmake new file mode 100644 index 0000000..06abc51 --- /dev/null +++ b/Tests/RunCMake/get_filename_component/UnknownComponent.cmake @@ -0,0 +1 @@ +get_filename_component(var "/path/to/filename.ext.in" BOGUS) -- cgit v0.12 From 7d1590e6f98a48d1d4f8f95413710e37f01b6026 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 16 Apr 2013 09:37:37 -0400 Subject: get_filename_component: Add DIRECTORY option (#14091) The name "PATH" is not precise so add equivalent option "DIRECTORY". Document the latter as preferred and the former as a legacy alias. --- Source/cmGetFilenameComponentCommand.cxx | 2 +- Source/cmGetFilenameComponentCommand.h | 3 ++- .../get_filename_component/KnownComponents.cmake | 19 ++++++++++--------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index fd1ad60..1d7fefc 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -58,7 +58,7 @@ bool cmGetFilenameComponentCommand } std::string storeArgs; std::string programArgs; - if (args[2] == "PATH") + if (args[2] == "DIRECTORY" || args[2] == "PATH") { result = cmSystemTools::GetFilenamePath(filename); } diff --git a/Source/cmGetFilenameComponentCommand.h b/Source/cmGetFilenameComponentCommand.h index f294daa..09af332 100644 --- a/Source/cmGetFilenameComponentCommand.h +++ b/Source/cmGetFilenameComponentCommand.h @@ -64,12 +64,13 @@ public: return " get_filename_component( [CACHE])\n" "Set to a component of , where is one of:\n" - " PATH = Directory without file name\n" + " DIRECTORY = Directory without file name\n" " NAME = File name without directory\n" " EXT = File name longest extension (.b.c from d/a.b.c)\n" " NAME_WE = File name without directory or longest extension\n" " ABSOLUTE = Full path to file\n" " REALPATH = Full path to existing file with symlinks resolved\n" + " PATH = Legacy alias for DIRECTORY (use for CMake <= 2.8.11)\n" "Paths are returned with forward slashes and have no trailing slahes. " "The longest file extension is always considered. " "If the optional CACHE argument is specified, the result variable is " diff --git a/Tests/RunCMake/get_filename_component/KnownComponents.cmake b/Tests/RunCMake/get_filename_component/KnownComponents.cmake index d5becc0..a4ef8ff 100644 --- a/Tests/RunCMake/get_filename_component/KnownComponents.cmake +++ b/Tests/RunCMake/get_filename_component/KnownComponents.cmake @@ -5,28 +5,29 @@ macro(check desc actual expect) endmacro() set(filename "/path/to/filename.ext.in") -set(expect_PATH "/path/to") +set(expect_DIRECTORY "/path/to") set(expect_NAME "filename.ext.in") set(expect_EXT ".ext.in") set(expect_NAME_WE "filename") -foreach(c PATH NAME EXT NAME_WE) +set(expect_PATH "/path/to") +foreach(c DIRECTORY NAME EXT NAME_WE PATH) get_filename_component(actual_${c} "${filename}" ${c}) check("${c}" "${actual_${c}}" "${expect_${c}}") endforeach() -get_filename_component(test_slashes "c:\\path\\to\\filename.ext.in" PATH) -check("PATH from backslashes" "${test_slashes}" "c:/path/to") +get_filename_component(test_slashes "c:\\path\\to\\filename.ext.in" DIRECTORY) +check("DIRECTORY from backslashes" "${test_slashes}" "c:/path/to") -get_filename_component(test_winroot "c:\\filename.ext.in" PATH) -check("PATH in windows root" "${test_winroot}" "c:/") +get_filename_component(test_winroot "c:\\filename.ext.in" DIRECTORY) +check("DIRECTORY in windows root" "${test_winroot}" "c:/") get_filename_component(test_absolute "/path/to/a/../filename.ext.in" ABSOLUTE) check("ABSOLUTE" "${test_absolute}" "/path/to/filename.ext.in") -get_filename_component(test_cache "/path/to/filename.ext.in" PATH CACHE) +get_filename_component(test_cache "/path/to/filename.ext.in" DIRECTORY CACHE) check("CACHE 1" "${test_cache}" "/path/to") -get_filename_component(test_cache "/path/to/other/filename.ext.in" PATH CACHE) +get_filename_component(test_cache "/path/to/other/filename.ext.in" DIRECTORY CACHE) check("CACHE 2" "${test_cache}" "/path/to") unset(test_cache CACHE) -get_filename_component(test_cache "/path/to/other/filename.ext.in" PATH CACHE) +get_filename_component(test_cache "/path/to/other/filename.ext.in" DIRECTORY CACHE) check("CACHE 3" "${test_cache}" "/path/to/other") -- cgit v0.12 From 5683146185a44e340452ee531e87099a51343897 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 16 Apr 2013 15:42:44 -0400 Subject: Xcode: Use explicitFileType to mark source types (#14093) Replace use of lastKnownFileType with explicitFileType to insist that Xcode treat the file as we ask. --- Modules/CompilerId/Xcode-1.pbxproj.in | 2 +- Modules/CompilerId/Xcode-2.pbxproj.in | 2 +- Modules/CompilerId/Xcode-3.pbxproj.in | 2 +- Source/cmGlobalXCodeGenerator.cxx | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Modules/CompilerId/Xcode-1.pbxproj.in b/Modules/CompilerId/Xcode-1.pbxproj.in index f06960f..793ad02 100644 --- a/Modules/CompilerId/Xcode-1.pbxproj.in +++ b/Modules/CompilerId/Xcode-1.pbxproj.in @@ -56,7 +56,7 @@ 2C18F0B415DC1DC700593670 = { fileEncoding = 30; isa = PBXFileReference; - lastKnownFileType = @id_type@; + explicitFileType = @id_type@; path = @id_src@; refType = 4; sourceTree = ""; diff --git a/Modules/CompilerId/Xcode-2.pbxproj.in b/Modules/CompilerId/Xcode-2.pbxproj.in index e3c7aa9..226b413 100644 --- a/Modules/CompilerId/Xcode-2.pbxproj.in +++ b/Modules/CompilerId/Xcode-2.pbxproj.in @@ -7,7 +7,7 @@ objects = { 2C18F0B615DC1E0300593670 = {isa = PBXBuildFile; fileRef = 2C18F0B415DC1DC700593670; }; - 2C18F0B415DC1DC700593670 = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = @id_type@; path = @id_src@; sourceTree = ""; }; + 2C18F0B415DC1DC700593670 = {isa = PBXFileReference; fileEncoding = 4; explicitFileType = @id_type@; path = @id_src@; sourceTree = ""; }; 8DD76F6C0486A84900D96B5E = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = CompilerId@id_lang@; sourceTree = BUILT_PRODUCTS_DIR; }; 08FB7794FE84155DC02AAC07 = { diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in index d94a803..6f861eb 100644 --- a/Modules/CompilerId/Xcode-3.pbxproj.in +++ b/Modules/CompilerId/Xcode-3.pbxproj.in @@ -7,7 +7,7 @@ objects = { 2C18F0B615DC1E0300593670 = {isa = PBXBuildFile; fileRef = 2C18F0B415DC1DC700593670; }; - 2C18F0B415DC1DC700593670 = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = @id_type@; path = @id_src@; sourceTree = ""; }; + 2C18F0B415DC1DC700593670 = {isa = PBXFileReference; fileEncoding = 4; explicitFileType = @id_type@; path = @id_src@; sourceTree = ""; }; 08FB7794FE84155DC02AAC07 = { isa = PBXGroup; children = ( diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index ceac564..2ecc64e 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -839,7 +839,7 @@ GetSourcecodeValueFromFileExtension(const std::string& _ext, // // Already specialized above or we leave sourcecode == "sourcecode" // // which is probably the most correct choice. Extensionless headers, // // for example... Or file types unknown to Xcode that do not map to a - // // valid lastKnownFileType value. + // // valid explicitFileType value. // } return sourcecode; @@ -882,7 +882,7 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath( std::string sourcecode = GetSourcecodeValueFromFileExtension(ext, lang); - fileRef->AddAttribute("lastKnownFileType", + fileRef->AddAttribute("explicitFileType", this->CreateString(sourcecode.c_str())); // Store the file path relative to the top of the source tree. @@ -1003,7 +1003,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, *i, cmtarget); cmXCodeObject* fr = xsf->GetObject("fileRef"); cmXCodeObject* filetype = - fr->GetObject()->GetObject("lastKnownFileType"); + fr->GetObject()->GetObject("explicitFileType"); cmTarget::SourceFileFlags tsFlags = cmtarget.GetTargetSourceFileFlags(*i); -- cgit v0.12 From b10a1713dcec004df950108a5734a8872919040c Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Wed, 17 Apr 2013 12:46:13 +0200 Subject: FindOpenGL: simplify OS selection code This was using nested if's, now it uses elseif to flatten that. It also removes one "if" from the general "else" branch that checks for Apple, as that has it's own branch anyway and can't be true at this point. --- Modules/FindOpenGL.cmake | 173 ++++++++++++++++++++++------------------------- 1 file changed, 82 insertions(+), 91 deletions(-) diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake index 96c4d8d..5f782dc 100644 --- a/Modules/FindOpenGL.cmake +++ b/Modules/FindOpenGL.cmake @@ -28,111 +28,102 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -if (WIN32) - if (CYGWIN) +if (CYGWIN) - find_path(OPENGL_INCLUDE_DIR GL/gl.h ) + find_path(OPENGL_INCLUDE_DIR GL/gl.h ) - find_library(OPENGL_gl_LIBRARY opengl32 ) + find_library(OPENGL_gl_LIBRARY opengl32 ) - find_library(OPENGL_glu_LIBRARY glu32 ) + find_library(OPENGL_glu_LIBRARY glu32 ) - else () +elseif (WIN32) - if(BORLAND) - set (OPENGL_gl_LIBRARY import32 CACHE STRING "OpenGL library for win32") - set (OPENGL_glu_LIBRARY import32 CACHE STRING "GLU library for win32") - else() - set (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32") - set (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32") - endif() - - endif () - -else () + if(BORLAND) + set (OPENGL_gl_LIBRARY import32 CACHE STRING "OpenGL library for win32") + set (OPENGL_glu_LIBRARY import32 CACHE STRING "GLU library for win32") + else() + set (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32") + set (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32") + endif() - if (APPLE) +elseif (APPLE) - find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL lib for OSX") - find_library(OPENGL_glu_LIBRARY AGL DOC "AGL lib for OSX") - find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OSX") + find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL lib for OSX") + find_library(OPENGL_glu_LIBRARY AGL DOC "AGL lib for OSX") + find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OSX") - else() - if (CMAKE_SYSTEM_NAME MATCHES "HP-UX") - # Handle HP-UX cases where we only want to find OpenGL in either hpux64 - # or hpux32 depending on if we're doing a 64 bit build. - if(CMAKE_SIZEOF_VOID_P EQUAL 4) - set(_OPENGL_LIB_PATH - /opt/graphics/OpenGL/lib/hpux32/) - else() - set(_OPENGL_LIB_PATH - /opt/graphics/OpenGL/lib/hpux64/ - /opt/graphics/OpenGL/lib/pa20_64) - endif() - elseif(CMAKE_SYSTEM_NAME STREQUAL Haiku) +else() + if (CMAKE_SYSTEM_NAME MATCHES "HP-UX") + # Handle HP-UX cases where we only want to find OpenGL in either hpux64 + # or hpux32 depending on if we're doing a 64 bit build. + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(_OPENGL_LIB_PATH + /opt/graphics/OpenGL/lib/hpux32/) + else() set(_OPENGL_LIB_PATH - /boot/develop/lib/x86) - set(_OPENGL_INCLUDE_PATH - /boot/develop/headers/os/opengl) + /opt/graphics/OpenGL/lib/hpux64/ + /opt/graphics/OpenGL/lib/pa20_64) endif() + elseif(CMAKE_SYSTEM_NAME STREQUAL Haiku) + set(_OPENGL_LIB_PATH + /boot/develop/lib/x86) + set(_OPENGL_INCLUDE_PATH + /boot/develop/headers/os/opengl) + endif() - # The first line below is to make sure that the proper headers - # are used on a Linux machine with the NVidia drivers installed. - # They replace Mesa with NVidia's own library but normally do not - # install headers and that causes the linking to - # fail since the compiler finds the Mesa headers but NVidia's library. - # Make sure the NVIDIA directory comes BEFORE the others. - # - Atanas Georgiev - - find_path(OPENGL_INCLUDE_DIR GL/gl.h - /usr/share/doc/NVIDIA_GLX-1.0/include - /usr/openwin/share/include - /opt/graphics/OpenGL/include /usr/X11R6/include - ${_OPENGL_INCLUDE_PATH} - ) - - find_path(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h - /usr/share/doc/NVIDIA_GLX-1.0/include - /usr/openwin/share/include - /opt/graphics/OpenGL/include /usr/X11R6/include - ) - - find_library(OPENGL_gl_LIBRARY - NAMES GL MesaGL - PATHS /opt/graphics/OpenGL/lib - /usr/openwin/lib - /usr/shlib /usr/X11R6/lib - ${_OPENGL_LIB_PATH} - ) - - unset(_OPENGL_INCLUDE_PATH) - unset(_OPENGL_LIB_PATH) - - # On Unix OpenGL most certainly always requires X11. - # Feel free to tighten up these conditions if you don't - # think this is always true. - # It's not true on OSX. - - if (OPENGL_gl_LIBRARY) - if(NOT X11_FOUND) - include(${CMAKE_CURRENT_LIST_DIR}/FindX11.cmake) - endif() - if (X11_FOUND) - if (NOT APPLE) - set (OPENGL_LIBRARIES ${X11_LIBRARIES}) - endif () - endif () + # The first line below is to make sure that the proper headers + # are used on a Linux machine with the NVidia drivers installed. + # They replace Mesa with NVidia's own library but normally do not + # install headers and that causes the linking to + # fail since the compiler finds the Mesa headers but NVidia's library. + # Make sure the NVIDIA directory comes BEFORE the others. + # - Atanas Georgiev + + find_path(OPENGL_INCLUDE_DIR GL/gl.h + /usr/share/doc/NVIDIA_GLX-1.0/include + /usr/openwin/share/include + /opt/graphics/OpenGL/include /usr/X11R6/include + ${_OPENGL_INCLUDE_PATH} + ) + + find_path(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h + /usr/share/doc/NVIDIA_GLX-1.0/include + /usr/openwin/share/include + /opt/graphics/OpenGL/include /usr/X11R6/include + ) + + find_library(OPENGL_gl_LIBRARY + NAMES GL MesaGL + PATHS /opt/graphics/OpenGL/lib + /usr/openwin/lib + /usr/shlib /usr/X11R6/lib + ${_OPENGL_LIB_PATH} + ) + + unset(_OPENGL_INCLUDE_PATH) + unset(_OPENGL_LIB_PATH) + + # On Unix OpenGL most certainly always requires X11. + # Feel free to tighten up these conditions if you don't + # think this is always true. + + if (OPENGL_gl_LIBRARY) + if(NOT X11_FOUND) + include(${CMAKE_CURRENT_LIST_DIR}/FindX11.cmake) + endif() + if (X11_FOUND) + set (OPENGL_LIBRARIES ${X11_LIBRARIES}) endif () + endif () - find_library(OPENGL_glu_LIBRARY - NAMES GLU MesaGLU - PATHS ${OPENGL_gl_LIBRARY} - /opt/graphics/OpenGL/lib - /usr/openwin/lib - /usr/shlib /usr/X11R6/lib - ) + find_library(OPENGL_glu_LIBRARY + NAMES GLU MesaGLU + PATHS ${OPENGL_gl_LIBRARY} + /opt/graphics/OpenGL/lib + /usr/openwin/lib + /usr/shlib /usr/X11R6/lib + ) - endif() endif () if(OPENGL_gl_LIBRARY) -- cgit v0.12 From 5be35935dceb55923b954ef683aea02af6a92c86 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Wed, 17 Apr 2013 12:59:52 +0200 Subject: FindOpenGL: require headers to be found on non-Windows platforms (#13746) --- Modules/FindOpenGL.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake index 5f782dc..83fcc3d 100644 --- a/Modules/FindOpenGL.cmake +++ b/Modules/FindOpenGL.cmake @@ -28,9 +28,12 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +set(_OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY) + if (CYGWIN) find_path(OPENGL_INCLUDE_DIR GL/gl.h ) + list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR) find_library(OPENGL_gl_LIBRARY opengl32 ) @@ -51,6 +54,7 @@ elseif (APPLE) find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL lib for OSX") find_library(OPENGL_glu_LIBRARY AGL DOC "AGL lib for OSX") find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OSX") + list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR) else() if (CMAKE_SYSTEM_NAME MATCHES "HP-UX") @@ -85,6 +89,7 @@ else() /opt/graphics/OpenGL/include /usr/X11R6/include ${_OPENGL_INCLUDE_PATH} ) + list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR) find_path(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h /usr/share/doc/NVIDIA_GLX-1.0/include @@ -153,7 +158,8 @@ set(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR}) # handle the QUIETLY and REQUIRED arguments and set OPENGL_FOUND to TRUE if # all listed variables are TRUE include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL DEFAULT_MSG OPENGL_gl_LIBRARY) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL REQUIRED_VARS ${_OpenGL_REQUIRED_VARS}) +unset(_OpenGL_REQUIRED_VARS) mark_as_advanced( OPENGL_INCLUDE_DIR -- cgit v0.12 From cd2d2480cc84c4d4b54cee76061e1aa5e57cb832 Mon Sep 17 00:00:00 2001 From: Mathias Gaunard Date: Wed, 27 Mar 2013 11:33:36 +0100 Subject: FindCUDA: CUDA_COMPUTE_BUILD_PATH uses relative paths to binary dir. make CUDA_COMPUTE_BUILD_PATH use a relative path to the current binary directory instead of the current source directory if the source file considered is in the current binary directory. This is done to shorten the paths given to the compiler. --- Modules/FindCUDA.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 423ad3d..8248624 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -920,7 +920,13 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path) if (IS_ABSOLUTE "${bpath}") # Absolute paths are generally unnessary, especially if something like # file(GLOB_RECURSE) is used to pick up the files. - file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}") + + string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos) + if (_binary_dir_pos EQUAL 0) + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}") + else() + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}") + endif() endif() # This recipie is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the -- cgit v0.12 From 573f39cb2ad6dcf70f85514132a504e9c2da1e0b Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 18 Apr 2013 11:55:10 -0400 Subject: CMake 2.8.11-rc3 --- ChangeLog.manual | 11 +++++++++++ Source/CMakeVersion.cmake | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog.manual b/ChangeLog.manual index df45179..2a44133 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,14 @@ +Changes in CMake 2.8.11-rc3 (since 2.8.11-rc2) +---------------------------------------------- +Brad King (1): + get_filename_component: Document path components more clearly (#14091) + +Rolf Eike Beer (1): + try_compile: add missing fclose() to recently added error case + +Stephen Kelly (1): + Fix clearing of the INCLUDE_DIRECTORIES DIRECTORY property. + Changes in CMake 2.8.11-rc2 (since 2.8.11-rc1) ---------------------------------------------- Alex Neundorf (6): diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1c8b577..ce99a2c 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -3,4 +3,4 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) set(CMake_VERSION_TWEAK 0) -set(CMake_VERSION_RC 2) +set(CMake_VERSION_RC 3) -- cgit v0.12 From e7c58f6c35d110a43c483a796fef644c6e22ce89 Mon Sep 17 00:00:00 2001 From: Ian Monroe Date: Thu, 18 Apr 2013 10:57:39 -0700 Subject: Ninja: use cd /D to set directory on Windows Add_custom_command was unable to handle build and source directories existing on different drives. --- Source/cmLocalNinjaGenerator.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index d902f4e..294a539 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -302,7 +302,12 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(const cmCustomCommand *cc, wd = this->GetMakefile()->GetStartOutputDirectory(); cmOStringStream cdCmd; - cdCmd << "cd " << this->ConvertToOutputFormat(wd, SHELL); +#ifdef _WIN32 + std::string cdStr = "cd /D "; +#else + std::string cdStr = "cd "; +#endif + cdCmd << cdStr << this->ConvertToOutputFormat(wd, SHELL); cmdLines.push_back(cdCmd.str()); } for (unsigned i = 0; i != ccg.GetNumberOfCommands(); ++i) { -- cgit v0.12 From 32b582d8a583fcaea92eff4b33af62ab0e10ceaa Mon Sep 17 00:00:00 2001 From: Marcel Loose Date: Thu, 18 Apr 2013 14:48:17 -0400 Subject: FindCUDA: Remove duplicate entries from INCLUDE_DIRECTORIES. As of CMake 2.8.8, the INCLUDE_DIRECTORIES() command does not de-duplicate entries. Failure to do so can lead to an extremely long and repetitive list of -I entries on the command line. --- Modules/FindCUDA.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 423ad3d..6a1a27e 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1021,7 +1021,10 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) # Initialize our list of includes with the user ones followed by the CUDA system ones. set(CUDA_NVCC_INCLUDE_ARGS ${CUDA_NVCC_INCLUDE_ARGS_USER} "-I${CUDA_INCLUDE_DIRS}") # Get the include directories for this directory and use them for our nvcc command. + # Remove duplicate entries which may be present since include_directories + # in CMake >= 2.8.8 does not remove them. get_directory_property(CUDA_NVCC_INCLUDE_DIRECTORIES INCLUDE_DIRECTORIES) + list(REMOVE_DUPLICATES CUDA_NVCC_INCLUDE_DIRECTORIES) if(CUDA_NVCC_INCLUDE_DIRECTORIES) foreach(dir ${CUDA_NVCC_INCLUDE_DIRECTORIES}) list(APPEND CUDA_NVCC_INCLUDE_ARGS -I${dir}) -- cgit v0.12 From 52723722c78d0fe474e6f03890d70283e9340bab Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 22 Apr 2013 08:50:08 -0400 Subject: Check{C,CXX}CompilerFlag: Test using C locale (#14102) Set the locale to C while running the compiler for these checks because we match the resulting warning messages in English only. Suggested-by: Marco Nolden --- Modules/CheckCCompilerFlag.cmake | 12 ++++++++++++ Modules/CheckCXXCompilerFlag.cmake | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake index 08e80f7..02f7cb6 100644 --- a/Modules/CheckCCompilerFlag.cmake +++ b/Modules/CheckCCompilerFlag.cmake @@ -26,6 +26,12 @@ include(CheckCSourceCompiles) macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT) set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}") set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}") + # Normalize locale during test compilation. + set(_CheckCCompilerFlag_LOCALE_VARS LC_ALL LC_MESSAGES LANG) + foreach(v ${_CheckCCompilerFlag_LOCALE_VARS}) + set(_CheckCCompilerFlag_SAVED_${v} "$ENV{${v}}") + set(ENV{${v}} C) + endforeach() CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT} # Some compilers do not fail with a bad flag FAIL_REGEX "command line option .* is valid for .* but not for C" # GNU @@ -41,5 +47,11 @@ macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT) FAIL_REGEX "command option .* is not recognized" # XL FAIL_REGEX "WARNING: unknown flag:" # Open64 ) + foreach(v ${_CheckCCompilerFlag_LOCALE_VARS}) + set(ENV{${v}} ${_CheckCCompilerFlag_SAVED_${v}}) + unset(_CheckCCompilerFlag_SAVED_${v}) + endforeach() + unset(_CheckCCompilerFlag_LOCALE_VARS) + set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") endmacro () diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake index 6626403..a872a75 100644 --- a/Modules/CheckCXXCompilerFlag.cmake +++ b/Modules/CheckCXXCompilerFlag.cmake @@ -26,6 +26,13 @@ include(CheckCXXSourceCompiles) macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT) set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}") set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}") + + # Normalize locale during test compilation. + set(_CheckCXXCompilerFlag_LOCALE_VARS LC_ALL LC_MESSAGES LANG) + foreach(v ${_CheckCXXCompilerFlag_LOCALE_VARS}) + set(_CheckCXXCompilerFlag_SAVED_${v} "$ENV{${v}}") + set(ENV{${v}} C) + endforeach() CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT} # Some compilers do not fail with a bad flag FAIL_REGEX "command line option .* is valid for .* but not for C\\\\+\\\\+" # GNU @@ -43,6 +50,12 @@ macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT) FAIL_REGEX "File with unknown suffix passed to linker" # PGI FAIL_REGEX "WARNING: unknown flag:" # Open64 ) + foreach(v ${_CheckCXXCompilerFlag_LOCALE_VARS}) + set(ENV{${v}} ${_CheckCXXCompilerFlag_SAVED_${v}}) + unset(_CheckCXXCompilerFlag_SAVED_${v}) + endforeach() + unset(_CheckCXXCompilerFlag_LOCALE_VARS) + set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") endmacro () -- cgit v0.12 From df3663bfabc9de99a7338ea0a19a1101a8dbc703 Mon Sep 17 00:00:00 2001 From: Marc Bartholomaeus Date: Thu, 18 Apr 2013 01:01:10 +0200 Subject: cmake-gui: Add search functions for Output window (#9733) Signed-off-by: Alex Neundorf --- Source/QtDialog/CMakeSetupDialog.cxx | 72 ++++++++++++++++++++++++++++++++++++ Source/QtDialog/CMakeSetupDialog.h | 4 ++ 2 files changed, 76 insertions(+) diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index c0dde1c..3cf799f 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include "QCMake.h" #include "QCMakeCacheView.h" @@ -122,6 +123,16 @@ CMakeSetupDialog::CMakeSetupDialog() QObject::connect(this->InstallForCommandLineAction, SIGNAL(triggered(bool)), this, SLOT(doInstallForCommandLine())); #endif + ToolsMenu->addSeparator(); + ToolsMenu->addAction(tr("&Find in Output..."), + this, SLOT(doOutputFindDialog())); + ToolsMenu->addAction(tr("&Find Next"), + this, SLOT(doOutputFindNext()), + QKeySequence::FindNext); + ToolsMenu->addAction(tr("&Find Previous"), + this, SLOT(doOutputFindPrev()), + QKeySequence::FindPrevious); + QMenu* OptionsMenu = this->menuBar()->addMenu(tr("&Options")); this->SuppressDevWarningsAction = OptionsMenu->addAction(tr("&Suppress dev Warnings (-Wno-dev)")); @@ -1149,4 +1160,65 @@ void CMakeSetupDialog::setSearchFilter(const QString& str) this->CacheValues->setSearchFilter(str); } +void CMakeSetupDialog::doOutputFindDialog() +{ + QStringList strings(this->FindHistory); + + QString selection = this->Output->textCursor().selectedText(); + if (!selection.isEmpty() && !selection.contains(QChar::ParagraphSeparator)) + { + strings.push_front(selection); + } + + bool ok; + QString search = QInputDialog::getItem(this, tr("Find in Output"), + tr("Find:"), strings, 0, true, &ok); + if (ok && !search.isEmpty()) + { + if (!this->FindHistory.contains(search)) + { + this->FindHistory.push_front(search); + } + doOutputFindNext(); + } +} + +void CMakeSetupDialog::doOutputFindPrev() +{ + doOutputFindNext(false); +} + +void CMakeSetupDialog::doOutputFindNext(bool directionForward) +{ + if (this->FindHistory.isEmpty()) + { + doOutputFindDialog(); //will re-call this function again + return; + } + + QString search = this->FindHistory.front(); + + QTextCursor cursor = this->Output->textCursor(); + QTextDocument* document = this->Output->document(); + QTextDocument::FindFlags flags; + if (!directionForward) + { + flags |= QTextDocument::FindBackward; + } + cursor = document->find(search, cursor, flags); + + if (cursor.isNull()) + { + // first search found nothing, wrap around and search again + cursor = this->Output->textCursor(); + cursor.movePosition(directionForward ? QTextCursor::Start + : QTextCursor::End); + cursor = document->find(search, cursor, flags); + } + + if (cursor.hasSelection()) + { + this->Output->setTextCursor(cursor); + } +} diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h index 2599675..88fefcc 100644 --- a/Source/QtDialog/CMakeSetupDialog.h +++ b/Source/QtDialog/CMakeSetupDialog.h @@ -77,6 +77,9 @@ protected slots: bool doConfigureInternal(); bool doGenerateInternal(); void exitLoop(int); + void doOutputFindDialog(); + void doOutputFindNext(bool directionForward = true); + void doOutputFindPrev(); protected: @@ -106,6 +109,7 @@ protected: QTextCharFormat MessageFormat; QStringList AddVariableCompletions; + QStringList FindHistory; QEventLoop LocalLoop; -- cgit v0.12 From 4ce65e82f5865469f392b0d021da588366bc14c3 Mon Sep 17 00:00:00 2001 From: Marc Bartholomaeus Date: Thu, 18 Apr 2013 00:53:12 +0200 Subject: cmake-gui: Add search functions to the context menu of the Output widget Signed-off-by: Alex Neundorf --- Source/QtDialog/CMakeSetupDialog.cxx | 20 ++++++++++++++++++++ Source/QtDialog/CMakeSetupDialog.h | 1 + 2 files changed, 21 insertions(+) diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 3cf799f..0be45c6 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -183,6 +183,10 @@ CMakeSetupDialog::CMakeSetupDialog() this->Output->setFont(outputFont); this->ErrorFormat.setForeground(QBrush(Qt::red)); + this->Output->setContextMenuPolicy(Qt::CustomContextMenu); + connect(this->Output, SIGNAL(customContextMenuRequested(const QPoint&)), + this, SLOT(doOutputContextMenu(const QPoint &))); + // start the cmake worker thread this->CMakeThread = new QCMakeThread(this); QObject::connect(this->CMakeThread, SIGNAL(cmakeInitialized()), @@ -1160,6 +1164,22 @@ void CMakeSetupDialog::setSearchFilter(const QString& str) this->CacheValues->setSearchFilter(str); } +void CMakeSetupDialog::doOutputContextMenu(const QPoint &pt) +{ + QMenu *menu = this->Output->createStandardContextMenu(); + + menu->addSeparator(); + menu->addAction(tr("Find..."), + this, SLOT(doOutputFindDialog())); + menu->addAction(tr("Find Next"), + this, SLOT(doOutputFindNext()), QKeySequence::FindNext); + menu->addAction(tr("Find Previous"), + this, SLOT(doOutputFindPrev()), QKeySequence::FindPrevious); + + menu->exec(this->Output->mapToGlobal(pt)); + delete menu; +} + void CMakeSetupDialog::doOutputFindDialog() { QStringList strings(this->FindHistory); diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h index 88fefcc..100834d 100644 --- a/Source/QtDialog/CMakeSetupDialog.h +++ b/Source/QtDialog/CMakeSetupDialog.h @@ -77,6 +77,7 @@ protected slots: bool doConfigureInternal(); bool doGenerateInternal(); void exitLoop(int); + void doOutputContextMenu(const QPoint &); void doOutputFindDialog(); void doOutputFindNext(bool directionForward = true); void doOutputFindPrev(); -- cgit v0.12 From 7be2d8acc64e371748b8758f16b7aa6bdaf3fd0f Mon Sep 17 00:00:00 2001 From: Marc Bartholomaeus Date: Thu, 18 Apr 2013 01:03:02 +0200 Subject: cmake-gui: Change shortcut of the search field from Ctrl-F to Alt-E Ctrl-F is now used by "Find in Output". Signed-off-by: Alex Neundorf --- Source/QtDialog/CMakeSetupDialog.cxx | 9 +++------ Source/QtDialog/CMakeSetupDialog.ui | 5 ++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 0be45c6..fb74aaf 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -125,7 +125,8 @@ CMakeSetupDialog::CMakeSetupDialog() #endif ToolsMenu->addSeparator(); ToolsMenu->addAction(tr("&Find in Output..."), - this, SLOT(doOutputFindDialog())); + this, SLOT(doOutputFindDialog()), + QKeySequence::Find); ToolsMenu->addAction(tr("&Find Next"), this, SLOT(doOutputFindNext()), QKeySequence::FindNext); @@ -165,10 +166,6 @@ CMakeSetupDialog::CMakeSetupDialog() QObject::connect(a, SIGNAL(triggered(bool)), this, SLOT(doHelp())); - QShortcut* filterShortcut = new QShortcut(QKeySequence::Find, this); - QObject::connect(filterShortcut, SIGNAL(activated()), - this, SLOT(startSearch())); - this->setAcceptDrops(true); // get the saved binary directories @@ -1170,7 +1167,7 @@ void CMakeSetupDialog::doOutputContextMenu(const QPoint &pt) menu->addSeparator(); menu->addAction(tr("Find..."), - this, SLOT(doOutputFindDialog())); + this, SLOT(doOutputFindDialog()), QKeySequence::Find); menu->addAction(tr("Find Next"), this, SLOT(doOutputFindNext()), QKeySequence::FindNext); menu->addAction(tr("Find Previous"), diff --git a/Source/QtDialog/CMakeSetupDialog.ui b/Source/QtDialog/CMakeSetupDialog.ui index dc8ee3f..98da249 100644 --- a/Source/QtDialog/CMakeSetupDialog.ui +++ b/Source/QtDialog/CMakeSetupDialog.ui @@ -107,7 +107,10 @@ - Search: + S&earch: + + + Search -- cgit v0.12 From 6e57724fc3f95f954666fbe9c33ea14e22c858a3 Mon Sep 17 00:00:00 2001 From: Marc Bartholomaeus Date: Thu, 18 Apr 2013 01:06:00 +0200 Subject: cmake-gui: Add function for going to next error message in Output window Using new shortcuts: F8 (Visual Studio) and Ctrl-. (Eclipse) Signed-off-by: Alex Neundorf --- Source/QtDialog/CMakeSetupDialog.cxx | 68 ++++++++++++++++++++++++++++++++++-- Source/QtDialog/CMakeSetupDialog.h | 1 + 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index fb74aaf..91279fd 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -133,6 +133,11 @@ CMakeSetupDialog::CMakeSetupDialog() ToolsMenu->addAction(tr("&Find Previous"), this, SLOT(doOutputFindPrev()), QKeySequence::FindPrevious); + ToolsMenu->addAction(tr("Goto Next Error"), + this, SLOT(doOutputErrorNext()), + QKeySequence(Qt::Key_F8)); // in Visual Studio + new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Period), + this, SLOT(doOutputErrorNext())); // in Eclipse QMenu* OptionsMenu = this->menuBar()->addMenu(tr("&Options")); this->SuppressDevWarningsAction = @@ -649,7 +654,13 @@ void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent) void CMakeSetupDialog::error(const QString& msg) { this->Output->setCurrentCharFormat(this->ErrorFormat); - this->Output->append(msg); + //QTextEdit will terminate the msg with a ParagraphSeparator, but it also replaces + //all newlines with ParagraphSeparators. By replacing the newlines by ourself, one + //error msg will be one paragraph. + QString paragraph(msg); + paragraph.replace(QLatin1Char('\n'), QChar::LineSeparator); + this->Output->append(paragraph); + } void CMakeSetupDialog::message(const QString& msg) @@ -1172,6 +1183,9 @@ void CMakeSetupDialog::doOutputContextMenu(const QPoint &pt) this, SLOT(doOutputFindNext()), QKeySequence::FindNext); menu->addAction(tr("Find Previous"), this, SLOT(doOutputFindPrev()), QKeySequence::FindPrevious); + menu->addSeparator(); + menu->addAction(tr("Goto Next Error"), + this, SLOT(doOutputErrorNext()), QKeySequence(Qt::Key_F8)); menu->exec(this->Output->mapToGlobal(pt)); delete menu; @@ -1182,7 +1196,9 @@ void CMakeSetupDialog::doOutputFindDialog() QStringList strings(this->FindHistory); QString selection = this->Output->textCursor().selectedText(); - if (!selection.isEmpty() && !selection.contains(QChar::ParagraphSeparator)) + if (!selection.isEmpty() && + !selection.contains(QChar::ParagraphSeparator) && + !selection.contains(QChar::LineSeparator)) { strings.push_front(selection); } @@ -1239,3 +1255,51 @@ void CMakeSetupDialog::doOutputFindNext(bool directionForward) this->Output->setTextCursor(cursor); } } + +void CMakeSetupDialog::doOutputErrorNext() +{ + QTextCursor cursor = this->Output->textCursor(); + bool atEnd = false; + + // move cursor out of current error-block + if (cursor.blockCharFormat() == this->ErrorFormat) + { + atEnd = !cursor.movePosition(QTextCursor::NextBlock); + } + + // move cursor to next error-block + while (cursor.blockCharFormat() != this->ErrorFormat && !atEnd) + { + atEnd = !cursor.movePosition(QTextCursor::NextBlock); + } + + if (atEnd) + { + // first search found nothing, wrap around and search again + atEnd = !cursor.movePosition(QTextCursor::Start); + + // move cursor to next error-block + while (cursor.blockCharFormat() != this->ErrorFormat && !atEnd) + { + atEnd = !cursor.movePosition(QTextCursor::NextBlock); + } + } + + if (!atEnd) + { + cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); + + QTextCharFormat selectionFormat; + selectionFormat.setBackground(Qt::yellow); + QTextEdit::ExtraSelection extraSelection = {cursor, selectionFormat}; + this->Output->setExtraSelections(QList() + << extraSelection); + + // make the whole error-block visible + this->Output->setTextCursor(cursor); + + // remove the selection to see the extraSelection + cursor.setPosition(cursor.anchor()); + this->Output->setTextCursor(cursor); + } +} diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h index 100834d..963c7d1 100644 --- a/Source/QtDialog/CMakeSetupDialog.h +++ b/Source/QtDialog/CMakeSetupDialog.h @@ -81,6 +81,7 @@ protected slots: void doOutputFindDialog(); void doOutputFindNext(bool directionForward = true); void doOutputFindPrev(); + void doOutputErrorNext(); protected: -- cgit v0.12 From f92d7e7f9541f74357d55ccc6781a8fe6c3bb8e9 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Thu, 18 Apr 2013 19:59:11 +0200 Subject: cmake-gui: use shortcut F only for "Find in Output" Before it was used also for "Find Next" and "Find Previous" Alex --- Source/QtDialog/CMakeSetupDialog.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 91279fd..4d62f72 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -127,10 +127,10 @@ CMakeSetupDialog::CMakeSetupDialog() ToolsMenu->addAction(tr("&Find in Output..."), this, SLOT(doOutputFindDialog()), QKeySequence::Find); - ToolsMenu->addAction(tr("&Find Next"), + ToolsMenu->addAction(tr("Find Next"), this, SLOT(doOutputFindNext()), QKeySequence::FindNext); - ToolsMenu->addAction(tr("&Find Previous"), + ToolsMenu->addAction(tr("Find Previous"), this, SLOT(doOutputFindPrev()), QKeySequence::FindPrevious); ToolsMenu->addAction(tr("Goto Next Error"), -- cgit v0.12 From f9eee7f1833856f690b4a8ef5f5aa44d9ccb8114 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 25 Apr 2013 09:07:45 -0400 Subject: Windows: Search '/' prefix only when cross compiling (#10994) Commit dac78148 (...makes the mingw cross compiler work out of the box..., 2007-08-02) added to CMAKE_SYSTEM_PROGRAM_PATH and CMAKE_SYSTEM_LIBRARY_PATH paths like "/bin" and "/lib" with no Windows drive letter so that cross-compiling to Windows from Linux would search these paths under CMAKE_FIND_ROOT_PATH. Later commit 2a782880 (...use CMAKE_SYSTEM_PREFIX_PATH when possible, 2008-01-16) generalized this approach by instead adding "/" to CMAKE_SYSTEM_PREFIX_PATH. Both commits assumed that the paths would never match anything on Windows hosts without a drive letter. However, Windows evaluates these paths relative to the current working drive letter so find_* commands may report paths like "/lib/..." when paths like "c:/lib/..." exist on what happens to be current drive. Such drive-less paths are not reliable when the working drive changes, so we should not use them. Fix WindowsPaths.cmake to add '/' to CMAKE_SYSTEM_PREFIX_PATH only when cross-compiling to Windows from a non-Windows host. This will avoid searching and finding local paths without a drive letter on Windows. --- Modules/Platform/WindowsPaths.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/Platform/WindowsPaths.cmake b/Modules/Platform/WindowsPaths.cmake index bd31da0..fc921d7 100644 --- a/Modules/Platform/WindowsPaths.cmake +++ b/Modules/Platform/WindowsPaths.cmake @@ -77,10 +77,12 @@ list(APPEND CMAKE_SYSTEM_PREFIX_PATH "${_CMAKE_INSTALL_DIR}") list(APPEND CMAKE_SYSTEM_PREFIX_PATH # Project install destination. "${CMAKE_INSTALL_PREFIX}" + ) +if(CMAKE_CROSSCOMPILING AND NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") # MinGW (useful when cross compiling from linux with CMAKE_FIND_ROOT_PATH set) - / - ) + list(APPEND CMAKE_SYSTEM_PREFIX_PATH /) +endif() list(APPEND CMAKE_SYSTEM_INCLUDE_PATH ) -- cgit v0.12 From 327c982faf6a9f119b6547c099a6bbf2ee82e517 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 25 Apr 2013 08:58:57 -0400 Subject: KWSys 2013-04-25 (709fb5c1) Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ 709fb5c1 | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' 2d263bc3..709fb5c1 Brad King (1): 709fb5c1 SystemTools: Fix FileIsDirectory for Windows drive letter roots Change-Id: Ie71305c3787806599f79a3cc7096e74e7237e986 --- SystemTools.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SystemTools.cxx b/SystemTools.cxx index 22bf193..d816b17 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -2741,11 +2741,11 @@ bool SystemTools::FileIsDirectory(const char* name) return false; } - // Remove any trailing slash from the name. + // Remove any trailing slash from the name except in a root component. char buffer[KWSYS_SYSTEMTOOLS_MAXPATH]; size_t last = length-1; if(last > 0 && (name[last] == '/' || name[last] == '\\') - && strcmp(name, "/") !=0) + && strcmp(name, "/") !=0 && name[last-1] != ':') { memcpy(buffer, name, last); buffer[last] = 0; -- cgit v0.12 From c46b46b6285e4c893341659f0be8ac306060bf9b Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 22 Mar 2013 15:50:38 -0700 Subject: Use GmakeErrorParser instead of deprecated MakeErrorParser (fixes bug 0013699) --- Source/cmExtraEclipseCDT4Generator.cxx | 16 +++++++++++++++- Source/cmExtraEclipseCDT4Generator.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 97ab086..22a1020 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -39,6 +39,7 @@ cmExtraEclipseCDT4Generator this->SupportsVirtualFolders = true; this->GenerateLinkedResources = true; + this->SupportsGmakeErrorParser = true; } //---------------------------------------------------------------------------- @@ -77,6 +78,10 @@ void cmExtraEclipseCDT4Generator::Generate() { this->SupportsVirtualFolders = false; } + if (version < 3007) // 3.7 is Indigo + { + this->SupportsGmakeErrorParser = false; + } } } @@ -403,8 +408,17 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() { fout << "org.eclipse.cdt.core.ICCErrorParser;"; } + + if (this->SupportsGmakeErrorParser) + { + fout << "org.eclipse.cdt.core.GmakeErrorParser;"; + } + else + { + fout << "org.eclipse.cdt.core.MakeErrorParser;"; + } + fout << - "org.eclipse.cdt.core.MakeErrorParser;" "org.eclipse.cdt.core.GCCErrorParser;" "org.eclipse.cdt.core.GASErrorParser;" "org.eclipse.cdt.core.GLDErrorParser;" diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h index 31ad68d..b31cce7 100644 --- a/Source/cmExtraEclipseCDT4Generator.h +++ b/Source/cmExtraEclipseCDT4Generator.h @@ -111,6 +111,7 @@ private: bool GenerateSourceProject; bool GenerateLinkedResources; bool SupportsVirtualFolders; + bool SupportsGmakeErrorParser; }; -- cgit v0.12 From b9c1f3b78afe63a172f641365559b15e8be831b8 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 30 Apr 2013 17:21:50 -0700 Subject: Eclipse: Add a missing space in the documentation --- Source/cmExtraEclipseCDT4Generator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 97ab086..083d91e 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -50,7 +50,7 @@ void cmExtraEclipseCDT4Generator entry.Full = "Project files for Eclipse will be created in the top directory. " "In out of source builds, a linked resource to the top level source " - "directory will be created." + "directory will be created. " "Additionally a hierarchy of makefiles is generated into the " "build tree. The appropriate make program can build the project through " "the default make target. A \"make install\" target is also provided."; -- cgit v0.12 From 40566ef2f808cc5bffa5109250f0edf864da5f7e Mon Sep 17 00:00:00 2001 From: David Golub Date: Thu, 2 May 2013 09:47:08 -0400 Subject: CPack/NSIS: Obtain path from which to uninstall from registry (#14124) Without this, when CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL is set, the installer tries to uninstall the old version from the default installation path for the new version, rather than using the path from the registry where the old version is installed. --- Modules/NSIS.template.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in index 59a444b..76310af 100644 --- a/Modules/NSIS.template.in +++ b/Modules/NSIS.template.in @@ -916,7 +916,9 @@ Function .onInit ;Run the uninstaller uninst: ClearErrors - ExecWait '$0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file + StrLen $2 "\Uninstall.exe" + StrCpy $3 $0 -$2 # remove "\Uninstall.exe" from UninstallString to get path + ExecWait '$0 _?=$3' ;Do not copy the uninstaller to a temp file IfErrors uninst_failed inst uninst_failed: -- cgit v0.12 From a2bc47df1a55530cb370590003836033d1b31e13 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 27 Feb 2013 15:33:39 -0500 Subject: Recognize ld with toolchain prefix (#13960) Teach CMAKE_PARSE_IMPLICIT_LINK_INFO to recognize linker invocations of the form "-ld" e.g. "x86_64-pc-linux-gnu-ld". --- Modules/CMakeParseImplicitLinkInfo.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake index 80e0218..fa03630 100644 --- a/Modules/CMakeParseImplicitLinkInfo.cmake +++ b/Modules/CMakeParseImplicitLinkInfo.cmake @@ -29,7 +29,7 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj endif() # Construct a regex to match linker lines. It must match both the # whole line and just the command (argv[0]). - set(linker_regex "^( *|.*[/\\])(${linker}|ld|collect2)[^/\\]*( |$)") + set(linker_regex "^( *|.*[/\\])(${linker}|([^/\\]+-)?ld|collect2)[^/\\]*( |$)") set(linker_exclude_regex "collect2 version ") set(log "${log} link line regex: [${linker_regex}]\n") string(REGEX REPLACE "\r?\n" ";" output_lines "${text}") -- cgit v0.12 From 20104ab2d82d6cf0aecbc8ea690465d08719fbe7 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 6 May 2013 18:10:55 +0200 Subject: Test transitive includes from setting the LINK_LIBRARIES property. Commit b8259c3d (Centralize maintenance of usage requirement include directories, 2013-04-29) changed the handling of the property. Previously setting the property directly instead of via target_link_libraries would not result in transitive include directory handling. --- Tests/RunCMake/include_directories/DebugIncludes-stderr.txt | 9 +++++++++ Tests/RunCMake/include_directories/DebugIncludes.cmake | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt b/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt index 63aec90..71e6456 100644 --- a/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt +++ b/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt @@ -42,3 +42,12 @@ CMake Debug Log at DebugIncludes.cmake:30 \(target_link_libraries\): Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) ++ +CMake Debug Log at DebugIncludes.cmake:55 \(set_property\): + Used includes for target lll: + + \* .*/Tests/RunCMake/include_directories/nine + \* .*/Tests/RunCMake/include_directories/ten + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/include_directories/DebugIncludes.cmake b/Tests/RunCMake/include_directories/DebugIncludes.cmake index de36899..bbc9e46 100644 --- a/Tests/RunCMake/include_directories/DebugIncludes.cmake +++ b/Tests/RunCMake/include_directories/DebugIncludes.cmake @@ -45,3 +45,11 @@ function(some_function) endfunction() some_function() + +add_library(bar "${CMAKE_CURRENT_BINARY_DIR}/DebugIncludes.cpp") +target_include_directories(bar + INTERFACE + "${CMAKE_CURRENT_SOURCE_DIR}/nine" + "${CMAKE_CURRENT_SOURCE_DIR}/ten" +) +set_property(TARGET lll APPEND PROPERTY LINK_LIBRARIES bar) -- cgit v0.12 From ecd11a25cc83eeae369011b1ca9e4a8498f10437 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 6 May 2013 12:30:56 +0000 Subject: ExternalProject: Allow blank SVN_USERNAME/SVN_PASSWORD (#14128) With SVN_USERNAME "" SVN_PASSWORD "" in an ExternalProject_Add() call, the blank username and password will be passed to the svn checkout/update step commands. --- Modules/ExternalProject.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 40e14d5..6afdb97 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1251,10 +1251,10 @@ function(_ep_add_download_command name) get_filename_component(work_dir "${source_dir}" PATH) set(comment "Performing download step (SVN checkout) for '${name}'") set(svn_user_pw_args "") - if(svn_username) + if(DEFINED svn_username) set(svn_user_pw_args ${svn_user_pw_args} "--username=${svn_username}") endif() - if(svn_password) + if(DEFINED svn_password) set(svn_user_pw_args ${svn_user_pw_args} "--password=${svn_password}") endif() if(svn_trust_cert) @@ -1473,10 +1473,10 @@ function(_ep_add_update_command name) get_property(svn_password TARGET ${name} PROPERTY _EP_SVN_PASSWORD) get_property(svn_trust_cert TARGET ${name} PROPERTY _EP_SVN_TRUST_CERT) set(svn_user_pw_args "") - if(svn_username) + if(DEFINED svn_username) set(svn_user_pw_args ${svn_user_pw_args} "--username=${svn_username}") endif() - if(svn_password) + if(DEFINED svn_password) set(svn_user_pw_args ${svn_user_pw_args} "--password=${svn_password}") endif() if(svn_trust_cert) -- cgit v0.12 From d0cdc687353cbba0ab844a360a23c71945c8370b Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 6 May 2013 10:29:55 -0400 Subject: KWSys 2013-05-06 (f4928d44) Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ f4928d44 | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' 709fb5c1..f4928d44 Andreas Mohr (1): f4928d44 Fix spelling and typos in comments and method documentation Change-Id: I64109c176370a9f10a22da21bc81bd9306a80431 --- CommandLineArguments.hxx.in | 10 +++++----- SharedForward.h.in | 2 +- SystemInformation.hxx.in | 4 ++-- SystemTools.cxx | 2 +- SystemTools.hxx.in | 2 +- testDynamicLoader.cxx | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CommandLineArguments.hxx.in b/CommandLineArguments.hxx.in index 68e9600..cbf6ee3 100644 --- a/CommandLineArguments.hxx.in +++ b/CommandLineArguments.hxx.in @@ -44,7 +44,7 @@ struct CommandLineArgumentsCallbackStructure; * * For the variable interface you associate variable with each argument. When * the argument is specified, the variable is set to the specified value casted - * to the apropriate type. For boolean (NO_ARGUMENT), the value is "1". + * to the appropriate type. For boolean (NO_ARGUMENT), the value is "1". * * Both interfaces can be used at the same time. * @@ -99,7 +99,7 @@ public: STRING_TYPE, // The variable is string (char*) STL_STRING_TYPE, // The variable is string (char*) VECTOR_INT_TYPE, // The variable is integer (int) - VECTOR_BOOL_TYPE, // The vairable is boolean (bool) + VECTOR_BOOL_TYPE, // The variable is boolean (bool) VECTOR_DOUBLE_TYPE, // The variable is float (double) VECTOR_STRING_TYPE, // The variable is string (char*) VECTOR_STL_STRING_TYPE, // The variable is string (char*) @@ -128,7 +128,7 @@ public: void ProcessArgument(const char* arg); /** - * This method will parse arguments and call apropriate methods. + * This method will parse arguments and call appropriate methods. */ int Parse(); @@ -144,7 +144,7 @@ public: /** * Add handler for argument which is going to set the variable to the * specified value. If the argument is specified, the option is casted to the - * apropriate type. + * appropriate type. */ void AddArgument(const char* argument, ArgumentTypeEnum type, bool* variable, const char* help); @@ -160,7 +160,7 @@ public: /** * Add handler for argument which is going to set the variable to the * specified value. If the argument is specified, the option is casted to the - * apropriate type. This will handle the multi argument values. + * appropriate type. This will handle the multi argument values. */ void AddArgument(const char* argument, ArgumentTypeEnum type, kwsys_stl::vector* variable, const char* help); diff --git a/SharedForward.h.in b/SharedForward.h.in index 8521099..8bbc74a 100644 --- a/SharedForward.h.in +++ b/SharedForward.h.in @@ -772,7 +772,7 @@ static int kwsys_shared_forward_get_settings(const char* self_path, const char** dir; for(dir = search_path; *dir; ++dir) { - /* Add seperator between path components. */ + /* Add separator between path components. */ if(dir != search_path) { strcat(ldpath, kwsys_shared_forward_path_sep); diff --git a/SystemInformation.hxx.in b/SystemInformation.hxx.in index 8f4cb4e..f7c454e 100644 --- a/SystemInformation.hxx.in +++ b/SystemInformation.hxx.in @@ -117,8 +117,8 @@ public: // Get total system RAM in units of KiB available to this process. // This may differ from the host available if a per-process resource // limit is applied. per-process memory limits are applied on unix - // system via rlimit api. Resource limits that are not imposed via - // rlimit api may be reported to us via an application specified + // system via rlimit API. Resource limits that are not imposed via + // rlimit API may be reported to us via an application specified // environment variable. LongLong GetProcMemoryAvailable( const char *hostLimitEnvVarName=NULL, diff --git a/SystemTools.cxx b/SystemTools.cxx index d816b17..394d65e 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -4002,7 +4002,7 @@ void SystemTools::SplitProgramFromArgs(const char* path, args = dir.substr(spacePos, dir.size()-spacePos); return; } - // Now try and find the the program in the path + // Now try and find the program in the path findProg = SystemTools::FindProgram(tryProg.c_str(), e); if(findProg.size()) { diff --git a/SystemTools.hxx.in b/SystemTools.hxx.in index 9c56e96..e55d431 100644 --- a/SystemTools.hxx.in +++ b/SystemTools.hxx.in @@ -766,7 +766,7 @@ public: static kwsys_stl::string GetCurrentWorkingDirectory(bool collapse =true); /** - * Change directory the the directory specified + * Change directory to the directory specified */ static int ChangeDirectory(const char* dir); diff --git a/testDynamicLoader.cxx b/testDynamicLoader.cxx index 61c1572..dd6d603 100644 --- a/testDynamicLoader.cxx +++ b/testDynamicLoader.cxx @@ -109,9 +109,9 @@ int testDynamicLoader(int argc, char *argv[]) // dlopen() on Syllable before 11/22/2007 doesn't return 0 on error #ifndef __SYLLABLE__ - // Make sure that inexistant lib is giving correct result + // Make sure that inexistent lib is giving correct result res += TestDynamicLoader("azerty_", "foo_bar",0,0,0); - // Make sure that random binary file cannnot be assimilated as dylib + // Make sure that random binary file cannot be assimilated as dylib res += TestDynamicLoader(TEST_SYSTEMTOOLS_BIN_FILE, "wp",0,0,0); #endif -- cgit v0.12 From 86832cecd59b3a56c5a609742b43e5b1c9524c66 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Wed, 1 May 2013 10:30:46 +0200 Subject: Fix spelling and typos (affecting users) --- Source/cmAddSubDirectoryCommand.h | 2 +- Source/cmLocalVisualStudio7Generator.cxx | 14 +++++++------- Source/cmake.cxx | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/cmAddSubDirectoryCommand.h b/Source/cmAddSubDirectoryCommand.h index fa322b0..e7f907c 100644 --- a/Source/cmAddSubDirectoryCommand.h +++ b/Source/cmAddSubDirectoryCommand.h @@ -61,7 +61,7 @@ public: " add_subdirectory(source_dir [binary_dir] \n" " [EXCLUDE_FROM_ALL])\n" "Add a subdirectory to the build. The source_dir specifies the " - "directory in which the source CmakeLists.txt and code files are " + "directory in which the source CMakeLists.txt and code files are " "located. If it is a relative " "path it will be evaluated with respect to the current " "directory (the typical usage), but it may also be an absolute path. " diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 7d0bc67..2dfbfb8 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -202,7 +202,7 @@ void cmLocalVisualStudio7Generator::WriteStampFiles() stampName += "/"; stampName += "generate.stamp"; std::ofstream stamp(stampName.c_str()); - stamp << "# CMake generation timestamp file this directory.\n"; + stamp << "# CMake generation timestamp file for this directory.\n"; // Create a helper file so CMake can determine when it is run // through the rule created by CreateVCProjBuildRule whether it @@ -443,12 +443,12 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] = {"InlineFunctionExpansion", "Ob0", "no inlines", "0", 0}, {"InlineFunctionExpansion", "Ob1", "when inline keyword", "1", 0}, {"InlineFunctionExpansion", "Ob2", "any time you can inline", "2", 0}, - {"RuntimeLibrary", "MTd", "Multithreded debug", "1", 0}, - {"RuntimeLibrary", "MT", "Multithreded", "0", 0}, - {"RuntimeLibrary", "MDd", "Multithreded dll debug", "3", 0}, - {"RuntimeLibrary", "MD", "Multithreded dll", "2", 0}, - {"RuntimeLibrary", "MLd", "Sinble Thread debug", "5", 0}, - {"RuntimeLibrary", "ML", "Sinble Thread", "4", 0}, + {"RuntimeLibrary", "MTd", "Multithreaded debug", "1", 0}, + {"RuntimeLibrary", "MT", "Multithreaded", "0", 0}, + {"RuntimeLibrary", "MDd", "Multithreaded dll debug", "3", 0}, + {"RuntimeLibrary", "MD", "Multithreaded dll", "2", 0}, + {"RuntimeLibrary", "MLd", "Single Thread debug", "5", 0}, + {"RuntimeLibrary", "ML", "Single Thread", "4", 0}, {"StructMemberAlignment", "Zp16", "struct align 16 byte ", "5", 0}, {"StructMemberAlignment", "Zp1", "struct align 1 byte ", "1", 0}, {"StructMemberAlignment", "Zp2", "struct align 2 byte ", "2", 0}, diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e2f80d1..ca6b661 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -128,7 +128,7 @@ void cmNeedBackwardsCompatibility(const std::string& variable, "by CMake in versions prior to 1.6. To fix this you might need to set " "the cache value of CMAKE_BACKWARDS_COMPATIBILITY to 1.4 or less. If " "you are writing a CMakeLists file, (or have already set " - "CMAKE_BACKWARDS_COMPATABILITY to 1.4 or less) then you probably need " + "CMAKE_BACKWARDS_COMPATIBILITY to 1.4 or less) then you probably need " "to include a CMake module to test for the feature this variable " "defines."; cmSystemTools::Error(message.c_str()); @@ -4045,7 +4045,7 @@ static bool cmakeCheckStampFile(const char* stampName) // TODO: Teach cmGeneratedFileStream to use a random temp file (with // multiple tries in unlikely case of conflict) and use that here. std::ofstream stamp(stampTemp); - stamp << "# CMake generation timestamp file this directory.\n"; + stamp << "# CMake generation timestamp file for this directory.\n"; } if(cmSystemTools::RenameFile(stampTemp, stampName)) { -- cgit v0.12 From ddac8d3d2d027dd50d729918078f57628855a568 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Wed, 1 May 2013 11:36:14 +0200 Subject: Fix spelling and typos (affecting binary data / module messages) --- Modules/FindCUDA/make2cmake.cmake | 2 +- Source/CPack/cmCPackDocumentVariables.cxx | 2 +- Source/cmAddDefinitionsCommand.h | 2 +- Source/cmCTest.cxx | 2 +- Source/cmCacheManager.cxx | 2 +- Source/cmDocumentGeneratorExpressions.h | 2 +- Source/cmDocumentVariables.cxx | 38 ++++++++++++---------- Source/cmDocumentation.cxx | 4 +-- Source/cmExportCommand.cxx | 2 +- Source/cmFileCommand.cxx | 4 +-- Source/cmGlobalGenerator.cxx | 2 +- Source/cmLocalGenerator.cxx | 2 +- Source/cmMakefile.cxx | 6 ++-- Source/cmPolicies.cxx | 7 ++-- Source/cmSourceFile.cxx | 4 +-- Source/cmSubdirCommand.cxx | 2 +- Source/cmTarget.cxx | 6 ++-- Source/cmake.cxx | 2 +- Source/cmakemain.cxx | 6 ++-- Source/ctest.cxx | 6 ++-- Tests/CompatibleInterface/CMakeLists.txt | 4 +-- Tests/ReturnTest/CMakeLists.txt | 2 +- .../BadNonTarget-stderr.txt | 4 +-- .../BadNonTarget.cmake | 2 +- .../libarchive/archive_write_set_format_7zip.c | 2 +- .../libarchive/archive_write_set_format_xar.c | 6 ++-- 26 files changed, 64 insertions(+), 59 deletions(-) diff --git a/Modules/FindCUDA/make2cmake.cmake b/Modules/FindCUDA/make2cmake.cmake index c2405f4..1b53d17 100644 --- a/Modules/FindCUDA/make2cmake.cmake +++ b/Modules/FindCUDA/make2cmake.cmake @@ -63,7 +63,7 @@ if (${depend_text} MATCHES ".+") if (EXISTS "/${file}") set(file "/${file}") else() - message(WARNING " Removing non-existant dependency file: ${file}") + message(WARNING " Removing non-existent dependency file: ${file}") set(file "") endif() endif() diff --git a/Source/CPack/cmCPackDocumentVariables.cxx b/Source/CPack/cmCPackDocumentVariables.cxx index 6a841fa..1dfaaf9 100644 --- a/Source/CPack/cmCPackDocumentVariables.cxx +++ b/Source/CPack/cmCPackDocumentVariables.cxx @@ -60,7 +60,7 @@ void cmCPackDocumentVariables::DefineVariables(cmake* cm) "It is usually invoked like this:\n" " make DESTDIR=/home/john install\n" "which will install the concerned software using the" - " installation prefix, e.g. \"/usr/local\" pre-pended with " + " installation prefix, e.g. \"/usr/local\" prepended with " "the DESTDIR value which finally gives \"/home/john/usr/local\"." " When preparing a package, CPack first installs the items to be " "packaged in a local (to the build tree) directory by using the " diff --git a/Source/cmAddDefinitionsCommand.h b/Source/cmAddDefinitionsCommand.h index 7bb3767..6705d11 100644 --- a/Source/cmAddDefinitionsCommand.h +++ b/Source/cmAddDefinitionsCommand.h @@ -63,7 +63,7 @@ public: "but it was originally intended to add preprocessor definitions. " "Flags beginning in -D or /D that look like preprocessor definitions " "are automatically added to the COMPILE_DEFINITIONS property for " - "the current directory. Definitions with non-trival values may be " + "the current directory. Definitions with non-trivial values may be " "left in the set of flags instead of being converted for reasons of " "backwards compatibility. See documentation of the directory, " "target, and source file COMPILE_DEFINITIONS properties for details " diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 322a6a2..9a042c4 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2413,7 +2413,7 @@ int cmCTest::Run(std::vector &args, std::string* output) #endif if(retv != 0) { - cmCTestLog(this, DEBUG, "build and test failing returing: " << retv + cmCTestLog(this, DEBUG, "build and test failing returning: " << retv << std::endl); } return retv; diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 3d5b24b..864df8e 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -491,7 +491,7 @@ bool cmCacheManager::SaveCache(const char* path) << "# The syntax for the file is as follows:\n" << "# KEY:TYPE=VALUE\n" << "# KEY is the name of a variable in the cache.\n" - << "# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT " + << "# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT " "TYPE!." << std::endl << "# VALUE is the current value for the KEY.\n\n"; diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h index 6cc3f25..7edc8ff 100644 --- a/Source/cmDocumentGeneratorExpressions.h +++ b/Source/cmDocumentGeneratorExpressions.h @@ -13,7 +13,7 @@ #define cmDocumentGeneratorExpressions_h #define CM_DOCUMENT_ADD_TEST_GENERATOR_EXPRESSIONS \ - "Generator expressions are evaluted during build system generation " \ + "Generator expressions are evaluated during build system generation " \ "to produce information specific to each build configuration. " \ "Valid expressions are:\n" \ " $<0:...> = empty string (ignores \"...\")\n" \ diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 50509a0..1ea1c72 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -10,7 +10,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_AR", cmProperty::VARIABLE, "Name of archiving tool for static libraries.", - "This specifies name of the program that creates archive " + "This specifies the name of the program that creates archive " "or static libraries.",false, "Variables that Provide Information"); @@ -152,7 +152,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_CACHE_MAJOR_VERSION", cmProperty::VARIABLE, "Major version of CMake used to create the CMakeCache.txt file", - "This is stores the major version of CMake used to " + "This stores the major version of CMake used to " "write a CMake cache file. It is only different when " "a different version of CMake is run on a previously " "created cache file.", false, @@ -160,7 +160,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_CACHE_MINOR_VERSION", cmProperty::VARIABLE, "Minor version of CMake used to create the CMakeCache.txt file", - "This is stores the minor version of CMake used to " + "This stores the minor version of CMake used to " "write a CMake cache file. It is only different when " "a different version of CMake is run on a previously " "created cache file.", false, @@ -169,7 +169,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_CACHE_PATCH_VERSION", cmProperty::VARIABLE, "Patch version of CMake used to create the CMakeCache.txt file", - "This is stores the patch version of CMake used to " + "This stores the patch version of CMake used to " "write a CMake cache file. It is only different when " "a different version of CMake is run on a previously " "created cache file.", false, @@ -616,7 +616,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_INSTALL_PREFIX", cmProperty::VARIABLE, "Install directory used by install.", "If \"make install\" is invoked or INSTALL is built" - ", this directory is pre-pended onto all install " + ", this directory is prepended onto all install " "directories. This variable defaults to /usr/local" " on UNIX and c:/Program Files on Windows.\n" "On UNIX one can use the DESTDIR mechanism in order" @@ -627,11 +627,11 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "It is usually invoked like this:\n" " make DESTDIR=/home/john install\n" "which will install the concerned software using the" - " installation prefix, e.g. \"/usr/local\" pre-pended with " + " installation prefix, e.g. \"/usr/local\" prepended with " "the DESTDIR value which finally gives \"/home/john/usr/local\".\n" "WARNING: DESTDIR may not be used on Windows because installation" " prefix usually contains a drive letter like in \"C:/Program Files\"" - " which cannot be pre-pended with some other prefix." + " which cannot be prepended with some other prefix." ,false, "Variables That Change Behavior"); @@ -792,7 +792,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "This switch should be used during the initial CMake run. Otherwise if " "the package has already been found in a previous CMake run, the " "variables which have been stored in the cache will still be there. " - "In the case it is recommended to remove the cache variables for " + "In that case it is recommended to remove the cache variables for " "this package from the cache using the cache editor or cmake -U", false, "Variables That Change Behavior"); @@ -888,7 +888,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) " an ABSOLUTE DESTINATION path.", "This variable is defined by CMake-generated cmake_install.cmake " "scripts." - " It can be used (read-only) by program or script that source those" + " It can be used (read-only) by programs or scripts that source those" " install scripts. This is used by some CPack generators (e.g. RPM).", false, "Variables That Change Behavior"); @@ -898,7 +898,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Ask cmake_install.cmake script to warn each time a file with " "absolute INSTALL DESTINATION is encountered.", "This variable is used by CMake-generated cmake_install.cmake" - " scripts. If ones set this variable to ON while running the" + " scripts. If one sets this variable to ON while running the" " script, it may get warning messages from the script.", false, "Variables That Change Behavior"); @@ -909,7 +909,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "The fatal error is emitted before the installation of " "the offending file takes place." " This variable is used by CMake-generated cmake_install.cmake" - " scripts. If ones set this variable to ON while running the" + " scripts. If one sets this variable to ON while running the" " script, it may get fatal error messages from the script.",false, "Variables That Change Behavior"); @@ -1110,7 +1110,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_HOST_APPLE", cmProperty::VARIABLE, - "True for Apple OSXoperating systems.", + "True for Apple OSX operating systems.", "Set to true when the host system is Apple OSX.", false, "Variables That Describe the System"); @@ -1395,7 +1395,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_USE_RELATIVE_PATHS", cmProperty::VARIABLE, "Use relative paths (May not work!).", - "If this is set to TRUE, then the CMake will use " + "If this is set to TRUE, then CMake will use " "relative paths between the source and binary tree. " "This option does not work for more complicated " "projects, and relative paths are used when possible. " @@ -1591,7 +1591,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE__COMPILE_OBJECT", cmProperty::VARIABLE, "Rule variable to compile a single object file.", "This is a rule variable that tells CMake how to " - "compile a single object file for for the language .",false, + "compile a single object file for the language ." + ,false, "Variables for Languages"); cm->DefineProperty @@ -1727,8 +1728,9 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE__LINK_EXECUTABLE ", cmProperty::VARIABLE, - "Rule variable to link and executable.", - "Rule variable to link and executable for the given language.",false, + "Rule variable to link an executable.", + "Rule variable to link an executable for the given language." + ,false, "Variables for Languages"); cm->DefineProperty @@ -1742,7 +1744,9 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE__SOURCE_FILE_EXTENSIONS", cmProperty::VARIABLE, "Extensions of source files for the given language.", "This is the list of extensions for a " - "given languages source files.",false,"Variables for Languages"); + "given language's source files." + ,false, + "Variables for Languages"); cm->DefineProperty( "CMAKE__COMPILER_LOADED", cmProperty::VARIABLE, diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index debde3b..4edacbb 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -53,7 +53,7 @@ static const char *cmModulesDocumentationDescription[][3] = "This is the documentation for the modules and scripts coming with CMake. " "Using these modules you can check the computer system for " "installed software packages, features of the compiler and the " - "existance of headers to name just a few.", 0}, + "existence of headers to name just a few.", 0}, {0,0,0} }; @@ -67,7 +67,7 @@ static const char *cmCustomModulesDocumentationDescription[][3] = "This is the documentation for additional modules and scripts for CMake. " "Using these modules you can check the computer system for " "installed software packages, features of the compiler and the " - "existance of headers to name just a few.", 0}, + "existence of headers to name just a few.", 0}, {0,0,0} }; diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index 1cc1754..ffa8b51 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -210,7 +210,7 @@ bool cmExportCommand::HandlePackage(std::vector const& args) else { cmOStringStream e; - e << "PACKAGE given unknown argumsnt: " << args[i]; + e << "PACKAGE given unknown argument: " << args[i]; this->SetError(e.str().c_str()); return false; } diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 018ce7e..2e6f3e0 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -1970,7 +1970,7 @@ bool cmFileInstaller else { cmOStringStream e; - e << "Option TYPE given uknown value \"" << stype << "\"."; + e << "Option TYPE given unknown value \"" << stype << "\"."; this->FileCommand->SetError(e.str().c_str()); return false; } @@ -1985,7 +1985,7 @@ bool cmFileInstaller::HandleInstallDestination() // allow for / to be a valid destination if ( destination.size() < 2 && destination != "/" ) { - this->FileCommand->SetError("called with inapropriate arguments. " + this->FileCommand->SetError("called with inappropriate arguments. " "No DESTINATION provided or ."); return false; } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index df14331..bff4681 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -423,7 +423,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, { if (this->CMakeInstance->GetIsInTryCompile()) { - cmSystemTools::Error("This should not have happen. " + cmSystemTools::Error("This should not have happened. " "If you see this message, you are probably " "using a broken CMakeLists.txt file or a " "problematic release of CMake"); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index ee5b9d8..69fb4d8 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -294,7 +294,7 @@ void cmLocalGenerator::GenerateTestFiles() << "# Build directory: " << this->Makefile->GetStartOutputDirectory() << std::endl << "# " << std::endl - << "# This file includes the relevent testing commands " + << "# This file includes the relevant testing commands " << "required for " << std::endl << "# testing this directory and lists subdirectories to " << "be tested as well." << std::endl; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 47a6d2e..7cf9d91 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1436,7 +1436,7 @@ void cmMakefile::AddLinkDirectoryForTarget(const char *target, else { cmSystemTools::Error - ("Attempt to add link directories to non-existant target: ", + ("Attempt to add link directories to non-existent target: ", target, " for directory ", d); } } @@ -4043,7 +4043,7 @@ void cmMakefile::DefineProperties(cmake *cm) "\n" "This property only works for Visual Studio 7 and above; it is ignored " "on other generators. The property only applies when set on a directory " - "whose CMakeLists.txt conatins a project() command."); + "whose CMakeLists.txt contains a project() command."); cm->DefineProperty ("VS_GLOBAL_SECTION_POST_
", cmProperty::DIRECTORY, "Specify a postSolution global section in Visual Studio.", @@ -4059,7 +4059,7 @@ void cmMakefile::DefineProperties(cmake *cm) "\n" "This property only works for Visual Studio 7 and above; it is ignored " "on other generators. The property only applies when set on a directory " - "whose CMakeLists.txt conatins a project() command." + "whose CMakeLists.txt contains a project() command." "\n" "Note that CMake generates postSolution sections ExtensibilityGlobals " "and ExtensibilityAddIns by default. If you set the corresponding " diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 831e92e..d2b8adf 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -440,7 +440,8 @@ cmPolicies::cmPolicies() this->DefinePolicy( CMP0016, "CMP0016", - "target_link_libraries() reports error if only argument is not a target.", + "target_link_libraries() reports error if its only argument " + "is not a target.", "In CMake 2.8.2 and lower the target_link_libraries() command silently " "ignored if it was called with only one argument, and this argument " "wasn't a valid target. " @@ -452,7 +453,7 @@ cmPolicies::cmPolicies() "Prefer files from the CMake module directory when including from there.", "Starting with CMake 2.8.4, if a cmake-module shipped with CMake (i.e. " "located in the CMake module directory) calls include() or " - "find_package(), the files located in the the CMake module directory are " + "find_package(), the files located in the CMake module directory are " "preferred over the files in CMAKE_MODULE_PATH. " "This makes sure that the modules belonging to " "CMake always get those files included which they expect, and against " @@ -770,7 +771,7 @@ std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id) { cmSystemTools::Error( "Request for error text for undefined policy!"); - return "Request for warning text for undefined policy!"; + return "Request for error text for undefined policy!"; } cmOStringStream error; diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 1d4b0c8..8bb7d96 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -483,7 +483,7 @@ void cmSourceFile::DefineProperties(cmake *cm) "the source file is. If it is not set the language is determined " "based on the file extension. Typical values are CXX C etc. Setting " "this property for a file means this file will be compiled. " - "Do not set this for header or files that should not be compiled."); + "Do not set this for headers or files that should not be compiled."); cm->DefineProperty ("LOCATION", cmProperty::SOURCE_FILE, @@ -551,7 +551,7 @@ void cmSourceFile::DefineProperties(cmake *cm) "Some packages can wrap source files into alternate languages " "to provide additional functionality. For example, C++ code " "can be wrapped into Java or Python etc using SWIG etc. " - "If WRAP_EXCLUDE is set to true (1 etc) that indicates then " + "If WRAP_EXCLUDE is set to true (1 etc) that indicates that " "this source file should not be wrapped."); } diff --git a/Source/cmSubdirCommand.cxx b/Source/cmSubdirCommand.cxx index 0cfe772..e497b46 100644 --- a/Source/cmSubdirCommand.cxx +++ b/Source/cmSubdirCommand.cxx @@ -64,7 +64,7 @@ bool cmSubdirCommand else { std::string error = "Incorrect SUBDIRS command. Directory: "; - error += *i + " does not exists."; + error += *i + " does not exist."; this->SetError(error.c_str()); res = false; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 66c22b1..f6dea4a 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -279,7 +279,7 @@ void cmTarget::DefineProperties(cmake *cm) "If not set here then it is set to target_EXPORTS by default " "(with some substitutions if the target is not a valid C " "identifier). This is useful for headers to know whether they are " - "being included from inside their library our outside to properly " + "being included from inside their library or outside to properly " "setup dllexport/dllimport decorations. "); cm->DefineProperty @@ -1143,7 +1143,7 @@ void cmTarget::DefineProperties(cmake *cm) cm->DefineProperty ("MACOSX_FRAMEWORK_INFO_PLIST", cmProperty::TARGET, "Specify a custom Info.plist template for a Mac OS X Framework.", - "An library target with FRAMEWORK enabled will be built as a " + "A library target with FRAMEWORK enabled will be built as a " "framework on Mac OS X. " "By default its Info.plist file is created by configuring a template " "called MacOSXFrameworkInfo.plist.in located in the CMAKE_MODULE_PATH. " @@ -1234,7 +1234,7 @@ void cmTarget::DefineProperties(cmake *cm) cm->DefineProperty ("GENERATOR_FILE_NAME", cmProperty::TARGET, "Generator's file for this target.", - "An internal property used by some generators to record the name of " + "An internal property used by some generators to record the name of the " "project or dsp file associated with this target. Note that at configure " "time, this property is only set for targets created by " "include_external_msproject()."); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index ca6b661..5303826 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -4173,7 +4173,7 @@ int cmake::VisualStudioLink(std::vector& args, int type) { if(verbose) { - std::cout << "Visual Studio Incremental Link with embeded manifests\n"; + std::cout << "Visual Studio Incremental Link with embedded manifests\n"; } return cmake::VisualStudioLinkIncremental(expandedArgs, type, verbose); } diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 4267841..77a5e43 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -86,8 +86,8 @@ static const char * cmDocumentationOptions[][3] = {"-L[A][H]", "List non-advanced cached variables.", "List cache variables will run CMake and list all the variables from the " "CMake cache that are not marked as INTERNAL or ADVANCED. This will " - "effectively display current CMake settings, which can be then changed " - "with -D option. Changing some of the variable may result in more " + "effectively display current CMake settings, which can then be changed " + "with -D option. Changing some of the variables may result in more " "variables being created. If A is specified, then it will display also " "advanced variables. If H is specified, it will also display help for " "each variable."}, @@ -152,7 +152,7 @@ static const char * cmDocumentationOptions[][3] = "format is determined depending on the filename suffix. Supported are man " "page, HTML, DocBook and plain text."}, {"--help-commands [file]", "Print help for all commands and exit.", - "Full documentation specific for all current command is displayed." + "Full documentation specific for all current commands is displayed." "If a file is specified, the documentation is written into and the output " "format is determined depending on the filename suffix. Supported are man " "page, HTML, DocBook and plain text."}, diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 3e63183..285ec17 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -60,7 +60,7 @@ static const char * cmDocumentationOptions[][3] = "Test output is normally suppressed and only summary information is " "displayed. This option will show even more test output."}, {"--debug", "Displaying more verbose internals of CTest.", - "This feature will result in large number of output that is mostly " + "This feature will result in a large number of output that is mostly " "useful for debugging dashboard problems."}, {"--output-on-failure", "Output anything outputted by the test program " "if the test should fail. This option can also be enabled by setting " @@ -99,7 +99,7 @@ static const char * cmDocumentationOptions[][3] = "This option tells ctest to NOT run the tests whose labels match the " "given regular expression."}, {"-D , --dashboard ", "Execute dashboard test", - "This option tells ctest to perform act as a Dart client and perform " + "This option tells ctest to act as a Dart client and perform " "a dashboard test. All tests are , where Mode can be " "Experimental, Nightly, and Continuous, and Test can be Start, Update, " "Configure, Build, Test, Coverage, and Submit."}, @@ -171,7 +171,7 @@ static const char * cmDocumentationOptions[][3] = "to this command line are the source and binary directories. By default " "this will run CMake on the Source/Bin directories specified unless " "--build-nocmake is specified. Both --build-makeprogram and " - "--build-generator MUST be provided to use --built-and-test. If " + "--build-generator MUST be provided to use --build-and-test. If " "--test-command is specified then that will be run after the build is " "complete. Other options that affect this mode are --build-target " "--build-nocmake, --build-run-dir, " diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt index cd0a37d..fc76e48 100644 --- a/Tests/CompatibleInterface/CMakeLists.txt +++ b/Tests/CompatibleInterface/CMakeLists.txt @@ -57,10 +57,10 @@ set_property(TARGET iface2 APPEND PROPERTY # properties defined only in the interface - they should be implicitly zero set_property(TARGET iface2 APPEND PROPERTY - LINK_INTERFACE_LIBRARIES $<$>:nonexistant> + LINK_INTERFACE_LIBRARIES $<$>:nonexistent> ) target_link_libraries(CompatibleInterface iface2 - $<$>:nonexistant> + $<$>:nonexistent> ) # Test that this does not segfault: target_compile_definitions(CompatibleInterface diff --git a/Tests/ReturnTest/CMakeLists.txt b/Tests/ReturnTest/CMakeLists.txt index 3bd7ce0..c4c606c 100644 --- a/Tests/ReturnTest/CMakeLists.txt +++ b/Tests/ReturnTest/CMakeLists.txt @@ -140,7 +140,7 @@ endwhile() if ("${iter}" STREQUAL "aaa") pass ("break in a while") else () - failed ("break in a whi;e got: ${whiletestResult}") + failed ("break in a while got: ${whiletestResult}") endif () diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt index 3b3bab0..3adf73e 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt @@ -1,8 +1,8 @@ CMake Error at BadNonTarget.cmake:7 \(include_directories\): Error evaluating generator expression: - \$ + \$ - Target "NonExistant" not found. + Target "NonExistent" not found. Call Stack \(most recent call first\): CMakeLists.txt:8 \(include\)$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake index b020c08..97d81e9 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake @@ -4,4 +4,4 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" add_executable(TargetPropertyGeneratorExpressions "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") -include_directories("$") +include_directories("$") diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c index 5bb248c..b6589dd 100644 --- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c +++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c @@ -385,7 +385,7 @@ _7z_options(struct archive_write *a, const char *key, const char *value) else { archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, - "Unkonwn compression name: `%s'", + "Unknown compression name: `%s'", value); return (ARCHIVE_FAILED); } diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c index 96b7b2f..4515157 100644 --- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c +++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c @@ -414,7 +414,7 @@ xar_options(struct archive_write *a, const char *key, const char *value) else { archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, - "Unkonwn checksum name: `%s'", + "Unknown checksum name: `%s'", value); return (ARCHIVE_FAILED); } @@ -448,7 +448,7 @@ xar_options(struct archive_write *a, const char *key, const char *value) else { archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, - "Unkonwn compression name: `%s'", + "Unknown compression name: `%s'", value); return (ARCHIVE_FAILED); } @@ -485,7 +485,7 @@ xar_options(struct archive_write *a, const char *key, const char *value) else { archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, - "Unkonwn checksum name: `%s'", + "Unknown checksum name: `%s'", value); return (ARCHIVE_FAILED); } -- cgit v0.12 From bf019d765d3993ba265c990a6e3a2e53defe112c Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Wed, 7 Nov 2012 17:13:09 +0100 Subject: Fix spelling and typos (non-binary) --- CMakeCPackOptions.cmake.in | 2 +- Modules/CMakeFindPackageMode.cmake | 2 +- Modules/CMakeParseArguments.cmake | 2 +- Modules/CPackPackageMaker.cmake | 2 +- Modules/CheckFunctionExists.cmake | 2 +- Modules/CheckSizeOf.cmake | 2 +- Modules/FindBoost.cmake | 6 +++--- Modules/FindFLTK2.cmake | 2 +- Modules/FindITK.cmake | 4 ++-- Modules/FindMPI.cmake | 2 +- Modules/FindQt4.cmake | 8 ++++---- Modules/FindVTK.cmake | 4 ++-- Modules/FindwxWindows.cmake | 6 +++--- Modules/Platform/Windows-MSVC.cmake | 2 +- Modules/UseEcos.cmake | 4 ++-- Source/CTest/cmCTestTestHandler.cxx | 4 ++-- Source/CursesDialog/form/frm_driver.c | 6 +++--- Source/CursesDialog/form/fty_enum.c | 2 +- Source/cmFunctionCommand.cxx | 2 +- Source/cmGlobalVisualStudioGenerator.cxx | 2 +- Source/cmIncludeCommand.cxx | 2 +- Source/cmLocalUnixMakefileGenerator3.cxx | 8 ++++---- Source/cmMakefile.cxx | 2 +- Source/cmNinjaNormalTargetGenerator.cxx | 2 +- Source/cmQtAutomoc.cxx | 4 ++-- Source/cmSystemTools.h | 2 +- Source/cmVisualStudioGeneratorOptions.cxx | 2 +- Source/cmWin32ProcessExecution.cxx | 2 +- Source/cmWin32ProcessExecution.h | 2 +- Source/cmake.cxx | 4 ++-- Source/cmake.h | 4 ++-- Tests/CompatibleInterface/CMakeLists.txt | 2 +- Utilities/cmcurl/ftp.c | 2 +- Utilities/cmcurl/http.c | 2 +- Utilities/cmcurl/urldata.h | 2 +- .../cmlibarchive/libarchive/archive_read_support_format_mtree.c | 2 +- Utilities/cmzlib/zlib.h | 2 +- 37 files changed, 56 insertions(+), 56 deletions(-) diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index 47dad49..008a102 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -34,7 +34,7 @@ if(CPACK_GENERATOR MATCHES "NSIS") set(CPACK_NSIS_MODIFY_PATH ON) endif() -# include the cpack options for qt dialog if they exisit +# include the cpack options for qt dialog if they exist # they might not if qt was not enabled for the build include("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL) diff --git a/Modules/CMakeFindPackageMode.cmake b/Modules/CMakeFindPackageMode.cmake index cea0187..e5216f4 100644 --- a/Modules/CMakeFindPackageMode.cmake +++ b/Modules/CMakeFindPackageMode.cmake @@ -3,7 +3,7 @@ # NAME = name of the package # COMPILER_ID = the CMake compiler ID for which the result is, i.e. GNU/Intel/Clang/MSVC, etc. # LANGUAGE = language for which the result will be used, i.e. C/CXX/Fortan/ASM -# MODE = EXIST : only check for existance of the given package +# MODE = EXIST : only check for existence of the given package # COMPILE : print the flags needed for compiling an object file which uses the given package # LINK : print the flags needed for linking when using the given package # QUIET = if TRUE, don't print anything diff --git a/Modules/CMakeParseArguments.cmake b/Modules/CMakeParseArguments.cmake index 406780e..016da0c 100644 --- a/Modules/CMakeParseArguments.cmake +++ b/Modules/CMakeParseArguments.cmake @@ -51,7 +51,7 @@ # MY_INSTALL_CONFIGURATIONS = "" (was not used) # MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL" # -# You can the continue and process these variables. +# You can then continue and process these variables. # # Keywords terminate lists of values, e.g. if directly after a one_value_keyword # another recognized keyword follows, this is interpreted as the beginning of diff --git a/Modules/CPackPackageMaker.cmake b/Modules/CPackPackageMaker.cmake index 45ba465..98ca9e2 100644 --- a/Modules/CPackPackageMaker.cmake +++ b/Modules/CPackPackageMaker.cmake @@ -2,7 +2,7 @@ ##end ##module # - PackageMaker CPack generator (Mac OS X). -# The following variable is specific to installers build on Mac OS X +# The following variable is specific to installers built on Mac OS X # using PackageMaker: ##end # diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake index 7aa1748..ead1354 100644 --- a/Modules/CheckFunctionExists.cmake +++ b/Modules/CheckFunctionExists.cmake @@ -4,7 +4,7 @@ # Check that the is provided by libraries on the system and # store the result in a . This does not verify that any # system header file declares the function, only that it can be found -# at link time (considure using CheckSymbolExists). +# at link time (consider using CheckSymbolExists). # # The following variables may be set before calling this macro to # modify the way the check is run: diff --git a/Modules/CheckSizeOf.cmake b/Modules/CheckSizeOf.cmake index 9f587b5..f0707df 100644 --- a/Modules/CheckSizeOf.cmake +++ b/Modules/CheckSizeOf.cmake @@ -15,4 +15,4 @@ message(SEND_ERROR "Modules/CheckSizeOf.cmake has been removed. " "Use Modules/CheckTypeSize.cmake instead. This " - "compatability check may be removed before the next release!") + "compatibility check may be removed before the next release!") diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 8d8b10c..7f79b14 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -41,7 +41,7 @@ # Boost_LIBRARY_DIR - Directory containing Boost libraries # Boost__LIBRARY_DEBUG - Component library debug variant # Boost__LIBRARY_RELEASE - Component library release variant -# Users may set the these hints or results as cache entries. Projects should +# Users may set these hints or results as cache entries. Projects should # not read these entries directly but instead use the above result variables. # Note that some hint names start in upper-case "BOOST". One may specify # these as environment variables if they are not specified as CMake variables @@ -154,7 +154,7 @@ #------------------------------------------------------------------------------- -# Before we go searching, check whether boost-cmake is avaialble, unless the +# Before we go searching, check whether boost-cmake is available, unless the # user specifically asked NOT to search for boost-cmake. # # If Boost_DIR is set, this behaves as any find_package call would. If not, @@ -247,7 +247,7 @@ macro(_Boost_ADJUST_LIB_VARS basename) endif() endif() - # Make variables changeble to the advanced user + # Make variables changeable to the advanced user mark_as_advanced( Boost_${basename}_LIBRARY_RELEASE Boost_${basename}_LIBRARY_DEBUG diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake index 071c318..09f6925 100644 --- a/Modules/FindFLTK2.cmake +++ b/Modules/FindFLTK2.cmake @@ -45,7 +45,7 @@ if(APPLE) set( FLTK2_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -lz") endif() -# If FLTK2_INCLUDE_DIR is already defined we assigne its value to FLTK2_DIR +# If FLTK2_INCLUDE_DIR is already defined we assign its value to FLTK2_DIR if(FLTK2_INCLUDE_DIR) set(FLTK2_DIR ${FLTK2_INCLUDE_DIR}) else() diff --git a/Modules/FindITK.cmake b/Modules/FindITK.cmake index b0b3f03..2929a76 100644 --- a/Modules/FindITK.cmake +++ b/Modules/FindITK.cmake @@ -17,7 +17,7 @@ # # USE_ITK_FILE - The full path to the UseITK.cmake file. # This is provided for backward -# compatability. Use ITK_USE_FILE +# compatibility. Use ITK_USE_FILE # instead. #============================================================================= @@ -52,6 +52,6 @@ if(NOT ITK_FOUND) endif() if(ITK_FOUND) - # Set USE_ITK_FILE for backward-compatability. + # Set USE_ITK_FILE for backward-compatibility. set(USE_ITK_FILE ${ITK_USE_FILE}) endif() diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 143d10a..0eb86a8 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -86,7 +86,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/GetPrerequisites.cmake) # # The compilers are detected in this order: # -# 1. Try to find the most generic availble MPI compiler, as this is usually set up by +# 1. Try to find the most generic available MPI compiler, as this is usually set up by # cluster admins. e.g., if plain old mpicc is available, we'll use it and assume it's # the right compiler. # diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 21e8e91..4f3e634 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -115,7 +115,7 @@ # You should have a look on the AUTOMOC property for targets to achieve the same results. # # macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename) -# Create a the interface header and implementation files with the +# Create the interface header and implementation files with the # given basename from the given interface xml file and add it to # the list of sources. # @@ -171,7 +171,7 @@ # in: ts_files # generates commands to create .qm from .ts - files. The generated # filenames can be found in qm_files. The ts_files -# must exists and are not updated in any way. +# must exist and are not updated in any way. # # function QT4_USE_MODULES( target [link_type] modules...) # Make use the from Qt. Using a Qt module means @@ -495,7 +495,7 @@ macro (_QT4_ADJUST_LIB_VARS _camelCaseBasename) set(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES}) endif () - # Make variables changeble to the advanced user + # Make variables changeable to the advanced user mark_as_advanced(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR) endmacro () @@ -771,7 +771,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) endif() endif () - # Make variables changeble to the advanced user + # Make variables changeable to the advanced user mark_as_advanced( QT_LIBRARY_DIR QT_DOC_DIR QT_MKSPECS_DIR QT_PLUGINS_DIR QT_TRANSLATIONS_DIR) diff --git a/Modules/FindVTK.cmake b/Modules/FindVTK.cmake index 0dede2d..085d60d 100644 --- a/Modules/FindVTK.cmake +++ b/Modules/FindVTK.cmake @@ -51,7 +51,7 @@ if("${VTK_FIND_VERSION}" VERSION_LESS 4.1) endif() endif() -# Construct consitent error messages for use below. +# Construct consistent error messages for use below. set(VTK_DIR_DESCRIPTION "directory containing VTKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/vtk for an installation.") if(_VTK_40_ALLOW) set(VTK_DIR_DESCRIPTION "${VTK_DIR_DESCRIPTION} For VTK 4.0, this is the location of UseVTK.cmake. This is either the root of the build tree or PREFIX/include/vtk for an installation.") @@ -127,7 +127,7 @@ endif() #----------------------------------------------------------------------------- if(VTK_FOUND) - # Set USE_VTK_FILE for backward-compatability. + # Set USE_VTK_FILE for backward-compatibility. set(USE_VTK_FILE ${VTK_USE_FILE}) else() # VTK not found, explain to the user how to specify its location. diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake index 4179f7b..868d20c 100644 --- a/Modules/FindwxWindows.cmake +++ b/Modules/FindwxWindows.cmake @@ -321,7 +321,7 @@ if(WIN32_STYLE_FIND) rpcrt4 wsock32 ) - ## HACK: feed in to optimized / debug libaries if both were FOUND. + ## HACK: feed in to optimized / debug libraries if both were FOUND. set(WXWINDOWS_STATIC_DEBUG_LIBS ${WXWINDOWS_STATIC_DEBUG_LIBS} wxbase26d wxbase26d_net @@ -354,7 +354,7 @@ if(WIN32_STYLE_FIND) ## ## if there is at least one shared lib available - ## let user choose wether to use shared or static wxwindows libs + ## let user choose whether to use shared or static wxwindows libs if(WXWINDOWS_SHARED_LIBRARY OR WXWINDOWS_SHARED_DEBUG_LIBRARY) ## default value OFF because wxWindows MSVS default build is static option(WXWINDOWS_USE_SHARED_LIBS @@ -606,7 +606,7 @@ else() ../wx/bin ../../wx/bin ) - # check wether wx-config was found: + # check whether wx-config was found: if(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE) # use shared/static wx lib? diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index f9df6d8..09d69e6 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -22,7 +22,7 @@ set(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") set(CMAKE_LINK_LIBRARY_FLAG "") set(MSVC 1) -# hack: if a new cmake (which uses CMAKE__LINKER) runs on an old build tree +# hack: if a new cmake (which uses CMAKE_LINKER) runs on an old build tree # (where link was hardcoded) and where CMAKE_LINKER isn't in the cache # and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun) # hardcode CMAKE_LINKER here to link, so it behaves as it did before, Alex diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake index 028df82..0c4fee4 100644 --- a/Modules/UseEcos.cmake +++ b/Modules/UseEcos.cmake @@ -132,10 +132,10 @@ macro(ECOS_ADJUST_DIRECTORY _target_FILES ) endmacro() # the default ecos config file name -# maybe in the future also out-of-source builds may be possible +# maybe in future also out-of-source builds may be possible set(ECOS_CONFIG_FILE ecos.ecc) -#creates the dependancy from all source files on the ecos target.ld, +#creates the dependency from all source files on the ecos target.ld, #adds the command for compiling ecos macro(ECOS_ADD_TARGET_LIB) # when building out-of-source, create the ecos/ subdir diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index e7491bb..3a9b192 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1363,7 +1363,7 @@ void cmCTestTestHandler tempPath += filename; attempted.push_back(tempPath); attemptedConfigs.push_back(ctest->GetConfigType()); - // If the file is an OSX bundle then the configtyp + // If the file is an OSX bundle then the configtype // will be at the start of the path tempPath = ctest->GetConfigType(); tempPath += "/"; @@ -1374,7 +1374,7 @@ void cmCTestTestHandler } else { - // no config specified to try some options + // no config specified - try some options... tempPath = filepath; tempPath += "Release/"; tempPath += filename; diff --git a/Source/CursesDialog/form/frm_driver.c b/Source/CursesDialog/form/frm_driver.c index f234722..b9611bf 100644 --- a/Source/CursesDialog/form/frm_driver.c +++ b/Source/CursesDialog/form/frm_driver.c @@ -176,7 +176,7 @@ static int FE_Delete_Previous(FORM *); #define Address_Of_Current_Position_In_Buffer(form) \ Address_Of_Current_Position_In_Nth_Buffer(form,0) -/* Logic to decide wether or not a field is actually a field with +/* Logic to decide whether or not a field is actually a field with vertical or horizontal scrolling */ #define Is_Scroll_Field(field) \ (((field)->drows > (field)->rows) || \ @@ -2100,7 +2100,7 @@ static int Insert_String(FORM *form, int row, char *txt, int len) | the wrapping. | | Return Values : E_OK - no wrapping required or wrapping -| was successfull +| was successful | E_REQUEST_DENIED - | E_SYSTEM_ERROR - some system error +--------------------------------------------------------------------------*/ @@ -3825,7 +3825,7 @@ int set_field_buffer(FIELD * field, int buffer, const char * value) (int)(1 + (vlen-len)/((field->rows+field->nrow)*field->cols)))) RETURN(E_SYSTEM_ERROR); - /* in this case we also have to check, wether or not the remaining + /* in this case we also have to check, whether or not the remaining characters in value are also printable for buffer 0. */ if (buffer==0) { diff --git a/Source/CursesDialog/form/fty_enum.c b/Source/CursesDialog/form/fty_enum.c index 8fc4cd7..59058a9 100644 --- a/Source/CursesDialog/form/fty_enum.c +++ b/Source/CursesDialog/form/fty_enum.c @@ -101,7 +101,7 @@ static void Free_Enum_Type(void * argp) | const unsigned char * buf, | bool ccase ) | -| Description : Check wether or not the text in 'buf' matches the +| Description : Check whether or not the text in 'buf' matches the | text in 's', at least partial. | | Return Values : NOMATCH - buffer doesn't match diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 10b47b9..a126cd1 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -267,7 +267,7 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf) std::vector expandedArguments; mf.ExpandArguments(lff.Arguments, expandedArguments); // if the endfunction has arguments then make sure - // they match the ones in the openeing function command + // they match the ones in the opening function command if ((expandedArguments.empty() || (expandedArguments[0] == this->Args[0]))) { diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 808664d..f4be0ce 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -449,7 +449,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target) } } - // Collext explicit util dependencies (add_dependencies). + // Collect explicit util dependencies (add_dependencies). std::set utilDepends; for(TargetDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index 0d5f67b..bb891d6 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -61,7 +61,7 @@ bool cmIncludeCommand noPolicyScope = true; } else if(i > 1) // compat.: in previous cmake versions the second - // parameter was ignore if it wasn't "OPTIONAL" + // parameter was ignored if it wasn't "OPTIONAL" { std::string errorText = "called with invalid argument: "; errorText += args[i]; diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 0f680f6..78a70f8 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1304,7 +1304,7 @@ cmLocalUnixMakefileGenerator3 std::string unmodified = s; unmodified += s2; // if there is no restriction on the length of make variables - // and there are no "." charactors in the string, then return the + // and there are no "." characters in the string, then return the // unmodified combination. if((!this->MakefileVariableSize && unmodified.find('.') == s.npos) && (!this->MakefileVariableSize && unmodified.find('+') == s.npos) @@ -1345,7 +1345,7 @@ cmLocalUnixMakefileGenerator3 return ret; } - // if the string is greater the 32 chars it is an invalid vairable name + // if the string is greater than 32 chars it is an invalid variable name // for borland make if(static_cast(ret.size()) > this->MakefileVariableSize) { @@ -1353,8 +1353,8 @@ cmLocalUnixMakefileGenerator3 int size = keep + 3; std::string str1 = s; std::string str2 = s2; - // we must shorten the combined string by 4 charactors - // keep no more than 24 charactors from the second string + // we must shorten the combined string by 4 characters + // keep no more than 24 characters from the second string if(static_cast(str2.size()) > keep) { str2 = str2.substr(0, keep); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7cf9d91..606ec93 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2086,7 +2086,7 @@ void cmMakefile::AddSourceGroup(const std::vector& name, } else if(i==-1) { - // group does not exists nor belong to any existing group + // group does not exist nor belong to any existing group // add its first component this->SourceGroups.push_back(cmSourceGroup(name[0].c_str(), regex)); sg = this->GetSourceGroup(currentName); diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 7e48cd7..e5f3570 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -505,7 +505,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() const std::string objPath = GetTarget()->GetSupportDirectory(); vars["OBJECT_DIR"] = ConvertToNinjaPath(objPath.c_str()); EnsureDirectoryExists(objPath); - // ar.exe can't handle backslashes in rsp files (implictly used by gcc) + // ar.exe can't handle backslashes in rsp files (implicitly used by gcc) std::string& linkLibraries = vars["LINK_LIBRARIES"]; std::replace(linkLibraries.begin(), linkLibraries.end(), '\\', '/'); } diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index a1fa31f..9783ce9 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -696,7 +696,7 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, std::string ownMocHeaderFile; std::string::size_type matchOffset = 0; - // first a simply string check for "moc" is *much* faster than the regexp, + // first a simple string check for "moc" is *much* faster than the regexp, // and if the string search already fails, we don't have to try the // expensive regexp if ((strstr(contentsString.c_str(), "moc") != NULL) @@ -870,7 +870,7 @@ void cmQtAutomoc::StrictParseCppFile(const std::string& absFilename, bool dotMocIncluded = false; std::string::size_type matchOffset = 0; - // first a simply string check for "moc" is *much* faster than the regexp, + // first a simple string check for "moc" is *much* faster than the regexp, // and if the string search already fails, we don't have to try the // expensive regexp if ((strstr(contentsString.c_str(), "moc") != NULL) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 0b2def2..8355d78 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -56,7 +56,7 @@ public: typedef void (*ErrorCallback)(const char*, const char*, bool&, void*); /** - * Set the function used by GUI's to display error messages + * Set the function used by GUIs to display error messages * Function gets passed: message as a const char*, * title as a const char*, and a reference to bool that when * set to false, will disable furthur messages (cancel). diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 1df0d9e..3579997 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -228,7 +228,7 @@ cmVisualStudioGeneratorOptions } if(this->Version >= cmLocalVisualStudioGenerator::VS10) { - // if there are configuration specifc flags, then + // if there are configuration specific flags, then // use the configuration specific tag for PreprocessorDefinitions if(this->Configuration.size()) { diff --git a/Source/cmWin32ProcessExecution.cxx b/Source/cmWin32ProcessExecution.cxx index 5752ab6..1bdeffb 100644 --- a/Source/cmWin32ProcessExecution.cxx +++ b/Source/cmWin32ProcessExecution.cxx @@ -506,7 +506,7 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring, /* Create new output read handle and the input write handle. Set * the inheritance properties to FALSE. Otherwise, the child inherits - * the these handles; resulting in non-closeable handles to the pipes + * these handles; resulting in non-closeable handles to the pipes * being created. */ fSuccess = DuplicateHandle(GetCurrentProcess(), this->hChildStdinWr, GetCurrentProcess(), &this->hChildStdinWrDup, 0, diff --git a/Source/cmWin32ProcessExecution.h b/Source/cmWin32ProcessExecution.h index 98b6bda..2127ebd2 100644 --- a/Source/cmWin32ProcessExecution.h +++ b/Source/cmWin32ProcessExecution.h @@ -69,7 +69,7 @@ public: /** * Start the process in the directory path. Make sure that the * executable is either in the path or specify the full path. The - * argument verbose specifies wether or not to display output while + * argument verbose specifies whether or not to display output while * it is being generated. */ bool StartProcess(const char*, const char* path, bool verbose); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 5303826..ae62edb 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2365,7 +2365,7 @@ int cmake::ActualConfigure() // EXECUTABLE_OUTPUT_PATH. They are now documented as old-style and // should no longer be used. Therefore we present them only if the // project requires compatibility with CMake 2.4. We detect this - // here by looking for the old CMAKE_BACKWARDS_COMPATABILITY + // here by looking for the old CMAKE_BACKWARDS_COMPATIBILITY // variable created when CMP0001 is not set to NEW. if(this->GetCacheManager()->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) { @@ -4117,7 +4117,7 @@ int cmake::WindowsCEEnvironment(const char* version, const std::string& name) return -1; } -// For visual studio 2005 and newer manifest files need to be embeded into +// For visual studio 2005 and newer manifest files need to be embedded into // exe and dll's. This code does that in such a way that incremental linking // still works. int cmake::VisualStudioLink(std::vector& args, int type) diff --git a/Source/cmake.h b/Source/cmake.h index 63065a1..1a09d88 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -35,7 +35,7 @@ class cmGeneratedFileStream; /** \brief Represents a cmake invocation. * * This class represents a cmake invocation. It is the top level class when - * running cmake. Most cmake based GUIS should primarily create an instance + * running cmake. Most cmake based GUIs should primarily create an instance * of this class and communicate with it. * * The basic process for a GUI is as follows: @@ -255,7 +255,7 @@ class cmake typedef void (*ProgressCallbackType) (const char*msg, float progress, void *); /** - * Set the function used by GUI's to receive progress updates + * Set the function used by GUIs to receive progress updates * Function gets passed: message as a const char*, a progress * amount ranging from 0 to 1.0 and client data. The progress * number provided may be negative in cases where a message is diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt index fc76e48..ae1d2fa 100644 --- a/Tests/CompatibleInterface/CMakeLists.txt +++ b/Tests/CompatibleInterface/CMakeLists.txt @@ -70,7 +70,7 @@ target_compile_definitions(CompatibleInterface # The COMPATIBLE_INTERFACE_* properties are only read from dependencies # in the interface. Populating it on the CompatibleInterface target does -# not have any affect on the interpretation of the INTERFACE variants +# not have any effect on the interpretation of the INTERFACE variants # in dependencies. set_property(TARGET iface1 PROPERTY INTERFACE_NON_RELEVANT_PROP ON diff --git a/Utilities/cmcurl/ftp.c b/Utilities/cmcurl/ftp.c index 8839889..3ccbc43 100644 --- a/Utilities/cmcurl/ftp.c +++ b/Utilities/cmcurl/ftp.c @@ -3683,7 +3683,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn) /* seek out the next path component */ if (slash_pos-cur_pos) { /* we skip empty path components, like "x//y" since the FTP command - CWD requires a parameter and a non-existant parameter a) doesn't + CWD requires a parameter and a non-existent parameter a) doesn't work on many servers and b) has no effect on the others. */ int len = (int)(slash_pos - cur_pos + absolute_dir); ftpc->dirs[ftpc->dirdepth] = curl_easy_unescape(conn->data, diff --git a/Utilities/cmcurl/http.c b/Utilities/cmcurl/http.c index c07053b..5405aac 100644 --- a/Utilities/cmcurl/http.c +++ b/Utilities/cmcurl/http.c @@ -178,7 +178,7 @@ static bool pickoneauth(struct auth *pick) picked = TRUE; /* The order of these checks is highly relevant, as this will be the order - of preference in case of the existance of multiple accepted types. */ + of preference in case of the existence of multiple accepted types. */ if(avail & CURLAUTH_GSSNEGOTIATE) pick->picked = CURLAUTH_GSSNEGOTIATE; else if(avail & CURLAUTH_DIGEST) diff --git a/Utilities/cmcurl/urldata.h b/Utilities/cmcurl/urldata.h index 9537ce3..46d956d 100644 --- a/Utilities/cmcurl/urldata.h +++ b/Utilities/cmcurl/urldata.h @@ -621,7 +621,7 @@ typedef CURLcode (*Curl_done_func)(struct connectdata *, CURLcode, bool); * Store's request specific data in the easy handle (SessionHandle). * Previously, these members were on the connectdata struct but since * a conn struct may now be shared between different SessionHandles, - * we store connection-specifc data here. + * we store connection-specific data here. * */ struct HandleData { diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_mtree.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_mtree.c index 6ac7db8..3ba4be0 100644 --- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_mtree.c +++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_mtree.c @@ -407,7 +407,7 @@ bid_keyword(const char *p, ssize_t len) if (l > 0) return (l); } - return (0);/* Unkown key */ + return (0);/* Unknown key */ } /* diff --git a/Utilities/cmzlib/zlib.h b/Utilities/cmzlib/zlib.h index 0228179..46e2db4 100644 --- a/Utilities/cmzlib/zlib.h +++ b/Utilities/cmzlib/zlib.h @@ -869,7 +869,7 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, See inflateBack() for the usage of these routines. inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the paramaters are invalid, Z_MEM_ERROR if the internal state could not + the parameters are invalid, Z_MEM_ERROR if the internal state could not be allocated, or Z_VERSION_ERROR if the version of the library does not match the version of the header file. */ -- cgit v0.12 From f57800d6f597ac812edb246b9b4cac2c8d238745 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Sat, 4 May 2013 14:53:26 +0200 Subject: Fix spelling and typos (product names) API, Borland, MinGW, UNIX, Mac OS X. --- Modules/FindOpenSSL.cmake | 2 +- Modules/FindQt4.cmake | 4 ++-- Source/QtDialog/QCMakeCacheView.cxx | 2 +- Source/cmDocumentVariables.cxx | 27 +++++++++++++++------------ Source/cmSetTargetPropertiesCommand.h | 2 +- Source/cmTarget.cxx | 4 ++-- Source/cmcldeps.cxx | 2 +- Utilities/cmcurl/ssluse.c | 2 +- 8 files changed, 24 insertions(+), 21 deletions(-) diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 224c88e..06c9d28 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -140,7 +140,7 @@ if(WIN32 AND NOT CYGWIN) set( OPENSSL_LIBRARIES ${SSL_EAY_LIBRARY} ${LIB_EAY_LIBRARY} ) elseif(MINGW) - # same player, for MingW + # same player, for MinGW set(LIB_EAY_NAMES libeay32) set(SSL_EAY_NAMES ssleay32) if(CMAKE_CROSS_COMPILING) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 4f3e634..96764fd 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -635,10 +635,10 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) ) endif() - # try dropping a hint if trying to use Visual Studio with Qt built by mingw + # try dropping a hint if trying to use Visual Studio with Qt built by MinGW if(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC) if(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a) - message( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by mingw. Those compilers do not produce code compatible with each other.") + message( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by MinGW. Those compilers do not produce code compatible with each other.") endif() endif() diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 6006758..bae6a30 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -177,7 +177,7 @@ QModelIndex QCMakeCacheView::moveCursor(CursorAction act, void QCMakeCacheView::setShowAdvanced(bool s) { #if QT_VERSION >= 040300 - // new 4.3 api that needs to be called. what about an older Qt? + // new 4.3 API that needs to be called. what about an older Qt? this->SearchFilter->invalidate(); #endif diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 1ea1c72..12df81b 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -129,9 +129,9 @@ void cmDocumentVariables::DefineVariables(cmake* cm) " needed to build the output of CMake. If the " "generator selected was Visual Studio 6, the " "CMAKE_BUILD_TOOL will be set to msdev, for " - "Unix makefiles it will be set to make or gmake, " + "Unix Makefiles it will be set to make or gmake, " "and for Visual Studio 7 it set to devenv. For " - "Nmake Makefiles the value is nmake. This can be " + "NMake Makefiles the value is nmake. This can be " "useful for adding special flags and commands based" " on the final build environment. ", false, "Variables that Provide Information"); @@ -940,7 +940,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "which CMake is targeting. On systems that " "have the uname command, this variable is set " "to the output of uname -s. Linux, Windows, " - " and Darwin for Mac OSX are the values found " + " and Darwin for Mac OS X are the values found " " on the big three operating systems." ,false, "Variables That Describe the System"); cm->DefineProperty @@ -999,20 +999,22 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("APPLE", cmProperty::VARIABLE, - "True if running on Mac OSX.", - "Set to true on Mac OSX.",false, + "True if running on Mac OS X.", + "Set to true on Mac OS X." + ,false, "Variables That Describe the System"); cm->DefineProperty ("BORLAND", cmProperty::VARIABLE, - "True if the borland compiler is being used.", + "True if the Borland compiler is being used.", "This is set to true if the Borland compiler is being used.",false, "Variables That Describe the System"); cm->DefineProperty ("CYGWIN", cmProperty::VARIABLE, - "True for cygwin.", - "Set to true when using CYGWIN.",false, + "True for Cygwin.", + "Set to true when using Cygwin." + ,false, "Variables That Describe the System"); cm->DefineProperty @@ -1110,8 +1112,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_HOST_APPLE", cmProperty::VARIABLE, - "True for Apple OSX operating systems.", - "Set to true when the host system is Apple OSX.", + "True for Apple OS X operating systems.", + "Set to true when the host system is Apple OS X.", false, "Variables That Describe the System"); @@ -1125,7 +1127,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_HOST_WIN32", cmProperty::VARIABLE, "True on windows systems, including win64.", - "Set to true when the host system is Windows and on cygwin.",false, + "Set to true when the host system is Windows and on Cygwin." + ,false, "Variables That Describe the System"); cm->DefineProperty @@ -1198,7 +1201,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_INSTALL_NAME_DIR", cmProperty::VARIABLE, - "Mac OSX directory name for installed targets.", + "Mac OS X directory name for installed targets.", "CMAKE_INSTALL_NAME_DIR is used to initialize the " "INSTALL_NAME_DIR property on all targets. See that target " "property for more information.", diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h index 9dd7848..cf9c193 100644 --- a/Source/cmSetTargetPropertiesCommand.h +++ b/Source/cmSetTargetPropertiesCommand.h @@ -104,7 +104,7 @@ public: "are common values for this property." "\n" "For shared libraries VERSION and SOVERSION can be used to specify " - "the build version and api version respectively. When building or " + "the build version and API version respectively. When building or " "installing appropriate symlinks are created if the platform " "supports symlinks and the linker supports so-names. " "If only one of both is specified the missing is assumed to have " diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index f6dea4a..929e7d5 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1041,7 +1041,7 @@ void cmTarget::DefineProperties(cmake *cm) ("SOVERSION", cmProperty::TARGET, "What version number is this target.", "For shared libraries VERSION and SOVERSION can be used to specify " - "the build version and api version respectively. When building or " + "the build version and API version respectively. When building or " "installing appropriate symlinks are created if the platform " "supports symlinks and the linker supports so-names. " "If only one of both is specified the missing is assumed to have " @@ -1079,7 +1079,7 @@ void cmTarget::DefineProperties(cmake *cm) ("VERSION", cmProperty::TARGET, "What version number is this target.", "For shared libraries VERSION and SOVERSION can be used to specify " - "the build version and api version respectively. When building or " + "the build version and API version respectively. When building or " "installing appropriate symlinks are created if the platform " "supports symlinks and the linker supports so-names. " "If only one of both is specified the missing is assumed to have " diff --git a/Source/cmcldeps.cxx b/Source/cmcldeps.cxx index 04dab59..262d83b 100644 --- a/Source/cmcldeps.cxx +++ b/Source/cmcldeps.cxx @@ -225,7 +225,7 @@ static int process( const std::string& srcfilename, int main() { - // Use the Win32 api instead of argc/argv so we can avoid interpreting the + // Use the Win32 API instead of argc/argv so we can avoid interpreting the // rest of command line after the .d and .obj. Custom parsing seemed // preferable to the ugliness you get into in trying to re-escape quotes for // subprocesses, so by avoiding argc/argv, the subprocess is called with diff --git a/Utilities/cmcurl/ssluse.c b/Utilities/cmcurl/ssluse.c index 14d05ac..6709278 100644 --- a/Utilities/cmcurl/ssluse.c +++ b/Utilities/cmcurl/ssluse.c @@ -442,7 +442,7 @@ int cert_stuff(struct connectdata *conn, failf(data, "no key set to load from crypto engine\n"); return 0; } - /* the typecast below was added to please mingw32 */ + /* the typecast below was added to please MinGW32 */ priv_key = (EVP_PKEY *) ENGINE_load_private_key(conn->data->state.engine,key_file, #ifdef HAVE_ENGINE_LOAD_FOUR_ARGS -- cgit v0.12 From 5ca4336ece8975138bcbf7f3641c7646dd3653fc Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Thu, 20 Dec 2012 16:56:13 +0100 Subject: FindwxWidgets: add DOC strings with usual style --- Modules/FindwxWidgets.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 218d476..37a894c 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -458,7 +458,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") wxWidgets-2.5.2 wxWidgets-2.5.1 wxWidgets - DOC "wxWidgets base/installation directory?" + DOC "wxWidgets base/installation directory" ) # If wxWidgets_ROOT_DIR changed, clear lib dir. @@ -492,7 +492,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") PATHS ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_dll # prefer shared ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_lib - DOC "Path to wxWidgets libraries?" + DOC "Path to wxWidgets libraries" NO_DEFAULT_PATH ) else() @@ -509,7 +509,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") PATHS ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_lib # prefer static ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_dll - DOC "Path to wxWidgets libraries?" + DOC "Path to wxWidgets libraries" NO_DEFAULT_PATH ) endif() @@ -703,6 +703,7 @@ else() #----------------------------------------------------------------- # Support cross-compiling, only search in the target platform. find_program(wxWidgets_CONFIG_EXECUTABLE wx-config + DOC "Location of wxWidgets library configuration provider binary (wx-config)." ONLY_CMAKE_FIND_ROOT_PATH ) @@ -843,6 +844,7 @@ set(wxWidgets_FOUND ${WXWIDGETS_FOUND}) # Resource file compiler. find_program(wxWidgets_wxrc_EXECUTABLE wxrc ${wxWidgets_ROOT_DIR}/utils/wxrc/vc_msw + DOC "Location of wxWidgets resource file compiler binary (wxrc)" ) # -- cgit v0.12 From e619111d91a71c0aa80ddf45d981c8bed51ad805 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Thu, 20 Dec 2012 16:57:07 +0100 Subject: Explain distribution of Win9x binary on all Windows versions. --- Source/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index ab62d2b..baeca29 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -537,7 +537,8 @@ endif() add_executable(cmake cmakemain.cxx) target_link_libraries(cmake CMakeLib) -# Build special executable for running programs on Windows 98 +# Build special executable for running programs on Windows 98. +# Included on any Windows (unconditional packaging required!). if(WIN32) if(NOT UNIX) add_executable(cmw9xcom cmw9xcom.cxx) -- cgit v0.12 From 2bab472ecb2e5be31ea41e4035c3e4923b42c57c Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Tue, 16 Apr 2013 16:02:47 +0200 Subject: VS10: add detailed comment about MIDL processing --- Source/cmVisualStudio10TargetGenerator.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 1cb9f23..e4c508c 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1579,6 +1579,21 @@ void cmVisualStudio10TargetGenerator:: WriteMidlOptions(std::string const& /*config*/, std::vector const & includes) { + // This processes *any* of the .idl files specified in the project's file + // list (and passed as the item metadata %(Filename) expressing the rule + // input filename) into output files at the per-config *build* dir + // ($(IntDir)) each. + // + // IOW, this MIDL section is intended to provide a fully generic syntax + // content suitable for most cases (read: if you get errors, then it's quite + // probable that the error is on your side of the .idl setup). + // + // Also, note that the marked-as-generated _i.c file in the Visual Studio + // generator case needs to be referred to as $(IntDir)\foo_i.c at the + // project's file list, otherwise the compiler-side processing won't pick it + // up (for non-directory form, it ends up looking in project binary dir + // only). Perhaps there's something to be done to make this more automatic + // on the CMake side? this->WriteString("\n", 2); this->OutputIncludes(includes); this->WriteString("$(IntDir)\n", 3); -- cgit v0.12 From 56ca34dbbd9822083ee22976e1c1ede8705cd67f Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Sat, 4 May 2013 16:02:21 +0200 Subject: Docs: Update description of CMAKE_(BUILD_TYPE|CONFIGURATION_TYPES) Bring woefully outdated descriptions somewhat up to speed. --- Source/cmDocumentVariables.cxx | 43 ++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 12df81b..8373d4d 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -577,26 +577,37 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_CONFIGURATION_TYPES", cmProperty::VARIABLE, - "Specifies the available build types.", - "This specifies what build types will be available such as " - "Debug, Release, RelWithDebInfo etc. This has reasonable defaults " - "on most platforms. But can be extended to provide other " - "build types. See also CMAKE_BUILD_TYPE.", - false, + "Specifies the available build types on multi-config generators.", + "This specifies what build types (configurations) will be available " + "such as Debug, Release, RelWithDebInfo etc. " + "This has reasonable defaults on most platforms, " + "but can be extended to provide other build types. " + "See also CMAKE_BUILD_TYPE for details of managing configuration data, " + "and CMAKE_CFG_INTDIR." + ,false, "Variables That Change Behavior"); cm->DefineProperty ("CMAKE_BUILD_TYPE", cmProperty::VARIABLE, - "Specifies the build type for make based generators.", - "This specifies what build type will be built in this tree. " - " Possible values are empty, Debug, Release, RelWithDebInfo" - " and MinSizeRel. This variable is only supported for " - "make based generators. If this variable is supported, " - "then CMake will also provide initial values for the " - "variables with the name " - " CMAKE_C_FLAGS_[DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL]." - " For example, if CMAKE_BUILD_TYPE is Debug, then " - "CMAKE_C_FLAGS_DEBUG will be added to the CMAKE_C_FLAGS.",false, + "Specifies the build type on single-configuration generators.", + "This statically specifies what build type (configuration) " + "will be built in this build tree. Possible values are " + "empty, Debug, Release, RelWithDebInfo and MinSizeRel. " + "This variable is only meaningful to single-configuration generators " + "(such as make and Ninja) i.e. " + "those which choose a single configuration " + "when CMake runs to generate a build tree as opposed to " + "multi-configuration generators which offer selection of the build " + "configuration within the generated build environment. " + "There are many per-config properties and variables " + "(usually following clean SOME_VAR_ order conventions), " + "such as CMAKE_C_FLAGS_, specified as uppercase: " + "CMAKE_C_FLAGS_[DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL]. " + "For example, in a build tree configured " + "to build type Debug, CMake will see to having " + "CMAKE_C_FLAGS_DEBUG settings get added to the CMAKE_C_FLAGS settings. " + "See also CMAKE_CONFIGURATION_TYPES." + ,false, "Variables That Change Behavior"); cm->DefineProperty -- cgit v0.12 From 2378a698a918c9d7f25e085480214bfb00171ecd Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Sat, 4 May 2013 15:19:46 +0200 Subject: Docs: Clarify that CMAKE_*_(PREFIX|SUFFIX) affect filenames Add "filename" to the descriptions. --- Source/cmDocumentVariables.cxx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 8373d4d..a8c8d03 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -270,12 +270,13 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_LINK_LIBRARY_SUFFIX", cmProperty::VARIABLE, "The suffix for libraries that you link to.", - "The suffix to use for the end of a library, .lib on Windows.",false, + "The suffix to use for the end of a library filename, .lib on Windows." + ,false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_EXECUTABLE_SUFFIX", cmProperty::VARIABLE, "The suffix for executables on this platform.", - "The suffix to use for the end of an executable if any, " + "The suffix to use for the end of an executable filename if any, " ".exe on Windows." "\n" "CMAKE_EXECUTABLE_SUFFIX_ overrides this for language ." @@ -452,8 +453,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ,false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_IMPORT_LIBRARY_SUFFIX", cmProperty::VARIABLE, - "The suffix for import libraries that you link to.", - "The suffix to use for the end of an import library if used " + "The suffix for import libraries that you link to.", + "The suffix to use for the end of an import library filename if used " "on this platform." "\n" "CMAKE_IMPORT_LIBRARY_SUFFIX_ overrides this for language ." @@ -468,7 +469,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_SHARED_LIBRARY_SUFFIX", cmProperty::VARIABLE, "The suffix for shared libraries that you link to.", - "The suffix to use for the end of a shared library, .dll on Windows." + "The suffix to use for the end of a shared library filename, " + ".dll on Windows." "\n" "CMAKE_SHARED_LIBRARY_SUFFIX_ overrides this for language ." ,false, "Variables that Provide Information"); @@ -482,7 +484,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_SHARED_MODULE_SUFFIX", cmProperty::VARIABLE, "The suffix for shared libraries that you link to.", - "The suffix to use for the end of a loadable module on this platform" + "The suffix to use for the end of a loadable module filename " + "on this platform" "\n" "CMAKE_SHARED_MODULE_SUFFIX_ overrides this for language ." ,false, "Variables that Provide Information"); @@ -496,7 +499,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_STATIC_LIBRARY_SUFFIX", cmProperty::VARIABLE, "The suffix for static libraries that you link to.", - "The suffix to use for the end of a static library, .lib on Windows." + "The suffix to use for the end of a static library filename, " + ".lib on Windows." "\n" "CMAKE_STATIC_LIBRARY_SUFFIX_ overrides this for language ." ,false, "Variables that Provide Information"); -- cgit v0.12 From 7cc2805cd6da07ad4b38f072fea811bb5de4f729 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Sat, 4 May 2013 15:27:40 +0200 Subject: Docs: Clarify wording "flag used" => "flag (to|will) be used" The phrase "flag used" is somewhat imprecise, so extend it to stress intentions. Also correct: - "Flag" => "Flags" - "[CMAKE_BUILD_TYPE]" => "" --- Source/cmDocumentVariables.cxx | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index a8c8d03..cbbbcbe 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -1376,38 +1376,41 @@ void cmDocumentVariables::DefineVariables(cmake* cm) cm->DefineProperty ("CMAKE_EXE_LINKER_FLAGS", cmProperty::VARIABLE, - "Linker flags used to create executables.", - "Flags used by the linker when creating an executable.",false, + "Linker flags to be used to create executables.", + "These flags will be used by the linker when creating an executable." + ,false, "Variables that Control the Build"); cm->DefineProperty - ("CMAKE_EXE_LINKER_FLAGS_[CMAKE_BUILD_TYPE]", cmProperty::VARIABLE, - "Flag used when linking an executable.", + ("CMAKE_EXE_LINKER_FLAGS_", cmProperty::VARIABLE, + "Flags to be used when linking an executable.", "Same as CMAKE_C_FLAGS_* but used by the linker " "when creating executables.",false, "Variables that Control the Build"); cm->DefineProperty ("CMAKE_LIBRARY_PATH_FLAG", cmProperty::VARIABLE, - "The flag used to add a library search path to a compiler.", - "The flag used to specify a library directory to the compiler. " + "The flag to be used to add a library search path to a compiler.", + "The flag will be used to specify a library directory to the compiler. " "On most compilers this is \"-L\".",false, "Variables that Control the Build"); cm->DefineProperty ("CMAKE_LINK_DEF_FILE_FLAG ", cmProperty::VARIABLE, - "Linker flag used to specify a .def file for dll creation.", - "The flag used to add a .def file when creating " - "a dll on Windows, this is only defined on Windows.",false, + "Linker flag to be used to specify a .def file for dll creation.", + "The flag will be used to add a .def file when creating " + "a dll on Windows; this is only defined on Windows." + ,false, "Variables that Control the Build"); cm->DefineProperty ("CMAKE_LINK_LIBRARY_FLAG", cmProperty::VARIABLE, - "Flag used to link a library into an executable.", - "The flag used to specify a library to link to an executable. " + "Flag to be used to link a library into an executable.", + "The flag will be used to specify a library to link to an executable. " "On most compilers this is \"-l\".",false, "Variables that Control the Build"); cm->DefineProperty ("CMAKE_LINK_LIBRARY_FILE_FLAG", cmProperty::VARIABLE, - "Flag used to link a library specified by a path to its file.", - "The flag used before a library file path is given to the linker. " + "Flag to be used to link a library specified by a path to its file.", + "The flag will be used before a library file path is given to the " + "linker. " "This is needed only on very few platforms.", false, "Variables that Control the Build"); cm->DefineProperty -- cgit v0.12 From 6162e0ff2d20d70cb2f7ef6714e05ca65aed3123 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 7 May 2013 11:56:31 -0400 Subject: CMake 2.8.11-rc4 --- ChangeLog.manual | 10 ++++++++++ Source/CMakeVersion.cmake | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog.manual b/ChangeLog.manual index 2a44133..970d67c 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,13 @@ +Changes in CMake 2.8.11-rc4 (since 2.8.11-rc3) +---------------------------------------------- +Brad King (1): + target_link_libraries: Update usage requirements documentation + +Stephen Kelly (3): + Centralize maintenance of usage requirement include directories + Fix include dir propagation from conditionally linked targets + Memoize usage requirement include directories in a config-specific map + Changes in CMake 2.8.11-rc3 (since 2.8.11-rc2) ---------------------------------------------- Brad King (1): diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ce99a2c..9ca7add 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -3,4 +3,4 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) set(CMake_VERSION_TWEAK 0) -set(CMake_VERSION_RC 3) +set(CMake_VERSION_RC 4) -- cgit v0.12 From e4c046521f1da9cee44833d88320d7551719059b Mon Sep 17 00:00:00 2001 From: Alexander Mohr Date: Wed, 8 May 2013 09:10:52 -0400 Subject: VS: Detect MSVC compiler id on ARM toolchain This enables detection with the VS2012 CTP for windows Blue (8.1). To build native ARM you need to have the WOA SDK (Windows on ARM). --- Modules/CMakeDetermineCompilerId.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index b918092..ae91a29 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -131,6 +131,8 @@ Id flags: ${testflags} elseif("${id_arch}" STREQUAL "Itanium") set(id_machine_10 MachineIA64) set(id_arch ia64) + elseif("${id_arch}" STREQUAL "ARM") + set(id_machine_10 MachineARM) else() set(id_machine_6 x86) set(id_machine_10 MachineX86) -- cgit v0.12 From 778aacc864d050f6b1213dff0a3211723f79f928 Mon Sep 17 00:00:00 2001 From: Gregoire Lejeune Date: Tue, 29 May 2012 22:23:15 +0200 Subject: Allow using Java in a cross-compilation toolchain Since Java is a portable language, if you want to use Java when cross-compiling, UseJava uses the JVM installed on the host. So in this case, we must use set CMAKE_JAVA_INCLUDE_FLAG_SEP for the current host. --- Modules/UseJava.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake index 0438695..e686c1d 100644 --- a/Modules/UseJava.cmake +++ b/Modules/UseJava.cmake @@ -242,7 +242,7 @@ function(add_jar _TARGET_NAME) ${CMAKE_JAVA_LIBRARY_OUTPUT_PATH} ) - if (WIN32 AND NOT CYGWIN) + if (WIN32 AND NOT CYGWIN AND CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") set(CMAKE_JAVA_INCLUDE_FLAG_SEP ";") else () set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":") -- cgit v0.12 From bcc0f3fb05276c58387e6ea43c1cf913790db0ed Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Sun, 5 May 2013 17:00:24 +0200 Subject: Tests: create output files for all memory checkers The dummy memory tester implementation now understands the command line switches for all memory checkers to redirect the output to a file. This avoids triggering the error cases for BoundsChecker and Purify because the output file does not exist. --- Tests/CTestTestMemcheck/CMakeLists.txt | 34 ++++++++++++--------- Tests/CTestTestMemcheck/memtester.cxx.in | 52 ++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 14 deletions(-) create mode 100644 Tests/CTestTestMemcheck/memtester.cxx.in diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt index 2730a61..b05d96b 100644 --- a/Tests/CTestTestMemcheck/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -1,10 +1,13 @@ foreach (_retval 0 1) - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret${_retval}.c" "int main(){return ${_retval};}\n") + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/memtester.cxx.in" "${CMAKE_CURRENT_BINARY_DIR}/ret${_retval}.cxx" @ONLY) endforeach () +include_directories(${CMake_SOURCE_DIR}/Source ${CMake_BINARY_DIR}/Source) + # create binaries that we will use as a pseudo memory checker -add_executable(pseudo_valgrind "${CMAKE_CURRENT_BINARY_DIR}/ret0.c") +add_executable(pseudo_valgrind "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx") set_target_properties(pseudo_valgrind PROPERTIES OUTPUT_NAME valgrind) +target_link_libraries(pseudo_valgrind CMakeLib) # Xcode 2.x forgets to create the output directory before linking # the individual architectures. @@ -14,13 +17,19 @@ if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]" ) endif() -add_executable(pseudo_purify "${CMAKE_CURRENT_BINARY_DIR}/ret0.c") +add_executable(pseudo_purify "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx") set_target_properties(pseudo_purify PROPERTIES OUTPUT_NAME purify) -add_executable(pseudo_BC "${CMAKE_CURRENT_BINARY_DIR}/ret0.c") +target_link_libraries(pseudo_purify CMakeLib) +add_executable(pseudo_BC "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx") set_target_properties(pseudo_BC PROPERTIES OUTPUT_NAME BC) +target_link_libraries(pseudo_BC CMakeLib) # binary to be used as pre- and post-memcheck command that fails -add_executable(memcheck_fail "${CMAKE_CURRENT_BINARY_DIR}/ret1.c") +add_executable(memcheck_fail "${CMAKE_CURRENT_BINARY_DIR}/ret1.cxx") +target_link_libraries(memcheck_fail CMakeLib) + +set(NORMAL_CTEST_OUTPUT "\n1/1 MemCheck #1: RunCMake \\.+ Passed +[0-9]+.[0-9]+ sec\n\n100% tests passed, 0 tests failed out of 1\n.*\n-- Processing memory checking output: \nMemory checking results:\n") +set(BULLSEYE_MSG "(BullseyeCoverage[^\n]*\n)?") foreach (_test IN ITEMS Unknown UnknownQuoted NotExist DummyValgrind DummyValgrindPrePost @@ -55,13 +64,13 @@ endforeach () set_tests_properties(CTestTestMemcheckNotExist PROPERTIES PASS_REGULAR_EXPRESSION "Memory checker \\(MemoryCheckCommand\\) not set, or cannot find the specified program.") -set(NORMAL_CTEST_OUTPUT "\n-- Processing memory checking output: \nMemory checking results:\n(BullseyeCoverage[^\n]*\n)?") - # It is a valid result if valgrind does not output any files (can e.g. happen # if you have not compiled in debug mode), so these tests will not fail. -set_tests_properties(CTestTestMemcheckDummyValgrind CTestTestMemcheckDummyValgrindPrePost +set_tests_properties(CTestTestMemcheckDummyValgrind + CTestTestMemcheckDummyValgrindPrePost + CTestTestMemcheckDummyPurify PROPERTIES - PASS_REGULAR_EXPRESSION "${NORMAL_CTEST_OUTPUT}") + PASS_REGULAR_EXPRESSION "${NORMAL_CTEST_OUTPUT}${BULLSEYE_MSG}$") foreach (_pp Pre Post) string(TOLOWER ${_pp} _pp_lower) @@ -72,10 +81,7 @@ endforeach () set_tests_properties(CTestTestMemcheckDummyValgrindIgnoreMemcheck PROPERTIES - PASS_REGULAR_EXPRESSION "\n2/2 Test #2: RunCMakeAgain .*\n1/1 MemCheck #1: RunCMake .*${NORMAL_CTEST_OUTPUT}") - -set_tests_properties(CTestTestMemcheckDummyPurify PROPERTIES - PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CMAKE_CURRENT_BINARY_DIR}/DummyPurify/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyPurify/test.cmake\n") + PASS_REGULAR_EXPRESSION "\n2/2 Test #2: RunCMakeAgain .*${NORMAL_CTEST_OUTPUT}${BULLSEYE_MSG}$") set_tests_properties(CTestTestMemcheckDummyBC PROPERTIES - PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CMAKE_CURRENT_BINARY_DIR}/DummyBC/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error parsing XML in stream at line 1: no element found\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyBC/test.cmake\n") + PASS_REGULAR_EXPRESSION "\n1/1 MemCheck #1: RunCMake \\.+ Passed +[0-9]+.[0-9]+ sec\n\n100% tests passed, 0 tests failed out of 1\n(.*\n)?Error parsing XML in stream at line 1: no element found\n") diff --git a/Tests/CTestTestMemcheck/memtester.cxx.in b/Tests/CTestTestMemcheck/memtester.cxx.in new file mode 100644 index 0000000..64b72d3 --- /dev/null +++ b/Tests/CTestTestMemcheck/memtester.cxx.in @@ -0,0 +1,52 @@ +#include +#include + +#define RETVAL @_retval@ + +int +main(int argc, char **argv) +{ + std::string exename = argv[0]; + std::string logarg; + bool nextarg = false; + + if (exename.find("valgrind") != exename.npos) + logarg = "--log-file="; + else if (exename.find("purify") != exename.npos) +#ifdef _WIN32 + logarg = "/SAVETEXTDATA="; +#else + logarg = "-log-file="; +#endif + else if (exename.find("BC") != exename.npos) + { + nextarg = true; + logarg = "/X"; + } + + if (!logarg.empty()) { + std::string logfile; + for (int i = 1; i < argc; i++) { + std::string arg = argv[i]; + if (arg.find(logarg) == 0) + { + if (nextarg) + { + if (i == argc - 1) + return 1; // invalid command line + logfile = argv[i + 1]; + } + else + { + logfile = arg.substr(logarg.length()); + } + break; + } + } + + if (!logfile.empty()) + cmSystemTools::Touch(logfile.c_str(), true); + } + + return RETVAL; +} -- cgit v0.12 From dde6306a48e0eac9783737ca2dab3ce28e27c869 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Sat, 4 May 2013 19:03:26 +0200 Subject: CTest: use an output file for Valgrind (#14110) This makes sure Valgrind output will not screw up tests that match on the output. --- Source/CTest/cmCTestMemCheckHandler.cxx | 20 ++++++++++++++++++++ Source/CTest/cmCTestMemCheckHandler.h | 4 ++++ Source/CTest/cmCTestRunTest.cxx | 18 ++++++++++++------ 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 80218ad..b320605 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -491,6 +491,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() switch ( this->MemoryTesterStyle ) { case cmCTestMemCheckHandler::VALGRIND: + { if ( this->MemoryTesterOptions.empty() ) { this->MemoryTesterOptions.push_back("-q"); @@ -516,7 +517,11 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile"); this->MemoryTesterOptions.push_back(suppressions); } + std::string outputFile = "--log-file=" + + this->MemoryTesterOutputFile; + this->MemoryTesterOptions.push_back(outputFile); break; + } case cmCTestMemCheckHandler::PURIFY: { std::string outputFile; @@ -948,6 +953,21 @@ cmCTestMemCheckHandler::PostProcessPurifyTest(cmCTestTestResult& res) cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "PostProcessPurifyTest for : " << res.Name.c_str() << std::endl); + appendMemTesterOutput(res); +} + +void +cmCTestMemCheckHandler::PostProcessValgrindTest(cmCTestTestResult& res) +{ + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "PostProcessValgrindTest for : " + << res.Name.c_str() << std::endl); + appendMemTesterOutput(res); +} + +void +cmCTestMemCheckHandler::appendMemTesterOutput(cmCTestTestResult& res) +{ if ( !cmSystemTools::FileExists(this->MemoryTesterOutputFile.c_str()) ) { std::string log = "Cannot find memory tester output file: " diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h index 1e81c89..0a8c1b3 100644 --- a/Source/CTest/cmCTestMemCheckHandler.h +++ b/Source/CTest/cmCTestMemCheckHandler.h @@ -119,6 +119,10 @@ private: void PostProcessPurifyTest(cmCTestTestResult& res); void PostProcessBoundsCheckerTest(cmCTestTestResult& res); + void PostProcessValgrindTest(cmCTestTestResult& res); + + ///! append MemoryTesterOutputFile to the test log + void appendMemTesterOutput(cmCTestTestHandler::cmCTestTestResult& res); }; #endif diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 5eabf3f..aa27f19 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -384,13 +384,19 @@ void cmCTestRunTest::MemCheckPostProcess() << this->TestResult.Name.c_str() << std::endl); cmCTestMemCheckHandler * handler = static_cast (this->TestHandler); - if(handler->MemoryTesterStyle == cmCTestMemCheckHandler::BOUNDS_CHECKER) + switch ( handler->MemoryTesterStyle ) { - handler->PostProcessBoundsCheckerTest(this->TestResult); - } - else if(handler->MemoryTesterStyle == cmCTestMemCheckHandler::PURIFY) - { - handler->PostProcessPurifyTest(this->TestResult); + case cmCTestMemCheckHandler::VALGRIND: + handler->PostProcessValgrindTest(this->TestResult); + break; + case cmCTestMemCheckHandler::PURIFY: + handler->PostProcessPurifyTest(this->TestResult); + break; + case cmCTestMemCheckHandler::BOUNDS_CHECKER: + handler->PostProcessBoundsCheckerTest(this->TestResult); + break; + default: + break; } } -- cgit v0.12 From f4994223bb84bfe98e0113a8a5ccac67435c13d3 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 6 May 2013 14:39:05 +0200 Subject: CTest: remove unreachable code and CTestTestMemcheckUnknown test The memory checker command can't be quoted at this point, because previously it has been tested that the given file exists, which will fail if the name is quoted. The CTestTestMemcheckUnknown test aimed to test this case, has always failed to do so and serves no useful purpose therefore. --- Source/CTest/cmCTestMemCheckHandler.cxx | 7 ------- Tests/CTestTestMemcheck/CMakeLists.txt | 8 +++----- Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt | 5 ----- .../CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake | 7 ------- Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in | 19 ------------------- 5 files changed, 3 insertions(+), 43 deletions(-) delete mode 100644 Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt delete mode 100644 Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake delete mode 100644 Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index b320605..280faa0 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -461,13 +461,6 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() return false; } - if ( this->MemoryTester[0] == '\"' && - this->MemoryTester[this->MemoryTester.size()-1] == '\"' ) - { - this->MemoryTester - = this->MemoryTester.substr(1, this->MemoryTester.size()-2); - } - // Setup the options std::string memoryTesterOptions; if ( this->CTest->GetCTestConfiguration( diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt index b05d96b..d2f3a87 100644 --- a/Tests/CTestTestMemcheck/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -31,7 +31,7 @@ target_link_libraries(memcheck_fail CMakeLib) set(NORMAL_CTEST_OUTPUT "\n1/1 MemCheck #1: RunCMake \\.+ Passed +[0-9]+.[0-9]+ sec\n\n100% tests passed, 0 tests failed out of 1\n.*\n-- Processing memory checking output: \nMemory checking results:\n") set(BULLSEYE_MSG "(BullseyeCoverage[^\n]*\n)?") -foreach (_test IN ITEMS Unknown UnknownQuoted NotExist +foreach (_test IN ITEMS Unknown NotExist DummyValgrind DummyValgrindPrePost DummyValgrindFailPre DummyValgrindFailPost DummyPurify DummyBC @@ -56,10 +56,8 @@ string(REPLACE "(" "\\(" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") string(REPLACE ")" "\\)" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") string(REPLACE "+" "\\+" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") -foreach (_unkn Unknown UnknownQuoted) - set_tests_properties(CTestTestMemcheck${_unkn} PROPERTIES - PASS_REGULAR_EXPRESSION "Do not understand memory checker: ${CMAKE_COMMAND_ESCAPED}\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/${_unkn}/test.cmake\n") -endforeach () +set_tests_properties(CTestTestMemcheckUnknown PROPERTIES + PASS_REGULAR_EXPRESSION "Do not understand memory checker: ${CMAKE_COMMAND_ESCAPED}\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/Unknown/test.cmake\n") set_tests_properties(CTestTestMemcheckNotExist PROPERTIES PASS_REGULAR_EXPRESSION "Memory checker \\(MemoryCheckCommand\\) not set, or cannot find the specified program.") diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt b/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt deleted file mode 100644 index 6f49c61..0000000 --- a/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) -project(CTestTestMemcheckUnknownQuoted) -include(CTest) - -add_test (RunCMake "\"${CMAKE_COMMAND}\"") diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake b/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake deleted file mode 100644 index f0233a7..0000000 --- a/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknownQuoted") -set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in b/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in deleted file mode 100644 index 1b1f702..0000000 --- a/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) - -# Settings: -set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") -set(CTEST_SITE "@SITE@") -set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckUnknownQuoted") - -set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/UnknownQuoted") -set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/UnknownQuoted") -set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") -set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") -set(CTEST_MEMORYCHECK_COMMAND "@CMAKE_COMMAND@") - -CTEST_START(Experimental) -CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -- cgit v0.12 From abf1df48fc966efc8c2d489acbea24dc0312c84c Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Sun, 5 May 2013 20:44:07 +0200 Subject: Tests: remove code duplication in CTestTestMemCheck tests The code for the tests is basically the same for all those subtests, so have one template and configure that for as many tests as possible to make it easier maintainable. --- Tests/CTestTestMemcheck/CMakeLists.txt | 53 ++++++++++++++++------ Tests/CTestTestMemcheck/CMakeLists.txt.in | 7 +++ Tests/CTestTestMemcheck/CTestConfig.cmake.in | 9 ++++ Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt | 5 -- Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake | 7 --- Tests/CTestTestMemcheck/DummyBC/test.cmake.in | 25 ---------- Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt | 5 -- .../DummyPurify/CTestConfig.cmake | 7 --- Tests/CTestTestMemcheck/DummyPurify/test.cmake.in | 25 ---------- .../CTestTestMemcheck/DummyValgrind/CMakeLists.txt | 5 -- .../DummyValgrind/CTestConfig.cmake | 7 --- .../CTestTestMemcheck/DummyValgrind/test.cmake.in | 25 ---------- .../DummyValgrindFailPost/CMakeLists.txt | 5 -- .../DummyValgrindFailPost/CTestConfig.cmake | 7 --- .../DummyValgrindFailPost/test.cmake.in | 27 ----------- .../DummyValgrindFailPre/CMakeLists.txt | 5 -- .../DummyValgrindFailPre/CTestConfig.cmake | 7 --- .../DummyValgrindFailPre/test.cmake.in | 27 ----------- .../DummyValgrindIgnoreMemcheck/CMakeLists.txt | 6 --- .../DummyValgrindIgnoreMemcheck/CTestConfig.cmake | 9 ---- .../DummyValgrindIgnoreMemcheck/test.cmake.in | 25 ---------- .../DummyValgrindPrePost/CMakeLists.txt | 5 -- .../DummyValgrindPrePost/CTestConfig.cmake | 7 --- .../DummyValgrindPrePost/test.cmake.in | 28 ------------ Tests/CTestTestMemcheck/NotExist/CMakeLists.txt | 5 -- Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake | 7 --- Tests/CTestTestMemcheck/NotExist/test.cmake.in | 19 -------- Tests/CTestTestMemcheck/Unknown/CMakeLists.txt | 5 -- Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake | 7 --- Tests/CTestTestMemcheck/Unknown/test.cmake.in | 19 -------- Tests/CTestTestMemcheck/test.cmake.in | 24 ++++++++++ 31 files changed, 80 insertions(+), 344 deletions(-) create mode 100644 Tests/CTestTestMemcheck/CMakeLists.txt.in create mode 100644 Tests/CTestTestMemcheck/CTestConfig.cmake.in delete mode 100644 Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt delete mode 100644 Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake delete mode 100644 Tests/CTestTestMemcheck/DummyBC/test.cmake.in delete mode 100644 Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt delete mode 100644 Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake delete mode 100644 Tests/CTestTestMemcheck/DummyPurify/test.cmake.in delete mode 100644 Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt delete mode 100644 Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake delete mode 100644 Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in delete mode 100644 Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt delete mode 100644 Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake delete mode 100644 Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in delete mode 100644 Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt delete mode 100644 Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake delete mode 100644 Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in delete mode 100644 Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt delete mode 100644 Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake delete mode 100644 Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in delete mode 100644 Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt delete mode 100644 Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake delete mode 100644 Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in delete mode 100644 Tests/CTestTestMemcheck/NotExist/CMakeLists.txt delete mode 100644 Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake delete mode 100644 Tests/CTestTestMemcheck/NotExist/test.cmake.in delete mode 100644 Tests/CTestTestMemcheck/Unknown/CMakeLists.txt delete mode 100644 Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake delete mode 100644 Tests/CTestTestMemcheck/Unknown/test.cmake.in create mode 100644 Tests/CTestTestMemcheck/test.cmake.in diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt index d2f3a87..3d6d8f3 100644 --- a/Tests/CTestTestMemcheck/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -31,25 +31,52 @@ target_link_libraries(memcheck_fail CMakeLib) set(NORMAL_CTEST_OUTPUT "\n1/1 MemCheck #1: RunCMake \\.+ Passed +[0-9]+.[0-9]+ sec\n\n100% tests passed, 0 tests failed out of 1\n.*\n-- Processing memory checking output: \nMemory checking results:\n") set(BULLSEYE_MSG "(BullseyeCoverage[^\n]*\n)?") -foreach (_test IN ITEMS Unknown NotExist - DummyValgrind DummyValgrindPrePost - DummyValgrindFailPre DummyValgrindFailPost - DummyPurify DummyBC - DummyValgrindIgnoreMemcheck) - configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/${_test}/test.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/${_test}/test.cmake" - @ONLY ESCAPE_QUOTES) - add_test(NAME CTestTestMemcheck${_test} +function(gen_mc_test NAME CHECKER) + set(SUBTEST_NAME "${NAME}") + set(CHECKER_COMMAND "${CHECKER}") + foreach(_file IN ITEMS CMakeLists.txt CTestConfig.cmake test.cmake) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${_file}.in" + "${CMAKE_CURRENT_BINARY_DIR}/${NAME}/${_file}" @ONLY) + endforeach() + add_test(NAME CTestTestMemcheck${NAME} COMMAND ${CMAKE_CTEST_COMMAND} - -S "${CMAKE_CURRENT_BINARY_DIR}/${_test}/test.cmake" -V - --output-log "${CMAKE_CURRENT_BINARY_DIR}/${_test}/testOutput.log" + -C $ + -S "${CMAKE_CURRENT_BINARY_DIR}/${NAME}/test.cmake" -V + --output-log "${CMAKE_CURRENT_BINARY_DIR}/${NAME}/testOutput.log" -D PSEUDO_BC=$ -D PSEUDO_PURIFY=$ -D PSEUDO_VALGRIND=$ -D ERROR_COMMAND=$ ) -endforeach () +endfunction(gen_mc_test) + +unset(CTEST_EXTRA_CONFIG) +unset(CTEST_EXTRA_CODE) +unset(CMAKELISTS_EXTRA_CODE) + +gen_mc_test(DummyPurify "\${PSEUDO_PURIFY}") +gen_mc_test(DummyValgrind "\${PSEUDO_VALGRIND}") +gen_mc_test(DummyBC "\${PSEUDO_BC}") + +set(CTEST_EXTRA_CODE "set(CTEST_CUSTOM_PRE_MEMCHECK \"\${CTEST_MEMORYCHECK_COMMAND}\")\nset(CTEST_CUSTOM_POST_MEMCHECK \"\${CTEST_MEMORYCHECK_COMMAND}\")") +gen_mc_test(DummyValgrindPrePost "\${PSEUDO_VALGRIND}") + +set(CTEST_EXTRA_CODE "set(CTEST_CUSTOM_POST_MEMCHECK \"\${ERROR_COMMAND}\")") +gen_mc_test(DummyValgrindFailPost "\${PSEUDO_VALGRIND}") + +set(CTEST_EXTRA_CODE "set(CTEST_CUSTOM_PRE_MEMCHECK \"\${ERROR_COMMAND}\")") +gen_mc_test(DummyValgrindFailPre "\${PSEUDO_VALGRIND}") + +unset(CTEST_EXTRA_CODE) +set(CTEST_EXTRA_CONFIG "set(CTEST_CUSTOM_MEMCHECK_IGNORE RunCMakeAgain)\n") +set(CMAKELISTS_EXTRA_CODE "add_test(NAME RunCMakeAgain COMMAND \"\${CMAKE_COMMAND}\" --version)") +gen_mc_test(DummyValgrindIgnoreMemcheck "\${PSEUDO_VALGRIND}") + +unset(CTEST_EXTRA_CONFIG) +unset(CMAKELISTS_EXTRA_CODE) +gen_mc_test(NotExist "\${CTEST_BINARY_DIRECTORY}/no-memcheck-exe") + +gen_mc_test(Unknown "${CMAKE_COMMAND}") string(REPLACE "\\" "\\\\" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND}") string(REPLACE "(" "\\(" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt.in b/Tests/CTestTestMemcheck/CMakeLists.txt.in new file mode 100644 index 0000000..e28e56a --- /dev/null +++ b/Tests/CTestTestMemcheck/CMakeLists.txt.in @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheck@SUBTEST_NAME@) +include(CTest) + +add_test(NAME RunCMake COMMAND "${CMAKE_COMMAND}" --version) + +@CMAKELISTS_EXTRA_CODE@ diff --git a/Tests/CTestTestMemcheck/CTestConfig.cmake.in b/Tests/CTestTestMemcheck/CTestConfig.cmake.in new file mode 100644 index 0000000..6cf3782 --- /dev/null +++ b/Tests/CTestTestMemcheck/CTestConfig.cmake.in @@ -0,0 +1,9 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheck@SUBTEST_NAME@") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) + +@CTEST_EXTRA_CONFIG@ diff --git a/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt deleted file mode 100644 index aa0e495..0000000 --- a/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) -project(CTestTestMemcheckDummyBC) -include(CTest) - -add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake deleted file mode 100644 index 39cdd88..0000000 --- a/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyBC") -set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyBC/test.cmake.in b/Tests/CTestTestMemcheck/DummyBC/test.cmake.in deleted file mode 100644 index 1b16433..0000000 --- a/Tests/CTestTestMemcheck/DummyBC/test.cmake.in +++ /dev/null @@ -1,25 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) - -# Settings: -set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") -set(CTEST_SITE "@SITE@") -set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyBC") - -set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyBC") -set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyBC") -set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") -set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") - -set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_BC}") - -#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) - -CTEST_START(Experimental) -CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt deleted file mode 100644 index dfd93fd..0000000 --- a/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) -project(CTestTestMemcheckDummyPurify) -include(CTest) - -add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake deleted file mode 100644 index 40b9608..0000000 --- a/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyPurify") -set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in b/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in deleted file mode 100644 index 0c8795c..0000000 --- a/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in +++ /dev/null @@ -1,25 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) - -# Settings: -set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") -set(CTEST_SITE "@SITE@") -set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyPurify") - -set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyPurify") -set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyPurify") -set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") -set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") - -set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_PURIFY}") - -#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) - -CTEST_START(Experimental) -CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt deleted file mode 100644 index 822966a..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) -project(CTestTestMemcheckDummyValgrind) -include(CTest) - -add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake deleted file mode 100644 index 4ca59a4..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind") -set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in deleted file mode 100644 index c3941c1..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in +++ /dev/null @@ -1,25 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) - -# Settings: -set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") -set(CTEST_SITE "@SITE@") -set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrind") - -set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrind") -set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrind") -set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") -set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") - -set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") - -#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) - -CTEST_START(Experimental) -CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt deleted file mode 100644 index 8185071..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) -project(CTestTestMemcheckDummyValgrindFailPost) -include(CTest) - -add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake deleted file mode 100644 index 4ca59a4..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind") -set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in deleted file mode 100644 index 90e2ac5..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in +++ /dev/null @@ -1,27 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) - -# Settings: -set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") -set(CTEST_SITE "@SITE@") -set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindFailPost") - -set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindFailPost") -set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindFailPost") -set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") -set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") - -set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") - -set(CTEST_CUSTOM_POST_MEMCHECK "${ERROR_COMMAND}") - -#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) - -CTEST_START(Experimental) -CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt deleted file mode 100644 index 3714cd6..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) -project(CTestTestMemcheckDummyValgrindFailPre) -include(CTest) - -add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake deleted file mode 100644 index 4ca59a4..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind") -set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in deleted file mode 100644 index fd17f63..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in +++ /dev/null @@ -1,27 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) - -# Settings: -set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") -set(CTEST_SITE "@SITE@") -set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindFailPre") - -set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindFailPre") -set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindFailPre") -set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") -set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") - -set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") - -set(CTEST_CUSTOM_PRE_MEMCHECK "${ERROR_COMMAND}") - -#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) - -CTEST_START(Experimental) -CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt deleted file mode 100644 index 5d437d1..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) -project(CTestTestMemcheckDummyValgrindIgnoreMemcheck) -include(CTest) - -add_test (RunCMake "${CMAKE_COMMAND}") -add_test (RunCMakeAgain "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake deleted file mode 100644 index 6eee3e6..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake +++ /dev/null @@ -1,9 +0,0 @@ -set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrindIgnoreMemcheck") -set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) - -set(CTEST_CUSTOM_MEMCHECK_IGNORE RunCMakeAgain) diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in deleted file mode 100644 index 37aaaeb..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in +++ /dev/null @@ -1,25 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) - -# Settings: -set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") -set(CTEST_SITE "@SITE@") -set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindIgnoreMemcheck") - -set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindIgnoreMemcheck") -set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindIgnoreMemcheck") -set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") -set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") - -set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") - -#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) - -CTEST_START(Experimental) -CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt deleted file mode 100644 index bc15632..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) -project(CTestTestMemcheckDummyValgrindPrePost) -include(CTest) - -add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake deleted file mode 100644 index 6e4c2e8..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrindPrePost") -set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in deleted file mode 100644 index 11f14a9..0000000 --- a/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in +++ /dev/null @@ -1,28 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) - -# Settings: -set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") -set(CTEST_SITE "@SITE@") -set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindPrePost") - -set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindPrePost") -set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindPrePost") -set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") -set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") - -set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") - -set(CTEST_CUSTOM_PRE_MEMCHECK "${CTEST_MEMORYCHECK_COMMAND}") -set(CTEST_CUSTOM_POST_MEMCHECK "${CTEST_MEMORYCHECK_COMMAND}") - -#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) - -CTEST_START(Experimental) -CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt b/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt deleted file mode 100644 index 4d905de..0000000 --- a/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) -project(CTestTestMemcheckNotExist) -include(CTest) - -add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake b/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake deleted file mode 100644 index 3ed84aa..0000000 --- a/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknown") -set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/NotExist/test.cmake.in b/Tests/CTestTestMemcheck/NotExist/test.cmake.in deleted file mode 100644 index 43f7542..0000000 --- a/Tests/CTestTestMemcheck/NotExist/test.cmake.in +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) - -# Settings: -set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") -set(CTEST_SITE "@SITE@") -set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckNotExist") - -set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/NotExist") -set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/NotExist") -set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") -set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") -set(CTEST_MEMORYCHECK_COMMAND "${CTEST_BINARY_DIRECTORY}/no-memcheck-exe") - -CTEST_START(Experimental) -CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt b/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt deleted file mode 100644 index 3fd3103..0000000 --- a/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) -project(CTestTestMemcheckUnknown) -include(CTest) - -add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake b/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake deleted file mode 100644 index 3ed84aa..0000000 --- a/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknown") -set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/Unknown/test.cmake.in b/Tests/CTestTestMemcheck/Unknown/test.cmake.in deleted file mode 100644 index 0830bf0..0000000 --- a/Tests/CTestTestMemcheck/Unknown/test.cmake.in +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) - -# Settings: -set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") -set(CTEST_SITE "@SITE@") -set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckUnknown") - -set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/Unknown") -set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/Unknown") -set(CTEST_CVS_COMMAND "@CVSCOMMAND@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") -set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") -set(CTEST_MEMORYCHECK_COMMAND "@CMAKE_COMMAND@") - -CTEST_START(Experimental) -CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/test.cmake.in b/Tests/CTestTestMemcheck/test.cmake.in new file mode 100644 index 0000000..6c388c5 --- /dev/null +++ b/Tests/CTestTestMemcheck/test.cmake.in @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Memcheck@SUBTEST_NAME@") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/@SUBTEST_NAME@") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/@SUBTEST_NAME@") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "@CHECKER_COMMAND@") + +@CTEST_EXTRA_CODE@ + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -- cgit v0.12 From 775225319295c08d2d6d7bb84010e4494d1bc5d0 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 6 May 2013 13:09:22 +0200 Subject: Tests: verify that memory checker output files are always present All supported memory checkers now write their output to a file. Use a dummy checker that ignores the given filename and ensure that the missing file is reported as error. --- Tests/CTestTestMemcheck/CMakeLists.txt | 27 +++++++++++++++++++++- .../NoLogDummyChecker/CMakeLists.txt | 17 ++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt index 3d6d8f3..65557c3 100644 --- a/Tests/CTestTestMemcheck/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -28,10 +28,15 @@ target_link_libraries(pseudo_BC CMakeLib) add_executable(memcheck_fail "${CMAKE_CURRENT_BINARY_DIR}/ret1.cxx") target_link_libraries(memcheck_fail CMakeLib) +# Binaries that are used as memchecker that do not write the expected +# output file. Need to be in their own subdirectory as they have the +# same filenames. +add_subdirectory(NoLogDummyChecker) + set(NORMAL_CTEST_OUTPUT "\n1/1 MemCheck #1: RunCMake \\.+ Passed +[0-9]+.[0-9]+ sec\n\n100% tests passed, 0 tests failed out of 1\n.*\n-- Processing memory checking output: \nMemory checking results:\n") set(BULLSEYE_MSG "(BullseyeCoverage[^\n]*\n)?") -function(gen_mc_test NAME CHECKER) +function(gen_mc_test_internal NAME CHECKER) set(SUBTEST_NAME "${NAME}") set(CHECKER_COMMAND "${CHECKER}") foreach(_file IN ITEMS CMakeLists.txt CTestConfig.cmake test.cmake) @@ -43,6 +48,12 @@ function(gen_mc_test NAME CHECKER) -C $ -S "${CMAKE_CURRENT_BINARY_DIR}/${NAME}/test.cmake" -V --output-log "${CMAKE_CURRENT_BINARY_DIR}/${NAME}/testOutput.log" + ${ARGN} + ) +endfunction(gen_mc_test_internal) + +function(gen_mc_test NAME CHECKER) + gen_mc_test_internal(${NAME} "${CHECKER}" -D PSEUDO_BC=$ -D PSEUDO_PURIFY=$ -D PSEUDO_VALGRIND=$ @@ -50,6 +61,17 @@ function(gen_mc_test NAME CHECKER) ) endfunction(gen_mc_test) +function(gen_mcnl_test NAME CHECKER) + gen_mc_test_internal(${NAME} ${CHECKER} + -D PSEUDO_BC=$ + -D PSEUDO_PURIFY=$ + -D PSEUDO_VALGRIND=$ + ) + set_tests_properties(CTestTestMemcheck${NAME} + PROPERTIES + PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CMAKE_CURRENT_BINARY_DIR}/${NAME}/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/${NAME}/test.cmake\n") +endfunction(gen_mcnl_test) + unset(CTEST_EXTRA_CONFIG) unset(CTEST_EXTRA_CODE) unset(CMAKELISTS_EXTRA_CODE) @@ -57,6 +79,9 @@ unset(CMAKELISTS_EXTRA_CODE) gen_mc_test(DummyPurify "\${PSEUDO_PURIFY}") gen_mc_test(DummyValgrind "\${PSEUDO_VALGRIND}") gen_mc_test(DummyBC "\${PSEUDO_BC}") +gen_mcnl_test(DummyPurifyNoLogfile "\${PSEUDO_PURIFY}") +gen_mcnl_test(DummyValgrindNoLogfile "\${PSEUDO_VALGRIND}") +gen_mcnl_test(DummyBCNoLogfile "\${PSEUDO_BC}") set(CTEST_EXTRA_CODE "set(CTEST_CUSTOM_PRE_MEMCHECK \"\${CTEST_MEMORYCHECK_COMMAND}\")\nset(CTEST_CUSTOM_POST_MEMCHECK \"\${CTEST_MEMORYCHECK_COMMAND}\")") gen_mc_test(DummyValgrindPrePost "\${PSEUDO_VALGRIND}") diff --git a/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt b/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt new file mode 100644 index 0000000..c5aa2cd --- /dev/null +++ b/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt @@ -0,0 +1,17 @@ +# A dummy checker implementation that does not write the requested output file +# so it triggers an error for every checker. + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret0.c" "int main(){return 0;}\n") + +foreach(_pseudo IN ITEMS valgrind purify BC) + add_executable(pseudonl_${_pseudo} "${CMAKE_CURRENT_BINARY_DIR}/ret0.c") + set_target_properties(pseudonl_${_pseudo} PROPERTIES OUTPUT_NAME ${_pseudo}) +endforeach() + +# Xcode 2.x forgets to create the output directory before linking +# the individual architectures. +if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]") + add_custom_command(TARGET pseudonl_valgrind + PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" + ) +endif() -- cgit v0.12 From 3b5b758915125f19cb57994601cc0cd68293fe2b Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 6 May 2013 22:04:30 +0200 Subject: CTest: drop suppression for gcc 2.9.6 errors from default Valgrind flags The --workaround-gcc296-bugs has been part of the default Valgrind flags since Valgrind support was added in commit 5b232ded151fc22144978b74cdaf7031d466e527 (ENH: Add initial memory check support which works for Valgrind, 2003-12-15). The Valgrind manpage says that this option should be avoided if not really needed as it may cause real errors to get ignored. If someone uses a compiler that really needs the flag this flag should be set by the user explicitely. Most users will never set any flags and probably never notice that they use a flag they shouldn't. --- Source/CTest/cmCTestMemCheckHandler.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 280faa0..19c156e 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -491,7 +491,6 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() this->MemoryTesterOptions.push_back("--tool=memcheck"); this->MemoryTesterOptions.push_back("--leak-check=yes"); this->MemoryTesterOptions.push_back("--show-reachable=yes"); - this->MemoryTesterOptions.push_back("--workaround-gcc296-bugs=yes"); this->MemoryTesterOptions.push_back("--num-callers=50"); } if ( this->CTest->GetCTestConfiguration( -- cgit v0.12 From cbdfcb0e61ad0fe3c61743111594f90c160f526d Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Tue, 7 May 2013 00:03:16 +0200 Subject: Tests: add test for non-existent Valgrind suppression file --- Tests/CTestTestMemcheck/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt index 65557c3..fc3b01e 100644 --- a/Tests/CTestTestMemcheck/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -97,8 +97,11 @@ set(CTEST_EXTRA_CONFIG "set(CTEST_CUSTOM_MEMCHECK_IGNORE RunCMakeAgain)\n") set(CMAKELISTS_EXTRA_CODE "add_test(NAME RunCMakeAgain COMMAND \"\${CMAKE_COMMAND}\" --version)") gen_mc_test(DummyValgrindIgnoreMemcheck "\${PSEUDO_VALGRIND}") -unset(CTEST_EXTRA_CONFIG) +set(CTEST_EXTRA_CONFIG "set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE \"\${CMAKE_CURRENT_BINARY_DIR}/does-not-exist\")") unset(CMAKELISTS_EXTRA_CODE) +gen_mc_test(DummyValgrindInvalidSupFile "\${PSEUDO_VALGRIND}") + +unset(CTEST_EXTRA_CONFIG) gen_mc_test(NotExist "\${CTEST_BINARY_DIRECTORY}/no-memcheck-exe") gen_mc_test(Unknown "${CMAKE_COMMAND}") @@ -135,3 +138,6 @@ set_tests_properties(CTestTestMemcheckDummyValgrindIgnoreMemcheck set_tests_properties(CTestTestMemcheckDummyBC PROPERTIES PASS_REGULAR_EXPRESSION "\n1/1 MemCheck #1: RunCMake \\.+ Passed +[0-9]+.[0-9]+ sec\n\n100% tests passed, 0 tests failed out of 1\n(.*\n)?Error parsing XML in stream at line 1: no element found\n") + +set_tests_properties(CTestTestMemcheckDummyValgrindInvalidSupFile PROPERTIES + PASS_REGULAR_EXPRESSION "\nCannot find memory checker suppression file: ${CMAKE_CURRENT_BINARY_DIR}/does-not-exist\n") -- cgit v0.12 From 61ddb9319b8b0d7182d9812df03b88b5d8e57c1d Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Thu, 9 May 2013 12:09:02 +0200 Subject: CTest: fix comment documenting cmBoundsCheckerParser class This was obviously copied from Source/cmGlobalXCodeGenerator.cxx during implementation but the comment was forgotten. --- Source/CTest/cmCTestMemCheckHandler.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 19c156e..8baa673 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -43,8 +43,7 @@ static CatToErrorType cmCTestMemCheckBoundsChecker[] = { {0,0} }; -// parse the xml file storing the installed version of Xcode on -// the machine +// parse the xml file containing the results of last BoundsChecker run class cmBoundsCheckerParser : public cmXMLParser { public: -- cgit v0.12 From 159c3e91ac0abc386ff363ed3382105de7143339 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Thu, 9 May 2013 12:24:09 +0200 Subject: Tests: add a test with custom options passed to valgrind --- Tests/CTestTestMemcheck/CMakeLists.txt | 9 +++++++++ Tests/CTestTestMemcheck/memtester.cxx.in | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt index fc3b01e..1c0c3b2 100644 --- a/Tests/CTestTestMemcheck/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -101,6 +101,12 @@ set(CTEST_EXTRA_CONFIG "set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE \"\${CMAKE_CURRE unset(CMAKELISTS_EXTRA_CODE) gen_mc_test(DummyValgrindInvalidSupFile "\${PSEUDO_VALGRIND}") +# CTest will add the logfile option as last option. Tell the dummy memcheck +# to ignore that argument. This will cause the logfile to be missing, which +# will be the prove for us that the custom option is indeed used. +set(CTEST_EXTRA_CONFIG "set(CTEST_MEMORYCHECK_COMMAND_OPTIONS \"--\")") +gen_mc_test(DummyValgrindCustomOptions "\${PSEUDO_VALGRIND}") + unset(CTEST_EXTRA_CONFIG) gen_mc_test(NotExist "\${CTEST_BINARY_DIRECTORY}/no-memcheck-exe") @@ -141,3 +147,6 @@ set_tests_properties(CTestTestMemcheckDummyBC PROPERTIES set_tests_properties(CTestTestMemcheckDummyValgrindInvalidSupFile PROPERTIES PASS_REGULAR_EXPRESSION "\nCannot find memory checker suppression file: ${CMAKE_CURRENT_BINARY_DIR}/does-not-exist\n") + +set_tests_properties(CTestTestMemcheckDummyValgrindCustomOptions PROPERTIES + PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CMAKE_CURRENT_BINARY_DIR}/DummyValgrindCustomOptions/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyValgrindCustomOptions/test.cmake\n") diff --git a/Tests/CTestTestMemcheck/memtester.cxx.in b/Tests/CTestTestMemcheck/memtester.cxx.in index 64b72d3..4609fa3 100644 --- a/Tests/CTestTestMemcheck/memtester.cxx.in +++ b/Tests/CTestTestMemcheck/memtester.cxx.in @@ -28,6 +28,12 @@ main(int argc, char **argv) std::string logfile; for (int i = 1; i < argc; i++) { std::string arg = argv[i]; + // stop processing options, this allows to force + // the logfile to be ignored + if (arg == "--") + { + break; + } if (arg.find(logarg) == 0) { if (nextarg) -- cgit v0.12 From e319e32b8c30d255ceea3ed1e133a7303aea9681 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Fri, 10 May 2013 20:50:22 +0200 Subject: CTest: make sure never to report negative test times (#14132) Because of clock scew between processors or just because of someone changing the system time the end timestamp may be before the start time. Reporting a negative time doesn't any sense, just report zero there as it already happens for really fast tests. --- Source/CTest/cmProcess.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 000bc85..167b992 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -175,6 +175,14 @@ int cmProcess::GetNextOutputLine(std::string& line, double timeout) // Record exit information. this->ExitValue = cmsysProcess_GetExitValue(this->Process); this->TotalTime = cmSystemTools::GetTime() - this->StartTime; + // Because of a processor clock scew the runtime may become slightly + // negative. If someone changed the system clock while the process was + // running this may be even more. Make sure not to report a negative + // duration here. + if (this->TotalTime <= 0.0) + { + this->TotalTime = 0.0; + } // std::cerr << "Time to run: " << this->TotalTime << "\n"; return cmsysProcess_Pipe_None; } -- cgit v0.12 From 74228e8486b1d87ef258f32be300a6b884793bc3 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Sat, 11 May 2013 12:02:05 +0200 Subject: Doc: fix example for FAIL_REGULAR_EXPRESSION The example used PASS_REGULAR_EXPRESSION instead of FAIL... --- Source/cmTest.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx index 912ec76..0904431 100644 --- a/Source/cmTest.cxx +++ b/Source/cmTest.cxx @@ -135,7 +135,7 @@ void cmTest::DefineProperties(cmake *cm) "If the output matches this regular expression the test will fail.", "If set, if the output matches one of " "specified regular expressions, the test will fail." - "For example: PASS_REGULAR_EXPRESSION \"[^a-z]Error;ERROR;Failed\""); + "For example: FAIL_REGULAR_EXPRESSION \"[^a-z]Error;ERROR;Failed\""); cm->DefineProperty ("LABELS", cmProperty::TEST, -- cgit v0.12 From 12cf7bc507e914c48289b73d241c5c9fea091ce8 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Sat, 11 May 2013 12:14:37 +0200 Subject: CTest: break after first regex match on output PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION both take a list of expressions. Stop searching if the first of those has matched the output as the result will not change anymore. --- Source/CTest/cmCTestRunTest.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 5eabf3f..fc1bcb5 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -166,6 +166,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) { found = true; reason = "Required regular expression found."; + break; } } if ( !found ) @@ -196,6 +197,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) reason += passIt->second; reason += "]"; forceFail = true; + break; } } } -- cgit v0.12 From 42bb42d19723323e6e48346b1437e04a251addfa Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 13 May 2013 11:01:17 -0400 Subject: VS: Always initialize CMAKE_CONFIGURATION_TYPES in IDE generators Initialize the CMAKE_CONFIGURATION_TYPES cache entry early during EnableLanguage like the Xcode generator does. Avoid depending on the MSVC compiler information module to do it. Otherwise code like project(MyProj NONE) sets CMAKE_CONFIGURATION_TYPES late (in GenerateConfigurations), and to only "Debug" and "Release" instead of the standard set of 4. Reported-by: Paul Smith --- Modules/Platform/Windows-MSVC.cmake | 3 --- Modules/Platform/Windows-df.cmake | 2 -- Source/cmGlobalVisualStudio7Generator.cxx | 10 ++++++++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index f9df6d8..8682e2d 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -52,9 +52,6 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 6") endif() if(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio") set (CMAKE_NO_BUILD_TYPE 1) - set (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING - "Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.") - mark_as_advanced(CMAKE_CONFIGURATION_TYPES) endif() # make sure to enable languages after setting configuration types diff --git a/Modules/Platform/Windows-df.cmake b/Modules/Platform/Windows-df.cmake index 7e2ac9f..8dfb610 100644 --- a/Modules/Platform/Windows-df.cmake +++ b/Modules/Platform/Windows-df.cmake @@ -38,8 +38,6 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 6") endif() if(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") set (CMAKE_NO_BUILD_TYPE 1) - set (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING - "Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.") endif() # does the compiler support pdbtype and is it the newer compiler diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 63cbdb8..ef2f77d 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -31,6 +31,16 @@ void cmGlobalVisualStudio7Generator mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1"); mf->AddDefinition("CMAKE_GENERATOR_FC", "ifort"); this->AddPlatformDefinitions(mf); + if(!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES")) + { + mf->AddCacheDefinition( + "CMAKE_CONFIGURATION_TYPES", + "Debug;Release;MinSizeRel;RelWithDebInfo", + "Semicolon separated list of supported configuration types, " + "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " + "anything else will be ignored.", + cmCacheManager::STRING); + } // Create list of configurations requested by user's cache, if any. this->cmGlobalGenerator::EnableLanguage(lang, mf, optional); -- cgit v0.12 From 3fde03cd8c70de19512a8b0bee4dcc16db31f68b Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Mon, 13 May 2013 22:20:24 -0600 Subject: Improve documentation for CPACK_PACKAGE_INSTALL_REGISTRY_KEY. Fixes issue 13787. --- Modules/CPack.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 42d3c0c..b0260ab 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -263,8 +263,8 @@ # ##variable # CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when -# installing this project. This is only used -# by installer for Windows. +# installing this project. This is only used by installer for Windows. +# The default value is based on the installation directory. ##end ##variable # CPACK_CREATE_DESKTOP_LINKS - List of desktop links to create. -- cgit v0.12 From 10bc50eacf2263719161cab19d4e576dcff2589b Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 13 May 2013 12:23:32 +0200 Subject: Tests: ignore Guard Malloc messages in MemChecker tests --- Tests/CTestTestMemcheck/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt index 1c0c3b2..59d6816 100644 --- a/Tests/CTestTestMemcheck/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -33,7 +33,13 @@ target_link_libraries(memcheck_fail CMakeLib) # same filenames. add_subdirectory(NoLogDummyChecker) -set(NORMAL_CTEST_OUTPUT "\n1/1 MemCheck #1: RunCMake \\.+ Passed +[0-9]+.[0-9]+ sec\n\n100% tests passed, 0 tests failed out of 1\n.*\n-- Processing memory checking output: \nMemory checking results:\n") +if (XCODE) + # filter out additional messages by Guard Malloc integrated in Xcode + set(GUARD_MALLOC_MSG "(ctest\([0-9]+\) malloc: [^\n]*\n)*") + set(NORMAL_CTEST_OUTPUT "\n1/1 MemCheck #1: RunCMake \\.+ Passed +[0-9]+\\.[0-9]+ sec\n${GUARD_MALLOC_MSG}\n${GUARD_MALLOC_MSG}100% tests passed, 0 tests failed out of 1\n.*\n-- Processing memory checking output: \n${GUARD_MALLOC_MSG}Memory checking results:\n${GUARD_MALLOC_MSG}") +else () + set(NORMAL_CTEST_OUTPUT "\n1/1 MemCheck #1: RunCMake \\.+ Passed +[0-9]+\\.[0-9]+ sec\n\n100% tests passed, 0 tests failed out of 1\n.*\n-- Processing memory checking output: \nMemory checking results:\n") +endif () set(BULLSEYE_MSG "(BullseyeCoverage[^\n]*\n)?") function(gen_mc_test_internal NAME CHECKER) -- cgit v0.12 From 9969bfb77370f60053867b5afbe7b1076b7104b9 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Wed, 15 May 2013 08:50:22 +0200 Subject: CTest: avoid useless changing of directory At this point we do not care what the current directory is, as nothing that requires a specific directory is done. Just make sure that at the end we are back in the same directory as at the start. --- Source/CTest/cmCTestTestHandler.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index e7491bb..55fa396 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -82,7 +82,6 @@ bool cmCTestSubdirCommand std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); for ( it = args.begin(); it != args.end(); ++ it ) { - cmSystemTools::ChangeDirectory(cwd.c_str()); std::string fname; if(cmSystemTools::FileIsFullPath(it->c_str())) @@ -116,7 +115,6 @@ bool cmCTestSubdirCommand else { // No CTestTestfile? Who cares... - cmSystemTools::ChangeDirectory(cwd.c_str()); continue; } fname += "/"; @@ -133,6 +131,7 @@ bool cmCTestSubdirCommand return false; } } + cmSystemTools::ChangeDirectory(cwd.c_str()); return true; } -- cgit v0.12 From 0ad0c37206fce114c4e4c31f5270b53e181ab3c2 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 15 May 2013 11:17:10 -0400 Subject: CMake 2.8.11 --- ChangeLog.manual | 4 ++++ Source/CMakeVersion.cmake | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog.manual b/ChangeLog.manual index 970d67c..a0da0d5 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,7 @@ +Changes in CMake 2.8.11 (since 2.8.11-rc4) +---------------------------------------- +None + Changes in CMake 2.8.11-rc4 (since 2.8.11-rc3) ---------------------------------------------- Brad King (1): diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 9ca7add..f2792d6 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -3,4 +3,4 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) set(CMake_VERSION_TWEAK 0) -set(CMake_VERSION_RC 4) +#set(CMake_VERSION_RC 0) -- cgit v0.12 From 5c0f2a131f358ac11da52a919f637b57d34cc544 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 15 May 2013 19:17:41 +0200 Subject: Test the use of target transitive compile definitions with moc. --- Tests/QtAutomoc/CMakeLists.txt | 3 +++ Tests/QtAutomoc/defines_test/CMakeLists.txt | 6 +++++ Tests/QtAutomoc/defines_test/defines_test.cpp | 38 +++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 Tests/QtAutomoc/defines_test/CMakeLists.txt create mode 100644 Tests/QtAutomoc/defines_test/defines_test.cpp diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt index 49d433f..a18baef 100644 --- a/Tests/QtAutomoc/CMakeLists.txt +++ b/Tests/QtAutomoc/CMakeLists.txt @@ -5,6 +5,9 @@ project(QtAutomoc) if (QT_TEST_VERSION STREQUAL 4) find_package(Qt4 REQUIRED) + # Include this directory before using the UseQt4 file. + add_subdirectory(defines_test) + include(UseQt4) set(QT_QTCORE_TARGET Qt4::QtCore) diff --git a/Tests/QtAutomoc/defines_test/CMakeLists.txt b/Tests/QtAutomoc/defines_test/CMakeLists.txt new file mode 100644 index 0000000..ad4e684 --- /dev/null +++ b/Tests/QtAutomoc/defines_test/CMakeLists.txt @@ -0,0 +1,6 @@ + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +add_executable(defines_test defines_test.cpp) +set_target_properties(defines_test PROPERTIES AUTOMOC TRUE) +target_link_libraries(defines_test Qt4::QtGui) diff --git a/Tests/QtAutomoc/defines_test/defines_test.cpp b/Tests/QtAutomoc/defines_test/defines_test.cpp new file mode 100644 index 0000000..2836d35 --- /dev/null +++ b/Tests/QtAutomoc/defines_test/defines_test.cpp @@ -0,0 +1,38 @@ + +#include + +#ifdef QT_GUI_LIB +#include + +class SomeDocument : public QTextDocument +{ + Q_OBJECT + +Q_SIGNALS: + void someSig(); +}; +#endif + +#ifdef QT_CORE_LIB +class SomeObject : public QObject +{ + Q_OBJECT + +Q_SIGNALS: + void someSig(); +}; +#endif + +int main(int argc, char **argv) +{ +#ifdef QT_CORE_LIB + QMetaObject sosmo = SomeObject::staticMetaObject; +#endif +#ifdef QT_GUI_LIB + QMetaObject sdsmo = SomeDocument::staticMetaObject; +#endif + + return 0; +} + +#include "defines_test.moc" -- cgit v0.12 From 272431a84ff13eb17cf04389428f57c7fe13e3a2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 16 May 2013 12:44:26 -0400 Subject: Begin post-2.8.11 development --- Source/CMakeVersion.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index f2792d6..f3fdc90 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 0) -#set(CMake_VERSION_RC 0) +set(CMake_VERSION_TWEAK 20130516) +#set(CMake_VERSION_RC 1) -- cgit v0.12 From 79ec7868d0f08c9ff2e6fa6454b205132acecc24 Mon Sep 17 00:00:00 2001 From: John Farrier Date: Mon, 29 Apr 2013 10:48:22 -0400 Subject: VS: Add Windows Forms Support Add support to maintain designer functionality for Visual Studio C++ Windows Forms projects. Also add a test project showing how to use the CMakeLists.txt file and, when successfully configured, will allow use of the designer for the included form. --- Source/cmGeneratorTarget.cxx | 12 ++++ Source/cmGeneratorTarget.h | 4 ++ Source/cmVisualStudio10TargetGenerator.cxx | 66 +++++++++++++++++- Source/cmVisualStudio10TargetGenerator.h | 3 +- Tests/CMakeLists.txt | 5 ++ Tests/VSWindowsFormsResx/CMakeLists.txt | 44 ++++++++++++ Tests/VSWindowsFormsResx/WindowsFormsResx/Header.h | 0 .../VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp | 1 + Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.h | 78 ++++++++++++++++++++++ .../WindowsFormsResx/MyForm.resx | 61 +++++++++++++++++ .../VSWindowsFormsResx/WindowsFormsResx/Source.cpp | 4 ++ 11 files changed, 275 insertions(+), 3 deletions(-) create mode 100644 Tests/VSWindowsFormsResx/CMakeLists.txt create mode 100644 Tests/VSWindowsFormsResx/WindowsFormsResx/Header.h create mode 100644 Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp create mode 100644 Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.h create mode 100644 Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.resx create mode 100644 Tests/VSWindowsFormsResx/WindowsFormsResx/Source.cpp diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 335ba0f..f5d1560 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -98,6 +98,18 @@ void cmGeneratorTarget::ClassifySources() this->IDLSources.push_back(sf); if(isObjLib) { badObjLib.push_back(sf); } } + else if(ext == "resx") + { + // Build and save the name of the corresponding .h file + // This relationship will be used later when building the project files. + // Both names would have been auto generated from Visual Studio + // where the user supplied the file name and Visual Studio + // appended the suffix. + std::string resx = sf->GetFullPath(); + std::string hFileName = resx.substr(0, resx.find_last_of(".")) + ".h"; + this->ExpectedResxHeaders.insert(hFileName); + this->ResxSources.push_back(sf); + } else if(header.find(sf->GetFullPath().c_str())) { this->HeaderSources.push_back(sf); diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index cbcd8a5..5f7019d 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -44,11 +44,15 @@ public: std::vector ObjectSources; std::vector ExternalObjects; std::vector IDLSources; + std::vector ResxSources; + std::string ModuleDefinitionFile; std::map Objects; std::set ExplicitObjectName; + std::set ExpectedResxHeaders; + /** Full path with trailing slash to the top-level directory holding object files for this target. Includes the build time config name placeholder if needed for the generator. */ diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 1cb9f23..933bf95 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -291,6 +291,7 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteCustomCommands(); this->WriteAllSources(); this->WriteDotNetReferences(); + this->WriteWinRTReferences(); this->WriteProjectReferences(); this->WriteString( @@ -455,6 +456,12 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() this->WriteString("true" "\n", 2); } + + if(!this->GeneratorTarget->ResxSources.empty()) + { + this->WriteString("true\n", 2); + } + this->WriteString("\n", 1); } } @@ -647,6 +654,23 @@ void cmVisualStudio10TargetGenerator::WriteGroups() this->WriteGroupSources(ti->first.c_str(), ti->second, sourceGroups); } + std::vector resxObjs = this->GeneratorTarget->ResxSources; + if(!resxObjs.empty()) + { + this->WriteString("\n", 1); + for(std::vector::iterator oi = resxObjs.begin(); + oi != resxObjs.end(); ++oi) + { + std::string obj = (*oi)->GetFullPath(); + this->WriteString("ConvertToWindowsSlash(obj); + (*this->BuildFileStream ) << obj << "\">\n"; + this->WriteString("Resource Files\n", 3); + this->WriteString("\n", 2); + } + this->WriteString("\n", 1); + } + // Add object library contents as external objects. std::vector objs; this->GeneratorTarget->UseObjectLibraries(objs); @@ -701,6 +725,23 @@ void cmVisualStudio10TargetGenerator::WriteGroups() << "\n"; this->WriteString("\n", 2); } + + if(!this->GeneratorTarget->ResxSources.empty()) + { + this->WriteString("\n", 2); + std::string guidName = "SG_Filter_Resource Files"; + this->GlobalGenerator->CreateGUID(guidName.c_str()); + this->WriteString("", 3); + std::string guid = + this->GlobalGenerator->GetGUID(guidName.c_str()); + (*this->BuildFileStream) << "{" << guid << "}" + << "\n"; + this->WriteString("rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;", 3); + (*this->BuildFileStream) << "gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;"; + (*this->BuildFileStream) << "mfcribbon-ms\n"; + this->WriteString("\n", 2); + } + this->WriteString("\n", 1); this->WriteString("\n", 0); // restore stream pointer @@ -832,8 +873,20 @@ void cmVisualStudio10TargetGenerator::WriteSource( } this->ConvertToWindowsSlash(sourceFile); this->WriteString("<", 2); - (*this->BuildFileStream ) << tool << - " Include=\"" << sourceFile << "\"" << (end? end : " />\n"); + (*this->BuildFileStream ) << tool << " Include=\"" << sourceFile << "\""; + + if(sf->GetExtension() == "h" && + this->IsResxHeader(sf->GetFullPath())) + { + (*this->BuildFileStream ) << ">\n"; + this->WriteString("CppForm\n", 3); + this->WriteString("\n", 2); + } + else + { + (*this->BuildFileStream ) << (end? end : " />\n"); + } + ToolSource toolSource = {sf, forceRelative}; this->Tools[tool].push_back(toolSource); } @@ -1718,3 +1771,12 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences() } this->WriteString("\n", 1); } + +bool cmVisualStudio10TargetGenerator:: + IsResxHeader(const std::string& headerFile) +{ + std::set::iterator it = + this->GeneratorTarget->ExpectedResxHeaders.find(headerFile); + + return it != this->GeneratorTarget->ExpectedResxHeaders.end(); +} diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 55a850a..73d5961 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -62,6 +62,7 @@ private: void WriteWinRTReferences(); void WritePathAndIncrementalLinkOptions(); void WriteItemDefinitionGroups(); + bool ComputeClOptions(); bool ComputeClOptions(std::string const& configName); void WriteClOptions(std::string const& config, @@ -91,7 +92,7 @@ private: std::vector& ); void AddMissingSourceGroups(std::set& groupsUsed, const std::vector& allGroups); - + bool IsResxHeader(const std::string& headerFile); private: typedef cmVisualStudioGeneratorOptions Options; diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index e07bb69..21c9490 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1448,6 +1448,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ADD_TEST_MACRO(SBCS SBCS) endif() + if(NOT "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [6789]( |$)" + AND NOT CMAKE_TEST_GENERATOR_TOOLSET) + ADD_TEST_MACRO(VSWindowsFormsResx VSWindowsFormsResx) + endif() + add_test(VSExternalInclude ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VSExternalInclude" diff --git a/Tests/VSWindowsFormsResx/CMakeLists.txt b/Tests/VSWindowsFormsResx/CMakeLists.txt new file mode 100644 index 0000000..a313ac2 --- /dev/null +++ b/Tests/VSWindowsFormsResx/CMakeLists.txt @@ -0,0 +1,44 @@ +# +# Example CMakeLists.txt file to demonstrate how to make a designable Windows Forms project with CMake. +# +# Code modifications and example by John Farrier, john.farrier@helleboreconsulting.com +# + +cmake_minimum_required(VERSION 2.8.10) + +# Project Name +project(VSWindowsFormsResx CXX) + +include(CheckFunctionExists) +include(CheckCXXSourceCompiles) +include(CheckIncludeFile) + +# Note: The designable form is assumed to have a .h extension as is default in Visual Studio. +# Node: The designable form is assumed to have a .resx file with the same name and path (save extension) as is default in Visual Studio + +set(TARGET_H + WindowsFormsResx/MyForm.h + WindowsFormsResx/Header.h + ) + +set(TARGET_SRC + WindowsFormsResx/MyForm.cpp + WindowsFormsResx/Source.cpp + ) + +set(TARGET_RESX + WindowsFormsResx/MyForm.resx + ) + +set(TARGET_LIBRARIES ${SYSLIBS}) +add_executable(${PROJECT_NAME} ${TARGET_SRC} ${TARGET_H} ${TARGET_RESX}) + +# Note: The property VS_GLOBAL_KEYWORD must be set. +set_property(TARGET ${PROJECT_NAME} PROPERTY VS_GLOBAL_KEYWORD "ManagedCProj") + +# Note: The property VS_DOTNET_REFERENCES must be set. +set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DOTNET_REFERENCES "System" "System.Data" "System.Drawing" "System.Windows.Forms" "System.Xml") + +# Note: Modification of compiler flags is required for CLR compatibility now that we are using .resx files. +string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +string(REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") diff --git a/Tests/VSWindowsFormsResx/WindowsFormsResx/Header.h b/Tests/VSWindowsFormsResx/WindowsFormsResx/Header.h new file mode 100644 index 0000000..e69de29 diff --git a/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp b/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp new file mode 100644 index 0000000..154e268 --- /dev/null +++ b/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp @@ -0,0 +1 @@ +#include "MyForm.h" \ No newline at end of file diff --git a/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.h b/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.h new file mode 100644 index 0000000..16222c5 --- /dev/null +++ b/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.h @@ -0,0 +1,78 @@ +#pragma once + +namespace Farrier { + + using namespace System; + using namespace System::ComponentModel; + using namespace System::Collections; + using namespace System::Windows::Forms; + using namespace System::Data; + using namespace System::Drawing; + + /// + /// Summary for MyForm + /// + public ref class MyForm : public System::Windows::Forms::Form + { + public: + MyForm(void) + { + InitializeComponent(); + // + //TODO: Add the constructor code here + // + } + + protected: + /// + /// Clean up any resources being used. + /// + ~MyForm() + { + if (components) + { + delete components; + } + } + private: System::Windows::Forms::Button^ button1; + protected: + + private: + /// + /// Required designer variable. + /// + System::ComponentModel::Container ^components; + +#pragma region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + void InitializeComponent(void) + { + this->button1 = (gcnew System::Windows::Forms::Button()); + this->SuspendLayout(); + // + // button1 + // + this->button1->Location = System::Drawing::Point(13, 13); + this->button1->Name = L"button1"; + this->button1->Size = System::Drawing::Size(75, 23); + this->button1->TabIndex = 0; + this->button1->Text = L"button1"; + this->button1->UseVisualStyleBackColor = true; + // + // MyForm + // + this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); + this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; + this->ClientSize = System::Drawing::Size(284, 261); + this->Controls->Add(this->button1); + this->Name = L"MyForm"; + this->Text = L"MyForm"; + this->ResumeLayout(false); + + } +#pragma endregion + }; +} diff --git a/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.resx b/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.resx new file mode 100644 index 0000000..e8ae276 --- /dev/null +++ b/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.resx @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tests/VSWindowsFormsResx/WindowsFormsResx/Source.cpp b/Tests/VSWindowsFormsResx/WindowsFormsResx/Source.cpp new file mode 100644 index 0000000..aee9e2e --- /dev/null +++ b/Tests/VSWindowsFormsResx/WindowsFormsResx/Source.cpp @@ -0,0 +1,4 @@ +int main(int argc, char **argv) +{ + return 0; +} -- cgit v0.12 From 05bf9721e48f8fbf3b3b5338ec779ee5e344a6d0 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 2 May 2013 09:02:01 +0200 Subject: Fix handling of commas in arbitrary content in genexes. As the comma is the parameter separator, it needs to be re-added when evaluating to reconstruct arbitrary content. --- Source/cmGeneratorExpressionEvaluator.cxx | 9 ++++----- Tests/GeneratorExpression/CMakeLists.txt | 10 ++++++++++ Tests/GeneratorExpression/check-part2.cmake | 10 ++++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 6618e83..5d06199 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1051,11 +1051,6 @@ std::string GeneratorExpressionContent::Evaluate( pend = this->ParamChildren.end(); for ( ; pit != pend; ++pit) { - if (!result.empty()) - { - result += ","; - } - std::vector::const_iterator it = pit->begin(); const std::vector::const_iterator end @@ -1077,6 +1072,10 @@ std::string GeneratorExpressionContent::Evaluate( return std::string(); } } + if ((pit + 1) != pend) + { + result += ","; + } } if (node->RequiresLiteralInput()) { diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index 0008c16..9cd8a7f 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -120,6 +120,16 @@ add_custom_target(check-part2 ALL -Dtest_target_includes6=$ -Dtest_target_includes7=$ -Dtest_target_includes8=$ + -Dtest_arbitrary_content_comma_1=$<1:a,> + -Dtest_arbitrary_content_comma_2=$<1:,a> + -Dtest_arbitrary_content_comma_3=$<1:a,,> + -Dtest_arbitrary_content_comma_4=$<1:,> + -Dtest_arbitrary_content_comma_5=$<1:,,> + -Dtest_arbitrary_content_comma_6=$<1:,,,> + -Dtest_arbitrary_content_comma_7=$<1:,,a> + -Dtest_arbitrary_content_comma_8=$<1:a,,b> + -Dtest_arbitrary_content_comma_9=$<1:a,,b,,> + -Dtest_arbitrary_content_comma_10=$<1:,,a,,b,,> -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part2.cmake COMMAND ${CMAKE_COMMAND} -E echo "check done (part 2 of 2)" VERBATIM diff --git a/Tests/GeneratorExpression/check-part2.cmake b/Tests/GeneratorExpression/check-part2.cmake index 3f7187c..a1db5f6 100644 --- a/Tests/GeneratorExpression/check-part2.cmake +++ b/Tests/GeneratorExpression/check-part2.cmake @@ -34,3 +34,13 @@ check(test_target_includes5 "/empty2/public;/empty3/public;/empty2/public;/empty check(test_target_includes6 "/empty3/public;/empty3/private;/empty2/public;/empty3/public;/empty4/public") check(test_target_includes7 "/empty1/public;/empty2/public;/empty3/public;/empty4/public") check(test_target_includes8 "/empty5/private1;/empty5/private2") +check(test_arbitrary_content_comma_1 "a,") +check(test_arbitrary_content_comma_2 ",a") +check(test_arbitrary_content_comma_3 "a,,") +check(test_arbitrary_content_comma_4 ",") +check(test_arbitrary_content_comma_5 ",,") +check(test_arbitrary_content_comma_6 ",,,") +check(test_arbitrary_content_comma_7 ",,a") +check(test_arbitrary_content_comma_8 "a,,b") +check(test_arbitrary_content_comma_9 "a,,b,,") +check(test_arbitrary_content_comma_10 ",,a,,b,,") -- cgit v0.12 From c70b9b51d9c711d761bc45c0918bc8bc75b23d19 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 2 May 2013 16:46:57 +0200 Subject: Fix style. --- Source/cmCacheManager.h | 2 +- Source/cmTarget.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 4a5ee45..a5e5eee 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -82,7 +82,7 @@ public: { this->Find(key); } - } + } private: CacheEntry const& GetEntry() const { return this->Position->second; } CacheEntry& GetEntry() { return this->Position->second; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index d14bfca..f6dd1c2 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -180,7 +180,7 @@ void deleteAndClear( //---------------------------------------------------------------------------- cmTargetInternals::~cmTargetInternals() { - deleteAndClear(CachedLinkInterfaceIncludeDirectoriesEntries); + deleteAndClear(this->CachedLinkInterfaceIncludeDirectoriesEntries); } //---------------------------------------------------------------------------- -- cgit v0.12 From 0a4d7d883c1d468e752e8a224a2cfb4a28f3ecf9 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 24 Apr 2013 13:48:07 +0200 Subject: Remove unused marker for a variable which is now used. --- Source/cmTarget.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index d14bfca..aa4dfdd 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -5289,7 +5289,6 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config, ImportInfo& info, cmTarget *headTarget) { - (void)headTarget; // This method finds information about an imported target from its // properties. The "IMPORTED_" namespace is reserved for properties // defined by the project exporting the target. -- cgit v0.12 From dc742fe4be83669a96aec4a47e70218c7ca70814 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 25 Apr 2013 13:54:18 +0200 Subject: Extract the ProcessArbitraryContent method. --- Source/cmGeneratorExpressionEvaluator.cxx | 95 ++++++++++++++++++------------- Source/cmGeneratorExpressionEvaluator.h | 8 +++ 2 files changed, 62 insertions(+), 41 deletions(-) diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 5d06199..3aceb71 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -993,6 +993,57 @@ std::string GeneratorExpressionContent::GetOriginalExpression() const } //---------------------------------------------------------------------------- +std::string GeneratorExpressionContent::ProcessArbitraryContent( + const cmGeneratorExpressionNode *node, + const std::string &identifier, + cmGeneratorExpressionContext *context, + cmGeneratorExpressionDAGChecker *dagChecker, + std::vector >::const_iterator + pit) const +{ + std::string result; + + const + std::vector >::const_iterator + pend = this->ParamChildren.end(); + for ( ; pit != pend; ++pit) + { + std::vector::const_iterator it + = pit->begin(); + const std::vector::const_iterator end + = pit->end(); + for ( ; it != end; ++it) + { + if (node->RequiresLiteralInput()) + { + if ((*it)->GetType() != cmGeneratorExpressionEvaluator::Text) + { + reportError(context, this->GetOriginalExpression(), + "$<" + identifier + "> expression requires literal input."); + return std::string(); + } + } + result += (*it)->Evaluate(context, dagChecker); + if (context->HadError) + { + return std::string(); + } + } + if ((pit + 1) != pend) + { + result += ","; + } + } + if (node->RequiresLiteralInput()) + { + std::vector parameters; + parameters.push_back(result); + return node->Evaluate(parameters, context, this, dagChecker); + } + return result; +} + +//---------------------------------------------------------------------------- std::string GeneratorExpressionContent::Evaluate( cmGeneratorExpressionContext *context, cmGeneratorExpressionDAGChecker *dagChecker) const @@ -1043,47 +1094,9 @@ std::string GeneratorExpressionContent::Evaluate( if (node->AcceptsSingleArbitraryContentParameter()) { - std::string result; - std::vector >::const_iterator - pit = this->ParamChildren.begin(); - const - std::vector >::const_iterator - pend = this->ParamChildren.end(); - for ( ; pit != pend; ++pit) - { - std::vector::const_iterator it - = pit->begin(); - const std::vector::const_iterator end - = pit->end(); - for ( ; it != end; ++it) - { - if (node->RequiresLiteralInput()) - { - if ((*it)->GetType() != cmGeneratorExpressionEvaluator::Text) - { - reportError(context, this->GetOriginalExpression(), - "$<" + identifier + "> expression requires literal input."); - return std::string(); - } - } - result += (*it)->Evaluate(context, dagChecker); - if (context->HadError) - { - return std::string(); - } - } - if ((pit + 1) != pend) - { - result += ","; - } - } - if (node->RequiresLiteralInput()) - { - std::vector parameters; - parameters.push_back(result); - return node->Evaluate(parameters, context, this, dagChecker); - } - return result; + return this->ProcessArbitraryContent(node, identifier, context, + dagChecker, + this->ParamChildren.begin()); } std::vector parameters; diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h index ce7ad69..218abf1 100644 --- a/Source/cmGeneratorExpressionEvaluator.h +++ b/Source/cmGeneratorExpressionEvaluator.h @@ -129,6 +129,14 @@ private: cmGeneratorExpressionDAGChecker *dagChecker, std::vector ¶meters) const; + std::string ProcessArbitraryContent( + const cmGeneratorExpressionNode *node, + const std::string &identifier, + cmGeneratorExpressionContext *context, + cmGeneratorExpressionDAGChecker *dagChecker, + std::vector >::const_iterator + pit) const; + private: std::vector IdentifierChildren; std::vector > ParamChildren; -- cgit v0.12 From bd638ee20f54e9fd7fb701fcf20ded1956c06bb0 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 25 Apr 2013 13:28:57 +0200 Subject: Rename the method determining if a genex accepts arbitrary content. The meaning of this will be expanded to generator expressions with more than a single parameter. --- Source/cmGeneratorExpressionEvaluator.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 3aceb71..60e1b05 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -51,7 +51,7 @@ struct cmGeneratorExpressionNode virtual bool RequiresLiteralInput() const { return false; } - virtual bool AcceptsSingleArbitraryContentParameter() const + virtual bool AcceptsArbitraryContentParameter() const { return false; } virtual int NumExpectedParameters() const { return 1; } @@ -70,7 +70,7 @@ static const struct ZeroNode : public cmGeneratorExpressionNode virtual bool GeneratesContent() const { return false; } - virtual bool AcceptsSingleArbitraryContentParameter() const { return true; } + virtual bool AcceptsArbitraryContentParameter() const { return true; } std::string Evaluate(const std::vector &, cmGeneratorExpressionContext *, @@ -87,7 +87,7 @@ static const struct OneNode : public cmGeneratorExpressionNode { OneNode() {} - virtual bool AcceptsSingleArbitraryContentParameter() const { return true; } + virtual bool AcceptsArbitraryContentParameter() const { return true; } std::string Evaluate(const std::vector &, cmGeneratorExpressionContext *, @@ -600,7 +600,7 @@ static const struct TargetNameNode : public cmGeneratorExpressionNode virtual bool GeneratesContent() const { return true; } - virtual bool AcceptsSingleArbitraryContentParameter() const { return true; } + virtual bool AcceptsArbitraryContentParameter() const { return true; } virtual bool RequiresLiteralInput() const { return true; } std::string Evaluate(const std::vector ¶meters, @@ -1075,7 +1075,8 @@ std::string GeneratorExpressionContent::Evaluate( if (!node->GeneratesContent()) { - if (node->AcceptsSingleArbitraryContentParameter()) + if (node->NumExpectedParameters() == 1 + && node->AcceptsArbitraryContentParameter()) { if (this->ParamChildren.empty()) { @@ -1092,7 +1093,8 @@ std::string GeneratorExpressionContent::Evaluate( return std::string(); } - if (node->AcceptsSingleArbitraryContentParameter()) + if (node->NumExpectedParameters() == 1 + && node->AcceptsArbitraryContentParameter()) { return this->ProcessArbitraryContent(node, identifier, context, dagChecker, -- cgit v0.12 From 96ec3147bbafd52b18bcf532b0da8727cd3c8104 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 25 Apr 2013 13:54:57 +0200 Subject: Make it possible for any genex to have arbitrary content at the end. --- Source/cmGeneratorExpressionEvaluator.cxx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 60e1b05..efb8117 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1119,12 +1119,15 @@ std::string GeneratorExpressionContent::EvaluateParameters( cmGeneratorExpressionDAGChecker *dagChecker, std::vector ¶meters) const { + const int numExpected = node->NumExpectedParameters(); { std::vector >::const_iterator pit = this->ParamChildren.begin(); const std::vector >::const_iterator pend = this->ParamChildren.end(); + const bool acceptsArbitraryContent + = node->AcceptsArbitraryContentParameter(); for ( ; pit != pend; ++pit) { std::string parameter; @@ -1141,10 +1144,20 @@ std::string GeneratorExpressionContent::EvaluateParameters( } } parameters.push_back(parameter); + if (acceptsArbitraryContent + && parameters.size() == (unsigned int)numExpected - 1) + { + assert(pit != pend); + std::string lastParam = this->ProcessArbitraryContent(node, identifier, + context, + dagChecker, + pit + 1); + parameters.push_back(lastParam); + return std::string(); + } } } - int numExpected = node->NumExpectedParameters(); if ((numExpected != -1 && (unsigned int)numExpected != parameters.size())) { if (numExpected == 0) -- cgit v0.12 From a7ba4520c7b15dc9f56d2c4718748b79b12c0c89 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 26 Feb 2013 00:50:49 +0100 Subject: Add the JOIN generator expression. This generator expression joins a list with a separator. The separator may contain arbitrary content, such as commas, which is ordinarily a delimiter in the generator expression syntax. --- Source/cmDocumentGeneratorExpressions.h | 2 ++ Source/cmGeneratorExpressionEvaluator.cxx | 30 ++++++++++++++++++++++ Tests/CompileDefinitions/compiletest.cpp | 20 ++++++++++++--- .../CompileDefinitions/target_prop/CMakeLists.txt | 6 +++++ .../TargetIncludeDirectories/CMakeLists.txt | 5 ++++ .../TargetIncludeDirectories/main.cpp | 1 + 6 files changed, 61 insertions(+), 3 deletions(-) diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h index 6cc3f25..ac52db0 100644 --- a/Source/cmDocumentGeneratorExpressions.h +++ b/Source/cmDocumentGeneratorExpressions.h @@ -28,6 +28,8 @@ "strings which contain a ',' for example.\n" \ " $ = A literal ';'. Used to prevent " \ "list expansion on an argument with ';'.\n" \ + " $ = joins the list with the content of " \ + "\"...\"\n" \ " $ = Marks ... as being the name of a " \ "target. This is required if exporting targets to multiple " \ "dependent export sets. The '...' must be a literal name of a " \ diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index efb8117..6092aa2 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -307,6 +307,34 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode } configurationTestNode; +static const struct JoinNode : public cmGeneratorExpressionNode +{ + JoinNode() {} + + virtual int NumExpectedParameters() const { return 2; } + + virtual bool AcceptsArbitraryContentParameter() const { return true; } + + std::string Evaluate(const std::vector ¶meters, + cmGeneratorExpressionContext *, + const GeneratorExpressionContent *, + cmGeneratorExpressionDAGChecker *) const + { + std::string result; + + std::vector list; + cmSystemTools::ExpandListArgument(parameters.front(), list); + std::string sep; + for(std::vector::const_iterator li = list.begin(); + li != list.end(); ++li) + { + result += sep + *li; + sep = parameters[1]; + } + return result; + } +} joinNode; + //---------------------------------------------------------------------------- static const char* targetPropertyTransitiveWhitelist[] = { "INTERFACE_INCLUDE_DIRECTORIES" @@ -973,6 +1001,8 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier) return &installInterfaceNode; else if (identifier == "INSTALL_PREFIX") return &installPrefixNode; + else if (identifier == "JOIN") + return &joinNode; return 0; } diff --git a/Tests/CompileDefinitions/compiletest.cpp b/Tests/CompileDefinitions/compiletest.cpp index 14b8eab..7379380 100644 --- a/Tests/CompileDefinitions/compiletest.cpp +++ b/Tests/CompileDefinitions/compiletest.cpp @@ -20,10 +20,16 @@ static const char very_fun_string[] = CMAKE_IS_REALLY; #endif enum { - StringLiteralTest1 = sizeof(CMakeStaticAssert) + StringLiteralTest1 = sizeof(CMakeStaticAssert), #ifndef NO_SPACES_IN_DEFINE_VALUES - , - StringLiteralTest2 = sizeof(CMakeStaticAssert) + StringLiteralTest2 = sizeof(CMakeStaticAssert), +#endif +#ifdef TEST_GENERATOR_EXPRESSIONS + StringLiteralTest3 = sizeof(CMakeStaticAssert), + StringLiteralTest4 = sizeof(CMakeStaticAssert), + StringLiteralTest5 = sizeof(CMakeStaticAssert), + StringLiteralTest6 = sizeof(CMakeStaticAssert), + StringLiteralTest7 = sizeof(CMakeStaticAssert) #endif }; @@ -42,6 +48,14 @@ enum { #error Expected define expanded from list #endif +#ifndef PREFIX_DEF1 +#error Expect PREFIX_DEF1 +#endif + +#ifndef PREFIX_DEF2 +#error Expect PREFIX_DEF2 +#endif + // TEST_GENERATOR_EXPRESSIONS #endif diff --git a/Tests/CompileDefinitions/target_prop/CMakeLists.txt b/Tests/CompileDefinitions/target_prop/CMakeLists.txt index 1ef2d6d..34be917 100644 --- a/Tests/CompileDefinitions/target_prop/CMakeLists.txt +++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt @@ -13,6 +13,12 @@ set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS "$<1:CMAKE_IS_DECLARATIVE>" "$<0:GE_NOT_DEFINED>" "$<1:ARGUMENT;LIST>" + PREFIX_$ + LETTER_LIST1=\"$\" + LETTER_LIST2=\"$\" + LETTER_LIST3=\"$\" + LETTER_LIST4=\"$\" + LETTER_LIST5=\"$\" ) set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt index ad6671f..60d4c6a 100644 --- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt @@ -123,3 +123,8 @@ target_link_libraries(lib5 libbad libgood) target_include_directories(lib5 BEFORE PRIVATE $ ) + +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/prefix_foo/prefix_bar/prefix_bat") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/prefix_foo/prefix_bar/prefix_bat/prefix_foo_bar_bat.h" "// prefix_foo_bar_bat.h\n") + +target_include_directories(TargetIncludeDirectories PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/prefix_$") diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp index 90909d3..5bb34aa 100644 --- a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp @@ -10,6 +10,7 @@ #include "arguments.h" #include "list.h" #include "target.h" +#include "prefix_foo_bar_bat.h" int main(int, char**) { -- cgit v0.12 From 88308bc2f2d906dc1ffd6b18e6a29137232d6e59 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 6 May 2013 18:39:48 +0200 Subject: Test that linking using the debug keyword to tll works. --- Tests/CMakeCommands/target_link_libraries/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt index 3881644..b003a1b 100644 --- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt +++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt @@ -114,3 +114,11 @@ endif() # shortcutting of the evaluation by returning an empty string. set(_exe_test $,EXECUTABLE>) target_link_libraries(targetC $<$:depG>) + +add_library(libConsumer empty.cpp) +# This line causes $<$:depA> to be used when +# determining the include directories for libConsumer based on the +# interface properties of its LINK_LIBRARIES. Because the above expression +# evaluates to the empty string in non-Debug cases, ensure that that causes +# no problems. +target_link_libraries(libConsumer debug depA) -- cgit v0.12 From 33ed186fce561d274ffee1acd20c2ceb45931de4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 15 May 2013 19:09:33 +0200 Subject: automoc: Read target defines unconditionally Commit 429e3699 (Process COMPILE_DEFINITIONS as generator expressions in QtAutomoc., 2013-01-25) introduced a check for the existence of the COMPILE_DEFINITIONS property on the target before processing it. At the time, compile definitions from linked targets were added to the COMPILE_DEFINITIONS property by target_link_libraries. The way such transitive compile definitions worked was changed in subsequent commit a1c4905f (Use the link information as a source of compile definitions and includes., 2013-02-12), so that the COMPILE_DEFINITIONS property may be empty, despite the fact that there are definitions which should be used. --- Source/cmQtAutomoc.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index a1fa31f..ff6f08c 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -280,13 +280,9 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) _moc_incs += *incDirIt; } - const char* tmp = target->GetProperty("COMPILE_DEFINITIONS"); - std::string _moc_compile_defs; - if (tmp) - { - _moc_compile_defs = target->GetCompileDefinitions(0); - } - tmp = makefile->GetProperty("COMPILE_DEFINITIONS"); + std::string _moc_compile_defs = target->GetCompileDefinitions(0); + + const char* tmp = makefile->GetProperty("COMPILE_DEFINITIONS"); if (tmp) { _moc_compile_defs += ";"; -- cgit v0.12 From edeabd18e6db5a52b2191ea9d3b09ee8bd090af6 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Fri, 17 May 2013 00:01:04 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index f3fdc90..038c612 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130516) +set(CMake_VERSION_TWEAK 20130517) #set(CMake_VERSION_RC 1) -- cgit v0.12 From 44258cc26c5626f084abed8d7e0e8cb97e4c77c8 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 17 May 2013 09:01:01 +0200 Subject: Remove unused typedef. --- Source/cmGeneratorExpressionEvaluator.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 6618e83..b969ca4 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1183,7 +1183,6 @@ GeneratorExpressionContent::~GeneratorExpressionContent() deleteAll(this->IdentifierChildren); typedef std::vector EvaluatorVector; - typedef std::vector TokenVector; std::vector::const_iterator pit = this->ParamChildren.begin(); const std::vector::const_iterator pend = -- cgit v0.12 From ffda082e652e1fd8a40dbc3c4d7ba11f18c06aac Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 17 May 2013 08:42:07 -0400 Subject: Sanitize linker name to parse implicit link line (#14154) Teach CMakeParseImplicitLinkInfo to convert the CMAKE_LINKER file name to a regular expression that matches only the original name. Escape special characters like '+' so they are not treated as regex syntax. Extend the ImplicitLinkInfoTest to test handling of a CMAKE_LINKER value with many special characters. --- Modules/CMakeParseImplicitLinkInfo.cmake | 1 + Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in | 1 + 2 files changed, 2 insertions(+) diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake index fa03630..4724a8c 100644 --- a/Modules/CMakeParseImplicitLinkInfo.cmake +++ b/Modules/CMakeParseImplicitLinkInfo.cmake @@ -26,6 +26,7 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj set(linker "CMAKE_LINKER-NOTFOUND") if(CMAKE_LINKER) get_filename_component(linker ${CMAKE_LINKER} NAME) + string(REGEX REPLACE "([][+.*?()^$])" "\\\\\\1" linker "${linker}") endif() # Construct a regex to match linker lines. It must match both the # whole line and just the command (argv[0]). diff --git a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in index e28d102..055b183 100644 --- a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in +++ b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in @@ -508,6 +508,7 @@ list(APPEND platforms msys_g77) #----------------------------------------------------------------------------- # Test parsing for all above examples. +set(CMAKE_LINKER "not-a-linker[]().*+^$?") foreach(p IN LISTS platforms) cmake_parse_implicit_link_info("${${p}_text}" libs dirs fwks log "${${p}_obj_regex}") -- cgit v0.12 From cd82e3f8f5f0c2d8a48b38e474bb19fb3b95e4f0 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sat, 18 May 2013 00:01:04 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 038c612..50ab06d 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130517) +set(CMake_VERSION_TWEAK 20130518) #set(CMake_VERSION_RC 1) -- cgit v0.12 From 3c7c33292966a5bb35c6ff5a16aa10ccf643838a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 18 May 2013 09:54:50 +0200 Subject: Fix brace indentation. --- Source/cmLocalGenerator.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index ee5b9d8..fc3ad4e 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2011,13 +2011,13 @@ void cmLocalGenerator::AddCMP0018Flags(std::string &flags, cmTarget* target, else { if (target->GetType() == cmTarget::OBJECT_LIBRARY) - { + { if (target->GetPropertyAsBool("POSITION_INDEPENDENT_CODE")) { this->AddPositionIndependentFlags(flags, lang, targetType); } return; - } + } if (target->GetLinkInterfaceDependentBoolProperty( "POSITION_INDEPENDENT_CODE", -- cgit v0.12 From b5d6f5dd5b894ea6dcd8f87e1925db5551f3ffc0 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 17 May 2013 10:12:02 +0200 Subject: Add EXPORT_NAME property. This allows for example, the buildsystem to use names like 'boost_any' instead of the overly generic 'any', and still be able to generate IMPORTED targets called 'boost::any'. --- Source/cmExportBuildFileGenerator.cxx | 4 +- Source/cmExportFileGenerator.cxx | 12 +++--- Source/cmExportInstallFileGenerator.cxx | 7 ++-- Source/cmTarget.cxx | 43 ++++++++++++++++++++++ Source/cmTarget.h | 1 + Tests/ExportImport/Export/CMakeLists.txt | 11 +++--- Tests/ExportImport/Export/renamed/CMakeLists.txt | 20 ++++++++++ Tests/ExportImport/Export/renamed/renamed.cxx | 7 ++++ Tests/ExportImport/Export/renamed/renamed.h | 12 ++++++ Tests/ExportImport/Export/testSharedLibDepends.cpp | 3 +- Tests/ExportImport/Export/testSharedLibDepends.h | 1 + Tests/ExportImport/Import/A/CMakeLists.txt | 6 +++ Tests/ExportImport/Import/A/deps_shared_iface.cpp | 4 +- Tests/ExportImport/Import/A/renamed_test.cpp | 8 ++++ 14 files changed, 122 insertions(+), 17 deletions(-) create mode 100644 Tests/ExportImport/Export/renamed/CMakeLists.txt create mode 100644 Tests/ExportImport/Export/renamed/renamed.cxx create mode 100644 Tests/ExportImport/Export/renamed/renamed.h create mode 100644 Tests/ExportImport/Import/A/renamed_test.cpp diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 7147f86..e1c26c6 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -30,7 +30,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) tei = this->Exports->begin(); tei != this->Exports->end(); ++tei) { - expectedTargets += sep + this->Namespace + (*tei)->GetName(); + expectedTargets += sep + this->Namespace + (*tei)->GetExportName(); sep = " "; cmTarget* te = *tei; if(this->ExportedTargets.insert(te).second) @@ -189,7 +189,7 @@ cmExportBuildFileGenerator::HandleMissingTarget( // Assume the target will be exported by another command. // Append it with the export namespace. link_libs += this->Namespace; - link_libs += dependee->GetName(); + link_libs += dependee->GetExportName(); } //---------------------------------------------------------------------------- diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 27ec56b..a6ccbd5 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -376,7 +376,7 @@ void cmExportFileGenerator::GenerateInterfaceProperties(cmTarget *target, if (!properties.empty()) { std::string targetName = this->Namespace; - targetName += target->GetName(); + targetName += target->GetExportName(); os << "set_target_properties(" << targetName << " PROPERTIES\n"; for(ImportPropertyMap::const_iterator pi = properties.begin(); pi != properties.end(); ++pi) @@ -407,7 +407,7 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input, } if(this->ExportedTargets.find(tgt) != this->ExportedTargets.end()) { - input = this->Namespace + input; + input = this->Namespace + tgt->GetExportName(); } else { @@ -772,7 +772,8 @@ cmExportFileGenerator { // Construct the imported target name. std::string targetName = this->Namespace; - targetName += target->GetName(); + + targetName += target->GetExportName(); // Create the imported target. os << "# Create imported target " << targetName << "\n"; @@ -835,7 +836,8 @@ cmExportFileGenerator { // Construct the imported target name. std::string targetName = this->Namespace; - targetName += target->GetName(); + + targetName += target->GetExportName(); // Set the import properties. os << "# Import target \"" << targetName << "\" for configuration \"" @@ -954,7 +956,7 @@ cmExportFileGenerator { // Construct the imported target name. std::string targetName = this->Namespace; - targetName += target->GetName(); + targetName += target->GetExportName(); os << "list(APPEND _IMPORT_CHECK_TARGETS " << targetName << " )\n" "list(APPEND _IMPORT_CHECK_FILES_FOR_" << targetName << " "; diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index ad12b5a..55081a7 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -47,7 +47,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) tei = this->IEGen->GetExportSet()->GetTargetExports()->begin(); tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei) { - expectedTargets += sep + this->Namespace + (*tei)->Target->GetName(); + expectedTargets += sep + this->Namespace + (*tei)->Target->GetExportName(); sep = " "; cmTargetExport const* te = *tei; if(this->ExportedTargets.insert(te->Target).second) @@ -395,13 +395,14 @@ cmExportInstallFileGenerator::HandleMissingTarget( std::string& link_libs, std::vector& missingTargets, cmMakefile* mf, cmTarget* depender, cmTarget* dependee) { - std::string name = dependee->GetName(); + const std::string name = dependee->GetName(); std::vector namespaces = this->FindNamespaces(mf, name); int targetOccurrences = (int)namespaces.size(); if (targetOccurrences == 1) { std::string missingTarget = namespaces[0]; - missingTarget += name; + + missingTarget += dependee->GetExportName(); link_libs += missingTarget; missingTargets.push_back(missingTarget); } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ed8edcc..3f6488a 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -867,6 +867,13 @@ void cmTarget::DefineProperties(cmake *cm) "OSX_ARCHITECTURES."); cm->DefineProperty + ("EXPORT_NAME", cmProperty::TARGET, + "Exported name for target files.", + "This sets the name for the IMPORTED target generated when it this " + "target is is exported. " + "If not set, the logical target name is used by default."); + + cm->DefineProperty ("OUTPUT_NAME", cmProperty::TARGET, "Output name for target files.", "This sets the base name for output files created for an executable or " @@ -2719,6 +2726,14 @@ void cmTarget::SetProperty(const char* prop, const char* value) new cmTargetInternals::IncludeDirectoriesEntry(cge)); return; } + if(strcmp(prop,"EXPORT_NAME") == 0 && this->IsImported()) + { + cmOStringStream e; + e << "EXPORT_NAME property can't be set on imported targets (\"" + << this->Name << "\")\n"; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); + return; + } if (strcmp(prop, "LINK_LIBRARIES") == 0) { this->Internal->LinkInterfaceIncludeDirectoriesEntries.clear(); @@ -2753,6 +2768,14 @@ void cmTarget::AppendProperty(const char* prop, const char* value, new cmTargetInternals::IncludeDirectoriesEntry(ge.Parse(value))); return; } + if(strcmp(prop,"EXPORT_NAME") == 0 && this->IsImported()) + { + cmOStringStream e; + e << "EXPORT_NAME property can't be set on imported targets (\"" + << this->Name << "\")\n"; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); + return; + } if (strcmp(prop, "LINK_LIBRARIES") == 0) { if (cmGeneratorExpression::IsValidTargetName(value) @@ -2770,6 +2793,26 @@ void cmTarget::AppendProperty(const char* prop, const char* value, } //---------------------------------------------------------------------------- +const char* cmTarget::GetExportName() +{ + const char *exportName = this->GetProperty("EXPORT_NAME"); + + if (exportName && *exportName) + { + if (!cmGeneratorExpression::IsValidTargetName(exportName)) + { + cmOStringStream e; + e << "EXPORT_NAME property \"" << exportName << "\" for \"" + << this->GetName() << "\": is not valid."; + cmSystemTools::Error(e.str().c_str()); + return ""; + } + return exportName; + } + return this->GetName(); +} + +//---------------------------------------------------------------------------- void cmTarget::AppendBuildInterfaceIncludes() { if(this->GetType() != cmTarget::SHARED_LIBRARY && diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 9d46796..42a31db 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -85,6 +85,7 @@ public: ///! Set/Get the name of the target const char* GetName() const {return this->Name.c_str();} + const char* GetExportName(); ///! Set the cmMakefile that owns this target void SetMakefile(cmMakefile *mf); diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index be48483..e3f23b8 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -165,6 +165,8 @@ set_property(TARGET testLibRequired APPEND PROPERTY include(GenerateExportHeader) +add_subdirectory(renamed) + add_library(testSharedLibRequired SHARED testSharedLibRequired.cpp) generate_export_header(testSharedLibRequired) set_property(TARGET testSharedLibRequired @@ -219,13 +221,12 @@ set_property(TARGET testSharedLibDepends APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$/include/testSharedLibDepends>" "$" ) -set_property(TARGET testSharedLibDepends APPEND PROPERTY - LINK_INTERFACE_LIBRARIES - $<$,EXECUTABLE>:$> -) # LINK_PRIVATE because the LINK_INTERFACE_LIBRARIES is specified above. target_link_libraries(testSharedLibDepends LINK_PRIVATE testSharedLibRequired) +target_link_libraries(testSharedLibDepends LINK_PUBLIC renamed_on_export) +target_link_libraries(testSharedLibDepends LINK_INTERFACE_LIBRARIES + $<$,EXECUTABLE>:$>) install(TARGETS testLibRequired testLibIncludeRequired1 @@ -310,7 +311,7 @@ add_subdirectory(sublib) # For CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE test. # Export from build tree. export(TARGETS testExe1 testLib1 testLib2 testLib3 testExe2libImp testLib3Imp testLib3ImpDep subdirlib - testSharedLibRequired testSharedLibDepends + testSharedLibRequired testSharedLibDepends renamed_on_export NAMESPACE bld_ FILE ExportBuildTree.cmake ) diff --git a/Tests/ExportImport/Export/renamed/CMakeLists.txt b/Tests/ExportImport/Export/renamed/CMakeLists.txt new file mode 100644 index 0000000..a763251 --- /dev/null +++ b/Tests/ExportImport/Export/renamed/CMakeLists.txt @@ -0,0 +1,20 @@ + +add_library(renamed_on_export SHARED renamed.cxx) +generate_export_header(renamed_on_export) +target_include_directories(renamed_on_export + PUBLIC "$/include/renamed>" + "$" +) +set_property(TARGET renamed_on_export + PROPERTY + EXPORT_NAME renamed +) + +install(FILES + "${CMAKE_CURRENT_SOURCE_DIR}/renamed.h" + "${CMAKE_CURRENT_BINARY_DIR}/renamed_on_export_export.h" + DESTINATION include/renamed +) + +install(TARGETS renamed_on_export + EXPORT exp DESTINATION lib ) diff --git a/Tests/ExportImport/Export/renamed/renamed.cxx b/Tests/ExportImport/Export/renamed/renamed.cxx new file mode 100644 index 0000000..b3e3e7e --- /dev/null +++ b/Tests/ExportImport/Export/renamed/renamed.cxx @@ -0,0 +1,7 @@ + +#include "renamed.h" + +int Renamed::foo() +{ + return 0; +} diff --git a/Tests/ExportImport/Export/renamed/renamed.h b/Tests/ExportImport/Export/renamed/renamed.h new file mode 100644 index 0000000..06ac601 --- /dev/null +++ b/Tests/ExportImport/Export/renamed/renamed.h @@ -0,0 +1,12 @@ + +#ifndef RENAMED_H +#define RENAMED_H + +#include "renamed_on_export_export.h" + +struct RENAMED_ON_EXPORT_EXPORT Renamed +{ + int foo(); +}; + +#endif diff --git a/Tests/ExportImport/Export/testSharedLibDepends.cpp b/Tests/ExportImport/Export/testSharedLibDepends.cpp index e279207..962223f 100644 --- a/Tests/ExportImport/Export/testSharedLibDepends.cpp +++ b/Tests/ExportImport/Export/testSharedLibDepends.cpp @@ -4,5 +4,6 @@ int TestSharedLibDepends::foo() { TestSharedLibRequired req; - return req.foo(); + Renamed renamed; + return req.foo() + renamed.foo(); } diff --git a/Tests/ExportImport/Export/testSharedLibDepends.h b/Tests/ExportImport/Export/testSharedLibDepends.h index b93143a..8b2f84e 100644 --- a/Tests/ExportImport/Export/testSharedLibDepends.h +++ b/Tests/ExportImport/Export/testSharedLibDepends.h @@ -5,6 +5,7 @@ #include "testsharedlibdepends_export.h" #include "testSharedLibRequired.h" +#include "renamed.h" struct TESTSHAREDLIBDEPENDS_EXPORT TestSharedLibDepends { diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 0337130..65b1a36 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -183,6 +183,12 @@ else() endif() endif() +add_executable(exp_renamed_test renamed_test.cpp) +target_link_libraries(exp_renamed_test exp_renamed) + +add_executable(bld_renamed_test renamed_test.cpp) +target_link_libraries(bld_renamed_test bld_renamed) + if (run_pic_test) target_compile_definitions(deps_shared_iface PRIVATE CHECK_PIC_WORKS) endif() diff --git a/Tests/ExportImport/Import/A/deps_shared_iface.cpp b/Tests/ExportImport/Import/A/deps_shared_iface.cpp index 2f0e74a..32e04db 100644 --- a/Tests/ExportImport/Import/A/deps_shared_iface.cpp +++ b/Tests/ExportImport/Import/A/deps_shared_iface.cpp @@ -22,6 +22,7 @@ #ifdef TEST_SUBDIR_LIB #include "subdir.h" +#include "renamed.h" #endif int main(int,char **) @@ -31,11 +32,12 @@ int main(int,char **) #ifdef TEST_SUBDIR_LIB SubDirObject sdo; + Renamed ren; #endif return dep.foo() + req.foo() #ifdef TEST_SUBDIR_LIB - + sdo.foo() + + sdo.foo() + ren.foo() #endif ; } diff --git a/Tests/ExportImport/Import/A/renamed_test.cpp b/Tests/ExportImport/Import/A/renamed_test.cpp new file mode 100644 index 0000000..e2ee126 --- /dev/null +++ b/Tests/ExportImport/Import/A/renamed_test.cpp @@ -0,0 +1,8 @@ + +#include "renamed.h" + +int main(int, char **) +{ + Renamed ren; + return ren.foo(); +} -- cgit v0.12 From 03071d30fee82919ca005758867224f937e15836 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sun, 19 May 2013 00:01:03 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 50ab06d..8417a33 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130518) +set(CMake_VERSION_TWEAK 20130519) #set(CMake_VERSION_RC 1) -- cgit v0.12 From 5261fde940ac85ae28af8bd6c800f2def3dea028 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Mon, 20 May 2013 00:01:03 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 8417a33..df3d134 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130519) +set(CMake_VERSION_TWEAK 20130520) #set(CMake_VERSION_RC 1) -- cgit v0.12 From 7e0c45e9cf153d4fe0b7945fbe0ec759b456311f Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 17 May 2013 08:21:43 -0400 Subject: VS: Allow /Fa to set AssemblerListingLocation (#14153) Generate the default AssemblerListingLocation through the flag map so that it can be overridden by a user /Fa flag. Also teach the VS 7-9 generators to map /Fa to AssemblerListingLocation. While at it, fix the AssemblerListingLocation default value to have a trailing slash after the configuration name. This ensures it will be treated as a directory and not a file name. --- Source/cmLocalVisualStudio7Generator.cxx | 6 +++++- Source/cmVisualStudio10TargetGenerator.cxx | 5 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 59d5ef0..58d28da 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -476,6 +476,9 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] = {"ForcedIncludeFiles", "FI", "Forced include files", "", cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SemicolonAppendable}, + {"AssemblerListingLocation", "Fa", "ASM List Location", "", + cmVS7FlagTable::UserValue}, + // boolean flags {"BufferSecurityCheck", "GS", "Buffer security check", "TRUE", 0}, {"BufferSecurityCheck", "GS-", "Turn off Buffer security check", "FALSE", 0}, @@ -740,6 +743,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, table, this->ExtraFlagTable); targetOptions.FixExceptionHandlingDefault(); + std::string asmLocation = std::string(configName) + "/"; + targetOptions.AddFlag("AssemblerListingLocation", asmLocation.c_str()); targetOptions.Parse(flags.c_str()); targetOptions.Parse(defineFlags.c_str()); targetOptions.ParseFinish(); @@ -836,7 +841,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, fout << "\"\n"; targetOptions.OutputFlagMap(fout, "\t\t\t\t"); targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX"); - fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n"; fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n"; fout << "/>\n"; // end of Target->GetMakefile()->GetDefineFlags(); clOptions.FixExceptionHandlingDefault(); clOptions.AddFlag("PrecompiledHeader", "NotUsing"); + std::string asmLocation = configName + "/"; + clOptions.AddFlag("AssemblerListingLocation", asmLocation.c_str()); clOptions.Parse(flags.c_str()); clOptions.Parse(defineFlags.c_str()); clOptions.AddDefines(this->Target->GetCompileDefinitions( @@ -1260,9 +1262,6 @@ void cmVisualStudio10TargetGenerator::WriteClOptions( clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ", "\n", "CXX"); - this->WriteString("", 3); - *this->BuildFileStream << configName - << "\n"; this->WriteString("$(IntDir)\n", 3); this->WriteString("\n", 2); } -- cgit v0.12 From 994dc70bc463699682d71e9a021b924c4b75cb29 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 17 Apr 2013 21:30:07 +0200 Subject: Remove unused vector population. The call to GetEnabledLanguages does not have side-effects. --- Source/cmLocalGenerator.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index ee5b9d8..e26aa74 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1084,8 +1084,6 @@ void cmLocalGenerator::ExpandRuleVariables(std::string& s, const RuleVariables& replaceValues) { - std::vector enabledLanguages; - this->GlobalGenerator->GetEnabledLanguages(enabledLanguages); this->InsertRuleLauncher(s, replaceValues.CMTarget, replaceValues.RuleLauncher); std::string::size_type start = s.find('<'); -- cgit v0.12 From f206cce2cac8b018d94b2c4f39b35c6928d38bd3 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Tue, 21 May 2013 00:01:03 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index df3d134..99ce3da 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130520) +set(CMake_VERSION_TWEAK 20130521) #set(CMake_VERSION_RC 1) -- cgit v0.12 From 8e947670cf2af581fb7b97f040e687aa6a2404e0 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 16 May 2013 18:58:58 +0200 Subject: Sublime: Honor source-level COMPILE_FLAGS property Make the code match the comment. --- Source/cmExtraSublimeTextGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index e4802d5..62e9194 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -457,7 +457,7 @@ cmExtraSublimeTextGenerator::ComputeFlagsForObject(cmSourceFile* source, } // Add source file specific flags. - lg->AppendFlags(flags, target->GetProperty("COMPILE_FLAGS")); + lg->AppendFlags(flags, source->GetProperty("COMPILE_FLAGS")); // TODO: Handle Apple frameworks. -- cgit v0.12 From dea4d263d3e23424185720745109bded4821d4af Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 15 Apr 2013 15:07:16 +0200 Subject: Docs: cmake -G selects a "build system" generator -G is not only for makefile generators. --- Source/cmake.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmake.h b/Source/cmake.h index 63065a1..1a4ec62 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -532,9 +532,9 @@ private: "CMakeCache.txt file, globbing expressions using * and ? are supported. "\ "The option may be repeated for as many cache entries as desired.\n" \ "Use with care, you can make your CMakeCache.txt non-working."}, \ - {"-G ", "Specify a makefile generator.", \ + {"-G ", "Specify a build system generator.", \ "CMake may support multiple native build systems on certain platforms. " \ - "A makefile generator is responsible for generating a particular build " \ + "A generator is responsible for generating a particular build " \ "system. Possible generator names are specified in the Generators " \ "section."},\ {"-T ", "Specify toolset name if supported by generator.", \ -- cgit v0.12 From 342fc0401005decc9b5b87168483d7b3818ae0af Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 11 Apr 2013 16:55:36 +0200 Subject: Recognize shared library files with a numerical suffix When processing link line entries we check for matches with known naming patterns for static and shared libraries. Teach this logic to recognize numerical suffixes after shared library names such as "libfoo.so.1". --- Source/cmComputeLinkInformation.cxx | 14 ++++++++++---- Source/cmComputeLinkInformation.h | 3 ++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 896b50a..0158508 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -882,7 +882,8 @@ void cmComputeLinkInformation::ComputeItemParserInfo() } // Compute a regex to match link extensions. - std::string libext = this->CreateExtensionRegex(this->LinkExtensions); + std::string libext = this->CreateExtensionRegex(this->LinkExtensions, + LinkUnknown); // Create regex to remove any library extension. std::string reg("(.*)"); @@ -916,7 +917,8 @@ void cmComputeLinkInformation::ComputeItemParserInfo() if(!this->StaticLinkExtensions.empty()) { std::string reg_static = reg; - reg_static += this->CreateExtensionRegex(this->StaticLinkExtensions); + reg_static += this->CreateExtensionRegex(this->StaticLinkExtensions, + LinkStatic); #ifdef CM_COMPUTE_LINK_INFO_DEBUG fprintf(stderr, "static regex [%s]\n", reg_static.c_str()); #endif @@ -928,7 +930,7 @@ void cmComputeLinkInformation::ComputeItemParserInfo() { std::string reg_shared = reg; this->SharedRegexString = - this->CreateExtensionRegex(this->SharedLinkExtensions); + this->CreateExtensionRegex(this->SharedLinkExtensions, LinkShared); reg_shared += this->SharedRegexString; #ifdef CM_COMPUTE_LINK_INFO_DEBUG fprintf(stderr, "shared regex [%s]\n", reg_shared.c_str()); @@ -966,7 +968,7 @@ void cmComputeLinkInformation::AddLinkExtension(const char* e, LinkType type) //---------------------------------------------------------------------------- std::string cmComputeLinkInformation -::CreateExtensionRegex(std::vector const& exts) +::CreateExtensionRegex(std::vector const& exts, LinkType type) { // Build a list of extension choices. std::string libext = "("; @@ -995,6 +997,10 @@ cmComputeLinkInformation { libext += "(\\.[0-9]+\\.[0-9]+)?"; } + else if(type == LinkShared) + { + libext += "(\\.[0-9]+)?"; + } libext += "$"; return libext; diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index 1a76922..e6ee871 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -134,7 +134,8 @@ private: bool OpenBSD; void AddLinkPrefix(const char* p); void AddLinkExtension(const char* e, LinkType type); - std::string CreateExtensionRegex(std::vector const& exts); + std::string CreateExtensionRegex(std::vector const& exts, + LinkType type); std::string NoCaseExpression(const char* str); // Handling of link items. -- cgit v0.12 From 444e752294166674af884c02202da518d3794fa9 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 15 May 2013 16:17:41 +0200 Subject: FindQt4: Fix QUIET failure with Qt 5 but not Qt 4 The call find_package(Qt4 QUIET) should be non-FATAL in that case. This fixes #14142. --- Modules/FindQt4.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 21e8e91..85686a9 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -657,8 +657,11 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) message(WARNING "${QT_QMAKE_EXECUTABLE} reported QT_INSTALL_LIBS as \"${QT_LIBRARY_DIR_TMP}\" " "but QtCore could not be found there. " "Qt is NOT installed correctly for the target build environment.") + set(Qt4_FOUND FALSE) if(Qt4_FIND_REQUIRED) message( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.") + else() + return() endif() endif() -- cgit v0.12 From eabefa8b02b399b00aea83185b6b364ab5b6aa3d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 26 Mar 2013 18:08:29 +0100 Subject: Error on relative path in INCLUDE_DIRECTORIES target property. Add policy CMP0021 to preserve existing behavior in projects expecting it from earlier CMake versions. --- Source/cmPolicies.cxx | 14 +++++++++ Source/cmPolicies.h | 2 ++ Source/cmTarget.cxx | 36 ++++++++++++++++++++-- Source/cmTarget.h | 5 +++ .../include_directories/CMP0021-result.txt | 1 + .../include_directories/CMP0021-stderr.txt | 4 +++ Tests/RunCMake/include_directories/CMP0021.cmake | 9 ++++++ .../include_directories/RunCMakeTest.cmake | 1 + 8 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 Tests/RunCMake/include_directories/CMP0021-result.txt create mode 100644 Tests/RunCMake/include_directories/CMP0021-stderr.txt create mode 100644 Tests/RunCMake/include_directories/CMP0021.cmake diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 831e92e..09e1051 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -529,6 +529,20 @@ cmPolicies::cmPolicies() "The NEW behavior for this policy is to link executables to " "qtmain.lib automatically when they link to QtCore IMPORTED target.", 2,8,11,0, cmPolicies::WARN); + + this->DefinePolicy( + CMP0021, "CMP0021", + "Fatal error on relative paths in INCLUDE_DIRECTORIES target property.", + "CMake 2.8.10.2 and lower allowed the INCLUDE_DIRECTORIES target " + "property to contain relative paths. The base path for such relative " + "entries is not well defined. CMake 2.8.12 issues a FATAL_ERROR if the " + "INCLUDE_DIRECTORIES property contains a relative path." + "\n" + "The OLD behavior for this policy is not to warn about relative paths in " + "the INCLUDE_DIRECTORIES target property. " + "The NEW behavior for this policy is to issue a FATAL_ERROR if " + "INCLUDE_DIRECTORIES contains a relative path.", + 2,8,11,20130516, cmPolicies::WARN); } cmPolicies::~cmPolicies() diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index c11af07..a033e87 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -70,6 +70,8 @@ public: /// instead. CMP0019, ///< No variable re-expansion in include and link info CMP0020, ///< Automatically link Qt executables to qtmain target + CMP0021, ///< Fatal error on relative paths in INCLUDE_DIRECTORIES + /// target property /** \brief Always the last entry. * diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index d14bfca..fab8f19 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -191,6 +191,7 @@ cmTarget::cmTarget() this->PolicyStatusCMP0004 = cmPolicies::WARN; this->PolicyStatusCMP0008 = cmPolicies::WARN; this->PolicyStatusCMP0020 = cmPolicies::WARN; + this->PolicyStatusCMP0021 = cmPolicies::WARN; this->LinkLibrariesAnalyzed = false; this->HaveInstallRule = false; this->DLLPlatform = false; @@ -1568,6 +1569,8 @@ void cmTarget::SetMakefile(cmMakefile* mf) this->Makefile->GetPolicyStatus(cmPolicies::CMP0008); this->PolicyStatusCMP0020 = this->Makefile->GetPolicyStatus(cmPolicies::CMP0020); + this->PolicyStatusCMP0021 = + this->Makefile->GetPolicyStatus(cmPolicies::CMP0021); } //---------------------------------------------------------------------------- @@ -2876,14 +2879,41 @@ static void processIncludeDirectories(cmTarget *tgt, if (!cmSystemTools::FileIsFullPath(li->c_str())) { + cmOStringStream e; + bool noMessage = false; + cmake::MessageType messageType = cmake::FATAL_ERROR; if (!(*it)->TargetName.empty()) { - cmOStringStream e; e << "Target \"" << (*it)->TargetName << "\" contains relative " "path in its INTERFACE_INCLUDE_DIRECTORIES:\n" " \"" << *li << "\" "; - tgt->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, - e.str().c_str()); + } + else + { + switch(tgt->GetPolicyStatusCMP0021()) + { + case cmPolicies::WARN: + { + cmOStringStream w; + e << (mf->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0021)) << "\n"; + messageType = cmake::AUTHOR_WARNING; + } + break; + case cmPolicies::OLD: + noMessage = true; + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::NEW: + // Issue the fatal message. + break; + } + e << "Found relative path while evaluating include directories of " + "\"" << tgt->GetName() << "\":\n \"" << *li << "\"\n"; + } + if (!noMessage) + { + tgt->GetMakefile()->IssueMessage(messageType, e.str().c_str()); return; } } diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 9d46796..daf9540 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -106,6 +106,10 @@ public: cmPolicies::PolicyStatus GetPolicyStatusCMP0020() const { return this->PolicyStatusCMP0020; } + /** Get the status of policy CMP0021 when the target was created. */ + cmPolicies::PolicyStatus GetPolicyStatusCMP0021() const + { return this->PolicyStatusCMP0021; } + /** * Get the list of the custom commands for this target */ @@ -664,6 +668,7 @@ private: cmPolicies::PolicyStatus PolicyStatusCMP0004; cmPolicies::PolicyStatus PolicyStatusCMP0008; cmPolicies::PolicyStatus PolicyStatusCMP0020; + cmPolicies::PolicyStatus PolicyStatusCMP0021; // Internal representation details. friend class cmTargetInternals; diff --git a/Tests/RunCMake/include_directories/CMP0021-result.txt b/Tests/RunCMake/include_directories/CMP0021-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/include_directories/CMP0021-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/include_directories/CMP0021-stderr.txt b/Tests/RunCMake/include_directories/CMP0021-stderr.txt new file mode 100644 index 0000000..c0781e7 --- /dev/null +++ b/Tests/RunCMake/include_directories/CMP0021-stderr.txt @@ -0,0 +1,4 @@ +CMake Error in CMakeLists.txt: + Found relative path while evaluating include directories of "userTarget": + + "foo" diff --git a/Tests/RunCMake/include_directories/CMP0021.cmake b/Tests/RunCMake/include_directories/CMP0021.cmake new file mode 100644 index 0000000..f18666b --- /dev/null +++ b/Tests/RunCMake/include_directories/CMP0021.cmake @@ -0,0 +1,9 @@ +enable_language(CXX) + +cmake_policy(SET CMP0021 NEW) + +add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") +set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<1:foo>") + +add_library(userTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") +target_include_directories(userTarget PRIVATE $) diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake index f516086..520dd44 100644 --- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake +++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake @@ -8,3 +8,4 @@ run_cmake(BinaryDirectoryInInterface) run_cmake(RelativePathInInterface) run_cmake(ImportedTarget) run_cmake(RelativePathInGenex) +run_cmake(CMP0021) -- cgit v0.12 From 2f84dfec93b6a5d8b4db89bafe09688382b96997 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 20 May 2013 12:25:59 +0200 Subject: include_directories: Fix handling of empty or space-only entries This is a regression introduced in commit 0d46e9a0 (Store includes from the same include_directories call together., 2013-01-20). Reported at http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/46695/focus=7847 --- Source/cmIncludeDirectoryCommand.cxx | 15 +++++++++++++-- Tests/IncludeDirectories/CMakeLists.txt | 11 +++++++++++ Tests/IncludeDirectories/empty.cpp | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 Tests/IncludeDirectories/empty.cpp diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index ffb0e80..30c1743 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -116,13 +116,19 @@ void cmIncludeDirectoryCommand::GetIncludes(const std::string &arg, { std::string inc = arg.substr(lastPos,pos); this->NormalizeInclude(inc); - incs.push_back(inc); + if (!inc.empty()) + { + incs.push_back(inc); + } } lastPos = pos + 1; } std::string inc = arg.substr(lastPos); this->NormalizeInclude(inc); - incs.push_back(inc); + if (!inc.empty()) + { + incs.push_back(inc); + } } void cmIncludeDirectoryCommand::NormalizeInclude(std::string &inc) @@ -133,6 +139,11 @@ void cmIncludeDirectoryCommand::NormalizeInclude(std::string &inc) { inc.assign(inc, b, 1+e-b); // copy the remaining substring } + else + { + inc = ""; + return; + } if (!cmSystemTools::IsOff(inc.c_str())) { diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt index 8a60f17..3e3ecc9 100644 --- a/Tests/IncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/CMakeLists.txt @@ -58,3 +58,14 @@ get_property(propContentAfter DIRECTORY PROPERTY INCLUDE_DIRECTORIES) if (NOT propContentAfter STREQUAL "") message(SEND_ERROR "Clearing DIRECTORY property failed.") endif() + +add_library(empty_entry_test SHARED empty.cpp) +set_target_properties(empty_entry_test PROPERTIES INCLUDE_DIRECTORIES "") +include_directories(/one/two + " " + " " +) +get_target_property(incs empty_entry_test INCLUDE_DIRECTORIES) +if (NOT incs STREQUAL ";/one/two") + message(SEND_ERROR "Empty include_directories entry was not ignored.") +endif() diff --git a/Tests/IncludeDirectories/empty.cpp b/Tests/IncludeDirectories/empty.cpp new file mode 100644 index 0000000..ab32cf6 --- /dev/null +++ b/Tests/IncludeDirectories/empty.cpp @@ -0,0 +1 @@ +// No content -- cgit v0.12 From db4350232639d9356c4bf5af6a91d71e5d45c93e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 17 May 2013 15:26:57 +0200 Subject: CTest: Read CTEST_PARALLEL_LEVEL from environment If no explicit "-j " option is given on the command line then read the parallel level from an environment variable. --- Source/cmCTest.cxx | 11 +++++++++++ Source/cmCTest.h | 1 + Source/ctest.cxx | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 9a042c4..69ffb97 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -294,6 +294,7 @@ cmCTest::cmCTest() { this->LabelSummary = true; this->ParallelLevel = 1; + this->ParallelLevelSetInCli = false; this->SubmitIndex = 0; this->Failover = false; this->BatchJobs = false; @@ -1999,11 +2000,13 @@ void cmCTest::HandleCommandLineArguments(size_t &i, i++; int plevel = atoi(args[i].c_str()); this->SetParallelLevel(plevel); + this->ParallelLevelSetInCli = true; } else if(arg.find("-j") == 0) { int plevel = atoi(arg.substr(2).c_str()); this->SetParallelLevel(plevel); + this->ParallelLevelSetInCli = true; } if(this->CheckArgument(arg, "--no-compress-output")) @@ -2398,6 +2401,14 @@ int cmCTest::Run(std::vector &args, std::string* output) } } // the close of the for argument loop + if (!this->ParallelLevelSetInCli) + { + if (const char *parallel = cmSystemTools::GetEnv("CTEST_PARALLEL_LEVEL")) + { + int plevel = atoi(parallel); + this->SetParallelLevel(plevel); + } + } // now what sould cmake do? if --build-and-test was specified then // we run the build and test handler and return diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 587a6db..5dd35ce 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -485,6 +485,7 @@ private: int MaxTestNameWidth; int ParallelLevel; + bool ParallelLevelSetInCli; int CompatibilityMode; diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 285ec17..e767a16 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -71,7 +71,8 @@ static const char * cmDocumentationOptions[][3] = {"-j , --parallel ", "Run the tests in parallel using the" "given number of jobs.", "This option tells ctest to run the tests in parallel using given " - "number of jobs."}, + "number of jobs. This option can also be set by setting " + "the environment variable CTEST_PARALLEL_LEVEL."}, {"-Q,--quiet", "Make ctest quiet.", "This option will suppress all the output. The output log file will " "still be generated if the --output-log is specified. Options such " -- cgit v0.12 From 0ab50aea4c4d7099b339fb38b4459d0debbdbd85 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 21 Mar 2013 19:34:32 +0100 Subject: string: Add MAKE_C_IDENTIFIER subcommand --- Source/cmStringCommand.cxx | 22 ++++++++++++++++++++++ Source/cmStringCommand.h | 6 +++++- Tests/StringFileTest/CMakeLists.txt | 6 ++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index e49edd8..1fbde01 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -93,6 +93,10 @@ bool cmStringCommand { return this->HandleTimestampCommand(args); } + else if(subCommand == "MAKE_C_IDENTIFIER") + { + return this->HandleMakeCIdentifierCommand(args); + } std::string e = "does not recognize sub-command "+subCommand; this->SetError(e.c_str()); @@ -755,6 +759,24 @@ bool cmStringCommand } //---------------------------------------------------------------------------- +bool cmStringCommand +::HandleMakeCIdentifierCommand(std::vector const& args) +{ + if(args.size() != 3) + { + this->SetError("sub-command MAKE_C_IDENTIFIER requires two arguments."); + return false; + } + + const std::string& input = args[1]; + const std::string& variableName = args[2]; + + this->Makefile->AddDefinition(variableName.c_str(), + cmSystemTools::MakeCidentifier(input.c_str()).c_str()); + return true; +} + +//---------------------------------------------------------------------------- bool cmStringCommand::HandleStripCommand( std::vector const& args) { diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index 802e0b8..f584cfd 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -94,6 +94,7 @@ public: " [RANDOM_SEED ] )\n" " string(FIND [REVERSE])\n" " string(TIMESTAMP [] [UTC])\n" + " string(MAKE_C_IDENTIFIER )\n" "REGEX MATCH will match the regular expression once and store the " "match in the output variable.\n" "REGEX MATCHALL will match the regular expression as many times as " @@ -176,7 +177,9 @@ public: "and copied to the output as-is.\n" "If no explicit is given it will default to:\n" " %Y-%m-%dT%H:%M:%S for local time.\n" - " %Y-%m-%dT%H:%M:%SZ for UTC."; + " %Y-%m-%dT%H:%M:%SZ for UTC.\n" + "MAKE_C_IDENTIFIER will write a string which can be used as an " + "identifier in C."; } cmTypeMacro(cmStringCommand, cmCommand); @@ -200,6 +203,7 @@ protected: bool HandleRandomCommand(std::vector const& args); bool HandleFindCommand(std::vector const& args); bool HandleTimestampCommand(std::vector const& args); + bool HandleMakeCIdentifierCommand(std::vector const& args); class RegexReplacement { diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt index 6d798b0..00383ab 100644 --- a/Tests/StringFileTest/CMakeLists.txt +++ b/Tests/StringFileTest/CMakeLists.txt @@ -280,3 +280,9 @@ endif() if(NOT ST_NINE STREQUAL "9") message(SEND_ERROR "SUBSTRING does not return the tail when selected with -1") endif() + +string(MAKE_C_IDENTIFIER "1one-two$" MCI_1) + +if(NOT MCI_1 STREQUAL _1one_two_) + message(SEND_ERROR "MAKE_C_IDENTIFIER did not create expected result.") +endif() -- cgit v0.12 From 1a2a6ba4b68dc59b8f5cae26458cc79ad3bb2750 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Tue, 21 May 2013 22:58:36 +0200 Subject: Tests: fix build of dummy memtester on AIX Both and include one or the other way. It looks like the CMake header adds a define that will cause another part of the system header to be used, resulting in conflicting definitions. --- Tests/CTestTestMemcheck/memtester.cxx.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CTestTestMemcheck/memtester.cxx.in b/Tests/CTestTestMemcheck/memtester.cxx.in index 4609fa3..da6f5a4 100644 --- a/Tests/CTestTestMemcheck/memtester.cxx.in +++ b/Tests/CTestTestMemcheck/memtester.cxx.in @@ -1,5 +1,5 @@ -#include #include +#include #define RETVAL @_retval@ -- cgit v0.12 From f1d27bf667a8548121ed849cbb211eccf386f1bd Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Tue, 21 May 2013 23:33:54 +0200 Subject: wizard: fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .../Source/cmakewizard.cxx: In member function ‘virtual void cmakewizard::AskUser(const char*, cmCacheManager::CacheIterator&)’: .../Source/cmakewizard.cxx:31:35: warning: conversion to ‘int’ from ‘long unsigned int’ may alter its value [-Wconversion] if(!fgets(buffer, sizeof(buffer)-1, stdin)) ^ .../Source/cmakewizard.cxx: In member function ‘virtual bool cmakewizard::AskAdvanced()’: .../Source/cmakewizard.cxx:70:35: warning: conversion to ‘int’ from ‘long unsigned int’ may alter its value [-Wconversion] if(!fgets(buffer, sizeof(buffer)-1, stdin)) The compiler is (partly) right here: sizeof() returns a size_t, which often is bigger as as int as it is unsigned long or something similar. Add an explicit cast to get rid of that warning here, the buffer has a size of 4KiB, so the value will fit into an int on all sane platforms. --- Source/cmakewizard.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmakewizard.cxx b/Source/cmakewizard.cxx index 749f669..8ac55d9 100644 --- a/Source/cmakewizard.cxx +++ b/Source/cmakewizard.cxx @@ -28,7 +28,7 @@ void cmakewizard::AskUser(const char* key, printf("Current Value: %s\n", iter.GetValue()); printf("New Value (Enter to keep current value): "); char buffer[4096]; - if(!fgets(buffer, sizeof(buffer)-1, stdin)) + if(!fgets(buffer, static_cast(sizeof(buffer) - 1), stdin)) { buffer[0] = 0; } @@ -67,7 +67,7 @@ bool cmakewizard::AskAdvanced() { printf("Would you like to see advanced options? [No]:"); char buffer[4096]; - if(!fgets(buffer, sizeof(buffer)-1, stdin)) + if(!fgets(buffer, static_cast(sizeof(buffer) - 1), stdin)) { buffer[0] = 0; } -- cgit v0.12 From d337cb402fa1935a39792a51739c7a9971202414 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Wed, 22 May 2013 00:01:06 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 99ce3da..93a4710 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130521) +set(CMake_VERSION_TWEAK 20130522) #set(CMake_VERSION_RC 1) -- cgit v0.12 From bcda47d2a0673d46ffe209e3e0c07724eb6b8f5a Mon Sep 17 00:00:00 2001 From: Matthew Bentham Date: Wed, 22 May 2013 08:44:00 -0400 Subject: Xcode: Honor CMAKE_(MODULE|SHARED)_LINKER_FLAGS_ (#14161) Refactor lookup of CMAKE_(EXE|MODULE|SHARED)_LINKER_FLAGS(|_) variables to ensure all combinations are handled. Use the helper method AddConfigVariableFlags to simplify the implementation. --- Source/cmGlobalXCodeGenerator.cxx | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 870bfa1..c739dcb 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1716,30 +1716,26 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, buildSettings->AddAttribute ("GCC_PREPROCESSOR_DEFINITIONS", ppDefs.CreateList()); + std::string extraLinkOptionsVar; std::string extraLinkOptions; if(target.GetType() == cmTarget::EXECUTABLE) { - extraLinkOptions = - this->CurrentMakefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS"); - std::string var = "CMAKE_EXE_LINKER_FLAGS_"; - var += cmSystemTools::UpperCase(configName); - std::string val = - this->CurrentMakefile->GetSafeDefinition(var.c_str()); - if(val.size()) - { - extraLinkOptions += " "; - extraLinkOptions += val; - } + extraLinkOptionsVar = "CMAKE_EXE_LINKER_FLAGS"; } - if(target.GetType() == cmTarget::SHARED_LIBRARY) + else if(target.GetType() == cmTarget::SHARED_LIBRARY) + { + extraLinkOptionsVar = "CMAKE_SHARED_LINKER_FLAGS"; + } + else if(target.GetType() == cmTarget::MODULE_LIBRARY) { - extraLinkOptions = this->CurrentMakefile-> - GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS"); + extraLinkOptionsVar = "CMAKE_MODULE_LINKER_FLAGS"; } - if(target.GetType() == cmTarget::MODULE_LIBRARY) + if(extraLinkOptionsVar.size()) { - extraLinkOptions = this->CurrentMakefile-> - GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS"); + this->CurrentLocalGenerator + ->AddConfigVariableFlags(extraLinkOptions, + extraLinkOptionsVar.c_str(), + configName); } const char* linkFlagsProp = "LINK_FLAGS"; -- cgit v0.12 From eca523fbd40487a36f41a0e3088238770131b7ce Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Tue, 21 May 2013 23:36:37 +0200 Subject: wizard: simplify control flow Checking if a byte is 0 before checking it for something else doesn't do anything useful. Also one can be sure that it can't be anything wanted if the value was set to 0 immediately before. --- Source/cmakewizard.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Source/cmakewizard.cxx b/Source/cmakewizard.cxx index 8ac55d9..bac403a 100644 --- a/Source/cmakewizard.cxx +++ b/Source/cmakewizard.cxx @@ -71,12 +71,9 @@ bool cmakewizard::AskAdvanced() { buffer[0] = 0; } - if(buffer[0]) + else if(buffer[0] == 'y' || buffer[0] == 'Y') { - if(buffer[0] == 'y' || buffer[0] == 'Y') - { - return true; - } + return true; } return false; } -- cgit v0.12 From 776225d379290b23f05cc67fa1ffa329cdc4bfac Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Tue, 21 May 2013 23:40:30 +0200 Subject: cmTarget: drop the unused local typedef LinkLine --- Source/cmTarget.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index d0227ec..e9fc7ef 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2494,8 +2494,6 @@ cmTarget::AnalyzeLibDependencies( const cmMakefile& mf ) } } - typedef std::vector< std::string > LinkLine; - // The dependency map. DependencyMap dep_map; -- cgit v0.12 From 332350b9c4e6cd198315167664104e645ad3d7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20OCHS?= Date: Wed, 12 Dec 2012 10:42:00 -0500 Subject: Xcode: Support XCODE_ATTRIBUTE_ with [variant=] (#12532) Since commit c519bb2b (XCode: Also qoute [] as needed to set build-configurations, 2011-04-05) we escape "[]" conditions for XCODE_ATTRIBUTE_ settings. However, we need to handle the "variant" condition with a special case to map it only into the settings for the matching configuration. --- Source/cmGlobalXCodeGenerator.cxx | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 870bfa1..7973822 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2241,8 +2241,39 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, { if(i->first.find("XCODE_ATTRIBUTE_") == 0) { - buildSettings->AddAttribute(i->first.substr(16).c_str(), - this->CreateString(i->second.GetValue())); + cmStdString attribute = i->first.substr(16); + // Handle [variant=] condition explicitly here. + cmStdString::size_type beginVariant = + attribute.find("[variant="); + if (beginVariant != cmStdString::npos) + { + cmStdString::size_type endVariant = + attribute.find("]", beginVariant+9); + if (endVariant != cmStdString::npos) + { + // Compare the variant to the configuration. + cmStdString variant = + attribute.substr(beginVariant+9, endVariant-beginVariant-9); + if (variant == configName) + { + // The variant matches the configuration so use this + // attribute but drop the [variant=] condition. + attribute.erase(beginVariant, endVariant-beginVariant+1); + } + else + { + // The variant does not match the configuration so + // do not use this attribute. + attribute.clear(); + } + } + } + + if (!attribute.empty()) + { + buildSettings->AddAttribute(attribute.c_str(), + this->CreateString(i->second.GetValue())); + } } } } -- cgit v0.12 From 5361270c6e9898b7ea10854ae101301772cd9b7d Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Thu, 23 May 2013 00:01:05 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 93a4710..dd0a14e 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130522) +set(CMake_VERSION_TWEAK 20130523) #set(CMake_VERSION_RC 1) -- cgit v0.12 From 0aed09fd20b841a34381584b2058e1f994154f74 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Thu, 23 May 2013 06:31:47 +0200 Subject: Tests: ignore GuardMalloc messages on all Apple build, not just XCode ones --- Tests/CTestTestMemcheck/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt index 59d6816..60df75c 100644 --- a/Tests/CTestTestMemcheck/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -33,7 +33,7 @@ target_link_libraries(memcheck_fail CMakeLib) # same filenames. add_subdirectory(NoLogDummyChecker) -if (XCODE) +if (APPLE) # filter out additional messages by Guard Malloc integrated in Xcode set(GUARD_MALLOC_MSG "(ctest\([0-9]+\) malloc: [^\n]*\n)*") set(NORMAL_CTEST_OUTPUT "\n1/1 MemCheck #1: RunCMake \\.+ Passed +[0-9]+\\.[0-9]+ sec\n${GUARD_MALLOC_MSG}\n${GUARD_MALLOC_MSG}100% tests passed, 0 tests failed out of 1\n.*\n-- Processing memory checking output: \n${GUARD_MALLOC_MSG}Memory checking results:\n${GUARD_MALLOC_MSG}") -- cgit v0.12 From bb412d009a8496f9b34b0289aa568ee282734bfb Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 11 Jul 2012 17:06:37 +0200 Subject: GenerateExportHeader: Add newlines to separate the compiler output. Make the error logs more readable. --- Tests/Module/GenerateExportHeader/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt index 4a5b1cb..454f37a 100644 --- a/Tests/Module/GenerateExportHeader/CMakeLists.txt +++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt @@ -23,13 +23,13 @@ set( CMAKE_INCLUDE_CURRENT_DIR ON ) macro(TEST_FAIL value msg) if (${value}) - message (SEND_ERROR "Test fail:" ${msg} ${Out} ) + message (SEND_ERROR "Test fail:" "${msg}\n" ${Out} ) endif () endmacro() macro(TEST_PASS value msg) if (NOT ${value}) - message (SEND_ERROR "Test fail:" ${msg} ${Out} ) + message (SEND_ERROR "Test fail:" "${msg}\n" ${Out} ) endif () endmacro() -- cgit v0.12 From a97240b969c8ce48f728ee113f47f9c2ba598aeb Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 23 May 2013 09:10:04 -0400 Subject: Tests/IncludeDirectories: Avoid shared library with no symbols The parent commit added a empty_entry_test shared library to the IncludeDirectories test. Some toolchains fail to create a shared library with no user-defined symbols, so provide a dummy symbol. --- Tests/IncludeDirectories/empty.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tests/IncludeDirectories/empty.cpp b/Tests/IncludeDirectories/empty.cpp index ab32cf6..1787013 100644 --- a/Tests/IncludeDirectories/empty.cpp +++ b/Tests/IncludeDirectories/empty.cpp @@ -1 +1,4 @@ -// No content +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() { return 0; } -- cgit v0.12 From 373faae5e1c936351b143b0561c61ef9884303e1 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Sun, 5 May 2013 20:19:05 -0600 Subject: Refactor how bundles and frameworks are supported. Make handling of directory separators consistent between non-bundle and bundle code. Remove xcode specific flag from cmTarget when getting install_name. Add (more) consistent convenience functions in cmTarget to get directories inside of bundles and frameworks to add files to. This refactor also fixes bug #12263 where frameworks had the wrong install name when SKIP_BUILD_RPATH. Also make install_name for frameworks consistent between Makefile and Xcode generator. --- Source/cmExportBuildFileGenerator.cxx | 2 +- Source/cmExportInstallFileGenerator.cxx | 8 +- Source/cmGlobalXCodeGenerator.cxx | 9 +- Source/cmInstallTargetGenerator.cxx | 14 +-- Source/cmMakefileExecutableTargetGenerator.cxx | 5 +- Source/cmMakefileLibraryTargetGenerator.cxx | 13 +- Source/cmMakefileTargetGenerator.cxx | 2 +- Source/cmMakefileTargetGenerator.h | 1 - Source/cmMakefileUtilityTargetGenerator.cxx | 3 - Source/cmNinjaNormalTargetGenerator.cxx | 19 ++- Source/cmNinjaTargetGenerator.cxx | 2 +- Source/cmOSXBundleGenerator.cxx | 102 +++++++++------- Source/cmOSXBundleGenerator.h | 22 ++-- Source/cmTarget.cxx | 160 ++++++++++++++++--------- Source/cmTarget.h | 33 +++-- Tests/BundleUtilities/CMakeLists.txt | 3 +- 16 files changed, 229 insertions(+), 169 deletions(-) diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 7147f86..f8a32c2 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -143,7 +143,7 @@ cmExportBuildFileGenerator std::string prop = "IMPORTED_LOCATION"; prop += suffix; std::string value; - if(target->IsFrameworkOnApple() || target->IsAppBundleOnApple()) + if(target->IsAppBundleOnApple()) { value = target->GetFullPath(config, false); } diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index ad12b5a..fff807c 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -351,13 +351,7 @@ cmExportInstallFileGenerator prop += suffix; // Append the installed file name. - if(target->IsFrameworkOnApple()) - { - value += itgen->GetInstallFilename(target, config); - value += ".framework/"; - value += itgen->GetInstallFilename(target, config); - } - else if(target->IsCFBundleOnApple()) + if(target->IsCFBundleOnApple()) { const char *ext = target->GetProperty("BUNDLE_EXTENSION"); if (!ext) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index ceac564..240d60c 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1823,6 +1823,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, pndir = target.GetDirectory(configName); } + if(target.IsFrameworkOnApple()) + { + pnprefix = ""; + } + buildSettings->AddAttribute("EXECUTABLE_PREFIX", this->CreateString(pnprefix.c_str())); buildSettings->AddAttribute("EXECUTABLE_SUFFIX", @@ -2156,14 +2161,14 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, if(target.GetType() == cmTarget::SHARED_LIBRARY) { // Get the install_name directory for the build tree. - install_name_dir = target.GetInstallNameDirForBuildTree(configName, true); + install_name_dir = target.GetInstallNameDirForBuildTree(configName); if(install_name_dir.empty()) { // Xcode will not pass the -install_name option at all if INSTALL_PATH // is not given or is empty. We must explicitly put the flag in the // link flags to create an install_name with just the library soname. extraLinkOptions += " -install_name "; - extraLinkOptions += target.GetFullName(configName); + extraLinkOptions += target.GetSOName(configName); } else { diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 5f9b658..9aac440 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -198,14 +198,12 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os, // Install the whole framework directory. type = cmInstallType_DIRECTORY; literal_args += " USE_SOURCE_PERMISSIONS"; - std::string from1 = fromDirConfig + targetName + ".framework"; + + std::string from1 = fromDirConfig + targetName; + from1 = cmSystemTools::GetFilenamePath(from1); // Tweaks apply to the binary inside the bundle. - std::string to1 = toDir + targetName; - to1 += ".framework/Versions/"; - to1 += this->Target->GetFrameworkVersion(); - to1 += "/"; - to1 += targetName; + std::string to1 = toDir + targetNameReal; filesFrom.push_back(from1); filesTo.push_back(to1); @@ -528,7 +526,7 @@ cmInstallTargetGenerator // components of the install_name field then we need to create a // mapping to be applied after installation. std::string for_build = tgt->GetInstallNameDirForBuildTree(config); - std::string for_install = tgt->GetInstallNameDirForInstallTree(config); + std::string for_install = tgt->GetInstallNameDirForInstallTree(); if(for_build != for_install) { // The directory portions differ. Append the filename to @@ -555,7 +553,7 @@ cmInstallTargetGenerator std::string for_build = this->Target->GetInstallNameDirForBuildTree(config); std::string for_install = - this->Target->GetInstallNameDirForInstallTree(config); + this->Target->GetInstallNameDirForInstallTree(); if(this->Target->IsFrameworkOnApple() && for_install.empty()) { diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index b7a454b..e4219a9 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -30,11 +30,8 @@ cmMakefileExecutableTargetGenerator this->TargetNamePDB, this->ConfigName); this->OSXBundleGenerator = new cmOSXBundleGenerator(this->Target, - this->TargetNameOut, this->ConfigName); this->OSXBundleGenerator->SetMacContentFolders(&this->MacContentFolders); - this->MacContentDirectory = - this->OSXBundleGenerator->GetMacContentDirectory(); } //---------------------------------------------------------------------------- @@ -103,11 +100,11 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) // Construct the full path version of the names. std::string outpath = this->Target->GetDirectory(this->ConfigName); - outpath += "/"; if(this->Target->IsAppBundleOnApple()) { this->OSXBundleGenerator->CreateAppBundle(targetName, outpath); } + outpath += "/"; std::string outpathImp; if(relink) { diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 5b4e4d7..3edaa44 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -32,11 +32,8 @@ cmMakefileLibraryTargetGenerator this->TargetNameImport, this->TargetNamePDB, this->ConfigName); this->OSXBundleGenerator = new cmOSXBundleGenerator(this->Target, - this->TargetNameOut, this->ConfigName); this->OSXBundleGenerator->SetMacContentFolders(&this->MacContentFolders); - this->MacContentDirectory = - this->OSXBundleGenerator->GetMacContentDirectory(); } //---------------------------------------------------------------------------- @@ -292,14 +289,15 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules std::string outpathImp; if(this->Target->IsFrameworkOnApple()) { - outpath = this->MacContentDirectory; - this->OSXBundleGenerator->CreateFramework(targetName); + outpath = this->Target->GetDirectory(this->ConfigName); + this->OSXBundleGenerator->CreateFramework(targetName, outpath); + outpath += "/"; } else if(this->Target->IsCFBundleOnApple()) { outpath = this->Target->GetDirectory(this->ConfigName); - outpath += "/"; this->OSXBundleGenerator->CreateCFBundle(targetName, outpath); + outpath += "/"; } else if(relink) { @@ -727,7 +725,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules commands1.clear(); // Add a rule to create necessary symlinks for the library. - if(targetOutPath != targetOutPathReal) + // Frameworks are handled by cmOSXBundleGenerator. + if(targetOutPath != targetOutPathReal && !this->Target->IsFrameworkOnApple()) { std::string symlink = "$(CMAKE_COMMAND) -E cmake_symlink_library "; symlink += targetOutPathReal; diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 4220ae1..6fc88d6 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -357,7 +357,7 @@ cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator() (cmSourceFile& source, const char* pkgloc) { // Skip OS X content when not building a Framework or Bundle. - if(this->Generator->MacContentDirectory.empty()) + if(!this->Generator->GetTarget()->IsBundleOnApple()) { return; } diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index 2798e54..f7a1e2e 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -233,7 +233,6 @@ protected: std::string TargetNamePDB; // Mac OS X content info. - std::string MacContentDirectory; std::set MacContentFolders; cmOSXBundleGenerator* OSXBundleGenerator; MacOSXContentGeneratorType* MacOSXContentGenerator; diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx index 4456aa7..1fa4e95 100644 --- a/Source/cmMakefileUtilityTargetGenerator.cxx +++ b/Source/cmMakefileUtilityTargetGenerator.cxx @@ -25,11 +25,8 @@ cmMakefileUtilityTargetGenerator { this->CustomCommandDriver = OnUtility; this->OSXBundleGenerator = new cmOSXBundleGenerator(this->Target, - this->TargetNameOut, this->ConfigName); this->OSXBundleGenerator->SetMacContentFolders(&this->MacContentFolders); - this->MacContentDirectory = - this->OSXBundleGenerator->GetMacContentDirectory(); } //---------------------------------------------------------------------------- diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 7e48cd7..e5a6eab 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -61,7 +61,6 @@ cmNinjaNormalTargetGenerator(cmTarget* target) } this->OSXBundleGenerator = new cmOSXBundleGenerator(target, - this->TargetNameOut, this->GetConfigName()); this->OSXBundleGenerator->SetMacContentFolders(&this->MacContentFolders); } @@ -383,24 +382,32 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() if (this->GetTarget()->IsAppBundleOnApple()) { // Create the app bundle - std::string outpath; + std::string outpath = + this->GetTarget()->GetDirectory(this->GetConfigName()); this->OSXBundleGenerator->CreateAppBundle(this->TargetNameOut, outpath); // Calculate the output path - targetOutput = outpath + this->TargetNameOut; + targetOutput = outpath; + targetOutput += "/"; + targetOutput += this->TargetNameOut; targetOutput = this->ConvertToNinjaPath(targetOutput.c_str()); - targetOutputReal = outpath + this->TargetNameReal; + targetOutputReal = outpath; + targetOutputReal += "/"; + targetOutputReal += this->TargetNameReal; targetOutputReal = this->ConvertToNinjaPath(targetOutputReal.c_str()); } else if (this->GetTarget()->IsFrameworkOnApple()) { // Create the library framework. - this->OSXBundleGenerator->CreateFramework(this->TargetNameOut); + std::string outpath = + this->GetTarget()->GetDirectory(this->GetConfigName()); + this->OSXBundleGenerator->CreateFramework(this->TargetNameOut, outpath); } else if(this->GetTarget()->IsCFBundleOnApple()) { // Create the core foundation bundle. - std::string outpath; + std::string outpath = + this->GetTarget()->GetDirectory(this->GetConfigName()); this->OSXBundleGenerator->CreateCFBundle(this->TargetNameOut, outpath); } diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 3fb823c..38305e2 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -701,7 +701,7 @@ cmNinjaTargetGenerator::MacOSXContentGeneratorType::operator()( cmSourceFile& source, const char* pkgloc) { // Skip OS X content when not building a Framework or Bundle. - if(this->Generator->OSXBundleGenerator->GetMacContentDirectory().empty()) + if(!this->Generator->GetTarget()->IsBundleOnApple()) { return; } diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx index 42fad07..621a49f 100644 --- a/Source/cmOSXBundleGenerator.cxx +++ b/Source/cmOSXBundleGenerator.cxx @@ -28,26 +28,16 @@ void cmOSXBundleGenerator::PrepareTargetProperties(cmTarget* target) //---------------------------------------------------------------------------- cmOSXBundleGenerator:: cmOSXBundleGenerator(cmTarget* target, - std::string targetNameOut, const char* configName) : Target(target) , Makefile(target->GetMakefile()) , LocalGenerator(Makefile->GetLocalGenerator()) - , TargetNameOut(targetNameOut) , ConfigName(configName) - , MacContentDirectory() - , FrameworkVersion() , MacContentFolders(0) { if (this->MustSkip()) return; - this->MacContentDirectory = - this->Target->GetMacContentDirectory(this->ConfigName, - /*implib*/ false, - /*includeMacOS*/ false); - if(this->Target->IsFrameworkOnApple()) - this->FrameworkVersion = this->Target->GetFrameworkVersion(); } //---------------------------------------------------------------------------- @@ -57,41 +47,60 @@ bool cmOSXBundleGenerator::MustSkip() } //---------------------------------------------------------------------------- -void cmOSXBundleGenerator::CreateAppBundle(std::string& targetName, +void cmOSXBundleGenerator::CreateAppBundle(const std::string& targetName, std::string& outpath) { if (this->MustSkip()) return; // Compute bundle directory names. - outpath = this->MacContentDirectory; - outpath += "MacOS"; - cmSystemTools::MakeDirectory(outpath.c_str()); - outpath += "/"; - this->Makefile->AddCMakeOutputFile(outpath.c_str()); + std::string out = outpath; + out += "/"; + out += this->Target->GetAppBundleDirectory(this->ConfigName, false); + cmSystemTools::MakeDirectory(out.c_str()); + this->Makefile->AddCMakeOutputFile(out.c_str()); + + std::string newoutpath = out; // Configure the Info.plist file. Note that it needs the executable name // to be set. - std::string plist = this->MacContentDirectory + "Info.plist"; + std::string plist = outpath; + plist += "/"; + plist += this->Target->GetAppBundleDirectory(this->ConfigName, true); + plist += "/Info.plist"; this->LocalGenerator->GenerateAppleInfoPList(this->Target, targetName.c_str(), plist.c_str()); this->Makefile->AddCMakeOutputFile(plist.c_str()); + outpath = newoutpath; } //---------------------------------------------------------------------------- -void cmOSXBundleGenerator::CreateFramework(std::string const& targetName) +void cmOSXBundleGenerator::CreateFramework( + const std::string& targetName, const std::string& outpath) { if (this->MustSkip()) return; assert(this->MacContentFolders); + // Compute the location of the top-level foo.framework directory. + std::string contentdir = outpath + "/" + + this->Target->GetFrameworkDirectory(this->ConfigName, true); + contentdir += "/"; + + std::string newoutpath = outpath + "/" + + this->Target->GetFrameworkDirectory(this->ConfigName, false); + + std::string frameworkVersion = this->Target->GetFrameworkVersion(); + // Configure the Info.plist file into the Resources directory. this->MacContentFolders->insert("Resources"); - std::string plist = this->MacContentDirectory + "Resources/Info.plist"; + std::string plist = newoutpath; + plist += "/Resources/Info.plist"; + std::string name = cmSystemTools::GetFilenameName(targetName); this->LocalGenerator->GenerateFrameworkInfoPList(this->Target, - targetName.c_str(), + name.c_str(), plist.c_str()); // TODO: Use the cmMakefileTargetGenerator::ExtraFiles vector to @@ -99,25 +108,17 @@ void cmOSXBundleGenerator::CreateFramework(std::string const& targetName) std::string oldName; std::string newName; - // Compute the location of the top-level foo.framework directory. - std::string top = this->Target->GetDirectory(this->ConfigName); - top += "/"; - top += this->TargetNameOut; - top += ".framework/"; // Make foo.framework/Versions - std::string versions = top; + std::string versions = contentdir; versions += "Versions"; cmSystemTools::MakeDirectory(versions.c_str()); // Make foo.framework/Versions/version - std::string version = versions; - version += "/"; - version += this->FrameworkVersion; - cmSystemTools::MakeDirectory(version.c_str()); + cmSystemTools::MakeDirectory(newoutpath.c_str()); // Current -> version - oldName = this->FrameworkVersion; + oldName = frameworkVersion; newName = versions; newName += "/Current"; cmSystemTools::RemoveFile(newName.c_str()); @@ -126,9 +127,9 @@ void cmOSXBundleGenerator::CreateFramework(std::string const& targetName) // foo -> Versions/Current/foo oldName = "Versions/Current/"; - oldName += this->TargetNameOut; - newName = top; - newName += this->TargetNameOut; + oldName += name; + newName = contentdir; + newName += name; cmSystemTools::RemoveFile(newName.c_str()); cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); this->Makefile->AddCMakeOutputFile(newName.c_str()); @@ -138,7 +139,7 @@ void cmOSXBundleGenerator::CreateFramework(std::string const& targetName) this->MacContentFolders->end()) { oldName = "Versions/Current/Resources"; - newName = top; + newName = contentdir; newName += "Resources"; cmSystemTools::RemoveFile(newName.c_str()); cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); @@ -150,7 +151,7 @@ void cmOSXBundleGenerator::CreateFramework(std::string const& targetName) this->MacContentFolders->end()) { oldName = "Versions/Current/Headers"; - newName = top; + newName = contentdir; newName += "Headers"; cmSystemTools::RemoveFile(newName.c_str()); cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); @@ -162,7 +163,7 @@ void cmOSXBundleGenerator::CreateFramework(std::string const& targetName) this->MacContentFolders->end()) { oldName = "Versions/Current/PrivateHeaders"; - newName = top; + newName = contentdir; newName += "PrivateHeaders"; cmSystemTools::RemoveFile(newName.c_str()); cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); @@ -171,27 +172,32 @@ void cmOSXBundleGenerator::CreateFramework(std::string const& targetName) } //---------------------------------------------------------------------------- -void cmOSXBundleGenerator::CreateCFBundle(std::string& targetName, +void cmOSXBundleGenerator::CreateCFBundle(const std::string& targetName, std::string& outpath) { if (this->MustSkip()) return; // Compute bundle directory names. - outpath = this->MacContentDirectory; - outpath += "MacOS"; - cmSystemTools::MakeDirectory(outpath.c_str()); - outpath += "/"; - this->Makefile->AddCMakeOutputFile(outpath.c_str()); + std::string out = outpath; + out += "/"; + out += this->Target->GetCFBundleDirectory(this->ConfigName, true); + std::string top = out; + out += "/MacOS"; + cmSystemTools::MakeDirectory(out.c_str()); + this->Makefile->AddCMakeOutputFile(out.c_str()); + + std::string newoutpath = out; // Configure the Info.plist file. Note that it needs the executable name // to be set. - std::string plist = this->MacContentDirectory; - plist += "Info.plist"; + std::string plist = top; + plist += "/Info.plist"; this->LocalGenerator->GenerateAppleInfoPList(this->Target, targetName.c_str(), plist.c_str()); this->Makefile->AddCMakeOutputFile(plist.c_str()); + outpath = newoutpath; } //---------------------------------------------------------------------------- @@ -220,7 +226,11 @@ std::string cmOSXBundleGenerator::InitMacOSXContentDirectory(const char* pkgloc) { // Construct the full path to the content subdirectory. - std::string macdir = this->MacContentDirectory; + + std::string macdir = + this->Target->GetMacContentDirectory(this->ConfigName, + /*implib*/ false); + macdir += "/"; macdir += pkgloc; cmSystemTools::MakeDirectory(macdir.c_str()); diff --git a/Source/cmOSXBundleGenerator.h b/Source/cmOSXBundleGenerator.h index 01e3cbe..6cf81d2 100644 --- a/Source/cmOSXBundleGenerator.h +++ b/Source/cmOSXBundleGenerator.h @@ -28,12 +28,19 @@ public: static void PrepareTargetProperties(cmTarget* target); cmOSXBundleGenerator(cmTarget* target, - std::string targetNameOut, const char* configName); - void CreateAppBundle(std::string& targetName, std::string& outpath); - void CreateFramework(std::string const& targetName); - void CreateCFBundle(std::string& targetName, std::string& outpath); + // create an app bundle at a given root, and return + // the directory within the bundle that contains the executable + void CreateAppBundle(const std::string& targetName, std::string& root); + + // create a framework at a given root + void CreateFramework(const std::string& targetName, + const std::string& root); + + // create a cf bundle at a given root and return the + // directory within the bundle that contains the library + void CreateCFBundle(const std::string& targetName, std::string& outpath); struct MacOSXContentGeneratorType { @@ -46,10 +53,6 @@ public: MacOSXContentGeneratorType* generator); std::string InitMacOSXContentDirectory(const char* pkgloc); - std::string GetMacContentDirectory() const - { return this->MacContentDirectory; } - std::string GetFrameworkVersion() const - { return this->FrameworkVersion; } void SetMacContentFolders(std::set* macContentFolders) { this->MacContentFolders = macContentFolders; } @@ -60,10 +63,7 @@ private: cmTarget* Target; cmMakefile* Makefile; cmLocalGenerator* LocalGenerator; - std::string TargetNameOut; const char* ConfigName; - std::string MacContentDirectory; - std::string FrameworkVersion; std::set* MacContentFolders; }; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 66c22b1..093b30e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1656,6 +1656,13 @@ bool cmTarget::IsCFBundleOnApple() } //---------------------------------------------------------------------------- +bool cmTarget::IsBundleOnApple() +{ + return this->IsFrameworkOnApple() || this->IsAppBundleOnApple() || + this->IsCFBundleOnApple(); +} + +//---------------------------------------------------------------------------- class cmTargetTraceDependencies { public: @@ -3264,17 +3271,23 @@ const char* cmTarget::NormalGetLocation(const char* config) // Now handle the deprecated build-time configuration location. this->Location = this->GetDirectory(); - if(!this->Location.empty()) - { - this->Location += "/"; - } const char* cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR"); if(cfgid && strcmp(cfgid, ".") != 0) { - this->Location += cfgid; this->Location += "/"; + this->Location += cfgid; + } + + if(this->IsCFBundleOnApple() || this->IsAppBundleOnApple()) + { + std::string macdir = this->BuildMacContentDirectory("", config, false); + if(!macdir.empty()) + { + this->Location += "/"; + this->Location += macdir; + } } - this->Location = this->BuildMacContentDirectory(this->Location, config); + this->Location += "/"; this->Location += this->GetFullName(config, false); return this->Location.c_str(); } @@ -3876,7 +3889,13 @@ std::string cmTarget::GetFullPath(const char* config, bool implib, std::string cmTarget::NormalGetFullPath(const char* config, bool implib, bool realname) { - std::string fpath = this->GetMacContentDirectory(config, implib); + std::string fpath = this->GetDirectory(config, implib); + fpath += "/"; + if(this->IsCFBundleOnApple() || this->IsAppBundleOnApple()) + { + fpath = this->BuildMacContentDirectory(fpath, config, false); + fpath += "/"; + } // Add the full name of the target. if(implib) @@ -4008,10 +4027,13 @@ void cmTarget::GetFullNameInternal(const char* config, targetSuffix = this->Makefile->GetSafeDefinition(suffixVar); } - // frameworks do not have a prefix or a suffix + // frameworks have directory prefix but no suffix + std::string fw_prefix; if(this->IsFrameworkOnApple()) { - targetPrefix = 0; + fw_prefix = this->GetOutputName(config, false); + fw_prefix += ".framework/"; + targetPrefix = fw_prefix.c_str(); targetSuffix = 0; } @@ -4091,13 +4113,24 @@ void cmTarget::GetLibraryNames(std::string& name, // The library name. name = prefix+base+suffix; - // The library's soname. - this->ComputeVersionedName(soName, prefix, base, suffix, - name, soversion); - - // The library's real name on disk. - this->ComputeVersionedName(realName, prefix, base, suffix, - name, version); + if(this->IsFrameworkOnApple()) + { + realName = prefix; + realName += "Versions/"; + realName += this->GetFrameworkVersion(); + realName += "/"; + realName += base; + soName = realName; + } + else + { + // The library's soname. + this->ComputeVersionedName(soName, prefix, base, suffix, + name, soversion); + // The library's real name on disk. + this->ComputeVersionedName(realName, prefix, base, suffix, + name, version); + } // The import library name. if(this->GetType() == cmTarget::SHARED_LIBRARY || @@ -4385,14 +4418,13 @@ bool cmTarget::NeedRelinkBeforeInstall(const char* config) } //---------------------------------------------------------------------------- -std::string cmTarget::GetInstallNameDirForBuildTree(const char* config, - bool for_xcode) +std::string cmTarget::GetInstallNameDirForBuildTree(const char* config) { // If building directly for installation then the build tree install_name // is the same as the install tree. if(this->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH")) { - return GetInstallNameDirForInstallTree(config, for_xcode); + return GetInstallNameDirForInstallTree(); } // Use the build tree directory for the target. @@ -4402,10 +4434,6 @@ std::string cmTarget::GetInstallNameDirForBuildTree(const char* config, { std::string dir = this->GetDirectory(config); dir += "/"; - if(this->IsFrameworkOnApple() && !for_xcode) - { - dir += this->GetFrameworkDirectory(config); - } return dir; } else @@ -4415,8 +4443,7 @@ std::string cmTarget::GetInstallNameDirForBuildTree(const char* config, } //---------------------------------------------------------------------------- -std::string cmTarget::GetInstallNameDirForInstallTree(const char* config, - bool for_xcode) +std::string cmTarget::GetInstallNameDirForInstallTree() { if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) { @@ -4432,12 +4459,6 @@ std::string cmTarget::GetInstallNameDirForInstallTree(const char* config, dir += "/"; } } - - if(this->IsFrameworkOnApple() && !for_xcode) - { - dir += this->GetFrameworkDirectory(config); - } - return dir; } else @@ -5896,59 +5917,86 @@ cmTarget::GetLinkInformation(const char* config, cmTarget *head) } //---------------------------------------------------------------------------- -std::string cmTarget::GetFrameworkDirectory(const char* config) +std::string cmTarget::GetFrameworkDirectory(const char* config, + bool rootDir) { std::string fpath; - fpath += this->GetFullName(config, false); - fpath += ".framework/Versions/"; - fpath += this->GetFrameworkVersion(); - fpath += "/"; + fpath += this->GetOutputName(config, false); + fpath += ".framework"; + if(!rootDir) + { + fpath += "/Versions/"; + fpath += this->GetFrameworkVersion(); + } + return fpath; +} + +//---------------------------------------------------------------------------- +std::string cmTarget::GetCFBundleDirectory(const char* config, + bool contentOnly) +{ + std::string fpath; + fpath += this->GetOutputName(config, false); + fpath += "."; + const char *ext = this->GetProperty("BUNDLE_EXTENSION"); + if (!ext) + { + ext = "bundle"; + } + fpath += ext; + fpath += "/Contents"; + if(!contentOnly) + fpath += "/MacOS"; + return fpath; +} + +//---------------------------------------------------------------------------- +std::string cmTarget::GetAppBundleDirectory(const char* config, + bool contentOnly) +{ + std::string fpath = this->GetFullName(config, false); + fpath += ".app/Contents"; + if(!contentOnly) + fpath += "/MacOS"; return fpath; } //---------------------------------------------------------------------------- std::string cmTarget::BuildMacContentDirectory(const std::string& base, const char* config, - bool includeMacOS) + bool contentOnly) { std::string fpath = base; if(this->IsAppBundleOnApple()) { - fpath += this->GetFullName(config, false); - fpath += ".app/Contents/"; - if(includeMacOS) - fpath += "MacOS/"; + fpath += this->GetAppBundleDirectory(config, contentOnly); } if(this->IsFrameworkOnApple()) { - fpath += this->GetFrameworkDirectory(config); + fpath += this->GetFrameworkDirectory(config, contentOnly); } if(this->IsCFBundleOnApple()) { - fpath += this->GetFullName(config, false); - fpath += "."; - const char *ext = this->GetProperty("BUNDLE_EXTENSION"); - if (!ext) - { - ext = "bundle"; - } - fpath += ext; - fpath += "/Contents/"; - if(includeMacOS) - fpath += "MacOS/"; + fpath += this->GetCFBundleDirectory(config, contentOnly); } return fpath; } //---------------------------------------------------------------------------- std::string cmTarget::GetMacContentDirectory(const char* config, - bool implib, - bool includeMacOS) + bool implib) { // Start with the output directory for the target. std::string fpath = this->GetDirectory(config, implib); fpath += "/"; - fpath = this->BuildMacContentDirectory(fpath, config, includeMacOS); + bool contentOnly = true; + if(this->IsFrameworkOnApple()) + { + // additional files with a framework go into the version specific + // directory + contentOnly = false; + } + fpath = this->BuildMacContentDirectory(fpath, config, contentOnly); return fpath; } diff --git a/Source/cmTarget.h b/Source/cmTarget.h index e25133e..4264e76 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -407,10 +407,8 @@ public: /** Return true if builtin chrpath will work for this target */ bool IsChrpathUsed(const char* config); - std::string GetInstallNameDirForBuildTree(const char* config, - bool for_xcode = false); - std::string GetInstallNameDirForInstallTree(const char* config, - bool for_xcode = false); + std::string GetInstallNameDirForBuildTree(const char* config); + std::string GetInstallNameDirForInstallTree(); cmComputeLinkInformation* GetLinkInformation(const char* config, cmTarget *head = 0); @@ -462,6 +460,10 @@ public: /** Return whether this target is an executable Bundle on Apple. */ bool IsAppBundleOnApple(); + /** Return whether this target is an executable Bundle, a framework + or CFBundle on Apple. */ + bool IsBundleOnApple(); + /** Return the framework version string. Undefined if IsFrameworkOnApple returns false. */ std::string GetFrameworkVersion(); @@ -476,21 +478,21 @@ public: directory. */ bool UsesDefaultOutputDir(const char* config, bool implib); - /** Append to @a base the mac content directory and return it. */ - std::string BuildMacContentDirectory(const std::string& base, - const char* config = 0, - bool includeMacOS = true); - /** @return the mac content directory for this target. */ - std::string GetMacContentDirectory(const char* config = 0, - bool implib = false, - bool includeMacOS = true); + std::string GetMacContentDirectory(const char* config, + bool implib); /** @return whether this target have a well defined output file name. */ bool HaveWellDefinedOutputFiles(); /** @return the Mac framework directory without the base. */ - std::string GetFrameworkDirectory(const char* config = 0); + std::string GetFrameworkDirectory(const char* config, bool rootDir); + + /** @return the Mac CFBundle directory without the base */ + std::string GetCFBundleDirectory(const char* config, bool contentOnly); + + /** @return the Mac App directory without the base */ + std::string GetAppBundleDirectory(const char* config, bool contentOnly); std::vector GetIncludeDirectories(const char *config); void InsertInclude(const cmValueWithOrigin &entry, @@ -597,6 +599,11 @@ private: the same as GetFullName. */ std::string NormalGetRealName(const char* config); + /** Append to @a base the mac content directory and return it. */ + std::string BuildMacContentDirectory(const std::string& base, + const char* config, + bool contentOnly); + private: std::string Name; std::vector PreBuildCommands; diff --git a/Tests/BundleUtilities/CMakeLists.txt b/Tests/BundleUtilities/CMakeLists.txt index 8f24afe..5cc7071 100644 --- a/Tests/BundleUtilities/CMakeLists.txt +++ b/Tests/BundleUtilities/CMakeLists.txt @@ -12,8 +12,7 @@ add_library(shared2 SHARED shared2.cpp shared2.h) # a framework library add_library(framework SHARED framework.cpp framework.h) -# TODO: fix problems with local frameworks without rpaths -#set_target_properties(framework PROPERTIES FRAMEWORK 1) +set_target_properties(framework PROPERTIES FRAMEWORK 1) # make sure rpaths are not helping BundleUtilities or the executables set_target_properties(shared shared2 framework PROPERTIES -- cgit v0.12 From 7ffef5024aa92a9802785c2e02abfd13249e6160 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 14 Mar 2013 16:37:49 +0100 Subject: GenerateExportHeader: Allow use of of this macro with MODULEs. The significant issue with MODULEs is that on Windows, the exported symbols must be dllexported and they are not imported. In other export macro implementations this is done by defining an export macro outside of any ifdef which depends on definitions set on the command line. However, with cmake we already expect the DEFINE_SYMBOL to be defined, so the regular EXPORT macro can be used by such plugins. --- Modules/GenerateExportHeader.cmake | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake index 892ebc6..80475a8 100644 --- a/Modules/GenerateExportHeader.cmake +++ b/Modules/GenerateExportHeader.cmake @@ -307,11 +307,9 @@ endmacro() function(GENERATE_EXPORT_HEADER TARGET_LIBRARY) get_property(type TARGET ${TARGET_LIBRARY} PROPERTY TYPE) - if(${type} STREQUAL "MODULE") - message(WARNING "This macro should not be used with libraries of type MODULE") - return() - endif() - if(NOT ${type} STREQUAL "STATIC_LIBRARY" AND NOT ${type} STREQUAL "SHARED_LIBRARY") + if(NOT ${type} STREQUAL "STATIC_LIBRARY" + AND NOT ${type} STREQUAL "SHARED_LIBRARY" + AND NOT ${type} STREQUAL "MODULE_LIBRARY") message(WARNING "This macro can only be used with libraries") return() endif() -- cgit v0.12 From 3cc5d3883e295f231ed449721c43699fbd205a0b Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Fri, 24 May 2013 00:01:04 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index dd0a14e..f12d928 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130523) +set(CMake_VERSION_TWEAK 20130524) #set(CMake_VERSION_RC 1) -- cgit v0.12 From b983a58bdf1a03a49f2512ac68390888669ac30b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 2 Jan 2013 17:10:04 +0100 Subject: file: Add GENERATE command to produce files at generate time The idea is to write to a temp file which contains generator expressions, and at generate time, evaluate the generator expressions, and write the result to a file. Because executables on Windows are limited in the length of command line it is possible to use, it is common to write command line arguments to a file instead and specify the file as a source of arguments. This new FILE(GENERATE) subcommand allows the use of generator expressions to create such files so that they can be used with add_custom_command for example. --- Source/cmBootstrapCommands.cxx | 1 + Source/cmFileCommand.cxx | 78 +++++++++++ Source/cmFileCommand.h | 19 +++ Source/cmGeneratorExpressionEvaluationFile.cxx | 151 +++++++++++++++++++++ Source/cmGeneratorExpressionEvaluationFile.h | 48 +++++++ Source/cmGlobalGenerator.cxx | 51 +++++++ Source/cmGlobalGenerator.h | 11 ++ Tests/RunCMake/CMakeLists.txt | 2 + .../RunCMake/File_Generate/BadCondition-result.txt | 1 + .../RunCMake/File_Generate/BadCondition-stderr.txt | 3 + Tests/RunCMake/File_Generate/BadCondition.cmake | 5 + Tests/RunCMake/File_Generate/CMakeLists.txt | 3 + .../File_Generate/CommandConflict-result.txt | 1 + .../File_Generate/CommandConflict-stderr.txt | 1 + Tests/RunCMake/File_Generate/CommandConflict.cmake | 9 ++ Tests/RunCMake/File_Generate/DebugEvaluate.cmake | 5 + .../File_Generate/EmptyCondition1-result.txt | 1 + .../File_Generate/EmptyCondition1-stderr.txt | 4 + Tests/RunCMake/File_Generate/EmptyCondition1.cmake | 5 + .../File_Generate/EmptyCondition2-result.txt | 1 + .../File_Generate/EmptyCondition2-stderr.txt | 4 + Tests/RunCMake/File_Generate/EmptyCondition2.cmake | 5 + .../File_Generate/OutputConflict-result.txt | 1 + .../File_Generate/OutputConflict-stderr.txt | 5 + Tests/RunCMake/File_Generate/OutputConflict.cmake | 4 + Tests/RunCMake/File_Generate/RunCMakeTest.cmake | 10 ++ Tests/RunCMake/File_Generate/input.txt | 1 + 27 files changed, 430 insertions(+) create mode 100644 Source/cmGeneratorExpressionEvaluationFile.cxx create mode 100644 Source/cmGeneratorExpressionEvaluationFile.h create mode 100644 Tests/RunCMake/File_Generate/BadCondition-result.txt create mode 100644 Tests/RunCMake/File_Generate/BadCondition-stderr.txt create mode 100644 Tests/RunCMake/File_Generate/BadCondition.cmake create mode 100644 Tests/RunCMake/File_Generate/CMakeLists.txt create mode 100644 Tests/RunCMake/File_Generate/CommandConflict-result.txt create mode 100644 Tests/RunCMake/File_Generate/CommandConflict-stderr.txt create mode 100644 Tests/RunCMake/File_Generate/CommandConflict.cmake create mode 100644 Tests/RunCMake/File_Generate/DebugEvaluate.cmake create mode 100644 Tests/RunCMake/File_Generate/EmptyCondition1-result.txt create mode 100644 Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt create mode 100644 Tests/RunCMake/File_Generate/EmptyCondition1.cmake create mode 100644 Tests/RunCMake/File_Generate/EmptyCondition2-result.txt create mode 100644 Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt create mode 100644 Tests/RunCMake/File_Generate/EmptyCondition2.cmake create mode 100644 Tests/RunCMake/File_Generate/OutputConflict-result.txt create mode 100644 Tests/RunCMake/File_Generate/OutputConflict-stderr.txt create mode 100644 Tests/RunCMake/File_Generate/OutputConflict.cmake create mode 100644 Tests/RunCMake/File_Generate/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/File_Generate/input.txt diff --git a/Source/cmBootstrapCommands.cxx b/Source/cmBootstrapCommands.cxx index e3a2ad4..1b7a751 100644 --- a/Source/cmBootstrapCommands.cxx +++ b/Source/cmBootstrapCommands.cxx @@ -52,6 +52,7 @@ #include "cmFindProgramCommand.cxx" #include "cmForEachCommand.cxx" #include "cmFunctionCommand.cxx" +#include "cmGeneratorExpressionEvaluationFile.cxx" #include "cmGetCMakePropertyCommand.cxx" #include "cmGetDirectoryPropertyCommand.cxx" #include "cmGetFilenameComponentCommand.cxx" diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 018ce7e..c51a72a 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -167,6 +167,10 @@ bool cmFileCommand { return this->HandleTimestampCommand(args); } + else if ( subCommand == "GENERATE" ) + { + return this->HandleGenerateCommand(args); + } std::string e = "does not recognize sub-command "+subCommand; this->SetError(e.c_str()); @@ -3250,6 +3254,80 @@ cmFileCommand::HandleUploadCommand(std::vector const& args) } //---------------------------------------------------------------------------- +void cmFileCommand::AddEvaluationFile(const std::string &inputName, + const std::string &outputExpr, + const std::string &condition, + bool inputIsContent + ) +{ + cmListFileBacktrace lfbt; + this->Makefile->GetBacktrace(lfbt); + + cmGeneratorExpression outputGe(lfbt); + cmsys::auto_ptr outputCge + = outputGe.Parse(outputExpr); + + cmGeneratorExpression conditionGe(lfbt); + cmsys::auto_ptr conditionCge + = conditionGe.Parse(condition); + + this->Makefile->GetLocalGenerator() + ->GetGlobalGenerator()->AddEvaluationFile(inputName, + outputCge, + this->Makefile, + conditionCge, + inputIsContent); +} + +//---------------------------------------------------------------------------- +bool cmFileCommand::HandleGenerateCommand( + std::vector const& args) +{ + if (args.size() < 5) + { + this->SetError("Incorrect arguments to GENERATE subcommand."); + return false; + } + if (args[1] != "OUTPUT") + { + this->SetError("Incorrect arguments to GENERATE subcommand."); + return false; + } + std::string condition; + if (args.size() > 5) + { + if (args[5] != "CONDITION") + { + this->SetError("Incorrect arguments to GENERATE subcommand."); + return false; + } + if (args.size() != 7) + { + this->SetError("Incorrect arguments to GENERATE subcommand."); + return false; + } + condition = args[6]; + if (condition.empty()) + { + this->SetError("CONDITION of sub-command GENERATE must not be empty if " + "specified."); + return false; + } + } + std::string output = args[2]; + const bool inputIsContent = args[3] != "INPUT"; + if (inputIsContent && args[3] != "CONTENT") + { + this->SetError("Incorrect arguments to GENERATE subcommand."); + return false; + } + std::string input = args[4]; + + this->AddEvaluationFile(input, output, condition, inputIsContent); + return true; +} + +//---------------------------------------------------------------------------- bool cmFileCommand::HandleTimestampCommand( std::vector const& args) { diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index 5973fa7..586fee2 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -88,6 +88,9 @@ public: " file(UPLOAD filename url [INACTIVITY_TIMEOUT timeout]\n" " [TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS])\n" " file(TIMESTAMP filename variable [] [UTC])\n" + " file(GENERATE OUTPUT output_file\n" + " \n" + " CONDITION expression)\n" "WRITE will write a message into a file called 'filename'. It " "overwrites the file if it already exists, and creates the file " "if it does not exist. (If the file is a build input, use " @@ -231,6 +234,15 @@ public: "it prints status messages, and NO_SOURCE_PERMISSIONS is default. " "Installation scripts generated by the install() command use this " "signature (with some undocumented options for internal use)." + "\n" + "GENERATE will write an with content from an " + ", or from . The output is generated " + "conditionally based on the content of the . The file is " + "written at CMake generate-time and the input may contain generator " + "expressions. The , and may " + "also contain generator expressions. The must evaluate to " + "either '0' or '1'. The must evaluate to a unique name " + "among all configurations and among all invocations of file(GENERATE)." // Undocumented INSTALL options: // - RENAME // - OPTIONAL @@ -269,6 +281,13 @@ protected: bool HandleUploadCommand(std::vector const& args); bool HandleTimestampCommand(std::vector const& args); + bool HandleGenerateCommand(std::vector const& args); + +private: + void AddEvaluationFile(const std::string &inputName, + const std::string &outputExpr, + const std::string &condition, + bool inputIsContent); }; diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx new file mode 100644 index 0000000..cab99ed --- /dev/null +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -0,0 +1,151 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2013 Stephen Kelly + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ + +#include "cmGeneratorExpressionEvaluationFile.h" + +#include "cmMakefile.h" + +#include + +//---------------------------------------------------------------------------- +cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile( + const std::string &input, + cmsys::auto_ptr outputFileExpr, + cmMakefile *makefile, + cmsys::auto_ptr condition, + bool inputIsContent) + : Input(input), + OutputFileExpr(outputFileExpr), + Makefile(makefile), + Condition(condition), + InputIsContent(inputIsContent) +{ +} + +//---------------------------------------------------------------------------- +void cmGeneratorExpressionEvaluationFile::Generate(const char *config, + cmCompiledGeneratorExpression* inputExpression, + std::map &outputFiles) +{ + std::string rawCondition = this->Condition->GetInput(); + if (!rawCondition.empty()) + { + std::string condResult = this->Condition->Evaluate(this->Makefile, config); + if (condResult == "0") + { + return; + } + if (condResult != "1") + { + cmOStringStream e; + e << "Evaluation file condition \"" << rawCondition << "\" did " + "not evaluate to valid content. Got \"" << condResult << "\"."; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); + return; + } + } + + const std::string outputFileName + = this->OutputFileExpr->Evaluate(this->Makefile, config); + const std::string outputContent + = inputExpression->Evaluate(this->Makefile, config); + + std::map::iterator it + = outputFiles.find(outputFileName); + + if(it != outputFiles.end()) + { + if (it->second == outputContent) + { + return; + } + cmOStringStream e; + e << "Evaluation file to be written multiple times for different " + "configurations with different content:\n " << outputFileName; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); + return; + } + + this->Files.push_back(outputFileName); + outputFiles[outputFileName] = outputContent; + + std::ofstream fout(outputFileName.c_str()); + + if(!fout) + { + cmOStringStream e; + e << "Evaluation file \"" << outputFileName << "\" cannot be written."; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); + return; + } + + fout << outputContent; + + fout.close(); +} + +//---------------------------------------------------------------------------- +void cmGeneratorExpressionEvaluationFile::Generate() +{ + std::string inputContent; + if (this->InputIsContent) + { + inputContent = this->Input; + } + else + { + std::ifstream fin(this->Input.c_str()); + if(!fin) + { + cmOStringStream e; + e << "Evaluation file \"" << this->Input << "\" cannot be read."; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); + return; + } + + std::string line; + std::string sep; + while(cmSystemTools::GetLineFromStream(fin, line)) + { + inputContent += sep + line; + sep = "\n"; + } + inputContent += sep; + } + + cmListFileBacktrace lfbt = this->OutputFileExpr->GetBacktrace(); + cmGeneratorExpression contentGE(lfbt); + cmsys::auto_ptr inputExpression + = contentGE.Parse(inputContent); + + std::map outputFiles; + + std::vector allConfigs; + this->Makefile->GetConfigurations(allConfigs); + + if (allConfigs.empty()) + { + this->Generate(0, inputExpression.get(), outputFiles); + } + else + { + for(std::vector::const_iterator li = allConfigs.begin(); + li != allConfigs.end(); ++li) + { + this->Generate(li->c_str(), inputExpression.get(), outputFiles); + if(cmSystemTools::GetFatalErrorOccured()) + { + return; + } + } + } +} diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h new file mode 100644 index 0000000..20ee5cb --- /dev/null +++ b/Source/cmGeneratorExpressionEvaluationFile.h @@ -0,0 +1,48 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2013 Stephen Kelly + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#ifndef cmGeneratorExpressionEvaluationFile_h +#define cmGeneratorExpressionEvaluationFile_h + +#include "cmStandardIncludes.h" +#include + +#include "cmGeneratorExpression.h" + +//---------------------------------------------------------------------------- +class cmGeneratorExpressionEvaluationFile +{ +public: + cmGeneratorExpressionEvaluationFile(const std::string &input, + cmsys::auto_ptr outputFileExpr, + cmMakefile *makefile, + cmsys::auto_ptr condition, + bool inputIsContent); + + void Generate(); + + std::vector GetFiles() const { return this->Files; } + +private: + void Generate(const char *config, + cmCompiledGeneratorExpression* inputExpression, + std::map &outputFiles); + +private: + const std::string Input; + const cmsys::auto_ptr OutputFileExpr; + cmMakefile *Makefile; + const cmsys::auto_ptr Condition; + std::vector Files; + const bool InputIsContent; +}; + +#endif diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index df14331..f6cdeba 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -26,6 +26,7 @@ #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGeneratorExpression.h" +#include "cmGeneratorExpressionEvaluationFile.h" #include @@ -69,6 +70,13 @@ cmGlobalGenerator::~cmGlobalGenerator() { delete this->LocalGenerators[i]; } + for(std::vector::const_iterator + li = this->EvaluationFiles.begin(); + li != this->EvaluationFiles.end(); + ++li) + { + delete *li; + } this->LocalGenerators.clear(); if (this->ExtraGenerator) @@ -981,6 +989,8 @@ void cmGlobalGenerator::Generate() // Create per-target generator information. this->CreateGeneratorTargets(); + this->ProcessEvaluationFiles(); + // Compute the inter-target dependencies. if(!this->ComputeTargetDepends()) { @@ -2558,3 +2568,44 @@ std::string cmGlobalGenerator::EscapeJSON(const std::string& s) { } return result; } + +//---------------------------------------------------------------------------- +void cmGlobalGenerator::AddEvaluationFile(const std::string &inputFile, + cmsys::auto_ptr outputExpr, + cmMakefile *makefile, + cmsys::auto_ptr condition, + bool inputIsContent) +{ + this->EvaluationFiles.push_back( + new cmGeneratorExpressionEvaluationFile(inputFile, outputExpr, + makefile, condition, + inputIsContent)); +} + +//---------------------------------------------------------------------------- +void cmGlobalGenerator::ProcessEvaluationFiles() +{ + std::set generatedFiles; + for(std::vector::const_iterator + li = this->EvaluationFiles.begin(); + li != this->EvaluationFiles.end(); + ++li) + { + (*li)->Generate(); + if (cmSystemTools::GetFatalErrorOccured()) + { + return; + } + std::vector files = (*li)->GetFiles(); + for(std::vector::const_iterator fi = files.begin(); + fi != files.end(); ++fi) + { + if (!generatedFiles.insert(*fi).second) + { + cmSystemTools::Error("File to be generated by multiple different " + "commands: ", fi->c_str()); + return; + } + } + } +} diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 11616e0..381918b 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -20,9 +20,11 @@ #include "cmSystemTools.h" // for cmSystemTools::OutputOption #include "cmExportSetMap.h" // For cmExportSetMap #include "cmGeneratorTarget.h" +#include "cmGeneratorExpression.h" class cmake; class cmGeneratorTarget; +class cmGeneratorExpressionEvaluationFile; class cmMakefile; class cmLocalGenerator; class cmExternalMakefileProjectGenerator; @@ -278,6 +280,14 @@ public: static std::string EscapeJSON(const std::string& s); + void AddEvaluationFile(const std::string &inputFile, + cmsys::auto_ptr outputName, + cmMakefile *makefile, + cmsys::auto_ptr condition, + bool inputIsContent); + + void ProcessEvaluationFiles(); + protected: typedef std::vector GeneratorVector; // for a project collect all its targets by following depend @@ -337,6 +347,7 @@ protected: // All targets in the entire project. std::map TotalTargets; std::map ImportedTargets; + std::vector EvaluationFiles; virtual const char* GetPredefinedTargetsFolder(); virtual bool UseFolderProperty(); diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 402c8a9..53bb8d8 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -86,3 +86,5 @@ if("${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [^6]") add_RunCMake_test(include_external_msproject) add_RunCMake_test(SolutionGlobalSections) endif() + +add_RunCMake_test(File_Generate) diff --git a/Tests/RunCMake/File_Generate/BadCondition-result.txt b/Tests/RunCMake/File_Generate/BadCondition-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/File_Generate/BadCondition-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Generate/BadCondition-stderr.txt b/Tests/RunCMake/File_Generate/BadCondition-stderr.txt new file mode 100644 index 0000000..bab8368 --- /dev/null +++ b/Tests/RunCMake/File_Generate/BadCondition-stderr.txt @@ -0,0 +1,3 @@ +CMake Error in CMakeLists.txt: + Evaluation file condition \"\$<1:Bad>\" did not evaluate to valid content. + Got \"Bad\". diff --git a/Tests/RunCMake/File_Generate/BadCondition.cmake b/Tests/RunCMake/File_Generate/BadCondition.cmake new file mode 100644 index 0000000..82ad672 --- /dev/null +++ b/Tests/RunCMake/File_Generate/BadCondition.cmake @@ -0,0 +1,5 @@ + +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" + CONDITION $<1:Bad> +) diff --git a/Tests/RunCMake/File_Generate/CMakeLists.txt b/Tests/RunCMake/File_Generate/CMakeLists.txt new file mode 100644 index 0000000..e8db6b0 --- /dev/null +++ b/Tests/RunCMake/File_Generate/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/File_Generate/CommandConflict-result.txt b/Tests/RunCMake/File_Generate/CommandConflict-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/File_Generate/CommandConflict-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Generate/CommandConflict-stderr.txt b/Tests/RunCMake/File_Generate/CommandConflict-stderr.txt new file mode 100644 index 0000000..da97ba4 --- /dev/null +++ b/Tests/RunCMake/File_Generate/CommandConflict-stderr.txt @@ -0,0 +1 @@ +CMake Error: File to be generated by multiple different commands: .*CommandConflict-build/output_.*.txt diff --git a/Tests/RunCMake/File_Generate/CommandConflict.cmake b/Tests/RunCMake/File_Generate/CommandConflict.cmake new file mode 100644 index 0000000..d57bc12 --- /dev/null +++ b/Tests/RunCMake/File_Generate/CommandConflict.cmake @@ -0,0 +1,9 @@ + +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output_$.txt" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" + CONDITION $> +) +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output_$.txt" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" + CONDITION $> +) diff --git a/Tests/RunCMake/File_Generate/DebugEvaluate.cmake b/Tests/RunCMake/File_Generate/DebugEvaluate.cmake new file mode 100644 index 0000000..1fa9b62 --- /dev/null +++ b/Tests/RunCMake/File_Generate/DebugEvaluate.cmake @@ -0,0 +1,5 @@ + +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" + CONDITION $ +) diff --git a/Tests/RunCMake/File_Generate/EmptyCondition1-result.txt b/Tests/RunCMake/File_Generate/EmptyCondition1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/File_Generate/EmptyCondition1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt b/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt new file mode 100644 index 0000000..9fe39cc --- /dev/null +++ b/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at EmptyCondition1.cmake:2 \(file\): + file Incorrect arguments to GENERATE subcommand. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/File_Generate/EmptyCondition1.cmake b/Tests/RunCMake/File_Generate/EmptyCondition1.cmake new file mode 100644 index 0000000..8574a5f --- /dev/null +++ b/Tests/RunCMake/File_Generate/EmptyCondition1.cmake @@ -0,0 +1,5 @@ + +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" + CONDITION +) diff --git a/Tests/RunCMake/File_Generate/EmptyCondition2-result.txt b/Tests/RunCMake/File_Generate/EmptyCondition2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/File_Generate/EmptyCondition2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt b/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt new file mode 100644 index 0000000..73d5f25 --- /dev/null +++ b/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at EmptyCondition2.cmake:2 \(file\): + file CONDITION of sub-command GENERATE must not be empty if specified. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/File_Generate/EmptyCondition2.cmake b/Tests/RunCMake/File_Generate/EmptyCondition2.cmake new file mode 100644 index 0000000..626bfb4 --- /dev/null +++ b/Tests/RunCMake/File_Generate/EmptyCondition2.cmake @@ -0,0 +1,5 @@ + +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" + CONDITION "" +) diff --git a/Tests/RunCMake/File_Generate/OutputConflict-result.txt b/Tests/RunCMake/File_Generate/OutputConflict-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/File_Generate/OutputConflict-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt b/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt new file mode 100644 index 0000000..dbd39de --- /dev/null +++ b/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt @@ -0,0 +1,5 @@ +CMake Error in CMakeLists.txt: + Evaluation file to be written multiple times for different configurations + with different content: + + .*output.txt diff --git a/Tests/RunCMake/File_Generate/OutputConflict.cmake b/Tests/RunCMake/File_Generate/OutputConflict.cmake new file mode 100644 index 0000000..7f3e8c7 --- /dev/null +++ b/Tests/RunCMake/File_Generate/OutputConflict.cmake @@ -0,0 +1,4 @@ + +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" +) diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake new file mode 100644 index 0000000..f07431c --- /dev/null +++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake @@ -0,0 +1,10 @@ +include(RunCMake) + +run_cmake(CommandConflict) +if("${RunCMake_GENERATOR}" MATCHES "Visual Studio" OR "${RunCMake_GENERATOR}" MATCHES "XCode" ) + run_cmake(OutputConflict) +endif() +run_cmake(EmptyCondition1) +run_cmake(EmptyCondition2) +run_cmake(BadCondition) +run_cmake(DebugEvaluate) diff --git a/Tests/RunCMake/File_Generate/input.txt b/Tests/RunCMake/File_Generate/input.txt new file mode 100644 index 0000000..3db429d --- /dev/null +++ b/Tests/RunCMake/File_Generate/input.txt @@ -0,0 +1 @@ +Some $<$:conflicting> $<$>:content> -- cgit v0.12 From 74f24b28423751bd775b66e13078db2fa71a932d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 16 Jul 2012 10:05:22 +0200 Subject: Tests/Module/GenerateExportHeader: Test exported free-function --- Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt b/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt index a5804fc..2a97d8f 100644 --- a/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt +++ b/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt @@ -8,6 +8,7 @@ macro(shared_build_fail Source Message) endmacro() shared_build_pass("Libshared l; return l.libshared_exported();" "Failed to build exported") +shared_build_pass("return libshared_exported();" "Failed to build exported function.") # if (COMPILER_HAS_DEPRECATED) # shared_build_fail("Libshared l; return l.libshared_deprecated();" "Built use of deprecated class method. This should not be possible.") -- cgit v0.12 From 32410140a7c592090249db772fd5f18c7808a3aa Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 16 May 2013 15:52:25 +0200 Subject: Add $ generator expression They can't be used when evaluating link libraries, but they can be used for include directories and compile definitions. Later they can be used for compile options. --- Source/cmDocumentGeneratorExpressions.h | 8 +++ Source/cmGeneratorExpressionEvaluator.cxx | 72 ++++++++++++++++++++-- Source/cmTarget.cxx | 10 ++- Source/cmTargetCompileDefinitionsCommand.h | 1 + Source/cmTargetIncludeDirectoriesCommand.h | 1 + Tests/CompileDefinitions/compiletest.c | 19 ++++++ Tests/CompileDefinitions/compiletest.cpp | 15 +++++ Tests/CompileDefinitions/compiletest_mixed_c.c | 19 ++++++ Tests/CompileDefinitions/compiletest_mixed_cxx.cpp | 19 ++++++ .../CompileDefinitions/target_prop/CMakeLists.txt | 20 ++++++ .../TargetIncludeDirectories/CMakeLists.txt | 16 +++++ .../TargetIncludeDirectories/main.c | 7 +++ .../TargetIncludeDirectories/main.cpp | 1 + 13 files changed, 200 insertions(+), 8 deletions(-) create mode 100644 Tests/CompileDefinitions/compiletest.c create mode 100644 Tests/CompileDefinitions/compiletest_mixed_c.c create mode 100644 Tests/CompileDefinitions/compiletest_mixed_cxx.cpp create mode 100644 Tests/IncludeDirectories/TargetIncludeDirectories/main.c diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h index ac52db0..93e9cec 100644 --- a/Source/cmDocumentGeneratorExpressions.h +++ b/Source/cmDocumentGeneratorExpressions.h @@ -74,4 +74,12 @@ "the target on which the generator expression is evaluated.\n" \ "" +#define CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS \ + "Language related expressions:\n" \ + " $ = The link language of the target " \ + "being generated.\n" \ + " $ = '1' if the link language of the " \ + "target being generated matches lang, else '0'.\n" \ + "" + #endif diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 6092aa2..7870d37 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -45,6 +45,11 @@ void reportError(cmGeneratorExpressionContext *context, //---------------------------------------------------------------------------- struct cmGeneratorExpressionNode { + enum { + DynamicParameters = 0, + OneOrMoreParameters = -1, + ZeroOrMoreParameters = -2 + }; virtual ~cmGeneratorExpressionNode() {} virtual bool GeneratesContent() const { return true; } @@ -110,8 +115,7 @@ static const struct ZeroNode installInterfaceNode; static const struct OP ## Node : public cmGeneratorExpressionNode \ { \ OP ## Node () {} \ -/* We let -1 carry the meaning 'at least one' */ \ - virtual int NumExpectedParameters() const { return -1; } \ + virtual int NumExpectedParameters() const { return OneOrMoreParameters; } \ \ std::string Evaluate(const std::vector ¶meters, \ cmGeneratorExpressionContext *context, \ @@ -306,6 +310,60 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode } } configurationTestNode; +//---------------------------------------------------------------------------- +static const struct LinkLanguageNode : public cmGeneratorExpressionNode +{ + LinkLanguageNode() {} + + virtual int NumExpectedParameters() const { return ZeroOrMoreParameters; } + + std::string Evaluate(const std::vector ¶meters, + cmGeneratorExpressionContext *context, + const GeneratorExpressionContent *content, + cmGeneratorExpressionDAGChecker *) const + { + if (parameters.size() != 0 && parameters.size() != 1) + { + reportError(context, content->GetOriginalExpression(), + "$ expression requires one or two parameters"); + return std::string(); + } + cmTarget* target = context->HeadTarget; + if (!target) + { + reportError(context, content->GetOriginalExpression(), + "$ may only be used with targets. It may not " + "be used with add_custom_command."); + } + + const char *lang = target->GetLinkerLanguage(context->Config); + if (parameters.size() == 0) + { + return lang ? lang : ""; + } + else + { + cmsys::RegularExpression langValidator; + langValidator.compile("^[A-Za-z0-9_]*$"); + if (!langValidator.find(parameters.begin()->c_str())) + { + reportError(context, content->GetOriginalExpression(), + "Expression syntax not recognized."); + return std::string(); + } + if (!lang) + { + return parameters.front().empty() ? "1" : "0"; + } + + if (strcmp(parameters.begin()->c_str(), lang) == 0) + { + return "1"; + } + return "0"; + } + } +} linkLanguageNode; static const struct JoinNode : public cmGeneratorExpressionNode { @@ -347,7 +405,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode TargetPropertyNode() {} // This node handles errors on parameter count itself. - virtual int NumExpectedParameters() const { return -1; } + virtual int NumExpectedParameters() const { return OneOrMoreParameters; } std::string Evaluate(const std::vector ¶meters, cmGeneratorExpressionContext *context, @@ -961,6 +1019,8 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier) return &configurationNode; else if (identifier == "CONFIG") return &configurationTestNode; + else if (identifier == "LINK_LANGUAGE") + return &linkLanguageNode; else if (identifier == "TARGET_FILE") return &targetFileNode; else if (identifier == "TARGET_LINKER_FILE") @@ -1188,7 +1248,8 @@ std::string GeneratorExpressionContent::EvaluateParameters( } } - if ((numExpected != -1 && (unsigned int)numExpected != parameters.size())) + if ((numExpected > cmGeneratorExpressionNode::DynamicParameters + && (unsigned int)numExpected != parameters.size())) { if (numExpected == 0) { @@ -1213,7 +1274,8 @@ std::string GeneratorExpressionContent::EvaluateParameters( return std::string(); } - if (numExpected == -1 && parameters.empty()) + if (numExpected == cmGeneratorExpressionNode::OneOrMoreParameters + && parameters.empty()) { reportError(context, this->GetOriginalExpression(), "$<" + identifier + "> expression requires at least one parameter."); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index d14bfca..865a4da 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -277,6 +277,7 @@ void cmTarget::DefineProperties(cmake *cm) "Contents of COMPILE_DEFINITIONS may use \"generator expressions\" with " "the syntax \"$<...>\". " CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS + CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS CM_DOCUMENT_COMPILE_DEFINITIONS_DISCLAIMER); cm->DefineProperty @@ -605,7 +606,8 @@ void cmTarget::DefineProperties(cmake *cm) "See also the include_directories command.\n" "Contents of INCLUDE_DIRECTORIES may use \"generator expressions\" with " "the syntax \"$<...>\". " - CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS); + CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS + CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS); cm->DefineProperty ("INSTALL_NAME_DIR", cmProperty::TARGET, @@ -802,7 +804,8 @@ void cmTarget::DefineProperties(cmake *cm) "as $ to use the " "include directories specified in the interface of 'foo'." "\n" - CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS); + CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS + CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS); cm->DefineProperty ("INTERFACE_COMPILE_DEFINITIONS", cmProperty::TARGET, @@ -813,7 +816,8 @@ void cmTarget::DefineProperties(cmake *cm) "as $ to use the " "compile definitions specified in the interface of 'foo'." "\n" - CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS); + CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS + CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS); cm->DefineProperty ("LINK_INTERFACE_MULTIPLICITY", cmProperty::TARGET, diff --git a/Source/cmTargetCompileDefinitionsCommand.h b/Source/cmTargetCompileDefinitionsCommand.h index ec9b071..22d8fa8 100644 --- a/Source/cmTargetCompileDefinitionsCommand.h +++ b/Source/cmTargetCompileDefinitionsCommand.h @@ -70,6 +70,7 @@ public: "Arguments to target_compile_definitions may use \"generator " "expressions\" with the syntax \"$<...>\". " CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS + CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS ; } diff --git a/Source/cmTargetIncludeDirectoriesCommand.h b/Source/cmTargetIncludeDirectoriesCommand.h index e4bc9cf..4a1a4df 100644 --- a/Source/cmTargetIncludeDirectoriesCommand.h +++ b/Source/cmTargetIncludeDirectoriesCommand.h @@ -75,6 +75,7 @@ public: "Arguments to target_include_directories may use \"generator " "expressions\" with the syntax \"$<...>\". " CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS + CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS ; } diff --git a/Tests/CompileDefinitions/compiletest.c b/Tests/CompileDefinitions/compiletest.c new file mode 100644 index 0000000..d7883af --- /dev/null +++ b/Tests/CompileDefinitions/compiletest.c @@ -0,0 +1,19 @@ + +#ifndef LINK_C_DEFINE +#error Expected LINK_C_DEFINE +#endif +#ifndef LINK_LANGUAGE_IS_C +#error Expected LINK_LANGUAGE_IS_C +#endif + +#ifdef LINK_CXX_DEFINE +#error Unexpected LINK_CXX_DEFINE +#endif +#ifdef LINK_LANGUAGE_IS_CXX +#error Unexpected LINK_LANGUAGE_IS_CXX +#endif + +int main(void) +{ + return 0; +} diff --git a/Tests/CompileDefinitions/compiletest.cpp b/Tests/CompileDefinitions/compiletest.cpp index 7379380..7df09df 100644 --- a/Tests/CompileDefinitions/compiletest.cpp +++ b/Tests/CompileDefinitions/compiletest.cpp @@ -56,6 +56,21 @@ enum { #error Expect PREFIX_DEF2 #endif +#ifndef LINK_CXX_DEFINE +#error Expected LINK_CXX_DEFINE +#endif +#ifndef LINK_LANGUAGE_IS_CXX +#error Expected LINK_LANGUAGE_IS_CXX +#endif + +#ifdef LINK_C_DEFINE +#error Unexpected LINK_C_DEFINE +#endif +#ifdef LINK_LANGUAGE_IS_C +#error Unexpected LINK_LANGUAGE_IS_C +#endif + + // TEST_GENERATOR_EXPRESSIONS #endif diff --git a/Tests/CompileDefinitions/compiletest_mixed_c.c b/Tests/CompileDefinitions/compiletest_mixed_c.c new file mode 100644 index 0000000..698c989 --- /dev/null +++ b/Tests/CompileDefinitions/compiletest_mixed_c.c @@ -0,0 +1,19 @@ + +#ifndef LINK_CXX_DEFINE +#error Expected LINK_CXX_DEFINE +#endif +#ifndef LINK_LANGUAGE_IS_CXX +#error Expected LINK_LANGUAGE_IS_CXX +#endif + +#ifdef LINK_C_DEFINE +#error Unexpected LINK_C_DEFINE +#endif +#ifdef LINK_LANGUAGE_IS_C +#error Unexpected LINK_LANGUAGE_IS_C +#endif + +void someFunc(void) +{ + +} diff --git a/Tests/CompileDefinitions/compiletest_mixed_cxx.cpp b/Tests/CompileDefinitions/compiletest_mixed_cxx.cpp new file mode 100644 index 0000000..c686854 --- /dev/null +++ b/Tests/CompileDefinitions/compiletest_mixed_cxx.cpp @@ -0,0 +1,19 @@ + +#ifndef LINK_CXX_DEFINE +#error Expected LINK_CXX_DEFINE +#endif +#ifndef LINK_LANGUAGE_IS_CXX +#error Expected LINK_LANGUAGE_IS_CXX +#endif + +#ifdef LINK_C_DEFINE +#error Unexpected LINK_C_DEFINE +#endif +#ifdef LINK_LANGUAGE_IS_C +#error Unexpected LINK_LANGUAGE_IS_C +#endif + +int main(int argc, char **argv) +{ + return 0; +} diff --git a/Tests/CompileDefinitions/target_prop/CMakeLists.txt b/Tests/CompileDefinitions/target_prop/CMakeLists.txt index 34be917..66a3aa6 100644 --- a/Tests/CompileDefinitions/target_prop/CMakeLists.txt +++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt @@ -19,9 +19,29 @@ set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS LETTER_LIST3=\"$\" LETTER_LIST4=\"$\" LETTER_LIST5=\"$\" + "$<$:LINK_CXX_DEFINE>" + "$<$:LINK_C_DEFINE>" + "LINK_LANGUAGE_IS_$" ) set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS BUILD_IS_DEBUG=$ BUILD_IS_NOT_DEBUG=$> ) + +add_executable(target_prop_c_executable ../compiletest.c) + +set_property(TARGET target_prop_c_executable APPEND PROPERTY COMPILE_DEFINITIONS + "$<$:LINK_CXX_DEFINE>" + "$<$:LINK_C_DEFINE>" + "LINK_LANGUAGE_IS_$" + ) + +# Resulting link language will be CXX +add_executable(target_prop_mixed_executable ../compiletest_mixed_c.c ../compiletest_mixed_cxx.cpp) + +set_property(TARGET target_prop_mixed_executable APPEND PROPERTY COMPILE_DEFINITIONS + "$<$:LINK_CXX_DEFINE>" + "$<$:LINK_C_DEFINE>" + "LINK_LANGUAGE_IS_$" + ) diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt index 60d4c6a..50f12ee 100644 --- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt @@ -128,3 +128,19 @@ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/prefix_foo/prefix_bar/prefix_ba file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/prefix_foo/prefix_bar/prefix_bat/prefix_foo_bar_bat.h" "// prefix_foo_bar_bat.h\n") target_include_directories(TargetIncludeDirectories PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/prefix_$") + +# Test that the language generator expressions work +set_property(TARGET TargetIncludeDirectories + APPEND PROPERTY INCLUDE_DIRECTORIES + "$<$:${CMAKE_CURRENT_BINARY_DIR}/bad>" + "$<$:${CMAKE_CURRENT_BINARY_DIR}/good>" + "$<$,CXX>:${CMAKE_CURRENT_BINARY_DIR}/othergood/>" +) + +add_executable(TargetIncludeDirectories_C main.c) +set_property(TARGET TargetIncludeDirectories_C + APPEND PROPERTY INCLUDE_DIRECTORIES + "$<$:${CMAKE_CURRENT_BINARY_DIR}/bad>" + "$<$:${CMAKE_CURRENT_BINARY_DIR}/good>" + "$<$,C>:${CMAKE_CURRENT_BINARY_DIR}/othergood/>" +) diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/main.c b/Tests/IncludeDirectories/TargetIncludeDirectories/main.c new file mode 100644 index 0000000..a597daa --- /dev/null +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/main.c @@ -0,0 +1,7 @@ + +#include "common.h" + +int main(void) +{ + return 0; +} diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp index 5bb34aa..aed0bde 100644 --- a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp @@ -11,6 +11,7 @@ #include "list.h" #include "target.h" #include "prefix_foo_bar_bat.h" +#include "common.h" int main(int, char**) { -- cgit v0.12 From 7e24997fedbcaa4f1db8e295ca1845dadf50ff55 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 23 May 2013 07:44:04 +0200 Subject: GenerateExportHeader: Generate only C identifiers as defines The variables in this module are used to configure a header file with defines whose name depends on the name of the target. As valid names of targets may be invalid for use as defines, convert the names of the defines used to C identifiers first. This is already done in C++ code for the DEFINE_SYMBOL property. This is not as simple as ensuring that the BASE_NAME is a C identifier, because most of the define names are configurable, and because use of a BASE_NAME which is not a C identifier, such as 4square can become a C identifier by specifying a prefix in the generate_export_header macro. --- Modules/GenerateExportHeader.cmake | 6 ++++++ Tests/Module/GenerateExportHeader/CMakeLists.txt | 3 +++ .../Module/GenerateExportHeader/c_identifier/CMakeLists.txt | 13 +++++++++++++ .../c_identifier/c_identifier_class.cpp | 7 +++++++ .../GenerateExportHeader/c_identifier/c_identifier_class.h | 13 +++++++++++++ Tests/Module/GenerateExportHeader/c_identifier/main.cpp | 8 ++++++++ 6 files changed, 50 insertions(+) create mode 100644 Tests/Module/GenerateExportHeader/c_identifier/CMakeLists.txt create mode 100644 Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.cpp create mode 100644 Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.h create mode 100644 Tests/Module/GenerateExportHeader/c_identifier/main.cpp diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake index 892ebc6..d9b7083 100644 --- a/Modules/GenerateExportHeader.cmake +++ b/Modules/GenerateExportHeader.cmake @@ -267,6 +267,7 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY) if(_GEH_EXPORT_MACRO_NAME) set(EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_EXPORT_MACRO_NAME}) endif() + string(MAKE_C_IDENTIFIER ${EXPORT_MACRO_NAME} EXPORT_MACRO_NAME) if(_GEH_EXPORT_FILE_NAME) if(IS_ABSOLUTE ${_GEH_EXPORT_FILE_NAME}) set(EXPORT_FILE_NAME ${_GEH_EXPORT_FILE_NAME}) @@ -277,12 +278,15 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY) if(_GEH_DEPRECATED_MACRO_NAME) set(DEPRECATED_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_DEPRECATED_MACRO_NAME}) endif() + string(MAKE_C_IDENTIFIER ${DEPRECATED_MACRO_NAME} DEPRECATED_MACRO_NAME) if(_GEH_NO_EXPORT_MACRO_NAME) set(NO_EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_NO_EXPORT_MACRO_NAME}) endif() + string(MAKE_C_IDENTIFIER ${NO_EXPORT_MACRO_NAME} NO_EXPORT_MACRO_NAME) if(_GEH_STATIC_DEFINE) set(STATIC_DEFINE ${_GEH_PREFIX_NAME}${_GEH_STATIC_DEFINE}) endif() + string(MAKE_C_IDENTIFIER ${STATIC_DEFINE} STATIC_DEFINE) if(_GEH_DEFINE_NO_DEPRECATED) set(DEFINE_NO_DEPRECATED TRUE) @@ -292,6 +296,7 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY) set(NO_DEPRECATED_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_NO_DEPRECATED_MACRO_NAME}) endif() + string(MAKE_C_IDENTIFIER ${NO_DEPRECATED_MACRO_NAME} NO_DEPRECATED_MACRO_NAME) set(INCLUDE_GUARD_NAME "${EXPORT_MACRO_NAME}_H") @@ -300,6 +305,7 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY) if(NOT EXPORT_IMPORT_CONDITION) set(EXPORT_IMPORT_CONDITION ${TARGET_LIBRARY}_EXPORTS) endif() + string(MAKE_C_IDENTIFIER ${EXPORT_IMPORT_CONDITION} EXPORT_IMPORT_CONDITION) configure_file("${_GENERATE_EXPORT_HEADER_MODULE_DIR}/exportheader.cmake.in" "${EXPORT_FILE_NAME}" @ONLY) diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt index 4a5b1cb..cc954ff 100644 --- a/Tests/Module/GenerateExportHeader/CMakeLists.txt +++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt @@ -168,6 +168,9 @@ add_subdirectory(lib_shared_and_statictest) add_subdirectory(override_symbol) add_subdirectory(nodeprecated) add_subdirectory(prefix) +if(NOT BORLAND) + add_subdirectory(c_identifier) +endif() if (CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} MATCHES Clang)) # We deliberately call deprecated methods, and test for that elsewhere. diff --git a/Tests/Module/GenerateExportHeader/c_identifier/CMakeLists.txt b/Tests/Module/GenerateExportHeader/c_identifier/CMakeLists.txt new file mode 100644 index 0000000..9f8c8ef --- /dev/null +++ b/Tests/Module/GenerateExportHeader/c_identifier/CMakeLists.txt @@ -0,0 +1,13 @@ +project(c_identifier) + +set(c_identifier_lib_SRCS + c_identifier_class.cpp +) + +add_library(7c-identifier-lib++ SHARED c_identifier_class.cpp) + +generate_export_header(7c-identifier-lib++) + +add_executable(c_identifier_exe main.cpp) + +target_link_libraries(c_identifier_exe 7c-identifier-lib++) diff --git a/Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.cpp b/Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.cpp new file mode 100644 index 0000000..d252c8e --- /dev/null +++ b/Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.cpp @@ -0,0 +1,7 @@ + +#include "c_identifier_class.h" + +int CIdentifierClass::someMethod() const +{ + return 0; +} diff --git a/Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.h b/Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.h new file mode 100644 index 0000000..741efdc --- /dev/null +++ b/Tests/Module/GenerateExportHeader/c_identifier/c_identifier_class.h @@ -0,0 +1,13 @@ + +#ifndef C_IDENTIFIER_CLASS_H +#define C_IDENTIFIER_CLASS_H + +#include "7c-identifier-lib++_export.h" + +class _7C_IDENTIFIER_LIB___EXPORT CIdentifierClass +{ +public: + int someMethod() const; +}; + +#endif diff --git a/Tests/Module/GenerateExportHeader/c_identifier/main.cpp b/Tests/Module/GenerateExportHeader/c_identifier/main.cpp new file mode 100644 index 0000000..68beebb --- /dev/null +++ b/Tests/Module/GenerateExportHeader/c_identifier/main.cpp @@ -0,0 +1,8 @@ + +#include "c_identifier_class.h" + +int main(int argc, char **argv) +{ + CIdentifierClass cic; + return cic.someMethod(); +} -- cgit v0.12 From 015309fc9f87babaadc2510eb80298b1f2389e8c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 22 May 2013 10:25:27 +0200 Subject: Tests/CompileDefinitions: Avoid spaces in defines on VS 6 The VS 6 IDE does not like spaces in definition values so CMake drops them and warns. The Tests/CompileDefinitions test C code that looks for the dropped definitions already knows to skip them, but CMake still warns. Silence the warnings by avoiding such values in the first place on VS 6. --- Tests/CompileDefinitions/CMakeLists.txt | 1 + .../CompileDefinitions/add_definitions_command/CMakeLists.txt | 11 +++++++++-- .../add_definitions_command_with_target_prop/CMakeLists.txt | 4 +++- Tests/CompileDefinitions/target_prop/CMakeLists.txt | 6 +++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Tests/CompileDefinitions/CMakeLists.txt b/Tests/CompileDefinitions/CMakeLists.txt index d3e9a3e..930d220 100644 --- a/Tests/CompileDefinitions/CMakeLists.txt +++ b/Tests/CompileDefinitions/CMakeLists.txt @@ -5,6 +5,7 @@ project(CompileDefinitions) if ("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 6") add_definitions(-DNO_SPACES_IN_DEFINE_VALUES) + set(NO_SPACES_IN_DEFINE_VALUES 1) endif() # Use compile flags to tell executables which config is built diff --git a/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt b/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt index d3886a1..23e0134 100644 --- a/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt +++ b/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt @@ -1,8 +1,15 @@ project(add_definitions_command) -add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun -DCMAKE_IS_="Fun" -DCMAKE_IS_REALLY="Very Fun") -add_definitions(-DCMAKE_IS_="Fun" -DCMAKE_IS_REALLY="Very Fun" -DCMAKE_IS_FUN -DCMAKE_IS=Fun) +add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun -DCMAKE_IS_="Fun") +if (NOT NO_SPACES_IN_DEFINE_VALUES) + add_definitions(-DCMAKE_IS_REALLY="Very Fun") +endif() +add_definitions(-DCMAKE_IS_="Fun") +if (NOT NO_SPACES_IN_DEFINE_VALUES) + add_definitions(-DCMAKE_IS_REALLY="Very Fun") +endif() +add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun) add_definitions(-DBUILD_IS_DEBUG=$ -DBUILD_IS_NOT_DEBUG=$>) add_executable(add_definitions_command_executable ../compiletest.cpp) diff --git a/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt b/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt index 5587f7f..55108db 100644 --- a/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt +++ b/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt @@ -7,7 +7,9 @@ add_executable(add_definitions_command_with_target_prop_executable ../compiletes set_target_properties(add_definitions_command_with_target_prop_executable PROPERTIES COMPILE_DEFINITIONS CMAKE_IS_="Fun") -set_property(TARGET add_definitions_command_with_target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_REALLY="Very Fun") +if (NOT NO_SPACES_IN_DEFINE_VALUES) + set_property(TARGET add_definitions_command_with_target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_REALLY="Very Fun") +endif() add_definitions(-DCMAKE_IS_FUN) diff --git a/Tests/CompileDefinitions/target_prop/CMakeLists.txt b/Tests/CompileDefinitions/target_prop/CMakeLists.txt index 66a3aa6..6bf9c5c 100644 --- a/Tests/CompileDefinitions/target_prop/CMakeLists.txt +++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt @@ -5,7 +5,11 @@ add_executable(target_prop_executable ../compiletest.cpp) set_target_properties(target_prop_executable PROPERTIES COMPILE_DEFINITIONS CMAKE_IS_FUN) -set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_REALLY="Very Fun" CMAKE_IS=Fun) +if (NOT NO_SPACES_IN_DEFINE_VALUES) + set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_REALLY="Very Fun" CMAKE_IS=Fun) +else() + set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS=Fun) +endif() set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_FUN CMAKE_IS_="Fun") set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS -- cgit v0.12 From 8961c4b68bdf3202be0451a68418922cf869439c Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Wed, 8 May 2013 16:04:30 -0400 Subject: FindProtobuf: also find pthread Modify FindProtobuf.cmake to find the pthread library on UNIX platforms, and to add the same to PROTOBUF_LIBRARIES, as this is a link dependency of libraries using the protobuf headers. --- Modules/FindProtobuf.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index af0c2dd..2972198 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -156,6 +156,16 @@ function(_protobuf_find_libraries name filename) endif() endfunction() +# Internal function: find threads library +function(_protobuf_find_threads) + set(CMAKE_THREAD_PREFER_PTHREAD TRUE) + find_package(Threads) + if(Threads_FOUND) + list(APPEND PROTOBUF_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) + set(PROTOBUF_LIBRARIES "${PROTOBUF_LIBRARIES}" PARENT_SCOPE) + endif() +endfunction() + # # Main. # @@ -190,6 +200,9 @@ if(MSVC) set(CMAKE_FIND_LIBRARY_PREFIXES "${PROTOBUF_ORIG_FIND_LIBRARY_PREFIXES}") endif() +if(UNIX) + _protobuf_find_threads() +endif() # Find the include directory find_path(PROTOBUF_INCLUDE_DIR -- cgit v0.12 From c35961b010da87492a60afb6e5dd7436ea36ed8b Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 24 May 2013 15:33:38 -0400 Subject: ExternalData: Do not re-stage staged object files The ExternalData_LINK_CONTENT option tells ExternalData to convert real data files it finds into content links and to "stage" the original content in a ".ExternalData__" file. However, after a data object has been staged it is possible that a user-provided pattern in the "REGEX:" option will later match the staged object file. We must not process staged object files even when a user pattern matches them. Fix the implementation to not match a staged object file as a normal data file for conversion. Extend the RunCMake.ExternalData test to cover this case. --- Modules/ExternalData.cmake | 5 ++- .../ExternalData/LinkDirectory1-stdout.txt | 5 +++ Tests/RunCMake/ExternalData/LinkDirectory1.cmake | 37 ++++++++++++++++++++++ Tests/RunCMake/ExternalData/RunCMakeTest.cmake | 1 + 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 Tests/RunCMake/ExternalData/LinkDirectory1-stdout.txt create mode 100644 Tests/RunCMake/ExternalData/LinkDirectory1.cmake diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake index 187f408..8332725 100644 --- a/Modules/ExternalData.cmake +++ b/Modules/ExternalData.cmake @@ -551,7 +551,10 @@ function(_ExternalData_arg_find_files pattern regex) set(relname "${entry}") set(alg "") endif() - if("x${relname}" MATCHES "^x${regex}$" AND NOT IS_DIRECTORY "${top_src}/${entry}") + if("x${relname}" MATCHES "^x${regex}$" # matches + AND NOT IS_DIRECTORY "${top_src}/${entry}" # not a directory + AND NOT "x${relname}" MATCHES "(^x|/)\\.ExternalData_" # not staged obj + ) set(name "${top_src}/${relname}") set(file "${top_bin}/${relname}") if(alg) diff --git a/Tests/RunCMake/ExternalData/LinkDirectory1-stdout.txt b/Tests/RunCMake/ExternalData/LinkDirectory1-stdout.txt new file mode 100644 index 0000000..953ea68 --- /dev/null +++ b/Tests/RunCMake/ExternalData/LinkDirectory1-stdout.txt @@ -0,0 +1,5 @@ +-- Linked Dir/ToLink.txt.md5 to ExternalData MD5/c18ff9804c8deec9eaeb17063cda8b7b +-- Raw data correctly transformed to content link! +-- Staged content exists! +-- Staged content is correct! +-- Staged content was correctly not re-staged! diff --git a/Tests/RunCMake/ExternalData/LinkDirectory1.cmake b/Tests/RunCMake/ExternalData/LinkDirectory1.cmake new file mode 100644 index 0000000..541fc79 --- /dev/null +++ b/Tests/RunCMake/ExternalData/LinkDirectory1.cmake @@ -0,0 +1,37 @@ +include(ExternalData) +set(ExternalData_LINK_CONTENT MD5) +set(ExternalData_SOURCE_ROOT ${CMAKE_CURRENT_BINARY_DIR}) +set(ExternalData_BINARY_ROOT ${CMAKE_CURRENT_BINARY_DIR}/ExternalData) +set(input ${CMAKE_CURRENT_BINARY_DIR}/Dir) +set(output ${CMAKE_CURRENT_BINARY_DIR}/ExternalData/Dir) +set(staged "${input}/.ExternalData_MD5_c18ff9804c8deec9eaeb17063cda8b7b") +set(content "To be transformed into a content link.") +file(REMOVE ${staged}) +file(REMOVE_RECURSE ${input}) +file(WRITE ${input}/ToLink.txt "${content}") +ExternalData_Expand_Arguments(Data args "DATA{${input}/,REGEX:.*}") +if("x${args}" STREQUAL "x${output}") + message(STATUS "Raw data correctly transformed to content link!") +else() + message(FATAL_ERROR "Data reference transformed to:\n ${args}\n" + "but we expected:\n ${output}") +endif() +if(EXISTS "${staged}") + message(STATUS "Staged content exists!") +else() + message(FATAL_ERROR "Staged content missing!") +endif() + +# Expand again to check whether staged content is ignored. +ExternalData_Expand_Arguments(Data args "DATA{${input}/,REGEX:.*}") +file(STRINGS "${staged}" staged_content LIMIT_INPUT 1024) +if("${content}" STREQUAL "${staged_content}") + message(STATUS "Staged content is correct!") +else() + message(STATUS "Staged content is incorrect!") +endif() +if(EXISTS "${staged}.md5") + message(FATAL_ERROR "Staged content was incorrectly re-staged!") +else() + message(STATUS "Staged content was correctly not re-staged!") +endif() diff --git a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake index ceb2ecf..8fba82c 100644 --- a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake +++ b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake @@ -13,6 +13,7 @@ run_cmake(Directory4) run_cmake(Directory5) run_cmake(LinkContentMD5) run_cmake(LinkContentSHA1) +run_cmake(LinkDirectory1) run_cmake(MissingData) run_cmake(NoLinkInSource) run_cmake(NoURLTemplates) -- cgit v0.12 From e65ef08bf2719ffd1cc4226f9594ff7127ad8b5e Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 24 May 2013 16:27:31 -0400 Subject: try_compile: Fix quoting of libraries in generated CMakeLists.txt Since commit 236133e7 (Handle targets in the LINK_LIBRARIES of try_compile, 2013-02-09) libraries passed to the new LINK_LIBRARIES option of try_compile are not quoted inside the generated CMakeLists.txt file. Quote the library names so they re-parse correctly when loaded by CMake to configure and generate the test project. Reported-by: Bogdan Cristea --- Source/cmCoreTryCompile.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 9f38b25..ebfcae0 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -111,7 +111,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) ++i) { extraArgs++; - libsToLink += argv[i] + " "; + libsToLink += "\"" + argv[i] + "\" "; cmTarget *tgt = this->Makefile->FindTargetToUse(argv[i].c_str()); if (!tgt) { -- cgit v0.12 From b8cc6f4eba0b7349de81a48aea18a43f99e78ca5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 20 May 2013 12:25:59 +0200 Subject: include_directories: Fix handling of empty or space-only entries Since commit 0d46e9a0 (Store includes from the same include_directories call together., 2013-01-20) we accidentally use such entries. Fix the code to drop them instead. Update the IncludeDirectories test to cover this case. Reported-by: Christophe Giboudeaux --- Source/cmIncludeDirectoryCommand.cxx | 15 +++++++++++++-- Tests/IncludeDirectories/CMakeLists.txt | 11 +++++++++++ Tests/IncludeDirectories/empty.cpp | 4 ++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 Tests/IncludeDirectories/empty.cpp diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index ffb0e80..30c1743 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -116,13 +116,19 @@ void cmIncludeDirectoryCommand::GetIncludes(const std::string &arg, { std::string inc = arg.substr(lastPos,pos); this->NormalizeInclude(inc); - incs.push_back(inc); + if (!inc.empty()) + { + incs.push_back(inc); + } } lastPos = pos + 1; } std::string inc = arg.substr(lastPos); this->NormalizeInclude(inc); - incs.push_back(inc); + if (!inc.empty()) + { + incs.push_back(inc); + } } void cmIncludeDirectoryCommand::NormalizeInclude(std::string &inc) @@ -133,6 +139,11 @@ void cmIncludeDirectoryCommand::NormalizeInclude(std::string &inc) { inc.assign(inc, b, 1+e-b); // copy the remaining substring } + else + { + inc = ""; + return; + } if (!cmSystemTools::IsOff(inc.c_str())) { diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt index 8a60f17..3e3ecc9 100644 --- a/Tests/IncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/CMakeLists.txt @@ -58,3 +58,14 @@ get_property(propContentAfter DIRECTORY PROPERTY INCLUDE_DIRECTORIES) if (NOT propContentAfter STREQUAL "") message(SEND_ERROR "Clearing DIRECTORY property failed.") endif() + +add_library(empty_entry_test SHARED empty.cpp) +set_target_properties(empty_entry_test PROPERTIES INCLUDE_DIRECTORIES "") +include_directories(/one/two + " " + " " +) +get_target_property(incs empty_entry_test INCLUDE_DIRECTORIES) +if (NOT incs STREQUAL ";/one/two") + message(SEND_ERROR "Empty include_directories entry was not ignored.") +endif() diff --git a/Tests/IncludeDirectories/empty.cpp b/Tests/IncludeDirectories/empty.cpp new file mode 100644 index 0000000..1787013 --- /dev/null +++ b/Tests/IncludeDirectories/empty.cpp @@ -0,0 +1,4 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() { return 0; } -- cgit v0.12 From a3a82b5ed7f1407fe89f4e92d32446f4e354c171 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sat, 25 May 2013 00:01:08 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index f12d928..1c8a397 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130524) +set(CMake_VERSION_TWEAK 20130525) #set(CMake_VERSION_RC 1) -- cgit v0.12 From fe1584f276f208ebf4d932c91ff4f4ad5c96507f Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sun, 26 May 2013 00:01:05 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1c8a397..c9cba48 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130525) +set(CMake_VERSION_TWEAK 20130526) #set(CMake_VERSION_RC 1) -- cgit v0.12 From ab7cd03cea8651fa1aea9c109fabc69b4e247062 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Mon, 27 May 2013 00:01:02 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index c9cba48..0b66d24 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130526) +set(CMake_VERSION_TWEAK 20130527) #set(CMake_VERSION_RC 1) -- cgit v0.12 From f77631672168b1e3b5fad93c2bb83db65cb67e7b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 27 May 2013 20:53:51 +0200 Subject: Use the qt5::moc imported target instead of a variable. The variable is provided in the Qt5 config files only for compatibility with this automoc feature, so use the more-future-proof method instead. --- Modules/AutomocInfo.cmake.in | 2 +- Source/cmQtAutomoc.cxx | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Modules/AutomocInfo.cmake.in b/Modules/AutomocInfo.cmake.in index 640bf70..e5bee86 100644 --- a/Modules/AutomocInfo.cmake.in +++ b/Modules/AutomocInfo.cmake.in @@ -6,7 +6,7 @@ set(AM_MOC_OPTIONS @_moc_options@) set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@") set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/") set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/") -set(AM_QT_MOC_EXECUTABLE "@QT_MOC_EXECUTABLE@") +set(AM_QT_MOC_EXECUTABLE "@_qt_moc_executable@") set(AM_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@/") set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/") set(AM_QT_VERSION_MAJOR "@QT_VERSION_MAJOR@" ) diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index a468fa7..9d14fc2 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -309,6 +309,23 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) cmLocalGenerator::EscapeForCMake(_moc_headers.c_str()).c_str()); makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE"); + if (makefile->GetDefinition("Qt5Core_VERSION_MAJOR")) + { + cmTarget *qt5Moc = makefile->FindTargetToUse("Qt5::moc"); + if (!qt5Moc) + { + cmSystemTools::Error("Qt5::moc target not found ", + automocTargetName.c_str()); + return; + } + makefile->AddDefinition("_qt_moc_executable", qt5Moc->GetLocation(0)); + } + else + { + const char *qtMoc = makefile->GetSafeDefinition("QT_MOC_EXECUTABLE"); + makefile->AddDefinition("_qt_moc_executable", qtMoc); + } + const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT"); std::string inputFile = cmakeRoot; inputFile += "/Modules/AutomocInfo.cmake.in"; -- cgit v0.12 From fa55751f83dc5d5bd5f80d12c3076ec703262edb Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 27 May 2013 17:58:57 +0200 Subject: QtAutomoc: Get the Qt version through the target link interface In Qt 5.1, Qt5::Core has a INTERFACE_QT_MAJOR_VERSION property of '5', and since CMake 2.8.11, Qt4::QtCore has an INTERFACE_QT_MAJOR_VERSION of '4'. This was introduced in commit 4aa10cd6 (FindQt4: Set the INTERFACE_QT_MAJOR_VERSION for Qt4::QtCore, 2013-03-16), to produce an error if Qt 4 and Qt 5 are erroneously used by the same target. This can also be used however to determine the Qt major version, and therefore the particular moc executable to use during automoc steps. This means that targets in a single buildsystem can use a selection of Qt 4 and Qt 5, and still take advantage of the CMAKE_AUTOMOC feature without conflicting. --- Modules/AutomocInfo.cmake.in | 3 +-- Source/cmQtAutomoc.cxx | 29 ++++++++++++++++++++++++++--- Tests/CMakeLists.txt | 14 ++++++++++++++ Tests/Qt4And5Automoc/CMakeLists.txt | 13 +++++++++++++ Tests/Qt4And5Automoc/main.cpp | 18 ++++++++++++++++++ Tests/Qt4And5Automoc/main_qt4.cpp | 4 ++++ Tests/Qt4And5Automoc/main_qt5.cpp | 4 ++++ 7 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 Tests/Qt4And5Automoc/CMakeLists.txt create mode 100644 Tests/Qt4And5Automoc/main.cpp create mode 100644 Tests/Qt4And5Automoc/main_qt4.cpp create mode 100644 Tests/Qt4And5Automoc/main_qt5.cpp diff --git a/Modules/AutomocInfo.cmake.in b/Modules/AutomocInfo.cmake.in index e5bee86..9cff735 100644 --- a/Modules/AutomocInfo.cmake.in +++ b/Modules/AutomocInfo.cmake.in @@ -9,7 +9,6 @@ set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/") set(AM_QT_MOC_EXECUTABLE "@_qt_moc_executable@") set(AM_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@/") set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/") -set(AM_QT_VERSION_MAJOR "@QT_VERSION_MAJOR@" ) -set(AM_Qt5Core_VERSION_MAJOR "@Qt5Core_VERSION_MAJOR@" ) +set(AM_QT_VERSION_MAJOR "@_target_qt_version@") set(AM_TARGET_NAME @_moc_target_name@) set(AM_RELAXED_MODE "@_moc_relaxed_mode@") diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index 9d14fc2..350b462 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -309,7 +309,27 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) cmLocalGenerator::EscapeForCMake(_moc_headers.c_str()).c_str()); makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE"); - if (makefile->GetDefinition("Qt5Core_VERSION_MAJOR")) + const char *qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR"); + if (!qtVersion) + { + qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR"); + } + if (const char *targetQtVersion = + target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", 0)) + { + qtVersion = targetQtVersion; + } + if (qtVersion) + { + makefile->AddDefinition("_target_qt_version", qtVersion); + } + + { + const char *qtMoc = makefile->GetSafeDefinition("QT_MOC_EXECUTABLE"); + makefile->AddDefinition("_qt_moc_executable", qtMoc); + } + + if (strcmp(qtVersion, "5") == 0) { cmTarget *qt5Moc = makefile->FindTargetToUse("Qt5::moc"); if (!qt5Moc) @@ -322,8 +342,11 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) } else { - const char *qtMoc = makefile->GetSafeDefinition("QT_MOC_EXECUTABLE"); - makefile->AddDefinition("_qt_moc_executable", qtMoc); + if (strcmp(qtVersion, "4") != 0) + { + cmSystemTools::Error("The CMAKE_AUTOMOC feature supports only Qt 4 and " + "Qt 5 ", automocTargetName.c_str()); + } } const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT"); diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 0b221e8..230f776 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1044,6 +1044,20 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command ${CMAKE_CTEST_COMMAND} -V ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Targets") + + if(Qt5Widgets_FOUND AND NOT Qt5Widgets_VERSION VERSION_LESS 5.1.0) + add_test(Qt4And5Automoc ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/Qt4And5Automoc" + "${CMake_BINARY_DIR}/Tests/Qt4And5Automoc" + ${build_generator_args} + --build-project Qt4And5Automoc + --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4And5Automoc" + --force-new-ctest-process + --test-command ${CMAKE_CTEST_COMMAND} -V + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5Automoc") + endif() endif() add_test(ExternalProject ${CMAKE_CTEST_COMMAND} diff --git a/Tests/Qt4And5Automoc/CMakeLists.txt b/Tests/Qt4And5Automoc/CMakeLists.txt new file mode 100644 index 0000000..0cc80fe --- /dev/null +++ b/Tests/Qt4And5Automoc/CMakeLists.txt @@ -0,0 +1,13 @@ + +project(Qt4And5Automoc) + +find_package(Qt4 REQUIRED) +find_package(Qt5Core REQUIRED) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +add_executable(qt4_exe main_qt4.cpp) +target_link_libraries(qt4_exe Qt4::QtCore) +add_executable(qt5_exe main_qt5.cpp) +target_link_libraries(qt5_exe Qt5::Core) diff --git a/Tests/Qt4And5Automoc/main.cpp b/Tests/Qt4And5Automoc/main.cpp new file mode 100644 index 0000000..00fd641 --- /dev/null +++ b/Tests/Qt4And5Automoc/main.cpp @@ -0,0 +1,18 @@ + +#include + +class SomeObject : public QObject +{ + Q_OBJECT +public: + explicit SomeObject(QObject *parent = 0) + : QObject(parent) + { + + } +}; + +int main(int argc, char **argv) +{ + return 0; +} diff --git a/Tests/Qt4And5Automoc/main_qt4.cpp b/Tests/Qt4And5Automoc/main_qt4.cpp new file mode 100644 index 0000000..a84ce89 --- /dev/null +++ b/Tests/Qt4And5Automoc/main_qt4.cpp @@ -0,0 +1,4 @@ + +#include "main.cpp" + +#include "main_qt4.moc" diff --git a/Tests/Qt4And5Automoc/main_qt5.cpp b/Tests/Qt4And5Automoc/main_qt5.cpp new file mode 100644 index 0000000..287b261 --- /dev/null +++ b/Tests/Qt4And5Automoc/main_qt5.cpp @@ -0,0 +1,4 @@ + +#include "main.cpp" + +#include "main_qt5.moc" -- cgit v0.12 From 97c2166de4c6f19d95e68034a1c5d7bdf14446da Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Tue, 28 May 2013 00:01:05 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 0b66d24..b831cbb 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130527) +set(CMake_VERSION_TWEAK 20130528) #set(CMake_VERSION_RC 1) -- cgit v0.12 From a2099a8e8d2b97d2a2f91cbc06a4078f7c5b7139 Mon Sep 17 00:00:00 2001 From: Bjoern Thiel Date: Tue, 28 May 2013 05:25:00 -0400 Subject: SelectLibraryConfigurations: Fix for cached _LIBRARY The line set( ${basename}_LIBRARY ) removes the normal variable, but if the corresponding cached variable is present then line list( APPEND ${basename}_LIBRARY optimized "${_libname}" ) uses that and fails. Replace the original line with set( ${basename}_LIBRARY "" ) to set the normal variable to empty instead of unsetting it. --- Modules/SelectLibraryConfigurations.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake index 62137bb..5bca064 100644 --- a/Modules/SelectLibraryConfigurations.cmake +++ b/Modules/SelectLibraryConfigurations.cmake @@ -62,7 +62,7 @@ macro( select_library_configurations basename ) # if the generator supports configuration types or CMAKE_BUILD_TYPE # is set, then set optimized and debug options. if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) - set( ${basename}_LIBRARY ) + set( ${basename}_LIBRARY "" ) foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE ) list( APPEND ${basename}_LIBRARY optimized "${_libname}" ) endforeach() -- cgit v0.12 From 3de9bb48a5d7976d5f22e3c7c0f95cfda102ed8a Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Tue, 28 May 2013 06:17:49 +0000 Subject: FindImageMagick: Find v6 include dir (#14174) The header files of ImageMagick are now located at /include/ImageMagick-6 instead of /include/ImageMagick. --- Modules/FindImageMagick.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindImageMagick.cmake b/Modules/FindImageMagick.cmake index cd97b38..02a5777 100644 --- a/Modules/FindImageMagick.cmake +++ b/Modules/FindImageMagick.cmake @@ -81,7 +81,7 @@ function(FIND_IMAGEMAGICK_API component header) ${ImageMagick_INCLUDE_DIRS} "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/include" PATH_SUFFIXES - ImageMagick + ImageMagick ImageMagick-6 DOC "Path to the ImageMagick include dir." ) find_library(ImageMagick_${component}_LIBRARY -- cgit v0.12 From 045d6ae0b042d4e6e3c4540c32559c58cb4153b0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 28 May 2013 11:12:18 -0400 Subject: KWSys: Fix SystemTools::FileIsDirectory with long paths (#14176) Allocate a buffer large enough to hold the input path when removing a trailing slash. Use a local stack buffer when it is large enough and fall back to heap allocation otherwise. --- Source/kwsys/SystemTools.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 22bf193..8b25d60 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -2742,14 +2742,23 @@ bool SystemTools::FileIsDirectory(const char* name) } // Remove any trailing slash from the name. - char buffer[KWSYS_SYSTEMTOOLS_MAXPATH]; + char local_buffer[KWSYS_SYSTEMTOOLS_MAXPATH]; + std::string string_buffer; size_t last = length-1; if(last > 0 && (name[last] == '/' || name[last] == '\\') && strcmp(name, "/") !=0) { - memcpy(buffer, name, last); - buffer[last] = 0; - name = buffer; + if(last < sizeof(local_buffer)) + { + memcpy(local_buffer, name, last); + local_buffer[last] = 0; + name = local_buffer; + } + else + { + string_buffer.append(name, last); + name = string_buffer.c_str(); + } } // Now check the file node type. -- cgit v0.12 From 7378792b4938d32c5eefc5bb485ecae1a7ec95fb Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 28 May 2013 11:13:24 -0400 Subject: if: Add test for IS_DIRECTORY Add a RunCMake.if test to cover if() command behavior. Start with a test for IS_DIRECTORY cases with an existing directory and a long path, both with a trailing slash. --- Tests/RunCMake/CMakeLists.txt | 1 + Tests/RunCMake/if/CMakeLists.txt | 3 +++ Tests/RunCMake/if/IsDirectory-stdout.txt | 1 + Tests/RunCMake/if/IsDirectory.cmake | 5 +++++ Tests/RunCMake/if/IsDirectoryLong-stdout.txt | 1 + Tests/RunCMake/if/IsDirectoryLong.cmake | 10 ++++++++++ Tests/RunCMake/if/RunCMakeTest.cmake | 4 ++++ 7 files changed, 25 insertions(+) create mode 100644 Tests/RunCMake/if/CMakeLists.txt create mode 100644 Tests/RunCMake/if/IsDirectory-stdout.txt create mode 100644 Tests/RunCMake/if/IsDirectory.cmake create mode 100644 Tests/RunCMake/if/IsDirectoryLong-stdout.txt create mode 100644 Tests/RunCMake/if/IsDirectoryLong.cmake create mode 100644 Tests/RunCMake/if/RunCMakeTest.cmake diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index f676107..a0168a6 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -72,6 +72,7 @@ add_RunCMake_test(add_dependencies) add_RunCMake_test(build_command) add_RunCMake_test(find_package) add_RunCMake_test(get_filename_component) +add_RunCMake_test(if) add_RunCMake_test(include) add_RunCMake_test(include_directories) add_RunCMake_test(list) diff --git a/Tests/RunCMake/if/CMakeLists.txt b/Tests/RunCMake/if/CMakeLists.txt new file mode 100644 index 0000000..e8db6b0 --- /dev/null +++ b/Tests/RunCMake/if/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/if/IsDirectory-stdout.txt b/Tests/RunCMake/if/IsDirectory-stdout.txt new file mode 100644 index 0000000..b89446a --- /dev/null +++ b/Tests/RunCMake/if/IsDirectory-stdout.txt @@ -0,0 +1 @@ +CMAKE_CURRENT_SOURCE_DIR exists, tested with trailing slash diff --git a/Tests/RunCMake/if/IsDirectory.cmake b/Tests/RunCMake/if/IsDirectory.cmake new file mode 100644 index 0000000..23d126d --- /dev/null +++ b/Tests/RunCMake/if/IsDirectory.cmake @@ -0,0 +1,5 @@ +if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/") + message(STATUS "CMAKE_CURRENT_SOURCE_DIR exists, tested with trailing slash") +else() + message(FATAL_ERROR "CMAKE_CURRENT_SOURCE_DIR does not exist!") +endif() diff --git a/Tests/RunCMake/if/IsDirectoryLong-stdout.txt b/Tests/RunCMake/if/IsDirectoryLong-stdout.txt new file mode 100644 index 0000000..5e62754 --- /dev/null +++ b/Tests/RunCMake/if/IsDirectoryLong-stdout.txt @@ -0,0 +1 @@ +Directory path with length 94208 correctly does not exist. diff --git a/Tests/RunCMake/if/IsDirectoryLong.cmake b/Tests/RunCMake/if/IsDirectoryLong.cmake new file mode 100644 index 0000000..0e93be7 --- /dev/null +++ b/Tests/RunCMake/if/IsDirectoryLong.cmake @@ -0,0 +1,10 @@ +set(d "/long/path/to/directory") +foreach(i RANGE 11) + set(d "${d}${d}") +endforeach() +string(LENGTH "${d}" dl) +if(IS_DIRECTORY "${d}/") + message(FATAL_ERROR "Directory should not exist!") +else() + message(STATUS "Directory path with length ${dl} correctly does not exist.") +endif() diff --git a/Tests/RunCMake/if/RunCMakeTest.cmake b/Tests/RunCMake/if/RunCMakeTest.cmake new file mode 100644 index 0000000..6b6b74b --- /dev/null +++ b/Tests/RunCMake/if/RunCMakeTest.cmake @@ -0,0 +1,4 @@ +include(RunCMake) + +run_cmake(IsDirectory) +run_cmake(IsDirectoryLong) -- cgit v0.12 From 6927b25affcb9e2e01fb226970fd91db143b5101 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Wed, 29 May 2013 00:01:03 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index b831cbb..01e8512 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130528) +set(CMake_VERSION_TWEAK 20130529) #set(CMake_VERSION_RC 1) -- cgit v0.12 From e162326128f70ae1fd1a2bee9449163f87af1d18 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 27 May 2013 17:45:47 +0200 Subject: Fix indentation. --- Source/cmGlobalGenerator.cxx | 2 +- Source/cmTarget.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 3496823..3e3e5e4 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -963,7 +963,7 @@ void cmGlobalGenerator::Generate() for ( tit = targets->begin(); tit != targets->end(); ++ tit ) { - tit->second.AppendBuildInterfaceIncludes(); + tit->second.AppendBuildInterfaceIncludes(); } } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 75873ff..d367c6c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3000,8 +3000,8 @@ std::vector cmTarget::GetIncludeDirectories(const char *config) cmListFileBacktrace lfbt; cmGeneratorExpressionDAGChecker dagChecker(lfbt, - this->GetName(), - "INCLUDE_DIRECTORIES", 0, 0); + this->GetName(), + "INCLUDE_DIRECTORIES", 0, 0); this->AppendBuildInterfaceIncludes(); -- cgit v0.12 From 927012979e54a69d9d49f188ce73f7b4ca2fb073 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 29 May 2013 08:55:14 -0400 Subject: KWSys 2013-05-29 (725e541e) Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ 725e541e | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' f4928d44..725e541e Brad King (1): 9fd64779 SystemTools: Fix FileIsDirectory with long paths Rolf Eike Beer (3): e8269442 Tests: fix a warning with acc 87abd647 SystemInformation: fix truncation warnings 039d9598 fix warnings about sizeof() return value truncation Change-Id: I1c459346a622610eac62dfcd3abd0e73c5a83494 --- SystemInformation.cxx | 4 ++-- SystemTools.cxx | 17 +++++++++++++---- testIOS.cxx | 2 +- testSystemInformation.cxx | 4 ++-- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/SystemInformation.cxx b/SystemInformation.cxx index 9e2a93d..9db1dee 100644 --- a/SystemInformation.cxx +++ b/SystemInformation.cxx @@ -1471,7 +1471,7 @@ int SystemInformationImplementation::GetFullyQualifiedDomainName( { char host[NI_MAXHOST]={'\0'}; - int addrlen + socklen_t addrlen = (fam==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6)); ierr=getnameinfo( @@ -3487,7 +3487,7 @@ bool SystemInformationImplementation::QueryLinuxMemory() bool have[6] = { false, false, false, false, false, false }; unsigned long value[6]; int count = 0; - while(fgets(buffer, sizeof(buffer), fd)) + while(fgets(buffer, static_cast(sizeof(buffer)), fd)) { for(int i=0; i < 6; ++i) { diff --git a/SystemTools.cxx b/SystemTools.cxx index 394d65e..158217e 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -2742,14 +2742,23 @@ bool SystemTools::FileIsDirectory(const char* name) } // Remove any trailing slash from the name except in a root component. - char buffer[KWSYS_SYSTEMTOOLS_MAXPATH]; + char local_buffer[KWSYS_SYSTEMTOOLS_MAXPATH]; + std::string string_buffer; size_t last = length-1; if(last > 0 && (name[last] == '/' || name[last] == '\\') && strcmp(name, "/") !=0 && name[last-1] != ':') { - memcpy(buffer, name, last); - buffer[last] = 0; - name = buffer; + if(last < sizeof(local_buffer)) + { + memcpy(local_buffer, name, last); + local_buffer[last] = 0; + name = local_buffer; + } + else + { + string_buffer.append(name, last); + name = string_buffer.c_str(); + } } // Now check the file node type. diff --git a/testIOS.cxx b/testIOS.cxx index 3b971e2..f0c7f1a 100644 --- a/testIOS.cxx +++ b/testIOS.cxx @@ -48,7 +48,7 @@ int testIOS(int, char*[]) return 1; } static const unsigned char array[] = { 0xff,0x4f,0xff,0x51,0x00,0x29,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,0x01,0x01,0xff,0x52,0x00,0x0c,0x00,0x00,0x00,0x01,0x00,0x05,0x04,0x04,0x00,0x01,0xff,0x5c,0x00,0x13,0x40,0x40,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0xff,0x64,0x00,0x2c,0x00,0x00,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x62,0x79,0x20,0x49,0x54,0x4b,0x2f,0x47,0x44,0x43,0x4d,0x2f,0x4f,0x70,0x65,0x6e,0x4a,0x50,0x45,0x47,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x31,0x2e,0x30,0xff,0x90,0x00,0x0a,0x00,0x00,0x00,0x00,0x06,0x2c,0x00,0x01,0xff,0x93,0xcf,0xb0,0x18,0x08,0x7f,0xc6,0x99,0xbf,0xff,0xc0,0xf8,0xc1,0xc1,0xf3,0x05,0x81,0xf2,0x83,0x0a,0xa5,0xff,0x10,0x90,0xbf,0x2f,0xff,0x04,0xa8,0x7f,0xc0,0xf8,0xc4,0xc1,0xf3,0x09,0x81,0xf3,0x0c,0x19,0x34 }; - const unsigned int narray = sizeof(array); // 180 + const size_t narray = sizeof(array); // 180 kwsys_ios::stringstream strstr; strstr.write( (char*)array, narray ); //strstr.seekp( narray / 2 ); // set position of put pointer in mid string diff --git a/testSystemInformation.cxx b/testSystemInformation.cxx index 49a686c..738043f 100644 --- a/testSystemInformation.cxx +++ b/testSystemInformation.cxx @@ -88,9 +88,9 @@ int testSystemInformation(int, char*[]) printMethod3(info, GetHostMemoryUsed(), "KiB"); printMethod3(info, GetProcMemoryUsed(), "KiB"); - for (int i = 0; i <= 31; i++) + for (long int i = 0; i <= 31; i++) { - if (info.DoesCPUSupportFeature(1 << i)) + if (info.DoesCPUSupportFeature(static_cast(1) << i)) { kwsys_ios::cout << "CPU feature " << i << "\n"; } -- cgit v0.12 From cbe3f2072bdd181660bc4f9174a73febd3ed5230 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Mon, 13 May 2013 20:45:35 -0600 Subject: Xcode: Add support for shared library versioning Add a post-build command to shared library targets to create the versioning symbolic links. --- Modules/Platform/Darwin.cmake | 8 +--- Source/cmGlobalXCodeGenerator.cxx | 94 ++++++++++++++++++++++++++++++++------- 2 files changed, 81 insertions(+), 21 deletions(-) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 2e6b71e..6e5d449 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -207,12 +207,8 @@ if("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$") "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress") endif() -if(NOT XCODE) - # Enable shared library versioning. This flag is not actually referenced - # but the fact that the setting exists will cause the generators to support - # soname computation. - set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name") -endif() +# Enable shared library versioning. +set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name") # Xcode does not support -isystem yet. if(XCODE) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 240d60c..9bbf186 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1319,8 +1319,40 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases, = cmtarget.GetPreBuildCommands(); std::vector const & prelink = cmtarget.GetPreLinkCommands(); - std::vector const & postbuild + std::vector postbuild = cmtarget.GetPostBuildCommands(); + + if(cmtarget.GetType() == cmTarget::SHARED_LIBRARY && + !cmtarget.IsFrameworkOnApple()) + { + cmCustomCommandLines cmd; + cmd.resize(1); + cmd[0].push_back(this->CurrentMakefile->GetDefinition("CMAKE_COMMAND")); + cmd[0].push_back("-E"); + cmd[0].push_back("cmake_symlink_library"); + std::string str_file = "$CurrentMakefile, + std::vector(), + std::vector(), + cmd, + "Creating symlinks", + ""); + + postbuild.push_back(command); + } + std::vectorconst &classes = cmtarget.GetSourceFiles(); // add all the sources std::vector commands; @@ -1797,9 +1829,34 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, std::string pnprefix; std::string pnbase; std::string pnsuffix; - target.GetFullNameComponents(pnprefix, pnbase, pnsuffix, configName); + const char* version = target.GetProperty("VERSION"); + const char* soversion = target.GetProperty("SOVERSION"); + if(!target.HasSOName(configName) || target.IsFrameworkOnApple()) + { + version = 0; + soversion = 0; + } + if(version && !soversion) + { + soversion = version; + } + if(!version && soversion) + { + version = soversion; + } + + std::string realName = pnbase; + std::string soName = pnbase; + if(version && soversion) + { + realName += "."; + realName += version; + soName += "."; + soName += soversion; + } + // Set attributes to specify the proper name for the target. std::string pndir = this->CurrentMakefile->GetCurrentOutputDirectory(); if(target.GetType() == cmTarget::STATIC_LIBRARY || @@ -1857,7 +1914,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, // Store the product name for all target types. buildSettings->AddAttribute("PRODUCT_NAME", - this->CreateString(pnbase.c_str())); + this->CreateString(realName.c_str())); buildSettings->AddAttribute("SYMROOT", this->CreateString(pndir.c_str())); @@ -1935,9 +1992,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, { if(target.GetPropertyAsBool("FRAMEWORK")) { - std::string version = target.GetFrameworkVersion(); + std::string fw_version = target.GetFrameworkVersion(); buildSettings->AddAttribute("FRAMEWORK_VERSION", - this->CreateString(version.c_str())); + this->CreateString(fw_version.c_str())); std::string plist = this->ComputeInfoPListLocation(target); // Xcode will create the final version of Info.plist at build time, @@ -2162,19 +2219,26 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, { // Get the install_name directory for the build tree. install_name_dir = target.GetInstallNameDirForBuildTree(configName); - if(install_name_dir.empty()) - { - // Xcode will not pass the -install_name option at all if INSTALL_PATH - // is not given or is empty. We must explicitly put the flag in the - // link flags to create an install_name with just the library soname. - extraLinkOptions += " -install_name "; - extraLinkOptions += target.GetSOName(configName); - } - else + // Xcode doesn't create the correct install_name in some cases. + // That is, if the INSTALL_PATH is empty, or if we have versioning + // of dylib libraries, we want to specify the install_name. + // This is done by adding a link flag to create an install_name + // with just the library soname. + std::string install_name; + if(!install_name_dir.empty()) { // Convert to a path for the native build tool. cmSystemTools::ConvertToUnixSlashes(install_name_dir); - // do not escape spaces on this since it is only a single path + install_name += install_name_dir; + install_name += "/"; + } + install_name += target.GetSOName(configName); + + if((realName != soName) || install_name_dir.empty()) + { + install_name_dir = ""; + extraLinkOptions += " -install_name "; + extraLinkOptions += XCodeEscapePath(install_name.c_str()); } } buildSettings->AddAttribute("INSTALL_PATH", -- cgit v0.12 From fafa66c7f0430992e5e3388a8a3c707014ee534d Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Thu, 30 May 2013 00:01:03 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 01e8512..6c27ab3 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130529) +set(CMake_VERSION_TWEAK 20130530) #set(CMake_VERSION_RC 1) -- cgit v0.12 From e5375442ff20fde45e70de318c5aa2f1e4bb190a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 30 May 2013 13:42:47 +0200 Subject: try_compile: Trim whitespace from LINK_LIBRARIES entries Commit e65ef08b (try_compile: Fix quoting of libraries in generated CMakeLists.txt, 2013-05-24) added quoting to entries specified in the LINK_LIBRARIES. However, if the input entries contain whitespace padding, that quoted whitespace causes an error in the generated CMakeLists.txt at target_link_libraries. Strictly, it is an error to have space separated entries in the CMAKE_REQUIRED_LIBRARIES, as it was never properly handled by CMakeExpandImportedTargets even prior to commit 236133e7 (Handle targets in the LINK_LIBRARIES of try_compile., 2013-02-09). However, it is causing a regression in KDE code which tests the next branch. --- Source/cmCoreTryCompile.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index ebfcae0..85e49a9 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -111,7 +111,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) ++i) { extraArgs++; - libsToLink += "\"" + argv[i] + "\" "; + libsToLink += "\"" + cmSystemTools::TrimWhitespace(argv[i]) + "\" "; cmTarget *tgt = this->Makefile->FindTargetToUse(argv[i].c_str()); if (!tgt) { -- cgit v0.12 From 53164ac997f6ce2a4fd1245956a815bfdb893c27 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 16 May 2013 15:52:14 +0200 Subject: cmTarget: Remove some hardcoding of transitive property names. --- Source/cmGeneratorExpressionEvaluator.cxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 6618e83..60c969e 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -314,6 +314,17 @@ static const char* targetPropertyTransitiveWhitelist[] = { }; //---------------------------------------------------------------------------- +struct TransitiveWhitelistCompare +{ + explicit TransitiveWhitelistCompare(const std::string &needle) + : Needle(needle) {} + bool operator() (const char *item) + { return strcmp(item, this->Needle.c_str()) == 0; } +private: + std::string Needle; +}; + +//---------------------------------------------------------------------------- static const struct TargetPropertyNode : public cmGeneratorExpressionNode { TargetPropertyNode() {} @@ -485,8 +496,12 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS"; } - if (interfacePropertyName == "INTERFACE_INCLUDE_DIRECTORIES" - || interfacePropertyName == "INTERFACE_COMPILE_DEFINITIONS") + const char **transBegin = targetPropertyTransitiveWhitelist; + const char **transEnd = targetPropertyTransitiveWhitelist + + (sizeof(targetPropertyTransitiveWhitelist) / + sizeof(*targetPropertyTransitiveWhitelist)); + if (std::find_if(transBegin, transEnd, + TransitiveWhitelistCompare(interfacePropertyName)) != transEnd) { const cmTarget::LinkInterface *iface = target->GetLinkInterface( context->Config, -- cgit v0.12 From 0b39fefeac550c8277ebde308fcb9198e43e46a7 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 29 May 2013 00:34:30 +0200 Subject: GenexEval: Extract a getLinkedTargetsContent from TargetPropertyNode. This will be used to process transitive components of properties which depend on linked targets. Currently only the link interface of the target can be used as the source of the linked targets, but in the next commit it will be possible to use the link implementation as the source of link targets. This commit does not change the semantics of the code. --- Source/cmGeneratorExpressionEvaluator.cxx | 81 ++++++++++++++++++------------- 1 file changed, 46 insertions(+), 35 deletions(-) diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 60c969e..ba74e60 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -313,6 +313,48 @@ static const char* targetPropertyTransitiveWhitelist[] = { , "INTERFACE_COMPILE_DEFINITIONS" }; +std::string getLinkedTargetsContent(const std::vector &libraries, + cmTarget *target, + cmGeneratorExpressionContext *context, + cmGeneratorExpressionDAGChecker *dagChecker, + const std::string &interfacePropertyName) +{ + cmGeneratorExpression ge(context->Backtrace); + + std::string sep; + std::string depString; + for (std::vector::const_iterator + it = libraries.begin(); + it != libraries.end(); ++it) + { + if (*it == target->GetName()) + { + // Broken code can have a target in its own link interface. + // Don't follow such link interface entries so as not to create a + // self-referencing loop. + continue; + } + if (context->Makefile->FindTargetToUse(it->c_str())) + { + depString += + sep + "$"; + sep = ";"; + } + } + cmsys::auto_ptr cge = ge.Parse(depString); + std::string linkedTargetsContent = cge->Evaluate(context->Makefile, + context->Config, + context->Quiet, + context->HeadTarget, + target, + dagChecker); + if (cge->GetHadContextSensitiveCondition()) + { + context->HadContextSensitiveCondition = true; + } + return linkedTargetsContent; +} + //---------------------------------------------------------------------------- struct TransitiveWhitelistCompare { @@ -508,41 +550,10 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode context->HeadTarget); if(iface) { - cmGeneratorExpression ge(context->Backtrace); - - std::string sep; - std::string depString; - for (std::vector::const_iterator - it = iface->Libraries.begin(); - it != iface->Libraries.end(); ++it) - { - if (*it == target->GetName()) - { - // Broken code can have a target in its own link interface. - // Don't follow such link interface entries so as not to create a - // self-referencing loop. - continue; - } - if (context->Makefile->FindTargetToUse(it->c_str())) - { - depString += - sep + "$"; - sep = ";"; - } - } - cmsys::auto_ptr cge = - ge.Parse(depString); - linkedTargetsContent = cge->Evaluate(context->Makefile, - context->Config, - context->Quiet, - context->HeadTarget, - target, - &dagChecker); - if (cge->GetHadContextSensitiveCondition()) - { - context->HadContextSensitiveCondition = true; - } + linkedTargetsContent = + getLinkedTargetsContent(iface->Libraries, target, + context, &dagChecker, + interfacePropertyName); } } -- cgit v0.12 From 3aa9ce441f010362e404e6f9126ecd3028de76b9 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 30 May 2013 15:30:24 +0200 Subject: GenexEval: Fix evaluation of INCLUDE_DIRECTORIES target property. This property should come from the content of the property itself, plus the INTERFACE_INCLUDE_DIRECTORIES of the link *implementation*. In contrast, when the INTERFACE_INCLUDE_DIRECTORIES is evaluated for a target, the INTERFACE_INCLUDE_DIRECTORIES of the link *interface* is used. Similar logic applies for the COMPILE_DEFINITIONS target properties. If the propertyName is already an INTERFACE_ variant of the property, ie, the expression is similar to $ then the INTERFACE_INCLUDE_DIRECTORIES of the link *interface* of foo is used. However, if the propertyName is not an INTERFACE_ variant, and the interfacePropertyName is, ie, the expression is similar to: $ then the INTERFACE_INCLUDE_DIRECTORIES of the link *implementation* of foo is used. --- Source/cmGeneratorExpressionEvaluator.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index ba74e60..de6371a 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -543,7 +543,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode + (sizeof(targetPropertyTransitiveWhitelist) / sizeof(*targetPropertyTransitiveWhitelist)); if (std::find_if(transBegin, transEnd, - TransitiveWhitelistCompare(interfacePropertyName)) != transEnd) + TransitiveWhitelistCompare(propertyName)) != transEnd) { const cmTarget::LinkInterface *iface = target->GetLinkInterface( context->Config, @@ -556,6 +556,20 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode interfacePropertyName); } } + else if (std::find_if(transBegin, transEnd, + TransitiveWhitelistCompare(interfacePropertyName)) != transEnd) + { + const cmTarget::LinkImplementation *impl = target->GetLinkImplementation( + context->Config, + context->HeadTarget); + if(impl) + { + linkedTargetsContent = + getLinkedTargetsContent(impl->Libraries, target, + context, &dagChecker, + interfacePropertyName); + } + } linkedTargetsContent = cmGeneratorExpression::StripEmptyListElements(linkedTargetsContent); -- cgit v0.12 From 07f9e157b61a419c04e31589c82eb284654a2b4e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 29 May 2013 00:34:30 +0200 Subject: GenexEval: Test evaluation of INCLUDE_DIRECTORIES target property. --- .../TargetIncludeDirectories/CMakeLists.txt | 19 +++++++++++++++++++ .../TargetIncludeDirectories/copy_includes.cpp | 7 +++++++ .../TargetIncludeDirectories/empty.cpp | 7 +++++++ 3 files changed, 33 insertions(+) create mode 100644 Tests/IncludeDirectories/TargetIncludeDirectories/copy_includes.cpp create mode 100644 Tests/IncludeDirectories/TargetIncludeDirectories/empty.cpp diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt index ad6671f..a80a58f 100644 --- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt @@ -110,6 +110,25 @@ set_property(TARGET libbad APPEND PROPERTY ) +add_library(includes_source_good empty.cpp) +target_include_directories(includes_source_good + INTERFACE + "${CMAKE_CURRENT_BINARY_DIR}/good" + "${CMAKE_CURRENT_BINARY_DIR}/othergood/" +) +add_library(includes_source_bad empty.cpp) +target_include_directories(includes_source_bad + INTERFACE + "${CMAKE_CURRENT_BINARY_DIR}/bad" +) + +add_library(includes_proxy SHARED empty.cpp) +target_link_libraries(includes_proxy includes_source_good) +target_link_libraries(includes_proxy LINK_INTERFACE_LIBRARIES includes_source_bad) +add_executable(copy_includes copy_includes.cpp) +target_include_directories(copy_includes PRIVATE $) + + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib5.cpp" "#include \"common.h\"\n") add_library(lib5 "${CMAKE_CURRENT_BINARY_DIR}/lib5.cpp") diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/copy_includes.cpp b/Tests/IncludeDirectories/TargetIncludeDirectories/copy_includes.cpp new file mode 100644 index 0000000..fed4c03 --- /dev/null +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/copy_includes.cpp @@ -0,0 +1,7 @@ + +#include "common.h" + +int main() +{ + return 0; +} diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/empty.cpp b/Tests/IncludeDirectories/TargetIncludeDirectories/empty.cpp new file mode 100644 index 0000000..7279c5e --- /dev/null +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty(void) +{ + return 0; +} -- cgit v0.12 From 363825cd55595b7de62fcf610836f6156a9f1a31 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 30 May 2013 16:11:11 -0400 Subject: FindBoost: Fix handling of \ in input paths (#14179) In commit 5b9149e0 (FindBoost: Overhaul caching and search repeat behavior, 2012-09-24) we refactored the internal library search to use a _Boost_FIND_LIBRARY macro to wrap around find_library calls. However, CMake macros re-process escape sequences when evaluating calls inside the macro after substituting placeholders (a historical bug). In order to avoid escape sequences, convert backslashes to forward slashes before passing arguments to the _Boost_FIND_LIBRARY macro. --- Modules/FindBoost.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 8d8b10c..0a9ffc1 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -928,9 +928,13 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "Searching for ${UPPERCOMPONENT}_LIBRARY_RELEASE: ${_boost_RELEASE_NAMES}") endif() + + # Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing. + string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS}") + _Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE NAMES ${_boost_RELEASE_NAMES} - HINTS ${_boost_LIBRARY_SEARCH_DIRS} + HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp} NAMES_PER_DIR DOC "${_boost_docstring_release}" ) @@ -960,9 +964,13 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "Searching for ${UPPERCOMPONENT}_LIBRARY_DEBUG: ${_boost_DEBUG_NAMES}") endif() + + # Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing. + string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS}") + _Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG NAMES ${_boost_DEBUG_NAMES} - HINTS ${_boost_LIBRARY_SEARCH_DIRS} + HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp} NAMES_PER_DIR DOC "${_boost_docstring_debug}" ) -- cgit v0.12 From 4836c5ab48d1aa3ed1ed8601f459b80d3ed2ab1f Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Fri, 31 May 2013 00:01:05 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 6c27ab3..4722148 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130530) +set(CMake_VERSION_TWEAK 20130531) #set(CMake_VERSION_RC 1) -- cgit v0.12 From cca955a27cf3fc8344ee3dce213472b61e1edef7 Mon Sep 17 00:00:00 2001 From: John Farrier Date: Wed, 29 May 2013 20:16:36 -0400 Subject: VS: Add VS_GLOBAL_ROOTNAMESPACE target property Add a setting for Visual Studio projects for the root namespace in the "Globals" PropertyGroup section of the project file. --- Source/cmTarget.cxx | 5 +++++ Source/cmVisualStudio10TargetGenerator.cxx | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 66c22b1..40c9798 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1303,6 +1303,11 @@ void cmTarget::DefineProperties(cmake *cm) "this value with \"ManagedCProj\", for example, in a Visual " "Studio managed C++ unit test project."); cm->DefineProperty + ("VS_GLOBAL_ROOTNAMESPACE", cmProperty::TARGET, + "Visual Studio project root namespace.", + "Sets the \"RootNamespace\" attribute for a generated Visual Studio " + "project. The attribute will be generated only if this is set."); + cm->DefineProperty ("VS_DOTNET_REFERENCES", cmProperty::TARGET, "Visual Studio managed project .NET references", "Adds one or more semicolon-delimited .NET references to a " diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 933bf95..61a3427 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -262,6 +262,15 @@ void cmVisualStudio10TargetGenerator::Generate() "\n"; } + const char* vsGlobalRootNamespace = + this->Target->GetProperty("VS_GLOBAL_ROOTNAMESPACE"); + if(vsGlobalRootNamespace) + { + this->WriteString("", 2); + (*this->BuildFileStream) << cmVS10EscapeXML(vsGlobalRootNamespace) << + "\n"; + } + this->WriteString("", 2); (*this->BuildFileStream) << this->Platform << "\n"; const char* projLabel = this->Target->GetProperty("PROJECT_LABEL"); -- cgit v0.12 From b680824a5fdcc54c265c64ce8958f9d80acad70d Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 15 May 2013 15:19:20 -0400 Subject: try_compile: Add test for bad call error cases Add a RunCMake.try_compile test to cover cases of bad invocation of the try_compile command. --- Tests/RunCMake/CMakeLists.txt | 1 + Tests/RunCMake/try_compile/BadLinkLibraries-result.txt | 1 + Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt | 5 +++++ Tests/RunCMake/try_compile/BadLinkLibraries.cmake | 3 +++ Tests/RunCMake/try_compile/CMakeLists.txt | 3 +++ Tests/RunCMake/try_compile/NoArgs-result.txt | 1 + Tests/RunCMake/try_compile/NoArgs-stderr.txt | 4 ++++ Tests/RunCMake/try_compile/NoArgs.cmake | 1 + Tests/RunCMake/try_compile/NoCopyFile-result.txt | 1 + Tests/RunCMake/try_compile/NoCopyFile-stderr.txt | 4 ++++ Tests/RunCMake/try_compile/NoCopyFile.cmake | 2 ++ Tests/RunCMake/try_compile/NoLinkLibraries-result.txt | 1 + Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt | 4 ++++ Tests/RunCMake/try_compile/NoLinkLibraries.cmake | 2 ++ Tests/RunCMake/try_compile/NoOutputVariable-result.txt | 1 + Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt | 4 ++++ Tests/RunCMake/try_compile/NoOutputVariable.cmake | 2 ++ .../try_compile/NonSourceCompileDefinitions-result.txt | 1 + .../try_compile/NonSourceCompileDefinitions-stderr.txt | 4 ++++ Tests/RunCMake/try_compile/NonSourceCompileDefinitions.cmake | 2 ++ Tests/RunCMake/try_compile/NonSourceCopyFile-result.txt | 1 + Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt | 4 ++++ Tests/RunCMake/try_compile/NonSourceCopyFile.cmake | 2 ++ Tests/RunCMake/try_compile/OneArg-result.txt | 1 + Tests/RunCMake/try_compile/OneArg-stderr.txt | 4 ++++ Tests/RunCMake/try_compile/OneArg.cmake | 1 + Tests/RunCMake/try_compile/RunCMakeTest.cmake | 11 +++++++++++ Tests/RunCMake/try_compile/TwoArgs-result.txt | 1 + Tests/RunCMake/try_compile/TwoArgs-stderr.txt | 4 ++++ Tests/RunCMake/try_compile/TwoArgs.cmake | 1 + Tests/RunCMake/try_compile/proj/CMakeLists.txt | 2 ++ Tests/RunCMake/try_compile/src.c | 1 + 32 files changed, 80 insertions(+) create mode 100644 Tests/RunCMake/try_compile/BadLinkLibraries-result.txt create mode 100644 Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt create mode 100644 Tests/RunCMake/try_compile/BadLinkLibraries.cmake create mode 100644 Tests/RunCMake/try_compile/CMakeLists.txt create mode 100644 Tests/RunCMake/try_compile/NoArgs-result.txt create mode 100644 Tests/RunCMake/try_compile/NoArgs-stderr.txt create mode 100644 Tests/RunCMake/try_compile/NoArgs.cmake create mode 100644 Tests/RunCMake/try_compile/NoCopyFile-result.txt create mode 100644 Tests/RunCMake/try_compile/NoCopyFile-stderr.txt create mode 100644 Tests/RunCMake/try_compile/NoCopyFile.cmake create mode 100644 Tests/RunCMake/try_compile/NoLinkLibraries-result.txt create mode 100644 Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt create mode 100644 Tests/RunCMake/try_compile/NoLinkLibraries.cmake create mode 100644 Tests/RunCMake/try_compile/NoOutputVariable-result.txt create mode 100644 Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt create mode 100644 Tests/RunCMake/try_compile/NoOutputVariable.cmake create mode 100644 Tests/RunCMake/try_compile/NonSourceCompileDefinitions-result.txt create mode 100644 Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt create mode 100644 Tests/RunCMake/try_compile/NonSourceCompileDefinitions.cmake create mode 100644 Tests/RunCMake/try_compile/NonSourceCopyFile-result.txt create mode 100644 Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt create mode 100644 Tests/RunCMake/try_compile/NonSourceCopyFile.cmake create mode 100644 Tests/RunCMake/try_compile/OneArg-result.txt create mode 100644 Tests/RunCMake/try_compile/OneArg-stderr.txt create mode 100644 Tests/RunCMake/try_compile/OneArg.cmake create mode 100644 Tests/RunCMake/try_compile/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/try_compile/TwoArgs-result.txt create mode 100644 Tests/RunCMake/try_compile/TwoArgs-stderr.txt create mode 100644 Tests/RunCMake/try_compile/TwoArgs.cmake create mode 100644 Tests/RunCMake/try_compile/proj/CMakeLists.txt create mode 100644 Tests/RunCMake/try_compile/src.c diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 66f86b6..f1e01b1 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -76,6 +76,7 @@ add_RunCMake_test(if) add_RunCMake_test(include) add_RunCMake_test(include_directories) add_RunCMake_test(list) +add_RunCMake_test(try_compile) add_RunCMake_test(CMP0004) find_package(Qt4 QUIET) diff --git a/Tests/RunCMake/try_compile/BadLinkLibraries-result.txt b/Tests/RunCMake/try_compile/BadLinkLibraries-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_compile/BadLinkLibraries-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt b/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt new file mode 100644 index 0000000..eceffec --- /dev/null +++ b/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at BadLinkLibraries.cmake:2 \(try_compile\): + Only libraries may be used as try_compile IMPORTED LINK_LIBRARIES. Got + not_a_library of type UTILITY. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/BadLinkLibraries.cmake b/Tests/RunCMake/try_compile/BadLinkLibraries.cmake new file mode 100644 index 0000000..e8b5add --- /dev/null +++ b/Tests/RunCMake/try_compile/BadLinkLibraries.cmake @@ -0,0 +1,3 @@ +add_custom_target(not_a_library) +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + LINK_LIBRARIES not_a_library) diff --git a/Tests/RunCMake/try_compile/CMakeLists.txt b/Tests/RunCMake/try_compile/CMakeLists.txt new file mode 100644 index 0000000..e8db6b0 --- /dev/null +++ b/Tests/RunCMake/try_compile/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/try_compile/NoArgs-result.txt b/Tests/RunCMake/try_compile/NoArgs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_compile/NoArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoArgs-stderr.txt b/Tests/RunCMake/try_compile/NoArgs-stderr.txt new file mode 100644 index 0000000..8808fd1 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoArgs-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoArgs.cmake:1 \(try_compile\): + try_compile unknown error. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoArgs.cmake b/Tests/RunCMake/try_compile/NoArgs.cmake new file mode 100644 index 0000000..8f751d9 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoArgs.cmake @@ -0,0 +1 @@ +try_compile() diff --git a/Tests/RunCMake/try_compile/NoCopyFile-result.txt b/Tests/RunCMake/try_compile/NoCopyFile-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFile-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt b/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt new file mode 100644 index 0000000..096fd98 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoCopyFile.cmake:1 \(try_compile\): + COPY_FILE specified but there is no variable +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoCopyFile.cmake b/Tests/RunCMake/try_compile/NoCopyFile.cmake new file mode 100644 index 0000000..8c648ff --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFile.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + COPY_FILE) diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries-result.txt b/Tests/RunCMake/try_compile/NoLinkLibraries-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_compile/NoLinkLibraries-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt b/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt new file mode 100644 index 0000000..507dce0 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoLinkLibraries.cmake:1 \(try_compile\): + LINK_LIBRARIES specified but there is no content +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries.cmake b/Tests/RunCMake/try_compile/NoLinkLibraries.cmake new file mode 100644 index 0000000..04c5758 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoLinkLibraries.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + LINK_LIBRARIES) diff --git a/Tests/RunCMake/try_compile/NoOutputVariable-result.txt b/Tests/RunCMake/try_compile/NoOutputVariable-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_compile/NoOutputVariable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt b/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt new file mode 100644 index 0000000..77ede4c --- /dev/null +++ b/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoOutputVariable.cmake:1 \(try_compile\): + OUTPUT_VARIABLE specified but there is no variable +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoOutputVariable.cmake b/Tests/RunCMake/try_compile/NoOutputVariable.cmake new file mode 100644 index 0000000..3b9cb34 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoOutputVariable.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + OUTPUT_VARIABLE) diff --git a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-result.txt b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt new file mode 100644 index 0000000..cf02efb --- /dev/null +++ b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NonSourceCompileDefinitions.cmake:1 \(try_compile\): + COMPILE_FLAGS specified on a srcdir type TRY_COMPILE +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions.cmake b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions.cmake new file mode 100644 index 0000000..8eb0d47 --- /dev/null +++ b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/proj + TestProject COMPILE_DEFINITIONS DEF) diff --git a/Tests/RunCMake/try_compile/NonSourceCopyFile-result.txt b/Tests/RunCMake/try_compile/NonSourceCopyFile-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_compile/NonSourceCopyFile-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt b/Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt new file mode 100644 index 0000000..f5893e1 --- /dev/null +++ b/Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NonSourceCopyFile.cmake:1 \(try_compile\): + COPY_FILE specified on a srcdir type TRY_COMPILE +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NonSourceCopyFile.cmake b/Tests/RunCMake/try_compile/NonSourceCopyFile.cmake new file mode 100644 index 0000000..c44192f --- /dev/null +++ b/Tests/RunCMake/try_compile/NonSourceCopyFile.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/proj + TestProject COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/result) diff --git a/Tests/RunCMake/try_compile/OneArg-result.txt b/Tests/RunCMake/try_compile/OneArg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_compile/OneArg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/OneArg-stderr.txt b/Tests/RunCMake/try_compile/OneArg-stderr.txt new file mode 100644 index 0000000..12835be --- /dev/null +++ b/Tests/RunCMake/try_compile/OneArg-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at OneArg.cmake:1 \(try_compile\): + try_compile unknown error. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/OneArg.cmake b/Tests/RunCMake/try_compile/OneArg.cmake new file mode 100644 index 0000000..e60a462 --- /dev/null +++ b/Tests/RunCMake/try_compile/OneArg.cmake @@ -0,0 +1 @@ +try_compile(RESULT) diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake new file mode 100644 index 0000000..a4248ec --- /dev/null +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -0,0 +1,11 @@ +include(RunCMake) + +run_cmake(NoArgs) +run_cmake(OneArg) +run_cmake(TwoArgs) +run_cmake(NoCopyFile) +run_cmake(NoOutputVariable) +run_cmake(NoLinkLibraries) +run_cmake(BadLinkLibraries) +run_cmake(NonSourceCopyFile) +run_cmake(NonSourceCompileDefinitions) diff --git a/Tests/RunCMake/try_compile/TwoArgs-result.txt b/Tests/RunCMake/try_compile/TwoArgs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_compile/TwoArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/TwoArgs-stderr.txt b/Tests/RunCMake/try_compile/TwoArgs-stderr.txt new file mode 100644 index 0000000..b9c08fc --- /dev/null +++ b/Tests/RunCMake/try_compile/TwoArgs-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at TwoArgs.cmake:1 \(try_compile\): + try_compile unknown error. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/TwoArgs.cmake b/Tests/RunCMake/try_compile/TwoArgs.cmake new file mode 100644 index 0000000..7f2212d --- /dev/null +++ b/Tests/RunCMake/try_compile/TwoArgs.cmake @@ -0,0 +1 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/Tests/RunCMake/try_compile/proj/CMakeLists.txt b/Tests/RunCMake/try_compile/proj/CMakeLists.txt new file mode 100644 index 0000000..78a87c0 --- /dev/null +++ b/Tests/RunCMake/try_compile/proj/CMakeLists.txt @@ -0,0 +1,2 @@ +cmake_minimum_required(VERSION 2.8.10) +project(TestProject NONE) diff --git a/Tests/RunCMake/try_compile/src.c b/Tests/RunCMake/try_compile/src.c new file mode 100644 index 0000000..78f2de1 --- /dev/null +++ b/Tests/RunCMake/try_compile/src.c @@ -0,0 +1 @@ +int main(void) { return 0; } -- cgit v0.12 From d06db7ebe80636876d9701064b16cec9d3e2e3cb Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 15 May 2013 15:30:34 -0400 Subject: try_compile: Refactor argument processing Process all arguments in a single loop using a simple state machine. While at it, fix some error message typos. Also allow LINK_LIBRARIES with no actual libraries to disable use of the -DLINK_LIBRARIES=... from the CMAKE_FLAGS. This was already possible in the old logic if LINK_LIBRARIES was immediately followed by another keyword argument instead of the end of the argument list, so allow it in general. Update the RunCMake.try_compile test cases accordingly. --- Source/cmCoreTryCompile.cxx | 236 +++++++++------------ Tests/RunCMake/try_compile/NoCopyFile-stderr.txt | 2 +- Tests/RunCMake/try_compile/NoCopyFile2-result.txt | 1 + Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt | 4 + Tests/RunCMake/try_compile/NoCopyFile2.cmake | 2 + .../try_compile/NoLinkLibraries-result.txt | 1 - .../try_compile/NoLinkLibraries-stderr.txt | 4 - Tests/RunCMake/try_compile/NoLinkLibraries.cmake | 2 - .../try_compile/NoOutputVariable-stderr.txt | 2 +- .../try_compile/NoOutputVariable2-result.txt | 1 + .../try_compile/NoOutputVariable2-stderr.txt | 4 + Tests/RunCMake/try_compile/NoOutputVariable2.cmake | 2 + .../NonSourceCompileDefinitions-stderr.txt | 2 +- Tests/RunCMake/try_compile/RunCMakeTest.cmake | 3 +- 14 files changed, 122 insertions(+), 144 deletions(-) create mode 100644 Tests/RunCMake/try_compile/NoCopyFile2-result.txt create mode 100644 Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt create mode 100644 Tests/RunCMake/try_compile/NoCopyFile2.cmake delete mode 100644 Tests/RunCMake/try_compile/NoLinkLibraries-result.txt delete mode 100644 Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt delete mode 100644 Tests/RunCMake/try_compile/NoLinkLibraries.cmake create mode 100644 Tests/RunCMake/try_compile/NoOutputVariable2-result.txt create mode 100644 Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt create mode 100644 Tests/RunCMake/try_compile/NoOutputVariable2.cmake diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 85e49a9..bf28428 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -23,150 +23,130 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) this->BinaryDirectory = argv[1].c_str(); this->OutputFile = ""; // which signature were we called with ? - this->SrcFileSignature = false; - unsigned int i; + this->SrcFileSignature = true; const char* sourceDirectory = argv[2].c_str(); const char* projectName = 0; const char* targetName = 0; - char targetNameBuf[64]; - int extraArgs = 0; - - // look for CMAKE_FLAGS and store them std::vector cmakeFlags; - for (i = 3; i < argv.size(); ++i) - { - if (argv[i] == "CMAKE_FLAGS") - { - // CMAKE_FLAGS is the first argument because we need an argv[0] that - // is not used, so it matches regular command line parsing which has - // the program name as arg 0 - for (; i < argv.size() && argv[i] != "COMPILE_DEFINITIONS" && - argv[i] != "OUTPUT_VARIABLE" && - argv[i] != "LINK_LIBRARIES"; - ++i) - { - extraArgs++; - cmakeFlags.push_back(argv[i]); - } - break; - } - } - - // look for OUTPUT_VARIABLE and store them + std::vector compileDefs; std::string outputVariable; - for (i = 3; i < argv.size(); ++i) + std::string copyFile; + std::vector targets; + std::string libsToLink = " "; + bool useOldLinkLibs = true; + char targetNameBuf[64]; + bool didOutputVariable = false; + bool didCopyFile = false; + + enum Doing { DoingNone, DoingCMakeFlags, DoingCompileDefinitions, + DoingLinkLibraries, DoingOutputVariable, DoingCopyFile }; + Doing doing = DoingNone; + for(size_t i=3; i < argv.size(); ++i) { - if (argv[i] == "OUTPUT_VARIABLE") + if(argv[i] == "CMAKE_FLAGS") { - if ( argv.size() <= (i+1) ) - { - this->Makefile->IssueMessage(cmake::FATAL_ERROR, - "OUTPUT_VARIABLE specified but there is no variable"); - return -1; - } - extraArgs += 2; - outputVariable = argv[i+1]; - break; + doing = DoingCMakeFlags; + // CMAKE_FLAGS is the first argument because we need an argv[0] that + // is not used, so it matches regular command line parsing which has + // the program name as arg 0 + cmakeFlags.push_back(argv[i]); } - } - - // look for COMPILE_DEFINITIONS and store them - std::vector compileFlags; - for (i = 3; i < argv.size(); ++i) - { - if (argv[i] == "COMPILE_DEFINITIONS") + else if(argv[i] == "COMPILE_DEFINITIONS") { - extraArgs++; - for (i = i + 1; i < argv.size() && argv[i] != "CMAKE_FLAGS" && - argv[i] != "OUTPUT_VARIABLE" && - argv[i] != "LINK_LIBRARIES"; - ++i) - { - extraArgs++; - compileFlags.push_back(argv[i]); - } - break; + doing = DoingCompileDefinitions; } - } - - std::vector targets; - std::string libsToLink = " "; - bool useOldLinkLibs = true; - for (i = 3; i < argv.size(); ++i) - { - if (argv[i] == "LINK_LIBRARIES") + else if(argv[i] == "LINK_LIBRARIES") { - if ( argv.size() <= (i+1) ) - { - this->Makefile->IssueMessage(cmake::FATAL_ERROR, - "LINK_LIBRARIES specified but there is no content"); - return -1; - } - extraArgs++; - ++i; + doing = DoingLinkLibraries; useOldLinkLibs = false; - for ( ; i < argv.size() && argv[i] != "CMAKE_FLAGS" - && argv[i] != "COMPILE_DEFINITIONS" && argv[i] != "OUTPUT_VARIABLE"; - ++i) + } + else if(argv[i] == "OUTPUT_VARIABLE") + { + doing = DoingOutputVariable; + didOutputVariable = true; + } + else if(argv[i] == "COPY_FILE") + { + doing = DoingCopyFile; + didCopyFile = true; + } + else if(doing == DoingCMakeFlags) + { + cmakeFlags.push_back(argv[i]); + } + else if(doing == DoingCompileDefinitions) + { + compileDefs.push_back(argv[i]); + } + else if(doing == DoingLinkLibraries) + { + libsToLink += "\"" + cmSystemTools::TrimWhitespace(argv[i]) + "\" "; + if(cmTarget *tgt = this->Makefile->FindTargetToUse(argv[i].c_str())) { - extraArgs++; - libsToLink += "\"" + cmSystemTools::TrimWhitespace(argv[i]) + "\" "; - cmTarget *tgt = this->Makefile->FindTargetToUse(argv[i].c_str()); - if (!tgt) - { - continue; - } switch(tgt->GetType()) - { - case cmTarget::SHARED_LIBRARY: - case cmTarget::STATIC_LIBRARY: - case cmTarget::UNKNOWN_LIBRARY: - break; - case cmTarget::EXECUTABLE: - if (tgt->IsExecutableWithExports()) - { + { + case cmTarget::SHARED_LIBRARY: + case cmTarget::STATIC_LIBRARY: + case cmTarget::UNKNOWN_LIBRARY: break; - } - default: - this->Makefile->IssueMessage(cmake::FATAL_ERROR, - "Only libraries may be used as try_compile IMPORTED " - "LINK_LIBRARIES. Got " + std::string(tgt->GetName()) + " of " - "type " + tgt->GetTargetTypeName(tgt->GetType()) + "."); - return -1; - } - if (!tgt->IsImported()) + case cmTarget::EXECUTABLE: + if (tgt->IsExecutableWithExports()) + { + break; + } + default: + this->Makefile->IssueMessage(cmake::FATAL_ERROR, + "Only libraries may be used as try_compile IMPORTED " + "LINK_LIBRARIES. Got " + std::string(tgt->GetName()) + " of " + "type " + tgt->GetTargetTypeName(tgt->GetType()) + "."); + return -1; + } + if (tgt->IsImported()) { - continue; + targets.push_back(tgt); } - targets.push_back(tgt); } - break; + } + else if(doing == DoingOutputVariable) + { + outputVariable = argv[i].c_str(); + doing = DoingNone; + } + else if(doing == DoingCopyFile) + { + copyFile = argv[i].c_str(); + doing = DoingNone; + } + else if(i == 3) + { + this->SrcFileSignature = false; + projectName = argv[i].c_str(); + } + else if(i == 4 && !this->SrcFileSignature) + { + targetName = argv[i].c_str(); + } + else + { + cmOStringStream m; + m << "try_compile given unknown argument \"" << argv[i] << "\"."; + this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str()); } } - // look for COPY_FILE - std::string copyFile; - for (i = 3; i < argv.size(); ++i) + if(didCopyFile && copyFile.empty()) { - if (argv[i] == "COPY_FILE") - { - if ( argv.size() <= (i+1) ) - { - this->Makefile->IssueMessage(cmake::FATAL_ERROR, - "COPY_FILE specified but there is no variable"); - return -1; - } - extraArgs += 2; - copyFile = argv[i+1]; - break; - } + this->Makefile->IssueMessage(cmake::FATAL_ERROR, + "COPY_FILE must be followed by a file path"); + return -1; } - // do we have a srcfile signature - if (argv.size() - extraArgs == 3) + if(didOutputVariable && outputVariable.empty()) { - this->SrcFileSignature = true; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, + "OUTPUT_VARIABLE must be followed by a variable name"); + return -1; } // compute the binary dir when TRY_COMPILE is called with a src file @@ -179,10 +159,10 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) else { // only valid for srcfile signatures - if (compileFlags.size()) + if (compileDefs.size()) { this->Makefile->IssueMessage(cmake::FATAL_ERROR, - "COMPILE_FLAGS specified on a srcdir type TRY_COMPILE"); + "COMPILE_DEFINITIONS specified on a srcdir type TRY_COMPILE"); return -1; } if (copyFile.size()) @@ -297,12 +277,12 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) fprintf(fout, "SET(CMAKE_SUPPRESS_REGENERATION 1)\n"); fprintf(fout, "LINK_DIRECTORIES(${LINK_DIRECTORIES})\n"); // handle any compile flags we need to pass on - if (compileFlags.size()) + if (compileDefs.size()) { fprintf(fout, "ADD_DEFINITIONS( "); - for (i = 0; i < compileFlags.size(); ++i) + for (size_t i = 0; i < compileDefs.size(); ++i) { - fprintf(fout,"%s ",compileFlags[i].c_str()); + fprintf(fout,"%s ",compileDefs[i].c_str()); } fprintf(fout, ")\n"); } @@ -398,16 +378,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) } } - // else the srcdir bindir project target signature - else - { - projectName = argv[3].c_str(); - - if (argv.size() - extraArgs == 5) - { - targetName = argv[4].c_str(); - } - } bool erroroc = cmSystemTools::GetErrorOccuredFlag(); cmSystemTools::ResetErrorOccuredFlag(); diff --git a/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt b/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt index 096fd98..d65d9488 100644 --- a/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt +++ b/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt @@ -1,4 +1,4 @@ CMake Error at NoCopyFile.cmake:1 \(try_compile\): - COPY_FILE specified but there is no variable + COPY_FILE must be followed by a file path Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoCopyFile2-result.txt b/Tests/RunCMake/try_compile/NoCopyFile2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFile2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt b/Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt new file mode 100644 index 0000000..e889524 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoCopyFile2.cmake:1 \(try_compile\): + COPY_FILE must be followed by a file path +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoCopyFile2.cmake b/Tests/RunCMake/try_compile/NoCopyFile2.cmake new file mode 100644 index 0000000..04b7f68 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFile2.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + COPY_FILE CMAKE_FLAGS -DA=B) diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries-result.txt b/Tests/RunCMake/try_compile/NoLinkLibraries-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/try_compile/NoLinkLibraries-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt b/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt deleted file mode 100644 index 507dce0..0000000 --- a/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Error at NoLinkLibraries.cmake:1 \(try_compile\): - LINK_LIBRARIES specified but there is no content -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries.cmake b/Tests/RunCMake/try_compile/NoLinkLibraries.cmake deleted file mode 100644 index 04c5758..0000000 --- a/Tests/RunCMake/try_compile/NoLinkLibraries.cmake +++ /dev/null @@ -1,2 +0,0 @@ -try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c - LINK_LIBRARIES) diff --git a/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt b/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt index 77ede4c..18ad751 100644 --- a/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt +++ b/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt @@ -1,4 +1,4 @@ CMake Error at NoOutputVariable.cmake:1 \(try_compile\): - OUTPUT_VARIABLE specified but there is no variable + OUTPUT_VARIABLE must be followed by a variable name Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoOutputVariable2-result.txt b/Tests/RunCMake/try_compile/NoOutputVariable2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_compile/NoOutputVariable2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt b/Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt new file mode 100644 index 0000000..8b2cc25 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoOutputVariable2.cmake:1 \(try_compile\): + OUTPUT_VARIABLE must be followed by a variable name +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoOutputVariable2.cmake b/Tests/RunCMake/try_compile/NoOutputVariable2.cmake new file mode 100644 index 0000000..ad9ac9a --- /dev/null +++ b/Tests/RunCMake/try_compile/NoOutputVariable2.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + OUTPUT_VARIABLE CMAKE_FLAGS -DA=B) diff --git a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt index cf02efb..025e658 100644 --- a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt +++ b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt @@ -1,4 +1,4 @@ CMake Error at NonSourceCompileDefinitions.cmake:1 \(try_compile\): - COMPILE_FLAGS specified on a srcdir type TRY_COMPILE + COMPILE_DEFINITIONS specified on a srcdir type TRY_COMPILE Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index a4248ec..31643cf 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -4,8 +4,9 @@ run_cmake(NoArgs) run_cmake(OneArg) run_cmake(TwoArgs) run_cmake(NoCopyFile) +run_cmake(NoCopyFile2) run_cmake(NoOutputVariable) -run_cmake(NoLinkLibraries) +run_cmake(NoOutputVariable2) run_cmake(BadLinkLibraries) run_cmake(NonSourceCopyFile) run_cmake(NonSourceCompileDefinitions) -- cgit v0.12 From 86f5460398ed5fa024aed6cbe0d5862f76a14439 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sat, 1 Jun 2013 00:01:03 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 4722148..9836853 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130531) +set(CMake_VERSION_TWEAK 20130601) #set(CMake_VERSION_RC 1) -- cgit v0.12 From a4d8c64d10105fd4448ffde6a5d2fb74c1bb4f57 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sun, 2 Jun 2013 00:01:03 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 9836853..25d4e77 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130601) +set(CMake_VERSION_TWEAK 20130602) #set(CMake_VERSION_RC 1) -- cgit v0.12 From f3ad863ae6f0487bbf80d95b0d3f622840187a6a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 28 May 2013 17:44:35 +0200 Subject: VS6: Rename some variables to correspond to config values. This simplifies population of the compile flags. --- Source/cmLocalVisualStudio6Generator.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index dc94476..0a3728b 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -1639,9 +1639,9 @@ void cmLocalVisualStudio6Generator // store flags for each configuration std::string flags = " "; std::string flagsRelease = " "; - std::string flagsMinSize = " "; + std::string flagsMinSizeRel = " "; std::string flagsDebug = " "; - std::string flagsDebugRel = " "; + std::string flagsRelWithDebInfo = " "; if(target.GetType() >= cmTarget::EXECUTABLE && target.GetType() <= cmTarget::OBJECT_LIBRARY) { @@ -1664,16 +1664,16 @@ void cmLocalVisualStudio6Generator flagsRelease += " -DCMAKE_INTDIR=\\\"Release\\\" "; flagVar = baseFlagVar + "_MINSIZEREL"; - flagsMinSize = this->Makefile->GetSafeDefinition(flagVar.c_str()); - flagsMinSize += " -DCMAKE_INTDIR=\\\"MinSizeRel\\\" "; + flagsMinSizeRel = this->Makefile->GetSafeDefinition(flagVar.c_str()); + flagsMinSizeRel += " -DCMAKE_INTDIR=\\\"MinSizeRel\\\" "; flagVar = baseFlagVar + "_DEBUG"; flagsDebug = this->Makefile->GetSafeDefinition(flagVar.c_str()); flagsDebug += " -DCMAKE_INTDIR=\\\"Debug\\\" "; flagVar = baseFlagVar + "_RELWITHDEBINFO"; - flagsDebugRel = this->Makefile->GetSafeDefinition(flagVar.c_str()); - flagsDebugRel += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\" "; + flagsRelWithDebInfo = this->Makefile->GetSafeDefinition(flagVar.c_str()); + flagsRelWithDebInfo += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\" "; } // if _UNICODE and _SBCS are not found, then add -D_MBCS @@ -1731,19 +1731,19 @@ void cmLocalVisualStudio6Generator flags += defines; flagsDebug += debugDefines; flagsRelease += releaseDefines; - flagsMinSize += minsizeDefines; - flagsDebugRel += debugrelDefines; + flagsMinSizeRel += minsizeDefines; + flagsRelWithDebInfo += debugrelDefines; // The template files have CXX FLAGS in them, that need to be replaced. // There are not separate CXX and C template files, so we use the same // variable names. The previous code sets up flags* variables to contain // the correct C or CXX flags cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_MINSIZEREL", - flagsMinSize.c_str()); + flagsMinSizeRel.c_str()); cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_DEBUG", flagsDebug.c_str()); cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_RELWITHDEBINFO", - flagsDebugRel.c_str()); + flagsRelWithDebInfo.c_str()); cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_RELEASE", flagsRelease.c_str()); cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS", flags.c_str()); -- cgit v0.12 From 35496761a58956bd8c5ad65a3ed9ee78d09af56b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 16 May 2013 14:59:04 +0200 Subject: Add cmLocalGenerator::GetCompileOptions. Currently it only adds the contents of the COMPILE_FLAGS target property, but it can be extended to handle a new COMPILE_OPTIONS generator expression enabled property. --- Source/cmExtraSublimeTextGenerator.cxx | 8 +++++--- Source/cmGlobalXCodeGenerator.cxx | 6 ++++-- Source/cmLocalGenerator.cxx | 12 +++++++++++ Source/cmLocalGenerator.h | 3 +++ Source/cmLocalVisualStudio6Generator.cxx | 21 +++++++++++++++++++- Source/cmLocalVisualStudio7Generator.cxx | 4 +++- Source/cmMakefileTargetGenerator.cxx | 32 ++++++++++++++++++------------ Source/cmNinjaTargetGenerator.cxx | 10 ++++++---- Source/cmVisualStudio10TargetGenerator.cxx | 6 +++++- 9 files changed, 77 insertions(+), 25 deletions(-) diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 62e9194..29d86a6 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -429,7 +429,9 @@ cmExtraSublimeTextGenerator::ComputeFlagsForObject(cmSourceFile* source, lg->AppendFlags(flags, makefile->GetDefineFlags()); // Add target-specific flags. - if(target->GetProperty("COMPILE_FLAGS")) + std::string targetFlags; + lg->GetCompileOptions(targetFlags, target, config); + if (!targetFlags.empty()) { std::string langIncludeExpr = "CMAKE_"; langIncludeExpr += language; @@ -440,7 +442,7 @@ cmExtraSublimeTextGenerator::ComputeFlagsForObject(cmSourceFile* source, cmsys::RegularExpression r(regex); std::vector args; cmSystemTools:: - ParseWindowsCommandLine(target->GetProperty("COMPILE_FLAGS"), args); + ParseWindowsCommandLine(targetFlags.c_str(), args); for(std::vector::iterator i = args.begin(); i != args.end(); ++i) { @@ -452,7 +454,7 @@ cmExtraSublimeTextGenerator::ComputeFlagsForObject(cmSourceFile* source, } else { - lg->AppendFlags(flags, target->GetProperty("COMPILE_FLAGS")); + lg->AppendFlags(flags, targetFlags.c_str()); } } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index bb1e792..10de35a 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -681,9 +681,11 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg, { // Add flags from target and source file properties. std::string flags; - if(cmtarget.GetProperty("COMPILE_FLAGS")) + std::string targetFlags; + lg->GetCompileOptions(targetFlags, &cmtarget, 0); // TODO: Config? + if(!targetFlags.empty()) { - lg->AppendFlags(flags, cmtarget.GetProperty("COMPILE_FLAGS")); + lg->AppendFlags(flags, targetFlags.c_str()); } const char* srcfmt = sf->GetProperty("Fortran_FORMAT"); switch(this->CurrentLocalGenerator->GetFortranFormat(srcfmt)) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index d346f16..9429450 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1325,6 +1325,18 @@ std::string cmLocalGenerator::GetIncludeFlags( } //---------------------------------------------------------------------------- +void cmLocalGenerator::GetCompileOptions(std::string& flags, + cmTarget* target, + const char *config) +{ + // Add target-specific flags. + if(const char *prop = target->GetProperty("COMPILE_FLAGS")) + { + this->AppendFlags(flags, prop); + } +} + +//---------------------------------------------------------------------------- void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs, cmGeneratorTarget* target, const char* lang, diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index a1c34f0..28c88e6 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -215,6 +215,9 @@ public: cmGeneratorTarget* target, const char* lang = "C", const char *config = 0, bool stripImplicitInclDirs = true); + void GetCompileOptions(std::string& flags, + cmTarget* target, + const char *config); /** Compute the language used to compile the given source file. */ const char* GetSourceFileLanguage(const cmSourceFile& source); diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 0a3728b..4c78f7f 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -1686,12 +1686,31 @@ void cmLocalVisualStudio6Generator flags += " /D \"_MBCS\""; } + { + std::string targetFlags; + this->GetCompileOptions(targetFlags, &target, 0); // Add per-target flags. - if(const char* targetFlags = target.GetProperty("COMPILE_FLAGS")) + if(!targetFlags.empty()) { flags += " "; flags += targetFlags; } + } +#define ADD_FLAGS(CONFIG) \ + { \ + std::string targetFlags; \ + this->GetCompileOptions(targetFlags, &target, #CONFIG); \ + if(!targetFlags.empty()) \ + { \ + flags ## CONFIG += " "; \ + flags ## CONFIG += targetFlags; \ + } \ + } + + ADD_FLAGS(Debug) + ADD_FLAGS(Release) + ADD_FLAGS(MinSizeRel) + ADD_FLAGS(RelWithDebInfo) // Add per-target and per-configuration preprocessor definitions. std::set definesSet; diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 58d28da..e7badf0 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -723,8 +723,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, } } + std::string targetFlags; + this->GetCompileOptions(targetFlags, &target, configName); // Add the target-specific flags. - if(const char* targetFlags = target.GetProperty("COMPILE_FLAGS")) + if(!targetFlags.empty()) { flags += " "; flags += targetFlags; diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 4220ae1..d83d722 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -332,21 +332,25 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags() this->Makefile->GetSafeDefinition(compiler.c_str()) << "\n"; } + std::string targetFlags; for(std::set::const_iterator l = languages.begin(); l != languages.end(); ++l) { *this->FlagFileStream << *l << "_FLAGS = " << this->GetFlags(*l) << "\n\n"; *this->FlagFileStream << *l << "_DEFINES = " << this->GetDefines(*l) << "\n\n"; + std::string targetLangFlags; + this->LocalGenerator->GetCompileOptions(targetLangFlags, this->Target, + this->LocalGenerator->ConfigurationName.c_str()); + if (!targetFlags.empty() && targetFlags != targetLangFlags) + { + targetFlags += " " + targetLangFlags; + } } - // Add target-specific flags. - if(this->Target->GetProperty("COMPILE_FLAGS")) + if (!targetFlags.empty()) { - std::string flags; - this->LocalGenerator->AppendFlags - (flags, this->Target->GetProperty("COMPILE_FLAGS")); - *this->FlagFileStream << "# TARGET_FLAGS = " << flags << "\n\n"; + *this->FlagFileStream << "# TARGET_FLAGS = " << targetFlags << "\n\n"; } } @@ -532,8 +536,13 @@ cmMakefileTargetGenerator langFlags += "_FLAGS)"; this->LocalGenerator->AppendFlags(flags, langFlags.c_str()); - // Add target-specific flags. - if(this->Target->GetProperty("COMPILE_FLAGS")) + std::string configUpper = + cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName); + + std::string targetFlags; + this->LocalGenerator->GetCompileOptions(targetFlags, this->Target, + configUpper.c_str()); + if (!targetFlags.empty()) { std::string langIncludeExpr = "CMAKE_"; langIncludeExpr += lang; @@ -545,7 +554,7 @@ cmMakefileTargetGenerator cmsys::RegularExpression r(regex); std::vector args; cmSystemTools::ParseWindowsCommandLine( - this->Target->GetProperty("COMPILE_FLAGS"), + targetFlags.c_str(), args); for(std::vector::iterator i = args.begin(); i != args.end(); ++i) @@ -559,8 +568,7 @@ cmMakefileTargetGenerator } else { - this->LocalGenerator->AppendFlags - (flags, this->Target->GetProperty("COMPILE_FLAGS")); + this->LocalGenerator->AppendFlags(flags, targetFlags.c_str()); } } @@ -594,8 +602,6 @@ cmMakefileTargetGenerator << compile_defs << "\n" << "\n"; } - std::string configUpper = - cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName); std::string defPropName = "COMPILE_DEFINITIONS_"; defPropName += configUpper; if(const char* config_compile_defs = diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 850e5ea..141e014 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -151,9 +151,9 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source, this->GetConfigName()); // Add include directory flags. + const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); { std::vector includes; - const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); this->LocalGenerator->GetIncludeDirectories(includes, this->GeneratorTarget, language.c_str(), config); @@ -171,7 +171,9 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source, this->LocalGenerator->AppendFlags(flags, this->Makefile->GetDefineFlags()); // Add target-specific flags. - if(this->Target->GetProperty("COMPILE_FLAGS")) + std::string targetFlags; + this->LocalGenerator->GetCompileOptions(targetFlags, this->Target, config); + if(!targetFlags.empty()) { std::string langIncludeExpr = "CMAKE_"; langIncludeExpr += language; @@ -183,7 +185,7 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source, cmsys::RegularExpression r(regex); std::vector args; cmSystemTools::ParseWindowsCommandLine( - this->Target->GetProperty("COMPILE_FLAGS"), + targetFlags.c_str(), args); for(std::vector::iterator i = args.begin(); i != args.end(); ++i) @@ -198,7 +200,7 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source, else { this->LocalGenerator->AppendFlags - (flags, this->Target->GetProperty("COMPILE_FLAGS")); + (flags, targetFlags.c_str()); } } diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 88c4deb..341ef45 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1261,8 +1261,12 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( flags += " /TP "; } } + + std::string targetFlags; + this->LocalGenerator->GetCompileOptions(targetFlags, this->Target, + configName.c_str()); // Add the target-specific flags. - if(const char* targetFlags = this->Target->GetProperty("COMPILE_FLAGS")) + if(!targetFlags.empty()) { flags += " "; flags += targetFlags; -- cgit v0.12 From 1319a147bdc15f4a5a6a8dc56f0198600ff04c42 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 28 May 2013 12:17:25 +0200 Subject: Add _COMPILER_ID generator expressions. These expressions evaluate to the id of the compiler used to build the target, or can be used to test if the compiler id matches a specified value. --- Source/cmDocumentGeneratorExpressions.h | 8 +++ Source/cmGeneratorExpressionEvaluator.cxx | 102 ++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h index 656810d..a8b3847 100644 --- a/Source/cmDocumentGeneratorExpressions.h +++ b/Source/cmDocumentGeneratorExpressions.h @@ -40,6 +40,14 @@ "is exported using export(), or when the target is used by another " \ "target in the same buildsystem. Expands to the empty string " \ "otherwise.\n" \ + " $ = The CMake-id of the C compiler " \ + "used.\n" \ + " $ = '1' if the CMake-id of the C " \ + "compiler matches comp, otherwise '0'.\n" \ + " $ = The CMake-id of the CXX compiler " \ + "used.\n" \ + " $ = '1' if the CMake-id of the CXX " \ + "compiler matches comp, otherwise '0'.\n" \ " $ = main file (.exe, .so.1.2, .a)\n" \ " $ = file used to link (.a, .lib, .so)\n" \ " $ = file with soname (.so.3)\n" \ diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index df52368..f27761a 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -247,6 +247,104 @@ static const struct SemicolonNode : public cmGeneratorExpressionNode } semicolonNode; //---------------------------------------------------------------------------- +struct CompilerIdNode : public cmGeneratorExpressionNode +{ + CompilerIdNode() {} + + virtual int NumExpectedParameters() const { return ZeroOrMoreParameters; } + + std::string EvaluateWithLanguage(const std::vector ¶meters, + cmGeneratorExpressionContext *context, + const GeneratorExpressionContent *content, + cmGeneratorExpressionDAGChecker *, + const std::string &lang) const + { + const char *compilerId = context->Makefile ? + context->Makefile->GetSafeDefinition(( + "CMAKE_" + lang + "_COMPILER_ID").c_str()) : ""; + if (parameters.size() == 0) + { + return compilerId ? compilerId : ""; + } + else + { + cmsys::RegularExpression compilerIdValidator; + compilerIdValidator.compile("^[A-Za-z0-9_]*$"); + if (!compilerIdValidator.find(parameters.begin()->c_str())) + { + reportError(context, content->GetOriginalExpression(), + "Expression syntax not recognized."); + return std::string(); + } + if (!compilerId) + { + return parameters.front().empty() ? "1" : "0"; + } + + if (cmsysString_strcasecmp(parameters.begin()->c_str(), compilerId) == 0) + { + return "1"; + } + return "0"; + } + } +}; + +//---------------------------------------------------------------------------- +static const struct CCompilerIdNode : public CompilerIdNode +{ + CCompilerIdNode() {} + + std::string Evaluate(const std::vector ¶meters, + cmGeneratorExpressionContext *context, + const GeneratorExpressionContent *content, + cmGeneratorExpressionDAGChecker *dagChecker) const + { + if (parameters.size() != 0 && parameters.size() != 1) + { + reportError(context, content->GetOriginalExpression(), + "$ expression requires one or two parameters"); + return std::string(); + } + if (!context->HeadTarget) + { + reportError(context, content->GetOriginalExpression(), + "$ may only be used with targets. It may not " + "be used with add_custom_command."); + } + return this->EvaluateWithLanguage(parameters, context, content, + dagChecker, "C"); + } +} cCompilerIdNode; + +//---------------------------------------------------------------------------- +static const struct CXXCompilerIdNode : public CompilerIdNode +{ + CXXCompilerIdNode() {} + + std::string Evaluate(const std::vector ¶meters, + cmGeneratorExpressionContext *context, + const GeneratorExpressionContent *content, + cmGeneratorExpressionDAGChecker *dagChecker) const + { + if (parameters.size() != 0 && parameters.size() != 1) + { + reportError(context, content->GetOriginalExpression(), + "$ expression requires one or two parameters"); + return std::string(); + } + if (!context->HeadTarget) + { + reportError(context, content->GetOriginalExpression(), + "$ may only be used with targets. It may not " + "be used with add_custom_command."); + } + return this->EvaluateWithLanguage(parameters, context, content, + dagChecker, "CXX"); + } +} cxxCompilerIdNode; + +//---------------------------------------------------------------------------- static const struct ConfigurationNode : public cmGeneratorExpressionNode { ConfigurationNode() {} @@ -1055,6 +1153,10 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier) return &orNode; else if (identifier == "NOT") return ¬Node; + else if (identifier == "C_COMPILER_ID") + return &cCompilerIdNode; + else if (identifier == "CXX_COMPILER_ID") + return &cxxCompilerIdNode; else if (identifier == "CONFIGURATION") return &configurationNode; else if (identifier == "CONFIG") -- cgit v0.12 From 47f80d9c43eaa31c32b33a977bdbeda319671dd6 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 28 May 2013 12:32:39 +0200 Subject: cmTarget: Rename struct to be more re-usable. The same struct can be used to represent COMPILE_OPTIONS content. --- Source/cmTarget.cxx | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 75873ff..e728c55 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -130,19 +130,19 @@ public: typedef std::map SourceEntriesType; SourceEntriesType SourceEntries; - struct IncludeDirectoriesEntry { - IncludeDirectoriesEntry(cmsys::auto_ptr cge, + struct TargetPropertyEntry { + TargetPropertyEntry(cmsys::auto_ptr cge, const std::string &targetName = std::string()) : ge(cge), TargetName(targetName) {} const cmsys::auto_ptr ge; - std::vector CachedIncludes; + std::vector CachedEntries; const std::string TargetName; }; - std::vector IncludeDirectoriesEntries; + std::vector IncludeDirectoriesEntries; std::vector LinkInterfaceIncludeDirectoriesEntries; - std::map > + std::map > CachedLinkInterfaceIncludeDirectoriesEntries; std::map CachedLinkInterfaceCompileDefinitions; @@ -152,9 +152,9 @@ public: //---------------------------------------------------------------------------- void deleteAndClear( - std::vector &entries) + std::vector &entries) { - for (std::vector::const_iterator + for (std::vector::const_iterator it = entries.begin(), end = entries.end(); it != end; ++it) @@ -167,10 +167,10 @@ void deleteAndClear( //---------------------------------------------------------------------------- void deleteAndClear( std::map > &entries) + std::vector > &entries) { for (std::map >::iterator + std::vector >::iterator it = entries.begin(), end = entries.end(); it != end; ++it) { deleteAndClear(it->second); @@ -2728,7 +2728,7 @@ void cmTarget::SetProperty(const char* prop, const char* value) deleteAndClear(this->Internal->IncludeDirectoriesEntries); cmsys::auto_ptr cge = ge.Parse(value); this->Internal->IncludeDirectoriesEntries.push_back( - new cmTargetInternals::IncludeDirectoriesEntry(cge)); + new cmTargetInternals::TargetPropertyEntry(cge)); return; } if(strcmp(prop,"EXPORT_NAME") == 0 && this->IsImported()) @@ -2770,7 +2770,7 @@ void cmTarget::AppendProperty(const char* prop, const char* value, this->Makefile->GetBacktrace(lfbt); cmGeneratorExpression ge(lfbt); this->Internal->IncludeDirectoriesEntries.push_back( - new cmTargetInternals::IncludeDirectoriesEntry(ge.Parse(value))); + new cmTargetInternals::TargetPropertyEntry(ge.Parse(value))); return; } if(strcmp(prop,"EXPORT_NAME") == 0 && this->IsImported()) @@ -2854,17 +2854,17 @@ void cmTarget::InsertInclude(const cmValueWithOrigin &entry, { cmGeneratorExpression ge(entry.Backtrace); - std::vector::iterator position + std::vector::iterator position = before ? this->Internal->IncludeDirectoriesEntries.begin() : this->Internal->IncludeDirectoriesEntries.end(); this->Internal->IncludeDirectoriesEntries.insert(position, - new cmTargetInternals::IncludeDirectoriesEntry(ge.Parse(entry.Value))); + new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry.Value))); } //---------------------------------------------------------------------------- static void processIncludeDirectories(cmTarget *tgt, - const std::vector &entries, + const std::vector &entries, std::vector &includes, std::set &uniqueIncludes, cmGeneratorExpressionDAGChecker *dagChecker, @@ -2872,12 +2872,12 @@ static void processIncludeDirectories(cmTarget *tgt, { cmMakefile *mf = tgt->GetMakefile(); - for (std::vector::const_iterator + for (std::vector::const_iterator it = entries.begin(), end = entries.end(); it != end; ++it) { bool testIsOff = true; bool cacheIncludes = false; - std::vector entryIncludes = (*it)->CachedIncludes; + std::vector entryIncludes = (*it)->CachedEntries; if(!entryIncludes.empty()) { testIsOff = false; @@ -2980,7 +2980,7 @@ static void processIncludeDirectories(cmTarget *tgt, } if (cacheIncludes) { - (*it)->CachedIncludes = entryIncludes; + (*it)->CachedEntries = entryIncludes; } if (!usedIncludes.empty()) { @@ -3066,7 +3066,7 @@ std::vector cmTarget::GetIncludeDirectories(const char *config) this->Internal ->CachedLinkInterfaceIncludeDirectoriesEntries[configString].push_back( - new cmTargetInternals::IncludeDirectoriesEntry(cge, + new cmTargetInternals::TargetPropertyEntry(cge, it->Value)); } } @@ -3512,9 +3512,9 @@ const char *cmTarget::GetProperty(const char* prop, static std::string output; output = ""; std::string sep; - typedef cmTargetInternals::IncludeDirectoriesEntry - IncludeDirectoriesEntry; - for (std::vector::const_iterator + typedef cmTargetInternals::TargetPropertyEntry + TargetPropertyEntry; + for (std::vector::const_iterator it = this->Internal->IncludeDirectoriesEntries.begin(), end = this->Internal->IncludeDirectoriesEntries.end(); it != end; ++it) -- cgit v0.12 From 7cb23084b2595d06aea46cead0e077b5f13aeddb Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 28 May 2013 12:39:32 +0200 Subject: cmTarget: Rename LinkInterfaceIncludeDirectoriesEntries This can be used for COMPILE_OPTIONS too. --- Source/cmTarget.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index e728c55..a54f80b 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -140,7 +140,7 @@ public: const std::string TargetName; }; std::vector IncludeDirectoriesEntries; - std::vector LinkInterfaceIncludeDirectoriesEntries; + std::vector LinkInterfacePropertyEntries; std::map > CachedLinkInterfaceIncludeDirectoriesEntries; @@ -2741,14 +2741,14 @@ void cmTarget::SetProperty(const char* prop, const char* value) } if (strcmp(prop, "LINK_LIBRARIES") == 0) { - this->Internal->LinkInterfaceIncludeDirectoriesEntries.clear(); + 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->LinkInterfaceIncludeDirectoriesEntries.push_back(entry); + this->Internal->LinkInterfacePropertyEntries.push_back(entry); } // Fall through } @@ -2789,7 +2789,7 @@ void cmTarget::AppendProperty(const char* prop, const char* value, cmListFileBacktrace lfbt; this->Makefile->GetBacktrace(lfbt); cmValueWithOrigin entry(value, lfbt); - this->Internal->LinkInterfaceIncludeDirectoriesEntries.push_back(entry); + this->Internal->LinkInterfacePropertyEntries.push_back(entry); } // Fall through } @@ -3036,8 +3036,8 @@ std::vector cmTarget::GetIncludeDirectories(const char *config) if (!this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[configString]) { for (std::vector::const_iterator - it = this->Internal->LinkInterfaceIncludeDirectoriesEntries.begin(), - end = this->Internal->LinkInterfaceIncludeDirectoriesEntries.end(); + it = this->Internal->LinkInterfacePropertyEntries.begin(), + end = this->Internal->LinkInterfacePropertyEntries.end(); it != end; ++it) { { -- cgit v0.12 From 80ca9c4b41ecdce069a6c3f4c1b558084a748876 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 16 May 2013 15:15:28 +0200 Subject: Add COMPILE_OPTIONS target property. This method reads generator expressions from the COMPILE_OPTIONS target property, as well as INTERFACE_COMPILE_OPTIONS from linked dependents. --- Source/cmGeneratorExpressionDAGChecker.cxx | 8 ++ Source/cmGeneratorExpressionDAGChecker.h | 1 + Source/cmGeneratorExpressionEvaluator.cxx | 9 +- Source/cmLocalGenerator.cxx | 8 ++ Source/cmTarget.cxx | 224 +++++++++++++++++++++++++++++ Source/cmTarget.h | 4 + Tests/CMakeLists.txt | 1 + Tests/CompileOptions/CMakeLists.txt | 16 +++ Tests/CompileOptions/main.cpp | 11 ++ Tests/CompileOptions/other.cpp | 5 + 10 files changed, 286 insertions(+), 1 deletion(-) create mode 100644 Tests/CompileOptions/CMakeLists.txt create mode 100644 Tests/CompileOptions/main.cpp create mode 100644 Tests/CompileOptions/other.cpp diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx index 5cb50b9..e5ffb0c 100644 --- a/Source/cmGeneratorExpressionDAGChecker.cxx +++ b/Source/cmGeneratorExpressionDAGChecker.cxx @@ -168,3 +168,11 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingCompileDefinitions() const || strcmp(prop, "INTERFACE_COMPILE_DEFINITIONS") == 0 || strncmp(prop, "COMPILE_DEFINITIONS_", 20) == 0); } + +//---------------------------------------------------------------------------- +bool cmGeneratorExpressionDAGChecker::EvaluatingCompileOptions() const +{ + const char *prop = this->Property.c_str(); + return (strcmp(prop, "COMPILE_OPTIONS") == 0 + || strcmp(prop, "INTERFACE_COMPILE_OPTIONS") == 0 ); +} diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h index 62a5cdf..8d9fd76 100644 --- a/Source/cmGeneratorExpressionDAGChecker.h +++ b/Source/cmGeneratorExpressionDAGChecker.h @@ -40,6 +40,7 @@ struct cmGeneratorExpressionDAGChecker bool EvaluatingLinkLibraries(); bool EvaluatingIncludeDirectories() const; bool EvaluatingCompileDefinitions() const; + bool EvaluatingCompileOptions() const; private: Result checkGraph() const; diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index f27761a..5e7d00d 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -495,6 +495,7 @@ static const struct JoinNode : public cmGeneratorExpressionNode static const char* targetPropertyTransitiveWhitelist[] = { "INTERFACE_INCLUDE_DIRECTORIES" , "INTERFACE_COMPILE_DEFINITIONS" + , "INTERFACE_COMPILE_OPTIONS" }; std::string getLinkedTargetsContent(const std::vector &libraries, @@ -702,7 +703,8 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode else { assert(dagCheckerParent->EvaluatingIncludeDirectories() - || dagCheckerParent->EvaluatingCompileDefinitions()); + || dagCheckerParent->EvaluatingCompileDefinitions() + || dagCheckerParent->EvaluatingCompileOptions()); } } @@ -721,6 +723,11 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode { interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS"; } + else if (propertyName == "INTERFACE_COMPILE_OPTIONS" + || propertyName == "COMPILE_OPTIONS") + { + interfacePropertyName = "INTERFACE_COMPILE_OPTIONS"; + } const char **transBegin = targetPropertyTransitiveWhitelist; const char **transEnd = targetPropertyTransitiveWhitelist diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 9429450..57e25a1 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1334,6 +1334,14 @@ void cmLocalGenerator::GetCompileOptions(std::string& flags, { this->AppendFlags(flags, prop); } + + std::vector opts; // TODO: Emitted. + target->GetCompileOptions(opts, config); + for(std::vector::const_iterator li = opts.begin(); + li != opts.end(); ++li) + { + this->AppendFlags(flags, li->c_str()); + } } //---------------------------------------------------------------------------- diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index a54f80b..ea5552e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -140,14 +140,18 @@ public: const std::string TargetName; }; std::vector IncludeDirectoriesEntries; + std::vector CompileOptionsEntries; std::vector LinkInterfacePropertyEntries; std::map > CachedLinkInterfaceIncludeDirectoriesEntries; + std::map > + CachedLinkInterfaceCompileOptionsEntries; std::map CachedLinkInterfaceCompileDefinitions; std::map CacheLinkInterfaceIncludeDirectoriesDone; std::map CacheLinkInterfaceCompileDefinitionsDone; + std::map CacheLinkInterfaceCompileOptionsDone; }; //---------------------------------------------------------------------------- @@ -181,6 +185,7 @@ void deleteAndClear( cmTargetInternals::~cmTargetInternals() { deleteAndClear(this->CachedLinkInterfaceIncludeDirectoriesEntries); + deleteAndClear(this->CachedLinkInterfaceCompileOptionsEntries); } //---------------------------------------------------------------------------- @@ -199,6 +204,7 @@ cmTarget::cmTarget() this->IsImportedTarget = false; this->BuildInterfaceIncludesAppended = false; this->DebugIncludesDone = false; + this->DebugCompileOptionsDone = false; } //---------------------------------------------------------------------------- @@ -287,6 +293,32 @@ void cmTarget::DefineProperties(cmake *cm) "This is the configuration-specific version of COMPILE_DEFINITIONS."); cm->DefineProperty + ("COMPILE_OPTIONS", cmProperty::TARGET, + "List of options to pass to the compiler.", + "This property specifies the list of options specified " + "so far for this property. " + "This property exists on targets only. " + "\n" + "The target property values are used by the generators to set " + "the options for the compiler.\n" + "Contents of COMPILE_OPTIONS may use \"generator expressions\" with " + "the syntax \"$<...>\". " + CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS + CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS); + + cm->DefineProperty + ("INTERFACE_COMPILE_OPTIONS", cmProperty::TARGET, + "List of interface options to pass to the compiler.", + "Targets may populate this property to publish the compile options " + "required to compile against the headers for the target. Consuming " + "targets can add entries to their own COMPILE_OPTIONS property such " + "as $ to use the " + "compile options specified in the interface of 'foo'." + "\n" + CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS + CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS); + + cm->DefineProperty ("DEFINE_SYMBOL", cmProperty::TARGET, "Define a symbol when compiling this target's sources.", "DEFINE_SYMBOL sets the name of the preprocessor symbol defined when " @@ -2731,6 +2763,17 @@ void cmTarget::SetProperty(const char* prop, const char* value) new cmTargetInternals::TargetPropertyEntry(cge)); return; } + if(strcmp(prop,"COMPILE_OPTIONS") == 0) + { + cmListFileBacktrace lfbt; + this->Makefile->GetBacktrace(lfbt); + cmGeneratorExpression ge(lfbt); + deleteAndClear(this->Internal->CompileOptionsEntries); + cmsys::auto_ptr cge = ge.Parse(value); + this->Internal->CompileOptionsEntries.push_back( + new cmTargetInternals::TargetPropertyEntry(cge)); + return; + } if(strcmp(prop,"EXPORT_NAME") == 0 && this->IsImported()) { cmOStringStream e; @@ -2773,6 +2816,15 @@ void cmTarget::AppendProperty(const char* prop, const char* value, new cmTargetInternals::TargetPropertyEntry(ge.Parse(value))); return; } + if(strcmp(prop,"COMPILE_OPTIONS") == 0) + { + cmListFileBacktrace lfbt; + this->Makefile->GetBacktrace(lfbt); + cmGeneratorExpression ge(lfbt); + this->Internal->CompileOptionsEntries.push_back( + new cmTargetInternals::TargetPropertyEntry(ge.Parse(value))); + return; + } if(strcmp(prop,"EXPORT_NAME") == 0 && this->IsImported()) { cmOStringStream e; @@ -3094,6 +3146,159 @@ std::vector cmTarget::GetIncludeDirectories(const char *config) } //---------------------------------------------------------------------------- +static void processCompileOptions(cmTarget *tgt, + const std::vector &entries, + std::vector &options, + std::set &uniqueOptions, + cmGeneratorExpressionDAGChecker *dagChecker, + const char *config, bool debugOptions) +{ + cmMakefile *mf = tgt->GetMakefile(); + + for (std::vector::const_iterator + it = entries.begin(), end = entries.end(); it != end; ++it) + { + bool cacheOptions = false; + std::vector entryOptions = (*it)->CachedEntries; + if(entryOptions.empty()) + { + cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf, + config, + false, + tgt, + dagChecker), + entryOptions); + if (mf->IsGeneratingBuildSystem() + && !(*it)->ge->GetHadContextSensitiveCondition()) + { + cacheOptions = true; + } + } + std::string usedOptions; + for(std::vector::iterator + li = entryOptions.begin(); li != entryOptions.end(); ++li) + { + std::string opt = *li; + + if(uniqueOptions.insert(opt).second) + { + options.push_back(opt); + if (debugOptions) + { + usedOptions += " * " + opt + "\n"; + } + } + } + if (cacheOptions) + { + (*it)->CachedEntries = entryOptions; + } + if (!usedOptions.empty()) + { + mf->GetCMakeInstance()->IssueMessage(cmake::LOG, + std::string("Used compile options for target ") + + tgt->GetName() + ":\n" + + usedOptions, (*it)->ge->GetBacktrace()); + } + } +} + +//---------------------------------------------------------------------------- +void cmTarget::GetCompileOptions(std::vector &result, + const char *config) +{ + std::set uniqueOptions; + cmListFileBacktrace lfbt; + + cmGeneratorExpressionDAGChecker dagChecker(lfbt, + this->GetName(), + "COMPILE_OPTIONS", 0, 0); + + std::vector debugProperties; + const char *debugProp = + this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES"); + if (debugProp) + { + cmSystemTools::ExpandListArgument(debugProp, debugProperties); + } + + bool debugOptions = !this->DebugCompileOptionsDone + && std::find(debugProperties.begin(), + debugProperties.end(), + "COMPILE_OPTIONS") + != debugProperties.end(); + + if (this->Makefile->IsGeneratingBuildSystem()) + { + this->DebugCompileOptionsDone = true; + } + + processCompileOptions(this, + this->Internal->CompileOptionsEntries, + result, + uniqueOptions, + &dagChecker, + config, + debugOptions); + + std::string configString = config ? config : ""; + if (!this->Internal->CacheLinkInterfaceCompileOptionsDone[configString]) + { + for (std::vector::const_iterator + it = this->Internal->LinkInterfacePropertyEntries.begin(), + end = this->Internal->LinkInterfacePropertyEntries.end(); + it != end; ++it) + { + { + cmGeneratorExpression ge(lfbt); + cmsys::auto_ptr cge = + ge.Parse(it->Value); + std::string targetResult = cge->Evaluate(this->Makefile, config, + false, this, 0, 0); + if (!this->Makefile->FindTargetToUse(targetResult.c_str())) + { + continue; + } + } + std::string optionGenex = "$Value + ",INTERFACE_COMPILE_OPTIONS>"; + if (cmGeneratorExpression::Find(it->Value) != std::string::npos) + { + // Because it->Value is a generator expression, ensure that it + // evaluates to the non-empty string before being used in the + // TARGET_PROPERTY expression. + optionGenex = "$<$Value + ">:" + optionGenex + ">"; + } + cmGeneratorExpression ge(it->Backtrace); + cmsys::auto_ptr cge = ge.Parse( + optionGenex); + + this->Internal + ->CachedLinkInterfaceCompileOptionsEntries[configString].push_back( + new cmTargetInternals::TargetPropertyEntry(cge, + it->Value)); + } + } + + processCompileOptions(this, + this->Internal->CachedLinkInterfaceCompileOptionsEntries[configString], + result, + uniqueOptions, + &dagChecker, + config, + debugOptions); + + if (!this->Makefile->IsGeneratingBuildSystem()) + { + deleteAndClear(this->Internal->CachedLinkInterfaceCompileOptionsEntries); + } + else + { + this->Internal->CacheLinkInterfaceCompileOptionsDone[configString] = true; + } +} + +//---------------------------------------------------------------------------- std::string cmTarget::GetCompileDefinitions(const char *config) { const char *configProp = 0; @@ -3525,6 +3730,24 @@ const char *cmTarget::GetProperty(const char* prop, } return output.c_str(); } + if(strcmp(prop,"COMPILE_OPTIONS") == 0) + { + static std::string output; + output = ""; + std::string sep; + typedef cmTargetInternals::TargetPropertyEntry + TargetPropertyEntry; + for (std::vector::const_iterator + it = this->Internal->CompileOptionsEntries.begin(), + end = this->Internal->CompileOptionsEntries.end(); + it != end; ++it) + { + output += sep; + output += (*it)->ge->GetInput(); + sep = ";"; + } + return output.c_str(); + } if (strcmp(prop,"IMPORTED") == 0) { @@ -6109,6 +6332,7 @@ cmTargetInternalPointer cmTargetInternalPointer::~cmTargetInternalPointer() { deleteAndClear(this->Pointer->IncludeDirectoriesEntries); + deleteAndClear(this->Pointer->CompileOptionsEntries); delete this->Pointer; } diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 508fc11..7ec10df 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -503,6 +503,9 @@ public: void AppendBuildInterfaceIncludes(); + void GetCompileOptions(std::vector &result, + const char *config); + bool IsNullImpliedByLinkLibraries(const std::string &p); bool IsLinkInterfaceDependentBoolProperty(const std::string &p, const char *config); @@ -627,6 +630,7 @@ private: bool IsApple; bool IsImportedTarget; bool DebugIncludesDone; + bool DebugCompileOptionsDone; mutable std::set LinkImplicitNullProperties; bool BuildInterfaceIncludesAppended; diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 0b221e8..3a28be2 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -245,6 +245,7 @@ if(BUILD_TESTING) ADD_TEST_MACRO(PolicyScope PolicyScope) ADD_TEST_MACRO(EmptyLibrary EmptyLibrary) ADD_TEST_MACRO(CompileDefinitions CompileDefinitions) + ADD_TEST_MACRO(CompileOptions CompileOptions) ADD_TEST_MACRO(CompatibleInterface CompatibleInterface) set_tests_properties(EmptyLibrary PROPERTIES PASS_REGULAR_EXPRESSION "CMake Error: CMake can not determine linker language for target:test") diff --git a/Tests/CompileOptions/CMakeLists.txt b/Tests/CompileOptions/CMakeLists.txt new file mode 100644 index 0000000..6d8a96a --- /dev/null +++ b/Tests/CompileOptions/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 2.8) + +project(CompileOptions) + +add_library(testlib other.cpp) + +add_executable(CompileOptions main.cpp) +set_property(TARGET CompileOptions PROPERTY COMPILE_OPTIONS "$<$:-DTEST_DEFINE>") +target_link_libraries(CompileOptions testlib) + +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + target_compile_definitions(CompileOptions + PRIVATE + "DO_GNU_TESTS" + ) +endif() diff --git a/Tests/CompileOptions/main.cpp b/Tests/CompileOptions/main.cpp new file mode 100644 index 0000000..0d39050 --- /dev/null +++ b/Tests/CompileOptions/main.cpp @@ -0,0 +1,11 @@ + +#ifdef DO_GNU_TESTS +# ifndef TEST_DEFINE +# error Expected TEST_DEFINE +# endif +#endif + +int main(int argc, char **argv) +{ + return 0; +} diff --git a/Tests/CompileOptions/other.cpp b/Tests/CompileOptions/other.cpp new file mode 100644 index 0000000..0e34375 --- /dev/null +++ b/Tests/CompileOptions/other.cpp @@ -0,0 +1,5 @@ + +void foo(void) +{ + +} -- cgit v0.12 From 24466f22c0c0e3235f0a21bd2a298c39df50e2f3 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 16 May 2013 15:20:16 +0200 Subject: Add target_compile_options command. This command populates the COMPILE_OPTIONS target property. --- Source/cmCommands.cxx | 2 + Source/cmTarget.cxx | 14 ++++ Source/cmTarget.h | 2 + Source/cmTargetCompileOptionsCommand.cxx | 62 +++++++++++++++ Source/cmTargetCompileOptionsCommand.h | 90 ++++++++++++++++++++++ .../target_compile_options/CMakeLists.txt | 35 +++++++++ .../target_compile_options/consumer.cpp | 18 +++++ .../CMakeCommands/target_compile_options/main.cpp | 18 +++++ Tests/CMakeLists.txt | 1 + 9 files changed, 242 insertions(+) create mode 100644 Source/cmTargetCompileOptionsCommand.cxx create mode 100644 Source/cmTargetCompileOptionsCommand.h create mode 100644 Tests/CMakeCommands/target_compile_options/CMakeLists.txt create mode 100644 Tests/CMakeCommands/target_compile_options/consumer.cpp create mode 100644 Tests/CMakeCommands/target_compile_options/main.cpp diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index 227b226..75f2ae8 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -29,6 +29,7 @@ #include "cmSourceGroupCommand.cxx" #include "cmSubdirDependsCommand.cxx" #include "cmTargetCompileDefinitionsCommand.cxx" +#include "cmTargetCompileOptionsCommand.cxx" #include "cmTargetIncludeDirectoriesCommand.cxx" #include "cmTargetPropCommandBase.cxx" #include "cmUseMangledMesaCommand.cxx" @@ -71,6 +72,7 @@ void GetPredefinedCommands(std::list& commands.push_back(new cmSubdirDependsCommand); commands.push_back(new cmTargetIncludeDirectoriesCommand); commands.push_back(new cmTargetCompileDefinitionsCommand); + commands.push_back(new cmTargetCompileOptionsCommand); commands.push_back(new cmUseMangledMesaCommand); commands.push_back(new cmUtilitySourceCommand); commands.push_back(new cmVariableRequiresCommand); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ea5552e..1f20be2 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2915,6 +2915,20 @@ void cmTarget::InsertInclude(const cmValueWithOrigin &entry, } //---------------------------------------------------------------------------- +void cmTarget::InsertCompileOption(const cmValueWithOrigin &entry, + bool before) +{ + cmGeneratorExpression ge(entry.Backtrace); + + std::vector::iterator position + = before ? this->Internal->CompileOptionsEntries.begin() + : this->Internal->CompileOptionsEntries.end(); + + this->Internal->CompileOptionsEntries.insert(position, + new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry.Value))); +} + +//---------------------------------------------------------------------------- static void processIncludeDirectories(cmTarget *tgt, const std::vector &entries, std::vector &includes, diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 7ec10df..b3d1131 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -500,6 +500,8 @@ public: std::vector GetIncludeDirectories(const char *config); void InsertInclude(const cmValueWithOrigin &entry, bool before = false); + void InsertCompileOption(const cmValueWithOrigin &entry, + bool before = false); void AppendBuildInterfaceIncludes(); diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx new file mode 100644 index 0000000..e80c845 --- /dev/null +++ b/Source/cmTargetCompileOptionsCommand.cxx @@ -0,0 +1,62 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2013 Stephen Kelly + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#include "cmTargetCompileOptionsCommand.h" + +bool cmTargetCompileOptionsCommand +::InitialPass(std::vector const& args, cmExecutionStatus &) +{ + return this->HandleArguments(args, "COMPILE_OPTIONS", PROCESS_BEFORE); +} + +void cmTargetCompileOptionsCommand +::HandleImportedTarget(const std::string &tgt) +{ + cmOStringStream e; + e << "Cannot specify compile options for imported target \"" + << tgt << "\"."; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); +} + +void cmTargetCompileOptionsCommand +::HandleMissingTarget(const std::string &name) +{ + cmOStringStream e; + e << "Cannot specify compile options for target \"" << name << "\" " + "which is not built by this project."; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); +} + +//---------------------------------------------------------------------------- +std::string cmTargetCompileOptionsCommand +::Join(const std::vector &content) +{ + std::string defs; + std::string sep; + for(std::vector::const_iterator it = content.begin(); + it != content.end(); ++it) + { + defs += sep + *it; + sep = ";"; + } + return defs; +} + +//---------------------------------------------------------------------------- +void cmTargetCompileOptionsCommand +::HandleDirectContent(cmTarget *tgt, const std::vector &content, + bool) +{ + cmListFileBacktrace lfbt; + this->Makefile->GetBacktrace(lfbt); + cmValueWithOrigin entry(this->Join(content), lfbt); + tgt->InsertCompileOption(entry); +} diff --git a/Source/cmTargetCompileOptionsCommand.h b/Source/cmTargetCompileOptionsCommand.h new file mode 100644 index 0000000..87fa1a7 --- /dev/null +++ b/Source/cmTargetCompileOptionsCommand.h @@ -0,0 +1,90 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2013 Stephen Kelly + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ + +#ifndef cmTargetCompileOptionsCommand_h +#define cmTargetCompileOptionsCommand_h + +#include "cmTargetPropCommandBase.h" + +class cmTargetCompileOptionsCommand : public cmTargetPropCommandBase +{ +public: + /** + * This is a virtual constructor for the command. + */ + virtual cmCommand* Clone() + { + return new cmTargetCompileOptionsCommand; + } + + /** + * This is called when the command is first encountered in + * the CMakeLists.txt file. + */ + virtual bool InitialPass(std::vector const& args, + cmExecutionStatus &status); + + /** + * The name of the command as specified in CMakeList.txt. + */ + virtual const char* GetName() const { return "target_compile_options";} + + /** + * Succinct documentation. + */ + virtual const char* GetTerseDocumentation() const + { + return + "Add compile options to a target."; + } + + /** + * More documentation. + */ + virtual const char* GetFullDocumentation() const + { + return + " target_compile_options( [BEFORE] " + " [items1...]\n" + " [ [items2...] ...])\n" + "Specify compile options to use when compiling a given target. " + "The named must have been created by a command such as " + "add_executable or add_library and must not be an IMPORTED target. " + "If BEFORE is specified, the content will be prepended to the property " + "instead of being appended.\n" + "The INTERFACE, PUBLIC and PRIVATE keywords are required to specify " + "the scope of the following arguments. PRIVATE and PUBLIC items will " + "populate the COMPILE_OPTIONS property of . PUBLIC and " + "INTERFACE items will populate the INTERFACE_COMPILE_OPTIONS " + "property of . " + "The following arguments specify compile opitions. " + "Repeated calls for the same append items in the order called." + "\n" + "Arguments to target_compile_options may use \"generator " + "expressions\" with the syntax \"$<...>\". " + CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS + ; + } + + cmTypeMacro(cmTargetCompileOptionsCommand, cmTargetPropCommandBase); + +private: + virtual void HandleImportedTarget(const std::string &tgt); + virtual void HandleMissingTarget(const std::string &name); + + virtual void HandleDirectContent(cmTarget *tgt, + const std::vector &content, + bool prepend); + virtual std::string Join(const std::vector &content); +}; + +#endif diff --git a/Tests/CMakeCommands/target_compile_options/CMakeLists.txt b/Tests/CMakeCommands/target_compile_options/CMakeLists.txt new file mode 100644 index 0000000..06a48fb --- /dev/null +++ b/Tests/CMakeCommands/target_compile_options/CMakeLists.txt @@ -0,0 +1,35 @@ + +cmake_minimum_required(VERSION 2.8) + +project(target_compile_options) + +add_executable(target_compile_options + "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" +) +target_compile_options(target_compile_options + PRIVATE $<$:-DMY_PRIVATE_DEFINE> + PUBLIC $<$:-DMY_PUBLIC_DEFINE> + INTERFACE $<$:-DMY_INTERFACE_DEFINE> +) + +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + target_compile_definitions(target_compile_options + PRIVATE + "DO_GNU_TESTS" + ) +endif() + +add_executable(consumer + "${CMAKE_CURRENT_SOURCE_DIR}/consumer.cpp" +) + +target_compile_options(consumer + PRIVATE $<$:$> +) + +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + target_compile_definitions(consumer + PRIVATE + "DO_GNU_TESTS" + ) +endif() diff --git a/Tests/CMakeCommands/target_compile_options/consumer.cpp b/Tests/CMakeCommands/target_compile_options/consumer.cpp new file mode 100644 index 0000000..1299606 --- /dev/null +++ b/Tests/CMakeCommands/target_compile_options/consumer.cpp @@ -0,0 +1,18 @@ + +#ifdef DO_GNU_TESTS + +# ifdef MY_PRIVATE_DEFINE +# error Unexpected MY_PRIVATE_DEFINE +# endif + +# ifndef MY_PUBLIC_DEFINE +# error Expected MY_PUBLIC_DEFINE +# endif + +# ifndef MY_INTERFACE_DEFINE +# error Expected MY_INTERFACE_DEFINE +# endif + +#endif + +int main() { return 0; } diff --git a/Tests/CMakeCommands/target_compile_options/main.cpp b/Tests/CMakeCommands/target_compile_options/main.cpp new file mode 100644 index 0000000..961c06d --- /dev/null +++ b/Tests/CMakeCommands/target_compile_options/main.cpp @@ -0,0 +1,18 @@ + +#ifdef DO_GNU_TESTS + +# ifndef MY_PRIVATE_DEFINE +# error Expected MY_PRIVATE_DEFINE +# endif + +# ifndef MY_PUBLIC_DEFINE +# error Expected MY_PUBLIC_DEFINE +# endif + +# ifdef MY_INTERFACE_DEFINE +# error Unexpected MY_INTERFACE_DEFINE +# endif + +#endif + +int main() { return 0; } diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 3a28be2..e16fd01 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1967,6 +1967,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ADD_TEST_MACRO(CMakeCommands.target_link_libraries target_link_libraries) ADD_TEST_MACRO(CMakeCommands.target_include_directories target_include_directories) ADD_TEST_MACRO(CMakeCommands.target_compile_definitions target_compile_definitions) + ADD_TEST_MACRO(CMakeCommands.target_compile_options target_compile_options) configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestCrash/test.cmake.in" -- cgit v0.12 From 0e9f4bc00c6b26f254e74063e4026ac33b786513 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 18 May 2013 12:12:18 +0200 Subject: Introduce target property _VISIBILITY_PRESET This is initialized by CMAKE__VISIBILITY_PRESET. The target property is used as the operand to the -fvisibility= compile option with GNU compilers and clang. --- Modules/Compiler/Clang.cmake | 1 + Modules/Compiler/GNU.cmake | 3 ++ Modules/Compiler/Intel-C.cmake | 4 ++ Modules/Compiler/Intel-CXX.cmake | 4 ++ Source/cmGlobalXCodeGenerator.cxx | 3 ++ Source/cmLocalGenerator.cxx | 48 ++++++++++++++++++++++ Source/cmLocalGenerator.h | 2 + Source/cmMakefileTargetGenerator.cxx | 3 ++ Source/cmNinjaTargetGenerator.cxx | 3 ++ Source/cmTarget.cxx | 21 ++++++++++ Tests/Module/GenerateExportHeader/CMakeLists.txt | 2 + .../visibility_preset/CMakeLists.txt | 13 ++++++ .../visibility_preset/main.cpp | 9 ++++ .../visibility_preset/visibility_preset.cpp | 7 ++++ .../visibility_preset/visibility_preset.h | 13 ++++++ Tests/RunCMake/CMakeLists.txt | 16 ++++++++ Tests/RunCMake/VisibilityPreset/CMakeLists.txt | 8 ++++ .../VisibilityPreset/PropertyTypo-result.txt | 1 + .../VisibilityPreset/PropertyTypo-stderr.txt | 1 + Tests/RunCMake/VisibilityPreset/PropertyTypo.cmake | 3 ++ Tests/RunCMake/VisibilityPreset/RunCMakeTest.cmake | 3 ++ Tests/RunCMake/VisibilityPreset/lib.cpp | 5 +++ 22 files changed, 173 insertions(+) create mode 100644 Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt create mode 100644 Tests/Module/GenerateExportHeader/visibility_preset/main.cpp create mode 100644 Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.cpp create mode 100644 Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.h create mode 100644 Tests/RunCMake/VisibilityPreset/CMakeLists.txt create mode 100644 Tests/RunCMake/VisibilityPreset/PropertyTypo-result.txt create mode 100644 Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt create mode 100644 Tests/RunCMake/VisibilityPreset/PropertyTypo.cmake create mode 100644 Tests/RunCMake/VisibilityPreset/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/VisibilityPreset/lib.cpp diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake index c6cd8f8..ec4562a 100644 --- a/Modules/Compiler/Clang.cmake +++ b/Modules/Compiler/Clang.cmake @@ -24,4 +24,5 @@ macro(__compiler_clang lang) __compiler_gnu(${lang}) set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ") + set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") endmacro() diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index faad416..504704d 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -25,6 +25,9 @@ macro(__compiler_gnu lang) if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4) set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") endif() + if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.2) + set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") + endif() set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index e23317c..5b43db9 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -6,5 +6,9 @@ set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG") set(CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG") set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG") +if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.0) + set(CMAKE_C_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") +endif() + set(CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") set(CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S -o ") diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index ae6021a..35bb3ec 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -6,5 +6,9 @@ set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG") +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0) + set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") +endif() + set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -S -o ") diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 870bfa1..13a14e1 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1684,6 +1684,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, // Add shared-library flags if needed. this->CurrentLocalGenerator->AddCMP0018Flags(flags, &target, lang, configName); + + this->CurrentLocalGenerator->AddVisibilityPresetFlags(flags, &target, + lang); } else if(binary) { diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index d346f16..71dd3e9 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1993,6 +1993,54 @@ void cmLocalGenerator::AddSharedFlags(std::string& flags, } //---------------------------------------------------------------------------- +void cmLocalGenerator +::AddVisibilityPresetFlags(std::string &flags, cmTarget* target, + const char *lang) +{ + int targetType = target->GetType(); + bool suitableTarget = ((targetType == cmTarget::SHARED_LIBRARY) + || (targetType == cmTarget::MODULE_LIBRARY) + || (target->IsExecutableWithExports())); + + if (!suitableTarget) + { + return; + } + + if (!lang) + { + return; + } + std::string l(lang); + std::string compileOption = "CMAKE_" + l + "_COMPILE_OPTIONS_VISIBILITY"; + const char *opt = this->Makefile->GetDefinition(compileOption.c_str()); + if (!opt) + { + return; + } + std::string flagDefine = l + "_VISIBILITY_PRESET"; + + const char *prop = target->GetProperty(flagDefine.c_str()); + if (!prop) + { + return; + } + if (strcmp(prop, "hidden") != 0 + && strcmp(prop, "default") != 0 + && strcmp(prop, "protected") != 0 + && strcmp(prop, "internal") != 0 ) + { + cmOStringStream e; + e << "Target " << target->GetName() << " uses unsupported value \"" + << prop << "\" for " << flagDefine << "."; + cmSystemTools::Error(e.str().c_str()); + return; + } + std::string option = std::string(opt) + prop; + this->AppendFlags(flags, option.c_str()); +} + +//---------------------------------------------------------------------------- void cmLocalGenerator::AddCMP0018Flags(std::string &flags, cmTarget* target, std::string const& lang, const char *config) diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index a1c34f0..84fd58c 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -143,6 +143,8 @@ public: const char* config); void AddCMP0018Flags(std::string &flags, cmTarget* target, std::string const& lang, const char *config); + void AddVisibilityPresetFlags(std::string &flags, cmTarget* target, + const char *lang); void AddConfigVariableFlags(std::string& flags, const char* var, const char* config); ///! Append flags to a string. diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 4220ae1..a7be669 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -271,6 +271,9 @@ std::string cmMakefileTargetGenerator::GetFlags(const std::string &l) this->LocalGenerator->AddCMP0018Flags(flags, this->Target, lang, this->ConfigName); + this->LocalGenerator->AddVisibilityPresetFlags(flags, this->Target, + lang); + // Add include directory flags. this->AddIncludeFlags(flags, lang); diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 850e5ea..778f86a 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -150,6 +150,9 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source, language.c_str(), this->GetConfigName()); + this->LocalGenerator->AddVisibilityPresetFlags(flags, this->Target, + language.c_str()); + // Add include directory flags. { std::vector includes; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index eb746b1..c34c3ab 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -924,6 +924,24 @@ void cmTarget::DefineProperties(cmake *cm) "(such as \"lib\") on a library name."); cm->DefineProperty + ("C_VISIBILITY_PRESET", cmProperty::TARGET, + "Value for symbol visibility compile flags", + "The C_VISIBILITY_PRESET property determines the value passed used in " + "a visibility related compile option, such as -fvisibility=. This " + "property only has an affect for libraries and executables with " + "exports. This property is initialized by the value of the variable " + "CMAKE_C_VISIBILITY_PRESET if it is set when a target is created."); + + cm->DefineProperty + ("CXX_VISIBILITY_PRESET", cmProperty::TARGET, + "Value for symbol visibility compile flags", + "The CXX_VISIBILITY_PRESET property determines the value passed used in " + "a visibility related compile option, such as -fvisibility=. This " + "property only has an affect for libraries and executables with " + "exports. This property is initialized by the value of the variable " + "CMAKE_CXX_VISIBILITY_PRESET if it is set when a target is created."); + + cm->DefineProperty ("POSITION_INDEPENDENT_CODE", cmProperty::TARGET, "Whether to create a position-independent target", "The POSITION_INDEPENDENT_CODE property determines whether position " @@ -1560,6 +1578,9 @@ void cmTarget::SetMakefile(cmMakefile* mf) this->InsertInclude(*it); } + this->SetPropertyDefault("C_VISIBILITY_PRESET", 0); + this->SetPropertyDefault("CXX_VISIBILITY_PRESET", 0); + if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY || this->TargetTypeValue == cmTarget::MODULE_LIBRARY) { diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt index 4a5b1cb..359a1e3 100644 --- a/Tests/Module/GenerateExportHeader/CMakeLists.txt +++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt @@ -141,6 +141,8 @@ endmacro() include(GenerateExportHeader) +add_subdirectory(visibility_preset) + add_compiler_export_flags() set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt b/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt new file mode 100644 index 0000000..ffa9380 --- /dev/null +++ b/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt @@ -0,0 +1,13 @@ + +set(CMAKE_CXX_VISIBILITY_PRESET hidden) + +if (CMAKE_CXX_FLAGS MATCHES "-fvisibility=hidden") + message(SEND_ERROR "Do not use add_compiler_export_flags before adding this directory") +endif() + +add_library(visibility_preset SHARED visibility_preset.cpp) +generate_export_header(visibility_preset) + +add_executable(visibility_preset_exe main.cpp) + +target_link_libraries(visibility_preset_exe visibility_preset) diff --git a/Tests/Module/GenerateExportHeader/visibility_preset/main.cpp b/Tests/Module/GenerateExportHeader/visibility_preset/main.cpp new file mode 100644 index 0000000..89c3977 --- /dev/null +++ b/Tests/Module/GenerateExportHeader/visibility_preset/main.cpp @@ -0,0 +1,9 @@ + +#include "visibility_preset.h" + +int main() +{ + VisibilityPreset vp; + vp.someMethod(); + return 0; +} diff --git a/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.cpp b/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.cpp new file mode 100644 index 0000000..c97dec6 --- /dev/null +++ b/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.cpp @@ -0,0 +1,7 @@ + +#include "visibility_preset.h" + +void VisibilityPreset::someMethod() +{ + +} diff --git a/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.h b/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.h new file mode 100644 index 0000000..8becbe1 --- /dev/null +++ b/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.h @@ -0,0 +1,13 @@ + +#ifndef VISIBILITY_PRESET_H +#define VISIBILITY_PRESET_H + +#include "visibility_preset_export.h" + +class VISIBILITY_PRESET_EXPORT VisibilityPreset +{ +public: + void someMethod(); +}; + +#endif diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index f676107..30be228 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -65,6 +65,22 @@ add_RunCMake_test(Languages) add_RunCMake_test(ObjectLibrary) if(NOT WIN32) add_RunCMake_test(PositionIndependentCode) + set(SKIP_VISIBILITY 0) + if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 4.2) + set(SKIP_VISIBILITY 1) + endif() + + if (CMAKE_CXX_COMPILER_ID MATCHES Watcom + OR CMAKE_SYSTEM_NAME MATCHES IRIX64 + OR CMAKE_CXX_COMPILER_ID MATCHES HP + OR CMAKE_CXX_COMPILER_ID MATCHES XL + OR CMAKE_CXX_COMPILER_ID MATCHES SunPro) + set(SKIP_VISIBILITY 1) + endif() + + if (NOT SKIP_VISIBILITY) + add_RunCMake_test(VisibilityPreset) + endif() endif() add_RunCMake_test(CompatibleInterface) diff --git a/Tests/RunCMake/VisibilityPreset/CMakeLists.txt b/Tests/RunCMake/VisibilityPreset/CMakeLists.txt new file mode 100644 index 0000000..22577da --- /dev/null +++ b/Tests/RunCMake/VisibilityPreset/CMakeLists.txt @@ -0,0 +1,8 @@ + +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} CXX) + +# MSVC creates extra targets which pollute the stderr unless we set this. +set(CMAKE_SUPPRESS_REGENERATION TRUE) + +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/VisibilityPreset/PropertyTypo-result.txt b/Tests/RunCMake/VisibilityPreset/PropertyTypo-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/VisibilityPreset/PropertyTypo-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt b/Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt new file mode 100644 index 0000000..ca8c33f --- /dev/null +++ b/Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt @@ -0,0 +1 @@ +CMake Error: Target visibility_preset uses unsupported value \"hiden\" for CXX_VISIBILITY_PRESET diff --git a/Tests/RunCMake/VisibilityPreset/PropertyTypo.cmake b/Tests/RunCMake/VisibilityPreset/PropertyTypo.cmake new file mode 100644 index 0000000..03c0ed9 --- /dev/null +++ b/Tests/RunCMake/VisibilityPreset/PropertyTypo.cmake @@ -0,0 +1,3 @@ + +add_library(visibility_preset SHARED lib.cpp) +set_property(TARGET visibility_preset PROPERTY CXX_VISIBILITY_PRESET hiden) diff --git a/Tests/RunCMake/VisibilityPreset/RunCMakeTest.cmake b/Tests/RunCMake/VisibilityPreset/RunCMakeTest.cmake new file mode 100644 index 0000000..2d78832 --- /dev/null +++ b/Tests/RunCMake/VisibilityPreset/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(PropertyTypo) diff --git a/Tests/RunCMake/VisibilityPreset/lib.cpp b/Tests/RunCMake/VisibilityPreset/lib.cpp new file mode 100644 index 0000000..06b3472 --- /dev/null +++ b/Tests/RunCMake/VisibilityPreset/lib.cpp @@ -0,0 +1,5 @@ + +int foo(void) +{ + return 42; +} -- cgit v0.12 From cd1fa537a03377974a4d0a27e592785f931a41e5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 23 May 2013 15:32:17 +0200 Subject: Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property. This corresponds to the g++ and clang++ option -fvisibility-inlines-hidden on linux. On Windows with MinGW, this corresponds to -fno-keep-inline-dllexport. That option is not supported by clang currently. --- Modules/Compiler/Clang-CXX.cmake | 2 + Modules/Compiler/GNU-CXX.cmake | 10 ++++ Source/cmLocalGenerator.cxx | 67 +++++++++++++++------- Source/cmTarget.cxx | 12 ++++ .../visibility_preset/CMakeLists.txt | 4 ++ 5 files changed, 75 insertions(+), 20 deletions(-) diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index 486e2af..972d889 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -1,2 +1,4 @@ include(Compiler/Clang) __compiler_clang(CXX) + +set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index 879ab8f..33d6093 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -1,2 +1,12 @@ include(Compiler/GNU) __compiler_gnu(CXX) + +if (WIN32) + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) + set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fno-keep-inline-dllexport") + endif() +else() + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.2) + set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") + endif() +endif() diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 71dd3e9..dce1838 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1992,28 +1992,12 @@ void cmLocalGenerator::AddSharedFlags(std::string& flags, } } -//---------------------------------------------------------------------------- -void cmLocalGenerator -::AddVisibilityPresetFlags(std::string &flags, cmTarget* target, - const char *lang) +static void AddVisibilityCompileOption(std::string &flags, cmTarget* target, + cmLocalGenerator *lg, const char *lang) { - int targetType = target->GetType(); - bool suitableTarget = ((targetType == cmTarget::SHARED_LIBRARY) - || (targetType == cmTarget::MODULE_LIBRARY) - || (target->IsExecutableWithExports())); - - if (!suitableTarget) - { - return; - } - - if (!lang) - { - return; - } std::string l(lang); std::string compileOption = "CMAKE_" + l + "_COMPILE_OPTIONS_VISIBILITY"; - const char *opt = this->Makefile->GetDefinition(compileOption.c_str()); + const char *opt = lg->GetMakefile()->GetDefinition(compileOption.c_str()); if (!opt) { return; @@ -2037,7 +2021,50 @@ void cmLocalGenerator return; } std::string option = std::string(opt) + prop; - this->AppendFlags(flags, option.c_str()); + lg->AppendFlags(flags, option.c_str()); +} + +static void AddInlineVisibilityCompileOption(std::string &flags, + cmTarget* target, + cmLocalGenerator *lg) +{ + std::string compileOption + = "CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN"; + const char *opt = lg->GetMakefile()->GetDefinition(compileOption.c_str()); + if (!opt) + { + return; + } + + bool prop = target->GetPropertyAsBool("VISIBILITY_INLINES_HIDDEN"); + if (!prop) + { + return; + } + lg->AppendFlags(flags, opt); +} + +//---------------------------------------------------------------------------- +void cmLocalGenerator +::AddVisibilityPresetFlags(std::string &flags, cmTarget* target, + const char *lang) +{ + int targetType = target->GetType(); + bool suitableTarget = ((targetType == cmTarget::SHARED_LIBRARY) + || (targetType == cmTarget::MODULE_LIBRARY) + || (target->IsExecutableWithExports())); + + if (!suitableTarget) + { + return; + } + + if (!lang) + { + return; + } + AddVisibilityCompileOption(flags, target, this, lang); + AddInlineVisibilityCompileOption(flags, target, this); } //---------------------------------------------------------------------------- diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index c34c3ab..47e36fd 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -942,6 +942,17 @@ void cmTarget::DefineProperties(cmake *cm) "CMAKE_CXX_VISIBILITY_PRESET if it is set when a target is created."); cm->DefineProperty + ("VISIBILITY_INLINES_HIDDEN", cmProperty::TARGET, + "Whether to add a compile flag to hide symbols of inline functions", + "The VISIBILITY_INLINES_HIDDEN property determines whether a flag for " + "hiding symbols for inline functions. the value passed used in " + "a visibility related compile option, such as -fvisibility=. This " + "property only has an affect for libraries and executables with " + "exports. This property is initialized by the value of the variable " + "CMAKE_VISIBILITY_INLINES_HIDDEN if it is set when a target is " + "created."); + + cm->DefineProperty ("POSITION_INDEPENDENT_CODE", cmProperty::TARGET, "Whether to create a position-independent target", "The POSITION_INDEPENDENT_CODE property determines whether position " @@ -1580,6 +1591,7 @@ void cmTarget::SetMakefile(cmMakefile* mf) this->SetPropertyDefault("C_VISIBILITY_PRESET", 0); this->SetPropertyDefault("CXX_VISIBILITY_PRESET", 0); + this->SetPropertyDefault("VISIBILITY_INLINES_HIDDEN", 0); if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY || this->TargetTypeValue == cmTarget::MODULE_LIBRARY) diff --git a/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt b/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt index ffa9380..2571d22 100644 --- a/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt +++ b/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt @@ -1,9 +1,13 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) if (CMAKE_CXX_FLAGS MATCHES "-fvisibility=hidden") message(SEND_ERROR "Do not use add_compiler_export_flags before adding this directory") endif() +if (CMAKE_CXX_FLAGS MATCHES "-fvisibility-inlines-hidden") + message(SEND_ERROR "Do not use add_compiler_export_flags before adding this directory") +endif() add_library(visibility_preset SHARED visibility_preset.cpp) generate_export_header(visibility_preset) -- cgit v0.12 From cd4451d1e738a729a1a8d0ed34b544cada1de078 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Sun, 2 Jun 2013 21:42:10 +0200 Subject: replace string(... MATCHES "^const$) with string(... STREQUAL "const") --- Modules/CMakeBackwardCompatibilityC.cmake | 2 +- Modules/CTest.cmake | 4 ++-- Modules/ExternalData.cmake | 2 +- Modules/FindThreads.cmake | 2 +- Modules/FindXMLRPC.cmake | 4 ++-- Tests/Complex/CMakeLists.txt | 13 +++++-------- Tests/ComplexOneConfig/CMakeLists.txt | 13 +++++-------- Tests/SimpleInstall/CMakeLists.txt | 2 +- Tests/SimpleInstallS2/CMakeLists.txt | 2 +- 9 files changed, 19 insertions(+), 25 deletions(-) diff --git a/Modules/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake index e3b6c82..4783d68 100644 --- a/Modules/CMakeBackwardCompatibilityC.cmake +++ b/Modules/CMakeBackwardCompatibilityC.cmake @@ -55,7 +55,7 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN) include (FindX11) - if("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$") + if("${X11_X11_INCLUDE_PATH}" STREQUAL "/usr/include") set (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.") else() set (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake index 562e248..5cd62f6 100644 --- a/Modules/CTest.cmake +++ b/Modules/CTest.cmake @@ -84,13 +84,13 @@ if(BUILD_TESTING) endmacro() macro(SET_IF_SET var val) - if(NOT "${val}" MATCHES "^$") + if(NOT "${val}" STREQUAL "") set("${var}" "${val}") endif() endmacro() macro(SET_IF_SET_AND_NOT_SET var val) - if(NOT "${val}" MATCHES "^$") + if(NOT "${val}" STREQUAL "") SET_IF_NOT_SET("${var}" "${val}") endif() endmacro() diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake index 8332725..50669bd 100644 --- a/Modules/ExternalData.cmake +++ b/Modules/ExternalData.cmake @@ -391,7 +391,7 @@ function(_ExternalData_arg target arg options var_file) # Regular expression to match associated files. string(REGEX REPLACE "^REGEX:" "" regex "${opt}") list(APPEND associated_regex "${regex}") - elseif("x${opt}" MATCHES "^x:$") + elseif(opt STREQUAL ":") # Activate series matching. set(series_option "${opt}") elseif("x${opt}" MATCHES "^[^][:/*?]+$") diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index 5d76777..f03908e 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -93,7 +93,7 @@ else() COMPILE_OUTPUT_VARIABLE OUTPUT) if(THREADS_HAVE_PTHREAD_ARG) - if(THREADS_PTHREAD_ARG MATCHES "^2$") + if(THREADS_PTHREAD_ARG STREQUAL "2") set(Threads_FOUND TRUE) message(STATUS "Check if compiler accepts -pthread - yes") else() diff --git a/Modules/FindXMLRPC.cmake b/Modules/FindXMLRPC.cmake index 6bb578b..c80249b 100644 --- a/Modules/FindXMLRPC.cmake +++ b/Modules/FindXMLRPC.cmake @@ -53,7 +53,7 @@ if(XMLRPC_FOUND) endif() # Parse the include flags. - if("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$") + if("${XMLRPC_C_CONFIG_RESULT}" STREQUAL "0") # Convert the compile flags to a CMake list. string(REGEX REPLACE " +" ";" XMLRPC_C_CONFIG_CFLAGS "${XMLRPC_C_CONFIG_CFLAGS}") @@ -91,7 +91,7 @@ if(XMLRPC_FOUND) endif() # Parse the library names and directories. - if("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$") + if("${XMLRPC_C_CONFIG_RESULT}" STREQUAL "0") string(REGEX REPLACE " +" ";" XMLRPC_C_CONFIG_LIBS "${XMLRPC_C_CONFIG_LIBS}") diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 048f966..50dccbe 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -45,12 +45,12 @@ endmacro() TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) macro(TEST_VAR_ARG fa) - if("${ARGV}" MATCHES "^1;2;3$") + if("${ARGV}" STREQUAL "1;2;3") message(STATUS "ARGV works") else() message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") endif() - if("${ARGN}" MATCHES "^2;3$") + if("${ARGN}" STREQUAL "2;3") message(STATUS "ARGN works") else() message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") @@ -163,7 +163,7 @@ execute_process( COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" OUTPUT_VARIABLE TEST_OUT ) -if("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +if("${TEST_OUT}" STREQUAL "ABCDEFG\n") else() message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") endif() @@ -177,7 +177,7 @@ endif() # ERROR_QUIET # RESULT_VARIABLE RESULT # ) -# if("${RESULT}" MATCHES "^0$") +# if("${RESULT}" STREQUAL "0") # message(SEND_ERROR # "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]") # else() @@ -387,10 +387,7 @@ if(NOT RESULT) message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.") endif() string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") -if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") - set(STRING_REGEX_PASSED 1) -endif() -if(NOT STRING_REGEX_PASSED) +if(NOT RESULT STREQUAL "a[b]c[d]e") message(SEND_ERROR "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") endif() diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index b0748fe..cbb4286 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -45,12 +45,12 @@ endmacro() TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) macro(TEST_VAR_ARG fa) - if("${ARGV}" MATCHES "^1;2;3$") + if("${ARGV}" STREQUAL "1;2;3") message(STATUS "ARGV works") else() message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") endif() - if("${ARGN}" MATCHES "^2;3$") + if("${ARGN}" STREQUAL "2;3") message(STATUS "ARGN works") else() message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") @@ -163,7 +163,7 @@ execute_process( COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" OUTPUT_VARIABLE TEST_OUT ) -if("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +if("${TEST_OUT}" STREQUAL "ABCDEFG\n") else() message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") endif() @@ -177,7 +177,7 @@ endif() # ERROR_QUIET # RESULT_VARIABLE RESULT # ) -# if("${RESULT}" MATCHES "^0$") +# if("${RESULT}" STREQUAL "0") # message(SEND_ERROR # "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]") # else() @@ -357,10 +357,7 @@ if(NOT RESULT) message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.") endif() string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") -if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") - set(STRING_REGEX_PASSED 1) -endif() -if(NOT STRING_REGEX_PASSED) +if(NOT RESULT STREQUAL "a[b]c[d]e") message(SEND_ERROR "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") endif() diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt index 479d6ec..b969bfd 100644 --- a/Tests/SimpleInstall/CMakeLists.txt +++ b/Tests/SimpleInstall/CMakeLists.txt @@ -122,7 +122,7 @@ if(STAGE2) RESULT_VARIABLE SAMPLE_SCRIPT_RESULT OUTPUT_VARIABLE SAMPLE_SCRIPT_OUTPUT ) - if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + if(NOT "${SAMPLE_SCRIPT_RESULT}" STREQUAL "0") message(FATAL_ERROR "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]") endif() diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt index 479d6ec..b969bfd 100644 --- a/Tests/SimpleInstallS2/CMakeLists.txt +++ b/Tests/SimpleInstallS2/CMakeLists.txt @@ -122,7 +122,7 @@ if(STAGE2) RESULT_VARIABLE SAMPLE_SCRIPT_RESULT OUTPUT_VARIABLE SAMPLE_SCRIPT_OUTPUT ) - if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + if(NOT "${SAMPLE_SCRIPT_RESULT}" STREQUAL "0") message(FATAL_ERROR "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]") endif() -- cgit v0.12 From 3c7e09eb8e88b39fb3d785245ad8b168530909fe Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Mon, 3 Jun 2013 00:01:05 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 25d4e77..1230403 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130602) +set(CMake_VERSION_TWEAK 20130603) #set(CMake_VERSION_RC 1) -- cgit v0.12 From 9ce60ff509c4ff27fe861fc5b2080f50897a68c4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 26 Feb 2013 23:27:22 +0100 Subject: Qt4Macros: Allow specifying a TARGET in invokations of macros. That will allow things like this: find_package(Qt4) qt4_generate_moc(myfile.h moc_myfile.cpp TARGET foo) # Note, foo target doesn't # exist until below. add_library(foo ...) The qt4_generate_moc call would use the INCLUDE_DIRECTORIES from the foo target using generator expressions. Currently it reads the INCLUDE_DIRECTORIES directory property, meaning that include_directories() is required. Support for the TARGET is also added to qt4_wrap_cpp, but not qt4_automoc, as that is deprecated in favor of the AUTOMOC target property. The moc tool reports failure if the Q_INTERFACES macro is used with an argument which has not appeared with Q_DECLARE_INTERFACE, so that is the basis of the unit test. The command line arguments are now always written to a file, which is passed to moc as the @atfile. This was already the case on Windows, but now it is used everywhere. The reason for that is that it is not currently possible to expand the list of includes from a target directly in a add_custom_command invokation (though that may become possible in the future). There is not a big disadvantage to using the file anyway on unix, so having one code path instead of two is also a motivation. --- Modules/Qt4Macros.cmake | 100 +++++++++++++++++++------------ Tests/Qt4Targets/CMakeLists.txt | 17 ++++++ Tests/Qt4Targets/interface/myinterface.h | 12 ++++ Tests/Qt4Targets/main_gen_test.cpp | 21 +++++++ Tests/Qt4Targets/main_wrap_test.cpp | 11 ++++ Tests/Qt4Targets/mywrapobject.h | 17 ++++++ 6 files changed, 140 insertions(+), 38 deletions(-) create mode 100644 Tests/Qt4Targets/interface/myinterface.h create mode 100644 Tests/Qt4Targets/main_gen_test.cpp create mode 100644 Tests/Qt4Targets/main_wrap_test.cpp create mode 100644 Tests/Qt4Targets/mywrapobject.h diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 251d57c..7d7f5aa 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -21,15 +21,20 @@ ###################################### -macro (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options) +macro (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options _qt4_target) set(${_qt4_files}) set(${_qt4_options}) set(_QT4_DOING_OPTIONS FALSE) + set(_QT4_DOING_TARGET FALSE) foreach(_currentArg ${ARGN}) - if ("${_currentArg}" STREQUAL "OPTIONS") + if ("x${_currentArg}" STREQUAL "xOPTIONS") set(_QT4_DOING_OPTIONS TRUE) + elseif ("x${_currentArg}" STREQUAL "xTARGET") + set(_QT4_DOING_TARGET TRUE) else () - if(_QT4_DOING_OPTIONS) + if(_QT4_DOING_TARGET) + set(${_qt4_target} "${_currentArg}") + elseif(_QT4_DOING_OPTIONS) list(APPEND ${_qt4_options} "${_currentArg}") else() list(APPEND ${_qt4_files} "${_currentArg}") @@ -92,34 +97,49 @@ endmacro() # helper macro to set up a moc rule -macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options) +macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target) # For Windows, create a parameters file to work around command line length limit - if (WIN32) - # Pass the parameters in a file. Set the working directory to - # be that containing the parameters file and reference it by - # just the file name. This is necessary because the moc tool on - # MinGW builds does not seem to handle spaces in the path to the - # file given with the @ syntax. - get_filename_component(_moc_outfile_name "${outfile}" NAME) - get_filename_component(_moc_outfile_dir "${outfile}" PATH) - if(_moc_outfile_dir) - set(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir}) - endif() - set (_moc_parameters_file ${outfile}_parameters) - set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}") - string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}") - file (WRITE ${_moc_parameters_file} "${_moc_parameters}") - add_custom_command(OUTPUT ${outfile} - COMMAND ${QT_MOC_EXECUTABLE} @${_moc_outfile_name}_parameters - DEPENDS ${infile} - ${_moc_working_dir} - VERBATIM) - else () - add_custom_command(OUTPUT ${outfile} - COMMAND ${QT_MOC_EXECUTABLE} - ARGS ${moc_flags} ${moc_options} -o ${outfile} ${infile} - DEPENDS ${infile} VERBATIM) - endif () + # Pass the parameters in a file. Set the working directory to + # be that containing the parameters file and reference it by + # just the file name. This is necessary because the moc tool on + # MinGW builds does not seem to handle spaces in the path to the + # file given with the @ syntax. + get_filename_component(_moc_outfile_name "${outfile}" NAME) + get_filename_component(_moc_outfile_dir "${outfile}" PATH) + if(_moc_outfile_dir) + set(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir}) + endif() + set (_moc_parameters_file ${outfile}_parameters) + set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}") + string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}") + + set(targetincludes) + set(targetdefines) + if(moc_target) + list(APPEND targetincludes "$") + list(APPEND targetdefines "$") + + set(targetincludes "$<$:-I$\n>") + set(targetdefines "$<$:-D$\n>") + + file (GENERATE + OUTPUT ${_moc_parameters_file} + CONTENT "${targetdefines}${targetincludes}${targetoptions}${_moc_parameters}\n" + CONDITION 1 + ) + + set(targetincludes) + set(targetdefines) + else() + file(WRITE ${_moc_parameters_file} "${_moc_parameters}\n") + endif() + + set(_moc_extra_parameters_file @${_moc_parameters_file}) + add_custom_command(OUTPUT ${outfile} + COMMAND ${QT_MOC_EXECUTABLE} ${_moc_extra_parameters_file} + DEPENDS ${infile} + ${_moc_working_dir} + VERBATIM) endmacro () @@ -131,7 +151,11 @@ macro (QT4_GENERATE_MOC infile outfile ) if(NOT IS_ABSOLUTE "${outfile}") set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}") endif() - QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "") + + if ("x${ARGV2}" STREQUAL "xTARGET") + set(moc_target ${ARGV3}) + endif() + QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}") set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file endmacro () @@ -141,12 +165,12 @@ endmacro () macro (QT4_WRAP_CPP outfiles ) # get include dirs QT4_GET_MOC_FLAGS(moc_flags) - QT4_EXTRACT_OPTIONS(moc_files moc_options ${ARGN}) + QT4_EXTRACT_OPTIONS(moc_files moc_options moc_target ${ARGN}) foreach (it ${moc_files}) get_filename_component(it ${it} ABSOLUTE) QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile) - QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}") + QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}") set(${outfiles} ${${outfiles}} ${outfile}) endforeach() @@ -156,7 +180,7 @@ endmacro () # QT4_WRAP_UI(outfiles inputfile ... ) macro (QT4_WRAP_UI outfiles ) - QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN}) + QT4_EXTRACT_OPTIONS(ui_files ui_options ui_target ${ARGN}) foreach (it ${ui_files}) get_filename_component(outfile ${it} NAME_WE) @@ -175,7 +199,7 @@ endmacro () # QT4_ADD_RESOURCES(outfiles inputfile ... ) macro (QT4_ADD_RESOURCES outfiles ) - QT4_EXTRACT_OPTIONS(rcc_files rcc_options ${ARGN}) + QT4_EXTRACT_OPTIONS(rcc_files rcc_options rcc_target ${ARGN}) foreach (it ${rcc_files}) get_filename_component(outfilename ${it} NAME_WE) @@ -270,7 +294,7 @@ endmacro() macro(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options ) - QT4_EXTRACT_OPTIONS(_customName _qt4_dbus_options ${ARGN}) + QT4_EXTRACT_OPTIONS(_customName _qt4_dbus_options _qt4_dbus_target ${ARGN}) get_filename_component(_in_file ${_header} ABSOLUTE) get_filename_component(_basename ${_header} NAME_WE) @@ -366,7 +390,7 @@ macro(QT4_AUTOMOC) set(_header ${_abs_PATH}/${_basename}.h) endif() set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC}) - QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "") + QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "" "") MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc}) endforeach () endif() @@ -376,7 +400,7 @@ endmacro() macro(QT4_CREATE_TRANSLATION _qm_files) - QT4_EXTRACT_OPTIONS(_lupdate_files _lupdate_options ${ARGN}) + QT4_EXTRACT_OPTIONS(_lupdate_files _lupdate_options _lupdate_target ${ARGN}) set(_my_sources) set(_my_dirs) set(_my_tsfiles) diff --git a/Tests/Qt4Targets/CMakeLists.txt b/Tests/Qt4Targets/CMakeLists.txt index d0c9c66..af9fc3f 100644 --- a/Tests/Qt4Targets/CMakeLists.txt +++ b/Tests/Qt4Targets/CMakeLists.txt @@ -19,3 +19,20 @@ if (WIN32) target_link_libraries(activeqtexe Qt4::QAxServer Qt4::QtGui) endif() endif() + +qt4_generate_moc(main_gen_test.cpp + "${CMAKE_CURRENT_BINARY_DIR}/main_gen_test.moc" + TARGET Qt4GenerateMacroTest +) +add_executable(Qt4GenerateMacroTest WIN32 main_gen_test.cpp "${CMAKE_CURRENT_BINARY_DIR}/main_gen_test.moc") +set_property(TARGET Qt4GenerateMacroTest PROPERTY AUTOMOC OFF) +target_include_directories(Qt4GenerateMacroTest PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/interface") +target_link_libraries(Qt4GenerateMacroTest Qt4::QtGui) + +qt4_wrap_cpp(moc_file mywrapobject.h + TARGET Qt4WrapMacroTest +) +add_executable(Qt4WrapMacroTest WIN32 main_wrap_test.cpp ${moc_file}) +set_property(TARGET Qt4WrapMacroTest PROPERTY AUTOMOC OFF) +target_include_directories(Qt4WrapMacroTest PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/interface") +target_link_libraries(Qt4WrapMacroTest Qt4::QtGui) diff --git a/Tests/Qt4Targets/interface/myinterface.h b/Tests/Qt4Targets/interface/myinterface.h new file mode 100644 index 0000000..59b43ad --- /dev/null +++ b/Tests/Qt4Targets/interface/myinterface.h @@ -0,0 +1,12 @@ + +#ifndef MYINTERFACE_H +#define MYINTERFACE_H + +class MyInterface +{ + +}; + +Q_DECLARE_INTERFACE(MyInterface, "org.cmake.example.MyInterface") + +#endif diff --git a/Tests/Qt4Targets/main_gen_test.cpp b/Tests/Qt4Targets/main_gen_test.cpp new file mode 100644 index 0000000..984424b --- /dev/null +++ b/Tests/Qt4Targets/main_gen_test.cpp @@ -0,0 +1,21 @@ + +#include + +#include "myinterface.h" + +class MyObject : public QObject, MyInterface +{ + Q_OBJECT + Q_INTERFACES(MyInterface) +public: + explicit MyObject(QObject *parent = 0) : QObject(parent) { } +}; + +int main(int argc, char **argv) +{ + MyObject mo; + mo.objectName(); + return 0; +} + +#include "main_gen_test.moc" diff --git a/Tests/Qt4Targets/main_wrap_test.cpp b/Tests/Qt4Targets/main_wrap_test.cpp new file mode 100644 index 0000000..21edc7b --- /dev/null +++ b/Tests/Qt4Targets/main_wrap_test.cpp @@ -0,0 +1,11 @@ + +#include + +#include "mywrapobject.h" + +int main(int argc, char **argv) +{ + MyWrapObject mwo; + mwo.objectName(); + return 0; +} diff --git a/Tests/Qt4Targets/mywrapobject.h b/Tests/Qt4Targets/mywrapobject.h new file mode 100644 index 0000000..de23540 --- /dev/null +++ b/Tests/Qt4Targets/mywrapobject.h @@ -0,0 +1,17 @@ + +#ifndef MYWRAPOBJECT_H +#define MYWRAPOBJECT_H + +#include + +#include "myinterface.h" + +class MyWrapObject : public QObject, MyInterface +{ + Q_OBJECT + Q_INTERFACES(MyInterface) +public: + explicit MyWrapObject(QObject *parent = 0) : QObject(parent) { } +}; + +#endif -- cgit v0.12 From 483e208482ff46532e7ae48659e569580a88af9c Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Sat, 1 Jun 2013 22:47:18 -0600 Subject: OS X: Fix getting of CFBundle LOCATION property. This fixes bug #13797. The kinds of changes applied in 373faae5 for frameworks are now applied to CFBundle. The prefix and suffix for CFBundles are now handled in cmTarget::GetFullNameInternal. --- Source/cmExportInstallFileGenerator.cxx | 16 +--------------- Source/cmGlobalXCodeGenerator.cxx | 8 +------- Source/cmMakefileLibraryTargetGenerator.cxx | 2 -- Source/cmNinjaNormalTargetGenerator.cxx | 2 -- Source/cmOSXBundleGenerator.cxx | 23 +++++------------------ Source/cmOSXBundleGenerator.h | 8 +++----- Source/cmTarget.cxx | 19 +++++++++++++++++-- Tests/CFBundleTest/CMakeLists.txt | 2 ++ 8 files changed, 29 insertions(+), 51 deletions(-) diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index fff807c..f3fda71 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -351,21 +351,7 @@ cmExportInstallFileGenerator prop += suffix; // Append the installed file name. - if(target->IsCFBundleOnApple()) - { - const char *ext = target->GetProperty("BUNDLE_EXTENSION"); - if (!ext) - { - ext = "bundle"; - } - - value += itgen->GetInstallFilename(target, config); - value += "."; - value += ext; - value += "/"; - value += itgen->GetInstallFilename(target, config); - } - else if(target->IsAppBundleOnApple()) + if(target->IsAppBundleOnApple()) { value += itgen->GetInstallFilename(target, config); value += ".app/Contents/MacOS/"; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 240d60c..00a06bc 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -746,12 +746,6 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg, } } - if(cmtarget.IsCFBundleOnApple()) - { - cmtarget.SetProperty("PREFIX", ""); - cmtarget.SetProperty("SUFFIX", ""); - } - // Add the fileRef to the top level Resources group/folder if it is not // already there. // @@ -1823,7 +1817,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, pndir = target.GetDirectory(configName); } - if(target.IsFrameworkOnApple()) + if(target.IsFrameworkOnApple() || target.IsCFBundleOnApple()) { pnprefix = ""; } diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 3edaa44..347f26d 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -24,8 +24,6 @@ cmMakefileLibraryTargetGenerator ::cmMakefileLibraryTargetGenerator(cmTarget* target): cmMakefileTargetGenerator(target) { - cmOSXBundleGenerator::PrepareTargetProperties(this->Target); - this->CustomCommandDriver = OnDepends; this->Target->GetLibraryNames( this->TargetNameOut, this->TargetNameSO, this->TargetNameReal, diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index e5a6eab..4a7d2f4 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -36,8 +36,6 @@ cmNinjaNormalTargetGenerator(cmTarget* target) , TargetNamePDB() , TargetLinkLanguage(0) { - cmOSXBundleGenerator::PrepareTargetProperties(target); - this->TargetLinkLanguage = target->GetLinkerLanguage(this->GetConfigName()); if (target->GetType() == cmTarget::EXECUTABLE) target->GetExecutableNames(this->TargetNameOut, diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx index 621a49f..d3cdf85 100644 --- a/Source/cmOSXBundleGenerator.cxx +++ b/Source/cmOSXBundleGenerator.cxx @@ -16,15 +16,6 @@ #include -void cmOSXBundleGenerator::PrepareTargetProperties(cmTarget* target) -{ - if(target->IsCFBundleOnApple()) - { - target->SetProperty("PREFIX", ""); - target->SetProperty("SUFFIX", ""); - } -} - //---------------------------------------------------------------------------- cmOSXBundleGenerator:: cmOSXBundleGenerator(cmTarget* target, @@ -173,31 +164,27 @@ void cmOSXBundleGenerator::CreateFramework( //---------------------------------------------------------------------------- void cmOSXBundleGenerator::CreateCFBundle(const std::string& targetName, - std::string& outpath) + const std::string& root) { if (this->MustSkip()) return; // Compute bundle directory names. - std::string out = outpath; + std::string out = root; out += "/"; - out += this->Target->GetCFBundleDirectory(this->ConfigName, true); - std::string top = out; - out += "/MacOS"; + out += this->Target->GetCFBundleDirectory(this->ConfigName, false); cmSystemTools::MakeDirectory(out.c_str()); this->Makefile->AddCMakeOutputFile(out.c_str()); - std::string newoutpath = out; - // Configure the Info.plist file. Note that it needs the executable name // to be set. - std::string plist = top; + std::string plist = + this->Target->GetCFBundleDirectory(this->ConfigName, true); plist += "/Info.plist"; this->LocalGenerator->GenerateAppleInfoPList(this->Target, targetName.c_str(), plist.c_str()); this->Makefile->AddCMakeOutputFile(plist.c_str()); - outpath = newoutpath; } //---------------------------------------------------------------------------- diff --git a/Source/cmOSXBundleGenerator.h b/Source/cmOSXBundleGenerator.h index 6cf81d2..ec82b9a 100644 --- a/Source/cmOSXBundleGenerator.h +++ b/Source/cmOSXBundleGenerator.h @@ -25,8 +25,6 @@ class cmLocalGenerator; class cmOSXBundleGenerator { public: - static void PrepareTargetProperties(cmTarget* target); - cmOSXBundleGenerator(cmTarget* target, const char* configName); @@ -38,9 +36,9 @@ public: void CreateFramework(const std::string& targetName, const std::string& root); - // create a cf bundle at a given root and return the - // directory within the bundle that contains the library - void CreateCFBundle(const std::string& targetName, std::string& outpath); + // create a cf bundle at a given root + void CreateCFBundle(const std::string& targetName, + const std::string& root); struct MacOSXContentGeneratorType { diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 093b30e..fb6d0a8 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3278,7 +3278,7 @@ const char* cmTarget::NormalGetLocation(const char* config) this->Location += cfgid; } - if(this->IsCFBundleOnApple() || this->IsAppBundleOnApple()) + if(this->IsAppBundleOnApple()) { std::string macdir = this->BuildMacContentDirectory("", config, false); if(!macdir.empty()) @@ -3891,7 +3891,7 @@ std::string cmTarget::NormalGetFullPath(const char* config, bool implib, { std::string fpath = this->GetDirectory(config, implib); fpath += "/"; - if(this->IsCFBundleOnApple() || this->IsAppBundleOnApple()) + if(this->IsAppBundleOnApple()) { fpath = this->BuildMacContentDirectory(fpath, config, false); fpath += "/"; @@ -4037,6 +4037,21 @@ void cmTarget::GetFullNameInternal(const char* config, targetSuffix = 0; } + if(this->IsCFBundleOnApple()) + { + fw_prefix = this->GetOutputName(config, false); + fw_prefix += "."; + const char *ext = this->GetProperty("BUNDLE_EXTENSION"); + if (!ext) + { + ext = "bundle"; + } + fw_prefix += ext; + fw_prefix += "/Contents/MacOS/"; + targetPrefix = fw_prefix.c_str(); + targetSuffix = 0; + } + // Begin the final name with the prefix. outPrefix = targetPrefix?targetPrefix:""; diff --git a/Tests/CFBundleTest/CMakeLists.txt b/Tests/CFBundleTest/CMakeLists.txt index 8fd9efd..bf9771c 100644 --- a/Tests/CFBundleTest/CMakeLists.txt +++ b/Tests/CFBundleTest/CMakeLists.txt @@ -54,3 +54,5 @@ set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/English.lproj") + +export(TARGETS CFBundleTest FILE ${CMAKE_CURRENT_BINARY_DIR}/exp.cmake) -- cgit v0.12 From b8af46cb878551cc5a1c9275f46792b282479ebb Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 23 May 2013 17:02:05 +0200 Subject: FindQt4: Don't fail if certain Qt modules are unavailable. --- Modules/FindQt4.cmake | 54 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 21e8e91..4c05cc0 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -881,16 +881,20 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) endforeach() if(Q_WS_WIN) - set(QT_MODULES ${QT_MODULES} QAxContainer QAxServer) - # Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR - find_path(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt - PATHS ${QT_HEADERS_DIR}/ActiveQt - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH - ) - find_path(QT_QAXSERVER_INCLUDE_DIR ActiveQt - PATHS ${QT_HEADERS_DIR}/ActiveQt - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH - ) + if (QT_QAXCONTAINER_FOUND) + set(QT_MODULES ${QT_MODULES} QAxContainer) + # Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR + find_path(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt + PATHS ${QT_HEADERS_DIR}/ActiveQt + NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH + ) + endif() + if (QT_QAXSERVER_FOUND) + find_path(QT_QAXSERVER_INCLUDE_DIR ActiveQt + PATHS ${QT_HEADERS_DIR}/ActiveQt + NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH + ) + endif() endif() # Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR @@ -1051,14 +1055,18 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) if(Q_WS_WIN) _QT4_ADJUST_LIB_VARS(qtmain) - _QT4_ADJUST_LIB_VARS(QAxServer) - set_property(TARGET Qt4::QAxServer PROPERTY - INTERFACE_QT4_NO_LINK_QTMAIN ON - ) - set_property(TARGET Qt4::QAxServer APPEND PROPERTY - COMPATIBLE_INTERFACE_BOOL QT4_NO_LINK_QTMAIN) + if(QT_QAXSERVER_FOUND) + _QT4_ADJUST_LIB_VARS(QAxServer) + set_property(TARGET Qt4::QAxServer PROPERTY + INTERFACE_QT4_NO_LINK_QTMAIN ON + ) + set_property(TARGET Qt4::QAxServer APPEND PROPERTY + COMPATIBLE_INTERFACE_BOOL QT4_NO_LINK_QTMAIN) + endif() - _QT4_ADJUST_LIB_VARS(QAxContainer) + if(QT_QAXCONTAINER_FOUND) + _QT4_ADJUST_LIB_VARS(QAxContainer) + endif() endif() # Only public dependencies are listed here. @@ -1080,7 +1088,9 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) _qt4_add_target_depends(QtWebKit Gui Network) _qt4_add_target_private_depends(Qt3Support Xml) - _qt4_add_target_private_depends(QtSvg Xml) + if(QT_VERSION VERSION_GREATER 4.6) + _qt4_add_target_private_depends(QtSvg Xml) + endif() _qt4_add_target_private_depends(QtDBus Xml) _qt4_add_target_private_depends(QtUiTools Xml Gui) _qt4_add_target_private_depends(QtHelp Sql Xml Network) @@ -1090,8 +1100,12 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) _qt4_add_target_private_depends(QtDeclarative XmlPatterns Svg Sql Gui) _qt4_add_target_private_depends(QtMultimedia Gui) _qt4_add_target_private_depends(QtOpenGL Gui) - _qt4_add_target_private_depends(QAxServer Gui) - _qt4_add_target_private_depends(QAxContainer Gui) + if(QT_QAXSERVER_FOUND) + _qt4_add_target_private_depends(QAxServer Gui) + endif() + if(QT_QAXCONTAINER_FOUND) + _qt4_add_target_private_depends(QAxContainer Gui) + endif() _qt4_add_target_private_depends(phonon Gui) if(QT_QTDBUS_FOUND) _qt4_add_target_private_depends(phonon DBus) -- cgit v0.12 From ce0c4802c02c98fffd66fe42944d255a0e7da026 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 23 May 2013 16:51:11 +0200 Subject: Qt4Macros: Handle Qt ActiveX libraries in qt4_use_modules. These libraries have non-conventional variable names. --- Modules/Qt4Macros.cmake | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 251d57c..f6c8476 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -451,14 +451,22 @@ function(qt4_use_modules _target _link_type) endif() foreach(_module ${modules}) string(TOUPPER ${_module} _ucmodule) - if (NOT QT_QT${_ucmodule}_FOUND) - message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.") - endif() - if ("${_ucmodule}" STREQUAL "MAIN") - message(FATAL_ERROR "Can not use \"${_module}\" module with qt4_use_modules.") + set(_targetPrefix QT_QT${_ucmodule}) + if (_ucmodule STREQUAL QAXCONTAINER OR _ucmodule STREQUAL QAXSERVER) + if (NOT QT_Q${_ucmodule}_FOUND) + message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.") + endif() + set(_targetPrefix QT_Q${_ucmodule}) + else() + if (NOT QT_QT${_ucmodule}_FOUND) + message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.") + endif() + if ("${_ucmodule}" STREQUAL "MAIN") + message(FATAL_ERROR "Can not use \"${_module}\" module with qt4_use_modules.") + endif() endif() - target_link_libraries(${_target} ${link_type} ${QT_QT${_ucmodule}_LIBRARY}) - set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${QT_QT${_ucmodule}_INCLUDE_DIR} ${QT_HEADERS_DIR} ${QT_MKSPECS_DIR}/default) - set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${QT_QT${_ucmodule}_COMPILE_DEFINITIONS}) + target_link_libraries(${_target} ${link_type} ${${_targetPrefix}_LIBRARIES}) + set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${${_targetPrefix}_INCLUDE_DIR} ${QT_HEADERS_DIR} ${QT_MKSPECS_DIR}/default) + set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${${_targetPrefix}_COMPILE_DEFINITIONS}) endforeach() endfunction() -- cgit v0.12 From 94e7fef2268ba9d31bd31834f05f6d0c2ffe5a18 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Fri, 26 Apr 2013 22:04:44 -0600 Subject: OS X: Add RPATH support for Mac. RPATH support is activated on targets that have the MACOSX_RPATH property turned on. For install time, it is also useful to set INSTALL_RPATH to help find dependent libraries with an @rpath in their install name. Also adding detection of rpath conflicts when using frameworks. --- Modules/Platform/Darwin.cmake | 5 ++ Source/cmComputeLinkInformation.cxx | 60 ++++++++++++++++++--- Source/cmInstallTargetGenerator.cxx | 76 ++++++++++++++++++++------- Source/cmOrderDirectories.cxx | 45 ++++++++++++++-- Source/cmSystemTools.cxx | 21 ++++++++ Source/cmSystemTools.h | 4 ++ Source/cmTarget.cxx | 101 +++++++++++++++++++++++++++++++++++- Source/cmTarget.h | 9 ++++ 8 files changed, 289 insertions(+), 32 deletions(-) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 6e5d449..f0652b9 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -30,6 +30,11 @@ set(CMAKE_SHARED_MODULE_SUFFIX ".so") set(CMAKE_MODULE_EXISTS 1) set(CMAKE_DL_LIBS "") +# Enable rpath support for 10.5 and greater where it is known to work. +if("${DARWIN_MAJOR_VERSION}" GREATER 8) + set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") +endif() + set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ") set(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ") set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}") diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 896b50a..9affeff 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1724,6 +1724,17 @@ void cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath, cmTarget* target) { + // Ignore targets on Apple where install_name is not @rpath. + // The dependenty library can be found with other means such as + // @loader_path or full paths. + if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) + { + if(!target->HasMacOSXRpath(this->Config)) + { + return; + } + } + // Libraries with unknown type must be handled using just the file // on disk. if(target->GetType() == cmTarget::UNKNOWN_LIBRARY) @@ -1756,25 +1767,60 @@ void cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath) { // Get the name of the library from the file name. + bool is_shared_library = false; std::string file = cmSystemTools::GetFilenameName(fullPath); - if(!this->ExtractSharedLibraryName.find(file.c_str())) + + if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) + { + // Check that @rpath is part of the install name. + // If it isn't, return. + std::string soname; + if(!cmSystemTools::GuessLibraryInstallName(fullPath, soname)) + { + return; + } + + if(soname.find("@rpath") == std::string::npos) + { + return; + } + } + + is_shared_library = this->ExtractSharedLibraryName.find(file.c_str()); + + if(!is_shared_library) { // On some platforms (AIX) a shared library may look static. if(this->ArchivesMayBeShared) { - if(!this->ExtractStaticLibraryName.find(file.c_str())) + if(this->ExtractStaticLibraryName.find(file.c_str())) { - // This is not the name of a shared library or archive. - return; + // This is the name of a shared library or archive. + is_shared_library = true; } } - else + } + + // It could be an Apple framework + if(!is_shared_library) + { + if(fullPath.find(".framework") != std::string::npos) { - // This is not the name of a shared library. - return; + cmsys::RegularExpression splitFramework; + splitFramework.compile("^(.*)/(.*).framework/.*/(.*)$"); + if(splitFramework.find(fullPath) && + (splitFramework.match(2) == splitFramework.match(3))) + { + is_shared_library = true; + } } } + if(!is_shared_library) + { + return; + } + // Include this library in the runtime path ordering. this->OrderRuntimeSearchPath->AddRuntimeLibrary(fullPath); if(this->LinkWithRuntimePath) diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 9aac440..ed01210 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -606,6 +606,12 @@ cmInstallTargetGenerator return; } + // Skip if on Apple + if(this->Target->GetMakefile()->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) + { + return; + } + // Get the link information for this target. // It can provide the RPATH. cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config); @@ -645,30 +651,62 @@ cmInstallTargetGenerator return; } - // Construct the original rpath string to be replaced. - std::string oldRpath = cli->GetRPathString(false); - - // Get the install RPATH from the link information. - std::string newRpath = cli->GetChrpathString(); - - // Skip the rule if the paths are identical - if(oldRpath == newRpath) + if(this->Target->GetMakefile()->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) { - return; - } + // If using install_name_tool, set up the rules to modify the rpaths. + std::string installNameTool = + this->Target->GetMakefile()-> + GetSafeDefinition("CMAKE_INSTALL_NAME_TOOL"); + + std::vector oldRuntimeDirs, newRuntimeDirs; + cli->GetRPath(oldRuntimeDirs, false); + cli->GetRPath(newRuntimeDirs, true); + + // Note: These are separate commands to avoid install_name_tool + // corruption on 10.6. + for(std::vector::const_iterator i = oldRuntimeDirs.begin(); + i != oldRuntimeDirs.end(); ++i) + { + os << indent << "execute_process(COMMAND " << installNameTool << "\n"; + os << indent << " -delete_rpath \"" << *i << "\"\n"; + os << indent << " \"" << toDestDirPath << "\")\n"; + } - // Write a rule to run chrpath to set the install-tree RPATH - if(newRpath.empty()) - { - os << indent << "FILE(RPATH_REMOVE\n" - << indent << " FILE \"" << toDestDirPath << "\")\n"; + for(std::vector::const_iterator i = newRuntimeDirs.begin(); + i != newRuntimeDirs.end(); ++i) + { + os << indent << "execute_process(COMMAND " << installNameTool << "\n"; + os << indent << " -add_rpath \"" << *i << "\"\n"; + os << indent << " \"" << toDestDirPath << "\")\n"; + } } else { - os << indent << "FILE(RPATH_CHANGE\n" - << indent << " FILE \"" << toDestDirPath << "\"\n" - << indent << " OLD_RPATH \"" << oldRpath << "\"\n" - << indent << " NEW_RPATH \"" << newRpath << "\")\n"; + // Construct the original rpath string to be replaced. + std::string oldRpath = cli->GetRPathString(false); + + // Get the install RPATH from the link information. + std::string newRpath = cli->GetChrpathString(); + + // Skip the rule if the paths are identical + if(oldRpath == newRpath) + { + return; + } + + // Write a rule to run chrpath to set the install-tree RPATH + if(newRpath.empty()) + { + os << indent << "FILE(RPATH_REMOVE\n" + << indent << " FILE \"" << toDestDirPath << "\")\n"; + } + else + { + os << indent << "FILE(RPATH_CHANGE\n" + << indent << " FILE \"" << toDestDirPath << "\"\n" + << indent << " OLD_RPATH \"" << oldRpath << "\"\n" + << indent << " NEW_RPATH \"" << newRpath << "\")\n"; + } } } diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 6e41768..93885b2 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -36,8 +36,25 @@ public: OD(od), GlobalGenerator(od->GlobalGenerator) { this->FullPath = file; - this->Directory = cmSystemTools::GetFilenamePath(file); - this->FileName = cmSystemTools::GetFilenameName(file); + + if(file.rfind(".framework") != std::string::npos) + { + cmsys::RegularExpression splitFramework; + splitFramework.compile("^(.*)/(.*).framework/.*/(.*)$"); + if(splitFramework.find(file) && + (splitFramework.match(2) == splitFramework.match(3))) + { + this->Directory = splitFramework.match(1); + this->FileName = + std::string(file.begin() + this->Directory.size() + 1, file.end()); + } + } + + if(this->FileName.empty()) + { + this->Directory = cmSystemTools::GetFilenamePath(file); + this->FileName = cmSystemTools::GetFilenameName(file); + } } virtual ~cmOrderDirectoriesConstraint() {} @@ -301,22 +318,42 @@ void cmOrderDirectories::AddRuntimeLibrary(std::string const& fullPath, // Add the runtime library at most once. if(this->EmmittedConstraintSOName.insert(fullPath).second) { + std::string soname2 = soname ? soname : ""; // Implicit link directories need special handling. if(!this->ImplicitDirectories.empty()) { std::string dir = cmSystemTools::GetFilenamePath(fullPath); + + if(fullPath.rfind(".framework") != std::string::npos) + { + cmsys::RegularExpression splitFramework; + splitFramework.compile("^(.*)/(.*).framework/(.*)/(.*)$"); + if(splitFramework.find(fullPath) && + (splitFramework.match(2) == splitFramework.match(4))) + { + dir = splitFramework.match(1); + soname2 = splitFramework.match(2); + soname2 += ".framework/"; + soname2 += splitFramework.match(3); + soname2 += "/"; + soname2 += splitFramework.match(4); + } + } + if(this->ImplicitDirectories.find(dir) != this->ImplicitDirectories.end()) { this->ImplicitDirEntries.push_back( - new cmOrderDirectoriesConstraintSOName(this, fullPath, soname)); + new cmOrderDirectoriesConstraintSOName(this, fullPath, + soname2.c_str())); return; } } // Construct the runtime information entry for this library. this->ConstraintEntries.push_back( - new cmOrderDirectoriesConstraintSOName(this, fullPath, soname)); + new cmOrderDirectoriesConstraintSOName(this, fullPath, + soname2.c_str())); } else { diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 67f3023..803d0da 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -2413,6 +2413,27 @@ bool cmSystemTools::GuessLibrarySOName(std::string const& fullPath, } //---------------------------------------------------------------------------- +bool cmSystemTools::GuessLibraryInstallName(std::string const& fullPath, + std::string& soname) +{ + std::vector cmds; + cmds.push_back("otool"); + cmds.push_back("-D"); + cmds.push_back(fullPath.c_str()); + + std::string output; + RunSingleCommand(cmds, &output, 0, 0, OUTPUT_NONE); + + std::vector strs = cmSystemTools::tokenize(output, "\n"); + if(strs.size() == 2) + { + soname = strs[1]; + return true; + } + return false; +} + +//---------------------------------------------------------------------------- #if defined(CMAKE_USE_ELF_PARSER) std::string::size_type cmSystemToolsFindRPath(std::string const& have, std::string const& want) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 0b2def2..d11e24d 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -439,6 +439,10 @@ public: static bool GuessLibrarySOName(std::string const& fullPath, std::string& soname); + /** Try to guess the install name of a shared library. */ + static bool GuessLibraryInstallName(std::string const& fullPath, + std::string& soname); + /** Try to set the RPATH in an ELF binary. */ static bool ChangeRPath(std::string const& file, std::string const& oldRPath, diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 093b30e..a4b3938 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1161,6 +1161,15 @@ void cmTarget::DefineProperties(cmake *cm) "hard-code all the settings instead of using the target properties."); cm->DefineProperty + ("MACOSX_RPATH", cmProperty::TARGET, + "Whether to use rpaths on Mac OS X.", + "When this property is set to true, the directory portion of the" + "\"install_name\" field of shared libraries will default to \"@rpath\"." + "Runtime paths will also be embedded in binaries using this target." + "This property is initialized by the value of the variable " + "CMAKE_MACOSX_RPATH if it is set when a target is created."); + + cm->DefineProperty ("ENABLE_EXPORTS", cmProperty::TARGET, "Specify whether an executable exports symbols for loadable modules.", "Normally an executable does not export any symbols because it is " @@ -1488,6 +1497,8 @@ void cmTarget::SetMakefile(cmMakefile* mf) this->SetPropertyDefault("LINK_INTERFACE_LIBRARIES", 0); this->SetPropertyDefault("WIN32_EXECUTABLE", 0); this->SetPropertyDefault("MACOSX_BUNDLE", 0); + this->SetPropertyDefault("MACOSX_RPATH", 0); + // Collect the set of configuration types. std::vector configNames; @@ -3793,6 +3804,75 @@ std::string cmTarget::GetSOName(const char* config) } //---------------------------------------------------------------------------- +bool cmTarget::HasMacOSXRpath(const char* config) +{ + bool install_name_is_rpath = false; + bool macosx_rpath = this->GetPropertyAsBool("MACOSX_RPATH"); + + if(!this->IsImportedTarget) + { + const char* install_name = this->GetProperty("INSTALL_NAME_DIR"); + bool use_install_name = + this->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH"); + if(install_name && use_install_name && + std::string(install_name) == "@rpath") + { + install_name_is_rpath = true; + } + } + else + { + // Lookup the imported soname. + if(cmTarget::ImportInfo const* info = this->GetImportInfo(config, this)) + { + if(!info->NoSOName && !info->SOName.empty()) + { + if(info->SOName.find("@rpath/") == 0) + { + install_name_is_rpath = true; + } + } + else + { + std::string install_name; + cmSystemTools::GuessLibraryInstallName(info->Location, install_name); + if(install_name.find("@rpath") != std::string::npos) + { + install_name_is_rpath = true; + } + } + } + } + + if(!install_name_is_rpath && !macosx_rpath) + { + return false; + } + + if(!this->Makefile->IsSet("CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG")) + { + cmOStringStream w; + w << "Attempting to use"; + if(macosx_rpath) + { + w << " MACOSX_RPATH"; + } + else + { + w << " @rpath"; + } + w << " without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being set."; + w << " This could be because you are using a Mac OS X version"; + w << " less than 10.5 or because CMake's platform configuration is"; + w << " corrupt."; + cmake* cm = this->Makefile->GetCMakeInstance(); + cm->IssueMessage(cmake::FATAL_ERROR, w.str(), this->GetBacktrace()); + } + + return true; +} + +//---------------------------------------------------------------------------- bool cmTarget::IsImportedSharedLibWithoutSOName(const char* config) { if(this->IsImported() && this->GetType() == cmTarget::SHARED_LIBRARY) @@ -4432,7 +4512,15 @@ std::string cmTarget::GetInstallNameDirForBuildTree(const char* config) !this->Makefile->IsOn("CMAKE_SKIP_RPATH") && !this->GetPropertyAsBool("SKIP_BUILD_RPATH")) { - std::string dir = this->GetDirectory(config); + std::string dir; + if(this->GetPropertyAsBool("MACOSX_RPATH")) + { + dir = "@rpath"; + } + else + { + dir = this->GetDirectory(config); + } dir += "/"; return dir; } @@ -4459,6 +4547,10 @@ std::string cmTarget::GetInstallNameDirForInstallTree() dir += "/"; } } + if(dir.empty() && this->GetPropertyAsBool("MACOSX_RPATH")) + { + dir = "@rpath/"; + } return dir; } else @@ -5040,7 +5132,6 @@ void cmTarget::GetLanguages(std::set& languages) const //---------------------------------------------------------------------------- bool cmTarget::IsChrpathUsed(const char* config) { -#if defined(CMAKE_USE_ELF_PARSER) // Only certain target types have an rpath. if(!(this->GetType() == cmTarget::SHARED_LIBRARY || this->GetType() == cmTarget::MODULE_LIBRARY || @@ -5074,6 +5165,12 @@ bool cmTarget::IsChrpathUsed(const char* config) return false; } + if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) + { + return true; + } + +#if defined(CMAKE_USE_ELF_PARSER) // Enable if the rpath flag uses a separator and the target uses ELF // binaries. if(const char* ll = this->GetLinkerLanguage(config, this)) diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 4264e76..9d25919 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -362,6 +362,9 @@ public: /** Get the soname of the target. Allowed only for a shared library. */ std::string GetSOName(const char* config); + /** Whether this library has @rpath and platform supports it. */ + bool HasMacOSXRpath(const char* config); + /** Test for special case of a third-party shared library that has no soname at all. */ bool IsImportedSharedLibWithoutSOName(const char* config); @@ -407,7 +410,13 @@ public: /** Return true if builtin chrpath will work for this target */ bool IsChrpathUsed(const char* config); + /** Return the install name directory for the target in the + * build tree. For example: "@rpath/", "@loader_path/", + * or "/full/path/to/library". */ std::string GetInstallNameDirForBuildTree(const char* config); + + /** Return the install name directory for the target in the + * install tree. For example: "@rpath/" or "@loader_path/". */ std::string GetInstallNameDirForInstallTree(); cmComputeLinkInformation* GetLinkInformation(const char* config, -- cgit v0.12 From 00d71bdd193b645aec10b41866bddb164c0eb093 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Wed, 1 May 2013 06:27:48 -0600 Subject: Xcode: Add rpath support in Xcode generator. --- Source/cmGlobalXCodeGenerator.cxx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 9bbf186..f2bb9d7 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2244,6 +2244,29 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, buildSettings->AddAttribute("INSTALL_PATH", this->CreateString(install_name_dir.c_str())); + // Create the LD_RUNPATH_SEARCH_PATHS + cmComputeLinkInformation* pcli = target.GetLinkInformation(configName); + if(pcli) + { + std::string search_paths; + std::vector runtimeDirs; + pcli->GetRPath(runtimeDirs, false); + for(std::vector::const_iterator i = runtimeDirs.begin(); + i != runtimeDirs.end(); ++i) + { + if(!search_paths.empty()) + { + search_paths += " "; + } + search_paths += this->XCodeEscapePath((*i).c_str()); + } + if(!search_paths.empty()) + { + buildSettings->AddAttribute("LD_RUNPATH_SEARCH_PATHS", + this->CreateString(search_paths.c_str())); + } + } + buildSettings->AddAttribute("OTHER_LDFLAGS", this->CreateString(extraLinkOptions.c_str())); buildSettings->AddAttribute("OTHER_REZFLAGS", -- cgit v0.12 From 8576b3f978e65a9c94630226e1da3f03047691a7 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Mon, 20 May 2013 16:57:58 -0600 Subject: OS X: Add support for @rpath in export files. Also expand the IMPORTED_SONAME property for targets to match the install_name. --- Source/cmExportBuildFileGenerator.cxx | 16 ++++++++++++++++ Source/cmExportBuildFileGenerator.h | 2 ++ Source/cmExportFileGenerator.cxx | 6 +++++- Source/cmExportFileGenerator.h | 3 +++ Source/cmExportInstallFileGenerator.cxx | 16 ++++++++++++++++ Source/cmExportInstallFileGenerator.h | 2 ++ Source/cmExportTryCompileFileGenerator.cxx | 15 +++++++++++++++ Source/cmExportTryCompileFileGenerator.h | 2 ++ Source/cmTarget.cxx | 4 ++++ 9 files changed, 65 insertions(+), 1 deletion(-) diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index f8a32c2..75a8aba 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -211,3 +211,19 @@ cmExportBuildFileGenerator << "consider using the APPEND option with multiple separate calls."; this->ExportCommand->ErrorMessage = e.str(); } + +std::string +cmExportBuildFileGenerator::InstallNameDir(cmTarget* target, + const std::string& config) +{ + std::string install_name_dir; + + cmMakefile* mf = target->GetMakefile(); + if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) + { + install_name_dir = + target->GetInstallNameDirForBuildTree(config.c_str()); + } + + return install_name_dir; +} diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h index 5e1be16..3ffdf8b 100644 --- a/Source/cmExportBuildFileGenerator.h +++ b/Source/cmExportBuildFileGenerator.h @@ -61,6 +61,8 @@ protected: cmTarget* target, ImportPropertyMap& properties); + std::string InstallNameDir(cmTarget* target, const std::string& config); + std::vector const* Exports; cmExportCommand* ExportCommand; }; diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 27ec56b..c465a68 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -624,8 +624,12 @@ cmExportFileGenerator std::string value; if(target->HasSOName(config)) { + if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) + { + value = this->InstallNameDir(target, config); + } prop = "IMPORTED_SONAME"; - value = target->GetSOName(config); + value += target->GetSOName(config); } else { diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h index 9f958a2..ed2d93b 100644 --- a/Source/cmExportFileGenerator.h +++ b/Source/cmExportFileGenerator.h @@ -159,6 +159,9 @@ private: std::vector &missingTargets); virtual void ReplaceInstallPrefix(std::string &input); + + virtual std::string InstallNameDir(cmTarget* target, + const std::string& config) = 0; }; #endif diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index fff807c..9d1bdaf 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -490,3 +490,19 @@ cmExportInstallFileGenerator } cmSystemTools::Error(e.str().c_str()); } + +std::string +cmExportInstallFileGenerator::InstallNameDir(cmTarget* target, + const std::string&) +{ + std::string install_name_dir; + + cmMakefile* mf = target->GetMakefile(); + if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) + { + install_name_dir = + target->GetInstallNameDirForInstallTree(); + } + + return install_name_dir; +} diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h index 20dd57a..7c634a4 100644 --- a/Source/cmExportInstallFileGenerator.h +++ b/Source/cmExportInstallFileGenerator.h @@ -85,6 +85,8 @@ protected: void ComplainAboutImportPrefix(cmInstallTargetGenerator* itgen); + std::string InstallNameDir(cmTarget* target, const std::string& config); + cmInstallExportGenerator* IEGen; std::string ImportPrefix; diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index 75f2651..948508b 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -112,3 +112,18 @@ cmExportTryCompileFileGenerator::PopulateProperties(cmTarget* target, } } } +std::string +cmExportTryCompileFileGenerator::InstallNameDir(cmTarget* target, + const std::string& config) +{ + std::string install_name_dir; + + cmMakefile* mf = target->GetMakefile(); + if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) + { + install_name_dir = + target->GetInstallNameDirForBuildTree(config.c_str()); + } + + return install_name_dir; +} diff --git a/Source/cmExportTryCompileFileGenerator.h b/Source/cmExportTryCompileFileGenerator.h index ed393ab..91b4a61 100644 --- a/Source/cmExportTryCompileFileGenerator.h +++ b/Source/cmExportTryCompileFileGenerator.h @@ -43,6 +43,8 @@ protected: ImportPropertyMap& properties, std::set &emitted); + std::string InstallNameDir(cmTarget* target, + const std::string& config); private: std::string FindTargets(const char *prop, cmTarget *tgt, std::set &emitted); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index a4b3938..ea718ae 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3782,6 +3782,10 @@ std::string cmTarget::GetSOName(const char* config) else { // Use the soname given if any. + if(info->SOName.find("@rpath/") == 0) + { + return info->SOName.substr(6); + } return info->SOName; } } -- cgit v0.12 From dc1d025197d48829f2c0389824c8273b9e257413 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Wed, 1 May 2013 22:19:06 -0600 Subject: OS X: Add test for rpaths on Mac. This also tests rpaths through export/import. --- Tests/CMakeLists.txt | 10 +++++ Tests/MacRuntimePath/A/CMakeLists.txt | 63 ++++++++++++++++++++++++++ Tests/MacRuntimePath/A/framework.cpp | 8 ++++ Tests/MacRuntimePath/A/framework.h | 17 +++++++ Tests/MacRuntimePath/A/shared.cpp | 8 ++++ Tests/MacRuntimePath/A/shared.h | 17 +++++++ Tests/MacRuntimePath/A/test1.cpp | 8 ++++ Tests/MacRuntimePath/A/test2.cpp | 8 ++++ Tests/MacRuntimePath/A/test3.cpp | 8 ++++ Tests/MacRuntimePath/B/CMakeLists.txt | 17 +++++++ Tests/MacRuntimePath/CMakeLists.txt | 72 ++++++++++++++++++++++++++++++ Tests/MacRuntimePath/InitialCache.cmake.in | 13 ++++++ 12 files changed, 249 insertions(+) create mode 100644 Tests/MacRuntimePath/A/CMakeLists.txt create mode 100644 Tests/MacRuntimePath/A/framework.cpp create mode 100644 Tests/MacRuntimePath/A/framework.h create mode 100644 Tests/MacRuntimePath/A/shared.cpp create mode 100644 Tests/MacRuntimePath/A/shared.h create mode 100644 Tests/MacRuntimePath/A/test1.cpp create mode 100644 Tests/MacRuntimePath/A/test2.cpp create mode 100644 Tests/MacRuntimePath/A/test3.cpp create mode 100644 Tests/MacRuntimePath/B/CMakeLists.txt create mode 100644 Tests/MacRuntimePath/CMakeLists.txt create mode 100644 Tests/MacRuntimePath/InitialCache.cmake.in diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index e07bb69..904922f 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1219,6 +1219,16 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ endif() endif() + if(APPLE AND "${DARWIN_MAJOR_VERSION}" GREATER 9) + add_test(MacRuntimePath ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/MacRuntimePath" + "${CMake_BINARY_DIR}/Tests/MacRuntimePath" + ${build_generator_args} + --build-project MacRuntimePath + ) + endif() + add_test(linkorder1 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/LinkLineOrder" diff --git a/Tests/MacRuntimePath/A/CMakeLists.txt b/Tests/MacRuntimePath/A/CMakeLists.txt new file mode 100644 index 0000000..6e6de42 --- /dev/null +++ b/Tests/MacRuntimePath/A/CMakeLists.txt @@ -0,0 +1,63 @@ +cmake_minimum_required(VERSION 2.8) +project(MacRuntimePath_A) + +# a shared library +add_library(shared SHARED shared.cpp shared.h) +set_target_properties(shared PROPERTIES MACOSX_RPATH 1) + +# a shared library with custom set @rpath +add_library(shared2 SHARED shared.cpp shared.h) +set_target_properties(shared2 PROPERTIES + BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@rpath") + +# a framework library +add_library(framework SHARED framework.cpp framework.h) +set_target_properties(framework PROPERTIES MACOSX_RPATH 1 FRAMEWORK 1) + +# executable to test a shared library dependency with install rpaths +add_executable(test1 test1.cpp) +target_link_libraries(test1 shared) +set_target_properties(test1 PROPERTIES + BUILD_WITH_INSTALL_RPATH 1 INSTALL_RPATH "@loader_path/../lib") + +# executable to test a framework library dependency with install rpaths +add_executable(test2 test2.cpp) +target_link_libraries(test2 framework) +set_target_properties(test2 PROPERTIES + BUILD_WITH_INSTALL_RPATH 1 INSTALL_RPATH "@loader_path/../lib") + +# executable to test a framework library dependency with build tree rpaths +add_executable(test3 test3.cpp) +target_link_libraries(test3 framework) + +# executable to test a framework library dependency with build tree rpaths +add_executable(test4 test1.cpp) +target_link_libraries(test4 shared2) + +set_target_properties(shared shared2 framework PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib") +set_target_properties(test1 test2 test3 test4 PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin") +foreach(config ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${config} CONFIG) + set_target_properties(shared shared2 framework PROPERTIES + LIBRARY_OUTPUT_DIRECTORY_${CONFIG} + "${CMAKE_CURRENT_BINARY_DIR}/${config}/lib") + set_target_properties(test1 test2 test3 test4 PROPERTIES + RUNTIME_OUTPUT_DIRECTORY_${CONFIG} + "${CMAKE_CURRENT_BINARY_DIR}/${config}/bin") +endforeach() + +foreach(test test1 test2 test3 test4) + add_custom_target(${test}_run ALL + COMMAND ${test} + DEPENDS ${test} + ) +endforeach() + +export(TARGETS shared shared2 framework FILE "${CMAKE_CURRENT_BINARY_DIR}/exp.cmake") + +install(TARGETS shared EXPORT MyExport DESTINATION lib) +install(TARGETS shared2 EXPORT MyExport DESTINATION lib2) +install(TARGETS framework EXPORT MyExport DESTINATION lib-fw) +install(EXPORT MyExport DESTINATION lib FILE exp.cmake) diff --git a/Tests/MacRuntimePath/A/framework.cpp b/Tests/MacRuntimePath/A/framework.cpp new file mode 100644 index 0000000..abda195 --- /dev/null +++ b/Tests/MacRuntimePath/A/framework.cpp @@ -0,0 +1,8 @@ + +#include "framework.h" +#include "stdio.h" + +void framework() +{ + printf("framework\n"); +} diff --git a/Tests/MacRuntimePath/A/framework.h b/Tests/MacRuntimePath/A/framework.h new file mode 100644 index 0000000..bdd10f0 --- /dev/null +++ b/Tests/MacRuntimePath/A/framework.h @@ -0,0 +1,17 @@ + +#ifndef framework_h +#define framework_h + +#ifdef WIN32 +# ifdef framework_EXPORTS +# define FRAMEWORK_EXPORT __declspec(dllexport) +# else +# define FRAMEWORK_EXPORT __declspec(dllimport) +# endif +#else +# define FRAMEWORK_EXPORT +#endif + +void FRAMEWORK_EXPORT framework(); + +#endif diff --git a/Tests/MacRuntimePath/A/shared.cpp b/Tests/MacRuntimePath/A/shared.cpp new file mode 100644 index 0000000..e5e7dc5 --- /dev/null +++ b/Tests/MacRuntimePath/A/shared.cpp @@ -0,0 +1,8 @@ + +#include "shared.h" +#include "stdio.h" + +void shared() +{ + printf("shared\n"); +} diff --git a/Tests/MacRuntimePath/A/shared.h b/Tests/MacRuntimePath/A/shared.h new file mode 100644 index 0000000..3588fb8 --- /dev/null +++ b/Tests/MacRuntimePath/A/shared.h @@ -0,0 +1,17 @@ + +#ifndef shared_h +#define shared_h + +#ifdef WIN32 +# ifdef shared_EXPORTS +# define SHARED_EXPORT __declspec(dllexport) +# else +# define SHARED_EXPORT __declspec(dllimport) +# endif +#else +# define SHARED_EXPORT +#endif + +void SHARED_EXPORT shared(); + +#endif diff --git a/Tests/MacRuntimePath/A/test1.cpp b/Tests/MacRuntimePath/A/test1.cpp new file mode 100644 index 0000000..cb93448 --- /dev/null +++ b/Tests/MacRuntimePath/A/test1.cpp @@ -0,0 +1,8 @@ + +#include "shared.h" + +int main(int, char**) +{ + shared(); + return 0; +} diff --git a/Tests/MacRuntimePath/A/test2.cpp b/Tests/MacRuntimePath/A/test2.cpp new file mode 100644 index 0000000..26bc9dd --- /dev/null +++ b/Tests/MacRuntimePath/A/test2.cpp @@ -0,0 +1,8 @@ + +#include "framework.h" + +int main(int, char**) +{ + framework(); + return 0; +} diff --git a/Tests/MacRuntimePath/A/test3.cpp b/Tests/MacRuntimePath/A/test3.cpp new file mode 100644 index 0000000..26bc9dd --- /dev/null +++ b/Tests/MacRuntimePath/A/test3.cpp @@ -0,0 +1,8 @@ + +#include "framework.h" + +int main(int, char**) +{ + framework(); + return 0; +} diff --git a/Tests/MacRuntimePath/B/CMakeLists.txt b/Tests/MacRuntimePath/B/CMakeLists.txt new file mode 100644 index 0000000..c361620 --- /dev/null +++ b/Tests/MacRuntimePath/B/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 2.8) +project(MacRuntimePath_B) + +include(${MacRuntimePath_B_BINARY_DIR}/../Root/lib/exp.cmake) + +add_executable(testb ${MacRuntimePath_B_SOURCE_DIR}/../A/test3.cpp) + +# test link with rpath enabled targets +target_link_libraries(testb shared framework) + +# test link with rpath enabled library by filename +target_link_libraries(testb $ framework) + +add_custom_target(testb_run ALL + COMMAND testb + DEPENDS testb + ) diff --git a/Tests/MacRuntimePath/CMakeLists.txt b/Tests/MacRuntimePath/CMakeLists.txt new file mode 100644 index 0000000..5e5b6c4 --- /dev/null +++ b/Tests/MacRuntimePath/CMakeLists.txt @@ -0,0 +1,72 @@ +cmake_minimum_required (VERSION 2.8) +project(MacRuntimePath) + + +# Wipe out the install tree to make sure the exporter works. +add_custom_command( + OUTPUT ${MacRuntimePath_BINARY_DIR}/CleanupProject + COMMAND ${CMAKE_COMMAND} -E remove_directory ${MacRuntimePath_BINARY_DIR}/Root + ) +add_custom_target(CleanupTarget ALL DEPENDS ${MacRuntimePath_BINARY_DIR}/CleanupProject) +set_property( + SOURCE ${MacRuntimePath_BINARY_DIR}/CleanupProject + PROPERTY SYMBOLIC 1 + ) + +configure_file(${MacRuntimePath_SOURCE_DIR}/InitialCache.cmake.in + ${MacRuntimePath_BINARY_DIR}/InitialCache.cmake @ONLY) + +if(CMAKE_CONFIGURATION_TYPES) + set(NESTED_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}") +else() + if(CMAKE_BUILD_TYPE) + set(NESTED_CONFIG_TYPE -C "${CMAKE_BUILD_TYPE}") + else() + set(NESTED_CONFIG_TYPE) + endif() +endif() + +# Build and install the exporter. +add_custom_command( + OUTPUT ${MacRuntimePath_BINARY_DIR}/ExportProject + COMMAND ${CMAKE_CTEST_COMMAND} ${NESTED_CONFIG_TYPE} + --build-and-test + ${MacRuntimePath_SOURCE_DIR}/A + ${MacRuntimePath_BINARY_DIR}/A + --build-noclean + --build-project MacRuntimePath_A + --build-target install + --build-generator ${CMAKE_GENERATOR} + --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" + --build-makeprogram ${CMAKE_MAKE_PROGRAM} + --build-options -C${MacRuntimePath_BINARY_DIR}/InitialCache.cmake + VERBATIM + ) +add_custom_target(ExportTarget ALL DEPENDS ${MacRuntimePath_BINARY_DIR}/ExportProject) +add_dependencies(ExportTarget CleanupTarget) +set_property( + SOURCE ${MacRuntimePath_BINARY_DIR}/ExportProject + PROPERTY SYMBOLIC 1 + ) + +# Build the importer. +add_custom_command( + OUTPUT ${MacRuntimePath_BINARY_DIR}/ImportProject + COMMAND ${CMAKE_CTEST_COMMAND} ${NESTED_CONFIG_TYPE} + --build-and-test + ${MacRuntimePath_SOURCE_DIR}/B + ${MacRuntimePath_BINARY_DIR}/B + --build-noclean + --build-project MacRuntimePath_B + --build-generator ${CMAKE_GENERATOR} + --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" + --build-makeprogram ${CMAKE_MAKE_PROGRAM} + --build-options -C${MacRuntimePath_BINARY_DIR}/InitialCache.cmake + VERBATIM + ) +add_custom_target(ImportTarget ALL DEPENDS ${MacRuntimePath_BINARY_DIR}/ImportProject) +add_dependencies(ImportTarget ExportTarget) +set_property( + SOURCE ${MacRuntimePath_BINARY_DIR}/ImportProject + PROPERTY SYMBOLIC 1 + ) diff --git a/Tests/MacRuntimePath/InitialCache.cmake.in b/Tests/MacRuntimePath/InitialCache.cmake.in new file mode 100644 index 0000000..be15eb3 --- /dev/null +++ b/Tests/MacRuntimePath/InitialCache.cmake.in @@ -0,0 +1,13 @@ +set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE STRING "C Compiler") +set(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@" CACHE STRING "C Flags") +set(CMAKE_C_FLAGS_DEBUG "@CMAKE_C_FLAGS_DEBUG@" CACHE STRING "C Flags") +set(CMAKE_C_FLAGS_RELEASE "@CMAKE_C_FLAGS_RELEASE@" CACHE STRING "C Flags") +set(CMAKE_C_FLAGS_MINSIZEREL "@CMAKE_C_FLAGS_MINSIZEREL@" CACHE STRING "C Flags") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "@CMAKE_C_FLAGS_RELWITHDEBINFO@" CACHE STRING "C Flags") +set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@" CACHE STRING "C++ Compiler") +set(CMAKE_CXX_FLAGS "@CMAKE_CXX_FLAGS@" CACHE STRING "C++ Flags") +set(CMAKE_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@" CACHE STRING "C++ Flags") +set(CMAKE_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@" CACHE STRING "C++ Flags") +set(CMAKE_CXX_FLAGS_MINSIZEREL "@CMAKE_CXX_FLAGS_MINSIZEREL@" CACHE STRING "C++ Flags") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@" CACHE STRING "C++ Flags") +set(CMAKE_INSTALL_PREFIX "@MacRuntimePath_BINARY_DIR@/Root" CACHE STRING "Installation Prefix") -- cgit v0.12 From 3d5bb381be16f67e4781c395bda2be12a5d00168 Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Mon, 3 Jun 2013 10:14:52 +0800 Subject: variable_watch: Add missing string enumeration entry (#14188) In commit 9a5b4eba (All variable accesses should produce watch callbacks, 2007-05-17) we added a new enumeration value but did not update the list of strings matching them. Add the missing entry. Without this, variable_watch prints REMOVED_ACCESS instead of MODIFIED_ACCESS when set the value of the variable. --- Source/cmVariableWatch.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx index f5fdca4..3905e9b 100644 --- a/Source/cmVariableWatch.cxx +++ b/Source/cmVariableWatch.cxx @@ -15,6 +15,7 @@ static const char* const cmVariableWatchAccessStrings[] = { "READ_ACCESS", "UNKNOWN_READ_ACCESS", + "UNKNOWN_DEFINED_ACCESS", "ALLOWED_UNKNOWN_READ_ACCESS", "MODIFIED_ACCESS", "REMOVED_ACCESS", -- cgit v0.12 From c63d30048bcf5bd6efa1e038b36c5efd29e34749 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 3 Jun 2013 09:23:25 -0400 Subject: variable_watch: Add test for MODIFIED_ACCESS report Add a RunCMake.variable_watch watch test to cover the basic use case. --- Tests/RunCMake/CMakeLists.txt | 1 + Tests/RunCMake/variable_watch/CMakeLists.txt | 3 +++ Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt | 3 +++ Tests/RunCMake/variable_watch/ModifiedAccess.cmake | 3 +++ Tests/RunCMake/variable_watch/RunCMakeTest.cmake | 3 +++ 5 files changed, 13 insertions(+) create mode 100644 Tests/RunCMake/variable_watch/CMakeLists.txt create mode 100644 Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt create mode 100644 Tests/RunCMake/variable_watch/ModifiedAccess.cmake create mode 100644 Tests/RunCMake/variable_watch/RunCMakeTest.cmake diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index f1e01b1..86c9725 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -77,6 +77,7 @@ add_RunCMake_test(include) add_RunCMake_test(include_directories) add_RunCMake_test(list) add_RunCMake_test(try_compile) +add_RunCMake_test(variable_watch) add_RunCMake_test(CMP0004) find_package(Qt4 QUIET) diff --git a/Tests/RunCMake/variable_watch/CMakeLists.txt b/Tests/RunCMake/variable_watch/CMakeLists.txt new file mode 100644 index 0000000..e8db6b0 --- /dev/null +++ b/Tests/RunCMake/variable_watch/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt b/Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt new file mode 100644 index 0000000..3287626 --- /dev/null +++ b/Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt @@ -0,0 +1,3 @@ +\* Variable "b" was accessed using MODIFIED_ACCESS in: .*/Tests/RunCMake/variable_watch/ModifiedAccess.cmake + The value of the variable: "b" + The list file stack: .*/Tests/RunCMake/variable_watch/CMakeLists.txt;.*/Tests/RunCMake/variable_watch/ModifiedAccess.cmake diff --git a/Tests/RunCMake/variable_watch/ModifiedAccess.cmake b/Tests/RunCMake/variable_watch/ModifiedAccess.cmake new file mode 100644 index 0000000..87943b3 --- /dev/null +++ b/Tests/RunCMake/variable_watch/ModifiedAccess.cmake @@ -0,0 +1,3 @@ +set(b "a") +variable_watch(b) +set(b "b") diff --git a/Tests/RunCMake/variable_watch/RunCMakeTest.cmake b/Tests/RunCMake/variable_watch/RunCMakeTest.cmake new file mode 100644 index 0000000..1dd7688 --- /dev/null +++ b/Tests/RunCMake/variable_watch/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(ModifiedAccess) -- cgit v0.12 From d66f6f36baca6d314f1f17e11d90d52b5c9d7ec2 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 31 May 2013 16:34:02 -0400 Subject: KWSys 2013-05-31 (dccf7725) Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ dccf7725 | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' 725e541e..dccf7725 Brad King (2): e3370418 SystemTools: Use COMPILE_DEFINITIONS to pass platform tests dccf7725 SystemTools: Touch with better than 1s resolution if possible Change-Id: Icdbcdf405e27b2d5dd30857c7c8679ed5096f252 --- CMakeLists.txt | 13 +++++++++-- SystemTools.cxx | 56 ++++++++++++++++++++++++++++++++++++++--------- kwsysPlatformTestsCXX.cxx | 19 ++++++++++++++++ 3 files changed, 76 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 124b8ac..6f0281d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -569,8 +569,17 @@ IF(KWSYS_USE_SystemTools) "Checking whether CXX compiler has unsetenv" DIRECT) KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H "Checking whether CXX compiler has environ in stdlib.h" DIRECT) - SET_SOURCE_FILES_PROPERTIES(SystemTools.cxx PROPERTIES - COMPILE_FLAGS "-DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV} -DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV} -DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}") + KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UTIMES + "Checking whether CXX compiler has utimes" DIRECT) + KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UTIMENSAT + "Checking whether CXX compiler has utimensat" DIRECT) + SET_PROPERTY(SOURCE SystemTools.cxx APPEND PROPERTY COMPILE_DEFINITIONS + KWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV} + KWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV} + KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H} + KWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES} + KWSYS_CXX_HAS_UTIMENSAT=${KWSYS_CXX_HAS_UTIMENSAT} + ) ENDIF() IF(KWSYS_USE_SystemInformation) diff --git a/SystemTools.cxx b/SystemTools.cxx index 158217e..652649f 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -1124,22 +1124,58 @@ bool SystemTools::Touch(const char* filename, bool create) } return false; } -#ifdef _MSC_VER -#define utime _utime -#define utimbuf _utimbuf -#endif - struct stat fromStat; - if(stat(filename, &fromStat) < 0) +#if defined(_WIN32) && !defined(__CYGWIN__) + HANDLE h = CreateFile(filename, FILE_WRITE_ATTRIBUTES, + FILE_SHARE_WRITE, 0, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, 0); + if(!h) + { + return false; + } + FILETIME mtime; + GetSystemTimeAsFileTime(&mtime); + if(!SetFileTime(h, 0, 0, &mtime)) { + CloseHandle(h); return false; } - struct utimbuf buf; - buf.actime = fromStat.st_atime; - buf.modtime = static_cast(SystemTools::GetTime()); - if(utime(filename, &buf) < 0) + CloseHandle(h); +#elif KWSYS_CXX_HAS_UTIMENSAT + struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; + if(utimensat(AT_FDCWD, filename, times, 0) < 0) + { + return false; + } +#else + struct stat st; + if(stat(filename, &st) < 0) { return false; } + struct timeval mtime; + gettimeofday(&mtime, 0); +# if KWSYS_CXX_HAS_UTIMES + struct timeval times[2] = + { +# if KWSYS_STAT_HAS_ST_MTIM + {st.st_atim.tv_sec, st.st_atim.tv_nsec/1000}, /* tv_sec, tv_usec */ +# else + {st.st_atime, 0}, +# endif + mtime + }; + if(utimes(filename, times) < 0) + { + return false; + } +# else + struct utimbuf times = {st.st_atime, mtime.tv_sec}; + if(utime(filename, ×) < 0) + { + return false; + } +# endif +#endif return true; } diff --git a/kwsysPlatformTestsCXX.cxx b/kwsysPlatformTestsCXX.cxx index 48976c4..a7e3b50 100644 --- a/kwsysPlatformTestsCXX.cxx +++ b/kwsysPlatformTestsCXX.cxx @@ -494,6 +494,25 @@ int main() } #endif +#ifdef TEST_KWSYS_CXX_HAS_UTIMES +#include +int main() +{ + struct timeval* current_time = 0; + return utimes("/example", current_time); +} +#endif + +#ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT +#include +#include +int main() +{ + struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; + return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); +} +#endif + #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ -- cgit v0.12 From 9d38db531d4bbba4eca48dc1ec4e724e98614201 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 3 Jun 2013 10:34:35 -0400 Subject: bootstrap: Compile KWSys SystemTools with UTIME(S|NSAT) values The parent commit merged a change to KWSys that adds preprocessor definitions for KWSYS_CXX_HAS_UTIMENSAT and KWSYS_CXX_HAS_UTIMES to the command line for compiling SystemTools. For bootstrapping we do not need sub-1s timestamps so just define them to 0 for now. --- bootstrap | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index 5c2addb..1e2d825 100755 --- a/bootstrap +++ b/bootstrap @@ -1082,6 +1082,8 @@ KWSYS_STL_HAS_ALLOCATOR_OBJECTS=0 KWSYS_CXX_HAS_SETENV=0 KWSYS_CXX_HAS_UNSETENV=0 KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=0 +KWSYS_CXX_HAS_UTIMENSAT=0 +KWSYS_CXX_HAS_UTIMES=0 KWSYS_CXX_HAS_CSTDDEF=0 KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS=0 KWSYS_CXX_HAS_MEMBER_TEMPLATES=0 @@ -1466,7 +1468,13 @@ if [ "x${cmake_cxx_flags}" != "x" ]; then fi cmake_c_flags_String="-DKWSYS_STRING_C" -cmake_cxx_flags_SystemTools="-DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV} -DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV} -DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}" +cmake_cxx_flags_SystemTools=" + -DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV} + -DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV} + -DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H} + -DKWSYS_CXX_HAS_UTIMENSAT=${KWSYS_CXX_HAS_UTIMENSAT} + -DKWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES} +" cmake_c_flags="${cmake_c_flags}-I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \ -I`cmake_escape \"${cmake_bootstrap_dir}\"`" cmake_cxx_flags="${cmake_cxx_flags} -I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \ -- cgit v0.12 From c9b75dcd734e2dd09eadbd9b16a6497bae95941c Mon Sep 17 00:00:00 2001 From: Modestas Vainius Date: Mon, 3 Jun 2013 16:42:12 +0200 Subject: Fix test failures caused by regexp-sensitive characters in the build paths Checkout [1] as an example of the test failures. In that particular cases, the failures is caused by the plus sign in the path being pass unescaped (buildd-cmake_2.8.9-1~bpo60+1-armel-3Lvkef) to the regexp. In addition to failures in the log, the following new tests also fail in 2.8.11: 243 - CTestTestMemcheckUnknown (Failed) 244 - CTestTestMemcheckUnknownQuoted (Failed) 248 - CTestTestMemcheckDummyValgrindFailPre (Failed) 249 - CTestTestMemcheckDummyValgrindFailPost (Failed) 250 - CTestTestMemcheckDummyPurify (Failed) 251 - CTestTestMemcheckDummyBC (Failed) 253 - CMake.List (Failed) [1] https://buildd.debian.org/status/fetch.php?pkg=cmake&arch=armel&ver=2.8.9-1~bpo60%2B1&stamp=1369243896 --- Tests/CMakeLists.txt | 5 +---- Tests/CMakeTests/GetPropertyTest.cmake.in | 29 ++++++++++++++++------------- Tests/CMakeTests/IfTest.cmake.in | 5 ++++- Tests/CMakeTests/ListTest.cmake.in | 21 ++++++++++++--------- Tests/CMakeTests/WhileTest.cmake.in | 14 +++++++++----- Tests/CTestTestMemcheck/CMakeLists.txt | 10 ++++++---- Tests/RegexEscapeString.cmake | 4 ++++ 7 files changed, 52 insertions(+), 36 deletions(-) create mode 100644 Tests/RegexEscapeString.cmake diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index e07bb69..44e9450 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -15,10 +15,7 @@ macro(ADD_TEST_MACRO NAME COMMAND) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}") endmacro() -macro(REGEX_ESCAPE_STRING _OUT _IN) - # Escape special regex metacharacters with a backslash - string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" ${_OUT} "${_IN}") -endmacro() +include(${CMAKE_CURRENT_SOURCE_DIR}/RegexEscapeString.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake) diff --git a/Tests/CMakeTests/GetPropertyTest.cmake.in b/Tests/CMakeTests/GetPropertyTest.cmake.in index 306ab72..a858418 100644 --- a/Tests/CMakeTests/GetPropertyTest.cmake.in +++ b/Tests/CMakeTests/GetPropertyTest.cmake.in @@ -28,92 +28,95 @@ if(NOT result STREQUAL "alpha") message(SEND_ERROR "bad value of VARIABLE PROPERTY test_var: got '${result}' instead of 'alpha'") endif() +include("@CMAKE_CURRENT_SOURCE_DIR@/../RegexEscapeString.cmake") +REGEX_ESCAPE_STRING(CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") + set(Missing-Argument-RESULT 1) -set(Missing-Argument-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Missing-Argument.cmake:1 \\(get_property\\):.*get_property called with incorrect number of arguments.*") +set(Missing-Argument-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Missing-Argument.cmake:1 \\(get_property\\):.*get_property called with incorrect number of arguments.*") check_cmake_test(GetProperty Missing-Argument ) set(Bad-Scope-RESULT 1) -set(Bad-Scope-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Bad-Scope.cmake:1 \\(get_property\\):.*get_property given invalid scope FOO\\..*") +set(Bad-Scope-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Bad-Scope.cmake:1 \\(get_property\\):.*get_property given invalid scope FOO\\..*") check_cmake_test(GetProperty Bad-Scope ) set(Bad-Argument-RESULT 1) -set(Bad-Argument-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Bad-Argument.cmake:1 \\(get_property\\):.*get_property given invalid argument \"FOO\"\\..*") +set(Bad-Argument-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Bad-Argument.cmake:1 \\(get_property\\):.*get_property given invalid argument \"FOO\"\\..*") check_cmake_test(GetProperty Bad-Argument ) set(No-Property-RESULT 1) -set(No-Property-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-No-Property.cmake:1 \\(get_property\\):.*get_property not given a PROPERTY argument\\..*") +set(No-Property-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-No-Property.cmake:1 \\(get_property\\):.*get_property not given a PROPERTY argument\\..*") check_cmake_test(GetProperty No-Property ) set(Global-Name-RESULT 1) -set(Global-Name-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Global-Name.cmake:1 \\(get_property\\):.*get_property given name for GLOBAL scope\\..*") +set(Global-Name-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Global-Name.cmake:1 \\(get_property\\):.*get_property given name for GLOBAL scope\\..*") check_cmake_test(GetProperty Global-Name ) set(Bad-Directory-RESULT 1) -set(Bad-Directory-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Bad-Directory.cmake:1 \\(get_property\\):.*get_property DIRECTORY scope provided but requested directory was not.*found\\..*") +set(Bad-Directory-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Bad-Directory.cmake:1 \\(get_property\\):.*get_property DIRECTORY scope provided but requested directory was not.*found\\..*") check_cmake_test(GetProperty Bad-Directory ) set(No-Target-RESULT 1) -set(No-Target-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-No-Target.cmake:1 \\(get_property\\):.*get_property not given name for TARGET scope\\..*") +set(No-Target-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-No-Target.cmake:1 \\(get_property\\):.*get_property not given name for TARGET scope\\..*") check_cmake_test(GetProperty No-Target ) set(Bad-Target-RESULT 1) -set(Bad-Target-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Bad-Target.cmake:1 \\(get_property\\):.*get_property could not find TARGET FOO\\..*") +set(Bad-Target-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Bad-Target.cmake:1 \\(get_property\\):.*get_property could not find TARGET FOO\\..*") check_cmake_test(GetProperty Bad-Target ) set(No-Source-RESULT 1) -set(No-Source-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-No-Source.cmake:1 \\(get_property\\):.*get_property not given name for SOURCE scope\\..*") +set(No-Source-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-No-Source.cmake:1 \\(get_property\\):.*get_property not given name for SOURCE scope\\..*") check_cmake_test(GetProperty No-Source ) set(No-Test-RESULT 1) -set(No-Test-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-No-Test.cmake:1 \\(get_property\\):.*get_property not given name for TEST scope\\..*") +set(No-Test-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-No-Test.cmake:1 \\(get_property\\):.*get_property not given name for TEST scope\\..*") check_cmake_test(GetProperty No-Test ) set(Bad-Test-RESULT 1) -set(Bad-Test-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Bad-Test.cmake:1 \\(get_property\\):.*get_property given TEST name that does not exist: FOO.*") +set(Bad-Test-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Bad-Test.cmake:1 \\(get_property\\):.*get_property given TEST name that does not exist: FOO.*") check_cmake_test(GetProperty Bad-Test ) set(Variable-Name-RESULT 1) -set(Variable-Name-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Variable-Name.cmake:1 \\(get_property\\):.*get_property given name for VARIABLE scope\\..*") +set(Variable-Name-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-Variable-Name.cmake:1 \\(get_property\\):.*get_property given name for VARIABLE scope\\..*") check_cmake_test(GetProperty Variable-Name ) set(No-Cache-RESULT 1) -set(No-Cache-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-No-Cache.cmake:1 \\(get_property\\):.*get_property not given name for CACHE scope\\..*") +set(No-Cache-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?GetProperty-No-Cache.cmake:1 \\(get_property\\):.*get_property not given name for CACHE scope\\..*") check_cmake_test(GetProperty No-Cache diff --git a/Tests/CMakeTests/IfTest.cmake.in b/Tests/CMakeTests/IfTest.cmake.in index 639e226..74b8e32 100644 --- a/Tests/CMakeTests/IfTest.cmake.in +++ b/Tests/CMakeTests/IfTest.cmake.in @@ -7,6 +7,9 @@ foreach(_arg "" 0 1 2 ${TRUE_NAMES} ${FALSE_NAMES}) set(VAR_${_arg} "${_arg}") endforeach() +include("@CMAKE_CURRENT_SOURCE_DIR@/../RegexEscapeString.cmake") +REGEX_ESCAPE_STRING(CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") + macro(test_vars _old) # Variables set to false or not set. foreach(_var "" 0 ${FALSE_NAMES} UNDEFINED) @@ -158,7 +161,7 @@ endforeach() test_vars("") set(Invalid-Argument-RESULT 1) -set(Invalid-Argument-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?If-Invalid-Argument.cmake:1 \\(if\\):.*Unknown arguments specified.*") +set(Invalid-Argument-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?If-Invalid-Argument.cmake:1 \\(if\\):.*Unknown arguments specified.*") include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake") check_cmake_test(If diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in index f0ed70f..77c34a9 100644 --- a/Tests/CMakeTests/ListTest.cmake.in +++ b/Tests/CMakeTests/ListTest.cmake.in @@ -1,5 +1,8 @@ include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake") +include("@CMAKE_CURRENT_SOURCE_DIR@/../RegexEscapeString.cmake") +REGEX_ESCAPE_STRING(CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") + macro(TEST command expected) if("x${result}" STREQUAL "x${expected}") #message("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"") @@ -101,7 +104,7 @@ list(SORT result) TEST("SORT empty result" "") set(No-Arguments-RESULT 1) -set(No-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-No-Arguments.cmake:1 \\(list\\):.*list must be called with at least two arguments.*") +set(No-Arguments-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-No-Arguments.cmake:1 \\(list\\):.*list must be called with at least two arguments.*") # these trigger top-level condition foreach(cmd IN ITEMS Append Find Get Insert Length Reverse Remove_At Remove_Duplicates Remove_Item Sort) @@ -130,33 +133,33 @@ foreach(cmd IN ITEMS Find Get Insert Length Remove_At Remove_Item) endforeach() set(Length-Too-Many-Arguments-RESULT 1) -set(Length-Too-Many-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Length-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command LENGTH requires two arguments.*") +set(Length-Too-Many-Arguments-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-Length-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command LENGTH requires two arguments.*") set(Reverse-Too-Many-Arguments-RESULT 1) -set(Reverse-Too-Many-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Reverse-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command REVERSE only takes one argument.*") +set(Reverse-Too-Many-Arguments-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-Reverse-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command REVERSE only takes one argument.*") set(Remove_Duplicates-Too-Many-Arguments-RESULT 1) -set(Remove_Duplicates-Too-Many-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Remove_Duplicates-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command REMOVE_DUPLICATES only takes one argument.*") +set(Remove_Duplicates-Too-Many-Arguments-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-Remove_Duplicates-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command REMOVE_DUPLICATES only takes one argument.*") set(Sort-Too-Many-Arguments-RESULT 1) -set(Sort-Too-Many-Arguments-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Sort-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command SORT only takes one argument.*") +set(Sort-Too-Many-Arguments-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-Sort-Too-Many-Arguments.cmake:1 \\(list\\):.*list sub-command SORT only takes one argument.*") set(Invalid-Subcommand-RESULT 1) -set(Invalid-Subcommand-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Invalid-Subcommand.cmake:1 \\(list\\):.*list does not recognize sub-command NO_SUCH_SUBCOMMAND.*") +set(Invalid-Subcommand-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-Invalid-Subcommand.cmake:1 \\(list\\):.*list does not recognize sub-command NO_SUCH_SUBCOMMAND.*") foreach(cmd Get Insert Remove_At) set(${cmd}-Invalid-Index-RESULT 1) - set(${cmd}-Invalid-Index-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-${cmd}-Invalid-Index.cmake:2 \\(list\\):.*list index: 3 out of range \\(-3, 2\\).*") + set(${cmd}-Invalid-Index-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-${cmd}-Invalid-Index.cmake:2 \\(list\\):.*list index: 3 out of range \\(-3, 2\\).*") endforeach() foreach(cmd Remove_Item Reverse Remove_Duplicates Sort Remove_At) string(TOUPPER ${cmd} Cmd) set(${cmd}-Nonexistent-List-RESULT 1) - set(${cmd}-Nonexistent-List-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-${cmd}-Nonexistent-List.cmake:2 \\(list\\):.*sub-command ${Cmd} requires list to be present.*") + set(${cmd}-Nonexistent-List-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-${cmd}-Nonexistent-List.cmake:2 \\(list\\):.*sub-command ${Cmd} requires list to be present.*") endforeach() set(Get-CMP0007-Warn-RESULT 0) -set(Get-CMP0007-Warn-STDERR ".*CMake Warning \\(dev\\) at (@CMAKE_CURRENT_SOURCE_DIR@/)?List-Get-CMP0007-Warn.cmake:3 \\(list\\):.*Policy CMP0007 is not set:.*") +set(Get-CMP0007-Warn-STDERR ".*CMake Warning \\(dev\\) at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?List-Get-CMP0007-Warn.cmake:3 \\(list\\):.*Policy CMP0007 is not set:.*") check_cmake_test(List No-Arguments diff --git a/Tests/CMakeTests/WhileTest.cmake.in b/Tests/CMakeTests/WhileTest.cmake.in index 4cec291..d4cf7d7 100644 --- a/Tests/CMakeTests/WhileTest.cmake.in +++ b/Tests/CMakeTests/WhileTest.cmake.in @@ -1,6 +1,9 @@ set(NUMBERS "") set(COUNT 0) +include("@CMAKE_CURRENT_SOURCE_DIR@/../RegexEscapeString.cmake") +REGEX_ESCAPE_STRING(CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") + while(COUNT LESS 200) set(NUMBERS "${NUMBERS} ${COUNT}") set(COUNT "2${COUNT}") @@ -16,8 +19,9 @@ if(NOT NUMBERS STREQUAL " 0 3 30 20 3 30") message(SEND_ERROR "while loop nesting error, result: '${NUMBERS}'") endif() + set(Missing-Argument-RESULT 1) -set(Missing-Argument-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?While-Missing-Argument.cmake:1 \\(while\\):.*while called with incorrect number of arguments.*") +set(Missing-Argument-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Missing-Argument.cmake:1 \\(while\\):.*while called with incorrect number of arguments.*") include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake") check_cmake_test(While @@ -25,28 +29,28 @@ check_cmake_test(While ) set(Missing-Endwhile-RESULT 1) -set(Missing-Endwhile-STDERR ".*CMake Error in (@CMAKE_CURRENT_SOURCE_DIR@/)?While-Missing-Endwhile.cmake:.*A logical block opening on the line.*(@CMAKE_CURRENT_SOURCE_DIR@/)?While-Missing-Endwhile.cmake:1 \\(while\\).*is not closed\\..*") +set(Missing-Endwhile-STDERR ".*CMake Error in (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Missing-Endwhile.cmake:.*A logical block opening on the line.*(${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Missing-Endwhile.cmake:1 \\(while\\).*is not closed\\..*") check_cmake_test(While Missing-Endwhile ) set(Endwhile-Mismatch-RESULT 0) -set(Endwhile-Mismatch-STDERR ".*CMake Warning \\(dev\\) in (@CMAKE_CURRENT_SOURCE_DIR@/)?While-Endwhile-Mismatch.cmake:.*A logical block opening on the line.*(@CMAKE_CURRENT_SOURCE_DIR@/)?While-Endwhile-Mismatch.cmake:1 \\(while\\).*with mis-matching arguments\\..*") +set(Endwhile-Mismatch-STDERR ".*CMake Warning \\(dev\\) in (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Endwhile-Mismatch.cmake:.*A logical block opening on the line.*(${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Endwhile-Mismatch.cmake:1 \\(while\\).*with mis-matching arguments\\..*") check_cmake_test(While Endwhile-Mismatch ) set(Endwhile-Alone-RESULT 1) -set(Endwhile-Alone-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?While-Endwhile-Alone.cmake:1 \\(endwhile\\):.*An ENDWHILE command was found outside of a proper WHILE ENDWHILE.*structure\\.\n.*$") +set(Endwhile-Alone-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Endwhile-Alone.cmake:1 \\(endwhile\\):.*An ENDWHILE command was found outside of a proper WHILE ENDWHILE.*structure\\.\n.*$") check_cmake_test(While Endwhile-Alone ) set(Endwhile-Alone-Args-RESULT 1) -set(Endwhile-Alone-Args-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?While-Endwhile-Alone-Args.cmake:1 \\(endwhile\\):.*An ENDWHILE command was found outside of a proper WHILE ENDWHILE.*structure\\. Or its arguments did not.*$") +set(Endwhile-Alone-Args-STDERR ".*CMake Error at (${CTEST_ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/)?While-Endwhile-Alone-Args.cmake:1 \\(endwhile\\):.*An ENDWHILE command was found outside of a proper WHILE ENDWHILE.*structure\\. Or its arguments did not.*$") check_cmake_test(While Endwhile-Alone-Args diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt index 2730a61..b5f758b 100644 --- a/Tests/CTestTestMemcheck/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -1,3 +1,5 @@ +REGEX_ESCAPE_STRING(CTEST_ESCAPED_CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") + foreach (_retval 0 1) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret${_retval}.c" "int main(){return ${_retval};}\n") endforeach () @@ -49,7 +51,7 @@ string(REPLACE "+" "\\+" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") foreach (_unkn Unknown UnknownQuoted) set_tests_properties(CTestTestMemcheck${_unkn} PROPERTIES - PASS_REGULAR_EXPRESSION "Do not understand memory checker: ${CMAKE_COMMAND_ESCAPED}\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/${_unkn}/test.cmake\n") + PASS_REGULAR_EXPRESSION "Do not understand memory checker: ${CMAKE_COMMAND_ESCAPED}\n(.*\n)?Error in read script: ${CTEST_ESCAPED_CMAKE_CURRENT_BINARY_DIR}/${_unkn}/test.cmake\n") endforeach () set_tests_properties(CTestTestMemcheckNotExist PROPERTIES @@ -67,7 +69,7 @@ foreach (_pp Pre Post) string(TOLOWER ${_pp} _pp_lower) set_tests_properties(CTestTestMemcheckDummyValgrindFail${_pp} PROPERTIES - PASS_REGULAR_EXPRESSION "\nProblem running command: ${CMAKE_CURRENT_BINARY_DIR}[^\n]*fail[^\n]*\n(.*\n)?Problem executing ${_pp_lower}-memcheck command\\(s\\\).\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyValgrindFail${_pp}/test.cmake\n") + PASS_REGULAR_EXPRESSION "\nProblem running command: ${CTEST_ESCAPED_CMAKE_CURRENT_BINARY_DIR}[^\n]*fail[^\n]*\n(.*\n)?Problem executing ${_pp_lower}-memcheck command\\(s\\\).\n(.*\n)?Error in read script: ${CTEST_ESCAPED_CMAKE_CURRENT_BINARY_DIR}/DummyValgrindFail${_pp}/test.cmake\n") endforeach () set_tests_properties(CTestTestMemcheckDummyValgrindIgnoreMemcheck @@ -75,7 +77,7 @@ set_tests_properties(CTestTestMemcheckDummyValgrindIgnoreMemcheck PASS_REGULAR_EXPRESSION "\n2/2 Test #2: RunCMakeAgain .*\n1/1 MemCheck #1: RunCMake .*${NORMAL_CTEST_OUTPUT}") set_tests_properties(CTestTestMemcheckDummyPurify PROPERTIES - PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CMAKE_CURRENT_BINARY_DIR}/DummyPurify/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyPurify/test.cmake\n") + PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CTEST_ESCAPED_CMAKE_CURRENT_BINARY_DIR}/DummyPurify/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error in read script: ${CTEST_ESCAPED_CMAKE_CURRENT_BINARY_DIR}/DummyPurify/test.cmake\n") set_tests_properties(CTestTestMemcheckDummyBC PROPERTIES - PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CMAKE_CURRENT_BINARY_DIR}/DummyBC/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error parsing XML in stream at line 1: no element found\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyBC/test.cmake\n") + PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CTEST_ESCAPED_CMAKE_CURRENT_BINARY_DIR}/DummyBC/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error parsing XML in stream at line 1: no element found\n(.*\n)?Error in read script: ${CTEST_ESCAPED_CMAKE_CURRENT_BINARY_DIR}/DummyBC/test.cmake\n") diff --git a/Tests/RegexEscapeString.cmake b/Tests/RegexEscapeString.cmake new file mode 100644 index 0000000..92aed17 --- /dev/null +++ b/Tests/RegexEscapeString.cmake @@ -0,0 +1,4 @@ +macro(REGEX_ESCAPE_STRING _OUT _IN) + # Escape special regex metacharacters with a backslash + string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" ${_OUT} "${_IN}") +endmacro() -- cgit v0.12 From 515f9af0d48be569adb51dfb43ff483cfc0d5156 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 3 Jun 2013 13:04:56 -0400 Subject: variable_watch: Remove leftover debugging code (#14187) When a watch does not specify a command to call then variable_watch prints out a message to stderr. Remove code after that which collects all variable values to construct a message that is never printed. Otherwise such code causes a READ_ACCESS watch to trigger on all variables in the currents scope. Reported-by: Yichao Yu --- Source/cmVariableWatchCommand.cxx | 13 ------------- Tests/RunCMake/variable_watch/NoWatcher-stderr.txt | 4 ++++ Tests/RunCMake/variable_watch/NoWatcher.cmake | 8 ++++++++ Tests/RunCMake/variable_watch/RunCMakeTest.cmake | 1 + 4 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 Tests/RunCMake/variable_watch/NoWatcher-stderr.txt create mode 100644 Tests/RunCMake/variable_watch/NoWatcher.cmake diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx index a432943..8532930 100644 --- a/Source/cmVariableWatchCommand.cxx +++ b/Source/cmVariableWatchCommand.cxx @@ -122,19 +122,6 @@ void cmVariableWatchCommand::VariableAccessed(const std::string& variable, msg << " The value of the variable: \"" << newValue << "\"" << std::endl; msg << " The list file stack: " << stack.c_str(); cmSystemTools::Message(msg.str().c_str()); - std::vector vars = makefile->GetDefinitions(); - cmOStringStream msg2; - size_t cc; - for ( cc = 0; cc < vars.size(); cc ++ ) - { - if ( vars[cc] == variable ) - { - continue; - } - msg2 << vars[cc] << " = \"" - << makefile->GetDefinition(vars[cc].c_str()) << "\"" << std::endl; - } - //cmSystemTools::Message(msg2.str().c_str()); } this->InCallback = false; } diff --git a/Tests/RunCMake/variable_watch/NoWatcher-stderr.txt b/Tests/RunCMake/variable_watch/NoWatcher-stderr.txt new file mode 100644 index 0000000..95ff73b --- /dev/null +++ b/Tests/RunCMake/variable_watch/NoWatcher-stderr.txt @@ -0,0 +1,4 @@ +my_func +\* Variable "b" was accessed using MODIFIED_ACCESS in: .*/Tests/RunCMake/variable_watch/NoWatcher.cmake + The value of the variable: "" + The list file stack: .*/Tests/RunCMake/variable_watch/CMakeLists.txt;.*/Tests/RunCMake/variable_watch/NoWatcher.cmake$ diff --git a/Tests/RunCMake/variable_watch/NoWatcher.cmake b/Tests/RunCMake/variable_watch/NoWatcher.cmake new file mode 100644 index 0000000..8a68efb --- /dev/null +++ b/Tests/RunCMake/variable_watch/NoWatcher.cmake @@ -0,0 +1,8 @@ +function(my_func) + message("my_func") +endfunction() +variable_watch(a my_func) +set(a "") + +variable_watch(b) +set(b "") diff --git a/Tests/RunCMake/variable_watch/RunCMakeTest.cmake b/Tests/RunCMake/variable_watch/RunCMakeTest.cmake index 1dd7688..8d20476 100644 --- a/Tests/RunCMake/variable_watch/RunCMakeTest.cmake +++ b/Tests/RunCMake/variable_watch/RunCMakeTest.cmake @@ -1,3 +1,4 @@ include(RunCMake) run_cmake(ModifiedAccess) +run_cmake(NoWatcher) -- cgit v0.12 From 647745b3eedd0036d9e745007acd1d9cc460ccab Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 3 Jun 2013 13:19:15 -0400 Subject: variable_watch: Print accesses as "CMake Debug Log" messages Use makefile->IssueMessage() to print the unprocessed watch message in a format consistent with other CMake messages and with a more complete call stack for the access. --- Source/cmVariableWatchCommand.cxx | 8 +++----- Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt | 7 ++++--- Tests/RunCMake/variable_watch/NoWatcher-stderr.txt | 7 ++++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx index 8532930..297a92b 100644 --- a/Source/cmVariableWatchCommand.cxx +++ b/Source/cmVariableWatchCommand.cxx @@ -117,11 +117,9 @@ void cmVariableWatchCommand::VariableAccessed(const std::string& variable, if ( !processed ) { cmOStringStream msg; - msg << "* Variable \"" << variable.c_str() << "\" was accessed using " - << accessString << " in: " << currentListFile << std::endl; - msg << " The value of the variable: \"" << newValue << "\"" << std::endl; - msg << " The list file stack: " << stack.c_str(); - cmSystemTools::Message(msg.str().c_str()); + msg << "Variable \"" << variable.c_str() << "\" was accessed using " + << accessString << " with value \"" << newValue << "\"."; + makefile->IssueMessage(cmake::LOG, msg.str()); } this->InCallback = false; } diff --git a/Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt b/Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt index 3287626..3ff96fc 100644 --- a/Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt +++ b/Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt @@ -1,3 +1,4 @@ -\* Variable "b" was accessed using MODIFIED_ACCESS in: .*/Tests/RunCMake/variable_watch/ModifiedAccess.cmake - The value of the variable: "b" - The list file stack: .*/Tests/RunCMake/variable_watch/CMakeLists.txt;.*/Tests/RunCMake/variable_watch/ModifiedAccess.cmake +CMake Debug Log at ModifiedAccess.cmake:3 \(set\): + Variable "b" was accessed using MODIFIED_ACCESS with value "b". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/variable_watch/NoWatcher-stderr.txt b/Tests/RunCMake/variable_watch/NoWatcher-stderr.txt index 95ff73b..d299429 100644 --- a/Tests/RunCMake/variable_watch/NoWatcher-stderr.txt +++ b/Tests/RunCMake/variable_watch/NoWatcher-stderr.txt @@ -1,4 +1,5 @@ my_func -\* Variable "b" was accessed using MODIFIED_ACCESS in: .*/Tests/RunCMake/variable_watch/NoWatcher.cmake - The value of the variable: "" - The list file stack: .*/Tests/RunCMake/variable_watch/CMakeLists.txt;.*/Tests/RunCMake/variable_watch/NoWatcher.cmake$ +CMake Debug Log at NoWatcher.cmake:8 \(set\): + Variable "b" was accessed using MODIFIED_ACCESS with value "". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ -- cgit v0.12 From 00c3840cc8c36adea76c6e833a9e2069645aec8a Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Tue, 4 Jun 2013 00:01:05 -0400 Subject: CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1230403..e53fb54 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130603) +set(CMake_VERSION_TWEAK 20130604) #set(CMake_VERSION_RC 1) -- cgit v0.12 From a984f3257e95f29a72da6566859d4c6a8a5d749b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 4 Jun 2013 10:30:24 +0200 Subject: Introduce add_compile_options command. This command is similar to add_definitions, in that it affects the compile options of all targets which follow it. The implementation is similar to the implementation of the include_directories command, in that it is based on populating a COMPILE_OPTIONS directory property and using that to initialize the same property on targets. Unlike the include_directories command however, the add_compile_options command does not affect previously defined targets. That is, in the following code, foo will not be compiled with -Wall, but bar will be: add_library(foo ...) add_compile_options(-Wall) add_library(bar ...) --- Source/cmAddCompileOptionsCommand.cxx | 28 +++++++++ Source/cmAddCompileOptionsCommand.h | 72 ++++++++++++++++++++++ Source/cmCommands.cxx | 2 + Source/cmMakefile.cxx | 60 ++++++++++++++++++ Source/cmMakefile.h | 6 ++ Source/cmTarget.cxx | 10 ++- .../add_compile_options/CMakeLists.txt | 14 +++++ Tests/CMakeCommands/add_compile_options/main.cpp | 11 ++++ 8 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 Source/cmAddCompileOptionsCommand.cxx create mode 100644 Source/cmAddCompileOptionsCommand.h create mode 100644 Tests/CMakeCommands/add_compile_options/CMakeLists.txt create mode 100644 Tests/CMakeCommands/add_compile_options/main.cpp diff --git a/Source/cmAddCompileOptionsCommand.cxx b/Source/cmAddCompileOptionsCommand.cxx new file mode 100644 index 0000000..a6c3c00 --- /dev/null +++ b/Source/cmAddCompileOptionsCommand.cxx @@ -0,0 +1,28 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2013 Stephen Kelly + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#include "cmAddCompileOptionsCommand.h" + +bool cmAddCompileOptionsCommand +::InitialPass(std::vector const& args, cmExecutionStatus &) +{ + if(args.size() < 1 ) + { + return true; + } + + for(std::vector::const_iterator i = args.begin(); + i != args.end(); ++i) + { + this->Makefile->AddCompileOption(i->c_str()); + } + return true; +} diff --git a/Source/cmAddCompileOptionsCommand.h b/Source/cmAddCompileOptionsCommand.h new file mode 100644 index 0000000..4504795 --- /dev/null +++ b/Source/cmAddCompileOptionsCommand.h @@ -0,0 +1,72 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2013 Stephen Kelly + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#ifndef cmAddCompileOptionsCommand_h +#define cmAddCompileOptionsCommand_h + +#include "cmCommand.h" +#include "cmDocumentGeneratorExpressions.h" + +class cmAddCompileOptionsCommand : public cmCommand +{ +public: + /** + * This is a virtual constructor for the command. + */ + virtual cmCommand* Clone() + { + return new cmAddCompileOptionsCommand; + } + + /** + * This is called when the command is first encountered in + * the CMakeLists.txt file. + */ + virtual bool InitialPass(std::vector const& args, + cmExecutionStatus &status); + + /** + * The name of the command as specified in CMakeList.txt. + */ + virtual const char* GetName() const {return "add_compile_options";} + + /** + * Succinct documentation. + */ + virtual const char* GetTerseDocumentation() const + { + return "Adds options to the compilation of source files."; + } + + /** + * More documentation. + */ + virtual const char* GetFullDocumentation() const + { + return + " add_compile_options(